diff --git a/snapshots/master/demos/android/energy-monitor.apk b/snapshots/master/demos/android/energy-monitor.apk index b81643fac..118d707f7 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 57d92b9c9..350707931 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.js b/snapshots/master/demos/carousel/pkg/carousel.js index 96cf4bb30..b42d14fc5 100644 --- a/snapshots/master/demos/carousel/pkg/carousel.js +++ b/snapshots/master/demos/carousel/pkg/carousel.js @@ -1650,43 +1650,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 138, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4367 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4368 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5595 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5596 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5628 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5629 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5646 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5647 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __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, 391, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5673 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5674 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5679 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5680 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __wbg_adapter_37); 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, 391, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5728 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5729 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5739 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5740 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 391, __wbg_adapter_37); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/carousel/pkg/carousel_bg.wasm b/snapshots/master/demos/carousel/pkg/carousel_bg.wasm index e267a8499..3bd2cbba2 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/energy-monitor/pkg/energy_monitor.js b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js index a2a1bf712..05680d80c 100644 --- a/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js +++ b/snapshots/master/demos/energy-monitor/pkg/energy_monitor.js @@ -1684,63 +1684,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7779 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7780 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7781 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7782 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7783 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7784 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7785 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7786 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7787 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7788 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3450, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9348 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9349 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9350 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9351 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9356 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9357 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9360 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9361 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9364 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9365 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9366 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9367 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9370 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9371 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9372 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9373 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9378 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9379 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3999, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10052 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10053 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 4045, __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 3ec0bef18..fb8bfa9a2 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/gallery/pkg/cosmic/gallery.js b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js index 794109e4b..3954dcb93 100644 --- a/snapshots/master/demos/gallery/pkg/cosmic/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cosmic/gallery.js @@ -1646,63 +1646,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper6907 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6904 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3289, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6909 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6906 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3289, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6910 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6907 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3289, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6911 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6908 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3289, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6912 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6909 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3289, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10131 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10129 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11359 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11357 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11392 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11390 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11410 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11408 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11432 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11430 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11437 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11435 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11443 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11441 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11461 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11459 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11492 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11490 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11503 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11501 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3540, __wbg_adapter_37); 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 edf744440..c44d1c309 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/cupertino/gallery.js b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js index a403b0451..da94b6afb 100644 --- a/snapshots/master/demos/gallery/pkg/cupertino/gallery.js +++ b/snapshots/master/demos/gallery/pkg/cupertino/gallery.js @@ -1646,63 +1646,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper6621 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6619 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3077, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6623 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6621 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3077, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6624 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6622 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3077, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6625 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6623 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3077, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6626 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6624 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 3077, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9848 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9847 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11076 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11075 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11109 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11108 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11127 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11126 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11149 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11148 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11154 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11153 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11160 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11159 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11178 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11177 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11209 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11208 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11220 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper11219 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 3328, __wbg_adapter_37); 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 efe735a0c..1f95eab8a 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/fluent/gallery.js b/snapshots/master/demos/gallery/pkg/fluent/gallery.js index 03bb06b2c..902866dff 100644 --- a/snapshots/master/demos/gallery/pkg/fluent/gallery.js +++ b/snapshots/master/demos/gallery/pkg/fluent/gallery.js @@ -1646,63 +1646,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper5727 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5725 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2612, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5729 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5727 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2612, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5730 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5728 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2612, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5731 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5729 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2612, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5732 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5730 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2612, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8950 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper8949 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10178 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10177 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10211 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10210 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10229 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10228 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10251 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10250 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10256 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10255 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10262 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10261 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10280 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10279 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10311 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10310 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10322 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper10321 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2863, __wbg_adapter_37); 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 ba1b3f251..06b0c2176 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/material/gallery.js b/snapshots/master/demos/gallery/pkg/material/gallery.js index 43a982810..964077c7f 100644 --- a/snapshots/master/demos/gallery/pkg/material/gallery.js +++ b/snapshots/master/demos/gallery/pkg/material/gallery.js @@ -1646,63 +1646,63 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper5178 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5176 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2448, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5180 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5178 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2448, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5181 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5179 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2448, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5182 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5180 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2448, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5183 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5181 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2448, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper8409 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper8408 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9637 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9636 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9670 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9669 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9688 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9687 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9710 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9709 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9715 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9714 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9721 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9720 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9739 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9738 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9770 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9769 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9781 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper9780 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2699, __wbg_adapter_37); 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 1813ceba3..be2b8ebcc 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/imagefilter/pkg/imagefilter.js b/snapshots/master/demos/imagefilter/pkg/imagefilter.js index 62a8c670c..42b5ab86f 100644 --- a/snapshots/master/demos/imagefilter/pkg/imagefilter.js +++ b/snapshots/master/demos/imagefilter/pkg/imagefilter.js @@ -1630,23 +1630,23 @@ function __wbg_get_imports() { const ret = getObject(arg0).visibilityState; return {"hidden":0,"visible":1,}[ret] ?? 2; }; - imports.wbg.__wbindgen_closure_wrapper1289 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1288 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 268, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1291 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1290 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 268, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1292 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1291 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 268, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1293 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1292 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 268, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper1294 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper1293 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 268, __wbg_adapter_26); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm b/snapshots/master/demos/imagefilter/pkg/imagefilter_bg.wasm index a11cbcbf4..70bb6ceef 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/memory/pkg/memory.js b/snapshots/master/demos/memory/pkg/memory.js index 30200b4dd..aebaa1b5a 100644 --- a/snapshots/master/demos/memory/pkg/memory.js +++ b/snapshots/master/demos/memory/pkg/memory.js @@ -1707,43 +1707,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 103, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4354 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4355 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 364, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5582 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5583 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 364, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5615 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5616 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 364, __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, 364, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5655 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5656 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 364, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5660 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5661 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 364, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5666 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5667 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 364, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5684 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5685 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 364, __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, 364, __wbg_adapter_59); 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, 364, __wbg_adapter_41); return addHeapObject(ret); }; diff --git a/snapshots/master/demos/memory/pkg/memory_bg.wasm b/snapshots/master/demos/memory/pkg/memory_bg.wasm index b9dba83d1..ae92a38a7 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/opengl_underlay/pkg/opengl_underlay.js b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js index d92eec490..a8611f467 100644 --- a/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js +++ b/snapshots/master/demos/opengl_underlay/pkg/opengl_underlay.js @@ -1663,43 +1663,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 161, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4459 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4460 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5687 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5688 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5720 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5721 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5738 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5739 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5760 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5761 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5765 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5766 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5771 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5772 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5789 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5790 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5820 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5821 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5831 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5832 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_37); 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 5a2ba15f9..209e964cd 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/plotter/pkg/plotter.js b/snapshots/master/demos/plotter/pkg/plotter.js index 47f59193c..12d691f68 100644 --- a/snapshots/master/demos/plotter/pkg/plotter.js +++ b/snapshots/master/demos/plotter/pkg/plotter.js @@ -1630,23 +1630,23 @@ function __wbg_get_imports() { return {"hidden":0,"visible":1,}[ret] ?? 2; }; imports.wbg.__wbindgen_closure_wrapper992 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); + const ret = makeClosure(arg0, arg1, 132, __wbg_adapter_26); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper994 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); + const ret = makeClosure(arg0, arg1, 132, __wbg_adapter_26); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper995 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); + const ret = makeClosure(arg0, arg1, 132, __wbg_adapter_26); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper996 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); + const ret = makeClosure(arg0, arg1, 132, __wbg_adapter_26); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper997 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 131, __wbg_adapter_26); + const ret = makeClosure(arg0, arg1, 132, __wbg_adapter_26); return addHeapObject(ret); }; imports.wbg.__wbindgen_closure_wrapper3550 = function(arg0, arg1, arg2) { diff --git a/snapshots/master/demos/plotter/pkg/plotter_bg.wasm b/snapshots/master/demos/plotter/pkg/plotter_bg.wasm index 6b19c23a5..e9a717899 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/printerdemo/pkg/printerdemo_lib.js b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js index b761f74fd..28f8c2e1c 100644 --- a/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js +++ b/snapshots/master/demos/printerdemo/pkg/printerdemo_lib.js @@ -1668,63 +1668,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4478 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4479 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2061, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4480 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4481 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2061, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4482 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4483 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2061, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4484 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4485 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2061, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4486 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4487 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2061, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6048 = 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_wrapper6050 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6051 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6056 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6057 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6060 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6061 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6064 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6065 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6066 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6067 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6070 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6071 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6072 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6073 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6078 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6079 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2610, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6752 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6753 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2656, __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 df3bcafed..da8a465f2 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_old/pkg/printerdemo_old.js b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js index 809532a28..fd50b7f26 100644 --- a/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js +++ b/snapshots/master/demos/printerdemo_old/pkg/printerdemo_old.js @@ -1649,43 +1649,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 631, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5360 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5361 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6588 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6589 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6621 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6622 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6639 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6640 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6661 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6662 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6666 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6667 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6672 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6673 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6690 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6691 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6721 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6722 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_55); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6732 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6733 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 891, __wbg_adapter_37); 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 d938199b8..0f1dd60f7 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/slide_puzzle/pkg/slide_puzzle.js b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js index e45aef750..922a08fea 100644 --- a/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js +++ b/snapshots/master/demos/slide_puzzle/pkg/slide_puzzle.js @@ -1707,43 +1707,43 @@ function __wbg_get_imports() { const ret = makeClosure(arg0, arg1, 277, __wbg_adapter_30); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4794 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4795 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6031 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6032 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_44); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6069 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6070 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6074 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6075 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6079 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6080 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6117 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6118 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6124 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6125 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6129 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6130 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6138 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6139 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __wbg_adapter_41); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6174 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6175 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 535, __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 4a67b11c5..7c4f7fcd2 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/todo-mvc/pkg/todo_lib_mvc.js b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js index 431e75c1d..8a9483bab 100644 --- a/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js +++ b/snapshots/master/demos/todo-mvc/pkg/todo_lib_mvc.js @@ -1684,63 +1684,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5098 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5097 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2189, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5100 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5099 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2189, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5102 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5101 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2189, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5104 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5103 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2189, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper5106 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper5105 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 2189, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6668 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6667 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6670 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6669 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6676 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6675 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6680 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6679 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6684 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6683 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6686 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6685 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6690 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6689 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6692 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6691 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6698 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6697 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2738, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7372 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7371 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2784, __wbg_adapter_58); return addHeapObject(ret); }; 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 2d31b6e01..f1d3e2924 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/pkg/todo_lib_bg.wasm b/snapshots/master/demos/todo/pkg/todo_lib_bg.wasm index a1af1d9a9..949ba60f2 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/weather-demo/pkg/weather_demo.js b/snapshots/master/demos/weather-demo/pkg/weather_demo.js index b05183d83..98e0494d2 100644 --- a/snapshots/master/demos/weather-demo/pkg/weather_demo.js +++ b/snapshots/master/demos/weather-demo/pkg/weather_demo.js @@ -1699,63 +1699,63 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4789 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4790 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1901, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4791 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4792 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1901, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4793 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4794 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1901, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4795 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4796 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1901, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper4797 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper4798 = function(arg0, arg1, arg2) { const ret = makeClosure(arg0, arg1, 1901, __wbg_adapter_26); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6361 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6362 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6363 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6364 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6369 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6370 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6373 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6374 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6377 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6378 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6379 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6380 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_49); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6383 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6384 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6385 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6386 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper6391 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper6392 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2449, __wbg_adapter_40); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper7065 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper7066 = function(arg0, arg1, arg2) { const ret = makeMutClosure(arg0, arg1, 2495, __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 a9b480cd0..e1b081161 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/docs/cpp/api/library_root.html b/snapshots/master/docs/cpp/api/library_root.html index f6175b3bf..9903cc9a5 100644 --- a/snapshots/master/docs/cpp/api/library_root.html +++ b/snapshots/master/docs/cpp/api/library_root.html @@ -436,7 +436,7 @@

Class Hierarchy
  • diff --git a/snapshots/master/docs/cpp/searchindex.js b/snapshots/master/docs/cpp/searchindex.js index d5c9b6c76..384bd390f 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", "mcu/esp-idf/troubleshoot", "mcu/esp_idf", "mcu/generic", "mcu/intro", "mcu/stm32", "mcu/stm32/generic", "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", "mcu/esp-idf/troubleshoot.md", "mcu/esp_idf.md", "mcu/generic.md", "mcu/intro.md", "mcu/stm32.md", "mcu/stm32/generic.md", "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", "Troubleshooting", "Espressif\u2019s IoT Development Framework", "Generic MCU Environment Setup", "Introduction", "STMicroelectronics\u2019 STM32Cube Ecosystem", "Generic Instructions for Slint on STM32 MCUs", "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, 233, 234, 240], "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, 235, 238, 239, 240], "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, 234, 238], "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, 235, 236, 237, 239, 240], "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, 235, 236, 237, 238, 239, 240], "declar": [0, 13, 14, 109, 142, 164, 229, 231, 239, 240], "how": [0, 20, 103, 157, 227, 231, 232, 233, 234, 236, 238, 239], "fill": [0, 20, 133, 136], "outlin": [0, 238], "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, 235, 238], "text": [0, 10, 17, 22, 48, 110, 127, 129, 130, 132, 133, 136, 142, 161, 231, 232, 233, 234, 238], "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, 235, 237, 240], "either": [0, 13, 14, 21, 22, 163, 165, 166, 227, 233, 237, 239], "solid": 0, "color": [0, 46, 61, 102, 103, 113, 115, 121, 128, 131, 135, 136, 141, 142, 147, 156, 167, 231, 232, 239, 240], "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, 233, 240], "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, 238, 239], "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, 234, 238, 239], "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, 240], "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, 238], "If": [0, 4, 6, 7, 8, 9, 10, 17, 21, 22, 102, 148, 156, 158, 162, 165, 166, 170, 171, 227, 228, 229, 233, 234, 235, 237], "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, 235, 236, 238, 239, 240], "first": [0, 7, 13, 20, 113, 122, 157, 158, 159, 227, 231, 233, 239], "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, 240], "factor": [0, 1, 10, 21, 113, 115, 127, 131, 240], "version": [0, 1, 26, 29, 35, 38, 98, 99, 227, 231, 235, 238], "ha": [0, 1, 4, 5, 6, 8, 10, 13, 14, 21, 53, 109, 148, 158, 159, 162, 167, 231, 234, 239], "bright": [0, 1, 234], "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, 235], "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, 233, 238], "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, 235, 238, 239, 240], "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, 148, 155, 156, 240], "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, 235, 236, 238, 239], "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, 234, 235, 238, 239], "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, 240], "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, 237, 238, 239, 240], "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, 240], "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, 234], "equal": [0, 14, 112, 122, 153, 157, 158, 159, 160, 165, 228], "hold": [0, 13, 14, 21, 159, 165, 166, 239], "must": [0, 10, 13, 17, 20, 21, 22, 95, 99, 107, 127, 148, 157, 229, 235], "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, 233], "differ": [0, 10, 13, 14, 17, 20, 46, 48, 49, 50, 53, 99, 105, 148, 227, 232, 233, 235, 237, 239], "what": [0, 17, 111, 136, 235], "thei": [0, 153, 156, 157, 160], "respect": [0, 235], "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, 236, 239, 240], "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, 239], "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, 240], "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, 236, 237, 240], "run": [1, 13, 17, 18, 21, 51, 98, 99, 102, 109, 110, 126, 158, 159, 162, 227, 228, 229, 231, 233, 234, 235, 237, 238, 240], "time": [1, 21, 102, 158, 159, 162, 227, 228, 231, 233, 238, 240], "8": [1, 115, 138, 142, 158, 167, 240], "bit": [1, 167, 240], "channel": [1, 148, 233], "red": [1, 110, 115, 131, 148, 154, 155, 156, 167], "green": [1, 110, 115, 131, 148, 154, 155, 156, 167], "blue": [1, 110, 115, 131, 148, 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, 233, 234, 235, 240], "entir": [1, 240], "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, 234, 237, 238, 239], "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, 240], "to_argb_uint": [1, 115], "convert": [1, 5, 10, 22, 106, 149, 150, 151, 152, 158, 165, 167, 228, 233, 240], "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, 235, 236, 238, 239, 240], "easi": [1, 239], "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, 162, 167, 227, 228, 229, 231, 238], "255": [1, 115, 142, 154, 155, 156, 167], "multipli": [1, 148, 240], "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, 239, 240], "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, 235], "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, 234, 238, 239, 240], "result": [1, 22, 99, 109, 111, 112, 113, 114, 115, 117, 121, 128, 135, 136, 139, 158, 167, 228], "back": [1, 9, 50, 53, 97, 132, 227, 229, 234], "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, 234, 235, 237, 238, 239, 240], "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, 235, 236], "5": [1, 26, 29, 35, 38, 110, 135, 138, 142, 158, 167], "50": [1, 142], "divid": [1, 236], "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, 235, 237], "30": [1, 142], "obtain": [1, 148], "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, 236], "clamp": 1, "between": [1, 10, 20, 21, 147, 148, 154, 155, 156, 167, 233, 234, 235, 237], "appli": [1, 4, 5, 8, 20, 48, 114, 133, 239], "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, 234, 235], "from_argb_encod": [1, 113, 115], "argb_encod": [1, 115], "integ": [1, 158, 240], "0xaarrggbb": 1, "from_argb_uint8": [1, 115], "paramet": [1, 5, 10, 13, 20, 51, 53, 100, 156, 229, 231, 239], "from_rgb_uint8": [1, 115], "have": [1, 10, 19, 20, 21, 22, 110, 112, 136, 148, 157, 165, 170, 171, 227, 229, 232, 233, 234, 235, 239], "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, 234, 237, 238], "compon": [1, 2, 3, 10, 11, 12, 13, 22, 109, 111, 115, 125, 127, 136, 147, 156, 167, 228, 229, 231, 232, 234, 238, 239], "hue": [1, 115, 147], "expect": [1, 233], "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, 240], "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, 234, 238, 239, 240], "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, 235], "refer": [1, 3, 10, 13, 21, 110, 148, 157, 158, 159, 165, 166, 227, 229, 234, 235, 237, 238, 240], "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, 235, 239], "handl": [2, 3, 12, 16, 17, 20, 21, 22, 112, 121, 127, 136, 140, 141, 231, 235, 239], "like": [2, 13, 20, 48, 99, 168, 227, 229, 231, 234, 235], "share": [2, 10, 12, 148, 157, 158, 159, 235], "pointer": [2, 10, 16, 50, 110, 133, 148, 157, 158, 159, 229, 239], "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, 236, 237, 239, 240], "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, 237, 238, 239, 240], "In": [2, 13, 15, 21, 112, 227, 232, 238], "order": [2, 8, 13, 100, 112, 136, 162, 165, 166, 233, 240], "get": [2, 109, 112, 121, 167, 227, 235, 237, 238, 239], "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, 234, 238, 239], "where": [2, 15, 163, 235, 239], "name": [2, 12, 13, 22, 109, 138, 164, 165, 166, 227, 228, 229, 231, 238, 240], "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, 234, 235, 238, 239], "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, 235, 239, 240], "componenthandl": [3, 12, 22, 58, 102, 103, 109, 111, 112, 229, 239], "null": [3, 13, 158, 162, 234], "lock": [3, 98, 112, 127], "alwai": [3, 20, 158, 240], "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, 238], "option": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 21, 22, 55, 57, 58, 93, 107, 109, 110, 111, 112, 117, 127, 136, 148, 165, 170, 171, 227, 228, 235, 238, 239], "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, 239, 240], "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, 236, 240], "model": [4, 5, 7, 8, 9, 14, 46, 58, 102, 103, 109, 112, 137, 138, 229, 239], "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, 234, 237, 238, 239], "filter": [4, 5, 8], "each": [4, 5, 8, 20, 22, 94, 106, 229, 236, 240], "row": [4, 5, 6, 7, 8, 9, 109, 112, 138], "accept": [4, 14, 22, 133, 136, 229, 233], "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, 239], "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, 234, 235, 236, 237, 239], "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, 124, 127, 158, 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, 234], "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, 239, 240], "particular": [4, 5, 6, 7, 8, 9, 227, 235], "should": [4, 5, 6, 7, 8, 9, 10, 13, 14, 17, 18, 21, 94, 96, 112, 121, 127, 170, 171, 227, 228, 234, 235], "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, 234, 238], "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, 233], "cannot": [4, 6, 7, 8, 9, 122, 148, 159, 162], "support": [4, 6, 7, 8, 9, 17, 49, 105, 112, 122, 227, 234, 235, 236, 238], "chang": [4, 5, 6, 7, 8, 9, 10, 20, 21, 101, 107, 142, 159, 165, 166, 231, 234, 239], "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, 233, 234, 235], "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, 234, 238], "int": [4, 8, 13, 14, 16, 46, 98, 99, 109, 110, 112, 113, 121, 125, 136, 140, 141, 142, 144, 148, 229, 231, 240], "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, 234, 235, 237, 239], "allow": [5, 10, 54, 104, 229, 233, 239], "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, 235, 237, 240], "number": [5, 14, 16, 20, 46, 109, 125, 133, 137, 158, 159, 163, 239], "string": [5, 11, 12, 13, 14, 29, 46, 98, 101, 136, 137, 140, 158, 229, 239, 240], "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, 239], "element": [6, 8, 10, 14, 21, 22, 48, 111, 119, 136, 139, 145, 148, 159, 170, 229, 231, 232, 239], "languag": [6, 101, 112, 227, 229, 231, 234, 235, 237, 238, 239], "subclass": [6, 15, 21, 105, 239], "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, 240], "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, 233], "row_ad": [6, 109, 112], "count": [6, 10, 109, 110, 112, 119, 126, 136, 138, 139, 157, 240], "were": [6, 11, 20, 21], "ad": [6, 238], "row_remov": [6, 109, 112], "remov": [6, 9, 159, 234], "been": [6, 21, 22, 53, 162, 165, 234], "everyth": [6, 16], "need": [6, 17, 18, 20, 21, 53, 102, 104, 115, 122, 227, 229, 231, 233, 234, 235, 238, 239], "reload": 6, "reserv": [7, 112], "mean": [7, 100, 109], "last": [7, 10, 11, 20, 21, 51, 100, 122, 158, 159], "second": [7, 20, 239], "revers": [7, 133], "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, 234], "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, 238], "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, 234, 235, 236, 237, 239], "render": [10, 15, 17, 19, 20, 21, 49, 52, 53, 94, 100, 105, 110, 136, 148, 157, 168, 227, 228, 229, 234, 235, 237, 238], "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, 234, 237, 239], "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, 234, 235, 237, 239], "control": [10, 13, 78, 97, 102, 106, 130, 132, 227, 233], "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, 234, 237, 238], "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, 238, 239], "explicitli": [10, 149, 150, 151, 152], "one": [10, 13, 14, 15, 48, 98, 105, 112, 127, 148, 158, 165, 166, 227, 228, 229, 239], "becom": [10, 21, 112, 165, 166], "hidden": [10, 13, 21, 54], "show": [10, 13, 21, 104, 109, 127, 227, 229, 231, 234], "addit": [10, 227, 234, 235], "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, 235, 238, 239], "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, 235, 236], "is_vis": [10, 127, 138], "even": [10, 51, 239], "previous": [10, 20, 162], "user": [10, 21, 54, 100, 229, 232, 239, 240], "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, 237, 239], "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, 237, 239], "regist": [10, 13, 49, 95, 112, 229], "invok": [10, 12, 13, 17, 18, 20, 21, 22, 98, 109, 110, 162, 227, 238], "dure": [10, 11, 148, 227], "phase": 10, "custom": [10, 105, 229], "top": [10, 117, 133, 135, 148], "below": [10, 237], "callabl": [10, 22], "argument": [10, 11, 13, 112, 136, 148, 227, 228, 229], "On": [10, 112, 231, 234], "success": [10, 238], "without": [10, 46, 105, 148, 165, 227, 235], "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, 233], "request": [10, 13, 21, 54], "redraw": [10, 20], "content": [10, 148, 159, 161, 229, 233, 234, 238], "physicalposit": [10, 20, 21, 66, 102, 103, 110, 120, 127, 168, 169], "physic": [10, 20, 21, 151, 152, 228, 240], "coordin": [10, 20, 21, 119, 148, 149, 151, 153, 240], "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, 234, 237, 238], "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, 240], "po": [10, 110, 127, 136], "note": [10, 13, 14, 16, 21, 110, 112, 165, 166, 227, 229, 231, 235, 240], "some": [10, 11, 125, 136, 231, 234], "wayland": [10, 16, 227], "avail": [10, 13, 101, 103, 109, 148, 227, 229, 233, 234, 239], "physicals": [10, 19, 20, 21, 69, 102, 103, 110, 123, 127, 168, 169, 234], "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, 158, 159, 168, 169, 170, 171, 227, 234, 238, 240], "exclud": [10, 21, 158, 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, 240], "pixel": [10, 20, 21, 110, 117, 133, 135, 148, 149, 150, 151, 152, 154, 155, 157, 167, 228, 233, 235, 240], "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, 233, 234, 235, 237], "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, 239, 240], "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, 234, 238, 239], "your": [10, 14, 20, 21, 105, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239], "own": [10, 105, 110, 227, 229, 236, 239], "backend": [10, 13, 49, 96, 105, 136, 142, 235], "want": [10, 104, 148, 165, 166, 227, 228, 231], "forward": [10, 21, 50, 109, 112, 127, 132, 235], "input": [10, 13, 21, 94, 100, 229, 235, 237], "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, 234, 238], "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, 238], "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, 240], "dispatch_pointer_release_ev": [10, 127], "dispatch_pointer_exit_ev": [10, 127], "exit": [10, 17, 127, 136], "trigger": [10, 97, 239], "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, 240], "y": [10, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 231, 232, 240], "direct": [10, 14, 21, 136], "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, 238], "height": [10, 21, 110, 111, 112, 117, 123, 127, 135, 136, 142, 148, 157, 160, 231, 232, 238], "root": [10, 145, 229], "properli": 10, "dispatch_scale_factor_change_ev": [10, 21, 127], "happen": 10, "resolut": 10, "select": [10, 17, 227, 234, 235, 237, 238], "platform": [10, 15, 16, 19, 20, 21, 43, 78, 96, 102, 103, 108, 127, 132, 167, 168, 169, 170, 171, 172, 234, 235, 237, 238], "right": [10, 20, 50, 117, 132, 133, 135, 148, 234], "initi": [10, 19, 21, 53, 97, 110, 157, 159, 165, 234, 238], "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, 234, 235], "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, 239], "load": [11, 102, 103, 104, 148, 228, 239], "compil": [11, 12, 13, 17, 101, 104, 109, 112, 138, 228, 229, 231, 232, 234, 236, 238, 240], "them": [11, 20, 22, 104, 165, 168, 169, 227, 233, 238, 239], "build_from_sourc": [11, 12, 104, 109], "set_include_path": [11, 109], "look": [11, 231, 233, 234, 235], "up": [11, 20, 98, 133, 228, 231, 234, 239], "import": [11, 105, 148, 228, 234, 238], "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, 240], "style": [11, 109, 138], "widget": [11, 48, 234, 237, 238], "set_translation_domain": [11, 109], "domain": [11, 109, 112, 136], "translat": [11, 101, 112, 231, 239, 240], "include_path": [11, 109], "configur": [11, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 227, 228, 233, 234, 235, 237], "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, 239], "source_cod": [11, 109, 138], "collect": [11, 98], "retriev": [11, 237], "previou": [11, 20, 112, 229], "comput": 11, "self": [11, 109, 110, 162], "markup": [12, 227, 229, 235, 240], "componentcompil": [12, 55, 102, 104, 109, 138, 163, 239], "And": 12, "instanti": [12, 229, 234, 238, 239], "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, 239], "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, 239], "export": [12, 13, 22, 229, 231, 232, 234, 238, 239, 240], "singleton": [12, 13, 239], "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, 234], "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, 238], "dyn": [13, 109, 136], "access": [13, 14, 21, 22, 48, 52, 96, 102, 165, 166, 170, 229, 239], "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, 238, 240], "shown": [13, 21, 54, 98, 170, 239], "react": [13, 100, 229, 239], "draw": [13, 148, 234], "touch": [13, 234, 235, 237, 238], "necessari": [13, 16, 100, 227], "spin": [13, 17, 229, 231], "loop": [13, 17, 18, 21, 51, 94, 97, 98, 99, 100, 110, 229, 231, 234, 238], "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, 235, 237, 238, 239], "conveni": [13, 14, 158, 162, 165, 166, 227, 229, 231, 235], "follow": [13, 98, 99, 102, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239, 240], "qwidget": [13, 109, 142], "qt": [13, 142, 227], "graphic": [13, 52, 53, 232], "mai": [13, 20, 21, 49, 148, 168, 233, 234], "nullptr": [13, 109, 110, 112, 121, 142], "runtim": [13, 17, 101, 104, 110, 165, 227], "hello": [13, 229, 231, 232, 234, 235, 238], "we": [13, 110, 112, 115, 122, 136, 227, 229, 231, 233, 235, 237], "world": [13, 231, 232, 234, 235, 238], "correctli": 13, "could": [13, 233, 235], "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, 239], "foo": [13, 14, 22, 109, 240], "Then": [13, 14, 96, 227], "42": [13, 14, 142, 158], "don": [13, 109, 136, 233], "match": [13, 22, 112, 227, 234, 237, 238], "which": [13, 20, 21, 100, 104, 112, 120, 123, 162, 165, 166, 227, 228, 229, 232, 235, 239], "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, 239], "prop_nam": [13, 109], "within": [13, 14, 22, 98, 102, 163, 227], "main": [13, 97, 98, 99, 100, 127, 228, 229, 231, 234, 238], "theglob": 13, "doe": [13, 16, 21, 22, 49, 162, 165], "correct": [13, 227], "get_global_properti": [13, 109, 239], "set_global_callback": [13, 109, 239], "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, 233], "toupper": [13, 229], "invoke_glob": [13, 109], "callable_nam": [13, 109, 138], "definit": [13, 109, 172], "dynam": [14, 102, 239], "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, 234, 235, 237, 239], "overload": [14, 21, 112], "to_xxx": 14, "possibl": [14, 158, 227, 239], "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, 234, 235, 236, 237, 238, 239, 240], "store": [14, 17, 113, 147, 156, 157], "sometyp": 14, "object": [14, 22, 46, 148, 240], "liter": 14, "bar": [14, 22, 48, 240], "my_prop": 14, "Such": 14, "doubl": [14, 20, 22, 109, 124, 125, 136, 138, 144, 158, 237], "some_valu": 14, "check": [14, 22, 111, 136, 142, 165, 166, 227, 231, 232, 234, 235, 237], "string_valu": 14, "do_someth": [14, 99], "extract": [14, 165, 166, 237, 238], "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, 240], "to_brush": [14, 109], "to_struct": [14, 109, 165], "imag": [14, 46, 63, 102, 103, 109, 117, 135, 136, 137, 138, 142, 157, 228, 235, 238, 240], "to_imag": [14, 109], "str": [14, 109, 112, 117, 124, 125, 138, 158, 229], "boolean": 14, "m": [14, 109, 112, 136, 235], "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, 239], "windowadapt": [15, 17, 20, 56, 102, 105, 108, 110, 171], "intend": [15, 22], "place": [15, 238], "requir": [15, 109, 110, 111, 112, 127, 227, 228, 233, 234, 238, 239], "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, 234], "server": 16, "kind": [16, 109, 130, 136, 239], "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, 239], "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, 50, 56, 102, 105, 110, 234], "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, 239], "unique_ptr": [17, 95, 110, 142], "chrono": [17, 58, 72, 93, 110, 112, 126, 162], "millisecond": [17, 93, 110, 126, 162, 240], "duration_since_start": [17, 110, 140], "start": [17, 20, 98, 99, 102, 126, 133, 136, 158, 162, 163, 227, 229, 234, 235, 237, 238], "applic": [17, 49, 95, 105, 148, 227, 228, 231, 232, 233, 237, 239], "slint_feature_freestand": [17, 80, 102, 110, 112, 117, 127, 134], "doesn": [17, 109, 112], "nullopt": [17, 21, 22, 110, 111, 112, 148], "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, 235], "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, 235, 239], "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, 228, 235, 237, 238], "To": [20, 107, 227, 235, 237, 239], "buffer": [20, 21, 53, 110, 117, 135, 140, 148, 157, 234, 237], "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, 233], "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, 234, 235, 239], "larg": 20, "stride": 20, "line": [20, 110, 125, 133, 137, 163, 227, 232, 235], "rgb565pixel": [20, 56, 102, 105, 110, 234], "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, "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, 233, 236, 238], "compos": [20, 168, 232], "multipl": [20, 49, 168, 227, 228, 229], "sub": [20, 168, 227, 229, 236, 239], "bounding_box_s": [20, 110, 168], "bound": [20, 168], "box": [20, 109, 138, 168, 234, 235], "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, 240], "windowproperti": [21, 56, 102, 105, 108, 110, 140], "layoutconstraint": [21, 56, 102, 105, 110, 170], "base": [21, 22, 46, 102, 111, 136, 234, 238], "layer": [21, 136], "win32": [21, 231], "wayland_surface_t": 21, "establish": 21, "link": [21, 112, 231, 238], "both": [21, 165, 166, 227], "about": [21, 53, 125, 227, 228, 231, 234, 235, 237], "being": [21, 115, 148], "etc": [21, 22, 239], "dispatch_mouse_press_ev": 21, "via": [21, 148, 229, 237, 238], "set_vis": [21, 110, 140], "update_window_properti": [21, 110, 140, 170], "deleg": 21, "bi": 21, "protocol": [21, 165, 166], "incomplet": 21, "experi": [21, 238], "unexpect": 21, "behavior": [21, 100, 148], "intent": 21, "develop": [21, 26, 29, 35, 38, 235, 236], "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, 234], "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, 235, 239], "iter": [21, 22, 55, 94, 102, 104, 109, 138, 165], "sent": [21, 53], "actual": [21, 229, 239], "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, 240], "getter": [21, 170, 229, 239], "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, 238], "smaller": [21, 170, 171], "than": [21, 99, 158, 170, 171, 228, 239], "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, 234], "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, 235, 238], "consist": 22, "surround": 22, "well": [22, 158, 165, 166, 234, 236, 238], "local": [22, 112], "separ": [22, 228], "colon": 22, "pushbutton": 22, "zwj": 22, "app": [22, 229, 234, 238], "mybutton": 22, "known": [22, 148], "type_nam": [22, 111, 145], "buttonbas": 22, "inherit": [22, 102, 229, 231, 232, 234, 238], "accessiblerol": [22, 78, 102, 107, 111, 132, 133, 136], "accessible_rol": [22, 111, 136], "role": [22, 48, 136], "locat": [22, 163, 238], "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, 235], "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, 234], "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, 233], "enabl": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 107, 136, 142, 227, 234, 235, 238, 239], "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, 234, 237, 238], "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, 238, 239, 240], "int8_t": [46, 137], "unit": [46, 240], "length": [46, 228, 240], "angl": [46, 113, 240], "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, 239], "automat": [48, 158, 239, 240], "tabl": [48, 132, 237, 240], "tree": [48, 105, 132, 238], "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, 234], "switch": [48, 113, 128, 132, 135, 139], "listitem": [48, 132], "item": [48, 53, 111, 112, 127, 136, 142, 145, 161], "scenario": 49, "occur": 49, "unsupport": [49, 134], "alreadyset": [49, 134], "There": 49, "alreadi": [49, 110, 157, 227, 235], "pencil": 50, "middl": [50, 132], "mani": [50, 112, 235], "center": [50, 133, 234, 238], "mode": [51, 100, 112, 126, 146, 162], "determin": [51, 100, 227], "quit": [51, 100, 234], "quitonlastwindowclos": [51, 100, 112], "rununtilquit": [51, 112], "keep": [51, 142, 229, 239], "nativeopengl": [52, 134], "opengl": [52, 53, 148], "renderingsetup": [53, 134], "beforerend": [53, 134], "afterrend": [53, 134], "gl": 53, "renderingteardown": [53, 134], "resourc": [53, 148], "due": [53, 233], "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, 233, 238], "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, 239], "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, 240], "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, 237], "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, 240], "pend": [93, 98, 99], "advanc": [94, 165, 166], "process": [94, 107, 227], "futur": [96, 234], "appear": 96, "termin": [97, 158, 234], "meant": [97, 106], "ui": [97, 98, 99, 104, 105, 107, 227, 228, 231, 232, 234, 237, 238], "immedi": 97, "add": [98, 122, 165, 227, 233, 234, 238], "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, 240], "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, 233, 234, 237, 238], "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, 234], "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, 236, 239], "header": [102, 118, 229, 231, 238], "choos": [102, 227, 238], "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, "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, "windowenum": 102, "closerequestresponseenum": 102, "eventloopmodeenum": 102, "graphicsapienum": 102, "pointereventbuttonenum": 102, "renderingstateenum": 102, "apidirectori": 102, "cppdirectori": 102, "includefil": 102, "hfile": 102, "hdirectori": 102, "cppdocsdirectori": 102, "generated_includefil": 102, "detail": [102, 232, 234, 235, 237], "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, 234, 235, 236, 237], "nest": 102, "relationship": 102, "deriv": [102, 105], "overview": [103, 236], "design": [103, 232, 240], "its": [104, 157, 163], "pre": [104, 148, 227, 228, 234, 235, 237], "normal": [104, 133, 156], "wai": [104, 148, 227, 228, 232, 239], "come": [105, 227, 232, 235, 239], "built": [105, 227, 231, 239], "modul": [105, 107, 227, 237], "interact": [105, 136, 227, 232, 239], "environ": [105, 233, 234, 236], "microcontrol": [105, 236], "embed": [105, 227, 232], "plugin": 105, "found": [105, 228, 231], "repositori": 105, "http": [105, 112, 227, 231, 234, 238], "github": [105, 227, 231, 234, 238], "com": [105, 112, 227, 231, 238], "master": 105, "platform_n": 105, "platform_qt": 105, "blob": 105, "esp": [105, 233, 234, 236], "idf": [105, 234, 236], "src": [105, 129, 130, 132, 133, 234], "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, 235], "cmake": [107, 227, 231, 232, 233, 235, 236, 237, 238, 239], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 234], "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, 235, 239], "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, 234, 235], "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, 231, 232, 234, 235, 237], "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, 239], "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, 234], "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, 237], "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, 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, 239], "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, 240], "dealloc": [112, 135, 136], "__cpp_sized_dealloc": 112, "align_val_t": 112, "align": [112, 136, 143, 234, 238], "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, 234], "alignof": [112, 122], "cross": [112, 235, 236], "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, 235, 238], "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, 237], "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, 237, 238], "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, 234, 238], "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, 233, 234], "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, 235], "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], "to_rgb8": [117, 148], "slint_image_to_rgb8": [117, 135], "to_rgba8": [117, 148], "slint_image_to_rgba8": [117, 135], "to_rgba8_premultipli": [117, 148], "slint_image_to_rgba8_premultipli": [117, 135], "slint_image_compare_equ": [117, 135], "imageinn": [117, 135], "load_image_from_embedded_data": 117, "extens": [117, 232, 237, 238], "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, 234, 235, 237, 238, 239], "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, 234, 238], "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, "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, 240], "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, 239], "sign": [125, 228, 240], "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, 235], "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, 228, 234, 235, 238, 240], "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, 238], "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, 239], "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, 238], "horizont": [133, 234, 238], "vertic": [133, 148], "unknown": [133, 227], "dark": 133, "light": 133, "animationdirect": [133, 136], "altern": [133, 227, 234], "alternaterevers": 133, "9": [134, 142, 148], "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, 239], "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, "swipegesturehandl": 136, "handle_swipe_left": 136, "handle_swipe_right": 136, "handle_swipe_up": 136, "handle_swipe_down": 136, "swipe": 136, "pressed_posit": 136, "current_posit": 136, "viewport_x": 136, "flick": 136, "simpletext": 136, "complextext": 136, "overflow": [136, 234], "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, 158, 233], "self_": [136, 142, 144], "sequenc": 136, "to_transl": 136, "target": [136, 140, 148, 227, 228, 231, 234, 235, 236, 238], "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, "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, 235, 237], "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, 240], "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, "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, 227, 235], "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, 234], "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, 240], "disk": [148, 228], "effici": [148, 158, 227, 232, 235], "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, 235, 238], "consequ": 148, "dimension": [153, 160], "precis": [156, 240], "thu": [156, 228], "cheap": [157, 159], "contigu": 157, "might": [157, 227, 228], "past": [157, 158, 159], "around": 158, "clone": 158, "hood": 158, "utf": [158, 240], "charact": 158, "raw": [158, 228], "suitabl": 158, "comparison": [158, 159], "scheme": 158, "fraction": 158, "str2": 158, "100": [158, 234], "lexicograph": 158, "less": [158, 239], "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, 240], "notat": 165, "lst": 165, "field": [165, 166, 229, 233, 240], "sure": [165, 166, 227, 233, 235, 238], "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, 233, 234, 235], "mit": [227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "2019": 227, "newer": [227, 235, 237], "autom": [227, 235], "offer": [227, 235], "linkag": [227, 235], "recommend": [227, 235], "ninja": [227, 235], "track": [227, 233, 235], "gninja": [227, 235], "cmake_gener": [227, 235], "download": [227, 237, 238], "linux": [227, 234], "x86": 227, "architectur": 227, "flexibl": [227, 239], "open": [227, 234, 237, 238], "latest": [227, 231, 238], "asset": 227, "xxx": 227, "x86_64": 227, "tar": [227, 238], "gz": [227, 238], "win64": 227, "ex": 227, "unpack": 227, "archiv": [227, 237], "cmake_prefix_path": [227, 238], "dcmake_prefix_path": 227, "find_packag": [227, 231, 238], "cmakelist": [227, 231, 234, 238], "txt": [227, 231, 234, 238], "lib": 227, "ld_library_path": 227, "learn": [227, 231, 232, 234, 235, 237], "guid": [227, 231, 234, 235], "rustc": [227, 235], "cargo": [227, 232, 233, 235], "project": [227, 231, 233, 234, 237, 238], "fetchcont": [227, 231], "snippet": [227, 238], "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, 239], "stack": [227, 233, 234], "winit": 227, "slint_feature_": 227, "setup": 227, "dslint_feature_backend_winit": 227, "dslint_feature_backend_winit_wayland": 227, "gui": [227, 234], "ccmake": 227, "more": [227, 229, 231, 232, 234, 235, 237, 239], "discov": 227, "disabl": [227, 235], "slint_enabled_featur": 227, "slint_disabled_featur": 227, "get_target_properti": 227, "backend_winit": 227, "in_list": 227, "similarli": 227, "processor": [227, 235], "corros": 227, "certain": 227, "furthermor": 227, "slint_library_cargo_flag": 227, "encapsul": 227, "abstract": [227, 229, 239], "inform": [227, 239], "slint_feature_backend_": 227, "stabl": [227, 228, 233], "ones": 227, "readi": 227, "upstream": 227, "yocto": 227, "sdk": [227, 236], "suffici": 227, "pleas": 227, "consult": 227, "now": 227, "toolchain": [227, 233, 234, 235, 236], "rustup": 227, "iconfigur": 227, "drust_cargo_target": [227, 235], "arm64": 227, "board": [227, 234, 237, 238], "targ": 227, "aarch64": 227, "gnu": 227, "cortexa53": 227, "crypto": 227, "poki": 227, "cd": [227, 234], "project_root": 227, "mkdir": 227, "dcmake_install_prefix": 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, 234, 235, 236, 237, 238], "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, 238], "customcompon": 228, "inclus": 228, "busi": [228, 232], "compier": 228, "These": [228, 229], "parallel": 228, "overal": 228, "howev": [228, 239], "split": 228, "across": 228, "abil": 228, "perform": [228, 239], "minimis": 228, "anywher": 228, "emb": [228, 235, 238], "slint_embed_resourc": [228, 238], "default_slint_embed_resourc": 228, "devic": [228, 232, 234, 237, 240], "ratio": [228, 240], "px": 228, "phx": 228, "desir": 228, "slint_scale_factor": 228, "shall": 228, "combin": 228, "dialog": 229, "get_": 229, "setter": [229, 239], "set_": 229, "invoke_": 229, "callback_nam": 229, "on_": 229, "function_nam": 229, "smart": [229, 239], "aliv": [229, 239], "complex": [229, 239], "yourself": 229, "let": 229, "samplecompon": 229, "counter": 229, "dash": 229, "underscor": 229, "user_nam": 229, "mayb": 229, "here": [229, 232, 233], "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, 234, 238, 239], "cmake_minimum_requir": 231, "cxx": [231, 238], "three": [231, 236], "packag": [231, 234], "approach": [231, 239], "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, 234], "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, 237], "studio": [232, 237], "featur": 232, "highlight": 232, "live": 232, "quick": 232, "cycl": 232, "viewer": 232, "tool": [232, 237, 238], "instal": [232, 234, 235, 237, 238], "awar": 233, "solv": 233, "z": 233, "nightli": 233, "solut": 233, "rustup_toolchain": 233, "toml": 233, "One": 233, "reason": [233, 234], "enough": 233, "ram": [233, 234, 238], "heap": 233, "big": 233, "8kib": 233, "invert": 233, "incompat": 233, "rgb565": 233, "littl": 233, "endian": 233, "esp32": [233, 234], "often": 233, "esp_lcd": 233, "accordingli": 233, "therefor": 233, "color_swap_16": [233, 234], "slintplatformconfigur": [233, 234, 238], "compiler_builtin": 233, "4c2482f45199cb1e": 233, "cgu": 233, "05": 233, "__udivdi3": 233, "0x0": 233, "libgcc": 233, "_udivdi3": 233, "o": 233, "wl": 233, "linker": 233, "target_link_opt": 233, "component_lib": [233, 234], "s3": 234, "prompt": 234, "instruct": [234, 235, 237], "maco": 234, "fall": 234, "io": 234, "book": 234, "html": 234, "soc": 234, "xtensa": 234, "risc": 234, "bare": 234, "bone": 234, "py": 234, "chipset": 234, "esp32s3": 234, "stdio": [234, 238], "esp_err": 234, "bsp": [234, 238], "bsp_lcd_draw_buff_s": 234, "draw_buf_s": 234, "bsp_lcd_h_re": 234, "config_bsp_lcd_draw_buf_height": 234, "app_main": 234, "esp_lcd_panel_io_handle_t": 234, "io_handl": 234, "esp_lcd_panel_handle_t": 234, "panel_handl": 234, "bsp_display_config_t": 234, "bsp_disp_cfg": 234, "max_transfer_sz": 234, "bsp_display_new": 234, "bsp_display_backlight_on": 234, "esp_lcd_touch_handle_t": 234, "touch_handl": 234, "bsp_touch_config_t": 234, "bsp_touch_cfg": 234, "bsp_touch_new": 234, "bsp_lcd_v_re": 234, "slint_esp_init": 234, "buffer1": 234, "appwindow": [234, 238], "verticalbox": [234, 238], "aboutslint": [234, 238], "18px": [234, 238], "idf_component_regist": 234, "include_dir": 234, "editor": 234, "menuconfig": 234, "config": 234, "tweak": 234, "spi": 234, "psram": 234, "q": 234, "save": 234, "sdkconfig": 234, "flash": [234, 237], "config_main_task_stack_s": 234, "monitor": 234, "observ": 234, "congratul": 234, "studi": [234, 235, 237], "aim": [235, 236], "those": 235, "dslint_feature_freestand": 235, "standard": 235, "dbuild_shared_lib": 235, "dslint_feature_renderer_softwar": 235, "ddefault_slint_embed_resourc": 235, "arm": [235, 237], "cortex": 235, "complet": [235, 238], "thumbv7em": [235, 238], "eabihf": [235, 238], "mcu": [236, 237], "highli": 236, "customiz": 236, "vendor": 236, "espressif": 236, "iot": 236, "framework": 236, "stm32": [236, 237], "stmicroelectron": 236, "stm32cube": [236, 238], "ecosystem": 236, "stm": 237, "bsp_t": 237, "bsp_lcd": 237, "hal_ltdc": 237, "stm32cubeclt": 237, "discoveri": 237, "kit": 237, "skeleton": [237, 238], "sampl": 237, "usag": 237, "basic": 237, "stm32h747i": 237, "disco": 237, "dual": 237, "core": 237, "m7": 237, "m4": 237, "lcd": 237, "zip": 237, "stm32h735g": 237, "dk": 237, "folder": 237, "preset": 237, "palett": 237, "panel": 237, "hit": 237, "rough": 238, "cube": 238, "stm32cubemx": 238, "peripher": 238, "prerequisit": 238, "ltdc": 238, "fmc": 238, "framebuff": 238, "web": 238, "browser": 238, "navig": 238, "appmain": 238, "set_target_properti": 238, "bsp_name": 238, "concret": 238, "stm32h735g_discoveri": 238, "target_compile_definit": 238, "slint_stm32_bsp_nam": 238, "bsp_lcd_initex": 238, "bsp_ts_init": 238, "slint_stm32_init": 238, "final": 238, "stm32h735g_discovery_lcd": 238, "stm32h735g_discovery_t": 238, "lcd_orientation_landscap": 238, "lcd_pixel_format_rgb565": 238, "lcd_default_width": 238, "lcd_default_height": 238, "error_handl": 238, "bsp_lcd_displayon": 238, "bsp_lcd_setactivelay": 238, "ts_init_t": 238, "ht": 238, "ts_swap_xi": 238, "accuraci": 238, "touchscreen": 238, "app_window": 238, "explain": 239, "veri": 239, "ahead": 239, "smallest": 239, "footprint": 239, "best": 239, "price": 239, "opportun": 239, "popul": 239, "slower": 239, "With": 239, "polymorph": 239, "commonli": 239, "consum": 239, "invoke_global_callback": 239, "summar": 240, "easili": 240, "physical_length": 240, "At": 240, "camelcas": 240, "mystruct": 240, "camel": 240, "myenum": 240, "beta": 240, "gamma": 240, "omicron": 240, "betagamma": 240}, "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"], [148, 2, 1, "_CPPv4NK5slint5Image7to_rgb8Ev", "slint::Image::to_rgb8"], [148, 2, 1, "_CPPv4NK5slint5Image8to_rgba8Ev", "slint::Image::to_rgba8"], [148, 2, 1, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv", "slint::Image::to_rgba8_premultiplied"], [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, "_CPPv4N5slint18PointerEventButton4BackE", "slint::PointerEventButton::Back"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton7ForwardE", "slint::PointerEventButton::Forward"], [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, "_CPPv4NK5slint12SharedString4sizeEv", "slint::SharedString::size"], [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, "_CPPv4N5slint7testing14AccessibleRole8ListItemE", "slint::testing::AccessibleRole::ListItem"], [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, 233], "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, 240], "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, 240], "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, 235, 238, 239], "interpret": [55, 104, 109, 239], "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, 233], "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, 234], "environ": [227, 235], "prerequisit": [227, 234, 235, 237], "instal": 227, "binari": 227, "packag": 227, "build": [227, 233], "from": 227, "sourc": 227, "featur": 227, "rust": [227, 233], "flag": 227, "backend": 227, "cross": 227, "compil": [227, 233, 235, 239], "cmake": 228, "slint_target_sourc": 228, "resourc": 228, "embed": 228, "scale": 228, "factor": 228, "microcontrol": 228, "gener": [229, 235, 238], "code": 229, "global": 229, "singleton": 229, "index": 230, "get": 231, "start": 231, "tutori": 231, "The": [232, 233], "markup": 232, "languag": 232, "architectur": 232, "troubleshoot": 233, "error": 233, "dure": 233, "devic": 233, "crash": 233, "boot": 233, "enter": 233, "loop": 233, "wrong": 233, "shown": 233, "about": 233, "multipl": 233, "symbol": 233, "when": 233, "link": 233, "espressif": 234, "": 234, "iot": 234, "framework": 234, "first": [234, 237], "step": [234, 235, 237], "next": [234, 235, 237], "mcu": [235, 238], "setup": 235, "introduct": 236, "stmicroelectron": 237, "stm32cube": 237, "ecosystem": 237, "instruct": 238, "stm32": 238, "overview": 239, "design": 239, "run": 239, "time": 239, "map": 240, "structur": 240}, "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"], [240, "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"], [234, "prerequisites"], [235, "prerequisites"], [237, "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"]], "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"]], "Troubleshooting": [[233, "troubleshooting"]], "Rust Compilation Error During Slint Build": [[233, "rust-compilation-error-during-slint-build"]], "The device crashes at boot or enter a boot loop": [[233, "the-device-crashes-at-boot-or-enter-a-boot-loop"]], "Wrong colors shown": [[233, "wrong-colors-shown"]], "Errors about multiple symbol definitions when linking": [[233, "errors-about-multiple-symbol-definitions-when-linking"]], "Espressif\u2019s IoT Development Framework": [[234, "espressif-s-iot-development-framework"]], "First Steps": [[234, "first-steps"], [237, "first-steps"]], "Next Steps": [[234, "next-steps"], [235, "next-steps"], [237, "next-steps"]], "Generic MCU Environment Setup": [[235, "generic-mcu-environment-setup"]], "Compiling Slint": [[235, "compiling-slint"]], "Introduction": [[236, "introduction"]], "STMicroelectronics\u2019 STM32Cube Ecosystem": [[237, "stmicroelectronics-stm32cube-ecosystem"]], "Generic Instructions for Slint on STM32 MCUs": [[238, "generic-instructions-for-slint-on-stm32-mcus"]], "Overview": [[239, "overview"]], "Compiled .slint Designs": [[239, "compiled-slint-designs"]], "Run-Time Interpreted .slint Designs": [[239, "run-time-interpreted-slint-designs"]], "Type Mappings": [[240, "type-mappings"]], "Structures": [[240, "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::listitem (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ListItemE"]], "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::back (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4BackE"]], "pointereventbutton::forward (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton7ForwardE"]], "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"]], "image::to_rgb8 (c++ function)": [[148, "_CPPv4NK5slint5Image7to_rgb8Ev"]], "image::to_rgba8 (c++ function)": [[148, "_CPPv4NK5slint5Image8to_rgba8Ev"]], "image::to_rgba8_premultiplied (c++ function)": [[148, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv"]], "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::size (c++ function)": [[158, "_CPPv4NK5slint12SharedString4sizeEv"]], "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", "mcu/esp-idf/troubleshoot", "mcu/esp_idf", "mcu/generic", "mcu/intro", "mcu/stm32", "mcu/stm32/generic", "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", "mcu/esp-idf/troubleshoot.md", "mcu/esp_idf.md", "mcu/generic.md", "mcu/intro.md", "mcu/stm32.md", "mcu/stm32/generic.md", "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", "Troubleshooting", "Espressif\u2019s IoT Development Framework", "Generic MCU Environment Setup", "Introduction", "STMicroelectronics\u2019 STM32Cube Ecosystem", "Generic Instructions for Slint on STM32 MCUs", "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, 233, 234, 240], "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, 235, 238, 239, 240], "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, 234, 238], "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, 235, 236, 237, 239, 240], "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, 235, 236, 237, 238, 239, 240], "declar": [0, 13, 14, 109, 142, 164, 229, 231, 239, 240], "how": [0, 20, 103, 157, 227, 231, 232, 233, 234, 236, 238, 239], "fill": [0, 20, 133, 136], "outlin": [0, 238], "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, 235, 238], "text": [0, 10, 17, 22, 48, 110, 127, 129, 130, 132, 133, 136, 142, 161, 231, 232, 233, 234, 238], "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, 235, 237, 240], "either": [0, 13, 14, 21, 22, 163, 165, 166, 227, 233, 237, 239], "solid": 0, "color": [0, 46, 61, 102, 103, 113, 115, 121, 128, 131, 135, 136, 141, 142, 147, 156, 167, 231, 232, 239, 240], "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, 233, 240], "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, 238, 239], "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, 234, 238, 239], "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, 240], "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, 238], "If": [0, 4, 6, 7, 8, 9, 10, 17, 21, 22, 102, 148, 156, 158, 162, 165, 166, 170, 171, 227, 228, 229, 233, 234, 235, 237], "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, 235, 236, 238, 239, 240], "first": [0, 7, 13, 20, 113, 122, 157, 158, 159, 227, 231, 233, 239], "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, 240], "factor": [0, 1, 10, 21, 113, 115, 127, 131, 240], "version": [0, 1, 26, 29, 35, 38, 98, 99, 227, 231, 235, 238], "ha": [0, 1, 4, 5, 6, 8, 10, 13, 14, 21, 53, 109, 148, 158, 159, 162, 167, 231, 234, 239], "bright": [0, 1, 234], "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, 235], "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, 233, 238], "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, 235, 238, 239, 240], "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, 148, 155, 156, 240], "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, 235, 236, 238, 239], "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, 234, 235, 238, 239], "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, 240], "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, 237, 238, 239, 240], "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, 240], "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, 234], "equal": [0, 14, 112, 122, 153, 157, 158, 159, 160, 165, 228], "hold": [0, 13, 14, 21, 159, 165, 166, 239], "must": [0, 10, 13, 17, 20, 21, 22, 95, 99, 107, 127, 148, 157, 229, 235], "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, 233], "differ": [0, 10, 13, 14, 17, 20, 46, 48, 49, 50, 53, 99, 105, 148, 227, 232, 233, 235, 237, 239], "what": [0, 17, 111, 136, 235], "thei": [0, 153, 156, 157, 160], "respect": [0, 235], "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, 236, 239, 240], "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, 239], "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, 240], "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, 236, 237, 240], "run": [1, 13, 17, 18, 21, 51, 98, 99, 102, 109, 110, 126, 158, 159, 162, 227, 228, 229, 231, 233, 234, 235, 237, 238, 240], "time": [1, 21, 102, 158, 159, 162, 227, 228, 231, 233, 238, 240], "8": [1, 115, 138, 142, 158, 167, 240], "bit": [1, 167, 240], "channel": [1, 148, 233], "red": [1, 110, 115, 131, 148, 154, 155, 156, 167], "green": [1, 110, 115, 131, 148, 154, 155, 156, 167], "blue": [1, 110, 115, 131, 148, 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, 233, 234, 235, 240], "entir": [1, 240], "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, 234, 237, 238, 239], "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, 240], "to_argb_uint": [1, 115], "convert": [1, 5, 10, 22, 106, 149, 150, 151, 152, 158, 165, 167, 228, 233, 240], "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, 235, 236, 238, 239, 240], "easi": [1, 239], "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, 162, 167, 227, 228, 229, 231, 238], "255": [1, 115, 142, 154, 155, 156, 167], "multipli": [1, 148, 240], "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, 239, 240], "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, 235], "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, 234, 238, 239, 240], "result": [1, 22, 99, 109, 111, 112, 113, 114, 115, 117, 121, 128, 135, 136, 139, 158, 167, 228], "back": [1, 9, 50, 53, 97, 132, 227, 229, 234], "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, 234, 235, 237, 238, 239, 240], "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, 235, 236], "5": [1, 26, 29, 35, 38, 110, 135, 138, 142, 158, 167], "50": [1, 142], "divid": [1, 236], "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, 235, 237], "30": [1, 142], "obtain": [1, 148], "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, 236], "clamp": 1, "between": [1, 10, 20, 21, 147, 148, 154, 155, 156, 167, 233, 234, 235, 237], "appli": [1, 4, 5, 8, 20, 48, 114, 133, 239], "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, 234, 235], "from_argb_encod": [1, 113, 115], "argb_encod": [1, 115], "integ": [1, 158, 240], "0xaarrggbb": 1, "from_argb_uint8": [1, 115], "paramet": [1, 5, 10, 13, 20, 51, 53, 100, 156, 229, 231, 239], "from_rgb_uint8": [1, 115], "have": [1, 10, 19, 20, 21, 22, 110, 112, 136, 148, 157, 165, 170, 171, 227, 229, 232, 233, 234, 235, 239], "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, 234, 237, 238], "compon": [1, 2, 3, 10, 11, 12, 13, 22, 109, 111, 115, 125, 127, 136, 147, 156, 167, 228, 229, 231, 232, 234, 238, 239], "hue": [1, 115, 147], "expect": [1, 233], "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, 240], "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, 234, 238, 239, 240], "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, 235], "refer": [1, 3, 10, 13, 21, 110, 148, 157, 158, 159, 165, 166, 227, 229, 234, 235, 237, 238, 240], "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, 235, 239], "handl": [2, 3, 12, 16, 17, 20, 21, 22, 112, 121, 127, 136, 140, 141, 231, 235, 239], "like": [2, 13, 20, 48, 99, 168, 227, 229, 231, 234, 235], "share": [2, 10, 12, 148, 157, 158, 159, 235], "pointer": [2, 10, 16, 50, 110, 133, 148, 157, 158, 159, 229, 239], "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, 236, 237, 239, 240], "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, 237, 238, 239, 240], "In": [2, 13, 15, 21, 112, 227, 232, 238], "order": [2, 8, 13, 100, 112, 136, 162, 165, 166, 233, 240], "get": [2, 109, 112, 121, 167, 227, 235, 237, 238, 239], "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, 234, 238, 239], "where": [2, 15, 163, 235, 239], "name": [2, 12, 13, 22, 109, 138, 164, 165, 166, 227, 228, 229, 231, 238, 240], "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, 234, 235, 238, 239], "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, 235, 239, 240], "componenthandl": [3, 12, 22, 58, 102, 103, 109, 111, 112, 229, 239], "null": [3, 13, 158, 162, 234], "lock": [3, 98, 112, 127], "alwai": [3, 20, 158, 240], "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, 238], "option": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 21, 22, 55, 57, 58, 93, 107, 109, 110, 111, 112, 117, 127, 136, 148, 165, 170, 171, 227, 228, 235, 238, 239], "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, 239, 240], "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, 236, 240], "model": [4, 5, 7, 8, 9, 14, 46, 58, 102, 103, 109, 112, 137, 138, 229, 239], "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, 234, 237, 238, 239], "filter": [4, 5, 8], "each": [4, 5, 8, 20, 22, 94, 106, 229, 236, 240], "row": [4, 5, 6, 7, 8, 9, 109, 112, 138], "accept": [4, 14, 22, 133, 136, 229, 233], "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, 239], "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, 234, 235, 236, 237, 239], "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, 124, 127, 158, 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, 234], "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, 239, 240], "particular": [4, 5, 6, 7, 8, 9, 227, 235], "should": [4, 5, 6, 7, 8, 9, 10, 13, 14, 17, 18, 21, 94, 96, 112, 121, 127, 170, 171, 227, 228, 234, 235], "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, 234, 238], "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, 233], "cannot": [4, 6, 7, 8, 9, 122, 148, 159, 162], "support": [4, 6, 7, 8, 9, 17, 49, 105, 112, 122, 227, 234, 235, 236, 238], "chang": [4, 5, 6, 7, 8, 9, 10, 20, 21, 101, 107, 142, 159, 165, 166, 231, 234, 239], "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, 233, 234, 235], "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, 234, 238], "int": [4, 8, 13, 14, 16, 46, 98, 99, 109, 110, 112, 113, 121, 125, 136, 140, 141, 142, 144, 148, 229, 231, 240], "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, 234, 235, 237, 239], "allow": [5, 10, 54, 104, 229, 233, 239], "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, 235, 237, 240], "number": [5, 14, 16, 20, 46, 109, 125, 133, 137, 158, 159, 163, 239], "string": [5, 11, 12, 13, 14, 29, 46, 98, 101, 136, 137, 140, 158, 229, 239, 240], "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, 239], "element": [6, 8, 10, 14, 21, 22, 48, 111, 119, 136, 139, 145, 148, 159, 170, 229, 231, 232, 239], "languag": [6, 101, 112, 227, 229, 231, 234, 235, 237, 238, 239], "subclass": [6, 15, 21, 105, 239], "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, 240], "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, 233], "row_ad": [6, 109, 112], "count": [6, 10, 109, 110, 112, 119, 126, 136, 138, 139, 157, 240], "were": [6, 11, 20, 21], "ad": [6, 238], "row_remov": [6, 109, 112], "remov": [6, 9, 159, 234], "been": [6, 21, 22, 53, 162, 165, 234], "everyth": [6, 16], "need": [6, 17, 18, 20, 21, 53, 102, 104, 115, 122, 227, 229, 231, 233, 234, 235, 238, 239], "reload": 6, "reserv": [7, 112], "mean": [7, 100, 109], "last": [7, 10, 11, 20, 21, 51, 100, 122, 158, 159], "second": [7, 20, 239], "revers": [7, 133], "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, 234], "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, 238], "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, 234, 235, 236, 237, 239], "render": [10, 15, 17, 19, 20, 21, 49, 52, 53, 94, 100, 105, 110, 136, 148, 157, 168, 227, 228, 229, 234, 235, 237, 238], "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, 234, 237, 239], "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, 234, 235, 237, 239], "control": [10, 13, 78, 97, 102, 106, 130, 132, 227, 233], "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, 234, 237, 238], "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, 238, 239], "explicitli": [10, 149, 150, 151, 152], "one": [10, 13, 14, 15, 48, 98, 105, 112, 127, 148, 158, 165, 166, 227, 228, 229, 239], "becom": [10, 21, 112, 165, 166], "hidden": [10, 13, 21, 54], "show": [10, 13, 21, 104, 109, 127, 227, 229, 231, 234], "addit": [10, 227, 234, 235], "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, 235, 238, 239], "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, 235, 236], "is_vis": [10, 127, 138], "even": [10, 51, 239], "previous": [10, 20, 162], "user": [10, 21, 54, 100, 229, 232, 239, 240], "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, 237, 239], "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, 237, 239], "regist": [10, 13, 49, 95, 112, 229], "invok": [10, 12, 13, 17, 18, 20, 21, 22, 98, 109, 110, 162, 227, 238], "dure": [10, 11, 148, 227], "phase": 10, "custom": [10, 105, 229], "top": [10, 117, 133, 135, 148], "below": [10, 237], "callabl": [10, 22], "argument": [10, 11, 13, 112, 136, 148, 227, 228, 229], "On": [10, 112, 231, 234], "success": [10, 238], "without": [10, 46, 105, 148, 165, 227, 235], "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, 233], "request": [10, 13, 21, 54], "redraw": [10, 20], "content": [10, 148, 159, 161, 229, 233, 234, 238], "physicalposit": [10, 20, 21, 66, 102, 103, 110, 120, 127, 168, 169], "physic": [10, 20, 21, 151, 152, 228, 240], "coordin": [10, 20, 21, 119, 148, 149, 151, 153, 240], "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, 234, 237, 238], "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, 240], "po": [10, 110, 127, 136], "note": [10, 13, 14, 16, 21, 110, 112, 165, 166, 227, 229, 231, 235, 240], "some": [10, 11, 125, 136, 231, 234], "wayland": [10, 16, 227], "avail": [10, 13, 101, 103, 109, 148, 227, 229, 233, 234, 239], "physicals": [10, 19, 20, 21, 69, 102, 103, 110, 123, 127, 168, 169, 234], "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, 158, 159, 168, 169, 170, 171, 227, 234, 238, 240], "exclud": [10, 21, 158, 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, 240], "pixel": [10, 20, 21, 110, 117, 133, 135, 148, 149, 150, 151, 152, 154, 155, 157, 167, 228, 233, 235, 240], "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, 233, 234, 235, 237], "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, 239, 240], "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, 234, 238, 239], "your": [10, 14, 20, 21, 105, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239], "own": [10, 105, 110, 227, 229, 236, 239], "backend": [10, 13, 49, 96, 105, 136, 142, 235], "want": [10, 104, 148, 165, 166, 227, 228, 231], "forward": [10, 21, 50, 109, 112, 127, 132, 235], "input": [10, 13, 21, 94, 100, 229, 235, 237], "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, 234, 238], "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, 238], "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, 240], "dispatch_pointer_release_ev": [10, 127], "dispatch_pointer_exit_ev": [10, 127], "exit": [10, 17, 127, 136], "trigger": [10, 97, 239], "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, 240], "y": [10, 110, 111, 112, 120, 125, 127, 135, 136, 139, 153, 231, 232, 240], "direct": [10, 14, 21, 136], "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, 238], "height": [10, 21, 110, 111, 112, 117, 123, 127, 135, 136, 142, 148, 157, 160, 231, 232, 238], "root": [10, 145, 229], "properli": 10, "dispatch_scale_factor_change_ev": [10, 21, 127], "happen": 10, "resolut": 10, "select": [10, 17, 227, 234, 235, 237, 238], "platform": [10, 15, 16, 19, 20, 21, 43, 78, 96, 102, 103, 108, 127, 132, 167, 168, 169, 170, 171, 172, 234, 235, 237, 238], "right": [10, 20, 50, 117, 132, 133, 135, 148, 234], "initi": [10, 19, 21, 53, 97, 110, 157, 159, 165, 234, 238], "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, 234, 235], "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, 239], "load": [11, 102, 103, 104, 148, 228, 239], "compil": [11, 12, 13, 17, 101, 104, 109, 112, 138, 228, 229, 231, 232, 234, 236, 238, 240], "them": [11, 20, 22, 104, 165, 168, 169, 227, 233, 238, 239], "build_from_sourc": [11, 12, 104, 109], "set_include_path": [11, 109], "look": [11, 231, 233, 234, 235], "up": [11, 20, 98, 133, 228, 231, 234, 239], "import": [11, 105, 148, 228, 234, 238], "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, 240], "style": [11, 109, 138], "widget": [11, 48, 234, 237, 238], "set_translation_domain": [11, 109], "domain": [11, 109, 112, 136], "translat": [11, 101, 112, 231, 239, 240], "include_path": [11, 109], "configur": [11, 23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 227, 228, 233, 234, 235, 237], "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, 239], "source_cod": [11, 109, 138], "collect": [11, 98], "retriev": [11, 237], "previou": [11, 20, 112, 229], "comput": 11, "self": [11, 109, 110, 162], "markup": [12, 227, 229, 235, 240], "componentcompil": [12, 55, 102, 104, 109, 138, 163, 239], "And": 12, "instanti": [12, 229, 234, 238, 239], "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, 239], "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, 239], "export": [12, 13, 22, 229, 231, 232, 234, 238, 239, 240], "singleton": [12, 13, 239], "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, 234], "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, 238], "dyn": [13, 109, 136], "access": [13, 14, 21, 22, 48, 52, 96, 102, 165, 166, 170, 229, 239], "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, 238, 240], "shown": [13, 21, 54, 98, 170, 239], "react": [13, 100, 229, 239], "draw": [13, 148, 234], "touch": [13, 234, 235, 237, 238], "necessari": [13, 16, 100, 227], "spin": [13, 17, 229, 231], "loop": [13, 17, 18, 21, 51, 94, 97, 98, 99, 100, 110, 229, 231, 234, 238], "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, 235, 237, 238, 239], "conveni": [13, 14, 158, 162, 165, 166, 227, 229, 231, 235], "follow": [13, 98, 99, 102, 148, 227, 228, 229, 231, 233, 234, 235, 237, 238, 239, 240], "qwidget": [13, 109, 142], "qt": [13, 142, 227], "graphic": [13, 52, 53, 232], "mai": [13, 20, 21, 49, 148, 168, 233, 234], "nullptr": [13, 109, 110, 112, 121, 142], "runtim": [13, 17, 101, 104, 110, 165, 227], "hello": [13, 229, 231, 232, 234, 235, 238], "we": [13, 110, 112, 115, 122, 136, 227, 229, 231, 233, 235, 237], "world": [13, 231, 232, 234, 235, 238], "correctli": 13, "could": [13, 233, 235], "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, 239], "foo": [13, 14, 22, 109, 240], "Then": [13, 14, 96, 227], "42": [13, 14, 142, 158], "don": [13, 109, 136, 233], "match": [13, 22, 112, 227, 234, 237, 238], "which": [13, 20, 21, 100, 104, 112, 120, 123, 162, 165, 166, 227, 228, 229, 232, 235, 239], "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, 239], "prop_nam": [13, 109], "within": [13, 14, 22, 98, 102, 163, 227], "main": [13, 97, 98, 99, 100, 127, 228, 229, 231, 234, 238], "theglob": 13, "doe": [13, 16, 21, 22, 49, 162, 165], "correct": [13, 227], "get_global_properti": [13, 109, 239], "set_global_callback": [13, 109, 239], "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, 233], "toupper": [13, 229], "invoke_glob": [13, 109], "callable_nam": [13, 109, 138], "definit": [13, 109, 172], "dynam": [14, 102, 239], "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, 234, 235, 237, 239], "overload": [14, 21, 112], "to_xxx": 14, "possibl": [14, 158, 227, 239], "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, 234, 235, 236, 237, 238, 239, 240], "store": [14, 17, 113, 147, 156, 157], "sometyp": 14, "object": [14, 22, 46, 148, 240], "liter": 14, "bar": [14, 22, 48, 240], "my_prop": 14, "Such": 14, "doubl": [14, 20, 22, 109, 124, 125, 136, 138, 144, 158, 237], "some_valu": 14, "check": [14, 22, 111, 136, 142, 165, 166, 227, 231, 232, 234, 235, 237], "string_valu": 14, "do_someth": [14, 99], "extract": [14, 165, 166, 237, 238], "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, 240], "to_brush": [14, 109], "to_struct": [14, 109, 165], "imag": [14, 46, 63, 102, 103, 109, 117, 135, 136, 137, 138, 142, 157, 228, 235, 238, 240], "to_imag": [14, 109], "str": [14, 109, 112, 117, 124, 125, 138, 158, 229], "boolean": 14, "m": [14, 109, 112, 136, 235], "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, 239], "windowadapt": [15, 17, 20, 56, 102, 105, 108, 110, 171], "intend": [15, 22], "place": [15, 238], "requir": [15, 109, 110, 111, 112, 127, 227, 228, 233, 234, 238, 239], "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, 234], "server": 16, "kind": [16, 109, 130, 136, 239], "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, 239], "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, 50, 56, 102, 105, 110, 234], "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, 239], "unique_ptr": [17, 95, 110, 142], "chrono": [17, 58, 72, 93, 110, 112, 126, 162], "millisecond": [17, 93, 110, 126, 162, 240], "duration_since_start": [17, 110, 140], "start": [17, 20, 98, 99, 102, 126, 133, 136, 158, 162, 163, 227, 229, 234, 235, 237, 238], "applic": [17, 49, 95, 105, 148, 227, 228, 231, 232, 233, 237, 239], "slint_feature_freestand": [17, 80, 102, 110, 112, 117, 127, 134], "doesn": [17, 109, 112], "nullopt": [17, 21, 22, 110, 111, 112, 148], "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, 235], "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, 235, 239], "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, 228, 235, 237, 238], "To": [20, 107, 227, 235, 237, 239], "buffer": [20, 21, 53, 110, 117, 135, 140, 148, 157, 234, 237], "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, 233], "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, 234, 235, 239], "larg": 20, "stride": 20, "line": [20, 110, 125, 133, 137, 163, 227, 232, 235], "rgb565pixel": [20, 56, 102, 105, 110, 234], "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, "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, 233, 236, 238], "compos": [20, 168, 232], "multipl": [20, 49, 168, 227, 228, 229], "sub": [20, 168, 227, 229, 236, 239], "bounding_box_s": [20, 110, 168], "bound": [20, 168], "box": [20, 109, 138, 168, 234, 235], "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, 240], "windowproperti": [21, 56, 102, 105, 108, 110, 140], "layoutconstraint": [21, 56, 102, 105, 110, 170], "base": [21, 22, 46, 102, 111, 136, 234, 238], "layer": [21, 136], "win32": [21, 231], "wayland_surface_t": 21, "establish": 21, "link": [21, 112, 231, 238], "both": [21, 165, 166, 227], "about": [21, 53, 125, 227, 228, 231, 234, 235, 237], "being": [21, 115, 148], "etc": [21, 22, 239], "dispatch_mouse_press_ev": 21, "via": [21, 148, 229, 237, 238], "set_vis": [21, 110, 140], "update_window_properti": [21, 110, 140, 170], "deleg": 21, "bi": 21, "protocol": [21, 165, 166], "incomplet": 21, "experi": [21, 238], "unexpect": 21, "behavior": [21, 100, 148], "intent": 21, "develop": [21, 26, 29, 35, 38, 235, 236], "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, 234], "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, 235, 239], "iter": [21, 22, 55, 94, 102, 104, 109, 138, 165], "sent": [21, 53], "actual": [21, 229, 239], "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, 240], "getter": [21, 170, 229, 239], "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, 238], "smaller": [21, 170, 171], "than": [21, 99, 158, 170, 171, 228, 239], "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, 234], "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, 235, 238], "consist": 22, "surround": 22, "well": [22, 158, 165, 166, 234, 236, 238], "local": [22, 112], "separ": [22, 228], "colon": 22, "pushbutton": 22, "zwj": 22, "app": [22, 229, 234, 238], "mybutton": 22, "known": [22, 148], "type_nam": [22, 111, 145], "buttonbas": 22, "inherit": [22, 102, 229, 231, 232, 234, 238], "accessiblerol": [22, 78, 102, 107, 111, 132, 133, 136], "accessible_rol": [22, 111, 136], "role": [22, 48, 136], "locat": [22, 163, 238], "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, 235], "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, 234], "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, 233], "enabl": [23, 24, 25, 27, 28, 30, 31, 32, 33, 34, 36, 37, 39, 107, 136, 142, 227, 234, 235, 238, 239], "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, 234, 237, 238], "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, 238, 239, 240], "int8_t": [46, 137], "unit": [46, 240], "length": [46, 228, 240], "angl": [46, 113, 240], "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, 239], "automat": [48, 158, 239, 240], "tabl": [48, 132, 237, 240], "tree": [48, 105, 132, 238], "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, 234], "switch": [48, 113, 128, 132, 135, 139], "listitem": [48, 132], "item": [48, 53, 111, 112, 127, 136, 142, 145, 161], "scenario": 49, "occur": 49, "unsupport": [49, 134], "alreadyset": [49, 134], "There": 49, "alreadi": [49, 110, 157, 227, 235], "pencil": 50, "middl": [50, 132], "mani": [50, 112, 235], "center": [50, 133, 234, 238], "mode": [51, 100, 112, 126, 146, 162], "determin": [51, 100, 227], "quit": [51, 100, 234], "quitonlastwindowclos": [51, 100, 112], "rununtilquit": [51, 112], "keep": [51, 142, 229, 239], "nativeopengl": [52, 134], "opengl": [52, 53, 148], "renderingsetup": [53, 134], "beforerend": [53, 134], "afterrend": [53, 134], "gl": 53, "renderingteardown": [53, 134], "resourc": [53, 148], "due": [53, 233], "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, 233, 238], "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, 239], "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, 240], "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, 237], "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, 240], "pend": [93, 98, 99], "advanc": [94, 165, 166], "process": [94, 107, 227], "futur": [96, 234], "appear": 96, "termin": [97, 158, 234], "meant": [97, 106], "ui": [97, 98, 99, 104, 105, 107, 227, 228, 231, 232, 234, 237, 238], "immedi": 97, "add": [98, 122, 165, 227, 233, 234, 238], "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, 240], "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, 233, 234, 237, 238], "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, 234], "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, 236, 239], "header": [102, 118, 229, 231, 238], "choos": [102, 227, 238], "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, 234, 235, 237], "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, 234, 235, 236, 237], "nest": 102, "relationship": 102, "deriv": [102, 105], "overview": [103, 236], "design": [103, 232, 240], "its": [104, 157, 163], "pre": [104, 148, 227, 228, 234, 235, 237], "normal": [104, 133, 156], "wai": [104, 148, 227, 228, 232, 239], "come": [105, 227, 232, 235, 239], "built": [105, 227, 231, 239], "modul": [105, 107, 227, 237], "interact": [105, 136, 227, 232, 239], "environ": [105, 233, 234, 236], "microcontrol": [105, 236], "embed": [105, 227, 232], "plugin": 105, "found": [105, 228, 231], "repositori": 105, "http": [105, 112, 227, 231, 234, 238], "github": [105, 227, 231, 234, 238], "com": [105, 112, 227, 231, 238], "master": 105, "platform_n": 105, "platform_qt": 105, "blob": 105, "esp": [105, 233, 234, 236], "idf": [105, 234, 236], "src": [105, 129, 130, 132, 133, 234], "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, 235], "cmake": [107, 227, 231, 232, 233, 235, 236, 237, 238, 239], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 235, 236, 237, 238, 239, 240], "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, 234], "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, 235, 239], "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, 234, 235], "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, 231, 232, 234, 235, 237], "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, 239], "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, 234], "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, 237], "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, 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, 239], "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, 240], "dealloc": [112, 135, 136], "__cpp_sized_dealloc": 112, "align_val_t": 112, "align": [112, 136, 143, 234, 238], "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, 234], "alignof": [112, 122], "cross": [112, 235, 236], "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, 235, 238], "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, 237], "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, 237, 238], "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, 234, 238], "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, 233, 234], "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, 235], "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], "to_rgb8": [117, 148], "slint_image_to_rgb8": [117, 135], "to_rgba8": [117, 148], "slint_image_to_rgba8": [117, 135], "to_rgba8_premultipli": [117, 148], "slint_image_to_rgba8_premultipli": [117, 135], "slint_image_compare_equ": [117, 135], "imageinn": [117, 135], "load_image_from_embedded_data": 117, "extens": [117, 232, 237, 238], "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, 234, 235, 237, 238, 239], "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, 234, 238], "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, "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, 240], "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, 239], "sign": [125, 228, 240], "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, 235], "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, 228, 234, 235, 238, 240], "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, 238], "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, 239], "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, 238], "horizont": [133, 234, 238], "vertic": [133, 148], "unknown": [133, 227], "dark": 133, "light": 133, "animationdirect": [133, 136], "altern": [133, 227, 234], "alternaterevers": 133, "9": [134, 142, 148], "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, 239], "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, "swipegesturehandl": 136, "handle_swipe_left": 136, "handle_swipe_right": 136, "handle_swipe_up": 136, "handle_swipe_down": 136, "swipe": 136, "pressed_posit": 136, "current_posit": 136, "viewport_x": 136, "flick": 136, "simpletext": 136, "complextext": 136, "overflow": [136, 234], "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, 158, 233], "self_": [136, 142, 144], "sequenc": 136, "to_transl": 136, "target": [136, 140, 148, 227, 228, 231, 234, 235, 236, 238], "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, "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, 235, 237], "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, 240], "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, "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, 227, 235], "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, 234], "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, 240], "disk": [148, 228], "effici": [148, 158, 227, 232, 235], "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, 235, 238], "consequ": 148, "dimension": [153, 160], "precis": [156, 240], "thu": [156, 228], "cheap": [157, 159], "contigu": 157, "might": [157, 227, 228], "past": [157, 158, 159], "around": 158, "clone": 158, "hood": 158, "utf": [158, 240], "charact": 158, "raw": [158, 228], "suitabl": 158, "comparison": [158, 159], "scheme": 158, "fraction": 158, "str2": 158, "100": [158, 234], "lexicograph": 158, "less": [158, 239], "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, 240], "notat": 165, "lst": 165, "field": [165, 166, 229, 233, 240], "sure": [165, 166, 227, 233, 235, 238], "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, 233, 234, 235], "mit": [227, 228, 229, 231, 233, 234, 235, 236, 237, 238, 239, 240], "2019": 227, "newer": [227, 235, 237], "autom": [227, 235], "offer": [227, 235], "linkag": [227, 235], "recommend": [227, 235], "ninja": [227, 235], "track": [227, 233, 235], "gninja": [227, 235], "cmake_gener": [227, 235], "download": [227, 237, 238], "linux": [227, 234], "x86": 227, "architectur": 227, "flexibl": [227, 239], "open": [227, 234, 237, 238], "latest": [227, 231, 238], "asset": 227, "xxx": 227, "x86_64": 227, "tar": [227, 238], "gz": [227, 238], "win64": 227, "ex": 227, "unpack": 227, "archiv": [227, 237], "cmake_prefix_path": [227, 238], "dcmake_prefix_path": 227, "find_packag": [227, 231, 238], "cmakelist": [227, 231, 234, 238], "txt": [227, 231, 234, 238], "lib": 227, "ld_library_path": 227, "learn": [227, 231, 232, 234, 235, 237], "guid": [227, 231, 234, 235], "rustc": [227, 235], "cargo": [227, 232, 233, 235], "project": [227, 231, 233, 234, 237, 238], "fetchcont": [227, 231], "snippet": [227, 238], "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, 239], "stack": [227, 233, 234], "winit": 227, "slint_feature_": 227, "setup": 227, "dslint_feature_backend_winit": 227, "dslint_feature_backend_winit_wayland": 227, "gui": [227, 234], "ccmake": 227, "more": [227, 229, 231, 232, 234, 235, 237, 239], "discov": 227, "disabl": [227, 235], "slint_enabled_featur": 227, "slint_disabled_featur": 227, "get_target_properti": 227, "backend_winit": 227, "in_list": 227, "similarli": 227, "processor": [227, 235], "corros": 227, "certain": 227, "furthermor": 227, "slint_library_cargo_flag": 227, "encapsul": 227, "abstract": [227, 229, 239], "inform": [227, 239], "slint_feature_backend_": 227, "stabl": [227, 228, 233], "ones": 227, "readi": 227, "upstream": 227, "yocto": 227, "sdk": [227, 236], "suffici": 227, "pleas": 227, "consult": 227, "now": 227, "toolchain": [227, 233, 234, 235, 236], "rustup": 227, "iconfigur": 227, "drust_cargo_target": [227, 235], "arm64": 227, "board": [227, 234, 237, 238], "targ": 227, "aarch64": 227, "gnu": 227, "cortexa53": 227, "crypto": 227, "poki": 227, "cd": [227, 234], "project_root": 227, "mkdir": 227, "dcmake_install_prefix": 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, 234, 235, 236, 237, 238], "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, 238], "customcompon": 228, "inclus": 228, "busi": [228, 232], "compier": 228, "These": [228, 229], "parallel": 228, "overal": 228, "howev": [228, 239], "split": 228, "across": 228, "abil": 228, "perform": [228, 239], "minimis": 228, "anywher": 228, "emb": [228, 235, 238], "slint_embed_resourc": [228, 238], "default_slint_embed_resourc": 228, "devic": [228, 232, 234, 237, 240], "ratio": [228, 240], "px": 228, "phx": 228, "desir": 228, "slint_scale_factor": 228, "shall": 228, "combin": 228, "dialog": 229, "get_": 229, "setter": [229, 239], "set_": 229, "invoke_": 229, "callback_nam": 229, "on_": 229, "function_nam": 229, "smart": [229, 239], "aliv": [229, 239], "complex": [229, 239], "yourself": 229, "let": 229, "samplecompon": 229, "counter": 229, "dash": 229, "underscor": 229, "user_nam": 229, "mayb": 229, "here": [229, 232, 233], "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, 234, 238, 239], "cmake_minimum_requir": 231, "cxx": [231, 238], "three": [231, 236], "packag": [231, 234], "approach": [231, 239], "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, 234], "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, 237], "studio": [232, 237], "featur": 232, "highlight": 232, "live": 232, "quick": 232, "cycl": 232, "viewer": 232, "tool": [232, 237, 238], "instal": [232, 234, 235, 237, 238], "awar": 233, "solv": 233, "z": 233, "nightli": 233, "solut": 233, "rustup_toolchain": 233, "toml": 233, "One": 233, "reason": [233, 234], "enough": 233, "ram": [233, 234, 238], "heap": 233, "big": 233, "8kib": 233, "invert": 233, "incompat": 233, "rgb565": 233, "littl": 233, "endian": 233, "esp32": [233, 234], "often": 233, "esp_lcd": 233, "accordingli": 233, "therefor": 233, "color_swap_16": [233, 234], "slintplatformconfigur": [233, 234, 238], "compiler_builtin": 233, "4c2482f45199cb1e": 233, "cgu": 233, "05": 233, "__udivdi3": 233, "0x0": 233, "libgcc": 233, "_udivdi3": 233, "o": 233, "wl": 233, "linker": 233, "target_link_opt": 233, "component_lib": [233, 234], "s3": 234, "prompt": 234, "instruct": [234, 235, 237], "maco": 234, "fall": 234, "io": 234, "book": 234, "html": 234, "soc": 234, "xtensa": 234, "risc": 234, "bare": 234, "bone": 234, "py": 234, "chipset": 234, "esp32s3": 234, "stdio": [234, 238], "esp_err": 234, "bsp": [234, 238], "bsp_lcd_draw_buff_s": 234, "draw_buf_s": 234, "bsp_lcd_h_re": 234, "config_bsp_lcd_draw_buf_height": 234, "app_main": 234, "esp_lcd_panel_io_handle_t": 234, "io_handl": 234, "esp_lcd_panel_handle_t": 234, "panel_handl": 234, "bsp_display_config_t": 234, "bsp_disp_cfg": 234, "max_transfer_sz": 234, "bsp_display_new": 234, "bsp_display_backlight_on": 234, "esp_lcd_touch_handle_t": 234, "touch_handl": 234, "bsp_touch_config_t": 234, "bsp_touch_cfg": 234, "bsp_touch_new": 234, "bsp_lcd_v_re": 234, "slint_esp_init": 234, "buffer1": 234, "appwindow": [234, 238], "verticalbox": [234, 238], "aboutslint": [234, 238], "18px": [234, 238], "idf_component_regist": 234, "include_dir": 234, "editor": 234, "menuconfig": 234, "config": 234, "tweak": 234, "spi": 234, "psram": 234, "q": 234, "save": 234, "sdkconfig": 234, "flash": [234, 237], "config_main_task_stack_s": 234, "monitor": 234, "observ": 234, "congratul": 234, "studi": [234, 235, 237], "aim": [235, 236], "those": 235, "dslint_feature_freestand": 235, "standard": 235, "dbuild_shared_lib": 235, "dslint_feature_renderer_softwar": 235, "ddefault_slint_embed_resourc": 235, "arm": [235, 237], "cortex": 235, "complet": [235, 238], "thumbv7em": [235, 238], "eabihf": [235, 238], "mcu": [236, 237], "highli": 236, "customiz": 236, "vendor": 236, "espressif": 236, "iot": 236, "framework": 236, "stm32": [236, 237], "stmicroelectron": 236, "stm32cube": [236, 238], "ecosystem": 236, "stm": 237, "bsp_t": 237, "bsp_lcd": 237, "hal_ltdc": 237, "stm32cubeclt": 237, "discoveri": 237, "kit": 237, "skeleton": [237, 238], "sampl": 237, "usag": 237, "basic": 237, "stm32h747i": 237, "disco": 237, "dual": 237, "core": 237, "m7": 237, "m4": 237, "lcd": 237, "zip": 237, "stm32h735g": 237, "dk": 237, "folder": 237, "preset": 237, "palett": 237, "panel": 237, "hit": 237, "rough": 238, "cube": 238, "stm32cubemx": 238, "peripher": 238, "prerequisit": 238, "ltdc": 238, "fmc": 238, "framebuff": 238, "web": 238, "browser": 238, "navig": 238, "appmain": 238, "set_target_properti": 238, "bsp_name": 238, "concret": 238, "stm32h735g_discoveri": 238, "target_compile_definit": 238, "slint_stm32_bsp_nam": 238, "bsp_lcd_initex": 238, "bsp_ts_init": 238, "slint_stm32_init": 238, "final": 238, "stm32h735g_discovery_lcd": 238, "stm32h735g_discovery_t": 238, "lcd_orientation_landscap": 238, "lcd_pixel_format_rgb565": 238, "lcd_default_width": 238, "lcd_default_height": 238, "error_handl": 238, "bsp_lcd_displayon": 238, "bsp_lcd_setactivelay": 238, "ts_init_t": 238, "ht": 238, "ts_swap_xi": 238, "accuraci": 238, "touchscreen": 238, "app_window": 238, "explain": 239, "veri": 239, "ahead": 239, "smallest": 239, "footprint": 239, "best": 239, "price": 239, "opportun": 239, "popul": 239, "slower": 239, "With": 239, "polymorph": 239, "commonli": 239, "consum": 239, "invoke_global_callback": 239, "summar": 240, "easili": 240, "physical_length": 240, "At": 240, "camelcas": 240, "mystruct": 240, "camel": 240, "myenum": 240, "beta": 240, "gamma": 240, "omicron": 240, "betagamma": 240}, "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"], [148, 2, 1, "_CPPv4NK5slint5Image7to_rgb8Ev", "slint::Image::to_rgb8"], [148, 2, 1, "_CPPv4NK5slint5Image8to_rgba8Ev", "slint::Image::to_rgba8"], [148, 2, 1, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv", "slint::Image::to_rgba8_premultiplied"], [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, "_CPPv4N5slint18PointerEventButton4BackE", "slint::PointerEventButton::Back"], [50, 5, 1, "_CPPv4N5slint18PointerEventButton7ForwardE", "slint::PointerEventButton::Forward"], [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, "_CPPv4NK5slint12SharedString4sizeEv", "slint::SharedString::size"], [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, "_CPPv4N5slint7testing14AccessibleRole8ListItemE", "slint::testing::AccessibleRole::ListItem"], [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, 233], "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, 240], "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, 240], "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, 235, 238, 239], "interpret": [55, 104, 109, 239], "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, 233], "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, 234], "environ": [227, 235], "prerequisit": [227, 234, 235, 237], "instal": 227, "binari": 227, "packag": 227, "build": [227, 233], "from": 227, "sourc": 227, "featur": 227, "rust": [227, 233], "flag": 227, "backend": 227, "cross": 227, "compil": [227, 233, 235, 239], "cmake": 228, "slint_target_sourc": 228, "resourc": 228, "embed": 228, "scale": 228, "factor": 228, "microcontrol": 228, "gener": [229, 235, 238], "code": 229, "global": 229, "singleton": 229, "index": 230, "get": 231, "start": 231, "tutori": 231, "The": [232, 233], "markup": 232, "languag": 232, "architectur": 232, "troubleshoot": 233, "error": 233, "dure": 233, "devic": 233, "crash": 233, "boot": 233, "enter": 233, "loop": 233, "wrong": 233, "shown": 233, "about": 233, "multipl": 233, "symbol": 233, "when": 233, "link": 233, "espressif": 234, "": 234, "iot": 234, "framework": 234, "first": [234, 237], "step": [234, 235, 237], "next": [234, 235, 237], "mcu": [235, 238], "setup": 235, "introduct": 236, "stmicroelectron": 237, "stm32cube": 237, "ecosystem": 237, "instruct": 238, "stm32": 238, "overview": 239, "design": 239, "run": 239, "time": 239, "map": 240, "structur": 240}, "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"], [240, "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"], [234, "prerequisites"], [235, "prerequisites"], [237, "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"]], "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"]], "Troubleshooting": [[233, "troubleshooting"]], "Rust Compilation Error During Slint Build": [[233, "rust-compilation-error-during-slint-build"]], "The device crashes at boot or enter a boot loop": [[233, "the-device-crashes-at-boot-or-enter-a-boot-loop"]], "Wrong colors shown": [[233, "wrong-colors-shown"]], "Errors about multiple symbol definitions when linking": [[233, "errors-about-multiple-symbol-definitions-when-linking"]], "Espressif\u2019s IoT Development Framework": [[234, "espressif-s-iot-development-framework"]], "First Steps": [[234, "first-steps"], [237, "first-steps"]], "Next Steps": [[234, "next-steps"], [235, "next-steps"], [237, "next-steps"]], "Generic MCU Environment Setup": [[235, "generic-mcu-environment-setup"]], "Compiling Slint": [[235, "compiling-slint"]], "Introduction": [[236, "introduction"]], "STMicroelectronics\u2019 STM32Cube Ecosystem": [[237, "stmicroelectronics-stm32cube-ecosystem"]], "Generic Instructions for Slint on STM32 MCUs": [[238, "generic-instructions-for-slint-on-stm32-mcus"]], "Overview": [[239, "overview"]], "Compiled .slint Designs": [[239, "compiled-slint-designs"]], "Run-Time Interpreted .slint Designs": [[239, "run-time-interpreted-slint-designs"]], "Type Mappings": [[240, "type-mappings"]], "Structures": [[240, "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::listitem (c++ enumerator)": [[48, "_CPPv4N5slint7testing14AccessibleRole8ListItemE"]], "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::back (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton4BackE"]], "pointereventbutton::forward (c++ enumerator)": [[50, "_CPPv4N5slint18PointerEventButton7ForwardE"]], "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"]], "image::to_rgb8 (c++ function)": [[148, "_CPPv4NK5slint5Image7to_rgb8Ev"]], "image::to_rgba8 (c++ function)": [[148, "_CPPv4NK5slint5Image8to_rgba8Ev"]], "image::to_rgba8_premultiplied (c++ function)": [[148, "_CPPv4NK5slint5Image22to_rgba8_premultipliedEv"]], "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::size (c++ function)": [[158, "_CPPv4NK5slint12SharedString4sizeEv"]], "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 0a2f93c38..6a19b63db 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 multiple rows are added to the model.

      +

      Type Parameters

      • T

      Parameters

      • arr: T[]

      Returns ArrayModel<T>

    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 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 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 a9cd7fac9..554691652 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 591bc8cd3..fe89df7bb 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

    Methods

    Hierarchy (view full)

    Implements

    • Iterable<T>

    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.

      +

    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 9aca5956c..552d082ff 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 8f3fd92b5..381046f82 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 3bd10c323..ecdecaeff 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 e66477490..bf19abcaf 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 44a56c58e..ea7f74eb7 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>

    \ 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 c3855b4a7..9a8df77a7 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

    \ 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 cb4964d2f..9ce74522e 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 524097773..38e690424 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 f177a57d2..6702b9317 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 029293051..bb0213fe5 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 1de63f605..ace067b01 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 1b799730b..1b3e4b1a5 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 cc4e952d3..e97725127 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
    slint

    Enum PlatformError

    #[non_exhaustive]
    pub enum PlatformError { +
    slint

    Enum PlatformError

    #[non_exhaustive]
    pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Send + Sync>), + OtherError(Box<dyn Error + Sync + Send>), }
    Expand description

    The platform encountered a fatal error.

    This error typically indicates an issue with initialization or connecting to the windowing system.

    This can be constructed from a String:

    @@ -141,8 +141,8 @@ is not implemented for the current platform.

    §

    SetPlatformError(SetPlatformError)

    There is already a platform set from another thread.

    §

    Other(String)

    Another platform-specific error occurred

    -
    §

    OtherError(Box<dyn Error + Send + Sync>)

    Another platform-specific error occurred.

    -

    Trait Implementations§

    §

    impl Debug for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Display for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Error for PlatformError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    §

    impl From<&str> for PlatformError

    §

    fn from(value: &str) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<Box<dyn Error + Send + Sync>> for PlatformError

    §

    fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<String> for PlatformError

    §

    fn from(value: String) -> PlatformError

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +
    §

    OtherError(Box<dyn Error + Sync + Send>)

    Another platform-specific error occurred.

    +

    Trait Implementations§

    §

    impl Debug for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Display for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Error for PlatformError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    §

    impl From<&str> for PlatformError

    §

    fn from(value: &str) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<Box<dyn Error + Sync + Send>> for PlatformError

    §

    fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<String> for PlatformError

    §

    fn from(value: String) -> PlatformError

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> Downcast for T
    where @@ -151,7 +151,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

    §

    fn as_any(&self) -> &(dyn Any + 'static)

    Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
    §

    fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

    Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
    §

    impl<T> DowncastSync for T
    where - T: Any + Send + Sync,

    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    §

    impl<T> Instrument for T

    §

    fn instrument(self, span: Span) -> Instrumented<Self>

    Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
    §

    fn in_current_span(self) -> Instrumented<Self>

    Instruments this type with the current Span, returning an diff --git a/snapshots/master/docs/rust/slint/enum.RenderingState.html b/snapshots/master/docs/rust/slint/enum.RenderingState.html index 92fbb954b..94d429759 100644 --- a/snapshots/master/docs/rust/slint/enum.RenderingState.html +++ b/snapshots/master/docs/rust/slint/enum.RenderingState.html @@ -1,4 +1,4 @@ -RenderingState in slint - Rust
    slint::platform

    Enum PlatformError

    #[non_exhaustive]
    pub enum PlatformError { +
    slint::platform

    Enum PlatformError

    #[non_exhaustive]
    pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Send + Sync>), + OtherError(Box<dyn Error + Sync + Send>), }
    Expand description

    The platform encountered a fatal error.

    This error typically indicates an issue with initialization or connecting to the windowing system.

    This can be constructed from a String:

    @@ -141,8 +141,8 @@ is not implemented for the current platform.

    §

    SetPlatformError(SetPlatformError)

    There is already a platform set from another thread.

    §

    Other(String)

    Another platform-specific error occurred

    -
    §

    OtherError(Box<dyn Error + Send + Sync>)

    Another platform-specific error occurred.

    -

    Trait Implementations§

    §

    impl Debug for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Display for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Error for PlatformError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    §

    impl From<&str> for PlatformError

    §

    fn from(value: &str) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<Box<dyn Error + Send + Sync>> for PlatformError

    §

    fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<String> for PlatformError

    §

    fn from(value: String) -> PlatformError

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +
    §

    OtherError(Box<dyn Error + Sync + Send>)

    Another platform-specific error occurred.

    +

    Trait Implementations§

    §

    impl Debug for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Display for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Error for PlatformError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    §

    impl From<&str> for PlatformError

    §

    fn from(value: &str) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<Box<dyn Error + Sync + Send>> for PlatformError

    §

    fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<String> for PlatformError

    §

    fn from(value: String) -> PlatformError

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> Downcast for T
    where @@ -151,7 +151,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

    §

    fn as_any(&self) -> &(dyn Any + 'static)

    Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
    §

    fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

    Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
    §

    impl<T> DowncastSync for T
    where - T: Any + Send + Sync,

    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    §

    impl<T> Instrument for T

    §

    fn instrument(self, span: Span) -> Instrumented<Self>

    Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
    §

    fn in_current_span(self) -> Instrumented<Self>

    Instruments this type with the current Span, returning an diff --git a/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html b/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html index 43e5829fe..32ef2a3a3 100644 --- a/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html +++ b/snapshots/master/docs/rust/slint/platform/enum.PointerEventButton.html @@ -1,4 +1,4 @@ -PointerEventButton in slint::platform - Rust
    slint::platform::femtovg_renderer

    Trait OpenGLInterface

    pub unsafe trait OpenGLInterface {
         // Required methods
    -    fn ensure_current(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
    -    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
    +    fn ensure_current(&self) -> Result<(), Box<dyn Error + Sync + Send>>;
    +    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Sync + Send>>;
         fn resize(
             &self,
             width: NonZero<u32>,
             height: NonZero<u32>,
    -    ) -> Result<(), Box<dyn Error + Send + Sync>>;
    +    ) -> Result<(), Box<dyn Error + Sync + Send>>;
         fn get_proc_address(&self, name: &CStr) -> *const c_void;
     }
    Expand description

    This trait describes the interface GPU accelerated renderers in Slint require to render with OpenGL.

    It serves the purpose to ensure that the OpenGL context is current before running any OpenGL @@ -137,15 +137,15 @@

    §Safety

    This trait is unsafe because an implementation of get_proc_address could return dangling pointers. In practice an implementation of this trait should just forward to the EGL/WGL/CGL C library that implements EGL/CGL/WGL.

    -

    Required Methods§

    fn ensure_current(&self) -> Result<(), Box<dyn Error + Send + Sync>>

    Ensures that the OpenGL context is current when returning from this function.

    -

    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Send + Sync>>

    This function is called by the renderers when all OpenGL commands have been issued and +

    Required Methods§

    fn ensure_current(&self) -> Result<(), Box<dyn Error + Sync + Send>>

    Ensures that the OpenGL context is current when returning from this function.

    +

    fn swap_buffers(&self) -> Result<(), Box<dyn Error + Sync + Send>>

    This function is called by the renderers when all OpenGL commands have been issued and the back buffer is reading for on-screen presentation. Typically implementations forward this to platform specific APIs such as eglSwapBuffers.

    fn resize( &self, width: NonZero<u32>, height: NonZero<u32>, -) -> Result<(), Box<dyn Error + Send + Sync>>

    This function is called by the renderers when the surface needs to be resized, typically +) -> Result<(), Box<dyn Error + Sync + Send>>

    This function is called by the renderers when the surface needs to be resized, typically in response to the windowing system notifying of a change in the window system. For most implementations this is a no-op, with the exception for wayland for example.

    fn get_proc_address(&self, name: &CStr) -> *const c_void

    Returns the address of the OpenGL function specified by name, or a null pointer if the diff --git a/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html b/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html index 91b9962e6..b9adb8a64 100644 --- a/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html +++ b/snapshots/master/docs/rust/slint/platform/fn.duration_until_next_timer_update.html @@ -1,4 +1,4 @@ -duration_until_next_timer_update in slint::platform - Rust

    \ No newline at end of file +
    \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint_build/enum.CompileError.html b/snapshots/master/docs/rust/slint_build/enum.CompileError.html index a37ed92a3..9c5593920 100644 --- a/snapshots/master/docs/rust/slint_build/enum.CompileError.html +++ b/snapshots/master/docs/rust/slint_build/enum.CompileError.html @@ -1,4 +1,4 @@ -CompileError in slint_build - Rust
    slint_build

    Function compile

    source
    pub fn compile(path: impl AsRef<Path>) -> Result<(), CompileError>
    Expand description

    Compile the .slint file and generate rust code for it.

    +
    slint_build

    Function compile

    source
    pub fn compile(path: impl AsRef<Path>) -> Result<(), CompileError>
    Expand description

    Compile the .slint file and generate rust code for it.

    The generated code code will be created in the directory specified by the OUT environment variable as it is expected for build script.

    The following line need to be added within your crate in order to include @@ -134,4 +134,5 @@ errors when generating the code.

    Please check out the documentation of the slint crate for more information about how to use the generated code.

    +

    This function can only be called within a build script run by cargo.

    \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint_build/fn.compile_with_config.html b/snapshots/master/docs/rust/slint_build/fn.compile_with_config.html index 874ab78f6..82a433ad1 100644 --- a/snapshots/master/docs/rust/slint_build/fn.compile_with_config.html +++ b/snapshots/master/docs/rust/slint_build/fn.compile_with_config.html @@ -1,4 +1,4 @@ -compile_with_config in slint_build - Rust
    slint_build

    Function compile_with_config

    source
    pub fn compile_with_config(
    -    path: impl AsRef<Path>,
    +
    slint_build

    Function compile_with_config

    source
    pub fn compile_with_config(
    +    relative_slint_file_path: impl AsRef<Path>,
         config: CompilerConfiguration,
     ) -> Result<(), CompileError>
    Expand description

    Same as compile, but allow to specify a configuration.

    Compile ui/hello.slint and select the “material” style:

    diff --git a/snapshots/master/docs/rust/slint_build/fn.compile_with_output.html b/snapshots/master/docs/rust/slint_build/fn.compile_with_output.html new file mode 100644 index 000000000..e5a5f374e --- /dev/null +++ b/snapshots/master/docs/rust/slint_build/fn.compile_with_output.html @@ -0,0 +1,132 @@ +compile_with_output in slint_build - Rust + + + + +
    slint_build

    Function compile_with_output

    source
    pub fn compile_with_output(
    +    input_slint_file_path: impl AsRef<Path>,
    +    output_rust_file_path: impl AsRef<Path>,
    +    config: CompilerConfiguration,
    +) -> Result<Vec<PathBuf>, CompileError>
    Expand description

    Similar to compile_with_config, but meant to be used independently of cargo.

    +

    Will compile the input file and write the result in the given output file.

    +

    Both input_slint_file_path and output_rust_file_path should be absolute paths.

    +

    Doesn’t print any cargo messages.

    +

    Returns a list of all input files that were used to generate the output file. (dependencies)

    +
    \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint_build/fn.print_rustc_flags.html b/snapshots/master/docs/rust/slint_build/fn.print_rustc_flags.html index 9f3c6804c..8ef5456f8 100644 --- a/snapshots/master/docs/rust/slint_build/fn.print_rustc_flags.html +++ b/snapshots/master/docs/rust/slint_build/fn.print_rustc_flags.html @@ -1,4 +1,4 @@ -print_rustc_flags in slint_build - Rust
    slint_build

    Function print_rustc_flags

    source
    pub fn print_rustc_flags() -> Result<()>
    Expand description

    This function is for use the application’s build script, in order to print any device specific +

    slint_build

    Function print_rustc_flags

    source
    pub fn print_rustc_flags() -> Result<()>
    Expand description

    This function is for use the application’s build script, in order to print any device specific build flags reported by the backend

    \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint_build/index.html b/snapshots/master/docs/rust/slint_build/index.html index 3bc7a7356..45feab32e 100644 --- a/snapshots/master/docs/rust/slint_build/index.html +++ b/snapshots/master/docs/rust/slint_build/index.html @@ -1,4 +1,4 @@ -slint_build - Rust

    Crate slint_build

    source
    Expand description

    This crate serves as a companion crate of the slint crate. +

    Crate slint_build

    source
    Expand description

    This crate serves as a companion crate of the slint crate. It is meant to allow you to compile the .slint files from your build.rs script.

    The main entry point of this crate is the compile() function

    §Example

    @@ -146,5 +146,5 @@

    §Example

    fn main() { HelloWorld::new().run(); }
    -

    Structs§

    • The structure for configuring aspects of the compilation of .slint markup files to Rust.

    Enums§

    Functions§

    Structs§

    • The structure for configuring aspects of the compilation of .slint markup files to Rust.

    Enums§

    Functions§

    \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint_build/sidebar-items.js b/snapshots/master/docs/rust/slint_build/sidebar-items.js index 95e555240..167bc2ba1 100644 --- a/snapshots/master/docs/rust/slint_build/sidebar-items.js +++ b/snapshots/master/docs/rust/slint_build/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"enum":["CompileError","EmbedResourcesKind"],"fn":["compile","compile_with_config","print_rustc_flags"],"struct":["CompilerConfiguration"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"enum":["CompileError","EmbedResourcesKind"],"fn":["compile","compile_with_config","compile_with_output","print_rustc_flags"],"struct":["CompilerConfiguration"]}; \ No newline at end of file diff --git a/snapshots/master/docs/rust/slint_build/struct.CompilerConfiguration.html b/snapshots/master/docs/rust/slint_build/struct.CompilerConfiguration.html index 9e9fb2545..60f06c387 100644 --- a/snapshots/master/docs/rust/slint_build/struct.CompilerConfiguration.html +++ b/snapshots/master/docs/rust/slint_build/struct.CompilerConfiguration.html @@ -1,4 +1,4 @@ -CompilerConfiguration in slint_build - Rust
    slint_interpreter

    Enum PlatformError

    #[non_exhaustive]
    pub enum PlatformError { +
    slint_interpreter

    Enum PlatformError

    #[non_exhaustive]
    pub enum PlatformError { NoPlatform, NoEventLoopProvider, SetPlatformError(SetPlatformError), Other(String), - OtherError(Box<dyn Error + Send + Sync>), + OtherError(Box<dyn Error + Sync + Send>), }
    Expand description

    The platform encountered a fatal error.

    This error typically indicates an issue with initialization or connecting to the windowing system.

    This can be constructed from a String:

    @@ -141,8 +141,8 @@ is not implemented for the current platform.

    §

    SetPlatformError(SetPlatformError)

    There is already a platform set from another thread.

    §

    Other(String)

    Another platform-specific error occurred

    -
    §

    OtherError(Box<dyn Error + Send + Sync>)

    Another platform-specific error occurred.

    -

    Trait Implementations§

    §

    impl Debug for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Display for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Error for PlatformError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    §

    impl From<&str> for PlatformError

    §

    fn from(value: &str) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<Box<dyn Error + Send + Sync>> for PlatformError

    §

    fn from(error: Box<dyn Error + Send + Sync>) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<String> for PlatformError

    §

    fn from(value: String) -> PlatformError

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where +
    §

    OtherError(Box<dyn Error + Sync + Send>)

    Another platform-specific error occurred.

    +

    Trait Implementations§

    §

    impl Debug for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Display for PlatformError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Error for PlatformError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    §

    impl From<&str> for PlatformError

    §

    fn from(value: &str) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<Box<dyn Error + Sync + Send>> for PlatformError

    §

    fn from(error: Box<dyn Error + Sync + Send>) -> PlatformError

    Converts to this type from the input type.
    §

    impl From<String> for PlatformError

    §

    fn from(value: String) -> PlatformError

    Converts to this type from the input type.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    source§

    impl<T> Borrow<T> for T
    where T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for T
    where T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> Downcast for T
    where @@ -151,7 +151,7 @@ further downcast into Rc<ConcreteType> where ConcreteType implements Trait.

    §

    fn as_any(&self) -> &(dyn Any + 'static)

    Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
    §

    fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

    Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
    §

    impl<T> DowncastSync for T
    where - T: Any + Send + Sync,

    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be + T: Any + Send + Sync,
    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    §

    impl<T> Instrument for T

    §

    fn instrument(self, span: Span) -> Instrumented<Self>

    Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
    §

    fn in_current_span(self) -> Instrumented<Self>

    Instruments this type with the current Span, returning an diff --git a/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html b/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html index 85c763d87..08b6326ae 100644 --- a/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html +++ b/snapshots/master/docs/rust/slint_interpreter/enum.RenderingState.html @@ -1,4 +1,4 @@ -RenderingState in slint_interpreter - Rust"),typeof Ot!="string"&&!dr(Ot))if(typeof Ot.toString=="function"){if(Ot=Ot.toString(),typeof Ot!="string")throw n4("dirty is not a string, aborting")}else throw n4("toString is not a function");if(!e.isSupported)return Ot;if(ss||be(K),e.removed=[],typeof Ot=="string"&&($s=!1),$s){if(Ot.nodeName){const se=Bo(Ot.nodeName);if(!Ne[se]||ns[se])throw n4("root node is forbidden and cannot be sanitized in-place")}}else if(Ot instanceof a)de=ea(""),T=de.ownerDocument.importNode(Ot,!0),T.nodeType===1&&T.nodeName==="BODY"||T.nodeName==="HTML"?de=T:de.appendChild(T);else{if(!Tn&&!Zr&&!Di&&Ot.indexOf("<")===-1)return y&&vd?y.createHTML(Ot):Ot;if(de=ea(Ot),!de)return Tn?null:vd?C:""}de&&Oo&&Wo(de.firstChild);const O=Ph($s?Ot:de);for(;ie=O.nextNode();)un(ie)||(ie.content instanceof o&&Ci(ie.content),Ft(ie));if($s)return Ot;if(Tn){if(Ba)for(ye=k.call(de.ownerDocument);de.firstChild;)ye.appendChild(de.firstChild);else ye=de;return(xt.shadowroot||xt.shadowrootmode)&&(ye=R.call(t,ye,!0)),ye}let $=Di?de.outerHTML:de.innerHTML;return Di&&Ne["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Ap(PGe,de.ownerDocument.doctype.name)&&($=" -`+$),Zr&&($=uv($,G," "),$=uv($,Y," "),$=uv($,j," ")),y&&vd?y.createHTML($):$},e.setConfig=function(Ot){be(Ot),ss=!0},e.clearConfig=function(){Is=null,ss=!1},e.isValidAttribute=function(Ot,K,de){Is||be({});const T=Bo(Ot),ie=Bo(K);return Se(T,ie,de)},e.addHook=function(Ot,K){typeof K=="function"&&(z[Ot]=z[Ot]||[],i4(z[Ot],K))},e.removeHook=function(Ot){if(z[Ot])return $Fe(z[Ot])},e.removeHooks=function(Ot){z[Ot]&&(z[Ot]=[])},e.removeAllHooks=function(){z={}},e}var oTe=FGe();const OGe=oTe.sanitize,BGe=oTe.addHook,WGe=oTe.removeHook;function Wc(s){return Pre(s,0)}function Pre(s,e){switch(typeof s){case"object":return s===null?yS(349,e):Array.isArray(s)?sdt(s,e):odt(s,e);case"string":return rTe(s,e);case"boolean":return ndt(s,e);case"number":return yS(s,e);case"undefined":return yS(937,e);default:return yS(617,e)}}function yS(s,e){return(e<<5)-e+s|0}function ndt(s,e){return yS(s?433:863,e)}function rTe(s,e){e=yS(149417,e);for(let t=0,i=s.length;tPre(i,t),e)}function odt(s,e){return e=yS(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=rTe(i,t),Pre(s[i],t)),e)}var Um;(function(s){s[s.BLOCK_SIZE=64]="BLOCK_SIZE",s[s.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(Um||(Um={}));function Ade(s,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function YFe(s,e=0,t=s.byteLength,i=0){for(let n=0;nt.toString(16).padStart(2,"0")).join(""):rdt((s>>>0).toString(16),e/4)}const Wne=class Wne{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(Um.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 n=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(Pc(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>=Um.BLOCK_SIZE&&(this._step(),t-=Um.BLOCK_SIZE,this._totalLen+=Um.BLOCK_SIZE,e[0]=e[Um.BLOCK_SIZE+0],e[1]=e[Um.BLOCK_SIZE+1],e[2]=e[Um.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,Um.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),s4(this._h0)+s4(this._h1)+s4(this._h2)+s4(this._h3)+s4(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,YFe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),YFe(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=Wne._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,Ade(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,n=this._h1,o=this._h2,r=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=n&o|~n&r,l=1518500249):h<40?(c=n^o^r,l=1859775393):h<60?(c=n&o|n&r|o&r,l=2400959708):(c=n^o^r,l=3395469782),d=Ade(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=r,r=o,o=Ade(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}};Wne._bigBlock32=new DataView(new ArrayBuffer(320));let fpe=Wne;function Ka(s,e,t){return Math.min(Math.max(s,e),t)}function JFe(s,e){return(e+s%e)%e}class adt{constructor(){this._next=0}getNext(){return this._next++}}class aTe{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class cdt{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n{s.delete(r.vscodeWindowId),i.fire(r)})),a.add(ue(r,ke.BEFORE_UNLOAD,()=>{n.fire(r)})),t.fire(c),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return s.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:si},getDocument(r){return ct(r).document}}}();function Ms(s){for(;s.firstChild;)s.firstChild.remove()}class udt{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!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 ue(s,e,t,i){return new udt(s,e,t,i)}function HGe(s,e){return function(t){return e(new Eh(s,t))}}function gdt(s){return function(e){return s(new En(e))}}const Ro=function(e,t,i,n){let o=i;return t==="click"||t==="mousedown"||t==="contextmenu"?o=HGe(ct(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=gdt(i)),ue(e,t,o,n)},fdt=function(e,t,i){const n=HGe(ct(e),t);return pdt(e,n,i)};function pdt(s,e,t){return ue(s,dm&&kO.pointerEvents?ke.POINTER_DOWN:ke.MOUSE_DOWN,e,t)}function XP(s,e,t){return TO(s,e,t)}class XV extends LGe{constructor(e,t){super(e,t)}}let Uj,Ll;function mdt(s,e,t,i){let n=0;const o=s.setInterval(()=>{n++,(n>=i||e()===!0)&&r.dispose()},t),r=Ee(()=>{s.clearInterval(o)});return r}class X7 extends J7{constructor(e){super(),this.defaultTarget=e&&ct(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class Ede{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){vt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const s=new Map,e=new Map,t=new Map,i=new Map,n=o=>{t.set(o,!1);const r=s.get(o)??[];for(e.set(o,r),s.set(o,[]),i.set(o,!0);r.length>0;)r.sort(Ede.sort),r.shift().execute();i.set(o,!1)};Ll=(o,r,a=0)=>{const c=F2(o),l=new Ede(r,a);let d=s.get(c);return d||(d=[],s.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),o.requestAnimationFrame(()=>n(c))),l},Uj=(o,r,a)=>{const c=F2(o);if(i.get(c)){const l=new Ede(r,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return Ll(o,r,a)}})();const _dt=8,vdt=function(s,e){return e};class bdt extends V{constructor(e,t,i,n=vdt,o=_dt){super();let r=null,a=0;const c=this._register(new Cm),l=()=>{a=new Date().getTime(),i(r),r=null};this._register(ue(e,t,d=>{r=n(r,d);const h=new Date().getTime()-a;h>=o?(c.cancel(),l()):c.setIfNotSet(l,o-h)}))}}function wdt(s,e,t,i,n){return new bdt(s,e,t,i,n)}function Fre(s){return ct(s).getComputedStyle(s,null)}function z_(s,e){const t=ct(s),i=t.document;if(s!==i.body)return new bn(s.clientWidth,s.clientHeight);if(dm&&t?.visualViewport)return new bn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new bn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new bn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new bn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class $r{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=Fre(e),o=n?n.getPropertyValue(t):"0";return $r.convertToPixels(e,o)}static getBorderLeftWidth(e){return $r.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return $r.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return $r.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return $r.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return $r.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return $r.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return $r.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return $r.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return $r.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return $r.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return $r.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return $r.getDimension(e,"margin-bottom","marginBottom")}}const u1=class u1{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new u1(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof u1?e:new u1(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};u1.None=new u1(0,0);let bn=u1;function Vj(s){let e=s.offsetParent,t=s.offsetTop,i=s.offsetLeft;for(;(s=s.parentNode)!==null&&s!==s.ownerDocument.body&&s!==s.ownerDocument.documentElement;){t-=s.scrollTop;const n=$Ge(s)?null:Fre(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=$r.getBorderLeftWidth(s),t+=$r.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function UGe(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function Cr(s){const e=s.getBoundingClientRect(),t=ct(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function VGe(s){let e=s,t=1;do{const i=Fre(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Pd(s){const e=$r.getMarginLeft(s)+$r.getMarginRight(s);return s.offsetWidth+e}function ZV(s){const e=$r.getBorderLeftWidth(s)+$r.getBorderRightWidth(s),t=$r.getPaddingLeft(s)+$r.getPaddingRight(s);return s.offsetWidth-e-t}function ydt(s){const e=$r.getMarginLeft(s)+$r.getMarginRight(s);return s.scrollWidth+e}function cTe(s){const e=$r.getBorderTopWidth(s)+$r.getBorderBottomWidth(s),t=$r.getPaddingTop(s)+$r.getPaddingBottom(s);return s.offsetHeight-e-t}function fb(s){const e=$r.getMarginTop(s)+$r.getMarginBottom(s);return s.offsetHeight+e}function Cdt(s,e){if(s===null)return 0;const t=Vj(s),i=Vj(e);return t.left-i.left}function Sdt(s,e){const t=e.map(n=>Math.max(ydt(n),Pd(n))+Cdt(n,s)||0);return Math.max(...t)}function wc(s,e){return!!e?.contains(s)}const zGe="parentFlowToElementId";function Adt(s,e){s.dataset[zGe]=e.id}function Edt(s){const e=s.dataset[zGe];return typeof e=="string"?s.ownerDocument.getElementById(e):null}function xdt(s,e){let t=s;for(;t;){if(t===e)return!0;if(Yr(t)){const i=Edt(t);if(i){t=i;continue}}t=t.parentNode}return!1}function Ddt(s,e,t){for(;s&&s.nodeType===s.ELEMENT_NODE;){if(s.classList.contains(e))return s;if(t){if(typeof t=="string"){if(s.classList.contains(t))return null}else if(s===t)return null}s=s.parentNode}return null}function pq(s,e,t){return!!Ddt(s,e,t)}function $Ge(s){return s&&!!s.host&&!!s.mode}function k8(s){return!!vM(s)}function vM(s){for(;s.parentNode;){if(s===s.ownerDocument?.body)return null;s=s.parentNode}return $Ge(s)?s:null}function Bc(){let s=Hu().activeElement;for(;s?.shadowRoot;)s=s.shadowRoot.activeElement;return s}function av(s){return Bc()===s}function lTe(s){return wc(Bc(),s)}function kdt(s){return s.ownerDocument===Hu()}function Hu(){return ldt()<=1?si.document:Array.from(D8()).map(({window:e})=>e.document).find(e=>e.hasFocus())??si.document}function ky(){return Hu().defaultView?.window??si}const dTe=new Map;function GGe(){return new Idt}class Idt{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=gl(si.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function gl(s=si.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),s.appendChild(i),t&&t.add(Ee(()=>i.remove())),s===si.document.head){const n=new Set;dTe.set(i,n);for(const{window:o,disposables:r}of D8()){if(o===si)continue;const a=r.add(Tdt(i,n,o));t?.add(a)}}return i}function Tdt(s,e,t){const i=new Z,n=s.cloneNode(!0);t.document.head.appendChild(n),i.add(Ee(()=>n.remove()));for(const o of qGe(s))n.sheet?.insertRule(o.cssText,n.sheet?.cssRules.length);return i.add(Ldt.observe(s,i,{childList:!0})(()=>{n.textContent=s.textContent})),e.add(n),i.add(Ee(()=>e.delete(n))),i}const Ldt=new class{constructor(){this.mutationObservers=new Map}observe(s,e,t){let i=this.mutationObservers.get(s);i||(i=new Map,this.mutationObservers.set(s,i));const n=Wc(t);let o=i.get(n);if(o)o.users+=1;else{const r=new I,a=new MutationObserver(l=>r.fire(l));a.observe(s,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(n),i?.size===0&&this.mutationObservers.delete(s))})),i.set(n,o)}return o.onDidMutate}};let xde=null;function KGe(){return xde||(xde=gl()),xde}function qGe(s){return s?.sheet?.rules?s.sheet.rules:s?.sheet?.cssRules?s.sheet.cssRules:[]}function Uf(s,e,t=KGe()){if(!(!t||!e)){t.sheet?.insertRule(`${s} {${e}}`,0);for(const i of dTe.get(t)??[])Uf(s,e,i)}}function CS(s,e=KGe()){if(!e)return;const t=qGe(e),i=[];for(let n=0;n=0;n--)e.sheet?.deleteRule(i[n]);for(const n of dTe.get(e)??[])CS(s,n)}function Rdt(s){return typeof s.selectorText=="string"}function Yr(s){return s instanceof HTMLElement||s instanceof ct(s).HTMLElement}function XFe(s){return s instanceof HTMLAnchorElement||s instanceof ct(s).HTMLAnchorElement}function Mdt(s){return s instanceof HTMLTextAreaElement||s instanceof ct(s).HTMLTextAreaElement}function Ndt(s){return s instanceof HTMLInputElement||s instanceof ct(s).HTMLInputElement}function Pdt(s){return s instanceof SVGElement||s instanceof ct(s).SVGElement}function hTe(s){return s instanceof MouseEvent||s instanceof ct(s).MouseEvent}function d_(s){return s instanceof KeyboardEvent||s instanceof ct(s).KeyboardEvent}function Fdt(s){return s instanceof DragEvent||s instanceof ct(s).DragEvent}const ke={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:vT?"webkitAnimationStart":"animationstart",ANIMATION_END:vT?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:vT?"webkitAnimationIteration":"animationiteration"};function Odt(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const en={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function Bdt(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function Wdt(s,e){for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)s.scrollTop!==e[t]&&(s.scrollTop=e[t]),s=s.parentNode}class zj extends V{static hasFocusWithin(e){if(Yr(e)){const t=vM(e),i=t?t.activeElement:e.ownerDocument.activeElement;return wc(i,e)}else{const t=e;return wc(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=zj.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(Yr(e)?ct(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{zj.hasFocusWithin(e)!==t&&(t?o():n())},this._register(ue(e,ke.FOCUS,n,!0)),this._register(ue(e,ke.BLUR,o,!0)),Yr(e)&&(this._register(ue(e,ke.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ue(e,ke.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Ac(s){return new zj(s)}function QGe(s,e){return s.after(e),e}function re(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Ore(s,e){return s.insertBefore(e,s.firstChild),e}function aa(s,...e){s.innerText="",re(s,...e)}const Hdt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var I8;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(I8||(I8={}));function jGe(s,e,t,...i){const n=Hdt.exec(e);if(!n)throw new Error("Bad use of emmet");const o=n[1]||"div";let r;return s!==I8.HTML?r=document.createElementNS(s,o):r=document.createElement(o),n[3]&&(r.id=n[3]),n[4]&&(r.className=n[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 fe(s,e,...t){return jGe(I8.HTML,s,e,...t)}fe.SVG=function(s,e,...t){return jGe(I8.SVG,s,e,...t)};function uTe(s,...e){s?Yh(...e):zd(...e)}function Yh(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function zd(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function ZFe(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function YGe(s){si.open(s,"_blank","noopener")}function Udt(s,e){const t=()=>{e(),i=Ll(s,t)};let i=Ll(s,t);return Ee(()=>i.dispose())}E8.setPreferredWebSchema(/^https:/.test(si.location.href)?"https":"http");function Zu(s){return s?`url('${ef.uriToBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function mq(s){return`'${s.replace(/'/g,"%27")}'`}function Iy(s,e){if(s!==void 0){const t=s.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Iy(i[1].trim(),e)),`var(${i[0]}, ${e})`}return s}return e}function Vdt(s,e){let t;if(N.isUri(s))t=s.toString(!0);else{const o=new Blob([s]);t=URL.createObjectURL(o),setTimeout(()=>URL.revokeObjectURL(t))}const i=ky(),n=document.createElement("a");i.document.body.appendChild(n),n.download=e,n.href=t,n.click(),setTimeout(()=>n.remove())}function zdt(){return new Promise(s=>{const e=ky(),t=document.createElement("input");e.document.body.appendChild(t),t.type="file",t.multiple=!0,M.once(M.fromDOMEventEmitter(t,"input"))(()=>{s(t.files??void 0)}),t.click(),setTimeout(()=>t.remove())})}var e5;(function(s){s[s.DOCUMENT=1]="DOCUMENT",s[s.BROWSER=2]="BROWSER"})(e5||(e5={}));function $dt(s){return s.document.fullscreenElement||s.document.webkitFullscreenElement||s.document.webkitIsFullScreen?{mode:e5.DOCUMENT,guess:!1}:s.innerHeight===s.screen.height?{mode:e5.BROWSER,guess:!1}:(Qt||pr)&&s.outerHeight===s.screen.height&&s.outerWidth===s.screen.width?{mode:e5.BROWSER,guess:!0}:null}function Gdt(s,e=!1){const t=document.createElement("a");return BGe("afterSanitizeAttributes",i=>{for(const n of["href","src"])if(i.hasAttribute(n)){const o=i.getAttribute(n);if(n==="href"&&o.startsWith("#"))continue;if(t.href=o,!s.includes(t.protocol.replace(/:$/,""))){if(e&&n==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(n)}}}),Ee(()=>{WGe("afterSanitizeAttributes")})}pe.http,pe.https,pe.command;const Kdt=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 qdt(s){const e=new Uint16Array(s.length);for(let n=0;nthis.registerListeners(e,t),{window:si,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ue(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new En(i);if(!(n.keyCode===S.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(n.keyCode!==S.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(ue(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(ue(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ue(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ue(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(ue(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 pb.instance||(pb.instance=new pb),pb.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class $j extends V{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(ue(this.element,ke.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(ue(this.element,ke.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(ue(this.element,ke.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(ue(this.element,ke.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(ue(this.element,ke.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(ue(this.element,ke.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(ue(this.element,ke.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const JGe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Bt(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=JGe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElement(o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const l of n.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(n.groups.name&&(c[n.groups.name]=r),i)for(const l of i)Yr(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(Gj(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(Gj(l),d.toString());return c.root=r,c}function tP(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=JGe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElementNS("http://www.w3.org/2000/svg",o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const l of n.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(n.groups.name&&(c[n.groups.name]=r),i)for(const l of i)Yr(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(Gj(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(Gj(l),d.toString());return c.root=r,c}function Gj(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Qdt extends V{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 jdt extends V{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 Qdt(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,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n}}class Ydt{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=F2(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=A2(new jdt(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),A2(M.once(hdt)(({vscodeWindowId:n})=>{n===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const L8=new Ydt;class XGe{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=wf(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=wf(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=wf(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=wf(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=wf(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=wf(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=wf(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=wf(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=wf(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=wf(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=wf(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=wf(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=wf(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=wf(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 wf(s){return typeof s=="number"?`${s}px`:s}function ls(s){return new XGe(s)}function Dl(s,e){s instanceof XGe?(s.setFontFamily(e.getMassagedFontFamily()),s.setFontWeight(e.fontWeight),s.setFontSize(e.fontSize),s.setFontFeatureSettings(e.fontFeatureSettings),s.setFontVariationSettings(e.fontVariationSettings),s.setLineHeight(e.lineHeight),s.setLetterSpacing(e.letterSpacing)):(s.style.fontFamily=e.getMassagedFontFamily(),s.style.fontWeight=e.fontWeight,s.style.fontSize=e.fontSize+"px",s.style.fontFeatureSettings=e.fontFeatureSettings,s.style.fontVariationSettings=e.fontVariationSettings,s.style.lineHeight=e.lineHeight+"px",s.style.letterSpacing=e.letterSpacing+"px")}var sc;(function(s){s[s.Regular=0]="Regular",s[s.Italic=1]="Italic",s[s.Bold=2]="Bold"})(sc||(sc={}));class Jdt{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class gTe{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(),this._container?.remove(),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");Dl(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Dl(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Dl(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const r of this._requests){let a;r.type===sc.Regular&&(a=t),r.type===sc.Bold&&(a=i),r.type===sc.Italic&&(a=n),a.appendChild(document.createElement("br"));const c=document.createElement("span");gTe._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 n=0;n<8;n++)i+=i;e.innerText=i}else{let i=t.chr;for(let n=0;n<8;n++)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 n=!1;for(const o of i)o.isTrusted||(n=!0,t.remove(o));n&&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!==ZGe)continue;const n=new _q(i,!1);this._writeToCache(e,n,n)}}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let n=this._actualReadFontInfo(e,t);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new _q({pixelRatio:L8.getInstance(e).value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,t,n)}return i.get(t)}_createRequest(e,t,i,n){const o=new Jdt(e,t);return i.push(o),n?.push(o),o}_actualReadFontInfo(e,t){const i=[],n=[],o=this._createRequest("n",sc.Regular,i,n),r=this._createRequest("m",sc.Regular,i,null),a=this._createRequest(" ",sc.Regular,i,n),c=this._createRequest("0",sc.Regular,i,n),l=this._createRequest("1",sc.Regular,i,n),d=this._createRequest("2",sc.Regular,i,n),h=this._createRequest("3",sc.Regular,i,n),u=this._createRequest("4",sc.Regular,i,n),f=this._createRequest("5",sc.Regular,i,n),p=this._createRequest("6",sc.Regular,i,n),m=this._createRequest("7",sc.Regular,i,n),v=this._createRequest("8",sc.Regular,i,n),b=this._createRequest("9",sc.Regular,i,n),w=this._createRequest("→",sc.Regular,i,n),y=this._createRequest("→",sc.Regular,i,null),C=this._createRequest("·",sc.Regular,i,n),A=this._createRequest("⸱",sc.Regular,i,null),L="|/-_ilm%";for(let G=0,Y=L.length;G.001){P=!1;break}}let z=!0;return P&&y.width!==R&&(z=!1),y.width>w.width&&(z=!1),new _q({pixelRatio:L8.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:P,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:C.width,wsmiddotWidth:A.width,maxDigitWidth:k},!0)}}class tht{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 ppe=new eht;var b_;(function(s){s.serviceIds=new Map,s.DI_TARGET="$di$target",s.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[s.DI_DEPENDENCIES]||[]}s.getServiceDependencies=e})(b_||(b_={}));const we=ae("instantiationService");function iht(s,e,t){e[b_.DI_TARGET]===e?e[b_.DI_DEPENDENCIES].push({id:s,index:t}):(e[b_.DI_DEPENDENCIES]=[{id:s,index:t}],e[b_.DI_TARGET]=e)}function ae(s){if(b_.serviceIds.has(s))return b_.serviceIds.get(s);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");iht(e,t,n)};return e.toString=()=>s,b_.serviceIds.set(s,e),e}const Kt=ae("codeEditorService"),gi=ae("modelService"),fn=ae("textModelService");function nht(s){return!!s.textEditorModel}function D(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}function _(s,e){return function(t,i){e(t,i,s)}}class rn extends V{constructor(e,t="",i="",n=!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=n,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 $_ extends V{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(n){i=n}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const Mz=class Mz{constructor(){this.id=Mz.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 Mz,...i]:t=i);return t}async run(){}};Mz.ID="vs.actions.separator";let Ar=Mz;class Nk{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}const Hne=class Hne extends rn{constructor(){super(Hne.ID,g(1610,"(empty)"),void 0,!1)}};Hne.ID="vs.actions.empty";let mpe=Hne;function rl(s){return{id:s.id,label:s.label,tooltip:s.tooltip??s.label,class:s.class,enabled:s.enabled??!0,checked:s.checked,run:async(...e)=>s.run(...e)}}var O2;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(O2||(O2={}));function eOe(s){return{id:s}}var We;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9-]+",s.iconModifierExpression="~[A-Za-z]+",s.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function t(u){const f=e.exec(u.id);if(!f)return t(ve.error);const[,p,m]=f,v=["codicon","codicon-"+p];return m&&v.push("codicon-modifier-"+m.substring(1)),v}s.asClassNameArray=t;function i(u){return t(u).join(" ")}s.asClassName=i;function n(u){return"."+t(u).join(".")}s.asCSSSelector=n;function o(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||O2.isThemeColor(u.color))}s.isThemeIcon=o;const r=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(u){const f=r.exec(u);if(!f)return;const[,p]=f;return{id:p}}s.fromString=a;function c(u){return{id:u}}s.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}}s.modify=l;function d(u){const f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}s.getModifier=d;function h(u,f){return u.id===f.id&&u.color?.id===f.color?.id}s.isEqual=h})(We||(We={}));const vi=ae("commandService"),_t=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new I,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,e){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:s,handler:e})}if(s.metadata&&Array.isArray(s.metadata.args)){const r=[];for(const c of s.metadata.args)r.push(c.constraint);const a=s.handler;s.handler=function(c,...l){return mrt(l,r),a(c,...l)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new hl,this._commands.set(t,i));const n=i.unshift(s),o=Ee(()=>{n(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(s,e){return _t.registerCommand(s,(t,...i)=>t.get(vi).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return hi.first(e)}getCommands(){const s=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&s.set(e,t)}return s}};_t.registerCommand("noop",()=>{});const Le=ae("contextKeyService");function Yf(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function Z7(s,e="Unreachable"){throw new Error(e)}function tOe(s){s||vt(new Ni("Soft Assertion Failed"))}function G_(s){if(!s()){debugger;s(),vt(new Ni("Assertion Failed"))}}function bU(s,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(rht)),this._cachedMergedKeybindings.slice(0)}}const So=new fTe,oht={EditorModes:"platform.keybindingsRegistry"};Qe.add(oht.EditorModes,So);function rht(s,e){if(s.weight1!==e.weight1)return s.weight1-e.weight1;if(s.command&&e.command){if(s.commande.command)return 1}return s.weight2-e.weight2}var vq;function bT(s){return s.command!==void 0}function aht(s){return s.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.DebugCallStackToolbar=new te("DebugCallStackToolbar"),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.SCMChangesContext=new te("SCMChangesContext"),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.TestProfilesContext=new te("TestProfilesContext"),te.TestMessageContext=new te("TestMessageContext"),te.TestMessageContent=new te("TestMessageContent"),te.TestPeekElement=new te("TestPeekElement"),te.TestPeekTitle=new te("TestPeekTitle"),te.TestCallStack=new te("TestCallStack"),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.InteractiveInputConfig=new te("InteractiveInputConfig"),te.ReplInputExecute=new te("ReplInputExecute"),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.InlineEditsActions=new te("InlineEditsActions"),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 _e=te;const Nz=class Nz{static for(e){let t=this._all.get(e);return t||(t=new Nz(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Nz&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Nz._all=new Map;let F0=Nz;const jn=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new jrt({merge:F0.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(s){return this._commands.set(s.id,s),this._onDidChangeMenu.fire(F0.for(_e.CommandPalette)),Ee(()=>{this._commands.delete(s.id)&&this._onDidChangeMenu.fire(F0.for(_e.CommandPalette))})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((e,t)=>s.set(t,e)),s}appendMenuItem(s,e){let t=this._menuItems.get(s);t||(t=new hl,this._menuItems.set(s,t));const i=t.push(e);return this._onDidChangeMenu.fire(F0.for(s)),Ee(()=>{i(),this._onDidChangeMenu.fire(F0.for(s))})}appendMenuItems(s){const e=new Z;for(const{id:t,item:i}of s)e.add(this.appendMenuItem(t,i));return e}getMenuItems(s){let e;return this._menuItems.has(s)?e=[...this._menuItems.get(s)]:e=[],s===_e.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(s){const e=new Set;for(const t of s)bT(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||s.push({command:t})})}};class Ty extends Nk{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 Sc=vq=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,n,o,r,a){this.hideActions=n,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=vq.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&&We.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=We.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new vq(t,void 0,i,n,void 0,r,a):void 0,this._options=i,this.class=c&&We.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)}};Sc=vq=D([_(5,Le),_(6,vi)],Sc);class li{constructor(e){this.desc=e}}function At(s){const e=[],t=new s,{f1:i,menu:n,keybinding:o,...r}=t.desc;if(_t.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(_t.registerCommand({id:r.id,handler:(a,...c)=>t.run(a,...c),metadata:r.metadata})),Array.isArray(n))for(const a of n)e.push(jn.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else n&&e.push(jn.appendMenuItem(n.id,{command:{...r,precondition:n.precondition===null?void 0:r.precondition},...n}));if(i&&(e.push(jn.appendMenuItem(_e.CommandPalette,{command:r,when:r.precondition})),e.push(jn.addCommand(r))),Array.isArray(o))for(const a of o)e.push(So.registerKeybindingRule({...a,id:r.id,when:r.precondition?he.and(r.precondition,a.when):a.when}));else o&&e.push(So.registerKeybindingRule({...o,id:r.id,when:r.precondition?he.and(r.precondition,o.when):o.when}));return{dispose(){bt(e)}}}const Yi=ae("telemetryService"),cht=ae("customEndpointTelemetryService"),Ge=ae("logService"),uf=ae("loggerService");var ri;(function(s){s[s.Eager=0]="Eager",s[s.AfterFirstRender=1]="AfterFirstRender",s[s.BeforeFirstInteraction=2]="BeforeFirstInteraction",s[s.Eventually=3]="Eventually",s[s.Lazy=4]="Lazy"})(ri||(ri={}));let Bre=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=he.and(i,this.precondition):i=this.precondition);const n={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};So.registerKeybindingRule(n)}}_t.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){jn.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 wI extends Bre{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Le).contextMatchesRules(i??void 0))return n(a,r,t)})}runCommand(e,t){return hc.runEditorCommand(e,t,this.precondition,(i,n,o)=>this.runEditorCommand(i,n,o))}}class tt extends hc{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(n){return n.menuId||(n.menuId=_e.EditorContext),n.title||(n.title=e.label),n.when=he.and(e.precondition,n.when),n}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(tt.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(Yi).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class tKe extends tt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,n)=>n[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=o.get(Le),a=o.get(Ge);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,n,...t)})}}function rg(s,e){_t.registerCommand(s,function(t,...i){const n=t.get(we),[o,r]=i;Tt(N.isUri(o)),Tt(oe.isIPosition(r));const a=t.get(gi).getModel(o);if(a){const c=oe.lift(r);return n.invokeFunction(e,a,c,...i.slice(2))}return t.get(fn).createModelReference(o).then(c=>new Promise((l,d)=>{try{const h=n.invokeFunction(e,c.object.textEditorModel,oe.lift(r),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function qe(s){return Jf.INSTANCE.registerEditorCommand(s),s}function Re(s){const e=new s;return Jf.INSTANCE.registerEditorAction(e),e}function iKe(s){return Jf.INSTANCE.registerEditorAction(s),s}function lht(s){Jf.INSTANCE.registerEditorAction(s)}function on(s,e,t){Jf.INSTANCE.registerEditorContribution(s,e,t)}function nKe(s,e){Jf.INSTANCE.registerDiffEditorContribution(s,e)}var ap;(function(s){function e(r){return Jf.INSTANCE.getEditorCommand(r)}s.getEditorCommand=e;function t(){return Jf.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return Jf.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(r){return Jf.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function o(){return Jf.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=o})(ap||(ap={}));const dht={EditorCommonContributions:"editor.contributions"},Une=class Une{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}};Une.INSTANCE=new Une;let Jf=Une;Qe.add(dht.EditorCommonContributions,Jf.INSTANCE);function e6(s){return s.register(),s}const sKe=e6(new wI({id:"undo",precondition:void 0,kbOpts:{weight:Ae.EditorCore,primary:U.CtrlCmd|S.KeyZ},menuOpts:[{menuId:_e.MenubarEditMenu,group:"1_do",title:g(550,"&&Undo"),order:1},{menuId:_e.CommandPalette,group:"",title:g(551,"Undo"),order:1}]}));e6(new eKe(sKe,{id:"default:undo",precondition:void 0}));const oKe=e6(new wI({id:"redo",precondition:void 0,kbOpts:{weight:Ae.EditorCore,primary:U.CtrlCmd|S.KeyY,secondary:[U.CtrlCmd|U.Shift|S.KeyZ],mac:{primary:U.CtrlCmd|U.Shift|S.KeyZ}},menuOpts:[{menuId:_e.MenubarEditMenu,group:"1_do",title:g(552,"&&Redo"),order:2},{menuId:_e.CommandPalette,group:"",title:g(553,"Redo"),order:1}]}));e6(new eKe(oKe,{id:"default:redo",precondition:void 0}));const hht=e6(new wI({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:Ae.EditorCore,kbExpr:null,primary:U.CtrlCmd|S.KeyA},menuOpts:[{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(554,"&&Select All"),order:1},{menuId:_e.CommandPalette,group:"",title:g(555,"Select All"),order:1}]})),uht="$initialize";let iOe=!1;function _pe(s){Wn&&(iOe||(iOe=!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(s.message))}var Wf;(function(s){s[s.Request=0]="Request",s[s.Reply=1]="Reply",s[s.SubscribeEvent=2]="SubscribeEvent",s[s.Event=3]="Event",s[s.UnsubscribeEvent=4]="UnsubscribeEvent"})(Wf||(Wf={}));class ght{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=Wf.Request}}class nOe{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=Wf.Reply}}class fht{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=Wf.SubscribeEvent}}class pht{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=Wf.Event}}class mht{constructor(e,t){this.vsWorker=e,this.req=t,this.type=Wf.UnsubscribeEvent}}class _ht{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((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new ght(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new I({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new fht(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new mht(this._workerId,i)),i=null}});return n.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case Wf.Reply:return this._handleReplyMessage(e);case Wf.Request:return this._handleRequestMessage(e);case Wf.SubscribeEvent:return this._handleSubscribeEventMessage(e);case Wf.Event:return this._handleEventMessage(e);case Wf.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(n=>{this._send(new nOe(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=SA(n.detail)),this._send(new nOe(this._workerId,t,void 0,SA(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new pht(this._workerId,t,n))});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===Wf.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{n?.(l)})),this._protocol=new _ht({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(aKe(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(rKe(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=W1e(i);this._onModuleLoaded=this._protocol.sendMessage(uht,[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)=>{n=d,this._onModuleLoaded.then(h=>{l(bht(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,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}function rKe(s){return s[0]==="o"&&s[1]==="n"&&Ow(s.charCodeAt(2))}function aKe(s){return/^onDynamic/.test(s)&&Ow(s.charCodeAt(9))}function bht(s,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},n=r=>function(a){return t(r,a)},o={};for(const r of s){if(aKe(r)){o[r]=n(r);continue}if(rKe(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function QA(s,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(s,e)}catch(i){vt(i);return}try{return globalThis.trustedTypes?.createPolicy(s,e)}catch(i){vt(i);return}}let Kj;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?Kj=globalThis.workerttPolicy:Kj=QA("defaultWorkerFactory",{createScriptURL:s=>s});function wht(s){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",s);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",s);return new Worker(Kj?Kj.createScriptURL(t):t,{name:s})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function yht(s){return typeof s.then=="function"}class Cht extends V{constructor(e,t,i,n,o){super(),this.id=t,this.label=i;const r=wht(i);yht(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){n(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(n){vt(n),vt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:n}))}})}}const Vne=class Vne{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++Vne.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new Cht(e,n,this._label||"anonymous"+n,t,o=>{_pe(o),this._webWorkerFailedBeforeError=o,i(o)})}};Vne.LAST_WORKER_ID=0;let vpe=Vne;var yr;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(yr||(yr={}));class kde{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 kde(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new kde({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new kde({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:g1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:g1.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}};g1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> - `,g1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `,g1.DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE=` - `;let bpe=g1;function E1(s,e){const t=s.getCount(),i=s.findTokenIndexAtOffset(e),n=s.getLanguageId(i);let o=i;for(;o+10&&s.getLanguageId(r-1)===n;)r--;return new Aht(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class Aht{constructor(e,t,i,n,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,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 wpe;(function(s){s[s.value=3]="value"})(wpe||(wpe={}));function Zb(s){return(s&wpe.value)!==0}function bq(s){const e=s;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function Ide(s){const e=s;return e?bq(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function jA(s,e){return new Eht(s,e)}class Eht{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?vt(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 n=i.indexOf(t);n>=0&&i.splice(n,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 xht(s,e){const t=[];let i;for(;(i=s.read())!==null;)t.push(i);return e(t)}function Dht(s,e,t){const i=[];let n;for(;(n=s.read())!==null&&i.length0?e(i):{read:()=>{if(i.length>0)return i.shift();if(typeof n<"u"){const o=n;return n=void 0,o}return s.read()}}}function pTe(s,e){return new Promise((t,i)=>{const n=[];kN(s,{onData:o=>{e&&n.push(o)},onError:o=>{e?i(o):t(void 0)},onEnd:()=>{t(e?e(n):void 0)}})})}function kN(s,e,t){s.on("error",i=>{t?.isCancellationRequested||e.onError(i)}),s.on("end",()=>{t?.isCancellationRequested||e.onEnd()}),s.on("data",i=>{t?.isCancellationRequested||e.onData(i)})}function kht(s,e){return new Promise((t,i)=>{const n=new Z,o=[],r=l=>{if(o.push(l),o.length>e)return n.dispose(),s.pause(),t({stream:s,buffer:o,ended:!1})},a=l=>(n.dispose(),i(l)),c=()=>(n.dispose(),t({stream:s,buffer:o,ended:!0}));n.add(Ee(()=>s.removeListener("error",a))),s.on("error",a),n.add(Ee(()=>s.removeListener("end",c))),s.on("end",c),n.add(Ee(()=>s.removeListener("data",r))),s.on("data",r)})}function Iht(s,e){const t=jA(e);return t.end(s),t}function Tht(s){let e=!1;return{read:()=>e?null:(e=!0,s)}}function Lht(s,e,t){const i=jA(t);return kN(s,{onData:n=>i.write(e.data(n)),onError:n=>i.error(e.error?e.error(n):n),onEnd:()=>i.end()}),i}const xG=typeof Buffer<"u",Rht=new ya(()=>new Uint8Array(256));let Tde,Lde;class $e{static alloc(e){return xG?new $e(Buffer.allocUnsafe(e)):new $e(new Uint8Array(e))}static wrap(e){return xG&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new $e(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&xG?new $e(Buffer.from(e)):(Tde||(Tde=new TextEncoder),new $e(Tde.encode(e)))}static fromByteArray(e){const t=$e.alloc(e.length);for(let i=0,n=e.length;i"u"){t=0;for(let o=0,r=e.length;on-t)return-1;const o=Rht.value;o.fill(e.length);for(let l=0;l>>0|s[e+1]<<8>>>0}function Pht(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function Iu(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function Tu(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function Fht(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0|s[e+2]<<16>>>0|s[e+3]<<24>>>0}function Oht(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255,e=e>>>8,s[t+2]=e&255,e=e>>>8,s[t+3]=e&255}function ype(s,e){return s[e]}function Cpe(s,e,t){s[t]=e}function Bht(s){return xht(s,e=>$e.concat(e))}function cKe(s){return Tht(s)}function eD(s){return pTe(s,e=>$e.concat(e))}async function Wht(s){return s.ended?$e.concat(s.buffer):$e.concat([...s.buffer,await eD(s.stream)])}function t6(s){return Iht(s,e=>$e.concat(e))}function lKe(s){return jA(e=>$e.concat(e),s)}function dKe(s){let e=0,t=0,i=0;const n=new Uint8Array(Math.floor(s.length/4*3)),o=a=>{switch(t){case 3:n[i++]=e|a,t=0;break;case 2:n[i++]=e|a>>>2,e=a<<6,t=3;break;case 1:n[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 ${s[a]}`)}}const r=i;for(;t>0;)o(0);return $e.wrap(n).slice(0,r)}const Hht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Uht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function mTe({buffer:s},e=!0,t=!1){const i=t?Uht:Hht;let n="";const o=s.byteLength%3;let r=0;for(;r>>2],n+=i[(a<<4|c>>>4)&63],n+=i[(c<<2|l>>>6)&63],n+=i[l&63]}if(o===1){const a=s[r+0];n+=i[a>>>2],n+=i[a<<4&63],e&&(n+="==")}else if(o===2){const a=s[r+0],c=s[r+1];n+=i[a>>>2],n+=i[(a<<4|c>>>4)&63],n+=i[c<<2&63],e&&(n+="=")}return n}let Rde;function hKe(){return Rde||(Rde=new TextDecoder("UTF-16LE")),Rde}let Mde;function Vht(){return Mde||(Mde=new TextDecoder("UTF-16BE")),Mde}let Nde;function uKe(){return Nde||(Nde=z1e()?hKe():Vht()),Nde}function zht(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?$ht(s,e,t):hKe().decode(i)}function $ht(s,e,t){const i=[];let n=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},n=(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 Kht{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Ght(t);this.brackets=i.map((n,o)=>new qj(e,o,n.open,n.close,qht(n.open,n.close,i,o),Qht(n.open,n.close,i,o))),this.forwardRegex=jht(this.brackets),this.reversedRegex=Yht(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const o of n.open)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of n.close)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function gKe(s,e,t,i){for(let n=0,o=e.length;n=0&&i.push(a);for(const a of r.close)a.indexOf(s)>=0&&i.push(a)}}function fKe(s,e){return s.length-e.length}function Wre(s){if(s.length<=1)return s;const e=[],t=new Set;for(const i of s)t.has(i)||(e.push(i),t.add(i));return e}function qht(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o=0;r--)n[o++]=i.charCodeAt(r);return uKe().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class Om{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,c=n+r;return new F(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,n,o){const a=_Te(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){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=n+r;return new F(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,n,o){const r=i.substring(n,o);return this.findNextBracketInText(e,t,r,n)}}class Xht{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 n=i.charAt(i.length-1);e.push(n)}return ja(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(Zb(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Om.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 mb;(function(s){s[s.INCREASE_MASK=1]="INCREASE_MASK",s[s.DECREASE_MASK=2]="DECREASE_MASK",s[s.INDENT_NEXTLINE_MASK=4]="INDENT_NEXTLINE_MASK",s[s.UNINDENT_MASK=8]="UNINDENT_MASK"})(mb||(mb={}));function DG(s){return s.global&&(s.lastIndex=0),!0}class Zht{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&DG(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&DG(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&DG(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&DG(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=mb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=mb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=mb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=mb.UNINDENT_MASK),t}}class ZP{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=ZP._createOpenBracketRegExp(t[0]),n=ZP._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=ll.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>=ll.Brackets&&i.length>0&&n.length>0)for(let o=0,r=this._brackets.length;o=ll.Brackets&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function out(s){return s.replace(/[\[\]]/g,"")}function rut(s){let e=!1;const t=new Map,i=new Map;if(aut(s,d=>{if(s===d)return!0;const h=JSON.stringify(d);if(h.length<30)return!0;const u=t.get(h);if(!u){const f={schemas:[d]};return t.set(h,f),i.set(d,f),!0}return u.schemas.push(d),i.set(d,u),e=!0,!1}),t.clear(),!e)return JSON.stringify(s);let o="$defs";for(;s.hasOwnProperty(o);)o+="_";const r=[];function a(d){return JSON.stringify(d,(h,u)=>{if(u!==d){const f=i.get(u);if(f&&f.schemas.length>1)return f.id||(f.id=`_${r.length}`,r.push(f.schemas[0])),{$ref:`#/${o}/${f.id}`}}return u})}const c=a(s),l=[];for(let d=0;d{for(const l of c)iP(l)&&r.push(l)},i=(...c)=>{for(const l of c)if(iP(l))for(const d in l){const h=l[d];iP(h)&&r.push(h)}},n=(...c)=>{for(const l of c)if(Array.isArray(l))for(const d of l)iP(d)&&r.push(d)},o=c=>{if(Array.isArray(c))for(const l of c)iP(l)&&r.push(l);else iP(c)&&r.push(c)},r=[s];let a=r.pop();for(;a;)e(a)&&(t(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),i(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),n(a.anyOf,a.allOf,a.oneOf,a.prefixItems),o(a.items)),a=r.pop()}const YA={JSONContribution:"base.contributions.json"};function cut(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class lut{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[cut(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){const t=this.schemasById[e];return t?rut(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}}const dut=new lut;Qe.add(YA.JSONContribution,dut);var sOe;(function(s){s.Multiline="multilineText",s.Singleline="singlelineText"})(sOe||(sOe={}));const Nn={Configuration:"base.contributions.configuration"};var at;(function(s){s[s.APPLICATION=1]="APPLICATION",s[s.MACHINE=2]="MACHINE",s[s.WINDOW=3]="WINDOW",s[s.RESOURCE=4]="RESOURCE",s[s.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",s[s.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(at||(at={}));const Dg={properties:{},patternProperties:{}},X4={properties:{},patternProperties:{}},eF={properties:{},patternProperties:{}},aS={properties:{},patternProperties:{}},cS={properties:{},patternProperties:{}},qv={properties:{},patternProperties:{}},bE="vscode://schemas/settings/resourceLanguage",bKe="vscode://schemas/settings/configurationDefaults",kG=Qe.as(YA.JSONContribution);class hut{constructor(){this.registeredConfigurationDefaults=[],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(472,"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={},kG.registerSchema(bE,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),kG.registerSchema(bE,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),kG.registerSchema(bE,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),kG.registerSchema(bE,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){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:n,source:o}of e)for(const r in n){t.add(r);const a=this.configurationDefaultsOverrides.get(r)??this.configurationDefaultsOverrides.set(r,{configurationDefaultOverrides:[]}).get(r),c=n[r];if(a.configurationDefaultOverrides.push({value:c,source:o}),tf.test(r)){const l=this.mergeDefaultConfigurationsForOverrideIdentifier(r,c,o,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l,this.updateDefaultOverrideProperty(r,l,o),i.push(...M8(r))}else{const l=this.mergeDefaultConfigurationsForConfigurationProperty(r,c,o,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l;const d=this.configurationProperties[r];d&&(this.updatePropertyDefaultValue(r,d),this.updateSchema(r,d))}}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 i of e){const n=this.registeredConfigurationDefaults.indexOf(i);n!==-1&&this.registeredConfigurationDefaults.splice(n,1)}for(const{overrides:i,source:n}of e)for(const o in i){const r=this.configurationDefaultsOverrides.get(o);if(!r)continue;const a=r.configurationDefaultOverrides.findIndex(c=>n?c.source?.id===n.id:c.value===i[o]);if(a!==-1){if(r.configurationDefaultOverrides.splice(a,1),r.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(o),tf.test(o)){let c;for(const l of r.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(o,l.value,l.source,c);c&&!CA(c.value)?(r.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(o,c,n)):(this.configurationDefaultsOverrides.delete(o),delete this.configurationProperties[o],delete this.defaultLanguageConfigurationOverridesNode.properties[o])}else{let c;for(const d of r.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(o,d.value,d.source,c);r.configurationDefaultOverrideValue=c;const l=this.configurationProperties[o];l&&(this.updatePropertyDefaultValue(o,l),this.updateSchema(o,l))}t.add(o)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,t,i){const n={type:"object",default:t.value,description:g(473,"Configure settings to be overridden for the {0} language.",out(e)),$ref:bE,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const o=n?.value||{},r=n?.source??new Map;if(!(r instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const c=t[a];if(kn(c)&&(Ya(o[a])||kn(o[a]))){if(o[a]={...o[a]??{},...c},i)for(const d in c)r.set(`${a}.${d}`,i)}else o[a]=c,i?r.set(a,i):r.delete(a)}return{value:o,source:r}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const o=this.configurationProperties[e],r=n?.value??o?.defaultDefaultValue;let a=i;if(kn(t)&&(o!==void 0&&o.type==="object"||o===void 0&&(Ya(r)||kn(r)))){if(a=n?.source??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const l in t)i&&a.set(`${e}.${l}`,i);t={...kn(r)?r:{},...t}}return{value:t,source:a}}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(n=>{this.validateAndRegisterProperties(n,t,n.extensionInfo,n.restrictedProperties,void 0,i),this.configurationContributors.push(n),this.registerJSONConfiguration(n)})}doDeregisterConfigurations(e,t){const i=n=>{if(n.properties)for(const o in n.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,n.properties[o])}n.allOf?.forEach(o=>i(o))};for(const n of e){i(n);const o=this.configurationContributors.indexOf(n);o!==-1&&this.configurationContributors.splice(o,1)}}validateAndRegisterProperties(e,t=!0,i,n,o=at.WINDOW,r){o=ra(e.scope)?o:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&SKe(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),tf.test(l)?d.scope=void 0:(d.scope=ra(d.scope)?o:d.scope,d.restricted=ra(d.restricted)?!!n?.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,n,o,r)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){const e=new Map;for(const[t,i]of this.configurationDefaultsOverrides)i.configurationDefaultOverrideValue&&e.set(t,i.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){const t=i=>{const n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Dg.properties[e]=t,t.scope){case at.APPLICATION:X4.properties[e]=t;break;case at.MACHINE:eF.properties[e]=t;break;case at.MACHINE_OVERRIDABLE:aS.properties[e]=t;break;case at.WINDOW:cS.properties[e]=t;break;case at.RESOURCE:qv.properties[e]=t;break;case at.LANGUAGE_OVERRIDABLE:qv.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Dg.properties[e],t.scope){case at.APPLICATION:delete X4.properties[e];break;case at.MACHINE:delete eF.properties[e];break;case at.MACHINE_OVERRIDABLE:delete aS.properties[e];break;case at.WINDOW:delete cS.properties[e];break;case at.RESOURCE:case at.LANGUAGE_OVERRIDABLE:delete qv.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:g(474,"Configure editor settings to be overridden for a language."),errorMessage:g(475,"This setting does not support per-language configuration."),$ref:bE};this.updatePropertyDefaultValue(t,i),Dg.properties[t]=i,X4.properties[t]=i,eF.properties[t]=i,aS.properties[t]=i,cS.properties[t]=i,qv.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:g(474,"Configure editor settings to be overridden for a language."),errorMessage:g(475,"This setting does not support per-language configuration."),$ref:bE};Dg.patternProperties[IE]=e,X4.patternProperties[IE]=e,eF.patternProperties[IE]=e,aS.patternProperties[IE]=e,cS.patternProperties[IE]=e,qv.patternProperties[IE]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,o;i&&(!t.disallowConfigurationDefault||!i.source)&&(n=i.value,o=i.source),Ya(n)&&(n=t.defaultDefaultValue,o=void 0),Ya(n)&&(n=CKe(t.type)),t.default=n,t.defaultValueSource=o}}const wKe="\\[([^\\]]+)\\]",oOe=new RegExp(wKe,"g"),IE=`^(${wKe})+$`,tf=new RegExp(IE);function M8(s){const e=[];if(tf.test(s)){let t=oOe.exec(s);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=oOe.exec(s)}}return ja(e)}function yKe(s){return s.reduce((e,t)=>`${e}[${t}]`,"")}function CKe(s){switch(Array.isArray(s)?s[0]:s){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const t5=new hut;Qe.add(Nn.Configuration,t5);function SKe(s,e){return s.trim()?tf.test(s)?g(477,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):t5.getConfigurationProperties()[s]!==void 0?g(478,"Cannot register '{0}'. This property is already registered.",s):e.policy?.name&&t5.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(479,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",s,e.policy?.name,t5.getPolicyConfigurations().get(e.policy?.name)):null:g(476,"Cannot register an empty property")}function uut(){const s=[],e=t5.getConfigurationProperties();for(const t of Object.keys(e))s.push([t,e[t].scope]);return s.push(["launch",at.RESOURCE]),s.push(["task",at.RESOURCE]),s}function AKe(s){const e={};for(const t of s){const i=t.properties;if(kn(i))for(const n in i)e[n]=i[n];t.allOf&&Object.assign(e,AKe(t.allOf))}return e}function gut(s){switch(s){case"application":return at.APPLICATION;case"machine":return at.MACHINE;case"resource":return at.RESOURCE;case"machine-overridable":return at.MACHINE_OVERRIDABLE;case"language-overridable":return at.LANGUAGE_OVERRIDABLE;default:return at.WINDOW}}const fut={ModesRegistry:"editor.modesRegistry"};class put{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 _ut(this,a,c),closing:c}}),o=new xj(a=>{const c=new Set,l=new Set;return{info:new vut(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=n.get(a),d=o.get(c);l.closing.add(d.info),d.opening.add(l.info)}const r=t.colorizedBracketPairs?rOe(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of r){const l=n.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([...n.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 i6(t,e)}}function rOe(s){return s.filter(([e,t])=>e!==""&&t!=="")}class xKe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class _ut extends xKe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class vut extends xKe{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,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 Fde{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Vs=ae("languageConfigurationService");let Ape=class extends V{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new Cut),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(Epe));this._register(this.configurationService.onDidChangeConfiguration(n=>{const o=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new Fde(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Fde(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new Fde(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=but(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};Ape=D([_(0,Te),_(1,xi)],Ape);function but(s,e,t,i){let n=e.getLanguageConfiguration(s);if(!n){if(!i.isRegisteredLanguageId(s))return new LO(s,{});n=new LO(s,{})}const o=wut(n.languageId,t),r=kKe([n.underlyingConfig,o]);return new LO(n.languageId,r)}const Epe={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function wut(s,e){const t=e.getValue(Epe.brackets,{overrideIdentifier:s}),i=e.getValue(Epe.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:aOe(t),colorizedBracketPairs:aOe(i)}}function aOe(s){if(Array.isArray(s))return s.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function DKe(s,e,t){const i=s.getLineContent(e);let n=ho(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class yut{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new cOe(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let n=0;ne.configuration)))}}function kKe(s){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 s)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 cOe{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 lOe{constructor(e){this.languageId=e}}class Cut extends V{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Ca,{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 n=this._entries.get(e);n||(n=new yut(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new lOe(e)),Ee(()=>{o.dispose(),this._onDidChange.fire(new lOe(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class LO{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 ZP(this.underlyingConfig):null,this.comments=LO._handleComments(this.underlyingConfig),this.characterPair=new bpe(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||j1e,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Zht(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new mut(e,this.underlyingConfig)}getWordDefinition(){return O7(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Kht(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Xht(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Sht(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[n,o]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=o}return i}}ce(Vs,Ape,qt.Delayed);class wE{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class dOe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new wE(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Un.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Un.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 Vw{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,r]=Vw._getElements(e),[a,c,l]=Vw._getElements(t);this._hasStrings=r&&l,this._originalStringElements=n,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(Vw._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,o=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(nP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new wE(e,0,i,n-i+1)]):e<=t?(nP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new wE(e,t-e+1,i,0)]):(nP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),nP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,n,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 wE(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,n,o),this.ConcatenateChanges(h,u)}return[new wE(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){let y=null,C=null,A=new hOe,L=t,k=i,P=f[0]-v[0]-n,R=Un.MIN_SAFE_SMALL_INTEGER,z=this.m_forwardHistory.length-1;do{const G=P+e;G===L||G=0&&(l=this.m_forwardHistory[z],e=l[0],L=1,k=l.length-1)}while(--z>=-1);if(y=A.getReverseChanges(),w[0]){let G=f[0]+1,Y=v[0]+1;if(y!==null&&y.length>0){const j=y[y.length-1];G=Math.max(G,j.getOriginalEnd()),Y=Math.max(Y,j.getModifiedEnd())}C=[new wE(G,u-G+1,Y,m-Y+1)]}else{A=new hOe,L=r,k=a,P=f[0]-v[0]-c,R=Un.MAX_SAFE_SMALL_INTEGER,z=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const G=P+o;G===L||G=d[G+1]?(h=d[G+1]-1,p=h-P-c,h>R&&A.MarkNextChange(),R=h+1,A.AddOriginalElement(h+1,p+1),P=G+1-o):(h=d[G-1],p=h-P-c,h>R&&A.MarkNextChange(),R=h,A.AddModifiedElement(h+1,p+1),P=G-1-o),z>=0&&(d=this.m_reverseHistory[z],o=d[0],L=1,k=d.length-1)}while(--z>=-1);C=A.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,n,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+(n-i),m=p+1,v=new Int32Array(m),b=new Int32Array(m),w=n-i,y=t-e,C=e-i,A=t-n,k=(y-w)%2===0;v[w]=e,b[y]=t,a[0]=!1;for(let P=1;P<=p/2+1;P++){let R=0,z=0;d=this.ClipDiagonalBound(w-P,P,w,m),h=this.ClipDiagonalBound(w+P,P,w,m);for(let Y=d;Y<=h;Y+=2){Y===d||YR+z&&(R=c,z=l),!k&&Math.abs(Y-y)<=P-1&&c>=b[Y])return o[0]=c,r[0]=l,j<=b[Y]&&EC.MaxDifferencesHistory>0&&P<=EC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):null}const G=(R-e+(z-i)-P)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(R,G))return a[0]=!0,o[0]=R,r[0]=z,G>0&&EC.MaxDifferencesHistory>0&&P<=EC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):(e++,i++,[new wE(e,t-e+1,i,n-i+1)]);u=this.ClipDiagonalBound(y-P,P,y,m),f=this.ClipDiagonalBound(y+P,P,y,m);for(let Y=u;Y<=f;Y+=2){Y===u||Y=b[Y+1]?c=b[Y+1]-1:c=b[Y-1],l=c-(Y-y)-A;const j=c;for(;c>e&&l>i&&this.ElementsAreEqual(c,l);)c--,l--;if(b[Y]=c,k&&Math.abs(Y-w)<=P&&c<=v[Y])return o[0]=c,r[0]=l,j>=v[Y]&&EC.MaxDifferencesHistory>0&&P<=EC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):null}if(P<=EC.MaxDifferencesHistory){let Y=new Int32Array(h-d+2);Y[0]=w-d+1,sP.Copy2(v,d,Y,1,h-d+1),this.m_forwardHistory.push(Y),Y=new Int32Array(f-u+2),Y[0]=y-u+1,sP.Copy2(b,u,Y,1,f-u+1),this.m_reverseHistory.push(Y)}}return this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,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 n=0,o=0;if(t>0){const h=e[t-1];n=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 n=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,n){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?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 n=new Array(e.length+t.length-1);return sP.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],sP.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return sP.Copy(e,0,n,0,e.length),sP.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(nP.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),nP.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 n=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 wE(n,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=XN(e),t=XN(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(n.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=XN(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,n=0,o=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],r=o-this.values[n],e=o)t=n+1;else break;return new IKe(n,e-r)}}class Eut{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 IKe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=N7(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]=n+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 i5;(function(s){s[s.False=0]="False",s[s.True=1]="True"})(i5||(i5={}));class jj{constructor(){this._actual=new yU(i5.False)}add(e){this._actual.set(e,i5.True)}has(e){return this._actual.get(e)===i5.True}clear(){return this._actual.clear()}}var Ri;(function(s){s[s.Invalid=0]="Invalid",s[s.Start=1]="Start",s[s.H=2]="H",s[s.HT=3]="HT",s[s.HTT=4]="HTT",s[s.HTTP=5]="HTTP",s[s.F=6]="F",s[s.FI=7]="FI",s[s.FIL=8]="FIL",s[s.BeforeColon=9]="BeforeColon",s[s.AfterColon=10]="AfterColon",s[s.AlmostThere=11]="AlmostThere",s[s.End=12]="End",s[s.Accept=13]="Accept",s[s.LastKnownState=14]="LastKnownState"})(Ri||(Ri={}));class xut{constructor(e,t,i){const n=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 n=new xut(i,t,Ri.Invalid);for(let o=0,r=e.length;o=this._maxCharCode?Ri.Invalid:this._states.get(e,t)}}let Ode=null;function Dut(){return Ode===null&&(Ode=new LKe([[Ri.Start,B.h,Ri.H],[Ri.Start,B.H,Ri.H],[Ri.Start,B.f,Ri.F],[Ri.Start,B.F,Ri.F],[Ri.H,B.t,Ri.HT],[Ri.H,B.T,Ri.HT],[Ri.HT,B.t,Ri.HTT],[Ri.HT,B.T,Ri.HTT],[Ri.HTT,B.p,Ri.HTTP],[Ri.HTT,B.P,Ri.HTTP],[Ri.HTTP,B.s,Ri.BeforeColon],[Ri.HTTP,B.S,Ri.BeforeColon],[Ri.HTTP,B.Colon,Ri.AfterColon],[Ri.F,B.i,Ri.FI],[Ri.F,B.I,Ri.FI],[Ri.FI,B.l,Ri.FIL],[Ri.FI,B.L,Ri.FIL],[Ri.FIL,B.e,Ri.BeforeColon],[Ri.FIL,B.E,Ri.BeforeColon],[Ri.BeforeColon,B.Colon,Ri.AfterColon],[Ri.AfterColon,B.Slash,Ri.AlmostThere],[Ri.AlmostThere,B.Slash,Ri.End]])),Ode}var xa;(function(s){s[s.None=0]="None",s[s.ForceTermination=1]="ForceTermination",s[s.CannotEndIn=2]="CannotEndIn"})(xa||(xa={}));let r4=null;function kut(){if(r4===null){r4=new yU(xa.None);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),c=t.charCodeAt(r);(a===B.OpenParen&&c===B.CloseParen||a===B.OpenSquareBracket&&c===B.CloseSquareBracket||a===B.OpenCurlyBrace&&c===B.CloseCurlyBrace)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=Dut()){const i=kut(),n=[];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=Ri.Start,f=!1,p=!1,m=!1,v=!1;for(;l=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}};zne.INSTANCE=new zne;let xpe=zne;var zr;(function(s){s[s.Regular=0]="Regular",s[s.Whitespace=1]="Whitespace",s[s.WordSeparator=2]="WordSeparator"})(zr||(zr={}));class Tut extends yU{constructor(e,t){super(zr.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,n=e.length;it)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=K6e(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 Rut(t,this.wordSeparators?fm(this.wordSeparators,[]):null,i?this.searchString:null)}}function RKe(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e=t)break;const n=s.charCodeAt(e);if(n===B.n||n===B.r||n===B.W)return!0}}return!1}function O0(s,e,t){if(!t)return new F8(s,null);const i=[];for(let n=0,o=e.length;n>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class IG{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new tF(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,c=0;n?(c=n.findLineFeedCountBeforeOffset(o),a=t+o+c):a=t+o;let l;if(n){const f=n.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 F(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,go.LF),c=e.getEOL()===`\r -`?new gOe(a):null,l=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(l[d++]=O0(this._getMultilineMatchRange(e,r,a,c,h.index,h[0]),h,n),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,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,n,o),r}const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let l=t.startLineNumber+1;l=c))return o;return o}const d=new tF(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[o++]=O0(new F(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),o>=c))return o;while(h);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new tF(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new oe(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),c=e.getValueInRange(new F(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),go.LF),l=e.getEOL()===`\r -`?new gOe(c):null;i.reset(t.column-1);const d=i.next(c);return d?O0(this._getMultilineMatchRange(e,r,c,l,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new oe(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),c=this._findFirstMatchInLine(i,a,r,t.column,n);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,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?O0(new F(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new tF(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new F(1,1,t.lineNumber,t.column),i,n,10*Nut);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,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,r,n);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,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=O0(new F(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function Put(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==zr.Regular||o===B.CarriageReturn||o===B.LineFeed)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==zr.Regular)return!0}return!1}function Fut(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==zr.Regular||o===B.CarriageReturn||o===B.LineFeed)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==zr.Regular)return!0}return!1}function vTe(s,e,t,i,n){return Put(s,e,t,i,n)&&Fut(s,e,t,i,n)}class tF{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 n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){kj(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||vTe(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class bTe{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new fOe(t),a=r.getCandidateCodePoints();let c;a==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${Out(Array.from(a))}`,"g");const l=new tF(null,c),d=[];let h=!1,u,f=0,p=0,m=0;e:for(let v=n,b=o;v<=b;v++){const w=e.getLineContent(v),y=w.length;l.reset(0);do if(u=l.next(w),u){let C=u.index,A=u.index+u[0].length;if(C>0){const R=w.charCodeAt(C-1);Pc(R)&&C--}if(A+1=1e3){h=!0;break e}d.push(new F(v,C+1,v,A+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:f,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new fOe(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case Lu.None:return null;case Lu.Invisible:return{kind:y_.Invisible};case Lu.Ambiguous:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=g8.getLocales().filter(c=>!g8.getInstance(new Set([...t.allowedLocales,c])).isAmbiguous(o));return{kind:y_.Ambiguous,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case Lu.NonBasicASCII:return{kind:y_.NonBasicAscii}}}}function Out(s,e){return`[${Rh(s.map(i=>String.fromCodePoint(i)).join(""))}]`}var y_;(function(s){s[s.Ambiguous=0]="Ambiguous",s[s.Invisible=1]="Invisible",s[s.NonBasicAscii=2]="NonBasicAscii"})(y_||(y_={}));class fOe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=g8.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of pT.codePoints)pOe(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 Lu.None;if(this.options.nonBasicASCII)return Lu.NonBasicASCII;let n=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),c=H7(r);n=n||c,!c&&!this.ambiguousCharacters.isAmbiguous(a)&&!pT.isInvisibleCharacter(a)&&(o=!0)}return!n&&o?Lu.None:this.options.invisibleCharacters&&!pOe(e)&&pT.isInvisibleCharacter(i)?Lu.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?Lu.Ambiguous:Lu.None}}function pOe(s){return s===" "||s===` -`||s===" "}var Lu;(function(s){s[s.None=0]="None",s[s.NonBasicASCII=1]="NonBasicASCII",s[s.Invisible=2]="Invisible",s[s.Ambiguous=3]="Ambiguous"})(Lu||(Lu={}));class yq{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Hre{constructor(e,t){this.lineRangeMapping=e,this.changes=t}flip(){return new Hre(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}}class mi{static addRange(e,t){let i=0;for(;it))return new mi(e,t)}static ofLength(e){return new mi(0,e)}static ofStartAndLength(e,t){return new mi(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Ni(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new mi(this.start+e,this.endExclusive+e)}deltaStart(e){return new mi(this.start+e,this.endExclusive)}deltaEnd(e){return new mi(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 Ni(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Ni(`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 pi=class Af{static fromRange(e){return new Af(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new Af(e.startLineNumber,e.endLineNumber+1)}static subtract(e,t){return t?e.startLineNumbert)throw new Ni(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&en.endLineNumberExclusive>=e.startLineNumber),i=b2(this._normalizedRanges,n=>n.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=v2(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=v2(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,n=0,o=null;for(;i=r.startLineNumber?o=new pi(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new jp(t)}subtractFrom(e){const t=w2(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=b2(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new jp([e]);const n=[];let o=e.startLineNumber;for(let r=t;ro&&n.push(new pi(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e)))}}const kp=class kp{static lengthDiffNonNegative(e,t){return t.isLessThan(e)?kp.zero:e.lineCount===t.lineCount?new kp(0,t.columnCount-e.columnCount):new kp(t.lineCount-e.lineCount,t.columnCount)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new kp(0,t.column-e.column):new kp(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return kp.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const n of e)n===` -`?(t++,i=0):i++;return new kp(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 kp(this.lineCount,this.columnCount+e.columnCount):new kp(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new F(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new F(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new F(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}`}};kp.zero=new kp(0,0);let eg=kp;class But{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;to<=e),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new oe(i,n)}getRange(e){return F.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return eg.ofRange(this.getRange(e))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new eg(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}let B2=class Cq{static single(e,t){return new Cq([new au(e,t)])}constructor(e){this.edits=e,G_(()=>bU(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 au(i.range.plusRange(t.range),i.text+t.text)}else t.isEmpty||e.push(t);return new Cq(e)}mapPosition(e){let t=0,i=0,n=0;for(const o of this.edits){const r=o.range.getStartPosition(),a=o.range.getEndPosition();if(e.isBeforeOrEqual(r))break;const c=eg.ofText(o.text);if(e.isBefore(a)){const l=new oe(r.lineNumber+t,r.column+(r.lineNumber+t===i?n:0)),d=c.addToPosition(l);return TG(l,d)}t+=c.lineCount-(o.range.endLineNumber-o.range.startLineNumber),c.lineCount===0?a.lineNumber!==r.lineNumber?n+=c.columnCount-(a.column-1):n+=c.columnCount-(a.column-r.column):n=c.columnCount,i=a.lineNumber+t}return new oe(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){function t(r){return r instanceof oe?r:r.getStartPosition()}function i(r){return r instanceof oe?r:r.getEndPosition()}const n=t(this.mapPosition(e.getStartPosition())),o=i(this.mapPosition(e.getEndPosition()));return TG(n,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=TG(i,a);l.isEmpty()||(t+=e.getValueOfRange(l)),t+=o.text,i=c}const n=TG(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new Wut(e);return this.apply(t)}inverse(e){const t=this.getNewRanges();return new Cq(this.edits.map((i,n)=>new au(t[n],e.getValueOfRange(i.range))))}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.edits){const r=eg.ofText(o.text),a=oe.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),c=r.createRange(a);e.push(c),i=c.endLineNumber-o.range.endLineNumber,n=c.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}};class au{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 TG(s,e){if(s.lineNumber===e.lineNumber&&s.column===Number.MAX_SAFE_INTEGER)return F.fromPositions(e,e);if(!s.isBeforeOrEqual(e))throw new Ni("start must be before end");return new F(s.lineNumber,s.column,e.lineNumber,e.column)}class MKe{get endPositionExclusive(){return this.length.addToPosition(new oe(1,1))}getValue(){return this.getValueOfRange(this.length.toRange())}}class Wut extends MKe{constructor(e){super(),this.value=e,this._t=new But(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}let L_=class TP{static inverse(e,t,i){const n=[];let o=1,r=1;for(const c of e){const l=new TP(new pi(o,c.original.startLineNumber),new pi(r,c.modified.startLineNumber));l.modified.isEmpty||n.push(l),o=c.original.endLineNumberExclusive,r=c.modified.endLineNumberExclusive}const a=new TP(new pi(o,t+1),new pi(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new TP(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new TP(this.modified,this.original)}join(e){return new TP(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 Gp(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ni("not a valid diff");return new Gp(new F(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new F(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Gp(new F(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new F(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(mOe(this.original.endLineNumberExclusive,e)&&mOe(this.modified.endLineNumberExclusive,t))return new Gp(new F(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new F(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Gp(F.fromPositions(new oe(this.original.startLineNumber,1),oP(new oe(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(new oe(this.modified.startLineNumber,1),oP(new oe(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Gp(F.fromPositions(oP(new oe(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),oP(new oe(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(oP(new oe(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),oP(new oe(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new Ni}};function oP(s,e){if(s.lineNumber<1)return new oe(1,1);if(s.lineNumber>e.length)return new oe(e.length,e[e.length-1].length+1);const t=e[s.lineNumber-1];return s.column>t.length+1?new oe(s.lineNumber,t.length+1):s}function mOe(s,e){return s>=1&&s<=e.length}let q_=class Sq extends L_{static fromRangeMappings(e){const t=pi.join(e.map(n=>pi.fromRangeInclusive(n.originalRange))),i=pi.join(e.map(n=>pi.fromRangeInclusive(n.modifiedRange)));return new Sq(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new Sq(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new Sq(this.original,this.modified,[this.toRangeMapping()])}},Gp=class NKe{static assertSorted(e){for(let t=1;t${this.modifiedRange.toString()}}`}flip(){return new NKe(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new au(this.originalRange,t)}};const Hut=3;class Uut{computeDiff(e,t,i){const o=new FKe(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 pi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):l=new pi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new pi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new pi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new q_(l,d,c.charChanges?.map(u=>new Gp(new F(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new F(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new q_(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 G_(()=>bU(r,(c,l)=>l.original.startLineNumber-c.original.endLineNumberExclusive===l.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===B.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]===B.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]===B.LineFeed?1:this._columns[e]+1)}}class RO{constructor(e,t,i,n,o,r,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){const n=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 RO(n,o,r,a,c,l,d,h)}}function zut(s){if(s.length<=1)return s;const e=[s[0]];let t=e[0];for(let i=1,n=s.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=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&p.getElements().length>0){let m=PKe(f,p,o,!0).changes;a&&(m=zut(m)),u=[];for(let v=0,b=m.length;v1&&m>1;){const v=u.charCodeAt(p-2),b=f.charCodeAt(m-2);if(v!==b)break;p--,m--}(p>1||m>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,p,r+1,1,m)}{let p=kpe(u,1),m=kpe(f,1);const v=u.length+1,b=f.length+1;for(;p!0;const e=Date.now();return()=>Date.now()-e{i.push(Rc.fromOffsetPairs(n?n.getEndExclusives():SS.zero,o?o.getStarts():new SS(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new Rc(new mi(e.offset1,t.offset1),new mi(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new Ni("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Rc(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Rc(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Rc(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Rc(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Rc(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 Rc(t,i)}getStarts(){return new SS(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new SS(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const f1=class f1{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new f1(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};f1.zero=new f1(0,0),f1.max=new f1(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let SS=f1;const $ne=class $ne{isValid(){return!0}};$ne.instance=new $ne;let O8=$ne;class $ut{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Ni("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class Wde{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 Ipe(s){return s===B.Space||s===B.Tab}const Pz=class Pz{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 n=0;for(let o=e.startLineNumber-1;o0&&m>0&&r.get(p-1,m-1)===3&&(w+=a.get(p-1,m-1)),w+=n?n(p,m):1):w=-1;const y=Math.max(v,b,w);if(y===w){const C=p>0&&m>0?a.get(p-1,m-1):0;a.set(p,m,C+1),r.set(p,m,3)}else y===v?(a.set(p,m,0),r.set(p,m,1)):y===b&&(a.set(p,m,0),r.set(p,m,2));o.set(p,m,y)}const c=[];let l=e.length,d=t.length;function h(p,m){(p+1!==l||m+1!==d)&&c.push(new Rc(new mi(p+1,l),new mi(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 XS(c,!1)}}class OKe{compute(e,t,i=O8.instance){if(e.length===0||t.length===0)return XS.trivial(e,t);const n=e,o=t;function r(m,v){for(;mn.length||C>o.length)continue;const A=r(y,C);c.set(d,A);const L=y===b?l.get(d+1):l.get(d-1);if(l.set(d,A!==y?new bOe(L,y,C,A-y):L),c.get(d)===n.length&&c.get(d)-d===o.length)break e}}let h=l.get(d);const u=[];let f=n.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 Rc(new mi(m,f),new mi(v,p))),!h)break;f=h.x,p=h.y,h=h.prev}return u.reverse(),new XS(u,!1)}}class bOe{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class Kut{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 qut{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 Xj{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let o=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,o=o.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const l=o.trimStart();a=o.length-l.length,o=l.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const c=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,o.length):o.length;for(let l=0;lString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=yOe(e>0?this.elements[e-1]:-1),i=yOe(eo<=e),n=e-this.firstElementOffsetByLineIdx[i];return new oe(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(n===0&&t==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?F.fromPositions(i,i):F.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!Hde(this.elements[e]))return;let t=e;for(;t>0&&Hde(this.elements[t-1]);)t--;let i=e;for(;in<=e.start)??0,i=irt(this.firstElementOffsetByLineIdx,n=>e.endExclusive<=n)??this.elements.length;return new mi(t,i)}}function Hde(s){return s>=B.a&&s<=B.z||s>=B.A&&s<=B.Z||s>=B.Digit0&&s<=B.Digit9}var ac;(function(s){s[s.WordLower=0]="WordLower",s[s.WordUpper=1]="WordUpper",s[s.WordNumber=2]="WordNumber",s[s.End=3]="End",s[s.Other=4]="Other",s[s.Separator=5]="Separator",s[s.Space=6]="Space",s[s.LineBreakCR=7]="LineBreakCR",s[s.LineBreakLF=8]="LineBreakLF"})(ac||(ac={}));const Qut={[ac.WordLower]:0,[ac.WordUpper]:0,[ac.WordNumber]:0,[ac.End]:10,[ac.Other]:2,[ac.Separator]:30,[ac.Space]:3,[ac.LineBreakCR]:10,[ac.LineBreakLF]:10};function wOe(s){return Qut[s]}function yOe(s){return s===B.LineFeed?ac.LineBreakLF:s===B.CarriageReturn?ac.LineBreakCR:Ipe(s)?ac.Space:s>=B.a&&s<=B.z?ac.WordLower:s>=B.A&&s<=B.Z?ac.WordUpper:s>=B.Digit0&&s<=B.Digit9?ac.WordNumber:s===-1?ac.End:s===B.Comma||s===B.Semicolon?ac.Separator:ac.Other}function jut(s,e,t,i,n,o){let{moves:r,excludedChanges:a}=Jut(s,e,t,o);if(!o.isValid())return[];const c=s.filter(d=>!a.has(d)),l=Xut(c,i,n,e,t,o);return $ge(r,l),r=Zut(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` -`).length>=15&&Yut(h,f=>f.length>=2)>=2}),r=egt(s,r),r}function Yut(s,e){let t=0;for(const i of s)e(i)&&t++;return t}function Jut(s,e,t,i){const n=[],o=s.filter(c=>c.modified.isEmpty&&c.original.length>=3).map(c=>new Jj(c.original,e,c)),r=new Set(s.filter(c=>c.original.isEmpty&&c.modified.length>=3).map(c=>new Jj(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),n.push(new L_(c.range,d.range)),a.add(c.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function Xut(s,e,t,i,n,o){const r=[],a=new P7;for(const u of s)for(let f=u.original.startLineNumber;fu.modified.startLineNumber,nu));for(const u of s){let f=[];for(let p=u.modified.startLineNumber;p{for(const C of f)if(C.originalLineRange.endLineNumberExclusive+1===w.endLineNumberExclusive&&C.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){C.originalLineRange=new pi(C.originalLineRange.startLineNumber,w.endLineNumberExclusive),C.modifiedLineRange=new pi(C.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),b.push(C);return}const y={modifiedLineRange:v,originalLineRange:w};c.push(y),b.push(y)}),f=b}if(!o.isValid())return[]}c.sort(S6e(Cc(u=>u.modifiedLineRange.length,nu)));const l=new jp,d=new jp;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 b of v.ranges){if(b.length<3)continue;const w=b,y=b.delta(-f);r.push(new L_(y,w)),l.addRange(w),d.addRange(y)}}r.sort(Cc(u=>u.original.startLineNumber,nu));const h=new vj(s);for(let u=0;uL.original.startLineNumber<=f.original.startLineNumber),m=v2(s,L=>L.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-p.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),b=h.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||k>n.length||l.contains(k)||d.contains(L)||!COe(i[L-1],n[k-1],o))break}C>0&&(d.addRange(new pi(f.original.startLineNumber-C,f.original.startLineNumber)),l.addRange(new pi(f.modified.startLineNumber-C,f.modified.startLineNumber)));let A;for(A=0;Ai.length||k>n.length||l.contains(k)||d.contains(L)||!COe(i[L-1],n[k-1],o))break}A>0&&(d.addRange(new pi(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+A)),l.addRange(new pi(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+A))),(C>0||A>0)&&(r[u]=new L_(new pi(f.original.startLineNumber-C,f.original.endLineNumberExclusive+A),new pi(f.modified.startLineNumber-C,f.modified.endLineNumberExclusive+A)))}return r}function COe(s,e,t){if(s.trim()===e.trim())return!0;if(s.length>300&&e.length>300)return!1;const n=new OKe().compute(new Xj([s],new F(1,1,1,s.length),!1),new Xj([e],new F(1,1,1,e.length),!1),t);let o=0;const r=Rc.invert(n.diffs,s.length);for(const d of r)d.seq1Range.forEach(h=>{Ipe(s.charCodeAt(h))||o++});function a(d){let h=0;for(let u=0;ue.length?s:e);return o/c>.6&&c>10}function Zut(s){if(s.length===0)return s;s.sort(Cc(t=>t.original.startLineNumber,nu));const e=[s[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function egt(s,e){const t=new vj(s);return e=e.filter(i=>{const n=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(l))}n.push(a)}return i.length>0&&n.push(i[i.length-1]),n}function tgt(s,e,t){if(!s.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&s.seq2Range.start-r>=n.start&&t.isStronglyEqual(s.seq2Range.start-r,s.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;s.seq1Range.start+al&&(l=p,c=d)}return s.delta(c)}function igt(s,e,t){const i=[];for(const n of t){const o=i[i.length-1];if(!o){i.push(n);continue}n.seq1Range.start-o.seq1Range.endExclusive<=2||n.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new Rc(o.seq1Range.join(n.seq1Range),o.seq2Range.join(n.seq2Range)):i.push(n)}return i}function ngt(s,e,t){const i=Rc.invert(t,s.length),n=[];let o=new SS(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 w=s.findWordContaining(v.seq1Range.start),y=e.findWordContaining(v.seq2Range.start),C=new Rc(w,y),A=C.intersect(v);if(p+=A.seq1Range.length,m+=A.seq2Range.length,u=u.join(C),u.seq1Range.endExclusive>=v.seq1Range.endExclusive)i.shift();else break}p+m<(u.seq1Range.length+u.seq2Range.length)*2/3&&n.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 sgt(t,n)}function sgt(s,e){const t=[];for(;s.length>0||e.length>0;){const i=s[0],n=e[0];let o;i&&(!n||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 ogt(s,e,t){let i=t;if(i.length===0)return i;let n=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(n++<10&&o);return i}function rgt(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const a=[i[0]];for(let c=1;c5||m.length>500)return!1;const b=s.getText(m).trim();if(b.length>20||b.split(/\r\n|\r|\n/).length>1)return!1;const w=s.countLinesIn(f.seq1Range),y=f.seq1Range.length,C=e.countLinesIn(f.seq2Range),A=f.seq2Range.length,L=s.countLinesIn(p.seq1Range),k=p.seq1Range.length,P=e.countLinesIn(p.seq2Range),R=p.seq2Range.length,z=2*40+50;function G(Y){return Math.min(Y,z)}return Math.pow(Math.pow(G(w*40+y),1.5)+Math.pow(G(C*40+A),1.5),1.5)+Math.pow(Math.pow(G(L*40+k),1.5)+Math.pow(G(P*40+R),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(n++<10&&o);const r=[];return drt(i,(a,c,l)=>{let d=c;function h(b){return b.length>0&&b.trim().length<=3&&c.seq1Range.length+c.seq2Range.length>100}const u=s.extendToFullLines(c.seq1Range),f=s.getText(new mi(u.start,c.seq1Range.start));h(f)&&(d=d.deltaStart(-f.length));const p=s.getText(new mi(c.seq1Range.endExclusive,u.endExclusive));h(p)&&(d=d.deltaEnd(p.length));const m=Rc.fromOffsetPairs(a?a.getEndExclusives():SS.zero,l?l.getStarts():SS.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 EOe{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:xOe(this.lines[e-1]),i=e===this.lines.length?0:xOe(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 xOe(s){let e=0;for(;eA===L))return new yq([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new yq([new q_(new pi(1,e.length+1),new pi(1,t.length+1),[new Gp(new F(1,1,e.length,e[e.length-1].length+1),new F(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?O8.instance:new $ut(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(A){let L=r.get(A);return L===void 0&&(L=r.size,r.set(A,L)),L}const c=e.map(A=>a(A.trim())),l=t.map(A=>a(A.trim())),d=new EOe(c,e),h=new EOe(l,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(A,L)=>e[A]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let f=u.diffs,p=u.hitTimeout;f=Tpe(d,h,f),f=ogt(d,h,f);const m=[],v=A=>{if(o)for(let L=0;LA.seq1Range.start-b===A.seq2Range.start-w);const L=A.seq1Range.start-b;v(L),b=A.seq1Range.endExclusive,w=A.seq2Range.endExclusive;const k=this.refineDiff(e,t,A,n,o);k.hitTimeout&&(p=!0);for(const P of k.mappings)m.push(P)}v(e.length-b);const y=DOe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,c,l,n,o)),G_(()=>{function A(k,P){if(k.lineNumber<1||k.lineNumber>P.length)return!1;const R=P[k.lineNumber-1];return!(k.column<1||k.column>R.length+1)}function L(k,P){return!(k.startLineNumber<1||k.startLineNumber>P.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>P.length+1)}for(const k of y){if(!k.innerChanges)return!1;for(const P of k.innerChanges)if(!(A(P.modifiedRange.getStartPosition(),t)&&A(P.modifiedRange.getEndPosition(),t)&&A(P.originalRange.getStartPosition(),e)&&A(P.originalRange.getEndPosition(),e)))return!1;if(!L(k.modified,t)||!L(k.original,e))return!1}return!0}),new yq(y,C,p)}computeMoves(e,t,i,n,o,r,a){return jut(e,t,i,n,o,r).map(d=>{const h=this.refineDiff(t,i,new Rc(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=DOe(h.mappings,t,i,!0);return new Hre(d,u)})}refineDiff(e,t,i,n,o){const a=cgt(i).toRangeMapping2(e,t),c=new Xj(e,a.originalRange,o),l=new Xj(t,a.modifiedRange,o),d=c.length+l.length<500?this.dynamicProgrammingDiffing.compute(c,l,n):this.myersDiffingAlgorithm.compute(c,l,n);let h=d.diffs;return h=Tpe(c,l,h),h=ngt(c,l,h),h=igt(c,l,h),h=rgt(c,l,h),{mappings:h.map(f=>new Gp(c.translateRange(f.seq1Range),l.translateRange(f.seq2Range))),hitTimeout:d.hitTimeout}}}function DOe(s,e,t,i=!1){const n=[];for(const o of P1e(s.map(r=>agt(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];n.push(new q_(r.original.join(a.original),r.modified.join(a.modified),o.map(c=>c.innerChanges[0])))}return G_(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:bU(n,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[s.modifiedRange.startLineNumber-1].length&&s.originalRange.startColumn-1>=e[s.originalRange.startLineNumber-1].length&&s.originalRange.startLineNumber<=s.originalRange.endLineNumber+n&&s.modifiedRange.startLineNumber<=s.modifiedRange.endLineNumber+n&&(i=1);const o=new pi(s.originalRange.startLineNumber+i,s.originalRange.endLineNumber+1+n),r=new pi(s.modifiedRange.startLineNumber+i,s.modifiedRange.endLineNumber+1+n);return new q_(o,r,[s])}function cgt(s){return new L_(new pi(s.seq1Range.start+1,s.seq1Range.endExclusive+1),new pi(s.seq2Range.start+1,s.seq2Range.endExclusive+1))}const Ude={getLegacy:()=>new Uut,getDefault:()=>new BKe};function tD(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class dn{constructor(e,t,i,n=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=tD(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class h_{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=tD(Math.max(Math.min(1,t),0),3),this.l=tD(Math.max(Math.min(1,i),0),3),this.a=tD(Math.max(Math.min(1,n),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,n=e.b/255,o=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);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-n)/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:n,a:o}=e;let r,a,c;if(i===0)r=a=c=n;else{const l=n<.5?n*(1+i):n+i-n*i,d=2*n-l;r=h_._hue2rgb(d,l,t+1/3),a=h_._hue2rgb(d,l,t),c=h_._hue2rgb(d,l,t-1/3)}return new dn(Math.round(r*255),Math.round(a*255),Math.round(c*255),o)}}class fy{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=tD(Math.max(Math.min(1,t),0),3),this.v=tD(Math.max(Math.min(1,i),0),3),this.a=tD(Math.max(Math.min(1,n),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,n=e.b/255,o=Math.max(t,i,n),r=Math.min(t,i,n),a=o-r,c=o===0?0:a/o;let l;return a===0?l=0:o===t?l=((i-n)/a%6+6)%6:o===i?l=(n-t)/a+2:l=(t-i)/a+4,new fy(Math.round(l*60),c,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),c=n-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 dn(l,d,h,o)}}var _o;let me=(_o=class{static fromHex(e){return _o.Format.CSS.parseHex(e)||_o.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:h_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:fy.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof dn)this.rgba=e;else if(e instanceof h_)this._hsla=e,this.rgba=h_.toRGBA(e);else if(e instanceof fy)this._hsva=e,this.rgba=fy.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&dn.equals(this.rgba,e.rgba)&&h_.equals(this.hsla,e.hsla)&&fy.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=_o._relativeLuminanceForComponent(this.rgba.r),t=_o._relativeLuminanceForComponent(this.rgba.g),i=_o._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return tD(n,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 t_o._flatten(n,i));return _o._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new _o(new dn(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=_o.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(n-o)/n,e.darken(i)}},_o.white=new _o(new dn(255,255,255,1)),_o.black=new _o(new dn(0,0,0,1)),_o.red=new _o(new dn(255,0,0,1)),_o.blue=new _o(new dn(0,0,255,1)),_o.green=new _o(new dn(0,255,0,1)),_o.cyan=new _o(new dn(0,255,255,1)),_o.lightgrey=new _o(new dn(211,211,211,1)),_o.transparent=new _o(new dn(0,0,0,0)),_o);(function(s){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:s.Format.CSS.formatRGBA(f)}t.formatRGB=i;function n(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=n;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:s.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?s.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()?s.Format.CSS.formatHex(f):s.Format.CSS.formatRGBA(f)}t.format=d;function h(f){const p=f.length;if(p===0||f.charCodeAt(0)!==B.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)),b=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new s(new dn(m,v,b,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)),b=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),w=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new s(new dn(m,v,b,w/255))}if(p===4){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),b=u(f.charCodeAt(3));return new s(new dn(16*m+m,16*v+v,16*b+b))}if(p===5){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),b=u(f.charCodeAt(3)),w=u(f.charCodeAt(4));return new s(new dn(16*m+m,16*v+v,16*b+b,(16*w+w)/255))}return null}t.parseHex=h;function u(f){switch(f){case B.Digit0:return 0;case B.Digit1:return 1;case B.Digit2:return 2;case B.Digit3:return 3;case B.Digit4:return 4;case B.Digit5:return 5;case B.Digit6:return 6;case B.Digit7:return 7;case B.Digit8:return 8;case B.Digit9:return 9;case B.a:return 10;case B.A:return 10;case B.b:return 11;case B.B:return 11;case B.c:return 12;case B.C:return 12;case B.d:return 13;case B.D:return 13;case B.e:return 14;case B.E:return 14;case B.f:return 15;case B.F:return 15}return 0}})(e.CSS||(e.CSS={}))})(s.Format||(s.Format={}))})(me||(me={}));function WKe(s){const e=[];for(const t of s){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function yTe(s,e,t,i){return{red:s/255,blue:t/255,green:e/255,alpha:i}}function a4(s,e){const t=e.index,i=e[0].length;if(!t)return;const n=s.positionAt(t);return{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:n.lineNumber,endColumn:n.column+i}}function lgt(s,e){if(!s)return;const t=me.Format.CSS.parseHex(e);if(t)return{range:s,color:yTe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function kOe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),o=WKe(n);return{range:s,color:yTe(o[0],o[1],o[2],t?o[3]:1)}}function IOe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),o=WKe(n),r=new me(new h_(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:s,color:yTe(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function c4(s,e){return typeof s=="string"?[...s.matchAll(e)]:s.findMatches(e)}function dgt(s){const e=[],i=c4(s,/\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 n of i){const o=n.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=kOe(a4(s,n),c4(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=kOe(a4(s,n),c4(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=IOe(a4(s,n),c4(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=IOe(a4(s,n),c4(a,l),!0)}else r==="#"&&(c=lgt(a4(s,n),r+a));c&&e.push(c)}return e}function hgt(s){return!s||typeof s.getValue!="function"||typeof s.positionAt!="function"?[]:dgt(s)}const TOe=new RegExp("\\bMARK:\\s*(.*)$","d"),ugt=/^-+|-+$/g;function ggt(s,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=fgt(s,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=pgt(s);t=t.concat(i)}return t}function fgt(s,e){const t=[],i=s.getLineCount();for(let n=1;n<=i;n++){const o=s.getLineContent(n),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:n,startColumn:r[0].length+1,endLineNumber:n,endColumn:o.length+1};if(a.endColumn>a.startColumn){const c={range:a,...HKe(o.substring(r[0].length)),shouldBeInComments:!1};(c.text||c.hasSeparatorLine)&&t.push(c)}}}return t}function pgt(s){const e=[],t=s.getLineCount();for(let i=1;i<=t;i++){const n=s.getLineContent(i);mgt(n,i,e)}return e}function mgt(s,e,t){TOe.lastIndex=0;const i=TOe.exec(s);if(i){const n=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:n,endLineNumber:e,endColumn:o};if(r.endColumn>r.startColumn){const a={range:r,...HKe(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function HKe(s){s=s.trim();const e=s.startsWith("-");return s=s.replace(ugt,""),{text:s,hasSeparatorLine:e}}class _gt extends TKe{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,n=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>o&&(i=o,n=!0)}return n?{lineNumber:t,column:i}:e}}const VE=class VE{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 _gt(N.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 n=this._getModel(e);return n?bTe.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?ggt(i,t):[]}async computeDiff(e,t,i,n){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:VE.computeDiff(o,r,i,n)}static computeDiff(e,t,i,n){const o=n==="advanced"?Ude.getDefault():Ude.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(),n=t.getLineCount();if(i!==n)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 n=this._getModel(e),o=this._getModel(t);if(!n||!o)return null;const r=n.getLinesContent(),a=o.getLinesContent();return new FKe(r,a,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((c,l)=>{if(c.range&&l.range)return F.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;cVE._diffLimit){o.push({range:c,text:l});continue}const u=Sut(h,l,i),f=n.offsetAt(F.lift(c).getStartPosition());for(const p of u){const m=n.positionAt(f+p.originalStart),v=n.positionAt(f+p.originalStart+p.originalLength),b={text:l.substr(p.modifiedStart,p.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};n.getValueInRange(b.range)!==b.text&&o.push(b)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}computeHumanReadableDiff(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((a,c)=>{if(a.range&&c.range)return F.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(b,w){return new oe(b.lineNumber+w.lineNumber-1,w.lineNumber===1?b.column+w.column-1:w.column)},v=function(b,w){const y=[];for(let C=w.startLineNumber;C<=w.endLineNumber;C++){const A=b[C-1];C===w.startLineNumber&&C===w.endLineNumber?y.push(A.substring(w.startColumn-1,w.endColumn-1)):C===w.startLineNumber?y.push(A.substring(w.startColumn-1)):C===w.endLineNumber?y.push(A.substring(0,w.endColumn-1)):y.push(A)}return y};if(typeof l=="number"&&(r=l),F.isEmpty(a)&&!c)continue;const d=n.getValueInRange(a);if(c=c.replace(/\r\n|\n|\r/g,n.eol),d===c)continue;if(Math.max(c.length,d.length)>VE._diffLimit){o.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=Ude.getDefault().computeDiff(h,u,i),p=F.lift(a).getStartPosition();for(const b of f.changes)if(b.innerChanges)for(const w of b.innerChanges)o.push({range:F.fromPositions(m(p,w.originalRange.getStartPosition()),m(p,w.originalRange.getEndPosition())),text:v(u,w.modifiedRange).join(n.eol)});else throw new Ni("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?Iut(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?hgt(t):null}async textualSuggest(e,t,i,n){const o=new js,r=new RegExp(i,n),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>VE._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,n),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(W1e(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)}}};VE._diffLimit=1e5,VE._suggestionsLimit=1e4;let Zj=VE;typeof importScripts=="function"&&(globalThis.monaco=_Ge());const Ec=ae("textResourceConfigurationService"),CTe=ae("textResourcePropertiesService"),it=ae("ILanguageFeaturesService"),LOe=60*1e3,ROe=5*60*1e3;function cw(s,e){const t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Lpe=class extends V{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new bgt(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>cw(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 vgt(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return cw(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(n=>n.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,n){const o=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,n));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(c=>new Hre(new L_(new pi(c[0],c[1]),new pi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new q_(new pi(l[0],l[1]),new pi(l[2],l[3]),l[4]?.map(d=>new Gp(new F(d[0],d[1],d[2],d[3]),new F(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return cw(this._modelService,e)&&cw(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(n=>n.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(eo(t)){if(!cw(this._modelService,e))return Promise.resolve(t);const n=js.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([o,Sr(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(eo(t)){if(!cw(this._modelService,e))return Promise.resolve(t);const i=js.create(),n=this._workerManager.withWorker().then(o=>o.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(o=>(vt(o),this.computeMoreMinimalEdits(e,t,!0)));return n.finally(()=>this._logService.trace("FORMAT#computeHumanReadableDiff",e.toString(!0),i.elapsed())),n}else return Promise.resolve(void 0)}canNavigateValueSet(e){return cw(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return cw(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))}};Lpe=D([_(0,gi),_(1,Ec),_(2,Ge),_(3,Vs),_(4,it)],Lpe);class vgt{constructor(e,t,i,n){this.languageConfigurationService=n,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 n=[];if(i.wordBasedSuggestions==="currentDocument")cw(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())cw(this._modelService,h.uri)&&(h===e?n.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&n.push(h.uri));if(n.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new F(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):F.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(n,r?.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(h=>({kind:Me.Text,label:h,insertText:h,range:{insert:c,replace:a}}))}}}class bgt extends V{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new X7).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(ROe/2),si),this._register(this._modelService.onModelRemoved(n=>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>ROe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new STe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class wgt extends V{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const n=new J7;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(LOe/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)bt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>LOe&&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 n=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(n.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(Ee(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],bt(t)}}class MOe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class Vde{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class STe extends V{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new vpe(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 vht(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new Vde(this)))}catch(e){_pe(e),this._worker=new MOe(new Zj(new Vde(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(_pe(e),this._worker=new MOe(new Zj(new Vde(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new wgt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(xy()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeDirtyDiff(e,t,i){return this._withSyncedResources([e,t]).then(n=>n.computeDirtyDiff(e.toString(),t.toString(),i))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeMoreMinimalEdits(e.toString(),t,i))}computeHumanReadableDiff(e,t,i){return this._withSyncedResources([e]).then(n=>n.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 n=await this._withSyncedResources(e),o=i.source,r=i.flags;return n.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.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(n=>{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 n.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 ygt(s,e,t){return new Cgt(s,e,t)}class Cgt extends STe{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?W1e(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(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,n);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var mt;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(mt||(mt={}));function Sgt(s){return s&&typeof s.id=="string"}const CU={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var oc;(function(s){s.CompositionStart="compositionStart",s.CompositionEnd="compositionEnd",s.Type="type",s.ReplacePreviousChar="replacePreviousChar",s.CompositionType="compositionType",s.Paste="paste",s.Cut="cut"})(oc||(oc={}));const B8=new class{clone(){return this}equals(s){return this===s}};function UKe(s,e){return new iTe([new _8(0,"",s)],e)}function ATe(s,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(s<>>0,new Lre(t,e===null?B8:e)}const HC=class HC{static createEmpty(e,t){const i=HC.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new HC(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const o=new Array;for(const{text:r,metadata:a}of e)o.push(i+r.length,a),i+=r.length,n+=r;return new HC(new Uint32Array(o),n,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 HC?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let r=n;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=Kv.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Kv.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Kv.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Kv.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Kv.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Kv.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return HC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new ETe(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(n=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const o=new Array;let r=0;for(;;){const a=tr){n+=this._text.substring(r,c.offset);const l=this._tokens[(t<<1)+1];o.push(n.length,l),r=c.offset}n+=c.text,o.push(n.length,c.tokenMetadata),i++}else break}return new HC(new Uint32Array(o),n,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 gd=HC;class ETe{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,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 ETe?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),n=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return ithis._endOffset&&(o=o.substring(0,o.length-(n-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&&is(e.data,t.data)}static equalsArr(e,t){return is(e,t,W8.equals)}}class eu{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,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,n=t.length;if(i!==n)return!1;for(let o=0;o=o||(a[c++]=new eu(Math.max(1,l.startColumn-n+1),Math.min(r+1,l.endColumn-n+1),l.className,l.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const o=[];let r=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Ja.Regular||l.type===Ja.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;o[r++]=new eu(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=eu._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class Dgt{static normalize(e,t){if(t.length===0)return[];const i=[],n=new eY;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(l-2);Pc(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);Pc(m)&&d--}const f=l-1,p=d-2;o=n.consumeLowerThan(f,o,i),n.count===0&&(o=f),n.insert(p,h,u)}return n.consumeLowerThan(Un.MAX_SAFE_SMALL_INTEGER,o,i),i}}var Xf;(function(s){s[s.None=0]="None",s[s.Boundary=1]="Boundary",s[s.Selection=2]="Selection",s[s.Trailing=3]="Trailing",s[s.All=4]="All"})(Xf||(Xf={}));let zKe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class yI{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(eu.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?Xf.All:v==="boundary"?Xf.Boundary:v==="selection"?Xf.Selection:v==="trailing"?Xf.Trailing:Xf.None,this.renderControlCharacters=b,this.fontLigatures=w,this.selectionsOnLine=y&&y.sort((L,k)=>L.startOffset>>lw.PART_INDEX_OFFSET}static getCharIndex(e){return(e&lw.CHAR_INDEX_MASK)>>>lw.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,n){const o=(t<>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}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=n_.getPartIndex(t),n=n_.getCharIndex(t);return new $Ke(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const n=(e<>>0;let o=0,r=this.length-1;for(;o+1>>1,v=this._data[m];if(v===n)return m;v>n?r=m:o=m}if(o===r)return o;const a=this._data[o],c=this._data[r];if(a===n)return o;if(c===n)return r;const l=n_.getPartIndex(a),d=n_.getCharIndex(a),h=n_.getPartIndex(c);let u;l!==h?u=t:u=n_.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,n=qu.None;for(const r of s.lineDecorations)(r.type===Ja.Before||r.type===Ja.After)&&(e.appendString(''),r.type===Ja.Before&&(n|=qu.Before,t++),r.type===Ja.After&&(n|=qu.After,i++));e.appendString("");const o=new n_(1,t+i);return o.setColumnInfo(1,t,0,0),new Rpe(o,!1,n)}return e.appendString(""),new Rpe(new n_(0,0),!1,qu.None)}return Fgt(Tgt(s),e)}class kgt{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Ure(s){const e=new wU(1e4),t=n6(s,e);return new kgt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Igt{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,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 Tgt(s){const e=s.lineContent;let t,i,n;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter0){for(let a=0,c=s.lineDecorations.length;a0&&(o[r++]=new al(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=n){const f=e?E2(s.substring(a,n)):!1;o[r++]=new al(n,h,0,f);break}const u=e?E2(s.substring(a,d)):!1;o[r++]=new al(d,h,0,u),a=d}return o}var B0;(function(s){s[s.LongToken=50]="LongToken"})(B0||(B0={}));function Rgt(s,e,t){let i=0;const n=[];let o=0;if(t)for(let r=0,a=e.length;r=B0.LongToken&&(n[o++]=new al(f+1,d,h,u),p=f+1,f=-1);p!==l&&(n[o++]=new al(l,d,h,u))}else n[o++]=c;i=l}else for(let r=0,a=e.length;rB0.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/B0.LongToken);for(let m=1;m=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function Mgt(s,e){const t=[];let i=new al(0,"",0,!1),n=0;for(const o of e){const r=o.endIndex;for(;ni.endIndex&&(i=new al(n,o.type,o.metadata,o.containsRTL),t.push(i)),i=new al(n+1,"mtkcontrol",o.metadata,!1),t.push(i))}n>i.endIndex&&(i=new al(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Ngt(s,e,t,i){const n=s.continuesWithWrappedLine,o=s.fauxIndentLength,r=s.tabSize,a=s.startVisibleColumn,c=s.useMonospaceOptimizations,l=s.selectionsOnLine,d=s.renderWhitespace===Xf.Boundary,h=s.renderWhitespace===Xf.Trailing,u=s.renderSpaceWidth!==s.spaceWidth,f=[];let p=0,m=0,v=i[m].type,b=i[m].containsRTL,w=i[m].endIndex;const y=i.length;let C=!1,A=kh(e),L;A===-1?(C=!0,A=t,L=t):L=T_(e);let k=!1,P=0,R=l&&l[P],z=a%r;for(let Y=o;Y=R.endOffset&&(P++,R=l&&l[P]);let ne;if(YL)ne=!0;else if(j===B.Tab)ne=!0;else if(j===B.Space)if(d)if(k)ne=!0;else{const ge=Y+1Y),ne&&h&&(ne=C||Y>L),ne&&b&&Y>=A&&Y<=L&&(ne=!1),k){if(!ne||!c&&z>=r){if(u){const ge=p>0?f[p-1].endIndex:o;for(let De=ge+1;De<=Y;De++)f[p++]=new al(De,"mtkw",py.IS_WHITESPACE,!1)}else f[p++]=new al(Y,"mtkw",py.IS_WHITESPACE,!1);z=z%r}}else(Y===w||ne&&Y>o)&&(f[p++]=new al(Y,v,0,b),z=z%r);for(j===B.Tab?z=r:Tk(j)?z+=2:z++,k=ne;Y===w&&(m++,m0?e.charCodeAt(t-1):B.Null,j=t>1?e.charCodeAt(t-2):B.Null;Y===B.Space&&j!==B.Space&&j!==B.Tab||(G=!0)}else G=!0;if(G)if(u){const Y=p>0?f[p-1].endIndex:o;for(let j=Y+1;j<=t;j++)f[p++]=new al(j,"mtkw",py.IS_WHITESPACE,!1)}else f[p++]=new al(t,"mtkw",py.IS_WHITESPACE,!1);else f[p++]=new al(t,v,0,b);return f}function Pgt(s,e,t,i){i.sort(eu.compare);const n=Dgt.normalize(s,i),o=n.length;let r=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=w.startOffset,a[c++]=new al(l,m,v,b)),w.endOffset+1<=p)l=w.endOffset+1,a[c++]=new al(l,m+" "+w.className,v|w.metadata,b),r++;else{l=p,a[c++]=new al(l,m+" "+w.className,v|w.metadata,b);break}}p>l&&(l=p,a[c++]=new al(l,m,v,b))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let R=0,z=l.length;R=d&&(lt+=Ji)}}for(De&&(e.appendString(' style="width:'),e.appendString(String(p*yt)),e.appendString('px"')),e.appendASCIICharCode(B.GreaterThan);C1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Ji=2;Ji<=xt;Ji++)e.appendCharCode(160)}else lt=2,xt=1,e.appendCharCode(m),e.appendCharCode(8204);L+=lt,k+=xt,C>=d&&(A+=xt)}}else for(e.appendASCIICharCode(B.GreaterThan);C=d&&(A+=lt)}Oe?P++:P=0,C>=r&&!y&&G.isPseudoAfter()&&(y=!0,w.setColumnInfo(C+1,R,L,k)),e.appendString("")}return y||w.setColumnInfo(r+1,l.length-1,L,k),a&&(e.appendString(''),e.appendString(g(9364,"Show more ({0})",Bgt(c))),e.appendString("")),e.appendString(""),new Rpe(w,f,n)}function Ogt(s){return s.toString(16).toUpperCase().padStart(4,"0")}function Bgt(s){return s<1024?g(9365,"{0} chars",s):s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}var Wgt=".monaco-aria-container{left:-999em;position:absolute}";ut(Wgt,{});const FOe=2e4;let W0,Aq,Mpe,Eq,Npe;function Hgt(s){W0=document.createElement("div"),W0.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"),W0.appendChild(i),i};Aq=e(),Mpe=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),W0.appendChild(i),i};Eq=t(),Npe=t(),s.appendChild(W0)}function Mr(s){W0&&(Aq.textContent!==s?(Ms(Mpe),tY(Aq,s)):(Ms(Aq),tY(Mpe,s)))}function Ah(s){W0&&(Eq.textContent!==s?(Ms(Npe),tY(Eq,s)):(Ms(Eq),tY(Npe,s)))}function tY(s,e){Ms(s),e.length>FOe&&(e=e.substr(0,FOe)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const DTe=ae("markerDecorationsService");var fB;let iY=(fB=class{constructor(e,t){}dispose(){}},fB.ID="editor.contrib.markerDecorations",fB);iY=D([_(1,DTe)],iY);on(iY.ID,iY,ri.Eager);var Ugt='::-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;overflow-wrap:normal;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)}';ut(Ugt,{});class KKe extends V{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,n=!1;const o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Ll(ct(this._referenceDomElement),()=>{n=!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,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}const $F=class $F{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=$F._read(e,this.key),i=o=>$F._read(e,o),n=(o,r)=>$F._write(e,o,r);this.migrate(t,i,n)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);e[o]=e[o]||{},this._write(e[o],t.substring(n+1),i);return}e[t]=i}};$F.items=[];let H8=$F;function Ub(s,e){H8.items.push(new H8(s,e))}function ff(s,e){Ub(s,(t,i,n)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){n(s,r);return}}})}function Vgt(s){H8.items.forEach(e=>e.apply(s))}ff("wordWrap",[[!0,"on"],[!1,"off"]]);ff("lineNumbers",[[!0,"on"],[!1,"off"]]);ff("cursorBlinking",[["visible","solid"]]);ff("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);ff("renderLineHighlight",[[!0,"line"],[!1,"none"]]);ff("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);ff("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);ff("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ff("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ff("autoIndent",[[!1,"advanced"],[!0,"full"]]);ff("matchBrackets",[[!0,"always"],[!1,"never"]]);ff("renderFinalNewline",[[!0,"on"],[!1,"off"]]);ff("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);ff("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);ff("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Ub("autoClosingBrackets",(s,e,t)=>{s===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Ub("renderIndentGuides",(s,e,t)=>{typeof s<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!s))});Ub("highlightActiveIndentGuide",(s,e,t)=>{typeof s<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!s))});const zgt={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"};Ub("suggest.filteredTypes",(s,e,t)=>{if(s&&typeof s=="object"){for(const i of Object.entries(zgt))s[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});Ub("quickSuggestions",(s,e,t)=>{if(typeof s=="boolean"){const i=s?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Ub("experimental.stickyScroll.enabled",(s,e,t)=>{typeof s=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",s))});Ub("experimental.stickyScroll.maxLineCount",(s,e,t)=>{typeof s=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",s))});Ub("codeActionsOnSave",(s,e,t)=>{if(s&&typeof s=="object"){let i=!1;const n={};for(const o of Object.entries(s))typeof o[1]=="boolean"?(i=!0,n[o[0]]=o[1]?"explicit":"never"):n[o[0]]=o[1];i&&t("codeActionsOnSave",n)}});Ub("codeActionWidget.includeNearbyQuickfixes",(s,e,t)=>{typeof s=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",s))});Ub("lightbulb.enabled",(s,e,t)=>{typeof s=="boolean"&&t("lightbulb.enabled",s?void 0:"off")});class $gt{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 Pk=new $gt,mr=ae("accessibilityService");let Ppe=class extends V{constructor(e,t,i,n,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 nGe,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new KKe(o,n.dimension)),this._targetWindowId=ct(o).vscodeWindowId,this._rawOptions=OOe(n),this._validatedOptions=lS.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(Qp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Pk.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(ppe.onDidChange(()=>this._recomputeOptions())),this._register(L8.getInstance(ct(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=lS.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=wx.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={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:Pk.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return lS.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:Kgt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:vT||rf,pixelRatio:L8.getInstance(Hj(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?Jl.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return ppe.readFontInfo(Hj(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=OOe(e);lS.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=lS.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=Ggt(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())}};Ppe=D([_(5,mr)],Ppe);function Ggt(s){let e=0;for(;s;)s=Math.floor(s/10),e++;return e||1}function Kgt(s){let e="";return!Ky&&!bGe&&(e+="no-user-select "),Ky&&(e+="no-minimap-shadow ",e+="enable-user-select "),Qt&&(e+="mac "),s&&(e+="standalone "),e}class qgt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Qgt{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 lS{static validateOptions(e){const t=new qgt;for(const i of JP){const n=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new Qgt;for(const n of JP)i._write(n.id,n.compute(t,i,e._read(n.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)?is(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!lS._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of JP){const r=!lS._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new iGe(i):null}static applyUpdate(e,t){let i=!1;for(const n of JP)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function OOe(s){const e=xs(s);return Vgt(e),e}var yx;(function(s){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},n={...e};let o=0,r;(function(P){P[P.Before=0]="Before",P[P.InProgress=1]="InProgress",P[P.Finished=2]="Finished"})(r||(r={}));const a={keydown:r.Before,input:r.Before,render:r.Before};function c(){w(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=r.InProgress,queueMicrotask(l)}s.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,b()}s.onBeforeInput=d;function h(){a.input===r.Before&&d(),queueMicrotask(u)}s.onInput=h;function u(){a.input===r.InProgress&&(performance.mark("input/end"),a.input=r.Finished)}function f(){w()}s.onKeyUp=f;function p(){w()}s.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),b())}s.onRenderStart=m;function v(){a.render===r.InProgress&&(performance.mark("render/end"),a.render=r.Finished)}function b(){setTimeout(w)}function w(){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"),y("keydown",e),y("input",t),y("render",i),y("inputlatency",n),o++,C())}function y(P,R){const z=performance.getEntriesByName(P)[0].duration;R.total+=z,R.min=Math.min(R.min,z),R.max=Math.max(R.max,z)}function C(){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 A(){if(o===0)return;const P={keydown:L(e),input:L(t),render:L(i),total:L(n),sampleCount:o};return k(e),k(t),k(i),k(n),o=0,P}s.getAndClearMeasurements=A;function L(P){return{average:P.total/o,max:P.max,min:P.min}}function k(P){P.total=0,P.min=Number.MAX_VALUE,P.max=0}})(yx||(yx={}));var es;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(es||(es={}));var Wg;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(Wg||(Wg={}));var Rt;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Rt||(Rt={}));function Qr(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===CU.ICodeEditor:!1}function im(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===CU.IDiffEditor:!1}function W2(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function s6(s){return Qr(s)?s:im(s)?s.getModifiedEditor():W2(s)&&Qr(s.activeCodeEditor)?s.activeCodeEditor:null}function jgt(s){return Qr(s)||im(s)?s:null}class SU{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,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=ct(e)}this._hooks.add(ue(r,ke.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ue(r,ke.POINTER_UP,a=>this.stopMonitoring(!0)))}}function Vre(s){return`--vscode-${s.replace(/\./g,"-")}`}function ze(s){return`var(${Vre(s)})`}function Fpe(s,e){return`var(${Vre(s)}, ${e})`}var Pu;(function(s){s[s.Darken=0]="Darken",s[s.Lighten=1]="Lighten",s[s.Transparent=2]="Transparent",s[s.Opaque=3]="Opaque",s[s.OneOf=4]="OneOf",s[s.LessProminent=5]="LessProminent",s[s.IfDefinedThenElse=6]="IfDefinedThenElse"})(Pu||(Pu={}));function Ygt(s){return s!==null&&typeof s=="object"&&"light"in s&&"dark"in s}const kTe={ColorContribution:"base.contributions.colors"},Jgt="default";class Xgt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}notifyThemeUpdate(e){for(const t of Object.keys(this.colorsById)){const i=e.getColor(t);i&&(this.colorSchema.properties[t].oneOf[0].defaultSnippets[0].body=`\${1:${i.toString()}}`)}this._onDidChangeSchema.fire()}registerColor(e,t,i,n=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),n&&(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=g(1694,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={oneOf:[a,{type:"string",const:Jgt,description:g(1695,"Use the default color.")}]},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?.defaults){const n=Ygt(i.defaults)?i.defaults[t.type]:i.defaults;return _v(n,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return n!==o?n-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const zre=new Xgt;Qe.add(kTe.ColorContribution,zre);function W(s,e,t,i,n){return zre.registerColor(s,e,t,i,n)}function Zgt(s,e){switch(s.op){case Pu.Darken:return _v(s.value,e)?.darken(s.factor);case Pu.Lighten:return _v(s.value,e)?.lighten(s.factor);case Pu.Transparent:return _v(s.value,e)?.transparent(s.factor);case Pu.Opaque:{const t=_v(s.background,e);return t?_v(s.value,e)?.makeOpaque(t):_v(s.value,e)}case Pu.OneOf:for(const t of s.values){const i=_v(t,e);if(i)return i}return;case Pu.IfDefinedThenElse:return _v(e.defines(s.if)?s.then:s.else,e);case Pu.LessProminent:{const t=_v(s.value,e);if(!t)return;const i=_v(s.background,e);return i?t.isDarkerThan(i)?me.getLighterColor(t,i,s.factor).transparent(s.transparency):me.getDarkerColor(t,i,s.factor).transparent(s.transparency):t.transparent(s.factor*s.transparency)}default:throw Z7()}}function pp(s,e){return{op:Pu.Darken,value:s,factor:e}}function R_(s,e){return{op:Pu.Lighten,value:s,factor:e}}function st(s,e){return{op:Pu.Transparent,value:s,factor:e}}function BOe(s,e){return{op:Pu.Opaque,value:s,background:e}}function U8(...s){return{op:Pu.OneOf,values:s}}function eft(s,e,t){return{op:Pu.IfDefinedThenElse,if:s,then:e,else:t}}function WOe(s,e,t,i){return{op:Pu.LessProminent,value:s,background:e,factor:t,transparency:i}}function _v(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?me.fromHex(s):e.getColor(s);if(s instanceof me)return s;if(typeof s=="object")return Zgt(s,e)}}const qKe="vscode://schemas/workbench-colors",QKe=Qe.as(YA.JSONContribution);QKe.registerSchema(qKe,zre.getColorSchema());const HOe=new cn(()=>QKe.notifySchemaChanged(qKe),200);zre.onDidChangeSchema(()=>{HOe.isScheduled()||HOe.schedule()});const zi=W("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},g(1696,"Overall foreground color. This color is only used if not overridden by a component.")),UOe=W("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},g(1697,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),VOe=W("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},g(1698,"Overall foreground color for error messages. This color is only used if not overridden by a component."));W("descriptionForeground",{light:"#717171",dark:st(zi,.7),hcDark:st(zi,.7),hcLight:st(zi,.7)},g(1699,"Foreground color for description text providing additional information, for example for a label."));const nY=W("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(1700,"The default color for icons in the workbench.")),mp=W("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},g(1701,"Overall border color for focused elements. This color is only used if not overridden by a component.")),wt=W("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},g(1702,"An extra border around elements to separate them from others for greater contrast.")),Js=W("contrastActiveBorder",{light:null,dark:null,hcDark:mp,hcLight:mp},g(1703,"An extra border around active elements to separate them from others for greater contrast."));W("selection.background",null,g(1704,"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 ITe=W("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1705,"Foreground color for links in text.")),tft=W("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1706,"Foreground color for links in text when clicked on and on mouse hover."));W("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:me.black,hcLight:"#292929"},g(1707,"Color for text separators."));W("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},g(1708,"Foreground color for preformatted text segments."));W("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},g(1709,"Background color for preformatted text segments."));const ift=W("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(1710,"Background color for block quotes in text.")),nft=W("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:me.white,hcLight:"#292929"},g(1711,"Border color for block quotes in text."));W("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:me.black,hcLight:"#F2F2F2"},g(1712,"Background color for code blocks in text."));W("sash.hoverBorder",mp,g(1908,"Border color of active sashes."));const yT=W("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:me.black,hcLight:"#0F4A85"},g(1909,"Badge background color. Badges are small information labels, e.g. for search results count.")),$re=W("badge.foreground",{dark:me.white,light:"#333",hcDark:me.white,hcLight:me.white},g(1910,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),o6=W("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(1911,"Scrollbar shadow to indicate that the view is scrolled.")),jKe=W("scrollbarSlider.background",{dark:me.fromHex("#797979").transparent(.4),light:me.fromHex("#646464").transparent(.4),hcDark:st(wt,.6),hcLight:st(wt,.4)},g(1912,"Scrollbar slider background color.")),YKe=W("scrollbarSlider.hoverBackground",{dark:me.fromHex("#646464").transparent(.7),light:me.fromHex("#646464").transparent(.7),hcDark:st(wt,.8),hcLight:st(wt,.8)},g(1913,"Scrollbar slider background color when hovering.")),JKe=W("scrollbarSlider.activeBackground",{dark:me.fromHex("#BFBFBF").transparent(.4),light:me.fromHex("#000000").transparent(.6),hcDark:wt,hcLight:wt},g(1914,"Scrollbar slider background color when clicked on.")),sft=W("progressBar.background",{dark:me.fromHex("#0E70C0"),light:me.fromHex("#0E70C0"),hcDark:wt,hcLight:wt},g(1915,"Background color of the progress bar that can show for long running operations.")),Hc=W("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:me.black,hcLight:me.white},g(1721,"Editor background color.")),Rl=W("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:me.white,hcLight:zi},g(1722,"Editor default foreground color."));W("editorStickyScroll.background",Hc,g(1723,"Background color of sticky scroll in the editor"));W("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1724,"Background color of sticky scroll on hover in the editor"));W("editorStickyScroll.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1725,"Border color of sticky scroll in the editor"));W("editorStickyScroll.shadow",o6,g(1726," Shadow color of sticky scroll in the editor"));const xh=W("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:me.white},g(1727,"Background color of editor widgets, such as find/replace.")),IN=W("editorWidget.foreground",zi,g(1728,"Foreground color of editor widgets, such as find/replace.")),r6=W("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:wt,hcLight:wt},g(1729,"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."));W("editorWidget.resizeBorder",null,g(1730,"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."));W("editorError.background",null,g(1731,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const TN=W("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(1732,"Foreground color of error squigglies in the editor.")),oft=W("editorError.border",{dark:null,light:null,hcDark:me.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},g(1733,"If set, color of double underlines for errors in the editor.")),rft=W("editorWarning.background",null,g(1734,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),pm=W("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(1735,"Foreground color of warning squigglies in the editor.")),V8=W("editorWarning.border",{dark:null,light:null,hcDark:me.fromHex("#FFCC00").transparent(.8),hcLight:me.fromHex("#FFCC00").transparent(.8)},g(1736,"If set, color of double underlines for warnings in the editor."));W("editorInfo.background",null,g(1737,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const mm=W("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(1738,"Foreground color of info squigglies in the editor.")),z8=W("editorInfo.border",{dark:null,light:null,hcDark:me.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},g(1739,"If set, color of double underlines for infos in the editor.")),aft=W("editorHint.foreground",{dark:me.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},g(1740,"Foreground color of hint squigglies in the editor."));W("editorHint.border",{dark:null,light:null,hcDark:me.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},g(1741,"If set, color of double underlines for hints in the editor."));const cft=W("editorLink.activeForeground",{dark:"#4E94CE",light:me.blue,hcDark:me.cyan,hcLight:"#292929"},g(1742,"Color of active links.")),AS=W("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(1743,"Color of the editor selection.")),lft=W("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:me.white},g(1744,"Color of the selected text for high contrast.")),XKe=W("editor.inactiveSelectionBackground",{light:st(AS,.5),dark:st(AS,.5),hcDark:st(AS,.7),hcLight:st(AS,.5)},g(1745,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),TTe=W("editor.selectionHighlightBackground",{light:WOe(AS,Hc,.3,.6),dark:WOe(AS,Hc,.3,.6),hcDark:null,hcLight:null},g(1746,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1747,"Border color for regions with the same content as the selection."));const zOe=W("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(1748,"Color of the current search match.")),dft=W("editor.findMatchForeground",null,g(1749,"Text color of the current search match.")),_b=W("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},g(1750,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),hft=W("editor.findMatchHighlightForeground",null,g(1751,"Foreground color of the other search matches."),!0);W("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},g(1752,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.findMatchBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1753,"Border color of the current search match."));const Cx=W("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1754,"Border color of the other search matches.")),uft=W("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:st(Js,.4),hcLight:st(Js,.4)},g(1755,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),gft=W("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},g(1756,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),sY=W("editorHoverWidget.background",xh,g(1757,"Background color of the editor hover."));W("editorHoverWidget.foreground",IN,g(1758,"Foreground color of the editor hover."));const ZKe=W("editorHoverWidget.border",r6,g(1759,"Border color of the editor hover."));W("editorHoverWidget.statusBarBackground",{dark:R_(sY,.2),light:pp(sY,.05),hcDark:xh,hcLight:xh},g(1760,"Background color of the editor hover status bar."));const LTe=W("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:me.white,hcLight:me.black},g(1761,"Foreground color of inline hints")),RTe=W("editorInlayHint.background",{dark:st(yT,.1),light:st(yT,.1),hcDark:st(me.white,.1),hcLight:st(yT,.1)},g(1762,"Background color of inline hints")),fft=W("editorInlayHint.typeForeground",LTe,g(1763,"Foreground color of inline hints for types")),pft=W("editorInlayHint.typeBackground",RTe,g(1764,"Background color of inline hints for types")),mft=W("editorInlayHint.parameterForeground",LTe,g(1765,"Foreground color of inline hints for parameters")),_ft=W("editorInlayHint.parameterBackground",RTe,g(1766,"Background color of inline hints for parameters")),vft=W("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},g(1767,"The color used for the lightbulb actions icon."));W("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(1768,"The color used for the lightbulb auto fix actions icon."));W("editorLightBulbAi.foreground",vft,g(1769,"The color used for the lightbulb AI icon."));W("editor.snippetTabstopHighlightBackground",{dark:new me(new dn(124,124,124,.3)),light:new me(new dn(10,50,100,.2)),hcDark:new me(new dn(124,124,124,.3)),hcLight:new me(new dn(10,50,100,.2))},g(1770,"Highlight background color of a snippet tabstop."));W("editor.snippetTabstopHighlightBorder",null,g(1771,"Highlight border color of a snippet tabstop."));W("editor.snippetFinalTabstopHighlightBackground",null,g(1772,"Highlight background color of the final tabstop of a snippet."));W("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new me(new dn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(1773,"Highlight border color of the final tabstop of a snippet."));const Ope=new me(new dn(155,185,85,.2)),Bpe=new me(new dn(255,0,0,.2)),my=W("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},g(1774,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),iF=W("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},g(1775,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditor.insertedLineBackground",{dark:Ope,light:Ope,hcDark:null,hcLight:null},g(1776,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditor.removedLineBackground",{dark:Bpe,light:Bpe,hcDark:null,hcLight:null},g(1777,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditorGutter.insertedLineBackground",null,g(1778,"Background color for the margin where lines got inserted."));W("diffEditorGutter.removedLineBackground",null,g(1779,"Background color for the margin where lines got removed."));const bft=W("diffEditorOverview.insertedForeground",null,g(1780,"Diff overview ruler foreground for inserted content.")),wft=W("diffEditorOverview.removedForeground",null,g(1781,"Diff overview ruler foreground for removed content."));W("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},g(1782,"Outline color for the text that got inserted."));W("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},g(1783,"Outline color for text that got removed."));W("diffEditor.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1784,"Border color between the two text editors."));W("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},g(1785,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));W("diffEditor.unchangedRegionBackground","sideBar.background",g(1786,"The background color of unchanged blocks in the diff editor."));W("diffEditor.unchangedRegionForeground","foreground",g(1787,"The foreground color of unchanged blocks in the diff editor."));W("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},g(1788,"The background color of unchanged code in the diff editor."));const CI=W("widget.shadow",{dark:st(me.black,.36),light:st(me.black,.16),hcDark:null,hcLight:null},g(1789,"Shadow color of widgets such as find/replace inside the editor.")),H2=W("widget.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1790,"Border color of widgets such as find/replace inside the editor.")),oY=W("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},g(1791,"Toolbar background when hovering over actions using the mouse"));W("toolbar.hoverOutline",{dark:null,light:null,hcDark:Js,hcLight:Js},g(1792,"Toolbar outline when hovering over actions using the mouse"));W("toolbar.activeBackground",{dark:R_(oY,.1),light:pp(oY,.1),hcDark:null,hcLight:null},g(1793,"Toolbar background when holding the mouse over actions"));const yft=W("breadcrumb.foreground",st(zi,.8),g(1794,"Color of focused breadcrumb items.")),Cft=W("breadcrumb.background",Hc,g(1795,"Background color of breadcrumb items.")),$Oe=W("breadcrumb.focusForeground",{light:pp(zi,.2),dark:R_(zi,.1),hcDark:R_(zi,.1),hcLight:R_(zi,.1)},g(1794,"Color of focused breadcrumb items.")),Sft=W("breadcrumb.activeSelectionForeground",{light:pp(zi,.2),dark:R_(zi,.1),hcDark:R_(zi,.1),hcLight:R_(zi,.1)},g(1796,"Color of selected breadcrumb items."));W("breadcrumbPicker.background",xh,g(1797,"Background color of breadcrumb item picker."));const eqe=.5,GOe=me.fromHex("#40C8AE").transparent(eqe),KOe=me.fromHex("#40A6FF").transparent(eqe),qOe=me.fromHex("#606060").transparent(.4),MTe=.4,U2=1,Wpe=W("merge.currentHeaderBackground",{dark:GOe,light:GOe,hcDark:null,hcLight:null},g(1798,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.currentContentBackground",st(Wpe,MTe),g(1799,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Hpe=W("merge.incomingHeaderBackground",{dark:KOe,light:KOe,hcDark:null,hcLight:null},g(1800,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.incomingContentBackground",st(Hpe,MTe),g(1801,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Upe=W("merge.commonHeaderBackground",{dark:qOe,light:qOe,hcDark:null,hcLight:null},g(1802,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.commonContentBackground",st(Upe,MTe),g(1803,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const V2=W("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},g(1804,"Border color on headers and the splitter in inline merge-conflicts."));W("editorOverviewRuler.currentContentForeground",{dark:st(Wpe,U2),light:st(Wpe,U2),hcDark:V2,hcLight:V2},g(1805,"Current overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.incomingContentForeground",{dark:st(Hpe,U2),light:st(Hpe,U2),hcDark:V2,hcLight:V2},g(1806,"Incoming overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.commonContentForeground",{dark:st(Upe,U2),light:st(Upe,U2),hcDark:V2,hcLight:V2},g(1807,"Common ancestor overview ruler foreground for inline merge-conflicts."));const s5=W("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},g(1808,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),tqe=W("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",g(1809,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Aft=W("problemsErrorIcon.foreground",TN,g(1810,"The color used for the problems error icon.")),Eft=W("problemsWarningIcon.foreground",pm,g(1811,"The color used for the problems warning icon.")),xft=W("problemsInfoIcon.foreground",mm,g(1812,"The color used for the problems info icon.")),Vpe=W("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(1897,"Minimap marker color for find matches."),!0),Gre=W("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1898,"Minimap marker color for repeating editor selections."),!0),QOe=W("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1899,"Minimap marker color for the editor selection."),!0),Dft=W("minimap.infoHighlight",{dark:mm,light:mm,hcDark:z8,hcLight:z8},g(1900,"Minimap marker color for infos.")),kft=W("minimap.warningHighlight",{dark:pm,light:pm,hcDark:V8,hcLight:V8},g(1901,"Minimap marker color for warnings.")),Ift=W("minimap.errorHighlight",{dark:new me(new dn(255,18,18,.7)),light:new me(new dn(255,18,18,.7)),hcDark:new me(new dn(255,50,50,1)),hcLight:"#B5200D"},g(1902,"Minimap marker color for errors.")),Tft=W("minimap.background",null,g(1903,"Minimap background color.")),Lft=W("minimap.foregroundOpacity",me.fromHex("#000f"),g(1904,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));W("minimapSlider.background",st(jKe,.5),g(1905,"Minimap slider background color."));W("minimapSlider.hoverBackground",st(YKe,.5),g(1906,"Minimap slider background color when hovering."));W("minimapSlider.activeBackground",st(JKe,.5),g(1907,"Minimap slider background color when clicked on."));W("charts.foreground",zi,g(1713,"The foreground color used in charts."));W("charts.lines",st(zi,.5),g(1714,"The color used for horizontal lines in charts."));W("charts.red",TN,g(1715,"The red color used in chart visualizations."));W("charts.blue",mm,g(1716,"The blue color used in chart visualizations."));W("charts.yellow",pm,g(1717,"The yellow color used in chart visualizations."));W("charts.orange",Vpe,g(1718,"The orange color used in chart visualizations."));W("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},g(1719,"The green color used in chart visualizations."));W("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(1720,"The purple color used in chart visualizations."));const z2=W("input.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1813,"Input box background.")),iqe=W("input.foreground",zi,g(1814,"Input box foreground.")),o5=W("input.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1815,"Input box border.")),Kre=W("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:wt,hcLight:wt},g(1816,"Border color of activated options in input fields.")),Rft=W("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(1817,"Background color of activated options in input fields.")),a6=W("inputOption.activeBackground",{dark:st(mp,.4),light:st(mp,.2),hcDark:me.transparent,hcLight:me.transparent},g(1818,"Background hover color of options in input fields.")),qre=W("inputOption.activeForeground",{dark:me.white,light:me.black,hcDark:zi,hcLight:zi},g(1819,"Foreground color of activated options in input fields.")),Mft=W("input.placeholderForeground",{light:st(zi,.5),dark:st(zi,.5),hcDark:st(zi,.7),hcLight:st(zi,.7)},g(1820,"Input box foreground color for placeholder text.")),Nft=W("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:me.black,hcLight:me.white},g(1821,"Input validation background color for information severity.")),Pft=W("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1822,"Input validation foreground color for information severity.")),Fft=W("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:wt,hcLight:wt},g(1823,"Input validation border color for information severity.")),Oft=W("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:me.black,hcLight:me.white},g(1824,"Input validation background color for warning severity.")),Bft=W("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1825,"Input validation foreground color for warning severity.")),Wft=W("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:wt,hcLight:wt},g(1826,"Input validation border color for warning severity.")),nqe=W("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:me.black,hcLight:me.white},g(1827,"Input validation background color for error severity.")),sqe=W("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1828,"Input validation foreground color for error severity.")),oqe=W("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:wt,hcLight:wt},g(1829,"Input validation border color for error severity.")),Qre=W("dropdown.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1830,"Dropdown background.")),Hft=W("dropdown.listBackground",{dark:null,light:null,hcDark:me.black,hcLight:me.white},g(1831,"Dropdown list background.")),NTe=W("dropdown.foreground",{dark:"#F0F0F0",light:zi,hcDark:me.white,hcLight:zi},g(1832,"Dropdown foreground.")),PTe=W("dropdown.border",{dark:Qre,light:"#CECECE",hcDark:wt,hcLight:wt},g(1833,"Dropdown border.")),bM=W("button.foreground",me.white,g(1834,"Button foreground color.")),rqe=W("button.separator",st(bM,.4),g(1835,"Button separator color.")),_y=W("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(1836,"Button background color.")),$8=W("button.hoverBackground",{dark:R_(_y,.2),light:pp(_y,.2),hcDark:_y,hcLight:_y},g(1837,"Button background color when hovering.")),Uft=W("button.border",wt,g(1838,"Button border color.")),Vft=W("button.secondaryForeground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:zi},g(1839,"Secondary button foreground color.")),zpe=W("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:me.white},g(1840,"Secondary button background color.")),zft=W("button.secondaryHoverBackground",{dark:R_(zpe,.2),light:pp(zpe,.2),hcDark:null,hcLight:null},g(1841,"Secondary button background color when hovering.")),Z4=W("radio.activeForeground",qre,g(1842,"Foreground color of active radio option.")),$ft=W("radio.activeBackground",a6,g(1843,"Background color of active radio option.")),Gft=W("radio.activeBorder",Kre,g(1844,"Border color of the active radio option.")),Kft=W("radio.inactiveForeground",null,g(1845,"Foreground color of inactive radio option.")),qft=W("radio.inactiveBackground",null,g(1846,"Background color of inactive radio option.")),Qft=W("radio.inactiveBorder",{light:st(Z4,.2),dark:st(Z4,.2),hcDark:st(Z4,.4),hcLight:st(Z4,.2)},g(1847,"Border color of the inactive radio option.")),jft=W("radio.inactiveHoverBackground",Rft,g(1848,"Background color of inactive active radio option when hovering.")),Yft=W("checkbox.background",Qre,g(1849,"Background color of checkbox widget."));W("checkbox.selectBackground",xh,g(1850,"Background color of checkbox widget when the element it's in is selected."));const Jft=W("checkbox.foreground",NTe,g(1851,"Foreground color of checkbox widget.")),Xft=W("checkbox.border",PTe,g(1852,"Border color of checkbox widget."));W("checkbox.selectBorder",nY,g(1853,"Border color of checkbox widget when the element it's in is selected."));const Zft=W("keybindingLabel.background",{dark:new me(new dn(128,128,128,.17)),light:new me(new dn(221,221,221,.4)),hcDark:me.transparent,hcLight:me.transparent},g(1854,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),ept=W("keybindingLabel.foreground",{dark:me.fromHex("#CCCCCC"),light:me.fromHex("#555555"),hcDark:me.white,hcLight:zi},g(1855,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),tpt=W("keybindingLabel.border",{dark:new me(new dn(51,51,51,.6)),light:new me(new dn(204,204,204,.4)),hcDark:new me(new dn(111,195,223)),hcLight:wt},g(1856,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),ipt=W("keybindingLabel.bottomBorder",{dark:new me(new dn(68,68,68,.6)),light:new me(new dn(187,187,187,.4)),hcDark:new me(new dn(111,195,223)),hcLight:zi},g(1857,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),npt=W("list.focusBackground",null,g(1858,"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.")),spt=W("list.focusForeground",null,g(1859,"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.")),$pe=W("list.focusOutline",{dark:mp,light:mp,hcDark:Js,hcLight:Js},g(1860,"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.")),opt=W("list.focusAndSelectionOutline",null,g(1861,"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.")),vy=W("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1862,"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.")),G8=W("list.activeSelectionForeground",{dark:me.white,light:me.white,hcDark:null,hcLight:null},g(1863,"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.")),aqe=W("list.activeSelectionIconForeground",null,g(1864,"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.")),Gpe=W("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1865,"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.")),rpt=W("list.inactiveSelectionForeground",null,g(1866,"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.")),apt=W("list.inactiveSelectionIconForeground",null,g(1867,"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.")),cpt=W("list.inactiveFocusBackground",null,g(1868,"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.")),lpt=W("list.inactiveFocusOutline",null,g(1869,"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.")),cqe=W("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:me.white.transparent(.1),hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1870,"List/Tree background when hovering over items using the mouse.")),lqe=W("list.hoverForeground",null,g(1871,"List/Tree foreground when hovering over items using the mouse.")),dpt=W("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},g(1872,"List/Tree drag and drop background when moving items over other items when using the mouse.")),hpt=W("list.dropBetweenBackground",{dark:nY,light:nY,hcDark:null,hcLight:null},g(1873,"List/Tree drag and drop border color when moving items between items when using the mouse.")),nF=W("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:mp,hcLight:mp},g(1874,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),upt=W("list.focusHighlightForeground",{dark:nF,light:eft(vy,nF,"#BBE7FF"),hcDark:nF,hcLight:nF},g(1875,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),gpt=W("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},g(1876,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),jOe=W("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},g(1877,"Foreground color of list items containing errors."));W("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},g(1878,"Foreground color of list items containing warnings."));const fpt=W("listFilterWidget.background",{light:pp(xh,0),dark:R_(xh,0),hcDark:xh,hcLight:xh},g(1879,"Background color of the type filter widget in lists and trees.")),ppt=W("listFilterWidget.outline",{dark:me.transparent,light:me.transparent,hcDark:"#f38518",hcLight:"#007ACC"},g(1880,"Outline color of the type filter widget in lists and trees.")),mpt=W("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:wt,hcLight:wt},g(1881,"Outline color of the type filter widget in lists and trees, when there are no matches.")),_pt=W("listFilterWidget.shadow",CI,g(1882,"Shadow color of the type filter widget in lists and trees."));W("list.filterMatchBackground",{dark:_b,light:_b,hcDark:null,hcLight:null},g(1883,"Background color of the filtered match."));W("list.filterMatchBorder",{dark:Cx,light:Cx,hcDark:wt,hcLight:Js},g(1884,"Border color of the filtered match."));const vpt=W("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(1885,"List/Tree foreground color for items that are deemphasized.")),rY=W("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(1886,"Tree stroke color for the indentation guides.")),bpt=W("tree.inactiveIndentGuidesStroke",st(rY,.4),g(1887,"Tree stroke color for the indentation guides that are not active.")),wpt=W("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(1888,"Table border color between columns.")),ypt=W("tree.tableOddRowsBackground",{dark:st(zi,.04),light:st(zi,.04),hcDark:null,hcLight:null},g(1889,"Background color for odd table rows.")),Cpt=W("menu.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1890,"Border color of menus.")),Spt=W("menu.foreground",NTe,g(1891,"Foreground color of menu items.")),Apt=W("menu.background",Qre,g(1892,"Background color of menu items.")),Ept=W("menu.selectionForeground",G8,g(1893,"Foreground color of the selected menu item in menus.")),xpt=W("menu.selectionBackground",vy,g(1894,"Background color of the selected menu item in menus.")),Dpt=W("menu.selectionBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(1895,"Border color of the selected menu item in menus.")),kpt=W("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:wt,hcLight:wt},g(1896,"Color of a separator menu item in menus.")),YOe=W("quickInput.background",xh,g(1916,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Ipt=W("quickInput.foreground",IN,g(1917,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Tpt=W("quickInputTitle.background",{dark:new me(new dn(255,255,255,.105)),light:new me(new dn(0,0,0,.06)),hcDark:"#000000",hcLight:me.white},g(1918,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),dqe=W("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:me.white,hcLight:"#0F4A85"},g(1919,"Quick picker color for grouping labels.")),Lpt=W("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:me.white,hcLight:"#0F4A85"},g(1920,"Quick picker color for grouping borders.")),JOe=W("quickInput.list.focusBackground",null,"",void 0,g(1921,"Please use quickInputList.focusBackground instead")),K8=W("quickInputList.focusForeground",G8,g(1922,"Quick picker foreground color for the focused item.")),FTe=W("quickInputList.focusIconForeground",aqe,g(1923,"Quick picker icon foreground color for the focused item.")),q8=W("quickInputList.focusBackground",{dark:U8(JOe,vy),light:U8(JOe,vy),hcDark:null,hcLight:null},g(1924,"Quick picker background color for the focused item."));W("search.resultsInfoForeground",{light:zi,dark:st(zi,.65),hcDark:zi,hcLight:zi},g(1925,"Color of the text in the search viewlet's completion message."));W("searchEditor.findMatchBackground",{light:st(_b,.66),dark:st(_b,.66),hcDark:_b,hcLight:_b},g(1926,"Color of the Search Editor query matches."));W("searchEditor.findMatchBorder",{light:st(Cx,.66),dark:st(Cx,.66),hcDark:Cx,hcLight:Cx},g(1927,"Border color of the Search Editor query matches."));class jre{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new hqe(this.x-e.scrollX,this.y-e.scrollY)}}class hqe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new jre(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class Rpt{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class Mpt{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function OTe(s){const e=Cr(s);return new Rpt(e.left,e.top,e.width,e.height)}function BTe(s,e,t){const i=e.width/s.offsetWidth,n=e.height/s.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/n;return new Mpt(o,r)}class Fk extends Eh{constructor(e,t,i){super(ct(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new jre(this.posx,this.posy),this.editorPos=OTe(i),this.relativePos=BTe(i,this.editorPos,this.pos)}}class Npt{constructor(e){this._editorViewDomNode=e}_create(e){return new Fk(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ue(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return ue(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return ue(e,ke.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return ue(e,ke.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return ue(e,ke.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return ue(e,"mousemove",i=>t(this._create(i)))}}class Ppt{constructor(e){this._editorViewDomNode=e}_create(e){return new Fk(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ue(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return ue(e,ke.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return ue(e,ke.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return ue(e,"pointermove",i=>t(this._create(i)))}}class Fpt extends V{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new SU),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Ro(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{n(new Fk(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const Gne=class Gne{constructor(e){this._editor=e,this._instanceId=++Gne._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new cn(()=>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 n=this._counter++;i=new Opt(t,`dyn-rule-${this._instanceId}-${n}`,k8(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())}};Gne._idPool=0;let aY=Gne;class Opt{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=gl(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const o=t[n];let r;typeof o=="object"?r=ze(o.id):r=o;const a=Bpt(n);i+=` + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Kat extends cr{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(142,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:g(143,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[g(144,"The minimap has the same size as the editor contents (and might scroll)."),g(145,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),g(146,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:g(147,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:g(148,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:g(149,"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(150,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:g(151,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:g(152,"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(153,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:g(154,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:g(155,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:g(156,"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:Et(t.enabled,this.defaultValue.enabled),autohide:Et(t.autohide,this.defaultValue.autohide),size:Kr(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Kr(t.side,this.defaultValue.side,["right","left"]),showSlider:Kr(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Et(t.renderCharacters,this.defaultValue.renderCharacters),scale:bo.clampedInt(t.scale,1,1,3),maxColumn:bo.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:Et(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:Et(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:Zf.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:Zf.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function qat(s){return s==="ctrlCmd"?Qt?"metaKey":"ctrlKey":"altKey"}class Qat extends cr{constructor(){super(x.padding,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:g(157,"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(158,"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 jat extends cr{constructor(){const e={enabled:!0,cycle:!0};super(x.parameterHints,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:g(159,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:g(160,"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:Et(t.enabled,this.defaultValue.enabled),cycle:Et(t.cycle,this.defaultValue.cycle)}}}class Yat extends z7{constructor(){super(x.pixelRatio)}compute(e,t,i){return e.pixelRatio}}class Jat extends cr{constructor(){super(x.placeholder,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class Xat extends cr{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[g(161,"Quick suggestions show inside the suggest widget"),g(162,"Quick suggestions show as ghost text"),g(163,"Quick suggestions are disabled")]}];super(x.quickSuggestions,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:g(164,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:g(165,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:g(166,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:g(167,"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:n}=e,o=["on","inline","off"];let r,a,c;return typeof t=="boolean"?r=t?"on":"off":r=Kr(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Kr(i,this.defaultValue.comments,o),typeof n=="boolean"?c=n?"on":"off":c=Kr(n,this.defaultValue.strings,o),{other:r,comments:a,strings:c}}}var wr;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(wr||(wr={}));class Zat extends cr{constructor(){super(x.lineNumbers,"lineNumbers",{renderType:wr.On,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[g(168,"Line numbers are not rendered."),g(169,"Line numbers are rendered as absolute number."),g(170,"Line numbers are rendered as distance in lines to cursor position."),g(171,"Line numbers are rendered every 10 lines.")],default:"on",description:g(172,"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=wr.Custom,i=e):e==="interval"?t=wr.Interval:e==="relative"?t=wr.Relative:e==="on"?t=wr.On:t=wr.Off),{renderType:t,renderFn:i}}}function Tj(s){const e=s.get(x.renderValidationDecorations);return e==="editable"?s.get(x.readOnly):e!=="on"}class ect extends cr{constructor(){const e=[],t={type:"number",description:g(173,"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(174,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:g(175,"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 n=i;t.push({column:bo.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class tct extends cr{constructor(){super(x.readOnlyMessage,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function bFe(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return Co.Hidden;case"visible":return Co.Visible;default:return Co.Auto}}let ict=class extends cr{constructor(){const e={vertical:Co.Auto,horizontal:Co.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(176,"The vertical scrollbar will be visible only when necessary."),g(177,"The vertical scrollbar will always be visible."),g(178,"The vertical scrollbar will always be hidden.")],default:"auto",description:g(179,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[g(180,"The horizontal scrollbar will be visible only when necessary."),g(181,"The horizontal scrollbar will always be visible."),g(182,"The horizontal scrollbar will always be hidden.")],default:"auto",description:g(183,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:g(184,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:g(185,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:g(186,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:g(187,"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),n=bo.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:bo.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:bFe(t.vertical,this.defaultValue.vertical),horizontal:bFe(t.horizontal,this.defaultValue.horizontal),useShadows:Et(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Et(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Et(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Et(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Et(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:bo.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:bo.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:Et(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Et(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Ef="inUntrustedWorkspace",Lu={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 nct extends cr{constructor(){const e={nonBasicASCII:Ef,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Ef,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(x.unicodeHighlighting,"unicodeHighlight",e,{[Lu.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ef],default:e.nonBasicASCII,description:g(188,"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.")},[Lu.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:g(189,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[Lu.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:g(190,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Lu.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ef],default:e.includeComments,description:g(191,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[Lu.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ef],default:e.includeStrings,description:g(192,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[Lu.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:g(193,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Lu.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:g(194,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Ys(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Ys(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new QV(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:SO(t.nonBasicASCII,Ef,[!0,!1,Ef]),invisibleCharacters:Et(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Et(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:SO(t.includeComments,Ef,[!0,!1,Ef]),includeStrings:SO(t.includeStrings,Ef,[!0,!1,Ef]),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[n,o]of Object.entries(e))o===!0&&(i[n]=!0);return i}}class sct extends cr{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(195,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[g(196,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),g(197,"Show the inline suggestion toolbar when hovering over an inline suggestion."),g(198,"Never show the inline suggestion toolbar.")],description:g(199,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:g(200,"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(201,"Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),mode:Kr(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Kr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Et(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Et(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:_h.string(t.fontFamily,this.defaultValue.fontFamily)}}}class oct extends cr{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1};super(x.inlineEdit,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:g(202,"Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[g(203,"Show the inline edit toolbar whenever an inline suggestion is shown."),g(204,"Show the inline edit toolbar when hovering over an inline suggestion."),g(205,"Never show the inline edit toolbar.")],description:g(206,"Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:g(207,"Controls the font family of the inline edit.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Et(t.enabled,this.defaultValue.enabled),showToolbar:Kr(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:_h.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:Et(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class rct extends cr{constructor(){const e={enabled:Hd.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Hd.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(x.bracketPairColorization,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(208,"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(209,"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:Et(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Et(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class act extends cr{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(210,"Enables bracket pair guides."),g(211,"Enables bracket pair guides only for the active bracket pair."),g(212,"Disables bracket pair guides.")],default:e.bracketPairs,description:g(213,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[g(214,"Enables horizontal guides as addition to vertical bracket pair guides."),g(215,"Enables horizontal guides only for the active bracket pair."),g(216,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:g(217,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:g(218,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:g(219,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[g(220,"Highlights the active indent guide."),g(221,"Highlights the active indent guide even if bracket guides are highlighted."),g(222,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:g(223,"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:SO(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:SO(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Et(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Et(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:SO(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function SO(s,e,t){const i=t.indexOf(s);return i===-1?e:t[i]}class cct extends cr{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(224,"Insert suggestion without overwriting text right of the cursor."),g(225,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:g(226,"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(227,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:g(228,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:g(229,"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(230,"Always select a suggestion when automatically triggering IntelliSense."),g(231,"Never select a suggestion when automatically triggering IntelliSense."),g(232,"Select a suggestion only when triggering IntelliSense from a trigger character."),g(233,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:g(234,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:g(235,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:g(236,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:g(237,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:g(238,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:g(239,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:g(240,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:g(241,"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(242,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:g(243,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:g(244,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:g(245,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:g(246,"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(247,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:g(248,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:g(249,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:g(250,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:g(251,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:g(252,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:g(253,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:g(254,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:g(255,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:g(256,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:g(257,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:g(258,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:g(259,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:g(260,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:g(261,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:g(262,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:g(263,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:g(264,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:g(265,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:g(266,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:g(267,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:g(268,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:g(269,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:g(270,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:g(271,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Kr(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Et(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Et(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Et(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Et(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Kr(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Et(t.showIcons,this.defaultValue.showIcons),showStatusBar:Et(t.showStatusBar,this.defaultValue.showStatusBar),preview:Et(t.preview,this.defaultValue.preview),previewMode:Kr(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Et(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Et(t.showMethods,this.defaultValue.showMethods),showFunctions:Et(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Et(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Et(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Et(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Et(t.showFields,this.defaultValue.showFields),showVariables:Et(t.showVariables,this.defaultValue.showVariables),showClasses:Et(t.showClasses,this.defaultValue.showClasses),showStructs:Et(t.showStructs,this.defaultValue.showStructs),showInterfaces:Et(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Et(t.showModules,this.defaultValue.showModules),showProperties:Et(t.showProperties,this.defaultValue.showProperties),showEvents:Et(t.showEvents,this.defaultValue.showEvents),showOperators:Et(t.showOperators,this.defaultValue.showOperators),showUnits:Et(t.showUnits,this.defaultValue.showUnits),showValues:Et(t.showValues,this.defaultValue.showValues),showConstants:Et(t.showConstants,this.defaultValue.showConstants),showEnums:Et(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Et(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Et(t.showKeywords,this.defaultValue.showKeywords),showWords:Et(t.showWords,this.defaultValue.showWords),showColors:Et(t.showColors,this.defaultValue.showColors),showFiles:Et(t.showFiles,this.defaultValue.showFiles),showReferences:Et(t.showReferences,this.defaultValue.showReferences),showFolders:Et(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Et(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Et(t.showSnippets,this.defaultValue.showSnippets),showUsers:Et(t.showUsers,this.defaultValue.showUsers),showIssues:Et(t.showIssues,this.defaultValue.showIssues)}}}class lct extends cr{constructor(){super(x.smartSelect,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:g(272,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:g(273,"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:Et(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Et(e.selectSubwords,this.defaultValue.selectSubwords)}}}class dct extends cr{constructor(){const e=[];super(x.wordSegmenterLocales,"wordSegmenterLocales",e,{anyOf:[{description:g(274,"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(274,"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 Ru;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(Ru||(Ru={}));class hct extends cr{constructor(){super(x.wrappingIndent,"wrappingIndent",Ru.Same,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[g(275,"No indentation. Wrapped lines begin at column 1."),g(276,"Wrapped lines get the same indentation as the parent."),g(277,"Wrapped lines get +1 indentation toward the parent."),g(278,"Wrapped lines get +2 indentation toward the parent.")],description:g(279,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return Ru.None;case"same":return Ru.Same;case"indent":return Ru.Indent;case"deepIndent":return Ru.DeepIndent}return Ru.Same}compute(e,t,i){return t.get(x.accessibilitySupport)===jl.Enabled?Ru.None:i}}class uct extends z7{constructor(){super(x.wrappingInfo)}compute(e,t,i){const n=t.get(x.layoutInfo);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}class gct extends cr{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(x.dropIntoEditor,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(280,"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(281,"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(282,"Show the drop selector widget after a file is dropped into the editor."),g(283,"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:Et(t.enabled,this.defaultValue.enabled),showDropSelector:Kr(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class fct extends cr{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(x.pasteAs,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:g(284,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:g(285,"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(286,"Show the paste selector widget after content is pasted into the editor."),g(287,"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:Et(t.enabled,this.defaultValue.enabled),showPasteSelector:Kr(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const pct="Consolas, 'Courier New', monospace",mct="Menlo, Monaco, 'Courier New', monospace",_ct="'Droid Sans Mono', 'monospace', monospace",rd={fontFamily:Qt?mct:pr?_ct:pct,fontWeight:"normal",fontSize:Qt?12:14,lineHeight:0,letterSpacing:0},qP=[];function Ue(s){return qP[s.id]=s,s}var x;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.ariaLabel=4]="ariaLabel",s[s.ariaRequired=5]="ariaRequired",s[s.autoClosingBrackets=6]="autoClosingBrackets",s[s.autoClosingComments=7]="autoClosingComments",s[s.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",s[s.autoClosingDelete=9]="autoClosingDelete",s[s.autoClosingOvertype=10]="autoClosingOvertype",s[s.autoClosingQuotes=11]="autoClosingQuotes",s[s.autoIndent=12]="autoIndent",s[s.automaticLayout=13]="automaticLayout",s[s.autoSurround=14]="autoSurround",s[s.bracketPairColorization=15]="bracketPairColorization",s[s.guides=16]="guides",s[s.codeLens=17]="codeLens",s[s.codeLensFontFamily=18]="codeLensFontFamily",s[s.codeLensFontSize=19]="codeLensFontSize",s[s.colorDecorators=20]="colorDecorators",s[s.colorDecoratorsLimit=21]="colorDecoratorsLimit",s[s.columnSelection=22]="columnSelection",s[s.comments=23]="comments",s[s.contextmenu=24]="contextmenu",s[s.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",s[s.cursorBlinking=26]="cursorBlinking",s[s.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",s[s.cursorStyle=28]="cursorStyle",s[s.cursorSurroundingLines=29]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",s[s.cursorWidth=31]="cursorWidth",s[s.disableLayerHinting=32]="disableLayerHinting",s[s.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",s[s.domReadOnly=34]="domReadOnly",s[s.dragAndDrop=35]="dragAndDrop",s[s.dropIntoEditor=36]="dropIntoEditor",s[s.emptySelectionClipboard=37]="emptySelectionClipboard",s[s.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",s[s.extraEditorClassName=39]="extraEditorClassName",s[s.fastScrollSensitivity=40]="fastScrollSensitivity",s[s.find=41]="find",s[s.fixedOverflowWidgets=42]="fixedOverflowWidgets",s[s.folding=43]="folding",s[s.foldingStrategy=44]="foldingStrategy",s[s.foldingHighlight=45]="foldingHighlight",s[s.foldingImportsByDefault=46]="foldingImportsByDefault",s[s.foldingMaximumRegions=47]="foldingMaximumRegions",s[s.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=49]="fontFamily",s[s.fontInfo=50]="fontInfo",s[s.fontLigatures=51]="fontLigatures",s[s.fontSize=52]="fontSize",s[s.fontWeight=53]="fontWeight",s[s.fontVariations=54]="fontVariations",s[s.formatOnPaste=55]="formatOnPaste",s[s.formatOnType=56]="formatOnType",s[s.glyphMargin=57]="glyphMargin",s[s.gotoLocation=58]="gotoLocation",s[s.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",s[s.hover=60]="hover",s[s.inDiffEditor=61]="inDiffEditor",s[s.inlineSuggest=62]="inlineSuggest",s[s.inlineEdit=63]="inlineEdit",s[s.letterSpacing=64]="letterSpacing",s[s.lightbulb=65]="lightbulb",s[s.lineDecorationsWidth=66]="lineDecorationsWidth",s[s.lineHeight=67]="lineHeight",s[s.lineNumbers=68]="lineNumbers",s[s.lineNumbersMinChars=69]="lineNumbersMinChars",s[s.linkedEditing=70]="linkedEditing",s[s.links=71]="links",s[s.matchBrackets=72]="matchBrackets",s[s.minimap=73]="minimap",s[s.mouseStyle=74]="mouseStyle",s[s.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=76]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",s[s.multiCursorModifier=78]="multiCursorModifier",s[s.multiCursorPaste=79]="multiCursorPaste",s[s.multiCursorLimit=80]="multiCursorLimit",s[s.occurrencesHighlight=81]="occurrencesHighlight",s[s.overviewRulerBorder=82]="overviewRulerBorder",s[s.overviewRulerLanes=83]="overviewRulerLanes",s[s.padding=84]="padding",s[s.pasteAs=85]="pasteAs",s[s.parameterHints=86]="parameterHints",s[s.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",s[s.placeholder=88]="placeholder",s[s.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",s[s.quickSuggestions=90]="quickSuggestions",s[s.quickSuggestionsDelay=91]="quickSuggestionsDelay",s[s.readOnly=92]="readOnly",s[s.readOnlyMessage=93]="readOnlyMessage",s[s.renameOnType=94]="renameOnType",s[s.renderControlCharacters=95]="renderControlCharacters",s[s.renderFinalNewline=96]="renderFinalNewline",s[s.renderLineHighlight=97]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=99]="renderValidationDecorations",s[s.renderWhitespace=100]="renderWhitespace",s[s.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",s[s.roundedSelection=102]="roundedSelection",s[s.rulers=103]="rulers",s[s.scrollbar=104]="scrollbar",s[s.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=106]="scrollBeyondLastLine",s[s.scrollPredominantAxis=107]="scrollPredominantAxis",s[s.selectionClipboard=108]="selectionClipboard",s[s.selectionHighlight=109]="selectionHighlight",s[s.selectOnLineNumbers=110]="selectOnLineNumbers",s[s.showFoldingControls=111]="showFoldingControls",s[s.showUnused=112]="showUnused",s[s.snippetSuggestions=113]="snippetSuggestions",s[s.smartSelect=114]="smartSelect",s[s.smoothScrolling=115]="smoothScrolling",s[s.stickyScroll=116]="stickyScroll",s[s.stickyTabStops=117]="stickyTabStops",s[s.stopRenderingLineAfter=118]="stopRenderingLineAfter",s[s.suggest=119]="suggest",s[s.suggestFontSize=120]="suggestFontSize",s[s.suggestLineHeight=121]="suggestLineHeight",s[s.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",s[s.suggestSelection=123]="suggestSelection",s[s.tabCompletion=124]="tabCompletion",s[s.tabIndex=125]="tabIndex",s[s.unicodeHighlighting=126]="unicodeHighlighting",s[s.unusualLineTerminators=127]="unusualLineTerminators",s[s.useShadowDOM=128]="useShadowDOM",s[s.useTabStops=129]="useTabStops",s[s.wordBreak=130]="wordBreak",s[s.wordSegmenterLocales=131]="wordSegmenterLocales",s[s.wordSeparators=132]="wordSeparators",s[s.wordWrap=133]="wordWrap",s[s.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=136]="wordWrapColumn",s[s.wordWrapOverride1=137]="wordWrapOverride1",s[s.wordWrapOverride2=138]="wordWrapOverride2",s[s.wrappingIndent=139]="wrappingIndent",s[s.wrappingStrategy=140]="wrappingStrategy",s[s.showDeprecated=141]="showDeprecated",s[s.inlayHints=142]="inlayHints",s[s.editorClassName=143]="editorClassName",s[s.pixelRatio=144]="pixelRatio",s[s.tabFocusMode=145]="tabFocusMode",s[s.layoutInfo=146]="layoutInfo",s[s.wrappingInfo=147]="wrappingInfo",s[s.defaultColorDecorators=148]="defaultColorDecorators",s[s.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",s[s.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(x||(x={}));const vh={acceptSuggestionOnCommitCharacter:Ue(new Ln(x.acceptSuggestionOnCommitCharacter,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:g(288,"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:Ue(new Br(x.acceptSuggestionOnEnter,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",g(289,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:g(290,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Ue(new kat),accessibilityPageSize:Ue(new bo(x.accessibilityPageSize,"accessibilityPageSize",10,1,Un.MAX_SAFE_SMALL_INTEGER,{description:g(291,"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:Ue(new _h(x.ariaLabel,"ariaLabel",g(292,"Editor content"))),ariaRequired:Ue(new Ln(x.ariaRequired,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Ue(new Ln(x.screenReaderAnnounceInlineSuggestion,"screenReaderAnnounceInlineSuggestion",!0,{description:g(293,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Ue(new Br(x.autoClosingBrackets,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(294,"Use language configurations to determine when to autoclose brackets."),g(295,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:g(296,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Ue(new Br(x.autoClosingComments,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(297,"Use language configurations to determine when to autoclose comments."),g(298,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:g(299,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Ue(new Br(x.autoClosingDelete,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",g(300,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:g(301,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Ue(new Br(x.autoClosingOvertype,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",g(302,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:g(303,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Ue(new Br(x.autoClosingQuotes,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",g(304,"Use language configurations to determine when to autoclose quotes."),g(305,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:g(306,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Ue(new vG(x.autoIndent,"autoIndent",cl.Full,"full",["none","keep","brackets","advanced","full"],Dat,{enumDescriptions:[g(307,"The editor will not insert indentation automatically."),g(308,"The editor will keep the current line's indentation."),g(309,"The editor will keep the current line's indentation and honor language defined brackets."),g(310,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),g(311,"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(312,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Ue(new Ln(x.automaticLayout,"automaticLayout",!1)),autoSurround:Ue(new Br(x.autoSurround,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[g(313,"Use language configurations to determine when to automatically surround selections."),g(314,"Surround with quotes but not brackets."),g(315,"Surround with brackets but not quotes."),""],description:g(316,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Ue(new rct),bracketPairGuides:Ue(new act),stickyTabStops:Ue(new Ln(x.stickyTabStops,"stickyTabStops",!1,{description:g(317,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Ue(new Ln(x.codeLens,"codeLens",!0,{description:g(318,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Ue(new _h(x.codeLensFontFamily,"codeLensFontFamily","",{description:g(319,"Controls the font family for CodeLens.")})),codeLensFontSize:Ue(new bo(x.codeLensFontSize,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:g(320,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Ue(new Ln(x.colorDecorators,"colorDecorators",!0,{description:g(321,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Ue(new Br(x.colorDecoratorsActivatedOn,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[g(322,"Make the color picker appear both on click and hover of the color decorator"),g(323,"Make the color picker appear on hover of the color decorator"),g(324,"Make the color picker appear on click of the color decorator")],description:g(325,"Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Ue(new bo(x.colorDecoratorsLimit,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:g(326,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Ue(new Ln(x.columnSelection,"columnSelection",!1,{description:g(327,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Ue(new Iat),contextmenu:Ue(new Ln(x.contextmenu,"contextmenu",!0)),copyWithSyntaxHighlighting:Ue(new Ln(x.copyWithSyntaxHighlighting,"copyWithSyntaxHighlighting",!0,{description:g(328,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Ue(new vG(x.cursorBlinking,"cursorBlinking",Td.Blink,"blink",["blink","smooth","phase","expand","solid"],Tat,{description:g(329,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Ue(new Br(x.cursorSmoothCaretAnimation,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[g(330,"Smooth caret animation is disabled."),g(331,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),g(332,"Smooth caret animation is always enabled.")],description:g(333,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Ue(new vG(x.cursorStyle,"cursorStyle",qr.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Rat,{description:g(334,"Controls the cursor style.")})),cursorSurroundingLines:Ue(new bo(x.cursorSurroundingLines,"cursorSurroundingLines",0,0,Un.MAX_SAFE_SMALL_INTEGER,{description:g(335,"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:Ue(new Br(x.cursorSurroundingLinesStyle,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[g(336,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),g(337,"`cursorSurroundingLines` is enforced always.")],markdownDescription:g(338,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:Ue(new bo(x.cursorWidth,"cursorWidth",0,0,Un.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(339,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Ue(new Ln(x.disableLayerHinting,"disableLayerHinting",!1)),disableMonospaceOptimizations:Ue(new Ln(x.disableMonospaceOptimizations,"disableMonospaceOptimizations",!1)),domReadOnly:Ue(new Ln(x.domReadOnly,"domReadOnly",!1)),dragAndDrop:Ue(new Ln(x.dragAndDrop,"dragAndDrop",!0,{description:g(340,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Ue(new Nat),dropIntoEditor:Ue(new gct),stickyScroll:Ue(new Vat),experimentalWhitespaceRendering:Ue(new Br(x.experimentalWhitespaceRendering,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[g(341,"Use a new rendering method with svgs."),g(342,"Use a new rendering method with font characters."),g(343,"Use the stable rendering method.")],description:g(344,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Ue(new _h(x.extraEditorClassName,"extraEditorClassName","")),fastScrollSensitivity:Ue(new Zf(x.fastScrollSensitivity,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:g(345,"Scrolling speed multiplier when pressing `Alt`.")})),find:Ue(new Pat),fixedOverflowWidgets:Ue(new Ln(x.fixedOverflowWidgets,"fixedOverflowWidgets",!1)),folding:Ue(new Ln(x.folding,"folding",!0,{description:g(346,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Ue(new Br(x.foldingStrategy,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[g(347,"Use a language-specific folding strategy if available, else the indentation-based one."),g(348,"Use the indentation-based folding strategy.")],description:g(349,"Controls the strategy for computing folding ranges.")})),foldingHighlight:Ue(new Ln(x.foldingHighlight,"foldingHighlight",!0,{description:g(350,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Ue(new Ln(x.foldingImportsByDefault,"foldingImportsByDefault",!1,{description:g(351,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Ue(new bo(x.foldingMaximumRegions,"foldingMaximumRegions",5e3,10,65e3,{description:g(352,"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:Ue(new Ln(x.unfoldOnClickAfterEndOfLine,"unfoldOnClickAfterEndOfLine",!1,{description:g(353,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Ue(new _h(x.fontFamily,"fontFamily",rd.fontFamily,{description:g(354,"Controls the font family.")})),fontInfo:Ue(new Fat),fontLigatures2:Ue(new xk),fontSize:Ue(new Oat),fontWeight:Ue(new Jge),fontVariations:Ue(new u8),formatOnPaste:Ue(new Ln(x.formatOnPaste,"formatOnPaste",!1,{description:g(355,"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:Ue(new Ln(x.formatOnType,"formatOnType",!1,{description:g(356,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Ue(new Ln(x.glyphMargin,"glyphMargin",!0,{description:g(357,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Ue(new Bat),hideCursorInOverviewRuler:Ue(new Ln(x.hideCursorInOverviewRuler,"hideCursorInOverviewRuler",!1,{description:g(358,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Ue(new Wat),inDiffEditor:Ue(new Ln(x.inDiffEditor,"inDiffEditor",!1)),letterSpacing:Ue(new Zf(x.letterSpacing,"letterSpacing",rd.letterSpacing,s=>Zf.clamp(s,-5,20),{description:g(359,"Controls the letter spacing in pixels.")})),lightbulb:Ue(new Uat),lineDecorationsWidth:Ue(new $at),lineHeight:Ue(new Gat),lineNumbers:Ue(new Zat),lineNumbersMinChars:Ue(new bo(x.lineNumbersMinChars,"lineNumbersMinChars",5,1,300)),linkedEditing:Ue(new Ln(x.linkedEditing,"linkedEditing",!1,{description:g(360,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Ue(new Ln(x.links,"links",!0,{description:g(361,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Ue(new Br(x.matchBrackets,"matchBrackets","always",["always","near","never"],{description:g(362,"Highlight matching brackets.")})),minimap:Ue(new Kat),mouseStyle:Ue(new Br(x.mouseStyle,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Ue(new Zf(x.mouseWheelScrollSensitivity,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:g(363,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Ue(new Ln(x.mouseWheelZoom,"mouseWheelZoom",!1,{markdownDescription:Qt?g(364,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):g(365,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Ue(new Ln(x.multiCursorMergeOverlapping,"multiCursorMergeOverlapping",!0,{description:g(366,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Ue(new vG(x.multiCursorModifier,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],qat,{markdownEnumDescriptions:[g(367,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(368,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:g(369,"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:Ue(new Br(x.multiCursorPaste,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[g(370,"Each cursor pastes a single line of the text."),g(371,"Each cursor pastes the full text.")],markdownDescription:g(372,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Ue(new bo(x.multiCursorLimit,"multiCursorLimit",1e4,1,1e5,{markdownDescription:g(373,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Ue(new Br(x.occurrencesHighlight,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[g(374,"Does not highlight occurrences."),g(375,"Highlights occurrences only in the current file."),g(376,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:g(377,"Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Ue(new Ln(x.overviewRulerBorder,"overviewRulerBorder",!0,{description:g(378,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Ue(new bo(x.overviewRulerLanes,"overviewRulerLanes",3,0,3)),padding:Ue(new Qat),pasteAs:Ue(new fct),parameterHints:Ue(new jat),peekWidgetDefaultFocus:Ue(new Br(x.peekWidgetDefaultFocus,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[g(379,"Focus the tree when opening peek"),g(380,"Focus the editor when opening peek")],description:g(381,"Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:Ue(new Jat),definitionLinkOpensInPeek:Ue(new Ln(x.definitionLinkOpensInPeek,"definitionLinkOpensInPeek",!1,{description:g(382,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Ue(new Xat),quickSuggestionsDelay:Ue(new bo(x.quickSuggestionsDelay,"quickSuggestionsDelay",10,0,Un.MAX_SAFE_SMALL_INTEGER,{description:g(383,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Ue(new Ln(x.readOnly,"readOnly",!1)),readOnlyMessage:Ue(new tct),renameOnType:Ue(new Ln(x.renameOnType,"renameOnType",!1,{description:g(384,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:g(385,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Ue(new Ln(x.renderControlCharacters,"renderControlCharacters",!0,{description:g(386,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Ue(new Br(x.renderFinalNewline,"renderFinalNewline",pr?"dimmed":"on",["off","on","dimmed"],{description:g(387,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Ue(new Br(x.renderLineHighlight,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",g(388,"Highlights both the gutter and the current line.")],description:g(389,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Ue(new Ln(x.renderLineHighlightOnlyWhenFocus,"renderLineHighlightOnlyWhenFocus",!1,{description:g(390,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Ue(new Br(x.renderValidationDecorations,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Ue(new Br(x.renderWhitespace,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",g(391,"Render whitespace characters except for single spaces between words."),g(392,"Render whitespace characters only on selected text."),g(393,"Render only trailing whitespace characters."),""],description:g(394,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Ue(new bo(x.revealHorizontalRightPadding,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Ue(new Ln(x.roundedSelection,"roundedSelection",!0,{description:g(395,"Controls whether selections should have rounded corners.")})),rulers:Ue(new ect),scrollbar:Ue(new ict),scrollBeyondLastColumn:Ue(new bo(x.scrollBeyondLastColumn,"scrollBeyondLastColumn",4,0,Un.MAX_SAFE_SMALL_INTEGER,{description:g(396,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Ue(new Ln(x.scrollBeyondLastLine,"scrollBeyondLastLine",!0,{description:g(397,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Ue(new Ln(x.scrollPredominantAxis,"scrollPredominantAxis",!0,{description:g(398,"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:Ue(new Ln(x.selectionClipboard,"selectionClipboard",!0,{description:g(399,"Controls whether the Linux primary clipboard should be supported."),included:pr})),selectionHighlight:Ue(new Ln(x.selectionHighlight,"selectionHighlight",!0,{description:g(400,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Ue(new Ln(x.selectOnLineNumbers,"selectOnLineNumbers",!0)),showFoldingControls:Ue(new Br(x.showFoldingControls,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[g(401,"Always show the folding controls."),g(402,"Never show the folding controls and reduce the gutter size."),g(403,"Only show the folding controls when the mouse is over the gutter.")],description:g(404,"Controls when the folding controls on the gutter are shown.")})),showUnused:Ue(new Ln(x.showUnused,"showUnused",!0,{description:g(405,"Controls fading out of unused code.")})),showDeprecated:Ue(new Ln(x.showDeprecated,"showDeprecated",!0,{description:g(406,"Controls strikethrough deprecated variables.")})),inlayHints:Ue(new zat),snippetSuggestions:Ue(new Br(x.snippetSuggestions,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[g(407,"Show snippet suggestions on top of other suggestions."),g(408,"Show snippet suggestions below other suggestions."),g(409,"Show snippets suggestions with other suggestions."),g(410,"Do not show snippet suggestions.")],description:g(411,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Ue(new lct),smoothScrolling:Ue(new Ln(x.smoothScrolling,"smoothScrolling",!1,{description:g(412,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Ue(new bo(x.stopRenderingLineAfter,"stopRenderingLineAfter",1e4,-1,Un.MAX_SAFE_SMALL_INTEGER)),suggest:Ue(new cct),inlineSuggest:Ue(new sct),inlineEdit:Ue(new oct),inlineCompletionsAccessibilityVerbose:Ue(new Ln(x.inlineCompletionsAccessibilityVerbose,"inlineCompletionsAccessibilityVerbose",!1,{description:g(413,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Ue(new bo(x.suggestFontSize,"suggestFontSize",0,0,1e3,{markdownDescription:g(414,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Ue(new bo(x.suggestLineHeight,"suggestLineHeight",0,0,1e3,{markdownDescription:g(415,"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:Ue(new Ln(x.suggestOnTriggerCharacters,"suggestOnTriggerCharacters",!0,{description:g(416,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Ue(new Br(x.suggestSelection,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[g(417,"Always select the first suggestion."),g(418,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),g(419,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:g(420,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Ue(new Br(x.tabCompletion,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[g(421,"Tab complete will insert the best matching suggestion when pressing tab."),g(422,"Disable tab completions."),g(423,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:g(424,"Enables tab completions.")})),tabIndex:Ue(new bo(x.tabIndex,"tabIndex",0,-1,Un.MAX_SAFE_SMALL_INTEGER)),unicodeHighlight:Ue(new nct),unusualLineTerminators:Ue(new Br(x.unusualLineTerminators,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[g(425,"Unusual line terminators are automatically removed."),g(426,"Unusual line terminators are ignored."),g(427,"Unusual line terminators prompt to be removed.")],description:g(428,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:Ue(new Ln(x.useShadowDOM,"useShadowDOM",!0)),useTabStops:Ue(new Ln(x.useTabStops,"useTabStops",!0,{description:g(429,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:Ue(new Br(x.wordBreak,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[g(430,"Use the default line break rule."),g(431,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:g(432,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:Ue(new dct),wordSeparators:Ue(new _h(x.wordSeparators,"wordSeparators",M6e,{description:g(433,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Ue(new Br(x.wordWrap,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[g(434,"Lines will never wrap."),g(435,"Lines will wrap at the viewport width."),g(436,"Lines will wrap at `#editor.wordWrapColumn#`."),g(437,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:g(438,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Ue(new _h(x.wordWrapBreakAfterCharacters,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Ue(new _h(x.wordWrapBreakBeforeCharacters,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Ue(new bo(x.wordWrapColumn,"wordWrapColumn",80,1,Un.MAX_SAFE_SMALL_INTEGER,{markdownDescription:g(439,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Ue(new Br(x.wordWrapOverride1,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Ue(new Br(x.wordWrapOverride2,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Ue(new Mat),defaultColorDecorators:Ue(new Ln(x.defaultColorDecorators,"defaultColorDecorators",!1,{markdownDescription:g(440,"Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Ue(new Yat),tabFocusMode:Ue(new Ln(x.tabFocusMode,"tabFocusMode",!1,{markdownDescription:g(441,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Ue(new CO),wrappingInfo:Ue(new uct),wrappingIndent:Ue(new hct),wrappingStrategy:Ue(new Hat)};var S;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.F20=78]="F20",s[s.F21=79]="F21",s[s.F22=80]="F22",s[s.F23=81]="F23",s[s.F24=82]="F24",s[s.NumLock=83]="NumLock",s[s.ScrollLock=84]="ScrollLock",s[s.Semicolon=85]="Semicolon",s[s.Equal=86]="Equal",s[s.Comma=87]="Comma",s[s.Minus=88]="Minus",s[s.Period=89]="Period",s[s.Slash=90]="Slash",s[s.Backquote=91]="Backquote",s[s.BracketLeft=92]="BracketLeft",s[s.Backslash=93]="Backslash",s[s.BracketRight=94]="BracketRight",s[s.Quote=95]="Quote",s[s.OEM_8=96]="OEM_8",s[s.IntlBackslash=97]="IntlBackslash",s[s.Numpad0=98]="Numpad0",s[s.Numpad1=99]="Numpad1",s[s.Numpad2=100]="Numpad2",s[s.Numpad3=101]="Numpad3",s[s.Numpad4=102]="Numpad4",s[s.Numpad5=103]="Numpad5",s[s.Numpad6=104]="Numpad6",s[s.Numpad7=105]="Numpad7",s[s.Numpad8=106]="Numpad8",s[s.Numpad9=107]="Numpad9",s[s.NumpadMultiply=108]="NumpadMultiply",s[s.NumpadAdd=109]="NumpadAdd",s[s.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=111]="NumpadSubtract",s[s.NumpadDecimal=112]="NumpadDecimal",s[s.NumpadDivide=113]="NumpadDivide",s[s.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",s[s.ABNT_C1=115]="ABNT_C1",s[s.ABNT_C2=116]="ABNT_C2",s[s.AudioVolumeMute=117]="AudioVolumeMute",s[s.AudioVolumeUp=118]="AudioVolumeUp",s[s.AudioVolumeDown=119]="AudioVolumeDown",s[s.BrowserSearch=120]="BrowserSearch",s[s.BrowserHome=121]="BrowserHome",s[s.BrowserBack=122]="BrowserBack",s[s.BrowserForward=123]="BrowserForward",s[s.MediaTrackNext=124]="MediaTrackNext",s[s.MediaTrackPrevious=125]="MediaTrackPrevious",s[s.MediaStop=126]="MediaStop",s[s.MediaPlayPause=127]="MediaPlayPause",s[s.LaunchMediaPlayer=128]="LaunchMediaPlayer",s[s.LaunchMail=129]="LaunchMail",s[s.LaunchApp2=130]="LaunchApp2",s[s.Clear=131]="Clear",s[s.MAX_VALUE=132]="MAX_VALUE"})(S||(S={}));var X;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.None=0]="None",s[s.Hyper=1]="Hyper",s[s.Super=2]="Super",s[s.Fn=3]="Fn",s[s.FnLock=4]="FnLock",s[s.Suspend=5]="Suspend",s[s.Resume=6]="Resume",s[s.Turbo=7]="Turbo",s[s.Sleep=8]="Sleep",s[s.WakeUp=9]="WakeUp",s[s.KeyA=10]="KeyA",s[s.KeyB=11]="KeyB",s[s.KeyC=12]="KeyC",s[s.KeyD=13]="KeyD",s[s.KeyE=14]="KeyE",s[s.KeyF=15]="KeyF",s[s.KeyG=16]="KeyG",s[s.KeyH=17]="KeyH",s[s.KeyI=18]="KeyI",s[s.KeyJ=19]="KeyJ",s[s.KeyK=20]="KeyK",s[s.KeyL=21]="KeyL",s[s.KeyM=22]="KeyM",s[s.KeyN=23]="KeyN",s[s.KeyO=24]="KeyO",s[s.KeyP=25]="KeyP",s[s.KeyQ=26]="KeyQ",s[s.KeyR=27]="KeyR",s[s.KeyS=28]="KeyS",s[s.KeyT=29]="KeyT",s[s.KeyU=30]="KeyU",s[s.KeyV=31]="KeyV",s[s.KeyW=32]="KeyW",s[s.KeyX=33]="KeyX",s[s.KeyY=34]="KeyY",s[s.KeyZ=35]="KeyZ",s[s.Digit1=36]="Digit1",s[s.Digit2=37]="Digit2",s[s.Digit3=38]="Digit3",s[s.Digit4=39]="Digit4",s[s.Digit5=40]="Digit5",s[s.Digit6=41]="Digit6",s[s.Digit7=42]="Digit7",s[s.Digit8=43]="Digit8",s[s.Digit9=44]="Digit9",s[s.Digit0=45]="Digit0",s[s.Enter=46]="Enter",s[s.Escape=47]="Escape",s[s.Backspace=48]="Backspace",s[s.Tab=49]="Tab",s[s.Space=50]="Space",s[s.Minus=51]="Minus",s[s.Equal=52]="Equal",s[s.BracketLeft=53]="BracketLeft",s[s.BracketRight=54]="BracketRight",s[s.Backslash=55]="Backslash",s[s.IntlHash=56]="IntlHash",s[s.Semicolon=57]="Semicolon",s[s.Quote=58]="Quote",s[s.Backquote=59]="Backquote",s[s.Comma=60]="Comma",s[s.Period=61]="Period",s[s.Slash=62]="Slash",s[s.CapsLock=63]="CapsLock",s[s.F1=64]="F1",s[s.F2=65]="F2",s[s.F3=66]="F3",s[s.F4=67]="F4",s[s.F5=68]="F5",s[s.F6=69]="F6",s[s.F7=70]="F7",s[s.F8=71]="F8",s[s.F9=72]="F9",s[s.F10=73]="F10",s[s.F11=74]="F11",s[s.F12=75]="F12",s[s.PrintScreen=76]="PrintScreen",s[s.ScrollLock=77]="ScrollLock",s[s.Pause=78]="Pause",s[s.Insert=79]="Insert",s[s.Home=80]="Home",s[s.PageUp=81]="PageUp",s[s.Delete=82]="Delete",s[s.End=83]="End",s[s.PageDown=84]="PageDown",s[s.ArrowRight=85]="ArrowRight",s[s.ArrowLeft=86]="ArrowLeft",s[s.ArrowDown=87]="ArrowDown",s[s.ArrowUp=88]="ArrowUp",s[s.NumLock=89]="NumLock",s[s.NumpadDivide=90]="NumpadDivide",s[s.NumpadMultiply=91]="NumpadMultiply",s[s.NumpadSubtract=92]="NumpadSubtract",s[s.NumpadAdd=93]="NumpadAdd",s[s.NumpadEnter=94]="NumpadEnter",s[s.Numpad1=95]="Numpad1",s[s.Numpad2=96]="Numpad2",s[s.Numpad3=97]="Numpad3",s[s.Numpad4=98]="Numpad4",s[s.Numpad5=99]="Numpad5",s[s.Numpad6=100]="Numpad6",s[s.Numpad7=101]="Numpad7",s[s.Numpad8=102]="Numpad8",s[s.Numpad9=103]="Numpad9",s[s.Numpad0=104]="Numpad0",s[s.NumpadDecimal=105]="NumpadDecimal",s[s.IntlBackslash=106]="IntlBackslash",s[s.ContextMenu=107]="ContextMenu",s[s.Power=108]="Power",s[s.NumpadEqual=109]="NumpadEqual",s[s.F13=110]="F13",s[s.F14=111]="F14",s[s.F15=112]="F15",s[s.F16=113]="F16",s[s.F17=114]="F17",s[s.F18=115]="F18",s[s.F19=116]="F19",s[s.F20=117]="F20",s[s.F21=118]="F21",s[s.F22=119]="F22",s[s.F23=120]="F23",s[s.F24=121]="F24",s[s.Open=122]="Open",s[s.Help=123]="Help",s[s.Select=124]="Select",s[s.Again=125]="Again",s[s.Undo=126]="Undo",s[s.Cut=127]="Cut",s[s.Copy=128]="Copy",s[s.Paste=129]="Paste",s[s.Find=130]="Find",s[s.AudioVolumeMute=131]="AudioVolumeMute",s[s.AudioVolumeUp=132]="AudioVolumeUp",s[s.AudioVolumeDown=133]="AudioVolumeDown",s[s.NumpadComma=134]="NumpadComma",s[s.IntlRo=135]="IntlRo",s[s.KanaMode=136]="KanaMode",s[s.IntlYen=137]="IntlYen",s[s.Convert=138]="Convert",s[s.NonConvert=139]="NonConvert",s[s.Lang1=140]="Lang1",s[s.Lang2=141]="Lang2",s[s.Lang3=142]="Lang3",s[s.Lang4=143]="Lang4",s[s.Lang5=144]="Lang5",s[s.Abort=145]="Abort",s[s.Props=146]="Props",s[s.NumpadParenLeft=147]="NumpadParenLeft",s[s.NumpadParenRight=148]="NumpadParenRight",s[s.NumpadBackspace=149]="NumpadBackspace",s[s.NumpadMemoryStore=150]="NumpadMemoryStore",s[s.NumpadMemoryRecall=151]="NumpadMemoryRecall",s[s.NumpadMemoryClear=152]="NumpadMemoryClear",s[s.NumpadMemoryAdd=153]="NumpadMemoryAdd",s[s.NumpadMemorySubtract=154]="NumpadMemorySubtract",s[s.NumpadClear=155]="NumpadClear",s[s.NumpadClearEntry=156]="NumpadClearEntry",s[s.ControlLeft=157]="ControlLeft",s[s.ShiftLeft=158]="ShiftLeft",s[s.AltLeft=159]="AltLeft",s[s.MetaLeft=160]="MetaLeft",s[s.ControlRight=161]="ControlRight",s[s.ShiftRight=162]="ShiftRight",s[s.AltRight=163]="AltRight",s[s.MetaRight=164]="MetaRight",s[s.BrightnessUp=165]="BrightnessUp",s[s.BrightnessDown=166]="BrightnessDown",s[s.MediaPlay=167]="MediaPlay",s[s.MediaRecord=168]="MediaRecord",s[s.MediaFastForward=169]="MediaFastForward",s[s.MediaRewind=170]="MediaRewind",s[s.MediaTrackNext=171]="MediaTrackNext",s[s.MediaTrackPrevious=172]="MediaTrackPrevious",s[s.MediaStop=173]="MediaStop",s[s.Eject=174]="Eject",s[s.MediaPlayPause=175]="MediaPlayPause",s[s.MediaSelect=176]="MediaSelect",s[s.LaunchMail=177]="LaunchMail",s[s.LaunchApp2=178]="LaunchApp2",s[s.LaunchApp1=179]="LaunchApp1",s[s.SelectTask=180]="SelectTask",s[s.LaunchScreenSaver=181]="LaunchScreenSaver",s[s.BrowserSearch=182]="BrowserSearch",s[s.BrowserHome=183]="BrowserHome",s[s.BrowserBack=184]="BrowserBack",s[s.BrowserForward=185]="BrowserForward",s[s.BrowserStop=186]="BrowserStop",s[s.BrowserRefresh=187]="BrowserRefresh",s[s.BrowserFavorites=188]="BrowserFavorites",s[s.ZoomToggle=189]="ZoomToggle",s[s.MailReply=190]="MailReply",s[s.MailForward=191]="MailForward",s[s.MailSend=192]="MailSend",s[s.MAX_VALUE=193]="MAX_VALUE"})(X||(X={}));class z1e{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()]||S.Unknown}}const lq=new z1e,Xge=new z1e,Zge=new z1e,Y6e=new Array(230),efe={},J6e=[],X6e=Object.create(null),Z6e=Object.create(null),Wp={lowerCaseToEnum:s=>Z6e[s]||X.None,toEnum:s=>X6e[s]||X.None,toString:s=>J6e[s]||"None"},Wg=[],g8=[];for(let s=0;s<=X.MAX_VALUE;s++)Wg[s]=S.DependsOnKbLayout;for(let s=0;s<=S.MAX_VALUE;s++)g8[s]=X.DependsOnKbLayout;(function(){const s="",e=[[1,X.None,"None",S.Unknown,"unknown",0,"VK_UNKNOWN",s,s],[1,X.Hyper,"Hyper",S.Unknown,s,0,s,s,s],[1,X.Super,"Super",S.Unknown,s,0,s,s,s],[1,X.Fn,"Fn",S.Unknown,s,0,s,s,s],[1,X.FnLock,"FnLock",S.Unknown,s,0,s,s,s],[1,X.Suspend,"Suspend",S.Unknown,s,0,s,s,s],[1,X.Resume,"Resume",S.Unknown,s,0,s,s,s],[1,X.Turbo,"Turbo",S.Unknown,s,0,s,s,s],[1,X.Sleep,"Sleep",S.Unknown,s,0,"VK_SLEEP",s,s],[1,X.WakeUp,"WakeUp",S.Unknown,s,0,s,s,s],[0,X.KeyA,"KeyA",S.KeyA,"A",65,"VK_A",s,s],[0,X.KeyB,"KeyB",S.KeyB,"B",66,"VK_B",s,s],[0,X.KeyC,"KeyC",S.KeyC,"C",67,"VK_C",s,s],[0,X.KeyD,"KeyD",S.KeyD,"D",68,"VK_D",s,s],[0,X.KeyE,"KeyE",S.KeyE,"E",69,"VK_E",s,s],[0,X.KeyF,"KeyF",S.KeyF,"F",70,"VK_F",s,s],[0,X.KeyG,"KeyG",S.KeyG,"G",71,"VK_G",s,s],[0,X.KeyH,"KeyH",S.KeyH,"H",72,"VK_H",s,s],[0,X.KeyI,"KeyI",S.KeyI,"I",73,"VK_I",s,s],[0,X.KeyJ,"KeyJ",S.KeyJ,"J",74,"VK_J",s,s],[0,X.KeyK,"KeyK",S.KeyK,"K",75,"VK_K",s,s],[0,X.KeyL,"KeyL",S.KeyL,"L",76,"VK_L",s,s],[0,X.KeyM,"KeyM",S.KeyM,"M",77,"VK_M",s,s],[0,X.KeyN,"KeyN",S.KeyN,"N",78,"VK_N",s,s],[0,X.KeyO,"KeyO",S.KeyO,"O",79,"VK_O",s,s],[0,X.KeyP,"KeyP",S.KeyP,"P",80,"VK_P",s,s],[0,X.KeyQ,"KeyQ",S.KeyQ,"Q",81,"VK_Q",s,s],[0,X.KeyR,"KeyR",S.KeyR,"R",82,"VK_R",s,s],[0,X.KeyS,"KeyS",S.KeyS,"S",83,"VK_S",s,s],[0,X.KeyT,"KeyT",S.KeyT,"T",84,"VK_T",s,s],[0,X.KeyU,"KeyU",S.KeyU,"U",85,"VK_U",s,s],[0,X.KeyV,"KeyV",S.KeyV,"V",86,"VK_V",s,s],[0,X.KeyW,"KeyW",S.KeyW,"W",87,"VK_W",s,s],[0,X.KeyX,"KeyX",S.KeyX,"X",88,"VK_X",s,s],[0,X.KeyY,"KeyY",S.KeyY,"Y",89,"VK_Y",s,s],[0,X.KeyZ,"KeyZ",S.KeyZ,"Z",90,"VK_Z",s,s],[0,X.Digit1,"Digit1",S.Digit1,"1",49,"VK_1",s,s],[0,X.Digit2,"Digit2",S.Digit2,"2",50,"VK_2",s,s],[0,X.Digit3,"Digit3",S.Digit3,"3",51,"VK_3",s,s],[0,X.Digit4,"Digit4",S.Digit4,"4",52,"VK_4",s,s],[0,X.Digit5,"Digit5",S.Digit5,"5",53,"VK_5",s,s],[0,X.Digit6,"Digit6",S.Digit6,"6",54,"VK_6",s,s],[0,X.Digit7,"Digit7",S.Digit7,"7",55,"VK_7",s,s],[0,X.Digit8,"Digit8",S.Digit8,"8",56,"VK_8",s,s],[0,X.Digit9,"Digit9",S.Digit9,"9",57,"VK_9",s,s],[0,X.Digit0,"Digit0",S.Digit0,"0",48,"VK_0",s,s],[1,X.Enter,"Enter",S.Enter,"Enter",13,"VK_RETURN",s,s],[1,X.Escape,"Escape",S.Escape,"Escape",27,"VK_ESCAPE",s,s],[1,X.Backspace,"Backspace",S.Backspace,"Backspace",8,"VK_BACK",s,s],[1,X.Tab,"Tab",S.Tab,"Tab",9,"VK_TAB",s,s],[1,X.Space,"Space",S.Space,"Space",32,"VK_SPACE",s,s],[0,X.Minus,"Minus",S.Minus,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,X.Equal,"Equal",S.Equal,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,X.BracketLeft,"BracketLeft",S.BracketLeft,"[",219,"VK_OEM_4","[","OEM_4"],[0,X.BracketRight,"BracketRight",S.BracketRight,"]",221,"VK_OEM_6","]","OEM_6"],[0,X.Backslash,"Backslash",S.Backslash,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,X.IntlHash,"IntlHash",S.Unknown,s,0,s,s,s],[0,X.Semicolon,"Semicolon",S.Semicolon,";",186,"VK_OEM_1",";","OEM_1"],[0,X.Quote,"Quote",S.Quote,"'",222,"VK_OEM_7","'","OEM_7"],[0,X.Backquote,"Backquote",S.Backquote,"`",192,"VK_OEM_3","`","OEM_3"],[0,X.Comma,"Comma",S.Comma,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,X.Period,"Period",S.Period,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,X.Slash,"Slash",S.Slash,"/",191,"VK_OEM_2","/","OEM_2"],[1,X.CapsLock,"CapsLock",S.CapsLock,"CapsLock",20,"VK_CAPITAL",s,s],[1,X.F1,"F1",S.F1,"F1",112,"VK_F1",s,s],[1,X.F2,"F2",S.F2,"F2",113,"VK_F2",s,s],[1,X.F3,"F3",S.F3,"F3",114,"VK_F3",s,s],[1,X.F4,"F4",S.F4,"F4",115,"VK_F4",s,s],[1,X.F5,"F5",S.F5,"F5",116,"VK_F5",s,s],[1,X.F6,"F6",S.F6,"F6",117,"VK_F6",s,s],[1,X.F7,"F7",S.F7,"F7",118,"VK_F7",s,s],[1,X.F8,"F8",S.F8,"F8",119,"VK_F8",s,s],[1,X.F9,"F9",S.F9,"F9",120,"VK_F9",s,s],[1,X.F10,"F10",S.F10,"F10",121,"VK_F10",s,s],[1,X.F11,"F11",S.F11,"F11",122,"VK_F11",s,s],[1,X.F12,"F12",S.F12,"F12",123,"VK_F12",s,s],[1,X.PrintScreen,"PrintScreen",S.Unknown,s,0,s,s,s],[1,X.ScrollLock,"ScrollLock",S.ScrollLock,"ScrollLock",145,"VK_SCROLL",s,s],[1,X.Pause,"Pause",S.PauseBreak,"PauseBreak",19,"VK_PAUSE",s,s],[1,X.Insert,"Insert",S.Insert,"Insert",45,"VK_INSERT",s,s],[1,X.Home,"Home",S.Home,"Home",36,"VK_HOME",s,s],[1,X.PageUp,"PageUp",S.PageUp,"PageUp",33,"VK_PRIOR",s,s],[1,X.Delete,"Delete",S.Delete,"Delete",46,"VK_DELETE",s,s],[1,X.End,"End",S.End,"End",35,"VK_END",s,s],[1,X.PageDown,"PageDown",S.PageDown,"PageDown",34,"VK_NEXT",s,s],[1,X.ArrowRight,"ArrowRight",S.RightArrow,"RightArrow",39,"VK_RIGHT","Right",s],[1,X.ArrowLeft,"ArrowLeft",S.LeftArrow,"LeftArrow",37,"VK_LEFT","Left",s],[1,X.ArrowDown,"ArrowDown",S.DownArrow,"DownArrow",40,"VK_DOWN","Down",s],[1,X.ArrowUp,"ArrowUp",S.UpArrow,"UpArrow",38,"VK_UP","Up",s],[1,X.NumLock,"NumLock",S.NumLock,"NumLock",144,"VK_NUMLOCK",s,s],[1,X.NumpadDivide,"NumpadDivide",S.NumpadDivide,"NumPad_Divide",111,"VK_DIVIDE",s,s],[1,X.NumpadMultiply,"NumpadMultiply",S.NumpadMultiply,"NumPad_Multiply",106,"VK_MULTIPLY",s,s],[1,X.NumpadSubtract,"NumpadSubtract",S.NumpadSubtract,"NumPad_Subtract",109,"VK_SUBTRACT",s,s],[1,X.NumpadAdd,"NumpadAdd",S.NumpadAdd,"NumPad_Add",107,"VK_ADD",s,s],[1,X.NumpadEnter,"NumpadEnter",S.Enter,s,0,s,s,s],[1,X.Numpad1,"Numpad1",S.Numpad1,"NumPad1",97,"VK_NUMPAD1",s,s],[1,X.Numpad2,"Numpad2",S.Numpad2,"NumPad2",98,"VK_NUMPAD2",s,s],[1,X.Numpad3,"Numpad3",S.Numpad3,"NumPad3",99,"VK_NUMPAD3",s,s],[1,X.Numpad4,"Numpad4",S.Numpad4,"NumPad4",100,"VK_NUMPAD4",s,s],[1,X.Numpad5,"Numpad5",S.Numpad5,"NumPad5",101,"VK_NUMPAD5",s,s],[1,X.Numpad6,"Numpad6",S.Numpad6,"NumPad6",102,"VK_NUMPAD6",s,s],[1,X.Numpad7,"Numpad7",S.Numpad7,"NumPad7",103,"VK_NUMPAD7",s,s],[1,X.Numpad8,"Numpad8",S.Numpad8,"NumPad8",104,"VK_NUMPAD8",s,s],[1,X.Numpad9,"Numpad9",S.Numpad9,"NumPad9",105,"VK_NUMPAD9",s,s],[1,X.Numpad0,"Numpad0",S.Numpad0,"NumPad0",96,"VK_NUMPAD0",s,s],[1,X.NumpadDecimal,"NumpadDecimal",S.NumpadDecimal,"NumPad_Decimal",110,"VK_DECIMAL",s,s],[0,X.IntlBackslash,"IntlBackslash",S.IntlBackslash,"OEM_102",226,"VK_OEM_102",s,s],[1,X.ContextMenu,"ContextMenu",S.ContextMenu,"ContextMenu",93,s,s,s],[1,X.Power,"Power",S.Unknown,s,0,s,s,s],[1,X.NumpadEqual,"NumpadEqual",S.Unknown,s,0,s,s,s],[1,X.F13,"F13",S.F13,"F13",124,"VK_F13",s,s],[1,X.F14,"F14",S.F14,"F14",125,"VK_F14",s,s],[1,X.F15,"F15",S.F15,"F15",126,"VK_F15",s,s],[1,X.F16,"F16",S.F16,"F16",127,"VK_F16",s,s],[1,X.F17,"F17",S.F17,"F17",128,"VK_F17",s,s],[1,X.F18,"F18",S.F18,"F18",129,"VK_F18",s,s],[1,X.F19,"F19",S.F19,"F19",130,"VK_F19",s,s],[1,X.F20,"F20",S.F20,"F20",131,"VK_F20",s,s],[1,X.F21,"F21",S.F21,"F21",132,"VK_F21",s,s],[1,X.F22,"F22",S.F22,"F22",133,"VK_F22",s,s],[1,X.F23,"F23",S.F23,"F23",134,"VK_F23",s,s],[1,X.F24,"F24",S.F24,"F24",135,"VK_F24",s,s],[1,X.Open,"Open",S.Unknown,s,0,s,s,s],[1,X.Help,"Help",S.Unknown,s,0,s,s,s],[1,X.Select,"Select",S.Unknown,s,0,s,s,s],[1,X.Again,"Again",S.Unknown,s,0,s,s,s],[1,X.Undo,"Undo",S.Unknown,s,0,s,s,s],[1,X.Cut,"Cut",S.Unknown,s,0,s,s,s],[1,X.Copy,"Copy",S.Unknown,s,0,s,s,s],[1,X.Paste,"Paste",S.Unknown,s,0,s,s,s],[1,X.Find,"Find",S.Unknown,s,0,s,s,s],[1,X.AudioVolumeMute,"AudioVolumeMute",S.AudioVolumeMute,"AudioVolumeMute",173,"VK_VOLUME_MUTE",s,s],[1,X.AudioVolumeUp,"AudioVolumeUp",S.AudioVolumeUp,"AudioVolumeUp",175,"VK_VOLUME_UP",s,s],[1,X.AudioVolumeDown,"AudioVolumeDown",S.AudioVolumeDown,"AudioVolumeDown",174,"VK_VOLUME_DOWN",s,s],[1,X.NumpadComma,"NumpadComma",S.NUMPAD_SEPARATOR,"NumPad_Separator",108,"VK_SEPARATOR",s,s],[0,X.IntlRo,"IntlRo",S.ABNT_C1,"ABNT_C1",193,"VK_ABNT_C1",s,s],[1,X.KanaMode,"KanaMode",S.Unknown,s,0,s,s,s],[0,X.IntlYen,"IntlYen",S.Unknown,s,0,s,s,s],[1,X.Convert,"Convert",S.Unknown,s,0,s,s,s],[1,X.NonConvert,"NonConvert",S.Unknown,s,0,s,s,s],[1,X.Lang1,"Lang1",S.Unknown,s,0,s,s,s],[1,X.Lang2,"Lang2",S.Unknown,s,0,s,s,s],[1,X.Lang3,"Lang3",S.Unknown,s,0,s,s,s],[1,X.Lang4,"Lang4",S.Unknown,s,0,s,s,s],[1,X.Lang5,"Lang5",S.Unknown,s,0,s,s,s],[1,X.Abort,"Abort",S.Unknown,s,0,s,s,s],[1,X.Props,"Props",S.Unknown,s,0,s,s,s],[1,X.NumpadParenLeft,"NumpadParenLeft",S.Unknown,s,0,s,s,s],[1,X.NumpadParenRight,"NumpadParenRight",S.Unknown,s,0,s,s,s],[1,X.NumpadBackspace,"NumpadBackspace",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryStore,"NumpadMemoryStore",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryRecall,"NumpadMemoryRecall",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryClear,"NumpadMemoryClear",S.Unknown,s,0,s,s,s],[1,X.NumpadMemoryAdd,"NumpadMemoryAdd",S.Unknown,s,0,s,s,s],[1,X.NumpadMemorySubtract,"NumpadMemorySubtract",S.Unknown,s,0,s,s,s],[1,X.NumpadClear,"NumpadClear",S.Clear,"Clear",12,"VK_CLEAR",s,s],[1,X.NumpadClearEntry,"NumpadClearEntry",S.Unknown,s,0,s,s,s],[1,X.None,s,S.Ctrl,"Ctrl",17,"VK_CONTROL",s,s],[1,X.None,s,S.Shift,"Shift",16,"VK_SHIFT",s,s],[1,X.None,s,S.Alt,"Alt",18,"VK_MENU",s,s],[1,X.None,s,S.Meta,"Meta",91,"VK_COMMAND",s,s],[1,X.ControlLeft,"ControlLeft",S.Ctrl,s,0,"VK_LCONTROL",s,s],[1,X.ShiftLeft,"ShiftLeft",S.Shift,s,0,"VK_LSHIFT",s,s],[1,X.AltLeft,"AltLeft",S.Alt,s,0,"VK_LMENU",s,s],[1,X.MetaLeft,"MetaLeft",S.Meta,s,0,"VK_LWIN",s,s],[1,X.ControlRight,"ControlRight",S.Ctrl,s,0,"VK_RCONTROL",s,s],[1,X.ShiftRight,"ShiftRight",S.Shift,s,0,"VK_RSHIFT",s,s],[1,X.AltRight,"AltRight",S.Alt,s,0,"VK_RMENU",s,s],[1,X.MetaRight,"MetaRight",S.Meta,s,0,"VK_RWIN",s,s],[1,X.BrightnessUp,"BrightnessUp",S.Unknown,s,0,s,s,s],[1,X.BrightnessDown,"BrightnessDown",S.Unknown,s,0,s,s,s],[1,X.MediaPlay,"MediaPlay",S.Unknown,s,0,s,s,s],[1,X.MediaRecord,"MediaRecord",S.Unknown,s,0,s,s,s],[1,X.MediaFastForward,"MediaFastForward",S.Unknown,s,0,s,s,s],[1,X.MediaRewind,"MediaRewind",S.Unknown,s,0,s,s,s],[1,X.MediaTrackNext,"MediaTrackNext",S.MediaTrackNext,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",s,s],[1,X.MediaTrackPrevious,"MediaTrackPrevious",S.MediaTrackPrevious,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",s,s],[1,X.MediaStop,"MediaStop",S.MediaStop,"MediaStop",178,"VK_MEDIA_STOP",s,s],[1,X.Eject,"Eject",S.Unknown,s,0,s,s,s],[1,X.MediaPlayPause,"MediaPlayPause",S.MediaPlayPause,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",s,s],[1,X.MediaSelect,"MediaSelect",S.LaunchMediaPlayer,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",s,s],[1,X.LaunchMail,"LaunchMail",S.LaunchMail,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",s,s],[1,X.LaunchApp2,"LaunchApp2",S.LaunchApp2,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",s,s],[1,X.LaunchApp1,"LaunchApp1",S.Unknown,s,0,"VK_MEDIA_LAUNCH_APP1",s,s],[1,X.SelectTask,"SelectTask",S.Unknown,s,0,s,s,s],[1,X.LaunchScreenSaver,"LaunchScreenSaver",S.Unknown,s,0,s,s,s],[1,X.BrowserSearch,"BrowserSearch",S.BrowserSearch,"BrowserSearch",170,"VK_BROWSER_SEARCH",s,s],[1,X.BrowserHome,"BrowserHome",S.BrowserHome,"BrowserHome",172,"VK_BROWSER_HOME",s,s],[1,X.BrowserBack,"BrowserBack",S.BrowserBack,"BrowserBack",166,"VK_BROWSER_BACK",s,s],[1,X.BrowserForward,"BrowserForward",S.BrowserForward,"BrowserForward",167,"VK_BROWSER_FORWARD",s,s],[1,X.BrowserStop,"BrowserStop",S.Unknown,s,0,"VK_BROWSER_STOP",s,s],[1,X.BrowserRefresh,"BrowserRefresh",S.Unknown,s,0,"VK_BROWSER_REFRESH",s,s],[1,X.BrowserFavorites,"BrowserFavorites",S.Unknown,s,0,"VK_BROWSER_FAVORITES",s,s],[1,X.ZoomToggle,"ZoomToggle",S.Unknown,s,0,s,s,s],[1,X.MailReply,"MailReply",S.Unknown,s,0,s,s,s],[1,X.MailForward,"MailForward",S.Unknown,s,0,s,s,s],[1,X.MailSend,"MailSend",S.Unknown,s,0,s,s,s],[1,X.None,s,S.KEY_IN_COMPOSITION,"KeyInComposition",229,s,s,s],[1,X.None,s,S.ABNT_C2,"ABNT_C2",194,"VK_ABNT_C2",s,s],[1,X.None,s,S.OEM_8,"OEM_8",223,"VK_OEM_8",s,s],[1,X.None,s,S.Unknown,s,0,"VK_KANA",s,s],[1,X.None,s,S.Unknown,s,0,"VK_HANGUL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_JUNJA",s,s],[1,X.None,s,S.Unknown,s,0,"VK_FINAL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_HANJA",s,s],[1,X.None,s,S.Unknown,s,0,"VK_KANJI",s,s],[1,X.None,s,S.Unknown,s,0,"VK_CONVERT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_NONCONVERT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_ACCEPT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_MODECHANGE",s,s],[1,X.None,s,S.Unknown,s,0,"VK_SELECT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PRINT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_EXECUTE",s,s],[1,X.None,s,S.Unknown,s,0,"VK_SNAPSHOT",s,s],[1,X.None,s,S.Unknown,s,0,"VK_HELP",s,s],[1,X.None,s,S.Unknown,s,0,"VK_APPS",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PROCESSKEY",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PACKET",s,s],[1,X.None,s,S.Unknown,s,0,"VK_DBE_SBCSCHAR",s,s],[1,X.None,s,S.Unknown,s,0,"VK_DBE_DBCSCHAR",s,s],[1,X.None,s,S.Unknown,s,0,"VK_ATTN",s,s],[1,X.None,s,S.Unknown,s,0,"VK_CRSEL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_EXSEL",s,s],[1,X.None,s,S.Unknown,s,0,"VK_EREOF",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PLAY",s,s],[1,X.None,s,S.Unknown,s,0,"VK_ZOOM",s,s],[1,X.None,s,S.Unknown,s,0,"VK_NONAME",s,s],[1,X.None,s,S.Unknown,s,0,"VK_PA1",s,s],[1,X.None,s,S.Unknown,s,0,"VK_OEM_CLEAR",s,s]],t=[],i=[];for(const n of e){const[o,r,a,c,l,d,h,u,f]=n;if(i[r]||(i[r]=!0,J6e[r]=a,X6e[a]=r,Z6e[a.toLowerCase()]=r,o&&(Wg[r]=c,c!==S.Unknown&&c!==S.Enter&&c!==S.Ctrl&&c!==S.Shift&&c!==S.Alt&&c!==S.Meta&&(g8[c]=r))),!t[c]){if(t[c]=!0,!l)throw new Error(`String representation missing for key code ${c} around scan code ${a}`);lq.define(c,l),Xge.define(c,u||l),Zge.define(c,f||u||l)}d&&(Y6e[d]=c),h&&(efe[h]=c)}g8[S.Enter]=X.Enter})();var Ia;(function(s){function e(a){return lq.keyCodeToStr(a)}s.toString=e;function t(a){return lq.strToKeyCode(a)}s.fromString=t;function i(a){return Xge.keyCodeToStr(a)}s.toUserSettingsUS=i;function n(a){return Zge.keyCodeToStr(a)}s.toUserSettingsGeneral=n;function o(a){return Xge.strToKeyCode(a)||Zge.strToKeyCode(a)}s.fromUserSettings=o;function r(a){if(a>=S.Numpad0&&a<=S.NumpadDivide)return null;switch(a){case S.UpArrow:return"Up";case S.DownArrow:return"Down";case S.LeftArrow:return"Left";case S.RightArrow:return"Right"}return lq.keyCodeToStr(a)}s.toElectronAccelerator=r})(Ia||(Ia={}));var U;(function(s){s[s.CtrlCmd=2048]="CtrlCmd",s[s.Shift=1024]="Shift",s[s.Alt=512]="Alt",s[s.WinCtrl=256]="WinCtrl"})(U||(U={}));function rr(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}var ws;(function(s){s[s.Uri=1]="Uri",s[s.Regexp=2]="Regexp",s[s.ScmResource=3]="ScmResource",s[s.ScmResourceGroup=4]="ScmResourceGroup",s[s.ScmProvider=5]="ScmProvider",s[s.CommentController=6]="CommentController",s[s.CommentThread=7]="CommentThread",s[s.CommentThreadInstance=8]="CommentThreadInstance",s[s.CommentThreadReply=9]="CommentThreadReply",s[s.CommentNode=10]="CommentNode",s[s.CommentThreadNode=11]="CommentThreadNode",s[s.TimelineActionContext=12]="TimelineActionContext",s[s.NotebookCellActionContext=13]="NotebookCellActionContext",s[s.NotebookActionContext=14]="NotebookActionContext",s[s.TerminalContext=15]="TerminalContext",s[s.TestItemContext=16]="TestItemContext",s[s.Date=17]="Date",s[s.TestMessageMenuArgs=18]="TestMessageMenuArgs"})(ws||(ws={}));var wFe={};let uT;const hde=globalThis.vscode;if(typeof hde<"u"&&typeof hde.process<"u"){const s=hde.process;uT={get platform(){return s.platform},get arch(){return s.arch},get env(){return s.env},cwd(){return s.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?uT={get platform(){return process.platform},get arch(){return process.arch},get env(){return wFe},cwd(){return wFe.VSCODE_CWD||process.cwd()}}:uT={get platform(){return Qn?"win32":Qt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const C2=uT.cwd,S2=uT.env,eGe=uT.platform,vct=uT.arch,bct=65,wct=97,yct=90,Cct=122,qx=46,ah=47,wf=92,oE=58,Sct=63;class tGe extends Error{constructor(e,t,i){let n;typeof t=="string"&&t.indexOf("not ")===0?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${n} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function Act(s,e){if(s===null||typeof s!="object")throw new tGe(e,"Object",s)}function tl(s,e){if(typeof s!="string")throw new tGe(e,"string",s)}const nv=eGe==="win32";function Os(s){return s===ah||s===wf}function tfe(s){return s===ah}function rE(s){return s>=bct&&s<=yct||s>=wct&&s<=Cct}function Lj(s,e,t,i){let n="",o=0,r=-1,a=0,c=0;for(let l=0;l<=s.length;++l){if(l2){const d=n.lastIndexOf(t);d===-1?(n="",o=0):(n=n.slice(0,d),o=n.length-1-n.lastIndexOf(t)),r=l,a=0;continue}else if(n.length!==0){n="",o=0,r=l,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",o=2)}else n.length>0?n+=`${t}${s.slice(r+1,l)}`:n=s.slice(r+1,l),o=l-r-1;r=l,a=0}else c===qx&&a!==-1?++a:a=-1}return n}function Ect(s){return s?`${s[0]==="."?"":"."}${s}`:""}function iGe(s,e){Act(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${Ect(e.ext)}`;return t?t===e.root?`${t}${i}`:`${t}${s}${i}`:i}const cc={resolve(...s){let e="",t="",i=!1;for(let n=s.length-1;n>=-1;n--){let o;if(n>=0){if(o=s[n],tl(o,`paths[${n}]`),o.length===0)continue}else e.length===0?o=C2():(o=S2[`=${e}`]||C2(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===wf)&&(o=`${e}\\`));const r=o.length;let a=0,c="",l=!1;const d=o.charCodeAt(0);if(r===1)Os(d)&&(a=1,l=!0);else if(Os(d))if(l=!0,Os(o.charCodeAt(1))){let h=2,u=h;for(;h2&&Os(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=Lj(t,!i,"\\",Os),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){tl(s,"path");const e=s.length;if(e===0)return".";let t=0,i,n=!1;const o=s.charCodeAt(0);if(e===1)return tfe(o)?"\\":s;if(Os(o))if(n=!0,Os(s.charCodeAt(1))){let a=2,c=a;for(;a2&&Os(s.charCodeAt(2))&&(n=!0,t=3));let r=t0&&Os(s.charCodeAt(e-1))&&(r+="\\"),i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(s){tl(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return Os(t)||e>2&&rE(t)&&s.charCodeAt(1)===oE&&Os(s.charCodeAt(2))},join(...s){if(s.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,n=0;if(typeof t=="string"&&Os(t.charCodeAt(0))){++n;const o=t.length;o>1&&Os(t.charCodeAt(1))&&(++n,o>2&&(Os(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n=2&&(e=`\\${e.slice(n)}`)}return cc.normalize(e)},relative(s,e){if(tl(s,"from"),tl(e,"to"),s===e)return"";const t=cc.resolve(s),i=cc.resolve(e);if(t===i||(s=t.toLowerCase(),e=i.toLowerCase(),s===e))return"";let n=0;for(;nn&&s.charCodeAt(o-1)===wf;)o--;const r=o-n;let a=0;for(;aa&&e.charCodeAt(c-1)===wf;)c--;const l=c-a,d=rd){if(e.charCodeAt(a+u)===wf)return i.slice(a+u+1);if(u===2)return i.slice(a+u)}r>d&&(s.charCodeAt(n+u)===wf?h=u:u===2&&(h=3)),h===-1&&(h=0)}let f="";for(u=n+h+1;u<=o;++u)(u===o||s.charCodeAt(u)===wf)&&(f+=f.length===0?"..":"\\..");return a+=h,f.length>0?`${f}${i.slice(a,c)}`:(i.charCodeAt(a)===wf&&++a,i.slice(a,c))},toNamespacedPath(s){if(typeof s!="string"||s.length===0)return s;const e=cc.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===wf){if(e.charCodeAt(1)===wf){const t=e.charCodeAt(2);if(t!==Sct&&t!==qx)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(rE(e.charCodeAt(0))&&e.charCodeAt(1)===oE&&e.charCodeAt(2)===wf)return`\\\\?\\${e}`;return s},dirname(s){tl(s,"path");const e=s.length;if(e===0)return".";let t=-1,i=0;const n=s.charCodeAt(0);if(e===1)return Os(n)?s:".";if(Os(n)){if(t=i=1,Os(s.charCodeAt(1))){let a=2,c=a;for(;a2&&Os(s.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(Os(s.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return s.slice(0,o)},basename(s,e){e!==void 0&&tl(e,"suffix"),tl(s,"path");let t=0,i=-1,n=!0,o;if(s.length>=2&&rE(s.charCodeAt(0))&&s.charCodeAt(1)===oE&&(t=2),e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=t;--o){const c=s.charCodeAt(o);if(Os(c)){if(!n){t=o+1;break}}else a===-1&&(n=!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=s.length),s.slice(t,i)}for(o=s.length-1;o>=t;--o)if(Os(s.charCodeAt(o))){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){tl(s,"path");let e=0,t=-1,i=0,n=-1,o=!0,r=0;s.length>=2&&s.charCodeAt(1)===oE&&rE(s.charCodeAt(0))&&(e=i=2);for(let a=s.length-1;a>=e;--a){const c=s.charCodeAt(a);if(Os(c)){if(!o){i=a+1;break}continue}n===-1&&(o=!1,n=a+1),c===qx?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||n===-1||r===0||r===1&&t===n-1&&t===i+1?"":s.slice(t,n)},format:iGe.bind(null,"\\"),parse(s){tl(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.length;let i=0,n=s.charCodeAt(0);if(t===1)return Os(n)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(Os(n)){if(i=1,Os(s.charCodeAt(1))){let h=2,u=h;for(;h0&&(e.root=s.slice(0,i));let o=-1,r=i,a=-1,c=!0,l=s.length-1,d=0;for(;l>=i;--l){if(n=s.charCodeAt(l),Os(n)){if(!c){r=l+1;break}continue}a===-1&&(c=!1,a=l+1),n===qx?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=s.slice(r,a):(e.name=s.slice(r,o),e.base=s.slice(r,a),e.ext=s.slice(o,a))),r>0&&r!==i?e.dir=s.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},xct=(()=>{if(nv){const s=/\\/g;return()=>{const e=C2().replace(s,"/");return e.slice(e.indexOf("/"))}}return()=>C2()})(),Vi={resolve(...s){let e="",t=!1;for(let i=s.length-1;i>=-1&&!t;i--){const n=i>=0?s[i]:xct();tl(n,`paths[${i}]`),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===ah)}return e=Lj(e,!t,"/",tfe),t?`/${e}`:e.length>0?e:"."},normalize(s){if(tl(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===ah,t=s.charCodeAt(s.length-1)===ah;return s=Lj(s,!e,"/",tfe),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return tl(s,"path"),s.length>0&&s.charCodeAt(0)===ah},join(...s){if(s.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Vi.normalize(e)},relative(s,e){if(tl(s,"from"),tl(e,"to"),s===e||(s=Vi.resolve(s),e=Vi.resolve(e),s===e))return"";const t=1,i=s.length,n=i-t,o=1,r=e.length-o,a=na){if(e.charCodeAt(o+l)===ah)return e.slice(o+l+1);if(l===0)return e.slice(o+l)}else n>a&&(s.charCodeAt(t+l)===ah?c=l:l===0&&(c=0));let d="";for(l=t+c+1;l<=i;++l)(l===i||s.charCodeAt(l)===ah)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+c)}`},toNamespacedPath(s){return s},dirname(s){if(tl(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===ah;let t=-1,i=!0;for(let n=s.length-1;n>=1;--n)if(s.charCodeAt(n)===ah){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":s.slice(0,t)},basename(s,e){e!==void 0&&tl(e,"ext"),tl(s,"path");let t=0,i=-1,n=!0,o;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=0;--o){const c=s.charCodeAt(o);if(c===ah){if(!n){t=o+1;break}}else a===-1&&(n=!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=s.length),s.slice(t,i)}for(o=s.length-1;o>=0;--o)if(s.charCodeAt(o)===ah){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){tl(s,"path");let e=-1,t=0,i=-1,n=!0,o=0;for(let r=s.length-1;r>=0;--r){const a=s.charCodeAt(r);if(a===ah){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a===qx?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?"":s.slice(e,i)},format:iGe.bind(null,"/"),parse(s){tl(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===ah;let i;t?(e.root="/",i=1):i=0;let n=-1,o=0,r=-1,a=!0,c=s.length-1,l=0;for(;c>=i;--c){const d=s.charCodeAt(c);if(d===ah){if(!a){o=c+1;break}continue}r===-1&&(a=!1,r=c+1),d===qx?n===-1?n=c:l!==1&&(l=1):n!==-1&&(l=-1)}if(r!==-1){const d=o===0&&t?1:o;n===-1||l===0||l===1&&n===r-1&&n===o+1?e.base=e.name=s.slice(d,r):(e.name=s.slice(d,n),e.base=s.slice(d,r),e.ext=s.slice(n,r))}return o>0?e.dir=s.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Vi.win32=cc.win32=cc;Vi.posix=cc.posix=Vi;const Dk=nv?cc.normalize:Vi.normalize,hM=nv?cc.isAbsolute:Vi.isAbsolute,ife=nv?cc.join:Vi.join,Dct=nv?cc.resolve:Vi.resolve,A2=nv?cc.relative:Vi.relative,bb=nv?cc.dirname:Vi.dirname,Ko=nv?cc.basename:Vi.basename,Vy=nv?cc.extname:Vi.extname,kct=nv?cc.parse:Vi.parse,su=nv?cc.sep:Vi.sep;nv?cc.delimiter:Vi.delimiter;const Ict=/^\w[\w\d+.-]*$/,Tct=/^\//,Lct=/^\/\//;function Rct(s,e){if(!s.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!Ict.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!Tct.test(s.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(Lct.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Mct(s,e){return!s&&!e?"file":s}function Nct(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==Vv&&(e=Vv+e):e=Vv;break}return e}const Ea="",Vv="/",Pct=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;let N=class dq{static isUri(e){return e instanceof dq?!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,n,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||Ea,this.authority=e.authority||Ea,this.path=e.path||Ea,this.query=e.query||Ea,this.fragment=e.fragment||Ea):(this.scheme=Mct(e,r),this.authority=t||Ea,this.path=Nct(this.scheme,i||Ea),this.query=n||Ea,this.fragment=o||Ea,Rct(this,r))}get fsPath(){return Rj(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=Ea),i===void 0?i=this.authority:i===null&&(i=Ea),n===void 0?n=this.path:n===null&&(n=Ea),o===void 0?o=this.query:o===null&&(o=Ea),r===void 0?r=this.fragment:r===null&&(r=Ea),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&r===this.fragment?this:new YN(t,i,n,o,r)}static parse(e,t=!1){const i=Pct.exec(e);return i?new YN(i[2]||Ea,bG(i[4]||Ea),bG(i[5]||Ea),bG(i[7]||Ea),bG(i[9]||Ea),t):new YN(Ea,Ea,Ea,Ea,Ea)}static file(e){let t=Ea;if(Qn&&(e=e.replace(/\\/g,Vv)),e[0]===Vv&&e[1]===Vv){const i=e.indexOf(Vv,2);i===-1?(t=e.substring(2),e=Vv):(t=e.substring(2,i),e=e.substring(i)||Vv)}return new YN("file",t,e,Ea,Ea)}static from(e,t){return new YN(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 Qn&&e.scheme==="file"?i=dq.file(cc.join(Rj(e,!0),...t)).path:i=Vi.join(e.path,...t),e.with({path:i})}toString(e=!1){return sfe(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof dq)return e;{const t=new YN(e);return t._formatted=e.external??null,t._fsPath=e._sep===nGe?e.fsPath??null:null,t}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};function nfe(s){return!s||typeof s!="object"?!1:typeof s.scheme=="string"&&(typeof s.authority=="string"||typeof s.authority>"u")&&(typeof s.path=="string"||typeof s.path>"u")&&(typeof s.query=="string"||typeof s.query>"u")&&(typeof s.fragment=="string"||typeof s.fragment>"u")}const nGe=Qn?1:void 0;let YN=class extends N{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Rj(this,!1)),this._fsPath}toString(e=!1){return e?sfe(this,!0):(this._formatted||(this._formatted=sfe(this,!1)),this._formatted)}toJSON(){const e={$mid:ws.Uri};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=nGe),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 sGe={[B.Colon]:"%3A",[B.Slash]:"%2F",[B.QuestionMark]:"%3F",[B.Hash]:"%23",[B.OpenSquareBracket]:"%5B",[B.CloseSquareBracket]:"%5D",[B.AtSign]:"%40",[B.ExclamationMark]:"%21",[B.DollarSign]:"%24",[B.Ampersand]:"%26",[B.SingleQuote]:"%27",[B.OpenParen]:"%28",[B.CloseParen]:"%29",[B.Asterisk]:"%2A",[B.Plus]:"%2B",[B.Comma]:"%2C",[B.Semicolon]:"%3B",[B.Equals]:"%3D",[B.Space]:"%20"};function yFe(s,e,t){let i,n=-1;for(let o=0;o=B.a&&r<=B.z||r>=B.A&&r<=B.Z||r>=B.Digit0&&r<=B.Digit9||r===B.Dash||r===B.Period||r===B.Underline||r===B.Tilde||e&&r===B.Slash||t&&r===B.OpenSquareBracket||t&&r===B.CloseSquareBracket||t&&r===B.Colon)n!==-1&&(i+=encodeURIComponent(s.substring(n,o)),n=-1),i!==void 0&&(i+=s.charAt(o));else{i===void 0&&(i=s.substr(0,o));const a=sGe[r];a!==void 0?(n!==-1&&(i+=encodeURIComponent(s.substring(n,o)),n=-1),i+=a):n===-1&&(n=o)}}return n!==-1&&(i+=encodeURIComponent(s.substring(n))),i!==void 0?i:s}function Fct(s){let e;for(let t=0;t1&&s.scheme==="file"?t=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===B.Slash&&(s.path.charCodeAt(1)>=B.A&&s.path.charCodeAt(1)<=B.Z||s.path.charCodeAt(1)>=B.a&&s.path.charCodeAt(1)<=B.z)&&s.path.charCodeAt(2)===B.Colon?e?t=s.path.substr(1):t=s.path[1].toLowerCase()+s.path.substr(2):t=s.path,Qn&&(t=t.replace(/\//g,"\\")),t}function sfe(s,e){const t=e?Fct:yFe;let i="",{scheme:n,authority:o,path:r,query:a,fragment:c}=s;if(n&&(i+=n,i+=":"),(o||n==="file")&&(i+=Vv,i+=Vv),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)===B.Slash&&r.charCodeAt(2)===B.Colon){const l=r.charCodeAt(1);l>=B.A&&l<=B.Z&&(r=`/${String.fromCharCode(l+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===B.Colon){const l=r.charCodeAt(0);l>=B.A&&l<=B.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:yFe(c,!1,!1)),i}function oGe(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+oGe(s.substr(3)):s}}const CFe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function bG(s){return s.match(CFe)?s.replace(CFe,e=>oGe(e)):s}let oe=class JI{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 JI(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return JI.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return JI.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return ml.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return ml.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 ml.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 ml.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 ml.plusRange(this,e)}static plusRange(e,t){let i,n,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 ml(i,n,o,r)}intersectRanges(e){return ml.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=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&&n>r?null:new ml(i,n,o,r)}equalsRange(e){return ml.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 ml.getEndPosition(this)}static getEndPosition(e){return new oe(e.endLineNumber,e.endColumn)}getStartPosition(){return ml.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 ml(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new ml(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return ml.collapseToStart(this)}static collapseToStart(e){return new ml(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return ml.collapseToEnd(this)}static collapseToEnd(e){return new ml(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new ml(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new ml(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new ml(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 o_;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(o_||(o_={}));let dt=class Mm extends F{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Mm.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?o_.LTR:o_.RTL}setEndPosition(e,t){return this.getDirection()===o_.LTR?new Mm(this.startLineNumber,this.startColumn,e,t):new Mm(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()===o_.LTR?new Mm(e,t,this.endLineNumber,this.endColumn):new Mm(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Mm(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===o_.LTR?new Mm(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Mm(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Mm(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,n=e.length;i>>Hi.LANGUAGEID_OFFSET}static getTokenType(e){return(e&Hi.TOKEN_TYPE_MASK)>>>Hi.TOKEN_TYPE_OFFSET}static containsBalancedBrackets(e){return(e&Hi.BALANCED_BRACKETS_MASK)!==0}static getFontStyle(e){return(e&Hi.FONT_STYLE_MASK)>>>Hi.FONT_STYLE_OFFSET}static getForeground(e){return(e&Hi.FOREGROUND_MASK)>>>Hi.FOREGROUND_OFFSET}static getBackground(e){return(e&Hi.BACKGROUND_MASK)>>>Hi.BACKGROUND_OFFSET}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return n&Vo.Italic&&(i+=" mtki"),n&Vo.Bold&&(i+=" mtkb"),n&Vo.Underline&&(i+=" mtku"),n&Vo.Strikethrough&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;n&Vo.Italic&&(o+="font-style: italic;"),n&Vo.Bold&&(o+="font-weight: bold;");let r="";return n&Vo.Underline&&(r+=" underline"),n&Vo.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&Vo.Italic),bold:!!(i&Vo.Bold),underline:!!(i&Vo.Underline),strikethrough:!!(i&Vo.Strikethrough)}}}let Wct=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 Hct(this,e,t);return this._factories.set(e,i),Ee(()=>{const n=this._factories.get(e);!n||n!==i||(this._factories.delete(e),n.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>Il.DefaultBackground?this._colorMap[Il.DefaultBackground]:null}};class Hct extends V{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))}}let f8=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 $1e{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class Dre{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var Mc;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Mc||(Mc={}));var Ne;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Snippet=27]="Snippet"})(Ne||(Ne={}));var p8;(function(s){const e=new Map;e.set(Ne.Method,ve.symbolMethod),e.set(Ne.Function,ve.symbolFunction),e.set(Ne.Constructor,ve.symbolConstructor),e.set(Ne.Field,ve.symbolField),e.set(Ne.Variable,ve.symbolVariable),e.set(Ne.Class,ve.symbolClass),e.set(Ne.Struct,ve.symbolStruct),e.set(Ne.Interface,ve.symbolInterface),e.set(Ne.Module,ve.symbolModule),e.set(Ne.Property,ve.symbolProperty),e.set(Ne.Event,ve.symbolEvent),e.set(Ne.Operator,ve.symbolOperator),e.set(Ne.Unit,ve.symbolUnit),e.set(Ne.Value,ve.symbolValue),e.set(Ne.Enum,ve.symbolEnum),e.set(Ne.Constant,ve.symbolConstant),e.set(Ne.Enum,ve.symbolEnum),e.set(Ne.EnumMember,ve.symbolEnumMember),e.set(Ne.Keyword,ve.symbolKeyword),e.set(Ne.Snippet,ve.symbolSnippet),e.set(Ne.Text,ve.symbolText),e.set(Ne.Color,ve.symbolColor),e.set(Ne.File,ve.symbolFile),e.set(Ne.Reference,ve.symbolReference),e.set(Ne.Customcolor,ve.symbolCustomColor),e.set(Ne.Folder,ve.symbolFolder),e.set(Ne.TypeParameter,ve.symbolTypeParameter),e.set(Ne.User,ve.account),e.set(Ne.Issue,ve.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=ve.symbolProperty),r}s.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 n(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=Ne.Property),a}s.fromString=n})(p8||(p8={}));var E2;(function(s){s[s.Deprecated=1]="Deprecated"})(E2||(E2={}));var qg;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(qg||(qg={}));var Qx;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(Qx||(Qx={}));var $u;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})($u||($u={}));var Jp;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(Jp||(Jp={}));class aGe{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return F.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var wh;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(wh||(wh={}));var m8;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(m8||(m8={}));var Ay;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Ay||(Ay={}));var _8;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(_8||(_8={}));function cGe(s){return s&&N.isUri(s.uri)&&F.isIRange(s.range)&&(F.isIRange(s.originSelectionRange)||F.isIRange(s.targetSelectionRange))}var pt;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(pt||(pt={}));const Uct={[pt.Array]:g(1658,"array"),[pt.Boolean]:g(1659,"boolean"),[pt.Class]:g(1660,"class"),[pt.Constant]:g(1661,"constant"),[pt.Constructor]:g(1662,"constructor"),[pt.Enum]:g(1663,"enumeration"),[pt.EnumMember]:g(1664,"enumeration member"),[pt.Event]:g(1665,"event"),[pt.Field]:g(1666,"field"),[pt.File]:g(1667,"file"),[pt.Function]:g(1668,"function"),[pt.Interface]:g(1669,"interface"),[pt.Key]:g(1670,"key"),[pt.Method]:g(1671,"method"),[pt.Module]:g(1672,"module"),[pt.Namespace]:g(1673,"namespace"),[pt.Null]:g(1674,"null"),[pt.Number]:g(1675,"number"),[pt.Object]:g(1676,"object"),[pt.Operator]:g(1677,"operator"),[pt.Package]:g(1678,"package"),[pt.Property]:g(1679,"property"),[pt.String]:g(1680,"string"),[pt.Struct]:g(1681,"struct"),[pt.TypeParameter]:g(1682,"type parameter"),[pt.Variable]:g(1683,"variable")};function Vct(s,e){return g(1684,"{0} ({1})",s,Uct[e])}var v8;(function(s){s[s.Deprecated=1]="Deprecated"})(v8||(v8={}));var Mj;(function(s){const e=new Map;e.set(pt.File,ve.symbolFile),e.set(pt.Module,ve.symbolModule),e.set(pt.Namespace,ve.symbolNamespace),e.set(pt.Package,ve.symbolPackage),e.set(pt.Class,ve.symbolClass),e.set(pt.Method,ve.symbolMethod),e.set(pt.Property,ve.symbolProperty),e.set(pt.Field,ve.symbolField),e.set(pt.Constructor,ve.symbolConstructor),e.set(pt.Enum,ve.symbolEnum),e.set(pt.Interface,ve.symbolInterface),e.set(pt.Function,ve.symbolFunction),e.set(pt.Variable,ve.symbolVariable),e.set(pt.Constant,ve.symbolConstant),e.set(pt.String,ve.symbolString),e.set(pt.Number,ve.symbolNumber),e.set(pt.Boolean,ve.symbolBoolean),e.set(pt.Array,ve.symbolArray),e.set(pt.Object,ve.symbolObject),e.set(pt.Key,ve.symbolKey),e.set(pt.Null,ve.symbolNull),e.set(pt.EnumMember,ve.symbolEnumMember),e.set(pt.Struct,ve.symbolStruct),e.set(pt.Event,ve.symbolEvent),e.set(pt.Operator,ve.symbolOperator),e.set(pt.TypeParameter,ve.symbolTypeParameter);function t(i){let n=e.get(i);return n||(console.info("No codicon found for SymbolKind "+i),n=ve.symbolProperty),n}s.toIcon=t})(Mj||(Mj={}));let G1e=class{static asEditOperation(e){return Zn.replace(F.lift(e.range),e.text)}};var Tg;let r_=(Tg=class{static fromValue(e){switch(e){case"comment":return Tg.Comment;case"imports":return Tg.Imports;case"region":return Tg.Region}return new Tg(e)}constructor(e){this.value=e}},Tg.Comment=new Tg("comment"),Tg.Imports=new Tg("imports"),Tg.Region=new Tg("region"),Tg);var rfe;(function(s){s[s.AIGenerated=1]="AIGenerated"})(rfe||(rfe={}));var uM;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(uM||(uM={}));var Nj;(function(s){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}s.is=e})(Nj||(Nj={}));var Lc;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(Lc||(Lc={}));var ou;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(ou||(ou={}));var jx;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(jx||(jx={}));var x2;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(x2||(x2={}));var Pj;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Pj||(Pj={}));class zct{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 Ta=new Wct;var SFe;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(SFe||(SFe={}));var D2;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(D2||(D2={}));var afe;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(afe||(afe={}));var cfe;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(cfe||(cfe={}));var lfe;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(lfe||(lfe={}));var dfe;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Snippet=27]="Snippet"})(dfe||(dfe={}));var hfe;(function(s){s[s.Deprecated=1]="Deprecated"})(hfe||(hfe={}));var ufe;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(ufe||(ufe={}));var gfe;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(gfe||(gfe={}));var ffe;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(ffe||(ffe={}));var pfe;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(pfe||(pfe={}));var mfe;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(mfe||(mfe={}));var _fe;(function(s){s[s.None=0]="None",s[s.Keep=1]="Keep",s[s.Brackets=2]="Brackets",s[s.Advanced=3]="Advanced",s[s.Full=4]="Full"})(_fe||(_fe={}));var vfe;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.ariaLabel=4]="ariaLabel",s[s.ariaRequired=5]="ariaRequired",s[s.autoClosingBrackets=6]="autoClosingBrackets",s[s.autoClosingComments=7]="autoClosingComments",s[s.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",s[s.autoClosingDelete=9]="autoClosingDelete",s[s.autoClosingOvertype=10]="autoClosingOvertype",s[s.autoClosingQuotes=11]="autoClosingQuotes",s[s.autoIndent=12]="autoIndent",s[s.automaticLayout=13]="automaticLayout",s[s.autoSurround=14]="autoSurround",s[s.bracketPairColorization=15]="bracketPairColorization",s[s.guides=16]="guides",s[s.codeLens=17]="codeLens",s[s.codeLensFontFamily=18]="codeLensFontFamily",s[s.codeLensFontSize=19]="codeLensFontSize",s[s.colorDecorators=20]="colorDecorators",s[s.colorDecoratorsLimit=21]="colorDecoratorsLimit",s[s.columnSelection=22]="columnSelection",s[s.comments=23]="comments",s[s.contextmenu=24]="contextmenu",s[s.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",s[s.cursorBlinking=26]="cursorBlinking",s[s.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",s[s.cursorStyle=28]="cursorStyle",s[s.cursorSurroundingLines=29]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",s[s.cursorWidth=31]="cursorWidth",s[s.disableLayerHinting=32]="disableLayerHinting",s[s.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",s[s.domReadOnly=34]="domReadOnly",s[s.dragAndDrop=35]="dragAndDrop",s[s.dropIntoEditor=36]="dropIntoEditor",s[s.emptySelectionClipboard=37]="emptySelectionClipboard",s[s.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",s[s.extraEditorClassName=39]="extraEditorClassName",s[s.fastScrollSensitivity=40]="fastScrollSensitivity",s[s.find=41]="find",s[s.fixedOverflowWidgets=42]="fixedOverflowWidgets",s[s.folding=43]="folding",s[s.foldingStrategy=44]="foldingStrategy",s[s.foldingHighlight=45]="foldingHighlight",s[s.foldingImportsByDefault=46]="foldingImportsByDefault",s[s.foldingMaximumRegions=47]="foldingMaximumRegions",s[s.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=49]="fontFamily",s[s.fontInfo=50]="fontInfo",s[s.fontLigatures=51]="fontLigatures",s[s.fontSize=52]="fontSize",s[s.fontWeight=53]="fontWeight",s[s.fontVariations=54]="fontVariations",s[s.formatOnPaste=55]="formatOnPaste",s[s.formatOnType=56]="formatOnType",s[s.glyphMargin=57]="glyphMargin",s[s.gotoLocation=58]="gotoLocation",s[s.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",s[s.hover=60]="hover",s[s.inDiffEditor=61]="inDiffEditor",s[s.inlineSuggest=62]="inlineSuggest",s[s.inlineEdit=63]="inlineEdit",s[s.letterSpacing=64]="letterSpacing",s[s.lightbulb=65]="lightbulb",s[s.lineDecorationsWidth=66]="lineDecorationsWidth",s[s.lineHeight=67]="lineHeight",s[s.lineNumbers=68]="lineNumbers",s[s.lineNumbersMinChars=69]="lineNumbersMinChars",s[s.linkedEditing=70]="linkedEditing",s[s.links=71]="links",s[s.matchBrackets=72]="matchBrackets",s[s.minimap=73]="minimap",s[s.mouseStyle=74]="mouseStyle",s[s.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=76]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",s[s.multiCursorModifier=78]="multiCursorModifier",s[s.multiCursorPaste=79]="multiCursorPaste",s[s.multiCursorLimit=80]="multiCursorLimit",s[s.occurrencesHighlight=81]="occurrencesHighlight",s[s.overviewRulerBorder=82]="overviewRulerBorder",s[s.overviewRulerLanes=83]="overviewRulerLanes",s[s.padding=84]="padding",s[s.pasteAs=85]="pasteAs",s[s.parameterHints=86]="parameterHints",s[s.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",s[s.placeholder=88]="placeholder",s[s.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",s[s.quickSuggestions=90]="quickSuggestions",s[s.quickSuggestionsDelay=91]="quickSuggestionsDelay",s[s.readOnly=92]="readOnly",s[s.readOnlyMessage=93]="readOnlyMessage",s[s.renameOnType=94]="renameOnType",s[s.renderControlCharacters=95]="renderControlCharacters",s[s.renderFinalNewline=96]="renderFinalNewline",s[s.renderLineHighlight=97]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=99]="renderValidationDecorations",s[s.renderWhitespace=100]="renderWhitespace",s[s.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",s[s.roundedSelection=102]="roundedSelection",s[s.rulers=103]="rulers",s[s.scrollbar=104]="scrollbar",s[s.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=106]="scrollBeyondLastLine",s[s.scrollPredominantAxis=107]="scrollPredominantAxis",s[s.selectionClipboard=108]="selectionClipboard",s[s.selectionHighlight=109]="selectionHighlight",s[s.selectOnLineNumbers=110]="selectOnLineNumbers",s[s.showFoldingControls=111]="showFoldingControls",s[s.showUnused=112]="showUnused",s[s.snippetSuggestions=113]="snippetSuggestions",s[s.smartSelect=114]="smartSelect",s[s.smoothScrolling=115]="smoothScrolling",s[s.stickyScroll=116]="stickyScroll",s[s.stickyTabStops=117]="stickyTabStops",s[s.stopRenderingLineAfter=118]="stopRenderingLineAfter",s[s.suggest=119]="suggest",s[s.suggestFontSize=120]="suggestFontSize",s[s.suggestLineHeight=121]="suggestLineHeight",s[s.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",s[s.suggestSelection=123]="suggestSelection",s[s.tabCompletion=124]="tabCompletion",s[s.tabIndex=125]="tabIndex",s[s.unicodeHighlighting=126]="unicodeHighlighting",s[s.unusualLineTerminators=127]="unusualLineTerminators",s[s.useShadowDOM=128]="useShadowDOM",s[s.useTabStops=129]="useTabStops",s[s.wordBreak=130]="wordBreak",s[s.wordSegmenterLocales=131]="wordSegmenterLocales",s[s.wordSeparators=132]="wordSeparators",s[s.wordWrap=133]="wordWrap",s[s.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=136]="wordWrapColumn",s[s.wordWrapOverride1=137]="wordWrapOverride1",s[s.wordWrapOverride2=138]="wordWrapOverride2",s[s.wrappingIndent=139]="wrappingIndent",s[s.wrappingStrategy=140]="wrappingStrategy",s[s.showDeprecated=141]="showDeprecated",s[s.inlayHints=142]="inlayHints",s[s.editorClassName=143]="editorClassName",s[s.pixelRatio=144]="pixelRatio",s[s.tabFocusMode=145]="tabFocusMode",s[s.layoutInfo=146]="layoutInfo",s[s.wrappingInfo=147]="wrappingInfo",s[s.defaultColorDecorators=148]="defaultColorDecorators",s[s.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",s[s.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(vfe||(vfe={}));var bfe;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(bfe||(bfe={}));var wfe;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})(wfe||(wfe={}));var yfe;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=3]="Right"})(yfe||(yfe={}));var Cfe;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Cfe||(Cfe={}));var Sfe;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Sfe||(Sfe={}));var Afe;(function(s){s[s.Both=0]="Both",s[s.Right=1]="Right",s[s.Left=2]="Left",s[s.None=3]="None"})(Afe||(Afe={}));var Efe;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Efe||(Efe={}));var xfe;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(xfe||(xfe={}));var Dfe;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(Dfe||(Dfe={}));var kfe;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.F20=78]="F20",s[s.F21=79]="F21",s[s.F22=80]="F22",s[s.F23=81]="F23",s[s.F24=82]="F24",s[s.NumLock=83]="NumLock",s[s.ScrollLock=84]="ScrollLock",s[s.Semicolon=85]="Semicolon",s[s.Equal=86]="Equal",s[s.Comma=87]="Comma",s[s.Minus=88]="Minus",s[s.Period=89]="Period",s[s.Slash=90]="Slash",s[s.Backquote=91]="Backquote",s[s.BracketLeft=92]="BracketLeft",s[s.Backslash=93]="Backslash",s[s.BracketRight=94]="BracketRight",s[s.Quote=95]="Quote",s[s.OEM_8=96]="OEM_8",s[s.IntlBackslash=97]="IntlBackslash",s[s.Numpad0=98]="Numpad0",s[s.Numpad1=99]="Numpad1",s[s.Numpad2=100]="Numpad2",s[s.Numpad3=101]="Numpad3",s[s.Numpad4=102]="Numpad4",s[s.Numpad5=103]="Numpad5",s[s.Numpad6=104]="Numpad6",s[s.Numpad7=105]="Numpad7",s[s.Numpad8=106]="Numpad8",s[s.Numpad9=107]="Numpad9",s[s.NumpadMultiply=108]="NumpadMultiply",s[s.NumpadAdd=109]="NumpadAdd",s[s.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=111]="NumpadSubtract",s[s.NumpadDecimal=112]="NumpadDecimal",s[s.NumpadDivide=113]="NumpadDivide",s[s.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",s[s.ABNT_C1=115]="ABNT_C1",s[s.ABNT_C2=116]="ABNT_C2",s[s.AudioVolumeMute=117]="AudioVolumeMute",s[s.AudioVolumeUp=118]="AudioVolumeUp",s[s.AudioVolumeDown=119]="AudioVolumeDown",s[s.BrowserSearch=120]="BrowserSearch",s[s.BrowserHome=121]="BrowserHome",s[s.BrowserBack=122]="BrowserBack",s[s.BrowserForward=123]="BrowserForward",s[s.MediaTrackNext=124]="MediaTrackNext",s[s.MediaTrackPrevious=125]="MediaTrackPrevious",s[s.MediaStop=126]="MediaStop",s[s.MediaPlayPause=127]="MediaPlayPause",s[s.LaunchMediaPlayer=128]="LaunchMediaPlayer",s[s.LaunchMail=129]="LaunchMail",s[s.LaunchApp2=130]="LaunchApp2",s[s.Clear=131]="Clear",s[s.MAX_VALUE=132]="MAX_VALUE"})(kfe||(kfe={}));var Ife;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Ife||(Ife={}));var Tfe;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(Tfe||(Tfe={}));var Lfe;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(Lfe||(Lfe={}));var Rfe;(function(s){s[s.Normal=1]="Normal",s[s.Underlined=2]="Underlined"})(Rfe||(Rfe={}));var Mfe;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Mfe||(Mfe={}));var Nfe;(function(s){s[s.AIGenerated=1]="AIGenerated"})(Nfe||(Nfe={}));var Pfe;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(Pfe||(Pfe={}));var Ffe;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(Ffe||(Ffe={}));var Ofe;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(Ofe||(Ofe={}));var Bfe;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(Bfe||(Bfe={}));var Wfe;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.None=2]="None",s[s.LeftOfInjectedText=3]="LeftOfInjectedText",s[s.RightOfInjectedText=4]="RightOfInjectedText"})(Wfe||(Wfe={}));var Hfe;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(Hfe||(Hfe={}));var Ufe;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(Ufe||(Ufe={}));var Vfe;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(Vfe||(Vfe={}));var zfe;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(zfe||(zfe={}));var $fe;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})($fe||($fe={}));var Gfe;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(Gfe||(Gfe={}));var Kfe;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Kfe||(Kfe={}));var qfe;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(qfe||(qfe={}));var Qfe;(function(s){s[s.Deprecated=1]="Deprecated"})(Qfe||(Qfe={}));var jfe;(function(s){s[s.Hidden=0]="Hidden",s[s.Blink=1]="Blink",s[s.Smooth=2]="Smooth",s[s.Phase=3]="Phase",s[s.Expand=4]="Expand",s[s.Solid=5]="Solid"})(jfe||(jfe={}));var Yfe;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(Yfe||(Yfe={}));var Jfe;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Jfe||(Jfe={}));var Xfe;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(Xfe||(Xfe={}));const BF=class BF{static chord(e,t){return rr(e,t)}};BF.CtrlCmd=U.CtrlCmd,BF.Shift=U.Shift,BF.Alt=U.Alt,BF.WinCtrl=U.WinCtrl;let Zfe=BF;function lGe(){return{editor:void 0,languages:void 0,CancellationTokenSource:ci,Emitter:I,KeyCode:kfe,KeyMod:Zfe,Position:oe,Range:F,Selection:dt,SelectionDirection:$fe,MarkerSeverity:Ife,MarkerTag:Tfe,Uri:N,Token:f8}}function $ct(s,e){const t=s;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const si=window;function Gct(s){return s===si?!1:typeof s?.vscodeWindowId=="number"}var AFe=[],YU=[];function ut(s,e){if(s&&typeof document<"u"){var t,i=e.prepend===!0?"prepend":"append",n=e.singleTag===!0,o=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var r=AFe.indexOf(o);r===-1&&(r=AFe.push(o)-1,YU[r]={}),t=YU[r]&&YU[r][i]?YU[r][i]:YU[r][i]=a()}else t=a();s.charCodeAt(0)===65279&&(s=s.substring(1)),t.styleSheet?t.styleSheet.cssText+=s:t.appendChild(document.createTextNode(s))}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,fT=uU.indexOf("AppleWebKit")>=0,$7=uU.indexOf("Chrome")>=0,zy=!$7&&uU.indexOf("Safari")>=0,hGe=!$7&&!zy&&fT;uU.indexOf("Electron/")>=0;const EFe=uU.indexOf("Android")>=0;let hq=!1;if(typeof si.matchMedia=="function"){const s=si.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=si.matchMedia("(display-mode: fullscreen)");hq=s.matches,Fj(si,s,({matches:t})=>{hq&&e.matches||(hq=t)})}function uGe(){return hq}var Yx;(function(s){s[s.Always=0]="Always",s[s.FullScreen=1]="FullScreen",s[s.None=2]="None"})(Yx||(Yx={}));const AO={clipboard:{writeText:od||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:od||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:od||uGe()?Yx.Always:navigator.keyboard||zy?Yx.FullScreen:Yx.None,touch:"ontouchstart"in si||navigator.maxTouchPoints>0,pointerEvents:si.PointerEvent&&("ontouchstart"in si||navigator.maxTouchPoints>0)};var T0;(function(s){s[s.CtrlCmd=2048]="CtrlCmd",s[s.Shift=1024]="Shift",s[s.Alt=512]="Alt",s[s.WinCtrl=256]="WinCtrl",s[s.KeyCode=255]="KeyCode"})(T0||(T0={}));function tpe(s,e){if(typeof s=="number"){if(s===0)return null;const t=(s&65535)>>>0,i=(s&4294901760)>>>16;return i!==0?new EO([wG(t,e),wG(i,e)]):new EO([wG(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 Sh{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=nlt.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class gM{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 n=!1;if($7){const o=navigator.userAgent.match(/Chrome\/(\d+)/);n=(o?parseInt(o[1]):123)<=122}if(e){const o=e,r=e,a=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")n?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?nf&&!Qt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")zy&&Qn?this.deltaX=-(o.wheelDeltaX/120):n?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?nf&&!Qt?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}function aE(s){return s===B.Slash||s===B.Backslash}function w8(s){return s.replace(/[\\/]/g,Vi.sep)}function rlt(s){return s.indexOf("/")===-1&&(s=w8(s)),/^[a-zA-Z]:(\/|$)/.test(s)&&(s="/"+s),s}function DFe(s,e=Vi.sep){if(!s)return"";const t=s.length,i=s.charCodeAt(0);if(aE(i)){if(aE(s.charCodeAt(1))&&!aE(s.charCodeAt(2))){let o=3;const r=o;for(;o\|]/g,llt=/[/]/g,dlt=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function hlt(s,e=Qn){const t=e?clt:llt;return!(!s||s.length===0||/^\s+$/.test(s)||(t.lastIndex=0,t.test(s))||e&&dlt.test(s)||s==="."||s===".."||e&&s[s.length-1]==="."||e&&s.length!==s.trim().length||s.length>255)}function ult(s,e,t){const i=s===e;return!t||i?i:!s||!e?!1:ua(s,e)}function Oj(s,e,t,i=su){if(s===e)return!0;if(!s||!e||e.length>s.length)return!1;if(t){if(!P7(s,e))return!1;if(e.length===s.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,s.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0}function gGe(s){return s>=B.A&&s<=B.Z||s>=B.a&&s<=B.z}function fGe(s,e=Qn){return e?gGe(s.charCodeAt(0))&&s.charCodeAt(1)===B.Colon:!1}function glt(s,e=Qn){return fGe(s,e)?s[0]:void 0}function pGe(s,e,t){return e.length>s.length?-1:s===e?0:(t&&(s=s.toLowerCase(),e=e.toLowerCase()),s.indexOf(e))}function mGe(s){const e=s.split(":");let t,i,n;for(const o of e){const r=Number(o);lc(r)?i===void 0?i=r:n===void 0&&(n=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:n!==void 0?n:i!==void 0?1:void 0}}var pe;(function(s){s.inMemory="inmemory",s.vscode="vscode",s.internal="private",s.walkThrough="walkThrough",s.walkThroughSnippet="walkThroughSnippet",s.http="http",s.https="https",s.file="file",s.mailto="mailto",s.untitled="untitled",s.data="data",s.command="command",s.vscodeRemote="vscode-remote",s.vscodeRemoteResource="vscode-remote-resource",s.vscodeManagedRemoteResource="vscode-managed-remote-resource",s.vscodeUserData="vscode-userdata",s.vscodeCustomEditor="vscode-custom-editor",s.vscodeNotebookCell="vscode-notebook-cell",s.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",s.vscodeNotebookCellOutput="vscode-notebook-cell-output",s.vscodeInteractiveInput="vscode-interactive-input",s.vscodeSettings="vscode-settings",s.vscodeWorkspaceTrust="vscode-workspace-trust",s.vscodeTerminal="vscode-terminal",s.vscodeChatCodeBlock="vscode-chat-code-block",s.vscodeCopilotBackingChatCodeBlock="vscode-copilot-chat-code-block",s.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",s.vscodeChatSesssion="vscode-chat-editor",s.webviewPanel="webview-panel",s.vscodeWebview="vscode-webview",s.extension="extension",s.vscodeFileResource="vscode-file",s.tmp="tmp",s.vsls="vsls",s.vscodeSourceControl="vscode-scm",s.commentsInput="comment",s.codeSetting="code-setting"})(pe||(pe={}));function CA(s,e){return N.isUri(s)?ua(s.scheme,e):P7(s,e+":")}function y8(s,...e){return e.some(t=>CA(s,t))}const flt="tkn";class plt{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=mlt(e,t)}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return Vi.join(this._serverRootPath,pe.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 vt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${flt}=${encodeURIComponent(o)}`),N.from({scheme:Wn?this._preferredWebSchema:pe.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const C8=new plt;function mlt(s,e){return Vi.join(e??"/",`${s.quality??"oss"}-${s.commit??"dev"}`)}const _lt="vscode-app",WF=class WF{constructor(){this.staticBrowserUris=new ui,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===pe.vscodeRemote?C8.rewrite(e):e.scheme===pe.file&&(od||grt===`${pe.vscodeFileResource}://${WF.FALLBACK_AUTHORITY}`)?e.with({scheme:pe.vscodeFileResource,authority:e.authority||WF.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===pe.vscodeFileResource?e.with({scheme:pe.file,authority:e.authority!==WF.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e,t){return N.isUri(e)?e:N.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()}};WF.FALLBACK_AUTHORITY=_lt;let ipe=WF;const Jg=new ipe;var npe;(function(s){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"}]]);s.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:N.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r?.get(t);if(a)return e.get(a)}s.getHeadersFromQuery=i;function n(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}s.addSearchParam=n})(npe||(npe={}));function Ym(s){return Rj(s,!0)}class CN{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:dm(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===pe.file)return Oj(Ym(e),Ym(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(k2(e.authority,t.authority))return Oj(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return N.joinPath(e,...t)}basenameOrAuthority(e){return _i(e)||e.authority}basename(e){return Vi.basename(e.path)}extname(e){return Vi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===pe.file?t=N.file(bb(Ym(e))).path:(t=Vi.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==B.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===pe.file?t=N.file(Dk(Ym(e))).path:t=Vi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!k2(e.authority,t.authority))return;if(e.scheme===pe.file){const o=A2(Ym(e),Ym(t));return Qn?w8(o):o}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,n.length);oDFe(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===B.Slash&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=su){return IFe(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=su){let i=!1;if(e.scheme===pe.file){const n=Ym(e);i=n!==void 0&&n.length===DFe(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=n.length===1&&n.charCodeAt(n.length-1)===B.Slash}return!i&&!IFe(e,t)?e.with({path:e.path+"/"}):e}}const xn=new CN(()=>!1),_Ge=new CN(s=>s.scheme===pe.file?!pr:!0),kre=new CN(s=>!0),ji=xn.isEqual.bind(xn),$y=xn.isEqualOrParent.bind(xn);xn.getComparisonKey.bind(xn);const SA=xn.basenameOrAuthority.bind(xn),_i=xn.basename.bind(xn),gU=xn.extname.bind(xn),Lr=xn.dirname.bind(xn),Pt=xn.joinPath.bind(xn),vGe=xn.normalizePath.bind(xn),SN=xn.relativePath.bind(xn),kFe=xn.resolvePath.bind(xn),bGe=xn.isAbsolutePath.bind(xn),k2=xn.isEqualAuthority.bind(xn),IFe=xn.hasTrailingPathSeparator.bind(xn),TFe=xn.removeTrailingPathSeparator.bind(xn);xn.addTrailingPathSeparator.bind(xn);function vlt(s,e){const t=[];for(let i=0;ir===i?!1:$y(n,e(o)))||t.push(s[i])}return t}var kk;(function(s){s.META_DATA_LABEL="label",s.META_DATA_DESCRIPTION="description",s.META_DATA_SIZE="size",s.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(s.META_DATA_MIME,o),i}s.parseMetaData=e})(kk||(kk={}));function S8(s,e,t){if(e){let i=s.path;return i&&i[0]!==Vi.sep&&(i=Vi.sep+i),s.with({scheme:t,authority:e,path:i})}return s.with({scheme:t})}const wGe=Symbol("MicrotaskDelay");function Gy(s){return!!s&&typeof s.then=="function"}function Rr(s){const e=new ci,t=s(e.token),i=new Promise((n,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),o(new Ma)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),n(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(n,o){return i.then(n,o)}catch(n){return this.then(void 0,n)}finally(n){return i.finally(n)}}}function B_(s,e,t){return new Promise((i,n)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});s.then(i,n).finally(()=>o.dispose())})}function Ire(s,e){return new Promise((t,i)=>{const n=e.onCancellationRequested(()=>{n.dispose(),i(new Ma)});s.then(t,i).finally(()=>n.dispose())})}function yGe(s,e,t){let i;const n=setTimeout(()=>{i?.(void 0)},e);return Promise.race([s.finally(()=>clearTimeout(n)),new Promise(o=>i=o)])}function Qh(s){return new Promise((e,t)=>{const i=s();Gy(i)?i.then(e,t):e(i)})}function I2(){let s,e;return{promise:new Promise((i,n)=>{s=i,e=n}),resolve:s,reject:e}}class G7{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(n=>{this.activePromise=null,t(n)},n=>{this.activePromise=null,i(n)})})}dispose(){this.isDisposed=!0}}class blt{constructor(){this.promiseMap=new Map}queue(e,t){const n=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(t).finally(()=>{this.promiseMap.get(e)===n&&this.promiseMap.delete(e)});return this.promiseMap.set(e,n),n}}const wlt=(s,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},s);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},ylt=s=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,s())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};let Lh=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((n,o)=>{this.doResolve=n,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const n=this.task;return this.task=null,n()}}));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===wGe?ylt(i):wlt(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Ma),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};class K7{constructor(e){this.delayer=new Lh(e),this.throttler=new G7}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 Gd{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 Sr(s,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{o.dispose(),t()},s),o=e.onCancellationRequested(()=>{clearTimeout(n),o.dispose(),i(new Ma)})}):Rr(t=>Sr(s,t))}function Ky(s,e=0,t){const i=setTimeout(()=>{s(),t&&n.dispose()},e),n=Ee(()=>{clearTimeout(i),t?.deleteAndLeak(n)});return t?.add(n),n}function Tre(s,e=i=>!!i,t=null){let i=0;const n=s.length,o=()=>{if(i>=n)return Promise.resolve(t);const r=s[i++];return Promise.resolve(r()).then(c=>e(c)?Promise.resolve(c):o())};return o()}class spe{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?M.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 gI=class extends spe{constructor(){super(1)}};class K1e{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 dc;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=xn){const i=t.getComparisonKey(e);return this.queues.get(i)?.size??0}queueFor(e,t,i=xn){const n=i.getComparisonKey(e);let o=this.queues.get(n);if(!o){o=new gI;const r=this.drainListenerCount++,a=M.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(n),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(r),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new mo),this.drainListeners.set(r,a),this.queues.set(n,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 bm{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 Ni("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ni("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class q7{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 Ni("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=Ee(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class cn{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 CGe extends cn{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 T2,xO;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?xO=(s,e)=>{T1e(()=>{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)}}}:xO=(s,e,t)=>{const i=s.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,s.cancelIdleCallback(i))}}},T2=s=>xO(globalThis,s)})();class SGe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=xO(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 ope extends SGe{constructor(e){super(globalThis,e)}}class AGe{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:n}=I2();this._queued={run:e,promise:t,promiseResolve:i,promiseReject:n}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}}var L0;(function(s){s[s.Resolved=0]="Resolved",s[s.Rejected=1]="Rejected"})(L0||(L0={}));class dc{get isRejected(){return this.outcome?.outcome===L0.Rejected}get isResolved(){return this.outcome?.outcome===L0.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===L0.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:L0.Resolved,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:L0.Rejected,value:e},t()})}cancel(){return this.error(new Ma)}}var Zs;(function(s){async function e(i){let n;const o=await Promise.all(i.map(r=>r.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return o}s.settled=e;function t(i){return new Promise(async(n,o)=>{try{await i(n,o)}catch(r){o(r)}})}s.withAsyncBody=t})(Zs||(Zs={}));class Clt{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 Ni("Promise is not resolved yet");if(this._error)throw this._error;return this._value}}class Slt{constructor(e){this._compute=e,this._promise=new ya(()=>new Clt(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}}var Sv;(function(s){s[s.Initial=0]="Initial",s[s.DoneOK=1]="DoneOK",s[s.DoneError=2]="DoneError"})(Sv||(Sv={}));const yg=class yg{static fromArray(e){return new yg(t=>{t.emitMany(e)})}static fromPromise(e){return new yg(async t=>{t.emitMany(await e)})}static fromPromises(e){return new yg(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new yg(async t=>{await Promise.all(e.map(async i=>{for await(const n of i)t.emitOne(n)}))})}constructor(e,t){this._state=Sv.Initial,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new I,queueMicrotask(async()=>{const i={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(i)),this.resolve()}catch(n){this.reject(n)}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===Sv.DoneError)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,t){return new yg(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return yg.map(this,e)}static filter(e,t){return new yg(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return yg.filter(this,e)}static coalesce(e){return yg.filter(e,t=>!!t)}coalesce(){return yg.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return yg.toPromise(this)}emitOne(e){this._state===Sv.Initial&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===Sv.Initial&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===Sv.Initial&&(this._state=Sv.DoneOK,this._onStateChanged.fire())}reject(e){this._state===Sv.Initial&&(this._state=Sv.DoneError,this._error=e,this._onStateChanged.fire())}};yg.EMPTY=yg.fromArray([]);let Kd=yg;class Alt extends Kd{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function Elt(s){const e=new ci,t=s(e.token);return new Alt(e,async i=>{const n=e.token.onCancellationRequested(()=>{n.dispose(),e.dispose(),i.reject(new Ma)});try{for await(const o of t){if(e.token.isCancellationRequested)return;i.emitOne(o)}n.dispose(),e.dispose()}catch(o){n.dispose(),e.dispose(),i.reject(o)}})}class L2{constructor(e){this._deferred=new dc,this._asyncIterable=new Kd(n=>{if(t){n.reject(t);return}return i&&n.emitMany(i),this._errorFn=o=>n.reject(o),this._emitFn=o=>n.emitOne(o),this._deferred.p},e);let t,i;this._emitFn=n=>{i||(i=[]),i.push(n)},this._errorFn=n=>{t||(t=n)}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitFn(e)}}const{entries:EGe,setPrototypeOf:LFe,isFrozen:xlt,getPrototypeOf:Dlt,getOwnPropertyDescriptor:klt}=Object;let{freeze:sf,seal:xb,create:Ilt}=Object,{apply:rpe,construct:ape}=typeof Reflect<"u"&&Reflect;rpe||(rpe=function(e,t,i){return e.apply(t,i)});sf||(sf=function(e){return e});xb||(xb=function(e){return e});ape||(ape=function(e,t){return new e(...t)});const Tlt=W_(Array.prototype.forEach),RFe=W_(Array.prototype.pop),JU=W_(Array.prototype.push),uq=W_(String.prototype.toLowerCase),ude=W_(String.prototype.toString),Llt=W_(String.prototype.match),lv=W_(String.prototype.replace),Rlt=W_(String.prototype.indexOf),Mlt=W_(String.prototype.trim),yp=W_(RegExp.prototype.test),XU=Nlt(TypeError);function W_(s){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n/gm),Wlt=xb(/\${[\w\W]*}/gm),Hlt=xb(/^data-[\-\w.\u00B7-\uFFFF]/),Ult=xb(/^aria-[\-\w]+$/),xGe=xb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vlt=xb(/^(?:\w+script|data):/i),zlt=xb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DGe=xb(/^html$/i);var OFe=Object.freeze({__proto__:null,MUSTACHE_EXPR:Olt,ERB_EXPR:Blt,TMPLIT_EXPR:Wlt,DATA_ATTR:Hlt,ARIA_ATTR:Ult,IS_ALLOWED_URI:xGe,IS_SCRIPT_OR_DATA:Vlt,ATTR_WHITESPACE:zlt,DOCTYPE_NAME:DGe});const $lt=()=>typeof window>"u"?null:window,Glt=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));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 kGe(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$lt();const e=Ot=>kGe(Ot);if(e.version="3.0.5",e.removed=[],!s||!s.document||s.document.nodeType!==9)return e.isSupported=!1,e;const t=s.document,i=t.currentScript;let{document:n}=s;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:c,NodeFilter:l,NamedNodeMap:d=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:f}=s,p=c.prototype,m=yG(p,"cloneNode"),v=yG(p,"nextSibling"),b=yG(p,"childNodes"),w=yG(p,"parentNode");if(typeof r=="function"){const Ot=n.createElement("template");Ot.content&&Ot.content.ownerDocument&&(n=Ot.content.ownerDocument)}let y,C="";const{implementation:A,createNodeIterator:L,createDocumentFragment:k,getElementsByTagName:P}=n,{importNode:R}=t;let z={};e.isSupported=typeof EGe=="function"&&typeof w=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:j,TMPLIT_EXPR:K,DATA_ATTR:ie,ARIA_ATTR:ge,IS_SCRIPT_OR_DATA:xe,ATTR_WHITESPACE:Re}=OFe;let{IS_ALLOWED_URI:yt}=OFe,Pe=null;const lt=Gs({},[...MFe,...gde,...fde,...pde,...NFe]);let xt=null;const Ji=Gs({},[...PFe,...mde,...FFe,...CG]);let Ii=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}})),ns=null,zs=null,Pn=!0,Xr=!0,ds=!1,Zo=!0,Zr=!1,Di=!1,ss=!1,Oo=!1,Tn=!1,Ba=!1,md=!1,Fn=!0,Zd=!1;const pc="user-content-";let Vc=!0,$s=!1,tc={},gl=null;const eh=Gs({},["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 dg=null;const mc=Gs({},["audio","video","img","source","image","track"]);let zc=null;const th=Gs({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dc="http://www.w3.org/1998/Math/MathML",fl="http://www.w3.org/2000/svg",ic="http://www.w3.org/1999/xhtml";let Or=ic,pl=!1,ih=null;const nh=Gs({},[Dc,fl,ic],ude);let $c;const Gc=["application/xhtml+xml","text/html"],Wa="text/html";let Bo,Is=null;const kc=n.createElement("form"),Rh=function(q){return q instanceof RegExp||q instanceof Function},be=function(q){if(!(Is&&Is===q)){if((!q||typeof q!="object")&&(q={}),q=JN(q),$c=Gc.indexOf(q.PARSER_MEDIA_TYPE)===-1?$c=Wa:$c=q.PARSER_MEDIA_TYPE,Bo=$c==="application/xhtml+xml"?ude:uq,Pe="ALLOWED_TAGS"in q?Gs({},q.ALLOWED_TAGS,Bo):lt,xt="ALLOWED_ATTR"in q?Gs({},q.ALLOWED_ATTR,Bo):Ji,ih="ALLOWED_NAMESPACES"in q?Gs({},q.ALLOWED_NAMESPACES,ude):nh,zc="ADD_URI_SAFE_ATTR"in q?Gs(JN(th),q.ADD_URI_SAFE_ATTR,Bo):th,dg="ADD_DATA_URI_TAGS"in q?Gs(JN(mc),q.ADD_DATA_URI_TAGS,Bo):mc,gl="FORBID_CONTENTS"in q?Gs({},q.FORBID_CONTENTS,Bo):eh,ns="FORBID_TAGS"in q?Gs({},q.FORBID_TAGS,Bo):{},zs="FORBID_ATTR"in q?Gs({},q.FORBID_ATTR,Bo):{},tc="USE_PROFILES"in q?q.USE_PROFILES:!1,Pn=q.ALLOW_ARIA_ATTR!==!1,Xr=q.ALLOW_DATA_ATTR!==!1,ds=q.ALLOW_UNKNOWN_PROTOCOLS||!1,Zo=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Zr=q.SAFE_FOR_TEMPLATES||!1,Di=q.WHOLE_DOCUMENT||!1,Tn=q.RETURN_DOM||!1,Ba=q.RETURN_DOM_FRAGMENT||!1,md=q.RETURN_TRUSTED_TYPE||!1,Oo=q.FORCE_BODY||!1,Fn=q.SANITIZE_DOM!==!1,Zd=q.SANITIZE_NAMED_PROPS||!1,Vc=q.KEEP_CONTENT!==!1,$s=q.IN_PLACE||!1,yt=q.ALLOWED_URI_REGEXP||xGe,Or=q.NAMESPACE||ic,Ii=q.CUSTOM_ELEMENT_HANDLING||{},q.CUSTOM_ELEMENT_HANDLING&&Rh(q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ii.tagNameCheck=q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),q.CUSTOM_ELEMENT_HANDLING&&Rh(q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ii.attributeNameCheck=q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ii.allowCustomizedBuiltInElements=q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Zr&&(Xr=!1),Ba&&(Tn=!0),tc&&(Pe=Gs({},[...NFe]),xt=[],tc.html===!0&&(Gs(Pe,MFe),Gs(xt,PFe)),tc.svg===!0&&(Gs(Pe,gde),Gs(xt,mde),Gs(xt,CG)),tc.svgFilters===!0&&(Gs(Pe,fde),Gs(xt,mde),Gs(xt,CG)),tc.mathMl===!0&&(Gs(Pe,pde),Gs(xt,FFe),Gs(xt,CG))),q.ADD_TAGS&&(Pe===lt&&(Pe=JN(Pe)),Gs(Pe,q.ADD_TAGS,Bo)),q.ADD_ATTR&&(xt===Ji&&(xt=JN(xt)),Gs(xt,q.ADD_ATTR,Bo)),q.ADD_URI_SAFE_ATTR&&Gs(zc,q.ADD_URI_SAFE_ATTR,Bo),q.FORBID_CONTENTS&&(gl===eh&&(gl=JN(gl)),Gs(gl,q.FORBID_CONTENTS,Bo)),Vc&&(Pe["#text"]=!0),Di&&Gs(Pe,["html","head","body"]),Pe.table&&(Gs(Pe,["tbody"]),delete ns.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw XU('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw XU('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=q.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=Glt(f,i)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));sf&&sf(q),Is=q}},Aa=Gs({},["mi","mo","mn","ms","mtext"]),ee=Gs({},["foreignobject","desc","title","annotation-xml"]),De=Gs({},["title","style","font","a","script"]),gt=Gs({},gde);Gs(gt,fde),Gs(gt,Plt);const zn=Gs({},pde);Gs(zn,Flt);const Cs=function(q){let de=w(q);(!de||!de.tagName)&&(de={namespaceURI:Or,tagName:"template"});const T=uq(q.tagName),ne=uq(de.tagName);return ih[q.namespaceURI]?q.namespaceURI===fl?de.namespaceURI===ic?T==="svg":de.namespaceURI===Dc?T==="svg"&&(ne==="annotation-xml"||Aa[ne]):!!gt[T]:q.namespaceURI===Dc?de.namespaceURI===ic?T==="math":de.namespaceURI===fl?T==="math"&&ee[ne]:!!zn[T]:q.namespaceURI===ic?de.namespaceURI===fl&&!ee[ne]||de.namespaceURI===Dc&&!Aa[ne]?!1:!zn[T]&&(De[T]||!gt[T]):!!($c==="application/xhtml+xml"&&ih[q.namespaceURI]):!1},Wo=function(q){JU(e.removed,{element:q});try{q.parentNode.removeChild(q)}catch{q.remove()}},Ha=function(q,de){try{JU(e.removed,{attribute:de.getAttributeNode(q),from:de})}catch{JU(e.removed,{attribute:null,from:de})}if(de.removeAttribute(q),q==="is"&&!xt[q])if(Tn||Ba)try{Wo(de)}catch{}else try{de.setAttribute(q,"")}catch{}},ea=function(q){let de,T;if(Oo)q=""+q;else{const O=Llt(q,/^[\r\n\t ]+/);T=O&&O[0]}$c==="application/xhtml+xml"&&Or===ic&&(q=''+q+"");const ne=y?y.createHTML(q):q;if(Or===ic)try{de=new u().parseFromString(ne,$c)}catch{}if(!de||!de.documentElement){de=A.createDocument(Or,"template",null);try{de.documentElement.innerHTML=pl?C:ne}catch{}}const ye=de.body||de.documentElement;return q&&T&&ye.insertBefore(n.createTextNode(T),ye.childNodes[0]||null),Or===ic?P.call(de,Di?"html":"body")[0]:Di?de.documentElement:ye},Mh=function(q){return L.call(q.ownerDocument||q,q,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},le=function(q){return q instanceof h&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof d)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},dr=function(q){return typeof a=="object"?q instanceof a:q&&typeof q=="object"&&typeof q.nodeType=="number"&&typeof q.nodeName=="string"},io=function(q,de,T){z[q]&&Tlt(z[q],ne=>{ne.call(e,de,T,Is)})},un=function(q){let de;if(io("beforeSanitizeElements",q,null),le(q))return Wo(q),!0;const T=Bo(q.nodeName);if(io("uponSanitizeElement",q,{tagName:T,allowedTags:Pe}),q.hasChildNodes()&&!dr(q.firstElementChild)&&(!dr(q.content)||!dr(q.content.firstElementChild))&&yp(/<[/\w]/g,q.innerHTML)&&yp(/<[/\w]/g,q.textContent))return Wo(q),!0;if(!Pe[T]||ns[T]){if(!ns[T]&&rt(T)&&(Ii.tagNameCheck instanceof RegExp&&yp(Ii.tagNameCheck,T)||Ii.tagNameCheck instanceof Function&&Ii.tagNameCheck(T)))return!1;if(Vc&&!gl[T]){const ne=w(q)||q.parentNode,ye=b(q)||q.childNodes;if(ye&&ne){const O=ye.length;for(let $=O-1;$>=0;--$)ne.insertBefore(m(ye[$],!0),v(q))}}return Wo(q),!0}return q instanceof c&&!Cs(q)||(T==="noscript"||T==="noembed"||T==="noframes")&&yp(/<\/no(script|embed|frames)/i,q.innerHTML)?(Wo(q),!0):(Zr&&q.nodeType===3&&(de=q.textContent,de=lv(de,G," "),de=lv(de,j," "),de=lv(de,K," "),q.textContent!==de&&(JU(e.removed,{element:q.cloneNode()}),q.textContent=de)),io("afterSanitizeElements",q,null),!1)},Se=function(q,de,T){if(Fn&&(de==="id"||de==="name")&&(T in n||T in kc))return!1;if(!(Xr&&!zs[de]&&yp(ie,de))){if(!(Pn&&yp(ge,de))){if(!xt[de]||zs[de]){if(!(rt(q)&&(Ii.tagNameCheck instanceof RegExp&&yp(Ii.tagNameCheck,q)||Ii.tagNameCheck instanceof Function&&Ii.tagNameCheck(q))&&(Ii.attributeNameCheck instanceof RegExp&&yp(Ii.attributeNameCheck,de)||Ii.attributeNameCheck instanceof Function&&Ii.attributeNameCheck(de))||de==="is"&&Ii.allowCustomizedBuiltInElements&&(Ii.tagNameCheck instanceof RegExp&&yp(Ii.tagNameCheck,T)||Ii.tagNameCheck instanceof Function&&Ii.tagNameCheck(T))))return!1}else if(!zc[de]){if(!yp(yt,lv(T,Re,""))){if(!((de==="src"||de==="xlink:href"||de==="href")&&q!=="script"&&Rlt(T,"data:")===0&&dg[q])){if(!(ds&&!yp(xe,lv(T,Re,"")))){if(T)return!1}}}}}}return!0},rt=function(q){return q.indexOf("-")>0},Ft=function(q){let de,T,ne,ye;io("beforeSanitizeAttributes",q,null);const{attributes:O}=q;if(!O)return;const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xt};for(ye=O.length;ye--;){de=O[ye];const{name:se,namespaceURI:Ke}=de;if(T=se==="value"?de.value:Mlt(de.value),ne=Bo(se),$.attrName=ne,$.attrValue=T,$.keepAttr=!0,$.forceKeepAttr=void 0,io("uponSanitizeAttribute",q,$),T=$.attrValue,$.forceKeepAttr||(Ha(se,q),!$.keepAttr))continue;if(!Zo&&yp(/\/>/i,T)){Ha(se,q);continue}Zr&&(T=lv(T,G," "),T=lv(T,j," "),T=lv(T,K," "));const Bi=Bo(q.nodeName);if(Se(Bi,ne,T)){if(Zd&&(ne==="id"||ne==="name")&&(Ha(se,q),T=pc+T),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ke)switch(f.getAttributeType(Bi,ne)){case"TrustedHTML":{T=y.createHTML(T);break}case"TrustedScriptURL":{T=y.createScriptURL(T);break}}try{Ke?q.setAttributeNS(Ke,se,T):q.setAttribute(se,T),RFe(e.removed)}catch{}}}io("afterSanitizeAttributes",q,null)},Ci=function Ot(q){let de;const T=Mh(q);for(io("beforeSanitizeShadowDOM",q,null);de=T.nextNode();)io("uponSanitizeShadowNode",de,null),!un(de)&&(de.content instanceof o&&Ot(de.content),Ft(de));io("afterSanitizeShadowDOM",q,null)};return e.sanitize=function(Ot){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de,T,ne,ye;if(pl=!Ot,pl&&(Ot=""),typeof Ot!="string"&&!dr(Ot))if(typeof Ot.toString=="function"){if(Ot=Ot.toString(),typeof Ot!="string")throw XU("dirty is not a string, aborting")}else throw XU("toString is not a function");if(!e.isSupported)return Ot;if(ss||be(q),e.removed=[],typeof Ot=="string"&&($s=!1),$s){if(Ot.nodeName){const se=Bo(Ot.nodeName);if(!Pe[se]||ns[se])throw XU("root node is forbidden and cannot be sanitized in-place")}}else if(Ot instanceof a)de=ea(""),T=de.ownerDocument.importNode(Ot,!0),T.nodeType===1&&T.nodeName==="BODY"||T.nodeName==="HTML"?de=T:de.appendChild(T);else{if(!Tn&&!Zr&&!Di&&Ot.indexOf("<")===-1)return y&&md?y.createHTML(Ot):Ot;if(de=ea(Ot),!de)return Tn?null:md?C:""}de&&Oo&&Wo(de.firstChild);const O=Mh($s?Ot:de);for(;ne=O.nextNode();)un(ne)||(ne.content instanceof o&&Ci(ne.content),Ft(ne));if($s)return Ot;if(Tn){if(Ba)for(ye=k.call(de.ownerDocument);de.firstChild;)ye.appendChild(de.firstChild);else ye=de;return(xt.shadowroot||xt.shadowrootmode)&&(ye=R.call(t,ye,!0)),ye}let $=Di?de.outerHTML:de.innerHTML;return Di&&Pe["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&yp(DGe,de.ownerDocument.doctype.name)&&($=" +`+$),Zr&&($=lv($,G," "),$=lv($,j," "),$=lv($,K," ")),y&&md?y.createHTML($):$},e.setConfig=function(Ot){be(Ot),ss=!0},e.clearConfig=function(){Is=null,ss=!1},e.isValidAttribute=function(Ot,q,de){Is||be({});const T=Bo(Ot),ne=Bo(q);return Se(T,ne,de)},e.addHook=function(Ot,q){typeof q=="function"&&(z[Ot]=z[Ot]||[],JU(z[Ot],q))},e.removeHook=function(Ot){if(z[Ot])return RFe(z[Ot])},e.removeHooks=function(Ot){z[Ot]&&(z[Ot]=[])},e.removeAllHooks=function(){z={}},e}var q1e=kGe();const IGe=q1e.sanitize,TGe=q1e.addHook,LGe=q1e.removeHook;function Wc(s){return Lre(s,0)}function Lre(s,e){switch(typeof s){case"object":return s===null?wS(349,e):Array.isArray(s)?qlt(s,e):Qlt(s,e);case"string":return Q1e(s,e);case"boolean":return Klt(s,e);case"number":return wS(s,e);case"undefined":return wS(937,e);default:return wS(617,e)}}function wS(s,e){return(e<<5)-e+s|0}function Klt(s,e){return wS(s?433:863,e)}function Q1e(s,e){e=wS(149417,e);for(let t=0,i=s.length;tLre(i,t),e)}function Qlt(s,e){return e=wS(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=Q1e(i,t),Lre(s[i],t)),e)}var Bm;(function(s){s[s.BLOCK_SIZE=64]="BLOCK_SIZE",s[s.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(Bm||(Bm={}));function _de(s,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function BFe(s,e=0,t=s.byteLength,i=0){for(let n=0;nt.toString(16).padStart(2,"0")).join(""):jlt((s>>>0).toString(16),e/4)}const Pne=class Pne{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(Bm.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 n=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(Pc(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>=Bm.BLOCK_SIZE&&(this._step(),t-=Bm.BLOCK_SIZE,this._totalLen+=Bm.BLOCK_SIZE,e[0]=e[Bm.BLOCK_SIZE+0],e[1]=e[Bm.BLOCK_SIZE+1],e[2]=e[Bm.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,Bm.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),ZU(this._h0)+ZU(this._h1)+ZU(this._h2)+ZU(this._h3)+ZU(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,BFe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),BFe(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=Pne._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,_de(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,n=this._h1,o=this._h2,r=this._h3,a=this._h4,c,l,d;for(let h=0;h<80;h++)h<20?(c=n&o|~n&r,l=1518500249):h<40?(c=n^o^r,l=1859775393):h<60?(c=n&o|n&r|o&r,l=2400959708):(c=n^o^r,l=3395469782),d=_de(i,5)+c+a+l+e.getUint32(h*4,!1)&4294967295,a=r,r=o,o=_de(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}};Pne._bigBlock32=new DataView(new ArrayBuffer(320));let cpe=Pne;function Ka(s,e,t){return Math.min(Math.max(s,e),t)}function WFe(s,e){return(e+s%e)%e}class Ylt{constructor(){this._next=0}getNext(){return this._next++}}class j1e{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class Jlt{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n{s.delete(r.vscodeWindowId),i.fire(r)})),a.add(ue(r,ke.BEFORE_UNLOAD,()=>{n.fire(r)})),t.fire(c),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return s.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:si},getDocument(r){return ct(r).document}}}();function Ms(s){for(;s.firstChild;)s.firstChild.remove()}class tdt{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!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 ue(s,e,t,i){return new tdt(s,e,t,i)}function RGe(s,e){return function(t){return e(new Sh(s,t))}}function idt(s){return function(e){return s(new En(e))}}const Ro=function(e,t,i,n){let o=i;return t==="click"||t==="mousedown"||t==="contextmenu"?o=RGe(ct(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=idt(i)),ue(e,t,o,n)},ndt=function(e,t,i){const n=RGe(ct(e),t);return sdt(e,n,i)};function sdt(s,e,t){return ue(s,am&&AO.pointerEvents?ke.POINTER_DOWN:ke.MOUSE_DOWN,e,t)}function QP(s,e,t){return xO(s,e,t)}class jV extends SGe{constructor(e,t){super(e,t)}}let Wj,Tl;function odt(s,e,t,i){let n=0;const o=s.setInterval(()=>{n++,(n>=i||e()===!0)&&r.dispose()},t),r=Ee(()=>{s.clearInterval(o)});return r}class Q7 extends q7{constructor(e){super(),this.defaultTarget=e&&ct(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class vde{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){vt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const s=new Map,e=new Map,t=new Map,i=new Map,n=o=>{t.set(o,!1);const r=s.get(o)??[];for(e.set(o,r),s.set(o,[]),i.set(o,!0);r.length>0;)r.sort(vde.sort),r.shift().execute();i.set(o,!1)};Tl=(o,r,a=0)=>{const c=R2(o),l=new vde(r,a);let d=s.get(c);return d||(d=[],s.set(c,d)),d.push(l),t.get(c)||(t.set(c,!0),o.requestAnimationFrame(()=>n(c))),l},Wj=(o,r,a)=>{const c=R2(o);if(i.get(c)){const l=new vde(r,a);let d=e.get(c);return d||(d=[],e.set(c,d)),d.push(l),l}else return Tl(o,r,a)}})();const rdt=8,adt=function(s,e){return e};class cdt extends V{constructor(e,t,i,n=adt,o=rdt){super();let r=null,a=0;const c=this._register(new bm),l=()=>{a=new Date().getTime(),i(r),r=null};this._register(ue(e,t,d=>{r=n(r,d);const h=new Date().getTime()-a;h>=o?(c.cancel(),l()):c.setIfNotSet(l,o-h)}))}}function ldt(s,e,t,i,n){return new cdt(s,e,t,i,n)}function Rre(s){return ct(s).getComputedStyle(s,null)}function H_(s,e){const t=ct(s),i=t.document;if(s!==i.body)return new bn(s.clientWidth,s.clientHeight);if(am&&t?.visualViewport)return new bn(t.visualViewport.width,t.visualViewport.height);if(t?.innerWidth&&t.innerHeight)return new bn(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new bn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new bn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class $r{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=Rre(e),o=n?n.getPropertyValue(t):"0";return $r.convertToPixels(e,o)}static getBorderLeftWidth(e){return $r.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return $r.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return $r.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return $r.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return $r.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return $r.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return $r.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return $r.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return $r.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return $r.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return $r.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return $r.getDimension(e,"margin-bottom","marginBottom")}}const c1=class c1{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new c1(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof c1?e:new c1(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};c1.None=new c1(0,0);let bn=c1;function Hj(s){let e=s.offsetParent,t=s.offsetTop,i=s.offsetLeft;for(;(s=s.parentNode)!==null&&s!==s.ownerDocument.body&&s!==s.ownerDocument.documentElement;){t-=s.scrollTop;const n=FGe(s)?null:Rre(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=$r.getBorderLeftWidth(s),t+=$r.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function MGe(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function Cr(s){const e=s.getBoundingClientRect(),t=ct(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function NGe(s){let e=s,t=1;do{const i=Rre(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function Md(s){const e=$r.getMarginLeft(s)+$r.getMarginRight(s);return s.offsetWidth+e}function YV(s){const e=$r.getBorderLeftWidth(s)+$r.getBorderRightWidth(s),t=$r.getPaddingLeft(s)+$r.getPaddingRight(s);return s.offsetWidth-e-t}function ddt(s){const e=$r.getMarginLeft(s)+$r.getMarginRight(s);return s.scrollWidth+e}function Y1e(s){const e=$r.getBorderTopWidth(s)+$r.getBorderBottomWidth(s),t=$r.getPaddingTop(s)+$r.getPaddingBottom(s);return s.offsetHeight-e-t}function hb(s){const e=$r.getMarginTop(s)+$r.getMarginBottom(s);return s.offsetHeight+e}function hdt(s,e){if(s===null)return 0;const t=Hj(s),i=Hj(e);return t.left-i.left}function udt(s,e){const t=e.map(n=>Math.max(ddt(n),Md(n))+hdt(n,s)||0);return Math.max(...t)}function wc(s,e){return!!e?.contains(s)}const PGe="parentFlowToElementId";function gdt(s,e){s.dataset[PGe]=e.id}function fdt(s){const e=s.dataset[PGe];return typeof e=="string"?s.ownerDocument.getElementById(e):null}function pdt(s,e){let t=s;for(;t;){if(t===e)return!0;if(Yr(t)){const i=fdt(t);if(i){t=i;continue}}t=t.parentNode}return!1}function mdt(s,e,t){for(;s&&s.nodeType===s.ELEMENT_NODE;){if(s.classList.contains(e))return s;if(t){if(typeof t=="string"){if(s.classList.contains(t))return null}else if(s===t)return null}s=s.parentNode}return null}function gq(s,e,t){return!!mdt(s,e,t)}function FGe(s){return s&&!!s.host&&!!s.mode}function E8(s){return!!fM(s)}function fM(s){for(;s.parentNode;){if(s===s.ownerDocument?.body)return null;s=s.parentNode}return FGe(s)?s:null}function Bc(){let s=Bu().activeElement;for(;s?.shadowRoot;)s=s.shadowRoot.activeElement;return s}function sv(s){return Bc()===s}function J1e(s){return wc(Bc(),s)}function _dt(s){return s.ownerDocument===Bu()}function Bu(){return Xlt()<=1?si.document:Array.from(A8()).map(({window:e})=>e.document).find(e=>e.hasFocus())??si.document}function Ey(){return Bu().defaultView?.window??si}const X1e=new Map;function OGe(){return new vdt}class vdt{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=ul(si.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function ul(s=si.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e?.(i),s.appendChild(i),t&&t.add(Ee(()=>i.remove())),s===si.document.head){const n=new Set;X1e.set(i,n);for(const{window:o,disposables:r}of A8()){if(o===si)continue;const a=r.add(bdt(i,n,o));t?.add(a)}}return i}function bdt(s,e,t){const i=new Z,n=s.cloneNode(!0);t.document.head.appendChild(n),i.add(Ee(()=>n.remove()));for(const o of WGe(s))n.sheet?.insertRule(o.cssText,n.sheet?.cssRules.length);return i.add(wdt.observe(s,i,{childList:!0})(()=>{n.textContent=s.textContent})),e.add(n),i.add(Ee(()=>e.delete(n))),i}const wdt=new class{constructor(){this.mutationObservers=new Map}observe(s,e,t){let i=this.mutationObservers.get(s);i||(i=new Map,this.mutationObservers.set(s,i));const n=Wc(t);let o=i.get(n);if(o)o.users+=1;else{const r=new I,a=new MutationObserver(l=>r.fire(l));a.observe(s,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(n),i?.size===0&&this.mutationObservers.delete(s))})),i.set(n,o)}return o.onDidMutate}};let bde=null;function BGe(){return bde||(bde=ul()),bde}function WGe(s){return s?.sheet?.rules?s.sheet.rules:s?.sheet?.cssRules?s.sheet.cssRules:[]}function Bf(s,e,t=BGe()){if(!(!t||!e)){t.sheet?.insertRule(`${s} {${e}}`,0);for(const i of X1e.get(t)??[])Bf(s,e,i)}}function yS(s,e=BGe()){if(!e)return;const t=WGe(e),i=[];for(let n=0;n=0;n--)e.sheet?.deleteRule(i[n]);for(const n of X1e.get(e)??[])yS(s,n)}function ydt(s){return typeof s.selectorText=="string"}function Yr(s){return s instanceof HTMLElement||s instanceof ct(s).HTMLElement}function HFe(s){return s instanceof HTMLAnchorElement||s instanceof ct(s).HTMLAnchorElement}function Cdt(s){return s instanceof HTMLTextAreaElement||s instanceof ct(s).HTMLTextAreaElement}function Sdt(s){return s instanceof HTMLInputElement||s instanceof ct(s).HTMLInputElement}function Adt(s){return s instanceof SVGElement||s instanceof ct(s).SVGElement}function Z1e(s){return s instanceof MouseEvent||s instanceof ct(s).MouseEvent}function a_(s){return s instanceof KeyboardEvent||s instanceof ct(s).KeyboardEvent}function Edt(s){return s instanceof DragEvent||s instanceof ct(s).DragEvent}const ke={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:fT?"webkitAnimationStart":"animationstart",ANIMATION_END:fT?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:fT?"webkitAnimationIteration":"animationiteration"};function xdt(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const en={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function Ddt(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function kdt(s,e){for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)s.scrollTop!==e[t]&&(s.scrollTop=e[t]),s=s.parentNode}class Uj extends V{static hasFocusWithin(e){if(Yr(e)){const t=fM(e),i=t?t.activeElement:e.ownerDocument.activeElement;return wc(i,e)}else{const t=e;return wc(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=Uj.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(Yr(e)?ct(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{Uj.hasFocusWithin(e)!==t&&(t?o():n())},this._register(ue(e,ke.FOCUS,n,!0)),this._register(ue(e,ke.BLUR,o,!0)),Yr(e)&&(this._register(ue(e,ke.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ue(e,ke.FOCUS_OUT,()=>this._refreshStateHandler())))}refreshState(){this._refreshStateHandler()}}function Ac(s){return new Uj(s)}function HGe(s,e){return s.after(e),e}function re(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Mre(s,e){return s.insertBefore(e,s.firstChild),e}function aa(s,...e){s.innerText="",re(s,...e)}const Idt=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var x8;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(x8||(x8={}));function UGe(s,e,t,...i){const n=Idt.exec(e);if(!n)throw new Error("Bad use of emmet");const o=n[1]||"div";let r;return s!==x8.HTML?r=document.createElementNS(s,o):r=document.createElement(o),n[3]&&(r.id=n[3]),n[4]&&(r.className=n[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 fe(s,e,...t){return UGe(x8.HTML,s,e,...t)}fe.SVG=function(s,e,...t){return UGe(x8.SVG,s,e,...t)};function eTe(s,...e){s?jh(...e):Ud(...e)}function jh(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function Ud(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function UFe(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function VGe(s){si.open(s,"_blank","noopener")}function Tdt(s,e){const t=()=>{e(),i=Tl(s,t)};let i=Tl(s,t);return Ee(()=>i.dispose())}C8.setPreferredWebSchema(/^https:/.test(si.location.href)?"https":"http");function Yu(s){return s?`url('${Jg.uriToBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function fq(s){return`'${s.replace(/'/g,"%27")}'`}function xy(s,e){if(s!==void 0){const t=s.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=xy(i[1].trim(),e)),`var(${i[0]}, ${e})`}return s}return e}function Ldt(s,e){let t;if(N.isUri(s))t=s.toString(!0);else{const o=new Blob([s]);t=URL.createObjectURL(o),setTimeout(()=>URL.revokeObjectURL(t))}const i=Ey(),n=document.createElement("a");i.document.body.appendChild(n),n.download=e,n.href=t,n.click(),setTimeout(()=>n.remove())}function Rdt(){return new Promise(s=>{const e=Ey(),t=document.createElement("input");e.document.body.appendChild(t),t.type="file",t.multiple=!0,M.once(M.fromDOMEventEmitter(t,"input"))(()=>{s(t.files??void 0)}),t.click(),setTimeout(()=>t.remove())})}var JV;(function(s){s[s.DOCUMENT=1]="DOCUMENT",s[s.BROWSER=2]="BROWSER"})(JV||(JV={}));function Mdt(s){return s.document.fullscreenElement||s.document.webkitFullscreenElement||s.document.webkitIsFullScreen?{mode:JV.DOCUMENT,guess:!1}:s.innerHeight===s.screen.height?{mode:JV.BROWSER,guess:!1}:(Qt||pr)&&s.outerHeight===s.screen.height&&s.outerWidth===s.screen.width?{mode:JV.BROWSER,guess:!0}:null}function Ndt(s,e=!1){const t=document.createElement("a");return TGe("afterSanitizeAttributes",i=>{for(const n of["href","src"])if(i.hasAttribute(n)){const o=i.getAttribute(n);if(n==="href"&&o.startsWith("#"))continue;if(t.href=o,!s.includes(t.protocol.replace(/:$/,""))){if(e&&n==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(n)}}}),Ee(()=>{LGe("afterSanitizeAttributes")})}pe.http,pe.https,pe.command;const Pdt=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 Fdt(s){const e=new Uint16Array(s.length);for(let n=0;nthis.registerListeners(e,t),{window:si,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ue(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new En(i);if(!(n.keyCode===S.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(n.keyCode!==S.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(ue(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(ue(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ue(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ue(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(ue(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 ub.instance||(ub.instance=new ub),ub.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Vj extends V{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(ue(this.element,ke.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(ue(this.element,ke.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(ue(this.element,ke.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(ue(this.element,ke.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(ue(this.element,ke.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(ue(this.element,ke.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(ue(this.element,ke.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const zGe=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Bt(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=zGe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElement(o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const l of n.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(n.groups.name&&(c[n.groups.name]=r),i)for(const l of i)Yr(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(zj(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(zj(l),d.toString());return c.root=r,c}function XN(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=zGe.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElementNS("http://www.w3.org/2000/svg",o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const l of n.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(n.groups.name&&(c[n.groups.name]=r),i)for(const l of i)Yr(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(zj(h),typeof u=="number"?u+"px":""+u);else l==="tabIndex"?r.tabIndex=d:r.setAttribute(zj(l),d.toString());return c.root=r,c}function zj(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class Odt extends V{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 Bdt extends V{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 Odt(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,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n}}class Wdt{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=R2(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=w2(new Bdt(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),w2(M.once(edt)(({vscodeWindowId:n})=>{n===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const k8=new Wdt;class $Ge{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=_f(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=_f(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=_f(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=_f(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=_f(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=_f(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=_f(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=_f(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=_f(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=_f(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=_f(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=_f(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=_f(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=_f(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 _f(s){return typeof s=="number"?`${s}px`:s}function ls(s){return new $Ge(s)}function xl(s,e){s instanceof $Ge?(s.setFontFamily(e.getMassagedFontFamily()),s.setFontWeight(e.fontWeight),s.setFontSize(e.fontSize),s.setFontFeatureSettings(e.fontFeatureSettings),s.setFontVariationSettings(e.fontVariationSettings),s.setLineHeight(e.lineHeight),s.setLetterSpacing(e.letterSpacing)):(s.style.fontFamily=e.getMassagedFontFamily(),s.style.fontWeight=e.fontWeight,s.style.fontSize=e.fontSize+"px",s.style.fontFeatureSettings=e.fontFeatureSettings,s.style.fontVariationSettings=e.fontVariationSettings,s.style.lineHeight=e.lineHeight+"px",s.style.letterSpacing=e.letterSpacing+"px")}var sc;(function(s){s[s.Regular=0]="Regular",s[s.Italic=1]="Italic",s[s.Bold=2]="Bold"})(sc||(sc={}));class Hdt{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class tTe{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(),this._container?.remove(),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");xl(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");xl(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");xl(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const r of this._requests){let a;r.type===sc.Regular&&(a=t),r.type===sc.Bold&&(a=i),r.type===sc.Italic&&(a=n),a.appendChild(document.createElement("br"));const c=document.createElement("span");tTe._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 n=0;n<8;n++)i+=i;e.innerText=i}else{let i=t.chr;for(let n=0;n<8;n++)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 n=!1;for(const o of i)o.isTrusted||(n=!0,t.remove(o));n&&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!==GGe)continue;const n=new pq(i,!1);this._writeToCache(e,n,n)}}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let n=this._actualReadFontInfo(e,t);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new pq({pixelRatio:k8.getInstance(e).value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,t,n)}return i.get(t)}_createRequest(e,t,i,n){const o=new Hdt(e,t);return i.push(o),n?.push(o),o}_actualReadFontInfo(e,t){const i=[],n=[],o=this._createRequest("n",sc.Regular,i,n),r=this._createRequest("m",sc.Regular,i,null),a=this._createRequest(" ",sc.Regular,i,n),c=this._createRequest("0",sc.Regular,i,n),l=this._createRequest("1",sc.Regular,i,n),d=this._createRequest("2",sc.Regular,i,n),h=this._createRequest("3",sc.Regular,i,n),u=this._createRequest("4",sc.Regular,i,n),f=this._createRequest("5",sc.Regular,i,n),p=this._createRequest("6",sc.Regular,i,n),m=this._createRequest("7",sc.Regular,i,n),v=this._createRequest("8",sc.Regular,i,n),b=this._createRequest("9",sc.Regular,i,n),w=this._createRequest("→",sc.Regular,i,n),y=this._createRequest("→",sc.Regular,i,null),C=this._createRequest("·",sc.Regular,i,n),A=this._createRequest("⸱",sc.Regular,i,null),L="|/-_ilm%";for(let G=0,j=L.length;G.001){P=!1;break}}let z=!0;return P&&y.width!==R&&(z=!1),y.width>w.width&&(z=!1),new pq({pixelRatio:k8.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:P,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:z,spaceWidth:a.width,middotWidth:C.width,wsmiddotWidth:A.width,maxDigitWidth:k},!0)}}class $dt{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 lpe=new zdt;var m_;(function(s){s.serviceIds=new Map,s.DI_TARGET="$di$target",s.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[s.DI_DEPENDENCIES]||[]}s.getServiceDependencies=e})(m_||(m_={}));const we=ae("instantiationService");function Gdt(s,e,t){e[m_.DI_TARGET]===e?e[m_.DI_DEPENDENCIES].push({id:s,index:t}):(e[m_.DI_DEPENDENCIES]=[{id:s,index:t}],e[m_.DI_TARGET]=e)}function ae(s){if(m_.serviceIds.has(s))return m_.serviceIds.get(s);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Gdt(e,t,n)};return e.toString=()=>s,m_.serviceIds.set(s,e),e}const Kt=ae("codeEditorService"),gi=ae("modelService"),fn=ae("textModelService");function Kdt(s){return!!s.textEditorModel}function D(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}function _(s,e){return function(t,i){e(t,i,s)}}class rn extends V{constructor(e,t="",i="",n=!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=n,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 U_ extends V{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(n){i=n}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const Tz=class Tz{constructor(){this.id=Tz.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 Tz,...i]:t=i);return t}async run(){}};Tz.ID="vs.actions.separator";let Ar=Tz;class Ik{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}const Fne=class Fne extends rn{constructor(){super(Fne.ID,g(1610,"(empty)"),void 0,!1)}};Fne.ID="vs.actions.empty";let dpe=Fne;function ol(s){return{id:s.id,label:s.label,tooltip:s.tooltip??s.label,class:s.class,enabled:s.enabled??!0,checked:s.checked,run:async(...e)=>s.run(...e)}}var M2;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(M2||(M2={}));function VFe(s){return{id:s}}var We;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9-]+",s.iconModifierExpression="~[A-Za-z]+",s.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function t(u){const f=e.exec(u.id);if(!f)return t(ve.error);const[,p,m]=f,v=["codicon","codicon-"+p];return m&&v.push("codicon-modifier-"+m.substring(1)),v}s.asClassNameArray=t;function i(u){return t(u).join(" ")}s.asClassName=i;function n(u){return"."+t(u).join(".")}s.asCSSSelector=n;function o(u){return u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||M2.isThemeColor(u.color))}s.isThemeIcon=o;const r=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(u){const f=r.exec(u);if(!f)return;const[,p]=f;return{id:p}}s.fromString=a;function c(u){return{id:u}}s.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}}s.modify=l;function d(u){const f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}s.getModifier=d;function h(u,f){return u.id===f.id&&u.color?.id===f.color?.id}s.isEqual=h})(We||(We={}));const vi=ae("commandService"),_t=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new I,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,e){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:s,handler:e})}if(s.metadata&&Array.isArray(s.metadata.args)){const r=[];for(const c of s.metadata.args)r.push(c.constraint);const a=s.handler;s.handler=function(c,...l){return ort(l,r),a(c,...l)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new dl,this._commands.set(t,i));const n=i.unshift(s),o=Ee(()=>{n(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(s,e){return _t.registerCommand(s,(t,...i)=>t.get(vi).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return hi.first(e)}getCommands(){const s=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&s.set(e,t)}return s}};_t.registerCommand("noop",()=>{});const Le=ae("contextKeyService");function qf(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function j7(s,e="Unreachable"){throw new Error(e)}function zFe(s){s||vt(new Ni("Soft Assertion Failed"))}function V_(s){if(!s()){debugger;s(),vt(new Ni("Assertion Failed"))}}function fU(s,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(jdt)),this._cachedMergedKeybindings.slice(0)}}const So=new iTe,Qdt={EditorModes:"platform.keybindingsRegistry"};Qe.add(Qdt.EditorModes,So);function jdt(s,e){if(s.weight1!==e.weight1)return s.weight1-e.weight1;if(s.command&&e.command){if(s.commande.command)return 1}return s.weight2-e.weight2}var mq;function pT(s){return s.command!==void 0}function Ydt(s){return s.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.DebugCallStackToolbar=new te("DebugCallStackToolbar"),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.SCMChangesContext=new te("SCMChangesContext"),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.TestProfilesContext=new te("TestProfilesContext"),te.TestMessageContext=new te("TestMessageContext"),te.TestMessageContent=new te("TestMessageContent"),te.TestPeekElement=new te("TestPeekElement"),te.TestPeekTitle=new te("TestPeekTitle"),te.TestCallStack=new te("TestCallStack"),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.InteractiveInputConfig=new te("InteractiveInputConfig"),te.ReplInputExecute=new te("ReplInputExecute"),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.InlineEditsActions=new te("InlineEditsActions"),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 _e=te;const Lz=class Lz{static for(e){let t=this._all.get(e);return t||(t=new Lz(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Lz&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Lz._all=new Map;let R0=Lz;const jn=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Brt({merge:R0.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(s){return this._commands.set(s.id,s),this._onDidChangeMenu.fire(R0.for(_e.CommandPalette)),Ee(()=>{this._commands.delete(s.id)&&this._onDidChangeMenu.fire(R0.for(_e.CommandPalette))})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((e,t)=>s.set(t,e)),s}appendMenuItem(s,e){let t=this._menuItems.get(s);t||(t=new dl,this._menuItems.set(s,t));const i=t.push(e);return this._onDidChangeMenu.fire(R0.for(s)),Ee(()=>{i(),this._onDidChangeMenu.fire(R0.for(s))})}appendMenuItems(s){const e=new Z;for(const{id:t,item:i}of s)e.add(this.appendMenuItem(t,i));return e}getMenuItems(s){let e;return this._menuItems.has(s)?e=[...this._menuItems.get(s)]:e=[],s===_e.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(s){const e=new Set;for(const t of s)pT(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||s.push({command:t})})}};class Dy extends Ik{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 Sc=mq=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,n,o,r,a){this.hideActions=n,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=mq.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&&We.isThemeIcon(l.icon)&&(c=l.icon),this.checked&&l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}c||(c=We.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new mq(t,void 0,i,n,void 0,r,a):void 0,this._options=i,this.class=c&&We.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)}};Sc=mq=D([_(5,Le),_(6,vi)],Sc);class li{constructor(e){this.desc=e}}function At(s){const e=[],t=new s,{f1:i,menu:n,keybinding:o,...r}=t.desc;if(_t.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(_t.registerCommand({id:r.id,handler:(a,...c)=>t.run(a,...c),metadata:r.metadata})),Array.isArray(n))for(const a of n)e.push(jn.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else n&&e.push(jn.appendMenuItem(n.id,{command:{...r,precondition:n.precondition===null?void 0:r.precondition},...n}));if(i&&(e.push(jn.appendMenuItem(_e.CommandPalette,{command:r,when:r.precondition})),e.push(jn.addCommand(r))),Array.isArray(o))for(const a of o)e.push(So.registerKeybindingRule({...a,id:r.id,when:r.precondition?he.and(r.precondition,a.when):a.when}));else o&&e.push(So.registerKeybindingRule({...o,id:r.id,when:r.precondition?he.and(r.precondition,o.when):o.when}));return{dispose(){bt(e)}}}const Yi=ae("telemetryService"),Jdt=ae("customEndpointTelemetryService"),Ge=ae("logService"),lf=ae("loggerService");var ri;(function(s){s[s.Eager=0]="Eager",s[s.AfterFirstRender=1]="AfterFirstRender",s[s.BeforeFirstInteraction=2]="BeforeFirstInteraction",s[s.Eventually=3]="Eventually",s[s.Lazy=4]="Lazy"})(ri||(ri={}));let Nre=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=he.and(i,this.precondition):i=this.precondition);const n={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};So.registerKeybindingRule(n)}}_t.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){jn.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 fI extends Nre{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(Le).contextMatchesRules(i??void 0))return n(a,r,t)})}runCommand(e,t){return hc.runEditorCommand(e,t,this.precondition,(i,n,o)=>this.runEditorCommand(i,n,o))}}class tt extends hc{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(n){return n.menuId||(n.menuId=_e.EditorContext),n.title||(n.title=e.label),n.when=he.and(e.precondition,n.when),n}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(tt.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(Yi).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class qGe extends tt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,n)=>n[0]-i[0]),{dispose:()=>{for(let i=0;i{const r=o.get(Le),a=o.get(Ge);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,n,...t)})}}function ng(s,e){_t.registerCommand(s,function(t,...i){const n=t.get(we),[o,r]=i;Tt(N.isUri(o)),Tt(oe.isIPosition(r));const a=t.get(gi).getModel(o);if(a){const c=oe.lift(r);return n.invokeFunction(e,a,c,...i.slice(2))}return t.get(fn).createModelReference(o).then(c=>new Promise((l,d)=>{try{const h=n.invokeFunction(e,c.object.textEditorModel,oe.lift(r),i.slice(2));l(h)}catch(h){d(h)}}).finally(()=>{c.dispose()}))})}function qe(s){return Qf.INSTANCE.registerEditorCommand(s),s}function Me(s){const e=new s;return Qf.INSTANCE.registerEditorAction(e),e}function QGe(s){return Qf.INSTANCE.registerEditorAction(s),s}function Xdt(s){Qf.INSTANCE.registerEditorAction(s)}function on(s,e,t){Qf.INSTANCE.registerEditorContribution(s,e,t)}function jGe(s,e){Qf.INSTANCE.registerDiffEditorContribution(s,e)}var sp;(function(s){function e(r){return Qf.INSTANCE.getEditorCommand(r)}s.getEditorCommand=e;function t(){return Qf.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return Qf.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(r){return Qf.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function o(){return Qf.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=o})(sp||(sp={}));const Zdt={EditorCommonContributions:"editor.contributions"},One=class One{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}};One.INSTANCE=new One;let Qf=One;Qe.add(Zdt.EditorCommonContributions,Qf.INSTANCE);function Y7(s){return s.register(),s}const YGe=Y7(new fI({id:"undo",precondition:void 0,kbOpts:{weight:Ae.EditorCore,primary:U.CtrlCmd|S.KeyZ},menuOpts:[{menuId:_e.MenubarEditMenu,group:"1_do",title:g(550,"&&Undo"),order:1},{menuId:_e.CommandPalette,group:"",title:g(551,"Undo"),order:1}]}));Y7(new KGe(YGe,{id:"default:undo",precondition:void 0}));const JGe=Y7(new fI({id:"redo",precondition:void 0,kbOpts:{weight:Ae.EditorCore,primary:U.CtrlCmd|S.KeyY,secondary:[U.CtrlCmd|U.Shift|S.KeyZ],mac:{primary:U.CtrlCmd|U.Shift|S.KeyZ}},menuOpts:[{menuId:_e.MenubarEditMenu,group:"1_do",title:g(552,"&&Redo"),order:2},{menuId:_e.CommandPalette,group:"",title:g(553,"Redo"),order:1}]}));Y7(new KGe(JGe,{id:"default:redo",precondition:void 0}));const eht=Y7(new fI({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:Ae.EditorCore,kbExpr:null,primary:U.CtrlCmd|S.KeyA},menuOpts:[{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(554,"&&Select All"),order:1},{menuId:_e.CommandPalette,group:"",title:g(555,"Select All"),order:1}]})),tht="$initialize";let $Fe=!1;function hpe(s){Wn&&($Fe||($Fe=!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(s.message))}var Ff;(function(s){s[s.Request=0]="Request",s[s.Reply=1]="Reply",s[s.SubscribeEvent=2]="SubscribeEvent",s[s.Event=3]="Event",s[s.UnsubscribeEvent=4]="UnsubscribeEvent"})(Ff||(Ff={}));class iht{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=Ff.Request}}class GFe{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=Ff.Reply}}class nht{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=Ff.SubscribeEvent}}class sht{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=Ff.Event}}class oht{constructor(e,t){this.vsWorker=e,this.req=t,this.type=Ff.UnsubscribeEvent}}class rht{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((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new iht(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new I({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new nht(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new oht(this._workerId,i)),i=null}});return n.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case Ff.Reply:return this._handleReplyMessage(e);case Ff.Request:return this._handleRequestMessage(e);case Ff.SubscribeEvent:return this._handleSubscribeEventMessage(e);case Ff.Event:return this._handleEventMessage(e);case Ff.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(n=>{this._send(new GFe(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=yA(n.detail)),this._send(new GFe(this._workerId,t,void 0,yA(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new sht(this._workerId,t,n))});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===Ff.Request)for(let i=0;i{this._protocol.handleMessage(l)},l=>{n?.(l)})),this._protocol=new rht({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(ZGe(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(XGe(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=D1e(i);this._onModuleLoaded=this._protocol.sendMessage(tht,[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)=>{n=d,this._onModuleLoaded.then(h=>{l(cht(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,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}function XGe(s){return s[0]==="o"&&s[1]==="n"&&Nw(s.charCodeAt(2))}function ZGe(s){return/^onDynamic/.test(s)&&Nw(s.charCodeAt(9))}function cht(s,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},n=r=>function(a){return t(r,a)},o={};for(const r of s){if(ZGe(r)){o[r]=n(r);continue}if(XGe(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function KA(s,e){const t=globalThis.MonacoEnvironment;if(t?.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(s,e)}catch(i){vt(i);return}try{return globalThis.trustedTypes?.createPolicy(s,e)}catch(i){vt(i);return}}let $j;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?$j=globalThis.workerttPolicy:$j=KA("defaultWorkerFactory",{createScriptURL:s=>s});function lht(s){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",s);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",s);return new Worker($j?$j.createScriptURL(t):t,{name:s})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function dht(s){return typeof s.then=="function"}class hht extends V{constructor(e,t,i,n,o){super(),this.id=t,this.label=i;const r=lht(i);dht(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(c){n(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(n){vt(n),vt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:n}))}})}}const Bne=class Bne{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++Bne.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new hht(e,n,this._label||"anonymous"+n,t,o=>{hpe(o),this._webWorkerFailedBeforeError=o,i(o)})}};Bne.LAST_WORKER_ID=0;let upe=Bne;var yr;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(yr||(yr={}));class yde{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 yde(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new yde({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new yde({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:l1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:l1.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}};l1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `,l1.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> + `,l1.DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE=` + `;let gpe=l1;function y1(s,e){const t=s.getCount(),i=s.findTokenIndexAtOffset(e),n=s.getLanguageId(i);let o=i;for(;o+10&&s.getLanguageId(r-1)===n;)r--;return new ght(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class ght{constructor(e,t,i,n,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,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 fpe;(function(s){s[s.value=3]="value"})(fpe||(fpe={}));function Yb(s){return(s&fpe.value)!==0}function _q(s){const e=s;return e?[e.on,e.pause,e.resume,e.destroy].every(t=>typeof t=="function"):!1}function Cde(s){const e=s;return e?_q(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function qA(s,e){return new fht(s,e)}class fht{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?vt(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 n=i.indexOf(t);n>=0&&i.splice(n,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 pht(s,e){const t=[];let i;for(;(i=s.read())!==null;)t.push(i);return e(t)}function mht(s,e,t){const i=[];let n;for(;(n=s.read())!==null&&i.length0?e(i):{read:()=>{if(i.length>0)return i.shift();if(typeof n<"u"){const o=n;return n=void 0,o}return s.read()}}}function nTe(s,e){return new Promise((t,i)=>{const n=[];AN(s,{onData:o=>{e&&n.push(o)},onError:o=>{e?i(o):t(void 0)},onEnd:()=>{t(e?e(n):void 0)}})})}function AN(s,e,t){s.on("error",i=>{t?.isCancellationRequested||e.onError(i)}),s.on("end",()=>{t?.isCancellationRequested||e.onEnd()}),s.on("data",i=>{t?.isCancellationRequested||e.onData(i)})}function _ht(s,e){return new Promise((t,i)=>{const n=new Z,o=[],r=l=>{if(o.push(l),o.length>e)return n.dispose(),s.pause(),t({stream:s,buffer:o,ended:!1})},a=l=>(n.dispose(),i(l)),c=()=>(n.dispose(),t({stream:s,buffer:o,ended:!0}));n.add(Ee(()=>s.removeListener("error",a))),s.on("error",a),n.add(Ee(()=>s.removeListener("end",c))),s.on("end",c),n.add(Ee(()=>s.removeListener("data",r))),s.on("data",r)})}function vht(s,e){const t=qA(e);return t.end(s),t}function bht(s){let e=!1;return{read:()=>e?null:(e=!0,s)}}function wht(s,e,t){const i=qA(t);return AN(s,{onData:n=>i.write(e.data(n)),onError:n=>i.error(e.error?e.error(n):n),onEnd:()=>i.end()}),i}const SG=typeof Buffer<"u",yht=new ya(()=>new Uint8Array(256));let Sde,Ade;class $e{static alloc(e){return SG?new $e(Buffer.allocUnsafe(e)):new $e(new Uint8Array(e))}static wrap(e){return SG&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new $e(e)}static fromString(e,t){return!(t?.dontUseNodeBuffer||!1)&&SG?new $e(Buffer.from(e)):(Sde||(Sde=new TextEncoder),new $e(Sde.encode(e)))}static fromByteArray(e){const t=$e.alloc(e.length);for(let i=0,n=e.length;i"u"){t=0;for(let o=0,r=e.length;on-t)return-1;const o=yht.value;o.fill(e.length);for(let l=0;l>>0|s[e+1]<<8>>>0}function Aht(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function Du(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function ku(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function Eht(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0|s[e+2]<<16>>>0|s[e+3]<<24>>>0}function xht(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255,e=e>>>8,s[t+2]=e&255,e=e>>>8,s[t+3]=e&255}function ppe(s,e){return s[e]}function mpe(s,e,t){s[t]=e}function Dht(s){return pht(s,e=>$e.concat(e))}function eKe(s){return bht(s)}function Jx(s){return nTe(s,e=>$e.concat(e))}async function kht(s){return s.ended?$e.concat(s.buffer):$e.concat([...s.buffer,await Jx(s.stream)])}function J7(s){return vht(s,e=>$e.concat(e))}function tKe(s){return qA(e=>$e.concat(e),s)}function iKe(s){let e=0,t=0,i=0;const n=new Uint8Array(Math.floor(s.length/4*3)),o=a=>{switch(t){case 3:n[i++]=e|a,t=0;break;case 2:n[i++]=e|a>>>2,e=a<<6,t=3;break;case 1:n[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 ${s[a]}`)}}const r=i;for(;t>0;)o(0);return $e.wrap(n).slice(0,r)}const Iht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function sTe({buffer:s},e=!0,t=!1){const i=t?Tht:Iht;let n="";const o=s.byteLength%3;let r=0;for(;r>>2],n+=i[(a<<4|c>>>4)&63],n+=i[(c<<2|l>>>6)&63],n+=i[l&63]}if(o===1){const a=s[r+0];n+=i[a>>>2],n+=i[a<<4&63],e&&(n+="==")}else if(o===2){const a=s[r+0],c=s[r+1];n+=i[a>>>2],n+=i[(a<<4|c>>>4)&63],n+=i[c<<2&63],e&&(n+="=")}return n}let Ede;function nKe(){return Ede||(Ede=new TextDecoder("UTF-16LE")),Ede}let xde;function Lht(){return xde||(xde=new TextDecoder("UTF-16BE")),xde}let Dde;function sKe(){return Dde||(Dde=L1e()?nKe():Lht()),Dde}function Rht(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?Mht(s,e,t):nKe().decode(i)}function Mht(s,e,t){const i=[];let n=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},n=(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 Pht{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Nht(t);this.brackets=i.map((n,o)=>new Gj(e,o,n.open,n.close,Fht(n.open,n.close,i,o),Oht(n.open,n.close,i,o))),this.forwardRegex=Bht(this.brackets),this.reversedRegex=Wht(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const o of n.open)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of n.close)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function oKe(s,e,t,i){for(let n=0,o=e.length;n=0&&i.push(a);for(const a of r.close)a.indexOf(s)>=0&&i.push(a)}}function rKe(s,e){return s.length-e.length}function Pre(s){if(s.length<=1)return s;const e=[],t=new Set;for(const i of s)t.has(i)||(e.push(i),t.add(i));return e}function Fht(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o=0;r--)n[o++]=i.charCodeAt(r);return sKe().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class Nm{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,c=n+r;return new F(t,c-a+1,t,c+1)}static findPrevBracketInRange(e,t,i,n,o){const a=oTe(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){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=n+r;return new F(t,c+1,t,c+1+a)}static findNextBracketInRange(e,t,i,n,o){const r=i.substring(n,o);return this.findNextBracketInText(e,t,r,n)}}class Uht{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 n=i.charAt(i.length-1);e.push(n)}return ja(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(Yb(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Nm.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 gb;(function(s){s[s.INCREASE_MASK=1]="INCREASE_MASK",s[s.DECREASE_MASK=2]="DECREASE_MASK",s[s.INDENT_NEXTLINE_MASK=4]="INDENT_NEXTLINE_MASK",s[s.UNINDENT_MASK=8]="UNINDENT_MASK"})(gb||(gb={}));function AG(s){return s.global&&(s.lastIndex=0),!0}class Vht{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&AG(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&AG(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&AG(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&AG(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=gb.INCREASE_MASK),this.shouldDecrease(e)&&(t+=gb.DECREASE_MASK),this.shouldIndentNextLine(e)&&(t+=gb.INDENT_NEXTLINE_MASK),this.shouldIgnore(e)&&(t+=gb.UNINDENT_MASK),t}}class jP{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=jP._createOpenBracketRegExp(t[0]),n=jP._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=cl.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>=cl.Brackets&&i.length>0&&n.length>0)for(let o=0,r=this._brackets.length;o=cl.Brackets&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function Qht(s){return s.replace(/[\[\]]/g,"")}function jht(s){let e=!1;const t=new Map,i=new Map;if(Yht(s,d=>{if(s===d)return!0;const h=JSON.stringify(d);if(h.length<30)return!0;const u=t.get(h);if(!u){const f={schemas:[d]};return t.set(h,f),i.set(d,f),!0}return u.schemas.push(d),i.set(d,u),e=!0,!1}),t.clear(),!e)return JSON.stringify(s);let o="$defs";for(;s.hasOwnProperty(o);)o+="_";const r=[];function a(d){return JSON.stringify(d,(h,u)=>{if(u!==d){const f=i.get(u);if(f&&f.schemas.length>1)return f.id||(f.id=`_${r.length}`,r.push(f.schemas[0])),{$ref:`#/${o}/${f.id}`}}return u})}const c=a(s),l=[];for(let d=0;d{for(const l of c)ZN(l)&&r.push(l)},i=(...c)=>{for(const l of c)if(ZN(l))for(const d in l){const h=l[d];ZN(h)&&r.push(h)}},n=(...c)=>{for(const l of c)if(Array.isArray(l))for(const d of l)ZN(d)&&r.push(d)},o=c=>{if(Array.isArray(c))for(const l of c)ZN(l)&&r.push(l);else ZN(c)&&r.push(c)},r=[s];let a=r.pop();for(;a;)e(a)&&(t(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),i(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),n(a.anyOf,a.allOf,a.oneOf,a.prefixItems),o(a.items)),a=r.pop()}const QA={JSONContribution:"base.contributions.json"};function Jht(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class Xht{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(e,t){this.schemasById[Jht(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){const t=this.schemasById[e];return t?jht(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}}const Zht=new Xht;Qe.add(QA.JSONContribution,Zht);var KFe;(function(s){s.Multiline="multilineText",s.Singleline="singlelineText"})(KFe||(KFe={}));const Nn={Configuration:"base.contributions.configuration"};var at;(function(s){s[s.APPLICATION=1]="APPLICATION",s[s.MACHINE=2]="MACHINE",s[s.WINDOW=3]="WINDOW",s[s.RESOURCE=4]="RESOURCE",s[s.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",s[s.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(at||(at={}));const Ag={properties:{},patternProperties:{}},Y4={properties:{},patternProperties:{}},YP={properties:{},patternProperties:{}},rS={properties:{},patternProperties:{}},aS={properties:{},patternProperties:{}},$v={properties:{},patternProperties:{}},mE="vscode://schemas/settings/resourceLanguage",hKe="vscode://schemas/settings/configurationDefaults",EG=Qe.as(QA.JSONContribution);class eut{constructor(){this.registeredConfigurationDefaults=[],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(472,"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={},EG.registerSchema(mE,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),EG.registerSchema(mE,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),EG.registerSchema(mE,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),EG.registerSchema(mE,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){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:n,source:o}of e)for(const r in n){t.add(r);const a=this.configurationDefaultsOverrides.get(r)??this.configurationDefaultsOverrides.set(r,{configurationDefaultOverrides:[]}).get(r),c=n[r];if(a.configurationDefaultOverrides.push({value:c,source:o}),Xg.test(r)){const l=this.mergeDefaultConfigurationsForOverrideIdentifier(r,c,o,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l,this.updateDefaultOverrideProperty(r,l,o),i.push(...T8(r))}else{const l=this.mergeDefaultConfigurationsForConfigurationProperty(r,c,o,a.configurationDefaultOverrideValue);if(!l)continue;a.configurationDefaultOverrideValue=l;const d=this.configurationProperties[r];d&&(this.updatePropertyDefaultValue(r,d),this.updateSchema(r,d))}}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 i of e){const n=this.registeredConfigurationDefaults.indexOf(i);n!==-1&&this.registeredConfigurationDefaults.splice(n,1)}for(const{overrides:i,source:n}of e)for(const o in i){const r=this.configurationDefaultsOverrides.get(o);if(!r)continue;const a=r.configurationDefaultOverrides.findIndex(c=>n?c.source?.id===n.id:c.value===i[o]);if(a!==-1){if(r.configurationDefaultOverrides.splice(a,1),r.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(o),Xg.test(o)){let c;for(const l of r.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForOverrideIdentifier(o,l.value,l.source,c);c&&!wA(c.value)?(r.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(o,c,n)):(this.configurationDefaultsOverrides.delete(o),delete this.configurationProperties[o],delete this.defaultLanguageConfigurationOverridesNode.properties[o])}else{let c;for(const d of r.configurationDefaultOverrides)c=this.mergeDefaultConfigurationsForConfigurationProperty(o,d.value,d.source,c);r.configurationDefaultOverrideValue=c;const l=this.configurationProperties[o];l&&(this.updatePropertyDefaultValue(o,l),this.updateSchema(o,l))}t.add(o)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,t,i){const n={type:"object",default:t.value,description:g(473,"Configure settings to be overridden for the {0} language.",Qht(e)),$ref:mE,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const o=n?.value||{},r=n?.source??new Map;if(!(r instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const c=t[a];if(kn(c)&&(Ya(o[a])||kn(o[a]))){if(o[a]={...o[a]??{},...c},i)for(const d in c)r.set(`${a}.${d}`,i)}else o[a]=c,i?r.set(a,i):r.delete(a)}return{value:o,source:r}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const o=this.configurationProperties[e],r=n?.value??o?.defaultDefaultValue;let a=i;if(kn(t)&&(o!==void 0&&o.type==="object"||o===void 0&&(Ya(r)||kn(r)))){if(a=n?.source??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const l in t)i&&a.set(`${e}.${l}`,i);t={...kn(r)?r:{},...t}}return{value:t,source:a}}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(n=>{this.validateAndRegisterProperties(n,t,n.extensionInfo,n.restrictedProperties,void 0,i),this.configurationContributors.push(n),this.registerJSONConfiguration(n)})}doDeregisterConfigurations(e,t){const i=n=>{if(n.properties)for(const o in n.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,n.properties[o])}n.allOf?.forEach(o=>i(o))};for(const n of e){i(n);const o=this.configurationContributors.indexOf(n);o!==-1&&this.configurationContributors.splice(o,1)}}validateAndRegisterProperties(e,t=!0,i,n,o=at.WINDOW,r){o=ra(e.scope)?o:e.scope;const a=e.properties;if(a)for(const l in a){const d=a[l];if(t&&pKe(l,d)){delete a[l];continue}if(d.source=i,d.defaultDefaultValue=a[l].default,this.updatePropertyDefaultValue(l,d),Xg.test(l)?d.scope=void 0:(d.scope=ra(d.scope)?o:d.scope,d.restricted=ra(d.restricted)?!!n?.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,n,o,r)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){const e=new Map;for(const[t,i]of this.configurationDefaultsOverrides)i.configurationDefaultOverrideValue&&e.set(t,i.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){const t=i=>{const n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(Ag.properties[e]=t,t.scope){case at.APPLICATION:Y4.properties[e]=t;break;case at.MACHINE:YP.properties[e]=t;break;case at.MACHINE_OVERRIDABLE:rS.properties[e]=t;break;case at.WINDOW:aS.properties[e]=t;break;case at.RESOURCE:$v.properties[e]=t;break;case at.LANGUAGE_OVERRIDABLE:$v.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete Ag.properties[e],t.scope){case at.APPLICATION:delete Y4.properties[e];break;case at.MACHINE:delete YP.properties[e];break;case at.MACHINE_OVERRIDABLE:delete rS.properties[e];break;case at.WINDOW:delete aS.properties[e];break;case at.RESOURCE:case at.LANGUAGE_OVERRIDABLE:delete $v.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:g(474,"Configure editor settings to be overridden for a language."),errorMessage:g(475,"This setting does not support per-language configuration."),$ref:mE};this.updatePropertyDefaultValue(t,i),Ag.properties[t]=i,Y4.properties[t]=i,YP.properties[t]=i,rS.properties[t]=i,aS.properties[t]=i,$v.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:g(474,"Configure editor settings to be overridden for a language."),errorMessage:g(475,"This setting does not support per-language configuration."),$ref:mE};Ag.patternProperties[xE]=e,Y4.patternProperties[xE]=e,YP.patternProperties[xE]=e,rS.patternProperties[xE]=e,aS.patternProperties[xE]=e,$v.patternProperties[xE]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,o;i&&(!t.disallowConfigurationDefault||!i.source)&&(n=i.value,o=i.source),Ya(n)&&(n=t.defaultDefaultValue,o=void 0),Ya(n)&&(n=fKe(t.type)),t.default=n,t.defaultValueSource=o}}const uKe="\\[([^\\]]+)\\]",qFe=new RegExp(uKe,"g"),xE=`^(${uKe})+$`,Xg=new RegExp(xE);function T8(s){const e=[];if(Xg.test(s)){let t=qFe.exec(s);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=qFe.exec(s)}}return ja(e)}function gKe(s){return s.reduce((e,t)=>`${e}[${t}]`,"")}function fKe(s){switch(Array.isArray(s)?s[0]:s){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const XV=new eut;Qe.add(Nn.Configuration,XV);function pKe(s,e){return s.trim()?Xg.test(s)?g(477,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):XV.getConfigurationProperties()[s]!==void 0?g(478,"Cannot register '{0}'. This property is already registered.",s):e.policy?.name&&XV.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(479,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",s,e.policy?.name,XV.getPolicyConfigurations().get(e.policy?.name)):null:g(476,"Cannot register an empty property")}function tut(){const s=[],e=XV.getConfigurationProperties();for(const t of Object.keys(e))s.push([t,e[t].scope]);return s.push(["launch",at.RESOURCE]),s.push(["task",at.RESOURCE]),s}function mKe(s){const e={};for(const t of s){const i=t.properties;if(kn(i))for(const n in i)e[n]=i[n];t.allOf&&Object.assign(e,mKe(t.allOf))}return e}function iut(s){switch(s){case"application":return at.APPLICATION;case"machine":return at.MACHINE;case"resource":return at.RESOURCE;case"machine-overridable":return at.MACHINE_OVERRIDABLE;case"language-overridable":return at.LANGUAGE_OVERRIDABLE;default:return at.WINDOW}}const nut={ModesRegistry:"editor.modesRegistry"};class sut{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 rut(this,a,c),closing:c}}),o=new Aj(a=>{const c=new Set,l=new Set;return{info:new aut(this,a,c,l),opening:c,openingColorized:l}});for(const[a,c]of i){const l=n.get(a),d=o.get(c);l.closing.add(d.info),d.opening.add(l.info)}const r=t.colorizedBracketPairs?QFe(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,c]of r){const l=n.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([...n.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 X7(t,e)}}function QFe(s){return s.filter(([e,t])=>e!==""&&t!=="")}class vKe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class rut extends vKe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class aut extends vKe{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,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 Ide{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Vs=ae("languageConfigurationService");let vpe=class extends V{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new hut),this.onDidChangeEmitter=this._register(new I),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(bpe));this._register(this.configurationService.onDidChangeConfiguration(n=>{const o=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,c])=>c.some(l=>i.has(l))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new Ide(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new Ide(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new Ide(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=cut(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};vpe=D([_(0,Te),_(1,xi)],vpe);function cut(s,e,t,i){let n=e.getLanguageConfiguration(s);if(!n){if(!i.isRegisteredLanguageId(s))return new DO(s,{});n=new DO(s,{})}const o=lut(n.languageId,t),r=wKe([n.underlyingConfig,o]);return new DO(n.languageId,r)}const bpe={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function lut(s,e){const t=e.getValue(bpe.brackets,{overrideIdentifier:s}),i=e.getValue(bpe.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:jFe(t),colorizedBracketPairs:jFe(i)}}function jFe(s){if(Array.isArray(s))return s.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function bKe(s,e,t){const i=s.getLineContent(e);let n=ho(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class dut{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new YFe(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ee(()=>{for(let n=0;ne.configuration)))}}function wKe(s){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 s)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 YFe{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 JFe{constructor(e){this.languageId=e}}class hut extends V{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._register(this.register(Ca,{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 n=this._entries.get(e);n||(n=new dut(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new JFe(e)),Ee(()=>{o.dispose(),this._onDidChange.fire(new JFe(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}}class DO{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 jP(this.underlyingConfig):null,this.comments=DO._handleComments(this.underlyingConfig),this.characterPair=new gpe(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||O1e,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Vht(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new out(e,this.underlyingConfig)}getWordDefinition(){return M7(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Pht(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Uht(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new uht(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[n,o]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=o}return i}}ce(Vs,vpe,qt.Delayed);class _E{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class XFe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new _E(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Un.MAX_SAFE_SMALL_INTEGER,this.m_modifiedStart=Un.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 Ww{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,r]=Ww._getElements(e),[a,c,l]=Ww._getElements(t);this._hasStrings=r&&l,this._originalStringElements=n,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(Ww._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,o=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let h;return i<=n?(eP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),h=[new _E(e,0,i,n-i+1)]):e<=t?(eP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[new _E(e,t-e+1,i,0)]):(eP.Assert(e===t+1,"originalStart should only be one more than originalEnd"),eP.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),h=[]),h}const r=[0],a=[0],c=this.ComputeRecursionPoint(e,t,i,n,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 _E(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:u=this.ComputeDiffRecursive(l+1,t,d+1,n,o),this.ConcatenateChanges(h,u)}return[new _E(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){let y=null,C=null,A=new ZFe,L=t,k=i,P=f[0]-v[0]-n,R=Un.MIN_SAFE_SMALL_INTEGER,z=this.m_forwardHistory.length-1;do{const G=P+e;G===L||G=0&&(l=this.m_forwardHistory[z],e=l[0],L=1,k=l.length-1)}while(--z>=-1);if(y=A.getReverseChanges(),w[0]){let G=f[0]+1,j=v[0]+1;if(y!==null&&y.length>0){const K=y[y.length-1];G=Math.max(G,K.getOriginalEnd()),j=Math.max(j,K.getModifiedEnd())}C=[new _E(G,u-G+1,j,m-j+1)]}else{A=new ZFe,L=r,k=a,P=f[0]-v[0]-c,R=Un.MAX_SAFE_SMALL_INTEGER,z=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const G=P+o;G===L||G=d[G+1]?(h=d[G+1]-1,p=h-P-c,h>R&&A.MarkNextChange(),R=h+1,A.AddOriginalElement(h+1,p+1),P=G+1-o):(h=d[G-1],p=h-P-c,h>R&&A.MarkNextChange(),R=h,A.AddModifiedElement(h+1,p+1),P=G-1-o),z>=0&&(d=this.m_reverseHistory[z],o=d[0],L=1,k=d.length-1)}while(--z>=-1);C=A.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,n,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+(n-i),m=p+1,v=new Int32Array(m),b=new Int32Array(m),w=n-i,y=t-e,C=e-i,A=t-n,k=(y-w)%2===0;v[w]=e,b[y]=t,a[0]=!1;for(let P=1;P<=p/2+1;P++){let R=0,z=0;d=this.ClipDiagonalBound(w-P,P,w,m),h=this.ClipDiagonalBound(w+P,P,w,m);for(let j=d;j<=h;j+=2){j===d||jR+z&&(R=c,z=l),!k&&Math.abs(j-y)<=P-1&&c>=b[j])return o[0]=c,r[0]=l,K<=b[j]&&AC.MaxDifferencesHistory>0&&P<=AC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):null}const G=(R-e+(z-i)-P)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(R,G))return a[0]=!0,o[0]=R,r[0]=z,G>0&&AC.MaxDifferencesHistory>0&&P<=AC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):(e++,i++,[new _E(e,t-e+1,i,n-i+1)]);u=this.ClipDiagonalBound(y-P,P,y,m),f=this.ClipDiagonalBound(y+P,P,y,m);for(let j=u;j<=f;j+=2){j===u||j=b[j+1]?c=b[j+1]-1:c=b[j-1],l=c-(j-y)-A;const K=c;for(;c>e&&l>i&&this.ElementsAreEqual(c,l);)c--,l--;if(b[j]=c,k&&Math.abs(j-w)<=P&&c<=v[j])return o[0]=c,r[0]=l,K>=v[j]&&AC.MaxDifferencesHistory>0&&P<=AC.MaxDifferencesHistory+1?this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,r,k,a):null}if(P<=AC.MaxDifferencesHistory){let j=new Int32Array(h-d+2);j[0]=w-d+1,tP.Copy2(v,d,j,1,h-d+1),this.m_forwardHistory.push(j),j=new Int32Array(f-u+2),j[0]=y-u+1,tP.Copy2(b,u,j,1,f-u+1),this.m_reverseHistory.push(j)}}return this.WALKTRACE(w,d,h,C,y,u,f,A,v,b,c,t,o,l,n,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 n=0,o=0;if(t>0){const h=e[t-1];n=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 n=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,n){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?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 n=new Array(e.length+t.length-1);return tP.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],tP.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return tP.Copy(e,0,n,0,e.length),tP.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(eP.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),eP.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 n=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 _E(n,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=jN(e),t=jN(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(n.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=jN(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,n=0,o=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],r=o-this.values[n],e=o)t=n+1;else break;return new yKe(n,e-r)}}class fut{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 yKe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=T7(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]=n+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 ZV;(function(s){s[s.False=0]="False",s[s.True=1]="True"})(ZV||(ZV={}));class qj{constructor(){this._actual=new mU(ZV.False)}add(e){this._actual.set(e,ZV.True)}has(e){return this._actual.get(e)===ZV.True}clear(){return this._actual.clear()}}var Ri;(function(s){s[s.Invalid=0]="Invalid",s[s.Start=1]="Start",s[s.H=2]="H",s[s.HT=3]="HT",s[s.HTT=4]="HTT",s[s.HTTP=5]="HTTP",s[s.F=6]="F",s[s.FI=7]="FI",s[s.FIL=8]="FIL",s[s.BeforeColon=9]="BeforeColon",s[s.AfterColon=10]="AfterColon",s[s.AlmostThere=11]="AlmostThere",s[s.End=12]="End",s[s.Accept=13]="Accept",s[s.LastKnownState=14]="LastKnownState"})(Ri||(Ri={}));class put{constructor(e,t,i){const n=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 n=new put(i,t,Ri.Invalid);for(let o=0,r=e.length;o=this._maxCharCode?Ri.Invalid:this._states.get(e,t)}}let Tde=null;function mut(){return Tde===null&&(Tde=new SKe([[Ri.Start,B.h,Ri.H],[Ri.Start,B.H,Ri.H],[Ri.Start,B.f,Ri.F],[Ri.Start,B.F,Ri.F],[Ri.H,B.t,Ri.HT],[Ri.H,B.T,Ri.HT],[Ri.HT,B.t,Ri.HTT],[Ri.HT,B.T,Ri.HTT],[Ri.HTT,B.p,Ri.HTTP],[Ri.HTT,B.P,Ri.HTTP],[Ri.HTTP,B.s,Ri.BeforeColon],[Ri.HTTP,B.S,Ri.BeforeColon],[Ri.HTTP,B.Colon,Ri.AfterColon],[Ri.F,B.i,Ri.FI],[Ri.F,B.I,Ri.FI],[Ri.FI,B.l,Ri.FIL],[Ri.FI,B.L,Ri.FIL],[Ri.FIL,B.e,Ri.BeforeColon],[Ri.FIL,B.E,Ri.BeforeColon],[Ri.BeforeColon,B.Colon,Ri.AfterColon],[Ri.AfterColon,B.Slash,Ri.AlmostThere],[Ri.AlmostThere,B.Slash,Ri.End]])),Tde}var xa;(function(s){s[s.None=0]="None",s[s.ForceTermination=1]="ForceTermination",s[s.CannotEndIn=2]="CannotEndIn"})(xa||(xa={}));let t4=null;function _ut(){if(t4===null){t4=new mU(xa.None);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),c=t.charCodeAt(r);(a===B.OpenParen&&c===B.CloseParen||a===B.OpenSquareBracket&&c===B.CloseSquareBracket||a===B.OpenCurlyBrace&&c===B.CloseCurlyBrace)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=mut()){const i=_ut(),n=[];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=Ri.Start,f=!1,p=!1,m=!1,v=!1;for(;l=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}};Wne.INSTANCE=new Wne;let wpe=Wne;var zr;(function(s){s[s.Regular=0]="Regular",s[s.Whitespace=1]="Whitespace",s[s.WordSeparator=2]="WordSeparator"})(zr||(zr={}));class but extends mU{constructor(e,t){super(zr.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,n=e.length;it)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=B6e(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 yut(t,this.wordSeparators?hm(this.wordSeparators,[]):null,i?this.searchString:null)}}function AKe(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e=t)break;const n=s.charCodeAt(e);if(n===B.n||n===B.r||n===B.W)return!0}}return!1}function M0(s,e,t){if(!t)return new M8(s,null);const i=[];for(let n=0,o=e.length;n>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class xG{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new JP(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,c=0;n?(c=n.findLineFeedCountBeforeOffset(o),a=t+o+c):a=t+o;let l;if(n){const f=n.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 F(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,go.LF),c=e.getEOL()===`\r +`?new tOe(a):null,l=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(l[d++]=M0(this._getMultilineMatchRange(e,r,a,c,h.index,h[0]),h,n),d>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,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,n,o),r}const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let l=t.startLineNumber+1;l=c))return o;return o}const d=new JP(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[o++]=M0(new F(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),o>=c))return o;while(h);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new JP(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new oe(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),c=e.getValueInRange(new F(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),go.LF),l=e.getEOL()===`\r +`?new tOe(c):null;i.reset(t.column-1);const d=i.next(c);return d?M0(this._getMultilineMatchRange(e,r,c,l,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new oe(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),c=this._findFirstMatchInLine(i,a,r,t.column,n);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,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?M0(new F(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new JP(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new F(1,1,t.lineNumber,t.column),i,n,10*Sut);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,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),c=this._findLastMatchInLine(i,a,r,n);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,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=M0(new F(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function Aut(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==zr.Regular||o===B.CarriageReturn||o===B.LineFeed)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==zr.Regular)return!0}return!1}function Eut(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==zr.Regular||o===B.CarriageReturn||o===B.LineFeed)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==zr.Regular)return!0}return!1}function rTe(s,e,t,i,n){return Aut(s,e,t,i,n)&&Eut(s,e,t,i,n)}class JP{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 n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){xj(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||rTe(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class aTe{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new iOe(t),a=r.getCandidateCodePoints();let c;a==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${xut(Array.from(a))}`,"g");const l=new JP(null,c),d=[];let h=!1,u,f=0,p=0,m=0;e:for(let v=n,b=o;v<=b;v++){const w=e.getLineContent(v),y=w.length;l.reset(0);do if(u=l.next(w),u){let C=u.index,A=u.index+u[0].length;if(C>0){const R=w.charCodeAt(C-1);Pc(R)&&C--}if(A+1=1e3){h=!0;break e}d.push(new F(v,C+1,v,A+1))}}while(u)}return{ranges:d,hasMore:h,ambiguousCharacterCount:f,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new iOe(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case Iu.None:return null;case Iu.Invisible:return{kind:v_.Invisible};case Iu.Ambiguous:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=d8.getLocales().filter(c=>!d8.getInstance(new Set([...t.allowedLocales,c])).isAmbiguous(o));return{kind:v_.Ambiguous,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case Iu.NonBasicASCII:return{kind:v_.NonBasicAscii}}}}function xut(s,e){return`[${Th(s.map(i=>String.fromCodePoint(i)).join(""))}]`}var v_;(function(s){s[s.Ambiguous=0]="Ambiguous",s[s.Invisible=1]="Invisible",s[s.NonBasicAscii=2]="NonBasicAscii"})(v_||(v_={}));class iOe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=d8.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of hT.codePoints)nOe(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 Iu.None;if(this.options.nonBasicASCII)return Iu.NonBasicASCII;let n=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),c=F7(r);n=n||c,!c&&!this.ambiguousCharacters.isAmbiguous(a)&&!hT.isInvisibleCharacter(a)&&(o=!0)}return!n&&o?Iu.None:this.options.invisibleCharacters&&!nOe(e)&&hT.isInvisibleCharacter(i)?Iu.Invisible:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?Iu.Ambiguous:Iu.None}}function nOe(s){return s===" "||s===` +`||s===" "}var Iu;(function(s){s[s.None=0]="None",s[s.NonBasicASCII=1]="NonBasicASCII",s[s.Invisible=2]="Invisible",s[s.Ambiguous=3]="Ambiguous"})(Iu||(Iu={}));class bq{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Fre{constructor(e,t){this.lineRangeMapping=e,this.changes=t}flip(){return new Fre(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}}class mi{static addRange(e,t){let i=0;for(;it))return new mi(e,t)}static ofLength(e){return new mi(0,e)}static ofStartAndLength(e,t){return new mi(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Ni(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new mi(this.start+e,this.endExclusive+e)}deltaStart(e){return new mi(this.start+e,this.endExclusive)}deltaEnd(e){return new mi(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 Ni(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Ni(`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 pi=class yf{static fromRange(e){return new yf(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new yf(e.startLineNumber,e.endLineNumber+1)}static subtract(e,t){return t?e.startLineNumbert)throw new Ni(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&en.endLineNumberExclusive>=e.startLineNumber),i=p2(this._normalizedRanges,n=>n.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=f2(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=f2(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,n=0,o=null;for(;i=r.startLineNumber?o=new pi(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new Kp(t)}subtractFrom(e){const t=m2(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=p2(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Kp([e]);const n=[];let o=e.startLineNumber;for(let r=t;ro&&n.push(new pi(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e)))}}const Ep=class Ep{static lengthDiffNonNegative(e,t){return t.isLessThan(e)?Ep.zero:e.lineCount===t.lineCount?new Ep(0,t.columnCount-e.columnCount):new Ep(t.lineCount-e.lineCount,t.columnCount)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new Ep(0,t.column-e.column):new Ep(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return Ep.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const n of e)n===` +`?(t++,i=0):i++;return new Ep(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 Ep(this.lineCount,this.columnCount+e.columnCount):new Ep(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new F(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new F(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new F(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}`}};Ep.zero=new Ep(0,0);let Ju=Ep;class Dut{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;to<=e),i=t+1,n=e-this.lineStartOffsetByLineIdx[t]+1;return new oe(i,n)}getRange(e){return F.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return Ju.ofRange(this.getRange(e))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new Ju(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}let N2=class wq{static single(e,t){return new wq([new ru(e,t)])}constructor(e){this.edits=e,V_(()=>fU(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 ru(i.range.plusRange(t.range),i.text+t.text)}else t.isEmpty||e.push(t);return new wq(e)}mapPosition(e){let t=0,i=0,n=0;for(const o of this.edits){const r=o.range.getStartPosition(),a=o.range.getEndPosition();if(e.isBeforeOrEqual(r))break;const c=Ju.ofText(o.text);if(e.isBefore(a)){const l=new oe(r.lineNumber+t,r.column+(r.lineNumber+t===i?n:0)),d=c.addToPosition(l);return DG(l,d)}t+=c.lineCount-(o.range.endLineNumber-o.range.startLineNumber),c.lineCount===0?a.lineNumber!==r.lineNumber?n+=c.columnCount-(a.column-1):n+=c.columnCount-(a.column-r.column):n=c.columnCount,i=a.lineNumber+t}return new oe(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){function t(r){return r instanceof oe?r:r.getStartPosition()}function i(r){return r instanceof oe?r:r.getEndPosition()}const n=t(this.mapPosition(e.getStartPosition())),o=i(this.mapPosition(e.getEndPosition()));return DG(n,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=DG(i,a);l.isEmpty()||(t+=e.getValueOfRange(l)),t+=o.text,i=c}const n=DG(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new kut(e);return this.apply(t)}inverse(e){const t=this.getNewRanges();return new wq(this.edits.map((i,n)=>new ru(t[n],e.getValueOfRange(i.range))))}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.edits){const r=Ju.ofText(o.text),a=oe.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),c=r.createRange(a);e.push(c),i=c.endLineNumber-o.range.endLineNumber,n=c.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}};class ru{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 DG(s,e){if(s.lineNumber===e.lineNumber&&s.column===Number.MAX_SAFE_INTEGER)return F.fromPositions(e,e);if(!s.isBeforeOrEqual(e))throw new Ni("start must be before end");return new F(s.lineNumber,s.column,e.lineNumber,e.column)}class EKe{get endPositionExclusive(){return this.length.addToPosition(new oe(1,1))}getValue(){return this.getValueOfRange(this.length.toRange())}}class kut extends EKe{constructor(e){super(),this.value=e,this._t=new Dut(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}let k_=class DP{static inverse(e,t,i){const n=[];let o=1,r=1;for(const c of e){const l=new DP(new pi(o,c.original.startLineNumber),new pi(r,c.modified.startLineNumber));l.modified.isEmpty||n.push(l),o=c.original.endLineNumberExclusive,r=c.modified.endLineNumberExclusive}const a=new DP(new pi(o,t+1),new pi(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new DP(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new DP(this.modified,this.original)}join(e){return new DP(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 Vp(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ni("not a valid diff");return new Vp(new F(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new F(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Vp(new F(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new F(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(sOe(this.original.endLineNumberExclusive,e)&&sOe(this.modified.endLineNumberExclusive,t))return new Vp(new F(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new F(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Vp(F.fromPositions(new oe(this.original.startLineNumber,1),iP(new oe(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(new oe(this.modified.startLineNumber,1),iP(new oe(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Vp(F.fromPositions(iP(new oe(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),iP(new oe(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),F.fromPositions(iP(new oe(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),iP(new oe(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new Ni}};function iP(s,e){if(s.lineNumber<1)return new oe(1,1);if(s.lineNumber>e.length)return new oe(e.length,e[e.length-1].length+1);const t=e[s.lineNumber-1];return s.column>t.length+1?new oe(s.lineNumber,t.length+1):s}function sOe(s,e){return s>=1&&s<=e.length}let $_=class yq extends k_{static fromRangeMappings(e){const t=pi.join(e.map(n=>pi.fromRangeInclusive(n.originalRange))),i=pi.join(e.map(n=>pi.fromRangeInclusive(n.modifiedRange)));return new yq(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new yq(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new yq(this.original,this.modified,[this.toRangeMapping()])}},Vp=class xKe{static assertSorted(e){for(let t=1;t${this.modifiedRange.toString()}}`}flip(){return new xKe(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new ru(this.originalRange,t)}};const Iut=3;class Tut{computeDiff(e,t,i){const o=new kKe(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 pi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):l=new pi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new pi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new pi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new $_(l,d,c.charChanges?.map(u=>new Vp(new F(u.originalStartLineNumber,u.originalStartColumn,u.originalEndLineNumber,u.originalEndColumn),new F(u.modifiedStartLineNumber,u.modifiedStartColumn,u.modifiedEndLineNumber,u.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===h.modified.startLineNumber||a.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new $_(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 V_(()=>fU(r,(c,l)=>l.original.startLineNumber-c.original.endLineNumberExclusive===l.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===B.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]===B.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]===B.LineFeed?1:this._columns[e]+1)}}class kO{constructor(e,t,i,n,o,r,a,c){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=c}static createFromDiffChange(e,t,i){const n=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 kO(n,o,r,a,c,l,d,h)}}function Rut(s){if(s.length<=1)return s;const e=[s[0]];let t=e[0];for(let i=1,n=s.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=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&p.getElements().length>0){let m=DKe(f,p,o,!0).changes;a&&(m=Rut(m)),u=[];for(let v=0,b=m.length;v1&&m>1;){const v=u.charCodeAt(p-2),b=f.charCodeAt(m-2);if(v!==b)break;p--,m--}(p>1||m>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,p,r+1,1,m)}{let p=Cpe(u,1),m=Cpe(f,1);const v=u.length+1,b=f.length+1;for(;p!0;const e=Date.now();return()=>Date.now()-e{i.push(Rc.fromOffsetPairs(n?n.getEndExclusives():CS.zero,o?o.getStarts():new CS(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new Rc(new mi(e.offset1,t.offset1),new mi(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new Ni("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Rc(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Rc(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Rc(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Rc(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Rc(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 Rc(t,i)}getStarts(){return new CS(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new CS(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const d1=class d1{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new d1(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};d1.zero=new d1(0,0),d1.max=new d1(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let CS=d1;const Hne=class Hne{isValid(){return!0}};Hne.instance=new Hne;let N8=Hne;class Mut{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Ni("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime!0,this.valid=!0}}class Rde{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 Spe(s){return s===B.Space||s===B.Tab}const Rz=class Rz{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 n=0;for(let o=e.startLineNumber-1;o0&&m>0&&r.get(p-1,m-1)===3&&(w+=a.get(p-1,m-1)),w+=n?n(p,m):1):w=-1;const y=Math.max(v,b,w);if(y===w){const C=p>0&&m>0?a.get(p-1,m-1):0;a.set(p,m,C+1),r.set(p,m,3)}else y===v?(a.set(p,m,0),r.set(p,m,1)):y===b&&(a.set(p,m,0),r.set(p,m,2));o.set(p,m,y)}const c=[];let l=e.length,d=t.length;function h(p,m){(p+1!==l||m+1!==d)&&c.push(new Rc(new mi(p+1,l),new mi(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 JS(c,!1)}}class IKe{compute(e,t,i=N8.instance){if(e.length===0||t.length===0)return JS.trivial(e,t);const n=e,o=t;function r(m,v){for(;mn.length||C>o.length)continue;const A=r(y,C);c.set(d,A);const L=y===b?l.get(d+1):l.get(d-1);if(l.set(d,A!==y?new aOe(L,y,C,A-y):L),c.get(d)===n.length&&c.get(d)-d===o.length)break e}}let h=l.get(d);const u=[];let f=n.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 Rc(new mi(m,f),new mi(v,p))),!h)break;f=h.x,p=h.y,h=h.prev}return u.reverse(),new JS(u,!1)}}class aOe{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class Put{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 Fut{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 Yj{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let o=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,o=o.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const l=o.trimStart();a=o.length-l.length,o=l.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const c=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,o.length):o.length;for(let l=0;lString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=lOe(e>0?this.elements[e-1]:-1),i=lOe(eo<=e),n=e-this.firstElementOffsetByLineIdx[i];return new oe(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(n===0&&t==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?F.fromPositions(i,i):F.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!Mde(this.elements[e]))return;let t=e;for(;t>0&&Mde(this.elements[t-1]);)t--;let i=e;for(;in<=e.start)??0,i=Got(this.firstElementOffsetByLineIdx,n=>e.endExclusive<=n)??this.elements.length;return new mi(t,i)}}function Mde(s){return s>=B.a&&s<=B.z||s>=B.A&&s<=B.Z||s>=B.Digit0&&s<=B.Digit9}var ac;(function(s){s[s.WordLower=0]="WordLower",s[s.WordUpper=1]="WordUpper",s[s.WordNumber=2]="WordNumber",s[s.End=3]="End",s[s.Other=4]="Other",s[s.Separator=5]="Separator",s[s.Space=6]="Space",s[s.LineBreakCR=7]="LineBreakCR",s[s.LineBreakLF=8]="LineBreakLF"})(ac||(ac={}));const Out={[ac.WordLower]:0,[ac.WordUpper]:0,[ac.WordNumber]:0,[ac.End]:10,[ac.Other]:2,[ac.Separator]:30,[ac.Space]:3,[ac.LineBreakCR]:10,[ac.LineBreakLF]:10};function cOe(s){return Out[s]}function lOe(s){return s===B.LineFeed?ac.LineBreakLF:s===B.CarriageReturn?ac.LineBreakCR:Spe(s)?ac.Space:s>=B.a&&s<=B.z?ac.WordLower:s>=B.A&&s<=B.Z?ac.WordUpper:s>=B.Digit0&&s<=B.Digit9?ac.WordNumber:s===-1?ac.End:s===B.Comma||s===B.Semicolon?ac.Separator:ac.Other}function But(s,e,t,i,n,o){let{moves:r,excludedChanges:a}=Hut(s,e,t,o);if(!o.isValid())return[];const c=s.filter(d=>!a.has(d)),l=Uut(c,i,n,e,t,o);return Bge(r,l),r=Vut(r),r=r.filter(d=>{const h=d.original.toOffsetRange().slice(e).map(f=>f.trim());return h.join(` +`).length>=15&&Wut(h,f=>f.length>=2)>=2}),r=zut(s,r),r}function Wut(s,e){let t=0;for(const i of s)e(i)&&t++;return t}function Hut(s,e,t,i){const n=[],o=s.filter(c=>c.modified.isEmpty&&c.original.length>=3).map(c=>new jj(c.original,e,c)),r=new Set(s.filter(c=>c.original.isEmpty&&c.modified.length>=3).map(c=>new jj(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),n.push(new k_(c.range,d.range)),a.add(c.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function Uut(s,e,t,i,n,o){const r=[],a=new L7;for(const u of s)for(let f=u.original.startLineNumber;fu.modified.startLineNumber,iu));for(const u of s){let f=[];for(let p=u.modified.startLineNumber;p{for(const C of f)if(C.originalLineRange.endLineNumberExclusive+1===w.endLineNumberExclusive&&C.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){C.originalLineRange=new pi(C.originalLineRange.startLineNumber,w.endLineNumberExclusive),C.modifiedLineRange=new pi(C.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),b.push(C);return}const y={modifiedLineRange:v,originalLineRange:w};c.push(y),b.push(y)}),f=b}if(!o.isValid())return[]}c.sort(p6e(Cc(u=>u.modifiedLineRange.length,iu)));const l=new Kp,d=new Kp;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 b of v.ranges){if(b.length<3)continue;const w=b,y=b.delta(-f);r.push(new k_(y,w)),l.addRange(w),d.addRange(y)}}r.sort(Cc(u=>u.original.startLineNumber,iu));const h=new mj(s);for(let u=0;uL.original.startLineNumber<=f.original.startLineNumber),m=f2(s,L=>L.modified.startLineNumber<=f.modified.startLineNumber),v=Math.max(f.original.startLineNumber-p.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),b=h.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||k>n.length||l.contains(k)||d.contains(L)||!dOe(i[L-1],n[k-1],o))break}C>0&&(d.addRange(new pi(f.original.startLineNumber-C,f.original.startLineNumber)),l.addRange(new pi(f.modified.startLineNumber-C,f.modified.startLineNumber)));let A;for(A=0;Ai.length||k>n.length||l.contains(k)||d.contains(L)||!dOe(i[L-1],n[k-1],o))break}A>0&&(d.addRange(new pi(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+A)),l.addRange(new pi(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+A))),(C>0||A>0)&&(r[u]=new k_(new pi(f.original.startLineNumber-C,f.original.endLineNumberExclusive+A),new pi(f.modified.startLineNumber-C,f.modified.endLineNumberExclusive+A)))}return r}function dOe(s,e,t){if(s.trim()===e.trim())return!0;if(s.length>300&&e.length>300)return!1;const n=new IKe().compute(new Yj([s],new F(1,1,1,s.length),!1),new Yj([e],new F(1,1,1,e.length),!1),t);let o=0;const r=Rc.invert(n.diffs,s.length);for(const d of r)d.seq1Range.forEach(h=>{Spe(s.charCodeAt(h))||o++});function a(d){let h=0;for(let u=0;ue.length?s:e);return o/c>.6&&c>10}function Vut(s){if(s.length===0)return s;s.sort(Cc(t=>t.original.startLineNumber,iu));const e=[s[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function zut(s,e){const t=new mj(s);return e=e.filter(i=>{const n=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(l))}n.push(a)}return i.length>0&&n.push(i[i.length-1]),n}function $ut(s,e,t){if(!s.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&s.seq2Range.start-r>=n.start&&t.isStronglyEqual(s.seq2Range.start-r,s.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;s.seq1Range.start+al&&(l=p,c=d)}return s.delta(c)}function Gut(s,e,t){const i=[];for(const n of t){const o=i[i.length-1];if(!o){i.push(n);continue}n.seq1Range.start-o.seq1Range.endExclusive<=2||n.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new Rc(o.seq1Range.join(n.seq1Range),o.seq2Range.join(n.seq2Range)):i.push(n)}return i}function Kut(s,e,t){const i=Rc.invert(t,s.length),n=[];let o=new CS(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 w=s.findWordContaining(v.seq1Range.start),y=e.findWordContaining(v.seq2Range.start),C=new Rc(w,y),A=C.intersect(v);if(p+=A.seq1Range.length,m+=A.seq2Range.length,u=u.join(C),u.seq1Range.endExclusive>=v.seq1Range.endExclusive)i.shift();else break}p+m<(u.seq1Range.length+u.seq2Range.length)*2/3&&n.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 qut(t,n)}function qut(s,e){const t=[];for(;s.length>0||e.length>0;){const i=s[0],n=e[0];let o;i&&(!n||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 Qut(s,e,t){let i=t;if(i.length===0)return i;let n=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(n++<10&&o);return i}function jut(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const a=[i[0]];for(let c=1;c5||m.length>500)return!1;const b=s.getText(m).trim();if(b.length>20||b.split(/\r\n|\r|\n/).length>1)return!1;const w=s.countLinesIn(f.seq1Range),y=f.seq1Range.length,C=e.countLinesIn(f.seq2Range),A=f.seq2Range.length,L=s.countLinesIn(p.seq1Range),k=p.seq1Range.length,P=e.countLinesIn(p.seq2Range),R=p.seq2Range.length,z=2*40+50;function G(j){return Math.min(j,z)}return Math.pow(Math.pow(G(w*40+y),1.5)+Math.pow(G(C*40+A),1.5),1.5)+Math.pow(Math.pow(G(L*40+k),1.5)+Math.pow(G(P*40+R),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(n++<10&&o);const r=[];return Zot(i,(a,c,l)=>{let d=c;function h(b){return b.length>0&&b.trim().length<=3&&c.seq1Range.length+c.seq2Range.length>100}const u=s.extendToFullLines(c.seq1Range),f=s.getText(new mi(u.start,c.seq1Range.start));h(f)&&(d=d.deltaStart(-f.length));const p=s.getText(new mi(c.seq1Range.endExclusive,u.endExclusive));h(p)&&(d=d.deltaEnd(p.length));const m=Rc.fromOffsetPairs(a?a.getEndExclusives():CS.zero,l?l.getStarts():CS.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 gOe{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:fOe(this.lines[e-1]),i=e===this.lines.length?0:fOe(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 fOe(s){let e=0;for(;eA===L))return new bq([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new bq([new $_(new pi(1,e.length+1),new pi(1,t.length+1),[new Vp(new F(1,1,e.length,e[e.length-1].length+1),new F(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?N8.instance:new Mut(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(A){let L=r.get(A);return L===void 0&&(L=r.size,r.set(A,L)),L}const c=e.map(A=>a(A.trim())),l=t.map(A=>a(A.trim())),d=new gOe(c,e),h=new gOe(l,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(A,L)=>e[A]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let f=u.diffs,p=u.hitTimeout;f=Ape(d,h,f),f=Qut(d,h,f);const m=[],v=A=>{if(o)for(let L=0;LA.seq1Range.start-b===A.seq2Range.start-w);const L=A.seq1Range.start-b;v(L),b=A.seq1Range.endExclusive,w=A.seq2Range.endExclusive;const k=this.refineDiff(e,t,A,n,o);k.hitTimeout&&(p=!0);for(const P of k.mappings)m.push(P)}v(e.length-b);const y=pOe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,c,l,n,o)),V_(()=>{function A(k,P){if(k.lineNumber<1||k.lineNumber>P.length)return!1;const R=P[k.lineNumber-1];return!(k.column<1||k.column>R.length+1)}function L(k,P){return!(k.startLineNumber<1||k.startLineNumber>P.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>P.length+1)}for(const k of y){if(!k.innerChanges)return!1;for(const P of k.innerChanges)if(!(A(P.modifiedRange.getStartPosition(),t)&&A(P.modifiedRange.getEndPosition(),t)&&A(P.originalRange.getStartPosition(),e)&&A(P.originalRange.getEndPosition(),e)))return!1;if(!L(k.modified,t)||!L(k.original,e))return!1}return!0}),new bq(y,C,p)}computeMoves(e,t,i,n,o,r,a){return But(e,t,i,n,o,r).map(d=>{const h=this.refineDiff(t,i,new Rc(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=pOe(h.mappings,t,i,!0);return new Fre(d,u)})}refineDiff(e,t,i,n,o){const a=Jut(i).toRangeMapping2(e,t),c=new Yj(e,a.originalRange,o),l=new Yj(t,a.modifiedRange,o),d=c.length+l.length<500?this.dynamicProgrammingDiffing.compute(c,l,n):this.myersDiffingAlgorithm.compute(c,l,n);let h=d.diffs;return h=Ape(c,l,h),h=Kut(c,l,h),h=Gut(c,l,h),h=jut(c,l,h),{mappings:h.map(f=>new Vp(c.translateRange(f.seq1Range),l.translateRange(f.seq2Range))),hitTimeout:d.hitTimeout}}}function pOe(s,e,t,i=!1){const n=[];for(const o of S1e(s.map(r=>Yut(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];n.push(new $_(r.original.join(a.original),r.modified.join(a.modified),o.map(c=>c.innerChanges[0])))}return V_(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:fU(n,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[s.modifiedRange.startLineNumber-1].length&&s.originalRange.startColumn-1>=e[s.originalRange.startLineNumber-1].length&&s.originalRange.startLineNumber<=s.originalRange.endLineNumber+n&&s.modifiedRange.startLineNumber<=s.modifiedRange.endLineNumber+n&&(i=1);const o=new pi(s.originalRange.startLineNumber+i,s.originalRange.endLineNumber+1+n),r=new pi(s.modifiedRange.startLineNumber+i,s.modifiedRange.endLineNumber+1+n);return new $_(o,r,[s])}function Jut(s){return new k_(new pi(s.seq1Range.start+1,s.seq1Range.endExclusive+1),new pi(s.seq2Range.start+1,s.seq2Range.endExclusive+1))}const Nde={getLegacy:()=>new Tut,getDefault:()=>new TKe};function Xx(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class dn{constructor(e,t,i,n=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=Xx(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class c_{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Xx(Math.max(Math.min(1,t),0),3),this.l=Xx(Math.max(Math.min(1,i),0),3),this.a=Xx(Math.max(Math.min(1,n),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,n=e.b/255,o=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);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-n)/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:n,a:o}=e;let r,a,c;if(i===0)r=a=c=n;else{const l=n<.5?n*(1+i):n+i-n*i,d=2*n-l;r=c_._hue2rgb(d,l,t+1/3),a=c_._hue2rgb(d,l,t),c=c_._hue2rgb(d,l,t-1/3)}return new dn(Math.round(r*255),Math.round(a*255),Math.round(c*255),o)}}class hy{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Xx(Math.max(Math.min(1,t),0),3),this.v=Xx(Math.max(Math.min(1,i),0),3),this.a=Xx(Math.max(Math.min(1,n),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,n=e.b/255,o=Math.max(t,i,n),r=Math.min(t,i,n),a=o-r,c=o===0?0:a/o;let l;return a===0?l=0:o===t?l=((i-n)/a%6+6)%6:o===i?l=(n-t)/a+2:l=(t-i)/a+4,new hy(Math.round(l*60),c,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),c=n-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 dn(l,d,h,o)}}var _o;let me=(_o=class{static fromHex(e){return _o.Format.CSS.parseHex(e)||_o.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:c_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:hy.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof dn)this.rgba=e;else if(e instanceof c_)this._hsla=e,this.rgba=c_.toRGBA(e);else if(e instanceof hy)this._hsva=e,this.rgba=hy.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&dn.equals(this.rgba,e.rgba)&&c_.equals(this.hsla,e.hsla)&&hy.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=_o._relativeLuminanceForComponent(this.rgba.r),t=_o._relativeLuminanceForComponent(this.rgba.g),i=_o._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return Xx(n,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 t_o._flatten(n,i));return _o._flatten(this,t)}static _flatten(e,t){const i=1-e.rgba.a;return new _o(new dn(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=_o.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(n-o)/n,e.darken(i)}},_o.white=new _o(new dn(255,255,255,1)),_o.black=new _o(new dn(0,0,0,1)),_o.red=new _o(new dn(255,0,0,1)),_o.blue=new _o(new dn(0,0,255,1)),_o.green=new _o(new dn(0,255,0,1)),_o.cyan=new _o(new dn(0,255,255,1)),_o.lightgrey=new _o(new dn(211,211,211,1)),_o.transparent=new _o(new dn(0,0,0,0)),_o);(function(s){(function(e){(function(t){function i(f){return f.rgba.a===1?`rgb(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b})`:s.Format.CSS.formatRGBA(f)}t.formatRGB=i;function n(f){return`rgba(${f.rgba.r}, ${f.rgba.g}, ${f.rgba.b}, ${+f.rgba.a.toFixed(2)})`}t.formatRGBA=n;function o(f){return f.hsla.a===1?`hsl(${f.hsla.h}, ${(f.hsla.s*100).toFixed(2)}%, ${(f.hsla.l*100).toFixed(2)}%)`:s.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?s.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()?s.Format.CSS.formatHex(f):s.Format.CSS.formatRGBA(f)}t.format=d;function h(f){const p=f.length;if(p===0||f.charCodeAt(0)!==B.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)),b=16*u(f.charCodeAt(5))+u(f.charCodeAt(6));return new s(new dn(m,v,b,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)),b=16*u(f.charCodeAt(5))+u(f.charCodeAt(6)),w=16*u(f.charCodeAt(7))+u(f.charCodeAt(8));return new s(new dn(m,v,b,w/255))}if(p===4){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),b=u(f.charCodeAt(3));return new s(new dn(16*m+m,16*v+v,16*b+b))}if(p===5){const m=u(f.charCodeAt(1)),v=u(f.charCodeAt(2)),b=u(f.charCodeAt(3)),w=u(f.charCodeAt(4));return new s(new dn(16*m+m,16*v+v,16*b+b,(16*w+w)/255))}return null}t.parseHex=h;function u(f){switch(f){case B.Digit0:return 0;case B.Digit1:return 1;case B.Digit2:return 2;case B.Digit3:return 3;case B.Digit4:return 4;case B.Digit5:return 5;case B.Digit6:return 6;case B.Digit7:return 7;case B.Digit8:return 8;case B.Digit9:return 9;case B.a:return 10;case B.A:return 10;case B.b:return 11;case B.B:return 11;case B.c:return 12;case B.C:return 12;case B.d:return 13;case B.D:return 13;case B.e:return 14;case B.E:return 14;case B.f:return 15;case B.F:return 15}return 0}})(e.CSS||(e.CSS={}))})(s.Format||(s.Format={}))})(me||(me={}));function LKe(s){const e=[];for(const t of s){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function lTe(s,e,t,i){return{red:s/255,blue:t/255,green:e/255,alpha:i}}function i4(s,e){const t=e.index,i=e[0].length;if(!t)return;const n=s.positionAt(t);return{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:n.lineNumber,endColumn:n.column+i}}function Xut(s,e){if(!s)return;const t=me.Format.CSS.parseHex(e);if(t)return{range:s,color:lTe(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function mOe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),o=LKe(n);return{range:s,color:lTe(o[0],o[1],o[2],t?o[3]:1)}}function _Oe(s,e,t){if(!s||e.length!==1)return;const n=e[0].values(),o=LKe(n),r=new me(new c_(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:s,color:lTe(r.rgba.r,r.rgba.g,r.rgba.b,r.rgba.a)}}function n4(s,e){return typeof s=="string"?[...s.matchAll(e)]:s.findMatches(e)}function Zut(s){const e=[],i=n4(s,/\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 n of i){const o=n.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=mOe(i4(s,n),n4(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=mOe(i4(s,n),n4(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=_Oe(i4(s,n),n4(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=_Oe(i4(s,n),n4(a,l),!0)}else r==="#"&&(c=Xut(i4(s,n),r+a));c&&e.push(c)}return e}function egt(s){return!s||typeof s.getValue!="function"||typeof s.positionAt!="function"?[]:Zut(s)}const vOe=new RegExp("\\bMARK:\\s*(.*)$","d"),tgt=/^-+|-+$/g;function igt(s,e){let t=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const i=ngt(s,e);t=t.concat(i)}if(e.findMarkSectionHeaders){const i=sgt(s);t=t.concat(i)}return t}function ngt(s,e){const t=[],i=s.getLineCount();for(let n=1;n<=i;n++){const o=s.getLineContent(n),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:n,startColumn:r[0].length+1,endLineNumber:n,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 sgt(s){const e=[],t=s.getLineCount();for(let i=1;i<=t;i++){const n=s.getLineContent(i);ogt(n,i,e)}return e}function ogt(s,e,t){vOe.lastIndex=0;const i=vOe.exec(s);if(i){const n=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:n,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(s){s=s.trim();const e=s.startsWith("-");return s=s.replace(tgt,""),{text:s,hasSeparatorLine:e}}class rgt extends CKe{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,n=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>o&&(i=o,n=!0)}return n?{lineNumber:t,column:i}:e}}const WE=class WE{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 rgt(N.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 n=this._getModel(e);return n?aTe.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?igt(i,t):[]}async computeDiff(e,t,i,n){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:WE.computeDiff(o,r,i,n)}static computeDiff(e,t,i,n){const o=n==="advanced"?Nde.getDefault():Nde.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(),n=t.getLineCount();if(i!==n)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 n=this._getModel(e),o=this._getModel(t);if(!n||!o)return null;const r=n.getLinesContent(),a=o.getLinesContent();return new kKe(r,a,{shouldComputeCharChanges:!1,shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:1e3}).computeDiff().changes}async computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((c,l)=>{if(c.range&&l.range)return F.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;cWE._diffLimit){o.push({range:c,text:l});continue}const u=uut(h,l,i),f=n.offsetAt(F.lift(c).getStartPosition());for(const p of u){const m=n.positionAt(f+p.originalStart),v=n.positionAt(f+p.originalStart+p.originalLength),b={text:l.substr(p.modifiedStart,p.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:v.lineNumber,endColumn:v.column}};n.getValueInRange(b.range)!==b.text&&o.push(b)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}computeHumanReadableDiff(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((a,c)=>{if(a.range&&c.range)return F.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(b,w){return new oe(b.lineNumber+w.lineNumber-1,w.lineNumber===1?b.column+w.column-1:w.column)},v=function(b,w){const y=[];for(let C=w.startLineNumber;C<=w.endLineNumber;C++){const A=b[C-1];C===w.startLineNumber&&C===w.endLineNumber?y.push(A.substring(w.startColumn-1,w.endColumn-1)):C===w.startLineNumber?y.push(A.substring(w.startColumn-1)):C===w.endLineNumber?y.push(A.substring(0,w.endColumn-1)):y.push(A)}return y};if(typeof l=="number"&&(r=l),F.isEmpty(a)&&!c)continue;const d=n.getValueInRange(a);if(c=c.replace(/\r\n|\n|\r/g,n.eol),d===c)continue;if(Math.max(c.length,d.length)>WE._diffLimit){o.push({range:a,text:c});continue}const h=d.split(/\r\n|\n|\r/),u=c.split(/\r\n|\n|\r/),f=Nde.getDefault().computeDiff(h,u,i),p=F.lift(a).getStartPosition();for(const b of f.changes)if(b.innerChanges)for(const w of b.innerChanges)o.push({range:F.fromPositions(m(p,w.originalRange.getStartPosition()),m(p,w.originalRange.getEndPosition())),text:v(u,w.modifiedRange).join(n.eol)});else throw new Ni("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?vut(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?egt(t):null}async textualSuggest(e,t,i,n){const o=new js,r=new RegExp(i,n),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>WE._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,n),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(D1e(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)}}};WE._diffLimit=1e5,WE._suggestionsLimit=1e4;let Jj=WE;typeof importScripts=="function"&&(globalThis.monaco=lGe());const Ec=ae("textResourceConfigurationService"),dTe=ae("textResourcePropertiesService"),it=ae("ILanguageFeaturesService"),bOe=60*1e3,wOe=5*60*1e3;function ow(s,e){const t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let Epe=class extends V{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new cgt(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>ow(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 agt(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return ow(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(n=>n.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,n){const o=await this._workerManager.withWorker().then(c=>c.computeDiff(e,t,i,n));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(c=>new Fre(new k_(new pi(c[0],c[1]),new pi(c[2],c[3])),a(c[4])))};function a(c){return c.map(l=>new $_(new pi(l[0],l[1]),new pi(l[2],l[3]),l[4]?.map(d=>new Vp(new F(d[0],d[1],d[2],d[3]),new F(d[4],d[5],d[6],d[7])))))}}canComputeDirtyDiff(e,t){return ow(this._modelService,e)&&ow(this._modelService,t)}computeDirtyDiff(e,t,i){return this._workerManager.withWorker().then(n=>n.computeDirtyDiff(e,t,i))}computeMoreMinimalEdits(e,t,i=!1){if(eo(t)){if(!ow(this._modelService,e))return Promise.resolve(t);const n=js.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([o,Sr(1e3).then(()=>t)])}else return Promise.resolve(void 0)}computeHumanReadableDiff(e,t){if(eo(t)){if(!ow(this._modelService,e))return Promise.resolve(t);const i=js.create(),n=this._workerManager.withWorker().then(o=>o.computeHumanReadableDiff(e,t,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1})).catch(o=>(vt(o),this.computeMoreMinimalEdits(e,t,!0)));return n.finally(()=>this._logService.trace("FORMAT#computeHumanReadableDiff",e.toString(!0),i.elapsed())),n}else return Promise.resolve(void 0)}canNavigateValueSet(e){return ow(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return ow(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))}};Epe=D([_(0,gi),_(1,Ec),_(2,Ge),_(3,Vs),_(4,it)],Epe);class agt{constructor(e,t,i,n){this.languageConfigurationService=n,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 n=[];if(i.wordBasedSuggestions==="currentDocument")ow(this._modelService,e.uri)&&n.push(e.uri);else for(const h of this._modelService.getModels())ow(this._modelService,h.uri)&&(h===e?n.unshift(h.uri):(i.wordBasedSuggestions==="allDocuments"||h.getLanguageId()===e.getLanguageId())&&n.push(h.uri));if(n.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new F(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):F.fromPositions(t),c=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(n,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 cgt extends V{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Q7).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(wOe/2),si),this._register(this._modelService.onModelRemoved(n=>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>wOe&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new hTe(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class lgt extends V{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const n=new q7;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(bOe/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)bt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>bOe&&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 n=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(n.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(Ee(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],bt(t)}}class yOe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class Pde{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class hTe extends V{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new upe(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 aht(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new Pde(this)))}catch(e){hpe(e),this._worker=new yOe(new Jj(new Pde(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(hpe(e),this._worker=new yOe(new Jj(new Pde(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new lgt(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(Sy()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeDirtyDiff(e,t,i){return this._withSyncedResources([e,t]).then(n=>n.computeDirtyDiff(e.toString(),t.toString(),i))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeMoreMinimalEdits(e.toString(),t,i))}computeHumanReadableDiff(e,t,i){return this._withSyncedResources([e]).then(n=>n.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 n=await this._withSyncedResources(e),o=i.source,r=i.flags;return n.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.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(n=>{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 n.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 dgt(s,e,t){return new hgt(s,e,t)}class hgt extends hTe{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?D1e(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(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,n);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}var mt;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(mt||(mt={}));function ugt(s){return s&&typeof s.id=="string"}const _U={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var oc;(function(s){s.CompositionStart="compositionStart",s.CompositionEnd="compositionEnd",s.Type="type",s.ReplacePreviousChar="replacePreviousChar",s.CompositionType="compositionType",s.Paste="paste",s.Cut="cut"})(oc||(oc={}));const P8=new class{clone(){return this}equals(s){return this===s}};function MKe(s,e){return new $1e([new f8(0,"",s)],e)}function uTe(s,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(s<>>0,new Dre(t,e===null?P8:e)}const WC=class WC{static createEmpty(e,t){const i=WC.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new WC(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const o=new Array;for(const{text:r,metadata:a}of e)o.push(i+r.length,a),i+=r.length,n+=r;return new WC(new Uint32Array(o),n,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 WC?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let r=n;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=zv.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return zv.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return zv.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return zv.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return zv.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return zv.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return WC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new gTe(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(n=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const o=new Array;let r=0;for(;;){const a=tr){n+=this._text.substring(r,c.offset);const l=this._tokens[(t<<1)+1];o.push(n.length,l),r=c.offset}n+=c.text,o.push(n.length,c.tokenMetadata),i++}else break}return new WC(new Uint32Array(o),n,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 hd=WC;class gTe{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,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 gTe?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),n=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return ithis._endOffset&&(o=o.substring(0,o.length-(n-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&&is(e.data,t.data)}static equalsArr(e,t){return is(e,t,F8.equals)}}class Zh{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,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,n=t.length;if(i!==n)return!1;for(let o=0;o=o||(a[c++]=new Zh(Math.max(1,l.startColumn-n+1),Math.min(r+1,l.endColumn-n+1),l.className,l.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const o=[];let r=0;for(let a=0,c=e.length;at||d.isEmpty()&&(l.type===Ja.Regular||l.type===Ja.RegularAffectingLetterSpacing))continue;const h=d.startLineNumber===t?d.startColumn:i,u=d.endLineNumber===t?d.endColumn:n;o[r++]=new Zh(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=Zh._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class mgt{static normalize(e,t){if(t.length===0)return[];const i=[],n=new Xj;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(l-2);Pc(m)&&l--}if(d>1){const m=e.charCodeAt(d-2);Pc(m)&&d--}const f=l-1,p=d-2;o=n.consumeLowerThan(f,o,i),n.count===0&&(o=f),n.insert(p,h,u)}return n.consumeLowerThan(Un.MAX_SAFE_SMALL_INTEGER,o,i),i}}var jf;(function(s){s[s.None=0]="None",s[s.Boundary=1]="Boundary",s[s.Selection=2]="Selection",s[s.Trailing=3]="Trailing",s[s.All=4]="All"})(jf||(jf={}));let PKe=class{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}};class pI{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=c,this.lineDecorations=l.sort(Zh.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=u,this.stopRenderingLineAfter=m,this.renderWhitespace=v==="all"?jf.All:v==="boundary"?jf.Boundary:v==="selection"?jf.Selection:v==="trailing"?jf.Trailing:jf.None,this.renderControlCharacters=b,this.fontLigatures=w,this.selectionsOnLine=y&&y.sort((L,k)=>L.startOffset>>rw.PART_INDEX_OFFSET}static getCharIndex(e){return(e&rw.CHAR_INDEX_MASK)>>>rw.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,n){const o=(t<>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}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=e_.getPartIndex(t),n=e_.getCharIndex(t);return new FKe(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const n=(e<>>0;let o=0,r=this.length-1;for(;o+1>>1,v=this._data[m];if(v===n)return m;v>n?r=m:o=m}if(o===r)return o;const a=this._data[o],c=this._data[r];if(a===n)return o;if(c===n)return r;const l=e_.getPartIndex(a),d=e_.getCharIndex(a),h=e_.getPartIndex(c);let u;l!==h?u=t:u=e_.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,n=Gu.None;for(const r of s.lineDecorations)(r.type===Ja.Before||r.type===Ja.After)&&(e.appendString(''),r.type===Ja.Before&&(n|=Gu.Before,t++),r.type===Ja.After&&(n|=Gu.After,i++));e.appendString("");const o=new e_(1,t+i);return o.setColumnInfo(1,t,0,0),new xpe(o,!1,n)}return e.appendString(""),new xpe(new e_(0,0),!1,Gu.None)}return Egt(bgt(s),e)}class _gt{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Ore(s){const e=new pU(1e4),t=Z7(s,e);return new _gt(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class vgt{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,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 bgt(s){const e=s.lineContent;let t,i,n;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter0){for(let a=0,c=s.lineDecorations.length;a0&&(o[r++]=new rl(i,"",0,!1));let a=i;for(let c=0,l=t.getCount();c=n){const f=e?y2(s.substring(a,n)):!1;o[r++]=new rl(n,h,0,f);break}const u=e?y2(s.substring(a,d)):!1;o[r++]=new rl(d,h,0,u),a=d}return o}var N0;(function(s){s[s.LongToken=50]="LongToken"})(N0||(N0={}));function ygt(s,e,t){let i=0;const n=[];let o=0;if(t)for(let r=0,a=e.length;r=N0.LongToken&&(n[o++]=new rl(f+1,d,h,u),p=f+1,f=-1);p!==l&&(n[o++]=new rl(l,d,h,u))}else n[o++]=c;i=l}else for(let r=0,a=e.length;rN0.LongToken){const h=c.type,u=c.metadata,f=c.containsRTL,p=Math.ceil(d/N0.LongToken);for(let m=1;m=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function Cgt(s,e){const t=[];let i=new rl(0,"",0,!1),n=0;for(const o of e){const r=o.endIndex;for(;ni.endIndex&&(i=new rl(n,o.type,o.metadata,o.containsRTL),t.push(i)),i=new rl(n+1,"mtkcontrol",o.metadata,!1),t.push(i))}n>i.endIndex&&(i=new rl(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Sgt(s,e,t,i){const n=s.continuesWithWrappedLine,o=s.fauxIndentLength,r=s.tabSize,a=s.startVisibleColumn,c=s.useMonospaceOptimizations,l=s.selectionsOnLine,d=s.renderWhitespace===jf.Boundary,h=s.renderWhitespace===jf.Trailing,u=s.renderSpaceWidth!==s.spaceWidth,f=[];let p=0,m=0,v=i[m].type,b=i[m].containsRTL,w=i[m].endIndex;const y=i.length;let C=!1,A=xh(e),L;A===-1?(C=!0,A=t,L=t):L=D_(e);let k=!1,P=0,R=l&&l[P],z=a%r;for(let j=o;j=R.endOffset&&(P++,R=l&&l[P]);let ie;if(jL)ie=!0;else if(K===B.Tab)ie=!0;else if(K===B.Space)if(d)if(k)ie=!0;else{const ge=j+1j),ie&&h&&(ie=C||j>L),ie&&b&&j>=A&&j<=L&&(ie=!1),k){if(!ie||!c&&z>=r){if(u){const ge=p>0?f[p-1].endIndex:o;for(let xe=ge+1;xe<=j;xe++)f[p++]=new rl(xe,"mtkw",uy.IS_WHITESPACE,!1)}else f[p++]=new rl(j,"mtkw",uy.IS_WHITESPACE,!1);z=z%r}}else(j===w||ie&&j>o)&&(f[p++]=new rl(j,v,0,b),z=z%r);for(K===B.Tab?z=r:Ek(K)?z+=2:z++,k=ie;j===w&&(m++,m0?e.charCodeAt(t-1):B.Null,K=t>1?e.charCodeAt(t-2):B.Null;j===B.Space&&K!==B.Space&&K!==B.Tab||(G=!0)}else G=!0;if(G)if(u){const j=p>0?f[p-1].endIndex:o;for(let K=j+1;K<=t;K++)f[p++]=new rl(K,"mtkw",uy.IS_WHITESPACE,!1)}else f[p++]=new rl(t,"mtkw",uy.IS_WHITESPACE,!1);else f[p++]=new rl(t,v,0,b);return f}function Agt(s,e,t,i){i.sort(Zh.compare);const n=mgt.normalize(s,i),o=n.length;let r=0;const a=[];let c=0,l=0;for(let h=0,u=t.length;hl&&(l=w.startOffset,a[c++]=new rl(l,m,v,b)),w.endOffset+1<=p)l=w.endOffset+1,a[c++]=new rl(l,m+" "+w.className,v|w.metadata,b),r++;else{l=p,a[c++]=new rl(l,m+" "+w.className,v|w.metadata,b);break}}p>l&&(l=p,a[c++]=new rl(l,m,v,b))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let R=0,z=l.length;R=d&&(lt+=Ji)}}for(xe&&(e.appendString(' style="width:'),e.appendString(String(p*yt)),e.appendString('px"')),e.appendASCIICharCode(B.GreaterThan);C1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Ji=2;Ji<=xt;Ji++)e.appendCharCode(160)}else lt=2,xt=1,e.appendCharCode(m),e.appendCharCode(8204);L+=lt,k+=xt,C>=d&&(A+=xt)}}else for(e.appendASCIICharCode(B.GreaterThan);C=d&&(A+=lt)}Re?P++:P=0,C>=r&&!y&&G.isPseudoAfter()&&(y=!0,w.setColumnInfo(C+1,R,L,k)),e.appendString("")}return y||w.setColumnInfo(r+1,l.length-1,L,k),a&&(e.appendString(''),e.appendString(g(9364,"Show more ({0})",Dgt(c))),e.appendString("")),e.appendString(""),new xpe(w,f,n)}function xgt(s){return s.toString(16).toUpperCase().padStart(4,"0")}function Dgt(s){return s<1024?g(9365,"{0} chars",s):s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}var kgt=".monaco-aria-container{left:-999em;position:absolute}";ut(kgt,{});const AOe=2e4;let P0,Cq,Dpe,Sq,kpe;function Igt(s){P0=document.createElement("div"),P0.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"),P0.appendChild(i),i};Cq=e(),Dpe=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),P0.appendChild(i),i};Sq=t(),kpe=t(),s.appendChild(P0)}function Mr(s){P0&&(Cq.textContent!==s?(Ms(Dpe),Zj(Cq,s)):(Ms(Cq),Zj(Dpe,s)))}function Ch(s){P0&&(Sq.textContent!==s?(Ms(kpe),Zj(Sq,s)):(Ms(Sq),Zj(kpe,s)))}function Zj(s,e){Ms(s),e.length>AOe&&(e=e.substr(0,AOe)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const pTe=ae("markerDecorationsService");var dB;let eY=(dB=class{constructor(e,t){}dispose(){}},dB.ID="editor.contrib.markerDecorations",dB);eY=D([_(1,pTe)],eY);on(eY.ID,eY,ri.Eager);var Tgt='::-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;overflow-wrap:normal;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)}';ut(Tgt,{});class BKe extends V{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,n=!1;const o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{Tl(ct(this._referenceDomElement),()=>{n=!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,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}const HF=class HF{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=HF._read(e,this.key),i=o=>HF._read(e,o),n=(o,r)=>HF._write(e,o,r);this.migrate(t,i,n)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);e[o]=e[o]||{},this._write(e[o],t.substring(n+1),i);return}e[t]=i}};HF.items=[];let O8=HF;function Bb(s,e){O8.items.push(new O8(s,e))}function hf(s,e){Bb(s,(t,i,n)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){n(s,r);return}}})}function Lgt(s){O8.items.forEach(e=>e.apply(s))}hf("wordWrap",[[!0,"on"],[!1,"off"]]);hf("lineNumbers",[[!0,"on"],[!1,"off"]]);hf("cursorBlinking",[["visible","solid"]]);hf("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);hf("renderLineHighlight",[[!0,"line"],[!1,"none"]]);hf("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);hf("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);hf("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);hf("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);hf("autoIndent",[[!1,"advanced"],[!0,"full"]]);hf("matchBrackets",[[!0,"always"],[!1,"never"]]);hf("renderFinalNewline",[[!0,"on"],[!1,"off"]]);hf("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);hf("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);hf("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);Bb("autoClosingBrackets",(s,e,t)=>{s===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Bb("renderIndentGuides",(s,e,t)=>{typeof s<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!s))});Bb("highlightActiveIndentGuide",(s,e,t)=>{typeof s<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!s))});const Rgt={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"};Bb("suggest.filteredTypes",(s,e,t)=>{if(s&&typeof s=="object"){for(const i of Object.entries(Rgt))s[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});Bb("quickSuggestions",(s,e,t)=>{if(typeof s=="boolean"){const i=s?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Bb("experimental.stickyScroll.enabled",(s,e,t)=>{typeof s=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",s))});Bb("experimental.stickyScroll.maxLineCount",(s,e,t)=>{typeof s=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",s))});Bb("codeActionsOnSave",(s,e,t)=>{if(s&&typeof s=="object"){let i=!1;const n={};for(const o of Object.entries(s))typeof o[1]=="boolean"?(i=!0,n[o[0]]=o[1]?"explicit":"never"):n[o[0]]=o[1];i&&t("codeActionsOnSave",n)}});Bb("codeActionWidget.includeNearbyQuickfixes",(s,e,t)=>{typeof s=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",s))});Bb("lightbulb.enabled",(s,e,t)=>{typeof s=="boolean"&&t("lightbulb.enabled",s?void 0:"off")});class Mgt{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 Tk=new Mgt,mr=ae("accessibilityService");let Ipe=class extends V{constructor(e,t,i,n,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 j6e,this.isSimpleWidget=e,this.contextMenuId=t,this.isStandaloneEditor=i,this._containerObserver=this._register(new BKe(o,n.dimension)),this._targetWindowId=ct(o).vscodeWindowId,this._rawOptions=EOe(n),this._validatedOptions=cS.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(x.automaticLayout)&&this._containerObserver.startObserving(),this._register(Gp.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Tk.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(lpe.onDidChange(()=>this._recomputeOptions())),this._register(k8.getInstance(ct(o)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=cS.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=_x.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={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:Tk.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return cS.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:Pgt(this.isStandaloneEditor),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:fT||nf,pixelRatio:k8.getInstance(Bj(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?jl.Enabled:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return lpe.readFontInfo(Bj(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=EOe(e);cS.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=cS.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=Ngt(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())}};Ipe=D([_(5,mr)],Ipe);function Ngt(s){let e=0;for(;s;)s=Math.floor(s/10),e++;return e||1}function Pgt(s){let e="";return!zy&&!hGe&&(e+="no-user-select "),zy&&(e+="no-minimap-shadow ",e+="enable-user-select "),Qt&&(e+="mac "),s&&(e+="standalone "),e}class Fgt{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Ogt{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 cS{static validateOptions(e){const t=new Fgt;for(const i of qP){const n=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new Ogt;for(const n of qP)i._write(n.id,n.compute(t,i,e._read(n.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)?is(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!cS._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of qP){const r=!cS._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new Q6e(i):null}static applyUpdate(e,t){let i=!1;for(const n of qP)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function EOe(s){const e=xs(s);return Lgt(e),e}var vx;(function(s){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},n={...e};let o=0,r;(function(P){P[P.Before=0]="Before",P[P.InProgress=1]="InProgress",P[P.Finished=2]="Finished"})(r||(r={}));const a={keydown:r.Before,input:r.Before,render:r.Before};function c(){w(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),a.keydown=r.InProgress,queueMicrotask(l)}s.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,b()}s.onBeforeInput=d;function h(){a.input===r.Before&&d(),queueMicrotask(u)}s.onInput=h;function u(){a.input===r.InProgress&&(performance.mark("input/end"),a.input=r.Finished)}function f(){w()}s.onKeyUp=f;function p(){w()}s.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),b())}s.onRenderStart=m;function v(){a.render===r.InProgress&&(performance.mark("render/end"),a.render=r.Finished)}function b(){setTimeout(w)}function w(){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"),y("keydown",e),y("input",t),y("render",i),y("inputlatency",n),o++,C())}function y(P,R){const z=performance.getEntriesByName(P)[0].duration;R.total+=z,R.min=Math.min(R.min,z),R.max=Math.max(R.max,z)}function C(){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 A(){if(o===0)return;const P={keydown:L(e),input:L(t),render:L(i),total:L(n),sampleCount:o};return k(e),k(t),k(i),k(n),o=0,P}s.getAndClearMeasurements=A;function L(P){return{average:P.total/o,max:P.max,min:P.min}}function k(P){P.total=0,P.min=Number.MAX_VALUE,P.max=0}})(vx||(vx={}));var es;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(es||(es={}));var Fg;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(Fg||(Fg={}));var Rt;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Rt||(Rt={}));function Qr(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===_U.ICodeEditor:!1}function Zp(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===_U.IDiffEditor:!1}function P2(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function e6(s){return Qr(s)?s:Zp(s)?s.getModifiedEditor():P2(s)&&Qr(s.activeCodeEditor)?s.activeCodeEditor:null}function Bgt(s){return Qr(s)||Zp(s)?s:null}class vU{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,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ee(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=ct(e)}this._hooks.add(ue(r,ke.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(ue(r,ke.POINTER_UP,a=>this.stopMonitoring(!0)))}}function Bre(s){return`--vscode-${s.replace(/\./g,"-")}`}function ze(s){return`var(${Bre(s)})`}function Tpe(s,e){return`var(${Bre(s)}, ${e})`}var Mu;(function(s){s[s.Darken=0]="Darken",s[s.Lighten=1]="Lighten",s[s.Transparent=2]="Transparent",s[s.Opaque=3]="Opaque",s[s.OneOf=4]="OneOf",s[s.LessProminent=5]="LessProminent",s[s.IfDefinedThenElse=6]="IfDefinedThenElse"})(Mu||(Mu={}));function Wgt(s){return s!==null&&typeof s=="object"&&"light"in s&&"dark"in s}const mTe={ColorContribution:"base.contributions.colors"},Hgt="default";class Ugt{constructor(){this._onDidChangeSchema=new I,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}notifyThemeUpdate(e){for(const t of Object.keys(this.colorsById)){const i=e.getColor(t);i&&(this.colorSchema.properties[t].oneOf[0].defaultSnippets[0].body=`\${1:${i.toString()}}`)}this._onDidChangeSchema.fire()}registerColor(e,t,i,n=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),n&&(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=g(1694,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={oneOf:[a,{type:"string",const:Hgt,description:g(1695,"Use the default color.")}]},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?.defaults){const n=Wgt(i.defaults)?i.defaults[t.type]:i.defaults;return fv(n,t)}}getColorSchema(){return this.colorSchema}getColorReferenceSchema(){return this.colorReferenceSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return n!==o?n-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const Wre=new Ugt;Qe.add(mTe.ColorContribution,Wre);function W(s,e,t,i,n){return Wre.registerColor(s,e,t,i,n)}function Vgt(s,e){switch(s.op){case Mu.Darken:return fv(s.value,e)?.darken(s.factor);case Mu.Lighten:return fv(s.value,e)?.lighten(s.factor);case Mu.Transparent:return fv(s.value,e)?.transparent(s.factor);case Mu.Opaque:{const t=fv(s.background,e);return t?fv(s.value,e)?.makeOpaque(t):fv(s.value,e)}case Mu.OneOf:for(const t of s.values){const i=fv(t,e);if(i)return i}return;case Mu.IfDefinedThenElse:return fv(e.defines(s.if)?s.then:s.else,e);case Mu.LessProminent:{const t=fv(s.value,e);if(!t)return;const i=fv(s.background,e);return i?t.isDarkerThan(i)?me.getLighterColor(t,i,s.factor).transparent(s.transparency):me.getDarkerColor(t,i,s.factor).transparent(s.transparency):t.transparent(s.factor*s.transparency)}default:throw j7()}}function up(s,e){return{op:Mu.Darken,value:s,factor:e}}function I_(s,e){return{op:Mu.Lighten,value:s,factor:e}}function st(s,e){return{op:Mu.Transparent,value:s,factor:e}}function xOe(s,e){return{op:Mu.Opaque,value:s,background:e}}function B8(...s){return{op:Mu.OneOf,values:s}}function zgt(s,e,t){return{op:Mu.IfDefinedThenElse,if:s,then:e,else:t}}function DOe(s,e,t,i){return{op:Mu.LessProminent,value:s,background:e,factor:t,transparency:i}}function fv(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?me.fromHex(s):e.getColor(s);if(s instanceof me)return s;if(typeof s=="object")return Vgt(s,e)}}const WKe="vscode://schemas/workbench-colors",HKe=Qe.as(QA.JSONContribution);HKe.registerSchema(WKe,Wre.getColorSchema());const kOe=new cn(()=>HKe.notifySchemaChanged(WKe),200);Wre.onDidChangeSchema(()=>{kOe.isScheduled()||kOe.schedule()});const zi=W("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},g(1696,"Overall foreground color. This color is only used if not overridden by a component.")),IOe=W("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},g(1697,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),TOe=W("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},g(1698,"Overall foreground color for error messages. This color is only used if not overridden by a component."));W("descriptionForeground",{light:"#717171",dark:st(zi,.7),hcDark:st(zi,.7),hcLight:st(zi,.7)},g(1699,"Foreground color for description text providing additional information, for example for a label."));const tY=W("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},g(1700,"The default color for icons in the workbench.")),gp=W("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},g(1701,"Overall border color for focused elements. This color is only used if not overridden by a component.")),wt=W("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},g(1702,"An extra border around elements to separate them from others for greater contrast.")),Js=W("contrastActiveBorder",{light:null,dark:null,hcDark:gp,hcLight:gp},g(1703,"An extra border around active elements to separate them from others for greater contrast."));W("selection.background",null,g(1704,"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 _Te=W("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1705,"Foreground color for links in text.")),$gt=W("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},g(1706,"Foreground color for links in text when clicked on and on mouse hover."));W("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:me.black,hcLight:"#292929"},g(1707,"Color for text separators."));W("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},g(1708,"Foreground color for preformatted text segments."));W("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},g(1709,"Background color for preformatted text segments."));const Ggt=W("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},g(1710,"Background color for block quotes in text.")),Kgt=W("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:me.white,hcLight:"#292929"},g(1711,"Border color for block quotes in text."));W("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:me.black,hcLight:"#F2F2F2"},g(1712,"Background color for code blocks in text."));W("sash.hoverBorder",gp,g(1908,"Border color of active sashes."));const _T=W("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:me.black,hcLight:"#0F4A85"},g(1909,"Badge background color. Badges are small information labels, e.g. for search results count.")),Hre=W("badge.foreground",{dark:me.white,light:"#333",hcDark:me.white,hcLight:me.white},g(1910,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),t6=W("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},g(1911,"Scrollbar shadow to indicate that the view is scrolled.")),UKe=W("scrollbarSlider.background",{dark:me.fromHex("#797979").transparent(.4),light:me.fromHex("#646464").transparent(.4),hcDark:st(wt,.6),hcLight:st(wt,.4)},g(1912,"Scrollbar slider background color.")),VKe=W("scrollbarSlider.hoverBackground",{dark:me.fromHex("#646464").transparent(.7),light:me.fromHex("#646464").transparent(.7),hcDark:st(wt,.8),hcLight:st(wt,.8)},g(1913,"Scrollbar slider background color when hovering.")),zKe=W("scrollbarSlider.activeBackground",{dark:me.fromHex("#BFBFBF").transparent(.4),light:me.fromHex("#000000").transparent(.6),hcDark:wt,hcLight:wt},g(1914,"Scrollbar slider background color when clicked on.")),qgt=W("progressBar.background",{dark:me.fromHex("#0E70C0"),light:me.fromHex("#0E70C0"),hcDark:wt,hcLight:wt},g(1915,"Background color of the progress bar that can show for long running operations.")),Hc=W("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:me.black,hcLight:me.white},g(1721,"Editor background color.")),Ll=W("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:me.white,hcLight:zi},g(1722,"Editor default foreground color."));W("editorStickyScroll.background",Hc,g(1723,"Background color of sticky scroll in the editor"));W("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1724,"Background color of sticky scroll on hover in the editor"));W("editorStickyScroll.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1725,"Border color of sticky scroll in the editor"));W("editorStickyScroll.shadow",t6,g(1726," Shadow color of sticky scroll in the editor"));const Ah=W("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:me.white},g(1727,"Background color of editor widgets, such as find/replace.")),EN=W("editorWidget.foreground",zi,g(1728,"Foreground color of editor widgets, such as find/replace.")),i6=W("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:wt,hcLight:wt},g(1729,"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."));W("editorWidget.resizeBorder",null,g(1730,"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."));W("editorError.background",null,g(1731,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const xN=W("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},g(1732,"Foreground color of error squigglies in the editor.")),Qgt=W("editorError.border",{dark:null,light:null,hcDark:me.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},g(1733,"If set, color of double underlines for errors in the editor.")),jgt=W("editorWarning.background",null,g(1734,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),um=W("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},g(1735,"Foreground color of warning squigglies in the editor.")),W8=W("editorWarning.border",{dark:null,light:null,hcDark:me.fromHex("#FFCC00").transparent(.8),hcLight:me.fromHex("#FFCC00").transparent(.8)},g(1736,"If set, color of double underlines for warnings in the editor."));W("editorInfo.background",null,g(1737,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const gm=W("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},g(1738,"Foreground color of info squigglies in the editor.")),H8=W("editorInfo.border",{dark:null,light:null,hcDark:me.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},g(1739,"If set, color of double underlines for infos in the editor.")),Ygt=W("editorHint.foreground",{dark:me.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},g(1740,"Foreground color of hint squigglies in the editor."));W("editorHint.border",{dark:null,light:null,hcDark:me.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},g(1741,"If set, color of double underlines for hints in the editor."));const Jgt=W("editorLink.activeForeground",{dark:"#4E94CE",light:me.blue,hcDark:me.cyan,hcLight:"#292929"},g(1742,"Color of active links.")),SS=W("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},g(1743,"Color of the editor selection.")),Xgt=W("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:me.white},g(1744,"Color of the selected text for high contrast.")),$Ke=W("editor.inactiveSelectionBackground",{light:st(SS,.5),dark:st(SS,.5),hcDark:st(SS,.7),hcLight:st(SS,.5)},g(1745,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),vTe=W("editor.selectionHighlightBackground",{light:DOe(SS,Hc,.3,.6),dark:DOe(SS,Hc,.3,.6),hcDark:null,hcLight:null},g(1746,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1747,"Border color for regions with the same content as the selection."));const LOe=W("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},g(1748,"Color of the current search match.")),Zgt=W("editor.findMatchForeground",null,g(1749,"Text color of the current search match.")),fb=W("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},g(1750,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),eft=W("editor.findMatchHighlightForeground",null,g(1751,"Foreground color of the other search matches."),!0);W("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},g(1752,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.findMatchBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1753,"Border color of the current search match."));const bx=W("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(1754,"Border color of the other search matches.")),tft=W("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:st(Js,.4),hcLight:st(Js,.4)},g(1755,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),ift=W("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},g(1756,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),iY=W("editorHoverWidget.background",Ah,g(1757,"Background color of the editor hover."));W("editorHoverWidget.foreground",EN,g(1758,"Foreground color of the editor hover."));const GKe=W("editorHoverWidget.border",i6,g(1759,"Border color of the editor hover."));W("editorHoverWidget.statusBarBackground",{dark:I_(iY,.2),light:up(iY,.05),hcDark:Ah,hcLight:Ah},g(1760,"Background color of the editor hover status bar."));const bTe=W("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:me.white,hcLight:me.black},g(1761,"Foreground color of inline hints")),wTe=W("editorInlayHint.background",{dark:st(_T,.1),light:st(_T,.1),hcDark:st(me.white,.1),hcLight:st(_T,.1)},g(1762,"Background color of inline hints")),nft=W("editorInlayHint.typeForeground",bTe,g(1763,"Foreground color of inline hints for types")),sft=W("editorInlayHint.typeBackground",wTe,g(1764,"Background color of inline hints for types")),oft=W("editorInlayHint.parameterForeground",bTe,g(1765,"Foreground color of inline hints for parameters")),rft=W("editorInlayHint.parameterBackground",wTe,g(1766,"Background color of inline hints for parameters")),aft=W("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},g(1767,"The color used for the lightbulb actions icon."));W("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(1768,"The color used for the lightbulb auto fix actions icon."));W("editorLightBulbAi.foreground",aft,g(1769,"The color used for the lightbulb AI icon."));W("editor.snippetTabstopHighlightBackground",{dark:new me(new dn(124,124,124,.3)),light:new me(new dn(10,50,100,.2)),hcDark:new me(new dn(124,124,124,.3)),hcLight:new me(new dn(10,50,100,.2))},g(1770,"Highlight background color of a snippet tabstop."));W("editor.snippetTabstopHighlightBorder",null,g(1771,"Highlight border color of a snippet tabstop."));W("editor.snippetFinalTabstopHighlightBackground",null,g(1772,"Highlight background color of the final tabstop of a snippet."));W("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new me(new dn(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},g(1773,"Highlight border color of the final tabstop of a snippet."));const Lpe=new me(new dn(155,185,85,.2)),Rpe=new me(new dn(255,0,0,.2)),gy=W("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},g(1774,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),XP=W("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},g(1775,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditor.insertedLineBackground",{dark:Lpe,light:Lpe,hcDark:null,hcLight:null},g(1776,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditor.removedLineBackground",{dark:Rpe,light:Rpe,hcDark:null,hcLight:null},g(1777,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);W("diffEditorGutter.insertedLineBackground",null,g(1778,"Background color for the margin where lines got inserted."));W("diffEditorGutter.removedLineBackground",null,g(1779,"Background color for the margin where lines got removed."));const cft=W("diffEditorOverview.insertedForeground",null,g(1780,"Diff overview ruler foreground for inserted content.")),lft=W("diffEditorOverview.removedForeground",null,g(1781,"Diff overview ruler foreground for removed content."));W("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},g(1782,"Outline color for the text that got inserted."));W("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},g(1783,"Outline color for text that got removed."));W("diffEditor.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1784,"Border color between the two text editors."));W("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},g(1785,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));W("diffEditor.unchangedRegionBackground","sideBar.background",g(1786,"The background color of unchanged blocks in the diff editor."));W("diffEditor.unchangedRegionForeground","foreground",g(1787,"The foreground color of unchanged blocks in the diff editor."));W("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},g(1788,"The background color of unchanged code in the diff editor."));const mI=W("widget.shadow",{dark:st(me.black,.36),light:st(me.black,.16),hcDark:null,hcLight:null},g(1789,"Shadow color of widgets such as find/replace inside the editor.")),F2=W("widget.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1790,"Border color of widgets such as find/replace inside the editor.")),nY=W("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},g(1791,"Toolbar background when hovering over actions using the mouse"));W("toolbar.hoverOutline",{dark:null,light:null,hcDark:Js,hcLight:Js},g(1792,"Toolbar outline when hovering over actions using the mouse"));W("toolbar.activeBackground",{dark:I_(nY,.1),light:up(nY,.1),hcDark:null,hcLight:null},g(1793,"Toolbar background when holding the mouse over actions"));const dft=W("breadcrumb.foreground",st(zi,.8),g(1794,"Color of focused breadcrumb items.")),hft=W("breadcrumb.background",Hc,g(1795,"Background color of breadcrumb items.")),ROe=W("breadcrumb.focusForeground",{light:up(zi,.2),dark:I_(zi,.1),hcDark:I_(zi,.1),hcLight:I_(zi,.1)},g(1794,"Color of focused breadcrumb items.")),uft=W("breadcrumb.activeSelectionForeground",{light:up(zi,.2),dark:I_(zi,.1),hcDark:I_(zi,.1),hcLight:I_(zi,.1)},g(1796,"Color of selected breadcrumb items."));W("breadcrumbPicker.background",Ah,g(1797,"Background color of breadcrumb item picker."));const KKe=.5,MOe=me.fromHex("#40C8AE").transparent(KKe),NOe=me.fromHex("#40A6FF").transparent(KKe),POe=me.fromHex("#606060").transparent(.4),yTe=.4,O2=1,Mpe=W("merge.currentHeaderBackground",{dark:MOe,light:MOe,hcDark:null,hcLight:null},g(1798,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.currentContentBackground",st(Mpe,yTe),g(1799,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Npe=W("merge.incomingHeaderBackground",{dark:NOe,light:NOe,hcDark:null,hcLight:null},g(1800,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.incomingContentBackground",st(Npe,yTe),g(1801,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Ppe=W("merge.commonHeaderBackground",{dark:POe,light:POe,hcDark:null,hcLight:null},g(1802,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);W("merge.commonContentBackground",st(Ppe,yTe),g(1803,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const B2=W("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},g(1804,"Border color on headers and the splitter in inline merge-conflicts."));W("editorOverviewRuler.currentContentForeground",{dark:st(Mpe,O2),light:st(Mpe,O2),hcDark:B2,hcLight:B2},g(1805,"Current overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.incomingContentForeground",{dark:st(Npe,O2),light:st(Npe,O2),hcDark:B2,hcLight:B2},g(1806,"Incoming overview ruler foreground for inline merge-conflicts."));W("editorOverviewRuler.commonContentForeground",{dark:st(Ppe,O2),light:st(Ppe,O2),hcDark:B2,hcLight:B2},g(1807,"Common ancestor overview ruler foreground for inline merge-conflicts."));const t5=W("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},g(1808,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),qKe=W("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",g(1809,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),gft=W("problemsErrorIcon.foreground",xN,g(1810,"The color used for the problems error icon.")),fft=W("problemsWarningIcon.foreground",um,g(1811,"The color used for the problems warning icon.")),pft=W("problemsInfoIcon.foreground",gm,g(1812,"The color used for the problems info icon.")),Fpe=W("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},g(1897,"Minimap marker color for find matches."),!0),Ure=W("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1898,"Minimap marker color for repeating editor selections."),!0),FOe=W("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},g(1899,"Minimap marker color for the editor selection."),!0),mft=W("minimap.infoHighlight",{dark:gm,light:gm,hcDark:H8,hcLight:H8},g(1900,"Minimap marker color for infos.")),_ft=W("minimap.warningHighlight",{dark:um,light:um,hcDark:W8,hcLight:W8},g(1901,"Minimap marker color for warnings.")),vft=W("minimap.errorHighlight",{dark:new me(new dn(255,18,18,.7)),light:new me(new dn(255,18,18,.7)),hcDark:new me(new dn(255,50,50,1)),hcLight:"#B5200D"},g(1902,"Minimap marker color for errors.")),bft=W("minimap.background",null,g(1903,"Minimap background color.")),wft=W("minimap.foregroundOpacity",me.fromHex("#000f"),g(1904,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));W("minimapSlider.background",st(UKe,.5),g(1905,"Minimap slider background color."));W("minimapSlider.hoverBackground",st(VKe,.5),g(1906,"Minimap slider background color when hovering."));W("minimapSlider.activeBackground",st(zKe,.5),g(1907,"Minimap slider background color when clicked on."));W("charts.foreground",zi,g(1713,"The foreground color used in charts."));W("charts.lines",st(zi,.5),g(1714,"The color used for horizontal lines in charts."));W("charts.red",xN,g(1715,"The red color used in chart visualizations."));W("charts.blue",gm,g(1716,"The blue color used in chart visualizations."));W("charts.yellow",um,g(1717,"The yellow color used in chart visualizations."));W("charts.orange",Fpe,g(1718,"The orange color used in chart visualizations."));W("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},g(1719,"The green color used in chart visualizations."));W("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(1720,"The purple color used in chart visualizations."));const W2=W("input.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1813,"Input box background.")),QKe=W("input.foreground",zi,g(1814,"Input box foreground.")),i5=W("input.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1815,"Input box border.")),Vre=W("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:wt,hcLight:wt},g(1816,"Border color of activated options in input fields.")),yft=W("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},g(1817,"Background color of activated options in input fields.")),n6=W("inputOption.activeBackground",{dark:st(gp,.4),light:st(gp,.2),hcDark:me.transparent,hcLight:me.transparent},g(1818,"Background hover color of options in input fields.")),zre=W("inputOption.activeForeground",{dark:me.white,light:me.black,hcDark:zi,hcLight:zi},g(1819,"Foreground color of activated options in input fields.")),Cft=W("input.placeholderForeground",{light:st(zi,.5),dark:st(zi,.5),hcDark:st(zi,.7),hcLight:st(zi,.7)},g(1820,"Input box foreground color for placeholder text.")),Sft=W("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:me.black,hcLight:me.white},g(1821,"Input validation background color for information severity.")),Aft=W("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1822,"Input validation foreground color for information severity.")),Eft=W("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:wt,hcLight:wt},g(1823,"Input validation border color for information severity.")),xft=W("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:me.black,hcLight:me.white},g(1824,"Input validation background color for warning severity.")),Dft=W("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1825,"Input validation foreground color for warning severity.")),kft=W("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:wt,hcLight:wt},g(1826,"Input validation border color for warning severity.")),jKe=W("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:me.black,hcLight:me.white},g(1827,"Input validation background color for error severity.")),YKe=W("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:zi},g(1828,"Input validation foreground color for error severity.")),JKe=W("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:wt,hcLight:wt},g(1829,"Input validation border color for error severity.")),$re=W("dropdown.background",{dark:"#3C3C3C",light:me.white,hcDark:me.black,hcLight:me.white},g(1830,"Dropdown background.")),Ift=W("dropdown.listBackground",{dark:null,light:null,hcDark:me.black,hcLight:me.white},g(1831,"Dropdown list background.")),CTe=W("dropdown.foreground",{dark:"#F0F0F0",light:zi,hcDark:me.white,hcLight:zi},g(1832,"Dropdown foreground.")),STe=W("dropdown.border",{dark:$re,light:"#CECECE",hcDark:wt,hcLight:wt},g(1833,"Dropdown border.")),pM=W("button.foreground",me.white,g(1834,"Button foreground color.")),XKe=W("button.separator",st(pM,.4),g(1835,"Button separator color.")),fy=W("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},g(1836,"Button background color.")),U8=W("button.hoverBackground",{dark:I_(fy,.2),light:up(fy,.2),hcDark:fy,hcLight:fy},g(1837,"Button background color when hovering.")),Tft=W("button.border",wt,g(1838,"Button border color.")),Lft=W("button.secondaryForeground",{dark:me.white,light:me.white,hcDark:me.white,hcLight:zi},g(1839,"Secondary button foreground color.")),Ope=W("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:me.white},g(1840,"Secondary button background color.")),Rft=W("button.secondaryHoverBackground",{dark:I_(Ope,.2),light:up(Ope,.2),hcDark:null,hcLight:null},g(1841,"Secondary button background color when hovering.")),J4=W("radio.activeForeground",zre,g(1842,"Foreground color of active radio option.")),Mft=W("radio.activeBackground",n6,g(1843,"Background color of active radio option.")),Nft=W("radio.activeBorder",Vre,g(1844,"Border color of the active radio option.")),Pft=W("radio.inactiveForeground",null,g(1845,"Foreground color of inactive radio option.")),Fft=W("radio.inactiveBackground",null,g(1846,"Background color of inactive radio option.")),Oft=W("radio.inactiveBorder",{light:st(J4,.2),dark:st(J4,.2),hcDark:st(J4,.4),hcLight:st(J4,.2)},g(1847,"Border color of the inactive radio option.")),Bft=W("radio.inactiveHoverBackground",yft,g(1848,"Background color of inactive active radio option when hovering.")),Wft=W("checkbox.background",$re,g(1849,"Background color of checkbox widget."));W("checkbox.selectBackground",Ah,g(1850,"Background color of checkbox widget when the element it's in is selected."));const Hft=W("checkbox.foreground",CTe,g(1851,"Foreground color of checkbox widget.")),Uft=W("checkbox.border",STe,g(1852,"Border color of checkbox widget."));W("checkbox.selectBorder",tY,g(1853,"Border color of checkbox widget when the element it's in is selected."));const Vft=W("keybindingLabel.background",{dark:new me(new dn(128,128,128,.17)),light:new me(new dn(221,221,221,.4)),hcDark:me.transparent,hcLight:me.transparent},g(1854,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),zft=W("keybindingLabel.foreground",{dark:me.fromHex("#CCCCCC"),light:me.fromHex("#555555"),hcDark:me.white,hcLight:zi},g(1855,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),$ft=W("keybindingLabel.border",{dark:new me(new dn(51,51,51,.6)),light:new me(new dn(204,204,204,.4)),hcDark:new me(new dn(111,195,223)),hcLight:wt},g(1856,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Gft=W("keybindingLabel.bottomBorder",{dark:new me(new dn(68,68,68,.6)),light:new me(new dn(187,187,187,.4)),hcDark:new me(new dn(111,195,223)),hcLight:zi},g(1857,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Kft=W("list.focusBackground",null,g(1858,"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.")),qft=W("list.focusForeground",null,g(1859,"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.")),Bpe=W("list.focusOutline",{dark:gp,light:gp,hcDark:Js,hcLight:Js},g(1860,"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.")),Qft=W("list.focusAndSelectionOutline",null,g(1861,"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.")),py=W("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1862,"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.")),V8=W("list.activeSelectionForeground",{dark:me.white,light:me.white,hcDark:null,hcLight:null},g(1863,"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.")),ZKe=W("list.activeSelectionIconForeground",null,g(1864,"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.")),Wpe=W("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1865,"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.")),jft=W("list.inactiveSelectionForeground",null,g(1866,"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.")),Yft=W("list.inactiveSelectionIconForeground",null,g(1867,"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.")),Jft=W("list.inactiveFocusBackground",null,g(1868,"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.")),Xft=W("list.inactiveFocusOutline",null,g(1869,"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.")),eqe=W("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:me.white.transparent(.1),hcLight:me.fromHex("#0F4A85").transparent(.1)},g(1870,"List/Tree background when hovering over items using the mouse.")),tqe=W("list.hoverForeground",null,g(1871,"List/Tree foreground when hovering over items using the mouse.")),Zft=W("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},g(1872,"List/Tree drag and drop background when moving items over other items when using the mouse.")),ept=W("list.dropBetweenBackground",{dark:tY,light:tY,hcDark:null,hcLight:null},g(1873,"List/Tree drag and drop border color when moving items between items when using the mouse.")),ZP=W("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:gp,hcLight:gp},g(1874,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),tpt=W("list.focusHighlightForeground",{dark:ZP,light:zgt(py,ZP,"#BBE7FF"),hcDark:ZP,hcLight:ZP},g(1875,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),ipt=W("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},g(1876,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),OOe=W("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},g(1877,"Foreground color of list items containing errors."));W("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},g(1878,"Foreground color of list items containing warnings."));const npt=W("listFilterWidget.background",{light:up(Ah,0),dark:I_(Ah,0),hcDark:Ah,hcLight:Ah},g(1879,"Background color of the type filter widget in lists and trees.")),spt=W("listFilterWidget.outline",{dark:me.transparent,light:me.transparent,hcDark:"#f38518",hcLight:"#007ACC"},g(1880,"Outline color of the type filter widget in lists and trees.")),opt=W("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:wt,hcLight:wt},g(1881,"Outline color of the type filter widget in lists and trees, when there are no matches.")),rpt=W("listFilterWidget.shadow",mI,g(1882,"Shadow color of the type filter widget in lists and trees."));W("list.filterMatchBackground",{dark:fb,light:fb,hcDark:null,hcLight:null},g(1883,"Background color of the filtered match."));W("list.filterMatchBorder",{dark:bx,light:bx,hcDark:wt,hcLight:Js},g(1884,"Border color of the filtered match."));const apt=W("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},g(1885,"List/Tree foreground color for items that are deemphasized.")),sY=W("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},g(1886,"Tree stroke color for the indentation guides.")),cpt=W("tree.inactiveIndentGuidesStroke",st(sY,.4),g(1887,"Tree stroke color for the indentation guides that are not active.")),lpt=W("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},g(1888,"Table border color between columns.")),dpt=W("tree.tableOddRowsBackground",{dark:st(zi,.04),light:st(zi,.04),hcDark:null,hcLight:null},g(1889,"Background color for odd table rows.")),hpt=W("menu.border",{dark:null,light:null,hcDark:wt,hcLight:wt},g(1890,"Border color of menus.")),upt=W("menu.foreground",CTe,g(1891,"Foreground color of menu items.")),gpt=W("menu.background",$re,g(1892,"Background color of menu items.")),fpt=W("menu.selectionForeground",V8,g(1893,"Foreground color of the selected menu item in menus.")),ppt=W("menu.selectionBackground",py,g(1894,"Background color of the selected menu item in menus.")),mpt=W("menu.selectionBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(1895,"Border color of the selected menu item in menus.")),_pt=W("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:wt,hcLight:wt},g(1896,"Color of a separator menu item in menus.")),BOe=W("quickInput.background",Ah,g(1916,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),vpt=W("quickInput.foreground",EN,g(1917,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),bpt=W("quickInputTitle.background",{dark:new me(new dn(255,255,255,.105)),light:new me(new dn(0,0,0,.06)),hcDark:"#000000",hcLight:me.white},g(1918,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),iqe=W("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:me.white,hcLight:"#0F4A85"},g(1919,"Quick picker color for grouping labels.")),wpt=W("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:me.white,hcLight:"#0F4A85"},g(1920,"Quick picker color for grouping borders.")),WOe=W("quickInput.list.focusBackground",null,"",void 0,g(1921,"Please use quickInputList.focusBackground instead")),z8=W("quickInputList.focusForeground",V8,g(1922,"Quick picker foreground color for the focused item.")),ATe=W("quickInputList.focusIconForeground",ZKe,g(1923,"Quick picker icon foreground color for the focused item.")),$8=W("quickInputList.focusBackground",{dark:B8(WOe,py),light:B8(WOe,py),hcDark:null,hcLight:null},g(1924,"Quick picker background color for the focused item."));W("search.resultsInfoForeground",{light:zi,dark:st(zi,.65),hcDark:zi,hcLight:zi},g(1925,"Color of the text in the search viewlet's completion message."));W("searchEditor.findMatchBackground",{light:st(fb,.66),dark:st(fb,.66),hcDark:fb,hcLight:fb},g(1926,"Color of the Search Editor query matches."));W("searchEditor.findMatchBorder",{light:st(bx,.66),dark:st(bx,.66),hcDark:bx,hcLight:bx},g(1927,"Border color of the Search Editor query matches."));class Gre{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new nqe(this.x-e.scrollX,this.y-e.scrollY)}}class nqe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new Gre(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class ypt{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class Cpt{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function ETe(s){const e=Cr(s);return new ypt(e.left,e.top,e.width,e.height)}function xTe(s,e,t){const i=e.width/s.offsetWidth,n=e.height/s.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/n;return new Cpt(o,r)}class Lk extends Sh{constructor(e,t,i){super(ct(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new Gre(this.posx,this.posy),this.editorPos=ETe(i),this.relativePos=xTe(i,this.editorPos,this.pos)}}class Spt{constructor(e){this._editorViewDomNode=e}_create(e){return new Lk(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ue(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return ue(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return ue(e,ke.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return ue(e,ke.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return ue(e,ke.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return ue(e,"mousemove",i=>t(this._create(i)))}}class Apt{constructor(e){this._editorViewDomNode=e}_create(e){return new Lk(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ue(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return ue(e,ke.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return ue(e,ke.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return ue(e,"pointermove",i=>t(this._create(i)))}}class Ept extends V{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new vU),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Ro(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{n(new Lk(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const Une=class Une{constructor(e){this._editor=e,this._instanceId=++Une._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new cn(()=>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 n=this._counter++;i=new xpt(t,`dyn-rule-${this._instanceId}-${n}`,E8(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())}};Une._idPool=0;let oY=Une;class xpt{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new Z,this._styleElement=ul(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const o=t[n];let r;typeof o=="object"?r=ze(o.id):r=o;const a=Dpt(n);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 Bpt(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var ao;(function(s){s[s.ViewCompositionStart=0]="ViewCompositionStart",s[s.ViewCompositionEnd=1]="ViewCompositionEnd",s[s.ViewConfigurationChanged=2]="ViewConfigurationChanged",s[s.ViewCursorStateChanged=3]="ViewCursorStateChanged",s[s.ViewDecorationsChanged=4]="ViewDecorationsChanged",s[s.ViewFlushed=5]="ViewFlushed",s[s.ViewFocusChanged=6]="ViewFocusChanged",s[s.ViewLanguageConfigurationChanged=7]="ViewLanguageConfigurationChanged",s[s.ViewLineMappingChanged=8]="ViewLineMappingChanged",s[s.ViewLinesChanged=9]="ViewLinesChanged",s[s.ViewLinesDeleted=10]="ViewLinesDeleted",s[s.ViewLinesInserted=11]="ViewLinesInserted",s[s.ViewRevealRangeRequest=12]="ViewRevealRangeRequest",s[s.ViewScrollChanged=13]="ViewScrollChanged",s[s.ViewThemeChanged=14]="ViewThemeChanged",s[s.ViewTokensChanged=15]="ViewTokensChanged",s[s.ViewTokensColorsChanged=16]="ViewTokensColorsChanged",s[s.ViewZonesChanged=17]="ViewZonesChanged"})(ao||(ao={}));class Wpt{constructor(){this.type=ao.ViewCompositionStart}}class Hpt{constructor(){this.type=ao.ViewCompositionEnd}}class Upt{constructor(e){this.type=ao.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Vpt{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=ao.ViewCursorStateChanged}}class NI{constructor(e){this.type=ao.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 LG{constructor(){this.type=ao.ViewFlushed}}class zpt{constructor(e){this.type=ao.ViewFocusChanged,this.isFocused=e}}class $pt{constructor(){this.type=ao.ViewLanguageConfigurationChanged}}class RG{constructor(){this.type=ao.ViewLineMappingChanged}}class uqe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=ao.ViewLinesChanged}}class Kpe{constructor(e,t){this.type=ao.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class qpe{constructor(e,t){this.type=ao.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var _s;(function(s){s[s.Simple=0]="Simple",s[s.Center=1]="Center",s[s.CenterIfOutsideViewport=2]="CenterIfOutsideViewport",s[s.Top=3]="Top",s[s.Bottom=4]="Bottom",s[s.NearTop=5]="NearTop",s[s.NearTopIfOutsideViewport=6]="NearTopIfOutsideViewport"})(_s||(_s={}));class r5{constructor(e,t,i,n,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=ao.ViewRevealRangeRequest}}class Gpt{constructor(e){this.type=ao.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 Kpt{constructor(e){this.theme=e,this.type=ao.ViewThemeChanged}}class qpt{constructor(e){this.type=ao.ViewTokensChanged,this.ranges=e}}class Qpt{constructor(){this.type=ao.ViewTokensColorsChanged}}let jpt=class{constructor(){this.type=ao.ViewZonesChanged}};class c6 extends V{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,n=e.length;it.lineNumber)&&(t=i);return t}constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class Yre{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i=a.left?n.width=Math.max(n.width,a.left+a.width-n.left):(t[i++]=n,n=a)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const n=[];for(let o=0,r=e.length;oc)return null;if(t=Math.min(c,Math.max(0,t)),n=Math.min(c,Math.max(0,n)),t===n&&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!==n&&n>0&&o===0&&(n--,o=Un.MAX_SAFE_SMALL_INTEGER);let l=e.children[t].firstChild,d=e.children[n].firstChild;if((!l||!d)&&(!l&&i===0&&t>0&&(l=e.children[t-1].firstChild,i=Un.MAX_SAFE_SMALL_INTEGER),!d&&o===0&&n>0&&(d=e.children[n-1].firstChild,o=Un.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 Jg;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_DARK="hcDark",s.HIGH_CONTRAST_LIGHT="hcLight"})(Jg||(Jg={}));function Ry(s){return s===Jg.HIGH_CONTRAST_DARK||s===Jg.HIGH_CONTRAST_LIGHT}function Jre(s){return s===Jg.DARK||s===Jg.HIGH_CONTRAST_DARK}const emt=function(){return ad?!0:!(pr||rf||Ky)}();let NO=!0;class ZOe{constructor(e,t){this.themeType=t;const i=e.options,n=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=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(x.disableMonospaceOptimizations),this.canUseHalfwidthRightwardsArrow=n.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 Kne=class Kne{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=ls(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 Ry(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),a=this._options,c=eu.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(Ry(a.themeType)||this._options.renderWhitespace==="selection"){const f=n.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=n6(d,o);o.appendString("
    ");let u=null;return NO&&emt&&r.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===qu.None&&(u=new MG(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),u||(u=fqe(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 MG:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof MG?this._renderedViewLine.monospaceAssumptionsAreValid():NO}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof MG&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){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 XOe(!0,[new CT(this.getWidth(n),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,n);return r&&r.length>0?new XOe(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};Kne.CLASS_NAME="view-line";let dS=Kne;var xC;(function(s){s[s.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(xC||(xC={}));class MG{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/xC.MaxMonospaceDistance);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),NO=!1)}return NO}toSlowRenderedLine(){return fqe(this.domNode,this.input,this._characterMapping,!1,qu.None)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new CT(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=xC.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const n=Math.floor((t-1)/xC.MaxMonospaceDistance)-1,o=(n+1)*xC.MaxMonospaceDistance+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[n],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=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 n=this._characterMapping.getDomPosition(t),o=xq.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return WTe(this._characterMapping,e,t)}}class gqe{constructor(e,t,i,n,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,!n||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,n){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,n);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new CT(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new CT(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===qu.None||this._containsForeignElements===qu.After)return 0;if(this._containsForeignElements===qu.Before)return this.getWidth(n);const o=this._getReadingTarget(e);return o.firstChild?(n.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,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const c=xq.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return!c||c.length===0?-1:c[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===qu.None)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),r=xq.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);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,n){if(t===1&&i===this._characterMapping.length)return[new CT(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return xq.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return WTe(this._characterMapping,e,t)}}class tmt extends gqe{_readVisibleRangesForRange(e,t,i,n,o){const r=super._readVisibleRangesForRange(e,t,i,n,o);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,o);if(a!==-1){const c=r[r.length-1];c.left=t){const h=t-r;return l-t=4&&e[0]===sa.OverflowGuard&&e[3]===sa.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===sa.OverflowGuard&&e[3]===sa.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===sa.OverflowGuard&&e[3]===sa.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===sa.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===sa.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===sa.OverflowingOverlayWidgets}}class wM{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(x.layoutInfo),this.viewDomNode=t.viewDomNode,this.overflowWidgetsDomNode=t.overflowWidgetsDomNode??null,this.lineHeight=n.get(x.lineHeight),this.stickyTabStops=n.get(x.stickyTabStops),this.typicalHalfwidthCharacterWidth=n.get(x.fontInfo).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return wM.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=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,Dd._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class eBe extends omt{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&this._targetElement&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Tb.collect(this.target,this._targetElement)),this._targetPathCacheValue}constructor(e,t,i,n,o,r=null){super(e,t,i,n),this.hitTestResult=new ya(()=>Dd.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._targetElement=null,this._ctx=e,this._eventTarget=o,this._targetElement=r;const a=!!this._eventTarget;this._useHitTestTarget=!a}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 n=t.isInContentArea?Rt.CONTENT_VIEW_ZONE:Rt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return Fh.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),n=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(Rt.GUTTER_GLYPH_MARGIN,n,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Rt.GUTTER_LINE_NUMBERS,n,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Rt.GUTTER_LINE_DECORATIONS,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!Fh.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new oe(1,1),tBe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new oe(n,o),tBe)}if(Fh.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const r=e.getLineWidth(n),a=zde(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new oe(n,1),a)}const o=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=o){const r=zde(t.mouseContentHorizontalOffset-o),a=new oe(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===ST.Content?Dd.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Fh.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Fh.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new oe(n,o))}}return null}static _hitTestScrollbar(e,t){if(Fh.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return Dd._getMouseColumn(n,t.get(x.fontInfo).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const r=n.lineNumber,a=n.column,c=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>c){const b=zde(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(n,b)}const l=e.visibleRangeForPosition(r,a);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:a}),a>1){const b=e.visibleRangeForPosition(r,a-1);b&&h.push({offset:b.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(ab.offset-w.offset);const f=t.pos.toClientCoordinates(ct(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let b=1;bo)){const a=Math.floor((n+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 jre(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(ct(e.viewDomNode)));if(d.type===ST.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(ct(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=vM(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=rmt(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new yE;const o=n.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)===dS.CLASS_NAME?H0.createFromDOMInfo(e,r,n.startOffset):new yE(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)===dS.CLASS_NAME?H0.createFromDOMInfo(e,o,o.textContent.length):new yE(o)}return new yE}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const n=i.offsetNode.parentNode,o=n?n.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===dS.CLASS_NAME?H0.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new yE(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,o=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,r=n?n.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===dS.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return H0.createFromDOMInfo(e,c,0)}else if(a===dS.CLASS_NAME)return H0.createFromDOMInfo(e,i.offsetNode,0)}return new yE(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=Q8.atomicPosition(i,e.column-1,n,iD.Nearest);return o!==-1?new oe(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new yE;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(ct(e.viewDomNode)))),i.type===ST.Content){const n=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,Io.None);(n||!o.equals(i.position))&&(i=new pqe(o,i.spanNode,n))}return i}}function rmt(s,e,t){const i=document.createRange();let n=s.elementFromPoint(e,t);if(n!==null){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const o=n.getBoundingClientRect(),r=ct(n),a=r.getComputedStyle(n,null).getPropertyValue("font-style"),c=r.getComputedStyle(n,null).getPropertyValue("font-variant"),l=r.getComputedStyle(n,null).getPropertyValue("font-weight"),d=r.getComputedStyle(n,null).getPropertyValue("font-size"),h=r.getComputedStyle(n,null).getPropertyValue("line-height"),u=r.getComputedStyle(n,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=n.innerText;let m=o.left,v=0,b;if(e>o.left+o.width)v=p.length;else{const w=Qpe.getInstance();for(let y=0;y{t.add(ue(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(ue(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(ue(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:si,disposables:this._store}))}static addTarget(e){if(!zl.isTouchDevice())return V.None;zl.INSTANCE||(zl.INSTANCE=A2(new zl));const t=zl.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!zl.isTouchDevice())return V.None;zl.INSTANCE||(zl.INSTANCE=A2(new zl));const t=zl.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in si||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,n=e.targetTouches.length;i=zl.HOLD_DELAY&&Math.abs(c.initialPageX-Cg(c.rollingPageX))<30&&Math.abs(c.initialPageY-Cg(c.rollingPageY))<30){const d=this.newGestureEvent(uo.Contextmenu,c.initialTarget);d.pageX=Cg(c.rollingPageX),d.pageY=Cg(c.rollingPageY),this.dispatchEvent(d)}else if(n===1){const d=Cg(c.rollingPageX),h=Cg(c.rollingPageY),u=Cg(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(uo.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===uo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>zl.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===uo.Change||e.type===uo.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 n=0,o=e.initialTarget;for(;o&&o!==i;)n++,o=o.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,o,r,a,c,l){this.handle=Ll(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;n+=zl.SCROLL_FRICTION*h,a+=zl.SCROLL_FRICTION*h,n>0&&(p=!1,u=o*n*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(uo.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,n,o,r+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,n=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)}};zl.SCROLL_FRICTION=-.005,zl.HOLD_DELAY=700,zl.CLEAR_TAP_COUNT_TIME=400;let fd=zl;function amt(s,e,t){let i=0;for(let o=0;o!0,lmt=()=>!1,dmt=s=>s===" "||s===" ";class rP{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,n){this.languageConfigurationService=n,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 n=E1(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return HTe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return dmt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return cmt;case"never":return lmt}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return qa.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=qa.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(nr?r:n}}let Rn=class mqe{static fromModelState(e){return new hmt(e)}static fromViewState(e){return new umt(e)}static fromModelSelection(e){const t=dt.liftSelection(e),i=new El(F.fromPositions(t.getSelectionStart()),Vh.Simple,0,t.getPosition(),0);return mqe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;io,l=n>r,d=nr||bn||v0&&n--,U0.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=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));n=Math.max(n,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-q6e(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 n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=Q8.atomicPosition(o,t.column-1,i,iD.Left);if(r!==-1&&r+1>=n)return new oe(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?As.leftPositionAtomicSoftTabs(t,i,e.tabSize):As.leftPosition(t,i);return new $de(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(o-1)),l=t.normalizePosition(As.clipPositionColumn(c,t),Io.Left),d=As.left(e,t,l);r=d.lineNumber,a=d.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new oe(e.lineNumber,As.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?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),f?o=0:o=l-qa.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),c!==void 0){const p=new oe(i,n),m=t.normalizePosition(p,c);o=o+(n-m.column),i=m.lineNumber,n=m.column}return new $de(i,n,o)}static down(e,t,i,n,o,r,a){return this.vertical(e,t,i,n,o,i+r,a,Io.RightOfInjectedText)}static moveDown(e,t,i,n,o){let r,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=As.down(e,t,r+c,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new oe(l.lineNumber,l.column),Io.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(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=u.length+1)return!1;const f=u.charAt(h.column-2),p=n.get(f);if(!p)return!1;if(Ok(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(h.column-1);let v=!1;for(const b of p)b.open===f&&b.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let b=!1;for(let w=0,y=a.length;w1){const o=t.getLineContent(n.lineNumber),r=kh(o),a=r===-1?o.length+1:r+1;if(n.column<=a){const c=i.visibleColumnFromColumn(t,n),l=qa.prevIndentTabStop(c,i.indentSize),d=i.columnFromVisibleColumn(t,n.lineNumber,l);return new F(n.lineNumber,d,n.lineNumber,n.column)}}return F.fromPositions(yM.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=wat(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 n=[];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 F(d,h,u,f);o=p,p.isEmpty()?n[r]=null:n[r]=new td(p,"")}else n[r]=null;else n[r]=new td(c,"")}return new tg(sr.Other,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Oi;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(Oi||(Oi={}));var xr;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Separator=2]="Separator"})(xr||(xr={}));var gs;(function(s){s[s.WordStart=0]="WordStart",s[s.WordStartFast=1]="WordStartFast",s[s.WordEnd=2]="WordEnd",s[s.WordAccessibility=3]="WordAccessibility"})(gs||(gs={}));class hs{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:xr.Regular,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=xr.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===zr.Regular){if(n===xr.Separator)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1));n=xr.Regular}else if(c===zr.WordSeparator){if(n===xr.Regular)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1));n=xr.Separator}else if(c===zr.Whitespace&&n!==xr.None)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1))}return n!==xr.None?this._createWord(e,n,zr.Whitespace,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let a=n;a=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return r;if(c===zr.Whitespace||i===xr.Regular&&c===zr.WordSeparator||i===xr.Separator&&c===zr.Regular)return r+1}return 0}static moveWordLeft(e,t,i,n,o){let r=i.lineNumber,a=i.column;a===1&&r>1&&(r=r-1,a=t.getLineMaxColumn(r));let c=hs._findPreviousWordOnLine(e,t,new oe(r,a));if(n===gs.WordStart)return new oe(r,c?c.start+1:1);if(n===gs.WordStartFast)return!o&&c&&c.wordType===xr.Separator&&c.end-c.start===1&&c.nextCharClass===zr.Regular&&(c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1))),new oe(r,c?c.start+1:1);if(n===gs.WordAccessibility){for(;c&&c.wordType===xr.Separator;)c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1));return new oe(r,c?c.start+1:1)}return c&&a<=c.end+1&&(c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1))),new oe(r,c?c.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=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===B.Underline&&c!==B.Underline)return new oe(i,r);if(a===B.Dash&&c!==B.Dash)return new oe(i,r);if((bx(a)||wG(a))&&Ow(c))return new oe(i,r);if(Ow(a)&&Ow(c)&&r+1=c.start+1&&(c=hs._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,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(c--,l=n.getLineMaxColumn(c)):(d&&l<=d.end+1&&(d=hs._findPreviousWordOnLine(i,n,new oe(c,d.start+1))),d?l=d.end+1:l>1?l=1:(c--,l=n.getLineMaxColumn(c))),new F(c,l,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new oe(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,n);return o||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===B.Space||i===B.Tab}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(n===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,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new F(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 F(i.lineNumber,h,i.lineNumber,u)),c=h=>{let u=h.start+1,f=h.end+1,p=!1;for(;f-11&&this._charAtIsWhitespace(n,u-2);)u--;return a(u,f)},l=hs._findPreviousWordOnLine(e,t,i);if(l&&r(l))return c(l);const d=hs._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(),n=hs._moveWordPartLeft(e,i);return new F(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=u.start+1&&(u=hs._findNextWordOnLine(i,n,new oe(c,u.end+1))),u?l=u.start+1:l!!e)}class bl{static addCursorDown(e,t,i){const n=[];let o=0;for(let r=0,a=t.length;rl&&(d=l,h=e.model.getLineMaxColumn(d)),Rn.fromModelState(new El(new F(r.lineNumber,1,d,h),Vh.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)),Rn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return Rn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return Rn.fromModelState(hs.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Rn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Rn.fromViewState(new El(new F(i,n,i,n),Vh.Simple,0,new oe(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(t.modelState.selectionStartKind===Vh.Word)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===Vh.Line)return this.line(e,t,i,n,o)}const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new oe(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Rn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,o,r){switch(i){case Mi.Direction.Left:return r===Mi.Unit.HalfLine?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case Mi.Direction.Right:return r===Mi.Unit.HalfLine?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case Mi.Direction.Up:return r===Mi.Unit.WrappedLine?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case Mi.Direction.Down:return r===Mi.Unit.WrappedLine?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case Mi.Direction.PrevBlankLine:return r===Mi.Unit.WrappedLine?t.map(a=>Rn.fromViewState(As.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Rn.fromModelState(As.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Mi.Direction.NextBlankLine:return r===Mi.Unit.WrappedLine?t.map(a=>Rn.fromViewState(As.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Rn.fromModelState(As.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Mi.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,n);case Mi.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case Mi.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,n);case Mi.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,n);case Mi.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case Mi.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortCenter:{const c=Math.round((a.startLineNumber+a.endLineNumber)/2),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?r=i.endLineNumber-1:oRn.fromViewState(As.moveLeft(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,r=t.length;oRn.fromViewState(As.moveRight(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,r=t.length;o0}}function Dpt(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}var ao;(function(s){s[s.ViewCompositionStart=0]="ViewCompositionStart",s[s.ViewCompositionEnd=1]="ViewCompositionEnd",s[s.ViewConfigurationChanged=2]="ViewConfigurationChanged",s[s.ViewCursorStateChanged=3]="ViewCursorStateChanged",s[s.ViewDecorationsChanged=4]="ViewDecorationsChanged",s[s.ViewFlushed=5]="ViewFlushed",s[s.ViewFocusChanged=6]="ViewFocusChanged",s[s.ViewLanguageConfigurationChanged=7]="ViewLanguageConfigurationChanged",s[s.ViewLineMappingChanged=8]="ViewLineMappingChanged",s[s.ViewLinesChanged=9]="ViewLinesChanged",s[s.ViewLinesDeleted=10]="ViewLinesDeleted",s[s.ViewLinesInserted=11]="ViewLinesInserted",s[s.ViewRevealRangeRequest=12]="ViewRevealRangeRequest",s[s.ViewScrollChanged=13]="ViewScrollChanged",s[s.ViewThemeChanged=14]="ViewThemeChanged",s[s.ViewTokensChanged=15]="ViewTokensChanged",s[s.ViewTokensColorsChanged=16]="ViewTokensColorsChanged",s[s.ViewZonesChanged=17]="ViewZonesChanged"})(ao||(ao={}));class kpt{constructor(){this.type=ao.ViewCompositionStart}}class Ipt{constructor(){this.type=ao.ViewCompositionEnd}}class Tpt{constructor(e){this.type=ao.ViewConfigurationChanged,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Lpt{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=ao.ViewCursorStateChanged}}class kI{constructor(e){this.type=ao.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 kG{constructor(){this.type=ao.ViewFlushed}}class Rpt{constructor(e){this.type=ao.ViewFocusChanged,this.isFocused=e}}class Mpt{constructor(){this.type=ao.ViewLanguageConfigurationChanged}}class IG{constructor(){this.type=ao.ViewLineMappingChanged}}class sqe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=ao.ViewLinesChanged}}class Hpe{constructor(e,t){this.type=ao.ViewLinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class Upe{constructor(e,t){this.type=ao.ViewLinesInserted,this.fromLineNumber=e,this.toLineNumber=t}}var _s;(function(s){s[s.Simple=0]="Simple",s[s.Center=1]="Center",s[s.CenterIfOutsideViewport=2]="CenterIfOutsideViewport",s[s.Top=3]="Top",s[s.Bottom=4]="Bottom",s[s.NearTop=5]="NearTop",s[s.NearTopIfOutsideViewport=6]="NearTopIfOutsideViewport"})(_s||(_s={}));class n5{constructor(e,t,i,n,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=ao.ViewRevealRangeRequest}}class Npt{constructor(e){this.type=ao.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 Ppt{constructor(e){this.theme=e,this.type=ao.ViewThemeChanged}}class Fpt{constructor(e){this.type=ao.ViewTokensChanged,this.ranges=e}}class Opt{constructor(){this.type=ao.ViewTokensColorsChanged}}let Bpt=class{constructor(){this.type=ao.ViewZonesChanged}};class s6 extends V{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,n=e.length;it.lineNumber)&&(t=i);return t}constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class Kre{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i=a.left?n.width=Math.max(n.width,a.left+a.width-n.left):(t[i++]=n,n=a)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const n=[];for(let o=0,r=e.length;oc)return null;if(t=Math.min(c,Math.max(0,t)),n=Math.min(c,Math.max(0,n)),t===n&&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!==n&&n>0&&o===0&&(n--,o=Un.MAX_SAFE_SMALL_INTEGER);let l=e.children[t].firstChild,d=e.children[n].firstChild;if((!l||!d)&&(!l&&i===0&&t>0&&(l=e.children[t-1].firstChild,i=Un.MAX_SAFE_SMALL_INTEGER),!d&&o===0&&n>0&&(d=e.children[n-1].firstChild,o=Un.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 Qg;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_DARK="hcDark",s.HIGH_CONTRAST_LIGHT="hcLight"})(Qg||(Qg={}));function Iy(s){return s===Qg.HIGH_CONTRAST_DARK||s===Qg.HIGH_CONTRAST_LIGHT}function qre(s){return s===Qg.DARK||s===Qg.HIGH_CONTRAST_DARK}const zpt=function(){return od?!0:!(pr||nf||zy)}();let TO=!0;class UOe{constructor(e,t){this.themeType=t;const i=e.options,n=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=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(x.disableMonospaceOptimizations),this.canUseHalfwidthRightwardsArrow=n.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 Vne=class Vne{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=ls(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 Iy(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),a=this._options,c=Zh.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(Iy(a.themeType)||this._options.renderWhitespace==="selection"){const f=n.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=Z7(d,o);o.appendString("
    ");let u=null;return TO&&zpt&&r.isBasicASCII&&a.useMonospaceOptimizations&&h.containsForeignElements===Gu.None&&(u=new TG(this._renderedViewLine?this._renderedViewLine.domNode:null,d,h.characterMapping)),u||(u=rqe(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 TG:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof TG?this._renderedViewLine.monospaceAssumptionsAreValid():TO}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof TG&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){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 HOe(!0,[new vT(this.getWidth(n),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,n);return r&&r.length>0?new HOe(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};Vne.CLASS_NAME="view-line";let lS=Vne;var EC;(function(s){s[s.MaxMonospaceDistance=300]="MaxMonospaceDistance"})(EC||(EC={}));class TG{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/EC.MaxMonospaceDistance);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),TO=!1)}return TO}toSlowRenderedLine(){return rqe(this.domNode,this.input,this._characterMapping,!1,Gu.None)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new vT(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=EC.MaxMonospaceDistance){const l=this._characterMapping.getHorizontalOffset(t);return this._charWidth*l}const n=Math.floor((t-1)/EC.MaxMonospaceDistance)-1,o=(n+1)*EC.MaxMonospaceDistance+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[n],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=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 n=this._characterMapping.getDomPosition(t),o=Aq.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return DTe(this._characterMapping,e,t)}}class oqe{constructor(e,t,i,n,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,!n||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,n){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,n);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new vT(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new vT(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===Gu.None||this._containsForeignElements===Gu.After)return 0;if(this._containsForeignElements===Gu.Before)return this.getWidth(n);const o=this._getReadingTarget(e);return o.firstChild?(n.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,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const c=Aq.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return!c||c.length===0?-1:c[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===Gu.None)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),r=Aq.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);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,n){if(t===1&&i===this._characterMapping.length)return[new vT(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return Aq.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return DTe(this._characterMapping,e,t)}}class $pt extends oqe{_readVisibleRangesForRange(e,t,i,n,o){const r=super._readVisibleRangesForRange(e,t,i,n,o);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,o);if(a!==-1){const c=r[r.length-1];c.left=t){const h=t-r;return l-t=4&&e[0]===sa.OverflowGuard&&e[3]===sa.ViewLines}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===sa.OverflowGuard&&e[3]===sa.ViewLines}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.ScrollableElement}static isChildOfMinimap(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.Minimap}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===sa.OverflowGuard&&e[3]===sa.ContentWidgets}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===sa.OverflowGuard}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===sa.OverflowingContentWidgets}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===sa.OverflowGuard&&e[1]===sa.OverlayWidgets}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===sa.OverflowingOverlayWidgets}}class mM{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(x.layoutInfo),this.viewDomNode=t.viewDomNode,this.overflowWidgetsDomNode=t.overflowWidgetsDomNode??null,this.lineHeight=n.get(x.lineHeight),this.stickyTabStops=n.get(x.stickyTabStops),this.typicalHalfwidthCharacterWidth=n.get(x.fontInfo).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return mM.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=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,Ed._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class VOe extends Qpt{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&this._targetElement&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Db.collect(this.target,this._targetElement)),this._targetPathCacheValue}constructor(e,t,i,n,o,r=null){super(e,t,i,n),this.hitTestResult=new ya(()=>Ed.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._targetElement=null,this._ctx=e,this._eventTarget=o,this._targetElement=r;const a=!!this._eventTarget;this._useHitTestTarget=!a}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 n=t.isInContentArea?Rt.CONTENT_VIEW_ZONE:Rt.GUTTER_VIEW_ZONE;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return Nh.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),n=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(Rt.GUTTER_GLYPH_MARGIN,n,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(Rt.GUTTER_LINE_NUMBERS,n,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(Rt.GUTTER_LINE_DECORATIONS,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!Nh.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new oe(1,1),zOe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new oe(n,o),zOe)}if(Nh.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const r=e.getLineWidth(n),a=Fde(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new oe(n,1),a)}const o=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=o){const r=Fde(t.mouseContentHorizontalOffset-o),a=new oe(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===bT.Content?Ed.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(Nh.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Nh.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new oe(n,o))}}return null}static _hitTestScrollbar(e,t){if(Nh.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new oe(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(x.layoutInfo),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return Ed._getMouseColumn(n,t.get(x.fontInfo).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const r=n.lineNumber,a=n.column,c=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>c){const b=Fde(t.mouseContentHorizontalOffset-c);return t.fulfillContentEmpty(n,b)}const l=e.visibleRangeForPosition(r,a);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:a}),a>1){const b=e.visibleRangeForPosition(r,a-1);b&&h.push({offset:b.left,column:a-1})}const u=e.viewModel.getLineMaxColumn(r);if(ab.offset-w.offset);const f=t.pos.toClientCoordinates(ct(e.viewDomNode)),p=i.getBoundingClientRect(),m=p.left<=f.clientX&&f.clientX<=p.right;let v=null;for(let b=1;bo)){const a=Math.floor((n+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 Gre(t.pos.x,c),d=this._actualDoHitTestWithCaretRangeFromPoint(e,l.toClientCoordinates(ct(e.viewDomNode)));if(d.type===bT.Content)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(ct(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=fM(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=jpt(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new vE;const o=n.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)===lS.CLASS_NAME?F0.createFromDOMInfo(e,r,n.startOffset):new vE(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)===lS.CLASS_NAME?F0.createFromDOMInfo(e,o,o.textContent.length):new vE(o)}return new vE}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const n=i.offsetNode.parentNode,o=n?n.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===lS.CLASS_NAME?F0.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new vE(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,o=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,r=n?n.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===lS.CLASS_NAME){const c=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(c)return F0.createFromDOMInfo(e,c,0)}else if(a===lS.CLASS_NAME)return F0.createFromDOMInfo(e,i.offsetNode,0)}return new vE(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=G8.atomicPosition(i,e.column-1,n,Zx.Nearest);return o!==-1?new oe(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new vE;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(ct(e.viewDomNode)))),i.type===bT.Content){const n=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,Io.None);(n||!o.equals(i.position))&&(i=new aqe(o,i.spanNode,n))}return i}}function jpt(s,e,t){const i=document.createRange();let n=s.elementFromPoint(e,t);if(n!==null){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const o=n.getBoundingClientRect(),r=ct(n),a=r.getComputedStyle(n,null).getPropertyValue("font-style"),c=r.getComputedStyle(n,null).getPropertyValue("font-variant"),l=r.getComputedStyle(n,null).getPropertyValue("font-weight"),d=r.getComputedStyle(n,null).getPropertyValue("font-size"),h=r.getComputedStyle(n,null).getPropertyValue("line-height"),u=r.getComputedStyle(n,null).getPropertyValue("font-family"),f=`${a} ${c} ${l} ${d}/${h} ${u}`,p=n.innerText;let m=o.left,v=0,b;if(e>o.left+o.width)v=p.length;else{const w=Vpe.getInstance();for(let y=0;y{t.add(ue(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(ue(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(ue(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:si,disposables:this._store}))}static addTarget(e){if(!Vl.isTouchDevice())return V.None;Vl.INSTANCE||(Vl.INSTANCE=w2(new Vl));const t=Vl.INSTANCE.targets.push(e);return Ee(t)}static ignoreTarget(e){if(!Vl.isTouchDevice())return V.None;Vl.INSTANCE||(Vl.INSTANCE=w2(new Vl));const t=Vl.INSTANCE.ignoreTargets.push(e);return Ee(t)}static isTouchDevice(){return"ontouchstart"in si||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,n=e.targetTouches.length;i=Vl.HOLD_DELAY&&Math.abs(c.initialPageX-bg(c.rollingPageX))<30&&Math.abs(c.initialPageY-bg(c.rollingPageY))<30){const d=this.newGestureEvent(uo.Contextmenu,c.initialTarget);d.pageX=bg(c.rollingPageX),d.pageY=bg(c.rollingPageY),this.dispatchEvent(d)}else if(n===1){const d=bg(c.rollingPageX),h=bg(c.rollingPageY),u=bg(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(uo.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===uo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Vl.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===uo.Change||e.type===uo.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 n=0,o=e.initialTarget;for(;o&&o!==i;)n++,o=o.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,o,r,a,c,l){this.handle=Tl(e,()=>{const d=Date.now(),h=d-i;let u=0,f=0,p=!0;n+=Vl.SCROLL_FRICTION*h,a+=Vl.SCROLL_FRICTION*h,n>0&&(p=!1,u=o*n*h),a>0&&(p=!1,f=c*a*h);const m=this.newGestureEvent(uo.Change);m.translationX=u,m.translationY=f,t.forEach(v=>v.dispatchEvent(m)),p||this.inertia(e,t,d,n,o,r+u,a,c,l+f)})}onTouchMove(e){const t=Date.now();for(let i=0,n=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)}};Vl.SCROLL_FRICTION=-.005,Vl.HOLD_DELAY=700,Vl.CLEAR_TAP_COUNT_TIME=400;let ud=Vl;function Ypt(s,e,t){let i=0;for(let o=0;o!0,Xpt=()=>!1,Zpt=s=>s===" "||s===" ";class nP{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,n){this.languageConfigurationService=n,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 n=y1(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return kTe(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Zpt;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Jpt;case"never":return Xpt}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return qa.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=qa.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(nr?r:n}}let Rn=class cqe{static fromModelState(e){return new emt(e)}static fromViewState(e){return new tmt(e)}static fromModelSelection(e){const t=dt.liftSelection(e),i=new Al(F.fromPositions(t.getSelectionStart()),Uh.Simple,0,t.getPosition(),0);return cqe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;io,l=n>r,d=nr||bn||v0&&n--,O0.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=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));n=Math.max(n,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-W6e(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 n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=G8.atomicPosition(o,t.column-1,i,Zx.Left);if(r!==-1&&r+1>=n)return new oe(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?As.leftPositionAtomicSoftTabs(t,i,e.tabSize):As.leftPosition(t,i);return new Ode(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const c=i.position.delta(void 0,-(o-1)),l=t.normalizePosition(As.clipPositionColumn(c,t),Io.Left),d=As.left(e,t,l);r=d.lineNumber,a=d.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new oe(e.lineNumber,As.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?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),f?o=0:o=l-qa.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),c!==void 0){const p=new oe(i,n),m=t.normalizePosition(p,c);o=o+(n-m.column),i=m.lineNumber,n=m.column}return new Ode(i,n,o)}static down(e,t,i,n,o,r,a){return this.vertical(e,t,i,n,o,i+r,a,Io.RightOfInjectedText)}static moveDown(e,t,i,n,o){let r,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let c=0,l;do if(l=As.down(e,t,r+c,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new oe(l.lineNumber,l.column),Io.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(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=u.length+1)return!1;const f=u.charAt(h.column-2),p=n.get(f);if(!p)return!1;if(Rk(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=u.charAt(h.column-1);let v=!1;for(const b of p)b.open===f&&b.close===m&&(v=!0);if(!v)return!1;if(e==="auto"){let b=!1;for(let w=0,y=a.length;w1){const o=t.getLineContent(n.lineNumber),r=xh(o),a=r===-1?o.length+1:r+1;if(n.column<=a){const c=i.visibleColumnFromColumn(t,n),l=qa.prevIndentTabStop(c,i.indentSize),d=i.columnFromVisibleColumn(t,n.lineNumber,l);return new F(n.lineNumber,d,n.lineNumber,n.column)}}return F.fromPositions(_M.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=lat(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 n=[];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 F(d,h,u,f);o=p,p.isEmpty()?n[r]=null:n[r]=new Zl(p,"")}else n[r]=null;else n[r]=new Zl(c,"")}return new Xu(sr.Other,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}var Oi;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(Oi||(Oi={}));var xr;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Separator=2]="Separator"})(xr||(xr={}));var gs;(function(s){s[s.WordStart=0]="WordStart",s[s.WordStartFast=1]="WordStartFast",s[s.WordEnd=2]="WordEnd",s[s.WordAccessibility=3]="WordAccessibility"})(gs||(gs={}));class hs{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:xr.Regular,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=xr.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===zr.Regular){if(n===xr.Separator)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1));n=xr.Regular}else if(c===zr.WordSeparator){if(n===xr.Regular)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1));n=xr.Separator}else if(c===zr.Whitespace&&n!==xr.None)return this._createWord(e,n,c,r+1,this._findEndOfWord(e,t,n,r+1))}return n!==xr.None?this._createWord(e,n,zr.Whitespace,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let a=n;a=0;r--){const a=e.charCodeAt(r),c=t.get(a);if(o&&r===o.index)return r;if(c===zr.Whitespace||i===xr.Regular&&c===zr.WordSeparator||i===xr.Separator&&c===zr.Regular)return r+1}return 0}static moveWordLeft(e,t,i,n,o){let r=i.lineNumber,a=i.column;a===1&&r>1&&(r=r-1,a=t.getLineMaxColumn(r));let c=hs._findPreviousWordOnLine(e,t,new oe(r,a));if(n===gs.WordStart)return new oe(r,c?c.start+1:1);if(n===gs.WordStartFast)return!o&&c&&c.wordType===xr.Separator&&c.end-c.start===1&&c.nextCharClass===zr.Regular&&(c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1))),new oe(r,c?c.start+1:1);if(n===gs.WordAccessibility){for(;c&&c.wordType===xr.Separator;)c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1));return new oe(r,c?c.start+1:1)}return c&&a<=c.end+1&&(c=hs._findPreviousWordOnLine(e,t,new oe(r,c.start+1))),new oe(r,c?c.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=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===B.Underline&&c!==B.Underline)return new oe(i,r);if(a===B.Dash&&c!==B.Dash)return new oe(i,r);if((mx(a)||_G(a))&&Nw(c))return new oe(i,r);if(Nw(a)&&Nw(c)&&r+1=c.start+1&&(c=hs._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,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(c--,l=n.getLineMaxColumn(c)):(d&&l<=d.end+1&&(d=hs._findPreviousWordOnLine(i,n,new oe(c,d.start+1))),d?l=d.end+1:l>1?l=1:(c--,l=n.getLineMaxColumn(c))),new F(c,l,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new oe(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,n);return o||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===B.Space||i===B.Tab}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(n===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,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new F(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 F(i.lineNumber,h,i.lineNumber,u)),c=h=>{let u=h.start+1,f=h.end+1,p=!1;for(;f-11&&this._charAtIsWhitespace(n,u-2);)u--;return a(u,f)},l=hs._findPreviousWordOnLine(e,t,i);if(l&&r(l))return c(l);const d=hs._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(),n=hs._moveWordPartLeft(e,i);return new F(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=u.start+1&&(u=hs._findNextWordOnLine(i,n,new oe(c,u.end+1))),u?l=u.start+1:l!!e)}class vl{static addCursorDown(e,t,i){const n=[];let o=0;for(let r=0,a=t.length;rl&&(d=l,h=e.model.getLineMaxColumn(d)),Rn.fromModelState(new Al(new F(r.lineNumber,1,d,h),Uh.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)),Rn.fromViewState(t.viewState.move(!0,d,h,0))}else{const l=t.modelState.selectionStart.getEndPosition();return Rn.fromModelState(t.modelState.move(!0,l.lineNumber,l.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return Rn.fromModelState(hs.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Rn(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Rn.fromViewState(new Al(new F(i,n,i,n),Uh.Simple,0,new oe(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(t.modelState.selectionStartKind===Uh.Word)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===Uh.Line)return this.line(e,t,i,n,o)}const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new oe(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return Rn.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,o,r){switch(i){case Mi.Direction.Left:return r===Mi.Unit.HalfLine?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case Mi.Direction.Right:return r===Mi.Unit.HalfLine?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case Mi.Direction.Up:return r===Mi.Unit.WrappedLine?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case Mi.Direction.Down:return r===Mi.Unit.WrappedLine?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case Mi.Direction.PrevBlankLine:return r===Mi.Unit.WrappedLine?t.map(a=>Rn.fromViewState(As.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Rn.fromModelState(As.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Mi.Direction.NextBlankLine:return r===Mi.Unit.WrappedLine?t.map(a=>Rn.fromViewState(As.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>Rn.fromModelState(As.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case Mi.Direction.WrappedLineStart:return this._moveToViewMinColumn(e,t,n);case Mi.Direction.WrappedLineFirstNonWhitespaceCharacter:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case Mi.Direction.WrappedLineColumnCenter:return this._moveToViewCenterColumn(e,t,n);case Mi.Direction.WrappedLineEnd:return this._moveToViewMaxColumn(e,t,n);case Mi.Direction.WrappedLineLastNonWhitespaceCharacter:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case Mi.Direction.ViewPortTop:{const c=this._firstLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortBottom:{const c=this._lastLineNumberInRange(e.model,a,o),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortCenter:{const c=Math.round((a.startLineNumber+a.endLineNumber)/2),l=e.model.getLineFirstNonWhitespaceColumn(c);return[this._moveToModelPosition(e,t[0],n,c,l)]}case Mi.Direction.ViewPortIfOutside:{const c=[];for(let l=0,d=t.length;li.endLineNumber-1?r=i.endLineNumber-1:oRn.fromViewState(As.moveLeft(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,r=t.length;oRn.fromViewState(As.moveRight(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];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 E1(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=E1(i,e.startColumn-1),o=gd.createEmpty("",n.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(n.firstCharOffset===0))return o;const l=t(r);if(!(n.languageId===l.languageId))return o;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class _qe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const c=ho(r);return a+r.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const n=this.model.tokenization.getLineTokens(e);let o=this.getProcessedTokens(n).getLineContent();return t!==void 0&&(o=i(o,t)),o}getProcessedTokens(e){const t=c=>c===nr.String||c===nr.RegEx||c===nr.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})}),gd.createFromTextAndMetadata(r,e.languageIdCodec)}}function $Te(s,e){s.tokenization.forceTokenization(e.lineNumber);const t=s.tokenization.getLineTokens(e.lineNumber),i=E1(t,e.column-1),n=i.firstCharOffset===0,o=t.getLanguageId(0)===i.languageId;return!n&&!o}function PO(s,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(n);if(!o)return null;const a=new zTe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=o.onEnter(s,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===yr.Indent&&(f=" "+f):u===yr.Indent||u===yr.IndentOutdent?f=" ":f="";let m=DKe(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var kq;const Gde=Object.create(null);function PI(s,e){if(e<=0)return"";Gde[s]||(Gde[s]=["",s]);const t=Gde[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let _m=kq=class{static unshiftIndent(e,t,i,n,o){const r=qa.visibleColumnFromColumn(e,t,i);if(o){const a=PI(" ",n),l=qa.prevIndentTabStop(r,n)/n;return PI(a,l)}else{const a=" ",l=qa.prevRenderTabStop(r,i)/i;return PI(a,l)}}static shiftIndent(e,t,i,n,o){const r=qa.visibleColumnFromColumn(e,t,i);if(o){const a=PI(" ",n),l=qa.nextIndentTabStop(r,n)/n;return PI(a,l)}else{const a=" ",l=qa.nextRenderTabStop(r,i)/i;return PI(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 n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,c=i===n;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<=n;h++,l=d){d=0;const u=e.getLineContent(h);let f=kh(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&&qa.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=PO(this._opts.autoIndent,e,new F(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(v){if(d=l,v.appendText)for(let b=0,w=v.appendText.length;b1){let n,o=-1;for(n=e-1;n>=1;n--){if(s.tokenization.getLanguageIdAtPosition(n,0)!==i)return o;const r=s.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(r)||r===""){o=n;continue}return n}}return-1}function j8(s,e,t,i=!0,n){if(s0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=mmt(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:ho(c),action:yr.Indent,line:a}}else if(r.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:ho(c),action:null,line:a}}else{if(a===1)return{indentation:ho(e.getLineContent(a)),action:null,line:a};const c=a-1,l=o.getIndentMetadata(e.getLineContent(c));if(!(l&(mb.INCREASE_MASK|mb.DECREASE_MASK))&&l&mb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:ho(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:ho(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:ho(e.getLineContent(d)),action:yr.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:ho(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:ho(e.getLineContent(d)),action:null,line:d}}return{indentation:ho(e.getLineContent(1)),action:null,line:1}}}function a5(s,e,t,i,n,o){if(s0){const b=e.getLineContent(v);if(l.shouldIndentNextLine(b)&&l.shouldIncrease(m)){const y=j8(r,e,t.startLineNumber,!1,o)?.indentation;if(y!==void 0){const C=e.getLineContent(t.startLineNumber),A=ho(C),k=n.shiftIndent(y)===A,P=/^\s*$/.test(p),R=s.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),G=R&&R.length>0&&P;if(k&&G)return y}}}return null}function vqe(s,e,t){const i=t.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;return!i||e<1||e>s.getLineCount()?null:i.getIndentMetadata(s.getLineContent(e))}function bmt(s,e,t){return{tokenization:{getLineTokens:n=>n===e?t:s.tokenization.getLineTokens(n),getLanguageId:()=>s.getLanguageId(),getLanguageIdAtPosition:(n,o)=>s.getLanguageIdAtPosition(n,o)},getLineContent:n=>n===e?t.getLineContent():s.getLineContent(n)}}class wmt{static getEdits(e,t,i,n,o){if(!o&&this._isAutoIndentType(e,t,i)){const r=[];for(const c of i){const l=this._findActualIndentationForSelection(e,t,c,n);if(l===null)return;r.push({selection:c,indentation:l})}const a=jpe.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,r,n,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndenttae(e,a),unshiftIndent:a=>Y8(e,a)},e.languageConfigurationService);if(o===null)return null;const r=DKe(t,i.startLineNumber,i.startColumn);return o===e.normalizeIndentation(r)?null:o}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,o){const r=i.map(({selection:c,indentation:l})=>{if(o!==null){const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!1);return new Lmt(d,c,n,o)}else{const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!0);return t0(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new tg(sr.TypingOther,r,a)}static _getEditFromIndentationAndSelection(e,t,i,n,o,r=!0){const a=n.startLineNumber,c=t.getLineFirstNonWhitespaceColumn(a);let l=e.normalizeIndentation(i);if(c!==0){const h=t.getLineContent(a);l+=h.substring(c-1,n.startColumn-1)}return l+=r?o:"",{range:new F(a,1,n.endLineNumber,n.endColumn),text:l}}}class ymt{static getEdits(e,t,i,n,o,r){if(bqe(t,i,n,o,r))return this._runAutoClosingOvertype(e,n,r)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let o=0,r=t.length;onew td(new F(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new tg(sr.TypingOther,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class jpe{static getEdits(e,t,i,n,o,r){if(!r){const a=this.getAutoClosingPairClose(e,t,i,n,o);if(a!==null)return this._runAutoClosingOpenCharType(i,n,o,a)}}static _runAutoClosingOpenCharType(e,t,i,n){const o=[];for(let r=0,a=e.length;r{const m=p.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-n.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)),n);if(!a)return null;let c,l;if(Ok(n)?(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:b}=p,w=t.getLineContent(m),y=w.substring(0,v-1),C=w.substring(b-1);if(C.startsWith(u)||(f=!1),C.length>0){const P=C.charAt(0);if(!this._isBeforeClosingBrace(e,C)&&!l(P))return null}if(a.open.length===1&&(n==="'"||n==='"')&&c!=="always"){const P=fm(e.wordSeparators,[]);if(y.length>0){const R=y.charCodeAt(y.length-1);if(P.get(R)===zr.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const A=t.tokenization.getLineTokens(m),L=E1(A,v-1);if(!a.shouldAutoClose(L,v-L.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const P=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(P))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of n)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 _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);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 F(l.lineNumber,l.column-a.open.length+1,l.lineNumber,l.column))+n!==a.open){c=!1;break}c&&(r=a)}return r}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(c=>t.startsWith(c.open)),a=o.some(c=>t.startsWith(c.close));return!r&&a}}class Smt{static getEdits(e,t,i,n,o){if(!o&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];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 y1(p,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=y1(i,e.startColumn-1),o=hd.createEmpty("",n.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(n.firstCharOffset===0))return o;const l=t(r);if(!(n.languageId===l.languageId))return o;const h=l.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(h)}}class lqe{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){const i=(r,a)=>{const c=ho(r);return a+r.substring(c.length)};this.model.tokenization.forceTokenization?.(e);const n=this.model.tokenization.getLineTokens(e);let o=this.getProcessedTokens(n).getLineContent();return t!==void 0&&(o=i(o,t)),o}getProcessedTokens(e){const t=c=>c===nr.String||c===nr.RegEx||c===nr.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})}),hd.createFromTextAndMetadata(r,e.languageIdCodec)}}function RTe(s,e){s.tokenization.forceTokenization(e.lineNumber);const t=s.tokenization.getLineTokens(e.lineNumber),i=y1(t,e.column-1),n=i.firstCharOffset===0,o=t.getLanguageId(0)===i.languageId;return!n&&!o}function LO(s,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(n);if(!o)return null;const a=new LTe(e,i).getProcessedTokenContextAroundRange(t),c=a.previousLineProcessedTokens.getLineContent(),l=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),h=o.onEnter(s,c,l,d);if(!h)return null;const u=h.indentAction;let f=h.appendText;const p=h.removeText||0;f?u===yr.Indent&&(f=" "+f):u===yr.Indent||u===yr.IndentOutdent?f=" ":f="";let m=bKe(e,t.startLineNumber,t.startColumn);return p&&(m=m.substring(0,m.length-p)),{indentAction:u,appendText:f,removeText:p,indentation:m}}var xq;const Bde=Object.create(null);function II(s,e){if(e<=0)return"";Bde[s]||(Bde[s]=["",s]);const t=Bde[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let fm=xq=class{static unshiftIndent(e,t,i,n,o){const r=qa.visibleColumnFromColumn(e,t,i);if(o){const a=II(" ",n),l=qa.prevIndentTabStop(r,n)/n;return II(a,l)}else{const a=" ",l=qa.prevRenderTabStop(r,i)/i;return II(a,l)}}static shiftIndent(e,t,i,n,o){const r=qa.visibleColumnFromColumn(e,t,i);if(o){const a=II(" ",n),l=qa.nextIndentTabStop(r,n)/n;return II(a,l)}else{const a=" ",l=qa.nextRenderTabStop(r,i)/i;return II(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 n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,c=i===n;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<=n;h++,l=d){d=0;const u=e.getLineContent(h);let f=xh(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&&qa.visibleColumnFromColumn(u,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(h-1)){const v=LO(this._opts.autoIndent,e,new F(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)),this._languageConfigurationService);if(v){if(d=l,v.appendText)for(let b=0,w=v.appendText.length;b1){let n,o=-1;for(n=e-1;n>=1;n--){if(s.tokenization.getLanguageIdAtPosition(n,0)!==i)return o;const r=s.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(r)||r===""){o=n;continue}return n}}return-1}function K8(s,e,t,i=!0,n){if(s0&&e.getLineContent(c)==="";c--)if(c===1)return{indentation:"",action:null};const a=omt(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:ho(c),action:yr.Indent,line:a}}else if(r.shouldDecrease(a)){const c=e.getLineContent(a);return{indentation:ho(c),action:null,line:a}}else{if(a===1)return{indentation:ho(e.getLineContent(a)),action:null,line:a};const c=a-1,l=o.getIndentMetadata(e.getLineContent(c));if(!(l&(gb.INCREASE_MASK|gb.DECREASE_MASK))&&l&gb.INDENT_NEXTLINE_MASK){let d=0;for(let h=c-1;h>0;h--)if(!r.shouldIndentNextLine(h)){d=h;break}return{indentation:ho(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:ho(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:ho(e.getLineContent(d)),action:yr.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:ho(e.getLineContent(h+1)),action:null,line:h+1}}else if(r.shouldDecrease(d))return{indentation:ho(e.getLineContent(d)),action:null,line:d}}return{indentation:ho(e.getLineContent(1)),action:null,line:1}}}function s5(s,e,t,i,n,o){if(s0){const b=e.getLineContent(v);if(l.shouldIndentNextLine(b)&&l.shouldIncrease(m)){const y=K8(r,e,t.startLineNumber,!1,o)?.indentation;if(y!==void 0){const C=e.getLineContent(t.startLineNumber),A=ho(C),k=n.shiftIndent(y)===A,P=/^\s*$/.test(p),R=s.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),G=R&&R.length>0&&P;if(k&&G)return y}}}return null}function dqe(s,e,t){const i=t.getLanguageConfiguration(s.getLanguageId()).indentRulesSupport;return!i||e<1||e>s.getLineCount()?null:i.getIndentMetadata(s.getLineContent(e))}function cmt(s,e,t){return{tokenization:{getLineTokens:n=>n===e?t:s.tokenization.getLineTokens(n),getLanguageId:()=>s.getLanguageId(),getLanguageIdAtPosition:(n,o)=>s.getLanguageIdAtPosition(n,o)},getLineContent:n=>n===e?t.getLineContent():s.getLineContent(n)}}class lmt{static getEdits(e,t,i,n,o){if(!o&&this._isAutoIndentType(e,t,i)){const r=[];for(const c of i){const l=this._findActualIndentationForSelection(e,t,c,n);if(l===null)return;r.push({selection:c,indentation:l})}const a=zpe.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,r,n,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndentJre(e,a),unshiftIndent:a=>q8(e,a)},e.languageConfigurationService);if(o===null)return null;const r=bKe(t,i.startLineNumber,i.startColumn);return o===e.normalizeIndentation(r)?null:o}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,o){const r=i.map(({selection:c,indentation:l})=>{if(o!==null){const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!1);return new wmt(d,c,n,o)}else{const d=this._getEditFromIndentationAndSelection(e,t,l,c,n,!0);return XI(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new Xu(sr.TypingOther,r,a)}static _getEditFromIndentationAndSelection(e,t,i,n,o,r=!0){const a=n.startLineNumber,c=t.getLineFirstNonWhitespaceColumn(a);let l=e.normalizeIndentation(i);if(c!==0){const h=t.getLineContent(a);l+=h.substring(c-1,n.startColumn-1)}return l+=r?o:"",{range:new F(a,1,n.endLineNumber,n.endColumn),text:l}}}class dmt{static getEdits(e,t,i,n,o,r){if(hqe(t,i,n,o,r))return this._runAutoClosingOvertype(e,n,r)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let o=0,r=t.length;onew Zl(new F(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new Xu(sr.TypingOther,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class zpe{static getEdits(e,t,i,n,o,r){if(!r){const a=this.getAutoClosingPairClose(e,t,i,n,o);if(a!==null)return this._runAutoClosingOpenCharType(i,n,o,a)}}static _runAutoClosingOpenCharType(e,t,i,n){const o=[];for(let r=0,a=e.length;r{const m=p.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-n.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)),n);if(!a)return null;let c,l;if(Rk(n)?(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:b}=p,w=t.getLineContent(m),y=w.substring(0,v-1),C=w.substring(b-1);if(C.startsWith(u)||(f=!1),C.length>0){const P=C.charAt(0);if(!this._isBeforeClosingBrace(e,C)&&!l(P))return null}if(a.open.length===1&&(n==="'"||n==='"')&&c!=="always"){const P=hm(e.wordSeparators,[]);if(y.length>0){const R=y.charCodeAt(y.length-1);if(P.get(R)===zr.Regular)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const A=t.tokenization.getLineTokens(m),L=y1(A,v-1);if(!a.shouldAutoClose(L,v-L.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const P=t.tokenization.getTokenTypeIfInsertingCharacter(m,v,k);if(!a.isOK(P))return null}}return f?a.close.substring(0,a.close.length-u.length):a.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of n)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 _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);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 F(l.lineNumber,l.column-a.open.length+1,l.lineNumber,l.column))+n!==a.open){c=!1;break}c&&(r=a)}return r}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(c=>t.startsWith(c.open)),a=o.some(c=>t.startsWith(c.close));return!r&&a}}class umt{static getEdits(e,t,i,n,o){if(!o&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let o=0,r=t.length;o=ll.Full){const c=_mt(e.autoIndent,t,n,{unshiftIndent:l=>Y8(e,l),shiftIndent:l=>tae(e,l),normalizeIndentation:l=>e.normalizeIndentation(l)},e.languageConfigurationService);if(c){let l=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=kh(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Dq(n,` -`+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 cY(n,` -`+e.normalizeIndentation(c.afterEnter),0,f,!0)}}}return t0(n,` -`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;othis._compositionType(i,d,o,r,a,c));return new tg(sr.TypingOther,l,{shouldPushStackElementBefore:eae(e,sr.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),c=Math.max(1,a.column-n),l=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new F(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&r===0?null:new cY(d,i,0,r)}}class kmt{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(T_(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=PO(e.autoIndent,t,new F(a,c,a,c),e.languageConfigurationService);l&&(o=l.indentation+l.appendText)}return n&&(n===yr.Indent&&(o=tae(e,o)),n===yr.Outdent&&(o=Y8(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){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;d2?l.charCodeAt(c.column-2):B.Null)===B.Backslash&&h)return!1;if(s.autoClosingOvertype==="auto"){let f=!1;for(let p=0,m=i.length;p{const n=t.get(Kt).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=Bc();return n&&["input","textarea"].indexOf(n.tagName.toLowerCase())>=0?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(Kt).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(t,n,i)):!1})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}var My;(function(s){s[s.Regular=0]="Regular",s[s.Minimal=1]="Minimal",s[s.None=2]="None"})(My||(My={}));var Zc;(function(s){class e extends ia{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,C){if(!C.position)return;y.model.pushStackElement(),y.setCursorStates(C.source,Oi.Explicit,[bl.moveTo(y,y.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==My.None&&y.revealAllCursors(C.source,!0,!0)}}s.MoveTo=qe(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),s.MoveToSelect=qe(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ia{runCoreEditorCommand(y,C){y.model.pushStackElement();const A=this._getColumnSelectResult(y,y.getPrimaryCursorState(),y.getCursorColumnSelectData(),C);A!==null&&(y.setCursorStates(C.source,Oi.Explicit,A.viewStates.map(L=>Rn.fromViewState(L))),y.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:A.fromLineNumber,fromViewVisualColumn:A.fromVisualColumn,toViewLineNumber:A.toLineNumber,toViewVisualColumn:A.toVisualColumn}),A.reversed?y.revealTopMostCursor(C.source):y.revealBottomMostCursor(C.source))}}s.ColumnSelect=qe(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(w,y,C,A){if(typeof A.position>"u"||typeof A.viewPosition>"u"||typeof A.mouseColumn>"u")return null;const L=w.model.validatePosition(A.position),k=w.coordinatesConverter.validateViewPosition(new oe(A.viewPosition.lineNumber,A.viewPosition.column),L),P=A.doColumnSelect?C.fromViewLineNumber:k.lineNumber,R=A.doColumnSelect?C.fromViewVisualColumn:A.mouseColumn-1;return U0.columnSelect(w.cursorConfig,w,P,R,k.lineNumber,A.mouseColumn-1)}}),s.CursorColumnSelectLeft=qe(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.LeftArrow,linux:{primary:0}}})}_getColumnSelectResult(w,y,C,A){return U0.columnSelectLeft(w.cursorConfig,w,C)}}),s.CursorColumnSelectRight=qe(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.RightArrow,linux:{primary:0}}})}_getColumnSelectResult(w,y,C,A){return U0.columnSelectRight(w.cursorConfig,w,C)}});class i extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return U0.columnSelectUp(y.cursorConfig,y,A,this._isPaged)}}s.CursorColumnSelectUp=qe(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.UpArrow,linux:{primary:0}}})),s.CursorColumnSelectPageUp=qe(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.PageUp,linux:{primary:0}}}));class n extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return U0.columnSelectDown(y.cursorConfig,y,A,this._isPaged)}}s.CursorColumnSelectDown=qe(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.DownArrow,linux:{primary:0}}})),s.CursorColumnSelectPageDown=qe(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.PageDown,linux:{primary:0}}}));class o extends ia{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Mi.metadata})}runCoreEditorCommand(y,C){const A=Mi.parse(C);A&&this._runCursorMove(y,C.source,A)}_runCursorMove(y,C,A){y.model.pushStackElement(),y.setCursorStates(C,Oi.Explicit,o._move(y,y.getCursorStates(),A)),y.revealAllCursors(C,!0)}static _move(y,C,A){const L=A.select,k=A.value;switch(A.direction){case Mi.Direction.Left:case Mi.Direction.Right:case Mi.Direction.Up:case Mi.Direction.Down:case Mi.Direction.PrevBlankLine:case Mi.Direction.NextBlankLine:case Mi.Direction.WrappedLineStart:case Mi.Direction.WrappedLineFirstNonWhitespaceCharacter:case Mi.Direction.WrappedLineColumnCenter:case Mi.Direction.WrappedLineEnd:case Mi.Direction.WrappedLineLastNonWhitespaceCharacter:return bl.simpleMove(y,C,A.direction,L,k,A.unit);case Mi.Direction.ViewPortTop:case Mi.Direction.ViewPortBottom:case Mi.Direction.ViewPortCenter:case Mi.Direction.ViewPortIfOutside:return bl.viewportMove(y,C,A.direction,L,k);default:return null}}}s.CursorMoveImpl=o,s.CursorMove=qe(new o);let r;(function(w){w[w.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(r||(r={}));class a extends ia{constructor(y){super(y),this._staticArgs=y.args}runCoreEditorCommand(y,C){let A=this._staticArgs;this._staticArgs.value===r.PAGE_SIZE_MARKER&&(A={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:C.pageSize||y.cursorConfig.pageSize}),y.model.pushStackElement(),y.setCursorStates(C.source,Oi.Explicit,bl.simpleMove(y,y.getCursorStates(),A.direction,A.select,A.value,A.unit)),y.revealAllCursors(C.source,!0)}}s.CursorLeft=qe(new a({args:{direction:Mi.Direction.Left,unit:Mi.Unit.None,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.LeftArrow,mac:{primary:S.LeftArrow,secondary:[U.WinCtrl|S.KeyB]}}})),s.CursorLeftSelect=qe(new a({args:{direction:Mi.Direction.Left,unit:Mi.Unit.None,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.LeftArrow}})),s.CursorRight=qe(new a({args:{direction:Mi.Direction.Right,unit:Mi.Unit.None,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.RightArrow,mac:{primary:S.RightArrow,secondary:[U.WinCtrl|S.KeyF]}}})),s.CursorRightSelect=qe(new a({args:{direction:Mi.Direction.Right,unit:Mi.Unit.None,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.RightArrow}})),s.CursorUp=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.UpArrow,mac:{primary:S.UpArrow,secondary:[U.WinCtrl|S.KeyP]}}})),s.CursorUpSelect=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.UpArrow,secondary:[U.CtrlCmd|U.Shift|S.UpArrow],mac:{primary:U.Shift|S.UpArrow},linux:{primary:U.Shift|S.UpArrow}}})),s.CursorPageUp=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageUp}})),s.CursorPageUpSelect=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.PageUp}})),s.CursorDown=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.DownArrow,mac:{primary:S.DownArrow,secondary:[U.WinCtrl|S.KeyN]}}})),s.CursorDownSelect=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.DownArrow,secondary:[U.CtrlCmd|U.Shift|S.DownArrow],mac:{primary:U.Shift|S.DownArrow},linux:{primary:U.Shift|S.DownArrow}}})),s.CursorPageDown=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageDown}})),s.CursorPageDownSelect=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.PageDown}})),s.CreateCursor=qe(new class extends ia{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(w,y){if(!y.position)return;let C;y.wholeLine?C=bl.line(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition):C=bl.moveTo(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition);const A=w.getCursorStates();if(A.length>1){const L=C.modelState?C.modelState.position:null,k=C.viewState?C.viewState.position:null;for(let P=0,R=A.length;Pk&&(L=k);const P=new F(L,1,L,w.model.getLineMaxColumn(L));let R=_s.Simple;if(C.at)switch(C.at){case sF.RawAtArgument.Top:R=_s.Top;break;case sF.RawAtArgument.Center:R=_s.Center;break;case sF.RawAtArgument.Bottom:R=_s.Bottom;break}const z=w.coordinatesConverter.convertModelRangeToViewRange(P);w.revealRange(y.source,!1,z,R,mt.Smooth)}}),s.SelectAll=new class extends Ype{constructor(){super(hht)}runDOMCommand(w){rf&&(w.focus(),w.select()),w.ownerDocument.execCommand("selectAll")}runEditorCommand(w,y,C){const A=y._getViewModel();A&&this.runCoreEditorCommand(A,C)}runCoreEditorCommand(w,y){w.model.pushStackElement(),w.setCursorStates("keyboard",Oi.Explicit,[bl.selectAll(w,w.getPrimaryCursorState())])}},s.SetSelection=qe(new class extends ia{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(w,y){y.selection&&(w.model.pushStackElement(),w.setCursorStates(y.source,Oi.Explicit,[Rn.fromModelSelection(y.selection)]))}})})(Zc||(Zc={}));const Mmt=he.and(J.textInputFocus,J.columnSelection);function AU(s,e){So.registerKeybindingRule({id:s,primary:e,when:Mmt,weight:os+1})}AU(Zc.CursorColumnSelectLeft.id,U.Shift|S.LeftArrow);AU(Zc.CursorColumnSelectRight.id,U.Shift|S.RightArrow);AU(Zc.CursorColumnSelectUp.id,U.Shift|S.UpArrow);AU(Zc.CursorColumnSelectPageUp.id,U.Shift|S.PageUp);AU(Zc.CursorColumnSelectDown.id,U.Shift|S.DownArrow);AU(Zc.CursorColumnSelectPageDown.id,U.Shift|S.PageDown);function sBe(s){return s.register(),s}var FO;(function(s){class e extends hc{runEditorCommand(i,n,o){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,o||{})}}s.CoreEditingCommand=e,s.LineBreakInsert=qe(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:J.writable,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyO}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Zre.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),s.Outdent=qe(new class extends e{constructor(){super({id:"outdent",precondition:J.writable,kbOpts:{weight:os,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus),primary:U.Shift|S.Tab}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,JE.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.Tab=qe(new class extends e{constructor(){super({id:"tab",precondition:J.writable,kbOpts:{weight:os,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus),primary:S.Tab}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,JE.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.DeleteLeft=qe(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.Backspace,secondary:[U.Shift|S.Backspace],mac:{primary:S.Backspace,secondary:[U.Shift|S.Backspace,U.WinCtrl|S.KeyH,U.WinCtrl|S.Backspace]}}})}runCoreEditingCommand(t,i,n){const[o,r]=yM.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(sr.DeletingLeft)}}),s.DeleteRight=qe(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.Delete,mac:{primary:S.Delete,secondary:[U.WinCtrl|S.KeyD,U.WinCtrl|S.Delete]}}})}runCoreEditingCommand(t,i,n){const[o,r]=yM.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(sr.DeletingRight)}}),s.Undo=new class extends Ype{constructor(){super(sKe)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().undo()}},s.Redo=new class extends Ype{constructor(){super(oKe)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(FO||(FO={}));class oBe extends Bre{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Kt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function LN(s,e){sBe(new oBe("default:"+s,s)),sBe(new oBe(s,s,e))}LN(oc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});LN(oc.ReplacePreviousChar);LN(oc.CompositionType);LN(oc.CompositionStart);LN(oc.CompositionEnd);LN(oc.Paste);LN(oc.Cut);let pd=class extends V{onclick(e,t){this._register(ue(e,ke.CLICK,i=>t(new Eh(ct(e),i))))}onmousedown(e,t){this._register(ue(e,ke.MOUSE_DOWN,i=>t(new Eh(ct(e),i))))}onmouseover(e,t){this._register(ue(e,ke.MOUSE_OVER,i=>t(new Eh(ct(e),i))))}onmouseleave(e,t){this._register(ue(e,ke.MOUSE_LEAVE,i=>t(new Eh(ct(e),i))))}onkeydown(e,t){this._register(ue(e,ke.KEY_DOWN,i=>t(new En(i))))}onkeyup(e,t){this._register(ue(e,ke.KEY_UP,i=>t(new En(i))))}oninput(e,t){this._register(ue(e,ke.INPUT,t))}onblur(e,t){this._register(ue(e,ke.BLUR,t))}onfocus(e,t){this._register(ue(e,ke.FOCUS,t))}onchange(e,t){this._register(ue(e,ke.CHANGE,t))}ignoreGesture(e){return fd.ignoreTarget(e)}};const $2=11;class Nmt extends pd{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(...We.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=$2+"px",this.domNode.style.height=$2+"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 SU),this._register(Ro(this.bgDomNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ro(this.domNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new X7),this._pointerdownScheduleRepeatTimer=this._register(new Cm)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ct(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 Pmt extends V{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 Cm)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===Co.Hidden?!1:this._visibility===Co.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 Fmt=140;class yqe extends pd{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 Pmt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new SU),this._shouldRender=!0,this.domNode=ls(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(ue(this.domNode.domNode,ke.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Nmt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ls(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 n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ue(this.slider.domNode,ke.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(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?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=Cr(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),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),n=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(Qn&&a>Fmt){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const l=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(n.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 Omt=20;class G2{constructor(e,t,i,n,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,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 G2(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,n,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),c=n>0&&n>i;if(!c)return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(Omt,Math.floor(i*a/n))),d=(a-l)/(n-i),h=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=G2._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 _M(null,1,0))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new _M(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===Co.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===Co.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class Wmt extends yqe{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new G2(t.verticalHasArrows?t.arrowSize:0,t.vertical===Co.Hidden?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-$2)/2,a=(t.verticalScrollbarSize-$2)/2;this._createArrow({className:"scra",icon:ve.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new _M(null,0,1))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new _M(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===Co.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var Hmt=".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)}";ut(Hmt,{});const Umt=500,rBe=50;class Vmt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const qne=class qne{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,n=this._rear;do{const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if(Q7){const t=ct(e.browserEvent),i=nlt(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 n=null;const o=new Vmt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(n=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,n)}_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 n=Math.abs(e.deltaX),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(n,r),1),l=Math.max(Math.min(o,a),1),d=Math.max(n,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}};qne.INSTANCE=new qne;let lY=qne;class qTe extends pd{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=zmt(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Wmt(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Bmt(this._scrollable,this._options,n)),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=ls(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ls(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ls(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 Cm),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=bt(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,Qt&&(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 _M(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=bt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new _M(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,ke.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=lY.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=!Qt&&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=rBe*o,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(r){const d=rBe*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 n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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,n=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${n}`)}}_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(),Umt)}}class Cqe extends qTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new yN({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ll(ct(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class l6 extends qTe{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 EU extends qTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new yN({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Ll(ct(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.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 zmt(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:Co.Auto,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:Co.Auto,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,Qt&&(e.className+=" mac"),e}class QTe extends c6{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._mouseOnOverflowWidgetsDomNode=!1,this._mouseOnViewDomNode=!1,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Dd(this._context,i),this._mouseDownOperation=this._register(new $mt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(a,c)=>this._createMouseTargetForView(a,c),a=>this._getMouseColumn(a))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(x.layoutInfo).height;const n=new Npt(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,a=>this._onContextMenu(a,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,a=>{this._mouseOnViewDomNode=!0,this._onMouseMoveOverView(a),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ue(this.viewHelper.viewDomNode.ownerDocument,"mousemove",c=>{this.viewHelper.viewDomNode.contains(c.target)||(this._mouseOnViewDomNode=!1,setTimeout(()=>{this._mouseOnOverflowWidgetsDomNode||this._onMouseLeave(new Fk(c,!1,this.viewHelper.viewDomNode))},0))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,a=>this._onMouseUp(a))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,a=>{this._mouseOnViewDomNode=!1,setTimeout(()=>{this._mouseOnOverflowWidgetsDomNode||this._onMouseLeave(a)},0)}));const o=this.viewHelper.overflowWidgetsDomNode;o&&(this._register(n.onMouseMove(o,a=>{this._mouseOnOverflowWidgetsDomNode=!0,this._mouseLeaveMonitor?.dispose(),this._mouseLeaveMonitor=null,this._onMouseMoveOverOverflowWidgetsDomNode(a)})),this._register(n.onMouseLeave(o,a=>{this._mouseOnOverflowWidgetsDomNode=!1,setTimeout(()=>{this._mouseOnViewDomNode||this._onMouseLeave(a)},0)})));let r=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(a,c)=>{r=c})),this._register(ue(this.viewHelper.viewDomNode,ke.POINTER_UP,a=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,a=>this._onMouseDown(a,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=lY.INSTANCE;let t=0,i=Qp.getZoomLevel(),n=!1,o=0;const r=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new _M(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=Qp.getZoomLevel(),h=l.deltaY>0?1:-1;Qp.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=Qp.getZoomLevel(),n=a(c),o=0),t=Date.now(),o+=l.deltaY,n&&(Qp.setZoomLevel(i+o/5),l.preventDefault(),l.stopPropagation())};this._register(ue(this.viewHelper.viewDomNode,ke.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(c){return Qt?(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 n=new hqe(e,t).toPageCoordinates(ct(this.viewHelper.viewDomNode)),o=OTe(this.viewHelper.viewDomNode);if(n.yo.y+o.height||n.xo.x+o.width)return null;const r=BTe(this.viewHelper.viewDomNode,o,n);return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),o,n,r,null)}_createMouseTargetForView(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=vM(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_createMouseTargetForOverflowWidgetsDomNode(e){return this.mouseTargetFactory.createMouseTargetForOverflowWidgetsDomNode(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,e.target)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTargetForView(e,t)})}_onMouseMoveOverView(e){this._onMouseMove(e,this._createMouseTargetForView(e,!0))}_onMouseMoveOverOverflowWidgetsDomNode(e){this._onMouseMove(e,this._createMouseTargetForOverflowWidgetsDomNode(e))}_onMouseMove(e,t){this._shouldIgnoreMouseMoveEvent(e)||this.viewController.emitMouseMove({event:e,target:t})}_shouldIgnoreMouseMoveEvent(e){return this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||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 $mt extends V{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new Fpt(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Gmt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new Jpe,this._currentSelection=new dt(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===Rt.OUTSIDE_EDITOR&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,My.Minimal)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===Rt.GUTTER_LINE_NUMBERS),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.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()&&n.type===Rt.CONTENT_TEXT&&n.position&&this._currentSelection.containsPosition(n.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);d_(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(n,t.shiftKey,My.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,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=n.getCurrentScrollTop()+e.relativePos.y,l=wM.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return uh.createOutsideEditor(o,h,"below",a)}const d=n.getLineNumberAtVerticalOffset(c);return uh.createOutsideEditor(o,new oe(d,i.getLineMaxColumn(d)),"below",a)}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return uh.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 n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===Rt.CONTENT_VIEW_ZONE||n.type===Rt.GUTTER_VIEW_ZONE){const r=this._helpPositionJumpOverViewZone(n.detail);if(r)return uh.createViewZone(n.type,n.element,n.mouseColumn,r,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new oe(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n: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===Rt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class Gmt extends V{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Kmt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Kmt extends V{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=Ll(ct(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(),n=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-n:n;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=OTe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new jre(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=BTe(this._viewHelper.viewDomNode,l,h);c=this._mouseTargetFactory.createMouseTargetForView(this._viewHelper.getLastRenderData(),l,h,u,null)}(!c.position||c.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?c=uh.createOutsideEditor(this._position.mouseColumn,new oe(a,1),"above",this._position.outsideDistance):c=uh.createOutsideEditor(this._position.mouseColumn,new oe(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,My.None),this._animationFrameDisposable=Ll(ct(c.element),()=>this._execute())}}const Qne=class Qne{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>Qne.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)}};Qne.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let Jpe=Qne;class ii{get event(){return this.emitter.event}constructor(e,t,i){const n=o=>this.emitter.fire(o);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}const GF=class GF{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,n),c=t.value.substring(0,t.selectionStart);a===c&&(r=t.newlineCountBeforeSelection)}return new GF(i,n,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new GF(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 n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,n,-1)}if(e>=this.selectionEnd){const n=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,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 n=0,o=-1;for(;(o=t.indexOf(` -`,o+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min($y(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(Dj(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const r=t.value.substring(n,t.value.length-o),a=e.selectionStart-n,c=e.selectionEnd-n,l=t.selectionStart-n,d=t.selectionEnd-n;if(l===d){const u=e.selectionStart-n;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($y(e.value,t.value),e.selectionEnd),n=Math.min(Dj(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n),a=e.selectionEnd-i,c=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:c-r.length}}};GF.EMPTY=new GF("",0,0,null,void 0);let Nd=GF;class oF{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new F(n,1,o+1,1)}static fromEditorSelection(e,t,i,n){const r=oF._getPageOfLine(t.startLineNumber,i),a=oF._getRangeForPage(r,i),c=oF._getPageOfLine(t.endLineNumber,i),l=oF._getRangeForPage(c,i);let d=a.intersectRanges(new F(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,go.LF)>500){const b=e.modifyPosition(d.getEndPosition(),-500);d=F.fromPositions(b,d.getEndPosition())}const h=e.getValueInRange(d,go.LF),u=e.getLineCount(),f=e.getLineMaxColumn(u);let p=l.intersectRanges(new F(t.endLineNumber,t.endColumn,u,f));if(n&&e.getValueLengthInRange(p,go.LF)>500){const b=e.modifyPosition(p.getStartPosition(),500);p=F.fromPositions(p.getStartPosition(),b)}const m=e.getValueInRange(p,go.LF);let v;if(r===c||r+1===c)v=e.getValueInRange(t,go.LF);else{const b=a.intersectRanges(t),w=l.intersectRanges(t);v=e.getValueInRange(b,go.LF)+"…"+e.getValueInRange(w,go.LF)}return n&&v.length>2*500&&(v=v.substring(0,500)+"…"+v.substring(v.length-500,v.length)),new Nd(h+v+m,h.length,h.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var dY;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(dY||(dY={}));const Xpe={forceCopyWithSyntaxHighlighting:!1},jne=class jne{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)}};jne.INSTANCE=new jne;let J8=jne;class qmt{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 Zpe=class extends V{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,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 wn),this._asyncTriggerCut=this._register(new cn(()=>this._onCut.fire(),0)),this._textAreaState=Nd.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(M.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new cn(()=>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 En(c);(l.keyCode===S.KEY_IN_COMPOSITION||this._currentComposition&&l.keyCode===S.Backspace)&&l.stopPropagation(),l.equals(S.Escape)&&l.preventDefault(),a=l,this._onKeyDown.fire(l)})),this._register(this._textArea.onKeyUp(c=>{const l=new En(c);this._onKeyUp.fire(l)})),this._register(this._textArea.onCompositionStart(c=>{const l=new qmt;if(this._currentComposition){this._currentComposition=l;return}if(this._currentComposition=l,this._OS===Ds.Macintosh&&a&&a.equals(S.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=Nd.readFromTextArea(this._textArea,this._textAreaState),u=Nd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(c);return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Nd.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=Nd.readFromTextArea(this._textArea,this._textAreaState),u=Nd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Nd.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=Nd.readFromTextArea(this._textArea,this._textAreaState),d=Nd.deduceInput(this._textAreaState,l,this._OS===Ds.Macintosh);d.replacePrevCharCnt===0&&d.text.length===1&&(Pc(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]=eme.getTextData(c.clipboardData);l&&(d=d||J8.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 cn(()=>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=Nd.readFromTextArea(this._textArea,null)}_installSelectionChangeListener(){let e=0;return ue(this._textArea.ownerDocument,"selectionchange",t=>{if(yx.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<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 dt(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};J8.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` -`):t.text,i),e.preventDefault(),e.clipboardData&&eme.setTextData(e.clipboardData,t.text,t.html,i)}};Zpe=D([_(4,mr),_(5,Ge)],Zpe);const eme={getTextData(s){const e=s.getData(Us.text);let t=null;const i=s.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&&s.files.length>0?[Array.prototype.slice.call(s.files,0).map(o=>o.name).join(` -`),null]:[e,t]},setTextData(s,e,t,i){s.setData(Us.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class Qmt extends V{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ii(this._actual,"keydown")).event,this.onKeyPress=this._register(new ii(this._actual,"keypress")).event,this.onKeyUp=this._register(new ii(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ii(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ii(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ii(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ii(this._actual,"beforeinput")).event,this.onInput=this._register(new ii(this._actual,"input")).event,this.onCut=this._register(new ii(this._actual,"cut")).event,this.onCopy=this._register(new ii(this._actual,"copy")).event,this.onPaste=this._register(new ii(this._actual,"paste")).event,this.onFocus=this._register(new ii(this._actual,"focus")).event,this.onBlur=this._register(new ii(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>yx.onKeyDown())),this._register(this.onBeforeInput(()=>yx.onBeforeInput())),this._register(this.onInput(()=>yx.onInput())),this._register(this.onKeyUp(()=>yx.onKeyUp())),this._register(ue(this._actual,dY.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=vM(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Bc()===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 n=this._actual;let o=null;const r=vM(n);r?o=r.activeElement:o=Bc();const a=ct(o),c=o===n,l=n.selectionStart,d=n.selectionEnd;if(c&&l===t&&d===i){rf&&a.parent!==a&&n.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),rf&&a.parent!==a&&n.focus();return}try{const h=Bdt(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),Wdt(n,h)}catch{}}}class jmt extends QTe{constructor(e,t,i){super(e,t,i),this._register(fd.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,uo.Tap,o=>this.onTap(o))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Change,o=>this.onChange(o))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Contextmenu,o=>this._onContextMenu(new Fk(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ue(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 n=new Ppt(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMoveOverView(o))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.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._createMouseTargetForView(new Fk(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:My.Minimal,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===Rt.CONTENT_TEXT&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class Ymt extends QTe{constructor(e,t,i){super(e,t,i),this._register(fd.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,uo.Tap,n=>this.onTap(n))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Change,n=>this.onChange(n))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Contextmenu,n=>this._onContextMenu(new Fk(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTargetForView(new Fk(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(dY.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,My.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class Jmt extends V{constructor(e,t,i){super(),(dm||Drt&&L6e)&&kO.pointerEvents?this.handler=this._register(new jmt(e,t,i)):si.TouchEvent?this.handler=this._register(new Ymt(e,t,i)):this.handler=this._register(new QTe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var Xmt=".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}";ut(Xmt,{});var Zmt=".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)}";ut(Zmt,{});class RN extends c6{}function $o(s){return{id:s}}function tme(s){switch(s){case Jg.DARK:return"vs-dark";case Jg.HIGH_CONTRAST_DARK:return"hc-black";case Jg.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Sqe={ThemingContribution:"base.contributions.theming"};class e_t{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 Aqe=new e_t;Qe.add(Sqe.ThemingContribution,Aqe);function Cp(s){return Aqe.onColorThemeChange(s)}class jTe extends V{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 Eqe=W("editor.lineHighlightBackground",null,g(4890,"Background color for the highlight of line at the cursor position.")),aBe=W("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:wt},g(4891,"Background color for the border around the line at the cursor position."));W("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},g(4892,"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);W("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(4893,"Background color of the border around highlighted ranges."));W("editor.symbolHighlightBackground",{dark:_b,light:_b,hcDark:null,hcLight:null},g(4894,"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);W("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(4895,"Background color of the border around highlighted symbols."));const iae=W("editorCursor.foreground",{dark:"#AEAFAD",light:me.black,hcDark:me.white,hcLight:"#0F4A85"},g(4896,"Color of the editor cursor.")),YTe=W("editorCursor.background",null,g(4897,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),xqe=W("editorMultiCursor.primary.foreground",iae,g(4898,"Color of the primary editor cursor when multiple cursors are present.")),t_t=W("editorMultiCursor.primary.background",YTe,g(4899,"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.")),Dqe=W("editorMultiCursor.secondary.foreground",iae,g(4900,"Color of secondary editor cursors when multiple cursors are present.")),i_t=W("editorMultiCursor.secondary.background",YTe,g(4901,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),JTe=W("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(4902,"Color of whitespace characters in the editor.")),n_t=W("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:me.white,hcLight:"#292929"},g(4903,"Color of editor line numbers.")),s_t=W("editorIndentGuide.background",JTe,g(4904,"Color of the editor indentation guides."),!1,g(4905,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),o_t=W("editorIndentGuide.activeBackground",JTe,g(4906,"Color of the active editor indentation guides."),!1,g(4907,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),d6=W("editorIndentGuide.background1",s_t,g(4908,"Color of the editor indentation guides (1).")),r_t=W("editorIndentGuide.background2","#00000000",g(4909,"Color of the editor indentation guides (2).")),a_t=W("editorIndentGuide.background3","#00000000",g(4910,"Color of the editor indentation guides (3).")),c_t=W("editorIndentGuide.background4","#00000000",g(4911,"Color of the editor indentation guides (4).")),l_t=W("editorIndentGuide.background5","#00000000",g(4912,"Color of the editor indentation guides (5).")),d_t=W("editorIndentGuide.background6","#00000000",g(4913,"Color of the editor indentation guides (6).")),h6=W("editorIndentGuide.activeBackground1",o_t,g(4914,"Color of the active editor indentation guides (1).")),h_t=W("editorIndentGuide.activeBackground2","#00000000",g(4915,"Color of the active editor indentation guides (2).")),u_t=W("editorIndentGuide.activeBackground3","#00000000",g(4916,"Color of the active editor indentation guides (3).")),g_t=W("editorIndentGuide.activeBackground4","#00000000",g(4917,"Color of the active editor indentation guides (4).")),f_t=W("editorIndentGuide.activeBackground5","#00000000",g(4918,"Color of the active editor indentation guides (5).")),p_t=W("editorIndentGuide.activeBackground6","#00000000",g(4919,"Color of the active editor indentation guides (6).")),m_t=W("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Js,hcLight:Js},g(4920,"Color of editor active line number"),!1,g(4921,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));W("editorLineNumber.activeForeground",m_t,g(4920,"Color of editor active line number"));const __t=W("editorLineNumber.dimmedForeground",null,g(4922,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."));W("editorRuler.foreground",{dark:"#5A5A5A",light:me.lightgrey,hcDark:me.white,hcLight:"#292929"},g(4923,"Color of the editor rulers."));W("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},g(4924,"Foreground color of editor CodeLens"));W("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},g(4925,"Background color behind matching brackets"));W("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:wt,hcLight:wt},g(4926,"Color for matching brackets boxes"));const kqe=W("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(4927,"Color of the overview ruler border.")),v_t=W("editorOverviewRuler.background",null,g(4928,"Background color of the editor overview ruler."));W("editorGutter.background",Hc,g(4929,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));W("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:wt},g(4930,"Border color of unnecessary (unused) source code in the editor."));const b_t=W("editorUnnecessaryCode.opacity",{dark:me.fromHex("#000a"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},g(4931,`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.`));W("editorGhostText.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:me.fromHex("#292929").transparent(.8)},g(4932,"Border color of ghost text in the editor."));const w_t=W("editorGhostText.foreground",{dark:me.fromHex("#ffffff56"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},g(4933,"Foreground color of the ghost text in the editor."));W("editorGhostText.background",null,g(4934,"Background color of the ghost text in the editor."));const y_t=new me(new dn(0,122,204,.6)),Iqe=W("editorOverviewRuler.rangeHighlightForeground",y_t,g(4935,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Tqe=W("editorOverviewRuler.errorForeground",{dark:new me(new dn(255,18,18,.7)),light:new me(new dn(255,18,18,.7)),hcDark:new me(new dn(255,50,50,1)),hcLight:"#B5200D"},g(4936,"Overview ruler marker color for errors.")),C_t=W("editorOverviewRuler.warningForeground",{dark:pm,light:pm,hcDark:V8,hcLight:V8},g(4937,"Overview ruler marker color for warnings.")),Lqe=W("editorOverviewRuler.infoForeground",{dark:mm,light:mm,hcDark:z8,hcLight:z8},g(4938,"Overview ruler marker color for infos.")),Rqe=W("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(4939,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Mqe=W("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(4940,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Nqe=W("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(4941,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Pqe=W("editorBracketHighlight.foreground4","#00000000",g(4942,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Fqe=W("editorBracketHighlight.foreground5","#00000000",g(4943,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Oqe=W("editorBracketHighlight.foreground6","#00000000",g(4944,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),S_t=W("editorBracketHighlight.unexpectedBracket.foreground",{dark:new me(new dn(255,18,18,.8)),light:new me(new dn(255,18,18,.8)),hcDark:new me(new dn(255,50,50,1)),hcLight:""},g(4945,"Foreground color of unexpected brackets.")),A_t=W("editorBracketPairGuide.background1","#00000000",g(4946,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),E_t=W("editorBracketPairGuide.background2","#00000000",g(4947,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),x_t=W("editorBracketPairGuide.background3","#00000000",g(4948,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),D_t=W("editorBracketPairGuide.background4","#00000000",g(4949,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),k_t=W("editorBracketPairGuide.background5","#00000000",g(4950,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),I_t=W("editorBracketPairGuide.background6","#00000000",g(4951,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),T_t=W("editorBracketPairGuide.activeBackground1","#00000000",g(4952,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),L_t=W("editorBracketPairGuide.activeBackground2","#00000000",g(4953,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),R_t=W("editorBracketPairGuide.activeBackground3","#00000000",g(4954,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),M_t=W("editorBracketPairGuide.activeBackground4","#00000000",g(4955,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),N_t=W("editorBracketPairGuide.activeBackground5","#00000000",g(4956,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),P_t=W("editorBracketPairGuide.activeBackground6","#00000000",g(4957,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));W("editorUnicodeHighlight.border",pm,g(4958,"Border color used to highlight unicode characters."));W("editorUnicodeHighlight.background",rft,g(4959,"Background color used to highlight unicode characters."));Cp((s,e)=>{const t=s.getColor(Hc),i=s.getColor(Eqe),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});const Yne=class Yne extends RN{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===wr.Relative||this._renderLineNumbers===wr.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===wr.Relative){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===wr.Interval){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const n=this._context.viewModel.getLineCount();return i===n?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===wr.Off){this._renderResult=null;return}const t=pr?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);o.sort((l,d)=>F.compareRangesUsingEnds(l.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),c=[];for(let l=i;l<=n;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]}};Yne.CLASS_NAME="line-numbers";let hY=Yne;Cp((s,e)=>{const t=s.getColor(n_t),i=s.getColor(__t);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 F_t=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";ut(F_t,{});const KF=class KF extends pf{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=ls(document.createElement("div")),this._domNode.setClassName(KF.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ls(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(KF.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)}};KF.CLASS_NAME="glyph-margin",KF.OUTER_CLASS_NAME="margin";let uY=KF;var O_t=".monaco-mouse-cursor-text{cursor:text}";ut(O_t,{});const ZS="monaco-mouse-cursor-text";class B_t{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 c5=new B_t,Ut=ae("keybindingService");class W_t{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,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:Tl.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const Kde=rf;let ime=class extends pf{constructor(e,t,i,n,o){super(e),this._keybindingService=n,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 dt(1,1,1,1)],this._modelSelections=[new dt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ls(document.createElement("textarea")),Tb.write(this.textArea,sa.TextArea),this.textArea.setClassName(`inputarea ${ZS}`),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(9840,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ls(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,Qn),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 b,w=null;if(Xpe.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(b=y.html,w=y.mode)}return{isFromEmptySelection:p,multicursorText:m,text:v,html:b,mode:w}},getScreenReaderContent:()=>{if(this._accessibilitySupport===Jl.Disabled){const u=this._selections[0];if(Qt&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new Nd(m,m.length,m.length,F.fromPositions(p),0)}if(Qt&&!u.isEmpty()&&l.getValueLengthInRange(u,go.TextDefined)<500){const p=l.getValueInRange(u,go.TextDefined);return new Nd(p,0,p.length,u,0)}if(Ky&&!u.isEmpty()){const p="vscode-placeholder";return new Nd(p,0,p.length,null,void 0)}return Nd.EMPTY}if(OFe){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new Nd(p,m,m,F.fromPositions(f),0)}return Nd.EMPTY}return oF.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===Jl.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new Qmt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(Zpe,d,h,po,{isAndroid:OFe,isChrome:Q7,isFirefox:rf,isSafari:Ky})),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 w=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=w.lastIndexOf(` -`),C=w.substring(y+1),A=C.lastIndexOf(" "),L=C.length-A-1,k=p.getStartPosition(),P=Math.min(k.column-1,L),R=k.column-1-P,z=C.substring(0,C.length-P),{tabSize:G}=this._context.viewModel.model.getOptions(),Y=H_t(this.textArea.domNode.ownerDocument,z,this._fontInfo,G);return{distanceToModelLineStart:R,widthOfHiddenTextBefore:Y}})(),{distanceToModelLineEnd:b}=(()=>{const w=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),y=w.indexOf(` -`),C=y===-1?w:w.substring(0,y),A=C.indexOf(" "),L=A===-1?C.length:C.length-A-1,k=p.getEndPosition(),P=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-P}})();this._context.viewModel.revealRange("keyboard",!0,F.fromPositions(this._selections[0].getStartPosition()),_s.Simple,mt.Immediate),this._visibleTextArea=new W_t(this._context,p.startLineNumber,m,v,b),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${ZS} 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 ${ZS}`),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(c5.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=fm(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);n.get(d)!==zr.Regular?o=!1:r--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);n.get(d)!==zr.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=fm(this._context.configuration.options.get(x.wordSeparators),[]);let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==zr.Regular||o>50)return t.substring(n-1,e.column-1);o++,n--}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(!Pc(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(x.accessibilitySupport)===Jl.Disabled){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),n=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=g(9841,"The editor is not accessible at this time.");return i?g(9842,"{0} To enable screen reader optimized mode, use {1}",r,i):n?g(9843,"{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,n):o?g(9844,"{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===Jl.Enabled&&t===wh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(x.layoutInfo).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==Jl.Disabled){const o=e.get(x.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=Kde?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:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*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;!c5.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,n=this._visibleTextArea.visibleTextareaEnd,o=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(o&&r&&i&&n&&n.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=n.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:(Ta.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(Qt||this._accessibilitySupport===Jl.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:Kde?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:Kde?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Dl(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?me.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 n=this._context.configuration.options;n.get(x.glyphMargin)?i.setClassName("monaco-editor-background textAreaCover "+uY.OUTER_CLASS_NAME):n.get(x.lineNumbers).renderType!==wr.Off?i.setClassName("monaco-editor-background textAreaCover "+hY.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};ime=D([_(3,Ut),_(4,we)],ime);function H_t(s,e,t,i){if(e.length===0)return 0;const n=s.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=s.createElement("span");Dl(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),n.appendChild(o),s.body.appendChild(n);const r=o.offsetWidth;return n.remove(),r}class U_t{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Zc.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):n?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){Zc.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Zc.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Zc.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Zc.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Zc.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Zc.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Zc.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Zc.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Zc.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Zc.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Zc.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Zc.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Zc.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 Bqe{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 Ni("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let o=0,r=0;for(let c=i;c<=n;c++){const l=c-this._rendLineNumberStart;e<=c&&c<=t&&(r===0?(o=l,r=1):r++)}if(e=n&&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,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)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(),n=!0}}return n}}class Wqe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Bqe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ls(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,n=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,n,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,n),o}_renderUntouchedLines(e,t,i,n,o){const r=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const l=r+c;a[c].layoutLine(l,n[l-o],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,n,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];n[a]&&(c.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");UC._ttPolicy&&(t=UC._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;oe}),UC._sb=new wU(1e5);let nme=UC;class Hqe extends pf{constructor(e){super(e),this._visibleLines=new Wqe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(x.fontInfo);Dl(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,n=t.length;i'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class z_t extends Hqe{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 $_t extends Hqe{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),Dl(this.domNode,t.get(x.fontInfo))}onConfigurationChanged(e){const t=this._context.configuration.options;Dl(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 nae{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 nae.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===Rt.GUTTER_VIEW_ZONE||i.type===Rt.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 G_t=".monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}";ut(G_t,{});class K_t extends pf{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ls(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),n=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,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 n of i){if(!n.options.blockClassName)continue;let o=this.blocks[t];o||(o=this.blocks[t]=ls(document.createElement("div")),this.domNode.appendChild(o));let r,a;n.options.blockIsAfterEnd?(r=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(r=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),a=n.range.isEmpty()&&!n.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0));const[c,l,d,h]=n.options.blockPadding??[0,0,0,0];o.setClassName("blockDecorations-block "+n.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 n=t;n0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,r=o,a=e.top+e.height,c=n.viewportHeight-a,l=o-i,d=r>=i,h=a,u=c>=i;let f=e.left;return f+t>n.scrollLeft+n.viewportWidth&&(f=n.scrollLeft+n.viewportWidth-t),fc){const u=h-(c-n);h-=u,i-=u}if(h=m,w=h+i<=u.height-v;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(d,m),fitsBelow:w,belowTop:h,left:p}:{fitsAbove:b,aboveTop:o,fitsBelow:w,belowTop:r,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new d4(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,n=o(i,this._affinity,this._lineHeight);return{primary:t,secondary:n};function o(r,a,c){if(!r)return null;const l=e.visibleRangeForPosition(r);if(!l)return null;const d=r.column===1&&a===Io.LeftOfInjectedText?0:l.left,h=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.scrollTop;return new cBe(h,d,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=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"&&qde(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"&&qde(this._actual.afterRender,this._actual,this._renderData.position)}};class l4{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class d4{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class cBe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function qde(s,e,...t){try{return s.call(e,...t)}catch{return null}}var j_t=`.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 +`+c;return i?new Eq(n,d,!0):new rY(n,d,-1,l.length-c.length,!0)}else if(o.indentAction===yr.Outdent){const c=q8(e,o.indentation);return XI(n,` +`+e.normalizeIndentation(c+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=ho(r).substring(0,n.startColumn-1);if(e.autoIndent>=cl.Full){const c=rmt(e.autoIndent,t,n,{unshiftIndent:l=>q8(e,l),shiftIndent:l=>Jre(e,l),normalizeIndentation:l=>e.normalizeIndentation(l)},e.languageConfigurationService);if(c){let l=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=xh(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Eq(n,` +`+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 rY(n,` +`+e.normalizeIndentation(c.afterEnter),0,f,!0)}}}return XI(n,` +`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;othis._compositionType(i,d,o,r,a,c));return new Xu(sr.TypingOther,l,{shouldPushStackElementBefore:Yre(e,sr.TypingOther),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),c=Math.max(1,a.column-n),l=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new F(a.lineNumber,c,a.lineNumber,l);return e.getValueInRange(d)===i&&r===0?null:new rY(d,i,0,r)}}class _mt{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(D_(d)>=0)break}if(a<1)return null;const c=t.getLineMaxColumn(a),l=LO(e.autoIndent,t,new F(a,c,a,c),e.languageConfigurationService);l&&(o=l.indentation+l.appendText)}return n&&(n===yr.Indent&&(o=Jre(e,o)),n===yr.Outdent&&(o=q8(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){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;d2?l.charCodeAt(c.column-2):B.Null)===B.Backslash&&h)return!1;if(s.autoClosingOvertype==="auto"){let f=!1;for(let p=0,m=i.length;p{const n=t.get(Kt).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=Bc();return n&&["input","textarea"].indexOf(n.tagName.toLowerCase())>=0?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(Kt).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(t,n,i)):!1})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}var Ty;(function(s){s[s.Regular=0]="Regular",s[s.Minimal=1]="Minimal",s[s.None=2]="None"})(Ty||(Ty={}));var Xc;(function(s){class e extends ia{constructor(y){super(y),this._inSelectionMode=y.inSelectionMode}runCoreEditorCommand(y,C){if(!C.position)return;y.model.pushStackElement(),y.setCursorStates(C.source,Oi.Explicit,[vl.moveTo(y,y.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==Ty.None&&y.revealAllCursors(C.source,!0,!0)}}s.MoveTo=qe(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),s.MoveToSelect=qe(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ia{runCoreEditorCommand(y,C){y.model.pushStackElement();const A=this._getColumnSelectResult(y,y.getPrimaryCursorState(),y.getCursorColumnSelectData(),C);A!==null&&(y.setCursorStates(C.source,Oi.Explicit,A.viewStates.map(L=>Rn.fromViewState(L))),y.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:A.fromLineNumber,fromViewVisualColumn:A.fromVisualColumn,toViewLineNumber:A.toLineNumber,toViewVisualColumn:A.toVisualColumn}),A.reversed?y.revealTopMostCursor(C.source):y.revealBottomMostCursor(C.source))}}s.ColumnSelect=qe(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(w,y,C,A){if(typeof A.position>"u"||typeof A.viewPosition>"u"||typeof A.mouseColumn>"u")return null;const L=w.model.validatePosition(A.position),k=w.coordinatesConverter.validateViewPosition(new oe(A.viewPosition.lineNumber,A.viewPosition.column),L),P=A.doColumnSelect?C.fromViewLineNumber:k.lineNumber,R=A.doColumnSelect?C.fromViewVisualColumn:A.mouseColumn-1;return O0.columnSelect(w.cursorConfig,w,P,R,k.lineNumber,A.mouseColumn-1)}}),s.CursorColumnSelectLeft=qe(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.LeftArrow,linux:{primary:0}}})}_getColumnSelectResult(w,y,C,A){return O0.columnSelectLeft(w.cursorConfig,w,C)}}),s.CursorColumnSelectRight=qe(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.RightArrow,linux:{primary:0}}})}_getColumnSelectResult(w,y,C,A){return O0.columnSelectRight(w.cursorConfig,w,C)}});class i extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return O0.columnSelectUp(y.cursorConfig,y,A,this._isPaged)}}s.CursorColumnSelectUp=qe(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.UpArrow,linux:{primary:0}}})),s.CursorColumnSelectPageUp=qe(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.PageUp,linux:{primary:0}}}));class n extends t{constructor(y){super(y),this._isPaged=y.isPaged}_getColumnSelectResult(y,C,A,L){return O0.columnSelectDown(y.cursorConfig,y,A,this._isPaged)}}s.CursorColumnSelectDown=qe(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.DownArrow,linux:{primary:0}}})),s.CursorColumnSelectPageDown=qe(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|U.Alt|S.PageDown,linux:{primary:0}}}));class o extends ia{constructor(){super({id:"cursorMove",precondition:void 0,metadata:Mi.metadata})}runCoreEditorCommand(y,C){const A=Mi.parse(C);A&&this._runCursorMove(y,C.source,A)}_runCursorMove(y,C,A){y.model.pushStackElement(),y.setCursorStates(C,Oi.Explicit,o._move(y,y.getCursorStates(),A)),y.revealAllCursors(C,!0)}static _move(y,C,A){const L=A.select,k=A.value;switch(A.direction){case Mi.Direction.Left:case Mi.Direction.Right:case Mi.Direction.Up:case Mi.Direction.Down:case Mi.Direction.PrevBlankLine:case Mi.Direction.NextBlankLine:case Mi.Direction.WrappedLineStart:case Mi.Direction.WrappedLineFirstNonWhitespaceCharacter:case Mi.Direction.WrappedLineColumnCenter:case Mi.Direction.WrappedLineEnd:case Mi.Direction.WrappedLineLastNonWhitespaceCharacter:return vl.simpleMove(y,C,A.direction,L,k,A.unit);case Mi.Direction.ViewPortTop:case Mi.Direction.ViewPortBottom:case Mi.Direction.ViewPortCenter:case Mi.Direction.ViewPortIfOutside:return vl.viewportMove(y,C,A.direction,L,k);default:return null}}}s.CursorMoveImpl=o,s.CursorMove=qe(new o);let r;(function(w){w[w.PAGE_SIZE_MARKER=-1]="PAGE_SIZE_MARKER"})(r||(r={}));class a extends ia{constructor(y){super(y),this._staticArgs=y.args}runCoreEditorCommand(y,C){let A=this._staticArgs;this._staticArgs.value===r.PAGE_SIZE_MARKER&&(A={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:C.pageSize||y.cursorConfig.pageSize}),y.model.pushStackElement(),y.setCursorStates(C.source,Oi.Explicit,vl.simpleMove(y,y.getCursorStates(),A.direction,A.select,A.value,A.unit)),y.revealAllCursors(C.source,!0)}}s.CursorLeft=qe(new a({args:{direction:Mi.Direction.Left,unit:Mi.Unit.None,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.LeftArrow,mac:{primary:S.LeftArrow,secondary:[U.WinCtrl|S.KeyB]}}})),s.CursorLeftSelect=qe(new a({args:{direction:Mi.Direction.Left,unit:Mi.Unit.None,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.LeftArrow}})),s.CursorRight=qe(new a({args:{direction:Mi.Direction.Right,unit:Mi.Unit.None,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.RightArrow,mac:{primary:S.RightArrow,secondary:[U.WinCtrl|S.KeyF]}}})),s.CursorRightSelect=qe(new a({args:{direction:Mi.Direction.Right,unit:Mi.Unit.None,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.RightArrow}})),s.CursorUp=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.UpArrow,mac:{primary:S.UpArrow,secondary:[U.WinCtrl|S.KeyP]}}})),s.CursorUpSelect=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.UpArrow,secondary:[U.CtrlCmd|U.Shift|S.UpArrow],mac:{primary:U.Shift|S.UpArrow},linux:{primary:U.Shift|S.UpArrow}}})),s.CursorPageUp=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageUp}})),s.CursorPageUpSelect=qe(new a({args:{direction:Mi.Direction.Up,unit:Mi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.PageUp}})),s.CursorDown=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.DownArrow,mac:{primary:S.DownArrow,secondary:[U.WinCtrl|S.KeyN]}}})),s.CursorDownSelect=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.DownArrow,secondary:[U.CtrlCmd|U.Shift|S.DownArrow],mac:{primary:U.Shift|S.DownArrow},linux:{primary:U.Shift|S.DownArrow}}})),s.CursorPageDown=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!1,value:r.PAGE_SIZE_MARKER},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.PageDown}})),s.CursorPageDownSelect=qe(new a({args:{direction:Mi.Direction.Down,unit:Mi.Unit.WrappedLine,select:!0,value:r.PAGE_SIZE_MARKER},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:U.Shift|S.PageDown}})),s.CreateCursor=qe(new class extends ia{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(w,y){if(!y.position)return;let C;y.wholeLine?C=vl.line(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition):C=vl.moveTo(w,w.getPrimaryCursorState(),!1,y.position,y.viewPosition);const A=w.getCursorStates();if(A.length>1){const L=C.modelState?C.modelState.position:null,k=C.viewState?C.viewState.position:null;for(let P=0,R=A.length;Pk&&(L=k);const P=new F(L,1,L,w.model.getLineMaxColumn(L));let R=_s.Simple;if(C.at)switch(C.at){case eF.RawAtArgument.Top:R=_s.Top;break;case eF.RawAtArgument.Center:R=_s.Center;break;case eF.RawAtArgument.Bottom:R=_s.Bottom;break}const z=w.coordinatesConverter.convertModelRangeToViewRange(P);w.revealRange(y.source,!1,z,R,mt.Smooth)}}),s.SelectAll=new class extends $pe{constructor(){super(eht)}runDOMCommand(w){nf&&(w.focus(),w.select()),w.ownerDocument.execCommand("selectAll")}runEditorCommand(w,y,C){const A=y._getViewModel();A&&this.runCoreEditorCommand(A,C)}runCoreEditorCommand(w,y){w.model.pushStackElement(),w.setCursorStates("keyboard",Oi.Explicit,[vl.selectAll(w,w.getPrimaryCursorState())])}},s.SetSelection=qe(new class extends ia{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(w,y){y.selection&&(w.model.pushStackElement(),w.setCursorStates(y.source,Oi.Explicit,[Rn.fromModelSelection(y.selection)]))}})})(Xc||(Xc={}));const Cmt=he.and(J.textInputFocus,J.columnSelection);function bU(s,e){So.registerKeybindingRule({id:s,primary:e,when:Cmt,weight:os+1})}bU(Xc.CursorColumnSelectLeft.id,U.Shift|S.LeftArrow);bU(Xc.CursorColumnSelectRight.id,U.Shift|S.RightArrow);bU(Xc.CursorColumnSelectUp.id,U.Shift|S.UpArrow);bU(Xc.CursorColumnSelectPageUp.id,U.Shift|S.PageUp);bU(Xc.CursorColumnSelectDown.id,U.Shift|S.DownArrow);bU(Xc.CursorColumnSelectPageDown.id,U.Shift|S.PageDown);function KOe(s){return s.register(),s}var RO;(function(s){class e extends hc{runEditorCommand(i,n,o){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,o||{})}}s.CoreEditingCommand=e,s.LineBreakInsert=qe(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:J.writable,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyO}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,jre.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),s.Outdent=qe(new class extends e{constructor(){super({id:"outdent",precondition:J.writable,kbOpts:{weight:os,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus),primary:U.Shift|S.Tab}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,QE.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.Tab=qe(new class extends e{constructor(){super({id:"tab",precondition:J.writable,kbOpts:{weight:os,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus),primary:S.Tab}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,QE.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.DeleteLeft=qe(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.Backspace,secondary:[U.Shift|S.Backspace],mac:{primary:S.Backspace,secondary:[U.Shift|S.Backspace,U.WinCtrl|S.KeyH,U.WinCtrl|S.Backspace]}}})}runCoreEditingCommand(t,i,n){const[o,r]=_M.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(sr.DeletingLeft)}}),s.DeleteRight=qe(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:os,kbExpr:J.textInputFocus,primary:S.Delete,mac:{primary:S.Delete,secondary:[U.WinCtrl|S.KeyD,U.WinCtrl|S.Delete]}}})}runCoreEditingCommand(t,i,n){const[o,r]=_M.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(sr.DeletingRight)}}),s.Undo=new class extends $pe{constructor(){super(YGe)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().undo()}},s.Redo=new class extends $pe{constructor(){super(JGe)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(x.readOnly)===!0))return i.getModel().redo()}}})(RO||(RO={}));class qOe extends Nre{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Kt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function DN(s,e){KOe(new qOe("default:"+s,s)),KOe(new qOe(s,s,e))}DN(oc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});DN(oc.ReplacePreviousChar);DN(oc.CompositionType);DN(oc.CompositionStart);DN(oc.CompositionEnd);DN(oc.Paste);DN(oc.Cut);let gd=class extends V{onclick(e,t){this._register(ue(e,ke.CLICK,i=>t(new Sh(ct(e),i))))}onmousedown(e,t){this._register(ue(e,ke.MOUSE_DOWN,i=>t(new Sh(ct(e),i))))}onmouseover(e,t){this._register(ue(e,ke.MOUSE_OVER,i=>t(new Sh(ct(e),i))))}onmouseleave(e,t){this._register(ue(e,ke.MOUSE_LEAVE,i=>t(new Sh(ct(e),i))))}onkeydown(e,t){this._register(ue(e,ke.KEY_DOWN,i=>t(new En(i))))}onkeyup(e,t){this._register(ue(e,ke.KEY_UP,i=>t(new En(i))))}oninput(e,t){this._register(ue(e,ke.INPUT,t))}onblur(e,t){this._register(ue(e,ke.BLUR,t))}onfocus(e,t){this._register(ue(e,ke.FOCUS,t))}onchange(e,t){this._register(ue(e,ke.CHANGE,t))}ignoreGesture(e){return ud.ignoreTarget(e)}};const H2=11;class Smt extends gd{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(...We.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=H2+"px",this.domNode.style.height=H2+"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 vU),this._register(Ro(this.bgDomNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ro(this.domNode,ke.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Q7),this._pointerdownScheduleRepeatTimer=this._register(new bm)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ct(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 Amt extends V{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 bm)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===Co.Hidden?!1:this._visibility===Co.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 Emt=140;class gqe extends gd{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 Amt(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new vU),this._shouldRender=!0,this.domNode=ls(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(ue(this.domNode.domNode,ke.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new Smt(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=ls(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 n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ue(this.slider.domNode,ke.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(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?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=Cr(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),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),n=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(Qn&&a>Emt){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const l=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(n.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 xmt=20;class U2{constructor(e,t,i,n,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,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 U2(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,n,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),c=n>0&&n>i;if(!c)return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(xmt,Math.floor(i*a/n))),d=(a-l)/(n-i),h=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=U2._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 gM(null,1,0))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new gM(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===Co.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===Co.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class kmt extends gqe{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new U2(t.verticalHasArrows?t.arrowSize:0,t.vertical===Co.Hidden?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-H2)/2,a=(t.verticalScrollbarSize-H2)/2;this._createArrow({className:"scra",icon:ve.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new gM(null,0,1))}),this._createArrow({className:"scra",icon:ve.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new gM(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===Co.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}var Imt=".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)}";ut(Imt,{});const Tmt=500,QOe=50;class Lmt{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}const zne=class zne{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,n=this._rear;do{const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){if($7){const t=ct(e.browserEvent),i=Kct(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 n=null;const o=new Lmt(e,t,i);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(n=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,n)}_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 n=Math.abs(e.deltaX),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),c=Math.max(Math.min(n,r),1),l=Math.max(Math.min(o,a),1),d=Math.max(n,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}};zne.INSTANCE=new zne;let aY=zne;class PTe extends gd{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=Rmt(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new kmt(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Dmt(this._scrollable,this._options,n)),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=ls(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ls(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ls(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 bm),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=bt(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,Qt&&(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 gM(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=bt(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new gM(n))};this._mouseWheelToDispose.push(ue(this._listenOnDomNode,ke.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=aY.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=!Qt&&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=QOe*o,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(l,h)}if(r){const d=QOe*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 n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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,n=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${n}`)}}_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(),Tmt)}}class fqe extends PTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new _N({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Tl(ct(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class o6 extends PTe{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 wU extends PTe{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new _N({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>Tl(ct(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.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 Rmt(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:Co.Auto,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:Co.Auto,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,Qt&&(e.className+=" mac"),e}class FTe extends s6{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._mouseOnOverflowWidgetsDomNode=!1,this._mouseOnViewDomNode=!1,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new Ed(this._context,i),this._mouseDownOperation=this._register(new Mmt(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(a,c)=>this._createMouseTargetForView(a,c),a=>this._getMouseColumn(a))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(x.layoutInfo).height;const n=new Spt(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,a=>this._onContextMenu(a,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,a=>{this._mouseOnViewDomNode=!0,this._onMouseMoveOverView(a),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ue(this.viewHelper.viewDomNode.ownerDocument,"mousemove",c=>{this.viewHelper.viewDomNode.contains(c.target)||(this._mouseOnViewDomNode=!1,setTimeout(()=>{this._mouseOnOverflowWidgetsDomNode||this._onMouseLeave(new Lk(c,!1,this.viewHelper.viewDomNode))},0))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,a=>this._onMouseUp(a))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,a=>{this._mouseOnViewDomNode=!1,setTimeout(()=>{this._mouseOnOverflowWidgetsDomNode||this._onMouseLeave(a)},0)}));const o=this.viewHelper.overflowWidgetsDomNode;o&&(this._register(n.onMouseMove(o,a=>{this._mouseOnOverflowWidgetsDomNode=!0,this._mouseLeaveMonitor?.dispose(),this._mouseLeaveMonitor=null,this._onMouseMoveOverOverflowWidgetsDomNode(a)})),this._register(n.onMouseLeave(o,a=>{this._mouseOnOverflowWidgetsDomNode=!1,setTimeout(()=>{this._mouseOnViewDomNode||this._onMouseLeave(a)},0)})));let r=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(a,c)=>{r=c})),this._register(ue(this.viewHelper.viewDomNode,ke.POINTER_UP,a=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,a=>this._onMouseDown(a,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=aY.INSTANCE;let t=0,i=Gp.getZoomLevel(),n=!1,o=0;const r=c=>{if(this.viewController.emitMouseWheel(c),!this._context.configuration.options.get(x.mouseWheelZoom))return;const l=new gM(c);if(e.acceptStandardWheelEvent(l),e.isPhysicalMouseWheel()){if(a(c)){const d=Gp.getZoomLevel(),h=l.deltaY>0?1:-1;Gp.setZoomLevel(d+h),l.preventDefault(),l.stopPropagation()}}else Date.now()-t>50&&(i=Gp.getZoomLevel(),n=a(c),o=0),t=Date.now(),o+=l.deltaY,n&&(Gp.setZoomLevel(i+o/5),l.preventDefault(),l.stopPropagation())};this._register(ue(this.viewHelper.viewDomNode,ke.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(c){return Qt?(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 n=new nqe(e,t).toPageCoordinates(ct(this.viewHelper.viewDomNode)),o=ETe(this.viewHelper.viewDomNode);if(n.yo.y+o.height||n.xo.x+o.width)return null;const r=xTe(this.viewHelper.viewDomNode,o,n);return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),o,n,r,null)}_createMouseTargetForView(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=fM(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTargetForView(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_createMouseTargetForOverflowWidgetsDomNode(e){return this.mouseTargetFactory.createMouseTargetForOverflowWidgetsDomNode(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,e.target)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTargetForView(e,t)})}_onMouseMoveOverView(e){this._onMouseMove(e,this._createMouseTargetForView(e,!0))}_onMouseMoveOverOverflowWidgetsDomNode(e){this._onMouseMove(e,this._createMouseTargetForOverflowWidgetsDomNode(e))}_onMouseMove(e,t){this._shouldIgnoreMouseMoveEvent(e)||this.viewController.emitMouseMove({event:e,target:t})}_shouldIgnoreMouseMoveEvent(e){return this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||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 Mmt extends V{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new Ept(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Nmt(this._context,this._viewHelper,this._mouseTargetFactory,(a,c,l)=>this._dispatchMouse(a,c,l))),this._mouseState=new Gpe,this._currentSelection=new dt(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===Rt.OUTSIDE_EDITOR&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,Ty.Minimal)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===Rt.GUTTER_LINE_NUMBERS),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.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()&&n.type===Rt.CONTENT_TEXT&&n.position&&this._currentSelection.containsPosition(n.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);a_(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(n,t.shiftKey,Ty.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,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,c=n.getCurrentScrollTop()+e.relativePos.y,l=mM.getZoneAtCoord(this._context,c);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return dh.createOutsideEditor(o,h,"below",a)}const d=n.getLineNumberAtVerticalOffset(c);return dh.createOutsideEditor(o,new oe(d,i.getLineMaxColumn(d)),"below",a)}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return dh.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 n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===Rt.CONTENT_VIEW_ZONE||n.type===Rt.GUTTER_VIEW_ZONE){const r=this._helpPositionJumpOverViewZone(n.detail);if(r)return dh.createViewZone(n.type,n.element,n.mouseColumn,r,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new oe(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n: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===Rt.CONTENT_TEXT&&e.detail.injectedText!==null})}}class Nmt extends V{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new Pmt(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class Pmt extends V{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=Tl(ct(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(),n=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-n:n;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=ETe(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(x.layoutInfo).horizontalScrollbarHeight,h=new Gre(this._mouseEvent.pos.x,l.y+l.height-d-.1),u=xTe(this._viewHelper.viewDomNode,l,h);c=this._mouseTargetFactory.createMouseTargetForView(this._viewHelper.getLastRenderData(),l,h,u,null)}(!c.position||c.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?c=dh.createOutsideEditor(this._position.mouseColumn,new oe(a,1),"above",this._position.outsideDistance):c=dh.createOutsideEditor(this._position.mouseColumn,new oe(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(c,!0,Ty.None),this._animationFrameDisposable=Tl(ct(c.element),()=>this._execute())}}const $ne=class $ne{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>$ne.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)}};$ne.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let Gpe=$ne;class ii{get event(){return this.emitter.event}constructor(e,t,i){const n=o=>this.emitter.fire(o);this.emitter=new I({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}const UF=class UF{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,n),c=t.value.substring(0,t.selectionStart);a===c&&(r=t.newlineCountBeforeSelection)}return new UF(i,n,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new UF(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 n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,n,-1)}if(e>=this.selectionEnd){const n=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,n,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 n=0,o=-1;for(;(o=t.indexOf(` +`,o+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(Uy(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(Ej(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const r=t.value.substring(n,t.value.length-o),a=e.selectionStart-n,c=e.selectionEnd-n,l=t.selectionStart-n,d=t.selectionEnd-n;if(l===d){const u=e.selectionStart-n;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(Uy(e.value,t.value),e.selectionEnd),n=Math.min(Ej(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n),a=e.selectionEnd-i,c=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:c-r.length}}};UF.EMPTY=new UF("",0,0,null,void 0);let Rd=UF;class tF{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new F(n,1,o+1,1)}static fromEditorSelection(e,t,i,n){const r=tF._getPageOfLine(t.startLineNumber,i),a=tF._getRangeForPage(r,i),c=tF._getPageOfLine(t.endLineNumber,i),l=tF._getRangeForPage(c,i);let d=a.intersectRanges(new F(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,go.LF)>500){const b=e.modifyPosition(d.getEndPosition(),-500);d=F.fromPositions(b,d.getEndPosition())}const h=e.getValueInRange(d,go.LF),u=e.getLineCount(),f=e.getLineMaxColumn(u);let p=l.intersectRanges(new F(t.endLineNumber,t.endColumn,u,f));if(n&&e.getValueLengthInRange(p,go.LF)>500){const b=e.modifyPosition(p.getStartPosition(),500);p=F.fromPositions(p.getStartPosition(),b)}const m=e.getValueInRange(p,go.LF);let v;if(r===c||r+1===c)v=e.getValueInRange(t,go.LF);else{const b=a.intersectRanges(t),w=l.intersectRanges(t);v=e.getValueInRange(b,go.LF)+"…"+e.getValueInRange(w,go.LF)}return n&&v.length>2*500&&(v=v.substring(0,500)+"…"+v.substring(v.length-500,v.length)),new Rd(h+v+m,h.length,h.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var cY;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(cY||(cY={}));const Kpe={forceCopyWithSyntaxHighlighting:!1},Gne=class Gne{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)}};Gne.INSTANCE=new Gne;let Q8=Gne;class Fmt{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 qpe=class extends V{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,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 wn),this._asyncTriggerCut=this._register(new cn(()=>this._onCut.fire(),0)),this._textAreaState=Rd.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(M.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new cn(()=>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 En(c);(l.keyCode===S.KEY_IN_COMPOSITION||this._currentComposition&&l.keyCode===S.Backspace)&&l.stopPropagation(),l.equals(S.Escape)&&l.preventDefault(),a=l,this._onKeyDown.fire(l)})),this._register(this._textArea.onKeyUp(c=>{const l=new En(c);this._onKeyUp.fire(l)})),this._register(this._textArea.onCompositionStart(c=>{const l=new Fmt;if(this._currentComposition){this._currentComposition=l;return}if(this._currentComposition=l,this._OS===Ds.Macintosh&&a&&a.equals(S.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=Rd.readFromTextArea(this._textArea,this._textAreaState),u=Rd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionUpdate.fire(c);return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Rd.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=Rd.readFromTextArea(this._textArea,this._textAreaState),u=Rd.deduceAndroidCompositionInput(this._textAreaState,h);this._textAreaState=h,this._onType.fire(u),this._onCompositionEnd.fire();return}const d=l.handleCompositionUpdate(c.data);this._textAreaState=Rd.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=Rd.readFromTextArea(this._textArea,this._textAreaState),d=Rd.deduceInput(this._textAreaState,l,this._OS===Ds.Macintosh);d.replacePrevCharCnt===0&&d.text.length===1&&(Pc(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]=Qpe.getTextData(c.clipboardData);l&&(d=d||Q8.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 cn(()=>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=Rd.readFromTextArea(this._textArea,null)}_installSelectionChangeListener(){let e=0;return ue(this._textArea.ownerDocument,"selectionchange",t=>{if(vx.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<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 dt(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};Q8.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,i),e.preventDefault(),e.clipboardData&&Qpe.setTextData(e.clipboardData,t.text,t.html,i)}};qpe=D([_(4,mr),_(5,Ge)],qpe);const Qpe={getTextData(s){const e=s.getData(Us.text);let t=null;const i=s.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&&s.files.length>0?[Array.prototype.slice.call(s.files,0).map(o=>o.name).join(` +`),null]:[e,t]},setTextData(s,e,t,i){s.setData(Us.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class Omt extends V{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ii(this._actual,"keydown")).event,this.onKeyPress=this._register(new ii(this._actual,"keypress")).event,this.onKeyUp=this._register(new ii(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ii(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ii(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ii(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ii(this._actual,"beforeinput")).event,this.onInput=this._register(new ii(this._actual,"input")).event,this.onCut=this._register(new ii(this._actual,"cut")).event,this.onCopy=this._register(new ii(this._actual,"copy")).event,this.onPaste=this._register(new ii(this._actual,"paste")).event,this.onFocus=this._register(new ii(this._actual,"focus")).event,this.onBlur=this._register(new ii(this._actual,"blur")).event,this._onSyntheticTap=this._register(new I),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>vx.onKeyDown())),this._register(this.onBeforeInput(()=>vx.onBeforeInput())),this._register(this.onInput(()=>vx.onInput())),this._register(this.onKeyUp(()=>vx.onKeyUp())),this._register(ue(this._actual,cY.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=fM(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Bc()===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 n=this._actual;let o=null;const r=fM(n);r?o=r.activeElement:o=Bc();const a=ct(o),c=o===n,l=n.selectionStart,d=n.selectionEnd;if(c&&l===t&&d===i){nf&&a.parent!==a&&n.focus();return}if(c){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),nf&&a.parent!==a&&n.focus();return}try{const h=Ddt(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),kdt(n,h)}catch{}}}class Bmt extends FTe{constructor(e,t,i){super(e,t,i),this._register(ud.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,uo.Tap,o=>this.onTap(o))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Change,o=>this.onChange(o))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Contextmenu,o=>this._onContextMenu(new Lk(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ue(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 n=new Apt(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMoveOverView(o))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.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._createMouseTargetForView(new Lk(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:Ty.Minimal,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===Rt.CONTENT_TEXT&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class Wmt extends FTe{constructor(e,t,i){super(e,t,i),this._register(ud.addTarget(this.viewHelper.linesContentDomNode)),this._register(ue(this.viewHelper.linesContentDomNode,uo.Tap,n=>this.onTap(n))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Change,n=>this.onChange(n))),this._register(ue(this.viewHelper.linesContentDomNode,uo.Contextmenu,n=>this._onContextMenu(new Lk(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTargetForView(new Lk(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(cY.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,Ty.Minimal)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class Hmt extends V{constructor(e,t,i){super(),(am||mrt&&S6e)&&AO.pointerEvents?this.handler=this._register(new Bmt(e,t,i)):si.TouchEvent?this.handler=this._register(new Wmt(e,t,i)):this.handler=this._register(new FTe(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}var Umt=".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}";ut(Umt,{});var Vmt=".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)}";ut(Vmt,{});class kN extends s6{}function $o(s){return{id:s}}function jpe(s){switch(s){case Qg.DARK:return"vs-dark";case Qg.HIGH_CONTRAST_DARK:return"hc-black";case Qg.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const pqe={ThemingContribution:"base.contributions.theming"};class zmt{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 mqe=new zmt;Qe.add(pqe.ThemingContribution,mqe);function bp(s){return mqe.onColorThemeChange(s)}class OTe extends V{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 _qe=W("editor.lineHighlightBackground",null,g(4890,"Background color for the highlight of line at the cursor position.")),jOe=W("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:wt},g(4891,"Background color for the border around the line at the cursor position."));W("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},g(4892,"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);W("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(4893,"Background color of the border around highlighted ranges."));W("editor.symbolHighlightBackground",{dark:fb,light:fb,hcDark:null,hcLight:null},g(4894,"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);W("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(4895,"Background color of the border around highlighted symbols."));const Xre=W("editorCursor.foreground",{dark:"#AEAFAD",light:me.black,hcDark:me.white,hcLight:"#0F4A85"},g(4896,"Color of the editor cursor.")),BTe=W("editorCursor.background",null,g(4897,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),vqe=W("editorMultiCursor.primary.foreground",Xre,g(4898,"Color of the primary editor cursor when multiple cursors are present.")),$mt=W("editorMultiCursor.primary.background",BTe,g(4899,"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.")),bqe=W("editorMultiCursor.secondary.foreground",Xre,g(4900,"Color of secondary editor cursors when multiple cursors are present.")),Gmt=W("editorMultiCursor.secondary.background",BTe,g(4901,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),WTe=W("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},g(4902,"Color of whitespace characters in the editor.")),Kmt=W("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:me.white,hcLight:"#292929"},g(4903,"Color of editor line numbers.")),qmt=W("editorIndentGuide.background",WTe,g(4904,"Color of the editor indentation guides."),!1,g(4905,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Qmt=W("editorIndentGuide.activeBackground",WTe,g(4906,"Color of the active editor indentation guides."),!1,g(4907,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),r6=W("editorIndentGuide.background1",qmt,g(4908,"Color of the editor indentation guides (1).")),jmt=W("editorIndentGuide.background2","#00000000",g(4909,"Color of the editor indentation guides (2).")),Ymt=W("editorIndentGuide.background3","#00000000",g(4910,"Color of the editor indentation guides (3).")),Jmt=W("editorIndentGuide.background4","#00000000",g(4911,"Color of the editor indentation guides (4).")),Xmt=W("editorIndentGuide.background5","#00000000",g(4912,"Color of the editor indentation guides (5).")),Zmt=W("editorIndentGuide.background6","#00000000",g(4913,"Color of the editor indentation guides (6).")),a6=W("editorIndentGuide.activeBackground1",Qmt,g(4914,"Color of the active editor indentation guides (1).")),e_t=W("editorIndentGuide.activeBackground2","#00000000",g(4915,"Color of the active editor indentation guides (2).")),t_t=W("editorIndentGuide.activeBackground3","#00000000",g(4916,"Color of the active editor indentation guides (3).")),i_t=W("editorIndentGuide.activeBackground4","#00000000",g(4917,"Color of the active editor indentation guides (4).")),n_t=W("editorIndentGuide.activeBackground5","#00000000",g(4918,"Color of the active editor indentation guides (5).")),s_t=W("editorIndentGuide.activeBackground6","#00000000",g(4919,"Color of the active editor indentation guides (6).")),o_t=W("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Js,hcLight:Js},g(4920,"Color of editor active line number"),!1,g(4921,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));W("editorLineNumber.activeForeground",o_t,g(4920,"Color of editor active line number"));const r_t=W("editorLineNumber.dimmedForeground",null,g(4922,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."));W("editorRuler.foreground",{dark:"#5A5A5A",light:me.lightgrey,hcDark:me.white,hcLight:"#292929"},g(4923,"Color of the editor rulers."));W("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},g(4924,"Foreground color of editor CodeLens"));W("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},g(4925,"Background color behind matching brackets"));W("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:wt,hcLight:wt},g(4926,"Color for matching brackets boxes"));const wqe=W("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},g(4927,"Color of the overview ruler border.")),a_t=W("editorOverviewRuler.background",null,g(4928,"Background color of the editor overview ruler."));W("editorGutter.background",Hc,g(4929,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));W("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:wt},g(4930,"Border color of unnecessary (unused) source code in the editor."));const c_t=W("editorUnnecessaryCode.opacity",{dark:me.fromHex("#000a"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},g(4931,`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.`));W("editorGhostText.border",{dark:null,light:null,hcDark:me.fromHex("#fff").transparent(.8),hcLight:me.fromHex("#292929").transparent(.8)},g(4932,"Border color of ghost text in the editor."));const l_t=W("editorGhostText.foreground",{dark:me.fromHex("#ffffff56"),light:me.fromHex("#0007"),hcDark:null,hcLight:null},g(4933,"Foreground color of the ghost text in the editor."));W("editorGhostText.background",null,g(4934,"Background color of the ghost text in the editor."));const d_t=new me(new dn(0,122,204,.6)),yqe=W("editorOverviewRuler.rangeHighlightForeground",d_t,g(4935,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Cqe=W("editorOverviewRuler.errorForeground",{dark:new me(new dn(255,18,18,.7)),light:new me(new dn(255,18,18,.7)),hcDark:new me(new dn(255,50,50,1)),hcLight:"#B5200D"},g(4936,"Overview ruler marker color for errors.")),h_t=W("editorOverviewRuler.warningForeground",{dark:um,light:um,hcDark:W8,hcLight:W8},g(4937,"Overview ruler marker color for warnings.")),Sqe=W("editorOverviewRuler.infoForeground",{dark:gm,light:gm,hcDark:H8,hcLight:H8},g(4938,"Overview ruler marker color for infos.")),Aqe=W("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},g(4939,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Eqe=W("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},g(4940,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),xqe=W("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},g(4941,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Dqe=W("editorBracketHighlight.foreground4","#00000000",g(4942,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),kqe=W("editorBracketHighlight.foreground5","#00000000",g(4943,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Iqe=W("editorBracketHighlight.foreground6","#00000000",g(4944,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),u_t=W("editorBracketHighlight.unexpectedBracket.foreground",{dark:new me(new dn(255,18,18,.8)),light:new me(new dn(255,18,18,.8)),hcDark:new me(new dn(255,50,50,1)),hcLight:""},g(4945,"Foreground color of unexpected brackets.")),g_t=W("editorBracketPairGuide.background1","#00000000",g(4946,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),f_t=W("editorBracketPairGuide.background2","#00000000",g(4947,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),p_t=W("editorBracketPairGuide.background3","#00000000",g(4948,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),m_t=W("editorBracketPairGuide.background4","#00000000",g(4949,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),__t=W("editorBracketPairGuide.background5","#00000000",g(4950,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),v_t=W("editorBracketPairGuide.background6","#00000000",g(4951,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),b_t=W("editorBracketPairGuide.activeBackground1","#00000000",g(4952,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),w_t=W("editorBracketPairGuide.activeBackground2","#00000000",g(4953,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),y_t=W("editorBracketPairGuide.activeBackground3","#00000000",g(4954,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),C_t=W("editorBracketPairGuide.activeBackground4","#00000000",g(4955,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),S_t=W("editorBracketPairGuide.activeBackground5","#00000000",g(4956,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),A_t=W("editorBracketPairGuide.activeBackground6","#00000000",g(4957,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));W("editorUnicodeHighlight.border",um,g(4958,"Border color used to highlight unicode characters."));W("editorUnicodeHighlight.background",jgt,g(4959,"Background color used to highlight unicode characters."));bp((s,e)=>{const t=s.getColor(Hc),i=s.getColor(_qe),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});const Kne=class Kne extends kN{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===wr.Relative||this._renderLineNumbers===wr.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===wr.Relative){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===wr.Interval){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const n=this._context.viewModel.getLineCount();return i===n?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===wr.Off){this._renderResult=null;return}const t=pr?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(l=>!!l.options.lineNumberClassName);o.sort((l,d)=>F.compareRangesUsingEnds(l.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),c=[];for(let l=i;l<=n;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]}};Kne.CLASS_NAME="line-numbers";let lY=Kne;bp((s,e)=>{const t=s.getColor(Kmt),i=s.getColor(r_t);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 E_t=".monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}";ut(E_t,{});const VF=class VF extends uf{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=ls(document.createElement("div")),this._domNode.setClassName(VF.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=ls(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(VF.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)}};VF.CLASS_NAME="glyph-margin",VF.OUTER_CLASS_NAME="margin";let dY=VF;var x_t=".monaco-mouse-cursor-text{cursor:text}";ut(x_t,{});const XS="monaco-mouse-cursor-text";class D_t{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 o5=new D_t,Ut=ae("keybindingService");class k_t{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,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:Il.DefaultForeground,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const Wde=nf;let Ype=class extends uf{constructor(e,t,i,n,o){super(e),this._keybindingService=n,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 dt(1,1,1,1)],this._modelSelections=[new dt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=ls(document.createElement("textarea")),Db.write(this.textArea,sa.TextArea),this.textArea.setClassName(`inputarea ${XS}`),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(9840,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(x.readOnly)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=ls(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,Qn),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 b,w=null;if(Kpe.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const y=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);y&&(b=y.html,w=y.mode)}return{isFromEmptySelection:p,multicursorText:m,text:v,html:b,mode:w}},getScreenReaderContent:()=>{if(this._accessibilitySupport===jl.Disabled){const u=this._selections[0];if(Qt&&u.isEmpty()){const p=u.getStartPosition();let m=this._getWordBeforePosition(p);if(m.length===0&&(m=this._getCharacterBeforePosition(p)),m.length>0)return new Rd(m,m.length,m.length,F.fromPositions(p),0)}if(Qt&&!u.isEmpty()&&l.getValueLengthInRange(u,go.TextDefined)<500){const p=l.getValueInRange(u,go.TextDefined);return new Rd(p,0,p.length,u,0)}if(zy&&!u.isEmpty()){const p="vscode-placeholder";return new Rd(p,0,p.length,null,void 0)}return Rd.EMPTY}if(EFe){const u=this._selections[0];if(u.isEmpty()){const f=u.getStartPosition(),[p,m]=this._getAndroidWordAtPosition(f);if(p.length>0)return new Rd(p,m,m,F.fromPositions(f),0)}return Rd.EMPTY}return tF.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===jl.Unknown)},deduceModelPosition:(u,f,p)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,f,p)},h=this._register(new Omt(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(qpe,d,h,po,{isAndroid:EFe,isChrome:$7,isFirefox:nf,isSafari:zy})),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 w=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),y=w.lastIndexOf(` +`),C=w.substring(y+1),A=C.lastIndexOf(" "),L=C.length-A-1,k=p.getStartPosition(),P=Math.min(k.column-1,L),R=k.column-1-P,z=C.substring(0,C.length-P),{tabSize:G}=this._context.viewModel.model.getOptions(),j=I_t(this.textArea.domNode.ownerDocument,z,this._fontInfo,G);return{distanceToModelLineStart:R,widthOfHiddenTextBefore:j}})(),{distanceToModelLineEnd:b}=(()=>{const w=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),y=w.indexOf(` +`),C=y===-1?w:w.substring(0,y),A=C.indexOf(" "),L=A===-1?C.length:C.length-A-1,k=p.getEndPosition(),P=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-P}})();this._context.viewModel.revealRange("keyboard",!0,F.fromPositions(this._selections[0].getStartPosition()),_s.Simple,mt.Immediate),this._visibleTextArea=new k_t(this._context,p.startLineNumber,m,v,b),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${XS} 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 ${XS}`),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(o5.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=hm(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);n.get(d)!==zr.Regular?o=!1:r--}if(a&&c>i.length&&(a=!1),a){const d=i.charCodeAt(c-1);n.get(d)!==zr.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=hm(this._context.configuration.options.get(x.wordSeparators),[]);let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==zr.Regular||o>50)return t.substring(n-1,e.column-1);o++,n--}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(!Pc(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){if(e.get(x.accessibilitySupport)===jl.Disabled){const i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),n=this._keybindingService.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),o=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),r=g(9841,"The editor is not accessible at this time.");return i?g(9842,"{0} To enable screen reader optimized mode, use {1}",r,i):n?g(9843,"{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,n):o?g(9844,"{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===jl.Enabled&&t===vh.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(x.layoutInfo).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==jl.Disabled){const o=e.get(x.fontInfo);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=Wde?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:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*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;!o5.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,n=this._visibleTextArea.visibleTextareaEnd,o=this._visibleTextArea.startPosition,r=this._visibleTextArea.endPosition;if(o&&r&&i&&n&&n.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=n.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:(Ta.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(Qt||this._accessibilitySupport===jl.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:Wde?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:Wde?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;xl(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?me.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 n=this._context.configuration.options;n.get(x.glyphMargin)?i.setClassName("monaco-editor-background textAreaCover "+dY.OUTER_CLASS_NAME):n.get(x.lineNumbers).renderType!==wr.Off?i.setClassName("monaco-editor-background textAreaCover "+lY.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};Ype=D([_(3,Ut),_(4,we)],Ype);function I_t(s,e,t,i){if(e.length===0)return 0;const n=s.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=s.createElement("span");xl(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),n.appendChild(o),s.body.appendChild(n);const r=o.offsetWidth;return n.remove(),r}class T_t{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Xc.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):n?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){Xc.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Xc.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Xc.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Xc.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Xc.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Xc.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Xc.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Xc.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Xc.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Xc.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Xc.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Xc.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Xc.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 Tqe{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 Ni("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let o=0,r=0;for(let c=i;c<=n;c++){const l=c-this._rendLineNumberStart;e<=c&&c<=t&&(r===0?(o=l,r=1):r++)}if(e=n&&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,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)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(),n=!0}}return n}}class Lqe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Tqe(()=>this._host.createVisibleLine())}_createDomNode(){const e=ls(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,n=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,n,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,n),o}_renderUntouchedLines(e,t,i,n,o){const r=e.rendLineNumberStart,a=e.lines;for(let c=t;c<=i;c++){const l=r+c;a[c].layoutLine(l,n[l-o],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,n,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];n[a]&&(c.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");HC._ttPolicy&&(t=HC._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;oe}),HC._sb=new pU(1e5);let Jpe=HC;class Rqe extends uf{constructor(e){super(e),this._visibleLines=new Lqe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(x.fontInfo);xl(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,n=t.length;i'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class R_t extends Rqe{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 M_t extends Rqe{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),xl(this.domNode,t.get(x.fontInfo))}onConfigurationChanged(e){const t=this._context.configuration.options;xl(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 Zre{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 Zre.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===Rt.GUTTER_VIEW_ZONE||i.type===Rt.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 N_t=".monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}";ut(N_t,{});class P_t extends uf{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=ls(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),n=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,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 n of i){if(!n.options.blockClassName)continue;let o=this.blocks[t];o||(o=this.blocks[t]=ls(document.createElement("div")),this.domNode.appendChild(o));let r,a;n.options.blockIsAfterEnd?(r=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(r=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),a=n.range.isEmpty()&&!n.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0));const[c,l,d,h]=n.options.blockPadding??[0,0,0,0];o.setClassName("blockDecorations-block "+n.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 n=t;n0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,r=o,a=e.top+e.height,c=n.viewportHeight-a,l=o-i,d=r>=i,h=a,u=c>=i;let f=e.left;return f+t>n.scrollLeft+n.viewportWidth&&(f=n.scrollLeft+n.viewportWidth-t),fc){const u=h-(c-n);h-=u,i-=u}if(h=m,w=h+i<=u.height-v;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(d,m),fitsBelow:w,belowTop:h,left:p}:{fitsAbove:b,aboveTop:o,fitsBelow:w,belowTop:r,left:f}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new o4(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,n=o(i,this._affinity,this._lineHeight);return{primary:t,secondary:n};function o(r,a,c){if(!r)return null;const l=e.visibleRangeForPosition(r);if(!l)return null;const d=r.column===1&&a===Io.LeftOfInjectedText?0:l.left,h=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.scrollTop;return new YOe(h,d,c)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=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"&&Hde(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"&&Hde(this._actual.afterRender,this._actual,this._renderData.position)}};class s4{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class o4{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class YOe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function Hde(s,e,...t){try{return s.call(e,...t)}catch{return null}}var B_t=`.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}`;ut(j_t,{});class Uqe extends RN{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 dt(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),is(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,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,n=[];for(let r=t;r<=i;r++){const a=r-t;n[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;n[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;n[a]=o}this._renderData=n}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 Y_t extends Uqe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class J_t extends Uqe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Cp((s,e)=>{const t=s.getColor(Eqe);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()||s.defines(aBe)){const i=s.getColor(aBe);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}; }`),Ry(s.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 X_t=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";ut(X_t,{});class Z_t extends RN{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=[],n=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:F.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 n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(c.range.startLineNumber,n),h=Math.min(c.range.endLineNumber,o);for(let u=d;u<=h;u++){const f=u-n;i[f]+=l}}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let o=null,r=!1,a=null,c=!1;for(let l=0,d=t.length;l';a[u]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class evt extends pf{constructor(e,t,i,n){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 "+tme(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 l6(t.domNode,d,this._context.viewLayout.getScrollable())),Tb.write(this.scrollbar.getDomNode(),sa.ScrollableElement),this.scrollbarDomNode=ls(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,mt.Immediate)};this._register(ue(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register(ue(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register(ue(n.domNode,"scroll",u=>h(n.domNode,!0,!1))),this._register(ue(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),n=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:n,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 "+tme(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var tvt=".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%)}";ut(tvt,{});class sme{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class ivt{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class nvt{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Vqe extends RN{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const c=a-e;n[c]=new nvt}if(i.length===0)return n;i.sort((a,c)=>a.className===c.className?a.startLineNumber===c.startLineNumber?a.endLineNumber-c.endLineNumber:a.startLineNumber-c.startLineNumber:a.classNamen)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 rvt(l,h,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,n)=>i.lineNumber===n.lineNumber?i.laneIndex===n.laneIndex?i.zIndex===n.zIndex?n.type===i.type?i.type===AT.Decoration&&n.type===AT.Decoration?i.className0;){const n=t.peek();if(!n)break;const o=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===AT.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 n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),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 AT;(function(s){s[s.Decoration=0]="Decoration",s[s.Widget=1]="Widget"})(AT||(AT={}));class ovt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=AT.Decoration}accept(e){return new avt(this.lineNumber,this.laneIndex,e)}}class rvt{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=AT.Widget}}class avt{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var cvt=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";ut(cvt,{});class zqe extends V{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function sae(s,e){let t=0,i=0;const n=s.length;for(;in)throw new Ni("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 P=k-2;P>=0;P--){const R=this._computeIndentLevel(P);if(R>=0){a=P,c=R;break}}}if(l===-2){l=-1,d=-1;for(let P=k;P=0){l=P,d=R;break}}}};let u=-2,f=-1,p=-2,m=-1;const v=k=>{if(u===-2){u=-1,f=-1;for(let P=k-2;P>=0;P--){const R=this._computeIndentLevel(P);if(R>=0){u=P,f=R;break}}}if(p!==-1&&(p===-2||p=0){p=P,m=R;break}}}};let b=0,w=!0,y=0,C=!0,A=0,L=0;for(let k=0;w||C;k++){const P=e-k,R=e+k;k>1&&(P<1||P1&&(R>n||R>i)&&(C=!1),k>5e4&&(w=!1,C=!1);let z=-1;if(w&&P>=1){const Y=this._computeIndentLevel(P-1);Y>=0?(l=P-1,d=Y,z=Math.ceil(Y/this.textModel.getOptions().indentSize)):(h(P),z=this._getIndentLevelForWhitespaceLine(r,c,d))}let G=-1;if(C&&R<=n){const Y=this._computeIndentLevel(R-1);Y>=0?(u=R-1,f=Y,G=Math.ceil(Y/this.textModel.getOptions().indentSize)):(v(R),G=this._getIndentLevelForWhitespaceLine(r,f,m))}if(k===0){L=z;continue}if(k===1){if(R<=n&&G>=0&&L+1===G){w=!1,b=R,y=R,A=G;continue}if(P>=1&&z>=0&&z-1===L){C=!1,b=P,y=P,A=z;continue}if(b=e,y=e,A=L,A===0)return{startLineNumber:b,endLineNumber:y,indent:A}}w&&(z>=A?b=P:w=!1),C&&(G>=A?y=R:C=!1)}return{startLineNumber:b,endLineNumber:y,indent:A}}getLinesBracketGuides(e,t,i,n){const o=[];for(let h=e;h<=t;h++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new F(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(F.fromPositions(i)).toArray()).filter(u=>F.strictContainsPosition(u.range,i));c=Ak(h,u=>r)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new $qe;for(const h of a){if(!h.closingBracketRange)continue;const u=c&&h.range.equalsRange(c);if(!u&&!n.includeInactive)continue;const f=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,l)+(n.highlightActive&&u?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=n.horizontalGuides===ET.Enabled||n.horizontalGuides===ET.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&o[h.range.startLineNumber-e].push(new x1(-1,h.openingBracketRange.getEndPosition().column,f,new l5(!1,m.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(m),w=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),y=Math.min(w,b,h.minVisibleColumnIndentation+1);let C=!1;kh(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&o[p.lineNumber-e].push(new x1(y,-1,f,new l5(!1,p.column),-1,-1)),m.lineNumber<=t&&b>y&&o[m.lineNumber-e].push(new x1(y,-1,f,new l5(!C,m.column),-1,-1)))}for(const h of o)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return o}getVisibleColumnFromPosition(e){return qa.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 n=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/n.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 n=this.textModel.getOptions();return t===-1||i===-1?0:tn||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 n=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?ET.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?ET.EnabledForActive:ET.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=n?n[h-e]:[],p=new Uy(f),m=o?o[h-e]:0;for(let v=1;v<=m;v++){const b=(v-1)*l+1,w=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=h&&h<=a&&v===c;u.push(...p.takeWhile(C=>C.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 aP(s){if(!(s&&s.isTransparent()))return s}Cp((s,e)=>{const t=[{bracketColor:Rqe,guideColor:A_t,guideColorActive:T_t},{bracketColor:Mqe,guideColor:E_t,guideColorActive:L_t},{bracketColor:Nqe,guideColor:x_t,guideColorActive:R_t},{bracketColor:Pqe,guideColor:D_t,guideColorActive:M_t},{bracketColor:Fqe,guideColor:k_t,guideColorActive:N_t},{bracketColor:Oqe,guideColor:I_t,guideColorActive:P_t}],i=new $qe,n=[{indentColor:d6,indentColorActive:h6},{indentColor:r_t,indentColorActive:h_t},{indentColor:a_t,indentColorActive:u_t},{indentColor:c_t,indentColorActive:g_t},{indentColor:l_t,indentColorActive:f_t},{indentColor:d_t,indentColorActive:p_t}],o=t.map(a=>{const c=s.getColor(a.bracketColor),l=s.getColor(a.guideColor),d=s.getColor(a.guideColorActive),h=aP(aP(l)??c?.transparent(.3)),u=aP(aP(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(Fc),r=n.map(a=>{const c=s.getColor(a.indentColor),l=s.getColor(a.indentColorActive),d=aP(c),h=aP(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(Fc);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 hvt=".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}";ut(hvt,{});class Qde{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 uvt{constructor(){this._currentVisibleRange=new F(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class gvt{constructor(e,t,i,n,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class fvt{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,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 cn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new uvt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(x.stickyScroll).enabled,this._maxNumberStickyLines=n.get(x.stickyScroll).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new dS(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),n=t.get(x.wrappingInfo);return this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.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,Dl(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new ZOe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).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 gvt(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 fvt(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?mt.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 n=this._getLineNumberFor(i);if(n===-1||n<1||n>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(n)===1)return new oe(n,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(nr)return null;let a=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const c=this._context.viewModel.getLineMinColumn(n);return ai)return-1;const n=new Qde(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=F.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let r=0;const a=new Qde(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hd)continue;const u=h===n.startLineNumber?n.startColumn:1,f=h!==n.endLineNumber,p=f?this._context.viewModel.getLineMaxColumn(h):n.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,p,a);if(m){if(t&&hthis._visibleLines.getEndLineNumber())return null;const n=new Qde(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Zpt(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 n=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}n=Math.max(n,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;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<=n;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 n=this._computeScrollLeftToReveal(i);n&&(this._isViewportWrapping||this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),pr&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;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 b=o[0].startLineNumber,w=o[0].endLineNumber;for(let y=1,C=o.length;yc){if(!d)return-1;v=h}else if(r===_s.NearTop||r===_s.NearTopIfOutsideViewport)if(r===_s.NearTopIfOutsideViewport&&a<=h&&u<=l)v=a;else{const b=Math.max(5*this._lineHeight,c*.2),w=h-b,y=u-c;v=Math.max(y,w)}else if(r===_s.Center||r===_s.CenterIfOutsideViewport)if(r===_s.CenterIfOutsideViewport&&a<=h&&u<=l)v=a;else{const b=(h+u)/2;v=Math.max(0,b-c/2)}else v=this._computeMinimumScrolling(a,l,h,u,r===_s.Top,r===_s.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let r=Un.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-Jne.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,n,o,r){e=e|0,t=t|0,i=i|0,n=n|0,o=!!o,r=!!r;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}};Jne.HORIZONTAL_EXTRA_PX=30;let ome=Jne;var pvt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";ut(pvt,{});class mvt extends Vqe{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 n=0;for(let o=0,r=t.length;o',c=[];for(let l=t;l<=i;l++){const d=l-t,h=n[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 bvt=".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}";ut(bvt,{});const zE=class zE{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=zE._clamp(e),this.g=zE._clamp(t),this.b=zE._clamp(i),this.a=zE._clamp(n)}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}};zE.Empty=new zE(0,0,0,0);let eA=zE;var Dn;(function(s){s[s.START_CH_CODE=32]="START_CH_CODE",s[s.END_CH_CODE=126]="END_CH_CODE",s[s.UNKNOWN_CODE=65533]="UNKNOWN_CODE",s[s.CHAR_COUNT=96]="CHAR_COUNT",s[s.SAMPLED_CHAR_HEIGHT=16]="SAMPLED_CHAR_HEIGHT",s[s.SAMPLED_CHAR_WIDTH=10]="SAMPLED_CHAR_WIDTH",s[s.BASE_CHAR_HEIGHT=2]="BASE_CHAR_HEIGHT",s[s.BASE_CHAR_WIDTH=1]="BASE_CHAR_WIDTH",s[s.RGBA_CHANNELS_CNT=4]="RGBA_CHANNELS_CNT",s[s.RGBA_SAMPLED_ROW_WIDTH=3840]="RGBA_SAMPLED_ROW_WIDTH"})(Dn||(Dn={}));const wvt=(()=>{const s=[];for(let e=Dn.START_CH_CODE;e<=Dn.END_CH_CODE;e++)s.push(e);return s.push(Dn.UNKNOWN_CODE),s})(),yvt=(s,e)=>(s-=Dn.START_CH_CODE,s<0||s>Dn.CHAR_COUNT?e<=2?(s+Dn.CHAR_COUNT)%Dn.CHAR_COUNT:Dn.CHAR_COUNT-1:s),Xne=class Xne extends V{static getInstance(){return this._INSTANCE||(this._INSTANCE=A2(new Xne)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ta.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Ta.getColorMap();if(!e){this._colors=[eA.Empty],this._backgroundIsLight=!0;return}this._colors=[eA.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Tl.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};Xne._INSTANCE=null;let gY=Xne;class X8{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=X8.soften(e,12/15),this.charDataLight=X8.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+p>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,v=yvt(n,l),b=e.width*Dn.RGBA_CHANNELS_CNT,w=a.r,y=a.g,C=a.b,A=o.r-w,L=o.g-y,k=o.b-C,P=Math.max(r,c),R=e.data;let z=v*u*f,G=i*b+t*Dn.RGBA_CHANNELS_CNT;for(let Y=0;Ye.width||i+h>e.height){console.warn("bad render request outside image data");return}const u=e.width*Dn.RGBA_CHANNELS_CNT,f=.5*(o/255),p=r.r,m=r.g,v=r.b,b=n.r-p,w=n.g-m,y=n.b-v,C=p+b*f,A=m+w*f,L=v+y*f,k=Math.max(o,a),P=e.data;let R=i*u+t*Dn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t>1]=lBe[s[t]]<<4|lBe[s[t+1]]&15;return e},hBe={1:hm(()=>dBe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:hm(()=>dBe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class d5{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return hBe[e]?i=new X8(hBe[e](),e):i=d5.createFromSampleData(d5.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=`${Dn.SAMPLED_CHAR_HEIGHT}px`,t.height=Dn.SAMPLED_CHAR_HEIGHT,t.width=Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH,t.style.width=Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${Dn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let n=0;for(const o of wvt)i.fillText(String.fromCharCode(o),n,Dn.SAMPLED_CHAR_HEIGHT/2),n+=Dn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH,Dn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=Dn.SAMPLED_CHAR_HEIGHT*Dn.SAMPLED_CHAR_WIDTH*Dn.RGBA_CHANNELS_CNT*Dn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const n=d5._downsample(e,t);return new X8(n,t)}static _downsampleChar(e,t,i,n,o){const r=Dn.BASE_CHAR_WIDTH*o,a=Dn.BASE_CHAR_HEIGHT*o;let c=n,l=0;for(let d=0;d0){const l=255/c;for(let d=0;dd5.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Tl.DefaultBackground),this.backgroundColor=OO._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=OO._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Tft);return i?new eA(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Lft);return t?eA._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Rl);return i?new eA(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 h5{constructor(e,t,i,n,o,r,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,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,n,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 L=c*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/L)),P=Math.max(0,e.minimapHeight-k),R=P/(d-o),z=l*R,G=P>0,Y=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),j=Math.floor(e.paddingTop/e.lineHeight);return new h5(l,d,G,R,z,k,j,1,Math.min(a,Y))}let v;if(r&&i!==a){const L=i-t+1;v=Math.floor(L*f/u)}else{const L=o/m;v=Math.floor(L*f/u)}const b=Math.floor(e.paddingTop/m);let w=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const L=o/m;w=Math.max(w,L-1)}let y;if(w>0){const L=o/m;y=(b+a+w-L-1)*f/u}else y=Math.max(0,(b+a)*f/u-v);y=Math.min(e.minimapHeight-v,y);const C=y/(d-o),A=l*C;if(p>=b+a+w){const L=y>0;return new h5(l,d,L,C,A,v,b,1,a)}else{let L;t>1?L=t+b:L=Math.max(1,l/m);let k,P=Math.max(1,Math.floor(L-A*u/f));Pl&&(P=Math.min(P,h.startLineNumber),k=Math.max(k,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?G=(t-P+k+z)*f/u:G=l/e.paddingTop*(k+z)*f/u,new h5(l,d,!0,C,G,v,k,P,R)}}}const Zne=class Zne{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};Zne.INVALID=new Zne(-1);let fY=Zne;class uBe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Bqe(()=>fY.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let n=0,o=i.length;n1){for(let b=0,w=n-1;b0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=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(n)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Z8.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.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 n=[];for(let o=0,r=t-e+1;o!n.options.minimap?.sectionHeaderStyle);if(this._samplingState){const n=[];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);n.push(new VKe(new F(a,r.startColumn,c,r.endColumn),o.options))}return n}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 n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new F(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new F(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 n=this._sectionHeaderCache.get(i);if(n)return n;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 F(e,1,e,1),_s.Center,mt.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},mt.Immediate)}}class rF extends V{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(QOe),this._domNode=ls(document.createElement("div")),Tb.write(this._domNode,sa.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ls(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ls(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ls(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ls(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=ls(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Ro(this._domNode.domNode,ke.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===gb.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=Cr(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 SU,this._sliderPointerDownListener=Ro(this._slider.domNode,ke.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=fd.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ue(this._domNode.domNode,uo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=ue(this._domNode.domNode,uo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ro(this._domNode.domNode,uo.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 n=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const c=Cr(this._domNode.domNode),l=Math.min(Math.abs(a-n),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(Qn&&l>Cvt){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,n),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 ZTe(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(QOe),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===gb.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=h5.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(F.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:n,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,n,o);const d=new gBe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,r),this._renderDecorationsLineHighlights(l,i,d,e,r);const h=new gBe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,r,c,a,n),this._renderDecorationsHighlights(l,i,h,e,r,c,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,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=n.intersectWithViewport(c);if(!l)continue;const[d,h]=l;for(let p=d;p<=h;p++)i.set(p,!0);const u=n.getYForLineNumber(d,o),f=n.getYForLineNumber(h,o);a>=u||(a>r&&e.fillRect(Xb,r,e.canvas.width,a-r),r=u),a=f}a>r&&e.fillRect(Xb,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,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!==Th.Inline)continue;const d=n.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=n.getYForLineNumber(h,o);e.fillRect(Xb,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,r,a,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const l of t){const d=n.intersectWithViewport(l);if(!d)continue;const[h,u]=d;for(let f=h;f<=u;f++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,f,o,o,r,a,c)}}_renderDecorationsHighlights(e,t,i,n,o,r,a,c){for(const l of t){const d=l.options.minimap;if(!d)continue;const h=n.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 Th.Inline:this.renderDecorationOnLine(e,i,l.range,p,n,m,o,o,r,a,c);continue;case Th.Gutter:{const v=n.getYForLineNumber(m,o);this.renderDecoration(e,p,2,v,Svt,o);continue}}}}renderDecorationOnLine(e,t,i,n,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),b=this.getXOffsetForPosition(t,r,m,l,d,h),w=this.getXOffsetForPosition(t,r,v,l,d,h);this.renderDecoration(e,n,b,u,w-b,a)}getXOffsetForPosition(e,t,i,n,o,r){if(i===1)return Xb;if((i-1)*o>=r)return r;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[Xb];let d=Xb;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=rF._fitSectionHeader.bind(null,u,r-Xb);for(const m of f){const v=e.getYForLineNumber(m.range.startLineNumber,t)+i,b=v-i,w=b+2,y=this._model.getSectionHeaderText(m,p);rF._renderSectionLabel(u,y,m.options.minimap?.sectionHeaderStyle===P8.Underlined,c,d,r,b,o,v,w)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",o=e.measureText(i).width,r=e.measureText(n).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)+n+i.substring(a-(l-d))}static _renderSectionLabel(e,t,i,n,o,r,a,c,l,d){t&&(e.fillStyle=n,e.fillRect(0,a,r,c),e.fillStyle=o,e.fillText(t,Xb,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,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const ge=this._lastRenderData._get();return new uBe(e,ge.imageData,ge.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,c]=rF._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,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,b=this._model.options.charRenderer(),w=this._model.options.fontScale,y=this._model.options.minimapCharWidth,A=(v===gb.Text?Dn.BASE_CHAR_HEIGHT:Dn.BASE_CHAR_HEIGHT+1)*w,L=n>A?Math.floor((n-A)/2):0,k=u.a/255,P=new eA(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 R=e.topPaddingLineCount*n;const z=[];for(let ge=0,De=i-t+1;ge=0&&Gw)return;const Y=v.charCodeAt(A);if(Y===B.Tab){const j=u-(A+L)%u;L+=j-1,C+=j*r}else if(Y===B.Space)C+=r;else{const j=Tk(Y)?2:1;for(let ne=0;new)return}}}}}class gBe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;nthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var Evt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";ut(Evt,{});class xvt extends pf{constructor(e,t){super(e),this._viewDomNode=t;const n=this._context.configuration.options.get(x.layoutInfo);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ls(document.createElement("div")),Tb.write(this._domNode,sa.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ls(document.createElement("div")),Tb.write(this.overflowingOverlayWidgetsDomNode,sa.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=ls(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()],n=t?t.preference:null,o=t?.stackOridinal;return i.preference===n&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,n=t.length;i0);t.sort((n,o)=>(this._widgets[n].stack||0)-(this._widgets[o].stack||0));for(let n=0,o=t.length;n=3){const o=Math.floor(n/3),r=Math.floor(n/3),a=n-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(n/2),r=n-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=n;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&&me.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 rme;(function(s){s[s.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(rme||(rme={}));var pY;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(pY||(pY={}));var Dv;(function(s){s[s.NotNeeded=0]="NotNeeded",s[s.Maybe=1]="Maybe",s[s.Needed=2]="Needed"})(Dv||(Dv={}));class kvt extends pf{constructor(e){super(e),this._actualShouldRender=Dv.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ls(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=Ta.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 Dvt(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=Dv.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Dv.Maybe,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(n=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}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=Dv.NotNeeded}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?me.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(W8.compareByRenderingProps),this._actualShouldRender===Dv.Maybe&&!W8.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Dv.Needed),this._actualShouldRender===Dv.Maybe&&!is(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Dv.Needed),this._actualShouldRender===Dv.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=n/a,l=rme.MIN_DECORATION_HEIGHT*this._settings.pixelRatio|0,d=l/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=me.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=me.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);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 b=0,w=0,y=0;for(let C=0,A=v.length/3;Cn&&(Y=n-d),R=Y-d,z=Y+d}R>y+1||L!==b?(C!==0&&h.fillRect(u[b],w,f[b],y-w),b=L,w=R,y=z):z>y&&(y=z)}h.fillRect(u[b],w,f[b],y-w)}if(!this._settings.hideCursor){const p=2*this._settings.pixelRatio|0,m=p/2|0,v=this._settings.x[pY.Full],b=this._settings.w[pY.Full];let w=-100,y=-100,C=null;for(let A=0,L=this._cursorPositions.length;An&&(R=n-m);const z=R-m,G=z+p;z>y+1||k!==C?(A!==0&&C&&h.fillRect(v,w,b,y-w),w=z,y=G):G>y&&(y=G),C=k,h.fillStyle=k}C&&h.fillRect(v,w,b,y-w)}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,n),h.moveTo(1,0),h.lineTo(i,0),h.stroke())}}var ame;(function(s){s[s.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(ame||(ame={}));class fBe{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 Gqe{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,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 b=d.color;let w=this._color2Id[b];w||(w=++this._lastAssignedId,this._color2Id[b]=w,this._id2Color[w]=b);const y=new fBe(m-v,m+v,w);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(fBe.compare),a}}class Tvt extends c6{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ls(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Ivt(n=>this._context.viewLayout.getVerticalOffsetForLineNumber(n)),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(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){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,n,a-r),o=l,e.fillStyle=i[o],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,n,a-r),r=d,a=h)}e.fillRect(0,r,n,a-r)}}var Lvt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";ut(Lvt,{});class Rvt extends pf{constructor(e){super(e),this.domNode=ls(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=ls(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 n=this._renderedRulers.pop();this.domNode.removeChild(n),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 Pvt=".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}";ut(Pvt,{});var za;(function(s){s[s.EXTERN=0]="EXTERN",s[s.INTERN=1]="INTERN",s[s.FLAT=2]="FLAT"})(za||(za={}));class Fvt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Ovt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Bvt(s){return new Fvt(s)}function Wvt(s){return new Ovt(s.lineNumber,s.ranges.map(Bvt))}const la=class la extends RN{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 n=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;PG(d-p)p&&(u.top=za.INTERN),PG(h-m)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const o=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let c=0,l=n.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]}};la.SELECTION_CLASS_NAME="selected-text",la.SELECTION_TOP_LEFT="top-left-radius",la.SELECTION_BOTTOM_LEFT="bottom-left-radius",la.SELECTION_TOP_RIGHT="top-right-radius",la.SELECTION_BOTTOM_RIGHT="bottom-right-radius",la.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",la.ROUNDED_PIECE_WIDTH=10;let cme=la;Cp((s,e)=>{const t=s.getColor(lft);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function PG(s){return s<0?-s:s}var Hvt=".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}";ut(Hvt,{});class pBe{constructor(e,t,i,n,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=r,this.textContentClassName=a}}var ES;(function(s){s[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary"})(ES||(ES={}));class mBe{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(x.fontInfo);this._cursorStyle=i.get(x.cursorStyle),this._lineHeight=i.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ls(document.createElement("div")),this._domNode.setClassName(`cursor ${ZS}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Dl(this._domNode,n),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 ES.Single:this._pluralityClass="";break;case ES.MultiPrimary:this._pluralityClass="cursor-primary";break;case ES.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),Dl(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),[n,o]=Q6e(i,t-1);return[new oe(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===qr.Line||this._cursorStyle===qr.LineThin){const u=e.visibleRangeForPosition(n);if(!u||u.outsideRenderedLine)return null;const f=ct(this._domNode.domNode);let p;this._cursorStyle===qr.Line?(p=ZFe(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=o,i=this._getTokenClassName(n))):p=ZFe(f,1);let m=u.left,v=0;p>=2&&m>=1&&(v=1,m-=v);const b=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new pBe(b,m,v,p,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new F(n.lineNumber,n.column,n.lineNumber,n.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===qr.Block&&(t=o,i=this._getTokenClassName(n));let d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===qr.Underline||this._cursorStyle===qr.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new pBe(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} ${ZS} ${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 Fz=class Fz extends pf{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 mBe(this._context,ES.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ls(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 Cm,this._cursorFlatBlinkInterval=new X7,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,n=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let n=0,o=e.ranges.length;n{this._isVisible?this._hide():this._show()},Fz.BLINK_INTERVAL,ct(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},Fz.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case qr.Line:e+=" cursor-line-style";break;case qr.Block:e+=" cursor-block-style";break;case qr.Underline:e+=" cursor-underline-style";break;case qr.LineThin:e+=" cursor-line-thin-style";break;case qr.BlockOutline:e+=" cursor-block-outline-style";break;case qr.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case Rd.Blink:e+=" cursor-blink";break;case Rd.Smooth:e+=" cursor-smooth";break;case Rd.Phase:e+=" cursor-phase";break;case Rd.Expand:e+=" cursor-expand";break;case Rd.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:iae,background:YTe},{class:".cursor-primary",foreground:xqe,background:t_t},{class:".cursor-secondary",foreground:Dqe,background:i_t}];for(const i of t){const n=s.getColor(i.foreground);if(n){let o=s.getColor(i.background);o||(o=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${o}; }`),Ry(s.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const jde=()=>{throw new Error("Invalid change accessor")};class Uvt extends pf{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=ls(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=ls(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 n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(n=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const n={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)}};Vvt(e,n),n.addZone=jde,n.removeZone=jde,n.layoutZone=jde}),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:ls(t.domNode),marginDomNode:t.marginDomNode?ls(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.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.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){vt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){vt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,n=!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&&(R++,z=i&&i[R]),j!==B.Tab&&j!==B.Space||u&&!L&&Y<=P)continue;if(h&&Y>=k&&Y<=P&&j===B.Space){const ge=Y-1>=0?a.charCodeAt(Y-1):B.Null,De=Y+1=0?a.charCodeAt(Y-1):B.Null;if(j===B.Space&&ge!==B.Space&&ge!==B.Tab)continue}if(i&&(!z||z.startOffset>Y||z.endOffset<=Y))continue;const ne=e.visibleRangeForPosition(new oe(t,Y+1));ne&&(r?(G=Math.max(G,ne.left),j===B.Tab?A+=this._renderArrow(f,v,ne.left):A+=``):j===B.Tab?A+=`
    ${C?"→":"→"}
    `:A+=`
    ${String.fromCharCode(y)}
    `)}return r?(G=Math.round(G+v),``+A+""):A}_renderArrow(e,t,i){const n=t/7,o=t,r=e/2,a=i,c={x:0,y:n/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},b={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 _Be{constructor(e){const t=e.options,i=t.get(x.fontInfo),n=t.get(x.experimentalWhitespaceRendering);n==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):n==="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 Gvt{constructor(e,t,i,n){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=n,this.visibleRange=new F(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 Kvt{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 qvt{constructor(e,t,i){this.configuration=e,this.theme=new Kvt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let dme=class extends c6{constructor(e,t,i,n,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new dt(1,1,1,1)],this._renderAnimationFrame=null,this._overflowWidgetsDomNode=r??null;const c=new U_t(t,n,o,e);this._context=new qvt(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(ime,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ls(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ls(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ls(document.createElement("div")),Tb.write(this._overflowGuardContainer,sa.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new evt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new ome(this._context,this._linesContent),this._viewZones=new Uvt(this._context),this._viewParts.push(this._viewZones);const l=new kvt(this._context);this._viewParts.push(l);const d=new Nvt(this._context);this._viewParts.push(d);const h=new z_t(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Y_t(this._context)),h.addDynamicOverlay(new cme(this._context)),h.addDynamicOverlay(new dvt(this._context)),h.addDynamicOverlay(new Z_t(this._context)),h.addDynamicOverlay(new $vt(this._context));const u=new $_t(this._context);this._viewParts.push(u),u.addDynamicOverlay(new J_t(this._context)),u.addDynamicOverlay(new vvt(this._context)),u.addDynamicOverlay(new mvt(this._context)),u.addDynamicOverlay(new hY(this._context)),this._glyphMarginWidgets=new svt(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new uY(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 q_t(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new lme(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new xvt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new Rvt(this._context);this._viewParts.push(p);const m=new K_t(this._context);this._viewParts.push(m);const v=new Avt(this._context);if(this._viewParts.push(v),l){const b=this._scrollbar.getOverviewRulerLayoutInfo();b.parent.insertBefore(l.getDomNode(),b.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 Jmt(this._context,c,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(o=>{const r=o.options.glyphMargin?.position??K_.Center;return n=Math.max(n,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 n=Math.max(n,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>F.compareRangesUsingStarts(o.range,r.range)),t.reset(n);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,overflowWidgetsDomNode:this._overflowWidgetsDomNode,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 smt(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)+" "+tme(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 Ni;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=hme.INSTANCE.scheduleCoordinatedRendering({window:ct(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Ni;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Ni;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Ni;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Ni;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Sx(()=>e.prepareRenderText());const t=Sx(()=>e.renderText());if(t){const[i,n]=t;Sx(()=>e.prepareRender(i,n)),Sx(()=>e.render(i,n))}}_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)}yx.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 Gvt(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 Jpt(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},mt.Immediate),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new oe(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?nae.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Tvt(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()}};dme=D([_(6,we)],dme);function Sx(s){try{return s()}catch(e){return vt(e),null}}const ese=class ese{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,n]of this._animationFrameRunners)n.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,Uj(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Sx(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;io.renderText())}for(let i=0,n=e.length;io.prepareRender(a,c))}for(let i=0,n=e.length;io.render(a,c))}}};ese.INSTANCE=new ese;let hme=ese;class u5{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,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 n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)n0?this.breakOffsets[o-1]:0,t===Io.Left)if(e<=r)n=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 FG(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===Io.Left){if(e>0&&t===this.getMinOutputOffset(e))return new FG(e-1,this.getMaxOutputOffset(e-1))}else if(i===Io.Right){const n=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===Io.None){if(e===i.offsetInInputWithInjections+i.length&&vBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(bBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(vBe(this.injectionOptions[o].cursorStops)||(n-=this.injectionOptions[o].content.length,bBe(this.injectionOptions[o].cursorStops)));)o--;return n}}else if(t===Io.Right||t===Io.RightOfInjectedText){let n=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)n-=this.injectionOptions[o-1].content.length,o--;return n}Z7()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let n=0;for(let o=0;oe)break;if(e<=c)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};n+=r}}}}function vBe(s){return s==null?!0:s===w_.Right||s===w_.Both}function bBe(s){return s==null?!0:s===w_.Left||s===w_.Both}class FG{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 Hg;(function(s){s[s.Flush=1]="Flush",s[s.LineChanged=2]="LineChanged",s[s.LinesDeleted=3]="LinesDeleted",s[s.LinesInserted=4]="LinesInserted",s[s.EOLChanged=5]="EOLChanged"})(Hg||(Hg={}));class Qvt{constructor(){this.changeType=Hg.Flush}}class M_{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new M_(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new M_(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,n)=>i.lineNumber===n.lineNumber?i.column===n.column?i.order-n.order:i.column-n.column:i.lineNumber-n.lineNumber),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}withText(e){return new M_(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class wBe{constructor(e,t,i){this.changeType=Hg.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class jvt{constructor(e,t){this.changeType=Hg.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class Yvt{constructor(e,t,i,n){this.changeType=Hg.LinesInserted,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Jvt{constructor(){this.changeType=Hg.EOLChanged}}class BO{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;ts});class eLe{static create(e){return new eLe(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[];return{addRequest:(c,l,d)=>{r.push(c),a.push(l)},finalize:()=>Zvt(qn(this.targetWindow.deref()),r,e,t,i,n,o,a)}}}function Zvt(s,e,t,i,n,o,r,a){function c(R){const z=a[R];if(z){const G=M_.applyInjectedText(e[R],z),Y=z.map(ne=>ne.options),j=z.map(ne=>ne.column-1);return new u5(j,Y,[G.length],[],0)}else return null}if(n===-1){const R=[];for(let z=0,G=e.length;zl?(G=0,Y=0):j=l-De}const ne=z.substr(G),ge=ebt(ne,Y,i,j,p,u);m[R]=G,v[R]=Y,b[R]=ne,w[R]=ge[0],y[R]=ge[1]}const C=p.build(),A=Xvt?.createHTML(C)??C;f.innerHTML=A,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"),s.document.body.appendChild(f);const L=document.createRange(),k=Array.prototype.slice.call(f.children,0),P=[];for(let R=0;RNe.options),Oe=yt.map(Ne=>Ne.column-1)):(De=null,Oe=null),P[R]=new u5(Oe,De,G,ge,j)}return f.remove(),P}var D1;(function(s){s[s.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(D1||(D1={}));function ebt(s,e,t,i,n,o){if(o!==0){const u=String(o);n.appendString('
    ');const r=s.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[s.length]=c,d[s.length]=a,n.appendString("
    "),[l,d]}function tbt(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),o=[];try{ume(s,n,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 ume(s,e,t,i,n,o,r,a){if(i===o||(n=n||Yde(s,e,t[i],t[i+1]),r=r||Yde(s,e,t[o],t[o+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const c=i+(o-i)/2|0,l=Yde(s,e,t[c],t[c+1]);ume(s,e,t,i,n,c,l,a),ume(s,e,t,c,l,o,r,a)}function Yde(s,e,t,i){return s.setStart(e[t/D1.SPAN_MODULO_LIMIT|0].firstChild,t%D1.SPAN_MODULO_LIMIT),s.setEnd(e[i/D1.SPAN_MODULO_LIMIT|0].firstChild,i%D1.SPAN_MODULO_LIMIT),s.getClientRects()}class ibt extends V{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new mo),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[ri.Eager]=!1,this._finishedInstantiation[ri.AfterFirstRender]=!1,this._finishedInstantiation[ri.BeforeFirstInteraction]=!1,this._finishedInstantiation[ri.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){vt(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(ri.Eager),this._register(XP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.AfterFirstRender)})),this._register(XP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.BeforeFirstInteraction)})),this._register(XP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.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(ri.BeforeFirstInteraction)}onAfterModelAttached(){return XP(ct(this._editor?.getDomNode()),()=>{this._instantiateSome(ri.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!==ri.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){vt(i)}}}}class qqe{constructor(e,t,i,n,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,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 Uh;(function(s){s.EditorHintDecoration="squiggly-hint",s.EditorInfoDecoration="squiggly-info",s.EditorWarningDecoration="squiggly-warning",s.EditorErrorDecoration="squiggly-error",s.EditorUnnecessaryDecoration="squiggly-unnecessary",s.EditorUnnecessaryInlineDecoration="squiggly-inline-unnecessary",s.EditorDeprecatedInlineDecoration="squiggly-inline-deprecated"})(Uh||(Uh={}));var rs;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})(rs||(rs={}));var fo;(function(s){s[s.ColorMask=1]="ColorMask",s[s.ColorMaskInverse=254]="ColorMaskInverse",s[s.ColorOffset=0]="ColorOffset",s[s.IsVisitedMask=2]="IsVisitedMask",s[s.IsVisitedMaskInverse=253]="IsVisitedMaskInverse",s[s.IsVisitedOffset=1]="IsVisitedOffset",s[s.IsForValidationMask=4]="IsForValidationMask",s[s.IsForValidationMaskInverse=251]="IsForValidationMaskInverse",s[s.IsForValidationOffset=2]="IsForValidationOffset",s[s.StickinessMask=24]="StickinessMask",s[s.StickinessMaskInverse=231]="StickinessMaskInverse",s[s.StickinessOffset=3]="StickinessOffset",s[s.CollapseOnReplaceEditMask=32]="CollapseOnReplaceEditMask",s[s.CollapseOnReplaceEditMaskInverse=223]="CollapseOnReplaceEditMaskInverse",s[s.CollapseOnReplaceEditOffset=5]="CollapseOnReplaceEditOffset",s[s.IsMarginMask=64]="IsMarginMask",s[s.IsMarginMaskInverse=191]="IsMarginMaskInverse",s[s.IsMarginOffset=6]="IsMarginOffset",s[s.MIN_SAFE_DELTA=-1073741824]="MIN_SAFE_DELTA",s[s.MAX_SAFE_DELTA=1073741824]="MAX_SAFE_DELTA"})(fo||(fo={}));function Cu(s){return(s.metadata&fo.ColorMask)>>>fo.ColorOffset}function er(s,e){s.metadata=s.metadata&fo.ColorMaskInverse|e<>>fo.IsVisitedOffset===1}function qo(s,e){s.metadata=s.metadata&fo.IsVisitedMaskInverse|(e?1:0)<>>fo.IsForValidationOffset===1}function yBe(s,e){s.metadata=s.metadata&fo.IsForValidationMaskInverse|(e?1:0)<>>fo.IsMarginOffset===1}function CBe(s,e){s.metadata=s.metadata&fo.IsMarginMaskInverse|(e?1:0)<>>fo.StickinessOffset}function SBe(s,e){s.metadata=s.metadata&fo.StickinessMaskInverse|e<>>fo.CollapseOnReplaceEditOffset===1}function ABe(s,e){s.metadata=s.metadata&fo.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===Uv.ForceMove?!1:i===Uv.ForceStay?!0:e}function rbt(s,e,t,i,n){const o=nbt(s),r=o===ni.AlwaysGrowsWhenTypingAtEdges||o===ni.GrowsOnlyWhenTypingBefore,a=o===ni.NeverGrowsWhenTypingAtEdges||o===ni.GrowsOnlyWhenTypingBefore,c=t-e,l=i,d=Math.min(c,l),h=s.start;let u=!1;const f=s.end;let p=!1;e<=h&&f<=t&&sbt(s)&&(s.start=e,u=!0,s.end=e,p=!0);{const v=n?Uv.ForceMove:c>0?Uv.ForceStay:Uv.MarkerDefined;!u&&cP(h,r,e,v)&&(u=!0),!p&&cP(f,a,e,v)&&(p=!0)}if(d>0&&!n){const v=c>l?Uv.ForceStay:Uv.MarkerDefined;!u&&cP(h,r,e+d,v)&&(u=!0),!p&&cP(f,a,e+d,v)&&(p=!0)}{const v=n?Uv.ForceMove:Uv.MarkerDefined;!u&&cP(h,r,t,v)&&(s.start=e+l,u=!0),!p&&cP(f,a,t,v)&&(s.end=e+l,p=!0)}const m=l-c;u||(s.start=Math.max(0,h+m)),p||(s.end=Math.max(0,f+m)),s.start>s.end&&(s.end=s.start)}function abt(s,e,t){let i=s.root,n=0,o=0,r=0,a=0;const c=[];let l=0;for(;i!==hn;){if(ld(i)){qo(i.left,!1),qo(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!ld(i.left)){if(o=n+i.maxEnd,ot){qo(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),c[l++]=i),qo(i,!0),i.right!==hn&&!ld(i.right)){n+=i.delta,i=i.right;continue}}return qo(s.root,!1),c}function cbt(s,e,t,i){let n=s.root,o=0,r=0,a=0;const c=i-(t-e);for(;n!==hn;){if(ld(n)){qo(n.left,!1),qo(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),Bk(n),n=n.parent;continue}if(!ld(n.left)){if(r=o+n.maxEnd,rt){n.start+=c,n.end+=c,n.delta+=c,(n.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),qo(n,!0);continue}if(qo(n,!0),n.right!==hn&&!ld(n.right)){o+=n.delta,n=n.right;continue}}qo(s.root,!1)}function lbt(s,e){let t=s.root;const i=[];let n=0;for(;t!==hn;){if(ld(t)){qo(t.left,!1),qo(t.right,!1),t=t.parent;continue}if(t.left!==hn&&!ld(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),qo(t,!0),t.right!==hn&&!ld(t.right)){t=t.right;continue}}return qo(s.root,!1),i}function dbt(s){let e=s.root;const t=[];let i=0;for(;e!==hn;){if(ld(e)){qo(e.left,!1),qo(e.right,!1),e=e.parent;continue}if(e.left!==hn&&!ld(e.left)){e=e.left;continue}if(e.right!==hn&&!ld(e.right)){e=e.right;continue}t[i++]=e,qo(e,!0)}return qo(s.root,!1),t}function EBe(s,e,t,i,n){let o=s.root,r=0,a=0,c=0;const l=[];let d=0;for(;o!==hn;){if(ld(o)){qo(o.left,!1),qo(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==hn&&!ld(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&&Qqe(o)&&(h=!1),n&&!jqe(o)&&(h=!1),h&&(l[d++]=o),qo(o,!0),o.right!==hn&&!ld(o.right)){r+=o.delta,o=o.right;continue}}return qo(s.root,!1),l}function hbt(s,e,t,i,n,o,r){let a=s.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==hn;){if(ld(a)){qo(a.left,!1),qo(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!ld(a.left)){if(l=c+a.maxEnd,lt){qo(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),n&&Qqe(a)&&(p=!1),r&&!jqe(a)&&(p=!1),p&&(u[f++]=a)}if(qo(a,!0),a.right!==hn&&!ld(a.right)){c+=a.delta,a=a.right;continue}}return qo(s.root,!1),u}function xBe(s,e){if(s.root===hn)return e.parent=hn,e.left=hn,e.right=hn,er(e,rs.Black),s.root=e,s.root;ubt(s,e),CE(e.parent);let t=e;for(;t!==s.root&&Cu(t.parent)===rs.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Cu(i)===rs.Red?(er(t.parent,rs.Black),er(i,rs.Black),er(t.parent.parent,rs.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,g5(s,t)),er(t.parent,rs.Black),er(t.parent.parent,rs.Red),f5(s,t.parent.parent))}else{const i=t.parent.parent.left;Cu(i)===rs.Red?(er(t.parent,rs.Black),er(i,rs.Black),er(t.parent.parent,rs.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,f5(s,t)),er(t.parent,rs.Black),er(t.parent.parent,rs.Red),g5(s,t.parent.parent))}return er(s.root,rs.Black),e}function ubt(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(fbt(n,o,i.start+t,i.end+t)<0)if(i.left===hn){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===hn){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=hn,e.right=hn,er(e,rs.Red)}function DBe(s,e){let t,i;if(e.left===hn?(t=e.right,i=e,t.delta+=e.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===hn?(t=e.left,i=e):(i=gbt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,er(t,rs.Black),e.detach(),Xde(),Bk(t),s.root.parent=hn;return}const n=Cu(i)===rs.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,er(i,Cu(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==hn&&(i.left.parent=i),i.right!==hn&&(i.right.parent=i)),e.detach(),n){CE(t.parent),i!==e&&(CE(i),CE(i.parent)),Xde();return}CE(t),CE(t.parent),i!==e&&(CE(i),CE(i.parent));let o;for(;t!==s.root&&Cu(t)===rs.Black;)t===t.parent.left?(o=t.parent.right,Cu(o)===rs.Red&&(er(o,rs.Black),er(t.parent,rs.Red),g5(s,t.parent),o=t.parent.right),Cu(o.left)===rs.Black&&Cu(o.right)===rs.Black?(er(o,rs.Red),t=t.parent):(Cu(o.right)===rs.Black&&(er(o.left,rs.Black),er(o,rs.Red),f5(s,o),o=t.parent.right),er(o,Cu(t.parent)),er(t.parent,rs.Black),er(o.right,rs.Black),g5(s,t.parent),t=s.root)):(o=t.parent.left,Cu(o)===rs.Red&&(er(o,rs.Black),er(t.parent,rs.Red),f5(s,t.parent),o=t.parent.left),Cu(o.left)===rs.Black&&Cu(o.right)===rs.Black?(er(o,rs.Red),t=t.parent):(Cu(o.left)===rs.Black&&(er(o.right,rs.Black),er(o,rs.Red),g5(s,o),o=t.parent.left),er(o,Cu(t.parent)),er(t.parent,rs.Black),er(o.left,rs.Black),f5(s,t.parent),t=s.root));er(t,rs.Black),Xde()}function gbt(s){for(;s.left!==hn;)s=s.left;return s}function Xde(){hn.parent=hn,hn.delta=0,hn.start=0,hn.end=0}function g5(s,e){const t=e.right;t.delta+=e.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==hn&&(t.left.parent=e),t.parent=e.parent,e.parent===hn?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Bk(e),Bk(t)}function f5(s,e){const t=e.left;e.delta-=t.delta,(e.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==hn&&(t.right.parent=e),t.parent=e.parent,e.parent===hn?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Bk(e),Bk(t)}function Jqe(s){let e=s.end;if(s.left!==hn){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==hn){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function Bk(s){s.maxEnd=Jqe(s)}function CE(s){for(;s!==hn;){const e=Jqe(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function fbt(s,e,t,i){return s===t?e-i:s-t}var xS;(function(s){s[s.Unknown=0]="Unknown",s[s.Invalid=3]="Invalid",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(xS||(xS={}));function Ab(s){let e=0,t=0,i=0,n=xS.Unknown;for(let o=0,r=s.length;o=np&&(t=t-s%np),t}function bbt(s,e){return s.reduce((t,i)=>Tr(t,e(i)),tu)}function Xqe(s,e){return s===e}function e3(s,e){const t=s,i=e;if(i-t<=0)return tu;const o=Math.floor(t/np),r=Math.floor(i/np),a=i-r*np;if(o===r){const c=t-o*np;return ka(0,a-c)}else return ka(r-o,a)}function WO(s,e){return s=e}function aF(s){return ka(s.lineNumber-1,s.column-1)}function DT(s,e){const t=s,i=Math.floor(t/np),n=t-i*np,o=e,r=Math.floor(o/np),a=o-r*np;return new F(i+1,n+1,r+1,a+1)}function wbt(s){const e=ov(s);return ka(e.length-1,e[e.length-1].length)}const OG=[],Ip=class Ip{static create(e,t){if(e<=128&&t.length===0){let i=Ip.cache[e];return i||(i=new Ip(e,t),Ip.cache[e]=i),i}return new Ip(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 n=i>>5;if(n===0){const r=1<>5;return n===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 Go;(function(s){s[s.Text=0]="Text",s[s.Bracket=1]="Bracket",s[s.Pair=2]="Pair",s[s.UnexpectedClosingBracket=3]="UnexpectedClosingBracket",s[s.List=4]="List"})(Go||(Go={}));class tLe{get length(){return this._length}constructor(e){this._length=e}}class UO extends tLe{static create(e,t,i){let n=e.length;return t&&(n=Tr(n,t.length)),i&&(n=Tr(n,i.length)),new UO(n,e,t,i,t?t.missingOpeningBracketIds:Gg.getEmpty())}get kind(){return Go.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,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return UO.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new UO(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(Tr(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class Q_ extends tLe{static create23(e,t,i,n=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Tr(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Tr(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new ybt(o,e.listHeight+1,e,t,i,r):new t3(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,n=e[0].missingOpeningBracketIds;for(let o=1;o{const n=F.lift(i.range);return new DS(aF(n.getStartPosition()),aF(n.getEndPosition()),wbt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${nm(this.startOffset)}...${nm(this.endOffset)}) -> ${nm(this.newLength)}`}}class Abt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>nLe.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:e3(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ka(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ka(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=nm(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ka(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ka(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 n=_bt(e,t,this.lineIdx,this.lineCharOffset);return new XE(n,Vu.Text,-1,Gg.getEmpty(),new V0(n))}}class xbt{constructor(e,t){this.text=e,this._offset=tu,this.idx=0;const i=t.getRegExpStr(),n=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 XE(ka(0,p),Vu.Text,-1,Gg.getEmpty(),new V0(ka(0,p))));const u=[];for(let p=0;p<60;p++)u.push(new XE(ka(1,p),Vu.Text,-1,Gg.getEmpty(),new V0(ka(1,p))));if(n)for(n.lastIndex=0;(r=n.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 b=p-l;if(bDbt(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===Vu.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Dbt(s){let e=Rh(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class tQe{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=sLe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function kbt(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e=2?iQe(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())LBe(i,n)<=LBe(n,r)?(i=Zde(i,n),n=r):n=Zde(n,r);return Zde(i,n)}function iQe(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n=3?s[2]:null,e)}function LBe(s,e){return Math.abs(s.listHeight-e.listHeight)}function Zde(s,e){return s.listHeight===e.listHeight?Q_.create23(s,e,null,!1):s.listHeight>e.listHeight?Ibt(s,e):Tbt(e,s)}function Ibt(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==Go.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Q_.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Q_.create23(s,n,null,!1):s}function Tbt(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==Go.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Q_.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Q_.create23(n,s,null,!1):s}class Lbt{constructor(e){this.lastOffset=tu,this.nextNodes=[e],this.offsets=[tu],this.idxs=[]}readLongestNodeAt(e,t){if(WO(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=h4(this.nextNodes);if(!i)return;const n=h4(this.offsets);if(WO(e,n))return;if(WO(n,e))if(Tr(n,i.length)<=e)this.nextNodeAfterCurrent();else{const o=ehe(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=ehe(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=h4(this.offsets),t=h4(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=h4(this.nextNodes),n=ehe(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Tr(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function ehe(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function h4(s){return s.length>0?s[s.length-1]:void 0}function gme(s,e,t,i){return new Rbt(s,e,t,i).parseDocument()}let Rbt=class{get nodesConstructed(){return this._itemsConstructed}get nodesReused(){return this._itemsFromCache}constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Lbt(i):void 0,this.positionMapper=new Abt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Gg.getEmpty(),0);return e||(e=Q_.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===Vu.ClosingBracket&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===Go.List&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?kbt(i):iQe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!mY(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!WO(n.length,t)?!1:n.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 Vu.ClosingBracket:return new Sbt(i.bracketIds,i.length);case Vu.Text:return i.astNode;case Vu.OpeningBracket:{if(t>300)return new V0(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),r=this.tokenizer.peek();return r&&r.kind===Vu.ClosingBracket&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),UO.create(i.astNode,o,r.astNode)):UO.create(i.astNode,o,null)}default:throw new Error("unexpected")}}};var nD;(function(s){s[s.InProgress=1]="InProgress",s[s.Completed=2]="Completed"})(nD||(nD={}));function vY(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new Uy(RBe(s)),i=RBe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function o(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!mY(l);){const[h,u]=n.splitAt(l);d.push(h),l=e3(h.lengthAfter,l),n=u??t.dequeue()}return mY(l)||d.push(new Ax(!1,l,l)),d}const r=[];function a(l,d,h){if(r.length>0&&Xqe(r[r.length-1].endOffset,l)){const u=r[r.length-1];r[r.length-1]=new DS(u.startOffset,d,Tr(u.newLength,h))}else r.push({startOffset:l,endOffset:d,newLength:h})}let c=tu;for(const l of i){const d=o(l.lengthBefore);if(l.modified){const h=bbt(d,f=>f.lengthBefore),u=Tr(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=Tr(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return r}class Ax{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=e3(e,this.lengthAfter);return Xqe(t,tu)?[this,void 0]:this.modified?[new Ax(this.modified,this.lengthBefore,e),new Ax(this.modified,tu,t)]:[new Ax(this.modified,e,e),new Ax(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${nm(this.lengthBefore)} -> ${nm(this.lengthAfter)}`}}function RBe(s){const e=[];let t=tu;for(const i of s){const n=e3(t,i.startOffset);mY(n)||e.push(new Ax(!1,n,n));const o=e3(i.startOffset,i.endOffset);e.push(new Ax(!0,o,i.newLength)),t=i.endOffset}return e}class Mbt extends V{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 Zqe,this.brackets=new tQe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===nD.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()),n=new xbt(this.textModel.getValue(),i);this.initialAstWithoutTokens=gme(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===nD.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new DS(ka(i.fromLineNumber-1,0),ka(i.toLineNumber,0),ka(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=DS.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=vY(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=vY(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 n=t,o=new eQe(this.textModel,this.brackets);return gme(o,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=ka(e.startLineNumber-1,e.startColumn-1),n=ka(e.endLineNumber-1,e.endColumn-1);return new gT(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;fme(r,tu,r.length,i,n,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=aF(e.getStartPosition()),n=aF(e.getEndPosition());return new gT(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Nbt(o,t,this.textModel);pme(r,tu,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return sQe(t,tu,t.length,aF(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return nQe(t,tu,t.length,aF(e))}}function nQe(s,e,t,i){if(s.kind===Go.List||s.kind===Go.Pair){const n=[];for(const o of s.children)t=Tr(e,o.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=n.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[o];if(WO(r,i)){const c=nQe(s.children[o],r,a,i);if(c)return c}}return null}else{if(s.kind===Go.UnexpectedClosingBracket)return null;if(s.kind===Go.Bracket){const n=DT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function sQe(s,e,t,i){if(s.kind===Go.List||s.kind===Go.Pair){for(const n of s.children){if(t=Tr(e,n.length),WO(i,t)){const o=sQe(n,e,t,i);if(o)return o}e=t}return null}else{if(s.kind===Go.UnexpectedClosingBracket)return null;if(s.kind===Go.Bracket){const n=DT(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function fme(s,e,t,i,n,o,r,a,c,l,d=!1){if(r>200)return!0;e:for(;;)switch(s.kind){case Go.List:{const h=s.childrenLength;for(let u=0;u200)return!0;let c=!0;if(s.kind===Go.Pair){let l=0;if(a){let u=a.get(s.openingBracket.text);u===void 0&&(u=0),l=u,u++,a.set(s.openingBracket.text,u)}const d=Tr(e,s.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=s.computeMinIndentation(e,o.textModel)),c=o.push(new mbt(DT(e,t),DT(e,d),s.closingBracket?DT(Tr(d,s.child?.length||tu),t):void 0,r,l,s,h)),e=d,c&&s.child){const u=s.child;if(t=Tr(e,u.length),HO(e,n)&&eV(t,i)&&(c=pme(u,e,t,i,n,o,r+1,a),!c))return!1}a?.set(s.openingBracket.text,l)}else{let l=e;for(const d of s.children){const h=l;if(l=Tr(l,d.length),HO(h,n)&&HO(i,l)&&(c=pme(d,h,l,i,n,o,r,a),!c))return!1}}return c}class Pbt extends V{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new wn),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.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=Fbt(e.add(new Mbt(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)||gT.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||gT.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||gT.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(F.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?BG(this._findMatchingBracketUp(c,n,the(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(F.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(Cc(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,F.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=the(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const d=t.getEndOffset(l);if(d<=a)break;if(Zb(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=n+1;l=c)break;if(Zb(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Zb(n.getStandardTokenType(r))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const h=Om.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 KC)return null;d=f}}c=h.endColumn-1}if(d)return d}if(r>0&&n.getStartOffset(r)===e.column-1){const c=r-1,l=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(c)).brackets;if(l&&!Zb(n.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,l,c),u=Om.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 KC?null:p}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof KC?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let r=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return KC.INSTANCE;const f=Om.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 b=d.getLanguageId(f)===n&&!Zb(d.getStandardTokenType(f));if(b)v?p=d.getStartOffset(f):(p=d.getStartOffset(f),m=d.getEndOffset(f));else if(v&&p!==m){const w=c(l,u,p,m);if(w)return w}v=b}if(v&&p!==m){const b=c(l,u,p,m);if(b)return b}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let r=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return KC.INSTANCE;const p=Om.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 b=!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,n=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(n&&o&&f&&h!==u){const v=Om.findPrevBracketInRange(n.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v);f=!1}i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!n&&!Zb(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(o&&n&&f&&h!==u){const v=Om.findPrevBracketInRange(n.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v)}f=m}if(o&&n&&f&&h!==u){const p=Om.findPrevBracketInRange(n.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 n=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);n!==m&&(n=m,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let p=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return p?[p.openingBracketRange,p.closingBracketRange]:null}const n=the(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const c=(f,p)=>{if(!r.has(f)){const m=[];for(let v=0,b=p?p.brackets.length:0;v{for(;;){if(n&&++l%100===0&&!n())return KC.INSTANCE;const w=Om.findNextBracketInRange(f.forwardRegex,p,m,v,b);if(!w)break;const y=m.substring(w.startColumn-1,w.endColumn-1).toLowerCase(),C=f.textIsBracket[y];if(C&&(C.isOpen(y)?a[C.index]++:C.isClose(y)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(w,C,!1,n);v=w.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 b=0,w=0,y=0;if(f===i.lineNumber){b=p.findTokenIndexAtOffset(i.column-1),w=i.column-1,y=i.column-1;const A=p.getLanguageId(b);h!==A&&(h=A,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,u))}let C=!0;for(;be?.dispose()}}function the(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const tse=class tse{constructor(){this._searchCanceledBrand=void 0}};tse.INSTANCE=new tse;let KC=tse;function BG(s){return s instanceof KC?null:s}class Obt extends V{constructor(e){super(),this.textModel=e,this.colorProvider=new oQe,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,n){return n?[]: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 F(1,1,this.textModel.getLineCount(),1),e,t):[]}}class oQe{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}`}}Cp((s,e)=>{const t=[Rqe,Mqe,Nqe,Pqe,Fqe,Oqe],i=new oQe;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(S_t)}; }`);const n=t.map(o=>s.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=n[o%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var Al;(function(s){s[s.Resource=0]="Resource",s[s.Workspace=1]="Workspace"})(Al||(Al={}));class rQe{constructor(e,t){this.resource=e,this.elements=t}}const qF=class qF{constructor(){this.id=qF._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};qF._ID=0,qF.None=new qF;let bY=qF;const QF=class QF{constructor(){this.id=QF._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};QF._ID=0,QF.None=new QF;let z0=QF;function WG(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Kl{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,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${WG(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${WG(this.oldText)}")`:`(replace@${this.oldPosition} "${WG(this.oldText)}" with "${WG(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Tu(e,n,i),i+=4;for(let o=0;o0&&(this.changes=Bbt(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Tu(e,t?t.length:0,i),i+=4,t)for(const n of t)Tu(e,n.selectionStartLineNumber,i),i+=4,Tu(e,n.selectionStartColumn,i),i+=4,Tu(e,n.positionLineNumber,i),i+=4,Tu(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Iu(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(N.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 el}append(e,t,i,n,o){this._data instanceof el&&this._data.append(e,t,i,n,o)}close(){this._data instanceof el&&(this._data=this._data.serialize())}open(){this._data instanceof el||(this._data=el.deserialize(this._data))}undo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof el&&(this._data=this._data.serialize());const e=el.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof el&&(this._data=this._data.serialize());const e=el.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof el&&(this._data=this._data.serialize()),this._data.byteLength+168}}class mme{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=Al.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const o=lP(n.resource);this._editStackElementsMap.set(o,n)}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)N.isUri(t.model)&&e.push(t.model);return e}matchesResource(e){const t=lP(e);return this._editStackElementsMap.has(t)}setModel(e){const t=lP(N.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=lP(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=lP(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,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=lP(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(`${_i(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function _me(s){return s.getEOL()===` -`?Sh.LF:Sh.CRLF}function qC(s){return s?s instanceof aQe||s instanceof mme:!1}class oLe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qC(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qC(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(qC(i)&&i.canAppend(this._model))return i;const n=new aQe(g(4960,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],_me(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=oLe._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),_me(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return vt(i),null}}}class Wbt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Hbt(s,e,t,i,n){n.spacesDiff=0,n.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){n.spacesDiff=h,h>0&&0<=c-1&&c-10?n++:C>1&&o++,Hbt(r,a,v,y,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=l&&d[L]++,r=v,a=y}let u=t;n!==o&&(u=n{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 vme{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!==Si)return rLe(this.right);let e=this;for(;e.parent!==Si&&e.parent.left!==e;)e=e.parent;return e.parent===Si?Si:e.parent}prev(){if(this.left!==Si)return cQe(this.left);let e=this;for(;e.parent!==Si&&e.parent.right!==e;)e=e.parent;return e.parent===Si?Si:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}var $n;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})($n||($n={}));const Si=new vme(null,$n.Black);Si.parent=Si;Si.left=Si;Si.right=Si;Si.color=$n.Black;function rLe(s){for(;s.left!==Si;)s=s.left;return s}function cQe(s){for(;s.right!==Si;)s=s.right;return s}function aLe(s){return s===Si?0:s.size_left+s.piece.length+aLe(s.right)}function cLe(s){return s===Si?0:s.lf_left+s.piece.lineFeedCnt+cLe(s.right)}function ihe(){Si.parent=Si}function p5(s,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!==Si&&(t.left.parent=e),t.parent=e.parent,e.parent===Si?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function m5(s,e){const t=e.left;e.left=t.right,t.right!==Si&&(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===Si?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function HG(s,e){let t,i;if(e.left===Si?(i=e,t=i.right):e.right===Si?(i=e,t=i.left):(i=rLe(e.right),t=i.right),i===s.root){s.root=t,t.color=$n.Black,e.detach(),ihe(),s.root.parent=Si;return}const n=i.color===$n.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,tV(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,tV(s,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Si&&(i.left.parent=i),i.right!==Si&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,tV(s,i)),e.detach(),t.parent.left===t){const r=aLe(t),a=cLe(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,yC(s,t.parent,c,l)}}if(tV(s,t.parent),n){ihe();return}let o;for(;t!==s.root&&t.color===$n.Black;)t===t.parent.left?(o=t.parent.right,o.color===$n.Red&&(o.color=$n.Black,t.parent.color=$n.Red,p5(s,t.parent),o=t.parent.right),o.left.color===$n.Black&&o.right.color===$n.Black?(o.color=$n.Red,t=t.parent):(o.right.color===$n.Black&&(o.left.color=$n.Black,o.color=$n.Red,m5(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=$n.Black,o.right.color=$n.Black,p5(s,t.parent),t=s.root)):(o=t.parent.left,o.color===$n.Red&&(o.color=$n.Black,t.parent.color=$n.Red,m5(s,t.parent),o=t.parent.left),o.left.color===$n.Black&&o.right.color===$n.Black?(o.color=$n.Red,t=t.parent):(o.left.color===$n.Black&&(o.right.color=$n.Black,o.color=$n.Red,p5(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=$n.Black,o.left.color=$n.Black,m5(s,t.parent),t=s.root));t.color=$n.Black,ihe()}function NBe(s,e){for(tV(s,e);e!==s.root&&e.parent.color===$n.Red;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===$n.Red?(e.parent.color=$n.Black,t.color=$n.Black,e.parent.parent.color=$n.Red,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,p5(s,e)),e.parent.color=$n.Black,e.parent.parent.color=$n.Red,m5(s,e.parent.parent))}else{const t=e.parent.parent.left;t.color===$n.Red?(e.parent.color=$n.Black,t.color=$n.Black,e.parent.parent.color=$n.Red,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,m5(s,e)),e.parent.color=$n.Black,e.parent.parent.color=$n.Red,p5(s,e.parent.parent))}s.root.color=$n.Black}function yC(s,e,t,i){for(;e!==s.root&&e!==Si;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function tV(s,e){let t=0,i=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=aLe(e.left)-e.size_left,i=cLe(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==s.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const vC=65535;function lQe(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class Ubt{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function DC(s,e=!0){const t=[0];let i=1;for(let n=0,o=s.length;n126)&&(r=!1)}const a=new Ubt(lQe(s),i,n,o,r);return s.length=0,a}class pg{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class $0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class zbt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Si&&e.iterate(e.root,i=>(i!==Si&&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 $bt{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 n=0;n=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const o of i)o!==null&&n.push(o);this._cache=n}}}class Gbt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new $0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Si,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=DC(e[o].buffer));const a=new pg(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]),n=this.rbInsertRight(n,a)}this._searchCache=new $bt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=vC,i=t-Math.floor(t/3),n=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 $0(c,DC(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 zbt(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,n=>{if(n===Si)return!0;const o=this.getNodeContent(n),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,n=this.root;for(;n!==Si;)if(n.left!==Si&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=o+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==Si;)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=n-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===Si){const o=this.getOffsetAt(i+1,1),r=n-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),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);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 n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Si;){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="",n=!1;return this.iterate(this.root,o=>{if(o===Si)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(n&&(c.charCodeAt(u)===B.LineFeed&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&c.charCodeAt(u+a-1)===B.CarriageReturn?(n=!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;fC+p,t.reset(0)):(w=u.buffer,y=C=>C,t.reset(p));do if(v=t.next(w),v){if(y(v.index)>=m)return d;this.positionInBuffer(e,y(v.index)-f,b);const C=this.getLineFeedCnt(e.piece.bufferIndex,o,b),A=b.line===o.line?b.column-o.column+n:b.column+1,L=A+v[0].length;if(h[d++]=O0(new F(i+C,A,i+C,L),v,c),y(v.index)+v[0].length>=m||d>=l)return d}while(v);return d}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new tF(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,n,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 b=this._buffers[f.piece.bufferIndex].lineStarts,w=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=b[d.line+m],C=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,C,d,this.positionInBuffer(f,y-w),t,i,n,r,o),r>=n)return o;u+=m}const v=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const b=this.getLineContent(u).substring(v,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,v,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(v),u,v,r,o,i,n),r>=n)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,n),o}const p=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,a,u,p,d,h,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,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||vTe(d,i,p,m,f))&&(a[r++]=new F8(new F(n,m+1+o,n,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++]=O0(new F(n,h.index+1+o,n,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!==Si){const{node:n,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,c=a.bufferIndex,l=this.positionInBuffer(n,o);if(n.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 pg(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(n,o)===10){const m={line:h.start.line+1,column:0};h=new pg(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(n,o-1)===13){const m=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,l);else this.deleteNodeTail(n,l);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let f=n;for(let p=0;p=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;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 n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],r=n[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;tvC){const d=[];for(;e.length>vC;){const u=e.charCodeAt(vC-1);let f;u===B.CarriageReturn||u>=55296&&u<=56319?(f=e.substring(0,vC-1),e=e.substring(vC-1)):(f=e.substring(0,vC),e=e.substring(vC));const p=DC(f);d.push(new pg(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 $0(f,p))}const h=DC(e);return d.push(new pg(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 $0(e,h)),d}let t=this._buffers[0].buffer.length;const i=DC(e,!1);let n=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},n=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);n=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!==Si;){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 n+=r.substring(c,c+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Si;)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,n=this.positionInBuffer(e,t),o=n.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,n);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=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-n,d=a-o,h=i.length+d;e.piece=new pg(i.bufferIndex,i.start,r,c,h),yC(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,n=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-n,d=o-c,h=i.length+d;e.piece=new pg(i.bufferIndex,r,i.end,a,h),yC(this,e,d,l)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,c=n.lineFeedCnt,l=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,l),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new pg(n.bufferIndex,n.start,l,d,h),yC(this,e,h-a,d-c);const u=new pg(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.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),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=DC(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Si;)if(i.left!==Si&&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 n+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:n}}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:n};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Si;){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],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}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===Si||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+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===Si||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=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[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 pg(e.piece.bufferIndex,e.piece.start,o,a,r),yC(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 pg(t.piece.bufferIndex,c,t.piece.end,d,l),yC(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;u(t+=this.getNodeContent(i),!0)),t}}class k1 extends V{constructor(e,t,i,n,o,r,a){super(),this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new Gbt(e,i,a)}equals(e){return!(e instanceof k1)||this._BOM!==e._BOM||this.getEOL()!==e.getEOL()?!1:this._pieceTree.equal(e._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new F(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=go.TextDefined){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=go.TextDefined){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const c=r.length-a.length,l=e.endLineNumber-e.startLineNumber;o=c*l}return n-i+o}getCharacterCountInRange(e,t=go.TextDefined){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let r=n;r<=o;r++){const a=this.getLineContent(r),c=r===n?e.startColumn-1:0,l=r===o?e.endColumn-1:a.length;for(let d=c;do-r),is(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,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,n=[];for(let r=t;r<=i;r++){const a=r-t;n[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;n[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;n[a]=o}this._renderData=n}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 W_t extends Mqe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class H_t extends Mqe{_renderOne(e,t){return`
    `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}bp((s,e)=>{const t=s.getColor(_qe);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()||s.defines(jOe)){const i=s.getColor(jOe);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}; }`),Iy(s.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 U_t=".monaco-editor .lines-content .cdr{height:100%;position:absolute}";ut(U_t,{});class V_t extends kN{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=[],n=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:F.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 n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(c.range.startLineNumber,n),h=Math.min(c.range.endLineNumber,o);for(let u=d;u<=h;u++){const f=u-n;i[f]+=l}}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let o=null,r=!1,a=null,c=!1;for(let l=0,d=t.length;l';a[u]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class z_t extends uf{constructor(e,t,i,n){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 "+jpe(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 o6(t.domNode,d,this._context.viewLayout.getScrollable())),Db.write(this.scrollbar.getDomNode(),sa.ScrollableElement),this.scrollbarDomNode=ls(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,mt.Immediate)};this._register(ue(i.domNode,"scroll",u=>h(i.domNode,!0,!0))),this._register(ue(t.domNode,"scroll",u=>h(t.domNode,!0,!1))),this._register(ue(n.domNode,"scroll",u=>h(n.domNode,!0,!1))),this._register(ue(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),n=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:n,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 "+jpe(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}var $_t=".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%)}";ut($_t,{});class Xpe{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class G_t{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class K_t{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Nqe extends kN{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const c=a-e;n[c]=new K_t}if(i.length===0)return n;i.sort((a,c)=>a.className===c.className?a.startLineNumber===c.startLineNumber?a.endLineNumber-c.endLineNumber:a.startLineNumber-c.startLineNumber:a.classNamen)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 j_t(l,h,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,n)=>i.lineNumber===n.lineNumber?i.laneIndex===n.laneIndex?i.zIndex===n.zIndex?n.type===i.type?i.type===wT.Decoration&&n.type===wT.Decoration?i.className0;){const n=t.peek();if(!n)break;const o=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===wT.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 n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),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 wT;(function(s){s[s.Decoration=0]="Decoration",s[s.Widget=1]="Widget"})(wT||(wT={}));class Q_t{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=wT.Decoration}accept(e){return new Y_t(this.lineNumber,this.laneIndex,e)}}class j_t{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=wT.Widget}}class Y_t{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}var J_t=".monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}";ut(J_t,{});class Pqe extends V{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function eae(s,e){let t=0,i=0;const n=s.length;for(;in)throw new Ni("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 P=k-2;P>=0;P--){const R=this._computeIndentLevel(P);if(R>=0){a=P,c=R;break}}}if(l===-2){l=-1,d=-1;for(let P=k;P=0){l=P,d=R;break}}}};let u=-2,f=-1,p=-2,m=-1;const v=k=>{if(u===-2){u=-1,f=-1;for(let P=k-2;P>=0;P--){const R=this._computeIndentLevel(P);if(R>=0){u=P,f=R;break}}}if(p!==-1&&(p===-2||p=0){p=P,m=R;break}}}};let b=0,w=!0,y=0,C=!0,A=0,L=0;for(let k=0;w||C;k++){const P=e-k,R=e+k;k>1&&(P<1||P1&&(R>n||R>i)&&(C=!1),k>5e4&&(w=!1,C=!1);let z=-1;if(w&&P>=1){const j=this._computeIndentLevel(P-1);j>=0?(l=P-1,d=j,z=Math.ceil(j/this.textModel.getOptions().indentSize)):(h(P),z=this._getIndentLevelForWhitespaceLine(r,c,d))}let G=-1;if(C&&R<=n){const j=this._computeIndentLevel(R-1);j>=0?(u=R-1,f=j,G=Math.ceil(j/this.textModel.getOptions().indentSize)):(v(R),G=this._getIndentLevelForWhitespaceLine(r,f,m))}if(k===0){L=z;continue}if(k===1){if(R<=n&&G>=0&&L+1===G){w=!1,b=R,y=R,A=G;continue}if(P>=1&&z>=0&&z-1===L){C=!1,b=P,y=P,A=z;continue}if(b=e,y=e,A=L,A===0)return{startLineNumber:b,endLineNumber:y,indent:A}}w&&(z>=A?b=P:w=!1),C&&(G>=A?y=R:C=!1)}return{startLineNumber:b,endLineNumber:y,indent:A}}getLinesBracketGuides(e,t,i,n){const o=[];for(let h=e;h<=t;h++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new F(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(F.fromPositions(i)).toArray()).filter(u=>F.strictContainsPosition(u.range,i));c=bk(h,u=>r)?.range}const l=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new Fqe;for(const h of a){if(!h.closingBracketRange)continue;const u=c&&h.range.equalsRange(c);if(!u&&!n.includeInactive)continue;const f=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,l)+(n.highlightActive&&u?" "+d.activeClassName:""),p=h.openingBracketRange.getStartPosition(),m=h.closingBracketRange.getStartPosition(),v=n.horizontalGuides===yT.Enabled||n.horizontalGuides===yT.EnabledForActive&&u;if(h.range.startLineNumber===h.range.endLineNumber){v&&o[h.range.startLineNumber-e].push(new C1(-1,h.openingBracketRange.getEndPosition().column,f,new r5(!1,m.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(m),w=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),y=Math.min(w,b,h.minVisibleColumnIndentation+1);let C=!1;xh(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&w>y&&o[p.lineNumber-e].push(new C1(y,-1,f,new r5(!1,p.column),-1,-1)),m.lineNumber<=t&&b>y&&o[m.lineNumber-e].push(new C1(y,-1,f,new r5(!C,m.column),-1,-1)))}for(const h of o)h.sort((u,f)=>u.visibleColumn-f.visibleColumn);return o}getVisibleColumnFromPosition(e){return qa.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 n=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/n.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 n=this.textModel.getOptions();return t===-1||i===-1?0:tn||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 n=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?yT.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?yT.EnabledForActive:yT.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=n?n[h-e]:[],p=new By(f),m=o?o[h-e]:0;for(let v=1;v<=m;v++){const b=(v-1)*l+1,w=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=h&&h<=a&&v===c;u.push(...p.takeWhile(C=>C.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 sP(s){if(!(s&&s.isTransparent()))return s}bp((s,e)=>{const t=[{bracketColor:Aqe,guideColor:g_t,guideColorActive:b_t},{bracketColor:Eqe,guideColor:f_t,guideColorActive:w_t},{bracketColor:xqe,guideColor:p_t,guideColorActive:y_t},{bracketColor:Dqe,guideColor:m_t,guideColorActive:C_t},{bracketColor:kqe,guideColor:__t,guideColorActive:S_t},{bracketColor:Iqe,guideColor:v_t,guideColorActive:A_t}],i=new Fqe,n=[{indentColor:r6,indentColorActive:a6},{indentColor:jmt,indentColorActive:e_t},{indentColor:Ymt,indentColorActive:t_t},{indentColor:Jmt,indentColorActive:i_t},{indentColor:Xmt,indentColorActive:n_t},{indentColor:Zmt,indentColorActive:s_t}],o=t.map(a=>{const c=s.getColor(a.bracketColor),l=s.getColor(a.guideColor),d=s.getColor(a.guideColorActive),h=sP(sP(l)??c?.transparent(.3)),u=sP(sP(d)??c);if(!(!h||!u))return{guideColor:h,guideColorActive:u}}).filter(Fc),r=n.map(a=>{const c=s.getColor(a.indentColor),l=s.getColor(a.indentColorActive),d=sP(c),h=sP(l);if(!(!d||!h))return{indentColor:d,indentColorActive:h}}).filter(Fc);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 evt=".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}";ut(evt,{});class Ude{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 tvt{constructor(){this._currentVisibleRange=new F(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class ivt{constructor(e,t,i,n,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class nvt{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,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 cn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new tvt,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(x.stickyScroll).enabled,this._maxNumberStickyLines=n.get(x.stickyScroll).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new lS(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),n=t.get(x.wrappingInfo);return this._lineHeight=t.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.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,xl(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(x.layoutInfo)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new UOe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).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 ivt(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 nvt(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?mt.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 n=this._getLineNumberFor(i);if(n===-1||n<1||n>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(n)===1)return new oe(n,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(nr)return null;let a=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const c=this._context.viewModel.getLineMinColumn(n);return ai)return-1;const n=new Ude(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=F.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let r=0;const a=new Ude(this.domNode.domNode,this._textRangeRestingSpot);let c=0;t&&(c=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new oe(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hd)continue;const u=h===n.startLineNumber?n.startColumn:1,f=h!==n.endLineNumber,p=f?this._context.viewModel.getLineMaxColumn(h):n.endColumn,m=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,u,p,a);if(m){if(t&&hthis._visibleLines.getEndLineNumber())return null;const n=new Ude(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Vpt(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 n=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}n=Math.max(n,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;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<=n;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 n=this._computeScrollLeftToReveal(i);n&&(this._isViewportWrapping||this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),pr&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;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 b=o[0].startLineNumber,w=o[0].endLineNumber;for(let y=1,C=o.length;yc){if(!d)return-1;v=h}else if(r===_s.NearTop||r===_s.NearTopIfOutsideViewport)if(r===_s.NearTopIfOutsideViewport&&a<=h&&u<=l)v=a;else{const b=Math.max(5*this._lineHeight,c*.2),w=h-b,y=u-c;v=Math.max(y,w)}else if(r===_s.Center||r===_s.CenterIfOutsideViewport)if(r===_s.CenterIfOutsideViewport&&a<=h&&u<=l)v=a;else{const b=(h+u)/2;v=Math.max(0,b-c/2)}else v=this._computeMinimumScrolling(a,l,h,u,r===_s.Top,r===_s.Bottom);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(x.layoutInfo),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let r=Un.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-qne.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,n,o,r){e=e|0,t=t|0,i=i|0,n=n|0,o=!!o,r=!!r;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}};qne.HORIZONTAL_EXTRA_PX=30;let Zpe=qne;var svt=".monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}";ut(svt,{});class ovt extends Nqe{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 n=0;for(let o=0,r=t.length;o',c=[];for(let l=t;l<=i;l++){const d=l-t,h=n[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 cvt=".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}";ut(cvt,{});const HE=class HE{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=HE._clamp(e),this.g=HE._clamp(t),this.b=HE._clamp(i),this.a=HE._clamp(n)}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}};HE.Empty=new HE(0,0,0,0);let ZS=HE;var Dn;(function(s){s[s.START_CH_CODE=32]="START_CH_CODE",s[s.END_CH_CODE=126]="END_CH_CODE",s[s.UNKNOWN_CODE=65533]="UNKNOWN_CODE",s[s.CHAR_COUNT=96]="CHAR_COUNT",s[s.SAMPLED_CHAR_HEIGHT=16]="SAMPLED_CHAR_HEIGHT",s[s.SAMPLED_CHAR_WIDTH=10]="SAMPLED_CHAR_WIDTH",s[s.BASE_CHAR_HEIGHT=2]="BASE_CHAR_HEIGHT",s[s.BASE_CHAR_WIDTH=1]="BASE_CHAR_WIDTH",s[s.RGBA_CHANNELS_CNT=4]="RGBA_CHANNELS_CNT",s[s.RGBA_SAMPLED_ROW_WIDTH=3840]="RGBA_SAMPLED_ROW_WIDTH"})(Dn||(Dn={}));const lvt=(()=>{const s=[];for(let e=Dn.START_CH_CODE;e<=Dn.END_CH_CODE;e++)s.push(e);return s.push(Dn.UNKNOWN_CODE),s})(),dvt=(s,e)=>(s-=Dn.START_CH_CODE,s<0||s>Dn.CHAR_COUNT?e<=2?(s+Dn.CHAR_COUNT)%Dn.CHAR_COUNT:Dn.CHAR_COUNT-1:s),Qne=class Qne extends V{static getInstance(){return this._INSTANCE||(this._INSTANCE=w2(new Qne)),this._INSTANCE}constructor(){super(),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ta.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Ta.getColorMap();if(!e){this._colors=[ZS.Empty],this._backgroundIsLight=!0;return}this._colors=[ZS.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=Il.DefaultBackground),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};Qne._INSTANCE=null;let hY=Qne;class j8{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=j8.soften(e,12/15),this.charDataLight=j8.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+p>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,v=dvt(n,l),b=e.width*Dn.RGBA_CHANNELS_CNT,w=a.r,y=a.g,C=a.b,A=o.r-w,L=o.g-y,k=o.b-C,P=Math.max(r,c),R=e.data;let z=v*u*f,G=i*b+t*Dn.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*Dn.RGBA_CHANNELS_CNT,f=.5*(o/255),p=r.r,m=r.g,v=r.b,b=n.r-p,w=n.g-m,y=n.b-v,C=p+b*f,A=m+w*f,L=v+y*f,k=Math.max(o,a),P=e.data;let R=i*u+t*Dn.RGBA_CHANNELS_CNT;for(let z=0;z{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t>1]=JOe[s[t]]<<4|JOe[s[t+1]]&15;return e},ZOe={1:cm(()=>XOe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:cm(()=>XOe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class a5{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return ZOe[e]?i=new j8(ZOe[e](),e):i=a5.createFromSampleData(a5.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=`${Dn.SAMPLED_CHAR_HEIGHT}px`,t.height=Dn.SAMPLED_CHAR_HEIGHT,t.width=Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH,t.style.width=Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH+"px",i.fillStyle="#ffffff",i.font=`bold ${Dn.SAMPLED_CHAR_HEIGHT}px ${e}`,i.textBaseline="middle";let n=0;for(const o of lvt)i.fillText(String.fromCharCode(o),n,Dn.SAMPLED_CHAR_HEIGHT/2),n+=Dn.SAMPLED_CHAR_WIDTH;return i.getImageData(0,0,Dn.CHAR_COUNT*Dn.SAMPLED_CHAR_WIDTH,Dn.SAMPLED_CHAR_HEIGHT)}static createFromSampleData(e,t){const i=Dn.SAMPLED_CHAR_HEIGHT*Dn.SAMPLED_CHAR_WIDTH*Dn.RGBA_CHANNELS_CNT*Dn.CHAR_COUNT;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");const n=a5._downsample(e,t);return new j8(n,t)}static _downsampleChar(e,t,i,n,o){const r=Dn.BASE_CHAR_WIDTH*o,a=Dn.BASE_CHAR_HEIGHT*o;let c=n,l=0;for(let d=0;d0){const l=255/c;for(let d=0;da5.create(this.fontScale,c.fontFamily)),this.defaultBackgroundColor=i.getColor(Il.DefaultBackground),this.backgroundColor=MO._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=MO._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(bft);return i?new ZS(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(wft);return t?ZS._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Ll);return i?new ZS(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 c5{constructor(e,t,i,n,o,r,a,c,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,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,n,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 L=c*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/L)),P=Math.max(0,e.minimapHeight-k),R=P/(d-o),z=l*R,G=P>0,j=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),K=Math.floor(e.paddingTop/e.lineHeight);return new c5(l,d,G,R,z,k,K,1,Math.min(a,j))}let v;if(r&&i!==a){const L=i-t+1;v=Math.floor(L*f/u)}else{const L=o/m;v=Math.floor(L*f/u)}const b=Math.floor(e.paddingTop/m);let w=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const L=o/m;w=Math.max(w,L-1)}let y;if(w>0){const L=o/m;y=(b+a+w-L-1)*f/u}else y=Math.max(0,(b+a)*f/u-v);y=Math.min(e.minimapHeight-v,y);const C=y/(d-o),A=l*C;if(p>=b+a+w){const L=y>0;return new c5(l,d,L,C,A,v,b,1,a)}else{let L;t>1?L=t+b:L=Math.max(1,l/m);let k,P=Math.max(1,Math.floor(L-A*u/f));Pl&&(P=Math.min(P,h.startLineNumber),k=Math.max(k,h.topPaddingLineCount)),h.scrollTop=e.paddingTop?G=(t-P+k+z)*f/u:G=l/e.paddingTop*(k+z)*f/u,new c5(l,d,!0,C,G,v,k,P,R)}}}const jne=class jne{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};jne.INVALID=new jne(-1);let uY=jne;class eBe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new Tqe(()=>uY.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let n=0,o=i.length;n1){for(let b=0,w=n-1;b0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=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(n)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Y8.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.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 n=[];for(let o=0,r=t-e+1;o!n.options.minimap?.sectionHeaderStyle);if(this._samplingState){const n=[];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);n.push(new NKe(new F(a,r.startColumn,c,r.endColumn),o.options))}return n}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 n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new F(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new F(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 n=this._sectionHeaderCache.get(i);if(n)return n;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 F(e,1,e,1),_s.Center,mt.Smooth)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},mt.Immediate)}}class iF extends V{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(FOe),this._domNode=ls(document.createElement("div")),Db.write(this._domNode,sa.Minimap),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=ls(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=ls(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=ls(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=ls(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=ls(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Ro(this._domNode.domNode,ke.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===db.None||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const l=Cr(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 vU,this._sliderPointerDownListener=Ro(this._slider.domNode,ke.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=ud.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ue(this._domNode.domNode,uo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=ue(this._domNode.domNode,uo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ro(this._domNode.domNode,uo.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 n=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const c=Cr(this._domNode.domNode),l=Math.min(Math.abs(a-n),Math.abs(a-c.left),Math.abs(a-c.left-c.width));if(Qn&&l>hvt){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,n),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 UTe(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(FOe),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===db.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=c5.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(F.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((u,f)=>(u.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:n,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,n,o);const d=new tBe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,r),this._renderDecorationsLineHighlights(l,i,d,e,r);const h=new tBe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,r,c,a,n),this._renderDecorationsHighlights(l,i,h,e,r,c,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,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=n.intersectWithViewport(c);if(!l)continue;const[d,h]=l;for(let p=d;p<=h;p++)i.set(p,!0);const u=n.getYForLineNumber(d,o),f=n.getYForLineNumber(h,o);a>=u||(a>r&&e.fillRect(jb,r,e.canvas.width,a-r),r=u),a=f}a>r&&e.fillRect(jb,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,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!==kh.Inline)continue;const d=n.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=n.getYForLineNumber(h,o);e.fillRect(jb,v,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,r,a,c){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const l of t){const d=n.intersectWithViewport(l);if(!d)continue;const[h,u]=d;for(let f=h;f<=u;f++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,f,o,o,r,a,c)}}_renderDecorationsHighlights(e,t,i,n,o,r,a,c){for(const l of t){const d=l.options.minimap;if(!d)continue;const h=n.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 kh.Inline:this.renderDecorationOnLine(e,i,l.range,p,n,m,o,o,r,a,c);continue;case kh.Gutter:{const v=n.getYForLineNumber(m,o);this.renderDecoration(e,p,2,v,uvt,o);continue}}}}renderDecorationOnLine(e,t,i,n,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),b=this.getXOffsetForPosition(t,r,m,l,d,h),w=this.getXOffsetForPosition(t,r,v,l,d,h);this.renderDecoration(e,n,b,u,w-b,a)}getXOffsetForPosition(e,t,i,n,o,r){if(i===1)return jb;if((i-1)*o>=r)return r;let c=e.get(t);if(!c){const l=this._model.getLineContent(t);c=[jb];let d=jb;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=iF._fitSectionHeader.bind(null,u,r-jb);for(const m of f){const v=e.getYForLineNumber(m.range.startLineNumber,t)+i,b=v-i,w=b+2,y=this._model.getSectionHeaderText(m,p);iF._renderSectionLabel(u,y,m.options.minimap?.sectionHeaderStyle===R8.Underlined,c,d,r,b,o,v,w)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",o=e.measureText(i).width,r=e.measureText(n).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)+n+i.substring(a-(l-d))}static _renderSectionLabel(e,t,i,n,o,r,a,c,l,d){t&&(e.fillStyle=n,e.fillRect(0,a,r,c),e.fillStyle=o,e.fillText(t,jb,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,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const ge=this._lastRenderData._get();return new eBe(e,ge.imageData,ge.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,c]=iF._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,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,b=this._model.options.charRenderer(),w=this._model.options.fontScale,y=this._model.options.minimapCharWidth,A=(v===db.Text?Dn.BASE_CHAR_HEIGHT:Dn.BASE_CHAR_HEIGHT+1)*w,L=n>A?Math.floor((n-A)/2):0,k=u.a/255,P=new ZS(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 R=e.topPaddingLineCount*n;const z=[];for(let ge=0,xe=i-t+1;ge=0&&Gw)return;const j=v.charCodeAt(A);if(j===B.Tab){const K=u-(A+L)%u;L+=K-1,C+=K*r}else if(j===B.Space)C+=r;else{const K=Ek(j)?2:1;for(let ie=0;iew)return}}}}}class tBe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;nthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}var fvt=".monaco-editor .overlayWidgets{left:0;position:absolute;top:0}";ut(fvt,{});class pvt extends uf{constructor(e,t){super(e),this._viewDomNode=t;const n=this._context.configuration.options.get(x.layoutInfo);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=ls(document.createElement("div")),Db.write(this._domNode,sa.OverlayWidgets),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=ls(document.createElement("div")),Db.write(this.overflowingOverlayWidgetsDomNode,sa.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=ls(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()],n=t?t.preference:null,o=t?.stackOridinal;return i.preference===n&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,n=t.length;i0);t.sort((n,o)=>(this._widgets[n].stack||0)-(this._widgets[o].stack||0));for(let n=0,o=t.length;n=3){const o=Math.floor(n/3),r=Math.floor(n/3),a=n-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(n/2),r=n-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=n;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&&me.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 eme;(function(s){s[s.MIN_DECORATION_HEIGHT=6]="MIN_DECORATION_HEIGHT"})(eme||(eme={}));var gY;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(gY||(gY={}));var Av;(function(s){s[s.NotNeeded=0]="NotNeeded",s[s.Maybe=1]="Maybe",s[s.Needed=2]="Needed"})(Av||(Av={}));class _vt extends uf{constructor(e){super(e),this._actualShouldRender=Av.NotNeeded,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=ls(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=Ta.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 mvt(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=Av.Needed,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=Av.Maybe,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(n=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}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=Av.NotNeeded}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?me.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(F8.compareByRenderingProps),this._actualShouldRender===Av.Maybe&&!F8.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=Av.Needed),this._actualShouldRender===Av.Maybe&&!is(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.position.lineNumber===m.position.lineNumber&&p.color===m.color)&&(this._actualShouldRender=Av.Needed),this._actualShouldRender===Av.Maybe)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),c=n/a,l=eme.MIN_DECORATION_HEIGHT*this._settings.pixelRatio|0,d=l/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=me.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=me.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);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 b=0,w=0,y=0;for(let C=0,A=v.length/3;Cn&&(j=n-d),R=j-d,z=j+d}R>y+1||L!==b?(C!==0&&h.fillRect(u[b],w,f[b],y-w),b=L,w=R,y=z):z>y&&(y=z)}h.fillRect(u[b],w,f[b],y-w)}if(!this._settings.hideCursor){const p=2*this._settings.pixelRatio|0,m=p/2|0,v=this._settings.x[gY.Full],b=this._settings.w[gY.Full];let w=-100,y=-100,C=null;for(let A=0,L=this._cursorPositions.length;An&&(R=n-m);const z=R-m,G=z+p;z>y+1||k!==C?(A!==0&&C&&h.fillRect(v,w,b,y-w),w=z,y=G):G>y&&(y=G),C=k,h.fillStyle=k}C&&h.fillRect(v,w,b,y-w)}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,n),h.moveTo(1,0),h.lineTo(i,0),h.stroke())}}var tme;(function(s){s[s.MINIMUM_HEIGHT=4]="MINIMUM_HEIGHT"})(tme||(tme={}));class iBe{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 Oqe{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,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 b=d.color;let w=this._color2Id[b];w||(w=++this._lastAssignedId,this._color2Id[b]=w,this._id2Color[w]=b);const y=new iBe(m-v,m+v,w);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(iBe.compare),a}}class bvt extends s6{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=ls(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new vvt(n=>this._context.viewLayout.getVerticalOffsetForLineNumber(n)),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(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){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,n,a-r),o=l,e.fillStyle=i[o],r=d,a=h):a>=d?a=Math.max(a,h):(e.fillRect(0,r,n,a-r),r=d,a=h)}e.fillRect(0,r,n,a-r)}}var wvt=".monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}";ut(wvt,{});class yvt extends uf{constructor(e){super(e),this.domNode=ls(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=ls(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 n=this._renderedRulers.pop();this.domNode.removeChild(n),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 Avt=".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}";ut(Avt,{});var za;(function(s){s[s.EXTERN=0]="EXTERN",s[s.INTERN=1]="INTERN",s[s.FLAT=2]="FLAT"})(za||(za={}));class Evt{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class xvt{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Dvt(s){return new Evt(s)}function kvt(s){return new xvt(s.lineNumber,s.ranges.map(Dvt))}const la=class la extends kN{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 n=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;RG(d-p)p&&(u.top=za.INTERN),RG(h-m)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const o=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let c=0,l=n.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]}};la.SELECTION_CLASS_NAME="selected-text",la.SELECTION_TOP_LEFT="top-left-radius",la.SELECTION_BOTTOM_LEFT="bottom-left-radius",la.SELECTION_TOP_RIGHT="top-right-radius",la.SELECTION_BOTTOM_RIGHT="bottom-right-radius",la.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",la.ROUNDED_PIECE_WIDTH=10;let ime=la;bp((s,e)=>{const t=s.getColor(Xgt);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function RG(s){return s<0?-s:s}var Ivt=".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}";ut(Ivt,{});class nBe{constructor(e,t,i,n,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=r,this.textContentClassName=a}}var AS;(function(s){s[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary"})(AS||(AS={}));class sBe{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(x.fontInfo);this._cursorStyle=i.get(x.cursorStyle),this._lineHeight=i.get(x.lineHeight),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(x.cursorWidth),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=ls(document.createElement("div")),this._domNode.setClassName(`cursor ${XS}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),xl(this._domNode,n),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 AS.Single:this._pluralityClass="";break;case AS.MultiPrimary:this._pluralityClass="cursor-primary";break;case AS.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),xl(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),[n,o]=H6e(i,t-1);return[new oe(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===qr.Line||this._cursorStyle===qr.LineThin){const u=e.visibleRangeForPosition(n);if(!u||u.outsideRenderedLine)return null;const f=ct(this._domNode.domNode);let p;this._cursorStyle===qr.Line?(p=UFe(f,this._lineCursorWidth>0?this._lineCursorWidth:2),p>2&&(t=o,i=this._getTokenClassName(n))):p=UFe(f,1);let m=u.left,v=0;p>=2&&m>=1&&(v=1,m-=v);const b=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new nBe(b,m,v,p,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new F(n.lineNumber,n.column,n.lineNumber,n.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===qr.Block&&(t=o,i=this._getTokenClassName(n));let d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return(this._cursorStyle===qr.Underline||this._cursorStyle===qr.UnderlineThin)&&(d+=this._lineHeight-2,h=2),new nBe(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} ${XS} ${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 Mz=class Mz extends uf{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 sBe(this._context,AS.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=ls(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 bm,this._cursorFlatBlinkInterval=new Q7,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,n=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let n=0,o=e.ranges.length;n{this._isVisible?this._hide():this._show()},Mz.BLINK_INTERVAL,ct(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},Mz.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case qr.Line:e+=" cursor-line-style";break;case qr.Block:e+=" cursor-block-style";break;case qr.Underline:e+=" cursor-underline-style";break;case qr.LineThin:e+=" cursor-line-thin-style";break;case qr.BlockOutline:e+=" cursor-block-outline-style";break;case qr.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case Td.Blink:e+=" cursor-blink";break;case Td.Smooth:e+=" cursor-smooth";break;case Td.Phase:e+=" cursor-phase";break;case Td.Expand:e+=" cursor-expand";break;case Td.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:Xre,background:BTe},{class:".cursor-primary",foreground:vqe,background:$mt},{class:".cursor-secondary",foreground:bqe,background:Gmt}];for(const i of t){const n=s.getColor(i.foreground);if(n){let o=s.getColor(i.background);o||(o=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${o}; }`),Iy(s.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const Vde=()=>{throw new Error("Invalid change accessor")};class Tvt extends uf{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=ls(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=ls(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 n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(n=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const n={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)}};Lvt(e,n),n.addZone=Vde,n.removeZone=Vde,n.layoutZone=Vde}),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:ls(t.domNode),marginDomNode:t.marginDomNode?ls(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.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.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){vt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){vt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,n=!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&&(R++,z=i&&i[R]),K!==B.Tab&&K!==B.Space||u&&!L&&j<=P)continue;if(h&&j>=k&&j<=P&&K===B.Space){const ge=j-1>=0?a.charCodeAt(j-1):B.Null,xe=j+1=0?a.charCodeAt(j-1):B.Null;if(K===B.Space&&ge!==B.Space&&ge!==B.Tab)continue}if(i&&(!z||z.startOffset>j||z.endOffset<=j))continue;const ie=e.visibleRangeForPosition(new oe(t,j+1));ie&&(r?(G=Math.max(G,ie.left),K===B.Tab?A+=this._renderArrow(f,v,ie.left):A+=``):K===B.Tab?A+=`
    ${C?"→":"→"}
    `:A+=`
    ${String.fromCharCode(y)}
    `)}return r?(G=Math.round(G+v),``+A+""):A}_renderArrow(e,t,i){const n=t/7,o=t,r=e/2,a=i,c={x:0,y:n/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},b={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 oBe{constructor(e){const t=e.options,i=t.get(x.fontInfo),n=t.get(x.experimentalWhitespaceRendering);n==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):n==="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 Nvt{constructor(e,t,i,n){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=n,this.visibleRange=new F(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 Pvt{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 Fvt{constructor(e,t,i){this.configuration=e,this.theme=new Pvt(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let sme=class extends s6{constructor(e,t,i,n,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new dt(1,1,1,1)],this._renderAnimationFrame=null,this._overflowWidgetsDomNode=r??null;const c=new T_t(t,n,o,e);this._context=new Fvt(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Ype,this._context,c,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=ls(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=ls(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=ls(document.createElement("div")),Db.write(this._overflowGuardContainer,sa.OverflowGuard),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new z_t(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new Zpe(this._context,this._linesContent),this._viewZones=new Tvt(this._context),this._viewParts.push(this._viewZones);const l=new _vt(this._context);this._viewParts.push(l);const d=new Svt(this._context);this._viewParts.push(d);const h=new R_t(this._context);this._viewParts.push(h),h.addDynamicOverlay(new W_t(this._context)),h.addDynamicOverlay(new ime(this._context)),h.addDynamicOverlay(new Z_t(this._context)),h.addDynamicOverlay(new V_t(this._context)),h.addDynamicOverlay(new Mvt(this._context));const u=new M_t(this._context);this._viewParts.push(u),u.addDynamicOverlay(new H_t(this._context)),u.addDynamicOverlay(new avt(this._context)),u.addDynamicOverlay(new ovt(this._context)),u.addDynamicOverlay(new lY(this._context)),this._glyphMarginWidgets=new q_t(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new dY(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 F_t(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new nme(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new pvt(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=new yvt(this._context);this._viewParts.push(p);const m=new P_t(this._context);this._viewParts.push(m);const v=new gvt(this._context);if(this._viewParts.push(v),l){const b=this._scrollbar.getOverviewRulerLayoutInfo();b.parent.insertBefore(l.getDomNode(),b.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 Hmt(this._context,c,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(o=>{const r=o.options.glyphMargin?.position??z_.Center;return n=Math.max(n,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 n=Math.max(n,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>F.compareRangesUsingStarts(o.range,r.range)),t.reset(n);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,overflowWidgetsDomNode:this._overflowWidgetsDomNode,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 qpt(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)+" "+jpe(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 Ni;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=ome.INSTANCE.scheduleCoordinatedRendering({window:ct(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Ni;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Ni;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Ni;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Ni;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();wx(()=>e.prepareRenderText());const t=wx(()=>e.renderText());if(t){const[i,n]=t;wx(()=>e.prepareRender(i,n)),wx(()=>e.render(i,n))}}_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)}vx.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 Nvt(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 Hpt(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},mt.Immediate),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new oe(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Zre.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new bvt(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()}};sme=D([_(6,we)],sme);function wx(s){try{return s()}catch(e){return vt(e),null}}const Yne=class Yne{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,n]of this._animationFrameRunners)n.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,Wj(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)wx(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;io.renderText())}for(let i=0,n=e.length;io.prepareRender(a,c))}for(let i=0,n=e.length;io.render(a,c))}}};Yne.INSTANCE=new Yne;let ome=Yne;class l5{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,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 n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)n0?this.breakOffsets[o-1]:0,t===Io.Left)if(e<=r)n=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 MG(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===Io.Left){if(e>0&&t===this.getMinOutputOffset(e))return new MG(e-1,this.getMaxOutputOffset(e-1))}else if(i===Io.Right){const n=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===Io.None){if(e===i.offsetInInputWithInjections+i.length&&rBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(aBe(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(rBe(this.injectionOptions[o].cursorStops)||(n-=this.injectionOptions[o].content.length,aBe(this.injectionOptions[o].cursorStops)));)o--;return n}}else if(t===Io.Right||t===Io.RightOfInjectedText){let n=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)n-=this.injectionOptions[o-1].content.length,o--;return n}j7()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let n=0;for(let o=0;oe)break;if(e<=c)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};n+=r}}}}function rBe(s){return s==null?!0:s===__.Right||s===__.Both}function aBe(s){return s==null?!0:s===__.Left||s===__.Both}class MG{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 Og;(function(s){s[s.Flush=1]="Flush",s[s.LineChanged=2]="LineChanged",s[s.LinesDeleted=3]="LinesDeleted",s[s.LinesInserted=4]="LinesInserted",s[s.EOLChanged=5]="EOLChanged"})(Og||(Og={}));class Ovt{constructor(){this.changeType=Og.Flush}}class T_{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new T_(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new T_(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,n)=>i.lineNumber===n.lineNumber?i.column===n.column?i.order-n.order:i.column-n.column:i.lineNumber-n.lineNumber),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}withText(e){return new T_(this.ownerId,this.lineNumber,this.column,{...this.options,content:e},this.order)}}class cBe{constructor(e,t,i){this.changeType=Og.LineChanged,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Bvt{constructor(e,t){this.changeType=Og.LinesDeleted,this.fromLineNumber=e,this.toLineNumber=t}}class Wvt{constructor(e,t,i,n){this.changeType=Og.LinesInserted,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Hvt{constructor(){this.changeType=Og.EOLChanged}}class NO{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;ts});class VTe{static create(e){return new VTe(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[];return{addRequest:(c,l,d)=>{r.push(c),a.push(l)},finalize:()=>Vvt(qn(this.targetWindow.deref()),r,e,t,i,n,o,a)}}}function Vvt(s,e,t,i,n,o,r,a){function c(R){const z=a[R];if(z){const G=T_.applyInjectedText(e[R],z),j=z.map(ie=>ie.options),K=z.map(ie=>ie.column-1);return new l5(K,j,[G.length],[],0)}else return null}if(n===-1){const R=[];for(let z=0,G=e.length;zl?(G=0,j=0):K=l-xe}const ie=z.substr(G),ge=zvt(ie,j,i,K,p,u);m[R]=G,v[R]=j,b[R]=ie,w[R]=ge[0],y[R]=ge[1]}const C=p.build(),A=Uvt?.createHTML(C)??C;f.innerHTML=A,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"),s.document.body.appendChild(f);const L=document.createRange(),k=Array.prototype.slice.call(f.children,0),P=[];for(let R=0;RPe.options),Re=yt.map(Pe=>Pe.column-1)):(xe=null,Re=null),P[R]=new l5(Re,xe,G,ge,K)}return f.remove(),P}var S1;(function(s){s[s.SPAN_MODULO_LIMIT=16384]="SPAN_MODULO_LIMIT"})(S1||(S1={}));function zvt(s,e,t,i,n,o){if(o!==0){const u=String(o);n.appendString('
    ');const r=s.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[s.length]=c,d[s.length]=a,n.appendString("
    "),[l,d]}function $vt(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),o=[];try{rme(s,n,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 rme(s,e,t,i,n,o,r,a){if(i===o||(n=n||zde(s,e,t[i],t[i+1]),r=r||zde(s,e,t[o],t[o+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const c=i+(o-i)/2|0,l=zde(s,e,t[c],t[c+1]);rme(s,e,t,i,n,c,l,a),rme(s,e,t,c,l,o,r,a)}function zde(s,e,t,i){return s.setStart(e[t/S1.SPAN_MODULO_LIMIT|0].firstChild,t%S1.SPAN_MODULO_LIMIT),s.setEnd(e[i/S1.SPAN_MODULO_LIMIT|0].firstChild,i%S1.SPAN_MODULO_LIMIT),s.getClientRects()}class Gvt extends V{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new mo),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[ri.Eager]=!1,this._finishedInstantiation[ri.AfterFirstRender]=!1,this._finishedInstantiation[ri.BeforeFirstInteraction]=!1,this._finishedInstantiation[ri.Eventually]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){vt(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(ri.Eager),this._register(QP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.AfterFirstRender)})),this._register(QP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.BeforeFirstInteraction)})),this._register(QP(ct(this._editor.getDomNode()),()=>{this._instantiateSome(ri.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(ri.BeforeFirstInteraction)}onAfterModelAttached(){return QP(ct(this._editor?.getDomNode()),()=>{this._instantiateSome(ri.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!==ri.Eager&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){vt(i)}}}}class Wqe{constructor(e,t,i,n,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,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 Hh;(function(s){s.EditorHintDecoration="squiggly-hint",s.EditorInfoDecoration="squiggly-info",s.EditorWarningDecoration="squiggly-warning",s.EditorErrorDecoration="squiggly-error",s.EditorUnnecessaryDecoration="squiggly-unnecessary",s.EditorUnnecessaryInlineDecoration="squiggly-inline-unnecessary",s.EditorDeprecatedInlineDecoration="squiggly-inline-deprecated"})(Hh||(Hh={}));var rs;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})(rs||(rs={}));var fo;(function(s){s[s.ColorMask=1]="ColorMask",s[s.ColorMaskInverse=254]="ColorMaskInverse",s[s.ColorOffset=0]="ColorOffset",s[s.IsVisitedMask=2]="IsVisitedMask",s[s.IsVisitedMaskInverse=253]="IsVisitedMaskInverse",s[s.IsVisitedOffset=1]="IsVisitedOffset",s[s.IsForValidationMask=4]="IsForValidationMask",s[s.IsForValidationMaskInverse=251]="IsForValidationMaskInverse",s[s.IsForValidationOffset=2]="IsForValidationOffset",s[s.StickinessMask=24]="StickinessMask",s[s.StickinessMaskInverse=231]="StickinessMaskInverse",s[s.StickinessOffset=3]="StickinessOffset",s[s.CollapseOnReplaceEditMask=32]="CollapseOnReplaceEditMask",s[s.CollapseOnReplaceEditMaskInverse=223]="CollapseOnReplaceEditMaskInverse",s[s.CollapseOnReplaceEditOffset=5]="CollapseOnReplaceEditOffset",s[s.IsMarginMask=64]="IsMarginMask",s[s.IsMarginMaskInverse=191]="IsMarginMaskInverse",s[s.IsMarginOffset=6]="IsMarginOffset",s[s.MIN_SAFE_DELTA=-1073741824]="MIN_SAFE_DELTA",s[s.MAX_SAFE_DELTA=1073741824]="MAX_SAFE_DELTA"})(fo||(fo={}));function yu(s){return(s.metadata&fo.ColorMask)>>>fo.ColorOffset}function er(s,e){s.metadata=s.metadata&fo.ColorMaskInverse|e<>>fo.IsVisitedOffset===1}function qo(s,e){s.metadata=s.metadata&fo.IsVisitedMaskInverse|(e?1:0)<>>fo.IsForValidationOffset===1}function lBe(s,e){s.metadata=s.metadata&fo.IsForValidationMaskInverse|(e?1:0)<>>fo.IsMarginOffset===1}function dBe(s,e){s.metadata=s.metadata&fo.IsMarginMaskInverse|(e?1:0)<>>fo.StickinessOffset}function hBe(s,e){s.metadata=s.metadata&fo.StickinessMaskInverse|e<>>fo.CollapseOnReplaceEditOffset===1}function uBe(s,e){s.metadata=s.metadata&fo.CollapseOnReplaceEditMaskInverse|(e?1:0)<t||i===Bv.ForceMove?!1:i===Bv.ForceStay?!0:e}function jvt(s,e,t,i,n){const o=Kvt(s),r=o===ni.AlwaysGrowsWhenTypingAtEdges||o===ni.GrowsOnlyWhenTypingBefore,a=o===ni.NeverGrowsWhenTypingAtEdges||o===ni.GrowsOnlyWhenTypingBefore,c=t-e,l=i,d=Math.min(c,l),h=s.start;let u=!1;const f=s.end;let p=!1;e<=h&&f<=t&&qvt(s)&&(s.start=e,u=!0,s.end=e,p=!0);{const v=n?Bv.ForceMove:c>0?Bv.ForceStay:Bv.MarkerDefined;!u&&oP(h,r,e,v)&&(u=!0),!p&&oP(f,a,e,v)&&(p=!0)}if(d>0&&!n){const v=c>l?Bv.ForceStay:Bv.MarkerDefined;!u&&oP(h,r,e+d,v)&&(u=!0),!p&&oP(f,a,e+d,v)&&(p=!0)}{const v=n?Bv.ForceMove:Bv.MarkerDefined;!u&&oP(h,r,t,v)&&(s.start=e+l,u=!0),!p&&oP(f,a,t,v)&&(s.end=e+l,p=!0)}const m=l-c;u||(s.start=Math.max(0,h+m)),p||(s.end=Math.max(0,f+m)),s.start>s.end&&(s.end=s.start)}function Yvt(s,e,t){let i=s.root,n=0,o=0,r=0,a=0;const c=[];let l=0;for(;i!==hn;){if(ad(i)){qo(i.left,!1),qo(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!ad(i.left)){if(o=n+i.maxEnd,ot){qo(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),c[l++]=i),qo(i,!0),i.right!==hn&&!ad(i.right)){n+=i.delta,i=i.right;continue}}return qo(s.root,!1),c}function Jvt(s,e,t,i){let n=s.root,o=0,r=0,a=0;const c=i-(t-e);for(;n!==hn;){if(ad(n)){qo(n.left,!1),qo(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),Mk(n),n=n.parent;continue}if(!ad(n.left)){if(r=o+n.maxEnd,rt){n.start+=c,n.end+=c,n.delta+=c,(n.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),qo(n,!0);continue}if(qo(n,!0),n.right!==hn&&!ad(n.right)){o+=n.delta,n=n.right;continue}}qo(s.root,!1)}function Xvt(s,e){let t=s.root;const i=[];let n=0;for(;t!==hn;){if(ad(t)){qo(t.left,!1),qo(t.right,!1),t=t.parent;continue}if(t.left!==hn&&!ad(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),qo(t,!0),t.right!==hn&&!ad(t.right)){t=t.right;continue}}return qo(s.root,!1),i}function Zvt(s){let e=s.root;const t=[];let i=0;for(;e!==hn;){if(ad(e)){qo(e.left,!1),qo(e.right,!1),e=e.parent;continue}if(e.left!==hn&&!ad(e.left)){e=e.left;continue}if(e.right!==hn&&!ad(e.right)){e=e.right;continue}t[i++]=e,qo(e,!0)}return qo(s.root,!1),t}function gBe(s,e,t,i,n){let o=s.root,r=0,a=0,c=0;const l=[];let d=0;for(;o!==hn;){if(ad(o)){qo(o.left,!1),qo(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==hn&&!ad(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&&Hqe(o)&&(h=!1),n&&!Uqe(o)&&(h=!1),h&&(l[d++]=o),qo(o,!0),o.right!==hn&&!ad(o.right)){r+=o.delta,o=o.right;continue}}return qo(s.root,!1),l}function ebt(s,e,t,i,n,o,r){let a=s.root,c=0,l=0,d=0,h=0;const u=[];let f=0;for(;a!==hn;){if(ad(a)){qo(a.left,!1),qo(a.right,!1),a===a.parent.right&&(c-=a.parent.delta),a=a.parent;continue}if(!ad(a.left)){if(l=c+a.maxEnd,lt){qo(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),n&&Hqe(a)&&(p=!1),r&&!Uqe(a)&&(p=!1),p&&(u[f++]=a)}if(qo(a,!0),a.right!==hn&&!ad(a.right)){c+=a.delta,a=a.right;continue}}return qo(s.root,!1),u}function fBe(s,e){if(s.root===hn)return e.parent=hn,e.left=hn,e.right=hn,er(e,rs.Black),s.root=e,s.root;tbt(s,e),bE(e.parent);let t=e;for(;t!==s.root&&yu(t.parent)===rs.Red;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;yu(i)===rs.Red?(er(t.parent,rs.Black),er(i,rs.Black),er(t.parent.parent,rs.Red),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,d5(s,t)),er(t.parent,rs.Black),er(t.parent.parent,rs.Red),h5(s,t.parent.parent))}else{const i=t.parent.parent.left;yu(i)===rs.Red?(er(t.parent,rs.Black),er(i,rs.Black),er(t.parent.parent,rs.Red),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,h5(s,t)),er(t.parent,rs.Black),er(t.parent.parent,rs.Red),d5(s,t.parent.parent))}return er(s.root,rs.Black),e}function tbt(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(nbt(n,o,i.start+t,i.end+t)<0)if(i.left===hn){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===hn){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=hn,e.right=hn,er(e,rs.Red)}function pBe(s,e){let t,i;if(e.left===hn?(t=e.right,i=e,t.delta+=e.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===hn?(t=e.left,i=e):(i=ibt(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,er(t,rs.Black),e.detach(),Gde(),Mk(t),s.root.parent=hn;return}const n=yu(i)===rs.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,er(i,yu(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==hn&&(i.left.parent=i),i.right!==hn&&(i.right.parent=i)),e.detach(),n){bE(t.parent),i!==e&&(bE(i),bE(i.parent)),Gde();return}bE(t),bE(t.parent),i!==e&&(bE(i),bE(i.parent));let o;for(;t!==s.root&&yu(t)===rs.Black;)t===t.parent.left?(o=t.parent.right,yu(o)===rs.Red&&(er(o,rs.Black),er(t.parent,rs.Red),d5(s,t.parent),o=t.parent.right),yu(o.left)===rs.Black&&yu(o.right)===rs.Black?(er(o,rs.Red),t=t.parent):(yu(o.right)===rs.Black&&(er(o.left,rs.Black),er(o,rs.Red),h5(s,o),o=t.parent.right),er(o,yu(t.parent)),er(t.parent,rs.Black),er(o.right,rs.Black),d5(s,t.parent),t=s.root)):(o=t.parent.left,yu(o)===rs.Red&&(er(o,rs.Black),er(t.parent,rs.Red),h5(s,t.parent),o=t.parent.left),yu(o.left)===rs.Black&&yu(o.right)===rs.Black?(er(o,rs.Red),t=t.parent):(yu(o.left)===rs.Black&&(er(o.right,rs.Black),er(o,rs.Red),d5(s,o),o=t.parent.left),er(o,yu(t.parent)),er(t.parent,rs.Black),er(o.left,rs.Black),h5(s,t.parent),t=s.root));er(t,rs.Black),Gde()}function ibt(s){for(;s.left!==hn;)s=s.left;return s}function Gde(){hn.parent=hn,hn.delta=0,hn.start=0,hn.end=0}function d5(s,e){const t=e.right;t.delta+=e.delta,(t.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==hn&&(t.left.parent=e),t.parent=e.parent,e.parent===hn?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,Mk(e),Mk(t)}function h5(s,e){const t=e.left;e.delta-=t.delta,(e.deltafo.MAX_SAFE_DELTA)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==hn&&(t.right.parent=e),t.parent=e.parent,e.parent===hn?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,Mk(e),Mk(t)}function zqe(s){let e=s.end;if(s.left!==hn){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==hn){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function Mk(s){s.maxEnd=zqe(s)}function bE(s){for(;s!==hn;){const e=zqe(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function nbt(s,e,t,i){return s===t?e-i:s-t}var ES;(function(s){s[s.Unknown=0]="Unknown",s[s.Invalid=3]="Invalid",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(ES||(ES={}));function yb(s){let e=0,t=0,i=0,n=ES.Unknown;for(let o=0,r=s.length;o=ep&&(t=t-s%ep),t}function cbt(s,e){return s.reduce((t,i)=>Tr(t,e(i)),eu)}function $qe(s,e){return s===e}function J8(s,e){const t=s,i=e;if(i-t<=0)return eu;const o=Math.floor(t/ep),r=Math.floor(i/ep),a=i-r*ep;if(o===r){const c=t-o*ep;return ka(0,a-c)}else return ka(r-o,a)}function PO(s,e){return s=e}function nF(s){return ka(s.lineNumber-1,s.column-1)}function ST(s,e){const t=s,i=Math.floor(t/ep),n=t-i*ep,o=e,r=Math.floor(o/ep),a=o-r*ep;return new F(i+1,n+1,r+1,a+1)}function lbt(s){const e=iv(s);return ka(e.length-1,e[e.length-1].length)}const NG=[],xp=class xp{static create(e,t){if(e<=128&&t.length===0){let i=xp.cache[e];return i||(i=new xp(e,t),xp.cache[e]=i),i}return new xp(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 n=i>>5;if(n===0){const r=1<>5;return n===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 Go;(function(s){s[s.Text=0]="Text",s[s.Bracket=1]="Bracket",s[s.Pair=2]="Pair",s[s.UnexpectedClosingBracket=3]="UnexpectedClosingBracket",s[s.List=4]="List"})(Go||(Go={}));class zTe{get length(){return this._length}constructor(e){this._length=e}}class OO extends zTe{static create(e,t,i){let n=e.length;return t&&(n=Tr(n,t.length)),i&&(n=Tr(n,i.length)),new OO(n,e,t,i,t?t.missingOpeningBracketIds:Vg.getEmpty())}get kind(){return Go.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,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}flattenLists(){return OO.create(this.openingBracket.flattenLists(),this.child&&this.child.flattenLists(),this.closingBracket&&this.closingBracket.flattenLists())}deepClone(){return new OO(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(Tr(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class G_ extends zTe{static create23(e,t,i,n=!1){let o=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Tr(o,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Tr(o,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new dbt(o,e.listHeight+1,e,t,i,r):new X8(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,n=e[0].missingOpeningBracketIds;for(let o=1;o{const n=F.lift(i.range);return new xS(nF(n.getStartPosition()),nF(n.getEndPosition()),lbt(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${em(this.startOffset)}...${em(this.endOffset)}) -> ${em(this.newLength)}`}}class gbt{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>GTe.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:J8(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ka(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ka(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=em(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ka(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ka(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 n=rbt(e,t,this.lineIdx,this.lineCharOffset);return new jE(n,Hu.Text,-1,Vg.getEmpty(),new B0(n))}}class pbt{constructor(e,t){this.text=e,this._offset=eu,this.idx=0;const i=t.getRegExpStr(),n=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 jE(ka(0,p),Hu.Text,-1,Vg.getEmpty(),new B0(ka(0,p))));const u=[];for(let p=0;p<60;p++)u.push(new jE(ka(1,p),Hu.Text,-1,Vg.getEmpty(),new B0(ka(1,p))));if(n)for(n.lastIndex=0;(r=n.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 b=p-l;if(bmbt(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===Hu.ClosingBracket&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function mbt(s){let e=Th(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class qqe{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=KTe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}getToken(e,t){return this.getSingleLanguageBracketTokens(t).getToken(e)}}function _bt(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e=2?Qqe(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())bBe(i,n)<=bBe(n,r)?(i=Kde(i,n),n=r):n=Kde(n,r);return Kde(i,n)}function Qqe(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n=3?s[2]:null,e)}function bBe(s,e){return Math.abs(s.listHeight-e.listHeight)}function Kde(s,e){return s.listHeight===e.listHeight?G_.create23(s,e,null,!1):s.listHeight>e.listHeight?vbt(s,e):bbt(e,s)}function vbt(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==Go.List)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=G_.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?G_.create23(s,n,null,!1):s}function bbt(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==Go.List)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=G_.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?G_.create23(n,s,null,!1):s}class wbt{constructor(e){this.lastOffset=eu,this.nextNodes=[e],this.offsets=[eu],this.idxs=[]}readLongestNodeAt(e,t){if(PO(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=r4(this.nextNodes);if(!i)return;const n=r4(this.offsets);if(PO(e,n))return;if(PO(n,e))if(Tr(n,i.length)<=e)this.nextNodeAfterCurrent();else{const o=qde(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=qde(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=r4(this.offsets),t=r4(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=r4(this.nextNodes),n=qde(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(Tr(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function qde(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function r4(s){return s.length>0?s[s.length-1]:void 0}function ame(s,e,t,i){return new ybt(s,e,t,i).parseDocument()}let ybt=class{get nodesConstructed(){return this._itemsConstructed}get nodesReused(){return this._itemsFromCache}constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new wbt(i):void 0,this.positionMapper=new gbt(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Vg.getEmpty(),0);return e||(e=G_.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===Hu.ClosingBracket&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===Go.List&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?_bt(i):Qqe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!fY(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!PO(n.length,t)?!1:n.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 Hu.ClosingBracket:return new ubt(i.bracketIds,i.length);case Hu.Text:return i.astNode;case Hu.OpeningBracket:{if(t>300)return new B0(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),r=this.tokenizer.peek();return r&&r.kind===Hu.ClosingBracket&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),OO.create(i.astNode,o,r.astNode)):OO.create(i.astNode,o,null)}default:throw new Error("unexpected")}}};var eD;(function(s){s[s.InProgress=1]="InProgress",s[s.Completed=2]="Completed"})(eD||(eD={}));function mY(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new By(wBe(s)),i=wBe(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function o(l){if(l===void 0){const h=t.takeWhile(u=>!0)||[];return n&&h.unshift(n),h}const d=[];for(;n&&!fY(l);){const[h,u]=n.splitAt(l);d.push(h),l=J8(h.lengthAfter,l),n=u??t.dequeue()}return fY(l)||d.push(new yx(!1,l,l)),d}const r=[];function a(l,d,h){if(r.length>0&&$qe(r[r.length-1].endOffset,l)){const u=r[r.length-1];r[r.length-1]=new xS(u.startOffset,d,Tr(u.newLength,h))}else r.push({startOffset:l,endOffset:d,newLength:h})}let c=eu;for(const l of i){const d=o(l.lengthBefore);if(l.modified){const h=cbt(d,f=>f.lengthBefore),u=Tr(c,h);a(c,u,l.lengthAfter),c=u}else for(const h of d){const u=c;c=Tr(c,h.lengthBefore),h.modified&&a(u,c,h.lengthAfter)}}return r}class yx{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=J8(e,this.lengthAfter);return $qe(t,eu)?[this,void 0]:this.modified?[new yx(this.modified,this.lengthBefore,e),new yx(this.modified,eu,t)]:[new yx(this.modified,e,e),new yx(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${em(this.lengthBefore)} -> ${em(this.lengthAfter)}`}}function wBe(s){const e=[];let t=eu;for(const i of s){const n=J8(t,i.startOffset);fY(n)||e.push(new yx(!1,n,n));const o=J8(i.startOffset,i.endOffset);e.push(new yx(!0,o,i.newLength)),t=i.endOffset}return e}class Cbt extends V{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 Gqe,this.brackets=new qqe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===eD.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()),n=new pbt(this.textModel.getValue(),i);this.initialAstWithoutTokens=ame(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===eD.Completed){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new xS(ka(i.fromLineNumber-1,0),ka(i.toLineNumber,0),ka(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=xS.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=mY(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=mY(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 n=t,o=new Kqe(this.textModel,this.brackets);return ame(o,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=ka(e.startLineNumber-1,e.startColumn-1),n=ka(e.endLineNumber-1,e.endColumn-1);return new lT(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;cme(r,eu,r.length,i,n,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=nF(e.getStartPosition()),n=nF(e.getEndPosition());return new lT(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new Sbt(o,t,this.textModel);lme(r,eu,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Yqe(t,eu,t.length,nF(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return jqe(t,eu,t.length,nF(e))}}function jqe(s,e,t,i){if(s.kind===Go.List||s.kind===Go.Pair){const n=[];for(const o of s.children)t=Tr(e,o.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=n.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[o];if(PO(r,i)){const c=jqe(s.children[o],r,a,i);if(c)return c}}return null}else{if(s.kind===Go.UnexpectedClosingBracket)return null;if(s.kind===Go.Bracket){const n=ST(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function Yqe(s,e,t,i){if(s.kind===Go.List||s.kind===Go.Pair){for(const n of s.children){if(t=Tr(e,n.length),PO(i,t)){const o=Yqe(n,e,t,i);if(o)return o}e=t}return null}else{if(s.kind===Go.UnexpectedClosingBracket)return null;if(s.kind===Go.Bracket){const n=ST(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function cme(s,e,t,i,n,o,r,a,c,l,d=!1){if(r>200)return!0;e:for(;;)switch(s.kind){case Go.List:{const h=s.childrenLength;for(let u=0;u200)return!0;let c=!0;if(s.kind===Go.Pair){let l=0;if(a){let u=a.get(s.openingBracket.text);u===void 0&&(u=0),l=u,u++,a.set(s.openingBracket.text,u)}const d=Tr(e,s.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=s.computeMinIndentation(e,o.textModel)),c=o.push(new obt(ST(e,t),ST(e,d),s.closingBracket?ST(Tr(d,s.child?.length||eu),t):void 0,r,l,s,h)),e=d,c&&s.child){const u=s.child;if(t=Tr(e,u.length),FO(e,n)&&X4(t,i)&&(c=lme(u,e,t,i,n,o,r+1,a),!c))return!1}a?.set(s.openingBracket.text,l)}else{let l=e;for(const d of s.children){const h=l;if(l=Tr(l,d.length),FO(h,n)&&FO(i,l)&&(c=lme(d,h,l,i,n,o,r,a),!c))return!1}}return c}class Abt extends V{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new wn),this.onDidChangeEmitter=new I,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.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=Ebt(e.add(new Cbt(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)||lT.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||lT.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||lT.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(F.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?PG(this._findMatchingBracketUp(c,n,Qde(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(F.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(Cc(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,F.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=Qde(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const d=t.getEndOffset(l);if(d<=a)break;if(Yb(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=n+1;l=c)break;if(Yb(t.getStandardTokenType(l))||t.getLanguageId(l)!==r){c=d;break}}return{searchStartOffset:a,searchEndOffset:c}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Yb(n.getStandardTokenType(r))){let{searchStartOffset:c,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const h=Nm.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 GC)return null;d=f}}c=h.endColumn-1}if(d)return d}if(r>0&&n.getStartOffset(r)===e.column-1){const c=r-1,l=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(c)).brackets;if(l&&!Yb(n.getStandardTokenType(c))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,n,l,c),u=Nm.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 GC?null:p}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof GC?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let r=-1,a=0;const c=(l,d,h,u)=>{for(;;){if(i&&++a%100===0&&!i())return GC.INSTANCE;const f=Nm.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 b=d.getLanguageId(f)===n&&!Yb(d.getStandardTokenType(f));if(b)v?p=d.getStartOffset(f):(p=d.getStartOffset(f),m=d.getEndOffset(f));else if(v&&p!==m){const w=c(l,u,p,m);if(w)return w}v=b}if(v&&p!==m){const b=c(l,u,p,m);if(b)return b}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let r=1,a=0;const c=(d,h,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return GC.INSTANCE;const p=Nm.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 b=!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,n=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(n&&o&&f&&h!==u){const v=Nm.findPrevBracketInRange(n.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v);f=!1}i=p,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!n&&!Yb(a.getStandardTokenType(d));if(m)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(o&&n&&f&&h!==u){const v=Nm.findPrevBracketInRange(n.reversedRegex,r,l,h,u);if(v)return this._toFoundBracket(o,v)}f=m}if(o&&n&&f&&h!==u){const p=Nm.findPrevBracketInRange(n.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 n=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);n!==m&&(n=m,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let p=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return p?[p.openingBracketRange,p.closingBracketRange]:null}const n=Qde(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const c=(f,p)=>{if(!r.has(f)){const m=[];for(let v=0,b=p?p.brackets.length:0;v{for(;;){if(n&&++l%100===0&&!n())return GC.INSTANCE;const w=Nm.findNextBracketInRange(f.forwardRegex,p,m,v,b);if(!w)break;const y=m.substring(w.startColumn-1,w.endColumn-1).toLowerCase(),C=f.textIsBracket[y];if(C&&(C.isOpen(y)?a[C.index]++:C.isClose(y)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(w,C,!1,n);v=w.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 b=0,w=0,y=0;if(f===i.lineNumber){b=p.findTokenIndexAtOffset(i.column-1),w=i.column-1,y=i.column-1;const A=p.getLanguageId(b);h!==A&&(h=A,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,c(h,u))}let C=!0;for(;be?.dispose()}}function Qde(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const Jne=class Jne{constructor(){this._searchCanceledBrand=void 0}};Jne.INSTANCE=new Jne;let GC=Jne;function PG(s){return s instanceof GC?null:s}class xbt extends V{constructor(e){super(),this.textModel=e,this.colorProvider=new Jqe,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,n){return n?[]: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 F(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Jqe{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}`}}bp((s,e)=>{const t=[Aqe,Eqe,xqe,Dqe,kqe,Iqe],i=new Jqe;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(u_t)}; }`);const n=t.map(o=>s.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=n[o%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});var Sl;(function(s){s[s.Resource=0]="Resource",s[s.Workspace=1]="Workspace"})(Sl||(Sl={}));class Xqe{constructor(e,t){this.resource=e,this.elements=t}}const zF=class zF{constructor(){this.id=zF._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};zF._ID=0,zF.None=new zF;let _Y=zF;const $F=class $F{constructor(){this.id=$F._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};$F._ID=0,$F.None=new $F;let W0=$F;function FG(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Gl{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,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${FG(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${FG(this.oldText)}")`:`(replace@${this.oldPosition} "${FG(this.oldText)}" with "${FG(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;ku(e,n,i),i+=4;for(let o=0;o0&&(this.changes=Dbt(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(ku(e,t?t.length:0,i),i+=4,t)for(const n of t)ku(e,n.selectionStartLineNumber,i),i+=4,ku(e,n.selectionStartColumn,i),i+=4,ku(e,n.positionLineNumber,i),i+=4,ku(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Du(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(N.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 Zc}append(e,t,i,n,o){this._data instanceof Zc&&this._data.append(e,t,i,n,o)}close(){this._data instanceof Zc&&(this._data=this._data.serialize())}open(){this._data instanceof Zc||(this._data=Zc.deserialize(this._data))}undo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Zc&&(this._data=this._data.serialize());const e=Zc.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(N.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Zc&&(this._data=this._data.serialize());const e=Zc.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Zc&&(this._data=this._data.serialize()),this._data.byteLength+168}}class dme{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=Sl.Workspace,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const o=rP(n.resource);this._editStackElementsMap.set(o,n)}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)N.isUri(t.model)&&e.push(t.model);return e}matchesResource(e){const t=rP(e);return this._editStackElementsMap.has(t)}setModel(e){const t=rP(N.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=rP(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=rP(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,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=rP(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(`${_i(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function hme(s){return s.getEOL()===` +`?yh.LF:yh.CRLF}function KC(s){return s?s instanceof Zqe||s instanceof dme:!1}class qTe{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);KC(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);KC(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(KC(i)&&i.canAppend(this._model))return i;const n=new Zqe(g(4960,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],hme(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=qTe._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),hme(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return vt(i),null}}}class kbt{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Ibt(s,e,t,i,n){n.spacesDiff=0,n.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){n.spacesDiff=h,h>0&&0<=c-1&&c-10?n++:C>1&&o++,Ibt(r,a,v,y,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=l&&d[L]++,r=v,a=y}let u=t;n!==o&&(u=n{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 ume{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!==Si)return QTe(this.right);let e=this;for(;e.parent!==Si&&e.parent.left!==e;)e=e.parent;return e.parent===Si?Si:e.parent}prev(){if(this.left!==Si)return eQe(this.left);let e=this;for(;e.parent!==Si&&e.parent.right!==e;)e=e.parent;return e.parent===Si?Si:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}var $n;(function(s){s[s.Black=0]="Black",s[s.Red=1]="Red"})($n||($n={}));const Si=new ume(null,$n.Black);Si.parent=Si;Si.left=Si;Si.right=Si;Si.color=$n.Black;function QTe(s){for(;s.left!==Si;)s=s.left;return s}function eQe(s){for(;s.right!==Si;)s=s.right;return s}function jTe(s){return s===Si?0:s.size_left+s.piece.length+jTe(s.right)}function YTe(s){return s===Si?0:s.lf_left+s.piece.lineFeedCnt+YTe(s.right)}function jde(){Si.parent=Si}function u5(s,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!==Si&&(t.left.parent=e),t.parent=e.parent,e.parent===Si?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function g5(s,e){const t=e.left;e.left=t.right,t.right!==Si&&(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===Si?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function OG(s,e){let t,i;if(e.left===Si?(i=e,t=i.right):e.right===Si?(i=e,t=i.left):(i=QTe(e.right),t=i.right),i===s.root){s.root=t,t.color=$n.Black,e.detach(),jde(),s.root.parent=Si;return}const n=i.color===$n.Red;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,Z4(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,Z4(s,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Si&&(i.left.parent=i),i.right!==Si&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,Z4(s,i)),e.detach(),t.parent.left===t){const r=jTe(t),a=YTe(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,wC(s,t.parent,c,l)}}if(Z4(s,t.parent),n){jde();return}let o;for(;t!==s.root&&t.color===$n.Black;)t===t.parent.left?(o=t.parent.right,o.color===$n.Red&&(o.color=$n.Black,t.parent.color=$n.Red,u5(s,t.parent),o=t.parent.right),o.left.color===$n.Black&&o.right.color===$n.Black?(o.color=$n.Red,t=t.parent):(o.right.color===$n.Black&&(o.left.color=$n.Black,o.color=$n.Red,g5(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=$n.Black,o.right.color=$n.Black,u5(s,t.parent),t=s.root)):(o=t.parent.left,o.color===$n.Red&&(o.color=$n.Black,t.parent.color=$n.Red,g5(s,t.parent),o=t.parent.left),o.left.color===$n.Black&&o.right.color===$n.Black?(o.color=$n.Red,t=t.parent):(o.left.color===$n.Black&&(o.right.color=$n.Black,o.color=$n.Red,u5(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=$n.Black,o.left.color=$n.Black,g5(s,t.parent),t=s.root));t.color=$n.Black,jde()}function CBe(s,e){for(Z4(s,e);e!==s.root&&e.parent.color===$n.Red;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===$n.Red?(e.parent.color=$n.Black,t.color=$n.Black,e.parent.parent.color=$n.Red,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,u5(s,e)),e.parent.color=$n.Black,e.parent.parent.color=$n.Red,g5(s,e.parent.parent))}else{const t=e.parent.parent.left;t.color===$n.Red?(e.parent.color=$n.Black,t.color=$n.Black,e.parent.parent.color=$n.Red,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,g5(s,e)),e.parent.color=$n.Black,e.parent.parent.color=$n.Red,u5(s,e.parent.parent))}s.root.color=$n.Black}function wC(s,e,t,i){for(;e!==s.root&&e!==Si;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function Z4(s,e){let t=0,i=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=jTe(e.left)-e.size_left,i=YTe(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==s.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const fC=65535;function tQe(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class Tbt{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function xC(s,e=!0){const t=[0];let i=1;for(let n=0,o=s.length;n126)&&(r=!1)}const a=new Tbt(tQe(s),i,n,o,r);return s.length=0,a}class ug{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class H0{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Rbt{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Si&&e.iterate(e.root,i=>(i!==Si&&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 Mbt{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 n=0;n=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const o of i)o!==null&&n.push(o);this._cache=n}}}class Nbt{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new H0("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Si,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=xC(e[o].buffer));const a=new ug(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]),n=this.rbInsertRight(n,a)}this._searchCache=new Mbt(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=fC,i=t-Math.floor(t/3),n=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 H0(c,xC(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 Rbt(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,n=>{if(n===Si)return!0;const o=this.getNodeContent(n),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,n=this.root;for(;n!==Si;)if(n.left!==Si&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=o+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==Si;)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=n-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===Si){const o=this.getOffsetAt(i+1,1),r=n-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),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);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 n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Si;){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="",n=!1;return this.iterate(this.root,o=>{if(o===Si)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(n&&(c.charCodeAt(u)===B.LineFeed&&(u++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&c.charCodeAt(u+a-1)===B.CarriageReturn?(n=!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;fC+p,t.reset(0)):(w=u.buffer,y=C=>C,t.reset(p));do if(v=t.next(w),v){if(y(v.index)>=m)return d;this.positionInBuffer(e,y(v.index)-f,b);const C=this.getLineFeedCnt(e.piece.bufferIndex,o,b),A=b.line===o.line?b.column-o.column+n:b.column+1,L=A+v[0].length;if(h[d++]=M0(new F(i+C,A,i+C,L),v,c),y(v.index)+v[0].length>=m||d>=l)return d}while(v);return d}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new JP(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,n,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 b=this._buffers[f.piece.bufferIndex].lineStarts,w=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=b[d.line+m],C=u===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,u,C,d,this.positionInBuffer(f,y-w),t,i,n,r,o),r>=n)return o;u+=m}const v=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const b=this.getLineContent(u).substring(v,e.endColumn-1);return r=this._findMatchesInLine(t,a,b,e.endLineNumber,v,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(u).substr(v),u,v,r,o,i,n),r>=n)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,n),o}const p=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,a,u,p,d,h,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,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||rTe(d,i,p,m,f))&&(a[r++]=new M8(new F(n,m+1+o,n,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++]=M0(new F(n,h.index+1+o,n,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!==Si){const{node:n,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,c=a.bufferIndex,l=this.positionInBuffer(n,o);if(n.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 ug(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(n,o)===10){const m={line:h.start.line+1,column:0};h=new ug(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(n,o-1)===13){const m=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,l);else this.deleteNodeTail(n,l);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let f=n;for(let p=0;p=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;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 n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],r=n[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;tfC){const d=[];for(;e.length>fC;){const u=e.charCodeAt(fC-1);let f;u===B.CarriageReturn||u>=55296&&u<=56319?(f=e.substring(0,fC-1),e=e.substring(fC-1)):(f=e.substring(0,fC),e=e.substring(fC));const p=xC(f);d.push(new ug(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 H0(f,p))}const h=xC(e);return d.push(new ug(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 H0(e,h)),d}let t=this._buffers[0].buffer.length;const i=xC(e,!1);let n=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},n=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);n=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!==Si;){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 n+=r.substring(c,c+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Si;)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,n=this.positionInBuffer(e,t),o=n.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,n);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=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-n,d=a-o,h=i.length+d;e.piece=new ug(i.bufferIndex,i.start,r,c,h),wC(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,n=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-n,d=o-c,h=i.length+d;e.piece=new ug(i.bufferIndex,r,i.end,a,h),wC(this,e,d,l)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,c=n.lineFeedCnt,l=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,l),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new ug(n.bufferIndex,n.start,l,d,h),wC(this,e,h-a,d-c);const u=new ug(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.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),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=xC(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Si;)if(i.left!==Si&&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 n+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:n}}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:n};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Si;){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],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}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===Si||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+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===Si||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=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[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 ug(e.piece.bufferIndex,e.piece.start,o,a,r),wC(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 ug(t.piece.bufferIndex,c,t.piece.end,d,l),wC(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;u(t+=this.getNodeContent(i),!0)),t}}class A1 extends V{constructor(e,t,i,n,o,r,a){super(),this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new Nbt(e,i,a)}equals(e){return!(e instanceof A1)||this._BOM!==e._BOM||this.getEOL()!==e.getEOL()?!1:this._pieceTree.equal(e._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new F(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=go.TextDefined){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=go.TextDefined){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const c=r.length-a.length,l=e.endLineNumber-e.startLineNumber;o=c*l}return n-i+o}getCharacterCountInRange(e,t=go.TextDefined){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let r=n;r<=o;r++){const a=this.getLineContent(r),c=r===n?e.startColumn-1:0,l=r===o?e.endColumn-1:a.length;for(let d=c;dv.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(c);let p=null;if(t&&h.length>0){h.sort((m,v)=>v.lineNumber-m.lineNumber),p=[];for(let m=0,v=h.length;m0&&h[m-1].lineNumber===b)continue;const w=h[m].oldContent,y=this.getLineContent(b);y.length===0||y===w||kh(y)!==-1||p.push(b)}}return this._onDidChangeContent.fire(),new Mut(u,f,p)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new F(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const c=[];for(let f=0,p=e.length;f0&&c.push(m.text),r=v.endLineNumber,a=v.endColumn}const l=c.join(""),[d,h,u]=Ab(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,go.TextDefined),text:l,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(k1._sortOpsDescending);const t=[];for(let i=0;i0){const l=o+1;l===1?c=new F(i,n,i,n+r):c=new F(i,n,i+l-1,a+1)}else c=new F(i,n,i,n);return c}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let r=0,a=e.length;r0){const u=c.eolCount+1;u===1?h=new F(l,d,l,d+c.firstLineLength):h=new F(l,d,l+u-1,c.lastLineLength+1)}else h=new F(l,d,l,d);i=h.endLineNumber,n=h.endColumn,t.push(h),o=c}return t}static _sortOpsAscending(e,t){const i=F.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=F.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Kbt{constructor(e,t,i,n,o,r,a,c,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=c,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===Sb.LF?` +`;case go.TextDefined:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,c=[];for(let m=0;mv.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(c);let p=null;if(t&&h.length>0){h.sort((m,v)=>v.lineNumber-m.lineNumber),p=[];for(let m=0,v=h.length;m0&&h[m-1].lineNumber===b)continue;const w=h[m].oldContent,y=this.getLineContent(b);y.length===0||y===w||xh(y)!==-1||p.push(b)}}return this._onDidChangeContent.fire(),new Cut(u,f,p)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new F(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const c=[];for(let f=0,p=e.length;f0&&c.push(m.text),r=v.endLineNumber,a=v.endColumn}const l=c.join(""),[d,h,u]=yb(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,go.TextDefined),text:l,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(A1._sortOpsDescending);const t=[];for(let i=0;i0){const l=o+1;l===1?c=new F(i,n,i,n+r):c=new F(i,n,i+l-1,a+1)}else c=new F(i,n,i,n);return c}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let r=0,a=e.length;r0){const u=c.eolCount+1;u===1?h=new F(l,d,l,d+c.firstLineLength):h=new F(l,d,l+u-1,c.lastLineLength+1)}else h=new F(l,d,l,d);i=h.endLineNumber,n=h.endColumn,t.push(h),o=c}return t}static _sortOpsAscending(e,t){const i=F.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=F.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Pbt{constructor(e,t,i,n,o,r,a,c,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=c,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===wb.LF?` `:`\r `:i>t/2?`\r `:` `}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||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=Vbt(this._tmpLineStarts,e);this.chunks.push(new $0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=E2(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Y6e(e)))}finish(e=!0){return this._finish(),new Kbt(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=DC(e.buffer);e.lineStarts=t,this._previousChar===B.CarriageReturn&&this.cr++}}}class qbt{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 n=this._store.slice(0,e),o=this._store.slice(e+t),r=Qbt(i,this._default);this._store=n.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 n=0;n>>1;if(t===0&&n[n.length-2]===i)return kC;const r=gd.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,c=n[r<<1];if(id&&(n[l++]=p,n[l++]=n[(f<<1)+1],d=p)}if(l===n.length)return e;const u=new Uint32Array(l);return u.set(n.subarray(0,l),0),u.buffer}static append(e,t){if(t===kC)return e;if(e===kC)return t;if(e===null)return e;if(t===null)return null;const i=hS(e),n=hS(t),o=n.length>>>1,r=new Uint32Array(i.length+n.length);r.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let r=gd.findIndexInTokensArray(n,t);r>0&&n[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]=Fd.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Fd.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[n]=Fd.insert(this._tokens[n],e.column-1,i);return}this._tokens[n]=Fd.deleteEnding(this._tokens[n],e.column-1),this._tokens[n]=Fd.insert(this._tokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}_insertLines(e,t){if(t===0)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new wY(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(n.lineNumber),r=u4(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return nr.Other;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=u4(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),c=new gd(a.tokens,r,this._languageIdCodec);if(c.getCount()===0)return nr.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column,r=this.getStartState(n);if(!r)return null;const a=this._textModel.getLineContent(n),c=a.substring(0,o-1)+i+a.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),d=u4(this._languageIdCodec,l,this.tokenizationSupport,c,!0,r);return new gd(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]=Ab(t.text);this.acceptChange(new pi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class Xbt{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 mi(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 mi(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new mi(i.start,e):this._ranges.splice(t,1,new mi(i.start,e),new mi(e+1,i.endExclusive))}}addRange(e){mi.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function u4(s,e,t,i,n,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,n,o.clone())}catch(a){vt(a)}return r||(r=ATe(s.encodeLanguageId(e),o)),gd.convertToEndOffset(r.tokens,i.length),r}class Zbt{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,N2(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 pi(e,t))}}class s3{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 n=null;if(t1&&(o=Kv.getLanguageId(n[1])!==e),!o)return kC}if(!n||n.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=PBe(e),o.buffer}return n[n.length-2]=t,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_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 n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Fd.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Fd.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=Fd.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=Fd.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Fd.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let n=0,o=e.length;n>>0}class lLe{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 n=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[c,l]=a.split(i);if(c.isEmpty()){n=n||{index:o};continue}l.isEmpty()||(this._pieces.splice(o,1,c,l),o++,r++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=N7(this._pieces,n.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 n=lLe._findFirstPieceWithLine(i,e),o=i[n].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,w=~b>>>0;for(;ct)n=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,n,o){for(const r of this._pieces)r.acceptEdit(e,t,i,n,o)}}class yY extends zqe{constructor(e,t,i,n,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=o,this._attachedViews=r,this._semanticTokens=new lLe(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 ewt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),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()}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,n,o]=Ab(t.text);this._semanticTokens.acceptEdit(t.range,i,n,o,t.text.length>0?t.text.charCodeAt(0):B.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 Ni("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),n=this.getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[r,a]=yY._findLanguageBoundaries(n,o),c=Ik(t.column,this.getLanguageConfiguration(n.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]=yY._findLanguageBoundaries(n,o-1),h=Ik(t.column,this.getLanguageConfiguration(n.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 n=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)n=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(n.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new twt(()=>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 yme(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=Ta.get(this.getLanguageId());if(!o)return[null,null];let r;try{r=o.getInitialState()}catch(a){return vt(a),[null,null]}return[o,r]},[i,n]=t();if(i&&n?this._tokenizer=new Ybt(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===nD.Completed)return;const r=nD.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 Zbt(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new s3(this._languageIdCodec),this._debugBackgroundStates=new yme(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,n]=Ab(t.text);this._tokens.acceptEdit(t.range,i,n),this._debugBackgroundTokens?.acceptEdit(t.range,i,n)}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=pi.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 bme,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(n)for(const r of o.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new bme;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 n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return nr.Other;const n=this._textModel.validatePosition(new oe(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const n=this._textModel.validatePosition(e);return this.forceTokenization(n.lineNumber),this._tokenizer.tokenizeLineWithEdit(n,t,i)}get hasTokens(){return this._tokens.hasTokens}}class twt extends V{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new cn(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){is(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 JA=ae("undoRedoService");var i0;function oae(s){const e=new n3;return e.acceptChunk(s),e.finish()}function dLe(s){return new Promise((e,t)=>{const i=new n3;let n=!1;kN(s,{onData:o=>{i.acceptChunk(typeof o=="string"?o:o.toString())},onError:o=>{n||(n=!0,t(o))},onEnd:()=>{n||(n=!0,e(i.finish()))}})})}function u6(s){const e=new n3;let t;for(;typeof(t=s.read())=="string";)e.acceptChunk(t);return e.finish()}function Cme(s,e){let t;return typeof s=="string"?t=oae(s):Lut(s)?t=u6(s):t=s,t.create(e)}let UG=0;const iwt=999,nwt=1e4;class swt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const n=this._source.read();if(n===null)return this._eos=!0,t===0?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=64*1024)return e.join("")}while(!0)}}const g4=()=>{throw new Error("Invalid change accessor")};var Dp;(function(s){s[s.Relaxed=0]="Relaxed",s[s.SurrogatePairs=1]="SurrogatePairs"})(Dp||(Dp={}));var Jv;let C_=(Jv=class extends V{static resolveOptions(e,t){if(t.detectIndentation){const i=MBe(e,t.tabSize,t.insertSpaces);return new wq({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new wq(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 jr(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,n=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 dwt(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 hwt),this._languageSelectionListener=this._register(new wn),this._deltaDecorationCallCnt=0,this._attachedViews=new uwt,UG++,this.id="$model"+UG,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=N.parse("inmemory://model/"+UG):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=Cme(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=i0.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 Pbt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new lvt(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Obt(this)),this._tokenizationTextModelPart=new yY(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new F(1,1,h,this._buffer.getLineLength(h)+1),go.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>i0.LARGE_FILE_SIZE_THRESHOLD||h>i0.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>i0.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>i0._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=J6e(UG),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new FBe,this._commandManager=new oLe(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),this._register(this._languageConfigurationService.onDidChange(f=>{this._bracketPairs.handleLanguageConfigurationServiceChange(f),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(f)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new k1([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=V.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 Ni("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 xT(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Pi();const{textBuffer:t,disposable:i}=Cme(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a,c){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=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 FBe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new BO([new Qvt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,o,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===Sh.CRLF?`\r +`&&(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=Lbt(this._tmpLineStarts,e);this.chunks.push(new H0(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=y2(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=V6e(e)))}finish(e=!0){return this._finish(),new Pbt(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=xC(e.buffer);e.lineStarts=t,this._previousChar===B.CarriageReturn&&this.cr++}}}class Fbt{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 n=this._store.slice(0,e),o=this._store.slice(e+t),r=Obt(i,this._default);this._store=n.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 n=0;n>>1;if(t===0&&n[n.length-2]===i)return DC;const r=hd.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,c=n[r<<1];if(id&&(n[l++]=p,n[l++]=n[(f<<1)+1],d=p)}if(l===n.length)return e;const u=new Uint32Array(l);return u.set(n.subarray(0,l),0),u.buffer}static append(e,t){if(t===DC)return e;if(e===DC)return t;if(e===null)return e;if(t===null)return null;const i=dS(e),n=dS(t),o=n.length>>>1,r=new Uint32Array(i.length+n.length);r.set(i,0);let a=i.length;const c=i[i.length-2];for(let l=0;l>>1;let r=hd.findIndexInTokensArray(n,t);r>0&&n[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]=Nd.delete(this._tokens[t],e.startColumn-1,e.endColumn-1);return}if(t>=0)if(this._tokens[t]=Nd.deleteEnding(this._tokens[t],e.startColumn-1),i=this._tokens.length)){if(t===0){this._tokens[n]=Nd.insert(this._tokens[n],e.column-1,i);return}this._tokens[n]=Nd.deleteEnding(this._tokens[n],e.column-1),this._tokens[n]=Nd.insert(this._tokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}_insertLines(e,t){if(t===0)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new vY(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(n.lineNumber),r=a4(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return nr.Other;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=a4(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),c=new hd(a.tokens,r,this._languageIdCodec);if(c.getCount()===0)return nr.Other;const l=c.findTokenIndexAtOffset(e.column-1);return c.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column,r=this.getStartState(n);if(!r)return null;const a=this._textModel.getLineContent(n),c=a.substring(0,o-1)+i+a.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),d=a4(this._languageIdCodec,l,this.tokenizationSupport,c,!0,r);return new hd(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]=yb(t.text);this.acceptChange(new pi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}}class Ubt{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 mi(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 mi(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new mi(i.start,e):this._ranges.splice(t,1,new mi(i.start,e),new mi(e+1,i.endExclusive))}}addRange(e){mi.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function a4(s,e,t,i,n,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,n,o.clone())}catch(a){vt(a)}return r||(r=uTe(s.encodeLanguageId(e),o)),hd.convertToEndOffset(r.tokens,i.length),r}class Vbt{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,T2(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 pi(e,t))}}class t3{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 n=null;if(t1&&(o=zv.getLanguageId(n[1])!==e),!o)return DC}if(!n||n.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=SBe(e),o.buffer}return n[n.length-2]=t,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_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 n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Nd.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Nd.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=Nd.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=Nd.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=Nd.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let n=0,o=e.length;n>>0}class JTe{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 n=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[c,l]=a.split(i);if(c.isEmpty()){n=n||{index:o};continue}l.isEmpty()||(this._pieces.splice(o,1,c,l),o++,r++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=T7(this._pieces,n.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 n=JTe._findFirstPieceWithLine(i,e),o=i[n].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,w=~b>>>0;for(;ct)n=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,n,o){for(const r of this._pieces)r.acceptEdit(e,t,i,n,o)}}class bY extends Pqe{constructor(e,t,i,n,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=o,this._attachedViews=r,this._semanticTokens=new JTe(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 zbt(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),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()}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,n,o]=yb(t.text);this._semanticTokens.acceptEdit(t.range,i,n,o,t.text.length>0?t.text.charCodeAt(0):B.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 Ni("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),n=this.getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[r,a]=bY._findLanguageBoundaries(n,o),c=Ak(t.column,this.getLanguageConfiguration(n.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]=bY._findLanguageBoundaries(n,o-1),h=Ak(t.column,this.getLanguageConfiguration(n.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 n=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)n=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(n.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new $bt(()=>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 pme(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=Ta.get(this.getLanguageId());if(!o)return[null,null];let r;try{r=o.getInitialState()}catch(a){return vt(a),[null,null]}return[o,r]},[i,n]=t();if(i&&n?this._tokenizer=new Wbt(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===eD.Completed)return;const r=eD.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 Vbt(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i?.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new t3(this._languageIdCodec),this._debugBackgroundStates=new pme(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,n]=yb(t.text);this._tokens.acceptEdit(t.range,i,n),this._debugBackgroundTokens?.acceptEdit(t.range,i,n)}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=pi.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 gme,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(n)for(const r of o.changes)this._backgroundTokenizer.value?.requestTokens(r.fromLineNumber,r.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new gme;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 n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return nr.Other;const n=this._textModel.validatePosition(new oe(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const n=this._textModel.validatePosition(e);return this.forceTokenization(n.lineNumber),this._tokenizer.tokenizeLineWithEdit(n,t,i)}get hasTokens(){return this._tokens.hasTokens}}class $bt extends V{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new cn(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){is(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 jA=ae("undoRedoService");var ZI;function tae(s){const e=new e3;return e.acceptChunk(s),e.finish()}function XTe(s){return new Promise((e,t)=>{const i=new e3;let n=!1;AN(s,{onData:o=>{i.acceptChunk(typeof o=="string"?o:o.toString())},onError:o=>{n||(n=!0,t(o))},onEnd:()=>{n||(n=!0,e(i.finish()))}})})}function c6(s){const e=new e3;let t;for(;typeof(t=s.read())=="string";)e.acceptChunk(t);return e.finish()}function mme(s,e){let t;return typeof s=="string"?t=tae(s):wut(s)?t=c6(s):t=s,t.create(e)}let BG=0;const Gbt=999,Kbt=1e4;class qbt{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const n=this._source.read();if(n===null)return this._eos=!0,t===0?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=64*1024)return e.join("")}while(!0)}}const c4=()=>{throw new Error("Invalid change accessor")};var Ap;(function(s){s[s.Relaxed=0]="Relaxed",s[s.SurrogatePairs=1]="SurrogatePairs"})(Ap||(Ap={}));var Qv;let b_=(Qv=class extends V{static resolveOptions(e,t){if(t.detectIndentation){const i=yBe(e,t.tabSize,t.insertSpaces);return new vq({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new vq(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 jr(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,n=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 Zbt(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 ewt),this._languageSelectionListener=this._register(new wn),this._deltaDecorationCallCnt=0,this._attachedViews=new twt,BG++,this.id="$model"+BG,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=N.parse("inmemory://model/"+BG):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:c,disposable:l}=mme(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=l,this._options=ZI.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 Abt(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new X_t(this,this._languageConfigurationService)),this._decorationProvider=this._register(new xbt(this)),this._tokenizationTextModelPart=new bY(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const h=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new F(1,1,h,this._buffer.getLineLength(h)+1),go.TextDefined);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>ZI.LARGE_FILE_SIZE_THRESHOLD||h>ZI.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>ZI.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=u>ZI._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=z6e(BG),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new ABe,this._commandManager=new qTe(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),this._register(this._languageConfigurationService.onDidChange(f=>{this._bracketPairs.handleLanguageConfigurationServiceChange(f),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(f)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new A1([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=V.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 Ni("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 CT(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Pi();const{textBuffer:t,disposable:i}=mme(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a,c){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:c,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=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 ABe,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new NO([new Ovt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,o,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===yh.CRLF?`\r `:` -`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new BO([new Jvt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,o,r),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=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 n=1;n<=i;n++){const o=this._buffer.getLineLength(n);o>=nwt?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,n=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 wq({tabSize:t,indentSize:i,insertSpaces:n,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=MBe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),HTe(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(j6e.source,!1,!0,!1,null,!1,Un.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,Dp.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 Ni("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new swt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=go.TextDefined){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=go.TextDefined){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=go.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 Ni("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ni("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` -`?Sh.LF:Sh.CRLF}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(o);r>=h&&(r=h)}const a=e.endLineNumber,c=e.endColumn;let l=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof c=="number"&&!isNaN(c)?c:1);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(l);d>=h&&(d=h)}return i===o&&n===r&&a===l&&c===d&&e instanceof F&&!(e instanceof dt)?e:new F(o,r,l,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===Dp.SurrogatePairs){const r=this._buffer.getLineCharCode(e,t-2);if(Pc(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new oe(1,1);if(n>r)return new oe(r,this.getLineMaxColumn(r));if(o<=1)return new oe(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new oe(n,a);if(i===Dp.SurrogatePairs){const c=this._buffer.getLineCharCode(n,o-2);if(Pc(c))return new oe(n,o-1)}return new oe(n,o)}validatePosition(e){const t=Dp.SurrogatePairs;return this._assertNotDisposed(),e instanceof oe&&this._isValidPosition(e.lineNumber,e.column,t)?e:this._validatePosition(e.lineNumber,e.column,t)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,Dp.Relaxed)||!this._isValidPosition(o,r,Dp.Relaxed))return!1;if(t===Dp.SurrogatePairs){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,c=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,l=Pc(a),d=Pc(c);return!l&&!d}return!0}validateRange(e){const t=Dp.SurrogatePairs;if(this._assertNotDisposed(),e instanceof F&&!(e instanceof dt)&&this._isValidRange(e,t))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,Dp.Relaxed),n=this._validatePosition(e.endLineNumber,e.endColumn,Dp.Relaxed),o=i.lineNumber,r=i.column,a=n.lineNumber,c=n.column;if(t===Dp.SurrogatePairs){const l=r>1?this._buffer.getLineCharCode(o,r-2):0,d=c>1&&c<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,c-2):0,h=Pc(l),u=Pc(d);return!h&&!u?new F(o,r,a,c):o===a&&r===c?new F(o,r-1,a,c-1):h&&u?new F(o,r-1,a,c+1):h?new F(o,r-1,a,c):new F(o,r,a,c+1)}return new F(o,r,a,c)}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new F(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,r,a=iwt){this._assertNotDisposed();let c=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>F.isIRange(h))&&(c=t.map(h=>this.validateRange(h)))),c===null&&(c=[this.getFullModelRange()]),c=c.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const l=[];l.push(c.reduce((h,u)=>F.areIntersecting(h,u)?h.plusRange(u):(l.push(h),u)));let d;if(!i&&e.indexOf(` -`)<0){const u=new GC(e,i,n,o).parseSearchRequest();if(!u)return[];d=f=>this.findMatchesLineByLine(f,u,r,a)}else d=h=>IG.findMatches(this,new GC(e,i,n,o),h,r,a);return l.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` -`)<0){const l=new GC(e,i,n,o).parseSearchRequest();if(!l)return null;const d=this.getLineCount();let h=new F(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,l,r,1);return IG.findNextMatch(this,new GC(e,i,n,o),a,r),u.length>0||(h=new F(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,l,r,1),u.length>0)?u[0]:null}return IG.findNextMatch(this,new GC(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return IG.findPreviousMatch(this,new GC(e,i,n,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` -`?Sh.LF:Sh.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 Bde?e:new Bde(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,n=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)===` +`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new NO([new Hvt],this._versionId,!1,!1),this._createContentChanged2(new F(1,1,o,r),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=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 n=1;n<=i;n++){const o=this._buffer.getLineLength(n);o>=Kbt?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,n=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 vq({tabSize:t,indentSize:i,insertSpaces:n,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=yBe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),kTe(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(U6e.source,!1,!0,!1,null,!1,Un.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,Ap.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 Ni("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new qbt(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=go.TextDefined){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=go.TextDefined){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=go.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 Ni("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Ni("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?yh.LF:yh.CRLF}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Ni("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(o);r>=h&&(r=h)}const a=e.endLineNumber,c=e.endColumn;let l=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof c=="number"&&!isNaN(c)?c:1);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(l);d>=h&&(d=h)}return i===o&&n===r&&a===l&&c===d&&e instanceof F&&!(e instanceof dt)?e:new F(o,r,l,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===Ap.SurrogatePairs){const r=this._buffer.getLineCharCode(e,t-2);if(Pc(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new oe(1,1);if(n>r)return new oe(r,this.getLineMaxColumn(r));if(o<=1)return new oe(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new oe(n,a);if(i===Ap.SurrogatePairs){const c=this._buffer.getLineCharCode(n,o-2);if(Pc(c))return new oe(n,o-1)}return new oe(n,o)}validatePosition(e){const t=Ap.SurrogatePairs;return this._assertNotDisposed(),e instanceof oe&&this._isValidPosition(e.lineNumber,e.column,t)?e:this._validatePosition(e.lineNumber,e.column,t)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,Ap.Relaxed)||!this._isValidPosition(o,r,Ap.Relaxed))return!1;if(t===Ap.SurrogatePairs){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,c=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,l=Pc(a),d=Pc(c);return!l&&!d}return!0}validateRange(e){const t=Ap.SurrogatePairs;if(this._assertNotDisposed(),e instanceof F&&!(e instanceof dt)&&this._isValidRange(e,t))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,Ap.Relaxed),n=this._validatePosition(e.endLineNumber,e.endColumn,Ap.Relaxed),o=i.lineNumber,r=i.column,a=n.lineNumber,c=n.column;if(t===Ap.SurrogatePairs){const l=r>1?this._buffer.getLineCharCode(o,r-2):0,d=c>1&&c<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,c-2):0,h=Pc(l),u=Pc(d);return!h&&!u?new F(o,r,a,c):o===a&&r===c?new F(o,r-1,a,c-1):h&&u?new F(o,r-1,a,c+1):h?new F(o,r-1,a,c):new F(o,r,a,c+1)}return new F(o,r,a,c)}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new F(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,r,a=Gbt){this._assertNotDisposed();let c=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>F.isIRange(h))&&(c=t.map(h=>this.validateRange(h)))),c===null&&(c=[this.getFullModelRange()]),c=c.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const l=[];l.push(c.reduce((h,u)=>F.areIntersecting(h,u)?h.plusRange(u):(l.push(h),u)));let d;if(!i&&e.indexOf(` +`)<0){const u=new $C(e,i,n,o).parseSearchRequest();if(!u)return[];d=f=>this.findMatchesLineByLine(f,u,r,a)}else d=h=>xG.findMatches(this,new $C(e,i,n,o),h,r,a);return l.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){const l=new $C(e,i,n,o).parseSearchRequest();if(!l)return null;const d=this.getLineCount();let h=new F(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,l,r,1);return xG.findNextMatch(this,new $C(e,i,n,o),a,r),u.length>0||(h=new F(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,l,r,1),u.length>0)?u[0]:null}return xG.findNextMatch(this,new $C(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return xG.findPreviousMatch(this,new $C(e,i,n,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?yh.LF:yh.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 Lde?e:new Lde(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,n=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 F(l,1,l,d);t.push(new Bde(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,n)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),c=this.getPositionAt(r.newEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),c=this.getPositionAt(r.oldEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,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(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let l=0,d=r.length;l=0;R--){const z=f+R,G=y+R;P.takeFromEndWhile(j=>j.lineNumber>G);const Y=P.takeFromEndWhile(j=>j.lineNumber===G);a.push(new wBe(z,this.getLineContent(G),Y))}if(bOe.lineNumberOe.lineNumber===De)}a.push(new Yvt(z+1,f+v,ne,j))}c+=w}this._emitContentChangedEvent(new BO(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 n.reverseEdits===null?void 0:n.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(n=>new wBe(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new Kqe(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,BBe(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let n=null;try{n=t(i)}catch(o){vt(o)}return i.addDecoration=g4,i.changeDecoration=g4,i.changeDecorationOptions=g4,i.removeDecoration=g4,i.deltaDecorations=g4,n}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."),vt(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 n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:OBe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.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(n),n.reset(this.getVersionId(),r,a,o),n.setOptions(OBe[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!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 F(a,1,c,l),h=this._getDecorationsInRange(d,i,n,o);return $ge(h,this._decorationProvider.getDecorationsInRange(d,i,n)),h}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return $ge(a,this._decorationProvider.getDecorationsInRange(r,t,i,n)),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),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return M_.fromDecorations(n).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,n){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,n)}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 n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),r=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!!(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=n!==o,a=rwt(t)!==Iq(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!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 owt(this.getLineContent(e))+1}},i0=Jv,Jv._MODEL_SYNC_LIMIT=50*1024*1024,Jv.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,Jv.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,Jv.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,Jv.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Vd.tabSize,indentSize:Vd.indentSize,insertSpaces:Vd.insertSpaces,detectIndentation:!1,defaultEOL:Sb.LF,trimAutoWhitespace:Vd.trimAutoWhitespace,largeFileOptimizations:Vd.largeFileOptimizations,bracketPairColorizationOptions:Vd.bracketPairColorizationOptions},Jv);C_=i0=D([_(4,JA),_(5,xi),_(6,Vs)],C_);function owt(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function nhe(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function rwt(s){return!!s.after||!!s.before}function Iq(s){return!!s.options.after||!!s.options.before}class FBe{constructor(){this._decorationsTree0=new Jde,this._decorationsTree1=new Jde,this._injectedTextDecorationsTree=new Jde}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,n,o,r){const a=e.getVersionId(),c=this._intervalSearch(t,i,n,o,a,r);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,n,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,n,o,r),c=this._decorationsTree1.intervalSearch(e,t,i,n,o,r),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,r);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,n,o){const r=e.getVersionId(),a=this._search(t,i,n,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,o){if(i)return this._decorationsTree1.search(e,t,n,o);{const r=this._decorationsTree0.search(e,t,n,o),a=this._decorationsTree1.search(e,t,n,o),c=this._injectedTextDecorationsTree.search(e,t,n,o);return r.concat(a).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){Iq(e)?this._injectedTextDecorationsTree.insert(e):nhe(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Iq(e)?this._injectedTextDecorationsTree.delete(e):nhe(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){Iq(e)?this._injectedTextDecorationsTree.resolveNode(e,t):nhe(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function Kb(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class dQe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class awt extends dQe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:kl.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 cwt{constructor(e){this.position=e?.position??K_.Center,this.persistLane=e?.persistLane}}class lwt extends dQe{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"?me.fromHex(e):t.getColor(e.id)}}class Wk{static from(e){return e instanceof Wk?e:new Wk(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 Gt{static register(e){return new Gt(e)}static createDynamic(e){return new Gt(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?Kb(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||ni.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?Kb(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 awt(e.overviewRuler):null,this.minimap=e.minimap?new lwt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new cwt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Kb(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Kb(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Kb(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?aat(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Kb(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Kb(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Kb(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Kb(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Kb(e.afterContentClassName):null,this.after=e.after?Wk.from(e.after):null,this.before=e.before?Wk.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}Gt.EMPTY=Gt.register({description:"empty"});const OBe=[Gt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}),Gt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:ni.NeverGrowsWhenTypingAtEdges}),Gt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:ni.GrowsOnlyWhenTypingBefore}),Gt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:ni.GrowsOnlyWhenTypingAfter})];function BBe(s){return s instanceof Gt?s:Gt.createDynamic(s)}class dwt extends V{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 hwt extends V{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 uwt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new gwt(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 gwt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(n=>new pi(n.startLineNumber,n.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class hLe{static create(e){return new hLe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new fwt(e,t)}createLineBreaksComputer(e,t,i,n,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?ph.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let Sme=[],Ame=[];function pwt(s,e,t,i,n,o,r,a){if(n===-1)return null;const c=t.length;if(c<=1)return null;const l=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=hQe(t,i,n,o,r),f=n-u,p=Sme,m=Ame;let v=0,b=0,w=0,y=n;const C=d.length;let A=0;if(A>=0){let L=Math.abs(h[A]-y);for(;A+1=L)break;L=k,A++}}for(;AL&&(L=b,k=w);let P=0,R=0,z=0,G=0;if(k<=y){let j=k,ne=L===0?B.Null:t.charCodeAt(L-1),ge=L===0?ph.NONE:s.get(ne),De=!0;for(let Oe=L;Oeb&&Eme(ne,ge,Ne,lt,l)&&(P=yt,R=j),j+=xt,j>y){yt>b?(z=yt,G=j-xt):(z=Oe+1,G=j),j-R>f&&(P=0),De=!1;break}ne=Ne,ge=lt}if(De){v>0&&(p[v]=d[d.length-1],m[v]=h[d.length-1],v++);break}}if(P===0){let j=k,ne=t.charCodeAt(L),ge=s.get(ne),De=!1;for(let Oe=L-1;Oe>=b;Oe--){const yt=Oe+1,Ne=t.charCodeAt(Oe);if(Ne===B.Tab){De=!0;break}let lt,xt;if(fM(Ne)?(Oe--,lt=ph.NONE,xt=2):(lt=s.get(Ne),xt=Tk(Ne)?o:1),j<=y){if(z===0&&(z=yt,G=j),j<=y-f)break;if(Eme(Ne,lt,ne,ge,l)){P=yt,R=j;break}}j-=xt,ne=Ne,ge=lt}if(P!==0){const Oe=f-(G-R);if(Oe<=i){const yt=t.charCodeAt(z);let Ne;Pc(yt)?Ne=2:Ne=_5(yt,G,i,o),Oe-Ne<0&&(P=0)}}if(De){A--;continue}}if(P===0&&(P=z,R=G),P<=b){const j=t.charCodeAt(b);Pc(j)?(P=b+2,R=w+2):(P=b+1,R=w+_5(j,w,i,o))}for(b=P,p[v]=P,w=R,m[v]=R,v++,y=R+f;A<0||A=Y)break;Y=j,A++}}return v===0?null:(p.length=v,m.length=v,Sme=e.breakOffsets,Ame=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function mwt(s,e,t,i,n,o,r,a){const c=M_.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(R=>R.options),d=t.map(R=>R.column-1)):(l=null,d=null),n===-1)return l?new u5(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new u5(d,l,[c.length],[],0):null;const u=a==="keepAll",f=hQe(c,i,n,o,r),p=n-f,m=[],v=[];let b=0,w=0,y=0,C=n,A=c.charCodeAt(0),L=s.get(A),k=_5(A,0,i,o),P=1;Pc(A)&&(k+=1,A=c.charCodeAt(1),L=s.get(A),P++);for(let R=P;RC&&((w===0||k-y>p)&&(w=z,y=k-j),m[b]=w,v[b]=y,b++,C=y+p,w=0),A=G,L=Y}return b===0&&(!t||t.length===0)?null:(m[b]=h,v[b]=k,new u5(d,l,m,v,f))}function _5(s,e,t,i){return s===B.Tab?t-e%t:Tk(s)||s<32?i:1}function WBe(s,e){return e-s%e}function Eme(s,e,t,i,n){return t!==B.Space&&(e===ph.BREAK_AFTER&&i!==ph.BREAK_AFTER||e!==ph.BREAK_BEFORE&&i===ph.BREAK_BEFORE||!n&&e===ph.BREAK_IDEOGRAPHIC&&i!==ph.BREAK_AFTER||!n&&i===ph.BREAK_IDEOGRAPHIC&&e!==ph.BREAK_BEFORE)}function hQe(s,e,t,i,n){let o=0;if(n!==Nu.None){const r=kh(s);if(r!==-1){for(let c=0;ct&&(o=0)}}return o}class CY{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new El(new F(1,1,1,1),Vh.Simple,0,new oe(1,1),0),new El(new F(1,1,1,1),Vh.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,ni.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,ni.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new Rn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?dt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):dt.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,n){return t.equals(i)?n:e.normalizePosition(t,Io.None)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,Io.None),a=this._validatePositionWithCache(e,n,i,r),c=this._validatePositionWithCache(e,o,n,a);return i.equals(r)&&n.equals(a)&&o.equals(c)?t:new El(F.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=CY._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new El(n,t.selectionStartKind,o,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new El(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new El(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=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 F(n.lineNumber,n.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new El(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class HBe{constructor(e){this.context=e,this.cursors=[new CY(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 srt(this.cursors,Cc(e=>e.viewState.position,oe.compare)).viewState.position}getBottomMostViewPosition(){return nrt(this.cursors,Cc(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(Rn.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 n=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,n=e.length;ii.selection,F.compareRangesUsingStarts));for(let i=0;ih&&m.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class UBe{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class _wt extends V{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 vwt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var pa;(function(s){s[s.ContentSizeChanged=0]="ContentSizeChanged",s[s.FocusChanged=1]="FocusChanged",s[s.ScrollChanged=2]="ScrollChanged",s[s.ViewZonesChanged=3]="ViewZonesChanged",s[s.HiddenAreasChanged=4]="HiddenAreasChanged",s[s.ReadOnlyEditAttempt=5]="ReadOnlyEditAttempt",s[s.CursorStateChanged=6]="CursorStateChanged",s[s.ModelDecorationsChanged=7]="ModelDecorationsChanged",s[s.ModelLanguageChanged=8]="ModelLanguageChanged",s[s.ModelLanguageConfigurationChanged=9]="ModelLanguageConfigurationChanged",s[s.ModelContentChanged=10]="ModelContentChanged",s[s.ModelOptionsChanged=11]="ModelOptionsChanged",s[s.ModelTokensChanged=12]="ModelTokensChanged"})(pa||(pa={}));class uLe{constructor(e,t,i,n){this.kind=pa.ContentSizeChanged,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,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 uLe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class gLe{constructor(e,t){this.kind=pa.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new gLe(this.oldHasFocus,e.hasFocus)}}class fLe{constructor(e,t,i,n,o,r,a,c){this.kind=pa.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,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 fLe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class bwt{constructor(){this.kind=pa.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class wwt{constructor(){this.kind=pa.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class SY{constructor(e,t,i,n,o,r,a){this.kind=pa.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,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,n=t.length;if(i!==n)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(n=n.slice(0,r),o=!0);const a=v5.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,r){const a=this._cursors.getViewPositions();let c=null,l=null;a.length>1?l=this._cursors.getViewSelections():c=F.fromPositions(a[0],a[0]),e.emitViewEvent(new r5(t,i,c,l,n,o,r))}revealPrimary(e,t,i,n,o,r){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new r5(t,i,null,c,n,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const o=Rn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Oi.Undo:i.isRedoing?Oi.Redo:Oi.RecoverFromMarkers,o)&&this.revealAll(e,"modelChange",!1,_s.Simple,!0,mt.Smooth)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Oi.RecoverFromMarkers,Rn.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,n){this.setStates(e,t,n,Rn.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let a=0,c=e.length;a0&&this._pushAutoClosedAction(i,n),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,n,o){const r=v5.from(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new Vpt(c,a,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((l,d)=>!l.modelState.equals(n.cursorState[d].modelState))){const l=n?n.cursorState.map(h=>h.modelState.selection):null,d=n?n.modelVersionId:0;e.emitOutgoingEvent(new SY(l,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=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,n){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,n=Oi.NotSet){if(this.context.cursorConfig.readOnly)return;const o=v5.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){vt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,_s.Simple,!0,mt.Smooth)}getAutoClosedCharacters(){return VBe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new b5(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(JE.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 n=t.length;let o=0;for(;o{const l=c.getPosition();return new dt(l.lineNumber,l.column+o,l.lineNumber,l.column+o)});this.setSelections(e,r,a,Oi.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(JE.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(JE.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,Oi.Paste)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(yM.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new tg(sr.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new tg(sr.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class v5{static from(e,t){return new v5(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 Iwt{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let r=0,a=n.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]===c_.LTR?new dt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new dt(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{F.isEmpty(h)&&u===""||n.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=dt.liftSelection(h);let p;if(f.isEmpty())if(typeof u=="boolean")u?p=ni.GrowsOnlyWhenTypingBefore:p=ni.GrowsOnlyWhenTypingAfter;else{const b=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===b?p=ni.GrowsOnlyWhenTypingBefore:p=ni.GrowsOnlyWhenTypingAfter}else p=ni.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 vt(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-F.compareRangesUsingEnds(i.range,n.range));const t={};for(let i=1;io.identifier.major?r=n.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Twt{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class b5{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new Twt(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=b5._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=b5._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let o=0,r=this._original.length;oB8,tokenizeEncoded:(s,e,t)=>ATe(_T.Null,t)};async function Lwt(s,e,t){if(!t)return $Be(e,s.languageIdCodec,zBe);const i=await Ta.getOrCreate(t);return $Be(e,s.languageIdCodec,i||zBe)}function Rwt(s,e,t,i,n,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 B.LessThan:p+="<",d=!1;break;case B.GreaterThan:p+=">",d=!1;break;case B.Ampersand:p+="&",d=!1;break;case B.Null:p+="�",d=!1;break;case B.UTF8_BOM:case B.LINE_SEPARATOR:case B.PARAGRAPH_SEPARATOR:case B.NEXT_LINE:p+="�",d=!1;break;case B.CarriageReturn:p+="​",d=!1;break;case B.Space:r&&d?(p+=" ",d=!1):(p+=" ",d=!0);break;default:p+=String.fromCharCode(m),d=!1}}if(a+=`${p}`,f>n||c>=n)break}return a+="
    ",a}function $Be(s,e,t){let i='
    ';const n=ov(s);let o=t.getInitialState();for(let r=0,a=n.length;r0&&(i+="
    ");const l=t.tokenizeEncoded(c,!0,o);gd.convertToEndOffset(l.tokens,c.length);const h=new gd(l.tokens,c,e).inflate();let u=0;for(let f=0,p=h.getCount();f${fT(c.substring(u,v))}`,u=v}o=l.endState}return i+="
    ",i}class Mwt{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,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class Nwt{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}var PD;let Pwt=(PD=class{constructor(e,t,i,n){this._instanceId=J6e(++PD.INSTANCE_COUNT),this._pendingChanges=new Mwt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n>>1;t===e[r].afterLineNumber?i{t=!0,n=n|0,o=o|0,r=r|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Nwt(c,n,o,r,a)),c},changeOneWhitespace:(n,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:o,newHeight:r})},removeWhitespace:n=>{t=!0,this._pendingChanges.remove({id:n})}})}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 n=new Set;for(const c of i)n.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(!n.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=PD.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,n=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,n=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else n=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 n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+n+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+n+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 n=1,o=t;for(;n=a+i)n=r+1;else{if(e>=a)return r;o=r}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,n=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(n)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(n)|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 b=-1;for(let A=n;A<=r;A++){if(b===-1){const L=h,k=h+i;(L<=v&&vv)&&(b=A)}for(h+=i,m[A-n]=u,u+=i;d===A;)u+=l,h+=l,a++,a>=c?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=A;break}}b===-1&&(b=r);const w=this.getVerticalOffsetForLineNumber(r)|0;let y=n,C=r;return yt&&C--,{bigNumbersDelta:p,startLineNumber:n,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:b,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:C,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 n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+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 n=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=n;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}},PD.INSTANCE_COUNT=0,PD);const Fwt=125;class iV{constructor(e,t,i,n){e=e|0,t=t|0,i=i|0,n=n|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Owt extends V{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new I),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new iV(0,0,0,0),this._scrollable=this._register(new yN({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,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new uLe(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 Bwt extends V{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(x.layoutInfo),r=n.get(x.padding);this._linesLayout=new Pwt(t,n.get(x.lineHeight),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Owt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new iV(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)?Fwt: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),n=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new iV(n,r.contentWidth,o,this._getContentHeight(n,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 n=this._configuration.options.get(x.scrollbar);return n.horizontal===Co.Hidden||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(x.scrollBeyondLastLine)?o+=Math.max(0,t-n.get(x.lineHeight)-n.get(x.padding).bottom):n.get(x.scrollbar).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new iV(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new NOe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new NOe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(x.wrappingInfo),n=e.get(x.fontInfo),o=e.get(x.layoutInfo);if(i.isViewportWrapping){const r=e.get(x.minimap);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(x.scrollBeyondLastColumn)*n.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 iV(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,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===mt.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 Wwt{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,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 n=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(n.startLineNumber,1),Io.Left,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),Io.Right);r=new F(a.lineNumber,a.column,c.lineNumber,c.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,Io.Right);i=new VKe(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 n=new F(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,Rj(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=n.length;dt===nr.Comment)}function _Le(s,e){return uQe(s,e.range,t=>t===nr.String)}function uQe(s,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=s.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}function she(s,e){return s===null?e?AY.INSTANCE:EY.INSTANCE:new Hwt(s,e)}class Hwt{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 n=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 M_(0,0,l+1,this._projectionData.injectionOptions[d],0));r=M_.applyInjectedText(e.getLineContent(t),a).substring(n,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=GBe(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 n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,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,w=c.breakOffsets[m];for(;pw)break;if(b0?c.wrappedTextIndentLength:0,P=k+Math.max(C-b,0),R=k+Math.min(A-b,w-b);P!==R&&v.push(new xgt(P,R,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(A<=w)f+=y,p++;else break}}}let u;l?u=e.tokenization.getLineTokens(t).withInserted(l.map((f,p)=>({offset:f,text:d[p].content,tokenMetadata:gd.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,a=n.breakOffsets[i],c=e.sliceAndInflate(r,a,o);let l=c.getLineContent();i>0&&(l=GBe(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1=ohe.length)for(let e=1;e<=s;e++)ohe[e]=Uwt(e);return ohe[s]}function Uwt(s){return new Array(s+1).join(" ")}class Vwt{constructor(e,t,i,n,o,r,a,c,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,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 $wt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new Uy(M_.fromDecorations(n));for(let m=0;mb.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(F.compareRangesUsingStarts);let h=1,u=0,f=-1,p=f+1=h&&v<=u,w=she(c[m],!b);l[m]=w.getViewLineCount(),this.modelLineProjections[m]=w}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new Eut(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=zwt(t),n=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(F.compareRangesUsingStarts);if(i.length===n.length){let u=!1;for(let f=0;f({range:u,options:Gt.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,n,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,c=this.wrappingColumn===i,l=this.wrappingIndent===n,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=n,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=n.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 n=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(n.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,n=t.remainder;return new KBe(i+1,n)}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),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let c=i.modelLineNumber;c<=n.modelLineNumber;c++){const l=this.modelLineProjections[c-1];if(l.isVisible()){const d=c===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=c===n.modelLineNumber?n.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 x1(f.visibleColumn,p,f.className,new l5(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)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],c=i.lineNumber-1,l=n.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),b=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(p+1)),w=b-v+1;let y=G0.BlockNone;w>1&&m.getViewLineMinColumn(this.model,p+1,b)===1&&(y=v===0?G0.BlockSubsequent:G0.BlockAll),r.push(w),a.push(y),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,n.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 n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,r=n.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()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new F(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new oe(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new F(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=Io.None,n=!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(n?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=Io.Left){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return F.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,Io.Right),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,Io.Left);return new F(i.lineNumber,i.column,n.lineNumber,n.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 n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,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 F(r.lineNumber,1,a.lineNumber,a.column),t,i,n,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 b=this.model.getLineMaxColumn(m);c=c.concat(this.model.getDecorationsInRange(new F(h.lineNumber,h.column,m,b),t,i,n)),h=null}h!==null&&(c=c.concat(this.model.getDecorationsInRange(new F(h.lineNumber,h.column,a.lineNumber,a.column),t,i,n)),h=null),c.sort((m,v)=>{const b=F.compareRangesUsingStarts(m.range,v.range);return b===0?m.idv.id?1:0:b});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 zwt(s){if(s.length===0)return[];const e=s.slice();e.sort(F.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,n=e[0].endLineNumber;for(let o=1,r=e.length;on+1?(t.push(new F(i,1,n,1)),i=a.startLineNumber,n=a.endLineNumber):a.endLineNumber>n&&(n=a.endLineNumber)}return t.push(new F(i,1,n,1)),t}class KBe{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class qBe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class $wt{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,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}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 G0;(function(s){s[s.BlockNone=0]="BlockNone",s[s.BlockSubsequent=1]="BlockSubsequent",s[s.BlockAll=2]="BlockAll"})(G0||(G0={}));class Gwt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Kwt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Kpe(t,i)}onModelLinesInserted(e,t,i,n){return new qpe(t,i)}onModelLineChanged(e,t,i){return[!1,new uqe(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,n=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 FI=K_.Right;class qwt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*FI/8))}reset(e){const t=Math.ceil((e+1)*FI/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=vLe.create(this.model),this.glyphLanes=new qwt(0),this.model.isTooLargeForTokenization())this._lines=new Gwt(this.model);else{const h=this._configuration.options,u=h.get(x.fontInfo),f=h.get(x.wrappingStrategy),p=h.get(x.wrappingInfo),m=h.get(x.wrappingIndent),v=h.get(x.wordBreak);this._lines=new Vwt(this._editorId,this.model,n,o,u,this.model.getOptions().tabSize,f,p.wrappingColumn,m,v)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new kwt(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Bwt(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(h=>{h.scrollTopChanged&&this._handleVisibleLinesChanged(),h.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Gpt(h)),this._eventDispatcher.emitOutgoingEvent(new fLe(h.oldScrollWidth,h.oldScrollLeft,h.oldScrollHeight,h.oldScrollTop,h.scrollWidth,h.scrollLeft,h.scrollHeight,h.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(h=>{this._eventDispatcher.emitOutgoingEvent(h)})),this._decorations=new Wwt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(h=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,h)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(gY.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Qpt)})),this._register(this._themeService.onDidColorThemeChange(h=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Kpt(h))})),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 F(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 zpt(e)),this._eventDispatcher.emitOutgoingEvent(new gLe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Wpt)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Hpt)}_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 jBe(t,this._viewportStart.startLineDelta)}return new jBe(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(x.fontInfo),r=n.get(x.wrappingStrategy),a=n.get(x.wrappingInfo),c=n.get(x.wrappingIndent),l=n.get(x.wordBreak);this._lines.setWrappingSettings(o,r,a.wrappingColumn,c,l)&&(e.emitViewEvent(new LG),e.emitViewEvent(new RG),e.emitViewEvent(new NI(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 NI(null))),t.hasChanged(x.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new NI(null))),e.emitViewEvent(new Upt(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),rP.shouldRecreate(t)&&(this.cursorConfig=new rP(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 n=!1,o=!1;const r=e instanceof xT?e.rawContentChangedEvent.changes:e.changes,a=e instanceof xT?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of r)switch(h.changeType){case Hg.LinesInserted:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),c.addRequest(f,p,null)}break}case Hg.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 Uy(l);for(const h of r)switch(h.changeType){case Hg.Flush:{this._lines.onModelFlushed(),i.emitViewEvent(new LG),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break}case Hg.LinesDeleted:{const u=this._lines.onModelLinesDeleted(a,h.fromLineNumber,h.toLineNumber);u!==null&&(i.emitViewEvent(u),this.viewLayout.onLinesDeleted(u.fromLineNumber,u.toLineNumber)),n=!0;break}case Hg.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)),n=!0;break}case Hg.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}case Hg.EOLChanged:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!n&&o&&(i.emitViewEvent(new RG),i.emitViewEvent(new NI(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 n=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},mt.Immediate)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof xT&&i.emitOutgoingEvent(new Ewt(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,n=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new $pt),this.cursorConfig=new rP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Awt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new rP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Swt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new LG),t.emitViewEvent(new RG),t.emitViewEvent(new NI(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new rP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new xwt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new NI(e)),this._eventDispatcher.emitOutgoingEvent(new Cwt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const n=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new LG),r.emitViewEvent(new RG),r.emitViewEvent(new NI(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const a=n.viewportStartModelPosition?.lineNumber;a&&i.some(l=>l.startLineNumber<=a&&a<=l.endLineNumber)||n.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new wwt)}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)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new F(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 n=[];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),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_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,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}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=kh(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=T_(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 n=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new fp(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,n,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new Egt(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Rj(this._configuration.options)),i=new jwt;for(const n of t){const o=n.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(n.range.startLineNumber,n.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.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),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const n=i?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(F.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])+n);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?go.CRLF:go.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?go.CRLF:go.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Ca||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new F(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===cd.fontFamily;let l;return c?l=cd.fontFamily:(l=o.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${cd.fontFamily}`),{mode:i,html:`
    `+this._getHTMLToCopy(n,r)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=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?n-1:0,f=l===o?r-1:h.length;h===""?c+="
    ":c+=Rwt(h,d.inflate(),t,u,f,a,Qn)}return c}_getColorMap(){const e=Ta.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,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=Oi.NotSet){this._withViewEventsCollector(n=>this._cursor.setSelections(n,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 ywt);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,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,n,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}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(n=>this._cursor.revealAll(n,e,i,_s.Simple,t,mt.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,_s.Simple,t,mt.Smooth))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new F(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new r5(e,!1,i,null,_s.Simple,!0,mt.Smooth)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new F(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new r5(e,!1,i,null,_s.Simple,!0,mt.Smooth)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new r5(e,!1,i,null,n,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new jpt),this._eventDispatcher.emitOutgoingEvent(new bwt))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{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 vLe{static create(e){const t=e._setTrackedRange(null,new F(1,1,1,1),ni.NeverGrowsWhenTypingAtEdges);return new vLe(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,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,ni.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new oe(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new F(i.lineNumber,i.column,i.lineNumber,i.column),ni.NeverGrowsWhenTypingAtEdges),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class jwt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,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){n>l&&(a[a.length-1]=n);return}a.push(o,i,n)}else{const a=new W8(e,t,[o,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class Ywt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&QBe(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)=>Jwt(t,i),[]);return QBe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Jwt(s,e){const t=[];let i=0,n=0;for(;i{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(x.layoutInfo)){const w=b.get(x.layoutInfo);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=r,this._themeService=c,this._register(new iyt(this,this._contextKeyService)),this._register(new nyt(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new Uc([Le,this._contextKeyService]))),this._modelData=null,this._focusTracker=new syt(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=ap.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of ap.getEditorActions()){if(this._actions.has(v.id)){vt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new qqe(v.id,v.label,v.alias,v.metadata,v.precondition??void 0,w=>this._instantiationService.invokeFunction(y=>Promise.resolve(v.runEditorCommand(y,this,w))),this._contextKeyService);this._actions.set(b.id,b)}const m=()=>!this._configuration.options.get(x.readOnly)&&this._configuration.options.get(x.dropIntoEditor).enabled;this._register(new $j(this._domElement,{onDragOver:v=>{if(!m())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b?.position&&this.showDropIndicatorAt(b.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b?.position&&this._onDropIntoEditor.fire({position:b.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n,o){return new Ppe(e,t,i,n,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return CU.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?hs.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=go.TextDefined;return e&&e.lineEnding&&e.lineEnding===` +`)){h=!1;break}}if(h){const u=new F(l,1,l,d);t.push(new Lde(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,n)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),c=this.getPositionAt(r.newEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),c=this.getPositionAt(r.oldEnd);return{range:new F(a.lineNumber,a.column,c.lineNumber,c.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,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(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let l=0,d=r.length;l=0;R--){const z=f+R,G=y+R;P.takeFromEndWhile(K=>K.lineNumber>G);const j=P.takeFromEndWhile(K=>K.lineNumber===G);a.push(new cBe(z,this.getLineContent(G),j))}if(bRe.lineNumberRe.lineNumber===xe)}a.push(new Wvt(z+1,f+v,ie,K))}c+=w}this._emitContentChangedEvent(new NO(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 n.reverseEdits===null?void 0:n.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(n=>new cBe(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new Bqe(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,xBe(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let n=null;try{n=t(i)}catch(o){vt(o)}return i.addDecoration=c4,i.changeDecoration=c4,i.changeDecorationOptions=c4,i.removeDecoration=c4,i.deltaDecorations=c4,n}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."),vt(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 n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:EBe[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.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(n),n.reset(this.getVersionId(),r,a,o),n.setOptions(EBe[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!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 F(a,1,c,l),h=this._getDecorationsInRange(d,i,n,o);return Bge(h,this._decorationProvider.getDecorationsInRange(d,i,n)),h}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return Bge(a,this._decorationProvider.getDecorationsInRange(r,t,i,n)),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),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return T_.fromDecorations(n).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,n){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,n)}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 n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),r=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!!(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=n!==o,a=jbt(t)!==Dq(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!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 Qbt(this.getLineContent(e))+1}},ZI=Qv,Qv._MODEL_SYNC_LIMIT=50*1024*1024,Qv.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,Qv.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,Qv.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,Qv.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Hd.tabSize,indentSize:Hd.indentSize,insertSpaces:Hd.insertSpaces,detectIndentation:!1,defaultEOL:wb.LF,trimAutoWhitespace:Hd.trimAutoWhitespace,largeFileOptimizations:Hd.largeFileOptimizations,bracketPairColorizationOptions:Hd.bracketPairColorizationOptions},Qv);b_=ZI=D([_(4,jA),_(5,xi),_(6,Vs)],b_);function Qbt(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function Yde(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function jbt(s){return!!s.after||!!s.before}function Dq(s){return!!s.options.after||!!s.options.before}class ABe{constructor(){this._decorationsTree0=new $de,this._decorationsTree1=new $de,this._injectedTextDecorationsTree=new $de}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,n,o,r){const a=e.getVersionId(),c=this._intervalSearch(t,i,n,o,a,r);return this._ensureNodesHaveRanges(e,c)}_intervalSearch(e,t,i,n,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,n,o,r),c=this._decorationsTree1.intervalSearch(e,t,i,n,o,r),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,r);return a.concat(c).concat(l)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,n,o){const r=e.getVersionId(),a=this._search(t,i,n,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,o){if(i)return this._decorationsTree1.search(e,t,n,o);{const r=this._decorationsTree0.search(e,t,n,o),a=this._decorationsTree1.search(e,t,n,o),c=this._injectedTextDecorationsTree.search(e,t,n,o);return r.concat(a).concat(c)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){Dq(e)?this._injectedTextDecorationsTree.insert(e):Yde(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Dq(e)?this._injectedTextDecorationsTree.delete(e):Yde(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){Dq(e)?this._injectedTextDecorationsTree.resolveNode(e,t):Yde(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function zb(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class iQe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Ybt extends iQe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Dl.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 Jbt{constructor(e){this.position=e?.position??z_.Center,this.persistLane=e?.persistLane}}class Xbt extends iQe{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"?me.fromHex(e):t.getColor(e.id)}}class Nk{static from(e){return e instanceof Nk?e:new Nk(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 Gt{static register(e){return new Gt(e)}static createDynamic(e){return new Gt(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?zb(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||ni.AlwaysGrowsWhenTypingAtEdges,this.zIndex=e.zIndex||0,this.className=e.className?zb(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 Ybt(e.overviewRuler):null,this.minimap=e.minimap?new Xbt(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Jbt(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?zb(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?zb(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?zb(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?Yrt(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?zb(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?zb(e.marginClassName):null,this.inlineClassName=e.inlineClassName?zb(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?zb(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?zb(e.afterContentClassName):null,this.after=e.after?Nk.from(e.after):null,this.before=e.before?Nk.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}Gt.EMPTY=Gt.register({description:"empty"});const EBe=[Gt.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}),Gt.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:ni.NeverGrowsWhenTypingAtEdges}),Gt.register({description:"tracked-range-grows-only-when-typing-before",stickiness:ni.GrowsOnlyWhenTypingBefore}),Gt.register({description:"tracked-range-grows-only-when-typing-after",stickiness:ni.GrowsOnlyWhenTypingAfter})];function xBe(s){return s instanceof Gt?s:Gt.createDynamic(s)}class Zbt extends V{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 ewt extends V{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 twt{constructor(){this._onDidChangeVisibleRanges=new I,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new iwt(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 iwt{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(n=>new pi(n.startLineNumber,n.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class ZTe{static create(e){return new ZTe(e.get(x.wordWrapBreakBeforeCharacters),e.get(x.wordWrapBreakAfterCharacters))}constructor(e,t){this.classifier=new nwt(e,t)}createLineBreaksComputer(e,t,i,n,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?gh.BREAK_IDEOGRAPHIC:this._map.get(e)||this._defaultValue}}let _me=[],vme=[];function swt(s,e,t,i,n,o,r,a){if(n===-1)return null;const c=t.length;if(c<=1)return null;const l=a==="keepAll",d=e.breakOffsets,h=e.breakOffsetsVisibleColumn,u=nQe(t,i,n,o,r),f=n-u,p=_me,m=vme;let v=0,b=0,w=0,y=n;const C=d.length;let A=0;if(A>=0){let L=Math.abs(h[A]-y);for(;A+1=L)break;L=k,A++}}for(;AL&&(L=b,k=w);let P=0,R=0,z=0,G=0;if(k<=y){let K=k,ie=L===0?B.Null:t.charCodeAt(L-1),ge=L===0?gh.NONE:s.get(ie),xe=!0;for(let Re=L;Reb&&bme(ie,ge,Pe,lt,l)&&(P=yt,R=K),K+=xt,K>y){yt>b?(z=yt,G=K-xt):(z=Re+1,G=K),K-R>f&&(P=0),xe=!1;break}ie=Pe,ge=lt}if(xe){v>0&&(p[v]=d[d.length-1],m[v]=h[d.length-1],v++);break}}if(P===0){let K=k,ie=t.charCodeAt(L),ge=s.get(ie),xe=!1;for(let Re=L-1;Re>=b;Re--){const yt=Re+1,Pe=t.charCodeAt(Re);if(Pe===B.Tab){xe=!0;break}let lt,xt;if(dM(Pe)?(Re--,lt=gh.NONE,xt=2):(lt=s.get(Pe),xt=Ek(Pe)?o:1),K<=y){if(z===0&&(z=yt,G=K),K<=y-f)break;if(bme(Pe,lt,ie,ge,l)){P=yt,R=K;break}}K-=xt,ie=Pe,ge=lt}if(P!==0){const Re=f-(G-R);if(Re<=i){const yt=t.charCodeAt(z);let Pe;Pc(yt)?Pe=2:Pe=f5(yt,G,i,o),Re-Pe<0&&(P=0)}}if(xe){A--;continue}}if(P===0&&(P=z,R=G),P<=b){const K=t.charCodeAt(b);Pc(K)?(P=b+2,R=w+2):(P=b+1,R=w+f5(K,w,i,o))}for(b=P,p[v]=P,w=R,m[v]=R,v++,y=R+f;A<0||A=j)break;j=K,A++}}return v===0?null:(p.length=v,m.length=v,_me=e.breakOffsets,vme=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=u,e)}function owt(s,e,t,i,n,o,r,a){const c=T_.applyInjectedText(e,t);let l,d;if(t&&t.length>0?(l=t.map(R=>R.options),d=t.map(R=>R.column-1)):(l=null,d=null),n===-1)return l?new l5(d,l,[c.length],[],0):null;const h=c.length;if(h<=1)return l?new l5(d,l,[c.length],[],0):null;const u=a==="keepAll",f=nQe(c,i,n,o,r),p=n-f,m=[],v=[];let b=0,w=0,y=0,C=n,A=c.charCodeAt(0),L=s.get(A),k=f5(A,0,i,o),P=1;Pc(A)&&(k+=1,A=c.charCodeAt(1),L=s.get(A),P++);for(let R=P;RC&&((w===0||k-y>p)&&(w=z,y=k-K),m[b]=w,v[b]=y,b++,C=y+p,w=0),A=G,L=j}return b===0&&(!t||t.length===0)?null:(m[b]=h,v[b]=k,new l5(d,l,m,v,f))}function f5(s,e,t,i){return s===B.Tab?t-e%t:Ek(s)||s<32?i:1}function DBe(s,e){return e-s%e}function bme(s,e,t,i,n){return t!==B.Space&&(e===gh.BREAK_AFTER&&i!==gh.BREAK_AFTER||e!==gh.BREAK_BEFORE&&i===gh.BREAK_BEFORE||!n&&e===gh.BREAK_IDEOGRAPHIC&&i!==gh.BREAK_AFTER||!n&&i===gh.BREAK_IDEOGRAPHIC&&e!==gh.BREAK_BEFORE)}function nQe(s,e,t,i,n){let o=0;if(n!==Ru.None){const r=xh(s);if(r!==-1){for(let c=0;ct&&(o=0)}}return o}class wY{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Al(new F(1,1,1,1),Uh.Simple,0,new oe(1,1),0),new Al(new F(1,1,1,1),Uh.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,ni.AlwaysGrowsWhenTypingAtEdges))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,ni.AlwaysGrowsWhenTypingAtEdges)}asCursorState(){return new Rn(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?dt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):dt.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,n){return t.equals(i)?n:e.normalizePosition(t,Io.None)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,Io.None),a=this._validatePositionWithCache(e,n,i,r),c=this._validatePositionWithCache(e,o,n,a);return i.equals(r)&&n.equals(a)&&o.equals(c)?t:new Al(F.fromPositions(a,c),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=wY._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new Al(n,t.selectionStartKind,o,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Al(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Al(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=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 F(n.lineNumber,n.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Al(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class kBe{constructor(e){this.context=e,this.cursors=[new wY(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 qot(this.cursors,Cc(e=>e.viewState.position,oe.compare)).viewState.position}getBottomMostViewPosition(){return Kot(this.cursors,Cc(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(Rn.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 n=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,n=e.length;ii.selection,F.compareRangesUsingStarts));for(let i=0;ih&&m.index--;e.splice(h,1),t.splice(d,1),this._removeSecondaryCursor(h-1),i--}}}}class IBe{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class rwt extends V{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 awt{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}var pa;(function(s){s[s.ContentSizeChanged=0]="ContentSizeChanged",s[s.FocusChanged=1]="FocusChanged",s[s.ScrollChanged=2]="ScrollChanged",s[s.ViewZonesChanged=3]="ViewZonesChanged",s[s.HiddenAreasChanged=4]="HiddenAreasChanged",s[s.ReadOnlyEditAttempt=5]="ReadOnlyEditAttempt",s[s.CursorStateChanged=6]="CursorStateChanged",s[s.ModelDecorationsChanged=7]="ModelDecorationsChanged",s[s.ModelLanguageChanged=8]="ModelLanguageChanged",s[s.ModelLanguageConfigurationChanged=9]="ModelLanguageConfigurationChanged",s[s.ModelContentChanged=10]="ModelContentChanged",s[s.ModelOptionsChanged=11]="ModelOptionsChanged",s[s.ModelTokensChanged=12]="ModelTokensChanged"})(pa||(pa={}));class eLe{constructor(e,t,i,n){this.kind=pa.ContentSizeChanged,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,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 eLe(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class tLe{constructor(e,t){this.kind=pa.FocusChanged,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new tLe(this.oldHasFocus,e.hasFocus)}}class iLe{constructor(e,t,i,n,o,r,a,c){this.kind=pa.ScrollChanged,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,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 iLe(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class cwt{constructor(){this.kind=pa.ViewZonesChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class lwt{constructor(){this.kind=pa.HiddenAreasChanged}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class yY{constructor(e,t,i,n,o,r,a){this.kind=pa.CursorStateChanged,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,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,n=t.length;if(i!==n)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(n=n.slice(0,r),o=!0);const a=p5.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,r){const a=this._cursors.getViewPositions();let c=null,l=null;a.length>1?l=this._cursors.getViewSelections():c=F.fromPositions(a[0],a[0]),e.emitViewEvent(new n5(t,i,c,l,n,o,r))}revealPrimary(e,t,i,n,o,r){const c=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new n5(t,i,null,c,n,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const o=Rn.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?Oi.Undo:i.isRedoing?Oi.Redo:Oi.RecoverFromMarkers,o)&&this.revealAll(e,"modelChange",!1,_s.Simple,!0,mt.Smooth)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",Oi.RecoverFromMarkers,Rn.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,n){this.setStates(e,t,n,Rn.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let a=0,c=e.length;a0&&this._pushAutoClosedAction(i,n),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,n,o){const r=p5.from(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),c=this._cursors.getViewSelections();if(e.emitViewEvent(new Lpt(c,a,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((l,d)=>!l.modelState.equals(n.cursorState[d].modelState))){const l=n?n.cursorState.map(h=>h.modelState.selection):null,d=n?n.modelVersionId:0;e.emitOutgoingEvent(new yY(l,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=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,n){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,n=Oi.NotSet){if(this.context.cursorConfig.readOnly)return;const o=p5.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){vt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,_s.Simple,!0,mt.Smooth)}getAutoClosedCharacters(){return TBe.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new m5(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(QE.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 n=t.length;let o=0;for(;o{const l=c.getPosition();return new dt(l.lineNumber,l.column+o,l.lineNumber,l.column+o)});this.setSelections(e,r,a,Oi.NotSet)}return}this._executeEdit(()=>{this._executeEditOperation(QE.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(QE.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,Oi.Paste)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(_M.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Xu(sr.Other,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Xu(sr.Other,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class p5{static from(e,t){return new p5(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 vwt{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let r=0,a=n.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]===o_.LTR?new dt(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new dt(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{F.isEmpty(h)&&u===""||n.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=dt.liftSelection(h);let p;if(f.isEmpty())if(typeof u=="boolean")u?p=ni.GrowsOnlyWhenTypingBefore:p=ni.GrowsOnlyWhenTypingAfter;else{const b=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===b?p=ni.GrowsOnlyWhenTypingBefore:p=ni.GrowsOnlyWhenTypingAfter}else p=ni.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 vt(h),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-F.compareRangesUsingEnds(i.range,n.range));const t={};for(let i=1;io.identifier.major?r=n.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class bwt{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class m5{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new bwt(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=m5._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=m5._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let o=0,r=this._original.length;oP8,tokenizeEncoded:(s,e,t)=>uTe(gT.Null,t)};async function wwt(s,e,t){if(!t)return RBe(e,s.languageIdCodec,LBe);const i=await Ta.getOrCreate(t);return RBe(e,s.languageIdCodec,i||LBe)}function ywt(s,e,t,i,n,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 B.LessThan:p+="<",d=!1;break;case B.GreaterThan:p+=">",d=!1;break;case B.Ampersand:p+="&",d=!1;break;case B.Null:p+="�",d=!1;break;case B.UTF8_BOM:case B.LINE_SEPARATOR:case B.PARAGRAPH_SEPARATOR:case B.NEXT_LINE:p+="�",d=!1;break;case B.CarriageReturn:p+="​",d=!1;break;case B.Space:r&&d?(p+=" ",d=!1):(p+=" ",d=!0);break;default:p+=String.fromCharCode(m),d=!1}}if(a+=`${p}`,f>n||c>=n)break}return a+="
    ",a}function RBe(s,e,t){let i='
    ';const n=iv(s);let o=t.getInitialState();for(let r=0,a=n.length;r0&&(i+="
    ");const l=t.tokenizeEncoded(c,!0,o);hd.convertToEndOffset(l.tokens,c.length);const h=new hd(l.tokens,c,e).inflate();let u=0;for(let f=0,p=h.getCount();f${dT(c.substring(u,v))}`,u=v}o=l.endState}return i+="
    ",i}class Cwt{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,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class Swt{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}var TD;let Awt=(TD=class{constructor(e,t,i,n){this._instanceId=z6e(++TD.INSTANCE_COUNT),this._pendingChanges=new Cwt,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n>>1;t===e[r].afterLineNumber?i{t=!0,n=n|0,o=o|0,r=r|0,a=a|0;const c=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Swt(c,n,o,r,a)),c},changeOneWhitespace:(n,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:o,newHeight:r})},removeWhitespace:n=>{t=!0,this._pendingChanges.remove({id:n})}})}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 n=new Set;for(const c of i)n.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(!n.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=TD.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,n=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,n=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else n=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 n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+n+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+n+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 n=1,o=t;for(;n=a+i)n=r+1;else{if(e>=a)return r;o=r}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,n=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(n)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(n)|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 b=-1;for(let A=n;A<=r;A++){if(b===-1){const L=h,k=h+i;(L<=v&&vv)&&(b=A)}for(h+=i,m[A-n]=u,u+=i;d===A;)u+=l,h+=l,a++,a>=c?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,l=this.getHeightForWhitespaceIndex(a)|0);if(h>=t){r=A;break}}b===-1&&(b=r);const w=this.getVerticalOffsetForLineNumber(r)|0;let y=n,C=r;return yt&&C--,{bigNumbersDelta:p,startLineNumber:n,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:b,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:C,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 n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+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 n=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=n;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}},TD.INSTANCE_COUNT=0,TD);const Ewt=125;class eV{constructor(e,t,i,n){e=e|0,t=t|0,i=i|0,n=n|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class xwt extends V{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new I),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new eV(0,0,0,0),this._scrollable=this._register(new _N({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,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new eLe(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 Dwt extends V{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(x.layoutInfo),r=n.get(x.padding);this._linesLayout=new Awt(t,n.get(x.lineHeight),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new xwt(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new eV(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)?Ewt: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),n=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new eV(n,r.contentWidth,o,this._getContentHeight(n,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 n=this._configuration.options.get(x.scrollbar);return n.horizontal===Co.Hidden||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(x.scrollBeyondLastLine)?o+=Math.max(0,t-n.get(x.lineHeight)-n.get(x.padding).bottom):n.get(x.scrollbar).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new eV(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new COe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new COe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(x.wrappingInfo),n=e.get(x.fontInfo),o=e.get(x.layoutInfo);if(i.isViewportWrapping){const r=e.get(x.minimap);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(x.scrollBeyondLastColumn)*n.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 eV(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,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===mt.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 kwt{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,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 n=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(n.startLineNumber,1),Io.Left,!1,!0),c=this._coordinatesConverter.convertModelPositionToViewPosition(new oe(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),Io.Right);r=new F(a.lineNumber,a.column,c.lineNumber,c.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,Io.Right);i=new NKe(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 n=new F(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,Tj(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=n.length;dt===nr.Comment)}function oLe(s,e){return sQe(s,e.range,t=>t===nr.String)}function sQe(s,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=s.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}function Jde(s,e){return s===null?e?CY.INSTANCE:SY.INSTANCE:new Iwt(s,e)}class Iwt{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 n=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 T_(0,0,l+1,this._projectionData.injectionOptions[d],0));r=T_.applyInjectedText(e.getLineContent(t),a).substring(n,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=MBe(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 n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,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,w=c.breakOffsets[m];for(;pw)break;if(b0?c.wrappedTextIndentLength:0,P=k+Math.max(C-b,0),R=k+Math.min(A-b,w-b);P!==R&&v.push(new pgt(P,R,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(A<=w)f+=y,p++;else break}}}let u;l?u=e.tokenization.getLineTokens(t).withInserted(l.map((f,p)=>({offset:f,text:d[p].content,tokenMetadata:hd.defaultTokenMetadata}))):u=e.tokenization.getLineTokens(t);for(let f=i;f0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,a=n.breakOffsets[i],c=e.sliceAndInflate(r,a,o);let l=c.getLineContent();i>0&&(l=MBe(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,u=i+1=Xde.length)for(let e=1;e<=s;e++)Xde[e]=Twt(e);return Xde[s]}function Twt(s){return new Array(s+1).join(" ")}class Lwt{constructor(e,t,i,n,o,r,a,c,l,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,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 Mwt(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new By(T_.fromDecorations(n));for(let m=0;mb.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(F.compareRangesUsingStarts);let h=1,u=0,f=-1,p=f+1=h&&v<=u,w=Jde(c[m],!b);l[m]=w.getViewLineCount(),this.modelLineProjections[m]=w}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new fut(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(u=>this.model.validateRange(u)),i=Rwt(t),n=this.hiddenAreasDecorationIds.map(u=>this.model.getDecorationRange(u)).sort(F.compareRangesUsingStarts);if(i.length===n.length){let u=!1;for(let f=0;f({range:u,options:Gt.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,n,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,c=this.wrappingColumn===i,l=this.wrappingIndent===n,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=n,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=n.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 n=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(n.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,n=t.remainder;return new NBe(i+1,n)}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),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new oe(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let c=i.modelLineNumber;c<=n.modelLineNumber;c++){const l=this.modelLineProjections[c-1];if(l.isVisible()){const d=c===i.modelLineNumber?i.modelLineWrappedLineIdx:0,h=c===n.modelLineNumber?n.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 C1(f.visibleColumn,p,f.className,new r5(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)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],c=i.lineNumber-1,l=n.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),b=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(p+1)),w=b-v+1;let y=U0.BlockNone;w>1&&m.getViewLineMinColumn(this.model,p+1,b)===1&&(y=v===0?U0.BlockSubsequent:U0.BlockAll),r.push(w),a.push(y),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,n.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 n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,r=n.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()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new F(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new oe(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new F(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=Io.None,n=!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(n?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=Io.Left){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return F.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,Io.Right),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,Io.Left);return new F(i.lineNumber,i.column,n.lineNumber,n.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 n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,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 F(r.lineNumber,1,a.lineNumber,a.column),t,i,n,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 b=this.model.getLineMaxColumn(m);c=c.concat(this.model.getDecorationsInRange(new F(h.lineNumber,h.column,m,b),t,i,n)),h=null}h!==null&&(c=c.concat(this.model.getDecorationsInRange(new F(h.lineNumber,h.column,a.lineNumber,a.column),t,i,n)),h=null),c.sort((m,v)=>{const b=F.compareRangesUsingStarts(m.range,v.range);return b===0?m.idv.id?1:0:b});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 Rwt(s){if(s.length===0)return[];const e=s.slice();e.sort(F.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,n=e[0].endLineNumber;for(let o=1,r=e.length;on+1?(t.push(new F(i,1,n,1)),i=a.startLineNumber,n=a.endLineNumber):a.endLineNumber>n&&(n=a.endLineNumber)}return t.push(new F(i,1,n,1)),t}class NBe{get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class PBe{constructor(e,t){this.modelRange=e,this.viewLines=t}}class Mwt{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,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}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 U0;(function(s){s[s.BlockNone=0]="BlockNone",s[s.BlockSubsequent=1]="BlockSubsequent",s[s.BlockAll=2]="BlockAll"})(U0||(U0={}));class Nwt{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Pwt(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Hpe(t,i)}onModelLinesInserted(e,t,i,n){return new Upe(t,i)}onModelLineChanged(e,t,i){return[!1,new sqe(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,n=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 TI=z_.Right;class Fwt{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*TI/8))}reset(e){const t=Math.ceil((e+1)*TI/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=rLe.create(this.model),this.glyphLanes=new Fwt(0),this.model.isTooLargeForTokenization())this._lines=new Nwt(this.model);else{const h=this._configuration.options,u=h.get(x.fontInfo),f=h.get(x.wrappingStrategy),p=h.get(x.wrappingInfo),m=h.get(x.wrappingIndent),v=h.get(x.wordBreak);this._lines=new Lwt(this._editorId,this.model,n,o,u,this.model.getOptions().tabSize,f,p.wrappingColumn,m,v)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new _wt(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Dwt(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(h=>{h.scrollTopChanged&&this._handleVisibleLinesChanged(),h.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Npt(h)),this._eventDispatcher.emitOutgoingEvent(new iLe(h.oldScrollWidth,h.oldScrollLeft,h.oldScrollHeight,h.oldScrollTop,h.scrollWidth,h.scrollLeft,h.scrollHeight,h.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(h=>{this._eventDispatcher.emitOutgoingEvent(h)})),this._decorations=new kwt(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(h=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,h)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(hY.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Opt)})),this._register(this._themeService.onDidColorThemeChange(h=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Ppt(h))})),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 F(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 Rpt(e)),this._eventDispatcher.emitOutgoingEvent(new tLe(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new kpt)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Ipt)}_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 OBe(t,this._viewportStart.startLineDelta)}return new OBe(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(x.fontInfo),r=n.get(x.wrappingStrategy),a=n.get(x.wrappingInfo),c=n.get(x.wrappingIndent),l=n.get(x.wordBreak);this._lines.setWrappingSettings(o,r,a.wrappingColumn,c,l)&&(e.emitViewEvent(new kG),e.emitViewEvent(new IG),e.emitViewEvent(new kI(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 kI(null))),t.hasChanged(x.renderValidationDecorations)&&(this._decorations.reset(),e.emitViewEvent(new kI(null))),e.emitViewEvent(new Tpt(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),nP.shouldRecreate(t)&&(this.cursorConfig=new nP(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 n=!1,o=!1;const r=e instanceof CT?e.rawContentChangedEvent.changes:e.changes,a=e instanceof CT?e.rawContentChangedEvent.versionId:null,c=this._lines.createLineBreaksComputer();for(const h of r)switch(h.changeType){case Og.LinesInserted:{for(let u=0;u!m.ownerId||m.ownerId===this._editorId)),c.addRequest(f,p,null)}break}case Og.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 By(l);for(const h of r)switch(h.changeType){case Og.Flush:{this._lines.onModelFlushed(),i.emitViewEvent(new kG),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break}case Og.LinesDeleted:{const u=this._lines.onModelLinesDeleted(a,h.fromLineNumber,h.toLineNumber);u!==null&&(i.emitViewEvent(u),this.viewLayout.onLinesDeleted(u.fromLineNumber,u.toLineNumber)),n=!0;break}case Og.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)),n=!0;break}case Og.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}case Og.EOLChanged:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!n&&o&&(i.emitViewEvent(new IG),i.emitViewEvent(new kI(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 n=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},mt.Immediate)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof CT&&i.emitOutgoingEvent(new fwt(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,n=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new Mpt),this.cursorConfig=new nP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new gwt(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new nP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new uwt(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new kG),t.emitViewEvent(new IG),t.emitViewEvent(new kI(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new nP(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new pwt(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new kI(e)),this._eventDispatcher.emitOutgoingEvent(new hwt(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const n=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new kG),r.emitViewEvent(new IG),r.emitViewEvent(new kI(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const a=n.viewportStartModelPosition?.lineNumber;a&&i.some(l=>l.startLineNumber<=a&&a<=l.endLineNumber)||n.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new lwt)}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)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new F(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 n=[];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),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_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,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}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=xh(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=D_(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 n=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new hp(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,n,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new fgt(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Tj(this._configuration.options)),i=new Bwt;for(const n of t){const o=n.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(n.range.startLineNumber,n.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.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),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const n=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(F.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])+n);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?go.CRLF:go.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?go.CRLF:go.TextDefined));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Ca||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new F(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===rd.fontFamily;let l;return c?l=rd.fontFamily:(l=o.fontFamily,l=l.replace(/"/g,"'"),/[,']/.test(l)||/[+ ]/.test(l)&&(l=`'${l}'`),l=`${l}, ${rd.fontFamily}`),{mode:i,html:`
    `+this._getHTMLToCopy(n,r)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=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?n-1:0,f=l===o?r-1:h.length;h===""?c+="
    ":c+=ywt(h,d.inflate(),t,u,f,a,Qn)}return c}_getColorMap(){const e=Ta.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,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=Oi.NotSet){this._withViewEventsCollector(n=>this._cursor.setSelections(n,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 dwt);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,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,n,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}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(n=>this._cursor.revealAll(n,e,i,_s.Simple,t,mt.Smooth))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,_s.Simple,t,mt.Smooth))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new F(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new n5(e,!1,i,null,_s.Simple,!0,mt.Smooth)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new F(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new n5(e,!1,i,null,_s.Simple,!0,mt.Smooth)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new n5(e,!1,i,null,n,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Bpt),this._eventDispatcher.emitOutgoingEvent(new cwt))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{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 rLe{static create(e){const t=e._setTrackedRange(null,new F(1,1,1,1),ni.NeverGrowsWhenTypingAtEdges);return new rLe(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,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,ni.NeverGrowsWhenTypingAtEdges)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new oe(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new F(i.lineNumber,i.column,i.lineNumber,i.column),ni.NeverGrowsWhenTypingAtEdges),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class Bwt{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,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){n>l&&(a[a.length-1]=n);return}a.push(o,i,n)}else{const a=new F8(e,t,[o,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class Wwt{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&FBe(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)=>Hwt(t,i),[]);return FBe(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Hwt(s,e){const t=[];let i=0,n=0;for(;i{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(x.layoutInfo)){const w=b.get(x.layoutInfo);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=r,this._themeService=c,this._register(new Gwt(this,this._contextKeyService)),this._register(new Kwt(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new Uc([Le,this._contextKeyService]))),this._modelData=null,this._focusTracker=new qwt(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=sp.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of sp.getEditorActions()){if(this._actions.has(v.id)){vt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new Wqe(v.id,v.label,v.alias,v.metadata,v.precondition??void 0,w=>this._instantiationService.invokeFunction(y=>Promise.resolve(v.runEditorCommand(y,this,w))),this._contextKeyService);this._actions.set(b.id,b)}const m=()=>!this._configuration.options.get(x.readOnly)&&this._configuration.options.get(x.dropIntoEditor).enabled;this._register(new Vj(this._domElement,{onDragOver:v=>{if(!m())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b?.position&&this.showDropIndicatorAt(b.position)},onDrop:async v=>{if(!m()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b?.position&&this._onDropIntoEditor.fire({position:b.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n,o){return new Ipe(e,t,i,n,this._domElement,o)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return _U.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?hs.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=go.TextDefined;return e&&e.lineEnding&&e.lineEnding===` `?i=go.LF:e&&e.lineEnding&&e.lineEnding===`\r -`&&(i=go.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 n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),n&&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,n){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?n0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?n0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?n0._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){this._modelData?.viewModel.setHiddenAreas(e.map(i=>F.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 qa.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 qa.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,n){if(!this._modelData)return;if(!F.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,n)}revealLine(e,t=mt.Smooth){this._revealLine(e,_s.Simple,t)}revealLineInCenter(e,t=mt.Smooth){this._revealLine(e,_s.Center,t)}revealLineInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealLine(e,_s.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=mt.Smooth){this._revealLine(e,_s.NearTop,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new F(e,1,e,1),t,!1,i)}revealPosition(e,t=mt.Smooth){this._revealPosition(e,_s.Simple,!0,t)}revealPositionInCenter(e,t=mt.Smooth){this._revealPosition(e,_s.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealPosition(e,_s.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=mt.Smooth){this._revealPosition(e,_s.NearTop,!0,t)}_revealPosition(e,t,i,n){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new F(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=dt.isISelection(e),n=F.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){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 dt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=mt.Smooth){this._revealLines(e,t,_s.Simple,i)}revealLinesInCenter(e,t,i=mt.Smooth){this._revealLines(e,t,_s.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=mt.Smooth){this._revealLines(e,t,_s.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=mt.Smooth){this._revealLines(e,t,_s.NearTop,i)}_revealLines(e,t,i,n){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new F(e,1,t,1),i,!1,n)}revealRange(e,t=mt.Smooth,i=!1,n=!0){this._revealRange(e,i?_s.Center:_s.Simple,n,t)}revealRangeInCenter(e,t=mt.Smooth){this._revealRange(e,_s.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealRange(e,_s.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=mt.Smooth){this._revealRange(e,_s.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=mt.Smooth){this._revealRange(e,_s.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=mt.Smooth){this._revealRange(e,_s.Top,!0,t)}_revealRange(e,t,i,n){if(!F.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(F.lift(e),t,i,n)}setSelections(e,t="api",i=Oi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,o=e.length;n0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const n=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(n)}}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 oc.CompositionStart:this._startComposition();return;case oc.CompositionEnd:this._endComposition(e);return;case oc.Type:{const o=i;this._type(e,o.text||"");return}case oc.ReplacePreviousChar:{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case oc.CompositionType:{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case oc.Paste:{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case oc.Cut:this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run(i)).then(void 0,vt);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,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,c=a.getSelection().getStartPosition();a.paste(t,i,n,e);const l=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new F(c.lineNumber,c.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=ap.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(n.runEditorCommand(o,this,i)).then(void 0,vt)}),!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 n;return i?Array.isArray(i)?n=()=>i:n=i:n=()=>null,this._modelData.viewModel.executeEdits(e,t,n),!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 oyt(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,Rj(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Rj(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 n={},o=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=n;const r=[];for(const c of i){let l=t;if(c.renderOptions){const h=Wc(c.renderOptions).toString(16);l=t+"-"+h,!o[h]&&!n[h]&&this._registerDecorationType(e,l,c.renderOptions,t),n[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)n[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 n=Gt.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,n=i.get(x.layoutInfo),o=n0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.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){Dl(e,this._configuration.options.get(x.fontInfo))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),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(),n=new Qwt(this._id,this._configuration,e,eLe.create(ct(this._domElement)),hLe.create(this._configuration.options),a=>Ll(ct(this._domElement),a),this.languageConfigurationService,this._themeService,i,{batchChanges:a=>{try{return this._beginUpdate(),a()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(a=>{switch(a.kind){case pa.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case pa.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case pa.ScrollChanged:this._onDidScrollChange.fire(a);break;case pa.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case pa.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case pa.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case pa.CursorStateChanged:{if(a.reachedMaxCursorCount){const h=this.getOption(x.multiCursorLimit),u=g(1335,"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(Xe.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:g(1336,"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(oc.Paste,l)},type:o=>{const r={text:o};this._commandService.executeCommand(oc.Type,r)},compositionType:(o,r,a,c)=>{if(a||c){const l={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(oc.CompositionType,l)}else{const l={text:o,replaceCharCnt:r};this._commandService.executeCommand(oc.ReplacePreviousChar,l)}},startComposition:()=>{this._commandService.executeCommand(oc.CompositionStart,{})},endComposition:()=>{this._commandService.executeCommand(oc.CompositionEnd,{})},cut:()=>{this._commandService.executeCommand(oc.Cut,{})}};const i=new nae(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 dme(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)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_registerDecorationType(e,t,i,n){this._codeEditorService.registerDecorationType(e,t,i,n,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 F(e.lineNumber,e.column,e.lineNumber,e.column),options:n0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,mt.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()}},n0=cL,cL.dropIntoEditorDecorationOptions=Gt.register({description:"workbench-dnd-target",className:"dnd-target"}),cL);Hk=n0=D([_(3,we),_(4,Kt),_(5,vi),_(6,Le),_(7,pn),_(8,bi),_(9,mr),_(10,Vs),_(11,it)],Hk);let eyt=0,tyt=class{constructor(e,t,i,n,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=r}dispose(){bt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var K0;(function(s){s[s.NotSet=0]="NotSet",s[s.False=1]="False",s[s.True=2]="True"})(K0||(K0={}));class YBe extends V{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=K0.NotSet}setValue(e){const t=e?K0.True:K0.False;this._value!==t&&(this._value=t,this._value===K0.True?this._onDidChangeToTrue.fire():this._value===K0.False&&this._onDidChangeToFalse.fire())}}class rh extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class iyt extends V{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=J.editorSimpleInput.bindTo(t),this._editorFocus=J.focus.bindTo(t),this._textInputFocus=J.textInputFocus.bindTo(t),this._editorTextFocus=J.editorTextFocus.bindTo(t),this._tabMovesFocus=J.tabMovesFocus.bindTo(t),this._editorReadonly=J.readOnly.bindTo(t),this._inDiffEditor=J.inDiffEditor.bindTo(t),this._editorColumnSelection=J.columnSelection.bindTo(t),this._hasMultipleSelections=J.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=J.hasNonEmptySelection.bindTo(t),this._canUndo=J.canUndo.bindTo(t),this._canRedo=J.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(Pk.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(Pk.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 nyt extends V{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=J.languageId.bindTo(t),this._hasCompletionItemProvider=J.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=J.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=J.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=J.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=J.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=J.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=J.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=J.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=J.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=J.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=J.hasReferenceProvider.bindTo(t),this._hasRenameProvider=J.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=J.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=J.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=J.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=J.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=J.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=J.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=J.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}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===pe.walkThroughSnippet||e.uri.scheme===pe.vscodeChatCodeBlock)})}}class syt extends V{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(Ac(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(Ac(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 oyt{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(n=>{this._isChangingDecorations||e.call(t,n)},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 n=e.getDecorationRange(i);n&&t.push(n)}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 ryt=encodeURIComponent("");function rhe(s){return ryt+encodeURIComponent(s.toString())+ayt}const cyt=encodeURIComponent('');function dyt(s){return cyt+encodeURIComponent(s.toString())+lyt}Cp((s,e)=>{const t=s.getColor(TN);t&&e.addRule(`.monaco-editor .${Uh.EditorErrorDecoration} { background: url("data:image/svg+xml,${rhe(t)}") repeat-x bottom left; }`);const i=s.getColor(pm);i&&e.addRule(`.monaco-editor .${Uh.EditorWarningDecoration} { background: url("data:image/svg+xml,${rhe(i)}") repeat-x bottom left; }`);const n=s.getColor(mm);n&&e.addRule(`.monaco-editor .${Uh.EditorInfoDecoration} { background: url("data:image/svg+xml,${rhe(n)}") repeat-x bottom left; }`);const o=s.getColor(aft);o&&e.addRule(`.monaco-editor .${Uh.EditorHintDecoration} { background: url("data:image/svg+xml,${dyt(o)}") no-repeat bottom left; }`);const r=s.getColor(b_t);r&&e.addRule(`.monaco-editor.showUnused .${Uh.EditorUnnecessaryInlineDecoration} { opacity: ${r.rgba.a}; }`)});let xY=class extends V{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 hl,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 gyt(gl())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!k8(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const n=new uyt(this,i,gl(t));this._editorStyleSheets.set(i,n)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),c={styleSheet:a,key:t,parentTypeKey:n,options:i||Object.create(null)};n?r=new fyt(this._themeService,a,c):r=new pyt(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 n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,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 n=e.uri.toString();let o;this._transientWatchers.hasOwnProperty(n)?o=this._transientWatchers[n]:(o=new hyt(n,e,this),this._transientWatchers[n]=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 n of this._codeEditorOpenHandlers){const o=await n(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};xY=D([_(0,pn)],xY);class hyt{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 uyt{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.remove(),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){Uf(e,t,this._styleSheet)}removeRulesContainingSelector(e){CS(e,this._styleSheet)}}class gyt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){Uf(e,t,this._styleSheet)}removeRulesContainingSelector(e){CS(e,this._styleSheet)}}class fyt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new DY(Ql.BeforeContentClassName,i,e),this._afterContentRules=new DY(Ql.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 pyt{constructor(e,t,i,n){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=h=>{const u=new DY(h,n,t);if(this._disposables.add(u),u.hasContent)return u.className},r=h=>{const u=new DY(h,n,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(Ql.ClassName);const a=r(Ql.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(Ql.BeforeContentClassName),this.afterContentClassName=o(Ql.AfterContentClassName),n.options.beforeInjectedText&&n.options.beforeInjectedText.contentText){const h=r(Ql.BeforeInjectedTextClassName);this.beforeInjectedText={content:n.options.beforeInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.beforeInjectedText.affectsLetterSpacing}}if(n.options.afterInjectedText&&n.options.afterInjectedText.contentText){const h=r(Ql.AfterInjectedTextClassName);this.afterInjectedText={content:n.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(Ql.GlyphMarginClassName);const c=n.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||kl.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 f4={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 DY{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let n=ahe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+ahe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=ahe.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,n;switch(this._ruleType){case Ql.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case Ql.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case Ql.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case Ql.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case Ql.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case Ql.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case Ql.AfterInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),n=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),n.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,n),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($p(f4.contentIconPath,Zu(N.revive(e.contentIconPath)))),typeof e.contentText=="string"){const n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push($p(f4.contentText,n))}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($p(f4.gutterIconPath,Zu(N.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push($p(f4.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push($p("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const n=i.length;for(const o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push($p(f4[o],r))}return i.length!==n}resolveValue(e){if(Sgt(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var Ql;(function(s){s[s.ClassName=0]="ClassName",s[s.InlineClassName=1]="InlineClassName",s[s.GlyphMarginClassName=2]="GlyphMarginClassName",s[s.BeforeContentClassName=3]="BeforeContentClassName",s[s.AfterContentClassName=4]="AfterContentClassName",s[s.BeforeInjectedTextClassName=5]="BeforeInjectedTextClassName",s[s.AfterInjectedTextClassName=6]="AfterInjectedTextClassName"})(Ql||(Ql={}));class ahe{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let n=".monaco-editor ."+this.getClassName(e,i);return t&&(n=n+"."+this.getClassName(t,i)),i===Ql.BeforeContentClassName?n+="::before":i===Ql.AfterContentClassName&&(n+="::after"),n}}let kY=class extends xY{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,n,o)=>n?this.doOpenEditor(n,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===pe.http||o===pe.https)return YGe(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,mt.Immediate);else{const o={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(o),e.revealPositionInCenter(o,mt.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};kY=D([_(0,Le),_(1,pn)],kY);ce(Kt,kY,qt.Eager);const pu=ae("layoutService");let IY=class{get mainContainer(){return lm(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??si.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return z_(this.mainContainer)}get activeContainerDimension(){return z_(this.activeContainer)}get containers(){return Fi(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=M.None,this.onDidLayoutActiveContainer=M.None,this.onDidLayoutContainer=M.None,this.onDidChangeActiveContainer=M.None,this.onDidAddContainer=M.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};IY=D([_(0,Kt)],IY);let kme=class extends IY{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};kme=D([_(1,Kt)],kme);ce(pu,IY,qt.Delayed);const to=ae("dialogService"),ag=ae("fileDialogService");function VG(s){return s.scheme===pe.file?s.fsPath:s.path}let gQe=0;class zG{constructor(e,t,i,n,o,r,a){this.id=++gQe,this.type=Al.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=n,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 uS;(function(s){s[s.ExternalRemoval=0]="ExternalRemoval",s[s.NoParallelUniverses=1]="NoParallelUniverses"})(uS||(uS={}));class JBe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class XBe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===uS.ExternalRemoval?e:t).push(n.resourceLabel);const i=[];return e.length>0&&i.push(g(1191,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(g(1192,"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 myt{constructor(e,t,i,n,o,r,a){this.id=++gQe,this.type=Al.Workspace,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,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 XBe),this.removedResources.has(t)||this.removedResources.set(t,new JBe(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 XBe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new JBe(e,uS.ExternalRemoval)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class fQe{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===Al.Workspace&&e.removeResource(this.resourceLabel,this.strResource,uS.ExternalRemoval);for(const e of this._future)e.type===Al.Workspace&&e.removeResource(this.resourceLabel,this.strResource,uS.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===Al.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e);for(const t of this._future)t.type===Al.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e)}_setElementValidFlag(e,t){e.type===Al.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===Al.Workspace&&t.removeResource(this.resourceLabel,this.strResource,uS.NoParallelUniverses);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new rQe(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,c=this._past.length;a=t||l.id!==e.elements[n])&&(i=!1,o=0),!i&&l.type===Al.Workspace&&l.removeResource(this.resourceLabel,this.strResource,uS.ExternalRemoval)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const c=this._future[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,r=a),!i&&c.type===Al.Workspace&&c.removeResource(this.resourceLabel,this.strResource,uS.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 che{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t{for(let i=0,n=this._uriComparisonKeyComputers.length;it.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof z0){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){vt(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,n,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(c){return r(),n.dispose(),this._onError(c,e)}return a?a.then(()=>(r(),n.dispose(),o()),c=>(r(),n.dispose(),this._onError(c,e))):(r(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return V.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?V.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==Al.Workspace||typeof e.actual.prepareUndoRedo>"u")return t(V.None);const i=e.actual.prepareUndoRedo();return i?wN(i)?t(i):i.then(n=>t(n)):t(V.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||pQe);return new che(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new $G(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new $G}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,g(1193,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,g(1193,"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(1194,"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(1195,"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(1196,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){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:Xe.Info,message:g(1197,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:g(1198,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:g(1199,"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;n=!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,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=g(1200,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new che([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}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 z0){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 n=this._editStacks.get(e),o=n.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===Al.Workspace?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:g(1201,"Would you like to undo '{0}'?",i.label),primaryButton:g(1202,"&&Yes"),cancelButton:g(1203,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(1205,"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(1206,"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(1207,"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),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=g(1208,"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 che([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderPre(TY.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Ka(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new cdt(6),this._cache.set(i,n));const o=Ka(n.update(t),this._min,this._max);return AA(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new aTe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Ka(e,this._min,this._max)}}let Tme=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=i?.min??50,o=i?.max??n**2,r=i?.key??void 0,a=`${TY.of(e)},${n}${r?","+r:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new _yt(n*1.5)):c=new vyt(this._logService,t,e,this._overallAverage()|0||n*1.5,n,o),this._data.set(a,c)),c}_overallAverage(){const e=new aTe;for(const t of this._data.values())e.update(t.default());return e.value}};Tme=D([_(0,Ge),_(1,Za)],Tme);ce(Sp,Tme,qt.Delayed);function lhe(s,e){return e&&(s.stack||s.stacktrace)?g(568,"{0}: {1}",e2e(s),ZBe(s.stack)||ZBe(s.stacktrace)):e2e(s)}function ZBe(s){return Array.isArray(s)?s.join(` -`):s}function e2e(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?g(569,"A system error occurred ({0})",s.message):s.message||g(570,"An unknown error occurred. Please consult the log for more details.")}function Nr(s=null,e=!1){if(!s)return g(570,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){const t=Fi(s),i=Nr(t[0],e);return t.length>1?g(571,"{0} ({1} errors in total)",i,t.length):i}if(Lt(s))return s;if(s.detail){const t=s.detail;if(t.error)return lhe(t.error,e);if(t.exception)return lhe(t.exception,e)}return s.stack?lhe(s,e):s.message?s.message:g(570,"An unknown error occurred. Please consult the log for more details.")}function byt(s){const e=s;return e instanceof Error&&Array.isArray(e.actions)}function wyt(s,e){let t;return typeof s=="string"?t=new Error(s):t=s,t.actions=e,t}function mQe(s){return lc(s)}var Gn;(function(s){s[s.Off=0]="Off",s[s.Trace=1]="Trace",s[s.Debug=2]="Debug",s[s.Info=3]="Info",s[s.Warning=4]="Warning",s[s.Error=5]="Error"})(Gn||(Gn={}));const bLe=Gn.Info;function LY(s,e,t){switch(e){case Gn.Trace:s.trace(t);break;case Gn.Debug:s.debug(t);break;case Gn.Info:s.info(t);break;case Gn.Warning:s.warn(t);break;case Gn.Error:s.error(t);break;case Gn.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function dP(s,e=!1){let t="";for(let i=0;i0?" ":"")+n}return t}class wLe extends V{constructor(){super(...arguments),this.level=bLe,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!==Gn.Off&&this.level<=e}}class rae extends wLe{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.checkLogLevel(Gn.Trace)&&this.log(Gn.Trace,dP([e,...t],!0))}debug(e,...t){this.checkLogLevel(Gn.Debug)&&this.log(Gn.Debug,dP([e,...t]))}info(e,...t){this.checkLogLevel(Gn.Info)&&this.log(Gn.Info,dP([e,...t]))}warn(e,...t){this.checkLogLevel(Gn.Warning)&&this.log(Gn.Warning,dP([e,...t]))}error(e,...t){if(this.checkLogLevel(Gn.Error))if(e instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(Gn.Error,dP(i))}else this.log(Gn.Error,dP([e,...t]))}flush(){}}let yyt=class extends wLe{constructor(e=bLe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Gn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Gn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Gn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Gn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Gn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}flush(){}};class Cyt extends wLe{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 _Qe extends V{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new ui,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 n of i)this._loggers.set(n.resource,{logger:void 0,info:n})}getLoggerEntry(e){return Lt(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),n=Lt(e)?e:t?.id??Wc(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?Gn.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const a={logger:o,info:{resource:i,id:n,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 Lt(e)?Pt(this.logsHome,`${e}.log`):e}setLogLevel(e,t){if(N.isUri(e)){const i=e,n=t,o=this._loggers.get(i);o&&n!==o.info.logLevel&&(o.info.logLevel=n===this.logLevel?void 0:n,o.logger?.setLevel(n),this._loggers.set(o.info.resource,o),this._onDidChangeLogLevel.fire([i,n]))}else{this.logLevel=e;for(const[i,n]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&n.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 vQe{constructor(){this.onDidChangeLogLevel=new I().event}setLevel(e){}getLevel(){return Gn.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}flush(){}}class Syt extends vQe{}function r3(s){switch(s){case Gn.Trace:return"trace";case Gn.Debug:return"debug";case Gn.Info:return"info";case Gn.Warning:return"warn";case Gn.Error:return"error";case Gn.Off:return"off"}}function bQe(s){switch(s){case"trace":return Gn.Trace;case"debug":return Gn.Debug;case"info":return Gn.Info;case"warn":return Gn.Warning;case"error":return Gn.Error;case"critical":return Gn.Error;case"off":return Gn.Off}}const Ayt=new Q("logLevel",r3(Gn.Info));class w5{static create(e,t){return new w5(e,new RY(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 F(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,[n,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new w5(this._startLineNumber,n),new w5(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,n,o]=Ab(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):B.Null)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new oe(e.startLineNumber,e.startColumn),t,i,n,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 n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+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,n,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,n,o)}}class RY{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=n-1;else{let r=n;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=n;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===n&&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>n){if(c===0&&!d){l=a;break}f-=c}else if(f===n&&p>=o)e&&f===0&&(p+=e,m+=e),f-=c,p-=o-i,m-=o-i;else throw new Error("Not possible!");const b=4*l;r[b]=f,r[b+1]=p,r[b+2]=m,r[b+3]=v,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,r){const a=i===0&&n===1&&(r>=B.Digit0&&r<=B.Digit9||r>=B.A&&r<=B.Z||r>=B.a&&r<=B.z),c=this._tokens,l=this._tokenCount;for(let d=0;d0&&h>1;const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,c,i);if(typeof d>"u")r=VO.NO_STYLING;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?Vo.Italic:0)<d&&i[5*w]===0;)w--;if(w-1===d){let y=h;for(;y+1L)e.warnOverlappingSemanticTokens(A,L+1);else{const G=e.getMetadata(R,z,t);G!==VO.NO_STYLING&&(p===0&&(p=A),u[f]=A-p,u[f+1]=L,u[f+2]=P,u[f+3]=G,f+=4,m=A,v=P)}c=A,l=L,a++}f!==u.length&&(u=u.subarray(0,f));const b=w5.create(p,u);r.push(b)}return r}class Eyt{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}const VC=class VC{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=VC._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=VC._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 Lme(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Mme=D([_(0,pn),_(1,Ge),_(2,xi)],Mme);ce(aae,Mme,qt.Delayed);const I1="**",Nme="/",Tq="[/\\\\]",Lq="[^/\\\\]",xyt=/\//g;function i2e(s,e){switch(s){case 0:return"";case 1:return`${Lq}*?`;default:return`(?:${Tq}|${Lq}+${Tq}${e?`|${Tq}${Lq}+`:""})*?`}}function Pme(s,e){if(!s)return[];const t=[];let i=!1,n=!1,o="";for(const r of s){switch(r){case e:if(!i&&!n){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}o+=r}return o&&t.push(o),t}function yQe(s){if(!s)return"";let e="";const t=Pme(s,Nme);if(t.every(i=>i===I1))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===I1){if(i)return;e+=i2e(2,o===t.length-1)}else{let r=!1,a="",c=!1,l="";for(const d of n){if(d!=="}"&&r){a+=d;continue}if(c&&(d!=="]"||!l)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!l?h="^":d===Nme?h="":h=Rh(d),l+=h;continue}switch(d){case"{":r=!0;continue;case"[":c=!0;continue;case"}":{const u=`(?:${Pme(a,",").map(f=>yQe(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=Lq;continue;case"*":e+=i2e(1);continue;default:e+=Rh(d)}}oyLe(a,e)).filter(a=>a!==Ny),s),i=t.length;if(!i)return Ny;if(i===1)return t[0];const n=function(a,c){for(let l=0,d=t.length;l!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function r2e(s,e,t){const i=ou===Vi.sep,n=i?s:s.replace(xyt,ou),o=ou+n,r=Vi.sep+s;let a;return t?a=function(c,l){return typeof c=="string"&&(c===n||c.endsWith(o)||!i&&(c===s||c.endsWith(r)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===n||!i&&c===s)?e:null},a.allPaths=[(t?"*/":"./")+s],a}function Fyt(s){try{const e=new RegExp(`^${yQe(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return Ny}}function zO(s,e,t){return!s||typeof e!="string"?!1:j_(s)(e,void 0,t)}function j_(s,e={}){if(!s)return s2e;if(typeof s=="string"||CQe(s)){const t=yLe(s,e);if(t===Ny)return s2e;const i=function(n,o){return!!t(n,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Oyt(s,e)}function CQe(s){const e=s;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Oyt(s,e){const t=SQe(Object.getOwnPropertyNames(s).map(a=>Byt(a,s[a],e)).filter(a=>a!==Ny)),i=t.length;if(!i)return Ny;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 n=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&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function Byt(s,e,t){if(e===!1)return Ny;const i=yLe(s,t);if(i===Ny)return Ny;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const o=(r,a,c,l)=>{if(!l||!i(r,a))return null;const d=n.replace("$(basename)",()=>c),h=l(d);return Qy(h)?h.then(u=>u?s:null):h?s:null};return o.requiresSiblings=!0,o}}return i}function SQe(s,e){const t=s.filter(a=>!!a.basenames);if(t.length<2)return s;const i=t.reduce((a,c)=>{const l=c.basenames;return l?a.concat(l):a},[]);let n;if(e){n=[];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===B.Slash||h===B.Backslash)break}c=a.substr(d)}const l=i.indexOf(c);return l!==-1?n[l]:null};o.basenames=i,o.patterns=n,o.allBasenames=i;const r=s.filter(a=>!a.basenames);return r.push(o),r}function cae(s,e,t,i,n,o){if(Array.isArray(s)){let r=0;for(const a of s){const c=cae(a,e,t,i,n,o);if(c===10)return c;c>r&&(r=c)}return r}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:r,pattern:a,scheme:c,hasAccessToAllModels:l,notebookType:d}=s;if(!i&&!l)return 0;d&&n&&(e=n);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:Rk(a.base)},u===e.fsPath||zO(u,e.fsPath))h=10;else return 0}return h}else return 0}}function AQe(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(AQe):!!s.notebookType}function EQe(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(EQe):!!s.exclusive}class a2e{constructor(e,t,i,n,o){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=o}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}}class oo{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 n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,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,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}allNoModel(){return this._entries.map(e=>e.provider)}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,n=>i.push(n.provider)),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,o=>{i&&n===o._score?i.push(o.provider):(n=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const n of this._entries)n._score>0&&i(n)}_updateScores(e,t){const i=this._notebookInfoResolver?.(e.uri),n=i?new a2e(e.uri,e.getLanguageId(),i.uri,i.type,t):new a2e(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){this._lastCandidate=n;for(const o of this._entries)if(o._score=cae(o.selector,n.uri,n.languageId,Ly(e),n.notebookUri,n.notebookType),EQe(o.selector)&&o._score>0)if(t)o._score=0;else{for(const r of this._entries)r._score=0;o._score=1e3;break}this._entries.sort(oo._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:nV(e.selector)&&!nV(t.selector)?1:!nV(e.selector)&&nV(t.selector)?-1:e._timet._time?-1:0}}function nV(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(nV):!!s.isBuiltin}class Wyt{constructor(){this.referenceProvider=new oo(this._score.bind(this)),this.renameProvider=new oo(this._score.bind(this)),this.newSymbolNamesProvider=new oo(this._score.bind(this)),this.codeActionProvider=new oo(this._score.bind(this)),this.definitionProvider=new oo(this._score.bind(this)),this.typeDefinitionProvider=new oo(this._score.bind(this)),this.declarationProvider=new oo(this._score.bind(this)),this.implementationProvider=new oo(this._score.bind(this)),this.documentSymbolProvider=new oo(this._score.bind(this)),this.inlayHintsProvider=new oo(this._score.bind(this)),this.colorProvider=new oo(this._score.bind(this)),this.codeLensProvider=new oo(this._score.bind(this)),this.documentFormattingEditProvider=new oo(this._score.bind(this)),this.documentRangeFormattingEditProvider=new oo(this._score.bind(this)),this.onTypeFormattingEditProvider=new oo(this._score.bind(this)),this.signatureHelpProvider=new oo(this._score.bind(this)),this.hoverProvider=new oo(this._score.bind(this)),this.documentHighlightProvider=new oo(this._score.bind(this)),this.multiDocumentHighlightProvider=new oo(this._score.bind(this)),this.selectionRangeProvider=new oo(this._score.bind(this)),this.foldingRangeProvider=new oo(this._score.bind(this)),this.linkProvider=new oo(this._score.bind(this)),this.inlineCompletionsProvider=new oo(this._score.bind(this)),this.inlineEditProvider=new oo(this._score.bind(this)),this.completionProvider=new oo(this._score.bind(this)),this.linkedEditingRangeProvider=new oo(this._score.bind(this)),this.inlineValuesProvider=new oo(this._score.bind(this)),this.evaluatableExpressionProvider=new oo(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new oo(this._score.bind(this)),this.documentSemanticTokensProvider=new oo(this._score.bind(this)),this.documentDropEditProvider=new oo(this._score.bind(this)),this.documentPasteEditProvider=new oo(this._score.bind(this)),this.mappedEditsProvider=new oo(this._score.bind(this))}setNotebookTypeResolver(e){this._notebookTypeResolver=e}_score(e){return this._notebookTypeResolver?.(e)}}ce(it,Wyt,qt.Delayed);const ec=ae("hoverService"),mf=ae("contextViewService"),lr=ae("contextMenuService");var Hyt='.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}';ut(Hyt,{});var Uyt='.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 .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);text-decoration:var(--text-link-decoration)}.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 .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.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}';ut(Uyt,{});const GG=fe;var vo;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BELOW=2]="BELOW",s[s.ABOVE=3]="ABOVE"})(vo||(vo={}));let CLe=class extends V{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 EU(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class SLe extends V{static render(e,t,i){return new SLe(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=re(e,GG("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=re(this.actionContainer,GG("a.action")),this.action.setAttribute("role","button"),t.iconClass&&re(this.action,GG(`span.icon.${t.iconClass}`));const n=re(this.action,GG("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new DQe(this.actionContainer,t.run)),this._store.add(new kQe(this.actionContainer,t.run,[S.Enter,S.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 xQe(s,e){return s&&e?g(6985,"Inspect this in the accessible view with {0}.",e):s?g(6986,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class DQe extends V{constructor(e,t){super(),this._register(ue(e,ke.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class kQe extends V{constructor(e,t,i){super(),this._register(ue(e,ke.KEY_DOWN,n=>{const o=new En(n);i.some(r=>o.equals(r))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}var Md;(function(s){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}}s.intersect=e;function t(o){return o.end-o.start<=0}s.isEmpty=t;function i(o,r){return!t(e(o,r))}s.intersects=i;function n(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}s.relativeComplement=n})(Md||(Md={}));var Vyt=".context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}";ut(Vyt,{});var zw;(function(s){s[s.ABSOLUTE=1]="ABSOLUTE",s[s.FIXED=2]="FIXED",s[s.FIXED_SHADOW=3]="FIXED_SHADOW"})(zw||(zw={}));function zyt(s){const e=s;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var vb;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(vb||(vb={}));var Vf;(function(s){s[s.BELOW=0]="BELOW",s[s.ABOVE=1]="ABOVE"})(Vf||(Vf={}));var NY;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(NY||(NY={}));var Mf;(function(s){s[s.Before=0]="Before",s[s.After=1]="After"})(Mf||(Mf={}));var Ex;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})(Ex||(Ex={}));function cF(s,e,t){const i=t.mode===Ex.ALIGN?t.offset:t.offset+t.size,n=t.mode===Ex.ALIGN?t.offset+t.size:t.offset;return t.position===Mf.Before?e<=s-i?i:e<=n?n-e:Math.max(s-e,0):e<=n?n-e:e<=s-i?i:0}const jF=class jF extends V{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=V.None,this.toDisposeOnSetContainer=V.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=fe(".context-view"),zd(this.view),this.setContainer(e,t),this._register(Ee(()=>this.setContainer(null,zw.ABSOLUTE)))}setContainer(e,t){this.useFixedPosition=t!==zw.ABSOLUTE;const i=this.useShadowDOM;if(this.useShadowDOM=t===zw.FIXED_SHADOW,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=fe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=$yt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(fe("slot"))}else this.container.appendChild(this.view);const n=new Z;jF.BUBBLE_UP_EVENTS.forEach(o=>{n.add(Ro(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),jF.BUBBLE_DOWN_EVENTS.forEach(o=>{n.add(Ro(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),Ms(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",Yh(this.view),this.toDisposeOnClean=e.render(this.view)||V.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(dm&&kO.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Yr(e)){const u=Cr(e),f=VGe(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else zyt(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=Pd(this.view),n=fb(this.view),o=this.delegate.anchorPosition||Vf.BELOW,r=this.delegate.anchorAlignment||vb.LEFT,a=this.delegate.anchorAxisAlignment||NY.VERTICAL;let c,l;const d=ky();if(a===NY.VERTICAL){const u={offset:t.top-d.pageYOffset,size:t.height,position:o===Vf.BELOW?Mf.Before:Mf.After},f={offset:t.left,size:t.width,position:r===vb.LEFT?Mf.Before:Mf.After,mode:Ex.ALIGN};c=cF(d.innerHeight,n,u)+d.pageYOffset,Md.intersects({start:c,end:c+n},{start:u.offset,end:u.offset+u.size})&&(f.mode=Ex.AVOID),l=cF(d.innerWidth,i,f)}else{const u={offset:t.left,size:t.width,position:r===vb.LEFT?Mf.Before:Mf.After},f={offset:t.top,size:t.height,position:o===Vf.BELOW?Mf.Before:Mf.After,mode:Ex.ALIGN};l=cF(d.innerWidth,i,u),Md.intersects({start:l,end:l+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Ex.AVOID),c=cF(d.innerHeight,n,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===Vf.BELOW?"bottom":"top"),this.view.classList.add(r===vb.LEFT?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=Cr(this.container);this.view.style.top=`${c-(this.useFixedPosition?Cr(this.view).top:h.top)}px`,this.view.style.left=`${l-(this.useFixedPosition?Cr(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(),zd(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,ct(e).document.activeElement):t&&!wc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};jF.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],jF.BUBBLE_DOWN_EVENTS=["click"];let Fme=jF;const $yt=` +`&&(i=go.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 n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),n&&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,n){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?e0._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?e0._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?e0._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){this._modelData?.viewModel.setHiddenAreas(e.map(i=>F.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 qa.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 qa.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,n){if(!this._modelData)return;if(!F.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,n)}revealLine(e,t=mt.Smooth){this._revealLine(e,_s.Simple,t)}revealLineInCenter(e,t=mt.Smooth){this._revealLine(e,_s.Center,t)}revealLineInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealLine(e,_s.CenterIfOutsideViewport,t)}revealLineNearTop(e,t=mt.Smooth){this._revealLine(e,_s.NearTop,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new F(e,1,e,1),t,!1,i)}revealPosition(e,t=mt.Smooth){this._revealPosition(e,_s.Simple,!0,t)}revealPositionInCenter(e,t=mt.Smooth){this._revealPosition(e,_s.Center,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealPosition(e,_s.CenterIfOutsideViewport,!0,t)}revealPositionNearTop(e,t=mt.Smooth){this._revealPosition(e,_s.NearTop,!0,t)}_revealPosition(e,t,i,n){if(!oe.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new F(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=dt.isISelection(e),n=F.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){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 dt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=mt.Smooth){this._revealLines(e,t,_s.Simple,i)}revealLinesInCenter(e,t,i=mt.Smooth){this._revealLines(e,t,_s.Center,i)}revealLinesInCenterIfOutsideViewport(e,t,i=mt.Smooth){this._revealLines(e,t,_s.CenterIfOutsideViewport,i)}revealLinesNearTop(e,t,i=mt.Smooth){this._revealLines(e,t,_s.NearTop,i)}_revealLines(e,t,i,n){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new F(e,1,t,1),i,!1,n)}revealRange(e,t=mt.Smooth,i=!1,n=!0){this._revealRange(e,i?_s.Center:_s.Simple,n,t)}revealRangeInCenter(e,t=mt.Smooth){this._revealRange(e,_s.Center,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=mt.Smooth){this._revealRange(e,_s.CenterIfOutsideViewport,!0,t)}revealRangeNearTop(e,t=mt.Smooth){this._revealRange(e,_s.NearTop,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=mt.Smooth){this._revealRange(e,_s.NearTopIfOutsideViewport,!0,t)}revealRangeAtTop(e,t=mt.Smooth){this._revealRange(e,_s.Top,!0,t)}_revealRange(e,t,i,n){if(!F.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(F.lift(e),t,i,n)}setSelections(e,t="api",i=Oi.NotSet){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,o=e.length;n0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const n=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(n)}}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 oc.CompositionStart:this._startComposition();return;case oc.CompositionEnd:this._endComposition(e);return;case oc.Type:{const o=i;this._type(e,o.text||"");return}case oc.ReplacePreviousChar:{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case oc.CompositionType:{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case oc.Paste:{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case oc.Cut:this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run(i)).then(void 0,vt);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,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,c=a.getSelection().getStartPosition();a.paste(t,i,n,e);const l=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new F(c.lineNumber,c.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=sp.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(n.runEditorCommand(o,this,i)).then(void 0,vt)}),!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 n;return i?Array.isArray(i)?n=()=>i:n=i:n=()=>null,this._modelData.viewModel.executeEdits(e,t,n),!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 Qwt(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,Tj(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,Tj(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 n={},o=this._decorationTypeSubtypes[t]||{};this._decorationTypeSubtypes[t]=n;const r=[];for(const c of i){let l=t;if(c.renderOptions){const h=Wc(c.renderOptions).toString(16);l=t+"-"+h,!o[h]&&!n[h]&&this._registerDecorationType(e,l,c.renderOptions,t),n[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)n[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 n=Gt.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,n=i.get(x.layoutInfo),o=e0._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.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){xl(e,this._configuration.options.get(x.fontInfo))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),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(),n=new Owt(this._id,this._configuration,e,VTe.create(ct(this._domElement)),ZTe.create(this._configuration.options),a=>Tl(ct(this._domElement),a),this.languageConfigurationService,this._themeService,i,{batchChanges:a=>{try{return this._beginUpdate(),a()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(a=>{switch(a.kind){case pa.ContentSizeChanged:this._onDidContentSizeChange.fire(a);break;case pa.FocusChanged:this._editorTextFocus.setValue(a.hasFocus);break;case pa.ScrollChanged:this._onDidScrollChange.fire(a);break;case pa.ViewZonesChanged:this._onDidChangeViewZones.fire();break;case pa.HiddenAreasChanged:this._onDidChangeHiddenAreas.fire();break;case pa.ReadOnlyEditAttempt:this._onDidAttemptReadOnlyEdit.fire();break;case pa.CursorStateChanged:{if(a.reachedMaxCursorCount){const h=this.getOption(x.multiCursorLimit),u=g(1335,"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(Xe.Warning,u,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:g(1336,"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(oc.Paste,l)},type:o=>{const r={text:o};this._commandService.executeCommand(oc.Type,r)},compositionType:(o,r,a,c)=>{if(a||c){const l={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:c};this._commandService.executeCommand(oc.CompositionType,l)}else{const l={text:o,replaceCharCnt:r};this._commandService.executeCommand(oc.ReplacePreviousChar,l)}},startComposition:()=>{this._commandService.executeCommand(oc.CompositionStart,{})},endComposition:()=>{this._commandService.executeCommand(oc.CompositionEnd,{})},cut:()=>{this._commandService.executeCommand(oc.Cut,{})}};const i=new Zre(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 sme(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)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_registerDecorationType(e,t,i,n){this._codeEditorService.registerDecorationType(e,t,i,n,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 F(e.lineNumber,e.column,e.lineNumber,e.column),options:e0.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,mt.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()}},e0=sL,sL.dropIntoEditorDecorationOptions=Gt.register({description:"workbench-dnd-target",className:"dnd-target"}),sL);Pk=e0=D([_(3,we),_(4,Kt),_(5,vi),_(6,Le),_(7,pn),_(8,bi),_(9,mr),_(10,Vs),_(11,it)],Pk);let zwt=0,$wt=class{constructor(e,t,i,n,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=r}dispose(){bt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};var V0;(function(s){s[s.NotSet=0]="NotSet",s[s.False=1]="False",s[s.True=2]="True"})(V0||(V0={}));class BBe extends V{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=V0.NotSet}setValue(e){const t=e?V0.True:V0.False;this._value!==t&&(this._value=t,this._value===V0.True?this._onDidChangeToTrue.fire():this._value===V0.False&&this._onDidChangeToFalse.fire())}}class sh extends I{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Gwt extends V{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=J.editorSimpleInput.bindTo(t),this._editorFocus=J.focus.bindTo(t),this._textInputFocus=J.textInputFocus.bindTo(t),this._editorTextFocus=J.editorTextFocus.bindTo(t),this._tabMovesFocus=J.tabMovesFocus.bindTo(t),this._editorReadonly=J.readOnly.bindTo(t),this._inDiffEditor=J.inDiffEditor.bindTo(t),this._editorColumnSelection=J.columnSelection.bindTo(t),this._hasMultipleSelections=J.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=J.hasNonEmptySelection.bindTo(t),this._canUndo=J.canUndo.bindTo(t),this._canRedo=J.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(Tk.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(Tk.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 Kwt extends V{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=J.languageId.bindTo(t),this._hasCompletionItemProvider=J.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=J.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=J.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=J.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=J.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=J.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=J.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=J.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=J.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=J.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=J.hasReferenceProvider.bindTo(t),this._hasRenameProvider=J.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=J.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=J.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=J.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=J.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=J.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=J.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=J.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}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===pe.walkThroughSnippet||e.uri.scheme===pe.vscodeChatCodeBlock)})}}class qwt extends V{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(Ac(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(Ac(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 Qwt{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(n=>{this._isChangingDecorations||e.call(t,n)},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 n=e.getDecorationRange(i);n&&t.push(n)}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 jwt=encodeURIComponent("");function Zde(s){return jwt+encodeURIComponent(s.toString())+Ywt}const Jwt=encodeURIComponent('');function Zwt(s){return Jwt+encodeURIComponent(s.toString())+Xwt}bp((s,e)=>{const t=s.getColor(xN);t&&e.addRule(`.monaco-editor .${Hh.EditorErrorDecoration} { background: url("data:image/svg+xml,${Zde(t)}") repeat-x bottom left; }`);const i=s.getColor(um);i&&e.addRule(`.monaco-editor .${Hh.EditorWarningDecoration} { background: url("data:image/svg+xml,${Zde(i)}") repeat-x bottom left; }`);const n=s.getColor(gm);n&&e.addRule(`.monaco-editor .${Hh.EditorInfoDecoration} { background: url("data:image/svg+xml,${Zde(n)}") repeat-x bottom left; }`);const o=s.getColor(Ygt);o&&e.addRule(`.monaco-editor .${Hh.EditorHintDecoration} { background: url("data:image/svg+xml,${Zwt(o)}") no-repeat bottom left; }`);const r=s.getColor(c_t);r&&e.addRule(`.monaco-editor.showUnused .${Hh.EditorUnnecessaryInlineDecoration} { opacity: ${r.rgba.a}; }`)});let AY=class extends V{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 dl,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 iyt(ul())}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!E8(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const n=new tyt(this,i,ul(t));this._editorStyleSheets.set(i,n)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n,o){let r=this._decorationOptionProviders.get(t);if(!r){const a=this._getOrCreateStyleSheet(o),c={styleSheet:a,key:t,parentTypeKey:n,options:i||Object.create(null)};n?r=new nyt(this._themeService,a,c):r=new syt(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 n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,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 n=e.uri.toString();let o;this._transientWatchers.hasOwnProperty(n)?o=this._transientWatchers[n]:(o=new eyt(n,e,this),this._transientWatchers[n]=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 n of this._codeEditorOpenHandlers){const o=await n(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ee(t)}};AY=D([_(0,pn)],AY);class eyt{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 tyt{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.remove(),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){Bf(e,t,this._styleSheet)}removeRulesContainingSelector(e){yS(e,this._styleSheet)}}class iyt{get sheet(){return this._styleSheet.sheet}constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){Bf(e,t,this._styleSheet)}removeRulesContainingSelector(e){yS(e,this._styleSheet)}}class nyt{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new EY(ql.BeforeContentClassName,i,e),this._afterContentRules=new EY(ql.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 syt{constructor(e,t,i,n){this._disposables=new Z,this.description=e,this._styleSheet=i,this._styleSheet.ref(),this.refCount=0;const o=h=>{const u=new EY(h,n,t);if(this._disposables.add(u),u.hasContent)return u.className},r=h=>{const u=new EY(h,n,t);return this._disposables.add(u),u.hasContent?{className:u.className,hasLetterSpacing:u.hasLetterSpacing}:null};this.className=o(ql.ClassName);const a=r(ql.InlineClassName);if(a&&(this.inlineClassName=a.className,this.inlineClassNameAffectsLetterSpacing=a.hasLetterSpacing),this.beforeContentClassName=o(ql.BeforeContentClassName),this.afterContentClassName=o(ql.AfterContentClassName),n.options.beforeInjectedText&&n.options.beforeInjectedText.contentText){const h=r(ql.BeforeInjectedTextClassName);this.beforeInjectedText={content:n.options.beforeInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.beforeInjectedText.affectsLetterSpacing}}if(n.options.afterInjectedText&&n.options.afterInjectedText.contentText){const h=r(ql.AfterInjectedTextClassName);this.afterInjectedText={content:n.options.afterInjectedText.contentText,inlineClassName:h?.className,inlineClassNameAffectsLetterSpacing:h?.hasLetterSpacing||n.options.afterInjectedText.affectsLetterSpacing}}this.glyphMarginClassName=o(ql.GlyphMarginClassName);const c=n.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||Dl.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 l4={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 EY{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let n=ehe.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+ehe.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=ehe.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,n;switch(this._ruleType){case ql.ClassName:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case ql.InlineClassName:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case ql.GlyphMarginClassName:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case ql.BeforeContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case ql.AfterContentClassName:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;case ql.BeforeInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.beforeInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.beforeInjectedText),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.beforeInjectedText);break;case ql.AfterInjectedTextClassName:t=this.getCSSTextForModelDecorationContentClassName(e.afterInjectedText),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.afterInjectedText),n=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),n.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector}`,n),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(Up(l4.contentIconPath,Yu(N.revive(e.contentIconPath)))),typeof e.contentText=="string"){const n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(Up(l4.contentText,n))}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(Up(l4.gutterIconPath,Yu(N.revive(e.gutterIconPath)))),typeof e.gutterIconSize<"u"&&t.push(Up(l4.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)?(t.push(Up("box-sizing: border-box;")),!0):!1}collectCSSText(e,t,i){const n=i.length;for(const o of t){const r=this.resolveValue(e[o]);typeof r=="string"&&i.push(Up(l4[o],r))}return i.length!==n}resolveValue(e){if(ugt(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}var ql;(function(s){s[s.ClassName=0]="ClassName",s[s.InlineClassName=1]="InlineClassName",s[s.GlyphMarginClassName=2]="GlyphMarginClassName",s[s.BeforeContentClassName=3]="BeforeContentClassName",s[s.AfterContentClassName=4]="AfterContentClassName",s[s.BeforeInjectedTextClassName=5]="BeforeInjectedTextClassName",s[s.AfterInjectedTextClassName=6]="AfterInjectedTextClassName"})(ql||(ql={}));class ehe{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let n=".monaco-editor ."+this.getClassName(e,i);return t&&(n=n+"."+this.getClassName(t,i)),i===ql.BeforeContentClassName?n+="::before":i===ql.AfterContentClassName&&(n+="::after"),n}}let xY=class extends AY{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,n,o)=>n?this.doOpenEditor(n,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===pe.http||o===pe.https)return VGe(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,mt.Immediate);else{const o={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(o),e.revealPositionInCenter(o,mt.Immediate)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};xY=D([_(0,Le),_(1,pn)],xY);ce(Kt,xY,qt.Eager);const fu=ae("layoutService");let DY=class{get mainContainer(){return rm(this._codeEditorService.listCodeEditors())?.getContainerDomNode()??si.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return H_(this.mainContainer)}get activeContainerDimension(){return H_(this.activeContainer)}get containers(){return Fi(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=M.None,this.onDidLayoutActiveContainer=M.None,this.onDidLayoutContainer=M.None,this.onDidChangeActiveContainer=M.None,this.onDidAddContainer=M.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};DY=D([_(0,Kt)],DY);let Cme=class extends DY{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Cme=D([_(1,Kt)],Cme);ce(fu,DY,qt.Delayed);const to=ae("dialogService"),sg=ae("fileDialogService");function WG(s){return s.scheme===pe.file?s.fsPath:s.path}let oQe=0;class HG{constructor(e,t,i,n,o,r,a){this.id=++oQe,this.type=Sl.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=n,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 hS;(function(s){s[s.ExternalRemoval=0]="ExternalRemoval",s[s.NoParallelUniverses=1]="NoParallelUniverses"})(hS||(hS={}));class WBe{constructor(e,t){this.resourceLabel=e,this.reason=t}}class HBe{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===hS.ExternalRemoval?e:t).push(n.resourceLabel);const i=[];return e.length>0&&i.push(g(1191,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(g(1192,"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 oyt{constructor(e,t,i,n,o,r,a){this.id=++oQe,this.type=Sl.Workspace,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,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 HBe),this.removedResources.has(t)||this.removedResources.set(t,new WBe(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 HBe),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new WBe(e,hS.ExternalRemoval)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class rQe{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===Sl.Workspace&&e.removeResource(this.resourceLabel,this.strResource,hS.ExternalRemoval);for(const e of this._future)e.type===Sl.Workspace&&e.removeResource(this.resourceLabel,this.strResource,hS.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===Sl.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e);for(const t of this._future)t.type===Sl.Workspace?t.setValid(this.resourceLabel,this.strResource,e):t.setValid(e)}_setElementValidFlag(e,t){e.type===Sl.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===Sl.Workspace&&t.removeResource(this.resourceLabel,this.strResource,hS.NoParallelUniverses);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new Xqe(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,c=this._past.length;a=t||l.id!==e.elements[n])&&(i=!1,o=0),!i&&l.type===Sl.Workspace&&l.removeResource(this.resourceLabel,this.strResource,hS.ExternalRemoval)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const c=this._future[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,r=a),!i&&c.type===Sl.Workspace&&c.removeResource(this.resourceLabel,this.strResource,hS.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 the{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t{for(let i=0,n=this._uriComparisonKeyComputers.length;it.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof W0){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){vt(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,n,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(c){return r(),n.dispose(),this._onError(c,e)}return a?a.then(()=>(r(),n.dispose(),o()),c=>(r(),n.dispose(),this._onError(c,e))):(r(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return V.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?V.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==Sl.Workspace||typeof e.actual.prepareUndoRedo>"u")return t(V.None);const i=e.actual.prepareUndoRedo();return i?mN(i)?t(i):i.then(n=>t(n)):t(V.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||aQe);return new the(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new UG(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new UG}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,g(1193,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,g(1193,"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(1194,"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(1195,"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(1196,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){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:Xe.Info,message:g(1197,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:g(1198,"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:g(1199,"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;n=!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,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=g(1200,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new the([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}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 W0){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 n=this._editStacks.get(e),o=n.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===Sl.Workspace?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:g(1201,"Would you like to undo '{0}'?",i.label),primaryButton:g(1202,"&&Yes"),cancelButton:g(1203,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,g(1205,"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(1206,"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(1207,"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),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=g(1208,"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 the([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderLre(kY.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Ka(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new Jlt(6),this._cache.set(i,n));const o=Ka(n.update(t),this._min,this._max);return CA(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new j1e;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Ka(e,this._min,this._max)}}let Ame=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=i?.min??50,o=i?.max??n**2,r=i?.key??void 0,a=`${kY.of(e)},${n}${r?","+r:""}`;let c=this._data.get(a);return c||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),c=new ryt(n*1.5)):c=new ayt(this._logService,t,e,this._overallAverage()|0||n*1.5,n,o),this._data.set(a,c)),c}_overallAverage(){const e=new j1e;for(const t of this._data.values())e.update(t.default());return e.value}};Ame=D([_(0,Ge),_(1,Za)],Ame);ce(wp,Ame,qt.Delayed);function ihe(s,e){return e&&(s.stack||s.stacktrace)?g(568,"{0}: {1}",VBe(s),UBe(s.stack)||UBe(s.stacktrace)):VBe(s)}function UBe(s){return Array.isArray(s)?s.join(` +`):s}function VBe(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?g(569,"A system error occurred ({0})",s.message):s.message||g(570,"An unknown error occurred. Please consult the log for more details.")}function Nr(s=null,e=!1){if(!s)return g(570,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){const t=Fi(s),i=Nr(t[0],e);return t.length>1?g(571,"{0} ({1} errors in total)",i,t.length):i}if(Lt(s))return s;if(s.detail){const t=s.detail;if(t.error)return ihe(t.error,e);if(t.exception)return ihe(t.exception,e)}return s.stack?ihe(s,e):s.message?s.message:g(570,"An unknown error occurred. Please consult the log for more details.")}function cyt(s){const e=s;return e instanceof Error&&Array.isArray(e.actions)}function lyt(s,e){let t;return typeof s=="string"?t=new Error(s):t=s,t.actions=e,t}function cQe(s){return lc(s)}var Gn;(function(s){s[s.Off=0]="Off",s[s.Trace=1]="Trace",s[s.Debug=2]="Debug",s[s.Info=3]="Info",s[s.Warning=4]="Warning",s[s.Error=5]="Error"})(Gn||(Gn={}));const aLe=Gn.Info;function IY(s,e,t){switch(e){case Gn.Trace:s.trace(t);break;case Gn.Debug:s.debug(t);break;case Gn.Info:s.info(t);break;case Gn.Warning:s.warn(t);break;case Gn.Error:s.error(t);break;case Gn.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function aP(s,e=!1){let t="";for(let i=0;i0?" ":"")+n}return t}class cLe extends V{constructor(){super(...arguments),this.level=aLe,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!==Gn.Off&&this.level<=e}}class iae extends cLe{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.checkLogLevel(Gn.Trace)&&this.log(Gn.Trace,aP([e,...t],!0))}debug(e,...t){this.checkLogLevel(Gn.Debug)&&this.log(Gn.Debug,aP([e,...t]))}info(e,...t){this.checkLogLevel(Gn.Info)&&this.log(Gn.Info,aP([e,...t]))}warn(e,...t){this.checkLogLevel(Gn.Warning)&&this.log(Gn.Warning,aP([e,...t]))}error(e,...t){if(this.checkLogLevel(Gn.Error))if(e instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=e.stack,this.log(Gn.Error,aP(i))}else this.log(Gn.Error,aP([e,...t]))}flush(){}}let dyt=class extends cLe{constructor(e=aLe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Gn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Gn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Gn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Gn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Gn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}flush(){}};class hyt extends cLe{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 lQe extends V{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new ui,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 n of i)this._loggers.set(n.resource,{logger:void 0,info:n})}getLoggerEntry(e){return Lt(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),n=Lt(e)?e:t?.id??Wc(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const r=t?.logLevel==="always"?Gn.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const a={logger:o,info:{resource:i,id:n,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 Lt(e)?Pt(this.logsHome,`${e}.log`):e}setLogLevel(e,t){if(N.isUri(e)){const i=e,n=t,o=this._loggers.get(i);o&&n!==o.info.logLevel&&(o.info.logLevel=n===this.logLevel?void 0:n,o.logger?.setLevel(n),this._loggers.set(o.info.resource,o),this._onDidChangeLogLevel.fire([i,n]))}else{this.logLevel=e;for(const[i,n]of this._loggers.entries())this._loggers.get(i)?.info.logLevel===void 0&&n.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 dQe{constructor(){this.onDidChangeLogLevel=new I().event}setLevel(e){}getLevel(){return Gn.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}critical(e,...t){}dispose(){}flush(){}}class uyt extends dQe{}function n3(s){switch(s){case Gn.Trace:return"trace";case Gn.Debug:return"debug";case Gn.Info:return"info";case Gn.Warning:return"warn";case Gn.Error:return"error";case Gn.Off:return"off"}}function hQe(s){switch(s){case"trace":return Gn.Trace;case"debug":return Gn.Debug;case"info":return Gn.Info;case"warn":return Gn.Warning;case"error":return Gn.Error;case"critical":return Gn.Error;case"off":return Gn.Off}}const gyt=new Y("logLevel",n3(Gn.Info));class _5{static create(e,t){return new _5(e,new TY(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 F(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,[n,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new _5(this._startLineNumber,n),new _5(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,n,o]=yb(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):B.Null)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new oe(e.startLineNumber,e.startColumn),t,i,n,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 n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+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,n,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,n,o)}}class TY{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=n-1;else{let r=n;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=n;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===n&&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>n){if(c===0&&!d){l=a;break}f-=c}else if(f===n&&p>=o)e&&f===0&&(p+=e,m+=e),f-=c,p-=o-i,m-=o-i;else throw new Error("Not possible!");const b=4*l;r[b]=f,r[b+1]=p,r[b+2]=m,r[b+3]=v,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,r){const a=i===0&&n===1&&(r>=B.Digit0&&r<=B.Digit9||r>=B.A&&r<=B.Z||r>=B.a&&r<=B.z),c=this._tokens,l=this._tokenCount;for(let d=0;d0&&h>1;const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,c,i);if(typeof d>"u")r=BO.NO_STYLING;else{if(r=0,typeof d.italic<"u"){const h=(d.italic?Vo.Italic:0)<d&&i[5*w]===0;)w--;if(w-1===d){let y=h;for(;y+1L)e.warnOverlappingSemanticTokens(A,L+1);else{const G=e.getMetadata(R,z,t);G!==BO.NO_STYLING&&(p===0&&(p=A),u[f]=A-p,u[f+1]=L,u[f+2]=P,u[f+3]=G,f+=4,m=A,v=P)}c=A,l=L,a++}f!==u.length&&(u=u.subarray(0,f));const b=_5.create(p,u);r.push(b)}return r}class fyt{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}const UC=class UC{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=UC._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=UC._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 Eme(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Dme=D([_(0,pn),_(1,Ge),_(2,xi)],Dme);ce(nae,Dme,qt.Delayed);const E1="**",kme="/",kq="[/\\\\]",Iq="[^/\\\\]",pyt=/\//g;function $Be(s,e){switch(s){case 0:return"";case 1:return`${Iq}*?`;default:return`(?:${kq}|${Iq}+${kq}${e?`|${kq}${Iq}+`:""})*?`}}function Ime(s,e){if(!s)return[];const t=[];let i=!1,n=!1,o="";for(const r of s){switch(r){case e:if(!i&&!n){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}o+=r}return o&&t.push(o),t}function gQe(s){if(!s)return"";let e="";const t=Ime(s,kme);if(t.every(i=>i===E1))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===E1){if(i)return;e+=$Be(2,o===t.length-1)}else{let r=!1,a="",c=!1,l="";for(const d of n){if(d!=="}"&&r){a+=d;continue}if(c&&(d!=="]"||!l)){let h;d==="-"?h=d:(d==="^"||d==="!")&&!l?h="^":d===kme?h="":h=Th(d),l+=h;continue}switch(d){case"{":r=!0;continue;case"[":c=!0;continue;case"}":{const u=`(?:${Ime(a,",").map(f=>gQe(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+l+"]",c=!1,l="";break}case"?":e+=Iq;continue;case"*":e+=$Be(1);continue;default:e+=Th(d)}}olLe(a,e)).filter(a=>a!==Ly),s),i=t.length;if(!i)return Ly;if(i===1)return t[0];const n=function(a,c){for(let l=0,d=t.length;l!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function QBe(s,e,t){const i=su===Vi.sep,n=i?s:s.replace(pyt,su),o=su+n,r=Vi.sep+s;let a;return t?a=function(c,l){return typeof c=="string"&&(c===n||c.endsWith(o)||!i&&(c===s||c.endsWith(r)))?e:null}:a=function(c,l){return typeof c=="string"&&(c===n||!i&&c===s)?e:null},a.allPaths=[(t?"*/":"./")+s],a}function Eyt(s){try{const e=new RegExp(`^${gQe(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return Ly}}function WO(s,e,t){return!s||typeof e!="string"?!1:K_(s)(e,void 0,t)}function K_(s,e={}){if(!s)return KBe;if(typeof s=="string"||fQe(s)){const t=lLe(s,e);if(t===Ly)return KBe;const i=function(n,o){return!!t(n,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return xyt(s,e)}function fQe(s){const e=s;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function xyt(s,e){const t=pQe(Object.getOwnPropertyNames(s).map(a=>Dyt(a,s[a],e)).filter(a=>a!==Ly)),i=t.length;if(!i)return Ly;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 n=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&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,c)=>c.allPaths?a.concat(c.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function Dyt(s,e,t){if(e===!1)return Ly;const i=lLe(s,t);if(i===Ly)return Ly;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const o=(r,a,c,l)=>{if(!l||!i(r,a))return null;const d=n.replace("$(basename)",()=>c),h=l(d);return Gy(h)?h.then(u=>u?s:null):h?s:null};return o.requiresSiblings=!0,o}}return i}function pQe(s,e){const t=s.filter(a=>!!a.basenames);if(t.length<2)return s;const i=t.reduce((a,c)=>{const l=c.basenames;return l?a.concat(l):a},[]);let n;if(e){n=[];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===B.Slash||h===B.Backslash)break}c=a.substr(d)}const l=i.indexOf(c);return l!==-1?n[l]:null};o.basenames=i,o.patterns=n,o.allBasenames=i;const r=s.filter(a=>!a.basenames);return r.push(o),r}function sae(s,e,t,i,n,o){if(Array.isArray(s)){let r=0;for(const a of s){const c=sae(a,e,t,i,n,o);if(c===10)return c;c>r&&(r=c)}return r}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:r,pattern:a,scheme:c,hasAccessToAllModels:l,notebookType:d}=s;if(!i&&!l)return 0;d&&n&&(e=n);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:Dk(a.base)},u===e.fsPath||WO(u,e.fsPath))h=10;else return 0}return h}else return 0}}function mQe(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(mQe):!!s.notebookType}function _Qe(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(_Qe):!!s.exclusive}class jBe{constructor(e,t,i,n,o){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=o}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}}class oo{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 n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,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,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}allNoModel(){return this._entries.map(e=>e.provider)}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,n=>i.push(n.provider)),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,o=>{i&&n===o._score?i.push(o.provider):(n=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const n of this._entries)n._score>0&&i(n)}_updateScores(e,t){const i=this._notebookInfoResolver?.(e.uri),n=i?new jBe(e.uri,e.getLanguageId(),i.uri,i.type,t):new jBe(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){this._lastCandidate=n;for(const o of this._entries)if(o._score=sae(o.selector,n.uri,n.languageId,ky(e),n.notebookUri,n.notebookType),_Qe(o.selector)&&o._score>0)if(t)o._score=0;else{for(const r of this._entries)r._score=0;o._score=1e3;break}this._entries.sort(oo._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:tV(e.selector)&&!tV(t.selector)?1:!tV(e.selector)&&tV(t.selector)?-1:e._timet._time?-1:0}}function tV(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(tV):!!s.isBuiltin}class kyt{constructor(){this.referenceProvider=new oo(this._score.bind(this)),this.renameProvider=new oo(this._score.bind(this)),this.newSymbolNamesProvider=new oo(this._score.bind(this)),this.codeActionProvider=new oo(this._score.bind(this)),this.definitionProvider=new oo(this._score.bind(this)),this.typeDefinitionProvider=new oo(this._score.bind(this)),this.declarationProvider=new oo(this._score.bind(this)),this.implementationProvider=new oo(this._score.bind(this)),this.documentSymbolProvider=new oo(this._score.bind(this)),this.inlayHintsProvider=new oo(this._score.bind(this)),this.colorProvider=new oo(this._score.bind(this)),this.codeLensProvider=new oo(this._score.bind(this)),this.documentFormattingEditProvider=new oo(this._score.bind(this)),this.documentRangeFormattingEditProvider=new oo(this._score.bind(this)),this.onTypeFormattingEditProvider=new oo(this._score.bind(this)),this.signatureHelpProvider=new oo(this._score.bind(this)),this.hoverProvider=new oo(this._score.bind(this)),this.documentHighlightProvider=new oo(this._score.bind(this)),this.multiDocumentHighlightProvider=new oo(this._score.bind(this)),this.selectionRangeProvider=new oo(this._score.bind(this)),this.foldingRangeProvider=new oo(this._score.bind(this)),this.linkProvider=new oo(this._score.bind(this)),this.inlineCompletionsProvider=new oo(this._score.bind(this)),this.inlineEditProvider=new oo(this._score.bind(this)),this.completionProvider=new oo(this._score.bind(this)),this.linkedEditingRangeProvider=new oo(this._score.bind(this)),this.inlineValuesProvider=new oo(this._score.bind(this)),this.evaluatableExpressionProvider=new oo(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new oo(this._score.bind(this)),this.documentSemanticTokensProvider=new oo(this._score.bind(this)),this.documentDropEditProvider=new oo(this._score.bind(this)),this.documentPasteEditProvider=new oo(this._score.bind(this)),this.mappedEditsProvider=new oo(this._score.bind(this))}setNotebookTypeResolver(e){this._notebookTypeResolver=e}_score(e){return this._notebookTypeResolver?.(e)}}ce(it,kyt,qt.Delayed);const ec=ae("hoverService"),gf=ae("contextViewService"),lr=ae("contextMenuService");var Iyt='.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}';ut(Iyt,{});var Tyt='.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 .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);text-decoration:var(--text-link-decoration)}.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 .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.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}';ut(Tyt,{});const VG=fe;var vo;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BELOW=2]="BELOW",s[s.ABOVE=3]="ABOVE"})(vo||(vo={}));let dLe=class extends V{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 wU(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class hLe extends V{static render(e,t,i){return new hLe(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=re(e,VG("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=re(this.actionContainer,VG("a.action")),this.action.setAttribute("role","button"),t.iconClass&&re(this.action,VG(`span.icon.${t.iconClass}`));const n=re(this.action,VG("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new bQe(this.actionContainer,t.run)),this._store.add(new wQe(this.actionContainer,t.run,[S.Enter,S.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 vQe(s,e){return s&&e?g(6985,"Inspect this in the accessible view with {0}.",e):s?g(6986,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class bQe extends V{constructor(e,t){super(),this._register(ue(e,ke.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class wQe extends V{constructor(e,t,i){super(),this._register(ue(e,ke.KEY_DOWN,n=>{const o=new En(n);i.some(r=>o.equals(r))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}var Ld;(function(s){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}}s.intersect=e;function t(o){return o.end-o.start<=0}s.isEmpty=t;function i(o,r){return!t(e(o,r))}s.intersects=i;function n(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}s.relativeComplement=n})(Ld||(Ld={}));var Lyt=".context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}";ut(Lyt,{});var Hw;(function(s){s[s.ABSOLUTE=1]="ABSOLUTE",s[s.FIXED=2]="FIXED",s[s.FIXED_SHADOW=3]="FIXED_SHADOW"})(Hw||(Hw={}));function Ryt(s){const e=s;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var pb;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(pb||(pb={}));var Wf;(function(s){s[s.BELOW=0]="BELOW",s[s.ABOVE=1]="ABOVE"})(Wf||(Wf={}));var RY;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(RY||(RY={}));var Tf;(function(s){s[s.Before=0]="Before",s[s.After=1]="After"})(Tf||(Tf={}));var Cx;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})(Cx||(Cx={}));function sF(s,e,t){const i=t.mode===Cx.ALIGN?t.offset:t.offset+t.size,n=t.mode===Cx.ALIGN?t.offset+t.size:t.offset;return t.position===Tf.Before?e<=s-i?i:e<=n?n-e:Math.max(s-e,0):e<=n?n-e:e<=s-i?i:0}const GF=class GF extends V{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=V.None,this.toDisposeOnSetContainer=V.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=fe(".context-view"),Ud(this.view),this.setContainer(e,t),this._register(Ee(()=>this.setContainer(null,Hw.ABSOLUTE)))}setContainer(e,t){this.useFixedPosition=t!==Hw.ABSOLUTE;const i=this.useShadowDOM;if(this.useShadowDOM=t===Hw.FIXED_SHADOW,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=fe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=Myt,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(fe("slot"))}else this.container.appendChild(this.view);const n=new Z;GF.BUBBLE_UP_EVENTS.forEach(o=>{n.add(Ro(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),GF.BUBBLE_DOWN_EVENTS.forEach(o=>{n.add(Ro(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),Ms(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",jh(this.view),this.toDisposeOnClean=e.render(this.view)||V.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(am&&AO.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Yr(e)){const u=Cr(e),f=NGe(e);t={top:u.top*f,left:u.left*f,width:u.width*f,height:u.height*f}}else Ryt(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=Md(this.view),n=hb(this.view),o=this.delegate.anchorPosition||Wf.BELOW,r=this.delegate.anchorAlignment||pb.LEFT,a=this.delegate.anchorAxisAlignment||RY.VERTICAL;let c,l;const d=Ey();if(a===RY.VERTICAL){const u={offset:t.top-d.pageYOffset,size:t.height,position:o===Wf.BELOW?Tf.Before:Tf.After},f={offset:t.left,size:t.width,position:r===pb.LEFT?Tf.Before:Tf.After,mode:Cx.ALIGN};c=sF(d.innerHeight,n,u)+d.pageYOffset,Ld.intersects({start:c,end:c+n},{start:u.offset,end:u.offset+u.size})&&(f.mode=Cx.AVOID),l=sF(d.innerWidth,i,f)}else{const u={offset:t.left,size:t.width,position:r===pb.LEFT?Tf.Before:Tf.After},f={offset:t.top,size:t.height,position:o===Wf.BELOW?Tf.Before:Tf.After,mode:Cx.ALIGN};l=sF(d.innerWidth,i,u),Ld.intersects({start:l,end:l+i},{start:u.offset,end:u.offset+u.size})&&(f.mode=Cx.AVOID),c=sF(d.innerHeight,n,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===Wf.BELOW?"bottom":"top"),this.view.classList.add(r===pb.LEFT?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=Cr(this.container);this.view.style.top=`${c-(this.useFixedPosition?Cr(this.view).top:h.top)}px`,this.view.style.left=`${l-(this.useFixedPosition?Cr(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(),Ud(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,ct(e).document.activeElement):t&&!wc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};GF.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],GF.BUBBLE_DOWN_EVENTS=["click"];let Tme=GF;const Myt=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -157,18 +157,18 @@ Received: '{1}'.`,e,e4.getLexeme(t)),o=t.offset,r=e4.getLexeme(t);return this._p :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :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; } -`,Ao=ae("openerService");function Gyt(s,e={}){const t=ELe(e);return t.textContent=s,t}function ALe(s,e={}){const t=ELe(e);return IQe(t,qyt(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function ELe(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class Kyt{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 ma;(function(s){s[s.Invalid=0]="Invalid",s[s.Root=1]="Root",s[s.Text=2]="Text",s[s.Bold=3]="Bold",s[s.Italics=4]="Italics",s[s.Action=5]="Action",s[s.ActionClose=6]="ActionClose",s[s.Code=7]="Code",s[s.NewLine=8]="NewLine"})(ma||(ma={}));function IQe(s,e,t,i){let n;if(e.type===ma.Text)n=document.createTextNode(e.content||"");else if(e.type===ma.Bold)n=document.createElement("b");else if(e.type===ma.Italics)n=document.createElement("i");else if(e.type===ma.Code&&i)n=document.createElement("code");else if(e.type===ma.Action&&t){const o=document.createElement("a");t.disposables.add(Ro(o,"click",r=>{t.callback(String(e.index),r)})),n=o}else e.type===ma.NewLine?n=document.createElement("br"):e.type===ma.Root&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(o=>{IQe(n,o,t,i)})}function qyt(s,e){const t={type:ma.Root,children:[]};let i=0,n=t;const o=[],r=new Kyt(s);for(;!r.eos();){let a=r.next();const c=a==="\\"&&Ome(r.peek(),e)!==ma.Invalid;if(c&&(a=r.next()),!c&&Qyt(a,e)&&a===r.peek()){r.advance(),n.type===ma.Text&&(n=o.pop());const l=Ome(a,e);if(n.type===l||n.type===ma.Action&&l===ma.ActionClose)n=o.pop();else{const d={type:l,children:[]};l===ma.Action&&(d.index=i,i++),n.children.push(d),o.push(n),n=d}}else if(a===` -`)n.type===ma.Text&&(n=o.pop()),n.children.push({type:ma.NewLine});else if(n.type!==ma.Text){const l={type:ma.Text,content:a};n.children.push(l),o.push(n),n=l}else n.content+=a}return n.type===ma.Text&&(n=o.pop()),t}function Qyt(s,e){return Ome(s,e)!==ma.Invalid}function Ome(s,e){switch(s){case"*":return ma.Bold;case"_":return ma.Italics;case"[":return ma.Action;case"]":return ma.ActionClose;case"`":return e?ma.Code:ma.Invalid;default:return ma.Invalid}}const jyt=new RegExp(`(\\\\)?\\$\\((${We.iconNameExpression}(?:${We.iconModifierExpression})?)\\)`,"g");function Eb(s){const e=new Array;let t,i=0,n=0;for(;(t=jyt.exec(s))!==null;){n=t.index||0,i0)return new Uint32Array(e)}let If=0;const ZE=new Uint32Array(10);function Jyt(s){if(If=0,qb(s,hhe,Bl.InitialConsonant),If>0||(qb(s,uhe,Bl.Vowel),If>0)||(qb(s,ghe,Bl.FinalConsonant),If>0)||(qb(s,OI,Bl.CompatibilityJamo),If))return ZE.subarray(0,If);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),o=t%28-1;if(i=0&&(o0)return ZE.subarray(0,If)}}function qb(s,e,t){s>=t&&s>8&&(ZE[If++]=s>>8&255),s>>16&&(ZE[If++]=s>>16&255))}var Bl;(function(s){s[s.InitialConsonant=4352]="InitialConsonant",s[s.Vowel=4449]="Vowel",s[s.FinalConsonant=4520]="FinalConsonant",s[s.CompatibilityJamo=12593]="CompatibilityJamo"})(Bl||(Bl={}));var $t;(function(s){s[s.NUL=0]="NUL",s[s.A=65]="A",s[s.B=66]="B",s[s.C=67]="C",s[s.D=68]="D",s[s.E=69]="E",s[s.F=70]="F",s[s.G=71]="G",s[s.H=72]="H",s[s.I=73]="I",s[s.J=74]="J",s[s.K=75]="K",s[s.L=76]="L",s[s.M=77]="M",s[s.N=78]="N",s[s.O=79]="O",s[s.P=80]="P",s[s.Q=81]="Q",s[s.R=82]="R",s[s.S=83]="S",s[s.T=84]="T",s[s.U=85]="U",s[s.V=86]="V",s[s.W=87]="W",s[s.X=88]="X",s[s.Y=89]="Y",s[s.Z=90]="Z",s[s.a=97]="a",s[s.b=98]="b",s[s.c=99]="c",s[s.d=100]="d",s[s.e=101]="e",s[s.f=102]="f",s[s.g=103]="g",s[s.h=104]="h",s[s.i=105]="i",s[s.j=106]="j",s[s.k=107]="k",s[s.l=108]="l",s[s.m=109]="m",s[s.n=110]="n",s[s.o=111]="o",s[s.p=112]="p",s[s.q=113]="q",s[s.r=114]="r",s[s.s=115]="s",s[s.t=116]="t",s[s.u=117]="u",s[s.v=118]="v",s[s.w=119]="w",s[s.x=120]="x",s[s.y=121]="y",s[s.z=122]="z"})($t||($t={}));var co;(function(s){s[s.fa=24934]="fa",s[s.fg=26470]="fg",s[s.fq=29030]="fq",s[s.fr=29286]="fr",s[s.ft=29798]="ft",s[s.fv=30310]="fv",s[s.fx=30822]="fx",s[s.hk=27496]="hk",s[s.hl=27752]="hl",s[s.ho=28520]="ho",s[s.ml=27757]="ml",s[s.nj=27246]="nj",s[s.nl=27758]="nl",s[s.np=28782]="np",s[s.qt=29809]="qt",s[s.rt=29810]="rt",s[s.sg=26483]="sg",s[s.sw=30579]="sw"})(co||(co={}));const hhe=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]),uhe=new Uint16Array([$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,co.hk,co.ho,co.hl,$t.y,$t.n,co.nj,co.np,co.nl,$t.b,$t.m,co.ml,$t.l]),ghe=new Uint16Array([$t.r,$t.R,co.rt,$t.s,co.sw,co.sg,$t.e,$t.f,co.fr,co.fa,co.fq,co.ft,co.fx,co.fv,co.fg,$t.a,$t.q,co.qt,$t.t,$t.T,$t.d,$t.w,$t.c,$t.z,$t.x,$t.v,$t.g]),OI=new Uint16Array([$t.r,$t.R,co.rt,$t.s,co.sw,co.sg,$t.e,$t.E,$t.f,co.fr,co.fa,co.fq,co.ft,co.fx,co.fv,co.fg,$t.a,$t.q,$t.Q,co.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,co.hk,co.ho,co.hl,$t.y,$t.n,co.nj,co.np,co.nl,$t.b,$t.m,co.ml,$t.l]);function q2(...s){return function(e,t){for(let i=0,n=s.length;i0?[{start:0,end:e.length}]:[]:null}function lae(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function LQe(s,e){return Bme(s.toLowerCase(),e.toLowerCase(),0,0)}function Bme(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=Bme(s,e,t+1,i+1))?kLe({start:i,end:i+1},n):null}return Bme(s,e,t,i+1)}function xLe(s){return B.a<=s&&s<=B.z}function g6(s){return B.A<=s&&s<=B.Z}function DLe(s){return B.Digit0<=s&&s<=B.Digit9}function RQe(s){return s===B.Space||s===B.Tab||s===B.LineFeed||s===B.CarriageReturn}const MQe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>MQe.add(s.charCodeAt(0)));function PY(s){return RQe(s)||MQe.has(s)}function c2e(s,e){return s===e||PY(s)&&PY(e)}const fhe=new Map;function l2e(s){if(fhe.has(s))return fhe.get(s);let e;const t=Yyt(s);return t&&(e=t),fhe.set(s,e),e}function NQe(s){return xLe(s)||g6(s)||DLe(s)}function kLe(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function PQe(s,e){for(let t=e;t0&&!NQe(s.charCodeAt(t-1)))return t}return s.length}function Wme(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,o=i+1;for(n=Wme(s,e,t+1,i+1);!n&&(o=PQe(e,o)).6}function tCt(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function iCt(s){let e=0,t=0,i=0,n=0;for(let o=0;o60&&(e=e.substring(0,60));const t=Zyt(e);if(!tCt(t)){if(!eCt(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n0&&PY(s.charCodeAt(t-1)))return t;return s.length}const nCt=q2(CM,FY,lae),sCt=q2(CM,FY,LQe),d2e=new um(1e4);function OY(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=d2e.get(s);i||(i=new RegExp(lat(s),"i"),d2e.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?sCt(s,e):nCt(s,e)}function OQe(s,e){const t=Uk(s,s.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?xU(t):null}function oCt(s,e,t,i,n,o){const r=Math.min(13,s.length);for(;t"u")return[];const e=[],t=s[1];for(let i=s.length-1;i>1;i--){const n=s[i]+t,o=e[e.length-1];o&&o.end===n?o.end=n+1:e.push({start:n,end:n+1})}return e}const xx=128;function ILe(){const s=[],e=[];for(let t=0;t<=xx;t++)e[t]=0;for(let t=0;t<=xx;t++)s.push(e.slice(0));return s}function BQe(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const WQe=BQe(2*xx),Ume=BQe(2*xx),bC=ILe(),BI=ILe(),KG=ILe();function qG(s,e){if(e<0||e>=s.length)return!1;const t=s.codePointAt(e);switch(t){case B.Underline:case B.Dash:case B.Period:case B.Space:case B.Slash:case B.Backslash:case B.SingleQuote:case B.DoubleQuote:case B.Colon:case B.DollarSign:case B.LessThan:case B.GreaterThan:case B.OpenParen:case B.CloseParen:case B.OpenSquareBracket:case B.CloseSquareBracket:case B.OpenCurlyBrace:case B.CloseCurlyBrace:return!0;case void 0:return!1;default:return!!Z1e(t)}}function h2e(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case B.Space:case B.Tab:return!0;default:return!1}}function Rq(s,e,t){return e[s]!==t[s]}function HQe(s,e,t,i,n,o,r=!1){for(;exx?xx:s.length,c=i.length>xx?xx:i.length;if(t>=a||o>=c||a-t>c-o||!HQe(e,t,a,n,o,c,!0))return;rCt(a,c,t,o,e,n);let l=1,d=1,h=t,u=o;const f=[!1];for(l=1,h=t;hw,R=P?BI[l][d-1]+(bC[l][d-1]>0?-5:0):0,z=u>w+1&&bC[l][d-1]>0,G=z?BI[l][d-2]+(bC[l][d-2]>0?-5:0):0;if(z&&(!P||G>=R)&&(!L||G>=k))BI[l][d]=G,KG[l][d]=q0.LeftLeft,bC[l][d]=0;else if(P&&(!L||R>=k))BI[l][d]=R,KG[l][d]=q0.Left,bC[l][d]=0;else if(L)BI[l][d]=k,KG[l][d]=q0.Diag,bC[l][d]=bC[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;l--,d--;const p=[BI[l][d],o];let m=0,v=0;for(;l>=1;){let w=d;do{const y=KG[l][w];if(y===q0.LeftLeft)w=w-2;else if(y===q0.Left)w=w-1;else break}while(w>=1);m>1&&e[t+l-1]===n[o+d-1]&&!Rq(w+o-1,i,n)&&m+1>bC[l][w]&&(w=d),w===d?m++:m=1,v||(v=w),l--,d=w-1,p.push(d)}c-o===a&&r.boostFullMatch&&(p[0]+=2);const b=v-a;return p[0]-=b,p}function rCt(s,e,t,i,n,o){let r=s-1,a=e-1;for(;r>=t&&a>=i;)n[r]===o[a]&&(Ume[r]=a,r--),a--}function aCt(s,e,t,i,n,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=s[t]===n[r]?7:5:Rq(r,n,o)&&(r===0||!Rq(r-1,n,o))?(h=s[t]===n[r]?7:5,u=!0):qG(o,r)&&(r===0||!qG(o,r-1))?h=5:(qG(o,r-1)||h2e(o,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=Rq(r,n,o)||qG(o,r-1)||h2e(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 cCt(s,e,t,i,n,o,r){return lCt(s,e,t,i,n,o,!0,r)}function lCt(s,e,t,i,n,o,r,a){let c=Uk(s,e,t,i,n,o,a);if(c&&!r)return c;if(s.length>=3){const l=Math.min(7,s.length-1);for(let d=t+1;dc[0])&&(c=u))}}}return c}function dCt(s,e){if(e+1>=s.length)return;const t=s[e],i=s[e+1];if(t!==i)return s.slice(0,e)+i+t+s.slice(e+2)}const hCt="$(",TLe=new RegExp(`\\$\\(${We.iconNameExpression}(?:${We.iconModifierExpression})?\\)`,"g"),uCt=new RegExp(`(\\\\)?${TLe.source}`,"g");function gCt(s){return s.replace(uCt,(e,t)=>t?e:`\\${e}`)}const fCt=new RegExp(`\\\\${TLe.source}`,"g");function pCt(s){return s.replace(fCt,e=>`\\${e}`)}const mCt=new RegExp(`(\\s)?(\\\\)?${TLe.source}(\\s)?`,"g");function dae(s){return s.indexOf(hCt)===-1?s:s.replace(mCt,(e,t,i,n)=>i?e:t||n||"")}function UQe(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const phe=new RegExp(`\\$\\(${We.iconNameCharacter}+\\)`,"g");function lF(s){phe.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=phe.lastIndex,o=phe.exec(s),r=s.substring(n,o?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===BY.Break?`\\ +`,Ao=ae("openerService");function Nyt(s,e={}){const t=gLe(e);return t.textContent=s,t}function uLe(s,e={}){const t=gLe(e);return yQe(t,Fyt(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function gLe(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class Pyt{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 ma;(function(s){s[s.Invalid=0]="Invalid",s[s.Root=1]="Root",s[s.Text=2]="Text",s[s.Bold=3]="Bold",s[s.Italics=4]="Italics",s[s.Action=5]="Action",s[s.ActionClose=6]="ActionClose",s[s.Code=7]="Code",s[s.NewLine=8]="NewLine"})(ma||(ma={}));function yQe(s,e,t,i){let n;if(e.type===ma.Text)n=document.createTextNode(e.content||"");else if(e.type===ma.Bold)n=document.createElement("b");else if(e.type===ma.Italics)n=document.createElement("i");else if(e.type===ma.Code&&i)n=document.createElement("code");else if(e.type===ma.Action&&t){const o=document.createElement("a");t.disposables.add(Ro(o,"click",r=>{t.callback(String(e.index),r)})),n=o}else e.type===ma.NewLine?n=document.createElement("br"):e.type===ma.Root&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(o=>{yQe(n,o,t,i)})}function Fyt(s,e){const t={type:ma.Root,children:[]};let i=0,n=t;const o=[],r=new Pyt(s);for(;!r.eos();){let a=r.next();const c=a==="\\"&&Lme(r.peek(),e)!==ma.Invalid;if(c&&(a=r.next()),!c&&Oyt(a,e)&&a===r.peek()){r.advance(),n.type===ma.Text&&(n=o.pop());const l=Lme(a,e);if(n.type===l||n.type===ma.Action&&l===ma.ActionClose)n=o.pop();else{const d={type:l,children:[]};l===ma.Action&&(d.index=i,i++),n.children.push(d),o.push(n),n=d}}else if(a===` +`)n.type===ma.Text&&(n=o.pop()),n.children.push({type:ma.NewLine});else if(n.type!==ma.Text){const l={type:ma.Text,content:a};n.children.push(l),o.push(n),n=l}else n.content+=a}return n.type===ma.Text&&(n=o.pop()),t}function Oyt(s,e){return Lme(s,e)!==ma.Invalid}function Lme(s,e){switch(s){case"*":return ma.Bold;case"_":return ma.Italics;case"[":return ma.Action;case"]":return ma.ActionClose;case"`":return e?ma.Code:ma.Invalid;default:return ma.Invalid}}const Byt=new RegExp(`(\\\\)?\\$\\((${We.iconNameExpression}(?:${We.iconModifierExpression})?)\\)`,"g");function Cb(s){const e=new Array;let t,i=0,n=0;for(;(t=Byt.exec(s))!==null;){n=t.index||0,i0)return new Uint32Array(e)}let xf=0;const YE=new Uint32Array(10);function Hyt(s){if(xf=0,$b(s,she,Ol.InitialConsonant),xf>0||($b(s,ohe,Ol.Vowel),xf>0)||($b(s,rhe,Ol.FinalConsonant),xf>0)||($b(s,LI,Ol.CompatibilityJamo),xf))return YE.subarray(0,xf);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),o=t%28-1;if(i=0&&(o0)return YE.subarray(0,xf)}}function $b(s,e,t){s>=t&&s>8&&(YE[xf++]=s>>8&255),s>>16&&(YE[xf++]=s>>16&255))}var Ol;(function(s){s[s.InitialConsonant=4352]="InitialConsonant",s[s.Vowel=4449]="Vowel",s[s.FinalConsonant=4520]="FinalConsonant",s[s.CompatibilityJamo=12593]="CompatibilityJamo"})(Ol||(Ol={}));var $t;(function(s){s[s.NUL=0]="NUL",s[s.A=65]="A",s[s.B=66]="B",s[s.C=67]="C",s[s.D=68]="D",s[s.E=69]="E",s[s.F=70]="F",s[s.G=71]="G",s[s.H=72]="H",s[s.I=73]="I",s[s.J=74]="J",s[s.K=75]="K",s[s.L=76]="L",s[s.M=77]="M",s[s.N=78]="N",s[s.O=79]="O",s[s.P=80]="P",s[s.Q=81]="Q",s[s.R=82]="R",s[s.S=83]="S",s[s.T=84]="T",s[s.U=85]="U",s[s.V=86]="V",s[s.W=87]="W",s[s.X=88]="X",s[s.Y=89]="Y",s[s.Z=90]="Z",s[s.a=97]="a",s[s.b=98]="b",s[s.c=99]="c",s[s.d=100]="d",s[s.e=101]="e",s[s.f=102]="f",s[s.g=103]="g",s[s.h=104]="h",s[s.i=105]="i",s[s.j=106]="j",s[s.k=107]="k",s[s.l=108]="l",s[s.m=109]="m",s[s.n=110]="n",s[s.o=111]="o",s[s.p=112]="p",s[s.q=113]="q",s[s.r=114]="r",s[s.s=115]="s",s[s.t=116]="t",s[s.u=117]="u",s[s.v=118]="v",s[s.w=119]="w",s[s.x=120]="x",s[s.y=121]="y",s[s.z=122]="z"})($t||($t={}));var co;(function(s){s[s.fa=24934]="fa",s[s.fg=26470]="fg",s[s.fq=29030]="fq",s[s.fr=29286]="fr",s[s.ft=29798]="ft",s[s.fv=30310]="fv",s[s.fx=30822]="fx",s[s.hk=27496]="hk",s[s.hl=27752]="hl",s[s.ho=28520]="ho",s[s.ml=27757]="ml",s[s.nj=27246]="nj",s[s.nl=27758]="nl",s[s.np=28782]="np",s[s.qt=29809]="qt",s[s.rt=29810]="rt",s[s.sg=26483]="sg",s[s.sw=30579]="sw"})(co||(co={}));const she=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]),ohe=new Uint16Array([$t.k,$t.o,$t.i,$t.O,$t.j,$t.p,$t.u,$t.P,$t.h,co.hk,co.ho,co.hl,$t.y,$t.n,co.nj,co.np,co.nl,$t.b,$t.m,co.ml,$t.l]),rhe=new Uint16Array([$t.r,$t.R,co.rt,$t.s,co.sw,co.sg,$t.e,$t.f,co.fr,co.fa,co.fq,co.ft,co.fx,co.fv,co.fg,$t.a,$t.q,co.qt,$t.t,$t.T,$t.d,$t.w,$t.c,$t.z,$t.x,$t.v,$t.g]),LI=new Uint16Array([$t.r,$t.R,co.rt,$t.s,co.sw,co.sg,$t.e,$t.E,$t.f,co.fr,co.fa,co.fq,co.ft,co.fx,co.fv,co.fg,$t.a,$t.q,$t.Q,co.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,co.hk,co.ho,co.hl,$t.y,$t.n,co.nj,co.np,co.nl,$t.b,$t.m,co.ml,$t.l]);function z2(...s){return function(e,t){for(let i=0,n=s.length;i0?[{start:0,end:e.length}]:[]:null}function oae(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function SQe(s,e){return Rme(s.toLowerCase(),e.toLowerCase(),0,0)}function Rme(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=Rme(s,e,t+1,i+1))?mLe({start:i,end:i+1},n):null}return Rme(s,e,t,i+1)}function fLe(s){return B.a<=s&&s<=B.z}function l6(s){return B.A<=s&&s<=B.Z}function pLe(s){return B.Digit0<=s&&s<=B.Digit9}function AQe(s){return s===B.Space||s===B.Tab||s===B.LineFeed||s===B.CarriageReturn}const EQe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>EQe.add(s.charCodeAt(0)));function MY(s){return AQe(s)||EQe.has(s)}function YBe(s,e){return s===e||MY(s)&&MY(e)}const ahe=new Map;function JBe(s){if(ahe.has(s))return ahe.get(s);let e;const t=Wyt(s);return t&&(e=t),ahe.set(s,e),e}function xQe(s){return fLe(s)||l6(s)||pLe(s)}function mLe(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function DQe(s,e){for(let t=e;t0&&!xQe(s.charCodeAt(t-1)))return t}return s.length}function Mme(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,o=i+1;for(n=Mme(s,e,t+1,i+1);!n&&(o=DQe(e,o)).6}function $yt(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function Gyt(s){let e=0,t=0,i=0,n=0;for(let o=0;o60&&(e=e.substring(0,60));const t=Vyt(e);if(!$yt(t)){if(!zyt(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n0&&MY(s.charCodeAt(t-1)))return t;return s.length}const Kyt=z2(vM,NY,oae),qyt=z2(vM,NY,SQe),XBe=new lm(1e4);function PY(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=XBe.get(s);i||(i=new RegExp(Xrt(s),"i"),XBe.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?qyt(s,e):Kyt(s,e)}function IQe(s,e){const t=Fk(s,s.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?yU(t):null}function Qyt(s,e,t,i,n,o){const r=Math.min(13,s.length);for(;t"u")return[];const e=[],t=s[1];for(let i=s.length-1;i>1;i--){const n=s[i]+t,o=e[e.length-1];o&&o.end===n?o.end=n+1:e.push({start:n,end:n+1})}return e}const Sx=128;function _Le(){const s=[],e=[];for(let t=0;t<=Sx;t++)e[t]=0;for(let t=0;t<=Sx;t++)s.push(e.slice(0));return s}function TQe(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const LQe=TQe(2*Sx),Pme=TQe(2*Sx),pC=_Le(),RI=_Le(),zG=_Le();function $G(s,e){if(e<0||e>=s.length)return!1;const t=s.codePointAt(e);switch(t){case B.Underline:case B.Dash:case B.Period:case B.Space:case B.Slash:case B.Backslash:case B.SingleQuote:case B.DoubleQuote:case B.Colon:case B.DollarSign:case B.LessThan:case B.GreaterThan:case B.OpenParen:case B.CloseParen:case B.OpenSquareBracket:case B.CloseSquareBracket:case B.OpenCurlyBrace:case B.CloseCurlyBrace:return!0;case void 0:return!1;default:return!!U1e(t)}}function ZBe(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case B.Space:case B.Tab:return!0;default:return!1}}function Tq(s,e,t){return e[s]!==t[s]}function RQe(s,e,t,i,n,o,r=!1){for(;eSx?Sx:s.length,c=i.length>Sx?Sx:i.length;if(t>=a||o>=c||a-t>c-o||!RQe(e,t,a,n,o,c,!0))return;jyt(a,c,t,o,e,n);let l=1,d=1,h=t,u=o;const f=[!1];for(l=1,h=t;hw,R=P?RI[l][d-1]+(pC[l][d-1]>0?-5:0):0,z=u>w+1&&pC[l][d-1]>0,G=z?RI[l][d-2]+(pC[l][d-2]>0?-5:0):0;if(z&&(!P||G>=R)&&(!L||G>=k))RI[l][d]=G,zG[l][d]=z0.LeftLeft,pC[l][d]=0;else if(P&&(!L||R>=k))RI[l][d]=R,zG[l][d]=z0.Left,pC[l][d]=0;else if(L)RI[l][d]=k,zG[l][d]=z0.Diag,pC[l][d]=pC[l-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;l--,d--;const p=[RI[l][d],o];let m=0,v=0;for(;l>=1;){let w=d;do{const y=zG[l][w];if(y===z0.LeftLeft)w=w-2;else if(y===z0.Left)w=w-1;else break}while(w>=1);m>1&&e[t+l-1]===n[o+d-1]&&!Tq(w+o-1,i,n)&&m+1>pC[l][w]&&(w=d),w===d?m++:m=1,v||(v=w),l--,d=w-1,p.push(d)}c-o===a&&r.boostFullMatch&&(p[0]+=2);const b=v-a;return p[0]-=b,p}function jyt(s,e,t,i,n,o){let r=s-1,a=e-1;for(;r>=t&&a>=i;)n[r]===o[a]&&(Pme[r]=a,r--),a--}function Yyt(s,e,t,i,n,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=s[t]===n[r]?7:5:Tq(r,n,o)&&(r===0||!Tq(r-1,n,o))?(h=s[t]===n[r]?7:5,u=!0):$G(o,r)&&(r===0||!$G(o,r-1))?h=5:($G(o,r-1)||ZBe(o,r-1))&&(h=5,u=!0),h>1&&t===i&&(d[0]=!0),u||(u=Tq(r,n,o)||$G(o,r-1)||ZBe(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 Jyt(s,e,t,i,n,o,r){return Xyt(s,e,t,i,n,o,!0,r)}function Xyt(s,e,t,i,n,o,r,a){let c=Fk(s,e,t,i,n,o,a);if(c&&!r)return c;if(s.length>=3){const l=Math.min(7,s.length-1);for(let d=t+1;dc[0])&&(c=u))}}}return c}function Zyt(s,e){if(e+1>=s.length)return;const t=s[e],i=s[e+1];if(t!==i)return s.slice(0,e)+i+t+s.slice(e+2)}const eCt="$(",vLe=new RegExp(`\\$\\(${We.iconNameExpression}(?:${We.iconModifierExpression})?\\)`,"g"),tCt=new RegExp(`(\\\\)?${vLe.source}`,"g");function iCt(s){return s.replace(tCt,(e,t)=>t?e:`\\${e}`)}const nCt=new RegExp(`\\\\${vLe.source}`,"g");function sCt(s){return s.replace(nCt,e=>`\\${e}`)}const oCt=new RegExp(`(\\s)?(\\\\)?${vLe.source}(\\s)?`,"g");function rae(s){return s.indexOf(eCt)===-1?s:s.replace(oCt,(e,t,i,n)=>i?e:t||n||"")}function MQe(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const che=new RegExp(`\\$\\(${We.iconNameCharacter}+\\)`,"g");function oF(s){che.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=che.lastIndex,o=che.exec(s),r=s.substring(n,o?.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===FY.Break?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` -${vCt(t,e)} -`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Rh(t),"g");return e.replace(i,(n,o)=>e.charAt(o-1)!=="\\"?`\\${n}`:n)}};function Q2(s){return dd(s)?!s.value:Array.isArray(s)?s.every(Q2):!0}function dd(s){return s instanceof Mt?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||typeof s.isTrusted=="object"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function _Ct(s,e){return s===e?!0:!s||!e?!1:s.value===e.value&&s.isTrusted===e.isTrusted&&s.supportThemeIcons===e.supportThemeIcons&&s.supportHtml===e.supportHtml&&(s.baseUri===e.baseUri||!!s.baseUri&&!!e.baseUri&&ji(N.from(s.baseUri),N.from(e.baseUri)))}function sV(s){return s.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function vCt(s,e){const t=s.match(/^`+/gm)?.reduce((n,o)=>n.length>o.length?n:o).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,s,`${"`".repeat(i)}`].join(` -`)}function QG(s){return s.replace(/"/g,""")}function mhe(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function VQe(s){const e=[],t=s.split("|").map(n=>n.trim());s=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=n?n[1]:"",a=o?o[1]:"",c=isFinite(parseInt(a)),l=isFinite(parseInt(r));c&&e.push(`width="${a}"`),l&&e.push(`height="${r}"`)}return{href:s,dimensions:e}}class DU{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const Vme=new DU("id#");var MN={exports:{}};function u2e(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function bCt(s){MN.exports.defaults=s}MN.exports={defaults:u2e(),getDefaults:u2e,changeDefaults:bCt};const wCt=/[&<>"']/,yCt=/[&<>"']/g,CCt=/[<>"']|&(?!#?\w+;)/,SCt=/[<>"']|&(?!#?\w+;)/g,ACt={"&":"&","<":"<",">":">",'"':""","'":"'"},g2e=s=>ACt[s];function ECt(s,e){if(e){if(wCt.test(s))return s.replace(yCt,g2e)}else if(CCt.test(s))return s.replace(SCt,g2e);return s}const xCt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function zQe(s){return s.replace(xCt,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const DCt=/(^|[^\[])\^/g;function kCt(s,e){s=s.source||s,e=e||"";const t={replace:(i,n)=>(n=n.source||n,n=n.replace(DCt,"$1"),s=s.replace(i,n),t),getRegex:()=>new RegExp(s,e)};return t}const ICt=/[^\w:]/g,TCt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function LCt(s,e,t){if(s){let i;try{i=decodeURIComponent(zQe(t)).replace(ICt,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!TCt.test(t)&&(t=$Qe(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const jG={},RCt=/^[^:]+:\/*[^/]*$/,MCt=/^([^:]+:)[\s\S]*$/,NCt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function $Qe(s,e){jG[" "+s]||(RCt.test(s)?jG[" "+s]=s+"/":jG[" "+s]=GQe(s,"/",!0)),s=jG[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(MCt,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(NCt,"$1")+e:s+e}const PCt={exec:function(){}};function FCt(s){let e=1,t,i;for(;e{let c=!1,l=r;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),i=t.split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i[i.length-1].trim()||i.pop(),i.length>e)i.splice(e);else for(;i.length1;)e&1&&(t+=s),e>>=1,s+=s;return t+s}var kU={escape:ECt,unescape:zQe,edit:kCt,cleanUrl:LCt,resolveUrl:$Qe,noopTest:PCt,merge:FCt,splitCells:OCt,rtrim:GQe,findClosingBracket:BCt,checkSanitizeDeprecation:WCt,repeatString:HCt};const{defaults:UCt}=MN.exports,{rtrim:_he,splitCells:f2e,escape:Vm,findClosingBracket:VCt}=kU;function p2e(s,e,t,i){const n=e.href,o=e.title?Vm(e.title):null,r=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){i.state.inLink=!0;const a={type:"link",raw:t,href:n,title:o,text:r,tokens:i.inlineTokens(r,[])};return i.state.inLink=!1,a}else return{type:"image",raw:t,href:n,title:o,text:Vm(r)}}function zCt(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const i=t[1];return e.split(` +${aCt(t,e)} +`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Th(t),"g");return e.replace(i,(n,o)=>e.charAt(o-1)!=="\\"?`\\${n}`:n)}};function $2(s){return cd(s)?!s.value:Array.isArray(s)?s.every($2):!0}function cd(s){return s instanceof Mt?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||typeof s.isTrusted=="object"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function rCt(s,e){return s===e?!0:!s||!e?!1:s.value===e.value&&s.isTrusted===e.isTrusted&&s.supportThemeIcons===e.supportThemeIcons&&s.supportHtml===e.supportHtml&&(s.baseUri===e.baseUri||!!s.baseUri&&!!e.baseUri&&ji(N.from(s.baseUri),N.from(e.baseUri)))}function iV(s){return s.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function aCt(s,e){const t=s.match(/^`+/gm)?.reduce((n,o)=>n.length>o.length?n:o).length??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,s,`${"`".repeat(i)}`].join(` +`)}function GG(s){return s.replace(/"/g,""")}function lhe(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function NQe(s){const e=[],t=s.split("|").map(n=>n.trim());s=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=n?n[1]:"",a=o?o[1]:"",c=isFinite(parseInt(a)),l=isFinite(parseInt(r));c&&e.push(`width="${a}"`),l&&e.push(`height="${r}"`)}return{href:s,dimensions:e}}class CU{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const Fme=new CU("id#");var IN={exports:{}};function e2e(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function cCt(s){IN.exports.defaults=s}IN.exports={defaults:e2e(),getDefaults:e2e,changeDefaults:cCt};const lCt=/[&<>"']/,dCt=/[&<>"']/g,hCt=/[<>"']|&(?!#?\w+;)/,uCt=/[<>"']|&(?!#?\w+;)/g,gCt={"&":"&","<":"<",">":">",'"':""","'":"'"},t2e=s=>gCt[s];function fCt(s,e){if(e){if(lCt.test(s))return s.replace(dCt,t2e)}else if(hCt.test(s))return s.replace(uCt,t2e);return s}const pCt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function PQe(s){return s.replace(pCt,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const mCt=/(^|[^\[])\^/g;function _Ct(s,e){s=s.source||s,e=e||"";const t={replace:(i,n)=>(n=n.source||n,n=n.replace(mCt,"$1"),s=s.replace(i,n),t),getRegex:()=>new RegExp(s,e)};return t}const vCt=/[^\w:]/g,bCt=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function wCt(s,e,t){if(s){let i;try{i=decodeURIComponent(PQe(t)).replace(vCt,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!bCt.test(t)&&(t=FQe(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const KG={},yCt=/^[^:]+:\/*[^/]*$/,CCt=/^([^:]+:)[\s\S]*$/,SCt=/^([^:]+:\/*[^/]*)[\s\S]*$/;function FQe(s,e){KG[" "+s]||(yCt.test(s)?KG[" "+s]=s+"/":KG[" "+s]=OQe(s,"/",!0)),s=KG[" "+s];const t=s.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:s.replace(CCt,"$1")+e:e.charAt(0)==="/"?t?e:s.replace(SCt,"$1")+e:s+e}const ACt={exec:function(){}};function ECt(s){let e=1,t,i;for(;e{let c=!1,l=r;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),i=t.split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i[i.length-1].trim()||i.pop(),i.length>e)i.splice(e);else for(;i.length1;)e&1&&(t+=s),e>>=1,s+=s;return t+s}var SU={escape:fCt,unescape:PQe,edit:_Ct,cleanUrl:wCt,resolveUrl:FQe,noopTest:ACt,merge:ECt,splitCells:xCt,rtrim:OQe,findClosingBracket:DCt,checkSanitizeDeprecation:kCt,repeatString:ICt};const{defaults:TCt}=IN.exports,{rtrim:dhe,splitCells:i2e,escape:Wm,findClosingBracket:LCt}=SU;function n2e(s,e,t,i){const n=e.href,o=e.title?Wm(e.title):null,r=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){i.state.inLink=!0;const a={type:"link",raw:t,href:n,title:o,text:r,tokens:i.inlineTokens(r,[])};return i.state.inLink=!1,a}else return{type:"image",raw:t,href:n,title:o,text:Wm(r)}}function RCt(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const i=t[1];return e.split(` `).map(n=>{const o=n.match(/^\s+/);if(o===null)return n;const[r]=o;return r.length>=i.length?n.slice(i.length):n}).join(` -`)}var KQe=class{constructor(e){this.options=e||UCt}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:` -`}}code(e){const t=this.rules.block.code.exec(e);if(t){const i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:_he(i,` -`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const i=t[0],n=zCt(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){const o=_he(i,"#");(this.options.pedantic||!o||/ $/.test(o))&&(i=o.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const i=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,n,o,r,a,c,l,d,h,u,f=t[1].trim();const p=f.length>1,m={type:"list",raw:"",ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]};f=p?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=p?f:"[*+-]");const v=new RegExp(`^( {0,3}${f})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!(this.rules.block.hr.test(e)||!(t=v.exec(e)));){h=t[2].split(` +`)}var BQe=class{constructor(e){this.options=e||TCt}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:` +`}}code(e){const t=this.rules.block.code.exec(e);if(t){const i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:dhe(i,` +`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const i=t[0],n=RCt(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){const o=dhe(i,"#");(this.options.pedantic||!o||/ $/.test(o))&&(i=o.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const i=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,n,o,r,a,c,l,d,h,u,f=t[1].trim();const p=f.length>1,m={type:"list",raw:"",ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]};f=p?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=p?f:"[*+-]");const v=new RegExp(`^( {0,3}${f})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!(this.rules.block.hr.test(e)||!(t=v.exec(e)));){h=t[2].split(` `),this.options.pedantic?(r=2,u=h[0].trimLeft()):(r=t[2].search(/[^ ]/),r=t[1].length+(r>4?1:r),u=h[0].slice(r-t[1].length)),c=!1,i=t[0],!h[0]&&/^ *$/.test(h[1])&&(i=t[1]+h.slice(0,2).join(` `)+` `,m.loose=!0,h=[]);const w=new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(a=1;a=r||!d.trim()){u+=` `+d.slice(r);continue}else{i=t[1]+h.slice(0,a).join(` `)+` -`;break}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(u),n&&(o=n[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:i,task:!!n,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 b=m.items.length;for(a=0;aw.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]):Vm(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:f2e(t[1]).map(n=>({text:n})),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 n=i.align.length,o,r,a,c;for(o=0;o({text:l}));for(n=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]):Vm(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=_he(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=VCt(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 n=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);r&&(n=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),p2e(t,{href:n&&n.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 n=(i[2]||i[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n||!n.href){const o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return p2e(i,n,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;const o=n[1]||n[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){const r=n[0].length-1;let a,c,l=r,d=0;const h=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(c=a.length,n[3]||n[4]){l+=c;continue}else if((n[5]||n[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+n.index+c);return{type:"em",raw:e.slice(0,r+n.index+c+1),text:f,tokens:this.lexer.inlineTokens(f,[])}}const u=e.slice(2,r+n.index+c-1);return{type:"strong",raw:e.slice(0,r+n.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 n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=Vm(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 n,o;return i[2]==="@"?(n=Vm(this.options.mangle?t(i[1]):i[1]),o="mailto:"+n):(n=Vm(i[1]),o=n),{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let n,o;if(i[2]==="@")n=Vm(this.options.mangle?t(i[0]):i[0]),o="mailto:"+n;else{let r;do r=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(r!==i[0]);n=Vm(i[0]),i[1]==="www."?o="http://"+n:o=n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let n;return this.lexer.state.inRawBlock?n=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Vm(i[0]):i[0]:n=Vm(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:n}}}};const{noopTest:WY,edit:uc,merge:NN}=kU,Ns={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:WY,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ns._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;Ns._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ns.def=uc(Ns.def).replace("label",Ns._label).replace("title",Ns._title).getRegex();Ns.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ns.listItemStart=uc(/^( *)(bull) */).replace("bull",Ns.bullet).getRegex();Ns.list=uc(Ns.list).replace(/bull/g,Ns.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ns.def.source+")").getRegex();Ns._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";Ns._comment=/|$)/;Ns.html=uc(Ns.html,"i").replace("comment",Ns._comment).replace("tag",Ns._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ns.paragraph=uc(Ns._paragraph).replace("hr",Ns.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",Ns._tag).getRegex();Ns.blockquote=uc(Ns.blockquote).replace("paragraph",Ns.paragraph).getRegex();Ns.normal=NN({},Ns);Ns.gfm=NN({},Ns.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});Ns.gfm.table=uc(Ns.gfm.table).replace("hr",Ns.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",Ns._tag).getRegex();Ns.pedantic=NN({},Ns.normal,{html:uc(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ns._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:WY,paragraph:uc(Ns.normal._paragraph).replace("hr",Ns.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Ns.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const tn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:WY,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:WY,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";tn.punctuation=uc(tn.punctuation).replace(/punctuation/g,tn._punctuation).getRegex();tn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;tn.escapedEmSt=/\\\*|\\_/g;tn._comment=uc(Ns._comment).replace("(?:-->|$)","-->").getRegex();tn.emStrong.lDelim=uc(tn.emStrong.lDelim).replace(/punct/g,tn._punctuation).getRegex();tn.emStrong.rDelimAst=uc(tn.emStrong.rDelimAst,"g").replace(/punct/g,tn._punctuation).getRegex();tn.emStrong.rDelimUnd=uc(tn.emStrong.rDelimUnd,"g").replace(/punct/g,tn._punctuation).getRegex();tn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;tn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;tn._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])?)+(?![-_])/;tn.autolink=uc(tn.autolink).replace("scheme",tn._scheme).replace("email",tn._email).getRegex();tn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;tn.tag=uc(tn.tag).replace("comment",tn._comment).replace("attribute",tn._attribute).getRegex();tn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;tn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;tn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;tn.link=uc(tn.link).replace("label",tn._label).replace("href",tn._href).replace("title",tn._title).getRegex();tn.reflink=uc(tn.reflink).replace("label",tn._label).getRegex();tn.reflinkSearch=uc(tn.reflinkSearch,"g").replace("reflink",tn.reflink).replace("nolink",tn.nolink).getRegex();tn.normal=NN({},tn);tn.pedantic=NN({},tn.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:uc(/^!?\[(label)\]\((.*?)\)/).replace("label",tn._label).getRegex(),reflink:uc(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tn._label).getRegex()});tn.gfm=NN({},tn.normal,{escape:uc(tn.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 QCt=class zme{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||KCt,this.options.tokenizer=this.options.tokenizer||new GCt,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:YG.normal,inline:p4.normal};this.options.pedantic?(t.block=YG.pedantic,t.inline=p4.pedantic):this.options.gfm&&(t.block=YG.gfm,this.options.breaks?t.inline=p4.breaks:t.inline=p4.gfm),this.tokenizer.rules=t}static get rules(){return{block:YG,inline:p4}}static lex(e,t){return new zme(t).lex(e)}static lexInline(e,t){return new zme(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` +`;break}}m.loose||(l?m.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(u),n&&(o=n[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),m.items.push({type:"list_item",raw:i,task:!!n,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 b=m.items.length;for(a=0;aw.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]):Wm(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:i2e(t[1]).map(n=>({text:n})),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 n=i.align.length,o,r,a,c;for(o=0;o({text:l}));for(n=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]):Wm(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=dhe(i.slice(0,-1),"\\");if((i.length-r.length)%2===0)return}else{const r=LCt(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 n=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);r&&(n=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(i)?n=n.slice(1):n=n.slice(1,-1)),n2e(t,{href:n&&n.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 n=(i[2]||i[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n||!n.href){const o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return n2e(i,n,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;const o=n[1]||n[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){const r=n[0].length-1;let a,c,l=r,d=0;const h=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+r);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(c=a.length,n[3]||n[4]){l+=c;continue}else if((n[5]||n[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+n.index+c);return{type:"em",raw:e.slice(0,r+n.index+c+1),text:f,tokens:this.lexer.inlineTokens(f,[])}}const u=e.slice(2,r+n.index+c-1);return{type:"strong",raw:e.slice(0,r+n.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 n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=Wm(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 n,o;return i[2]==="@"?(n=Wm(this.options.mangle?t(i[1]):i[1]),o="mailto:"+n):(n=Wm(i[1]),o=n),{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let n,o;if(i[2]==="@")n=Wm(this.options.mangle?t(i[0]):i[0]),o="mailto:"+n;else{let r;do r=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(r!==i[0]);n=Wm(i[0]),i[1]==="www."?o="http://"+n:o=n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let n;return this.lexer.state.inRawBlock?n=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Wm(i[0]):i[0]:n=Wm(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:n}}}};const{noopTest:OY,edit:uc,merge:TN}=SU,Ns={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:OY,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ns._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;Ns._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ns.def=uc(Ns.def).replace("label",Ns._label).replace("title",Ns._title).getRegex();Ns.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ns.listItemStart=uc(/^( *)(bull) */).replace("bull",Ns.bullet).getRegex();Ns.list=uc(Ns.list).replace(/bull/g,Ns.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ns.def.source+")").getRegex();Ns._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";Ns._comment=/|$)/;Ns.html=uc(Ns.html,"i").replace("comment",Ns._comment).replace("tag",Ns._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ns.paragraph=uc(Ns._paragraph).replace("hr",Ns.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",Ns._tag).getRegex();Ns.blockquote=uc(Ns.blockquote).replace("paragraph",Ns.paragraph).getRegex();Ns.normal=TN({},Ns);Ns.gfm=TN({},Ns.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});Ns.gfm.table=uc(Ns.gfm.table).replace("hr",Ns.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",Ns._tag).getRegex();Ns.pedantic=TN({},Ns.normal,{html:uc(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ns._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:OY,paragraph:uc(Ns.normal._paragraph).replace("hr",Ns.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Ns.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const tn={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:OY,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:OY,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";tn.punctuation=uc(tn.punctuation).replace(/punctuation/g,tn._punctuation).getRegex();tn.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;tn.escapedEmSt=/\\\*|\\_/g;tn._comment=uc(Ns._comment).replace("(?:-->|$)","-->").getRegex();tn.emStrong.lDelim=uc(tn.emStrong.lDelim).replace(/punct/g,tn._punctuation).getRegex();tn.emStrong.rDelimAst=uc(tn.emStrong.rDelimAst,"g").replace(/punct/g,tn._punctuation).getRegex();tn.emStrong.rDelimUnd=uc(tn.emStrong.rDelimUnd,"g").replace(/punct/g,tn._punctuation).getRegex();tn._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;tn._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;tn._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])?)+(?![-_])/;tn.autolink=uc(tn.autolink).replace("scheme",tn._scheme).replace("email",tn._email).getRegex();tn._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;tn.tag=uc(tn.tag).replace("comment",tn._comment).replace("attribute",tn._attribute).getRegex();tn._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;tn._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;tn._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;tn.link=uc(tn.link).replace("label",tn._label).replace("href",tn._href).replace("title",tn._title).getRegex();tn.reflink=uc(tn.reflink).replace("label",tn._label).getRegex();tn.reflinkSearch=uc(tn.reflinkSearch,"g").replace("reflink",tn.reflink).replace("nolink",tn.nolink).getRegex();tn.normal=TN({},tn);tn.pedantic=TN({},tn.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:uc(/^!?\[(label)\]\((.*?)\)/).replace("label",tn._label).getRegex(),reflink:uc(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tn._label).getRegex()});tn.gfm=TN({},tn.normal,{escape:uc(tn.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 OCt=class Ome{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||PCt,this.options.tokenizer=this.options.tokenizer||new NCt,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:qG.normal,inline:d4.normal};this.options.pedantic?(t.block=qG.pedantic,t.inline=d4.pedantic):this.options.gfm&&(t.block=qG.gfm,this.options.breaks?t.inline=d4.breaks:t.inline=d4.gfm),this.tokenizer.rules=t}static get rules(){return{block:qG,inline:d4}}static lex(e,t){return new Ome(t).lex(e)}static lexInline(e,t){return new Ome(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,n,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),n=t[t.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=` `+i.raw,n.text+=` `+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.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),n=t[t.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=` @@ -190,9 +190,9 @@ ${vCt(t,e)} `+i.raw,n.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),r=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&n.type==="text"?(n.raw+=` `+i.raw,n.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,n,o,r=e,a,c,l;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+m2e("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+m2e("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(i=d.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,r,l)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e,_2e)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,_2e))){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const h=e.slice(1);let u;this.options.extensions.startInline.forEach(function(f){u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(o=e.substring(0,d+1))}if(i=this.tokenizer.inlineText(o,qCt)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(l=i.raw.slice(-1)),c=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}};const{defaults:jCt}=MN.exports,{cleanUrl:v2e,escape:JG}=kU;var qQe=class{constructor(e){this.options=e||jCt}code(e,t,i){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(e,n);o!=null&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+` -`,n?'
    '+(i?e:JG(e,!0))+`
    -`:"
    "+(i?e:JG(e,!0))+`
    +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,n,o,r=e,a,c,l;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+s2e("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+s2e("a",a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(c||(l=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(i=d.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),n=t[t.length-1],n&&i.type==="text"&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,r,l)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e,o2e)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,o2e))){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const h=e.slice(1);let u;this.options.extensions.startInline.forEach(function(f){u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(d=Math.min(d,u))}),d<1/0&&d>=0&&(o=e.substring(0,d+1))}if(i=this.tokenizer.inlineText(o,FCt)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(l=i.raw.slice(-1)),c=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}};const{defaults:BCt}=IN.exports,{cleanUrl:r2e,escape:QG}=SU;var WQe=class{constructor(e){this.options=e||BCt}code(e,t,i){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(e,n);o!=null&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+` +`,n?'
    '+(i?e:QG(e,!0))+`
    +`:"
    "+(i?e:QG(e,!0))+`
    `}blockquote(e){return`
    `+e+`
    `}html(e){return e}heading(e,t,i,n){return this.options.headerIds?"'+e+" @@ -210,33 +210,33 @@ ${vCt(t,e)} `}tablerow(e){return` `+e+` `}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+" -`}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(e=v2e(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='",n}image(e,t,i){if(e=v2e(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n=''+i+'":">",n}text(e){return e}},QQe=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}},jQe=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do n++,i=e+"-"+n;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}};const YCt=qQe,JCt=QQe,XCt=jQe,{defaults:ZCt}=MN.exports,{unescape:eSt}=kU;var tSt=class $me{constructor(e){this.options=e||ZCt,this.options.renderer=this.options.renderer||new YCt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new JCt,this.slugger=new XCt}static parse(e,t){return new $me(t).parse(e)}static parseInline(e,t){return new $me(t).parseInline(e)}parse(e,t=!0){let i="",n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L;const k=e.length;for(n=0;n0&&w.tokens[0].type==="paragraph"?(w.tokens[0].text=A+" "+w.tokens[0].text,w.tokens[0].tokens&&w.tokens[0].tokens.length>0&&w.tokens[0].tokens[0].type==="text"&&(w.tokens[0].tokens[0].text=A+" "+w.tokens[0].tokens[0].text)):w.tokens.unshift({type:"text",text:A}):b+=A),b+=this.parse(w.tokens,v),u+=this.renderer.listitem(b,C,y);i+=this.renderer.list(u,p,m);continue}case"html":{i+=this.renderer.html(f.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case"text":{for(u=f.tokens?this.parseInline(f.tokens):f.text;n+1"u"||s===null)throw new Error("marked(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=hae({},Bs.defaults,e||{}),XQe(e),t){const i=e.highlight;let n;try{n=c3.lex(s,e)}catch(a){return t(a)}const o=function(a){let c;if(!a)try{e.walkTokens&&Bs.walkTokens(n,e.walkTokens),c=l3.parse(n,e)}catch(l){a=l}return e.highlight=i,a?t(a):t(null,c)};if(!i||i.length<3||(delete e.highlight,!n.length))return o();let r=0;Bs.walkTokens(n,function(a){a.type==="code"&&(r++,setTimeout(()=>{i(a.text,a.lang,function(c,l){if(c)return o(c);l!=null&&l!==a.text&&(a.text=l,a.escaped=!0),r--,r===0&&o()})},0))}),r===0&&o();return}try{const i=c3.lex(s,e);return e.walkTokens&&Bs.walkTokens(i,e.walkTokens),l3.parse(i,e)}catch(i){if(i.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+ZQe(i.message+"",!0)+"
    ";throw i}}Bs.options=Bs.setOptions=function(s){return hae(Bs.defaults,s),oSt(Bs.defaults),Bs};Bs.getDefaults=sSt;Bs.defaults=rSt;Bs.use=function(...s){const e=hae({},...s),t=Bs.defaults.extensions||{renderers:{},childTokens:{}};let i;s.forEach(n=>{if(n.extensions&&(i=!0,n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const r=t.renderers?t.renderers[o.name]:null;r?t.renderers[o.name]=function(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)})),n.renderer){const o=Bs.defaults.renderer||new JQe;for(const r in n.renderer){const a=o[r];o[r]=(...c)=>{let l=n.renderer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.renderer=o}if(n.tokenizer){const o=Bs.defaults.tokenizer||new YQe;for(const r in n.tokenizer){const a=o[r];o[r]=(...c)=>{let l=n.tokenizer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.tokenizer=o}if(n.walkTokens){const o=Bs.defaults.walkTokens;e.walkTokens=r=>{n.walkTokens.call(this,r),o&&o(r)}}i&&(e.extensions=t),Bs.setOptions(e)})};Bs.walkTokens=function(s,e){for(const t of s)switch(e(t),t.type){case"table":{for(const i of t.header)Bs.walkTokens(i.tokens,e);for(const i of t.rows)for(const n of i)Bs.walkTokens(n.tokens,e);break}case"list":{Bs.walkTokens(t.items,e);break}default:Bs.defaults.extensions&&Bs.defaults.extensions.childTokens&&Bs.defaults.extensions.childTokens[t.type]?Bs.defaults.extensions.childTokens[t.type].forEach(function(i){Bs.walkTokens(t[i],e)}):t.tokens&&Bs.walkTokens(t.tokens,e)}};Bs.parseInline=function(s,e){if(typeof s>"u"||s===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");e=hae({},Bs.defaults,e||{}),XQe(e);try{const t=c3.lexInline(s,e);return e.walkTokens&&Bs.walkTokens(t,e.walkTokens),l3.parseInline(t,e)}catch(t){if(t.message+=` -Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+ZQe(t.message+"",!0)+"
    ";throw t}};Bs.Parser=l3;Bs.parser=l3.parse;Bs.Renderer=JQe;Bs.TextRenderer=iSt;Bs.Lexer=c3;Bs.lexer=c3.lex;Bs.Tokenizer=YQe;Bs.Slugger=nSt;Bs.parse=Bs;var zu=Bs;function eje(s){return JSON.stringify(s,aSt)}function j2(s){let e=JSON.parse(s);return e=Mo(e),e}function aSt(s,e){return e instanceof RegExp?{$mid:ws.Regexp,source:e.source,flags:e.flags}:e}function Mo(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case ws.Uri:return N.revive(s);case ws.Regexp:return new RegExp(s.source,s.flags);case ws.Date:return new Date(s.source)}if(s instanceof $e||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t{let i=[],n=[];return s&&({href:s,dimensions:i}=VQe(s),n.push(`src="${QG(s)}"`)),t&&n.push(`alt="${QG(t)}"`),e&&n.push(`title="${QG(e)}"`),i.length&&(n=n.concat(i)),""},paragraph:s=>`

    ${s}

    `,link:(s,e,t)=>typeof s!="string"?"":(s===t&&(t=mhe(t)),e=typeof e=="string"?QG(mhe(e)):"",s=mhe(s),s=s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function f6(s,e={},t={}){const i=new Z;let n=!1;const o=ELe(e),r=function(m){let v;try{v=j2(decodeURIComponent(m))}catch{}return v?(v=S2(v,b=>{if(s.uris&&s.uris[b])return N.revive(s.uris[b])}),encodeURIComponent(JSON.stringify(v))):m},a=function(m,v){const b=s.uris&&s.uris[m];let w=N.revive(b);return v?m.startsWith(pe.data+":")?m:(w||(w=N.parse(m)),ef.uriToBrowserUri(w).toString(!0)):!w||N.parse(m).toString()===w.toString()?m:(w.query&&(w=w.with({query:r(w.query)})),w.toString())},c=new zu.Renderer;c.image=vhe.image,c.link=vhe.link,c.paragraph=vhe.paragraph;const l=[],d=[];if(e.codeBlockRendererSync?c.code=(m,v)=>{const b=Vme.nextId(),w=e.codeBlockRendererSync(b2e(v),m);return d.push([b,w]),`
    ${fT(m)}
    `}:e.codeBlockRenderer&&(c.code=(m,v)=>{const b=Vme.nextId(),w=e.codeBlockRenderer(b2e(v),m);return l.push(w.then(y=>[b,y])),`
    ${fT(m)}
    `}),e.actionHandler){const m=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let C=y.dataset.href;C&&(s.baseUri&&(C=bhe(N.from(s.baseUri),C)),e.actionHandler.callback(C,w))}catch(C){vt(C)}finally{w.preventDefault()}},v=e.actionHandler.disposables.add(new ii(o,"click")),b=e.actionHandler.disposables.add(new ii(o,"auxclick"));e.actionHandler.disposables.add(M.any(v.event,b.event)(w=>{const y=new Eh(ct(o),w);!y.leftButton&&!y.middleButton||m(y)})),e.actionHandler.disposables.add(ue(o,"keydown",w=>{const y=new En(w);!y.equals(S.Space)&&!y.equals(S.Enter)||m(y)}))}s.supportHtml||(t.sanitizer=m=>e.sanitizerOptions?.replaceWithPlaintext?fT(m):(s.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let h=s.value??"";h.length>1e5&&(h=`${h.substr(0,1e5)}…`),s.supportThemeIcons&&(h=pCt(h));let u;if(e.fillInIncompleteTokens){const m={...zu.defaults,...t},v=zu.lexer(h,m),b=bSt(v);u=zu.parser(b,m)}else u=zu.parse(h,t);s.supportThemeIcons&&(u=Eb(u).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const p=new DOMParser().parseFromString(Gme({isTrusted:s.isTrusted,...e.sanitizerOptions},u),"text/html");if(p.body.querySelectorAll("img, audio, video, source").forEach(m=>{const v=m.getAttribute("src");if(v){let b=v;try{s.baseUri&&(b=bhe(N.from(s.baseUri),b))}catch{}if(m.setAttribute("src",a(b,!0)),e.remoteImageIsAllowed){const w=N.parse(b);w.scheme!==pe.file&&w.scheme!==pe.data&&!e.remoteImageIsAllowed(w)&&m.replaceWith(fe("",void 0,m.outerHTML))}}}),p.body.querySelectorAll("a").forEach(m=>{const v=m.getAttribute("href");if(m.setAttribute("href",""),!v||/^data:|javascript:/i.test(v)||/^command:/i.test(v)&&!s.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(v))m.replaceWith(...m.childNodes);else{let b=a(v,!1);s.baseUri&&(b=bhe(N.from(s.baseUri),v)),m.dataset.href=b}}),o.innerHTML=Gme({isTrusted:s.isTrusted,...e.sanitizerOptions},p.body.innerHTML),l.length>0)Promise.all(l).then(m=>{if(n)return;const v=new Map(m),b=o.querySelectorAll("div[data-code]");for(const w of b){const y=v.get(w.dataset.code??"");y&&aa(w,y)}e.asyncRenderCallback?.()});else if(d.length>0){const m=new Map(d),v=o.querySelectorAll("div[data-code]");for(const b of v){const w=m.get(b.dataset.code??"");w&&aa(b,w)}}if(e.asyncRenderCallback)for(const m of o.getElementsByTagName("img")){const v=i.add(ue(m,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}return{element:o,dispose:()=>{n=!0,i.dispose()}}}function b2e(s){if(!s)return"";const e=s.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:s}function bhe(s,e){return/^\w[\w\d+.-]*:/.test(e)?e:s.path.endsWith("/")?HFe(s,e).toString():HFe(Lr(s),e).toString()}const cSt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Gme(s,e){const{config:t,allowedSchemes:i}=dSt(s),n=new Z;n.add(w2e("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(border-radius:[0-9]+px;)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}else if(o.tagName==="INPUT"&&o.attributes.getNamedItem("type")?.value==="checkbox"){if(r.attrName==="type"&&r.attrValue==="checkbox"||r.attrName==="disabled"||r.attrName==="checked"){r.keepAttr=!0;return}r.keepAttr=!1}})),n.add(w2e("uponSanitizeElement",(o,r)=>{if(r.tagName==="input"&&(o.attributes.getNamedItem("type")?.value==="checkbox"?o.setAttribute("disabled",""):s.replaceWithPlaintext||o.remove()),s.replaceWithPlaintext&&!r.allowedTags[r.tagName]&&r.tagName!=="body"&&o.parentElement){let a,c;if(r.tagName==="#comment")a=``;else{const u=cSt.includes(r.tagName),f=o.attributes.length?" "+Array.from(o.attributes).map(p=>`${p.name}="${p.value}"`).join(" "):"";a=`<${r.tagName}${f}>`,u||(c=``)}const l=document.createDocumentFragment(),d=o.parentElement.ownerDocument.createTextNode(a);l.appendChild(d);const h=c?o.parentElement.ownerDocument.createTextNode(c):void 0;for(;o.firstChild;)l.appendChild(o.firstChild);h&&l.appendChild(h),o.parentElement.replaceChild(l,o)}})),n.add(Gdt(i));try{return OGe(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{n.dispose()}}const lSt=["align","autoplay","alt","checked","class","colspan","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","style","target","title","type","width","start"];function dSt(s){const e=[pe.http,pe.https,pe.mailto,pe.data,pe.file,pe.vscodeFileResource,pe.vscodeRemote,pe.vscodeRemoteResource];return s.isTrusted&&e.push(pe.command),{config:{ALLOWED_TAGS:s.allowedTags??[...Kdt],ALLOWED_ATTR:lSt,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function tje(s){return typeof s=="string"?s:hSt(s)}function hSt(s,e){let t=s.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=zu.parse(t,{renderer:fSt.value}).replace(/&(#\d+|[a-zA-Z]+);/g,n=>uSt.get(n)??n);return Gme({isTrusted:!1},i).toString()}const uSt=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function gSt(){const s=new zu.Renderer;return s.code=e=>e,s.blockquote=e=>e,s.html=e=>"",s.heading=(e,t,i)=>e+` +`}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(e=r2e(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='",n}image(e,t,i){if(e=r2e(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n=''+i+'":">",n}text(e){return e}},HQe=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}},UQe=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do n++,i=e+"-"+n;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}};const WCt=WQe,HCt=HQe,UCt=UQe,{defaults:VCt}=IN.exports,{unescape:zCt}=SU;var $Ct=class Bme{constructor(e){this.options=e||VCt,this.options.renderer=this.options.renderer||new WCt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new HCt,this.slugger=new UCt}static parse(e,t){return new Bme(t).parse(e)}static parseInline(e,t){return new Bme(t).parseInline(e)}parse(e,t=!0){let i="",n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L;const k=e.length;for(n=0;n0&&w.tokens[0].type==="paragraph"?(w.tokens[0].text=A+" "+w.tokens[0].text,w.tokens[0].tokens&&w.tokens[0].tokens.length>0&&w.tokens[0].tokens[0].type==="text"&&(w.tokens[0].tokens[0].text=A+" "+w.tokens[0].tokens[0].text)):w.tokens.unshift({type:"text",text:A}):b+=A),b+=this.parse(w.tokens,v),u+=this.renderer.listitem(b,C,y);i+=this.renderer.list(u,p,m);continue}case"html":{i+=this.renderer.html(f.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case"text":{for(u=f.tokens?this.parseInline(f.tokens):f.text;n+1"u"||s===null)throw new Error("marked(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=aae({},Bs.defaults,e||{}),$Qe(e),t){const i=e.highlight;let n;try{n=o3.lex(s,e)}catch(a){return t(a)}const o=function(a){let c;if(!a)try{e.walkTokens&&Bs.walkTokens(n,e.walkTokens),c=r3.parse(n,e)}catch(l){a=l}return e.highlight=i,a?t(a):t(null,c)};if(!i||i.length<3||(delete e.highlight,!n.length))return o();let r=0;Bs.walkTokens(n,function(a){a.type==="code"&&(r++,setTimeout(()=>{i(a.text,a.lang,function(c,l){if(c)return o(c);l!=null&&l!==a.text&&(a.text=l,a.escaped=!0),r--,r===0&&o()})},0))}),r===0&&o();return}try{const i=o3.lex(s,e);return e.walkTokens&&Bs.walkTokens(i,e.walkTokens),r3.parse(i,e)}catch(i){if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+GQe(i.message+"",!0)+"
    ";throw i}}Bs.options=Bs.setOptions=function(s){return aae(Bs.defaults,s),QCt(Bs.defaults),Bs};Bs.getDefaults=qCt;Bs.defaults=jCt;Bs.use=function(...s){const e=aae({},...s),t=Bs.defaults.extensions||{renderers:{},childTokens:{}};let i;s.forEach(n=>{if(n.extensions&&(i=!0,n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const r=t.renderers?t.renderers[o.name]:null;r?t.renderers[o.name]=function(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)})),n.renderer){const o=Bs.defaults.renderer||new zQe;for(const r in n.renderer){const a=o[r];o[r]=(...c)=>{let l=n.renderer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.renderer=o}if(n.tokenizer){const o=Bs.defaults.tokenizer||new VQe;for(const r in n.tokenizer){const a=o[r];o[r]=(...c)=>{let l=n.tokenizer[r].apply(o,c);return l===!1&&(l=a.apply(o,c)),l}}e.tokenizer=o}if(n.walkTokens){const o=Bs.defaults.walkTokens;e.walkTokens=r=>{n.walkTokens.call(this,r),o&&o(r)}}i&&(e.extensions=t),Bs.setOptions(e)})};Bs.walkTokens=function(s,e){for(const t of s)switch(e(t),t.type){case"table":{for(const i of t.header)Bs.walkTokens(i.tokens,e);for(const i of t.rows)for(const n of i)Bs.walkTokens(n.tokens,e);break}case"list":{Bs.walkTokens(t.items,e);break}default:Bs.defaults.extensions&&Bs.defaults.extensions.childTokens&&Bs.defaults.extensions.childTokens[t.type]?Bs.defaults.extensions.childTokens[t.type].forEach(function(i){Bs.walkTokens(t[i],e)}):t.tokens&&Bs.walkTokens(t.tokens,e)}};Bs.parseInline=function(s,e){if(typeof s>"u"||s===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof s!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected");e=aae({},Bs.defaults,e||{}),$Qe(e);try{const t=o3.lexInline(s,e);return e.walkTokens&&Bs.walkTokens(t,e.walkTokens),r3.parseInline(t,e)}catch(t){if(t.message+=` +Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+GQe(t.message+"",!0)+"
    ";throw t}};Bs.Parser=r3;Bs.parser=r3.parse;Bs.Renderer=zQe;Bs.TextRenderer=GCt;Bs.Lexer=o3;Bs.lexer=o3.lex;Bs.Tokenizer=VQe;Bs.Slugger=KCt;Bs.parse=Bs;var Uu=Bs;function KQe(s){return JSON.stringify(s,YCt)}function G2(s){let e=JSON.parse(s);return e=Mo(e),e}function YCt(s,e){return e instanceof RegExp?{$mid:ws.Regexp,source:e.source,flags:e.flags}:e}function Mo(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case ws.Uri:return N.revive(s);case ws.Regexp:return new RegExp(s.source,s.flags);case ws.Date:return new Date(s.source)}if(s instanceof $e||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t{let i=[],n=[];return s&&({href:s,dimensions:i}=NQe(s),n.push(`src="${GG(s)}"`)),t&&n.push(`alt="${GG(t)}"`),e&&n.push(`title="${GG(e)}"`),i.length&&(n=n.concat(i)),""},paragraph:s=>`

    ${s}

    `,link:(s,e,t)=>typeof s!="string"?"":(s===t&&(t=lhe(t)),e=typeof e=="string"?GG(lhe(e)):"",s=lhe(s),s=s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function d6(s,e={},t={}){const i=new Z;let n=!1;const o=gLe(e),r=function(m){let v;try{v=G2(decodeURIComponent(m))}catch{}return v?(v=b2(v,b=>{if(s.uris&&s.uris[b])return N.revive(s.uris[b])}),encodeURIComponent(JSON.stringify(v))):m},a=function(m,v){const b=s.uris&&s.uris[m];let w=N.revive(b);return v?m.startsWith(pe.data+":")?m:(w||(w=N.parse(m)),Jg.uriToBrowserUri(w).toString(!0)):!w||N.parse(m).toString()===w.toString()?m:(w.query&&(w=w.with({query:r(w.query)})),w.toString())},c=new Uu.Renderer;c.image=hhe.image,c.link=hhe.link,c.paragraph=hhe.paragraph;const l=[],d=[];if(e.codeBlockRendererSync?c.code=(m,v)=>{const b=Fme.nextId(),w=e.codeBlockRendererSync(a2e(v),m);return d.push([b,w]),`
    ${dT(m)}
    `}:e.codeBlockRenderer&&(c.code=(m,v)=>{const b=Fme.nextId(),w=e.codeBlockRenderer(a2e(v),m);return l.push(w.then(y=>[b,y])),`
    ${dT(m)}
    `}),e.actionHandler){const m=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let C=y.dataset.href;C&&(s.baseUri&&(C=uhe(N.from(s.baseUri),C)),e.actionHandler.callback(C,w))}catch(C){vt(C)}finally{w.preventDefault()}},v=e.actionHandler.disposables.add(new ii(o,"click")),b=e.actionHandler.disposables.add(new ii(o,"auxclick"));e.actionHandler.disposables.add(M.any(v.event,b.event)(w=>{const y=new Sh(ct(o),w);!y.leftButton&&!y.middleButton||m(y)})),e.actionHandler.disposables.add(ue(o,"keydown",w=>{const y=new En(w);!y.equals(S.Space)&&!y.equals(S.Enter)||m(y)}))}s.supportHtml||(t.sanitizer=m=>e.sanitizerOptions?.replaceWithPlaintext?dT(m):(s.isTrusted?m.match(/^(]+>)|(<\/\s*span>)$/):void 0)?m:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let h=s.value??"";h.length>1e5&&(h=`${h.substr(0,1e5)}…`),s.supportThemeIcons&&(h=sCt(h));let u;if(e.fillInIncompleteTokens){const m={...Uu.defaults,...t},v=Uu.lexer(h,m),b=cSt(v);u=Uu.parser(b,m)}else u=Uu.parse(h,t);s.supportThemeIcons&&(u=Cb(u).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const p=new DOMParser().parseFromString(Wme({isTrusted:s.isTrusted,...e.sanitizerOptions},u),"text/html");if(p.body.querySelectorAll("img, audio, video, source").forEach(m=>{const v=m.getAttribute("src");if(v){let b=v;try{s.baseUri&&(b=uhe(N.from(s.baseUri),b))}catch{}if(m.setAttribute("src",a(b,!0)),e.remoteImageIsAllowed){const w=N.parse(b);w.scheme!==pe.file&&w.scheme!==pe.data&&!e.remoteImageIsAllowed(w)&&m.replaceWith(fe("",void 0,m.outerHTML))}}}),p.body.querySelectorAll("a").forEach(m=>{const v=m.getAttribute("href");if(m.setAttribute("href",""),!v||/^data:|javascript:/i.test(v)||/^command:/i.test(v)&&!s.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(v))m.replaceWith(...m.childNodes);else{let b=a(v,!1);s.baseUri&&(b=uhe(N.from(s.baseUri),v)),m.dataset.href=b}}),o.innerHTML=Wme({isTrusted:s.isTrusted,...e.sanitizerOptions},p.body.innerHTML),l.length>0)Promise.all(l).then(m=>{if(n)return;const v=new Map(m),b=o.querySelectorAll("div[data-code]");for(const w of b){const y=v.get(w.dataset.code??"");y&&aa(w,y)}e.asyncRenderCallback?.()});else if(d.length>0){const m=new Map(d),v=o.querySelectorAll("div[data-code]");for(const b of v){const w=m.get(b.dataset.code??"");w&&aa(b,w)}}if(e.asyncRenderCallback)for(const m of o.getElementsByTagName("img")){const v=i.add(ue(m,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}return{element:o,dispose:()=>{n=!0,i.dispose()}}}function a2e(s){if(!s)return"";const e=s.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:s}function uhe(s,e){return/^\w[\w\d+.-]*:/.test(e)?e:s.path.endsWith("/")?kFe(s,e).toString():kFe(Lr(s),e).toString()}const JCt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function Wme(s,e){const{config:t,allowedSchemes:i}=ZCt(s),n=new Z;n.add(c2e("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(border-radius:[0-9]+px;)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}else if(o.tagName==="INPUT"&&o.attributes.getNamedItem("type")?.value==="checkbox"){if(r.attrName==="type"&&r.attrValue==="checkbox"||r.attrName==="disabled"||r.attrName==="checked"){r.keepAttr=!0;return}r.keepAttr=!1}})),n.add(c2e("uponSanitizeElement",(o,r)=>{if(r.tagName==="input"&&(o.attributes.getNamedItem("type")?.value==="checkbox"?o.setAttribute("disabled",""):s.replaceWithPlaintext||o.remove()),s.replaceWithPlaintext&&!r.allowedTags[r.tagName]&&r.tagName!=="body"&&o.parentElement){let a,c;if(r.tagName==="#comment")a=``;else{const u=JCt.includes(r.tagName),f=o.attributes.length?" "+Array.from(o.attributes).map(p=>`${p.name}="${p.value}"`).join(" "):"";a=`<${r.tagName}${f}>`,u||(c=``)}const l=document.createDocumentFragment(),d=o.parentElement.ownerDocument.createTextNode(a);l.appendChild(d);const h=c?o.parentElement.ownerDocument.createTextNode(c):void 0;for(;o.firstChild;)l.appendChild(o.firstChild);h&&l.appendChild(h),o.parentElement.replaceChild(l,o)}})),n.add(Ndt(i));try{return IGe(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{n.dispose()}}const XCt=["align","autoplay","alt","checked","class","colspan","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","style","target","title","type","width","start"];function ZCt(s){const e=[pe.http,pe.https,pe.mailto,pe.data,pe.file,pe.vscodeFileResource,pe.vscodeRemote,pe.vscodeRemoteResource];return s.isTrusted&&e.push(pe.command),{config:{ALLOWED_TAGS:s.allowedTags??[...Pdt],ALLOWED_ATTR:XCt,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function qQe(s){return typeof s=="string"?s:eSt(s)}function eSt(s,e){let t=s.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Uu.parse(t,{renderer:nSt.value}).replace(/&(#\d+|[a-zA-Z]+);/g,n=>tSt.get(n)??n);return Wme({isTrusted:!1},i).toString()}const tSt=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function iSt(){const s=new Uu.Renderer;return s.code=e=>e,s.blockquote=e=>e,s.html=e=>"",s.heading=(e,t,i)=>e+` `,s.hr=()=>"",s.list=(e,t)=>e,s.listitem=e=>e+` `,s.paragraph=e=>e+` `,s.table=(e,t)=>e+t+` `,s.tablerow=e=>e,s.tablecell=(e,t)=>e+" ",s.strong=e=>e,s.em=e=>e,s.codespan=e=>e,s.br=()=>` -`,s.del=e=>e,s.image=(e,t,i)=>"",s.text=e=>e,s.link=(e,t,i)=>i,s}const fSt=new ya(s=>gSt());function d3(s){let e="";return s.forEach(t=>{e+=t.raw}),e}function ije(s){if(s.tokens)for(let e=s.tokens.length-1;e>=0;e--){const t=s.tokens[e];if(t.type==="text"){const i=t.raw.split(` -`),n=i[i.length-1];if(n.includes("`"))return CSt(s);if(n.includes("**"))return kSt(s);if(n.match(/\*\w/))return SSt(s);if(n.match(/(^|\s)__\w/))return ISt(s);if(n.match(/(^|\s)_\w/))return ASt(s);if(pSt(n)||mSt(n)&&s.tokens.slice(0,e).some(o=>o.type==="text"&&o.raw.match(/\[[^\]]*$/))){const o=s.tokens.slice(e+1);return o[0]?.type==="link"&&o[1]?.type==="text"&&o[1].raw.match(/^ *"[^"]*$/)||n.match(/^[^"]* +"[^"]*$/)?xSt(s):ESt(s)}else if(n.match(/(^|\s)\[\w*/))return DSt(s)}}}function pSt(s){return!!s.match(/(^|\s)\[.*\]\(\w*/)}function mSt(s){return!!s.match(/^[^\[]*\]\([^\)]*$/)}function _St(s){const e=s.items[s.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if(t?.type==="text"&&!("inRawBlock"in e)&&(i=ije(t)),!i||i.type!=="paragraph")return;const n=d3(s.items.slice(0,-1)),o=e.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!o)return;const r=o+d3(e.tokens.slice(0,-1))+i.raw,a=zu.lexer(n+r)[0];if(a.type==="list")return a}const vSt=3;function bSt(s){for(let e=0;ee,s.image=(e,t,i)=>"",s.text=e=>e,s.link=(e,t,i)=>i,s}const nSt=new ya(s=>iSt());function a3(s){let e="";return s.forEach(t=>{e+=t.raw}),e}function QQe(s){if(s.tokens)for(let e=s.tokens.length-1;e>=0;e--){const t=s.tokens[e];if(t.type==="text"){const i=t.raw.split(` +`),n=i[i.length-1];if(n.includes("`"))return hSt(s);if(n.includes("**"))return _St(s);if(n.match(/\*\w/))return uSt(s);if(n.match(/(^|\s)__\w/))return vSt(s);if(n.match(/(^|\s)_\w/))return gSt(s);if(sSt(n)||oSt(n)&&s.tokens.slice(0,e).some(o=>o.type==="text"&&o.raw.match(/\[[^\]]*$/))){const o=s.tokens.slice(e+1);return o[0]?.type==="link"&&o[1]?.type==="text"&&o[1].raw.match(/^ *"[^"]*$/)||n.match(/^[^"]* +"[^"]*$/)?pSt(s):fSt(s)}else if(n.match(/(^|\s)\[\w*/))return mSt(s)}}}function sSt(s){return!!s.match(/(^|\s)\[.*\]\(\w*/)}function oSt(s){return!!s.match(/^[^\[]*\]\([^\)]*$/)}function rSt(s){const e=s.items[s.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if(t?.type==="text"&&!("inRawBlock"in e)&&(i=QQe(t)),!i||i.type!=="paragraph")return;const n=a3(s.items.slice(0,-1)),o=e.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!o)return;const r=o+a3(e.tokens.slice(0,-1))+i.raw,a=Uu.lexer(n+r)[0];if(a.type==="list")return a}const aSt=3;function cSt(s){for(let e=0;e"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;n=!0}else return}if(typeof i=="number"&&i>0){const o=n?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` -|${" --- |".repeat(i)}`;return zu.lexer(a)}}function w2e(s,e){return BGe(s,e),Ee(()=>WGe(s))}var LSt=".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}";ut(LSt,{});var Kme,lL;let Y_=(lL=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 n=new Z,o=n.add(f6(e,{...this._getRenderOptions(e,n),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{let o;i?o=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(o=this._options.editor.getModel()?.getLanguageId()),o||(o=Ca);const r=await Lwt(this._languageService,n,o),a=document.createElement("span");if(a.innerHTML=Kme._ttpTokenizer?.createHTML(r)??r,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);Dl(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=>uae(this._openerService,i,e.isTrusted),disposables:t}}}},Kme=lL,lL._ttpTokenizer=QA("tokenizeToString",{createHTML(e){return e}}),lL);Y_=Kme=D([_(1,xi),_(2,Ao)],Y_);async function uae(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:RSt(t)})}catch(i){return vt(i),!1}}function RSt(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}const Qb=fe;var Hr;(function(s){s[s.PointerSize=3]="PointerSize",s[s.HoverBorderWidth=2]="HoverBorderWidth",s[s.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(Hr||(Hr={}));let qme=class extends pd{get _targetWindow(){return ct(this._target.targetElements[0])}get _targetDocumentElement(){return ct(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===vo.BELOW?Vf.BELOW:Vf.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,n,o,r){super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,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=>uae(this._openerService,u,dd(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new MSt(e.target),this._hoverPointer=e.appearance?.showPointer?Qb("div.workbench-hover-pointer"):void 0,this._hover=this._register(new CLe),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??vo.ABOVE,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(S.Escape)&&this.dispose()}),this._register(ue(this._targetWindow,"blur",()=>this.dispose()));const a=Qb("div.hover-row.markdown-hover"),c=Qb("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Yr(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(Y_,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||cd.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=Qb("div.hover-row.status-bar"),f=Qb("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=Qb("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"||dd(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=Qb("div.hover-row.status-bar"),f=Qb("div.info");f.textContent=g(4885,"Hold {0} key to mouse over",Qt?"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 y2e(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new y2e(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=Ore(this._hoverContainer,Qb("div")),n=re(this._hoverContainer,Qb("div"));i.tabIndex=0,n.tabIndex=0,this._register(ue(n,"focus",o=>{e.focus(),o.preventDefault()})),this._register(ue(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&xQe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Ah(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=VGe(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:n,bottom:o,left:r}=t[0],a=n-r,c=o-i,l={top:i,right:n,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 vo.RIGHT:l.left+=Hr.PointerSize,l.right+=Hr.PointerSize,this._hoverContainer.style.paddingLeft=`${Hr.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-Hr.PointerSize}px`;break;case vo.LEFT:l.left-=Hr.PointerSize,l.right-=Hr.PointerSize,this._hoverContainer.style.paddingRight=`${Hr.PointerSize}px`,this._hoverContainer.style.marginRight=`${-Hr.PointerSize}px`;break;case vo.BELOW:l.top+=Hr.PointerSize,l.bottom+=Hr.PointerSize,this._hoverContainer.style.paddingTop=`${Hr.PointerSize}px`,this._hoverContainer.style.marginTop=`${-Hr.PointerSize}px`;break;case vo.ABOVE:l.top-=Hr.PointerSize,l.bottom-=Hr.PointerSize,this._hoverContainer.style.paddingBottom=`${Hr.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-Hr.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+Hr.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===vo.RIGHT?this._x=e.right:this._hoverPosition===vo.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-Hr.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?Hr.PointerSize:0;if(this._forcePosition){const i=t+Hr.HoverBorderWidth;this._hoverPosition===vo.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===vo.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===vo.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vo.LEFT:this._hoverPosition=vo.BELOW):this._hoverPosition===vo.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vo.RIGHT:this._hoverPosition=vo.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=vo.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?Hr.PointerSize:0;this._hoverPosition===vo.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=vo.BELOW):this._hoverPosition===vo.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=vo.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?Hr.PointerSize:0)+Hr.HoverBorderWidth;this._hoverPosition===vo.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===vo.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)-Hr.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-Hr.PointerSize}px`;break}case vo.ABOVE:case vo.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===vo.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-Hr.PointerSize;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-Hr.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}};qme=D([_(1,Ut),_(2,Te),_(3,Ao),_(4,we),_(5,mr)],qme);class y2e extends pd{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=ct(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(ct(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class MSt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var nf;(function(s){s[s.NoMatchingKb=0]="NoMatchingKb",s[s.MoreChordsNeeded=1]="MoreChordsNeeded",s[s.KbFound=2]="KbFound"})(nf||(nf={}));const HY={kind:nf.NoMatchingKb},NSt={kind:nf.MoreChordsNeeded};function PSt(s,e,t){return{kind:nf.KbFound,commandId:s,commandArgs:e,isBubble:t}}class $O{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const o=n.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=$O.handleRemovals([].concat(e).concat(t));for(let n=0,o=this._keybindings.length;n"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const o=i[n];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,n=t.length;i"u"||t.length===0)return[];const i=[];let n=0;for(let o=t.length-1;o>=0;o--)i[n++]=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 n=i.length-1;n>=0;n--){const o=i[n];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(o===void 0)return this._log("\\ No keybinding entries."),HY;let r=null;if(n.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 n=t[i];if($O._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function C2e(s){return s?`${s.serialize()}`:"no when condition"}function S2e(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}let UY=class extends V{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Fme(this.layoutService.mainContainer,zw.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(ct(t))?n=zw.ABSOLUTE:i?n=zw.FIXED_SHADOW:n=zw.FIXED:n=zw.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,n),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}};UY=D([_(0,pu)],UY);class FSt extends UY{getContextViewElement(){return this.contextView.getViewElement()}}class OSt{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 n;if(e===void 0||Lt(e)||Yr(e))n=e;else if(!C2(e.markdown))n=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(4884,"Loading..."),t,i),this._cancellationTokenSource=new ci;const o=this._cancellationTokenSource.token;if(n=await e.markdown(o),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||o.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:vo.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n?.dispose()}hasContent(e){return e?dd(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let Qme=class extends V{constructor(e,t,i,n,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=o,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new UY(this._layoutService))}showHover(e,t,i){if(A2e(this._currentHoverOptions)===A2e(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),o=Bc();i||(n&&o?o.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=o):this._lastFocusedElementBeforeOpen=void 0);const r=new Z,a=this._instantiationService.createInstance(qme,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&lTe(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const c=Yr(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(ct(c))}if(this._contextViewHandler.showContextView(new BSt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(ue(ct(e.container).document,ke.MOUSE_DOWN,c=>{wc(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)r.add(ue(l,ke.CLICK,()=>this.hideHover()));else r.add(ue(e.target,ke.CLICK,()=>this.hideHover()));const c=Bc();if(c){const l=ct(c).document;r.add(ue(c,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(ue(l,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(ue(c,ke.KEY_UP,d=>this._keyUp(d,a))),r.add(ue(l,ke.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in si){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 n=new En(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(n,n.target).kind!==nf.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()))}setupManagedHover(e,t,i,n){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=(y,C)=>{const A=r!==void 0;y&&(r?.dispose(),r=void 0),C&&(o?.dispose(),o=void 0),A&&(e.onDidHideHover?.(),r=void 0)},c=(y,C,A,L)=>new Cm(async()=>{(!r||r.isDisposed)&&(r=new OSt(e,A||t,y>0),await r.update(typeof i=="function"?i():i,C,{...n,trapFocus:L}))},y);let l=!1;const d=ue(t,ke.MOUSE_DOWN,()=>{l=!0,a(!0,!0)},!0),h=ue(t,ke.MOUSE_UP,()=>{l=!1},!0),u=ue(t,ke.MOUSE_LEAVE,y=>{l=!1,a(!1,y.fromElement===t)},!0),f=y=>{if(o)return;const C=new Z,A={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const L=k=>{A.x=k.x+10,Yr(k.target)&&E2e(k.target,t)!==t&&a(!0,!0)};C.add(ue(t,ke.MOUSE_MOVE,L,!0))}o=C,!(Yr(y.target)&&E2e(y.target,t)!==t)&&C.add(c(e.delay,!1,A))},p=ue(t,ke.MOUSE_OVER,f,!0),m=()=>{if(l||o)return;const y={targetElements:[t],dispose:()=>{}},C=new Z,A=()=>a(!0,!0);C.add(ue(t,ke.BLUR,A,!0)),C.add(c(e.delay,!1,y)),o=C};let v;const b=t.tagName.toLowerCase();b!=="input"&&b!=="textarea"&&(v=ue(t,ke.FOCUS,m,!0));const w={show:y=>{a(!1,!0)},hide:()=>{a(!0,!0)},update:async(y,C)=>{i=y,await r?.update(i,void 0,C)},dispose:()=>{this._managedHovers.delete(t),p.dispose(),u.dispose(),d.dispose(),h.dispose(),v?.dispose(),a(!0,!0)}};return this._managedHovers.set(t,w),w}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};Qme=D([_(0,we),_(1,lr),_(2,Ut),_(3,pu),_(4,mr)],Qme);function A2e(s){if(s!==void 0)return s?.id??s}class BSt{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 E2e(s,e){for(e=e??ct(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}ce(ec,Qme,qt.Delayed);Cp((s,e)=>{const t=s.getColor(ZKe);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 PN=ae("IWorkspaceEditService");class gae{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(tA.is(t))return tA.lift(t);if(cp.is(t))return cp.lift(t);throw new Error("Unsupported edit")})}}class tA extends gae{static is(e){return e instanceof tA?!0:kn(e)&&N.isUri(e.resource)&&kn(e.textEdit)}static lift(e){return e instanceof tA?e:new tA(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class cp extends gae{static is(e){return e instanceof cp?!0:kn(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof cp?e:new cp(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const Ol={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,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},Vb=Object.freeze({id:"editor",order:5,type:"object",title:g(1209,"Editor"),scope:at.LANGUAGE_OVERRIDABLE}),VY={...Vb,properties:{"editor.tabSize":{type:"number",default:Vd.tabSize,minimum:1,markdownDescription:g(1210,"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(1211,'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:Vd.insertSpaces,markdownDescription:g(1212,"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:Vd.detectIndentation,markdownDescription:g(1213,"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:Vd.trimAutoWhitespace,description:g(1214,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Vd.largeFileOptimizations,description:g(1215,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[g(1216,"Turn off Word Based Suggestions."),g(1217,"Only suggest words from the active document."),g(1218,"Suggest words from all open documents of the same language."),g(1219,"Suggest words from all open documents.")],description:g(1220,"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(1221,"Semantic highlighting enabled for all color themes."),g(1222,"Semantic highlighting disabled for all color themes."),g(1223,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:g(1224,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:g(1225,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:g(1226,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:g(1227,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:g(1228,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:g(1229,"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(1230,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:g(1231,"The opening bracket character or string sequence.")},{type:"string",description:g(1232,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:g(1233,"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(1231,"The opening bracket character or string sequence.")},{type:"string",description:g(1232,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Ol.maxComputationTime,description:g(1234,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Ol.maxFileSize,description:g(1235,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Ol.renderSideBySide,description:g(1236,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Ol.renderSideBySideInlineBreakpoint,description:g(1237,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Ol.useInlineViewWhenSpaceIsLimited,description:g(1238,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Ol.renderMarginRevertIcon,description:g(1239,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Ol.renderGutterMenu,description:g(1240,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Ol.ignoreTrimWhitespace,description:g(1241,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Ol.renderIndicators,description:g(1242,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Ol.diffCodeLens,description:g(1243,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Ol.diffWordWrap,markdownEnumDescriptions:[g(1244,"Lines will never wrap."),g(1245,"Lines will wrap at the viewport width."),g(1246,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Ol.diffAlgorithm,markdownEnumDescriptions:[g(1247,"Uses the legacy diffing algorithm."),g(1248,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Ol.hideUnchangedRegions.enabled,markdownDescription:g(1249,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Ol.hideUnchangedRegions.revealLineCount,markdownDescription:g(1250,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Ol.hideUnchangedRegions.minimumLineCount,markdownDescription:g(1251,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Ol.hideUnchangedRegions.contextLineCount,markdownDescription:g(1252,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Ol.experimental.showMoves,markdownDescription:g(1253,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Ol.experimental.showEmptyDecorations,description:g(1254,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Ol.experimental.useTrueInlineView,description:g(1255,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function WSt(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of JP){const e=s.schema;if(typeof e<"u")if(WSt(e))VY.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(VY.properties[t]=e[t])}let XG=null;function nje(){return XG===null&&(XG=Object.create(null),Object.keys(VY.properties).forEach(s=>{XG[s]=!0})),XG}function HSt(s){return nje()[`editor.${s}`]||!1}function USt(s){return nje()[`diffEditor.${s}`]||!1}const VSt=Qe.as(Nn.Configuration);VSt.registerConfiguration(VY);var yl;(function(s){s[s.None=0]="None",s[s.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=2]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",s[s.InvalidUnicode=4]="InvalidUnicode",s[s.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",s[s.InvalidCharacter=6]="InvalidCharacter"})(yl||(yl={}));var ft;(function(s){s[s.OpenBraceToken=1]="OpenBraceToken",s[s.CloseBraceToken=2]="CloseBraceToken",s[s.OpenBracketToken=3]="OpenBracketToken",s[s.CloseBracketToken=4]="CloseBracketToken",s[s.CommaToken=5]="CommaToken",s[s.ColonToken=6]="ColonToken",s[s.NullKeyword=7]="NullKeyword",s[s.TrueKeyword=8]="TrueKeyword",s[s.FalseKeyword=9]="FalseKeyword",s[s.StringLiteral=10]="StringLiteral",s[s.NumericLiteral=11]="NumericLiteral",s[s.LineCommentTrivia=12]="LineCommentTrivia",s[s.BlockCommentTrivia=13]="BlockCommentTrivia",s[s.LineBreakTrivia=14]="LineBreakTrivia",s[s.Trivia=15]="Trivia",s[s.Unknown=16]="Unknown",s[s.EOF=17]="EOF"})(ft||(ft={}));var Ho;(function(s){s[s.InvalidSymbol=1]="InvalidSymbol",s[s.InvalidNumberFormat=2]="InvalidNumberFormat",s[s.PropertyNameExpected=3]="PropertyNameExpected",s[s.ValueExpected=4]="ValueExpected",s[s.ColonExpected=5]="ColonExpected",s[s.CommaExpected=6]="CommaExpected",s[s.CloseBraceExpected=7]="CloseBraceExpected",s[s.CloseBracketExpected=8]="CloseBracketExpected",s[s.EndOfFileExpected=9]="EndOfFileExpected",s[s.InvalidCommentToken=10]="InvalidCommentToken",s[s.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=12]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",s[s.InvalidUnicode=14]="InvalidUnicode",s[s.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",s[s.InvalidCharacter=16]="InvalidCharacter"})(Ho||(Ho={}));var h3;(function(s){s.DEFAULT={allowTrailingComma:!0}})(h3||(h3={}));function LLe(s,e=!1){let t=0;const i=s.length;let n="",o=0,r=ft.Unknown,a=yl.None;function c(m){let v=0,b=0;for(;v=ti._0&&w<=ti._9)b=b*16+w-ti._0;else if(w>=ti.A&&w<=ti.F)b=b*16+w-ti.A+10;else if(w>=ti.a&&w<=ti.f)b=b*16+w-ti.a+10;else break;t++,v++}return v=i){m+=s.substring(v,t),a=yl.UnexpectedEndOfString;break}const b=s.charCodeAt(t);if(b===ti.doubleQuote){m+=s.substring(v,t),t++;break}if(b===ti.backslash){if(m+=s.substring(v,t),t++,t>=i){a=yl.UnexpectedEndOfString;break}switch(s.charCodeAt(t++)){case ti.doubleQuote:m+='"';break;case ti.backslash:m+="\\";break;case ti.slash:m+="/";break;case ti.b:m+="\b";break;case ti.f:m+="\f";break;case ti.n:m+=` -`;break;case ti.r:m+="\r";break;case ti.t:m+=" ";break;case ti.u:{const y=c(4);y>=0?m+=String.fromCharCode(y):a=yl.InvalidUnicode;break}default:a=yl.InvalidEscapeCharacter}v=t;continue}if(b>=0&&b<=31)if(ZG(b)){m+=s.substring(v,t),a=yl.UnexpectedEndOfString;break}else a=yl.InvalidCharacter;t++}return m}function u(){if(n="",a=yl.None,o=t,t>=i)return o=i,r=ft.EOF;let m=s.charCodeAt(t);if(whe(m)){do t++,n+=String.fromCharCode(m),m=s.charCodeAt(t);while(whe(m));return r=ft.Trivia}if(ZG(m))return t++,n+=String.fromCharCode(m),m===ti.carriageReturn&&s.charCodeAt(t)===ti.lineFeed&&(t++,n+=` -`),r=ft.LineBreakTrivia;switch(m){case ti.openBrace:return t++,r=ft.OpenBraceToken;case ti.closeBrace:return t++,r=ft.CloseBraceToken;case ti.openBracket:return t++,r=ft.OpenBracketToken;case ti.closeBracket:return t++,r=ft.CloseBracketToken;case ti.colon:return t++,r=ft.ColonToken;case ti.comma:return t++,r=ft.CommaToken;case ti.doubleQuote:return t++,n=h(),r=ft.StringLiteral;case ti.slash:{const v=t-1;if(s.charCodeAt(t+1)===ti.slash){for(t+=2;t=ft.LineCommentTrivia&&m<=ft.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>r,getTokenValue:()=>n,getTokenOffset:()=>o,getTokenLength:()=>t-o,getTokenError:()=>a}}function whe(s){return s===ti.space||s===ti.tab||s===ti.verticalTab||s===ti.formFeed||s===ti.nonBreakingSpace||s===ti.ogham||s>=ti.enQuad&&s<=ti.zeroWidthSpace||s===ti.narrowNoBreakSpace||s===ti.mathematicalSpace||s===ti.ideographicSpace||s===ti.byteOrderMark}function ZG(s){return s===ti.lineFeed||s===ti.carriageReturn||s===ti.lineSeparator||s===ti.paragraphSeparator}function hP(s){return s>=ti._0&&s<=ti._9}var ti;(function(s){s[s.nullCharacter=0]="nullCharacter",s[s.maxAsciiCharacter=127]="maxAsciiCharacter",s[s.lineFeed=10]="lineFeed",s[s.carriageReturn=13]="carriageReturn",s[s.lineSeparator=8232]="lineSeparator",s[s.paragraphSeparator=8233]="paragraphSeparator",s[s.nextLine=133]="nextLine",s[s.space=32]="space",s[s.nonBreakingSpace=160]="nonBreakingSpace",s[s.enQuad=8192]="enQuad",s[s.emQuad=8193]="emQuad",s[s.enSpace=8194]="enSpace",s[s.emSpace=8195]="emSpace",s[s.threePerEmSpace=8196]="threePerEmSpace",s[s.fourPerEmSpace=8197]="fourPerEmSpace",s[s.sixPerEmSpace=8198]="sixPerEmSpace",s[s.figureSpace=8199]="figureSpace",s[s.punctuationSpace=8200]="punctuationSpace",s[s.thinSpace=8201]="thinSpace",s[s.hairSpace=8202]="hairSpace",s[s.zeroWidthSpace=8203]="zeroWidthSpace",s[s.narrowNoBreakSpace=8239]="narrowNoBreakSpace",s[s.ideographicSpace=12288]="ideographicSpace",s[s.mathematicalSpace=8287]="mathematicalSpace",s[s.ogham=5760]="ogham",s[s._=95]="_",s[s.$=36]="$",s[s._0=48]="_0",s[s._1=49]="_1",s[s._2=50]="_2",s[s._3=51]="_3",s[s._4=52]="_4",s[s._5=53]="_5",s[s._6=54]="_6",s[s._7=55]="_7",s[s._8=56]="_8",s[s._9=57]="_9",s[s.a=97]="a",s[s.b=98]="b",s[s.c=99]="c",s[s.d=100]="d",s[s.e=101]="e",s[s.f=102]="f",s[s.g=103]="g",s[s.h=104]="h",s[s.i=105]="i",s[s.j=106]="j",s[s.k=107]="k",s[s.l=108]="l",s[s.m=109]="m",s[s.n=110]="n",s[s.o=111]="o",s[s.p=112]="p",s[s.q=113]="q",s[s.r=114]="r",s[s.s=115]="s",s[s.t=116]="t",s[s.u=117]="u",s[s.v=118]="v",s[s.w=119]="w",s[s.x=120]="x",s[s.y=121]="y",s[s.z=122]="z",s[s.A=65]="A",s[s.B=66]="B",s[s.C=67]="C",s[s.D=68]="D",s[s.E=69]="E",s[s.F=70]="F",s[s.G=71]="G",s[s.H=72]="H",s[s.I=73]="I",s[s.J=74]="J",s[s.K=75]="K",s[s.L=76]="L",s[s.M=77]="M",s[s.N=78]="N",s[s.O=79]="O",s[s.P=80]="P",s[s.Q=81]="Q",s[s.R=82]="R",s[s.S=83]="S",s[s.T=84]="T",s[s.U=85]="U",s[s.V=86]="V",s[s.W=87]="W",s[s.X=88]="X",s[s.Y=89]="Y",s[s.Z=90]="Z",s[s.ampersand=38]="ampersand",s[s.asterisk=42]="asterisk",s[s.at=64]="at",s[s.backslash=92]="backslash",s[s.bar=124]="bar",s[s.caret=94]="caret",s[s.closeBrace=125]="closeBrace",s[s.closeBracket=93]="closeBracket",s[s.closeParen=41]="closeParen",s[s.colon=58]="colon",s[s.comma=44]="comma",s[s.dot=46]="dot",s[s.doubleQuote=34]="doubleQuote",s[s.equals=61]="equals",s[s.exclamation=33]="exclamation",s[s.greaterThan=62]="greaterThan",s[s.lessThan=60]="lessThan",s[s.minus=45]="minus",s[s.openBrace=123]="openBrace",s[s.openBracket=91]="openBracket",s[s.openParen=40]="openParen",s[s.percent=37]="percent",s[s.plus=43]="plus",s[s.question=63]="question",s[s.semicolon=59]="semicolon",s[s.singleQuote=39]="singleQuote",s[s.slash=47]="slash",s[s.tilde=126]="tilde",s[s.backspace=8]="backspace",s[s.formFeed=12]="formFeed",s[s.byteOrderMark=65279]="byteOrderMark",s[s.tab=9]="tab",s[s.verticalTab=11]="verticalTab"})(ti||(ti={}));function sf(s,e=[],t=h3.DEFAULT){let i=null,n=[];const o=[];function r(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}return MLe(s,{onObjectBegin:()=>{const c={};r(c),o.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(n),n=c,i=null},onArrayEnd:()=>{n=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),n[0]}function RLe(s,e=[],t=h3.DEFAULT){let i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function n(c){i.type==="property"&&(i.length=c-i.offset,i=i.parent)}function o(c){return i.children.push(c),c}MLe(s,{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,n(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,n(c+l)},onLiteralValue:(c,l,d)=>{o({type:sD(c),offset:l,length:d,parent:i,value:c}),n(l+d)},onSeparator:(c,l,d)=>{i.type==="property"&&(c===":"?i.colonOffset=l:c===","&&n(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 jme(s,e){if(!s)return;let t=s;for(const i of e)if(typeof i=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let n=!1;for(const o of t.children)if(Array.isArray(o.children)&&o.children[0].value===i){t=o.children[1],n=!0;break}if(!n)return}else{const n=i;if(t.type!=="array"||n<0||!Array.isArray(t.children)||n>=t.children.length)return;t=t.children[n]}return t}function MLe(s,e,t=h3.DEFAULT){const i=LLe(s,!1);function n(R){return R?()=>R(i.getTokenOffset(),i.getTokenLength()):()=>!0}function o(R){return R?z=>R(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const r=n(e.onObjectBegin),a=o(e.onObjectProperty),c=n(e.onObjectEnd),l=n(e.onArrayBegin),d=n(e.onArrayEnd),h=o(e.onLiteralValue),u=o(e.onSeparator),f=n(e.onComment),p=o(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function b(){for(;;){const R=i.scan();switch(i.getTokenError()){case yl.InvalidUnicode:w(Ho.InvalidUnicode);break;case yl.InvalidEscapeCharacter:w(Ho.InvalidEscapeCharacter);break;case yl.UnexpectedEndOfNumber:w(Ho.UnexpectedEndOfNumber);break;case yl.UnexpectedEndOfComment:m||w(Ho.UnexpectedEndOfComment);break;case yl.UnexpectedEndOfString:w(Ho.UnexpectedEndOfString);break;case yl.InvalidCharacter:w(Ho.InvalidCharacter);break}switch(R){case ft.LineCommentTrivia:case ft.BlockCommentTrivia:m?w(Ho.InvalidCommentToken):f();break;case ft.Unknown:w(Ho.InvalidSymbol);break;case ft.Trivia:case ft.LineBreakTrivia:break;default:return R}}}function w(R,z=[],G=[]){if(p(R),z.length+G.length>0){let Y=i.getToken();for(;Y!==ft.EOF;){if(z.indexOf(Y)!==-1){b();break}else if(G.indexOf(Y)!==-1)break;Y=b()}}}function y(R){const z=i.getTokenValue();return R?h(z):a(z),b(),!0}function C(){switch(i.getToken()){case ft.NumericLiteral:{let R=0;try{R=JSON.parse(i.getTokenValue()),typeof R!="number"&&(w(Ho.InvalidNumberFormat),R=0)}catch{w(Ho.InvalidNumberFormat)}h(R);break}case ft.NullKeyword:h(null);break;case ft.TrueKeyword:h(!0);break;case ft.FalseKeyword:h(!1);break;default:return!1}return b(),!0}function A(){return i.getToken()!==ft.StringLiteral?(w(Ho.PropertyNameExpected,[],[ft.CloseBraceToken,ft.CommaToken]),!1):(y(!1),i.getToken()===ft.ColonToken?(u(":"),b(),P()||w(Ho.ValueExpected,[],[ft.CloseBraceToken,ft.CommaToken])):w(Ho.ColonExpected,[],[ft.CloseBraceToken,ft.CommaToken]),!0)}function L(){r(),b();let R=!1;for(;i.getToken()!==ft.CloseBraceToken&&i.getToken()!==ft.EOF;){if(i.getToken()===ft.CommaToken){if(R||w(Ho.ValueExpected,[],[]),u(","),b(),i.getToken()===ft.CloseBraceToken&&v)break}else R&&w(Ho.CommaExpected,[],[]);A()||w(Ho.ValueExpected,[],[ft.CloseBraceToken,ft.CommaToken]),R=!0}return c(),i.getToken()!==ft.CloseBraceToken?w(Ho.CloseBraceExpected,[ft.CloseBraceToken],[]):b(),!0}function k(){l(),b();let R=!1;for(;i.getToken()!==ft.CloseBracketToken&&i.getToken()!==ft.EOF;){if(i.getToken()===ft.CommaToken){if(R||w(Ho.ValueExpected,[],[]),u(","),b(),i.getToken()===ft.CloseBracketToken&&v)break}else R&&w(Ho.CommaExpected,[],[]);P()||w(Ho.ValueExpected,[],[ft.CloseBracketToken,ft.CommaToken]),R=!0}return d(),i.getToken()!==ft.CloseBracketToken?w(Ho.CloseBracketExpected,[ft.CloseBracketToken],[]):b(),!0}function P(){switch(i.getToken()){case ft.OpenBracketToken:return k();case ft.OpenBraceToken:return L();case ft.StringLiteral:return y(!0);default:return C()}}return b(),i.getToken()===ft.EOF?t.allowEmptyContent?!0:(w(Ho.ValueExpected,[],[]),!1):P()?(i.getToken()!==ft.EOF&&w(Ho.EndOfFileExpected,[],[]),!0):(w(Ho.ValueExpected,[],[]),!1)}function sD(s){switch(typeof s){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(s){if(Array.isArray(s))return"array"}else return"null";return"object"}default:return"null"}}class zSt{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===B.Slash||this._splitOnBackslash&&i===B.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Dh(new GSt(e,t))}static forPaths(e=!1){return new Dh(new y5(void 0,!e))}static forStrings(){return new Dh(new zSt)}static forConfigKeys(){return new Dh(new $St)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);mFe(i);for(const n of i)this.set(n,e)}else{const i=e.slice(0);mFe(i);for(const n of i)this.set(n[0],n[1])}}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new eK,this._root.segment=i.value());const o=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new eK,n.left.segment=i.value()),o.push([nc.Left,n]),n=n.left;else if(a<0)n.right||(n.right=new eK,n.right.segment=i.value()),o.push([nc.Right,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new eK,n.mid.segment=i.value()),o.push([nc.Mid,n]),n=n.mid;else break}const r=n.value;n.value=t,n.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===nc.Right&&h===nc.Right)o[a][1]=c.rotateLeft();else if(d===nc.Left&&h===nc.Left)o[a][1]=c.rotateRight();else if(d===nc.Right&&h===nc.Left)c.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=c.rotateLeft();else if(d===nc.Left&&h===nc.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 nc.Left:o[a-1][1].left=o[a][1];break;case nc.Right:o[a-1][1].right=o[a][1];break;case nc.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 n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<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),n=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)n.push([nc.Left,o]),o=o.left;else if(r<0)n.push([nc.Right,o]),o=o.right;else if(i.hasNext())i.next(),n.push([nc.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(n.length>0){const[a,c]=n[n.length-1];switch(a){case nc.Left:c.left=r;break;case nc.Mid:c.mid=r;break;case nc.Right:c.right=r;break}}else this._root=r}for(let r=n.length-1;r>=0;r--){const a=n[r][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),n[r][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),n[r][1]=a.rotateRight()),r>0)switch(n[r-1][0]){case nc.Left:n[r-1][1].left=n[r][1];break;case nc.Right:n[r-1][1].right=n[r][1];break;case nc.Mid:n[r-1][1].mid=n[r][1];break}else this._root=n[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;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(),n=i.value||n,i=i.mid;else break}return i&&i.value||n}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const o=i.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else return n.mid?this._entries(n.mid):t?n.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)}}var sn;(function(s){s[s.Unknown=0]="Unknown",s[s.File=1]="File",s[s.Directory=2]="Directory",s[s.SymbolicLink=64]="SymbolicLink"})(sn||(sn={}));var lp;(function(s){s[s.Readonly=1]="Readonly",s[s.Locked=2]="Locked"})(lp||(lp={}));var LE;(function(s){s[s.UPDATED=2]="UPDATED",s[s.ADDED=4]="ADDED",s[s.DELETED=8]="DELETED"})(LE||(LE={}));var Vn;(function(s){s[s.None=0]="None",s[s.FileReadWrite=2]="FileReadWrite",s[s.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",s[s.FileReadStream=16]="FileReadStream",s[s.FileFolderCopy=8]="FileFolderCopy",s[s.PathCaseSensitive=1024]="PathCaseSensitive",s[s.Readonly=2048]="Readonly",s[s.Trash=4096]="Trash",s[s.FileWriteUnlock=8192]="FileWriteUnlock",s[s.FileAtomicRead=16384]="FileAtomicRead",s[s.FileAtomicWrite=32768]="FileAtomicWrite",s[s.FileAtomicDelete=65536]="FileAtomicDelete",s[s.FileClone=131072]="FileClone"})(Vn||(Vn={}));function zm(s){return!!(s.capabilities&Vn.FileReadWrite)}function x2e(s){return!!(s.capabilities&Vn.FileFolderCopy)}function KSt(s){return!!(s.capabilities&Vn.FileClone)}function hE(s){return!!(s.capabilities&Vn.FileOpenReadWriteClose)}function Nq(s){return!!(s.capabilities&Vn.FileReadStream)}function yhe(s){return zm(s)?!!(s.capabilities&Vn.FileAtomicRead):!1}function D2e(s){return zm(s)?!!(s.capabilities&Vn.FileAtomicWrite):!1}function qSt(s){return!!(s.capabilities&Vn.FileAtomicDelete)}function QSt(s){return!!(s.capabilities&Vn.Readonly)}var ot;(function(s){s.FileExists="EntryExists",s.FileNotFound="EntryNotFound",s.FileNotADirectory="EntryNotADirectory",s.FileIsADirectory="EntryIsADirectory",s.FileExceedsStorageQuota="EntryExceedsStorageQuota",s.FileTooLarge="EntryTooLarge",s.FileWriteLocked="EntryWriteLocked",s.NoPermissions="NoPermissions",s.Unavailable="Unavailable",s.Unknown="Unknown"})(ot||(ot={}));class xA extends Error{static create(e,t){const i=new xA(e.toString(),t);return sje(i,t),i}constructor(e,t){super(e),this.code=t}}function us(s,e){return xA.create(s,e)}function s0(s){return s||us(g(0,"Unknown Error"),ot.Unknown)}function sje(s,e){return s.name=e?`${e} (FileSystemError)`:"FileSystemError",s}function Vk(s){if(!s)return ot.Unknown;if(s instanceof xA)return s.code;const e=/^(.+) \(FileSystemError\)$/.exec(s.name);if(!e)return ot.Unknown;switch(e[1]){case ot.FileExists:return ot.FileExists;case ot.FileIsADirectory:return ot.FileIsADirectory;case ot.FileNotADirectory:return ot.FileNotADirectory;case ot.FileNotFound:return ot.FileNotFound;case ot.FileTooLarge:return ot.FileTooLarge;case ot.FileWriteLocked:return ot.FileWriteLocked;case ot.NoPermissions:return ot.NoPermissions;case ot.Unavailable:return ot.Unavailable}return ot.Unknown}function $w(s){if(s instanceof Td)return s.fileOperationResult;switch(Vk(s)){case ot.FileNotFound:return Qi.FILE_NOT_FOUND;case ot.FileIsADirectory:return Qi.FILE_IS_DIRECTORY;case ot.FileNotADirectory:return Qi.FILE_NOT_DIRECTORY;case ot.FileWriteLocked:return Qi.FILE_WRITE_LOCKED;case ot.NoPermissions:return Qi.FILE_PERMISSION_DENIED;case ot.FileExists:return Qi.FILE_MOVE_CONFLICT;case ot.FileTooLarge:return Qi.FILE_TOO_LARGE;default:return Qi.FILE_OTHER_ERROR}}var Ai;(function(s){s[s.CREATE=0]="CREATE",s[s.DELETE=1]="DELETE",s[s.MOVE=2]="MOVE",s[s.COPY=3]="COPY",s[s.WRITE=4]="WRITE"})(Ai||(Ai={}));class uP{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var To;(function(s){s[s.UPDATED=0]="UPDATED",s[s.ADDED=1]="ADDED",s[s.DELETED=2]="DELETED"})(To||(To={}));const YF=class YF{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new ya(()=>{const i=Dh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(n=>[n,!0])),i}),this.updated=new ya(()=>{const i=Dh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(n=>[n,!0])),i}),this.deleted=new ya(()=>{const i=Dh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawDeleted.map(n=>[n,!0])),i}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const i of e){switch(i.type){case To.ADDED:this.rawAdded.push(i.resource);break;case To.UPDATED:this.rawUpdated.push(i.resource);break;case To.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==YF.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=YF.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=YF.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 n=i.length>0;return!!((!n||i.includes(To.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!n||i.includes(To.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!n||i.includes(To.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"}};YF.MIXED_CORRELATION=null;let zY=YF;class Td extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class Pq extends Td{constructor(e,t,i,n){super(e,t,n),this.fileOperationResult=t,this.size=i}}class C5 extends Td{constructor(e,t,i){super(e,Qi.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var Qi;(function(s){s[s.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",s[s.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",s[s.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",s[s.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",s[s.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",s[s.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",s[s.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",s[s.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",s[s.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",s[s.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",s[s.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Qi||(Qi={}));const tl={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Eu={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},NLe="files.associations",jSt="files.exclude",oje="files.readonlyInclude",rje="files.readonlyExclude",YSt="files.readonlyFromPermissions";var ba;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(ba||(ba={}));const S_="";function $Y(s){if(!(typeof s.size!="number"||typeof s.mtime!="number"))return s.mtime.toString(29)+s.size.toString(31)}async function aje(s,e){if(!e.hasProvider(N.from({scheme:s.scheme})))return new Promise(t=>{const i=e.onDidChangeFileSystemProviderRegistrations(n=>{n.scheme===s.scheme&&n.added&&(i.dispose(),t())})})}const $l=class $l{static formatSize(e){return lc(e)||(e=0),e<$l.KB?g(1,"{0}B",e.toFixed(0)):e<$l.MB?g(2,"{0}KB",(e/$l.KB).toFixed(2)):e<$l.GB?g(3,"{0}MB",(e/$l.MB).toFixed(2)):e<$l.TB?g(4,"{0}GB",(e/$l.GB).toFixed(2)):g(5,"{0}TB",(e/$l.TB).toFixed(2))}};$l.KB=1024,$l.MB=$l.KB*$l.KB,$l.GB=$l.MB*$l.KB,$l.TB=$l.GB*$l.KB;let Nc=$l;function JSt(s){const e=typeof s=="string"||s?.scheme===pe.vscodeRemote;return typeof s!="string"&&s?.scheme===pe.file?1024*Nc.MB:e?10*Nc.MB:Wn?50*Nc.MB:1024*Nc.MB}function oV(s){return Object.isFrozen(s)?s:x6e(s)}class as{static createEmptyModel(e){return new as({},[],[],void 0,e)}constructor(e,t,i,n,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw?.length){const e=this.raw.map(t=>{if(t instanceof as)return t;const i=new DA("",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?Qj(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return oV(i.rawConfiguration.getValue(e))},get override(){return t?oV(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return oV(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const c=new as(o,a,[],void 0,i.logService).getValue(e);c!==void 0&&n.push({identifiers:r,value:c})}return n.length?oV(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?Qj(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return ja(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return ja(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=xs(this.contents),i=xs(this.overrides),n=[...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=>is(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=ja(c.keys)):i.push(xs(a))}for(const a of r.keys)n.indexOf(a)===-1&&n.push(a)}return new as(t,n,i,o.every(r=>r instanceof as)?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 n of ja([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[n];const r=t[n];r&&(typeof o=="object"&&typeof r=="object"?(o=xs(o),this.mergeContents(o,r)):o=r),i[n]=o}return new as(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&kn(e[i])&&kn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=xs(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=o=>{o&&(i?this.mergeContents(i,o):i=xs(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&n(o.contents);return n(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),sut(this.contents,e),tf.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>is(i.identifiers,M8(e))),1))}updateValue(e,t,i){if(_Ke(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),tf.test(e)){const n=M8(e),o={identifiers:n,keys:Object.keys(this.contents[e]),contents:R8(this.contents[e],a=>this.logService.error(a))},r=this.overrides.findIndex(a=>is(a.identifiers,n));r!==-1?this.overrides[r]=o:this.overrides.push(o)}}}class DA{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||as.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!ra(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:n,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new as(i,n,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseContent(e){let t={},i=null,n=[];const o=[];function r(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}const a={onObjectBegin:()=>{const c={};r(c),o.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(n),n=c,i=null},onArrayEnd:()=>{n=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{}};if(e)try{MLe(e,a),t=n[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return t}doParseRaw(e,t){const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n=this.filter(e,i,!0,t);e=n.raw;const o=R8(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:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){let o=!1;if(!n?.scopes&&!n?.skipRestricted&&!n?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:o};const r={},a=[];for(const c in e)if(tf.test(c)&&i){const l=this.filter(e[c],t,!1,n);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:at.WINDOW:void 0;l?.restricted&&a.push(c),!n.exclude?.includes(c)&&(n.include?.includes(c)||(d===void 0||n.scopes===void 0||n.scopes.includes(d))&&!(n.skipRestricted&&l?.restricted))?r[c]=e[c]:o=!0}return{raw:r,restricted:a,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(tf.test(n)){const o={};for(const r in e[n])o[r]=e[n][r];i.push({identifiers:M8(n),keys:Object.keys(o),contents:R8(o,t)})}return i}}class cje extends V{constructor(e,t,i,n,o){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=n,this.logService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new DA(this.userSettingsResource.toString(),o),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(M.any(M.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userSettingsResource)),M.filter(this.fileService.onDidRunOperation,r=>(r.isOperation(Ai.CREATE)||r.isOperation(Ai.COPY)||r.isOperation(Ai.DELETE)||r.isOperation(Ai.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 as.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class XSt{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,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 oV(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 u3=class lje{constructor(e,t,i,n,o,r,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ui,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=as.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,t===void 0?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=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 n.overrides)for(const l of c.identifiers)n.getOverrideValue(e,l)!==void 0&&a.add(l);return new XSt(e,t,n.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:n,updated:o,removed:r}=uE(this._defaultConfiguration,e);t=[...n,...o,...r]}for(const n of t)for(const o of M8(n)){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=>!Ys(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:n}=uE(this._policyConfiguration,e),o=[...t,...i,...n];return o.length&&this.updatePolicyConfiguration(e),{keys:o,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.applicationConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateApplicationConfiguration(e),{keys:r,overrides:o}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.localUserConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateLocalUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.remoteUserConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateRemoteUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=uE(this.workspaceConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateWorkspaceConfiguration(e),{keys:r,overrides:o}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:n,updated:o,removed:r,overrides:a}=uE(i,t),c=[...n,...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:n,removed:o,overrides:r}=uE(t,void 0);return{keys:[...i,...n,...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 n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.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(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),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:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,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(n=>t.add(n))),[...t.values()]}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=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(N.revive(d[0]),this.parseConfigurationModel(d[1],t)),l),new ui);return new lje(i,n,o,r,as.createEmptyModel(t),a,c,as.createEmptyModel(t),new ui,t)}static parseConfigurationModel(e,t){return new as(e.contents,e.keys,e.overrides,void 0,t)}};function k2e(...s){if(s.length===0)return{keys:[],overrides:[]};if(s.length===1)return s[0];const e=new Set,t=new Map;for(const n of s)n.keys.forEach(o=>e.add(o)),n.overrides.forEach(([o,r])=>{const a=Cj(t,o,new Set);r.forEach(c=>a.add(c))});const i=[];return t.forEach((n,o)=>i.push([o,[...n.values()]])),{keys:[...e.values()],overrides:i}}class PLe{constructor(e,t,i,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,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=u3.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const o=n+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!Ys(a,c)}return!0}}function uE(s,e){const{added:t,removed:i,updated:n}=I2e(e?.rawConfiguration,s?.rawConfiguration),o=[],r=s?.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(s){const c=r.filter(l=>!a.includes(l));for(const l of c)o.push([l,s.getKeysForOverrideIdentifier(l)])}if(e&&s){for(const c of r)if(a.includes(c)){const l=I2e({contents:s.getOverrideValue(void 0,c)||{},keys:s.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:n,overrides:o}}function I2e(s,e){const t=s?e?s.keys.filter(o=>e.keys.indexOf(o)===-1):[...s.keys]:[],i=e?s?e.keys.filter(o=>s.keys.indexOf(o)===-1):[...e.keys]:[],n=[];if(s&&e){for(const o of e.keys)if(s.keys.indexOf(o)!==-1){const r=Qj(e.contents,o),a=Qj(s.contents,o);Ys(r,a)||n.push(o)}}return{added:t,removed:i,updated:n}}const ZSt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class dje extends V{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:M.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new J7,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=dF.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Cm,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 Fi(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"),HY;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),HY;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,n)}_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 Cre("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(g(1256,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:n})=>n).join(", ");this._currentChordStatusMessage=this._notificationService.status(g(1257,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),c5.enabled&&c5.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],c5.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),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=dF.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=dF.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new dF(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 n=!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."),n;const a=this._contextKeyService.getContext(t),c=e.getLabel(),l=this._getResolver().resolve(a,r,o);switch(l.kind){case nf.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(1258,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}return n}case nf.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(o,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case nf.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(1258,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(n=!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}ZSt.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=S.KeyA&&e.keyCode<=S.KeyZ||e.keyCode>=S.Digit0&&e.keyCode<=S.Digit9}}const sse=class sse{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}}};sse.EMPTY=new sse(null);let dF=sse;class Dx{constructor(e,t,i,n,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?GY(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=GY(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===B.Caret:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function GY(s){const e=[];for(let t=0,i=s.length;tthis._getLabel(e))}getAriaLabel(){return hje.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:eAt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return FLe.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 slt(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 Y2 extends OLe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===Ds.Macintosh)switch(e){case S.LeftArrow:return"←";case S.UpArrow:return"↑";case S.RightArrow:return"→";case S.DownArrow:return"↓"}return Ia.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Ia.toString(e.keyCode)}_getElectronAccelerator(e){return Ia.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Ia.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return Y2.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+=Ia.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===S.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===S.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===S.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===S.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=Vg[e];if(t!==S.DependsOnKbLayout)return t;switch(e){case X.KeyA:return S.KeyA;case X.KeyB:return S.KeyB;case X.KeyC:return S.KeyC;case X.KeyD:return S.KeyD;case X.KeyE:return S.KeyE;case X.KeyF:return S.KeyF;case X.KeyG:return S.KeyG;case X.KeyH:return S.KeyH;case X.KeyI:return S.KeyI;case X.KeyJ:return S.KeyJ;case X.KeyK:return S.KeyK;case X.KeyL:return S.KeyL;case X.KeyM:return S.KeyM;case X.KeyN:return S.KeyN;case X.KeyO:return S.KeyO;case X.KeyP:return S.KeyP;case X.KeyQ:return S.KeyQ;case X.KeyR:return S.KeyR;case X.KeyS:return S.KeyS;case X.KeyT:return S.KeyT;case X.KeyU:return S.KeyU;case X.KeyV:return S.KeyV;case X.KeyW:return S.KeyW;case X.KeyX:return S.KeyX;case X.KeyY:return S.KeyY;case X.KeyZ:return S.KeyZ;case X.Digit1:return S.Digit1;case X.Digit2:return S.Digit2;case X.Digit3:return S.Digit3;case X.Digit4:return S.Digit4;case X.Digit5:return S.Digit5;case X.Digit6:return S.Digit6;case X.Digit7:return S.Digit7;case X.Digit8:return S.Digit8;case X.Digit9:return S.Digit9;case X.Digit0:return S.Digit0;case X.Minus:return S.Minus;case X.Equal:return S.Equal;case X.BracketLeft:return S.BracketLeft;case X.BracketRight:return S.BracketRight;case X.Backslash:return S.Backslash;case X.IntlHash:return S.Unknown;case X.Semicolon:return S.Semicolon;case X.Quote:return S.Quote;case X.Backquote:return S.Backquote;case X.Comma:return S.Comma;case X.Period:return S.Period;case X.Slash:return S.Slash;case X.IntlBackslash:return S.IntlBackslash}return S.Unknown}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Ih)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===S.Unknown?null:new Ih(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=GY(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new Y2(i,t)]:[]}}const Fs=ae("labelService"),cg=ae("progressService"),XA=ae("editorProgressService"),uje="telemetry.telemetryLevel",iAt="telemetry.enableCrashReporter",gje="telemetry.enableTelemetry";var Kg;(function(s){s[s.NONE=0]="NONE",s[s.CRASH=1]="CRASH",s[s.ERROR=2]="ERROR",s[s.USAGE=3]="USAGE"})(Kg||(Kg={}));var Q0;(function(s){s.OFF="off",s.CRASH="crash",s.ERROR="error",s.ON="all"})(Q0||(Q0={}));function P_(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.uri)}function nAt(s){return typeof s?.id=="string"&&!P_(s)&&!iA(s)}const BLe={id:"empty-window"};function GO(s,e){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:Ko(s)}:BLe;const t=s;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 iA(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.configPath)}var qi;(function(s){s[s.EMPTY=1]="EMPTY",s[s.FOLDER=2]="FOLDER",s[s.WORKSPACE=3]="WORKSPACE"})(qi||(qi={}));function Yme(s){const e=s;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function fje(s){const e=s;return!!(e&&typeof e=="object"&&N.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let pje=class{constructor(e,t,i,n,o){this._id=e,this._transient=i,this._configuration=n,this._ignorePathCasing=o,this._foldersMap=Dh.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=Dh.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}}},pae=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return Pt(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function KY(s){return new pae({uri:s,index:0,name:EA(s)},{uri:s.toString()})}const xb="code-workspace",mje=`.${xb}`,sAt=[{name:g(792,"Code Workspace"),extensions:[xb]}];function g3(s,e){return EGe.isEqualOrParent(s,e.untitledWorkspacesHome)}function Py(s){let e;return N.isUri(s)?e=s:e=s.configuration,e?.scheme===pe.tmp}const _je="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function oAt(s){return s.id===_je}function Jme(s,e){return!g3(s,e)&&!Py(s)}function mae(s){return(typeof s=="string"?Gy(s):vU(s))===mje}const yi=ae("contextService");var kg;(function(s){s.accessibilityHelpTitle=g(1259,"Accessibility Help"),s.openingDocs=g(1260,"Opening the Accessibility documentation page."),s.readonlyDiffEditor=g(1261,"You are in a read-only pane of a diff editor."),s.editableDiffEditor=g(1262,"You are in a pane of a diff editor."),s.readonlyEditor=g(1263,"You are in a read-only code editor."),s.editableEditor=g(1264,"You are in a code editor."),s.changeConfigToOnMac=g(1265,"Configure the application to be optimized for usage with a Screen Reader (Command+E)."),s.changeConfigToOnWinLinux=g(1266,"Configure the application to be optimized for usage with a Screen Reader (Control+E)."),s.auto_on=g(1267,"The application is configured to be optimized for usage with a Screen Reader."),s.auto_off=g(1268,"The application is configured to never be optimized for usage with a Screen Reader."),s.screenReaderModeEnabled=g(1269,"Screen Reader Optimized Mode enabled."),s.screenReaderModeDisabled=g(1270,"Screen Reader Optimized Mode disabled."),s.tabFocusModeOnMsg=g(1271,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior{0}.",""),s.tabFocusModeOffMsg=g(1272,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior{0}",""),s.stickScroll=g(1273,"Focus Sticky Scroll{0} to focus the currently nested scopes.",""),s.showAccessibilityHelpAction=g(1274,"Show Accessibility Help"),s.listSignalSounds=g(1275,"Run the command: List Signal Sounds for an overview of all sounds and their current status."),s.listAlerts=g(1276,"Run the command: List Signal Announcements for an overview of announcements and their current status."),s.quickChat=g(1277,"Toggle quick chat{0} to open or close a chat session.",""),s.startInlineChat=g(1278,"Start inline chat{0} to create an in editor chat session.",""),s.setBreakpoint=g(1279,"The Debug: Inline Breakpoint command{0} will set or unset a breakpoint at the current cursor position in the active editor.",""),s.debugExecuteSelection=g(1280,"The Debug: Execute Selection command{0} will execute the selected text in the debug console.","")})(kg||(kg={}));var T2e;(function(s){s.inspectTokensAction=g(1281,"Developer: Inspect Tokens")})(T2e||(T2e={}));var qY;(function(s){s.editorViewAccessibleLabel=g(1288,"Editor content"),s.accessibilityHelpMessage=g(1289,"Press Alt+F1 for Accessibility Options.")})(qY||(qY={}));var L2e;(function(s){s.toggleHighContrast=g(1290,"Toggle High Contrast Theme")})(L2e||(L2e={}));var Xme;(function(s){s.bulkEditServiceSummary=g(1291,"Made {0} edits in {1} files")})(Xme||(Xme={}));const _ae=ae("workspaceTrustEnablementService"),uC=ae("workspaceTrustManagementService"),vae=ae("workspaceTrustRequestService");let zk=[],WLe=[],HLe=[];function tK(s,e=!1){vje(s,!1,e)}function rAt(s){vje(s,!0,!1)}function vje(s,e,t){const i=aAt(s,e);zk.push(i),i.userConfigured?HLe.push(i):WLe.push(i),t&&!i.userConfigured&&zk.forEach(n=>{n.mime===i.mime||n.userConfigured||(i.extension&&n.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&n.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&n.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&n.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function aAt(s,e){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:e,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?j_(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(Vi.sep)>=0:!1}}function cAt(){zk=zk.filter(s=>s.userConfigured),WLe=[]}function lAt(){zk=zk.filter(s=>!s.userConfigured),HLe=[]}function dAt(s,e){return hAt(s,e).map(t=>t.id)}function hAt(s,e){let t;if(s)switch(s.scheme){case pe.file:t=s.fsPath;break;case pe.data:{t=Mk.parseMetaData(s).get(Mk.META_DATA_LABEL);break}case pe.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:Us.unknown}];t=t.toLowerCase();const i=Ko(t),n=R2e(t,i,HLe);if(n)return[n,{id:Ca,mime:Us.text}];const o=R2e(t,i,WLe);if(o)return[o,{id:Ca,mime:Us.text}];if(e){const r=uAt(e);if(r)return[r,{id:Ca,mime:Us.text}]}return[{id:"unknown",mime:Us.unknown}]}function R2e(s,e,t){let i,n,o;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!n||a.filepattern.length>n.filepattern.length)){const c=a.filepatternOnPath?s:e;a.filepatternLowercase?.(c)&&(n=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&e.endsWith(a.extensionLowercase)&&(o=a)}if(i)return i;if(n)return n;if(o)return o}function uAt(s){if(eTe(s)&&(s=s.substr(1)),s.length>0)for(let e=zk.length-1;e>=0;e--){const t=zk[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t}}const gv=Object.prototype.hasOwnProperty,M2e="vs.editor.nullLanguage";class gAt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(M2e,_T.Null),this._register(Ca,_T.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)||_T.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||M2e}}const Oz=class Oz extends V{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Oz.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new gAt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(wT.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Oz.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},cAt();const e=[].concat(wT.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return wT.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(n=>{this._lowercaseNameMap[n.toLowerCase()]=i.identifier}),i.mimetypes.forEach(n=>{this._mimeTypesMap[n]=i.identifier})}),Qe.as(Nn.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;gv.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 n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),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)tK({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)tK({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)tK({id:i,mime:n,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);J1e(c)||tK({id:i,mime:n,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?gv.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)gv.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>wS(t.languageName,i.languageName)),e}getLanguageName(e){return gv.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return gv.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return gv.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return gv.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return gv.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return gv.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return gv.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&gv.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:dAt(e,t)}};Oz.instanceCount=0;let Zme=Oz;const Bz=class Bz extends V{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,Bz.instanceCount++,this._registry=this._register(new Zme(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Bz.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 lm(i,null)}createById(e){return new Che(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new Che(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new Che(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Ca),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),Ta.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Bz.instanceCount=0;let QY=Bz;class Che{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 fAt extends V{constructor(e,t){super(),this._register(ue(e,"dragover",i=>{i.preventDefault(),this.timeout||(this.timeout=setTimeout(()=>{t(),this.timeout=null},800))})),["dragleave","drop","dragend"].forEach(i=>{this._register(ue(e,i,()=>{this.clearDragTimeout()}))})}clearDragTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){super.dispose(),this.clearDragTimeout()}}const sp={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Us.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},pAt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let bae=pAt;const mAt=new ya(()=>bae("mouse",!1)),_At=new ya(()=>bae("element",!1));function bje(s){bae=s}function Pr(s){return s==="element"?_At.value:mAt.value}function $k(){return bae("element",!0)}class vAt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function wje(s){return(e,t,i)=>{let n=null,o=null;if(typeof i.value=="function"?(n="value",o=i.value):typeof i.get=="function"&&(n="get",o=i.get),!o)throw new Error("not supported");i[n]=s(o,t)}}function Zt(s,e,t){let i=null,n=null;if(typeof t.value=="function"?(i="value",n=t.value,n.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",n=t.get),!n)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:n.apply(this,r)}),this[o]}}function ULe(s,e,t){return wje((i,n)=>{const o=`$debounce$${n}`,r=`$debounce$result$${n}`;return function(...a){this[r]||(this[r]=void 0),clearTimeout(this[o]),this[o]=setTimeout(()=>{i.apply(this,a),this[r]=void 0},s)}})}function bAt(s,e,t){return wje((i,n)=>{const o=`$throttle$timer$${n}`,r=`$throttle$result$${n}`,a=`$throttle$lastRun$${n}`,c=`$throttle$pending$${n}`;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]+s;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 wAt=".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}";ut(wAt,{});var T1;(function(s){s[s.Copy=0]="Copy",s[s.Move=1]="Move"})(T1||(T1={}));var by;(function(s){s.Over="drop-target",s.Before="drop-target-before",s.After="drop-target-after"})(by||(by={}));class WI extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function N2e(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.ende.concat(t),[]))}class SAt{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 n=i.length-t,o=N2e({start:0,end:e},this.groups),r=N2e({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:e_e(c.range,n),size:c.size})),a=i.map((c,l)=>({range:{start:e+l,end:e+l+1},size:c.size}));this.groups=CAt(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 HI={CurrentDragAndDropData:void 0};var IC;(function(s){s[s.TOP=0]="TOP",s[s.CENTER_TOP=1]="CENTER_TOP",s[s.CENTER_BOTTOM=2]="CENTER_BOTTOM",s[s.BOTTOM=3]="BOTTOM"})(IC||(IC={}));const jb={useShadows:!0,verticalScrollMode:Co.Auto,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class m6{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class yje{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class t_e{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;tn,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 ose=class ose{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:ZV(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,n=jb){if(this.virtualDelegate=t,this.domId=`list_id_${++ose.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Mh(50),this.splicing=!1,this.dragOverAnimationStopDisposable=V.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=V.None,this.onDragLeaveTimeout=V.None,this.disposables=new Z,this._onDidChangeContentHeight=new I,this._onDidChangeContentWidth=new I,this.onDidChangeContentHeight=M.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this.onDidChangeContentWidth=M.latch(this._onDidChangeContentWidth.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(n.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new AAt(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 n.mouseSupport=="boolean"?n.mouseSupport:!0),this._horizontalScrolling=n.horizontalScrolling??jb.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new xAt(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??jb.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(fd.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new yN({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>Ll(ct(this.domNode),r)})),this.scrollableElement=this.disposables.add(new l6(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??jb.alwaysConsumeMouseWheel,horizontal:Co.Auto,vertical:n.verticalScrollMode??jb.verticalScrollMode,useShadows:n.useShadows??jb.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ue(this.rowsContainer,uo.Change,r=>this.onTouchChange(r))),this.disposables.add(ue(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(ue(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=n.setRowLineHeight??jb.setRowLineHeight,this.setRowHeight=n.setRowHeight??jb.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??jb.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(jb.dnd),this.layout(n.initialSize?.height,n.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),n=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+n),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 n=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=n+this.probeDynamicHeight(e)}if(n===t)return;const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let r=0;ee&&i=r.start;A--){const L=this.items[A];if(L.dragStartDisposable.dispose(),L.checkedDisposable.dispose(),L.row){let k=a.get(L.templateId);k||(k=[],a.set(L.templateId,k));const P=this.renderers.get(L.templateId);P&&P.disposeElement&&P.disposeElement(L.element,A,L.row.templateData,L.size),k.unshift(L.row)}L.row=null,L.stale=!0}const c={start:e+t,end:this.items.length},l=Md.intersect(c,n),d=Md.relativeComplement(c,n),h=i.map(A=>({id:String(this.itemId++),element:A,templateId:this.virtualDelegate.getTemplateId(A),size:this.virtualDelegate.getHeight(A),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(A),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:V.None,checkedDisposable:V.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=e_e(l,f),v=Md.intersect(p,m);for(let A=v.start;Ae_e(A,f)),C=[{start:e,end:e+i.length},...w].map(A=>Md.intersect(p,A)).reverse();for(const A of C)for(let L=A.end-1;L>=A.start;L--){const k=this.items[L],R=a.get(k.templateId)?.pop();this.insertItemInDOM(L,R)}for(const A of a.values())for(const L of A)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(A=>A.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ll(ct(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:cTe(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:ZV(this.domNode)})}render(e,t,i,n,o,r=!1){const a=this.getRenderRange(t,i),c=Md.relativeComplement(a,e).reverse(),l=Md.relativeComplement(e,a);if(r){const d=Md.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)}),n!==void 0&&(this.rowsContainer.style.left=`-${n}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 n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);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=ue(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=ZV(e.row.domNode);const t=ct(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 M.map(this.disposables.add(new ii(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return M.map(this.disposables.add(new ii(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return M.filter(M.map(this.disposables.add(new ii(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseUp(){return M.map(this.disposables.add(new ii(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return M.map(this.disposables.add(new ii(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return M.map(this.disposables.add(new ii(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return M.map(this.disposables.add(new ii(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return M.map(this.disposables.add(new ii(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return M.any(M.map(this.disposables.add(new ii(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),M.map(this.disposables.add(new ii(this.domNode,uo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return M.map(this.disposables.add(new ii(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return M.map(this.disposables.add(new ii(this.rowsContainer,uo.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],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,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 n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(sp.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(n,i)),typeof o>"u"&&(o=String(n.length));const r=fe(".monaco-drag-image");r.textContent=o,(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode).appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>r.remove(),0)}this.domNode.classList.add("dragging"),this.currentDragData=new m6(n),HI.CurrentDragAndDropData=new yje(n),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),HI.CurrentDragAndDropData&&HI.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(HI.CurrentDragAndDropData)this.currentDragData=HI.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new t_e}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===T1.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=ja(i).filter(o=>o>=-1&&oo-r),i=i[0]===-1?[-1]:i;let n=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:by.Over;if(EAt(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===n)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=n,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(n),this.rowsContainer.classList.add(n),this.currentDragFeedbackDisposable=Ee(()=>{this.domNode.classList.remove(n),this.rowsContainer.classList.remove(n)});else{if(i.length>1&&n!==by.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");n===by.After&&i[0]{for(const o of i){const r=this.items[o];r.dropTarget=!1,r.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=jy(()=>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,HI.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,HI.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=V.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=Vj(this.domNode).top;this.dragOverAnimationDisposable=Udt(ct(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=jy(()=>{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,n=Math.floor(i/.25);return Ka(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(Yr(i)||Pdt(i))&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const o=Number(n);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 n=this.getRenderRange(e,t);let o,r;e===this.elementTop(n.start)?(o=n.start,r=0):n.end-n.start>1&&(o=n.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;us===e;function J2(s=_p){return(e,t)=>is(e,t,s)}function DAt(){return(s,e)=>s.equals(e)}function Fq(s,e,t){if(t!==void 0){const i=s;return i==null||e===void 0||e===null?e===i:t(i,e)}else{const i=s;return(n,o)=>n==null||o===void 0||o===null?o===n:i(n,o)}}function jY(s,e){if(s===e)return!0;if(Array.isArray(s)&&Array.isArray(e)){if(s.length!==e.length)return!1;for(let t=0;t{const o=VLe(n);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(n.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:n},o=>n(this.read(o),o))}flatten(){return s_e({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(Sje(this,t)),this}keepObserved(e){return e.add(Aje(this)),this}get debugValue(){return this.get()}}class IU extends Eje{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 ts(s,e){const t=new TU(s,e);try{s(t)}finally{t.finish()}}let iK;function rV(s){if(iK)s(iK);else{const e=new TU(s,void 0);iK=e;try{s(e)}finally{e.finish(),iK=void 0}}}async function xje(s,e){const t=new TU(s,e);try{await s(t)}finally{t.finish()}}function SM(s,e,t){s?e(s):ts(e,t)}class TU{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():VLe(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{const o=this._value;this._setValue(e),Cje()?.handleObservableChanged(this,{oldValue:o,newValue:e,change:i,didChange:!0,hadValue:!0});for(const r of this.observers)t.updateObserver(r,this),r.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function f3(s,e){let t;return typeof s=="string"?t=new Yd(void 0,s,void 0):t=new Yd(s,void 0,void 0),new WAt(t,e,_p)}class WAt extends zLe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function Ze(s,e){return e!==void 0?new AM(new Yd(s,void 0,e),e,void 0,void 0,void 0,_p):new AM(new Yd(void 0,void 0,s),s,void 0,void 0,void 0,_p)}function _6(s,e,t){return new HAt(new Yd(s,void 0,e),e,void 0,void 0,void 0,_p,t)}function Jh(s,e){return new AM(new Yd(s.owner,s.debugName,s.debugReferenceFn),e,void 0,void 0,s.onLastObserverRemoved,s.equalsFn??_p)}BAt(Jh);function Dje(s,e){return new AM(new Yd(s.owner,s.debugName,void 0),e,s.createEmptyChangeSummary,s.handleChange,void 0,s.equalityComparer??_p)}function AI(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new Z;return new AM(new Yd(i,void 0,t),o=>(n.clear(),t(o,n)),void 0,void 0,()=>n.dispose(),_p)}function mh(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);let n;return new AM(new Yd(i,void 0,t),o=>{n?n.clear():n=new Z;const r=t(o);return r&&n.add(r),r},void 0,void 0,()=>{n&&(n.dispose(),n=void 0)},_p)}var Sd;(function(s){s[s.initial=0]="initial",s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(Sd||(Sd={}));class AM extends IU{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n,o=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=Sd.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=Sd.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===Sd.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===Sd.stale)break}this.state===Sd.dependenciesMightHaveChanged&&(this.state=Sd.upToDate),this._recomputeIfNeeded()}while(this.state!==Sd.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===Sd.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==Sd.initial,i=this.value;this.state=Sd.upToDate;const n=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,n)}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===Sd.upToDate&&(this.state=Sd.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)}G_(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===Sd.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=Sd.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,n=this.state===Sd.upToDate;if(i&&(this.state===Sd.dependenciesMightHaveChanged||n)&&(this.state=Sd.stale,n))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 HAt extends AM{constructor(e,t,i,n,o=void 0,r,a){super(e,t,i,n,o,r),this.set=a}}function ai(s){return new wae(new Yd(void 0,void 0,s),s,void 0,void 0)}function v6(s,e){return new wae(new Yd(s.owner,s.debugName,s.debugReferenceFn??e),e,void 0,void 0)}function LU(s,e){return new wae(new Yd(s.owner,s.debugName,s.debugReferenceFn??e),e,s.createEmptyChangeSummary,s.handleChange)}function UAt(s,e){const t=new Z,i=LU({owner:s.owner,debugName:s.debugName,debugReferenceFn:s.debugReferenceFn??e,createEmptyChangeSummary:s.createEmptyChangeSummary,handleChange:s.handleChange},(n,o)=>{t.clear(),e(n,o,t)});return Ee(()=>{i.dispose(),t.dispose()})}function cu(s){const e=new Z,t=v6({owner:void 0,debugName:void 0,debugReferenceFn:s},i=>{e.clear(),s(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var xf;(function(s){s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(xf||(xf={}));class wae{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=xf.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),gU(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),fU(this)}_runIfNeeded(){if(this.state===xf.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=xf.upToDate;const t=this.disposed;try{if(!t){Cje()?.handleAutorunTriggered(this);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===xf.upToDate&&(this.state=xf.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===xf.dependenciesMightHaveChanged){this.state=xf.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===xf.stale)break}this._runIfNeeded()}while(this.state!==xf.upToDate);this.updateCount--,G_(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===xf.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=xf.dependenciesMightHaveChanged)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:n=>n===e},this.changeSummary))&&(this.state=xf.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(s){s.Observer=wae})(ai||(ai={}));function nd(s){return new VAt(s)}class VAt extends Eje{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 Kn(...s){let e,t,i;return s.length===3?[e,t,i]=s:[t,i]=s,new kx(new Yd(e,void 0,i),t,i,()=>kx.globalTransaction,_p)}function zAt(s,e,t){return new kx(new Yd(s.owner,s.debugName,s.debugReferenceFn??t),e,t,()=>kx.globalTransaction,s.equalsFn??_p)}class kx extends IU{constructor(e,t,i,n,o){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=o,this.hasValue=!1,this.handleEvent=r=>{const a=this._getValue(r),c=this.value;(!this.hasValue||!this._equalityComparator(c,a))&&(this.value=a,this.hasValue&&SM(this._getTransaction(),d=>{for(const h of this.observers)d.updateObserver(h,this),h.handleChange(this,void 0)},()=>{const d=this.getDebugName();return"Event fired"+(d?`: ${d}`:"")}),this.hasValue=!0)}}getDebugName(){return this._debugNameData.getDebugName(this)}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(s){s.Observer=kx;function e(t,i){let n=!1;kx.globalTransaction===void 0&&(kx.globalTransaction=t,n=!0);try{i()}finally{n&&(kx.globalTransaction=void 0)}}s.batchEventsGlobally=e})(Kn||(Kn={}));function id(s,e){return new $At(s,e)}class $At extends IU{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{ts(i=>{for(const n of this.observers)i.updateObserver(n,this),n.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function gC(s){return typeof s=="string"?new W2e(s):new W2e(void 0,s)}class W2e extends IU{get debugName(){return new Yd(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){ts(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 Oq(s){const e=new kje(!1,void 0);return s.addObserver(e),Ee(()=>{s.removeObserver(e)})}OAt(Oq);function FN(s,e){const t=new kje(!0,e);return s.addObserver(t),e?e(s.get()):s.reportChanges(),Ee(()=>{s.removeObserver(t)})}FAt(FN);class kje{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 b6(s,e){let t;return Jh({owner:s,debugReferenceFn:e},n=>(t=e(n,t),t))}function GAt(s,e){let t;const i=gC("derivedObservableWithWritableCache"),n=Ze(s,o=>(i.read(o),t=e(o,t),t));return Object.assign(n,{clearCache:o=>{t=void 0,i.trigger(o)},setCache:(o,r)=>{t=o,i.trigger(r)}})}function YY(s,e,t,i){let n=new H2e(t,i);return Jh({debugReferenceFn:t,owner:s,onLastObserverRemoved:()=>{n.dispose(),n=new H2e(t)}},r=>(n.setItems(e.read(r)),n.getItems()))}class H2e{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 n of e){const o=this._keySelector?this._keySelector(n):n;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new Z;r={out:this._map(n,a),store:a},this._cache.set(o,r)}t.push(r.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}}class $Le{constructor(e){this.observable=e}get onDidChange(){return M.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function Ije(s,e){return e instanceof $Le?e.observable:Kn(s,e.onDidChange,()=>e.value)}function KAt(s,e){return b6(s,(t,i)=>i??e(t))}class qAt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(o=>o.templateData===i);if(n>=0){const o=this.renderedElements[n];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 n=[];for(const o of this.renderedElements)o.index=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}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 p3=class{get name(){return this._trait}get renderer(){return new qAt(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new I,this.onChange=this._onChange.event}splice(e,t,i){const n=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+n);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(V2e),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=r_e(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return y2(this.sortedIndexes,e,V2e)>=0}dispose(){bt(this._onChange)}};p3.__decorator=D([Zt],p3.prototype,"renderer",null);class QAt extends p3{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 She{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 n=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(n.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(n),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function nA(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function w6(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:w6(s.parentElement,e)}function aV(s){return w6(s,"monaco-editor")}function jAt(s){return w6(s,"monaco-custom-toggle")}function YAt(s){return w6(s,"action-item")}function S5(s){return w6(s,"monaco-tree-sticky-row")}function m3(s){return s.classList.contains("monaco-tree-sticky-container")}function Tje(s){return s.tagName==="A"&&s.classList.contains("monaco-button")||s.tagName==="DIV"&&s.classList.contains("monaco-button-dropdown")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:Tje(s.parentElement)}class o_e{get onKeyDown(){return M.chain(this.disposables.add(new ii(this.view.domNode,"keydown")).event,e=>e.filter(t=>!nA(t.target)).map(t=>new En(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(n=>{switch(n.keyCode){case S.Enter:return this.onEnter(n);case S.UpArrow:return this.onUpArrow(n);case S.DownArrow:return this.onDownArrow(n);case S.PageUp:return this.onPageUpArrow(n);case S.PageDown:return this.onPageDownArrow(n);case S.Escape:return this.onEscape(n);case S.KeyA:this.multipleSelectionSupport&&(Qt?n.metaKey:n.ctrlKey)&&this.onCtrlA(n)}}))}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(Au(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()}}o_e.__decorator=D([Zt],o_e.prototype,"onKeyDown",null);var Gw;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(Gw||(Gw={}));var hF;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(hF||(hF={}));const JAt=new class{mightProducePrintableCharacter(s){return s.ctrlKey||s.metaKey||s.altKey?!1:s.keyCode>=S.KeyA&&s.keyCode<=S.KeyZ||s.keyCode>=S.Digit0&&s.keyCode<=S.Digit9||s.keyCode>=S.Numpad0&&s.keyCode<=S.Numpad9||s.keyCode>=S.Semicolon&&s.keyCode<=S.Quote}};class XAt{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=hF.Idle,this.mode=Gw.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??Gw.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=M.chain(this.enabledDisposables.add(new ii(this.view.domNode,"keydown")).event,o=>o.filter(r=>!nA(r.target)).filter(()=>this.mode===Gw.Automatic||this.triggered).map(r=>new En(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>en.stop(r,!0)).map(r=>r.browserEvent.key)),i=M.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);M.reduce(M.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"?Mr(t):t&&Mr(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=hF.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===hF.Idle?1:0;this.state=hF.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"||CM(e,c)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class ZAt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=M.chain(this.disposables.add(new ii(t.domNode,"keydown")).event,o=>o.filter(r=>!nA(r.target)).map(r=>new En(r)));M.chain(i,o=>o.filter(r=>r.keyCode===S.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 n=i.querySelector("[tabIndex]");if(!n||!Yr(n)||n.tabIndex===-1)return;const o=ct(n).getComputedStyle(n);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function Lje(s){return Qt?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function Rje(s){return s.browserEvent.shiftKey}function eEt(s){return hTe(s)&&s.button===2}const U2e={isSelectionSingleChangeEvent:Lje,isSelectionRangeChangeEvent:Rje};class Mje{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||U2e),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(fd.addTarget(e.getHTMLElement()))),M.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||U2e))}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){aV(e.browserEvent.target)||Bc()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(nA(e.browserEvent.target)||aV(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||nA(e.browserEvent.target)||aV(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),eEt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(nA(e.browserEvent.target)||aV(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 n=Math.min(i,t),o=Math.max(i,t),r=Au(n,o+1),a=this.list.getSelection(),c=nEt(r_e(a,[i]),i);if(c.length===0)return;const l=r_e(r,sEt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),o=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class Nje{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(` +|${" --- |".repeat(i)}`;return Uu.lexer(a)}}function c2e(s,e){return TGe(s,e),Ee(()=>LGe(s))}var wSt=".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}";ut(wSt,{});var Hme,oL;let q_=(oL=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 n=new Z,o=n.add(d6(e,{...this._getRenderOptions(e,n),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{let o;i?o=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(o=this._options.editor.getModel()?.getLanguageId()),o||(o=Ca);const r=await wwt(this._languageService,n,o),a=document.createElement("span");if(a.innerHTML=Hme._ttpTokenizer?.createHTML(r)??r,this._options.editor){const c=this._options.editor.getOption(x.fontInfo);xl(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=>cae(this._openerService,i,e.isTrusted),disposables:t}}}},Hme=oL,oL._ttpTokenizer=KA("tokenizeToString",{createHTML(e){return e}}),oL);q_=Hme=D([_(1,xi),_(2,Ao)],q_);async function cae(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:ySt(t)})}catch(i){return vt(i),!1}}function ySt(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}const Gb=fe;var Hr;(function(s){s[s.PointerSize=3]="PointerSize",s[s.HoverBorderWidth=2]="HoverBorderWidth",s[s.HoverWindowEdgeMargin=2]="HoverWindowEdgeMargin"})(Hr||(Hr={}));let Ume=class extends gd{get _targetWindow(){return ct(this._target.targetElements[0])}get _targetDocumentElement(){return ct(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===vo.BELOW?Wf.BELOW:Wf.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,n,o,r){super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,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=>cae(this._openerService,u,cd(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new CSt(e.target),this._hoverPointer=e.appearance?.showPointer?Gb("div.workbench-hover-pointer"):void 0,this._hover=this._register(new dLe),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??vo.ABOVE,this.onmousedown(this._hover.containerDomNode,u=>u.stopPropagation()),this.onkeydown(this._hover.containerDomNode,u=>{u.equals(S.Escape)&&this.dispose()}),this._register(ue(this._targetWindow,"blur",()=>this.dispose()));const a=Gb("div.hover-row.markdown-hover"),c=Gb("div.hover-contents");if(typeof e.content=="string")c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(Yr(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const u=e.content,f=this._instantiationService.createInstance(q_,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||rd.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=Gb("div.hover-row.status-bar"),f=Gb("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=Gb("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"||cd(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):l=e.persistence.hideOnHover,l&&e.appearance?.showHoverHint){const u=Gb("div.hover-row.status-bar"),f=Gb("div.info");f.textContent=g(4885,"Hold {0} key to mouse over",Qt?"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 l2e(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),l){const u=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new l2e(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=Mre(this._hoverContainer,Gb("div")),n=re(this._hoverContainer,Gb("div"));i.tabIndex=0,n.tabIndex=0,this._register(ue(n,"focus",o=>{e.focus(),o.preventDefault()})),this._register(ue(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&vQe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());i&&Ch(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=NGe(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:n,bottom:o,left:r}=t[0],a=n-r,c=o-i,l={top:i,right:n,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 vo.RIGHT:l.left+=Hr.PointerSize,l.right+=Hr.PointerSize,this._hoverContainer.style.paddingLeft=`${Hr.PointerSize}px`,this._hoverContainer.style.marginLeft=`${-Hr.PointerSize}px`;break;case vo.LEFT:l.left-=Hr.PointerSize,l.right-=Hr.PointerSize,this._hoverContainer.style.paddingRight=`${Hr.PointerSize}px`,this._hoverContainer.style.marginRight=`${-Hr.PointerSize}px`;break;case vo.BELOW:l.top+=Hr.PointerSize,l.bottom+=Hr.PointerSize,this._hoverContainer.style.paddingTop=`${Hr.PointerSize}px`,this._hoverContainer.style.marginTop=`${-Hr.PointerSize}px`;break;case vo.ABOVE:l.top-=Hr.PointerSize,l.bottom-=Hr.PointerSize,this._hoverContainer.style.paddingBottom=`${Hr.PointerSize}px`,this._hoverContainer.style.marginBottom=`${-Hr.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+Hr.HoverBorderWidth;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===vo.RIGHT?this._x=e.right:this._hoverPosition===vo.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-Hr.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?Hr.PointerSize:0;if(this._forcePosition){const i=t+Hr.HoverBorderWidth;this._hoverPosition===vo.RIGHT?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===vo.LEFT&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===vo.RIGHT?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vo.LEFT:this._hoverPosition=vo.BELOW):this._hoverPosition===vo.LEFT&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=vo.RIGHT:this._hoverPosition=vo.BELOW),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=vo.RIGHT))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?Hr.PointerSize:0;this._hoverPosition===vo.ABOVE?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=vo.BELOW):this._hoverPosition===vo.BELOW&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=vo.ABOVE)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?Hr.PointerSize:0)+Hr.HoverBorderWidth;this._hoverPosition===vo.ABOVE?t=Math.min(t,e.top-i):this._hoverPosition===vo.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)-Hr.PointerSize}px`:this._hoverPointer.style.top=`${Math.round(t/2)-Hr.PointerSize}px`;break}case vo.ABOVE:case vo.BELOW:{this._hoverPointer.classList.add(this._hoverPosition===vo.ABOVE?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-Hr.PointerSize;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-Hr.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}};Ume=D([_(1,Ut),_(2,Te),_(3,Ao),_(4,we),_(5,mr)],Ume);class l2e extends gd{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=ct(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(ct(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class CSt{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var Zg;(function(s){s[s.NoMatchingKb=0]="NoMatchingKb",s[s.MoreChordsNeeded=1]="MoreChordsNeeded",s[s.KbFound=2]="KbFound"})(Zg||(Zg={}));const BY={kind:Zg.NoMatchingKb},SSt={kind:Zg.MoreChordsNeeded};function ASt(s,e,t){return{kind:Zg.KbFound,commandId:s,commandArgs:e,isBubble:t}}class HO{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const o=n.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=HO.handleRemovals([].concat(e).concat(t));for(let n=0,o=this._keybindings.length;n"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const o=i[n];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,n=t.length;i"u"||t.length===0)return[];const i=[];let n=0;for(let o=t.length-1;o>=0;o--)i[n++]=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 n=i.length-1;n>=0;n--){const o=i[n];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(o===void 0)return this._log("\\ No keybinding entries."),BY;let r=null;if(n.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 n=t[i];if(HO._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function d2e(s){return s?`${s.serialize()}`:"no when condition"}function h2e(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}let WY=class extends V{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Tme(this.layoutService.mainContainer,Hw.ABSOLUTE)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(ct(t))?n=Hw.ABSOLUTE:i?n=Hw.FIXED_SHADOW:n=Hw.FIXED:n=Hw.ABSOLUTE,this.contextView.setContainer(t??this.layoutService.activeContainer,n),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}};WY=D([_(0,fu)],WY);class ESt extends WY{getContextViewElement(){return this.contextView.getViewElement()}}class xSt{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 n;if(e===void 0||Lt(e)||Yr(e))n=e;else if(!v2(e.markdown))n=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(g(4884,"Loading..."),t,i),this._cancellationTokenSource=new ci;const o=this._cancellationTokenSource.token;if(n=await e.markdown(o),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||o.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:vo.BELOW},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n?.dispose()}hasContent(e){return e?cd(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}let Vme=class extends V{constructor(e,t,i,n,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=o,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new WY(this._layoutService))}showHover(e,t,i){if(u2e(this._currentHoverOptions)===u2e(e)||this._currentHover&&this._currentHoverOptions?.persistence?.sticky)return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),o=Bc();i||(n&&o?o.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=o):this._lastFocusedElementBeforeOpen=void 0);const r=new Z,a=this._instantiationService.createInstance(Ume,e);if(e.persistence?.sticky&&(a.isLocked=!0),a.onDispose(()=>{this._currentHover?.domNode&&J1e(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const c=Yr(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(ct(c))}if(this._contextViewHandler.showContextView(new DSt(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(ue(ct(e.container).document,ke.MOUSE_DOWN,c=>{wc(c.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)r.add(ue(l,ke.CLICK,()=>this.hideHover()));else r.add(ue(e.target,ke.CLICK,()=>this.hideHover()));const c=Bc();if(c){const l=ct(c).document;r.add(ue(c,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(ue(l,ke.KEY_DOWN,d=>this._keyDown(d,a,!!e.persistence?.hideOnKeyDown))),r.add(ue(c,ke.KEY_UP,d=>this._keyUp(d,a))),r.add(ue(l,ke.KEY_UP,d=>this._keyUp(d,a)))}}if("IntersectionObserver"in si){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 n=new En(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(r=>!!r)||this._keybindingService.softDispatch(n,n.target).kind!==Zg.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()))}setupManagedHover(e,t,i,n){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=(y,C)=>{const A=r!==void 0;y&&(r?.dispose(),r=void 0),C&&(o?.dispose(),o=void 0),A&&(e.onDidHideHover?.(),r=void 0)},c=(y,C,A,L)=>new bm(async()=>{(!r||r.isDisposed)&&(r=new xSt(e,A||t,y>0),await r.update(typeof i=="function"?i():i,C,{...n,trapFocus:L}))},y);let l=!1;const d=ue(t,ke.MOUSE_DOWN,()=>{l=!0,a(!0,!0)},!0),h=ue(t,ke.MOUSE_UP,()=>{l=!1},!0),u=ue(t,ke.MOUSE_LEAVE,y=>{l=!1,a(!1,y.fromElement===t)},!0),f=y=>{if(o)return;const C=new Z,A={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const L=k=>{A.x=k.x+10,Yr(k.target)&&g2e(k.target,t)!==t&&a(!0,!0)};C.add(ue(t,ke.MOUSE_MOVE,L,!0))}o=C,!(Yr(y.target)&&g2e(y.target,t)!==t)&&C.add(c(e.delay,!1,A))},p=ue(t,ke.MOUSE_OVER,f,!0),m=()=>{if(l||o)return;const y={targetElements:[t],dispose:()=>{}},C=new Z,A=()=>a(!0,!0);C.add(ue(t,ke.BLUR,A,!0)),C.add(c(e.delay,!1,y)),o=C};let v;const b=t.tagName.toLowerCase();b!=="input"&&b!=="textarea"&&(v=ue(t,ke.FOCUS,m,!0));const w={show:y=>{a(!1,!0)},hide:()=>{a(!0,!0)},update:async(y,C)=>{i=y,await r?.update(i,void 0,C)},dispose:()=>{this._managedHovers.delete(t),p.dispose(),u.dispose(),d.dispose(),h.dispose(),v?.dispose(),a(!0,!0)}};return this._managedHovers.set(t,w),w}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};Vme=D([_(0,we),_(1,lr),_(2,Ut),_(3,fu),_(4,mr)],Vme);function u2e(s){if(s!==void 0)return s?.id??s}class DSt{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 g2e(s,e){for(e=e??ct(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}ce(ec,Vme,qt.Delayed);bp((s,e)=>{const t=s.getColor(GKe);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 LN=ae("IWorkspaceEditService");class lae{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(eA.is(t))return eA.lift(t);if(op.is(t))return op.lift(t);throw new Error("Unsupported edit")})}}class eA extends lae{static is(e){return e instanceof eA?!0:kn(e)&&N.isUri(e.resource)&&kn(e.textEdit)}static lift(e){return e instanceof eA?e:new eA(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class op extends lae{static is(e){return e instanceof op?!0:kn(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof op?e:new op(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const Fl={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,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},Wb=Object.freeze({id:"editor",order:5,type:"object",title:g(1209,"Editor"),scope:at.LANGUAGE_OVERRIDABLE}),HY={...Wb,properties:{"editor.tabSize":{type:"number",default:Hd.tabSize,minimum:1,markdownDescription:g(1210,"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(1211,'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:Hd.insertSpaces,markdownDescription:g(1212,"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:Hd.detectIndentation,markdownDescription:g(1213,"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:Hd.trimAutoWhitespace,description:g(1214,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Hd.largeFileOptimizations,description:g(1215,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[g(1216,"Turn off Word Based Suggestions."),g(1217,"Only suggest words from the active document."),g(1218,"Suggest words from all open documents of the same language."),g(1219,"Suggest words from all open documents.")],description:g(1220,"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(1221,"Semantic highlighting enabled for all color themes."),g(1222,"Semantic highlighting disabled for all color themes."),g(1223,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:g(1224,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:g(1225,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:g(1226,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:g(1227,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:g(1228,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:g(1229,"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(1230,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:g(1231,"The opening bracket character or string sequence.")},{type:"string",description:g(1232,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:g(1233,"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(1231,"The opening bracket character or string sequence.")},{type:"string",description:g(1232,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Fl.maxComputationTime,description:g(1234,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Fl.maxFileSize,description:g(1235,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Fl.renderSideBySide,description:g(1236,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Fl.renderSideBySideInlineBreakpoint,description:g(1237,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Fl.useInlineViewWhenSpaceIsLimited,description:g(1238,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Fl.renderMarginRevertIcon,description:g(1239,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Fl.renderGutterMenu,description:g(1240,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Fl.ignoreTrimWhitespace,description:g(1241,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Fl.renderIndicators,description:g(1242,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Fl.diffCodeLens,description:g(1243,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Fl.diffWordWrap,markdownEnumDescriptions:[g(1244,"Lines will never wrap."),g(1245,"Lines will wrap at the viewport width."),g(1246,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Fl.diffAlgorithm,markdownEnumDescriptions:[g(1247,"Uses the legacy diffing algorithm."),g(1248,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Fl.hideUnchangedRegions.enabled,markdownDescription:g(1249,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Fl.hideUnchangedRegions.revealLineCount,markdownDescription:g(1250,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Fl.hideUnchangedRegions.minimumLineCount,markdownDescription:g(1251,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Fl.hideUnchangedRegions.contextLineCount,markdownDescription:g(1252,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Fl.experimental.showMoves,markdownDescription:g(1253,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Fl.experimental.showEmptyDecorations,description:g(1254,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Fl.experimental.useTrueInlineView,description:g(1255,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function kSt(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of qP){const e=s.schema;if(typeof e<"u")if(kSt(e))HY.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(HY.properties[t]=e[t])}let jG=null;function jQe(){return jG===null&&(jG=Object.create(null),Object.keys(HY.properties).forEach(s=>{jG[s]=!0})),jG}function ISt(s){return jQe()[`editor.${s}`]||!1}function TSt(s){return jQe()[`diffEditor.${s}`]||!1}const LSt=Qe.as(Nn.Configuration);LSt.registerConfiguration(HY);var wl;(function(s){s[s.None=0]="None",s[s.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=2]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",s[s.InvalidUnicode=4]="InvalidUnicode",s[s.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",s[s.InvalidCharacter=6]="InvalidCharacter"})(wl||(wl={}));var ft;(function(s){s[s.OpenBraceToken=1]="OpenBraceToken",s[s.CloseBraceToken=2]="CloseBraceToken",s[s.OpenBracketToken=3]="OpenBracketToken",s[s.CloseBracketToken=4]="CloseBracketToken",s[s.CommaToken=5]="CommaToken",s[s.ColonToken=6]="ColonToken",s[s.NullKeyword=7]="NullKeyword",s[s.TrueKeyword=8]="TrueKeyword",s[s.FalseKeyword=9]="FalseKeyword",s[s.StringLiteral=10]="StringLiteral",s[s.NumericLiteral=11]="NumericLiteral",s[s.LineCommentTrivia=12]="LineCommentTrivia",s[s.BlockCommentTrivia=13]="BlockCommentTrivia",s[s.LineBreakTrivia=14]="LineBreakTrivia",s[s.Trivia=15]="Trivia",s[s.Unknown=16]="Unknown",s[s.EOF=17]="EOF"})(ft||(ft={}));var Ho;(function(s){s[s.InvalidSymbol=1]="InvalidSymbol",s[s.InvalidNumberFormat=2]="InvalidNumberFormat",s[s.PropertyNameExpected=3]="PropertyNameExpected",s[s.ValueExpected=4]="ValueExpected",s[s.ColonExpected=5]="ColonExpected",s[s.CommaExpected=6]="CommaExpected",s[s.CloseBraceExpected=7]="CloseBraceExpected",s[s.CloseBracketExpected=8]="CloseBracketExpected",s[s.EndOfFileExpected=9]="EndOfFileExpected",s[s.InvalidCommentToken=10]="InvalidCommentToken",s[s.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=12]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",s[s.InvalidUnicode=14]="InvalidUnicode",s[s.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",s[s.InvalidCharacter=16]="InvalidCharacter"})(Ho||(Ho={}));var c3;(function(s){s.DEFAULT={allowTrailingComma:!0}})(c3||(c3={}));function bLe(s,e=!1){let t=0;const i=s.length;let n="",o=0,r=ft.Unknown,a=wl.None;function c(m){let v=0,b=0;for(;v=ti._0&&w<=ti._9)b=b*16+w-ti._0;else if(w>=ti.A&&w<=ti.F)b=b*16+w-ti.A+10;else if(w>=ti.a&&w<=ti.f)b=b*16+w-ti.a+10;else break;t++,v++}return v=i){m+=s.substring(v,t),a=wl.UnexpectedEndOfString;break}const b=s.charCodeAt(t);if(b===ti.doubleQuote){m+=s.substring(v,t),t++;break}if(b===ti.backslash){if(m+=s.substring(v,t),t++,t>=i){a=wl.UnexpectedEndOfString;break}switch(s.charCodeAt(t++)){case ti.doubleQuote:m+='"';break;case ti.backslash:m+="\\";break;case ti.slash:m+="/";break;case ti.b:m+="\b";break;case ti.f:m+="\f";break;case ti.n:m+=` +`;break;case ti.r:m+="\r";break;case ti.t:m+=" ";break;case ti.u:{const y=c(4);y>=0?m+=String.fromCharCode(y):a=wl.InvalidUnicode;break}default:a=wl.InvalidEscapeCharacter}v=t;continue}if(b>=0&&b<=31)if(YG(b)){m+=s.substring(v,t),a=wl.UnexpectedEndOfString;break}else a=wl.InvalidCharacter;t++}return m}function u(){if(n="",a=wl.None,o=t,t>=i)return o=i,r=ft.EOF;let m=s.charCodeAt(t);if(ghe(m)){do t++,n+=String.fromCharCode(m),m=s.charCodeAt(t);while(ghe(m));return r=ft.Trivia}if(YG(m))return t++,n+=String.fromCharCode(m),m===ti.carriageReturn&&s.charCodeAt(t)===ti.lineFeed&&(t++,n+=` +`),r=ft.LineBreakTrivia;switch(m){case ti.openBrace:return t++,r=ft.OpenBraceToken;case ti.closeBrace:return t++,r=ft.CloseBraceToken;case ti.openBracket:return t++,r=ft.OpenBracketToken;case ti.closeBracket:return t++,r=ft.CloseBracketToken;case ti.colon:return t++,r=ft.ColonToken;case ti.comma:return t++,r=ft.CommaToken;case ti.doubleQuote:return t++,n=h(),r=ft.StringLiteral;case ti.slash:{const v=t-1;if(s.charCodeAt(t+1)===ti.slash){for(t+=2;t=ft.LineCommentTrivia&&m<=ft.Trivia);return m}return{setPosition:l,getPosition:()=>t,scan:e?p:u,getToken:()=>r,getTokenValue:()=>n,getTokenOffset:()=>o,getTokenLength:()=>t-o,getTokenError:()=>a}}function ghe(s){return s===ti.space||s===ti.tab||s===ti.verticalTab||s===ti.formFeed||s===ti.nonBreakingSpace||s===ti.ogham||s>=ti.enQuad&&s<=ti.zeroWidthSpace||s===ti.narrowNoBreakSpace||s===ti.mathematicalSpace||s===ti.ideographicSpace||s===ti.byteOrderMark}function YG(s){return s===ti.lineFeed||s===ti.carriageReturn||s===ti.lineSeparator||s===ti.paragraphSeparator}function cP(s){return s>=ti._0&&s<=ti._9}var ti;(function(s){s[s.nullCharacter=0]="nullCharacter",s[s.maxAsciiCharacter=127]="maxAsciiCharacter",s[s.lineFeed=10]="lineFeed",s[s.carriageReturn=13]="carriageReturn",s[s.lineSeparator=8232]="lineSeparator",s[s.paragraphSeparator=8233]="paragraphSeparator",s[s.nextLine=133]="nextLine",s[s.space=32]="space",s[s.nonBreakingSpace=160]="nonBreakingSpace",s[s.enQuad=8192]="enQuad",s[s.emQuad=8193]="emQuad",s[s.enSpace=8194]="enSpace",s[s.emSpace=8195]="emSpace",s[s.threePerEmSpace=8196]="threePerEmSpace",s[s.fourPerEmSpace=8197]="fourPerEmSpace",s[s.sixPerEmSpace=8198]="sixPerEmSpace",s[s.figureSpace=8199]="figureSpace",s[s.punctuationSpace=8200]="punctuationSpace",s[s.thinSpace=8201]="thinSpace",s[s.hairSpace=8202]="hairSpace",s[s.zeroWidthSpace=8203]="zeroWidthSpace",s[s.narrowNoBreakSpace=8239]="narrowNoBreakSpace",s[s.ideographicSpace=12288]="ideographicSpace",s[s.mathematicalSpace=8287]="mathematicalSpace",s[s.ogham=5760]="ogham",s[s._=95]="_",s[s.$=36]="$",s[s._0=48]="_0",s[s._1=49]="_1",s[s._2=50]="_2",s[s._3=51]="_3",s[s._4=52]="_4",s[s._5=53]="_5",s[s._6=54]="_6",s[s._7=55]="_7",s[s._8=56]="_8",s[s._9=57]="_9",s[s.a=97]="a",s[s.b=98]="b",s[s.c=99]="c",s[s.d=100]="d",s[s.e=101]="e",s[s.f=102]="f",s[s.g=103]="g",s[s.h=104]="h",s[s.i=105]="i",s[s.j=106]="j",s[s.k=107]="k",s[s.l=108]="l",s[s.m=109]="m",s[s.n=110]="n",s[s.o=111]="o",s[s.p=112]="p",s[s.q=113]="q",s[s.r=114]="r",s[s.s=115]="s",s[s.t=116]="t",s[s.u=117]="u",s[s.v=118]="v",s[s.w=119]="w",s[s.x=120]="x",s[s.y=121]="y",s[s.z=122]="z",s[s.A=65]="A",s[s.B=66]="B",s[s.C=67]="C",s[s.D=68]="D",s[s.E=69]="E",s[s.F=70]="F",s[s.G=71]="G",s[s.H=72]="H",s[s.I=73]="I",s[s.J=74]="J",s[s.K=75]="K",s[s.L=76]="L",s[s.M=77]="M",s[s.N=78]="N",s[s.O=79]="O",s[s.P=80]="P",s[s.Q=81]="Q",s[s.R=82]="R",s[s.S=83]="S",s[s.T=84]="T",s[s.U=85]="U",s[s.V=86]="V",s[s.W=87]="W",s[s.X=88]="X",s[s.Y=89]="Y",s[s.Z=90]="Z",s[s.ampersand=38]="ampersand",s[s.asterisk=42]="asterisk",s[s.at=64]="at",s[s.backslash=92]="backslash",s[s.bar=124]="bar",s[s.caret=94]="caret",s[s.closeBrace=125]="closeBrace",s[s.closeBracket=93]="closeBracket",s[s.closeParen=41]="closeParen",s[s.colon=58]="colon",s[s.comma=44]="comma",s[s.dot=46]="dot",s[s.doubleQuote=34]="doubleQuote",s[s.equals=61]="equals",s[s.exclamation=33]="exclamation",s[s.greaterThan=62]="greaterThan",s[s.lessThan=60]="lessThan",s[s.minus=45]="minus",s[s.openBrace=123]="openBrace",s[s.openBracket=91]="openBracket",s[s.openParen=40]="openParen",s[s.percent=37]="percent",s[s.plus=43]="plus",s[s.question=63]="question",s[s.semicolon=59]="semicolon",s[s.singleQuote=39]="singleQuote",s[s.slash=47]="slash",s[s.tilde=126]="tilde",s[s.backspace=8]="backspace",s[s.formFeed=12]="formFeed",s[s.byteOrderMark=65279]="byteOrderMark",s[s.tab=9]="tab",s[s.verticalTab=11]="verticalTab"})(ti||(ti={}));function ef(s,e=[],t=c3.DEFAULT){let i=null,n=[];const o=[];function r(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}return yLe(s,{onObjectBegin:()=>{const c={};r(c),o.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(n),n=c,i=null},onArrayEnd:()=>{n=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{e.push({error:c,offset:l,length:d})}},t),n[0]}function wLe(s,e=[],t=c3.DEFAULT){let i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function n(c){i.type==="property"&&(i.length=c-i.offset,i=i.parent)}function o(c){return i.children.push(c),c}yLe(s,{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,n(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,n(c+l)},onLiteralValue:(c,l,d)=>{o({type:tD(c),offset:l,length:d,parent:i,value:c}),n(l+d)},onSeparator:(c,l,d)=>{i.type==="property"&&(c===":"?i.colonOffset=l:c===","&&n(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 zme(s,e){if(!s)return;let t=s;for(const i of e)if(typeof i=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;let n=!1;for(const o of t.children)if(Array.isArray(o.children)&&o.children[0].value===i){t=o.children[1],n=!0;break}if(!n)return}else{const n=i;if(t.type!=="array"||n<0||!Array.isArray(t.children)||n>=t.children.length)return;t=t.children[n]}return t}function yLe(s,e,t=c3.DEFAULT){const i=bLe(s,!1);function n(R){return R?()=>R(i.getTokenOffset(),i.getTokenLength()):()=>!0}function o(R){return R?z=>R(z,i.getTokenOffset(),i.getTokenLength()):()=>!0}const r=n(e.onObjectBegin),a=o(e.onObjectProperty),c=n(e.onObjectEnd),l=n(e.onArrayBegin),d=n(e.onArrayEnd),h=o(e.onLiteralValue),u=o(e.onSeparator),f=n(e.onComment),p=o(e.onError),m=t&&t.disallowComments,v=t&&t.allowTrailingComma;function b(){for(;;){const R=i.scan();switch(i.getTokenError()){case wl.InvalidUnicode:w(Ho.InvalidUnicode);break;case wl.InvalidEscapeCharacter:w(Ho.InvalidEscapeCharacter);break;case wl.UnexpectedEndOfNumber:w(Ho.UnexpectedEndOfNumber);break;case wl.UnexpectedEndOfComment:m||w(Ho.UnexpectedEndOfComment);break;case wl.UnexpectedEndOfString:w(Ho.UnexpectedEndOfString);break;case wl.InvalidCharacter:w(Ho.InvalidCharacter);break}switch(R){case ft.LineCommentTrivia:case ft.BlockCommentTrivia:m?w(Ho.InvalidCommentToken):f();break;case ft.Unknown:w(Ho.InvalidSymbol);break;case ft.Trivia:case ft.LineBreakTrivia:break;default:return R}}}function w(R,z=[],G=[]){if(p(R),z.length+G.length>0){let j=i.getToken();for(;j!==ft.EOF;){if(z.indexOf(j)!==-1){b();break}else if(G.indexOf(j)!==-1)break;j=b()}}}function y(R){const z=i.getTokenValue();return R?h(z):a(z),b(),!0}function C(){switch(i.getToken()){case ft.NumericLiteral:{let R=0;try{R=JSON.parse(i.getTokenValue()),typeof R!="number"&&(w(Ho.InvalidNumberFormat),R=0)}catch{w(Ho.InvalidNumberFormat)}h(R);break}case ft.NullKeyword:h(null);break;case ft.TrueKeyword:h(!0);break;case ft.FalseKeyword:h(!1);break;default:return!1}return b(),!0}function A(){return i.getToken()!==ft.StringLiteral?(w(Ho.PropertyNameExpected,[],[ft.CloseBraceToken,ft.CommaToken]),!1):(y(!1),i.getToken()===ft.ColonToken?(u(":"),b(),P()||w(Ho.ValueExpected,[],[ft.CloseBraceToken,ft.CommaToken])):w(Ho.ColonExpected,[],[ft.CloseBraceToken,ft.CommaToken]),!0)}function L(){r(),b();let R=!1;for(;i.getToken()!==ft.CloseBraceToken&&i.getToken()!==ft.EOF;){if(i.getToken()===ft.CommaToken){if(R||w(Ho.ValueExpected,[],[]),u(","),b(),i.getToken()===ft.CloseBraceToken&&v)break}else R&&w(Ho.CommaExpected,[],[]);A()||w(Ho.ValueExpected,[],[ft.CloseBraceToken,ft.CommaToken]),R=!0}return c(),i.getToken()!==ft.CloseBraceToken?w(Ho.CloseBraceExpected,[ft.CloseBraceToken],[]):b(),!0}function k(){l(),b();let R=!1;for(;i.getToken()!==ft.CloseBracketToken&&i.getToken()!==ft.EOF;){if(i.getToken()===ft.CommaToken){if(R||w(Ho.ValueExpected,[],[]),u(","),b(),i.getToken()===ft.CloseBracketToken&&v)break}else R&&w(Ho.CommaExpected,[],[]);P()||w(Ho.ValueExpected,[],[ft.CloseBracketToken,ft.CommaToken]),R=!0}return d(),i.getToken()!==ft.CloseBracketToken?w(Ho.CloseBracketExpected,[ft.CloseBracketToken],[]):b(),!0}function P(){switch(i.getToken()){case ft.OpenBracketToken:return k();case ft.OpenBraceToken:return L();case ft.StringLiteral:return y(!0);default:return C()}}return b(),i.getToken()===ft.EOF?t.allowEmptyContent?!0:(w(Ho.ValueExpected,[],[]),!1):P()?(i.getToken()!==ft.EOF&&w(Ho.EndOfFileExpected,[],[]),!0):(w(Ho.ValueExpected,[],[]),!1)}function tD(s){switch(typeof s){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(s){if(Array.isArray(s))return"array"}else return"null";return"object"}default:return"null"}}class RSt{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===B.Slash||this._splitOnBackslash&&i===B.Backslash))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Eh(new NSt(e,t))}static forPaths(e=!1){return new Eh(new v5(void 0,!e))}static forStrings(){return new Eh(new RSt)}static forConfigKeys(){return new Eh(new MSt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);sFe(i);for(const n of i)this.set(n,e)}else{const i=e.slice(0);sFe(i);for(const n of i)this.set(n[0],n[1])}}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new JG,this._root.segment=i.value());const o=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new JG,n.left.segment=i.value()),o.push([nc.Left,n]),n=n.left;else if(a<0)n.right||(n.right=new JG,n.right.segment=i.value()),o.push([nc.Right,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new JG,n.mid.segment=i.value()),o.push([nc.Mid,n]),n=n.mid;else break}const r=n.value;n.value=t,n.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===nc.Right&&h===nc.Right)o[a][1]=c.rotateLeft();else if(d===nc.Left&&h===nc.Left)o[a][1]=c.rotateRight();else if(d===nc.Right&&h===nc.Left)c.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=c.rotateLeft();else if(d===nc.Left&&h===nc.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 nc.Left:o[a-1][1].left=o[a][1];break;case nc.Right:o[a-1][1].right=o[a][1];break;case nc.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 n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<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),n=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)n.push([nc.Left,o]),o=o.left;else if(r<0)n.push([nc.Right,o]),o=o.right;else if(i.hasNext())i.next(),n.push([nc.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(n.length>0){const[a,c]=n[n.length-1];switch(a){case nc.Left:c.left=r;break;case nc.Mid:c.mid=r;break;case nc.Right:c.right=r;break}}else this._root=r}for(let r=n.length-1;r>=0;r--){const a=n[r][1];a.updateHeight();const c=a.balanceFactor();if(c>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),n[r][1]=a.rotateLeft()):c<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),n[r][1]=a.rotateRight()),r>0)switch(n[r-1][0]){case nc.Left:n[r-1][1].left=n[r][1];break;case nc.Right:n[r-1][1].right=n[r][1];break;case nc.Mid:n[r-1][1].mid=n[r][1];break}else this._root=n[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;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(),n=i.value||n,i=i.mid;else break}return i&&i.value||n}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const o=i.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else return n.mid?this._entries(n.mid):t?n.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)}}var sn;(function(s){s[s.Unknown=0]="Unknown",s[s.File=1]="File",s[s.Directory=2]="Directory",s[s.SymbolicLink=64]="SymbolicLink"})(sn||(sn={}));var rp;(function(s){s[s.Readonly=1]="Readonly",s[s.Locked=2]="Locked"})(rp||(rp={}));var kE;(function(s){s[s.UPDATED=2]="UPDATED",s[s.ADDED=4]="ADDED",s[s.DELETED=8]="DELETED"})(kE||(kE={}));var Vn;(function(s){s[s.None=0]="None",s[s.FileReadWrite=2]="FileReadWrite",s[s.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",s[s.FileReadStream=16]="FileReadStream",s[s.FileFolderCopy=8]="FileFolderCopy",s[s.PathCaseSensitive=1024]="PathCaseSensitive",s[s.Readonly=2048]="Readonly",s[s.Trash=4096]="Trash",s[s.FileWriteUnlock=8192]="FileWriteUnlock",s[s.FileAtomicRead=16384]="FileAtomicRead",s[s.FileAtomicWrite=32768]="FileAtomicWrite",s[s.FileAtomicDelete=65536]="FileAtomicDelete",s[s.FileClone=131072]="FileClone"})(Vn||(Vn={}));function Hm(s){return!!(s.capabilities&Vn.FileReadWrite)}function f2e(s){return!!(s.capabilities&Vn.FileFolderCopy)}function PSt(s){return!!(s.capabilities&Vn.FileClone)}function cE(s){return!!(s.capabilities&Vn.FileOpenReadWriteClose)}function Rq(s){return!!(s.capabilities&Vn.FileReadStream)}function fhe(s){return Hm(s)?!!(s.capabilities&Vn.FileAtomicRead):!1}function p2e(s){return Hm(s)?!!(s.capabilities&Vn.FileAtomicWrite):!1}function FSt(s){return!!(s.capabilities&Vn.FileAtomicDelete)}function OSt(s){return!!(s.capabilities&Vn.Readonly)}var ot;(function(s){s.FileExists="EntryExists",s.FileNotFound="EntryNotFound",s.FileNotADirectory="EntryNotADirectory",s.FileIsADirectory="EntryIsADirectory",s.FileExceedsStorageQuota="EntryExceedsStorageQuota",s.FileTooLarge="EntryTooLarge",s.FileWriteLocked="EntryWriteLocked",s.NoPermissions="NoPermissions",s.Unavailable="Unavailable",s.Unknown="Unknown"})(ot||(ot={}));class AA extends Error{static create(e,t){const i=new AA(e.toString(),t);return YQe(i,t),i}constructor(e,t){super(e),this.code=t}}function us(s,e){return AA.create(s,e)}function t0(s){return s||us(g(0,"Unknown Error"),ot.Unknown)}function YQe(s,e){return s.name=e?`${e} (FileSystemError)`:"FileSystemError",s}function Ok(s){if(!s)return ot.Unknown;if(s instanceof AA)return s.code;const e=/^(.+) \(FileSystemError\)$/.exec(s.name);if(!e)return ot.Unknown;switch(e[1]){case ot.FileExists:return ot.FileExists;case ot.FileIsADirectory:return ot.FileIsADirectory;case ot.FileNotADirectory:return ot.FileNotADirectory;case ot.FileNotFound:return ot.FileNotFound;case ot.FileTooLarge:return ot.FileTooLarge;case ot.FileWriteLocked:return ot.FileWriteLocked;case ot.NoPermissions:return ot.NoPermissions;case ot.Unavailable:return ot.Unavailable}return ot.Unknown}function Uw(s){if(s instanceof kd)return s.fileOperationResult;switch(Ok(s)){case ot.FileNotFound:return Qi.FILE_NOT_FOUND;case ot.FileIsADirectory:return Qi.FILE_IS_DIRECTORY;case ot.FileNotADirectory:return Qi.FILE_NOT_DIRECTORY;case ot.FileWriteLocked:return Qi.FILE_WRITE_LOCKED;case ot.NoPermissions:return Qi.FILE_PERMISSION_DENIED;case ot.FileExists:return Qi.FILE_MOVE_CONFLICT;case ot.FileTooLarge:return Qi.FILE_TOO_LARGE;default:return Qi.FILE_OTHER_ERROR}}var Ai;(function(s){s[s.CREATE=0]="CREATE",s[s.DELETE=1]="DELETE",s[s.MOVE=2]="MOVE",s[s.COPY=3]="COPY",s[s.WRITE=4]="WRITE"})(Ai||(Ai={}));class lP{constructor(e,t,i){this.resource=e,this.operation=t,this.target=i}isOperation(e){return this.operation===e}}var To;(function(s){s[s.UPDATED=0]="UPDATED",s[s.ADDED=1]="ADDED",s[s.DELETED=2]="DELETED"})(To||(To={}));const KF=class KF{constructor(e,t){this.ignorePathCasing=t,this.correlationId=void 0,this.added=new ya(()=>{const i=Eh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawAdded.map(n=>[n,!0])),i}),this.updated=new ya(()=>{const i=Eh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawUpdated.map(n=>[n,!0])),i}),this.deleted=new ya(()=>{const i=Eh.forUris(()=>this.ignorePathCasing);return i.fill(this.rawDeleted.map(n=>[n,!0])),i}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const i of e){switch(i.type){case To.ADDED:this.rawAdded.push(i.resource);break;case To.UPDATED:this.rawUpdated.push(i.resource);break;case To.DELETED:this.rawDeleted.push(i.resource);break}this.correlationId!==KF.MIXED_CORRELATION&&(typeof i.cId=="number"?this.correlationId===void 0?this.correlationId=i.cId:this.correlationId!==i.cId&&(this.correlationId=KF.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=KF.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 n=i.length>0;return!!((!n||i.includes(To.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!n||i.includes(To.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!n||i.includes(To.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"}};KF.MIXED_CORRELATION=null;let UY=KF;class kd extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}class Mq extends kd{constructor(e,t,i,n){super(e,t,n),this.fileOperationResult=t,this.size=i}}class b5 extends kd{constructor(e,t,i){super(e,Qi.FILE_NOT_MODIFIED_SINCE,i),this.stat=t}}var Qi;(function(s){s[s.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",s[s.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",s[s.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",s[s.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",s[s.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",s[s.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",s[s.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",s[s.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",s[s.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",s[s.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",s[s.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Qi||(Qi={}));const el={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},Au={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},CLe="files.associations",BSt="files.exclude",JQe="files.readonlyInclude",XQe="files.readonlyExclude",WSt="files.readonlyFromPermissions";var ba;(function(s){s[s.FILE=0]="FILE",s[s.FOLDER=1]="FOLDER",s[s.ROOT_FOLDER=2]="ROOT_FOLDER"})(ba||(ba={}));const w_="";function VY(s){if(!(typeof s.size!="number"||typeof s.mtime!="number"))return s.mtime.toString(29)+s.size.toString(31)}async function ZQe(s,e){if(!e.hasProvider(N.from({scheme:s.scheme})))return new Promise(t=>{const i=e.onDidChangeFileSystemProviderRegistrations(n=>{n.scheme===s.scheme&&n.added&&(i.dispose(),t())})})}const zl=class zl{static formatSize(e){return lc(e)||(e=0),e{if(t instanceof as)return t;const i=new EA("",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?Kj(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return nV(i.rawConfiguration.getValue(e))},get override(){return t?nV(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return nV(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const c=new as(o,a,[],void 0,i.logService).getValue(e);c!==void 0&&n.push({identifiers:r,value:c})}return n.length?nV(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?Kj(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return ja(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return ja(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=xs(this.contents),i=xs(this.overrides),n=[...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=>is(l.identifiers,a.identifiers));c?(this.mergeContents(c.contents,a.contents),c.keys.push(...a.keys),c.keys=ja(c.keys)):i.push(xs(a))}for(const a of r.keys)n.indexOf(a)===-1&&n.push(a)}return new as(t,n,i,o.every(r=>r instanceof as)?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 n of ja([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[n];const r=t[n];r&&(typeof o=="object"&&typeof r=="object"?(o=xs(o),this.mergeContents(o,r)):o=r),i[n]=o}return new as(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&kn(e[i])&&kn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=xs(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=o=>{o&&(i?this.mergeContents(i,o):i=xs(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&n(o.contents);return n(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),qht(this.contents,e),Xg.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>is(i.identifiers,T8(e))),1))}updateValue(e,t,i){if(lKe(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),Xg.test(e)){const n=T8(e),o={identifiers:n,keys:Object.keys(this.contents[e]),contents:I8(this.contents[e],a=>this.logService.error(a))},r=this.overrides.findIndex(a=>is(a.identifiers,n));r!==-1?this.overrides[r]=o:this.overrides.push(o)}}}class EA{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||as.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!ra(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:n,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new as(i,n,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseContent(e){let t={},i=null,n=[];const o=[];function r(c){Array.isArray(n)?n.push(c):i!==null&&(n[i]=c)}const a={onObjectBegin:()=>{const c={};r(c),o.push(n),n=c,i=null},onObjectProperty:c=>{i=c},onObjectEnd:()=>{n=o.pop()},onArrayBegin:()=>{const c=[];r(c),o.push(n),n=c,i=null},onArrayEnd:()=>{n=o.pop()},onLiteralValue:r,onError:(c,l,d)=>{}};if(e)try{yLe(e,a),t=n[0]||{}}catch(c){this.logService.error(`Error while parsing settings file ${this._name}: ${c}`),this._parseErrors=[c]}return t}doParseRaw(e,t){const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n=this.filter(e,i,!0,t);e=n.raw;const o=I8(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:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){let o=!1;if(!n?.scopes&&!n?.skipRestricted&&!n?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:o};const r={},a=[];for(const c in e)if(Xg.test(c)&&i){const l=this.filter(e[c],t,!1,n);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:at.WINDOW:void 0;l?.restricted&&a.push(c),!n.exclude?.includes(c)&&(n.include?.includes(c)||(d===void 0||n.scopes===void 0||n.scopes.includes(d))&&!(n.skipRestricted&&l?.restricted))?r[c]=e[c]:o=!0}return{raw:r,restricted:a,hasExcludedProperties:o}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(Xg.test(n)){const o={};for(const r in e[n])o[r]=e[n][r];i.push({identifiers:T8(n),keys:Object.keys(o),contents:I8(o,t)})}return i}}class eje extends V{constructor(e,t,i,n,o){super(),this.userSettingsResource=e,this.parseOptions=t,this.fileService=n,this.logService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.parser=new EA(this.userSettingsResource.toString(),o),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(M.any(M.filter(this.fileService.onDidFilesChange,r=>r.contains(this.userSettingsResource)),M.filter(this.fileService.onDidRunOperation,r=>(r.isOperation(Ai.CREATE)||r.isOperation(Ai.COPY)||r.isOperation(Ai.DELETE)||r.isOperation(Ai.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 as.createEmptyModel(this.logService)}}reparse(e){return e&&(this.parseOptions=e),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}class USt{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,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 nV(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 l3=class tje{constructor(e,t,i,n,o,r,a,c,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=c,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ui,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=as.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,t===void 0?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=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 n.overrides)for(const l of c.identifiers)n.getOverrideValue(e,l)!==void 0&&a.add(l);return new USt(e,t,n.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:n,updated:o,removed:r}=lE(this._defaultConfiguration,e);t=[...n,...o,...r]}for(const n of t)for(const o of T8(n)){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=>!Ys(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:n}=lE(this._policyConfiguration,e),o=[...t,...i,...n];return o.length&&this.updatePolicyConfiguration(e),{keys:o,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=lE(this.applicationConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateApplicationConfiguration(e),{keys:r,overrides:o}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=lE(this.localUserConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateLocalUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=lE(this.remoteUserConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateRemoteUserConfiguration(e),{keys:r,overrides:o}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:n,overrides:o}=lE(this.workspaceConfiguration,e),r=[...t,...i,...n];return r.length&&this.updateWorkspaceConfiguration(e),{keys:r,overrides:o}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:n,updated:o,removed:r,overrides:a}=lE(i,t),c=[...n,...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:n,removed:o,overrides:r}=lE(t,void 0);return{keys:[...i,...n,...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 n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.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(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),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:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,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(n=>t.add(n))),[...t.values()]}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=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(N.revive(d[0]),this.parseConfigurationModel(d[1],t)),l),new ui);return new tje(i,n,o,r,as.createEmptyModel(t),a,c,as.createEmptyModel(t),new ui,t)}static parseConfigurationModel(e,t){return new as(e.contents,e.keys,e.overrides,void 0,t)}};function m2e(...s){if(s.length===0)return{keys:[],overrides:[]};if(s.length===1)return s[0];const e=new Set,t=new Map;for(const n of s)n.keys.forEach(o=>e.add(o)),n.overrides.forEach(([o,r])=>{const a=wj(t,o,new Set);r.forEach(c=>a.add(c))});const i=[];return t.forEach((n,o)=>i.push([o,[...n.values()]])),{keys:[...e.values()],overrides:i}}class SLe{constructor(e,t,i,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,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=l3.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const o=n+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!Ys(a,c)}return!0}}function lE(s,e){const{added:t,removed:i,updated:n}=_2e(e?.rawConfiguration,s?.rawConfiguration),o=[],r=s?.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(s){const c=r.filter(l=>!a.includes(l));for(const l of c)o.push([l,s.getKeysForOverrideIdentifier(l)])}if(e&&s){for(const c of r)if(a.includes(c)){const l=_2e({contents:s.getOverrideValue(void 0,c)||{},keys:s.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:n,overrides:o}}function _2e(s,e){const t=s?e?s.keys.filter(o=>e.keys.indexOf(o)===-1):[...s.keys]:[],i=e?s?e.keys.filter(o=>s.keys.indexOf(o)===-1):[...e.keys]:[],n=[];if(s&&e){for(const o of e.keys)if(s.keys.indexOf(o)!==-1){const r=Kj(e.contents,o),a=Kj(s.contents,o);Ys(r,a)||n.push(o)}}return{added:t,removed:i,updated:n}}const VSt=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class ije extends V{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:M.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new I),this._currentChords=[],this._currentChordChecker=new q7,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=rF.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new bm,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 Fi(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"),BY;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),BY;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,n)}_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 vre("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(g(1256,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:n})=>n).join(", ");this._currentChordStatusMessage=this._notificationService.status(g(1257,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),o5.enabled&&o5.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],o5.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),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=rF.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=rF.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new rF(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 n=!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."),n;const a=this._contextKeyService.getContext(t),c=e.getLabel(),l=this._getResolver().resolve(a,r,o);switch(l.kind){case Zg.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(1258,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}return n}case Zg.MoreChordsNeeded:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(o,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case Zg.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(1258,"The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(n=!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}VSt.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=S.KeyA&&e.keyCode<=S.KeyZ||e.keyCode>=S.Digit0&&e.keyCode<=S.Digit9}}const ese=class ese{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}}};ese.EMPTY=new ese(null);let rF=ese;class Ax{constructor(e,t,i,n,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?zY(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=zY(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===B.Caret:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function zY(s){const e=[];for(let t=0,i=s.length;tthis._getLabel(e))}getAriaLabel(){return nje.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:zSt.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return ALe.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 qct(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 K2 extends ELe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===Ds.Macintosh)switch(e){case S.LeftArrow:return"←";case S.UpArrow:return"↑";case S.RightArrow:return"→";case S.DownArrow:return"↓"}return Ia.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Ia.toString(e.keyCode)}_getElectronAccelerator(e){return Ia.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Ia.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(){return!0}_getChordDispatch(e){return K2.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+=Ia.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===S.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===S.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===S.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===S.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=Wg[e];if(t!==S.DependsOnKbLayout)return t;switch(e){case X.KeyA:return S.KeyA;case X.KeyB:return S.KeyB;case X.KeyC:return S.KeyC;case X.KeyD:return S.KeyD;case X.KeyE:return S.KeyE;case X.KeyF:return S.KeyF;case X.KeyG:return S.KeyG;case X.KeyH:return S.KeyH;case X.KeyI:return S.KeyI;case X.KeyJ:return S.KeyJ;case X.KeyK:return S.KeyK;case X.KeyL:return S.KeyL;case X.KeyM:return S.KeyM;case X.KeyN:return S.KeyN;case X.KeyO:return S.KeyO;case X.KeyP:return S.KeyP;case X.KeyQ:return S.KeyQ;case X.KeyR:return S.KeyR;case X.KeyS:return S.KeyS;case X.KeyT:return S.KeyT;case X.KeyU:return S.KeyU;case X.KeyV:return S.KeyV;case X.KeyW:return S.KeyW;case X.KeyX:return S.KeyX;case X.KeyY:return S.KeyY;case X.KeyZ:return S.KeyZ;case X.Digit1:return S.Digit1;case X.Digit2:return S.Digit2;case X.Digit3:return S.Digit3;case X.Digit4:return S.Digit4;case X.Digit5:return S.Digit5;case X.Digit6:return S.Digit6;case X.Digit7:return S.Digit7;case X.Digit8:return S.Digit8;case X.Digit9:return S.Digit9;case X.Digit0:return S.Digit0;case X.Minus:return S.Minus;case X.Equal:return S.Equal;case X.BracketLeft:return S.BracketLeft;case X.BracketRight:return S.BracketRight;case X.Backslash:return S.Backslash;case X.IntlHash:return S.Unknown;case X.Semicolon:return S.Semicolon;case X.Quote:return S.Quote;case X.Backquote:return S.Backquote;case X.Comma:return S.Comma;case X.Period:return S.Period;case X.Slash:return S.Slash;case X.IntlBackslash:return S.IntlBackslash}return S.Unknown}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Dh)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===S.Unknown?null:new Dh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=zY(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new K2(i,t)]:[]}}const Fs=ae("labelService"),og=ae("progressService"),YA=ae("editorProgressService"),sje="telemetry.telemetryLevel",GSt="telemetry.enableCrashReporter",oje="telemetry.enableTelemetry";var zg;(function(s){s[s.NONE=0]="NONE",s[s.CRASH=1]="CRASH",s[s.ERROR=2]="ERROR",s[s.USAGE=3]="USAGE"})(zg||(zg={}));var $0;(function(s){s.OFF="off",s.CRASH="crash",s.ERROR="error",s.ON="all"})($0||($0={}));function R_(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.uri)}function KSt(s){return typeof s?.id=="string"&&!R_(s)&&!tA(s)}const xLe={id:"empty-window"};function UO(s,e){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:Ko(s)}:xLe;const t=s;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 tA(s){const e=s;return typeof e?.id=="string"&&N.isUri(e.configPath)}var qi;(function(s){s[s.EMPTY=1]="EMPTY",s[s.FOLDER=2]="FOLDER",s[s.WORKSPACE=3]="WORKSPACE"})(qi||(qi={}));function $me(s){const e=s;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&Array.isArray(e.folders))}function rje(s){const e=s;return!!(e&&typeof e=="object"&&N.isUri(e.uri)&&typeof e.name=="string"&&typeof e.toResource=="function")}let aje=class{constructor(e,t,i,n,o){this._id=e,this._transient=i,this._configuration=n,this._ignorePathCasing=o,this._foldersMap=Eh.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=Eh.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}}},hae=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return Pt(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function $Y(s){return new hae({uri:s,index:0,name:SA(s)},{uri:s.toString()})}const Sb="code-workspace",cje=`.${Sb}`,qSt=[{name:g(792,"Code Workspace"),extensions:[Sb]}];function d3(s,e){return _Ge.isEqualOrParent(s,e.untitledWorkspacesHome)}function Ry(s){let e;return N.isUri(s)?e=s:e=s.configuration,e?.scheme===pe.tmp}const lje="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function QSt(s){return s.id===lje}function Gme(s,e){return!d3(s,e)&&!Ry(s)}function uae(s){return(typeof s=="string"?Vy(s):gU(s))===cje}const yi=ae("contextService");var Eg;(function(s){s.accessibilityHelpTitle=g(1259,"Accessibility Help"),s.openingDocs=g(1260,"Opening the Accessibility documentation page."),s.readonlyDiffEditor=g(1261,"You are in a read-only pane of a diff editor."),s.editableDiffEditor=g(1262,"You are in a pane of a diff editor."),s.readonlyEditor=g(1263,"You are in a read-only code editor."),s.editableEditor=g(1264,"You are in a code editor."),s.changeConfigToOnMac=g(1265,"Configure the application to be optimized for usage with a Screen Reader (Command+E)."),s.changeConfigToOnWinLinux=g(1266,"Configure the application to be optimized for usage with a Screen Reader (Control+E)."),s.auto_on=g(1267,"The application is configured to be optimized for usage with a Screen Reader."),s.auto_off=g(1268,"The application is configured to never be optimized for usage with a Screen Reader."),s.screenReaderModeEnabled=g(1269,"Screen Reader Optimized Mode enabled."),s.screenReaderModeDisabled=g(1270,"Screen Reader Optimized Mode disabled."),s.tabFocusModeOnMsg=g(1271,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior{0}.",""),s.tabFocusModeOffMsg=g(1272,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior{0}",""),s.stickScroll=g(1273,"Focus Sticky Scroll{0} to focus the currently nested scopes.",""),s.showAccessibilityHelpAction=g(1274,"Show Accessibility Help"),s.listSignalSounds=g(1275,"Run the command: List Signal Sounds for an overview of all sounds and their current status."),s.listAlerts=g(1276,"Run the command: List Signal Announcements for an overview of announcements and their current status."),s.quickChat=g(1277,"Toggle quick chat{0} to open or close a chat session.",""),s.startInlineChat=g(1278,"Start inline chat{0} to create an in editor chat session.",""),s.setBreakpoint=g(1279,"The Debug: Inline Breakpoint command{0} will set or unset a breakpoint at the current cursor position in the active editor.",""),s.debugExecuteSelection=g(1280,"The Debug: Execute Selection command{0} will execute the selected text in the debug console.","")})(Eg||(Eg={}));var v2e;(function(s){s.inspectTokensAction=g(1281,"Developer: Inspect Tokens")})(v2e||(v2e={}));var GY;(function(s){s.editorViewAccessibleLabel=g(1288,"Editor content"),s.accessibilityHelpMessage=g(1289,"Press Alt+F1 for Accessibility Options.")})(GY||(GY={}));var b2e;(function(s){s.toggleHighContrast=g(1290,"Toggle High Contrast Theme")})(b2e||(b2e={}));var Kme;(function(s){s.bulkEditServiceSummary=g(1291,"Made {0} edits in {1} files")})(Kme||(Kme={}));const gae=ae("workspaceTrustEnablementService"),cC=ae("workspaceTrustManagementService"),fae=ae("workspaceTrustRequestService");let Bk=[],DLe=[],kLe=[];function XG(s,e=!1){dje(s,!1,e)}function jSt(s){dje(s,!0,!1)}function dje(s,e,t){const i=YSt(s,e);Bk.push(i),i.userConfigured?kLe.push(i):DLe.push(i),t&&!i.userConfigured&&Bk.forEach(n=>{n.mime===i.mime||n.userConfigured||(i.extension&&n.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&n.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&n.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&n.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function YSt(s,e){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:e,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?K_(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(Vi.sep)>=0:!1}}function JSt(){Bk=Bk.filter(s=>s.userConfigured),DLe=[]}function XSt(){Bk=Bk.filter(s=>!s.userConfigured),kLe=[]}function ZSt(s,e){return eAt(s,e).map(t=>t.id)}function eAt(s,e){let t;if(s)switch(s.scheme){case pe.file:t=s.fsPath;break;case pe.data:{t=kk.parseMetaData(s).get(kk.META_DATA_LABEL);break}case pe.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:Us.unknown}];t=t.toLowerCase();const i=Ko(t),n=w2e(t,i,kLe);if(n)return[n,{id:Ca,mime:Us.text}];const o=w2e(t,i,DLe);if(o)return[o,{id:Ca,mime:Us.text}];if(e){const r=tAt(e);if(r)return[r,{id:Ca,mime:Us.text}]}return[{id:"unknown",mime:Us.unknown}]}function w2e(s,e,t){let i,n,o;for(let r=t.length-1;r>=0;r--){const a=t[r];if(e===a.filenameLowercase){i=a;break}if(a.filepattern&&(!n||a.filepattern.length>n.filepattern.length)){const c=a.filepatternOnPath?s:e;a.filepatternLowercase?.(c)&&(n=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&e.endsWith(a.extensionLowercase)&&(o=a)}if(i)return i;if(n)return n;if(o)return o}function tAt(s){if(V1e(s)&&(s=s.substr(1)),s.length>0)for(let e=Bk.length-1;e>=0;e--){const t=Bk[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t}}const dv=Object.prototype.hasOwnProperty,y2e="vs.editor.nullLanguage";class iAt{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(y2e,gT.Null),this._register(Ca,gT.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)||gT.Null}decodeLanguageId(e){return this._languageIdToLanguage[e]||y2e}}const Nz=class Nz extends V{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,Nz.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new iAt,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(mT.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Nz.instanceCount--,super.dispose()}setDynamicLanguages(e){this._dynamicLanguages=e,this._initializeFromRegistry()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},JSt();const e=[].concat(mT.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}registerLanguage(e){return mT.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(n=>{this._lowercaseNameMap[n.toLowerCase()]=i.identifier}),i.mimetypes.forEach(n=>{this._mimeTypesMap[n]=i.identifier})}),Qe.as(Nn.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;dv.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 n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),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)XG({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)XG({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)XG({id:i,mime:n,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);W1e(c)||XG({id:i,mime:n,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?dv.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getSortedRegisteredLanguageNames(){const e=[];for(const t in this._nameMap)dv.call(this._nameMap,t)&&e.push({languageName:t,languageId:this._nameMap[t]});return e.sort((t,i)=>bS(t.languageName,i.languageName)),e}getLanguageName(e){return dv.call(this._languages,e)?this._languages[e].name:null}getMimeType(e){return dv.call(this._languages,e)&&this._languages[e].mimetypes[0]||null}getExtensions(e){return dv.call(this._languages,e)?this._languages[e].extensions:[]}getFilenames(e){return dv.call(this._languages,e)?this._languages[e].filenames:[]}getIcon(e){return dv.call(this._languages,e)&&this._languages[e].icons[0]||null}getConfigurationFiles(e){return dv.call(this._languages,e)?this._languages[e].configurationFiles||[]:[]}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return dv.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&dv.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:ZSt(e,t)}};Nz.instanceCount=0;let qme=Nz;const Pz=class Pz extends V{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,Pz.instanceCount++,this._registry=this._register(new qme(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Pz.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 rm(i,null)}createById(e){return new phe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByMimeType(e){return new phe(this.onDidChange,()=>{const t=this.getLanguageIdByMimeType(e);return this._createAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new phe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Ca),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),Ta.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Pz.instanceCount=0;let KY=Pz;class phe{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 nAt extends V{constructor(e,t){super(),this._register(ue(e,"dragover",i=>{i.preventDefault(),this.timeout||(this.timeout=setTimeout(()=>{t(),this.timeout=null},800))})),["dragleave","drop","dragend"].forEach(i=>{this._register(ue(e,i,()=>{this.clearDragTimeout()}))})}clearDragTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){super.dispose(),this.clearDragTimeout()}}const tp={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Us.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},sAt=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let pae=sAt;const oAt=new ya(()=>pae("mouse",!1)),rAt=new ya(()=>pae("element",!1));function hje(s){pae=s}function Pr(s){return s==="element"?rAt.value:oAt.value}function Wk(){return pae("element",!0)}class aAt{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function uje(s){return(e,t,i)=>{let n=null,o=null;if(typeof i.value=="function"?(n="value",o=i.value):typeof i.get=="function"&&(n="get",o=i.get),!o)throw new Error("not supported");i[n]=s(o,t)}}function Zt(s,e,t){let i=null,n=null;if(typeof t.value=="function"?(i="value",n=t.value,n.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",n=t.get),!n)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:n.apply(this,r)}),this[o]}}function ILe(s,e,t){return uje((i,n)=>{const o=`$debounce$${n}`,r=`$debounce$result$${n}`;return function(...a){this[r]||(this[r]=void 0),clearTimeout(this[o]),this[o]=setTimeout(()=>{i.apply(this,a),this[r]=void 0},s)}})}function cAt(s,e,t){return uje((i,n)=>{const o=`$throttle$timer$${n}`,r=`$throttle$result$${n}`,a=`$throttle$lastRun$${n}`,c=`$throttle$pending$${n}`;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]+s;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 lAt=".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}";ut(lAt,{});var x1;(function(s){s[s.Copy=0]="Copy",s[s.Move=1]="Move"})(x1||(x1={}));var my;(function(s){s.Over="drop-target",s.Before="drop-target-before",s.After="drop-target-after"})(my||(my={}));class MI extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function C2e(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.ende.concat(t),[]))}class uAt{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 n=i.length-t,o=C2e({start:0,end:e},this.groups),r=C2e({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(c=>({range:Qme(c.range,n),size:c.size})),a=i.map((c,l)=>({range:{start:e+l,end:e+l+1},size:c.size}));this.groups=hAt(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 NI={CurrentDragAndDropData:void 0};var kC;(function(s){s[s.TOP=0]="TOP",s[s.CENTER_TOP=1]="CENTER_TOP",s[s.CENTER_BOTTOM=2]="CENTER_BOTTOM",s[s.BOTTOM=3]="BOTTOM"})(kC||(kC={}));const Kb={useShadows:!0,verticalScrollMode:Co.Auto,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class u6{get context(){return this._context}set context(e){this._context=e}constructor(e){this.elements=e}update(){}getData(){return this.elements}}class gje{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class jme{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;tn,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 tse=class tse{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:YV(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,n=Kb){if(this.virtualDelegate=t,this.domId=`list_id_${++tse.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Lh(50),this.splicing=!1,this.dragOverAnimationStopDisposable=V.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=V.None,this.onDragLeaveTimeout=V.None,this.disposables=new Z,this._onDidChangeContentHeight=new I,this._onDidChangeContentWidth=new I,this.onDidChangeContentHeight=M.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this.onDidChangeContentWidth=M.latch(this._onDidChangeContentWidth.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(n.paddingTop??0);for(const r of i)this.renderers.set(r.templateId,r);this.cache=this.disposables.add(new gAt(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 n.mouseSupport=="boolean"?n.mouseSupport:!0),this._horizontalScrolling=n.horizontalScrolling??Kb.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new pAt(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??Kb.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(ud.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new _N({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:r=>Tl(ct(this.domNode),r)})),this.scrollableElement=this.disposables.add(new o6(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??Kb.alwaysConsumeMouseWheel,horizontal:Co.Auto,vertical:n.verticalScrollMode??Kb.verticalScrollMode,useShadows:n.useShadows??Kb.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ue(this.rowsContainer,uo.Change,r=>this.onTouchChange(r))),this.disposables.add(ue(this.scrollableElement.getDomNode(),"scroll",r=>r.target.scrollTop=0)),this.disposables.add(ue(this.domNode,"dragover",r=>this.onDragOver(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"drop",r=>this.onDrop(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"dragleave",r=>this.onDragLeave(this.toDragEvent(r)))),this.disposables.add(ue(this.domNode,"dragend",r=>this.onDragEnd(r))),this.setRowLineHeight=n.setRowLineHeight??Kb.setRowLineHeight,this.setRowHeight=n.setRowHeight??Kb.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??Kb.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(Kb.dnd),this.layout(n.initialSize?.height,n.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),n=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+n),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 n=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=n+this.probeDynamicHeight(e)}if(n===t)return;const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);let r=0;ee&&i=r.start;A--){const L=this.items[A];if(L.dragStartDisposable.dispose(),L.checkedDisposable.dispose(),L.row){let k=a.get(L.templateId);k||(k=[],a.set(L.templateId,k));const P=this.renderers.get(L.templateId);P&&P.disposeElement&&P.disposeElement(L.element,A,L.row.templateData,L.size),k.unshift(L.row)}L.row=null,L.stale=!0}const c={start:e+t,end:this.items.length},l=Ld.intersect(c,n),d=Ld.relativeComplement(c,n),h=i.map(A=>({id:String(this.itemId++),element:A,templateId:this.virtualDelegate.getTemplateId(A),size:this.virtualDelegate.getHeight(A),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(A),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:V.None,checkedDisposable:V.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=Qme(l,f),v=Ld.intersect(p,m);for(let A=v.start;AQme(A,f)),C=[{start:e,end:e+i.length},...w].map(A=>Ld.intersect(p,A)).reverse();for(const A of C)for(let L=A.end-1;L>=A.start;L--){const k=this.items[L],R=a.get(k.templateId)?.pop();this.insertItemInDOM(L,R)}for(const A of a.values())for(const L of A)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(A=>A.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Tl(ct(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:Y1e(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:YV(this.domNode)})}render(e,t,i,n,o,r=!1){const a=this.getRenderRange(t,i),c=Ld.relativeComplement(a,e).reverse(),l=Ld.relativeComplement(e,a);if(r){const d=Ld.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)}),n!==void 0&&(this.rowsContainer.style.left=`-${n}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 n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);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=ue(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=YV(e.row.domNode);const t=ct(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 M.map(this.disposables.add(new ii(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return M.map(this.disposables.add(new ii(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return M.filter(M.map(this.disposables.add(new ii(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseUp(){return M.map(this.disposables.add(new ii(this.domNode,"mouseup")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDown(){return M.map(this.disposables.add(new ii(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return M.map(this.disposables.add(new ii(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMove(){return M.map(this.disposables.add(new ii(this.domNode,"mousemove")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return M.map(this.disposables.add(new ii(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return M.any(M.map(this.disposables.add(new ii(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),M.map(this.disposables.add(new ii(this.domNode,uo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return M.map(this.disposables.add(new ii(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return M.map(this.disposables.add(new ii(this.rowsContainer,uo.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],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,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 n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(tp.TEXT,t),i.dataTransfer.setDragImage){let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(n,i)),typeof o>"u"&&(o=String(n.length));const r=fe(".monaco-drag-image");r.textContent=o,(l=>{for(;l&&!l.classList.contains("monaco-workbench");)l=l.parentElement;return l||this.domNode.ownerDocument})(this.domNode).appendChild(r),i.dataTransfer.setDragImage(r,-10,-10),setTimeout(()=>r.remove(),0)}this.domNode.classList.add("dragging"),this.currentDragData=new u6(n),NI.CurrentDragAndDropData=new gje(n),this.dnd.onDragStart?.(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),NI.CurrentDragAndDropData&&NI.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(NI.CurrentDragAndDropData)this.currentDragData=NI.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new jme}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===x1.Copy?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=ja(i).filter(o=>o>=-1&&oo-r),i=i[0]===-1?[-1]:i;let n=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:my.Over;if(fAt(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===n)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=n,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(n),this.rowsContainer.classList.add(n),this.currentDragFeedbackDisposable=Ee(()=>{this.domNode.classList.remove(n),this.rowsContainer.classList.remove(n)});else{if(i.length>1&&n!==my.Over)throw new Error("Can't use multiple feedbacks with position different than 'over'");n===my.After&&i[0]{for(const o of i){const r=this.items[o];r.dropTarget=!1,r.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Ky(()=>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,NI.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,NI.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=V.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=Hj(this.domNode).top;this.dragOverAnimationDisposable=Tdt(ct(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Ky(()=>{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,n=Math.floor(i/.25);return Ka(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(Yr(i)||Adt(i))&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const o=Number(n);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 n=this.getRenderRange(e,t);let o,r;e===this.elementTop(n.start)?(o=n.start,r=0):n.end-n.start>1&&(o=n.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;us===e;function q2(s=fp){return(e,t)=>is(e,t,s)}function mAt(){return(s,e)=>s.equals(e)}function Nq(s,e,t){if(t!==void 0){const i=s;return i==null||e===void 0||e===null?e===i:t(i,e)}else{const i=s;return(n,o)=>n==null||o===void 0||o===null?o===n:i(n,o)}}function qY(s,e){if(s===e)return!0;if(Array.isArray(s)&&Array.isArray(e)){if(s.length!==e.length)return!1;for(let t=0;t{const o=TLe(n);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(n.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:n},o=>n(this.read(o),o))}flatten(){return Xme({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(pje(this,t)),this}keepObserved(e){return e.add(mje(this)),this}get debugValue(){return this.get()}}class AU extends _je{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 ts(s,e){const t=new EU(s,e);try{s(t)}finally{t.finish()}}let ZG;function sV(s){if(ZG)s(ZG);else{const e=new EU(s,void 0);ZG=e;try{s(e)}finally{e.finish(),ZG=void 0}}}async function vje(s,e){const t=new EU(s,e);try{await s(t)}finally{t.finish()}}function bM(s,e,t){s?e(s):ts(e,t)}class EU{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():TLe(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{const o=this._value;this._setValue(e),fje()?.handleObservableChanged(this,{oldValue:o,newValue:e,change:i,didChange:!0,hadValue:!0});for(const r of this.observers)t.updateObserver(r,this),r.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function h3(s,e){let t;return typeof s=="string"?t=new Qd(void 0,s,void 0):t=new Qd(s,void 0,void 0),new kAt(t,e,fp)}class kAt extends LLe{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}function Ze(s,e){return e!==void 0?new wM(new Qd(s,void 0,e),e,void 0,void 0,void 0,fp):new wM(new Qd(void 0,void 0,s),s,void 0,void 0,void 0,fp)}function g6(s,e,t){return new IAt(new Qd(s,void 0,e),e,void 0,void 0,void 0,fp,t)}function Yh(s,e){return new wM(new Qd(s.owner,s.debugName,s.debugReferenceFn),e,void 0,void 0,s.onLastObserverRemoved,s.equalsFn??fp)}DAt(Yh);function bje(s,e){return new wM(new Qd(s.owner,s.debugName,void 0),e,s.createEmptyChangeSummary,s.handleChange,void 0,s.equalityComparer??fp)}function vI(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new Z;return new wM(new Qd(i,void 0,t),o=>(n.clear(),t(o,n)),void 0,void 0,()=>n.dispose(),fp)}function fh(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);let n;return new wM(new Qd(i,void 0,t),o=>{n?n.clear():n=new Z;const r=t(o);return r&&n.add(r),r},void 0,void 0,()=>{n&&(n.dispose(),n=void 0)},fp)}var yd;(function(s){s[s.initial=0]="initial",s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(yd||(yd={}));class wM extends AU{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n,o=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=yd.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=yd.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===yd.dependenciesMightHaveChanged){for(const e of this.dependencies)if(e.reportChanges(),this.state===yd.stale)break}this.state===yd.dependenciesMightHaveChanged&&(this.state=yd.upToDate),this._recomputeIfNeeded()}while(this.state!==yd.upToDate);return this.value}}_recomputeIfNeeded(){if(this.state===yd.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==yd.initial,i=this.value;this.state=yd.upToDate;const n=this.changeSummary;this.changeSummary=this.createChangeSummary?.();try{this.value=this._computeFn(this,n)}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===yd.upToDate&&(this.state=yd.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)}V_(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===yd.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=yd.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,n=this.state===yd.upToDate;if(i&&(this.state===yd.dependenciesMightHaveChanged||n)&&(this.state=yd.stale,n))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 IAt extends wM{constructor(e,t,i,n,o=void 0,r,a){super(e,t,i,n,o,r),this.set=a}}function ai(s){return new mae(new Qd(void 0,void 0,s),s,void 0,void 0)}function f6(s,e){return new mae(new Qd(s.owner,s.debugName,s.debugReferenceFn??e),e,void 0,void 0)}function xU(s,e){return new mae(new Qd(s.owner,s.debugName,s.debugReferenceFn??e),e,s.createEmptyChangeSummary,s.handleChange)}function TAt(s,e){const t=new Z,i=xU({owner:s.owner,debugName:s.debugName,debugReferenceFn:s.debugReferenceFn??e,createEmptyChangeSummary:s.createEmptyChangeSummary,handleChange:s.handleChange},(n,o)=>{t.clear(),e(n,o,t)});return Ee(()=>{i.dispose(),t.dispose()})}function au(s){const e=new Z,t=f6({owner:void 0,debugName:void 0,debugReferenceFn:s},i=>{e.clear(),s(i,e)});return Ee(()=>{t.dispose(),e.dispose()})}var Sf;(function(s){s[s.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",s[s.stale=2]="stale",s[s.upToDate=3]="upToDate"})(Sf||(Sf={}));class mae{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=Sf.stale,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=this.createChangeSummary?.(),this._runIfNeeded(),cU(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),lU(this)}_runIfNeeded(){if(this.state===Sf.upToDate)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=Sf.upToDate;const t=this.disposed;try{if(!t){fje()?.handleAutorunTriggered(this);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===Sf.upToDate&&(this.state=Sf.dependenciesMightHaveChanged),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===Sf.dependenciesMightHaveChanged){this.state=Sf.upToDate;for(const e of this.dependencies)if(e.reportChanges(),this.state===Sf.stale)break}this._runIfNeeded()}while(this.state!==Sf.upToDate);this.updateCount--,V_(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===Sf.upToDate&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=Sf.dependenciesMightHaveChanged)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:n=>n===e},this.changeSummary))&&(this.state=Sf.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(s){s.Observer=mae})(ai||(ai={}));function td(s){return new LAt(s)}class LAt extends _je{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 Kn(...s){let e,t,i;return s.length===3?[e,t,i]=s:[t,i]=s,new Ex(new Qd(e,void 0,i),t,i,()=>Ex.globalTransaction,fp)}function RAt(s,e,t){return new Ex(new Qd(s.owner,s.debugName,s.debugReferenceFn??t),e,t,()=>Ex.globalTransaction,s.equalsFn??fp)}class Ex extends AU{constructor(e,t,i,n,o){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=o,this.hasValue=!1,this.handleEvent=r=>{const a=this._getValue(r),c=this.value;(!this.hasValue||!this._equalityComparator(c,a))&&(this.value=a,this.hasValue&&bM(this._getTransaction(),d=>{for(const h of this.observers)d.updateObserver(h,this),h.handleChange(this,void 0)},()=>{const d=this.getDebugName();return"Event fired"+(d?`: ${d}`:"")}),this.hasValue=!0)}}getDebugName(){return this._debugNameData.getDebugName(this)}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(s){s.Observer=Ex;function e(t,i){let n=!1;Ex.globalTransaction===void 0&&(Ex.globalTransaction=t,n=!0);try{i()}finally{n&&(Ex.globalTransaction=void 0)}}s.batchEventsGlobally=e})(Kn||(Kn={}));function ed(s,e){return new MAt(s,e)}class MAt extends AU{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{ts(i=>{for(const n of this.observers)i.updateObserver(n,this),n.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function lC(s){return typeof s=="string"?new D2e(s):new D2e(void 0,s)}class D2e extends AU{get debugName(){return new Qd(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){ts(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 Pq(s){const e=new wje(!1,void 0);return s.addObserver(e),Ee(()=>{s.removeObserver(e)})}xAt(Pq);function RN(s,e){const t=new wje(!0,e);return s.addObserver(t),e?e(s.get()):s.reportChanges(),Ee(()=>{s.removeObserver(t)})}EAt(RN);class wje{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 p6(s,e){let t;return Yh({owner:s,debugReferenceFn:e},n=>(t=e(n,t),t))}function NAt(s,e){let t;const i=lC("derivedObservableWithWritableCache"),n=Ze(s,o=>(i.read(o),t=e(o,t),t));return Object.assign(n,{clearCache:o=>{t=void 0,i.trigger(o)},setCache:(o,r)=>{t=o,i.trigger(r)}})}function QY(s,e,t,i){let n=new k2e(t,i);return Yh({debugReferenceFn:t,owner:s,onLastObserverRemoved:()=>{n.dispose(),n=new k2e(t)}},r=>(n.setItems(e.read(r)),n.getItems()))}class k2e{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 n of e){const o=this._keySelector?this._keySelector(n):n;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new Z;r={out:this._map(n,a),store:a},this._cache.set(o,r)}t.push(r.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}}class RLe{constructor(e){this.observable=e}get onDidChange(){return M.fromObservableLight(this.observable)}get value(){return this.observable.get()}}function yje(s,e){return e instanceof RLe?e.observable:Kn(s,e.onDidChange,()=>e.value)}function PAt(s,e){return p6(s,(t,i)=>i??e(t))}class FAt{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(o=>o.templateData===i);if(n>=0){const o=this.renderedElements[n];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 n=[];for(const o of this.renderedElements)o.index=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}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 u3=class{get name(){return this._trait}get renderer(){return new FAt(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new I,this.onChange=this._onChange.event}splice(e,t,i){const n=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+n);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(T2e),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=e_e(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return _2(this.sortedIndexes,e,T2e)>=0}dispose(){bt(this._onChange)}};u3.__decorator=D([Zt],u3.prototype,"renderer",null);class OAt extends u3{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 mhe{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 n=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(n.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(n),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function iA(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function m6(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:m6(s.parentElement,e)}function oV(s){return m6(s,"monaco-editor")}function BAt(s){return m6(s,"monaco-custom-toggle")}function WAt(s){return m6(s,"action-item")}function w5(s){return m6(s,"monaco-tree-sticky-row")}function g3(s){return s.classList.contains("monaco-tree-sticky-container")}function Cje(s){return s.tagName==="A"&&s.classList.contains("monaco-button")||s.tagName==="DIV"&&s.classList.contains("monaco-button-dropdown")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:Cje(s.parentElement)}class Zme{get onKeyDown(){return M.chain(this.disposables.add(new ii(this.view.domNode,"keydown")).event,e=>e.filter(t=>!iA(t.target)).map(t=>new En(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(n=>{switch(n.keyCode){case S.Enter:return this.onEnter(n);case S.UpArrow:return this.onUpArrow(n);case S.DownArrow:return this.onDownArrow(n);case S.PageUp:return this.onPageUpArrow(n);case S.PageDown:return this.onPageDownArrow(n);case S.Escape:return this.onEscape(n);case S.KeyA:this.multipleSelectionSupport&&(Qt?n.metaKey:n.ctrlKey)&&this.onCtrlA(n)}}))}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(Su(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()}}Zme.__decorator=D([Zt],Zme.prototype,"onKeyDown",null);var Vw;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(Vw||(Vw={}));var aF;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(aF||(aF={}));const HAt=new class{mightProducePrintableCharacter(s){return s.ctrlKey||s.metaKey||s.altKey?!1:s.keyCode>=S.KeyA&&s.keyCode<=S.KeyZ||s.keyCode>=S.Digit0&&s.keyCode<=S.Digit9||s.keyCode>=S.Numpad0&&s.keyCode<=S.Numpad9||s.keyCode>=S.Semicolon&&s.keyCode<=S.Quote}};class UAt{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=aF.Idle,this.mode=Vw.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??Vw.Automatic}trigger(){this.triggered=!this.triggered}enable(){if(this.enabled)return;let e=!1;const t=M.chain(this.enabledDisposables.add(new ii(this.view.domNode,"keydown")).event,o=>o.filter(r=>!iA(r.target)).filter(()=>this.mode===Vw.Automatic||this.triggered).map(r=>new En(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>en.stop(r,!0)).map(r=>r.browserEvent.key)),i=M.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);M.reduce(M.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"?Mr(t):t&&Mr(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=aF.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===aF.Idle?1:0;this.state=aF.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"||vM(e,c)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class VAt{constructor(e,t){this.list=e,this.view=t,this.disposables=new Z;const i=M.chain(this.disposables.add(new ii(t.domNode,"keydown")).event,o=>o.filter(r=>!iA(r.target)).map(r=>new En(r)));M.chain(i,o=>o.filter(r=>r.keyCode===S.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 n=i.querySelector("[tabIndex]");if(!n||!Yr(n)||n.tabIndex===-1)return;const o=ct(n).getComputedStyle(n);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function Sje(s){return Qt?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function Aje(s){return s.browserEvent.shiftKey}function zAt(s){return Z1e(s)&&s.button===2}const I2e={isSelectionSingleChangeEvent:Sje,isSelectionRangeChangeEvent:Aje};class Eje{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||I2e),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(ud.addTarget(e.getHTMLElement()))),M.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||I2e))}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){oV(e.browserEvent.target)||Bc()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(iA(e.browserEvent.target)||oV(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||iA(e.browserEvent.target)||oV(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),zAt(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(iA(e.browserEvent.target)||oV(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 n=Math.min(i,t),o=Math.max(i,t),r=Su(n,o+1),a=this.list.getSelection(),c=KAt(e_e(a,[i]),i);if(c.length===0)return;const l=e_e(r,qAt(a,c));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),o=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class xje{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(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } - `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=Iy(e.listFocusAndSelectionOutline,Iy(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` + `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=xy(e.listFocusAndSelectionOutline,xy(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } - `);const o=Iy(e.listSelectionOutline,e.listInactiveFocusOutline??"");o&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${o}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` + `);const o=xy(e.listSelectionOutline,e.listInactiveFocusOutline??"");o&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${o}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` .monaco-list${t}.drop-target, .monaco-list${t} .monaco-list-rows.drop-target, .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } @@ -269,17 +269,17 @@ ${e}`)}function CSt(s){return SI(s,"`")}function SSt(s){return SI(s,"*")}functio background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=i.join(` -`)}}const tEt={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:me.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:me.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:me.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},iEt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function nEt(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]s-e;class oEt{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,n){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class rEt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Z}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&typeof n!="string"?n:nd(n);i.disposables.add(ai(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,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class aEt{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,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}}class Xa{get onDidChangeFocus(){return M.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return M.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=M.chain(this.disposables.add(new ii(this.view.domNode,"keydown")).event,o=>o.map(r=>new En(r)).filter(r=>e=r.keyCode===S.ContextMenu||r.shiftKey&&r.keyCode===S.F10).map(r=>en.stop(r,!0)).filter(()=>!1)),i=M.chain(this.disposables.add(new ii(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new En(r)).filter(r=>r.keyCode===S.ContextMenu||r.shiftKey&&r.keyCode===S.F10).map(r=>en.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}})),n=M.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:c})=>({element:r,index:a,anchor:new Eh(ct(this.view.domNode),c),browserEvent:c})));return M.any(t,i,n)}get onKeyDown(){return this.disposables.add(new ii(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new ii(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new ii(this.view.domNode,"keypress")).event}get onDidFocus(){return M.signal(this.disposables.add(new ii(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return M.signal(this.disposables.add(new ii(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,o=iEt){this.user=e,this._options=o,this.focus=new p3("focused"),this.anchor=new p3("anchor"),this.eventBufferer=new F7,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 QAt(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new rEt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(l=>new oEt(l.templateId,[...a,l]));const c={...o,dnd:o.dnd&&new aEt(this,o.dnd)};if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const l=gl(this.view.domNode);this.styleController=new Nje(l,this.view.domId)}if(this.spliceable=new vAt([new She(this.focus,this.view,o.identityProvider),new She(this.selection,this.view,o.identityProvider),new She(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 ZAt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new o_e(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const l=o.keyboardNavigationDelegate||JAt;this.typeNavigationController=new XAt(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,n){return new gc(e,t,i,n)}createMouseController(e){return new Mje(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 WI(this.user,`Invalid start index: ${e}`);if(t<0)throw new WI(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 WI(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 WI(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return lm(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 WI(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);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 n=this.getFocus()[0];if(n!==i&&(n===void 0||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await Sr(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const o=i(),r=this.view.getScrollTop()+o;r===0?n=this.view.indexAt(r):n=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==n&&(a===void 0||a>=n)){const c=this.findNextIndex(n,!1,t);c>-1&&a!==c?this.setFocus([c],e):this.setFocus([n],e)}else{const c=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Sr(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 n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=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 n=0;nthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new WI(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(lc(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Ka(t,0,1)+o-i)}else{const a=o+r,c=n+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 WI(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-n)/r)}isDOMFocused(){return av(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()}}Xa.__decorator=D([Zt],Xa.prototype,"onDidChangeFocus",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidChangeSelection",null);Xa.__decorator=D([Zt],Xa.prototype,"onContextMenu",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyDown",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyUp",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyPress",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidFocus",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidBlur",null);let Pje={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function Fje(s){Pje=s}function Sm(){return Pje}var cEt=".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}";ut(cEt,{});const L1=fe,Oje="selectOption.entry.template";class lEt{get templateId(){return Oje}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=re(e,L1(".option-text")),t.detail=re(e,L1(".option-detail")),t.decoratorRight=re(e,L1(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,r=e.detail,a=e.decoratorRight,c=e.isDisabled;n.text.textContent=o,n.detail.textContent=r||"",n.decoratorRight.innerText=a||"",c?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}const yw=class yw extends V{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=yw.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(Sm().setupManagedHover(Pr("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return Oje}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=fe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=re(this.selectDropDownContainer,L1(".select-box-details-pane"));const t=re(this.selectDropDownContainer,L1(".select-box-dropdown-container-width-control")),i=re(t,L1(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",re(i,this.widthControlElement),this._dropDownPosition=Vf.BELOW,this.styleElement=gl(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ue(this.selectDropDownContainer,ke.DRAG_START,n=>{en.stop(n,!0)}))}registerListeners(){this._register(Ro(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(ue(this.selectElement,ke.CLICK,t=>{en.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.MOUSE_DOWN,t=>{en.stop(t)}));let e;this._register(ue(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ue(this.selectElement,"touchend",t=>{en.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.KEY_DOWN,t=>{const i=new En(t);let n=!1;Qt?(i.keyCode===S.DownArrow||i.keyCode===S.UpArrow||i.keyCode===S.Space||i.keyCode===S.Enter)&&(n=!0):(i.keyCode===S.DownArrow&&i.altKey||i.keyCode===S.UpArrow&&i.altKey||i.keyCode===S.Space||i.keyCode===S.Enter)&&(n=!0),n&&(this.showSelectDropDown(),en.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){is(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,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=Iy(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 n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}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:()=>{this.selectDropDownContainer.remove()}}}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=ct(this.selectElement),i=Cr(this.selectElement),n=ct(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-yw.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=Vf.ABOVE,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=Vf.BELOW,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),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,n=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>n&&(i=r,n=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Pd(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=re(e,L1(".select-box-dropdown-list-container")),this.listRenderer=new lEt,this.selectList=this._register(new Xa("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:Co.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let o=n.text;return n.detail&&(o+=`. ${n.detail}`),n.decoratorRight&&(o+=`. ${n.decoratorRight}`),n.description&&(o+=`. ${n.description}`),o},getWidgetAriaLabel:()=>g(10917,"Select Box"),getRole:()=>Qt?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ii(this.selectDropDownListContainer,"keydown")),i=M.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(o=>new En(o)));this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Enter))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Tab))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Escape))(this.onEscape,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.UpArrow))(this.onUpArrow,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.DownArrow))(this.onDownArrow,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.PageDown))(this.onPageDown,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.PageUp))(this.onPageUp,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Home))(this.onHome,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.End))(this.onEnd,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode>=S.Digit0&&o.keyCode<=S.KeyZ||o.keyCode>=S.Semicolon&&o.keyCode<=S.NumpadDivide))(this.onCharacter,this)),this._register(ue(this.selectList.getHTMLElement(),ke.POINTER_UP,n=>this.onPointerUp(n))),this._register(this.selectList.onMouseOver(n=>typeof n.index<"u"&&this.selectList.setFocus([n.index]))),this._register(this.selectList.onDidChangeFocus(n=>this.onListFocus(n))),this._register(ue(this.selectDropDownContainer,ke.FOCUS_OUT,n=>{!this._isVisible||wc(n.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;en.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n{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&&(en.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){en.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){en.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){en.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=Ia.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(ue(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ro(this.selectElement,"click",e=>{en.stop(e,!0)})),this._register(Ro(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ro(this.selectElement,"keydown",e=>{let t=!1;Qt?(e.keyCode===S.DownArrow||e.keyCode===S.UpArrow||e.keyCode===S.Space)&&(t=!0):(e.keyCode===S.DownArrow&&e.altKey||e.keyCode===S.Space||e.keyCode===S.Enter)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!is(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,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(n)}))}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 $_)),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(fd.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,rf&&this._register(ue(e,ke.DRAG_START,n=>n.dataTransfer?.setData(sp.TEXT,this._action.label)))),this._register(ue(t,uo.Tap,n=>this.onClick(n,!0))),this._register(ue(t,ke.MOUSE_DOWN,n=>{i||en.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),Qt&&this._register(ue(t,ke.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(ue(t,ke.CLICK,n=>{en.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(ue(t,ke.DBLCLICK,n=>{en.stop(n,!0)})),[ke.MOUSE_UP,ke.MOUSE_OUT].forEach(n=>{this._register(ue(t,n,o=>{en.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){en.stop(e,!0);const i=ra(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??Pr("element");this.customHover=this._store.add(Sm().setupManagedHover(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 Jy extends zf{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),Tt(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===Ar.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"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(5041,"{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.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Bje extends zf{constructor(e,t,i,n,o,r,a){super(e,t),this.selectBox=new uEt(i,n,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 fEt=".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}";ut(fEt,{});class pEt extends $_{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=re(e,fe(".monaco-dropdown")),this._label=re(this._element,fe(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[ke.CLICK,ke.MOUSE_DOWN,uo.Tap])this._register(ue(this.element,o,r=>en.stop(r,!0)));for(const o of[ke.MOUSE_DOWN,uo.Tap])this._register(ue(this._label,o,r=>{hTe(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(ue(this._label,ke.KEY_UP,o=>{const r=new En(o);(r.equals(S.Enter)||r.equals(S.Space))&&(en.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(fd.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(Sm().setupManagedHover(Pr("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 mEt extends pEt{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:vb.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 sA extends zf{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=re(o,fe("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(Sm().setupManagedHover(this.options.hoverDelegate??Pr("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),n={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 mEt(e,n)),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 _Et='.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-action-bar .action-item.menu-entry.text-only .action-label{border-radius:2px;color:var(--vscode-descriptionForeground);overflow:hidden}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:", "}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.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}';ut(_Et,{});const Oa=ae("menuService");function GLe(s){return s&&typeof s=="object"&&typeof s.original=="string"&&typeof s.value=="string"}function vEt(s){return s?s.condition!==void 0:!1}const A5={exports:{}};(function(){function s(n){const o=[];typeof n=="number"&&o.push("code/timeOrigin",n);function r(c){o.push(c,Date.now())}function a(){const c=[];for(let l=0;lthis.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===kv.Closed)return;let i=!1;ra(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===kv.None&&(this.state=kv.Initialized,this.options.hint!==oD.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return ra(i)?t:i}getBoolean(e,t){const i=this.get(e);return ra(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return ra(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return ra(i)?t:j2(i)}async set(e,t,i=!1){if(this.state===kv.Closed)return;if(ra(t))return this.delete(e,i);const n=kn(t)||Array.isArray(t)?eje(t):String(t);if(this.cache.get(e)!==n)return this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===kv.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!==kv.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=kv.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===kv.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===oD.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===oD.STORAGE_IN_MEMORY}};rse.DEFAULT_FLUSH_DELAY=100;let oA=rse;class Bq{constructor(){this.onDidChangeItemsExternal=M.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 Jt=ae("fileService"),ks=ae("IUriIdentityService"),yEt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function CEt(s){return yEt.test(s)}const ar=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;nd.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&&n.set(r,c)}}catch(o){this.logService.error(o)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:n}}return this._profilesObject}createDefaultProfile(){const e=cV("__default__profile__",g(567,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Rh(t)}\\s(\\d+)`);let n=0;for(const r of this.profiles){const a=i.exec(r.name),c=a?parseInt(a[1]):0;n=c>n?c:n}const o=`${t} ${n+1}`;return this.createProfile(Wc(ar()).toString(16),o,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Wc(ar()).toString(16),e,t,i)}async createProfile(e,t,i,n){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const o=await this.doCreateProfile(e,t,i);return n&&await this.setProfileForWorkspace(n,o),o}async doCreateProfile(e,t,i){if(!Lt(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let n=this.profileCreationPromises.get(t);return n||(n=(async()=>{try{if(this.profiles.find(c=>c.name===t||c.id===e))throw new Error(`Profile with ${t} name already exists`);const r=cV(e,t,Pt(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 Zs.settled(a),this.updateProfiles([r],[],[]),r}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,n)),n}async updateProfile(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let i=this.profiles.find(n=>n.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);return i=cV(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(n=>n.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(n){i.push(n)}});try{await Promise.allSettled(i)}catch(n){this.logService.error(n)}for(const n of[...this.profilesObject.emptyWindows.keys()])t.id===this.profilesObject.emptyWindows.get(n)?.id&&this.profilesObject.emptyWindows.delete(n);for(const n of[...this.profilesObject.workspaces.keys()])t.id===this.profilesObject.workspaces.get(n)?.id&&this.profilesObject.workspaces.delete(n);this.updateStoredProfileAssociations(),this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(n){$w(n)!==Qi.FILE_NOT_FOUND&&this.logService.error(n)}}async setProfileForWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const i=this.profiles.find(n=>n.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.folders.clear(),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),i=N.isUri(t)?this.profilesObject.workspaces.get(t):this.profilesObject.emptyWindows.get(t);return i||(P_(e)?this.transientProfilesObject.folders.get(e.uri):iA(e)?this.transientProfilesObject.workspaces.get(e.configPath):this.transientProfilesObject.emptyWindows.get(e.id))}getWorkspace(e){return P_(e)?e.uri:iA(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!([...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))||[...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.transientProfilesObject.folders.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const n=[...this.profiles,...e],o=[],r=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];for(let a of n){if(a.isDefault||t.some(l=>a.id===l.id))continue;a=i.find(l=>a.id===l.id)??a;const c=r.find(l=>a.id===l.id);if(a.isTransient)this.transientProfilesObject.profiles.push(a);else{if(c){for(const[l,d]of this.transientProfilesObject.emptyWindows.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:l},a);break}for(const[l,d]of this.transientProfilesObject.workspaces.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:"",configPath:l},a);break}for(const[l,d]of this.transientProfilesObject.folders.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:"",uri:l},a);break}}o.push({location:a.location,name:a.name,shortName:a.shortName,icon:a.icon,useDefaultFlags:a.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){if(i=t?.isTransient?!0:i,i)P_(e)?(this.transientProfilesObject.folders.delete(e.uri),t&&this.transientProfilesObject.folders.set(e.uri,t)):iA(e)?(this.transientProfilesObject.workspaces.delete(e.configPath),t&&this.transientProfilesObject.workspaces.set(e.configPath,t)):(this.transientProfilesObject.emptyWindows.delete(e.id),t&&this.transientProfilesObject.emptyWindows.set(e.id,t));else{this.updateWorkspaceAssociation(e,void 0,!0);const n=this.getWorkspace(e);N.isUri(n)?(this.profilesObject.workspaces.delete(n),t&&this.profilesObject.workspaces.set(n,t)):(this.profilesObject.emptyWindows.delete(n),t&&this.profilesObject.emptyWindows.set(n,t)),this.updateStoredProfileAssociations()}}updateStoredProfileAssociations(){const e={};for(const[i,n]of this.profilesObject.workspaces.entries())e[i.toString()]=n.id;const t={};for(const[i,n]of this.profilesObject.emptyWindows.entries())t[i.toString()]=n.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=N.parse(r);t[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const n={};if(e.emptyWindows)for(const[o,r]of Object.entries(e.emptyWindows)){const a=N.parse(r);n[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}return{workspaces:t,emptyWindows:n}}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},dL.PROFILES_KEY="userDataProfiles",dL.PROFILE_ASSOCIATIONS_KEY="profileAssociations",dL);$2e=D([_(0,Za),_(1,Jt),_(2,ks),_(3,Ge)],$2e);const Wq="__$__isNewStorageMarker",Hq="__$__targetStorageMarker";var wy;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(wy||(wy={}));var Ie;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Ie||(Ie={}));var an;(function(s){s[s.USER=0]="USER",s[s.MACHINE=1]="MACHINE"})(an||(an={}));function SEt(s){const e=s.get(Hq);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const ase=class ase extends V{constructor(e={flushInterval:ase.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new kk),this._onDidChangeTarget=this._register(new kk),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new cn(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new wn),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return M.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=N2(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){bt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{cs("code/willInitStorage");try{await this.doInitialize()}finally{cs("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===Hq){switch(e){case Ie.APPLICATION:this._applicationKeyTargets=void 0;break;case Ie.PROFILE:this._profileKeyTargets=void 0;break;case Ie.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:n})}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,n,o=!1){if(ra(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),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=[],n=this.getKeyTargets(e);for(const o of Object.keys(n))n[o]===t&&i.push(o);return i}updateKeyTarget(e,t,i,n=!1){const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(Hq,JSON.stringify(o),n)):typeof o[e]=="number"&&(delete o[e],this.getStorage(t)?.set(Hq,JSON.stringify(o),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(Ie.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(Ie.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(Ie.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case Ie.APPLICATION:return this.applicationKeyTargets;case Ie.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?SEt(t):Object.create(null)}isNew(e){return this.getBoolean(Wq,e)===!0}async flush(e=wy.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(Ie.APPLICATION),i=this.getStorage(Ie.PROFILE),n=this.getStorage(Ie.WORKSPACE);switch(e){case wy.NONE:await Zs.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case wy.SHUTDOWN:await Zs.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(Ie.APPLICATION)?.items??new Map,t=this.getStorage(Ie.PROFILE)?.items??new Map,i=this.getStorage(Ie.WORKSPACE)?.items??new Map;return EEt(e,t,i,this.getLogDetails(Ie.APPLICATION)??"",this.getLogDetails(Ie.PROFILE)??"",this.getLogDetails(Ie.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(wy.NONE),Wje(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||c_e(t)&&c_e(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const n=new Set;for(const[o,r]of e)n.add(o),t.get(o)!==r&&this.emitDidChangeValue(i,{key:o,external:!0});for(const[o]of t.items)n.has(o)||this.emitDidChangeValue(i,{key:o,external:!0})})}};ase.DEFAULT_FLUSH_INTERVAL=60*1e3;let X2=ase;function c_e(s){return s.isDefault||!!s.useDefaultFlags?.globalState}class AEt extends X2{constructor(){super(),this.applicationStorage=this._register(new oA(new Bq,{hint:oD.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new oA(new Bq,{hint:oD.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new oA(new Bq,{hint:oD.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.WORKSPACE,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.PROFILE,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.APPLICATION,e)))}getStorage(e){switch(e){case Ie.APPLICATION:return this.applicationStorage;case Ie.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case Ie.APPLICATION:return"inMemory (application)";case Ie.PROFILE:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}async function EEt(s,e,t,i,n,o){const r=m=>{try{return JSON.parse(m)}catch{return m}},a=new Map,c=new Map;s.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!==n?`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!==n){console.group(`Storage: Profile (path: ${n}, profile specific)`);const m=[];l.forEach((v,b)=>{m.push({key:b,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 $i=ae("storageService");function xEt(s,e){const t={...e};for(const i in s){const n=s[i];t[i]=n!==void 0?ze(n):void 0}return t}const l_e={keybindingLabelBackground:ze(Zft),keybindingLabelForeground:ze(ept),keybindingLabelBorder:ze(tpt),keybindingLabelBottomBorder:ze(ipt),keybindingLabelShadow:ze(CI)},y6={buttonForeground:ze(bM),buttonSeparator:ze(rqe),buttonBackground:ze(_y),buttonHoverBackground:ze($8),buttonSecondaryForeground:ze(Vft),buttonSecondaryBackground:ze(zpe),buttonSecondaryHoverBackground:ze(zft),buttonBorder:ze(Uft)},Hje={progressBarBackground:ze(sft)},JY={inputActiveOptionBorder:ze(Kre),inputActiveOptionForeground:ze(qre),inputActiveOptionBackground:ze(a6)};ze(Z4),ze($ft),ze(Gft),ze(Kft),ze(qft),ze(Qft),ze(jft);ze(Yft),ze(Xft),ze(Jft);ze(xh),ze(IN),ze(CI),ze(wt),ze(Aft),ze(Eft),ze(xft),ze(ITe);const EM={inputBackground:ze(z2),inputForeground:ze(iqe),inputBorder:ze(o5),inputValidationInfoBorder:ze(Fft),inputValidationInfoBackground:ze(Nft),inputValidationInfoForeground:ze(Pft),inputValidationWarningBorder:ze(Wft),inputValidationWarningBackground:ze(Oft),inputValidationWarningForeground:ze(Bft),inputValidationErrorBorder:ze(oqe),inputValidationErrorBackground:ze(nqe),inputValidationErrorForeground:ze(sqe)},DEt={listFilterWidgetBackground:ze(fpt),listFilterWidgetOutline:ze(ppt),listFilterWidgetNoMatchesOutline:ze(mpt),listFilterWidgetShadow:ze(_pt),inputBoxStyles:EM,toggleStyles:JY},Uje={badgeBackground:ze(yT),badgeForeground:ze($re),badgeBorder:ze(wt)};ze(Cft),ze(yft),ze($Oe),ze($Oe),ze(Sft);const ON={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ze(npt),listFocusForeground:ze(spt),listFocusOutline:ze($pe),listActiveSelectionBackground:ze(vy),listActiveSelectionForeground:ze(G8),listActiveSelectionIconForeground:ze(aqe),listFocusAndSelectionOutline:ze(opt),listFocusAndSelectionBackground:ze(vy),listFocusAndSelectionForeground:ze(G8),listInactiveSelectionBackground:ze(Gpe),listInactiveSelectionIconForeground:ze(apt),listInactiveSelectionForeground:ze(rpt),listInactiveFocusBackground:ze(cpt),listInactiveFocusOutline:ze(lpt),listHoverBackground:ze(cqe),listHoverForeground:ze(lqe),listDropOverBackground:ze(dpt),listDropBetweenBackground:ze(hpt),listSelectionOutline:ze(Js),listHoverOutline:ze(Js),treeIndentGuidesStroke:ze(rY),treeInactiveIndentGuidesStroke:ze(bpt),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:ze(o6),tableColumnsBorder:ze(wpt),tableOddRowsBackgroundColor:ze(ypt)};function BN(s){return xEt(s,ON)}const Vje={selectBackground:ze(Qre),selectListBackground:ze(Hft),selectForeground:ze(NTe),decoratorRightForeground:ze(dqe),selectBorder:ze(PTe),focusBorder:ze(mp),listFocusBackground:ze(q8),listInactiveSelectionIconForeground:ze(FTe),listFocusForeground:ze(K8),listFocusOutline:Fpe(Js,me.transparent.toString()),listHoverBackground:ze(cqe),listHoverForeground:ze(lqe),listHoverOutline:ze(Js),selectListBorder:ze(r6),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},kEt={shadowColor:ze(CI),borderColor:ze(Cpt),foregroundColor:ze(Spt),backgroundColor:ze(Apt),selectionForegroundColor:ze(Ept),selectionBackgroundColor:ze(xpt),selectionBorderColor:ze(Dpt),separatorColor:ze(kpt),scrollbarShadow:ze(o6),scrollbarSliderBackground:ze(jKe),scrollbarSliderHoverBackground:ze(YKe),scrollbarSliderActiveBackground:ze(JKe)};function zje(s,e,t,i){let n,o,r;if(Array.isArray(s))r=s,n=e,o=t;else{const l=e;r=s.getActions(l),n=t,o=i}const a=pb.getInstance(),c=a.keyStatus.altKey||(Qn||pr)&&a.keyStatus.shiftKey;$je(r,n,c,o?l=>l===o:l=>l==="navigation")}function fC(s,e,t,i,n,o){let r,a,c,l,d;if(Array.isArray(s))d=s,r=e,a=t,c=i,l=n;else{const u=e;d=s.getActions(u),r=t,a=i,c=n,l=o}$je(d,r,!1,typeof a=="string"?u=>u===a:a,c,l)}function $je(s,e,t,i=r=>r==="navigation",n=()=>!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 s){let h;i(l)?(h=r,h.length>0&&o&&h.push(new Ar)):(h=a,h.length>0&&h.push(new Ar));for(let u of d){t&&(u=u instanceof Sc&&u.alt?u.alt:u);const f=h.push(u);u instanceof Nk&&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;n(d,l,u.length)&&u.splice(h,1,...f)}}let Lb=class extends Jy{constructor(e,t,i,n,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._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new wn),this._altKey=pb.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 n=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);n!==this._wantsAltCommand&&(this._wantsAltCommand=n,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(ue(e,"mouseleave",n=>{t=!1,i()})),this._register(ue(e,"mouseenter",n=>{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 n=t?g(4886,"{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(4886,"{0} ({1})",o,a):o;n=g(4887,`{0} -[{1}] {2}`,n,p6.modifierLabels[po].altKey,c)}return n}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 n=this._commandAction.checked&&vEt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(We.isThemeIcon(n)){const o=We.asClassNameArray(n);i.classList.add(...o),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=Jre(this._themeService.getColorTheme().type)?Zu(n.dark):Zu(n.light),i.classList.add("icon"),this._itemClassDispose.value=jr(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};Lb=D([_(2,Ut),_(3,bi),_(4,Le),_(5,pn),_(6,lr),_(7,mr)],Lb);class C6 extends Lb{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=C6._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=g(4888,"{1} to {0}",this._action.label,t):this.label.textContent=g(4889,"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let _3=class extends sA{constructor(e,t,i,n,o){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(We.isThemeIcon(e.item.icon)?We.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),Tt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!We.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=Jre(this._themeService.getColorTheme().type)?Zu(i.dark):Zu(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};_3=D([_(2,Ut),_(3,lr),_(4,pn)],_3);let d_e=class extends zf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,o,r,a,c){super(null,e),this._keybindingService=i,this._notificationService=n,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,Ie.WORKSPACE):void 0;d&&(l=e.actions.find(u=>d===u.id)),l||(l=e.actions[0]),this._defaultAction=this._instaService.createInstance(Lb,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 $_};this._dropdown=new sA(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof Sc&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,Ie.WORKSPACE,an.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Lb,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends $_{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(Ore(this._container,fe(".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=fe(".action-container");this._defaultAction.render(re(this._container,t)),this._register(ue(t,ke.KEY_DOWN,n=>{const o=new En(n);o.equals(S.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=fe(".dropdown-action-container");this._dropdown.render(re(this._container,i)),this._register(ue(i,ke.KEY_DOWN,n=>{const o=new En(n);o.equals(S.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()}};d_e=D([_(2,Ut),_(3,bi),_(4,lr),_(5,Oa),_(6,we),_(7,$i)],d_e);let h_e=class extends Bje{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Ar.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,Vje,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=ze(PTe)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};h_e=D([_(1,mf)],h_e);function WN(s,e,t){return e instanceof Sc?s.createInstance(Lb,e,t):e instanceof Ty?e.item.isSelection?s.createInstance(h_e,e):e.item.rememberDefaultAction?s.createInstance(d_e,e,{...t,persistLastActionId:!0}):s.createInstance(_3,e,t):void 0}var F_;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(F_||(F_={}));class hd extends V{constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new mo),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??F_.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[S.Enter,S.Space]},this._hoverDelegate=t.hoverDelegate??this._register($k()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new $_,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,n;switch(this._orientation){case F_.HORIZONTAL:i=[S.LeftArrow],n=[S.RightArrow];break;case F_.VERTICAL:i=[S.UpArrow],n=[S.DownArrow],this.domNode.className+=" vertical";break}this._register(ue(this.domNode,ke.KEY_DOWN,o=>{const r=new En(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():n&&(r.equals(n[0])||r.equals(n[1]))?a=this.focusNext():r.equals(S.Escape)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(S.Home)?a=this.focusFirst():r.equals(S.End)?a=this.focusLast():r.equals(S.Tab)&&c instanceof zf&&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(ue(this.domNode,ke.KEY_UP,o=>{const r=new En(o);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(S.Tab)||r.equals(U.Shift|S.Tab)||r.equals(S.UpArrow)||r.equals(S.DownArrow)||r.equals(S.LeftArrow)||r.equals(S.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Ac(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Bc()===this.domNode||!wc(Bc(),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 zf&&i.isEnabled());t instanceof zf&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof zf&&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(Yr(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,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,c)),a||(a=new Jy(this.context,o,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ue(r,ke.CONTEXT_MENU,l=>{en.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof zf&&this.viewItems.length===0&&a.setFocusable(!0),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[n]),this.viewItems.splice(n,0,a),n++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e=0&&e"u"){const n=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=n===-1?void 0:n,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===Ar.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===Ar.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 n=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(n){let o=!0;C2(n.focus)||(o=!1),this.options.focusOnlyEnabledItems&&C2(n.isEnabled)&&!n.isEnabled()&&(o=!1),n.action.id===Ar.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&n.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof zf){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=bt(this.viewItems),this.getContainer().remove(),super.dispose()}}function G2e(s){if(!s.length)return s;let e=-1;for(let i=0;i=0&&s[i].id===Ar.ID;i--)s.splice(i,1);let t=!1;for(let i=s.length-1;i>=0;i--){const n=s[i].id===Ar.ID;n&&!t?s.splice(i,1):n?n&&(t=!1):t=!0}return s}const u_e=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Ahe=/(&)?(&)([^\s&])/g;var XY;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(XY||(XY={}));var g_e;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(g_e||(g_e={}));let Gje=class Uq extends hd{constructor(e,t,i,n){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:F_.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[S.Enter,...Qt||pr?[S.Space]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(fd.addTarget(o)),this._register(ue(o,ke.KEY_DOWN,l=>{new En(l).equals(S.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(ue(o,ke.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){en.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Ehe&&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)}}})),pr&&this._register(ue(o,ke.KEY_DOWN,l=>{const d=new En(l);d.equals(S.Home)||d.equals(S.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),en.stop(l,!0)):(d.equals(S.End)||d.equals(S.PageDown))&&(this.focusedItem=0,this.focusPrevious(),en.stop(l,!0))})),this._register(ue(this.domNode,ke.MOUSE_OUT,l=>{const d=l.relatedTarget;wc(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ue(this.actionsList,ke.MOUSE_OVER,l=>{let d=l.target;if(!(!d||!wc(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(fd.addTarget(this.actionsList)),this._register(ue(this.actionsList,uo.Tap,l=>{let d=l.initialTarget;if(!(!d||!wc(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 EU(o,{alwaysConsumeMouseWheel:!0,horizontal:Co.Hidden,vertical:Co.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(ue(o,uo.Change,l=>{en.stop(l,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-l.translationY})})),this._register(ue(a,ke.MOUSE_UP,l=>{l.preventDefault()}));const c=ct(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 Ar&&(d===t.length-1||d===0||t[d-1]instanceof Ar))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof K2e)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(k8(e)?this.styleSheet=gl(e):(Uq.globalStyleSheet||(Uq.globalStyleSheet=gl()),this.styleSheet=Uq.globalStyleSheet)),this.styleSheet.textContent=TEt(t,k8(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=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=n,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 Ehe)super.focus(e),t.open(!0);else if(t instanceof f_e)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(ue(this.element,ke.MOUSE_UP,o=>{if(en.stop(o,!0),rf){if(new Eh(ct(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(ue(this.element,ke.CONTEXT_MENU,o=>{en.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=re(this.element,fe("a.action-menu-item")),this._action.id===Ar.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=re(this.item,fe("span.menu-item-check"+We.asCSSSelector(ve.menuSelection))),this.check.setAttribute("role","none"),this.label=re(this.item,fe("span.action-label")),this.options.label&&this.options.keybinding&&(re(this.item,fe("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){Ms(this.label);let e=dae(this.action.label);if(e){const t=IEt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=u_e.exec(e);if(i){e=fT(e),Ahe.lastIndex=0;let n=Ahe.exec(e);for(;n&&n[1];)n=Ahe.exec(e);const o=r=>r.replace(/&&/g,"&");n?this.label.append(pU(o(e.substr(0,n.index))," "),fe("u",{"aria-hidden":"true"},n[3]),zy(o(e.substr(n.index+n[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,n=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=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Ehe extends f_e{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Z),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:{horizontal:XY.Right,vertical:g_e.Below},this.showScheduler=new cn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new cn(()=>{this.element&&!wc(Bc(),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=re(this.item,fe("span.submenu-indicator"+We.asCSSSelector(ve.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ue(this.element,ke.KEY_UP,t=>{const i=new En(t);(i.equals(S.RightArrow)||i.equals(S.Enter))&&(en.stop(t,!0),this.createSubmenu(!0))})),this._register(ue(this.element,ke.KEY_DOWN,t=>{const i=new En(t);Bc()===this.item&&(i.equals(S.RightArrow)||i.equals(S.Enter))&&en.stop(t,!0)})),this._register(ue(this.element,ke.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ue(this.element,ke.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ue(this.element,ke.FOCUS_OUT,t=>{this.element&&!wc(Bc(),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){en.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,n){const o={top:0,left:0};return o.left=cF(e.width,t.width,{position:n.horizontal===XY.Right?Mf.Before:Mf.After,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new En(d).equals(S.LeftArrow)&&(en.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ue(this.submenuContainer,ke.KEY_DOWN,d=>{new En(d).equals(S.LeftArrow)&&en.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 K2e extends Jy{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function IEt(s){const e=u_e,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}function q2e(s){const e=fGe()[s.id];return`.codicon-${s.id}:before { content: '\\${e.toString(16)}'; }`}function TEt(s,e){let t=` +`)}}const $At={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:me.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:me.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:me.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},GAt={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function KAt(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]s-e;class QAt{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,n){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const r of this.renderers)r.disposeElement?.(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class jAt{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new Z}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&typeof n!="string"?n:td(n);i.disposables.add(ai(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,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class YAt{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,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}}class Xa{get onDidChangeFocus(){return M.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return M.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=M.chain(this.disposables.add(new ii(this.view.domNode,"keydown")).event,o=>o.map(r=>new En(r)).filter(r=>e=r.keyCode===S.ContextMenu||r.shiftKey&&r.keyCode===S.F10).map(r=>en.stop(r,!0)).filter(()=>!1)),i=M.chain(this.disposables.add(new ii(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new En(r)).filter(r=>r.keyCode===S.ContextMenu||r.shiftKey&&r.keyCode===S.F10).map(r=>en.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}})),n=M.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:c})=>({element:r,index:a,anchor:new Sh(ct(this.view.domNode),c),browserEvent:c})));return M.any(t,i,n)}get onKeyDown(){return this.disposables.add(new ii(this.view.domNode,"keydown")).event}get onKeyUp(){return this.disposables.add(new ii(this.view.domNode,"keyup")).event}get onKeyPress(){return this.disposables.add(new ii(this.view.domNode,"keypress")).event}get onDidFocus(){return M.signal(this.disposables.add(new ii(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return M.signal(this.disposables.add(new ii(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,o=GAt){this.user=e,this._options=o,this.focus=new u3("focused"),this.anchor=new u3("anchor"),this.eventBufferer=new R7,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 OAt(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new jAt(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(l=>new QAt(l.templateId,[...a,l]));const c={...o,dnd:o.dnd&&new YAt(this,o.dnd)};if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const l=ul(this.view.domNode);this.styleController=new xje(l,this.view.domId)}if(this.spliceable=new aAt([new mhe(this.focus,this.view,o.identityProvider),new mhe(this.selection,this.view,o.identityProvider),new mhe(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 VAt(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new Zme(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const l=o.keyboardNavigationDelegate||HAt;this.typeNavigationController=new UAt(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,n){return new gc(e,t,i,n)}createMouseController(e){return new Eje(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 MI(this.user,`Invalid start index: ${e}`);if(t<0)throw new MI(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 MI(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 MI(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return rm(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 MI(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);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 n=this.getFocus()[0];if(n!==i&&(n===void 0||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await Sr(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const o=i(),r=this.view.getScrollTop()+o;r===0?n=this.view.indexAt(r):n=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==n&&(a===void 0||a>=n)){const c=this.findNextIndex(n,!1,t);c>-1&&a!==c?this.setFocus([c],e):this.setFocus([n],e)}else{const c=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==c&&(this.setFocus([]),await Sr(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 n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=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 n=0;nthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new MI(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(lc(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Ka(t,0,1)+o-i)}else{const a=o+r,c=n+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 MI(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-n)/r)}isDOMFocused(){return sv(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()}}Xa.__decorator=D([Zt],Xa.prototype,"onDidChangeFocus",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidChangeSelection",null);Xa.__decorator=D([Zt],Xa.prototype,"onContextMenu",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyDown",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyUp",null);Xa.__decorator=D([Zt],Xa.prototype,"onKeyPress",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidFocus",null);Xa.__decorator=D([Zt],Xa.prototype,"onDidBlur",null);let Dje={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function kje(s){Dje=s}function wm(){return Dje}var JAt=".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}";ut(JAt,{});const D1=fe,Ije="selectOption.entry.template";class XAt{get templateId(){return Ije}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=re(e,D1(".option-text")),t.detail=re(e,D1(".option-detail")),t.decoratorRight=re(e,D1(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,r=e.detail,a=e.decoratorRight,c=e.isDisabled;n.text.textContent=o,n.detail.textContent=r||"",n.decoratorRight.innerText=a||"",c?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}const vw=class vw extends V{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=vw.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(wm().setupManagedHover(Pr("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return Ije}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=fe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=re(this.selectDropDownContainer,D1(".select-box-details-pane"));const t=re(this.selectDropDownContainer,D1(".select-box-dropdown-container-width-control")),i=re(t,D1(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",re(i,this.widthControlElement),this._dropDownPosition=Wf.BELOW,this.styleElement=ul(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ue(this.selectDropDownContainer,ke.DRAG_START,n=>{en.stop(n,!0)}))}registerListeners(){this._register(Ro(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(ue(this.selectElement,ke.CLICK,t=>{en.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.MOUSE_DOWN,t=>{en.stop(t)}));let e;this._register(ue(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ue(this.selectElement,"touchend",t=>{en.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ue(this.selectElement,ke.KEY_DOWN,t=>{const i=new En(t);let n=!1;Qt?(i.keyCode===S.DownArrow||i.keyCode===S.UpArrow||i.keyCode===S.Space||i.keyCode===S.Enter)&&(n=!0):(i.keyCode===S.DownArrow&&i.altKey||i.keyCode===S.UpArrow&&i.altKey||i.keyCode===S.Space||i.keyCode===S.Enter)&&(n=!0),n&&(this.showSelectDropDown(),en.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){is(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,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=xy(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 n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}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:()=>{this.selectDropDownContainer.remove()}}}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=ct(this.selectElement),i=Cr(this.selectElement),n=ct(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-vw.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=Wf.ABOVE,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=Wf.BELOW,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),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,n=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>n&&(i=r,n=l)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=Md(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=re(e,D1(".select-box-dropdown-list-container")),this.listRenderer=new XAt,this.selectList=this._register(new Xa("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:Co.Visible,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let o=n.text;return n.detail&&(o+=`. ${n.detail}`),n.decoratorRight&&(o+=`. ${n.decoratorRight}`),n.description&&(o+=`. ${n.description}`),o},getWidgetAriaLabel:()=>g(10917,"Select Box"),getRole:()=>Qt?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ii(this.selectDropDownListContainer,"keydown")),i=M.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(o=>new En(o)));this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Enter))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Tab))(this.onEnter,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Escape))(this.onEscape,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.UpArrow))(this.onUpArrow,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.DownArrow))(this.onDownArrow,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.PageDown))(this.onPageDown,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.PageUp))(this.onPageUp,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.Home))(this.onHome,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode===S.End))(this.onEnd,this)),this._register(M.chain(i,n=>n.filter(o=>o.keyCode>=S.Digit0&&o.keyCode<=S.KeyZ||o.keyCode>=S.Semicolon&&o.keyCode<=S.NumpadDivide))(this.onCharacter,this)),this._register(ue(this.selectList.getHTMLElement(),ke.POINTER_UP,n=>this.onPointerUp(n))),this._register(this.selectList.onMouseOver(n=>typeof n.index<"u"&&this.selectList.setFocus([n.index]))),this._register(this.selectList.onDidChangeFocus(n=>this.onListFocus(n))),this._register(ue(this.selectDropDownContainer,ke.FOCUS_OUT,n=>{!this._isVisible||wc(n.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;en.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n{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&&(en.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){en.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){en.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){en.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=Ia.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(ue(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ro(this.selectElement,"click",e=>{en.stop(e,!0)})),this._register(Ro(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ro(this.selectElement,"keydown",e=>{let t=!1;Qt?(e.keyCode===S.DownArrow||e.keyCode===S.UpArrow||e.keyCode===S.Space)&&(t=!0):(e.keyCode===S.DownArrow&&e.altKey||e.keyCode===S.Space||e.keyCode===S.Enter)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!is(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,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(n)}))}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 U_)),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(ud.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,nf&&this._register(ue(e,ke.DRAG_START,n=>n.dataTransfer?.setData(tp.TEXT,this._action.label)))),this._register(ue(t,uo.Tap,n=>this.onClick(n,!0))),this._register(ue(t,ke.MOUSE_DOWN,n=>{i||en.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),Qt&&this._register(ue(t,ke.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(ue(t,ke.CLICK,n=>{en.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(ue(t,ke.DBLCLICK,n=>{en.stop(n,!0)})),[ke.MOUSE_UP,ke.MOUSE_OUT].forEach(n=>{this._register(ue(t,n,o=>{en.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){en.stop(e,!0);const i=ra(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??Pr("element");this.customHover=this._store.add(wm().setupManagedHover(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 Qy extends Hf{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),Tt(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===Ar.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"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(5041,"{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.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Tje extends Hf{constructor(e,t,i,n,o,r,a){super(e,t),this.selectBox=new tEt(i,n,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 nEt=".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}";ut(nEt,{});class sEt extends U_{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=re(e,fe(".monaco-dropdown")),this._label=re(this._element,fe(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[ke.CLICK,ke.MOUSE_DOWN,uo.Tap])this._register(ue(this.element,o,r=>en.stop(r,!0)));for(const o of[ke.MOUSE_DOWN,uo.Tap])this._register(ue(this._label,o,r=>{Z1e(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(ue(this._label,ke.KEY_UP,o=>{const r=new En(o);(r.equals(S.Enter)||r.equals(S.Space))&&(en.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(ud.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(wm().setupManagedHover(Pr("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 oEt extends sEt{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:pb.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 nA extends Hf{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=re(o,fe("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(wm().setupManagedHover(this.options.hoverDelegate??Pr("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),n={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 oEt(e,n)),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 rEt='.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-action-bar .action-item.menu-entry.text-only .action-label{border-radius:2px;color:var(--vscode-descriptionForeground);overflow:hidden}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:", "}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.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}';ut(rEt,{});const Oa=ae("menuService");function MLe(s){return s&&typeof s=="object"&&typeof s.original=="string"&&typeof s.value=="string"}function aEt(s){return s?s.condition!==void 0:!1}const y5={exports:{}};(function(){function s(n){const o=[];typeof n=="number"&&o.push("code/timeOrigin",n);function r(c){o.push(c,Date.now())}function a(){const c=[];for(let l=0;lthis.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===Ev.Closed)return;let i=!1;ra(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===Ev.None&&(this.state=Ev.Initialized,this.options.hint!==iD.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return ra(i)?t:i}getBoolean(e,t){const i=this.get(e);return ra(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return ra(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return ra(i)?t:G2(i)}async set(e,t,i=!1){if(this.state===Ev.Closed)return;if(ra(t))return this.delete(e,i);const n=kn(t)||Array.isArray(t)?KQe(t):String(t);if(this.cache.get(e)!==n)return this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Ev.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!==Ev.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=Ev.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===Ev.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===iD.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===iD.STORAGE_IN_MEMORY}};ise.DEFAULT_FLUSH_DELAY=100;let sA=ise;class Fq{constructor(){this.onDidChangeItemsExternal=M.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 Jt=ae("fileService"),ks=ae("IUriIdentityService"),dEt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function hEt(s){return dEt.test(s)}const ar=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;nd.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&&n.set(r,c)}}catch(o){this.logService.error(o)}this._profilesObject={profiles:t,workspaces:i,emptyWindows:n}}return this._profilesObject}createDefaultProfile(){const e=rV("__default__profile__",g(567,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Th(t)}\\s(\\d+)`);let n=0;for(const r of this.profiles){const a=i.exec(r.name),c=a?parseInt(a[1]):0;n=c>n?c:n}const o=`${t} ${n+1}`;return this.createProfile(Wc(ar()).toString(16),o,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Wc(ar()).toString(16),e,t,i)}async createProfile(e,t,i,n){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const o=await this.doCreateProfile(e,t,i);return n&&await this.setProfileForWorkspace(n,o),o}async doCreateProfile(e,t,i){if(!Lt(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let n=this.profileCreationPromises.get(t);return n||(n=(async()=>{try{if(this.profiles.find(c=>c.name===t||c.id===e))throw new Error(`Profile with ${t} name already exists`);const r=rV(e,t,Pt(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 Zs.settled(a),this.updateProfiles([r],[],[]),r}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,n)),n}async updateProfile(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let i=this.profiles.find(n=>n.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);return i=rV(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(n=>n.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(n){i.push(n)}});try{await Promise.allSettled(i)}catch(n){this.logService.error(n)}for(const n of[...this.profilesObject.emptyWindows.keys()])t.id===this.profilesObject.emptyWindows.get(n)?.id&&this.profilesObject.emptyWindows.delete(n);for(const n of[...this.profilesObject.workspaces.keys()])t.id===this.profilesObject.workspaces.get(n)?.id&&this.profilesObject.workspaces.delete(n);this.updateStoredProfileAssociations(),this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(n){Uw(n)!==Qi.FILE_NOT_FOUND&&this.logService.error(n)}}async setProfileForWorkspace(e,t){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const i=this.profiles.find(n=>n.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.folders.clear(),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),i=N.isUri(t)?this.profilesObject.workspaces.get(t):this.profilesObject.emptyWindows.get(t);return i||(R_(e)?this.transientProfilesObject.folders.get(e.uri):tA(e)?this.transientProfilesObject.workspaces.get(e.configPath):this.transientProfilesObject.emptyWindows.get(e.id))}getWorkspace(e){return R_(e)?e.uri:tA(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!([...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))||[...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.transientProfilesObject.folders.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const n=[...this.profiles,...e],o=[],r=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];for(let a of n){if(a.isDefault||t.some(l=>a.id===l.id))continue;a=i.find(l=>a.id===l.id)??a;const c=r.find(l=>a.id===l.id);if(a.isTransient)this.transientProfilesObject.profiles.push(a);else{if(c){for(const[l,d]of this.transientProfilesObject.emptyWindows.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:l},a);break}for(const[l,d]of this.transientProfilesObject.workspaces.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:"",configPath:l},a);break}for(const[l,d]of this.transientProfilesObject.folders.entries())if(a.id===d.id){this.updateWorkspaceAssociation({id:"",uri:l},a);break}}o.push({location:a.location,name:a.name,shortName:a.shortName,icon:a.icon,useDefaultFlags:a.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){if(i=t?.isTransient?!0:i,i)R_(e)?(this.transientProfilesObject.folders.delete(e.uri),t&&this.transientProfilesObject.folders.set(e.uri,t)):tA(e)?(this.transientProfilesObject.workspaces.delete(e.configPath),t&&this.transientProfilesObject.workspaces.set(e.configPath,t)):(this.transientProfilesObject.emptyWindows.delete(e.id),t&&this.transientProfilesObject.emptyWindows.set(e.id,t));else{this.updateWorkspaceAssociation(e,void 0,!0);const n=this.getWorkspace(e);N.isUri(n)?(this.profilesObject.workspaces.delete(n),t&&this.profilesObject.workspaces.set(n,t)):(this.profilesObject.emptyWindows.delete(n),t&&this.profilesObject.emptyWindows.set(n,t)),this.updateStoredProfileAssociations()}}updateStoredProfileAssociations(){const e={};for(const[i,n]of this.profilesObject.workspaces.entries())e[i.toString()]=n.id;const t={};for(const[i,n]of this.profilesObject.emptyWindows.entries())t[i.toString()]=n.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=N.parse(r);t[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}const n={};if(e.emptyWindows)for(const[o,r]of Object.entries(e.emptyWindows)){const a=N.parse(r);n[o]=this.uriIdentityService.extUri.isEqual(a,i.location)?i.id:this.uriIdentityService.extUri.basename(a)}return{workspaces:t,emptyWindows:n}}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},rL.PROFILES_KEY="userDataProfiles",rL.PROFILE_ASSOCIATIONS_KEY="profileAssociations",rL);R2e=D([_(0,Za),_(1,Jt),_(2,ks),_(3,Ge)],R2e);const Oq="__$__isNewStorageMarker",Bq="__$__targetStorageMarker";var _y;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(_y||(_y={}));var Ie;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Ie||(Ie={}));var an;(function(s){s[s.USER=0]="USER",s[s.MACHINE=1]="MACHINE"})(an||(an={}));function uEt(s){const e=s.get(Bq);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const nse=class nse extends V{constructor(e={flushInterval:nse.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Sk),this._onDidChangeTarget=this._register(new Sk),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new I),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new cn(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new wn),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return M.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=T2(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){bt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{cs("code/willInitStorage");try{await this.doInitialize()}finally{cs("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===Bq){switch(e){case Ie.APPLICATION:this._applicationKeyTargets=void 0;break;case Ie.PROFILE:this._profileKeyTargets=void 0;break;case Ie.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:n})}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,n,o=!1){if(ra(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),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=[],n=this.getKeyTargets(e);for(const o of Object.keys(n))n[o]===t&&i.push(o);return i}updateKeyTarget(e,t,i,n=!1){const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(Bq,JSON.stringify(o),n)):typeof o[e]=="number"&&(delete o[e],this.getStorage(t)?.set(Bq,JSON.stringify(o),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(Ie.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(Ie.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(Ie.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case Ie.APPLICATION:return this.applicationKeyTargets;case Ie.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?uEt(t):Object.create(null)}isNew(e){return this.getBoolean(Oq,e)===!0}async flush(e=_y.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(Ie.APPLICATION),i=this.getStorage(Ie.PROFILE),n=this.getStorage(Ie.WORKSPACE);switch(e){case _y.NONE:await Zs.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case _y.SHUTDOWN:await Zs.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(Ie.APPLICATION)?.items??new Map,t=this.getStorage(Ie.PROFILE)?.items??new Map,i=this.getStorage(Ie.WORKSPACE)?.items??new Map;return fEt(e,t,i,this.getLogDetails(Ie.APPLICATION)??"",this.getLogDetails(Ie.PROFILE)??"",this.getLogDetails(Ie.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(_y.NONE),Lje(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||i_e(t)&&i_e(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const n=new Set;for(const[o,r]of e)n.add(o),t.get(o)!==r&&this.emitDidChangeValue(i,{key:o,external:!0});for(const[o]of t.items)n.has(o)||this.emitDidChangeValue(i,{key:o,external:!0})})}};nse.DEFAULT_FLUSH_INTERVAL=60*1e3;let Q2=nse;function i_e(s){return s.isDefault||!!s.useDefaultFlags?.globalState}class gEt extends Q2{constructor(){super(),this.applicationStorage=this._register(new sA(new Fq,{hint:iD.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new sA(new Fq,{hint:iD.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new sA(new Fq,{hint:iD.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.WORKSPACE,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.PROFILE,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(Ie.APPLICATION,e)))}getStorage(e){switch(e){case Ie.APPLICATION:return this.applicationStorage;case Ie.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case Ie.APPLICATION:return"inMemory (application)";case Ie.PROFILE:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}shouldFlushWhenIdle(){return!1}hasScope(e){return!1}}async function fEt(s,e,t,i,n,o){const r=m=>{try{return JSON.parse(m)}catch{return m}},a=new Map,c=new Map;s.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!==n?`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!==n){console.group(`Storage: Profile (path: ${n}, profile specific)`);const m=[];l.forEach((v,b)=>{m.push({key:b,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 $i=ae("storageService");function pEt(s,e){const t={...e};for(const i in s){const n=s[i];t[i]=n!==void 0?ze(n):void 0}return t}const n_e={keybindingLabelBackground:ze(Vft),keybindingLabelForeground:ze(zft),keybindingLabelBorder:ze($ft),keybindingLabelBottomBorder:ze(Gft),keybindingLabelShadow:ze(mI)},_6={buttonForeground:ze(pM),buttonSeparator:ze(XKe),buttonBackground:ze(fy),buttonHoverBackground:ze(U8),buttonSecondaryForeground:ze(Lft),buttonSecondaryBackground:ze(Ope),buttonSecondaryHoverBackground:ze(Rft),buttonBorder:ze(Tft)},Rje={progressBarBackground:ze(qgt)},jY={inputActiveOptionBorder:ze(Vre),inputActiveOptionForeground:ze(zre),inputActiveOptionBackground:ze(n6)};ze(J4),ze(Mft),ze(Nft),ze(Pft),ze(Fft),ze(Oft),ze(Bft);ze(Wft),ze(Uft),ze(Hft);ze(Ah),ze(EN),ze(mI),ze(wt),ze(gft),ze(fft),ze(pft),ze(_Te);const yM={inputBackground:ze(W2),inputForeground:ze(QKe),inputBorder:ze(i5),inputValidationInfoBorder:ze(Eft),inputValidationInfoBackground:ze(Sft),inputValidationInfoForeground:ze(Aft),inputValidationWarningBorder:ze(kft),inputValidationWarningBackground:ze(xft),inputValidationWarningForeground:ze(Dft),inputValidationErrorBorder:ze(JKe),inputValidationErrorBackground:ze(jKe),inputValidationErrorForeground:ze(YKe)},mEt={listFilterWidgetBackground:ze(npt),listFilterWidgetOutline:ze(spt),listFilterWidgetNoMatchesOutline:ze(opt),listFilterWidgetShadow:ze(rpt),inputBoxStyles:yM,toggleStyles:jY},Mje={badgeBackground:ze(_T),badgeForeground:ze(Hre),badgeBorder:ze(wt)};ze(hft),ze(dft),ze(ROe),ze(ROe),ze(uft);const MN={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ze(Kft),listFocusForeground:ze(qft),listFocusOutline:ze(Bpe),listActiveSelectionBackground:ze(py),listActiveSelectionForeground:ze(V8),listActiveSelectionIconForeground:ze(ZKe),listFocusAndSelectionOutline:ze(Qft),listFocusAndSelectionBackground:ze(py),listFocusAndSelectionForeground:ze(V8),listInactiveSelectionBackground:ze(Wpe),listInactiveSelectionIconForeground:ze(Yft),listInactiveSelectionForeground:ze(jft),listInactiveFocusBackground:ze(Jft),listInactiveFocusOutline:ze(Xft),listHoverBackground:ze(eqe),listHoverForeground:ze(tqe),listDropOverBackground:ze(Zft),listDropBetweenBackground:ze(ept),listSelectionOutline:ze(Js),listHoverOutline:ze(Js),treeIndentGuidesStroke:ze(sY),treeInactiveIndentGuidesStroke:ze(cpt),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:ze(t6),tableColumnsBorder:ze(lpt),tableOddRowsBackgroundColor:ze(dpt)};function NN(s){return pEt(s,MN)}const Nje={selectBackground:ze($re),selectListBackground:ze(Ift),selectForeground:ze(CTe),decoratorRightForeground:ze(iqe),selectBorder:ze(STe),focusBorder:ze(gp),listFocusBackground:ze($8),listInactiveSelectionIconForeground:ze(ATe),listFocusForeground:ze(z8),listFocusOutline:Tpe(Js,me.transparent.toString()),listHoverBackground:ze(eqe),listHoverForeground:ze(tqe),listHoverOutline:ze(Js),selectListBorder:ze(i6),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},_Et={shadowColor:ze(mI),borderColor:ze(hpt),foregroundColor:ze(upt),backgroundColor:ze(gpt),selectionForegroundColor:ze(fpt),selectionBackgroundColor:ze(ppt),selectionBorderColor:ze(mpt),separatorColor:ze(_pt),scrollbarShadow:ze(t6),scrollbarSliderBackground:ze(UKe),scrollbarSliderHoverBackground:ze(VKe),scrollbarSliderActiveBackground:ze(zKe)};function Pje(s,e,t,i){let n,o,r;if(Array.isArray(s))r=s,n=e,o=t;else{const l=e;r=s.getActions(l),n=t,o=i}const a=ub.getInstance(),c=a.keyStatus.altKey||(Qn||pr)&&a.keyStatus.shiftKey;Fje(r,n,c,o?l=>l===o:l=>l==="navigation")}function dC(s,e,t,i,n,o){let r,a,c,l,d;if(Array.isArray(s))d=s,r=e,a=t,c=i,l=n;else{const u=e;d=s.getActions(u),r=t,a=i,c=n,l=o}Fje(d,r,!1,typeof a=="string"?u=>u===a:a,c,l)}function Fje(s,e,t,i=r=>r==="navigation",n=()=>!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 s){let h;i(l)?(h=r,h.length>0&&o&&h.push(new Ar)):(h=a,h.length>0&&h.push(new Ar));for(let u of d){t&&(u=u instanceof Sc&&u.alt?u.alt:u);const f=h.push(u);u instanceof Ik&&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;n(d,l,u.length)&&u.splice(h,1,...f)}}let kb=class extends Qy{constructor(e,t,i,n,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._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=c,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new wn),this._altKey=ub.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 n=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);n!==this._wantsAltCommand&&(this._wantsAltCommand=n,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(ue(e,"mouseleave",n=>{t=!1,i()})),this._register(ue(e,"mouseenter",n=>{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 n=t?g(4886,"{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(4886,"{0} ({1})",o,a):o;n=g(4887,`{0} +[{1}] {2}`,n,h6.modifierLabels[po].altKey,c)}return n}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 n=this._commandAction.checked&&aEt(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(We.isThemeIcon(n)){const o=We.asClassNameArray(n);i.classList.add(...o),this._itemClassDispose.value=Ee(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=qre(this._themeService.getColorTheme().type)?Yu(n.dark):Yu(n.light),i.classList.add("icon"),this._itemClassDispose.value=jr(Ee(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};kb=D([_(2,Ut),_(3,bi),_(4,Le),_(5,pn),_(6,lr),_(7,mr)],kb);class v6 extends kb{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=v6._symbolPrintEnter(e);this._options?.conversational?this.label.textContent=g(4888,"{1} to {0}",this._action.label,t):this.label.textContent=g(4889,"{0} ({1})",this._action.label,t)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let f3=class extends nA{constructor(e,t,i,n,o){const r={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(We.isThemeIcon(e.item.icon)?We.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),Tt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!We.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=qre(this._themeService.getColorTheme().type)?Yu(i.dark):Yu(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};f3=D([_(2,Ut),_(3,lr),_(4,pn)],f3);let s_e=class extends Hf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,o,r,a,c){super(null,e),this._keybindingService=i,this._notificationService=n,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,Ie.WORKSPACE):void 0;d&&(l=e.actions.find(u=>d===u.id)),l||(l=e.actions[0]),this._defaultAction=this._instaService.createInstance(kb,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 U_};this._dropdown=new nA(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof Sc&&this.update(u.action)}))}update(e){this._options?.persistLastActionId&&this._storageService.store(this._storageKey,e.id,Ie.WORKSPACE,an.MACHINE),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(kb,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends U_{async runAction(t,i){await t.run(void 0)}},this._container&&this._defaultAction.render(Mre(this._container,fe(".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=fe(".action-container");this._defaultAction.render(re(this._container,t)),this._register(ue(t,ke.KEY_DOWN,n=>{const o=new En(n);o.equals(S.RightArrow)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=fe(".dropdown-action-container");this._dropdown.render(re(this._container,i)),this._register(ue(i,ke.KEY_DOWN,n=>{const o=new En(n);o.equals(S.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()}};s_e=D([_(2,Ut),_(3,bi),_(4,lr),_(5,Oa),_(6,we),_(7,$i)],s_e);let o_e=class extends Tje{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Ar.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,Nje,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=ze(STe)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};o_e=D([_(1,gf)],o_e);function PN(s,e,t){return e instanceof Sc?s.createInstance(kb,e,t):e instanceof Dy?e.item.isSelection?s.createInstance(o_e,e):e.item.rememberDefaultAction?s.createInstance(s_e,e,{...t,persistLastActionId:!0}):s.createInstance(f3,e,t):void 0}var M_;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(M_||(M_={}));class ld extends V{constructor(e,t={}){super(),this._actionRunnerDisposables=this._register(new Z),this.viewItemDisposables=this._register(new mo),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??M_.HORIZONTAL,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[S.Enter,S.Space]},this._hoverDelegate=t.hoverDelegate??this._register(Wk()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new U_,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,n;switch(this._orientation){case M_.HORIZONTAL:i=[S.LeftArrow],n=[S.RightArrow];break;case M_.VERTICAL:i=[S.UpArrow],n=[S.DownArrow],this.domNode.className+=" vertical";break}this._register(ue(this.domNode,ke.KEY_DOWN,o=>{const r=new En(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():n&&(r.equals(n[0])||r.equals(n[1]))?a=this.focusNext():r.equals(S.Escape)&&this.cancelHasListener?this._onDidCancel.fire():r.equals(S.Home)?a=this.focusFirst():r.equals(S.End)?a=this.focusLast():r.equals(S.Tab)&&c instanceof Hf&&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(ue(this.domNode,ke.KEY_UP,o=>{const r=new En(o);this.isTriggerKeyEvent(r)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(r)),r.preventDefault(),r.stopPropagation()):(r.equals(S.Tab)||r.equals(U.Shift|S.Tab)||r.equals(S.UpArrow)||r.equals(S.DownArrow)||r.equals(S.LeftArrow)||r.equals(S.RightArrow))&&this.updateFocusedItem()})),this.focusTracker=this._register(Ac(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Bc()===this.domNode||!wc(Bc(),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 Hf&&i.isEnabled());t instanceof Hf&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Hf&&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(Yr(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,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,c)),a||(a=new Qy(this.context,o,c)),this.options.allowContextMenu||this.viewItemDisposables.set(a,ue(r,ke.CONTEXT_MENU,l=>{en.stop(l,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Hf&&this.viewItems.length===0&&a.setFocusable(!0),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[n]),this.viewItems.splice(n,0,a),n++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e=0&&e"u"){const n=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=n===-1?void 0:n,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===Ar.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===Ar.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 n=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(n){let o=!0;v2(n.focus)||(o=!1),this.options.focusOnlyEnabledItems&&v2(n.isEnabled)&&!n.isEnabled()&&(o=!1),n.action.id===Ar.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&n.showHover?.()}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Hf){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=bt(this.viewItems),this.getContainer().remove(),super.dispose()}}function M2e(s){if(!s.length)return s;let e=-1;for(let i=0;i=0&&s[i].id===Ar.ID;i--)s.splice(i,1);let t=!1;for(let i=s.length-1;i>=0;i--){const n=s[i].id===Ar.ID;n&&!t?s.splice(i,1):n?n&&(t=!1):t=!0}return s}const r_e=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,_he=/(&)?(&)([^\s&])/g;var YY;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(YY||(YY={}));var a_e;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(a_e||(a_e={}));let Oje=class Wq extends ld{constructor(e,t,i,n){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:M_.VERTICAL,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[S.Enter,...Qt||pr?[S.Space]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(ud.addTarget(o)),this._register(ue(o,ke.KEY_DOWN,l=>{new En(l).equals(S.Tab)&&l.preventDefault()})),i.enableMnemonics&&this._register(ue(o,ke.KEY_DOWN,l=>{const d=l.key.toLocaleLowerCase();if(this.mnemonics.has(d)){en.stop(l,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof vhe&&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)}}})),pr&&this._register(ue(o,ke.KEY_DOWN,l=>{const d=new En(l);d.equals(S.Home)||d.equals(S.PageUp)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),en.stop(l,!0)):(d.equals(S.End)||d.equals(S.PageDown))&&(this.focusedItem=0,this.focusPrevious(),en.stop(l,!0))})),this._register(ue(this.domNode,ke.MOUSE_OUT,l=>{const d=l.relatedTarget;wc(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(ue(this.actionsList,ke.MOUSE_OVER,l=>{let d=l.target;if(!(!d||!wc(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(ud.addTarget(this.actionsList)),this._register(ue(this.actionsList,uo.Tap,l=>{let d=l.initialTarget;if(!(!d||!wc(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 wU(o,{alwaysConsumeMouseWheel:!0,horizontal:Co.Hidden,vertical:Co.Visible,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(ue(o,uo.Change,l=>{en.stop(l,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-l.translationY})})),this._register(ue(a,ke.MOUSE_UP,l=>{l.preventDefault()}));const c=ct(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 Ar&&(d===t.length-1||d===0||t[d-1]instanceof Ar))),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof N2e)).forEach((l,d,h)=>{l.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(E8(e)?this.styleSheet=ul(e):(Wq.globalStyleSheet||(Wq.globalStyleSheet=ul()),this.styleSheet=Wq.globalStyleSheet)),this.styleSheet.textContent=bEt(t,E8(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=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=n,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 vhe)super.focus(e),t.open(!0);else if(t instanceof c_e)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(ue(this.element,ke.MOUSE_UP,o=>{if(en.stop(o,!0),nf){if(new Sh(ct(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(ue(this.element,ke.CONTEXT_MENU,o=>{en.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=re(this.element,fe("a.action-menu-item")),this._action.id===Ar.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=re(this.item,fe("span.menu-item-check"+We.asCSSSelector(ve.menuSelection))),this.check.setAttribute("role","none"),this.label=re(this.item,fe("span.action-label")),this.options.label&&this.options.keybinding&&(re(this.item,fe("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){Ms(this.label);let e=rae(this.action.label);if(e){const t=vEt(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=r_e.exec(e);if(i){e=dT(e),_he.lastIndex=0;let n=_he.exec(e);for(;n&&n[1];)n=_he.exec(e);const o=r=>r.replace(/&&/g,"&");n?this.label.append(dU(o(e.substr(0,n.index))," "),fe("u",{"aria-hidden":"true"},n[3]),Hy(o(e.substr(n.index+n[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,n=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=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class vhe extends c_e{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Z),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:{horizontal:YY.Right,vertical:a_e.Below},this.showScheduler=new cn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new cn(()=>{this.element&&!wc(Bc(),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=re(this.item,fe("span.submenu-indicator"+We.asCSSSelector(ve.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ue(this.element,ke.KEY_UP,t=>{const i=new En(t);(i.equals(S.RightArrow)||i.equals(S.Enter))&&(en.stop(t,!0),this.createSubmenu(!0))})),this._register(ue(this.element,ke.KEY_DOWN,t=>{const i=new En(t);Bc()===this.item&&(i.equals(S.RightArrow)||i.equals(S.Enter))&&en.stop(t,!0)})),this._register(ue(this.element,ke.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ue(this.element,ke.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(ue(this.element,ke.FOCUS_OUT,t=>{this.element&&!wc(Bc(),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){en.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,n){const o={top:0,left:0};return o.left=sF(e.width,t.width,{position:n.horizontal===YY.Right?Tf.Before:Tf.After,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new En(d).equals(S.LeftArrow)&&(en.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ue(this.submenuContainer,ke.KEY_DOWN,d=>{new En(d).equals(S.LeftArrow)&&en.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 N2e extends Qy{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function vEt(s){const e=r_e,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}function P2e(s){const e=rGe()[s.id];return`.codicon-${s.id}:before { content: '\\${e.toString(16)}'; }`}function bEt(s,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${q2e(ve.menuSelection)} -${q2e(ve.menuSubmenu)} +${P2e(ve.menuSelection)} +${P2e(ve.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -636,88 +636,88 @@ ${q2e(ve.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } - `)}return t}class LEt{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,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=Bc();let i;const n=Yr(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(fe(".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=ue(this.block,ke.MOUSE_DOWN,d=>d.stopPropagation()));const a=new Z,c=e.actionRunner||new $_;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new Gje(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},kEt),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=ct(o);return a.add(ue(l,ke.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(ue(l,ke.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Eh(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===o)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),jr(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&&(Bc()===this.lastContainer||wc(Bc(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Fr(e.error)&&this.notificationService.error(e.error)}}let p_e=class extends V{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new LEt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,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=m_e.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),pb.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};p_e=D([_(0,Yi),_(1,bi),_(2,mf),_(3,Ut),_(4,Oa),_(5,Le)],p_e);var m_e;(function(s){function e(i){return i&&i.menuId instanceof _e}function t(i,n,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(r){const d=n.getMenuActions(r,c??o,a);zje(d,l)}return i.getActions?Ar.join(i.getActions(),l):l}}}s.transform=t})(m_e||(m_e={}));function Q2e(s){const e=s;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var Gk;(function(s){s[s.ACTIVATE=1]="ACTIVATE",s[s.RESTORE=2]="RESTORE",s[s.PRESERVE=3]="PRESERVE"})(Gk||(Gk={}));var __e;(function(s){s[s.PICK=0]="PICK",s[s.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(__e||(__e={}));var v3;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(v3||(v3={}));var rA;(function(s){s[s.Center=0]="Center",s[s.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",s[s.NearTop=2]="NearTop",s[s.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(rA||(rA={}));var Db;(function(s){s.PROGRAMMATIC="api",s.NAVIGATION="code.navigation",s.JUMP="code.jump"})(Db||(Db={}));function KLe(s){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(s.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},s=s.with({fragment:""})),{selection:e,uri:s}}let v_e=class{constructor(e){this._commandService=e}async open(e,t){if(!AA(e,pe.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=N.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=j2(decodeURIComponent(e.query))}catch{try{i=j2(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};v_e=D([_(0,vi)],v_e);let b_e=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=N.parse(e));const{selection:i,uri:n}=KLe(e);return e=n,e.scheme===pe.file&&(e=xGe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?v3.USER:v3.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};b_e=D([_(0,Kt)],b_e);let w_e=class{constructor(e,t){this._openers=new hl,this._validators=new hl,this._resolvers=new hl,this._resolvedUriTargets=new ui(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new hl,this._defaultExternalOpener={openExternal:async i=>(A8(i,pe.http,pe.https)?YGe(i):si.location.href=i,!0)},this._openers.push({open:async(i,n)=>n?.openExternal||A8(i,pe.mailto,pe.http,pe.https,pe.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new v_e(t)),this._openers.push(new b_e(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"?N.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(n,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 n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?N.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.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},He.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},He.None)}dispose(){this._validators.clear()}};w_e=D([_(0,Kt),_(1,vi)],w_e);const Ml=ae("editorWorkerService");var u_;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(u_||(u_={}));var Ws;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Ws||(Ws={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=g(4412,"Error"),t[s.Warning]=g(4413,"Warning"),t[s.Info]=g(4414,"Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case Xe.Error:return s.Error;case Xe.Warning:return s.Warning;case Xe.Info:return s.Info;case Xe.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return Xe.Error;case s.Warning:return Xe.Warning;case s.Info:return Xe.Info;case s.Hint:return Xe.Ignore}}s.toSeverity=o})(Ws||(Ws={}));var ZY;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){const r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(Ws.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(ZY||(ZY={}));const Am=ae("markerService");let y_e=class extends V{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new I),this.onDidChangeMarker=this._onDidChangeMarker.event,this._markerDecorations=new ui,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 REt(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===pe.inMemory||e.uri.scheme===pe.internal||e.uri.scheme===pe.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)}};y_e=D([_(0,gi),_(1,Am)],y_e);class REt extends V{constructor(e){super(),this.model=e,this._map=new Prt,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Sre(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=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(n,o);for(const a of i)this._map.delete(a);for(let a=0;a{const n=this.model.getDecorationRange(t);n&&e.push([n,i])}),e}_createDecorationRange(e,t){let i=F.lift(t);if(t.severity===Ws.Hint&&!this._hasMarkerTag(t,u_.Unnecessary)&&!this._hasMarkerTag(t,u_.Deprecated)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const n=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(n===1||i.endColumn>=n)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new F(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0:!1}}var o0;function gE(s){return s.toString()}class MEt{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(n=>i(e,n)))}dispose(){this._modelEventListeners.dispose()}}const NEt=pr||Qt?Sb.LF:Sb.CRLF;class PEt{constructor(e,t,i,n,o,r,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=c}}var hL;let C_e=(hL=class extends V{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,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=Vd.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 n="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const u=parseInt(e.editor.indentSize,10);isNaN(u)||(n=Math.max(u,1))}let o=Vd.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=NEt;const a=e.eol;a===`\r -`?r=Sb.CRLF:a===` -`&&(r=Sb.LF);let c=Vd.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let l=Vd.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(l=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Vd.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Vd.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:n,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:po===Ds.Linux||po===Ds.Macintosh?` + `)}return t}class wEt{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,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=Bc();let i;const n=Yr(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(fe(".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=ue(this.block,ke.MOUSE_DOWN,d=>d.stopPropagation()));const a=new Z,c=e.actionRunner||new U_;c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,a),c.onDidRun(this.onDidActionRun,this,a),i=new Oje(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},_Et),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const l=ct(o);return a.add(ue(l,ke.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(ue(l,ke.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const h=new Sh(l,d);let u=h.target;if(!h.rightButton){for(;u;){if(u===o)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),jr(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&&(Bc()===this.lastContainer||wc(Bc(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Fr(e.error)&&this.notificationService.error(e.error)}}let l_e=class extends V{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new wEt(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,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=d_e.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),ub.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};l_e=D([_(0,Yi),_(1,bi),_(2,gf),_(3,Ut),_(4,Oa),_(5,Le)],l_e);var d_e;(function(s){function e(i){return i&&i.menuId instanceof _e}function t(i,n,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:c}=i;return{...i,getActions:()=>{const l=[];if(r){const d=n.getMenuActions(r,c??o,a);Pje(d,l)}return i.getActions?Ar.join(i.getActions(),l):l}}}s.transform=t})(d_e||(d_e={}));function F2e(s){const e=s;return typeof e?.resolve=="function"&&typeof e?.isResolved=="function"}var Hk;(function(s){s[s.ACTIVATE=1]="ACTIVATE",s[s.RESTORE=2]="RESTORE",s[s.PRESERVE=3]="PRESERVE"})(Hk||(Hk={}));var h_e;(function(s){s[s.PICK=0]="PICK",s[s.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(h_e||(h_e={}));var p3;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(p3||(p3={}));var oA;(function(s){s[s.Center=0]="Center",s[s.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",s[s.NearTop=2]="NearTop",s[s.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(oA||(oA={}));var Ab;(function(s){s.PROGRAMMATIC="api",s.NAVIGATION="code.navigation",s.JUMP="code.jump"})(Ab||(Ab={}));function NLe(s){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(s.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},s=s.with({fragment:""})),{selection:e,uri:s}}let u_e=class{constructor(e){this._commandService=e}async open(e,t){if(!CA(e,pe.command))return!1;if(!t?.allowCommands||(typeof e=="string"&&(e=N.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=G2(decodeURIComponent(e.query))}catch{try{i=G2(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};u_e=D([_(0,vi)],u_e);let g_e=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=N.parse(e));const{selection:i,uri:n}=NLe(e);return e=n,e.scheme===pe.file&&(e=vGe(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?p3.USER:p3.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};g_e=D([_(0,Kt)],g_e);let f_e=class{constructor(e,t){this._openers=new dl,this._validators=new dl,this._resolvers=new dl,this._resolvedUriTargets=new ui(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new dl,this._defaultExternalOpener={openExternal:async i=>(y8(i,pe.http,pe.https)?VGe(i):si.location.href=i,!0)},this._openers.push({open:async(i,n)=>n?.openExternal||y8(i,pe.mailto,pe.http,pe.https,pe.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new u_e(t)),this._openers.push(new g_e(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"?N.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(n,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 n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?N.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.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},He.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},He.None)}dispose(){this._validators.clear()}};f_e=D([_(0,Kt),_(1,vi)],f_e);const Rl=ae("editorWorkerService");var l_;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(l_||(l_={}));var Ws;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Ws||(Ws={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=g(4412,"Error"),t[s.Warning]=g(4413,"Warning"),t[s.Info]=g(4414,"Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case Xe.Error:return s.Error;case Xe.Warning:return s.Warning;case Xe.Info:return s.Info;case Xe.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return Xe.Error;case s.Warning:return Xe.Warning;case s.Info:return Xe.Info;case s.Hint:return Xe.Ignore}}s.toSeverity=o})(Ws||(Ws={}));var JY;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){const r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(Ws.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(JY||(JY={}));const ym=ae("markerService");let p_e=class extends V{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new I),this.onDidChangeMarker=this._onDidChangeMarker.event,this._markerDecorations=new ui,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 yEt(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===pe.inMemory||e.uri.scheme===pe.internal||e.uri.scheme===pe.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)}};p_e=D([_(0,gi),_(1,ym)],p_e);class yEt extends V{constructor(e){super(),this.model=e,this._map=new Art,this._register(Ee(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=bre(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=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(n,o);for(const a of i)this._map.delete(a);for(let a=0;a{const n=this.model.getDecorationRange(t);n&&e.push([n,i])}),e}_createDecorationRange(e,t){let i=F.lift(t);if(t.severity===Ws.Hint&&!this._hasMarkerTag(t,l_.Unnecessary)&&!this._hasMarkerTag(t,l_.Deprecated)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const n=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(n===1||i.endColumn>=n)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new F(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0:!1}}var i0;function dE(s){return s.toString()}class CEt{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(n=>i(e,n)))}dispose(){this._modelEventListeners.dispose()}}const SEt=pr||Qt?wb.LF:wb.CRLF;class AEt{constructor(e,t,i,n,o,r,a,c){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=c}}var aL;let m_e=(aL=class extends V{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,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=Hd.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 n="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const u=parseInt(e.editor.indentSize,10);isNaN(u)||(n=Math.max(u,1))}let o=Hd.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=SEt;const a=e.eol;a===`\r +`?r=wb.CRLF:a===` +`&&(r=wb.LF);let c=Hd.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let l=Hd.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(l=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Hd.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Hd.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:n,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:po===Ds.Linux||po===Ds.Macintosh?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);o=o0._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;ne){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.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,n){const o=this.getCreationOptions(t,i,n),r=new C_(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(gE(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)qC(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)qC(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>qC(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=gE(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const c=new MEt(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:n,disposable:o}=Cme(t,i.defaultEOL);if(e.equalsTextBuffer(n)){o.dispose();return}e.pushStackElement(),e.pushEOL(n.getEOL()===`\r -`?Sh.CRLF:Sh.LF),e.pushEditOperations([],o0._computeEdits(e,n),()=>[]),e.pushStackElement(),o.dispose()}static _commonPrefix(e,t,i,n,o,r){const a=Math.min(t,o);let c=0;for(let l=0;l0?(a=new F(o+1,1,i-r+1,1),c=new F(o+1,1,n-r+1,1)):o>0?(a=new F(o,e.getLineMaxColumn(o),i,e.getLineMaxColumn(i)),c=new F(o,1+t.getLineLength(o),n,1+t.getLineLength(n))):(a=new F(1,1,i,e.getLineMaxColumn(i)),c=new F(1,1,n,1+t.getLineLength(n))),[Zn.replaceMove(a,t.getValueInRange(c,go.TextDefined))]}createModel(e,t,i,n=!1){let o;return t?o=this._createModelData(e,t,i,n):o=this._createModelData(e,Ca,i,n),this._onModelAdded.fire(o.model),o.model}destroyModel(e){const t=this._models[gE(e)];t&&t.model.dispose()}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||l.future.length>0){for(const d of l.past)qC(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)qC(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=o0.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(o)if(!n&&(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=>qC(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new PEt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,c.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){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,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);o0._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new Z2}},o0=hL,hL.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,hL);C_e=o0=D([_(0,Te),_(1,CTe),_(2,JA),_(3,xi),_(4,Vs)],C_e);const cse=class cse{canComputeSHA1(e){return e.getValueLength()<=cse.MAX_MODEL_SIZE}computeSHA1(e){const t=new fpe,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}};cse.MAX_MODEL_SIZE=10*1024*1024;let Z2=cse;var FEt=".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}";ut(FEt,{});var eJ;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(eJ||(eJ={}));const RU={Quickaccess:"workbench.contributions.quickaccess"};class OEt{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 Fi([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}}}Qe.add(RU.Quickaccess,new OEt);const BEt={ctrlCmd:!1,alt:!1};var eW;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(eW||(eW={}));var tW;(function(s){s.QuickPick="quickPick",s.InputBox="inputBox",s.QuickWidget="quickWidget"})(tW||(tW={}));var Hf;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(Hf||(Hf={}));var wo;(function(s){s[s.First=1]="First",s[s.Second=2]="Second",s[s.Last=3]="Last",s[s.Next=4]="Next",s[s.Previous=5]="Previous",s[s.NextPage=6]="NextPage",s[s.PreviousPage=7]="PreviousPage",s[s.NextSeparator=8]="NextSeparator",s[s.PreviousSeparator=9]="PreviousSeparator"})(wo||(wo={}));var tJ;(function(s){s[s.Title=1]="Title",s[s.Inline=2]="Inline"})(tJ||(tJ={}));class WEt{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===pe.file?e.resource.fsPath:e.resource?.path}}const j2e=new WEt,In=ae("quickInputService");let S_e=class extends V{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Qe.as(RU.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[n,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=n?.defaultFilterValue;m===eJ.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??Hf.SECOND),h.contextKey=o?.contextKey,h.filterValue=p=>p.substring(o?o.prefix.length:0);let u;t&&(u=new dc,d.add(M.once(h.onWillAccept)(p=>{p.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,n,o,e,i));const f=d.add(new ci);if(n&&d.add(n.provide(h,f.token,i?.providerOptions)),M.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 n;i?.preserveValue?n=[e.value.length,e.value.length]:n=[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,o){const r=new Z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};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 n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};S_e=D([_(0,In),_(1,we)],S_e);var HEt=".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;border-radius:2px;display:flex;padding-right:2px}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.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}";ut(HEt,{});const Kje={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class ZA extends pd{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(...We.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(Sm().setupManagedHover(e.hoverDelegate??Pr("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===S.Space||i.keyCode===S.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(...We.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...We.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 lse=class lse extends pd{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 ZA({title:this.title,isChecked:this.isChecked,icon:ve.check,actionClassName:lse.CLASS_NAME,...Kje})),this.domNode=this.checkbox.domNode,this.styles=i,this.applyStyles(),this._register(this.checkbox.onChange(n=>{this.applyStyles(),this._onChange.fire(n)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}focus(){this.domNode.focus()}hasFocus(){return av(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||""}};lse.CLASS_NAME="monaco-checkbox";let Y2e=lse;var UEt='.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-top-left-radius:5px;border-top-right-radius:5px;display:flex}.quick-input-left-action-bar{display:flex;flex:1;margin-left:4px}.quick-input-inline-action-bar{margin:2px 0 0 5px}.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;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: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}';ut(UEt,{});class A_e{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}A_e.__decorator=D([Zt],A_e.prototype,"toString",null);const VEt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function qje(s){const e=[];let t=0,i;for(;i=VEt.exec(s);){i.index-t>0&&e.push(s.substring(t,i.index));const[,n,o,,r]=i;r?e.push({label:n,href:o,title:r}):e.push({label:n,href:o}),t=i.index+i[0].length}return t{Odt(f)&&en.stop(f,!0),t.callback(o.href)},l=t.disposables.add(new ii(a,ke.CLICK)).event,d=t.disposables.add(new ii(a,ke.KEY_DOWN)).event,h=M.chain(d,f=>f.filter(p=>{const m=new En(p);return m.equals(S.Space)||m.equals(S.Enter)}));t.disposables.add(fd.addTarget(a));const u=t.disposables.add(new ii(a,uo.Tap)).event;M.any(l,u,h)(c,null,t.disposables),e.appendChild(a)}}let xM=class extends V{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,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 n=Yr(e.target)?[e.target]:e.target.targetElements;for(const r of n)this.hoverDisposables.add(Ro(r,"keydown",a=>{a.equals(S.Escape)&&this.hoverService.hideHover()}));const o=Yr(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.lastHoverHideTimet===iJ),this._rightButtons=e.filter(t=>t!==iJ&&t.location!==tJ.Inline),this._inlineButtons=e.filter(t=>t.location===tJ.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{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=eW.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=eW.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?aa(this.ui.widget,this._widget):aa(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Cm,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 n=this._leftButtons.map((a,c)=>E5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.leftActionBar.push(n,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this._rightButtons.map((a,c)=>E5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.rightActionBar.push(o,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const r=this._inlineButtons.map((a,c)=>E5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.inlineActionBar.push(r,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const n=this.toggles?.filter(o=>o instanceof ZA)??[];this.ui.inputBox.toggles=n}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,aa(this.ui.message),GEt(i,this.ui.message,{callback:n=>{this.ui.linkOpenerDelegate(n)},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(5276,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Xe.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()}};dse.noPromptMessage=g(5275,"Press 'Enter' to confirm your input or 'Escape' to cancel");let iW=dse;const hse=class hse extends iW{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=Hf.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 F7,this.type=tW.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?BEt: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&&is(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&&is(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(hTe(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&is(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 ue(this.ui.container,ke.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new En(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===S.Shift?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===S.Alt||a[0].ctrlKey&&i===S.Ctrl||a[0].metaKey&&i===S.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.titleButtons.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 n=this.ariaLabel;!n&&i.inputBox&&(n=this.placeholder||hse.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??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._itemActivation){case Hf.NONE:this._itemActivation=Hf.FIRST;break;case Hf.SECOND:this.ui.list.focus(wo.Second),this._itemActivation=Hf.FIRST;break;case Hf.LAST:this.ui.list.focus(wo.Last),this._itemActivation=Hf.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))}};hse.DEFAULT_ARIA_LABEL=g(5277,"Type to narrow down results.");let uF=hse,JEt=class extends iW{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=tW.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(5278,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):iW.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.titleButtons.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 XEt extends iW{constructor(){super(...arguments),this.type=tW.QuickWidget}update(){if(!this.visible)return;const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step};this.ui.setVisibilities(e),super.update()}}let E_e=class extends xM{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Yr(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};E_e=D([_(0,Te),_(1,ec)],E_e);var ZEt=".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)}";ut(ZEt,{});me.white.toString(),me.white.toString();class Jd extends V{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,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",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(fd.addTarget(this._element)),[ke.CLICK,uo.Tap].forEach(o=>{this._register(ue(this._element,o,r=>{if(!this.enabled){en.stop(r);return}this._onDidClick.fire(r)}))}),this._register(ue(this._element,ke.KEY_DOWN,o=>{const r=new En(o);let a=!1;this.enabled&&(r.equals(S.Enter)||r.equals(S.Space))?(this._onDidClick.fire(o),a=!0):r.equals(S.Escape)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&en.stop(r,!0)})),this._register(ue(this._element,ke.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ue(this._element,ke.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ac(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 Eb(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}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||dd(this._label)&&dd(e)&&_Ct(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(dd(e)){const n=f6(e,{inline:!0});n.dispose();const o=n.element.querySelector("p")?.innerHTML;if(o){const r=OGe(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=r}else aa(t)}else this.options.supportIcons?aa(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=tje(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?aa(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...We.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(Sm().setupManagedHover(this.options.hoverDelegate??Pr("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return av(this._element)}}class ext extends V{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 Jd(this.element,t)),this._register(this.button.onDidClick(o=>this._onDidClick.fire(o))),this.action=this._register(new rn("primaryAction",tje(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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground;this.separatorContainer.style.backgroundColor=n??"",this.separator.style.backgroundColor=t.buttonSeparator??"",this.dropdownButton=this._register(new Jd(this.element,{...t,title:!1,supportIcons:!0})),this._register(Sm().setupManagedHover(Pr("mouse"),this.dropdownButton.element,g(8811,"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=ve.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 txt{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new Jd(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?aa(this._descriptionElement,...Eb(e)):this._descriptionElement.textContent=e}}class ixt{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 Jd(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new txt(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new ext(this.container,e));return this.pushButton(t),t}pushButton(e){this._buttons.push(e);const t=this._buttons.length-1;this._buttonStore.add(ue(e.element,ke.KEY_DOWN,i=>{const n=new En(i);let o=!0,r;n.equals(S.LeftArrow)?r=t>0?t-1:this._buttons.length-1:n.equals(S.RightArrow)?r=t===this._buttons.length-1?0:t+1:o=!1,o&&typeof r=="number"&&(this._buttons[r].focus(),en.stop(i,!0))}))}}var nxt=".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}";ut(nxt,{});class x_e{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=re(e,fe(".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=$p(this.countFormat,this.count),this.element.title=$p(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 sxt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let oxt=sxt;function rxt(s,e){return oxt()}var axt=".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)}}";ut(axt,{});const Dhe="done",khe="active",nK="infinite",sK="infinite-long-running",Ihe="discrete",Wz=class Wz extends V{constructor(e,t){super(),this.progressSignal=this._register(new wn),this.workedVal=0,this.showDelayedScheduler=this._register(new cn(()=>Yh(this.element),0)),this.longRunningScheduler=this._register(new cn(()=>this.infiniteLongRunning(),Wz.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(khe,nK,sK,Ihe),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(Dhe),this.element.classList.contains(nK)?(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(Ihe,Dhe,sK),this.element.classList.add(khe,nK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(sK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return lc(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(nK,sK,Dhe),this.element.classList.add(khe,Ihe),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=rxt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):Yh(this.element)}hide(){zd(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};Wz.LONG_RUNNING_INFINITE_THRESHOLD=1e4,Wz.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let nJ=Wz;const cxt=g(9871,"Match Case"),lxt=g(9872,"Match Whole Word"),dxt=g(9873,"Use Regular Expression");class Jje extends ZA{constructor(e){super({icon:ve.caseSensitive,title:cxt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Xje extends ZA{constructor(e){super({icon:ve.wholeWord,title:lxt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Zje extends ZA{constructor(e){super({icon:ve.regex,title:dxt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class hxt{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}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 uxt{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 hxt(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}}class J2e{get size(){return this._size}constructor(e,t=10,i=n=>n){if(this.capacity=t,this.identityFn=i,e.length<1)throw new Error("not supported");this._size=1,this.head=this.tail=this.cursor={value:e[0],previous:void 0,next:void 0},this.valueSet=new Lrt([e[0]],i);for(let n=1;nthis.capacity;)this.valueSet.delete(this.head.value),this.head=this.head.next,this.head.previous=void 0,this._size--}replaceLast(e){if(this.identityFn(this.tail.value)===this.identityFn(e))return e;const t=this.tail.value;return this.valueSet.delete(t),this.tail.value=e,this.valueSet.has(e)?this._deleteFromList(e):this.valueSet.add(e),t}prepend(e){if(this._size===this.capacity||this.valueSet.has(e))return;const t={value:e,previous:void 0,next:this.head};this.head.previous=t,this.head=t,this._size++,this.valueSet.add(e)}isAtEnd(){return this.cursor===this.tail}current(){return this.cursor.value}previous(){return this.cursor.previous&&(this.cursor=this.cursor.previous),this.cursor.value}next(){return this.cursor.next&&(this.cursor=this.cursor.next),this.cursor.value}has(e){return this.valueSet.has(e)}resetCursor(){return this.cursor=this.tail,this.cursor.value}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}_deleteFromList(e){let t=this.head;const i=this.identityFn(e);for(;t!==this.tail;)this.identityFn(t.value)===i&&(t===this.head?(this.head=this.head.next,this.head.previous=void 0):(t.previous.next=t.next,t.next.previous=t.previous),this._size--),t=t.next}}var gxt=".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}";ut(gxt,{});const m4=fe;var Xl;(function(s){s[s.INFO=1]="INFO",s[s.WARNING=2]="WARNING",s[s.ERROR=3]="ERROR"})(Xl||(Xl={}));const fxt={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 eYe extends pd{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=re(e,m4(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",o=re(this.element,m4(".ibwrapper"));if(this.input=re(o,m4(n+".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=re(o,m4("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Cqe(this.element,{vertical:Co.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),re(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const r=this._register(new ii(e.ownerDocument,"selectionchange")),a=M.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 hd(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(Sm().setupManagedHover(Pr("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:fb(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return av(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 Pd(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,n=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+n}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"&&Ys(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 ${Iy(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 Xl.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case Xl.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 Xl.INFO:return"info";case Xl.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Pd(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:vb.RIGHT,render:n=>{if(!this.message)return null;e=re(n,m4(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?ALe(this.message.content,o):Gyt(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}`:"",re(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===Xl.ERROR?i=g(9834,"Error: {0}",this.message.content):this.message.type===Xl.WARNING?i=g(9835,"Warning: {0}",this.message.content):i=g(9836,"Info: {0}",this.message.content),Mr(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??"",n=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 ${Iy(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=fb(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,n=t.selectionEnd,o=t.value;i!==null&&n!==null&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class qLe extends eYe{constructor(e,t,i){const n=g(9837," or {0} for history","⇅"),o=g(9838," ({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 uxt(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:o,c=this.placeholder+a;i.showPlaceholderOnFocus&&!av(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(n)})}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??"",Ah(this.value?this.value:g(9839,"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,Ah(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 pxt=".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}}";ut(pxt,{});const mxt=g(9833,"input"),iFe=class iFe extends pd{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new wn),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||mxt,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=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 qLe(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($k());if(this.showCommonFindToggles){this.regex=this._register(new Zje({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 Xje({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 Jje({appendTitle:n,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(S.LeftArrow)||f.equals(S.RightArrow)||f.equals(S.Escape)){const p=u.indexOf(this.domNode.ownerDocument.activeElement);if(p>=0){let m=-1;f.equals(S.RightArrow)?m=(p+1)%u.length:f.equals(S.LeftArrow)&&(p===0?m=u.length-1:m=p-1),f.equals(S.Escape)?(u[p].blur(),this.inputBox.focus()):m>=0&&u[m].focus(),en.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(ue(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(ue(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()}};iFe.OPTION_CHANGE="optionChange";let b3=iFe;const _xt=fe;class vxt extends V{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Ro(this.findInput.inputBox.inputElement,ke.KEY_DOWN,o),this.onMouseDown=o=>Ro(this.findInput.inputBox.inputElement,ke.MOUSE_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=re(this.parent,_xt(".quick-input-box")),this.findInput=this._register(new b3(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.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===Xe.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Xe.Info?Xl.INFO:e===Xe.Warning?Xl.WARNING:Xl.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Xe.Info?Xl.INFO:e===Xe.Warning?Xl.WARNING:Xl.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class bxt{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:V.None}}renderElement(e,t,i,n){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,n);const r=new ci,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,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class wxt{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 yxt(s,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new wxt(s,e.accessibilityProvider)}}class Cxt{constructor(e,t,i,n,o={}){const r=()=>this.model,a=n.map(c=>new bxt(c,r));this.list=new Xa(e,t,i,a,yxt(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return av(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 M.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 M.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 M.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 M.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 M.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return M.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get onContextMenu(){return M.map(this.list.onContextMenu,({element:e,index:t,anchor:i,browserEvent:n})=>typeof e>"u"?{element:e,index:t,anchor:i,browserEvent:n}:{element:this._model.get(e),index:t,anchor:i,browserEvent:n})}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Au(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 Sxt=':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}';ut(Sxt,{});const Axt=!1;var sJ;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(sJ||(sJ={}));var fi;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(fi||(fi={}));var oa;(function(s){s[s.Disabled=0]="Disabled",s[s.AtMinimum=1]="AtMinimum",s[s.AtMaximum=2]="AtMaximum",s[s.Enabled=3]="Enabled"})(oa||(oa={}));let Ext=4;const xxt=new I;let Dxt=300;const kxt=new I;class w3{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new ii(ct(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ii(ct(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}w3.__decorator=D([Zt],w3.prototype,"onPointerMove",null);w3.__decorator=D([Zt],w3.prototype,"onPointerUp",null);class y3{get onPointerMove(){return this.disposables.add(new ii(this.el,uo.Change)).event}get onPointerUp(){return this.disposables.add(new ii(this.el,uo.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}y3.__decorator=D([Zt],y3.prototype,"onPointerMove",null);y3.__decorator=D([Zt],y3.prototype,"onPointerUp",null);class nW{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}nW.__decorator=D([Zt],nW.prototype,"onPointerMove",null);nW.__decorator=D([Zt],nW.prototype,"onPointerUp",null);const X2e="pointer-events-disabled";class Od extends V{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===oa.Disabled),this.el.classList.toggle("minimum",e===oa.AtMinimum),this.el.classList.toggle("maximum",e===oa.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!==oa.Disabled&&(this._orthogonalStartDragHandle=re(this.el,fe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ii(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Od.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ii(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Od.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!==oa.Disabled&&(this._orthogonalEndDragHandle=re(this.el,fe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ii(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Od.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ii(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Od.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=Dxt,this.hoverDelayer=this._register(new Mh(this.hoverDelay)),this._state=oa.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=re(e,fe(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Qt&&this.el.classList.add("mac");const n=this._register(new ii(this.el,"mousedown")).event;this._register(n(h=>this.onPointerStart(h,new w3(e)),this));const o=this._register(new ii(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new ii(this.el,"mouseenter")).event;this._register(r(()=>Od.onMouseEnter(this)));const a=this._register(new ii(this.el,"mouseleave")).event;this._register(a(()=>Od.onMouseLeave(this))),this._register(fd.addTarget(this.el));const c=this._register(new ii(this.el,uo.Start)).event;this._register(c(h=>this.onPointerStart(h,new y3(this.el)),this));const l=this._register(new ii(this.el,uo.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===fi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=Ext,this._register(xxt.event(h=>{this.size=h,this.layout()}))),this._register(kxt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||fi.VERTICAL,this.orientation===fi.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",Axt),this.layout()}onPointerStart(e,t){en.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new nW(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new nW(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of n)p.classList.add(X2e);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=gl(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===fi.HORIZONTAL?this.state===oa.AtMinimum?p="s-resize":this.state===oa.AtMaximum?p="n-resize":p=Qt?"row-resize":"ns-resize":this.state===oa.AtMinimum?p="e-resize":this.state===oa.AtMaximum?p="w-resize":p=Qt?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{en.stop(p,!1);const m={startX:o,currentX:p.pageX,startY:r,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{en.stop(p,!1),l.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of n)m.classList.remove(X2e)};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&&Od.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Od.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Od.onMouseLeave(this)}layout(){if(this.orientation===fi.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||!Yr(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var Ixt='.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%}';ut(Ixt,{});const Txt={separatorBorder:me.transparent};var hw;(function(s){s[s.Normal=0]="Normal",s[s.Low=1]="Low",s[s.High=2]="High"})(hw||(hw={}));class tYe{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=Ka(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,n){this.container=e,this.view=t,this.disposable=n,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 Lxt extends tYe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Rxt extends tYe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Oh;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Oh||(Oh={}));var Kk;(function(s){s.Distribute={type:"distribute"};function e(n){return{type:"split",index:n}}s.Split=e;function t(n){return{type:"auto",index:n}}s.Auto=t;function i(n){return{type:"invisible",cachedVisibleSize:n}}s.Invisible=i})(Kk||(Kk={}));class C3 extends V{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=Oh.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??fi.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===fi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=re(this.el,fe(".sash-container")),this.viewContainer=fe(".split-view-container"),this.scrollable=this._register(new yN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Ll(ct(this.el),n)})),this.scrollableElement=this._register(new l6(this.viewContainer,{vertical:this.orientation===fi.VERTICAL?t.scrollbarVisibility??Co.Auto:Co.Hidden,horizontal:this.orientation===fi.HORIZONTAL?t.scrollbarVisibility??Co.Auto:Co.Hidden},this.scrollable));const i=this._register(new ii(this.viewContainer,"scroll")).event;this._register(i(n=>{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(n=>{n.scrollTopChanged&&(this.viewContainer.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this.viewContainer.scrollLeft=n.scrollLeft)})),re(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Txt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((n,o)=>{const r=Ya(n.visible)||n.visible?n.size:{type:"invisible",cachedVisibleSize:n.size},a=n.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((n,o)=>n+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,n){this.doAddView(e,t,i,n)}removeView(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.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,n=this.viewItems.splice(e,1)[0];if(i&&(i.size+=n.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=n.view;return n.dispose(),o}finally{this.state=Oh.Idle}}removeAllViews(){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.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=Oh.Idle}}moveView(e,t){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),n=typeof i>"u"?this.getViewSize(e):Kk.Invisible(i),o=this.removeView(e);this.addView(o,n,t)}swapViews(e,t){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),n=this.getViewSize(t),o=this.removeView(t),r=this.removeView(e);this.addView(o,i,e),this.addView(r,n,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 n=0;for(let o=0;o0&&(r.size=Ka(Math.round(a*e/n),r.minimumSize,r.maximumSize))}}else{const n=Au(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===hw.Low),r=n.filter(a=>this.viewItems[a].priority===hw.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 n=this.sashItems.findIndex(a=>a.sash===e),o=jr(ue(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),ue(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(n===this.sashItems.length-1){const m=this.viewItems[n];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[n+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!c){const p=Au(n,-1),m=Au(n+1,this.viewItems.length),v=p.reduce((P,R)=>P+(this.viewItems[R].minimumSize-l[R]),0),b=p.reduce((P,R)=>P+(this.viewItems[R].viewMaximumSize-l[R]),0),w=m.length===0?Number.POSITIVE_INFINITY:m.reduce((P,R)=>P+(l[R]-this.viewItems[R].minimumSize),0),y=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((P,R)=>P+(l[R]-this.viewItems[R].viewMaximumSize),0),C=Math.max(v,y),A=Math.min(w,b),L=this.findFirstSnapIndex(p),k=this.findFirstSnapIndex(m);if(typeof L=="number"){const P=this.viewItems[L],R=Math.floor(P.viewMinimumSize/2);u={index:L,limitDelta:P.visible?C-R:C+R,size:P.size}}if(typeof k=="number"){const P=this.viewItems[k],R=Math.floor(P.viewMinimumSize/2);f={index:k,limitDelta:P.visible?A+R:A-R,size:P.size}}}this.sashDragState={start:a,current:a,index:n,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:n,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,n,void 0,void 0,r,a,c,l);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),p=u?t:t+1,m=this.viewItems[p],v=m.size-m.maximumSize,b=m.size-m.minimumSize,w=u?t-1:t+1;this.resize(w,-h,f,void 0,void 0,v,b)}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=Ka(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!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.Busy;try{const i=Au(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===hw.Low),e],o=i.filter(a=>this.viewItems[a].priority===hw.High),r=this.viewItems[e];t=Math.round(t),t=Ka(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,o)}finally{this.state=Oh.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=Ka(i,a.minimumSize,a.maximumSize);const n=Au(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===hw.Low),r=n.filter(a=>this.viewItems[a].priority===hw.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,n){if(this.state!==Oh.Idle)throw new Error("Cant modify splitview");this.state=Oh.Busy;try{const o=fe(".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(()=>o.remove()),c=jr(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===fi.VERTICAL?new Lxt(o,e,l,c):new Rxt(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===fi.VERTICAL?new Od(this.sashContainer,{getHorizontalSashTop:P=>this.getSashPosition(P),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:fi.HORIZONTAL}):new Od(this.sashContainer,{getVerticalSashLeft:P=>this.getSashPosition(P),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:fi.VERTICAL}),p=this.orientation===fi.VERTICAL?P=>({sash:f,start:P.startY,current:P.currentY,alt:P.altKey}):P=>({sash:f,start:P.startX,current:P.currentX,alt:P.altKey}),v=M.map(f.onDidStart,p)(this.onSashStart,this),w=M.map(f.onDidChange,p)(this.onSashChange,this),C=M.map(f.onDidEnd,()=>this.sashItems.findIndex(P=>P.sash===f))(this.onSashEnd,this),A=f.onDidReset(()=>{const P=this.sashItems.findIndex(j=>j.sash===f),R=Au(P,-1),z=Au(P+1,this.viewItems.length),G=this.findFirstSnapIndex(R),Y=this.findFirstSnapIndex(z);typeof G=="number"&&!this.viewItems[G].visible||typeof Y=="number"&&!this.viewItems[Y].visible||this._onDidSashReset.fire(P)}),L=jr(v,w,C,A,f),k={sash:f,disposable:L};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),n||this.relayout([i],h),!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Oh.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,o)=>n+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),n,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=Au(e,-1),h=Au(e+1,this.viewItems.length);if(o)for(const k of o)fde(d,k),fde(h,k);if(n)for(const k of n)vG(d,k),vG(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,P)=>k+(this.viewItems[P].minimumSize-i[P]),0),b=d.reduce((k,P)=>k+(this.viewItems[P].maximumSize-i[P]),0),w=h.length===0?Number.POSITIVE_INFINITY:h.reduce((k,P)=>k+(i[P]-this.viewItems[P].minimumSize),0),y=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((k,P)=>k+(i[P]-this.viewItems[P].maximumSize),0),C=Math.max(v,y,r),A=Math.min(w,b,a);let L=!1;if(c){const k=this.viewItems[c.index],P=t>=c.limitDelta;L=P!==k.visible,k.setVisible(P,c.size)}if(!L&&l){const k=this.viewItems[l.index],P=ta+c.size,0);let i=this.size-t;const n=Au(this.viewItems.length-1,-1),o=n.filter(a=>this.viewItems[a].priority===hw.Low),r=n.filter(a=>this.viewItems[a].priority===hw.High);for(const a of r)fde(n,a);for(const a of o)vG(n,a);typeof e=="number"&&vG(n,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===fi.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),n=[...this.viewItems].reverse();e=!1;const o=n.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const r=n.map(c=>e=c.maximumSize-c.size>0||e).reverse();let a=0;for(let c=0;c0||this.startSnappingEnabled)?l.state=oa.AtMinimum:w&&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(),bt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var Mxt='.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}';ut(Mxt,{});const use=class use{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=use.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=n.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=re(e,fe(".monaco-table-tr")),i=[],n=[];for(let r=0;rthis.disposables.add(new Pxt(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 C3(this.domNode,{orientation:fi.HORIZONTAL,scrollbarVisibility:Co.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 oJ(n,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Xa(e,this.domNode,Nxt(i),[l],r)),M.any(...a.map(d=>d.onDidLayout))(([d,h])=>l.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=n.reduce((f,p)=>f+p.weight,0),u=n[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=gl(this.domNode),this.style(tEt)}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??cTe(this.domNode),t=t??ZV(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 { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);o=i0._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;ne){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.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,n){const o=this.getCreationOptions(t,i,n),r=new b_(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(dE(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)KC(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)KC(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>KC(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=dE(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const c=new CEt(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:n,disposable:o}=mme(t,i.defaultEOL);if(e.equalsTextBuffer(n)){o.dispose();return}e.pushStackElement(),e.pushEOL(n.getEOL()===`\r +`?yh.CRLF:yh.LF),e.pushEditOperations([],i0._computeEdits(e,n),()=>[]),e.pushStackElement(),o.dispose()}static _commonPrefix(e,t,i,n,o,r){const a=Math.min(t,o);let c=0;for(let l=0;l0?(a=new F(o+1,1,i-r+1,1),c=new F(o+1,1,n-r+1,1)):o>0?(a=new F(o,e.getLineMaxColumn(o),i,e.getLineMaxColumn(i)),c=new F(o,1+t.getLineLength(o),n,1+t.getLineLength(n))):(a=new F(1,1,i,e.getLineMaxColumn(i)),c=new F(1,1,n,1+t.getLineLength(n))),[Zn.replaceMove(a,t.getValueInRange(c,go.TextDefined))]}createModel(e,t,i,n=!1){let o;return t?o=this._createModelData(e,t,i,n):o=this._createModelData(e,Ca,i,n),this._onModelAdded.fire(o.model),o.model}destroyModel(e){const t=this._models[dE(e)];t&&t.model.dispose()}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||l.future.length>0){for(const d of l.past)KC(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of l.future)KC(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=i0.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,c=this._getSHA1Computer();if(o)if(!n&&(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=>KC(l)&&l.matchesResource(e.uri)),this._insertDisposedModel(new AEt(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,c.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){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,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);i0._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new j2}},i0=aL,aL.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,aL);m_e=i0=D([_(0,Te),_(1,dTe),_(2,jA),_(3,xi),_(4,Vs)],m_e);const sse=class sse{canComputeSHA1(e){return e.getValueLength()<=sse.MAX_MODEL_SIZE}computeSHA1(e){const t=new cpe,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}};sse.MAX_MODEL_SIZE=10*1024*1024;let j2=sse;var EEt=".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}";ut(EEt,{});var XY;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(XY||(XY={}));const DU={Quickaccess:"workbench.contributions.quickaccess"};class xEt{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 Fi([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}}}Qe.add(DU.Quickaccess,new xEt);const DEt={ctrlCmd:!1,alt:!1};var Y2;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(Y2||(Y2={}));var J2;(function(s){s.QuickPick="quickPick",s.InputBox="inputBox",s.QuickWidget="quickWidget"})(J2||(J2={}));var Of;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(Of||(Of={}));var wo;(function(s){s[s.First=1]="First",s[s.Second=2]="Second",s[s.Last=3]="Last",s[s.Next=4]="Next",s[s.Previous=5]="Previous",s[s.NextPage=6]="NextPage",s[s.PreviousPage=7]="PreviousPage",s[s.NextSeparator=8]="NextSeparator",s[s.PreviousSeparator=9]="PreviousSeparator"})(wo||(wo={}));var ZY;(function(s){s[s.Title=1]="Title",s[s.Inline=2]="Inline"})(ZY||(ZY={}));class kEt{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===pe.file?e.resource.fsPath:e.resource?.path}}const O2e=new kEt,In=ae("quickInputService");let __e=class extends V{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Qe.as(DU.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[n,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=n?.defaultFilterValue;m===XY.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??Of.SECOND),h.contextKey=o?.contextKey,h.filterValue=p=>p.substring(o?o.prefix.length:0);let u;t&&(u=new dc,d.add(M.once(h.onWillAccept)(p=>{p.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,n,o,e,i));const f=d.add(new ci);if(n&&d.add(n.provide(h,f.token,i?.providerOptions)),M.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 n;i?.preserveValue?n=[e.value.length,e.value.length]:n=[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,o){const r=new Z,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};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 n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};__e=D([_(0,In),_(1,we)],__e);var IEt=".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;border-radius:2px;display:flex;padding-right:2px}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.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}";ut(IEt,{});const Bje={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class JA extends gd{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(...We.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(wm().setupManagedHover(e.hoverDelegate??Pr("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===S.Space||i.keyCode===S.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(...We.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...We.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 ose=class ose extends gd{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 JA({title:this.title,isChecked:this.isChecked,icon:ve.check,actionClassName:ose.CLASS_NAME,...Bje})),this.domNode=this.checkbox.domNode,this.styles=i,this.applyStyles(),this._register(this.checkbox.onChange(n=>{this.applyStyles(),this._onChange.fire(n)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}focus(){this.domNode.focus()}hasFocus(){return sv(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||""}};ose.CLASS_NAME="monaco-checkbox";let B2e=ose;var TEt='.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-top-left-radius:5px;border-top-right-radius:5px;display:flex}.quick-input-left-action-bar{display:flex;flex:1;margin-left:4px}.quick-input-inline-action-bar{margin:2px 0 0 5px}.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;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: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}';ut(TEt,{});class v_e{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}v_e.__decorator=D([Zt],v_e.prototype,"toString",null);const LEt=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function Wje(s){const e=[];let t=0,i;for(;i=LEt.exec(s);){i.index-t>0&&e.push(s.substring(t,i.index));const[,n,o,,r]=i;r?e.push({label:n,href:o,title:r}):e.push({label:n,href:o}),t=i.index+i[0].length}return t{xdt(f)&&en.stop(f,!0),t.callback(o.href)},l=t.disposables.add(new ii(a,ke.CLICK)).event,d=t.disposables.add(new ii(a,ke.KEY_DOWN)).event,h=M.chain(d,f=>f.filter(p=>{const m=new En(p);return m.equals(S.Space)||m.equals(S.Enter)}));t.disposables.add(ud.addTarget(a));const u=t.disposables.add(new ii(a,uo.Tap)).event;M.any(l,u,h)(c,null,t.disposables),e.appendChild(a)}}let CM=class extends V{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,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 n=Yr(e.target)?[e.target]:e.target.targetElements;for(const r of n)this.hoverDisposables.add(Ro(r,"keydown",a=>{a.equals(S.Escape)&&this.hoverService.hideHover()}));const o=Yr(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.lastHoverHideTimet===eJ),this._rightButtons=e.filter(t=>t!==eJ&&t.location!==ZY.Inline),this._inlineButtons=e.filter(t=>t.location===ZY.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{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=Y2.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=Y2.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?aa(this.ui.widget,this._widget):aa(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new bm,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 n=this._leftButtons.map((a,c)=>C5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.leftActionBar.push(n,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this._rightButtons.map((a,c)=>C5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.rightActionBar.push(o,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const r=this._inlineButtons.map((a,c)=>C5(a,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(a)));this.ui.inlineActionBar.push(r,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const n=this.toggles?.filter(o=>o instanceof JA)??[];this.ui.inputBox.toggles=n}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,aa(this.ui.message),NEt(i,this.ui.message,{callback:n=>{this.ui.linkOpenerDelegate(n)},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(5276,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Xe.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()}};rse.noPromptMessage=g(5275,"Press 'Enter' to confirm your input or 'Escape' to cancel");let X2=rse;const ase=class ase extends X2{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=Of.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 R7,this.type=J2.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?DEt: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&&is(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&&is(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(Z1e(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&is(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 ue(this.ui.container,ke.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new En(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===S.Shift?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===S.Alt||a[0].ctrlKey&&i===S.Ctrl||a[0].metaKey&&i===S.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.titleButtons.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 n=this.ariaLabel;!n&&i.inputBox&&(n=this.placeholder||ase.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??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._itemActivation){case Of.NONE:this._itemActivation=Of.FIRST;break;case Of.SECOND:this.ui.list.focus(wo.Second),this._itemActivation=Of.FIRST;break;case Of.LAST:this.ui.list.focus(wo.Last),this._itemActivation=Of.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))}};ase.DEFAULT_ARIA_LABEL=g(5277,"Type to narrow down results.");let cF=ase,HEt=class extends X2{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=J2.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(5278,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):X2.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.titleButtons.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 UEt extends X2{constructor(){super(...arguments),this.type=J2.QuickWidget}update(){if(!this.visible)return;const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step};this.ui.setVisibilities(e),super.update()}}let b_e=class extends CM{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(Yr(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};b_e=D([_(0,Te),_(1,ec)],b_e);var VEt=".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)}";ut(VEt,{});me.white.toString(),me.white.toString();class jd extends V{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,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",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(ud.addTarget(this._element)),[ke.CLICK,uo.Tap].forEach(o=>{this._register(ue(this._element,o,r=>{if(!this.enabled){en.stop(r);return}this._onDidClick.fire(r)}))}),this._register(ue(this._element,ke.KEY_DOWN,o=>{const r=new En(o);let a=!1;this.enabled&&(r.equals(S.Enter)||r.equals(S.Space))?(this._onDidClick.fire(o),a=!0):r.equals(S.Escape)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&en.stop(r,!0)})),this._register(ue(this._element,ke.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ue(this._element,ke.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ac(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 Cb(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}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||cd(this._label)&&cd(e)&&rCt(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(cd(e)){const n=d6(e,{inline:!0});n.dispose();const o=n.element.querySelector("p")?.innerHTML;if(o){const r=IGe(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=r}else aa(t)}else this.options.supportIcons?aa(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=qQe(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?aa(this._labelShortElement,...this.getContentElements(e)):this._labelShortElement.textContent=e)}set icon(e){this._element.classList.add(...We.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(wm().setupManagedHover(this.options.hoverDelegate??Pr("mouse"),this._element,e)):this._hover&&this._hover.update(e)}focus(){this._element.focus()}hasFocus(){return sv(this._element)}}class zEt extends V{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 jd(this.element,t)),this._register(this.button.onDidClick(o=>this._onDidClick.fire(o))),this.action=this._register(new rn("primaryAction",qQe(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 n=t.secondary?t.buttonSecondaryBackground:t.buttonBackground;this.separatorContainer.style.backgroundColor=n??"",this.separator.style.backgroundColor=t.buttonSeparator??"",this.dropdownButton=this._register(new jd(this.element,{...t,title:!1,supportIcons:!0})),this._register(wm().setupManagedHover(Pr("mouse"),this.dropdownButton.element,g(8811,"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=ve.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 $Et{constructor(e,t){this.options=t,this._element=document.createElement("div"),this._element.classList.add("monaco-description-button"),this._button=new jd(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?aa(this._descriptionElement,...Cb(e)):this._descriptionElement.textContent=e}}class GEt{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 jd(this.container,e));return this.pushButton(t),t}addButtonWithDescription(e){const t=this._buttonStore.add(new $Et(this.container,e));return this.pushButton(t),t}addButtonWithDropdown(e){const t=this._buttonStore.add(new zEt(this.container,e));return this.pushButton(t),t}pushButton(e){this._buttons.push(e);const t=this._buttons.length-1;this._buttonStore.add(ue(e.element,ke.KEY_DOWN,i=>{const n=new En(i);let o=!0,r;n.equals(S.LeftArrow)?r=t>0?t-1:this._buttons.length-1:n.equals(S.RightArrow)?r=t===this._buttons.length-1?0:t+1:o=!1,o&&typeof r=="number"&&(this._buttons[r].focus(),en.stop(i,!0))}))}}var KEt=".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}";ut(KEt,{});class w_e{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=re(e,fe(".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=Up(this.countFormat,this.count),this.element.title=Up(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 qEt=()=>({msLoopTime:-1,msDelayTime:-1,dispose:()=>{}});let QEt=qEt;function jEt(s,e){return QEt()}var YEt=".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)}}";ut(YEt,{});const whe="done",yhe="active",eK="infinite",tK="infinite-long-running",Che="discrete",Fz=class Fz extends V{constructor(e,t){super(),this.progressSignal=this._register(new wn),this.workedVal=0,this.showDelayedScheduler=this._register(new cn(()=>jh(this.element),0)),this.longRunningScheduler=this._register(new cn(()=>this.infiniteLongRunning(),Fz.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(yhe,eK,tK,Che),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(whe),this.element.classList.contains(eK)?(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(Che,whe,tK),this.element.classList.add(yhe,eK),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(tK)}total(e){return this.workedVal=0,this.totalWork=e,this.element.setAttribute("aria-valuemax",e.toString()),this}hasTotal(){return lc(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(eK,tK,whe),this.element.classList.add(yhe,Che),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=jEt(),typeof e=="number"?this.showDelayedScheduler.schedule(e):jh(this.element)}hide(){Ud(this.element),this.showDelayedScheduler.cancel(),this.progressSignal.clear()}};Fz.LONG_RUNNING_INFINITE_THRESHOLD=1e4,Fz.PROGRESS_SIGNAL_DEFAULT_DELAY=3e3;let tJ=Fz;const JEt=g(9871,"Match Case"),XEt=g(9872,"Match Whole Word"),ZEt=g(9873,"Use Regular Expression");class zje extends JA{constructor(e){super({icon:ve.caseSensitive,title:JEt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class $je extends JA{constructor(e){super({icon:ve.wholeWord,title:XEt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Gje extends JA{constructor(e){super({icon:ve.regex,title:ZEt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ext{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}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 txt{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 ext(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}}class W2e{get size(){return this._size}constructor(e,t=10,i=n=>n){if(this.capacity=t,this.identityFn=i,e.length<1)throw new Error("not supported");this._size=1,this.head=this.tail=this.cursor={value:e[0],previous:void 0,next:void 0},this.valueSet=new wrt([e[0]],i);for(let n=1;nthis.capacity;)this.valueSet.delete(this.head.value),this.head=this.head.next,this.head.previous=void 0,this._size--}replaceLast(e){if(this.identityFn(this.tail.value)===this.identityFn(e))return e;const t=this.tail.value;return this.valueSet.delete(t),this.tail.value=e,this.valueSet.has(e)?this._deleteFromList(e):this.valueSet.add(e),t}prepend(e){if(this._size===this.capacity||this.valueSet.has(e))return;const t={value:e,previous:void 0,next:this.head};this.head.previous=t,this.head=t,this._size++,this.valueSet.add(e)}isAtEnd(){return this.cursor===this.tail}current(){return this.cursor.value}previous(){return this.cursor.previous&&(this.cursor=this.cursor.previous),this.cursor.value}next(){return this.cursor.next&&(this.cursor=this.cursor.next),this.cursor.value}has(e){return this.valueSet.has(e)}resetCursor(){return this.cursor=this.tail,this.cursor.value}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}_deleteFromList(e){let t=this.head;const i=this.identityFn(e);for(;t!==this.tail;)this.identityFn(t.value)===i&&(t===this.head?(this.head=this.head.next,this.head.previous=void 0):(t.previous.next=t.next,t.next.previous=t.previous),this._size--),t=t.next}}var ixt=".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}";ut(ixt,{});const h4=fe;var Yl;(function(s){s[s.INFO=1]="INFO",s[s.WARNING=2]="WARNING",s[s.ERROR=3]="ERROR"})(Yl||(Yl={}));const nxt={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 Kje extends gd{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=re(e,h4(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",o=re(this.element,h4(".ibwrapper"));if(this.input=re(o,h4(n+".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=re(o,h4("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new fqe(this.element,{vertical:Co.Auto}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),re(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const r=this._register(new ii(e.ownerDocument,"selectionchange")),a=M.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 ld(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(wm().setupManagedHover(Pr("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:hb(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return sv(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 Md(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,n=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+n}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"&&Ys(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 ${xy(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 Yl.INFO:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case Yl.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 Yl.INFO:return"info";case Yl.WARNING:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=Md(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:pb.RIGHT,render:n=>{if(!this.message)return null;e=re(n,h4(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?uLe(this.message.content,o):Nyt(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}`:"",re(e,r),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===Yl.ERROR?i=g(9834,"Error: {0}",this.message.content):this.message.type===Yl.WARNING?i=g(9835,"Warning: {0}",this.message.content):i=g(9836,"Info: {0}",this.message.content),Mr(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??"",n=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 ${xy(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=hb(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,n=t.selectionEnd,o=t.value;i!==null&&n!==null&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class PLe extends Kje{constructor(e,t,i){const n=g(9837," or {0} for history","⇅"),o=g(9838," ({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 txt(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:o,c=this.placeholder+a;i.showPlaceholderOnFocus&&!sv(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(n)})}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??"",Ch(this.value?this.value:g(9839,"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,Ch(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 sxt=".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}}";ut(sxt,{});const oxt=g(9833,"input"),$Pe=class $Pe extends gd{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new wn),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||oxt,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=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 PLe(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(Wk());if(this.showCommonFindToggles){this.regex=this._register(new Gje({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 $je({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 zje({appendTitle:n,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(S.LeftArrow)||f.equals(S.RightArrow)||f.equals(S.Escape)){const p=u.indexOf(this.domNode.ownerDocument.activeElement);if(p>=0){let m=-1;f.equals(S.RightArrow)?m=(p+1)%u.length:f.equals(S.LeftArrow)&&(p===0?m=u.length-1:m=p-1),f.equals(S.Escape)?(u[p].blur(),this.inputBox.focus()):m>=0&&u[m].focus(),en.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(ue(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(ue(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()}};$Pe.OPTION_CHANGE="optionChange";let m3=$Pe;const rxt=fe;class axt extends V{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Ro(this.findInput.inputBox.inputElement,ke.KEY_DOWN,o),this.onMouseDown=o=>Ro(this.findInput.inputBox.inputElement,ke.MOUSE_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=re(this.parent,rxt(".quick-input-box")),this.findInput=this._register(new m3(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.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===Xe.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Xe.Info?Yl.INFO:e===Xe.Warning?Yl.WARNING:Yl.ERROR,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Xe.Info?Yl.INFO:e===Xe.Warning?Yl.WARNING:Yl.ERROR)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class cxt{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:V.None}}renderElement(e,t,i,n){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,n);const r=new ci,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,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class lxt{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 dxt(s,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new lxt(s,e.accessibilityProvider)}}class hxt{constructor(e,t,i,n,o={}){const r=()=>this.model,a=n.map(c=>new cxt(c,r));this.list=new Xa(e,t,i,a,dxt(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}isDOMFocused(){return sv(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 M.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 M.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 M.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 M.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 M.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return M.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get onContextMenu(){return M.map(this.list.onContextMenu,({element:e,index:t,anchor:i,browserEvent:n})=>typeof e>"u"?{element:e,index:t,anchor:i,browserEvent:n}:{element:this._model.get(e),index:t,anchor:i,browserEvent:n})}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Su(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 uxt=':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}';ut(uxt,{});const gxt=!1;var iJ;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(iJ||(iJ={}));var fi;(function(s){s[s.VERTICAL=0]="VERTICAL",s[s.HORIZONTAL=1]="HORIZONTAL"})(fi||(fi={}));var oa;(function(s){s[s.Disabled=0]="Disabled",s[s.AtMinimum=1]="AtMinimum",s[s.AtMaximum=2]="AtMaximum",s[s.Enabled=3]="Enabled"})(oa||(oa={}));let fxt=4;const pxt=new I;let mxt=300;const _xt=new I;class _3{constructor(e){this.el=e,this.disposables=new Z}get onPointerMove(){return this.disposables.add(new ii(ct(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ii(ct(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}_3.__decorator=D([Zt],_3.prototype,"onPointerMove",null);_3.__decorator=D([Zt],_3.prototype,"onPointerUp",null);class v3{get onPointerMove(){return this.disposables.add(new ii(this.el,uo.Change)).event}get onPointerUp(){return this.disposables.add(new ii(this.el,uo.End)).event}constructor(e){this.el=e,this.disposables=new Z}dispose(){this.disposables.dispose()}}v3.__decorator=D([Zt],v3.prototype,"onPointerMove",null);v3.__decorator=D([Zt],v3.prototype,"onPointerUp",null);class Z2{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}Z2.__decorator=D([Zt],Z2.prototype,"onPointerMove",null);Z2.__decorator=D([Zt],Z2.prototype,"onPointerUp",null);const H2e="pointer-events-disabled";class Pd extends V{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===oa.Disabled),this.el.classList.toggle("minimum",e===oa.AtMinimum),this.el.classList.toggle("maximum",e===oa.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!==oa.Disabled&&(this._orthogonalStartDragHandle=re(this.el,fe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ee(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ii(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Pd.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ii(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Pd.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!==oa.Disabled&&(this._orthogonalEndDragHandle=re(this.el,fe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ee(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ii(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Pd.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ii(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Pd.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=mxt,this.hoverDelayer=this._register(new Lh(this.hoverDelay)),this._state=oa.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=re(e,fe(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Qt&&this.el.classList.add("mac");const n=this._register(new ii(this.el,"mousedown")).event;this._register(n(h=>this.onPointerStart(h,new _3(e)),this));const o=this._register(new ii(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new ii(this.el,"mouseenter")).event;this._register(r(()=>Pd.onMouseEnter(this)));const a=this._register(new ii(this.el,"mouseleave")).event;this._register(a(()=>Pd.onMouseLeave(this))),this._register(ud.addTarget(this.el));const c=this._register(new ii(this.el,uo.Start)).event;this._register(c(h=>this.onPointerStart(h,new v3(this.el)),this));const l=this._register(new ii(this.el,uo.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===fi.VERTICAL?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=fxt,this._register(pxt.event(h=>{this.size=h,this.layout()}))),this._register(_xt.event(h=>this.hoverDelay=h)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||fi.VERTICAL,this.orientation===fi.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",gxt),this.layout()}onPointerStart(e,t){en.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new Z2(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new Z2(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const p of n)p.classList.add(H2e);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=ul(this.el),d=()=>{let p="";i?p="all-scroll":this.orientation===fi.HORIZONTAL?this.state===oa.AtMinimum?p="s-resize":this.state===oa.AtMaximum?p="n-resize":p=Qt?"row-resize":"ns-resize":this.state===oa.AtMinimum?p="e-resize":this.state===oa.AtMaximum?p="w-resize":p=Qt?"col-resize":"ew-resize",l.textContent=`* { cursor: ${p} !important; }`},h=new Z;d(),i||this.onDidEnablementChange.event(d,null,h);const u=p=>{en.stop(p,!1);const m={startX:o,currentX:p.pageX,startY:r,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},f=p=>{en.stop(p,!1),l.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const m of n)m.classList.remove(H2e)};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&&Pd.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Pd.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Pd.onMouseLeave(this)}layout(){if(this.orientation===fi.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||!Yr(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}var vxt='.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%}';ut(vxt,{});const bxt={separatorBorder:me.transparent};var cw;(function(s){s[s.Normal=0]="Normal",s[s.Low=1]="Low",s[s.High=2]="High"})(cw||(cw={}));class qje{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=Ka(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,n){this.container=e,this.view=t,this.disposable=n,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 wxt extends qje{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class yxt extends qje{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Fh;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})(Fh||(Fh={}));var Uk;(function(s){s.Distribute={type:"distribute"};function e(n){return{type:"split",index:n}}s.Split=e;function t(n){return{type:"auto",index:n}}s.Auto=t;function i(n){return{type:"invisible",cachedVisibleSize:n}}s.Invisible=i})(Uk||(Uk={}));class b3 extends V{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=Fh.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??fi.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===fi.VERTICAL?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=re(this.el,fe(".sash-container")),this.viewContainer=fe(".split-view-container"),this.scrollable=this._register(new _N({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Tl(ct(this.el),n)})),this.scrollableElement=this._register(new o6(this.viewContainer,{vertical:this.orientation===fi.VERTICAL?t.scrollbarVisibility??Co.Auto:Co.Hidden,horizontal:this.orientation===fi.HORIZONTAL?t.scrollbarVisibility??Co.Auto:Co.Hidden},this.scrollable));const i=this._register(new ii(this.viewContainer,"scroll")).event;this._register(i(n=>{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(n=>{n.scrollTopChanged&&(this.viewContainer.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this.viewContainer.scrollLeft=n.scrollLeft)})),re(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||bxt),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((n,o)=>{const r=Ya(n.visible)||n.visible?n.size:{type:"invisible",cachedVisibleSize:n.size},a=n.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((n,o)=>n+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,n){this.doAddView(e,t,i,n)}removeView(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");if(this.state!==Fh.Idle)throw new Error("Cant modify splitview");this.state=Fh.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,n=this.viewItems.splice(e,1)[0];if(i&&(i.size+=n.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=n.view;return n.dispose(),o}finally{this.state=Fh.Idle}}removeAllViews(){if(this.state!==Fh.Idle)throw new Error("Cant modify splitview");this.state=Fh.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=Fh.Idle}}moveView(e,t){if(this.state!==Fh.Idle)throw new Error("Cant modify splitview");const i=this.getViewCachedVisibleSize(e),n=typeof i>"u"?this.getViewSize(e):Uk.Invisible(i),o=this.removeView(e);this.addView(o,n,t)}swapViews(e,t){if(this.state!==Fh.Idle)throw new Error("Cant modify splitview");if(e>t)return this.swapViews(t,e);const i=this.getViewSize(e),n=this.getViewSize(t),o=this.removeView(t),r=this.removeView(e);this.addView(o,i,e),this.addView(r,n,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 n=0;for(let o=0;o0&&(r.size=Ka(Math.round(a*e/n),r.minimumSize,r.maximumSize))}}else{const n=Su(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===cw.Low),r=n.filter(a=>this.viewItems[a].priority===cw.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 n=this.sashItems.findIndex(a=>a.sash===e),o=jr(ue(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),ue(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(n===this.sashItems.length-1){const m=this.viewItems[n];d=(m.minimumSize-m.size)/2,h=(m.maximumSize-m.size)/2}else{const m=this.viewItems[n+1];d=(m.size-m.maximumSize)/2,h=(m.size-m.minimumSize)/2}let u,f;if(!c){const p=Su(n,-1),m=Su(n+1,this.viewItems.length),v=p.reduce((P,R)=>P+(this.viewItems[R].minimumSize-l[R]),0),b=p.reduce((P,R)=>P+(this.viewItems[R].viewMaximumSize-l[R]),0),w=m.length===0?Number.POSITIVE_INFINITY:m.reduce((P,R)=>P+(l[R]-this.viewItems[R].minimumSize),0),y=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((P,R)=>P+(l[R]-this.viewItems[R].viewMaximumSize),0),C=Math.max(v,y),A=Math.min(w,b),L=this.findFirstSnapIndex(p),k=this.findFirstSnapIndex(m);if(typeof L=="number"){const P=this.viewItems[L],R=Math.floor(P.viewMinimumSize/2);u={index:L,limitDelta:P.visible?C-R:C+R,size:P.size}}if(typeof k=="number"){const P=this.viewItems[k],R=Math.floor(P.viewMinimumSize/2);f={index:k,limitDelta:P.visible?A+R:A-R,size:P.size}}}this.sashDragState={start:a,current:a,index:n,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:n,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,n,void 0,void 0,r,a,c,l);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),p=u?t:t+1,m=this.viewItems[p],v=m.size-m.maximumSize,b=m.size-m.minimumSize,w=u?t-1:t+1;this.resize(w,-h,f,void 0,void 0,v,b)}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=Ka(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!==Fh.Idle)throw new Error("Cant modify splitview");this.state=Fh.Busy;try{const i=Su(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===cw.Low),e],o=i.filter(a=>this.viewItems[a].priority===cw.High),r=this.viewItems[e];t=Math.round(t),t=Ka(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,o)}finally{this.state=Fh.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=Ka(i,a.minimumSize,a.maximumSize);const n=Su(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===cw.Low),r=n.filter(a=>this.viewItems[a].priority===cw.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,n){if(this.state!==Fh.Idle)throw new Error("Cant modify splitview");this.state=Fh.Busy;try{const o=fe(".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(()=>o.remove()),c=jr(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===fi.VERTICAL?new wxt(o,e,l,c):new yxt(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===fi.VERTICAL?new Pd(this.sashContainer,{getHorizontalSashTop:P=>this.getSashPosition(P),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:fi.HORIZONTAL}):new Pd(this.sashContainer,{getVerticalSashLeft:P=>this.getSashPosition(P),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:fi.VERTICAL}),p=this.orientation===fi.VERTICAL?P=>({sash:f,start:P.startY,current:P.currentY,alt:P.altKey}):P=>({sash:f,start:P.startX,current:P.currentX,alt:P.altKey}),v=M.map(f.onDidStart,p)(this.onSashStart,this),w=M.map(f.onDidChange,p)(this.onSashChange,this),C=M.map(f.onDidEnd,()=>this.sashItems.findIndex(P=>P.sash===f))(this.onSashEnd,this),A=f.onDidReset(()=>{const P=this.sashItems.findIndex(K=>K.sash===f),R=Su(P,-1),z=Su(P+1,this.viewItems.length),G=this.findFirstSnapIndex(R),j=this.findFirstSnapIndex(z);typeof G=="number"&&!this.viewItems[G].visible||typeof j=="number"&&!this.viewItems[j].visible||this._onDidSashReset.fire(P)}),L=jr(v,w,C,A,f),k={sash:f,disposable:L};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),n||this.relayout([i],h),!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=Fh.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,o)=>n+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),n,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,c,l){if(e<0||e>=this.viewItems.length)return 0;const d=Su(e,-1),h=Su(e+1,this.viewItems.length);if(o)for(const k of o)ade(d,k),ade(h,k);if(n)for(const k of n)pG(d,k),pG(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,P)=>k+(this.viewItems[P].minimumSize-i[P]),0),b=d.reduce((k,P)=>k+(this.viewItems[P].maximumSize-i[P]),0),w=h.length===0?Number.POSITIVE_INFINITY:h.reduce((k,P)=>k+(i[P]-this.viewItems[P].minimumSize),0),y=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((k,P)=>k+(i[P]-this.viewItems[P].maximumSize),0),C=Math.max(v,y,r),A=Math.min(w,b,a);let L=!1;if(c){const k=this.viewItems[c.index],P=t>=c.limitDelta;L=P!==k.visible,k.setVisible(P,c.size)}if(!L&&l){const k=this.viewItems[l.index],P=ta+c.size,0);let i=this.size-t;const n=Su(this.viewItems.length-1,-1),o=n.filter(a=>this.viewItems[a].priority===cw.Low),r=n.filter(a=>this.viewItems[a].priority===cw.High);for(const a of r)ade(n,a);for(const a of o)pG(n,a);typeof e=="number"&&pG(n,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===fi.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),n=[...this.viewItems].reverse();e=!1;const o=n.map(c=>e=c.size-c.minimumSize>0||e).reverse();e=!1;const r=n.map(c=>e=c.maximumSize-c.size>0||e).reverse();let a=0;for(let c=0;c0||this.startSnappingEnabled)?l.state=oa.AtMinimum:w&&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(),bt(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}var Cxt='.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}';ut(Cxt,{});const cse=class cse{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=cse.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=n.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=re(e,fe(".monaco-table-tr")),i=[],n=[];for(let r=0;rthis.disposables.add(new Axt(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 b3(this.domNode,{orientation:fi.HORIZONTAL,scrollbarVisibility:Co.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 nJ(n,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Xa(e,this.domNode,Sxt(i),[l],r)),M.any(...a.map(d=>d.onDidLayout))(([d,h])=>l.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=n.reduce((f,p)=>f+p.weight,0),u=n[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=ul(this.domNode),this.style($At)}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??Y1e(this.domNode),t=t??YV(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()}};gse.InstanceCount=0;let D_e=gse;var qs;(function(s){s[s.Hidden=0]="Hidden",s[s.Visible=1]="Visible",s[s.Recurse=2]="Recurse"})(qs||(qs={}));var Nf;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Nf||(Nf={}));var R1;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(R1||(R1={}));var M1;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(M1||(M1={}));class Zl extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class QLe{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 jLe(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function S3(s){switch(s){case!0:return qs.Visible;case!1:return qs.Hidden;default:return s}}function The(s){return typeof s.collapsible=="boolean"}class Fxt{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new F7,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 Mh(kGe),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=n.allowNonCollapsibleParents??!1,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:qs.Visible,visible:!0,filterData:void 0}}splice(e,t,i=hi.empty(),n={}){if(e.length===0)throw new Zl(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=hi.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const c=[...n],l=t[t.length-1],d=new Vw({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,b)=>{if(r>0)for(let w=0;wb.originalStart-v.originalStart))u(f,p,f-(m.originalStart+m.originalLength)),f=m.originalStart,p=m.modifiedStart-l,this.spliceSimple([...h,f],m.originalLength,hi.slice(c,p,p+m.modifiedLength),o);u(f,p,f)}spliceSimple(e,t,i=hi.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=hi.map(i,A=>this.createTreeNode(A,a,a.visible?qs.Visible:qs.Hidden,l,h,n)),f=e[e.length-1];let p=0;for(let A=f;A>=0&&Ar.getId(A.element).toString())):a.lastDiffIds=a.children.map(A=>r.getId(A.element).toString()):a.lastDiffIds=void 0;let y=0;for(const A of w)A.visible&&y++;if(y!==0)for(let A=f+m.length;AL+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-A),this.list.splice(c,A,h)}if(w.length>0&&o){const A=L=>{o(L),L.children.forEach(A)};w.forEach(A)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:w});let C=a;for(;C;){if(C.visibility===qs.Recurse){this.refilterDelayer.trigger(()=>this.refilter());break}C=C.parent}}rerender(e){if(e.length===0)throw new Zl(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}updateElementHeight(e,t){if(e.length===0)throw new Zl(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:n}=this.getTreeNodeWithListIndex(e);return i&&n?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 n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!The(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,n){const o=this._setNodeCollapseState(e,n,!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 n;if(e===this.root?n=!1:(The(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!The(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}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,n,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:qs.Visible,visible:!0,filterData:void 0},c=this._filterNode(a,i);a.visibility=c,n&&o.push(a);const l=e.children||hi.empty(),d=n&&c!==qs.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===qs.Recurse?h>0:c===qs.Visible,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,n&&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?qs.Visible:qs.Hidden,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===qs.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==qs.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,o,i,n&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===qs.Recurse?a:o===qs.Visible,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&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):qs.Visible;return typeof i=="boolean"?(e.filterData=void 0,i?qs.Visible:qs.Hidden):jLe(i)?(e.filterData=i.data,S3(i.visibility)):(e.filterData=void 0,S3(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...n]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Zl(this.user,"Invalid tree location");return this.getTreeNode(n,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:n,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Zl(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Zl(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function Lhe(s){return s instanceof m6?new Bxt(s):s}class Wxt{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=V.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?.(Lhe(e),t)}onDragOver(e,t,i,n,o,r=!0){const a=this.dnd.onDragOver(Lhe(e),t&&t.element,i,n,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=jy(()=>{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===M1.Up){const f=this.modelProvider(),p=f.getNodeLocation(t),m=f.getParentNodeLocation(p),v=f.getNode(m),b=m&&f.getListIndex(m);return this.onDragOver(e,v,b,n,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:Au(h,h+u)}}drop(e,t,i,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(Lhe(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Hxt(s,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new Wxt(s,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=s(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);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 YLe{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 x5{static lift(e){return e instanceof x5?e:new x5(e)}static empty(e=0){return new x5({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 sW;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(sW||(sW={}));class Uxt{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Z,this.onDidChange=M.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const Hz=class Hz{constructor(e,t,i,n,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Hz.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=V.None,this.disposables=new Z,this.templateId=e.templateId,this.updateOptions(r),M.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=Ka(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,n]of this.renderedNodes)this.renderTreeElement(i,n)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==sW.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,n]of this.renderedNodes)this._renderIndentGuides(i,n);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=re(e,fe(".monaco-tl-row")),i=re(t,fe(".monaco-tl-indent")),n=re(t,fe(".monaco-tl-twistie")),o=re(t,fe(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:V.None,templateData:r}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,n),typeof n=="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=Hz.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(...We.asClassNameArray(ve.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...We.asClassNameArray(ve.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(Ms(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),r=n.getParentNodeLocation(o);if(!r)break;const a=n.getNode(r),c=fe(".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(n=>{const o=i.getNodeLocation(n);try{const r=i.getParentNodeLocation(o);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),bt(this.disposables)}};Hz.DefaultIndent=8;let k_e=Hz;class Vxt{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=qs.Visible;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?qs.Visible:qs.Hidden:jLe(r)?i=S3(r.visibility):i=r,i===qs.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:N_.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:N_.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=Uk(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===Zf.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):qs.Recurse:{data:N_.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){bt(this.disposables)}}class zxt extends ZA{constructor(e){super({icon:ve.listFilter,title:g(4961,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class $xt extends ZA{constructor(e){super({icon:ve.searchFuzzy,title:g(4962,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const Gxt={inputBoxStyles:fxt,toggleStyles:Kje,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var Zf;(function(s){s[s.Highlight=0]="Highlight",s[s.Filter=1]="Filter"})(Zf||(Zf={}));var bb;(function(s){s[s.Fuzzy=0]="Fuzzy",s[s.Contiguous=1]="Contiguous"})(bb||(bb={}));let Kxt=class extends V{set mode(e){this.modeToggle.checked=e===Zf.Filter,this.findInput.inputBox.setPlaceHolder(e===Zf.Filter?g(4963,"Type to filter"):g(4964,"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,n,o,r){super(),this.tree=t,this.elements=Bt(".monaco-tree-type-filter",[Bt(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),Bt(".monaco-tree-type-filter-input@findInput"),Bt(".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(()=>this.elements.root.remove()));const a=r?.styles??Gxt;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($k());this.modeToggle=this._register(new zxt({...a.toggleStyles,isChecked:n===Zf.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new $xt({...a.toggleStyles,isChecked:o===bb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=M.map(this.modeToggle.onChange,()=>this.modeToggle.checked?Zf.Filter:Zf.Highlight,this._store),this.onDidChangeMatchType=M.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?bb.Fuzzy:bb.Contiguous,this._store),this.findInput=this._register(new b3(this.elements.findInput,i,{label:g(4964,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:r?.history})),this.actionbar=this._register(new hd(this.elements.actionbar)),this.mode=n;const l=this._register(new ii(this.findInput.inputBox.inputElement,"keydown")),d=M.chain(l.event,p=>p.map(m=>new En(m)));this._register(d(p=>{if(p.equals(S.Enter)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.addToHistory(),this.tree.domFocus();return}if(p.equals(S.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(S.UpArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.showPreviousValue();return}}));const h=this._register(new rn("close",g(4965,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new ii(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new ii(ct(p),"mousemove")),b=m.add(new ii(ct(p),"mouseup")),w=this.right,y=p.pageX,C=this.top,A=p.pageY;this.elements.grab.classList.add("grabbing");const L=this.elements.root.style.transition;this.elements.root.style.transition="unset";const k=P=>{const R=P.pageX-y;this.right=w-R;const z=P.pageY-A;this.top=C+z,this.layout()};m.add(v.event(k)),m.add(b.event(P=>{k(P),this.elements.grab.classList.remove("grabbing"),this.elements.root.style.transition=L,m.dispose()}))}));const f=M.chain(this._register(new ii(this.elements.grab,"keydown")).event,p=>p.map(m=>new En(m)));this._register(f(p=>{let m,v;if(p.keyCode===S.LeftArrow?m=Number.POSITIVE_INFINITY:p.keyCode===S.RightArrow?m=0:p.keyCode===S.Space&&(m=this.right===0?Number.POSITIVE_INFINITY:0),p.keyCode===S.UpArrow?v=0:p.keyCode===S.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 b=this.elements.root.style.transition;this.elements.root.style.transition="unset",this.layout(),setTimeout(()=>{this.elements.root.style.transition=b},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=Ka(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=Ka(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 Sr(300),super.dispose()}},qxt=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,n,o,r={}){this.tree=e,this.view=i,this.filter=n,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??Zf.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 Kxt(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=>!N_.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:Xl.WARNING,content:g(4966,"No elements found.")}):this.widget?.showMessage({type:Xl.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!N_.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 Qxt(s,e){return s.position===e.position&&iYe(s,e)}function iYe(s,e){return s.node.element===e.node.element&&s.startIndex===e.startIndex&&s.height===e.height&&s.endIndex===e.endIndex}class jxt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return is(this.stickyNodes,e.stickyNodes,Qxt)}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(!is(this.stickyNodes,e.stickyNodes,iYe)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class Yxt{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let Z2e=class extends V{constructor(e,t,i,n,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 Yxt,this._widget=this._register(new Jxt(i.getScrollableElement(),i,e,n,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,n=0,o=this.getNextStickyNode(i,void 0,n);for(;o&&(t.push(o),n+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,n);const r=this.constrainStickyNodes(t);return r.length?new jxt(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n&&!(n===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(n,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:n,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(n===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 n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const o=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}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 n=this.model.getListRenderCount(t),o=i+n-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 n=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 n=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${n.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=`${n.position+n.height}px`}createElement(e,t,i){const n=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",`${n}`),o.setAttribute("data-parity",n%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));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,n){if(!this.accessibilityProvider)return V.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),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:nd(o),a=ai(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 Xxt extends V{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._register(ue(this.container,"focus",()=>this.onFocus())),this._register(ue(this.container,"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(!m3(t)&&!S5(t)){this.focusedLast()&&this.view.domFocus();return}if(!d_(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 n=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,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;!m3(t)&&!S5(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 n=Ka(i,0,t.count-1);this.setFocus(n)}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=n?n.position+n.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 gP(s){let e=R1.Unknown;return pq(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=R1.Twistie:pq(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=R1.Element:pq(s.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=R1.Filter),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function Zxt(s){const e=m3(s.browserEvent.target);return{element:s.element?s.element.element:null,browserEvent:s.browserEvent,anchor:s.anchor,isStickyScroll:e}}function Vq(s,e){e(s),s.children.forEach(t=>Vq(t,e))}class Rhe{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&&is(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 n=this;this._onDidChange.fire({get elements(){return n.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=>Vq(d,l)),this.set([...c.values()]);return}const i=new Set,n=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>Vq(c,n));const o=new Map,r=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>Vq(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 eDt extends Mje{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Tje(e.browserEvent.target)||nA(e.browserEvent.target)||aV(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,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=S5(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&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||n)){const a=this.tree.getNodeLocation(t),c=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,c),n){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(jAt(e.browserEvent.target)||YAt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}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(!m3(t)&&!S5(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!m3(t)&&!S5(t)){super.onContextMenu(e);return}}}class tDt extends Xa{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,c),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new eDt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],o=[];let r;i.forEach((a,c)=>{this.focusTrait.has(a)&&n.push(e+c),this.selectionTrait.has(a)&&o.push(e+c),this.anchorTrait.has(a)&&(r=e+c)}),n.length>0&&super.setFocus(ja([...super.getFocus(),...n])),o.length>0&&super.setSelection(ja([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(n=>this.element(n)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(n=>this.element(n)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}var oW;(function(s){s[s.Tree=0]="Tree",s[s.StickyScroll=1]="StickyScroll"})(oW||(oW={}));class nYe{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 M.map(this.view.onMouseClick,gP)}get onMouseDblClick(){return M.filter(M.map(this.view.onMouseDblClick,gP),e=>e.target!==R1.Filter)}get onMouseOver(){return M.map(this.view.onMouseOver,gP)}get onMouseOut(){return M.map(this.view.onMouseOut,gP)}get onContextMenu(){return M.any(M.filter(M.map(this.view.onContextMenu,Zxt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??M.None)}get onTap(){return M.map(this.view.onTap,gP)}get onPointer(){return M.map(this.view.onPointer,gP)}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 M.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get findMode(){return this.findController?.mode??Zf.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:M.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,n,o={}){this._user=e,this._options=o,this.eventBufferer=new F7,this.onDidChangeFindOpenState=M.None,this.onDidChangeStickyScrollFocused=M.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 YLe(i);const r=new Xge,a=new Xge,c=this.disposables.add(new Uxt(a.event)),l=new P7;this.renderers=n.map(p=>new k_e(p,()=>this.model,r.event,c,l,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new Vxt(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new Rhe(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new Rhe(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new Rhe(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new tDt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...Hxt(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const h=M.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 Mh(0));if(this.disposables.add(M.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=M.chain(this.view.onKeyDown,m=>m.filter(v=>!nA(v.target)).map(v=>new En(v)));M.chain(p,m=>m.filter(v=>v.keyCode===S.LeftArrow))(this.onLeftArrow,this,this.disposables),M.chain(p,m=>m.filter(v=>v.keyCode===S.RightArrow))(this.onRightArrow,this,this.disposables),M.chain(p,m=>m.filter(v=>v.keyCode===S.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 qxt(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=M.None,this.onDidChangeFindMatchType=M.None;o.enableStickyScroll&&(this.stickyScrollController=new Z2e(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=gl(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===sW.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===sW.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new Z2e(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=M.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 av(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),lc(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 n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),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=Iy(e.listFocusAndSelectionOutline,Iy(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 lm(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 n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,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 n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=d_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=d_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=d_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=d_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=d_(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=d_(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()?oW.StickyScroll:oW.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 n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}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 Zl(this._user,"Can't get tree view state without an identity provider");const t=r=>e.getId(r).toString(),i=x5.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 n=this.model.getNode(),o=[n];for(;o.length>0;){const r=o.shift();r!==n&&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],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);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],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!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],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}navigate(e){return new iDt(this.view,this.model,e)}dispose(){bt(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose()}}class iDt{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 JLe{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 Fxt(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=hi.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=hi.empty(),i){const n=new Set,o=new Set,r=c=>{if(c.element===null)return;const l=c;if(n.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(n.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=hi.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),hi.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===Nf.Collapsed||t.collapsed===Nf.PreserveOrCollapsed?r=!0:t.collapsed===Nf.Expanded||t.collapsed===Nf.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Nf.PreserveOrCollapsed||t.collapsed===Nf.PreserveOrExpanded?o=i.collapsed:t.collapsed===Nf.Collapsed?o=!0:t.collapsed===Nf.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:n,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),n=this.model.getNode(i);this._setChildren(i,this.resortChildren(n,t),{})}resortChildren(e,t,i=!0){let n=[...e.children];return(t||i)&&(n=n.sort(this.sorter.compare.bind(this.sorter))),hi.map(n,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 n=this.getElementLocation(e);return this.model.setCollapsed(n,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 Zl(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Zl(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Zl(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Zl(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function zq(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:hi.map(hi.from(s.children),zq),collapsible:s.collapsible,collapsed:s.collapsed}}function $q(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=hi.consume(hi.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:hi.map(hi.concat(n,i),$q),collapsible:s.collapsible,collapsed:s.collapsed}}function I_e(s,e=0){let t;return eI_e(i,0)),e===0&&s.element.incompressible?{element:s.element.elements[e],children:t,incompressible:!0,collapsible:s.collapsible,collapsed:s.collapsed}:{element:s.element.elements[e],children:t,collapsible:s.collapsible,collapsed:s.collapsed}}function eWe(s){return I_e(s,0)}function sYe(s,e,t){return s.element===e?{...s,children:t}:{...s,children:hi.map(hi.from(s.children),i=>sYe(i,e,t))}}const nDt=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class sDt{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 JLe(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=hi.empty(),i){const n=i.diffIdentityProvider&&nDt(i.diffIdentityProvider);if(e===null){const p=hi.map(t,this.enabled?$q:zq);this._setChildren(null,p,{diffIdentityProvider:n,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Zl(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),c=this.model.getNode(a),l=eWe(r),d=sYe(l,e,t),h=(this.enabled?$q:zq)(d),u=i.diffIdentityProvider?(p,m)=>i.diffIdentityProvider.getId(p)===i.diffIdentityProvider.getId(m):void 0;if(is(h.element.elements,r.element.elements,u)){this._setChildren(o,h.children||hi.empty(),{diffIdentityProvider:n,diffDepth:1});return}const f=c.children.map(p=>p===r?h:p);this._setChildren(c.element,f,{diffIdentityProvider:n,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,n=hi.map(i,eWe),o=hi.map(n,e?$q:zq);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=a=>{for(const c of a.element.elements)n.add(c),this.nodes.set(c,a.element)},r=a=>{for(const c of a.element.elements)n.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 n=this.getCompressedNode(e);return this.model.setCollapsed(n,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 Zl(this.user,`Tree element not found: ${e}`);return t}}const oDt=s=>s[s.length-1];class XLe{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new XLe(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 rDt(s,e){return{splice(t,i,n){e.splice(t,i,n.map(o=>s.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function aDt(s,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(s(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(s(t),i)}}}}class cDt{get onDidSplice(){return M.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 M.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return M.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||oDt;const n=o=>this.elementMapper(o.elements);this.nodeMapper=new QLe(o=>new XLe(n,o)),this.model=new sDt(e,rDt(this.nodeMapper,t),aDt(n,i))}setChildren(e,t=hi.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 ZLe extends nYe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=hi.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 JLe(e,t,i)}}class T_e{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,n){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,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}T_e.__decorator=D([Zt],T_e.prototype,"compressedTreeNodeProvider",null);class lDt{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 n=0;ni||n>=t-1&&tthis,a=new lDt(()=>this.model),c=n.map(l=>new T_e(r,a,l));super(e,t,i,c,{...dDt(r,o),stickyScrollDelegate:a})}setChildren(e,t=hi.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new cDt(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 Mhe(s){return{...s,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function L_e(s,e){return e.parent?e.parent===s?!0:L_e(s,e.parent):!1}function hDt(s,e){return s===e||L_e(s,e)||L_e(e,s)}class eRe{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new eRe(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 uDt{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,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...We.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...We.asClassNameArray(ve.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function tWe(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function oK(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}function gDt(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,anchor:s.anchor,isStickyScroll:s.isStickyScroll}}class fDt extends m6{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 Nhe(s){return s instanceof m6?new fDt(s):s}class pDt{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?.(Nhe(e),t)}onDragOver(e,t,i,n,o,r=!0){return this.dnd.onDragOver(Nhe(e),t&&t.element,i,n,o)}drop(e,t,i,n,o){this.dnd.drop(Nhe(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}function rYe(s){return s&&{...s,collapseByDefault:!0,identityProvider:s.identityProvider&&{getId(e){return s.identityProvider.getId(e.element)}},dnd:s.dnd&&new pDt(s.dnd),multipleSelectionController:s.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return s.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return s.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:s.accessibilityProvider&&{...s.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:s.accessibilityProvider.getRole?e=>s.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:s.accessibilityProvider.isChecked?e=>!!s.accessibilityProvider?.isChecked(e.element):void 0,getAriaLabel(e){return s.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return s.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:s.accessibilityProvider.getWidgetRole?()=>s.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:s.accessibilityProvider.getAriaLevel&&(e=>s.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:s.accessibilityProvider.getActiveDescendantId&&(e=>s.accessibilityProvider.getActiveDescendantId(e.element))},filter:s.filter&&{filter(e,t){return s.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:s.keyboardNavigationLabelProvider&&{...s.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof s.expandOnlyOnTwistieClick>"u"?void 0:typeof s.expandOnlyOnTwistieClick!="function"?s.expandOnlyOnTwistieClick:e=>s.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?qs.Visible:typeof s.defaultFindVisibility=="number"?s.defaultFindVisibility:typeof s.defaultFindVisibility>"u"?qs.Recurse:s.defaultFindVisibility(e.element)}}function R_e(s,e){e(s),s.children.forEach(t=>R_e(t,e))}class aYe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return M.map(this.tree.onDidChangeFocus,tWe)}get onDidChangeSelection(){return M.map(this.tree.onDidChangeSelection,tWe)}get onKeyDown(){return this.tree.onKeyDown}get onMouseClick(){return M.map(this.tree.onMouseClick,oK)}get onMouseDblClick(){return M.map(this.tree.onMouseDblClick,oK)}get onContextMenu(){return M.map(this.tree.onContextMenu,gDt)}get onTap(){return M.map(this.tree.onTap,oK)}get onPointer(){return M.map(this.tree.onPointer,oK)}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,n,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 QLe(a=>new eRe(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)?Nf.PreserveOrCollapsed:Nf.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=Mhe({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,n,o){const r=new YLe(i),a=n.map(l=>new uDt(l,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=rYe(o)||{};return new ZLe(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(n=>n.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,n){await this._updateChildren(e,t,i,void 0,n)}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(typeof this.root.element>"u")throw new Zl(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,o),i)try{this.tree.rerender(r)}catch{}}resort(e=this.root.element,t=!0){this.tree.resort(this.getDataNode(e),t)}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 Zl(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await M.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 M.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event)),n}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 hi.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(n=>this.getDataNode(n));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(n=>this.getDataNode(n));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 Zl(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,n){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,n)}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((o,r)=>{!n&&hDt(r,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n)return n;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 n;e.refreshPromise=new Promise(o=>n=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 Zs.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{n()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(hi.empty());else{const o=this.doGetChildren(e);if(vFe(o))n=Promise.resolve(o);else{const r=Sr(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=o.finally(()=>r.cancel())}}try{const o=await n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Fr(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 vFe(i)?this.processChildren(i):(t=Rr(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(vt))}setChildren(e,t,i,n){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=Mhe({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&m.defaultCollapseState===Nf.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=>R_e(v,b=>this.nodes.delete(b.element))),m.children.splice(0,m.children.length),m.stale=!0):c.push(m):h&&!f.collapsed&&c.push(m),m}const p=Mhe({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(u)>-1&&n.focus.push(p),n&&n.viewState.selection&&n.viewState.selection.indexOf(u)>-1&&n.selection.push(p),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(u)>-1||h&&p.defaultCollapseState===Nf.PreserveOrExpanded)&&c.push(p),p});for(const d of r.values())R_e(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 n=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,n,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?hi.map(e.children,n=>this.asTreeElement(n,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 Zl(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),n=[],o=this.tree.getNode(),r=[o];for(;r.length>0;){const a=r.pop();a!==o&&a.collapsible&&!a.collapsed&&n.push(e(a.element.element)),r.push(...a.children)}return{focus:t,selection:i,expanded:n,scrollTop:this.scrollTop}}dispose(){this.disposables.dispose(),this.tree.dispose()}}class tRe{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 tRe(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 mDt{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...We.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...We.asClassNameArray(ve.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=bt(this.disposables)}}function _Dt(s){const e=s&&rYe(s);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class vDt extends aYe{constructor(e,t,i,n,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new QLe(c=>new tRe(c)),this.filter=a.filter}createTree(e,t,i,n,o){const r=new YLe(i),a=n.map(l=>new mDt(l,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=_Dt(o)||{};return new oYe(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 Zl(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),n=[],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)n.push(e(c.element));r.push(...a.children)}return{focus:t,selection:i,expanded:n,scrollTop:this.scrollTop}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=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 b of v.element.elements)p.add(n(b.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,qs.Visible),n=bDt(i);if(n===qs.Recurse)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===qs.Visible})),super.processChildren(e)}}function bDt(s){return typeof s=="boolean"?s?qs.Visible:qs.Hidden:jLe(s)?S3(s.visibility):S3(s)}class wDt extends nYe{constructor(e,t,i,n,o,r={}){super(e,t,i,n,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 Zl(this.user,"Can't restore tree view state without an identity provider");if(this.input=e,!e){this.nodesByIdentity.clear(),this.model.setChildren(null,hi.empty());return}if(!t){this._refresh(e);return}const i=[],n=[],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)&&n.push(a.element)};this._refresh(e,o,r),this.setFocus(i),this.setSelection(n),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}updateChildren(e=this.input){if(typeof this.input>"u")throw new Zl(this.user,"Tree input not set");let t;this.identityProvider&&(t=i=>{const n=this.identityProvider.getId(i).toString(),o=this.nodesByIdentity.get(n);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 n;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)},n=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:n})}iterate(e,t){const i=[...this.dataSource.getChildren(e)];return{elements:hi.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 JLe(e,t,i)}}const yDt=new Q("isMac",Qt,g(4967,"Whether the operating system is macOS")),CDt=new Q("isLinux",pr,g(4968,"Whether the operating system is Linux")),S6=new Q("isWindows",Qn,g(4969,"Whether the operating system is Windows")),iRe=new Q("isWeb",Wn,g(4970,"Whether the platform is a web browser")),SDt=new Q("isMacNative",Qt&&!Wn,g(4971,"Whether the operating system is macOS on a non-browser platform")),ADt=new Q("isIOS",dm,g(4972,"Whether the operating system is iOS")),EDt=new Q("isMobile",L6e,g(4973,"Whether the platform is a mobile web browser")),iWe=new Q("isDevelopment",!1,!0),xDt=new Q("productQualityType","",g(4974,"Quality type of VS Code")),yae="inputFocus",nRe=new Q(yae,!1,g(4975,"Whether keyboard focus is inside an input box")),lg=ae("listService");class DDt{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 Nje(gl(),"").style(ON)),this.lists.some(n=>n.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),av(e.getHTMLElement())&&this.setLastFocusedList(e),jr(e.onDidFocus(()=>this.setLastFocusedList(e)),Ee(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(n=>n!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const A3=new Q("listScrollAtBoundary","none"),kDt=he.or(A3.isEqualTo("top"),A3.isEqualTo("both")),IDt=he.or(A3.isEqualTo("bottom"),A3.isEqualTo("both")),cYe=new Q("listFocus",!0),lYe=new Q("treestickyScrollFocused",!1),Cae=new Q("listSupportsMultiselect",!0),Sae=he.and(cYe,he.not(yae),lYe.negate()),sRe=new Q("listHasSelectionOrFocus",!1),oRe=new Q("listDoubleSelection",!1),rRe=new Q("listMultiSelection",!1),Aae=new Q("listSelectionNavigation",!1),TDt=new Q("listSupportsFind",!0),aRe=new Q("treeElementCanCollapse",!1),LDt=new Q("treeElementHasParent",!1),cRe=new Q("treeElementCanExpand",!1),RDt=new Q("treeElementHasChild",!1),MDt=new Q("treeFindOpen",!1),dYe="listTypeNavigationMode",hYe="listAutomaticKeyboardNavigation";function Eae(s,e){const t=s.createScoped(e.getHTMLElement());return cYe.bindTo(t),t}function xae(s,e){const t=A3.bindTo(s),i=()=>{const n=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&o?t.set("both"):n?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const HN="workbench.list.multiSelectModifier",Gq="workbench.list.openMode",sm="workbench.list.horizontalScrolling",lRe="workbench.list.defaultFindMode",dRe="workbench.list.typeNavigationMode",rJ="workbench.list.keyboardNavigation",Rb="workbench.list.scrollByPage",hRe="workbench.list.defaultFindMatchType",E3="workbench.tree.indent",aJ="workbench.tree.renderIndentGuides",Mb="workbench.list.smoothScrolling",Xy="workbench.list.mouseWheelScrollSensitivity",Zy="workbench.list.fastScrollSensitivity",cJ="workbench.tree.expandMode",lJ="workbench.tree.enableStickyScroll",dJ="workbench.tree.stickyScrollMaxItemCount";function eC(s){return s.getValue(HN)==="alt"}class NDt extends V{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=eC(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(HN)&&(this.useAltAsMultipleSelectionModifier=eC(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Lje(e)}isSelectionRangeChangeEvent(e){return Rje(e)}}function Dae(s,e){const t=s.get(Te),i=s.get(Ut),n=new Z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(Mb),mouseWheelScrollSensitivity:t.getValue(Xy),fastScrollSensitivity:t.getValue(Zy),multipleSelectionController:e.multipleSelectionController??n.add(new NDt(t)),keyboardNavigationEventFilter:ODt(i),scrollByPage:!!t.getValue(Rb)},n]}let M_e=class extends Xa{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(sm),[h,u]=l.invokeFunction(Dae,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=Eae(r,this),this.disposables.add(xae(this.contextKeyService,this)),this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=sRe.bindTo(this.contextKeyService),this.listDoubleSelection=oRe.bindTo(this.contextKeyService),this.listMultiSelection=rRe.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=eC(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(HN)&&(this._useAltAsMultipleSelectionModifier=eC(c));let m={};if(p.affectsConfiguration(sm)&&this.horizontalScrolling===void 0){const v=!!c.getValue(sm);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Rb)){const v=!!c.getValue(Rb);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Mb)){const v=!!c.getValue(Mb);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(Xy)){const v=c.getValue(Xy);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Zy)){const v=c.getValue(Zy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new uYe(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?BN(e):ON)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}};M_e=D([_(5,Le),_(6,lg),_(7,Te),_(8,we)],M_e);let nWe=class extends Cxt{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(sm),[h,u]=l.invokeFunction(Dae,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new Z,this.disposables.add(u),this.contextKeyService=Eae(r,this),this.disposables.add(xae(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=eC(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(HN)&&(this._useAltAsMultipleSelectionModifier=eC(c));let m={};if(p.affectsConfiguration(sm)&&this.horizontalScrolling===void 0){const v=!!c.getValue(sm);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Rb)){const v=!!c.getValue(Rb);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Mb)){const v=!!c.getValue(Mb);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(Xy)){const v=c.getValue(Xy);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Zy)){const v=c.getValue(Zy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new uYe(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?BN(e):ON)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};nWe=D([_(5,Le),_(6,lg),_(7,Te),_(8,we)],nWe);let sWe=class extends D_e{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!l.getValue(sm),[u,f]=d.invokeFunction(Dae,r);super(e,t,i,n,o,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=Eae(a,this),this.disposables.add(xae(this.contextKeyService,this)),this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=sRe.bindTo(this.contextKeyService),this.listDoubleSelection=oRe.bindTo(this.contextKeyService),this.listMultiSelection=rRe.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=eC(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(HN)&&(this._useAltAsMultipleSelectionModifier=eC(l));let v={};if(m.affectsConfiguration(sm)&&this.horizontalScrolling===void 0){const b=!!l.getValue(sm);v={...v,horizontalScrolling:b}}if(m.affectsConfiguration(Rb)){const b=!!l.getValue(Rb);v={...v,scrollByPage:b}}if(m.affectsConfiguration(Mb)){const b=!!l.getValue(Mb);v={...v,smoothScrolling:b}}if(m.affectsConfiguration(Xy)){const b=l.getValue(Xy);v={...v,mouseWheelScrollSensitivity:b}}if(m.affectsConfiguration(Zy)){const b=l.getValue(Zy);v={...v,fastScrollSensitivity:b}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new PDt(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?BN(e):ON)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};sWe=D([_(6,Le),_(7,lg),_(8,Te),_(9,we)],sWe);class uRe extends V{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new I),this.onDidOpen=this._onDidOpen.event,this._register(M.filter(this.widget.onDidChangeSelection,i=>d_(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(Gq)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(Gq)&&(this.openOnSingleClick=t?.configurationService.getValue(Gq)!=="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,n=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const n=t.button===1,o=!0,r=n,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,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class uYe extends uRe{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class PDt extends uRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class FDt extends uRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function ODt(s){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=s.softDispatch(t,t.target);return i.kind===nf.MoreChordsNeeded?(e=!0,!1):(e=!1,i.kind===nf.NoMatchingKb)}}let x3=class extends ZLe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(A6,o);super(e,t,i,n,d),this.disposables.add(u),this.internals=new DM(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};x3=D([_(5,we),_(6,Le),_(7,lg),_(8,Te)],x3);let oWe=class extends oYe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(A6,o);super(e,t,i,n,d),this.disposables.add(u),this.internals=new DM(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)}};oWe=D([_(5,we),_(6,Le),_(7,lg),_(8,Te)],oWe);let rWe=class extends wDt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(A6,r);super(e,t,i,n,o,h),this.disposables.add(f),this.internals=new DM(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)}};rWe=D([_(6,we),_(7,Le),_(8,lg),_(9,Te)],rWe);let N_e=class extends aYe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(A6,r);super(e,t,i,n,o,h),this.disposables.add(f),this.internals=new DM(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)}};N_e=D([_(6,we),_(7,Le),_(8,lg),_(9,Te)],N_e);let hJ=class extends vDt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d,h){const{options:u,getTypeNavigationMode:f,disposable:p}=c.invokeFunction(A6,a);super(e,t,i,n,o,r,u),this.disposables.add(p),this.internals=new DM(this,a,f,a.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};hJ=D([_(7,we),_(8,Le),_(9,lg),_(10,Te)],hJ);function gYe(s){const e=s.getValue(lRe);if(e==="highlight")return Zf.Highlight;if(e==="filter")return Zf.Filter;const t=s.getValue(rJ);if(t==="simple"||t==="highlight")return Zf.Highlight;if(t==="filter")return Zf.Filter}function fYe(s){const e=s.getValue(hRe);if(e==="fuzzy")return bb.Fuzzy;if(e==="contiguous")return bb.Contiguous}function A6(s,e){const t=s.get(Te),i=s.get(mf),n=s.get(Le),o=s.get(we),r=()=>{const u=n.getContextKeyValue(dYe);if(u==="automatic")return Gw.Automatic;if(u==="trigger"||n.getContextKeyValue(hYe)===!1)return Gw.Trigger;const p=t.getValue(dRe);if(p==="automatic")return Gw.Automatic;if(p==="trigger")return Gw.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(sm),[c,l]=o.invokeFunction(Dae,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(aJ);return{getTypeNavigationMode:r,disposable:l,options:{keyboardSupport:!1,...c,indent:typeof t.getValue(E3)=="number"?t.getValue(E3):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(Mb),defaultFindMode:gYe(t),defaultFindMatchType:fYe(t),horizontalScrolling:a,scrollByPage:!!t.getValue(Rb),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(cJ)==="doubleClick",contextViewProvider:i,findWidgetStyles:DEt,enableStickyScroll:!!t.getValue(lJ),stickyScrollMaxItemCount:Number(t.getValue(dJ))}}}let DM=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a){this.tree=e,this.disposables=[],this.contextKeyService=Eae(o,e),this.disposables.push(xae(this.contextKeyService,e)),this.listSupportsMultiSelect=Cae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Aae.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=TDt.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=sRe.bindTo(this.contextKeyService),this.hasDoubleSelection=oRe.bindTo(this.contextKeyService),this.hasMultiSelection=rRe.bindTo(this.contextKeyService),this.treeElementCanCollapse=aRe.bindTo(this.contextKeyService),this.treeElementHasParent=LDt.bindTo(this.contextKeyService),this.treeElementCanExpand=cRe.bindTo(this.contextKeyService),this.treeElementHasChild=RDt.bindTo(this.contextKeyService),this.treeFindOpen=MDt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=lYe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=eC(a),this.updateStyleOverrides(n);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(dYe),d.add(hYe),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(HN)&&(this._useAltAsMultipleSelectionModifier=eC(a)),h.affectsConfiguration(E3)){const f=a.getValue(E3);u={...u,indent:f}}if(h.affectsConfiguration(aJ)&&t.renderIndentGuides===void 0){const f=a.getValue(aJ);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(Mb)){const f=!!a.getValue(Mb);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(lRe)||h.affectsConfiguration(rJ)){const f=gYe(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(dRe)||h.affectsConfiguration(rJ)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(hRe)){const f=fYe(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(sm)&&t.horizontalScrolling===void 0){const f=!!a.getValue(sm);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(Rb)){const f=!!a.getValue(Rb);u={...u,scrollByPage:f}}if(h.affectsConfiguration(cJ)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(cJ)==="doubleClick"}),h.affectsConfiguration(lJ)){const f=a.getValue(lJ);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(dJ)){const f=Math.max(1,a.getValue(dJ));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(Xy)){const f=a.getValue(Xy);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(Zy)){const f=a.getValue(Zy);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 FDt(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?BN(e):ON)}dispose(){this.disposables=bt(this.disposables)}};DM=D([_(4,Le),_(5,lg),_(6,Te)],DM);const BDt=Qe.as(Nn.Configuration);BDt.registerConfiguration({id:"workbench",order:7,title:g(1295,"Workbench"),type:"object",properties:{[HN]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[g(1296,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(1297,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:g(1298,"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.")},[Gq]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(1299,"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.")},[sm]:{type:"boolean",default:!1,description:g(1300,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Rb]:{type:"boolean",default:!1,description:g(1301,"Controls whether clicks in the scrollbar scroll page by page.")},[E3]:{type:"number",default:8,minimum:4,maximum:40,description:g(1302,"Controls tree indentation in pixels.")},[aJ]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:g(1303,"Controls whether the tree should render indent guides.")},[Mb]:{type:"boolean",default:!1,description:g(1304,"Controls whether lists and trees have smooth scrolling.")},[Xy]:{type:"number",default:1,markdownDescription:g(1305,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Zy]:{type:"number",default:5,markdownDescription:g(1306,"Scrolling speed multiplier when pressing `Alt`.")},[lRe]:{type:"string",enum:["highlight","filter"],enumDescriptions:[g(1307,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),g(1308,"Filter elements when searching.")],default:"highlight",description:g(1309,"Controls the default find mode for lists and trees in the workbench.")},[rJ]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[g(1310,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),g(1311,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),g(1312,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:g(1313,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:g(1314,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[hRe]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[g(1315,"Use fuzzy matching when searching."),g(1316,"Use contiguous matching when searching.")],default:"fuzzy",description:g(1317,"Controls the type of matching used when searching lists and trees in the workbench.")},[cJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(1318,"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.")},[lJ]:{type:"boolean",default:!0,description:g(1319,"Controls whether sticky scrolling is enabled in trees.")},[dJ]:{type:"number",minimum:1,default:7,markdownDescription:g(1320,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[dRe]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:g(1321,"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 WDt=".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}";ut(WDt,{});class rD extends V{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=t?.supportIcons??!1,this.domNode=re(e,fe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=rD.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Ys(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{n=o===`\r -`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class _4{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 D3 extends V{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new _4(re(e,fe(".monaco-icon-label")))),this.labelContainer=re(this.domNode.element,fe(".monaco-icon-label-container")),this.nameContainer=re(this.labelContainer,fe("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new VDt(this.nameContainer,!!t.supportIcons)):this.nameNode=new HDt(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??Pr("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.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||!Yr(a)?(c=fe(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,c.style.backgroundImage=Zu(i?.iconPath)}else a&&a.remove();if(this.domNode.className=n.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 rD?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(c.element,i?.descriptionTitle)):(c.textContent=t&&i?.labelEscapeNewLines?rD.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){Lt(r)?o.title=dae(r):r?.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const n=Sm().setupManagedHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new _4(QGe(this.nameContainer,fe("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new _4(re(e.element,fe("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new _4(re(this.labelContainer,fe("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new rD(re(e.element,fe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new _4(re(e.element,fe("span.label-description"))))}return this.descriptionNode}}class HDt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Ys(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=re(this.container,fe("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+n.length},r=t.map(a=>Md.intersect(o,a)).filter(a=>!Md.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=o.end+e.length,r})}class VDt extends V{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&&Ys(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 rD(re(this.container,fe("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||"/",n=UDt(e,i,t?.matches);for(let o=0;o{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}}),MU=new ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),gRe=new ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function mYe(s,e,t=!1){const i=s||"",n=e||"",o=aWe.value.collator.compare(i,n);return aWe.value.collatorIsNumeric&&o===0&&i!==n?in.length)return 1}return 0}class tkt extends IU{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this.observers)for(const t of this._deltas)e.handleChange(this,t);this._deltas.length=0}else for(const e of this.observers)e.handleChange(this,void 0)}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this.observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this.observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this.observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new TU(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),i!==void 0&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(o,r)=>{},handlePossibleChange:o=>{}},this),this._updateCounter>1)for(const o of this.observers)o.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function fJ(s,e){return s.lazy?new tkt(new Yd(s.owner,s.debugName,void 0),e,s.equalsFn??_p):new zLe(new Yd(s.owner,s.debugName,void 0),e,s.equalsFn??_p)}var P_e;const vv=fe;class bYe{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new ya(()=>{const n=i.label??"",o=lF(n).text.trim(),r=i.ariaLabel||[n,this.saneDescription,this.saneDetail].map(a=>UQe(a)).filter(a=>!!a).join(", ");return{saneLabel:n,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 vl extends bYe{constructor(e,t,i,n,o,r){super(e,t,o),this.fireButtonTriggered=i,this._onChecked=n,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?M.map(M.filter(this._onChecked.event,a=>a.element===this),a=>a.checked):M.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 kw;(function(s){s[s.NONE=0]="NONE",s[s.MOUSE_HOVER=1]="MOUSE_HOVER",s[s.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(kw||(kw={}));class r0 extends bYe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=kw.NONE}}class ikt{getHeight(e){return e instanceof r0?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof vl?pJ.ID:mJ.ID}}class nkt{getWidgetAriaLabel(){return g(9964,"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 vl)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class wYe{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Z,t.toDisposeTemplate=new Z,t.entry=re(e,vv(".quick-input-list-entry"));const i=re(t.entry,vv("label.quick-input-list-label"));t.toDisposeTemplate.add(Ro(i,ke.CLICK,l=>{t.checkbox.offsetParent||l.preventDefault()})),t.checkbox=re(i,vv("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const n=re(i,vv(".quick-input-list-rows")),o=re(n,vv(".quick-input-list-row")),r=re(n,vv(".quick-input-list-row"));t.label=new D3(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Ore(t.label.element,vv(".quick-input-list-icon"));const a=re(o,vv(".quick-input-list-entry-keybinding"));t.keybinding=new qk(a,po),t.toDisposeTemplate.add(t.keybinding);const c=re(r,vv(".quick-input-list-label-meta"));return t.detail=new D3(c,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=re(t.entry,vv(".quick-input-list-separator")),t.actionBar=new hd(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 uL;let pJ=(uL=class extends wYe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return P_e.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Ro(t.checkbox,ke.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0;const o=n.item;i.checkbox.checked=n.checked,i.toDisposeElement.add(n.onChecked(u=>i.checkbox.checked=u)),i.checkbox.disabled=n.checkboxDisabled;const{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=n;if(o.iconPath){const u=Jre(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,f=N.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Zu(f)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:n.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:n.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(n.saneLabel,n.saneDescription,d),i.keybinding.set(o.keybinding),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:n.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";n.separator?.label?(i.separator.textContent=n.separator.label,i.separator.style.display="",this.addItemWithSeparator(n)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!n.separator);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>E5(u,`id-${f}`,()=>n.fireButtonTriggered({button:u,item:n.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)}},P_e=uL,uL.ID="quickpickitem",uL);pJ=P_e=D([_(1,pn)],pJ);const fse=class fse extends wYe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return fse.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0,n.element.classList.toggle("focus-inside",!!n.focusInsideSeparator);const o=n.separator,{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=n;i.icon.style.backgroundImage="",i.icon.className="";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:n.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:n.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(n.saneLabel,n.saneDescription,d),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:n.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.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)=>E5(u,`id-${f}`,()=>n.fireSeparatorButtonTriggered({button:u,separator:n.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(n)}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)}};fse.ID="quickpickseparator";let mJ=fse,kM=class extends V{constructor(e,t,i,n,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._visibleCountObservable=jt("VisibleCount",0),this.onChangedVisibleCount=M.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=jt("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=M.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=jt("CheckedCount",0),this.onChangedCheckedCount=M.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=fJ({equalsFn:is},new Array),this.onChangedCheckedElements=M.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new I,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new I,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new I,this._elementCheckedEventBufferer=new F7,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Z),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._matchOnMeta=!0,this._sortByLabel=!0,this._shouldLoop=!0,this._container=re(this.parent,vv(".quick-input-list")),this._separatorRenderer=new mJ(t),this._itemRenderer=o.createInstance(pJ,t),this._tree=this._register(o.createInstance(x3,"QuickInput",this._container,new ikt,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new nkt,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:sW.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return M.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof vl).map(t=>t.item),this._store)}get onDidChangeSelection(){return M.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof vl).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}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._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new En(e);switch(t.keyCode){case S.Space:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(ue(this._container,ke.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(ue(this._container,ke.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new Y7(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(XFe(t.browserEvent.target)){e.cancel();return}if(!(!XFe(t.browserEvent.relatedTarget)&&wc(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof vl&&this.showHover(t.element)})}catch(i){if(!Fr(i))throw i}})),this._register(this._tree.onMouseOut(t=>{wc(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 n=i===t;!!(i.focusInsideSeparator&kw.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=kw.ACTIVE_ITEM:i.focusInsideSeparator&=~kw.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&kw.MOUSE_HOVER)||(i.focusInsideSeparator|=kw.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&kw.MOUSE_HOVER)&&(i.focusInsideSeparator&=~kw.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof vl);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof r0&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,n,o)=>{let r;if(n.type==="separator"){if(!n.buttons)return i;t=new r0(o,a=>this._onSeparatorButtonTriggered.fire(a),n),r=t}else{const a=o>0?e[o-1]:void 0;let c;a&&a.type==="separator"&&!a.buttons&&(t=void 0,c=a);const l=new vl(o,this._hasCheckboxes,d=>this._onButtonTriggered.fire(d),this._elementChecked,n,c);if(this._itemElements.push(l),t)return t.children.push(l),i;r=l}return i.push(r),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),n=i?.parentNode;if(i&&n){const o=i.nextSibling;i.remove(),n.insertBefore(i,o)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i).filter(i=>!i.hidden);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")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}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 vl);break;case wo.Second:{this._tree.scrollTop=0;let t=!1;this._tree.focusFirst(void 0,i=>i.element instanceof vl?t?!0:(t=!t,!1):!1);break}case wo.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,t=>t.element instanceof vl);break;case wo.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,n=>n.element instanceof vl?(this._tree.reveal(n.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,n=>{if(!(n.element instanceof vl))return!1;const o=this._tree.getParentElement(n.element);return o===null||o.children[0]!==n.element?this._tree.reveal(n.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 vl?(this._tree.reveal(t.element),!0):!1);break;case wo.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof vl))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 r0)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 vl){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 n=this._tree.getFocus()[0];i===n&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,o=>o.element instanceof vl));break}case wo.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,n=>{if(n.element instanceof r0)i?t||(this._separatorRenderer.isSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element.children[0]):i=!0;else if(n.element instanceof vl&&!t){if(n.element.separator)this._itemRenderer.isItemWithSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element;else if(n.element===this._elementTree[0])return this._tree.reveal(n.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(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const a=r.index&&this._inputElements[r.index-1];r.item&&(r.separator=a&&a.type==="separator"&&!a.buttons?a:void 0)});else{let r;this._elementTree.forEach(a=>{let c;this.matchOnLabelMode==="fuzzy"?c=this.matchOnLabel?Mq(e,lF(a.saneLabel))??void 0:void 0:c=this.matchOnLabel?skt(t,lF(a.saneLabel))??void 0:void 0;const l=this.matchOnDescription?Mq(e,lF(a.saneDescription||""))??void 0:void 0,d=this.matchOnDetail?Mq(e,lF(a.saneDetail||""))??void 0:void 0;if(c||l||d?(a.labelHighlights=c,a.descriptionHighlights=l,a.detailHighlights=d,a.hidden=!1):(a.labelHighlights=void 0,a.descriptionHighlights=void 0,a.detailHighlights=void 0,a.hidden=a.item?!a.item.alwaysShow:!0),a.item?a.separator=void 0:a.separator&&(a.hidden=!0),!this.sortByLabel){const h=a.index&&this._inputElements[a.index-1];r=h&&h.type==="separator"?h:r,r&&!a.hidden&&(a.separator=r,r=void 0)}})}const i=this._elementTree.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();i.sort((a,c)=>okt(a,c,r))}let n;const o=i.reduce((r,a,c)=>(a instanceof vl?n?n.children.push(a):r.push(a):a instanceof r0&&(a.children=[],n=a,r.push(a)),r),new Array);return this._setElementsToTree(o),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof vl),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof vl))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 vl&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof r0?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(n=>({element:n,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;it.checked).length;this._checkedCountObservable.set(e,void 0),this._checkedElementsObservable.set(this.getCheckedElements(),void 0)}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:t=>{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:vo.RIGHT}},!1))}};kM.__decorator=D([Zt],kM.prototype,"onDidChangeFocus",null);kM.__decorator=D([Zt],kM.prototype,"onDidChangeSelection",null);kM=D([_(4,we),_(5,mr)],kM);function skt(s,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return cWe(s,t);const n=pU(t," "),o=t.length-n.length,r=cWe(s,n);if(r)for(const a of r){const c=i[a.start+o]+o;a.start+=c,a.end+=c}return r}function cWe(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t!==-1?[{start:t,end:t+s.length}]:null}function okt(s,e,t){const i=s.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:qq(s.saneSortLabel,e.saneSortLabel,t)}const yYe={weight:Ae.WorkbenchContrib,when:he.and(he.equals(jje,tW.QuickPick),qEt),metadata:{description:g(9965,"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 Pg(s,e={}){So.registerCommandAndKeybindingRule({...yYe,...s,secondary:rkt(s.primary,s.secondary??[],e)})}const _J=Qt?U.WinCtrl:U.CtrlCmd;function rkt(s,e,t={}){return t.withAltMod&&e.push(U.Alt+s),t.withCtrlMod&&(e.push(_J+s),t.withAltMod&&e.push(U.Alt+_J+s)),t.withCmdMod&&Qt&&(e.push(U.CtrlCmd+s),t.withCtrlMod&&e.push(U.CtrlCmd+U.WinCtrl+s),t.withAltMod&&(e.push(U.CtrlCmd+U.Alt+s),t.withCtrlMod&&e.push(U.CtrlCmd+U.Alt+U.WinCtrl+s))),e}function Pf(s,e){return t=>{const i=t.get(In).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(s)}}Pg({id:"quickInput.pageNext",primary:S.PageDown,handler:Pf(wo.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Pg({id:"quickInput.pagePrevious",primary:S.PageUp,handler:Pf(wo.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Pg({id:"quickInput.first",primary:_J+S.Home,handler:Pf(wo.First)},{withAltMod:!0,withCmdMod:!0});Pg({id:"quickInput.last",primary:_J+S.End,handler:Pf(wo.Last)},{withAltMod:!0,withCmdMod:!0});Pg({id:"quickInput.next",primary:S.DownArrow,handler:Pf(wo.Next)},{withCtrlMod:!0});Pg({id:"quickInput.previous",primary:S.UpArrow,handler:Pf(wo.Previous)},{withCtrlMod:!0});const lWe=g(9966,"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."),dWe=g(9967,"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.");Qt?(Pg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.DownArrow,handler:Pf(wo.NextSeparator,wo.Next),metadata:{description:lWe}}),Pg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.DownArrow],handler:Pf(wo.NextSeparator)},{withCtrlMod:!0}),Pg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.UpArrow,handler:Pf(wo.PreviousSeparator,wo.Previous),metadata:{description:dWe}}),Pg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.UpArrow],handler:Pf(wo.PreviousSeparator)},{withCtrlMod:!0})):(Pg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.Alt+S.DownArrow,handler:Pf(wo.NextSeparator,wo.Next),metadata:{description:lWe}}),Pg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,handler:Pf(wo.NextSeparator)}),Pg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.Alt+S.UpArrow,handler:Pf(wo.PreviousSeparator,wo.Previous),metadata:{description:dWe}}),Pg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,handler:Pf(wo.PreviousSeparator)}));Pg({id:"quickInput.acceptInBackground",when:he.and(yYe.when,he.or(nRe.negate(),YEt)),primary:S.RightArrow,weight:Ae.WorkbenchContrib+50,handler:s=>{s.get(In).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var F_e;const mg=fe;var gL;let O_e=(gL=class extends V{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=n,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=KEt.bindTo(this.contextKeyService),this.quickInputTypeContext=QEt.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=jEt.bindTo(this.contextKeyService),this.backButton=iJ,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(M.runAndSubscribe(tm,({window:o,disposables:r})=>this.registerKeyModsListeners(o,r),{window:si,disposables:this._store})),this._register(ddt(o=>{this.ui&&ct(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=n=>{this.keyMods.ctrlCmd=n.ctrlKey||n.metaKey,this.keyMods.alt=n.altKey};for(const n of[ke.KEY_DOWN,ke.KEY_UP,ke.MOUSE_DOWN])t.add(ue(e,n,i,!0))}getUI(e){if(this.ui)return e&&ct(this._container)!==ct(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=re(this._container,mg(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=gl(t),n=re(t,mg(".quick-input-titlebar")),o=this._register(new hd(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=re(n,mg(".quick-input-title")),a=this._register(new hd(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const c=re(t,mg(".quick-input-header")),l=re(c,mg("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",g(5279,"Toggle all checkboxes")),this._register(Ro(l,ke.CHANGE,ne=>{const ge=l.checked;Y.setAllVisibleChecked(ge)})),this._register(ue(l,ke.CLICK,ne=>{(ne.x||ne.y)&&f.setFocus()}));const d=re(c,mg(".quick-input-description")),h=re(c,mg(".quick-input-and-message")),u=re(h,mg(".quick-input-filter")),f=this._register(new vxt(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=re(u,mg(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new x_e(p,{countFormat:g(5280,"{0} Results")},this.styles.countBadge),v=re(u,mg(".quick-input-count"));v.setAttribute("aria-live","polite");const b=new x_e(v,{countFormat:g(5281,"{0} Selected")},this.styles.countBadge),w=this._register(new hd(c,{hoverDelegate:this.options.hoverDelegate}));w.domNode.classList.add("quick-input-inline-action-bar");const y=re(c,mg(".quick-input-action")),C=this._register(new Jd(y,this.styles.button));C.label=g(5282,"OK"),this._register(C.onDidClick(ne=>{this.onDidAcceptEmitter.fire()}));const A=re(c,mg(".quick-input-action")),L=this._register(new Jd(A,{...this.styles.button,supportIcons:!0}));L.label=g(5283,"Custom"),this._register(L.onDidClick(ne=>{this.onDidCustomEmitter.fire()}));const k=re(h,mg(`#${this.idPrefix}message.quick-input-message`)),P=this._register(new nJ(t,this.styles.progressBar));P.getContainer().classList.add("quick-input-progress");const R=re(t,mg(".quick-input-html-widget"));R.tabIndex=-1;const z=re(t,mg(".quick-input-description")),G=this.idPrefix+"list",Y=this._register(this.instantiationService.createInstance(kM,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,G));f.setAttribute("aria-controls",G),this._register(Y.onDidChangeFocus(()=>{f.setAttribute("aria-activedescendant",Y.getActiveDescendant()??"")})),this._register(Y.onChangedAllVisibleChecked(ne=>{l.checked=ne})),this._register(Y.onChangedVisibleCount(ne=>{m.setCount(ne)})),this._register(Y.onChangedCheckedCount(ne=>{b.setCount(ne)})),this._register(Y.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof uF&&this.controller.canSelectMany&&Y.clearFocus())},0)}));const j=Ac(t);return this._register(j),this._register(ue(t,ke.FOCUS,ne=>{const ge=this.getUI();if(wc(ne.relatedTarget,ge.inputContainer)){const De=ge.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==De&&this.endOfQuickInputBoxContext.set(De)}wc(ne.relatedTarget,ge.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Yr(ne.relatedTarget)?ne.relatedTarget:void 0)},!0)),this._register(j.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(eW.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(ne=>{const ge=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==ge&&this.endOfQuickInputBoxContext.set(ge)})),this._register(ue(t,ke.FOCUS,ne=>{f.setFocus()})),this._register(Ro(t,ke.KEY_DOWN,ne=>{if(!wc(ne.target,R))switch(ne.keyCode){case S.Enter:en.stop(ne,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case S.Escape:en.stop(ne,!0),this.hide(eW.Gesture);break;case S.Tab:if(!ne.altKey&&!ne.ctrlKey&&!ne.metaKey){const ge=[".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")?ge.push("input"):ge.push("input[type=text]"),this.getUI().list.displayed&&ge.push(".monaco-list"),this.getUI().message&&ge.push(".quick-input-message a"),this.getUI().widget){if(wc(ne.target,this.getUI().widget))break;ge.push(".quick-input-html-widget")}const De=t.querySelectorAll(ge.join(", "));ne.shiftKey&&ne.target===De[0]?(en.stop(ne,!0),Y.clearFocus()):!ne.shiftKey&&wc(ne.target,De[De.length-1])&&(en.stop(ne,!0),De[0].focus())}break;case S.Space:ne.ctrlKey&&(en.stop(ne,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:n,title:r,description1:z,description2:d,widget:R,rightActionBar:a,inlineActionBar:w,checkAll:l,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:p,visibleCount:m,countContainer:v,count:b,okContainer:y,ok:C,message:k,customButtonContainer:A,customButton:L,list:Y,progressBar:P,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:ne=>this.show(ne),hide:()=>this.hide(),setVisibilities:ne=>this.setVisibilities(ne),setEnabled:ne=>this.setEnabled(ne),setContextKey:ne=>this.options.setContextKey(ne),linkOpenerDelegate:ne=>this.options.linkOpenerDelegate(ne)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,re(this._container,this.ui.container))}pick(e,t={},i=He.None){return new Promise((n,o)=>{let r=d=>{r=n,t.onKeyMods?.(a.keyMods),n(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(()=>{bt(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&&Lt(t)?(e.severity=Xe.Error,e.validationMessage=t):t&&!Lt(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Xe.Ignore,e.validationMessage=void 0)}input(e={},t=He.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const n=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=M.debounce(n.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",c=Promise.resolve(o(a));const l=[n,r(d=>{d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{d===a&&this.setValidationOnInput(n,h)})}),n.onDidAccept(()=>{const d=n.value;d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{!h||!Lt(h)&&h.severity!==Xe.Error?(i(d),n.hide()):d===a&&this.setValidationOnInput(n,h)})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{bt(l),i(void 0)})];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()})}createQuickPick(){const e=this.getUI(!0);return new uF(e)}createInputBox(){const e=this.getUI(!0);return new JEt(e)}createQuickWidget(){const e=this.getUI(!0);return new XEt(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="",aa(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Xe.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),aa(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 n=this.options.backKeybindingLabel();iJ.tooltip=n?g(5284,"Back ({0})",n):g(5285,"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.displayed=!!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,n=i&&!lTe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){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 uF&&this.controller.canSelectMany&&this.getUI().list.toggleCheckbox()}navigate(e,t){this.isVisible()&&this.getUI().list.displayed&&(this.getUI().list.focus(e?wo.Next:wo.Previous),t&&this.controller instanceof uF&&(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,F_e.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:n,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=n?`1px solid ${n}`:"",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)}}},F_e=gL,gL.MAX_WIDTH=600,gL);O_e=F_e=D([_(1,pu),_(2,we),_(3,Le)],O_e);let vJ=class extends jTe{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(S_e))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,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(Ao).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(E_e))},n=this._register(this.instantiationService.createInstance(O_e,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{ct(e.activeContainer)===ct(n.container)&&n.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Q(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=He.None){return this.controller.pick(e,t,i)}input(e={},t=He.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:ze(YOe),quickInputForeground:ze(Ipt),quickInputTitleBackground:ze(Tpt),widgetBorder:ze(H2),widgetShadow:ze(CI)},inputBox:EM,toggle:JY,countBadge:Uje,button:y6,progressBar:Hje,keybindingLabel:l_e,list:BN({listBackground:YOe,listFocusBackground:q8,listFocusForeground:K8,listInactiveFocusForeground:K8,listInactiveSelectionIconForeground:FTe,listInactiveFocusBackground:q8,listFocusOutline:Js,listInactiveFocusOutline:Js}),pickerGroup:{pickerGroupBorder:ze(Lpt),pickerGroupForeground:ze(dqe)}}}};vJ=D([_(0,we),_(1,Le),_(2,pn),_(3,pu),_(4,Te)],vJ);let B_e=class extends vJ{constructor(e,t,i,n,o,r){super(t,i,n,new kme(e.getContainerDomNode(),o),r),this.host=void 0;const a=I3.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 M.map(e.onDidLayoutChange,l=>({container:c.getDomNode(),dimension:l}))},get onDidChangeActiveContainer(){return M.None},get onDidAddContainer(){return M.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)}};B_e=D([_(1,we),_(2,Le),_(3,pn),_(4,Kt),_(5,Te)],B_e);let k3=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(B_e,e);this.mapEditorToService.set(e,t),hm(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=He.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()}};k3=D([_(0,we),_(1,Kt)],k3);const pse=class pse{static get(e){return e.getContribution(pse.ID)}constructor(e){this.editor=e,this.widget=new W_e(this.editor)}dispose(){this.widget.dispose()}};pse.ID="editor.controller.quickInput";let I3=pse;const mse=class mse{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return mse.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Wg.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};mse.ID="editor.contrib.quickInputWidget";let W_e=mse;on(I3.ID,I3,ri.Lazy);class akt{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function ckt(s){if(!s||!Array.isArray(s))return[];const e=[];let t=0;for(let i=0,n=s.length;i{const u=fkt(d.token,h.token);return u!==0?u:d.index-h.index});let t=Vo.None,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){const d=s.shift();d.fontStyle!==Vo.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const o=new hkt;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(n),c=new fRe(t,r,a),l=new pRe(c);for(let d=0,h=s.length;d"u"){const n=this._match(t),o=gkt(t);i=(n.metadata|o<>>0,this._cache.set(t,i)}return(i|e<>>0}}const ukt=/\b(comment|string|regex|regexp)\b/;function gkt(s){const e=s.match(ukt);if(!e)return nr.Other;switch(e[1]){case"comment":return nr.Comment;case"string":return nr.String;case"regex":return nr.RegEx;case"regexp":return nr.RegEx}throw new Error("Unexpected match for standard token type!")}function fkt(s,e){return se?1:0}class fRe{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 fRe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==Vo.NotSet&&(this._fontStyle=e),t!==Tl.None&&(this._foreground=t),i!==Tl.None&&(this._background=i),this.metadata=(this._fontStyle<>>0}}class pkt{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 pRe{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 pkt(this._mainRule,e)}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,n;t===-1?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);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 pRe(this._mainRule.clone()),this._children.set(r,c)),c.insert(a,t,i,n)}}function mkt(s){const e=[];for(let t=1,i=s.length;t({format:n.format,location:n.location.toString()}))}}s.toJSONObject=e;function t(i){const n=o=>Lt(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Lt(o.format)&&Lt(o.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(o=>({format:o.format,location:N.parse(o.location)}))}}s.fromJSONObject=t})(hWe||(hWe={}));class ykt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:g(4497,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:g(4498,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${We.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){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:n};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return n&&(a.deprecationMessage=n),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(;We.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 n=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of n.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${We.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(r=>!We.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` -`)}}const NU=new ykt;Qe.add(SYe.IconContribution,NU);function oi(s,e,t,i){return NU.registerIcon(s,e,t,i)}function mRe(){return NU}function Ckt(){const s=fGe();for(const e in s){const t="\\"+s[e].toString(16);NU.registerIcon(e,{fontCharacter:t})}}Ckt();const AYe="vscode://schemas/icons",EYe=Qe.as(YA.JSONContribution);EYe.registerSchema(AYe,NU.getIconSchema());const uWe=new cn(()=>EYe.notifySchemaChanged(AYe),200);NU.onDidChange(()=>{uWe.isScheduled()||uWe.schedule()});const xYe=oi("widget-close",ve.close,g(4499,"Icon for the close action in widgets.")),Skt=oi("goto-previous-location",ve.arrowUp,g(4500,"Icon for goto previous editor location.")),Akt=oi("goto-next-location",ve.arrowDown,g(4501,"Icon for goto next editor location."));We.modify(ve.sync,"spin");We.modify(ve.loading,"spin");function Ekt(s){const e=new Z,t=e.add(new I),i=mRe();return e.add(i.onDidChange(()=>t.fire())),s&&e.add(s.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=s?s.getProductIconTheme():new DYe,o={},r=[],a=[];for(const c of i.getIcons()){const l=n.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}: ${mq(d.id)};`,`${u}: '${l.fontCharacter}';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; font-family: ${mq(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=>`${Zu(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${mq(c)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` -`)}}}class DYe{getIcon(e){const t=mRe();let i=e.defaults;for(;We.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const ex="vs",D5="vs-dark",KO="hc-black",qO="hc-light",kYe=Qe.as(kTe.ColorContribution),xkt=Qe.as(Sqe.ThemingContribution);class IYe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Qq(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,me.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=H_e(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,me.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=kYe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case ex:return Jg.LIGHT;case KO:return Jg.HIGH_CONTRAST_DARK;case qO:return Jg.HIGH_CONTRAST_LIGHT;default:return Jg.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=H_e(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=CYe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Kv.getForeground(o),a=Kv.getFontStyle(o);return{foreground:r,italic:!!(a&Vo.Italic),bold:!!(a&Vo.Bold),underline:!!(a&Vo.Underline),strikethrough:!!(a&Vo.Strikethrough)}}get tokenColorMap(){return[]}}function Qq(s){return s===ex||s===D5||s===KO||s===qO}function H_e(s){switch(s){case ex:return _kt;case D5:return vkt;case KO:return bkt;case qO:return wkt}}function aK(s){const e=H_e(s);return new IYe(s,e)}class Dkt extends V{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 DYe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(ex,aK(ex)),this._knownThemes.set(D5,aK(D5)),this._knownThemes.set(KO,aK(KO)),this._knownThemes.set(qO,aK(qO));const e=this._register(Ekt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(ex),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Bj(si,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return k8(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=gl(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),V.None}_registerShadowDomContainer(e){const t=gl(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(ex),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=si.matchMedia("(forced-colors: active)").matches;if(e!==Ry(this._theme.type)){let t;Jre(this._theme.type)?t=e?KO:D5:t=e?qO:ex,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)}};xkt.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of kYe.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${Vre(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` -`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(mkt(o)),this._themeCSS=e.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()}};lse.InstanceCount=0;let y_e=lse;var qs;(function(s){s[s.Hidden=0]="Hidden",s[s.Visible=1]="Visible",s[s.Recurse=2]="Recurse"})(qs||(qs={}));var Lf;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Lf||(Lf={}));var k1;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(k1||(k1={}));var I1;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(I1||(I1={}));class Jl extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class FLe{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 OLe(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function w3(s){switch(s){case!0:return qs.Visible;case!1:return qs.Hidden;default:return s}}function She(s){return typeof s.collapsible=="boolean"}class Ext{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new R7,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 Lh(wGe),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=n.allowNonCollapsibleParents??!1,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:qs.Visible,visible:!0,filterData:void 0}}splice(e,t,i=hi.empty(),n={}){if(e.length===0)throw new Jl(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=hi.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const c=[...n],l=t[t.length-1],d=new Ww({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,b)=>{if(r>0)for(let w=0;wb.originalStart-v.originalStart))u(f,p,f-(m.originalStart+m.originalLength)),f=m.originalStart,p=m.modifiedStart-l,this.spliceSimple([...h,f],m.originalLength,hi.slice(c,p,p+m.modifiedLength),o);u(f,p,f)}spliceSimple(e,t,i=hi.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:c,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=hi.map(i,A=>this.createTreeNode(A,a,a.visible?qs.Visible:qs.Hidden,l,h,n)),f=e[e.length-1];let p=0;for(let A=f;A>=0&&Ar.getId(A.element).toString())):a.lastDiffIds=a.children.map(A=>r.getId(A.element).toString()):a.lastDiffIds=void 0;let y=0;for(const A of w)A.visible&&y++;if(y!==0)for(let A=f+m.length;AL+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-A),this.list.splice(c,A,h)}if(w.length>0&&o){const A=L=>{o(L),L.children.forEach(A)};w.forEach(A)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:w});let C=a;for(;C;){if(C.visibility===qs.Recurse){this.refilterDelayer.trigger(()=>this.refilter());break}C=C.parent}}rerender(e){if(e.length===0)throw new Jl(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}updateElementHeight(e,t){if(e.length===0)throw new Jl(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:n}=this.getTreeNodeWithListIndex(e);return i&&n?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 n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!She(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,n){const o=this._setNodeCollapseState(e,n,!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 n;if(e===this.root?n=!1:(She(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!She(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}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,n,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:qs.Visible,visible:!0,filterData:void 0},c=this._filterNode(a,i);a.visibility=c,n&&o.push(a);const l=e.children||hi.empty(),d=n&&c!==qs.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===qs.Recurse?h>0:c===qs.Visible,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,n&&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?qs.Visible:qs.Hidden,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===qs.Hidden)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==qs.Hidden){let c=0;for(const l of e.children)a=this._updateNodeAfterFilterChange(l,o,i,n&&!e.collapsed)||a,l.visible&&(l.visibleChildIndex=c++);e.visibleChildrenCount=c}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===qs.Recurse?a:o===qs.Visible,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&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):qs.Visible;return typeof i=="boolean"?(e.filterData=void 0,i?qs.Visible:qs.Hidden):OLe(i)?(e.filterData=i.data,w3(i.visibility)):(e.filterData=void 0,w3(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...n]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Jl(this.user,"Invalid tree location");return this.getTreeNode(n,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:n,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Jl(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Jl(this.user,"Invalid tree location");for(let c=0;ct.element)),this.data=e}}function Ahe(s){return s instanceof u6?new Dxt(s):s}class kxt{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=V.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?.(Ahe(e),t)}onDragOver(e,t,i,n,o,r=!0){const a=this.dnd.onDragOver(Ahe(e),t&&t.element,i,n,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=Ky(()=>{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===I1.Up){const f=this.modelProvider(),p=f.getNodeLocation(t),m=f.getParentNodeLocation(p),v=f.getNode(m),b=m&&f.getListIndex(m);return this.onDragOver(e,v,b,n,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),h=l.getListIndex(d),u=l.getListRenderCount(d);return{...a,feedback:Su(h,h+u)}}drop(e,t,i,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(Ahe(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function Ixt(s,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new kxt(s,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=s(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);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 BLe{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 S5{static lift(e){return e instanceof S5?e:new S5(e)}static empty(e=0){return new S5({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 eW;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(eW||(eW={}));class Txt{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new Z,this.onDidChange=M.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const Oz=class Oz{constructor(e,t,i,n,o,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Oz.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=V.None,this.disposables=new Z,this.templateId=e.templateId,this.updateOptions(r),M.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=Ka(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,n]of this.renderedNodes)this.renderTreeElement(i,n)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==eW.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,n]of this.renderedNodes)this._renderIndentGuides(i,n);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=re(e,fe(".monaco-tl-row")),i=re(t,fe(".monaco-tl-indent")),n=re(t,fe(".monaco-tl-twistie")),o=re(t,fe(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:V.None,templateData:r}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,n),typeof n=="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=Oz.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(...We.asClassNameArray(ve.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...We.asClassNameArray(ve.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(Ms(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Z,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),r=n.getParentNodeLocation(o);if(!r)break;const a=n.getNode(r),c=fe(".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(n=>{const o=i.getNodeLocation(n);try{const r=i.getParentNodeLocation(o);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),bt(this.disposables)}};Oz.DefaultIndent=8;let C_e=Oz;class Lxt{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=qs.Visible;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?qs.Visible:qs.Hidden:OLe(r)?i=w3(r.visibility):i=r,i===qs.Hidden)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:L_.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:L_.Default,visibility:i};let c;if(this.tree.findMatchType===mb.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=Fk(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===Yf.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):qs.Recurse:{data:L_.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){bt(this.disposables)}}class Rxt extends JA{constructor(e){super({icon:ve.listFilter,title:g(4961,"Filter"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Mxt extends JA{constructor(e){super({icon:ve.searchFuzzy,title:g(4962,"Fuzzy Match"),isChecked:e.isChecked??!1,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const Nxt={inputBoxStyles:nxt,toggleStyles:Bje,listFilterWidgetBackground:void 0,listFilterWidgetNoMatchesOutline:void 0,listFilterWidgetOutline:void 0,listFilterWidgetShadow:void 0};var Yf;(function(s){s[s.Highlight=0]="Highlight",s[s.Filter=1]="Filter"})(Yf||(Yf={}));var mb;(function(s){s[s.Fuzzy=0]="Fuzzy",s[s.Contiguous=1]="Contiguous"})(mb||(mb={}));let Pxt=class extends V{set mode(e){this.modeToggle.checked=e===Yf.Filter,this.findInput.inputBox.setPlaceHolder(e===Yf.Filter?g(4963,"Type to filter"):g(4964,"Type to search"))}set matchType(e){this.matchTypeToggle.checked=e===mb.Fuzzy}get value(){return this.findInput.inputBox.value}set value(e){this.findInput.inputBox.value=e}constructor(e,t,i,n,o,r){super(),this.tree=t,this.elements=Bt(".monaco-tree-type-filter",[Bt(".monaco-tree-type-filter-grab.codicon.codicon-debug-gripper@grab",{tabIndex:0}),Bt(".monaco-tree-type-filter-input@findInput"),Bt(".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(()=>this.elements.root.remove()));const a=r?.styles??Nxt;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(Wk());this.modeToggle=this._register(new Rxt({...a.toggleStyles,isChecked:n===Yf.Filter,hoverDelegate:c})),this.matchTypeToggle=this._register(new Mxt({...a.toggleStyles,isChecked:o===mb.Fuzzy,hoverDelegate:c})),this.onDidChangeMode=M.map(this.modeToggle.onChange,()=>this.modeToggle.checked?Yf.Filter:Yf.Highlight,this._store),this.onDidChangeMatchType=M.map(this.matchTypeToggle.onChange,()=>this.matchTypeToggle.checked?mb.Fuzzy:mb.Contiguous,this._store),this.findInput=this._register(new m3(this.elements.findInput,i,{label:g(4964,"Type to search"),additionalToggles:[this.modeToggle,this.matchTypeToggle],showCommonFindToggles:!1,inputBoxStyles:a.inputBoxStyles,toggleStyles:a.toggleStyles,history:r?.history})),this.actionbar=this._register(new ld(this.elements.actionbar)),this.mode=n;const l=this._register(new ii(this.findInput.inputBox.inputElement,"keydown")),d=M.chain(l.event,p=>p.map(m=>new En(m)));this._register(d(p=>{if(p.equals(S.Enter)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.addToHistory(),this.tree.domFocus();return}if(p.equals(S.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(S.UpArrow)){p.preventDefault(),p.stopPropagation(),this.findInput.inputBox.showPreviousValue();return}}));const h=this._register(new rn("close",g(4965,"Close"),"codicon codicon-close",!0,()=>this.dispose()));this.actionbar.push(h,{icon:!0,label:!1});const u=this._register(new ii(this.elements.grab,"mousedown"));this._register(u.event(p=>{const m=new Z,v=m.add(new ii(ct(p),"mousemove")),b=m.add(new ii(ct(p),"mouseup")),w=this.right,y=p.pageX,C=this.top,A=p.pageY;this.elements.grab.classList.add("grabbing");const L=this.elements.root.style.transition;this.elements.root.style.transition="unset";const k=P=>{const R=P.pageX-y;this.right=w-R;const z=P.pageY-A;this.top=C+z,this.layout()};m.add(v.event(k)),m.add(b.event(P=>{k(P),this.elements.grab.classList.remove("grabbing"),this.elements.root.style.transition=L,m.dispose()}))}));const f=M.chain(this._register(new ii(this.elements.grab,"keydown")).event,p=>p.map(m=>new En(m)));this._register(f(p=>{let m,v;if(p.keyCode===S.LeftArrow?m=Number.POSITIVE_INFINITY:p.keyCode===S.RightArrow?m=0:p.keyCode===S.Space&&(m=this.right===0?Number.POSITIVE_INFINITY:0),p.keyCode===S.UpArrow?v=0:p.keyCode===S.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 b=this.elements.root.style.transition;this.elements.root.style.transition="unset",this.layout(),setTimeout(()=>{this.elements.root.style.transition=b},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=Ka(this.right,0,Math.max(0,e-212)),this.elements.root.style.right=`${this.right}px`,this.top=Ka(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 Sr(300),super.dispose()}},Fxt=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,n,o,r={}){this.tree=e,this.view=i,this.filter=n,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??Yf.Highlight,this._matchType=e.options.defaultFindMatchType??mb.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 Pxt(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=>!L_.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:Yl.WARNING,content:g(4966,"No elements found.")}):this.widget?.showMessage({type:Yl.WARNING}):this.widget?.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!L_.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 Oxt(s,e){return s.position===e.position&&Qje(s,e)}function Qje(s,e){return s.node.element===e.node.element&&s.startIndex===e.startIndex&&s.height===e.height&&s.endIndex===e.endIndex}class Bxt{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return is(this.stickyNodes,e.stickyNodes,Oxt)}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(!is(this.stickyNodes,e.stickyNodes,Qje)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class Wxt{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}let U2e=class extends V{constructor(e,t,i,n,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 Wxt,this._widget=this._register(new Hxt(i.getScrollableElement(),i,e,n,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,n=0,o=this.getNextStickyNode(i,void 0,n);for(;o&&(t.push(o),n+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,n);const r=this.constrainStickyNodes(t);return r.length?new Bxt(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n&&!(n===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(n,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:n,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(n===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 n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const o=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}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 n=this.model.getListRenderCount(t),o=i+n-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 n=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 n=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${n.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=`${n.position+n.height}px`}createElement(e,t,i){const n=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",`${n}`),o.setAttribute("data-parity",n%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));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,n){if(!this.accessibilityProvider)return V.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),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:td(o),a=ai(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 Uxt extends V{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._register(ue(this.container,"focus",()=>this.onFocus())),this._register(ue(this.container,"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(!g3(t)&&!w5(t)){this.focusedLast()&&this.view.domFocus();return}if(!a_(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 n=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,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;!g3(t)&&!w5(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 n=Ka(i,0,t.count-1);this.setFocus(n)}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=n?n.position+n.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 dP(s){let e=k1.Unknown;return gq(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=k1.Twistie:gq(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=k1.Element:gq(s.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=k1.Filter),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function Vxt(s){const e=g3(s.browserEvent.target);return{element:s.element?s.element.element:null,browserEvent:s.browserEvent,anchor:s.anchor,isStickyScroll:e}}function Hq(s,e){e(s),s.children.forEach(t=>Hq(t,e))}class Ehe{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&&is(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 n=this;this._onDidChange.fire({get elements(){return n.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=>Hq(d,l)),this.set([...c.values()]);return}const i=new Set,n=c=>i.add(this.identityProvider.getId(c.element).toString());t.forEach(c=>Hq(c,n));const o=new Map,r=c=>o.set(this.identityProvider.getId(c.element).toString(),c);e.forEach(c=>Hq(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 zxt extends Eje{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Cje(e.browserEvent.target)||iA(e.browserEvent.target)||oV(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,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=w5(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&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||n)){const a=this.tree.getNodeLocation(t),c=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,c),n){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(BAt(e.browserEvent.target)||WAt(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}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(!g3(t)&&!w5(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!g3(t)&&!w5(t)){super.onContextMenu(e);return}}}class $xt extends Xa{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,c),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new zxt(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],o=[];let r;i.forEach((a,c)=>{this.focusTrait.has(a)&&n.push(e+c),this.selectionTrait.has(a)&&o.push(e+c),this.anchorTrait.has(a)&&(r=e+c)}),n.length>0&&super.setFocus(ja([...super.getFocus(),...n])),o.length>0&&super.setSelection(ja([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(n=>this.element(n)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(n=>this.element(n)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}var tW;(function(s){s[s.Tree=0]="Tree",s[s.StickyScroll=1]="StickyScroll"})(tW||(tW={}));class jje{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 M.map(this.view.onMouseClick,dP)}get onMouseDblClick(){return M.filter(M.map(this.view.onMouseDblClick,dP),e=>e.target!==k1.Filter)}get onMouseOver(){return M.map(this.view.onMouseOver,dP)}get onMouseOut(){return M.map(this.view.onMouseOut,dP)}get onContextMenu(){return M.any(M.filter(M.map(this.view.onContextMenu,Vxt),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??M.None)}get onTap(){return M.map(this.view.onTap,dP)}get onPointer(){return M.map(this.view.onPointer,dP)}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 M.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}get findMode(){return this.findController?.mode??Yf.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){return this.findController?.matchType??mb.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get onDidChangeFindPattern(){return this.findController?this.findController.onDidChangePattern:M.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,n,o={}){this._user=e,this._options=o,this.eventBufferer=new R7,this.onDidChangeFindOpenState=M.None,this.onDidChangeStickyScrollFocused=M.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 BLe(i);const r=new Kge,a=new Kge,c=this.disposables.add(new Txt(a.event)),l=new L7;this.renderers=n.map(p=>new C_e(p,()=>this.model,r.event,c,l,o));for(const p of this.renderers)this.disposables.add(p);let d;o.keyboardNavigationLabelProvider&&(d=new Lxt(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:d},this.disposables.add(d)),this.focus=new Ehe(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new Ehe(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new Ehe(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new $xt(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...Ixt(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const h=M.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 Lh(0));if(this.disposables.add(M.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=M.chain(this.view.onKeyDown,m=>m.filter(v=>!iA(v.target)).map(v=>new En(v)));M.chain(p,m=>m.filter(v=>v.keyCode===S.LeftArrow))(this.onLeftArrow,this,this.disposables),M.chain(p,m=>m.filter(v=>v.keyCode===S.RightArrow))(this.onRightArrow,this,this.disposables),M.chain(p,m=>m.filter(v=>v.keyCode===S.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 Fxt(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=M.None,this.onDidChangeFindMatchType=M.None;o.enableStickyScroll&&(this.stickyScrollController=new U2e(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=ul(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===eW.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===eW.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new U2e(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=M.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 sv(this.getHTMLElement())}layout(e,t){this.view.layout(e,t),lc(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 n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),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=xy(e.listFocusAndSelectionOutline,xy(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 rm(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 n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,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 n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=a_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=a_(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=a_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=a_(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=a_(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=a_(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()?tW.StickyScroll:tW.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 n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}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 Jl(this._user,"Can't get tree view state without an identity provider");const t=r=>e.getId(r).toString(),i=S5.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 n=this.model.getNode(),o=[n];for(;o.length>0;){const r=o.shift();r!==n&&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],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);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],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!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],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}navigate(e){return new Gxt(this.view,this.model,e)}dispose(){bt(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose()}}class Gxt{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 WLe{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 Ext(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=hi.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=hi.empty(),i){const n=new Set,o=new Set,r=c=>{if(c.element===null)return;const l=c;if(n.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(n.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=hi.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),hi.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===Lf.Collapsed||t.collapsed===Lf.PreserveOrCollapsed?r=!0:t.collapsed===Lf.Expanded||t.collapsed===Lf.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Lf.PreserveOrCollapsed||t.collapsed===Lf.PreserveOrExpanded?o=i.collapsed:t.collapsed===Lf.Collapsed?o=!0:t.collapsed===Lf.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:n,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),n=this.model.getNode(i);this._setChildren(i,this.resortChildren(n,t),{})}resortChildren(e,t,i=!0){let n=[...e.children];return(t||i)&&(n=n.sort(this.sorter.compare.bind(this.sorter))),hi.map(n,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 n=this.getElementLocation(e);return this.model.setCollapsed(n,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 Jl(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Jl(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Jl(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Jl(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function Uq(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:hi.map(hi.from(s.children),Uq),collapsible:s.collapsible,collapsed:s.collapsed}}function Vq(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=hi.consume(hi.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:hi.map(hi.concat(n,i),Vq),collapsible:s.collapsible,collapsed:s.collapsed}}function S_e(s,e=0){let t;return eS_e(i,0)),e===0&&s.element.incompressible?{element:s.element.elements[e],children:t,incompressible:!0,collapsible:s.collapsible,collapsed:s.collapsed}:{element:s.element.elements[e],children:t,collapsible:s.collapsible,collapsed:s.collapsed}}function V2e(s){return S_e(s,0)}function Yje(s,e,t){return s.element===e?{...s,children:t}:{...s,children:hi.map(hi.from(s.children),i=>Yje(i,e,t))}}const Kxt=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class qxt{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 WLe(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=hi.empty(),i){const n=i.diffIdentityProvider&&Kxt(i.diffIdentityProvider);if(e===null){const p=hi.map(t,this.enabled?Vq:Uq);this._setChildren(null,p,{diffIdentityProvider:n,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Jl(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),c=this.model.getNode(a),l=V2e(r),d=Yje(l,e,t),h=(this.enabled?Vq:Uq)(d),u=i.diffIdentityProvider?(p,m)=>i.diffIdentityProvider.getId(p)===i.diffIdentityProvider.getId(m):void 0;if(is(h.element.elements,r.element.elements,u)){this._setChildren(o,h.children||hi.empty(),{diffIdentityProvider:n,diffDepth:1});return}const f=c.children.map(p=>p===r?h:p);this._setChildren(c.element,f,{diffIdentityProvider:n,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,n=hi.map(i,V2e),o=hi.map(n,e?Vq:Uq);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=a=>{for(const c of a.element.elements)n.add(c),this.nodes.set(c,a.element)},r=a=>{for(const c of a.element.elements)n.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 n=this.getCompressedNode(e);return this.model.setCollapsed(n,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 Jl(this.user,`Tree element not found: ${e}`);return t}}const Qxt=s=>s[s.length-1];class HLe{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new HLe(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 jxt(s,e){return{splice(t,i,n){e.splice(t,i,n.map(o=>s.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function Yxt(s,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(s(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(s(t),i)}}}}class Jxt{get onDidSplice(){return M.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 M.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return M.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||Qxt;const n=o=>this.elementMapper(o.elements);this.nodeMapper=new FLe(o=>new HLe(n,o)),this.model=new qxt(e,jxt(this.nodeMapper,t),Yxt(n,i))}setChildren(e,t=hi.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 ULe extends jje{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=hi.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 WLe(e,t,i)}}class A_e{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,n){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,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}A_e.__decorator=D([Zt],A_e.prototype,"compressedTreeNodeProvider",null);class Xxt{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 n=0;ni||n>=t-1&&tthis,a=new Xxt(()=>this.model),c=n.map(l=>new A_e(r,a,l));super(e,t,i,c,{...Zxt(r,o),stickyScrollDelegate:a})}setChildren(e,t=hi.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new Jxt(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 xhe(s){return{...s,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function E_e(s,e){return e.parent?e.parent===s?!0:E_e(s,e.parent):!1}function eDt(s,e){return s===e||E_e(s,e)||E_e(e,s)}class VLe{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new VLe(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 tDt{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,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...We.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...We.asClassNameArray(ve.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function z2e(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function iK(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}function iDt(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,anchor:s.anchor,isStickyScroll:s.isStickyScroll}}class nDt extends u6{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 Dhe(s){return s instanceof u6?new nDt(s):s}class sDt{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?.(Dhe(e),t)}onDragOver(e,t,i,n,o,r=!0){return this.dnd.onDragOver(Dhe(e),t&&t.element,i,n,o)}drop(e,t,i,n,o){this.dnd.drop(Dhe(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}function Xje(s){return s&&{...s,collapseByDefault:!0,identityProvider:s.identityProvider&&{getId(e){return s.identityProvider.getId(e.element)}},dnd:s.dnd&&new sDt(s.dnd),multipleSelectionController:s.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return s.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return s.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:s.accessibilityProvider&&{...s.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:s.accessibilityProvider.getRole?e=>s.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:s.accessibilityProvider.isChecked?e=>!!s.accessibilityProvider?.isChecked(e.element):void 0,getAriaLabel(e){return s.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return s.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:s.accessibilityProvider.getWidgetRole?()=>s.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:s.accessibilityProvider.getAriaLevel&&(e=>s.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:s.accessibilityProvider.getActiveDescendantId&&(e=>s.accessibilityProvider.getActiveDescendantId(e.element))},filter:s.filter&&{filter(e,t){return s.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:s.keyboardNavigationLabelProvider&&{...s.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof s.expandOnlyOnTwistieClick>"u"?void 0:typeof s.expandOnlyOnTwistieClick!="function"?s.expandOnlyOnTwistieClick:e=>s.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?qs.Visible:typeof s.defaultFindVisibility=="number"?s.defaultFindVisibility:typeof s.defaultFindVisibility>"u"?qs.Recurse:s.defaultFindVisibility(e.element)}}function x_e(s,e){e(s),s.children.forEach(t=>x_e(t,e))}class Zje{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return M.map(this.tree.onDidChangeFocus,z2e)}get onDidChangeSelection(){return M.map(this.tree.onDidChangeSelection,z2e)}get onKeyDown(){return this.tree.onKeyDown}get onMouseClick(){return M.map(this.tree.onMouseClick,iK)}get onMouseDblClick(){return M.map(this.tree.onMouseDblClick,iK)}get onContextMenu(){return M.map(this.tree.onContextMenu,iDt)}get onTap(){return M.map(this.tree.onTap,iK)}get onPointer(){return M.map(this.tree.onPointer,iK)}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,n,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 FLe(a=>new VLe(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)?Lf.PreserveOrCollapsed:Lf.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=xhe({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,n,o){const r=new BLe(i),a=n.map(l=>new tDt(l,this.nodeMapper,this._onDidChangeNodeSlowState.event)),c=Xje(o)||{};return new ULe(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(n=>n.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,n){await this._updateChildren(e,t,i,void 0,n)}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(typeof this.root.element>"u")throw new Jl(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,o),i)try{this.tree.rerender(r)}catch{}}resort(e=this.root.element,t=!0){this.tree.resort(this.getDataNode(e),t)}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 Jl(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await M.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 M.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await M.toPromise(this._onDidRender.event)),n}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 hi.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(n=>this.getDataNode(n));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(n=>this.getDataNode(n));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 Jl(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,n){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,n)}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((o,r)=>{!n&&eDt(r,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n)return n;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 n;e.refreshPromise=new Promise(o=>n=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 Zs.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{n()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(hi.empty());else{const o=this.doGetChildren(e);if(rFe(o))n=Promise.resolve(o);else{const r=Sr(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=o.finally(()=>r.cancel())}}try{const o=await n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Fr(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 rFe(i)?this.processChildren(i):(t=Rr(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(vt))}setChildren(e,t,i,n){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=xhe({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&m.defaultCollapseState===Lf.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=>x_e(v,b=>this.nodes.delete(b.element))),m.children.splice(0,m.children.length),m.stale=!0):c.push(m):h&&!f.collapsed&&c.push(m),m}const p=xhe({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(u)>-1&&n.focus.push(p),n&&n.viewState.selection&&n.viewState.selection.indexOf(u)>-1&&n.selection.push(p),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(u)>-1||h&&p.defaultCollapseState===Lf.PreserveOrExpanded)&&c.push(p),p});for(const d of r.values())x_e(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 n=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,n,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?hi.map(e.children,n=>this.asTreeElement(n,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 Jl(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),n=[],o=this.tree.getNode(),r=[o];for(;r.length>0;){const a=r.pop();a!==o&&a.collapsible&&!a.collapsed&&n.push(e(a.element.element)),r.push(...a.children)}return{focus:t,selection:i,expanded:n,scrollTop:this.scrollTop}}dispose(){this.disposables.dispose(),this.tree.dispose()}}class zLe{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 zLe(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 oDt{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...We.asClassNameArray(ve.treeItemLoading)),!0):(t.classList.remove(...We.asClassNameArray(ve.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=bt(this.disposables)}}function rDt(s){const e=s&&Xje(s);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class aDt extends Zje{constructor(e,t,i,n,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new FLe(c=>new zLe(c)),this.filter=a.filter}createTree(e,t,i,n,o){const r=new BLe(i),a=n.map(l=>new oDt(l,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),c=rDt(o)||{};return new Jje(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 Jl(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),n=[],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)n.push(e(c.element));r.push(...a.children)}return{focus:t,selection:i,expanded:n,scrollTop:this.scrollTop}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=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 b of v.element.elements)p.add(n(b.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,qs.Visible),n=cDt(i);if(n===qs.Recurse)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===qs.Visible})),super.processChildren(e)}}function cDt(s){return typeof s=="boolean"?s?qs.Visible:qs.Hidden:OLe(s)?w3(s.visibility):w3(s)}class lDt extends jje{constructor(e,t,i,n,o,r={}){super(e,t,i,n,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 Jl(this.user,"Can't restore tree view state without an identity provider");if(this.input=e,!e){this.nodesByIdentity.clear(),this.model.setChildren(null,hi.empty());return}if(!t){this._refresh(e);return}const i=[],n=[],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)&&n.push(a.element)};this._refresh(e,o,r),this.setFocus(i),this.setSelection(n),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}updateChildren(e=this.input){if(typeof this.input>"u")throw new Jl(this.user,"Tree input not set");let t;this.identityProvider&&(t=i=>{const n=this.identityProvider.getId(i).toString(),o=this.nodesByIdentity.get(n);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 n;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)},n=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:n})}iterate(e,t){const i=[...this.dataSource.getChildren(e)];return{elements:hi.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 WLe(e,t,i)}}const dDt=new Y("isMac",Qt,g(4967,"Whether the operating system is macOS")),hDt=new Y("isLinux",pr,g(4968,"Whether the operating system is Linux")),b6=new Y("isWindows",Qn,g(4969,"Whether the operating system is Windows")),$Le=new Y("isWeb",Wn,g(4970,"Whether the platform is a web browser")),uDt=new Y("isMacNative",Qt&&!Wn,g(4971,"Whether the operating system is macOS on a non-browser platform")),gDt=new Y("isIOS",am,g(4972,"Whether the operating system is iOS")),fDt=new Y("isMobile",S6e,g(4973,"Whether the platform is a mobile web browser")),$2e=new Y("isDevelopment",!1,!0),pDt=new Y("productQualityType","",g(4974,"Quality type of VS Code")),_ae="inputFocus",GLe=new Y(_ae,!1,g(4975,"Whether keyboard focus is inside an input box")),rg=ae("listService");class mDt{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 xje(ul(),"").style(MN)),this.lists.some(n=>n.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),sv(e.getHTMLElement())&&this.setLastFocusedList(e),jr(e.onDidFocus(()=>this.setLastFocusedList(e)),Ee(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(n=>n!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const y3=new Y("listScrollAtBoundary","none"),_Dt=he.or(y3.isEqualTo("top"),y3.isEqualTo("both")),vDt=he.or(y3.isEqualTo("bottom"),y3.isEqualTo("both")),eYe=new Y("listFocus",!0),tYe=new Y("treestickyScrollFocused",!1),vae=new Y("listSupportsMultiselect",!0),bae=he.and(eYe,he.not(_ae),tYe.negate()),KLe=new Y("listHasSelectionOrFocus",!1),qLe=new Y("listDoubleSelection",!1),QLe=new Y("listMultiSelection",!1),wae=new Y("listSelectionNavigation",!1),bDt=new Y("listSupportsFind",!0),jLe=new Y("treeElementCanCollapse",!1),wDt=new Y("treeElementHasParent",!1),YLe=new Y("treeElementCanExpand",!1),yDt=new Y("treeElementHasChild",!1),CDt=new Y("treeFindOpen",!1),iYe="listTypeNavigationMode",nYe="listAutomaticKeyboardNavigation";function yae(s,e){const t=s.createScoped(e.getHTMLElement());return eYe.bindTo(t),t}function Cae(s,e){const t=y3.bindTo(s),i=()=>{const n=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&o?t.set("both"):n?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const FN="workbench.list.multiSelectModifier",zq="workbench.list.openMode",tm="workbench.list.horizontalScrolling",JLe="workbench.list.defaultFindMode",XLe="workbench.list.typeNavigationMode",sJ="workbench.list.keyboardNavigation",Ib="workbench.list.scrollByPage",ZLe="workbench.list.defaultFindMatchType",C3="workbench.tree.indent",oJ="workbench.tree.renderIndentGuides",Tb="workbench.list.smoothScrolling",jy="workbench.list.mouseWheelScrollSensitivity",Yy="workbench.list.fastScrollSensitivity",rJ="workbench.tree.expandMode",aJ="workbench.tree.enableStickyScroll",cJ="workbench.tree.stickyScrollMaxItemCount";function Jy(s){return s.getValue(FN)==="alt"}class SDt extends V{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Jy(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(FN)&&(this.useAltAsMultipleSelectionModifier=Jy(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Sje(e)}isSelectionRangeChangeEvent(e){return Aje(e)}}function Sae(s,e){const t=s.get(Te),i=s.get(Ut),n=new Z;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(Tb),mouseWheelScrollSensitivity:t.getValue(jy),fastScrollSensitivity:t.getValue(Yy),multipleSelectionController:e.multipleSelectionController??n.add(new SDt(t)),keyboardNavigationEventFilter:xDt(i),scrollByPage:!!t.getValue(Ib)},n]}let D_e=class extends Xa{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(tm),[h,u]=l.invokeFunction(Sae,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=yae(r,this),this.disposables.add(Cae(this.contextKeyService,this)),this.listSupportsMultiSelect=vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),wae.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=KLe.bindTo(this.contextKeyService),this.listDoubleSelection=qLe.bindTo(this.contextKeyService),this.listMultiSelection=QLe.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Jy(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(FN)&&(this._useAltAsMultipleSelectionModifier=Jy(c));let m={};if(p.affectsConfiguration(tm)&&this.horizontalScrolling===void 0){const v=!!c.getValue(tm);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Ib)){const v=!!c.getValue(Ib);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Tb)){const v=!!c.getValue(Tb);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(jy)){const v=c.getValue(jy);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Yy)){const v=c.getValue(Yy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new sYe(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?NN(e):MN)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}};D_e=D([_(5,Le),_(6,rg),_(7,Te),_(8,we)],D_e);let G2e=class extends hxt{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(tm),[h,u]=l.invokeFunction(Sae,o);super(e,t,i,n,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new Z,this.disposables.add(u),this.contextKeyService=yae(r,this),this.disposables.add(Cae(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),wae.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Jy(c),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(FN)&&(this._useAltAsMultipleSelectionModifier=Jy(c));let m={};if(p.affectsConfiguration(tm)&&this.horizontalScrolling===void 0){const v=!!c.getValue(tm);m={...m,horizontalScrolling:v}}if(p.affectsConfiguration(Ib)){const v=!!c.getValue(Ib);m={...m,scrollByPage:v}}if(p.affectsConfiguration(Tb)){const v=!!c.getValue(Tb);m={...m,smoothScrolling:v}}if(p.affectsConfiguration(jy)){const v=c.getValue(jy);m={...m,mouseWheelScrollSensitivity:v}}if(p.affectsConfiguration(Yy)){const v=c.getValue(Yy);m={...m,fastScrollSensitivity:v}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new sYe(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?NN(e):MN)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};G2e=D([_(5,Le),_(6,rg),_(7,Te),_(8,we)],G2e);let K2e=class extends y_e{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!l.getValue(tm),[u,f]=d.invokeFunction(Sae,r);super(e,t,i,n,o,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=yae(a,this),this.disposables.add(Cae(this.contextKeyService,this)),this.listSupportsMultiSelect=vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),wae.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=KLe.bindTo(this.contextKeyService),this.listDoubleSelection=qLe.bindTo(this.contextKeyService),this.listMultiSelection=QLe.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Jy(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(FN)&&(this._useAltAsMultipleSelectionModifier=Jy(l));let v={};if(m.affectsConfiguration(tm)&&this.horizontalScrolling===void 0){const b=!!l.getValue(tm);v={...v,horizontalScrolling:b}}if(m.affectsConfiguration(Ib)){const b=!!l.getValue(Ib);v={...v,scrollByPage:b}}if(m.affectsConfiguration(Tb)){const b=!!l.getValue(Tb);v={...v,smoothScrolling:b}}if(m.affectsConfiguration(jy)){const b=l.getValue(jy);v={...v,mouseWheelScrollSensitivity:b}}if(m.affectsConfiguration(Yy)){const b=l.getValue(Yy);v={...v,fastScrollSensitivity:b}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new ADt(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?NN(e):MN)}get useAltAsMultipleSelectionModifier(){return this._useAltAsMultipleSelectionModifier}dispose(){this.disposables.dispose(),super.dispose()}};K2e=D([_(6,Le),_(7,rg),_(8,Te),_(9,we)],K2e);class eRe extends V{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new I),this.onDidOpen=this._onDidOpen.event,this._register(M.filter(this.widget.onDidChangeSelection,i=>a_(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(zq)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(zq)&&(this.openOnSingleClick=t?.configurationService.getValue(zq)!=="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,n=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const n=t.button===1,o=!0,r=n,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,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class sYe extends eRe{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class ADt extends eRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class EDt extends eRe{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function xDt(s){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=s.softDispatch(t,t.target);return i.kind===Zg.MoreChordsNeeded?(e=!0,!1):(e=!1,i.kind===Zg.NoMatchingKb)}}let S3=class extends ULe{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(w6,o);super(e,t,i,n,d),this.disposables.add(u),this.internals=new SM(this,o,h,o.overrideStyles,a,c,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};S3=D([_(5,we),_(6,Le),_(7,rg),_(8,Te)],S3);let q2e=class extends Jje{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(w6,o);super(e,t,i,n,d),this.disposables.add(u),this.internals=new SM(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)}};q2e=D([_(5,we),_(6,Le),_(7,rg),_(8,Te)],q2e);let Q2e=class extends lDt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(w6,r);super(e,t,i,n,o,h),this.disposables.add(f),this.internals=new SM(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)}};Q2e=D([_(6,we),_(7,Le),_(8,rg),_(9,Te)],Q2e);let k_e=class extends Zje{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(w6,r);super(e,t,i,n,o,h),this.disposables.add(f),this.internals=new SM(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)}};k_e=D([_(6,we),_(7,Le),_(8,rg),_(9,Te)],k_e);let lJ=class extends aDt{get contextKeyService(){return this.internals.contextKeyService}get useAltAsMultipleSelectionModifier(){return this.internals.useAltAsMultipleSelectionModifier}get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,c,l,d,h){const{options:u,getTypeNavigationMode:f,disposable:p}=c.invokeFunction(w6,a);super(e,t,i,n,o,r,u),this.disposables.add(p),this.internals=new SM(this,a,f,a.overrideStyles,l,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};lJ=D([_(7,we),_(8,Le),_(9,rg),_(10,Te)],lJ);function oYe(s){const e=s.getValue(JLe);if(e==="highlight")return Yf.Highlight;if(e==="filter")return Yf.Filter;const t=s.getValue(sJ);if(t==="simple"||t==="highlight")return Yf.Highlight;if(t==="filter")return Yf.Filter}function rYe(s){const e=s.getValue(ZLe);if(e==="fuzzy")return mb.Fuzzy;if(e==="contiguous")return mb.Contiguous}function w6(s,e){const t=s.get(Te),i=s.get(gf),n=s.get(Le),o=s.get(we),r=()=>{const u=n.getContextKeyValue(iYe);if(u==="automatic")return Vw.Automatic;if(u==="trigger"||n.getContextKeyValue(nYe)===!1)return Vw.Trigger;const p=t.getValue(XLe);if(p==="automatic")return Vw.Automatic;if(p==="trigger")return Vw.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(tm),[c,l]=o.invokeFunction(Sae,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(oJ);return{getTypeNavigationMode:r,disposable:l,options:{keyboardSupport:!1,...c,indent:typeof t.getValue(C3)=="number"?t.getValue(C3):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(Tb),defaultFindMode:oYe(t),defaultFindMatchType:rYe(t),horizontalScrolling:a,scrollByPage:!!t.getValue(Ib),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(rJ)==="doubleClick",contextViewProvider:i,findWidgetStyles:mEt,enableStickyScroll:!!t.getValue(aJ),stickyScrollMaxItemCount:Number(t.getValue(cJ))}}}let SM=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a){this.tree=e,this.disposables=[],this.contextKeyService=yae(o,e),this.disposables.push(Cae(this.contextKeyService,e)),this.listSupportsMultiSelect=vae.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),wae.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=bDt.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=KLe.bindTo(this.contextKeyService),this.hasDoubleSelection=qLe.bindTo(this.contextKeyService),this.hasMultiSelection=QLe.bindTo(this.contextKeyService),this.treeElementCanCollapse=jLe.bindTo(this.contextKeyService),this.treeElementHasParent=wDt.bindTo(this.contextKeyService),this.treeElementCanExpand=YLe.bindTo(this.contextKeyService),this.treeElementHasChild=yDt.bindTo(this.contextKeyService),this.treeFindOpen=CDt.bindTo(this.contextKeyService),this.treeStickyScrollFocused=tYe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Jy(a),this.updateStyleOverrides(n);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(iYe),d.add(nYe),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(FN)&&(this._useAltAsMultipleSelectionModifier=Jy(a)),h.affectsConfiguration(C3)){const f=a.getValue(C3);u={...u,indent:f}}if(h.affectsConfiguration(oJ)&&t.renderIndentGuides===void 0){const f=a.getValue(oJ);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(Tb)){const f=!!a.getValue(Tb);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(JLe)||h.affectsConfiguration(sJ)){const f=oYe(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(XLe)||h.affectsConfiguration(sJ)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(ZLe)){const f=rYe(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(tm)&&t.horizontalScrolling===void 0){const f=!!a.getValue(tm);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(Ib)){const f=!!a.getValue(Ib);u={...u,scrollByPage:f}}if(h.affectsConfiguration(rJ)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(rJ)==="doubleClick"}),h.affectsConfiguration(aJ)){const f=a.getValue(aJ);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(cJ)){const f=Math.max(1,a.getValue(cJ));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(jy)){const f=a.getValue(jy);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(Yy)){const f=a.getValue(Yy);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 EDt(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?NN(e):MN)}dispose(){this.disposables=bt(this.disposables)}};SM=D([_(4,Le),_(5,rg),_(6,Te)],SM);const DDt=Qe.as(Nn.Configuration);DDt.registerConfiguration({id:"workbench",order:7,title:g(1295,"Workbench"),type:"object",properties:{[FN]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[g(1296,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),g(1297,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:g(1298,"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.")},[zq]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(1299,"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.")},[tm]:{type:"boolean",default:!1,description:g(1300,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Ib]:{type:"boolean",default:!1,description:g(1301,"Controls whether clicks in the scrollbar scroll page by page.")},[C3]:{type:"number",default:8,minimum:4,maximum:40,description:g(1302,"Controls tree indentation in pixels.")},[oJ]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:g(1303,"Controls whether the tree should render indent guides.")},[Tb]:{type:"boolean",default:!1,description:g(1304,"Controls whether lists and trees have smooth scrolling.")},[jy]:{type:"number",default:1,markdownDescription:g(1305,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Yy]:{type:"number",default:5,markdownDescription:g(1306,"Scrolling speed multiplier when pressing `Alt`.")},[JLe]:{type:"string",enum:["highlight","filter"],enumDescriptions:[g(1307,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),g(1308,"Filter elements when searching.")],default:"highlight",description:g(1309,"Controls the default find mode for lists and trees in the workbench.")},[sJ]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[g(1310,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),g(1311,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),g(1312,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:g(1313,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:g(1314,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[ZLe]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[g(1315,"Use fuzzy matching when searching."),g(1316,"Use contiguous matching when searching.")],default:"fuzzy",description:g(1317,"Controls the type of matching used when searching lists and trees in the workbench.")},[rJ]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:g(1318,"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.")},[aJ]:{type:"boolean",default:!0,description:g(1319,"Controls whether sticky scrolling is enabled in trees.")},[cJ]:{type:"number",minimum:1,default:7,markdownDescription:g(1320,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[XLe]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:g(1321,"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 kDt=".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}";ut(kDt,{});class nD extends V{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=t?.supportIcons??!1,this.domNode=re(e,fe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=nD.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Ys(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{n=o===`\r +`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class u4{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 A3 extends V{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new u4(re(e,fe(".monaco-icon-label")))),this.labelContainer=re(this.domNode.element,fe(".monaco-icon-label-container")),this.nameContainer=re(this.labelContainer,fe("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new LDt(this.nameContainer,!!t.supportIcons)):this.nameNode=new IDt(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??Pr("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.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||!Yr(a)?(c=fe(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,c.style.backgroundImage=Yu(i?.iconPath)}else a&&a.remove();if(this.domNode.className=n.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 nD?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(c.element,i?.descriptionTitle)):(c.textContent=t&&i?.labelEscapeNewLines?nD.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){Lt(r)?o.title=rae(r):r?.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const n=wm().setupManagedHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new u4(HGe(this.nameContainer,fe("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new u4(re(e.element,fe("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new u4(re(this.labelContainer,fe("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new nD(re(e.element,fe("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new u4(re(e.element,fe("span.label-description"))))}return this.descriptionNode}}class IDt{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Ys(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=re(this.container,fe("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+n.length},r=t.map(a=>Ld.intersect(o,a)).filter(a=>!Ld.isEmpty(a)).map(({start:a,end:c})=>({start:a-i,end:c-i}));return i=o.end+e.length,r})}class LDt extends V{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&&Ys(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 nD(re(this.container,fe("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||"/",n=TDt(e,i,t?.matches);for(let o=0;o{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}}),kU=new ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0})})),tRe=new ya(()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})}));function cYe(s,e,t=!1){const i=s||"",n=e||"",o=j2e.value.collator.compare(i,n);return j2e.value.collatorIsNumeric&&o===0&&i!==n?in.length)return 1}return 0}class $Dt extends AU{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this.observers)for(const t of this._deltas)e.handleChange(this,t);this._deltas.length=0}else for(const e of this.observers)e.handleChange(this,void 0)}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this.observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this.observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this.observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new EU(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),i!==void 0&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(o,r)=>{},handlePossibleChange:o=>{}},this),this._updateCounter>1)for(const o of this.observers)o.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function uJ(s,e){return s.lazy?new $Dt(new Qd(s.owner,s.debugName,void 0),e,s.equalsFn??fp):new LLe(new Qd(s.owner,s.debugName,void 0),e,s.equalsFn??fp)}var I_e;const pv=fe;class hYe{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new ya(()=>{const n=i.label??"",o=oF(n).text.trim(),r=i.ariaLabel||[n,this.saneDescription,this.saneDetail].map(a=>MQe(a)).filter(a=>!!a).join(", ");return{saneLabel:n,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 _l extends hYe{constructor(e,t,i,n,o,r){super(e,t,o),this.fireButtonTriggered=i,this._onChecked=n,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?M.map(M.filter(this._onChecked.event,a=>a.element===this),a=>a.checked):M.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 Ew;(function(s){s[s.NONE=0]="NONE",s[s.MOUSE_HOVER=1]="MOUSE_HOVER",s[s.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(Ew||(Ew={}));class n0 extends hYe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=Ew.NONE}}class GDt{getHeight(e){return e instanceof n0?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof _l?gJ.ID:fJ.ID}}class KDt{getWidgetAriaLabel(){return g(9964,"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 _l)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class uYe{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new Z,t.toDisposeTemplate=new Z,t.entry=re(e,pv(".quick-input-list-entry"));const i=re(t.entry,pv("label.quick-input-list-label"));t.toDisposeTemplate.add(Ro(i,ke.CLICK,l=>{t.checkbox.offsetParent||l.preventDefault()})),t.checkbox=re(i,pv("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const n=re(i,pv(".quick-input-list-rows")),o=re(n,pv(".quick-input-list-row")),r=re(n,pv(".quick-input-list-row"));t.label=new A3(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=Mre(t.label.element,pv(".quick-input-list-icon"));const a=re(o,pv(".quick-input-list-entry-keybinding"));t.keybinding=new Vk(a,po),t.toDisposeTemplate.add(t.keybinding);const c=re(r,pv(".quick-input-list-label-meta"));return t.detail=new A3(c,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=re(t.entry,pv(".quick-input-list-separator")),t.actionBar=new ld(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 cL;let gJ=(cL=class extends uYe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return I_e.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Ro(t.checkbox,ke.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0;const o=n.item;i.checkbox.checked=n.checked,i.toDisposeElement.add(n.onChecked(u=>i.checkbox.checked=u)),i.checkbox.disabled=n.checkboxDisabled;const{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=n;if(o.iconPath){const u=qre(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,f=N.revive(u);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Yu(f)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:n.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:n.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(n.saneLabel,n.saneDescription,d),i.keybinding.set(o.keybinding),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:n.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:c,title:u,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";n.separator?.label?(i.separator.textContent=n.separator.label,i.separator.style.display="",this.addItemWithSeparator(n)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!n.separator);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((u,f)=>C5(u,`id-${f}`,()=>n.fireButtonTriggered({button:u,item:n.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)}},I_e=cL,cL.ID="quickpickitem",cL);gJ=I_e=D([_(1,pn)],gJ);const dse=class dse extends uYe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return dse.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0,n.element.classList.toggle("focus-inside",!!n.focusInsideSeparator);const o=n.separator,{labelHighlights:r,descriptionHighlights:a,detailHighlights:c}=n;i.icon.style.backgroundImage="",i.icon.className="";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:n.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:n.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(n.saneLabel,n.saneDescription,d),n.saneDetail){let u;n.saneTooltip||(u={markdown:{value:n.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.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)=>C5(u,`id-${f}`,()=>n.fireSeparatorButtonTriggered({button:u,separator:n.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(n)}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)}};dse.ID="quickpickseparator";let fJ=dse,AM=class extends V{constructor(e,t,i,n,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._visibleCountObservable=jt("VisibleCount",0),this.onChangedVisibleCount=M.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=jt("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=M.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=jt("CheckedCount",0),this.onChangedCheckedCount=M.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=uJ({equalsFn:is},new Array),this.onChangedCheckedElements=M.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new I,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new I,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new I,this._elementCheckedEventBufferer=new R7,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new Z),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._matchOnMeta=!0,this._sortByLabel=!0,this._shouldLoop=!0,this._container=re(this.parent,pv(".quick-input-list")),this._separatorRenderer=new fJ(t),this._itemRenderer=o.createInstance(gJ,t),this._tree=this._register(o.createInstance(S3,"QuickInput",this._container,new GDt,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new KDt,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:eW.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return M.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof _l).map(t=>t.item),this._store)}get onDidChangeSelection(){return M.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof _l).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}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._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new En(e);switch(t.keyCode){case S.Space:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(ue(this._container,ke.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(ue(this._container,ke.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new K7(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(HFe(t.browserEvent.target)){e.cancel();return}if(!(!HFe(t.browserEvent.relatedTarget)&&wc(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof _l&&this.showHover(t.element)})}catch(i){if(!Fr(i))throw i}})),this._register(this._tree.onMouseOut(t=>{wc(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 n=i===t;!!(i.focusInsideSeparator&Ew.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=Ew.ACTIVE_ITEM:i.focusInsideSeparator&=~Ew.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&Ew.MOUSE_HOVER)||(i.focusInsideSeparator|=Ew.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&Ew.MOUSE_HOVER)&&(i.focusInsideSeparator&=~Ew.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof _l);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof n0&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,n,o)=>{let r;if(n.type==="separator"){if(!n.buttons)return i;t=new n0(o,a=>this._onSeparatorButtonTriggered.fire(a),n),r=t}else{const a=o>0?e[o-1]:void 0;let c;a&&a.type==="separator"&&!a.buttons&&(t=void 0,c=a);const l=new _l(o,this._hasCheckboxes,d=>this._onButtonTriggered.fire(d),this._elementChecked,n,c);if(this._itemElements.push(l),t)return t.children.push(l),i;r=l}return i.push(r),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),n=i?.parentNode;if(i&&n){const o=i.nextSibling;i.remove(),n.insertBefore(i,o)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i).filter(i=>!i.hidden);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")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}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 _l);break;case wo.Second:{this._tree.scrollTop=0;let t=!1;this._tree.focusFirst(void 0,i=>i.element instanceof _l?t?!0:(t=!t,!1):!1);break}case wo.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,t=>t.element instanceof _l);break;case wo.Next:{const t=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,n=>n.element instanceof _l?(this._tree.reveal(n.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,n=>{if(!(n.element instanceof _l))return!1;const o=this._tree.getParentElement(n.element);return o===null||o.children[0]!==n.element?this._tree.reveal(n.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 _l?(this._tree.reveal(t.element),!0):!1);break;case wo.PreviousPage:this._tree.focusPreviousPage(void 0,t=>{if(!(t.element instanceof _l))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 n0)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 _l){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 n=this._tree.getFocus()[0];i===n&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,o=>o.element instanceof _l));break}case wo.PreviousSeparator:{let t,i=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,n=>{if(n.element instanceof n0)i?t||(this._separatorRenderer.isSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element.children[0]):i=!0;else if(n.element instanceof _l&&!t){if(n.element.separator)this._itemRenderer.isItemWithSeparatorVisible(n.element)?this._tree.reveal(n.element):this._tree.reveal(n.element,0),t=n.element;else if(n.element===this._elementTree[0])return this._tree.reveal(n.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(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const a=r.index&&this._inputElements[r.index-1];r.item&&(r.separator=a&&a.type==="separator"&&!a.buttons?a:void 0)});else{let r;this._elementTree.forEach(a=>{let c;this.matchOnLabelMode==="fuzzy"?c=this.matchOnLabel?Lq(e,oF(a.saneLabel))??void 0:void 0:c=this.matchOnLabel?qDt(t,oF(a.saneLabel))??void 0:void 0;const l=this.matchOnDescription?Lq(e,oF(a.saneDescription||""))??void 0:void 0,d=this.matchOnDetail?Lq(e,oF(a.saneDetail||""))??void 0:void 0;if(c||l||d?(a.labelHighlights=c,a.descriptionHighlights=l,a.detailHighlights=d,a.hidden=!1):(a.labelHighlights=void 0,a.descriptionHighlights=void 0,a.detailHighlights=void 0,a.hidden=a.item?!a.item.alwaysShow:!0),a.item?a.separator=void 0:a.separator&&(a.hidden=!0),!this.sortByLabel){const h=a.index&&this._inputElements[a.index-1];r=h&&h.type==="separator"?h:r,r&&!a.hidden&&(a.separator=r,r=void 0)}})}const i=this._elementTree.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();i.sort((a,c)=>QDt(a,c,r))}let n;const o=i.reduce((r,a,c)=>(a instanceof _l?n?n.children.push(a):r.push(a):a instanceof n0&&(a.children=[],n=a,r.push(a)),r),new Array);return this._setElementsToTree(o),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof _l),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof _l))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 _l&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof n0?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(n=>({element:n,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;it.checked).length;this._checkedCountObservable.set(e,void 0),this._checkedElementsObservable.set(this.getCheckedElements(),void 0)}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:t=>{this.linkOpenerDelegate(t)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:vo.RIGHT}},!1))}};AM.__decorator=D([Zt],AM.prototype,"onDidChangeFocus",null);AM.__decorator=D([Zt],AM.prototype,"onDidChangeSelection",null);AM=D([_(4,we),_(5,mr)],AM);function qDt(s,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return Y2e(s,t);const n=dU(t," "),o=t.length-n.length,r=Y2e(s,n);if(r)for(const a of r){const c=i[a.start+o]+o;a.start+=c,a.end+=c}return r}function Y2e(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t!==-1?[{start:t,end:t+s.length}]:null}function QDt(s,e,t){const i=s.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:Gq(s.saneSortLabel,e.saneSortLabel,t)}const gYe={weight:Ae.WorkbenchContrib,when:he.and(he.equals(Uje,J2.QuickPick),FEt),metadata:{description:g(9965,"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 Rg(s,e={}){So.registerCommandAndKeybindingRule({...gYe,...s,secondary:jDt(s.primary,s.secondary??[],e)})}const pJ=Qt?U.WinCtrl:U.CtrlCmd;function jDt(s,e,t={}){return t.withAltMod&&e.push(U.Alt+s),t.withCtrlMod&&(e.push(pJ+s),t.withAltMod&&e.push(U.Alt+pJ+s)),t.withCmdMod&&Qt&&(e.push(U.CtrlCmd+s),t.withCtrlMod&&e.push(U.CtrlCmd+U.WinCtrl+s),t.withAltMod&&(e.push(U.CtrlCmd+U.Alt+s),t.withCtrlMod&&e.push(U.CtrlCmd+U.Alt+U.WinCtrl+s))),e}function Rf(s,e){return t=>{const i=t.get(In).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(s)}}Rg({id:"quickInput.pageNext",primary:S.PageDown,handler:Rf(wo.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Rg({id:"quickInput.pagePrevious",primary:S.PageUp,handler:Rf(wo.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Rg({id:"quickInput.first",primary:pJ+S.Home,handler:Rf(wo.First)},{withAltMod:!0,withCmdMod:!0});Rg({id:"quickInput.last",primary:pJ+S.End,handler:Rf(wo.Last)},{withAltMod:!0,withCmdMod:!0});Rg({id:"quickInput.next",primary:S.DownArrow,handler:Rf(wo.Next)},{withCtrlMod:!0});Rg({id:"quickInput.previous",primary:S.UpArrow,handler:Rf(wo.Previous)},{withCtrlMod:!0});const J2e=g(9966,"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."),X2e=g(9967,"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.");Qt?(Rg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.DownArrow,handler:Rf(wo.NextSeparator,wo.Next),metadata:{description:J2e}}),Rg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.DownArrow],handler:Rf(wo.NextSeparator)},{withCtrlMod:!0}),Rg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.CtrlCmd+S.UpArrow,handler:Rf(wo.PreviousSeparator,wo.Previous),metadata:{description:X2e}}),Rg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,secondary:[U.CtrlCmd+U.WinCtrl+S.UpArrow],handler:Rf(wo.PreviousSeparator)},{withCtrlMod:!0})):(Rg({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:U.Alt+S.DownArrow,handler:Rf(wo.NextSeparator,wo.Next),metadata:{description:J2e}}),Rg({id:"quickInput.nextSeparator",primary:U.CtrlCmd+U.Alt+S.DownArrow,handler:Rf(wo.NextSeparator)}),Rg({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:U.Alt+S.UpArrow,handler:Rf(wo.PreviousSeparator,wo.Previous),metadata:{description:X2e}}),Rg({id:"quickInput.previousSeparator",primary:U.CtrlCmd+U.Alt+S.UpArrow,handler:Rf(wo.PreviousSeparator)}));Rg({id:"quickInput.acceptInBackground",when:he.and(gYe.when,he.or(GLe.negate(),WEt)),primary:S.RightArrow,weight:Ae.WorkbenchContrib+50,handler:s=>{s.get(In).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var T_e;const gg=fe;var lL;let L_e=(lL=class extends V{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=n,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=PEt.bindTo(this.contextKeyService),this.quickInputTypeContext=OEt.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=BEt.bindTo(this.contextKeyService),this.backButton=eJ,this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(M.runAndSubscribe(Xp,({window:o,disposables:r})=>this.registerKeyModsListeners(o,r),{window:si,disposables:this._store})),this._register(Zlt(o=>{this.ui&&ct(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=n=>{this.keyMods.ctrlCmd=n.ctrlKey||n.metaKey,this.keyMods.alt=n.altKey};for(const n of[ke.KEY_DOWN,ke.KEY_UP,ke.MOUSE_DOWN])t.add(ue(e,n,i,!0))}getUI(e){if(this.ui)return e&&ct(this._container)!==ct(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=re(this._container,gg(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=ul(t),n=re(t,gg(".quick-input-titlebar")),o=this._register(new ld(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=re(n,gg(".quick-input-title")),a=this._register(new ld(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const c=re(t,gg(".quick-input-header")),l=re(c,gg("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",g(5279,"Toggle all checkboxes")),this._register(Ro(l,ke.CHANGE,ie=>{const ge=l.checked;j.setAllVisibleChecked(ge)})),this._register(ue(l,ke.CLICK,ie=>{(ie.x||ie.y)&&f.setFocus()}));const d=re(c,gg(".quick-input-description")),h=re(c,gg(".quick-input-and-message")),u=re(h,gg(".quick-input-filter")),f=this._register(new axt(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=re(u,gg(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new w_e(p,{countFormat:g(5280,"{0} Results")},this.styles.countBadge),v=re(u,gg(".quick-input-count"));v.setAttribute("aria-live","polite");const b=new w_e(v,{countFormat:g(5281,"{0} Selected")},this.styles.countBadge),w=this._register(new ld(c,{hoverDelegate:this.options.hoverDelegate}));w.domNode.classList.add("quick-input-inline-action-bar");const y=re(c,gg(".quick-input-action")),C=this._register(new jd(y,this.styles.button));C.label=g(5282,"OK"),this._register(C.onDidClick(ie=>{this.onDidAcceptEmitter.fire()}));const A=re(c,gg(".quick-input-action")),L=this._register(new jd(A,{...this.styles.button,supportIcons:!0}));L.label=g(5283,"Custom"),this._register(L.onDidClick(ie=>{this.onDidCustomEmitter.fire()}));const k=re(h,gg(`#${this.idPrefix}message.quick-input-message`)),P=this._register(new tJ(t,this.styles.progressBar));P.getContainer().classList.add("quick-input-progress");const R=re(t,gg(".quick-input-html-widget"));R.tabIndex=-1;const z=re(t,gg(".quick-input-description")),G=this.idPrefix+"list",j=this._register(this.instantiationService.createInstance(AM,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,G));f.setAttribute("aria-controls",G),this._register(j.onDidChangeFocus(()=>{f.setAttribute("aria-activedescendant",j.getActiveDescendant()??"")})),this._register(j.onChangedAllVisibleChecked(ie=>{l.checked=ie})),this._register(j.onChangedVisibleCount(ie=>{m.setCount(ie)})),this._register(j.onChangedCheckedCount(ie=>{b.setCount(ie)})),this._register(j.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof cF&&this.controller.canSelectMany&&j.clearFocus())},0)}));const K=Ac(t);return this._register(K),this._register(ue(t,ke.FOCUS,ie=>{const ge=this.getUI();if(wc(ie.relatedTarget,ge.inputContainer)){const xe=ge.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==xe&&this.endOfQuickInputBoxContext.set(xe)}wc(ie.relatedTarget,ge.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Yr(ie.relatedTarget)?ie.relatedTarget:void 0)},!0)),this._register(K.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(Y2.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(ie=>{const ge=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==ge&&this.endOfQuickInputBoxContext.set(ge)})),this._register(ue(t,ke.FOCUS,ie=>{f.setFocus()})),this._register(Ro(t,ke.KEY_DOWN,ie=>{if(!wc(ie.target,R))switch(ie.keyCode){case S.Enter:en.stop(ie,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case S.Escape:en.stop(ie,!0),this.hide(Y2.Gesture);break;case S.Tab:if(!ie.altKey&&!ie.ctrlKey&&!ie.metaKey){const ge=[".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")?ge.push("input"):ge.push("input[type=text]"),this.getUI().list.displayed&&ge.push(".monaco-list"),this.getUI().message&&ge.push(".quick-input-message a"),this.getUI().widget){if(wc(ie.target,this.getUI().widget))break;ge.push(".quick-input-html-widget")}const xe=t.querySelectorAll(ge.join(", "));ie.shiftKey&&ie.target===xe[0]?(en.stop(ie,!0),j.clearFocus()):!ie.shiftKey&&wc(ie.target,xe[xe.length-1])&&(en.stop(ie,!0),xe[0].focus())}break;case S.Space:ie.ctrlKey&&(en.stop(ie,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:n,title:r,description1:z,description2:d,widget:R,rightActionBar:a,inlineActionBar:w,checkAll:l,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:p,visibleCount:m,countContainer:v,count:b,okContainer:y,ok:C,message:k,customButtonContainer:A,customButton:L,list:j,progressBar:P,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:ie=>this.show(ie),hide:()=>this.hide(),setVisibilities:ie=>this.setVisibilities(ie),setEnabled:ie=>this.setEnabled(ie),setContextKey:ie=>this.options.setContextKey(ie),linkOpenerDelegate:ie=>this.options.linkOpenerDelegate(ie)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,re(this._container,this.ui.container))}pick(e,t={},i=He.None){return new Promise((n,o)=>{let r=d=>{r=n,t.onKeyMods?.(a.keyMods),n(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(()=>{bt(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&&Lt(t)?(e.severity=Xe.Error,e.validationMessage=t):t&&!Lt(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Xe.Ignore,e.validationMessage=void 0)}input(e={},t=He.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const n=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=M.debounce(n.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",c=Promise.resolve(o(a));const l=[n,r(d=>{d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{d===a&&this.setValidationOnInput(n,h)})}),n.onDidAccept(()=>{const d=n.value;d!==a&&(c=Promise.resolve(o(d)),a=d),c.then(h=>{!h||!Lt(h)&&h.severity!==Xe.Error?(i(d),n.hide()):d===a&&this.setValidationOnInput(n,h)})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{bt(l),i(void 0)})];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()})}createQuickPick(){const e=this.getUI(!0);return new cF(e)}createInputBox(){const e=this.getUI(!0);return new HEt(e)}createQuickWidget(){const e=this.getUI(!0);return new UEt(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="",aa(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Xe.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),aa(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 n=this.options.backKeybindingLabel();eJ.tooltip=n?g(5284,"Back ({0})",n):g(5285,"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.displayed=!!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,n=i&&!J1e(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){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 cF&&this.controller.canSelectMany&&this.getUI().list.toggleCheckbox()}navigate(e,t){this.isVisible()&&this.getUI().list.displayed&&(this.getUI().list.focus(e?wo.Next:wo.Previous),t&&this.controller instanceof cF&&(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,T_e.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:n,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=n?`1px solid ${n}`:"",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)}}},T_e=lL,lL.MAX_WIDTH=600,lL);L_e=T_e=D([_(1,fu),_(2,we),_(3,Le)],L_e);let mJ=class extends OTe{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(__e))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,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(Ao).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(b_e))},n=this._register(this.instantiationService.createInstance(L_e,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{ct(e.activeContainer)===ct(n.container)&&n.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}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=He.None){return this.controller.pick(e,t,i)}input(e={},t=He.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:ze(BOe),quickInputForeground:ze(vpt),quickInputTitleBackground:ze(bpt),widgetBorder:ze(F2),widgetShadow:ze(mI)},inputBox:yM,toggle:jY,countBadge:Mje,button:_6,progressBar:Rje,keybindingLabel:n_e,list:NN({listBackground:BOe,listFocusBackground:$8,listFocusForeground:z8,listInactiveFocusForeground:z8,listInactiveSelectionIconForeground:ATe,listInactiveFocusBackground:$8,listFocusOutline:Js,listInactiveFocusOutline:Js}),pickerGroup:{pickerGroupBorder:ze(wpt),pickerGroupForeground:ze(iqe)}}}};mJ=D([_(0,we),_(1,Le),_(2,pn),_(3,fu),_(4,Te)],mJ);let R_e=class extends mJ{constructor(e,t,i,n,o,r){super(t,i,n,new Cme(e.getContainerDomNode(),o),r),this.host=void 0;const a=x3.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 M.map(e.onDidLayoutChange,l=>({container:c.getDomNode(),dimension:l}))},get onDidChangeActiveContainer(){return M.None},get onDidAddContainer(){return M.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)}};R_e=D([_(1,we),_(2,Le),_(3,pn),_(4,Kt),_(5,Te)],R_e);let E3=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(R_e,e);this.mapEditorToService.set(e,t),cm(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=He.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()}};E3=D([_(0,we),_(1,Kt)],E3);const hse=class hse{static get(e){return e.getContribution(hse.ID)}constructor(e){this.editor=e,this.widget=new M_e(this.editor)}dispose(){this.widget.dispose()}};hse.ID="editor.controller.quickInput";let x3=hse;const use=class use{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return use.ID}getDomNode(){return this.domNode}getPosition(){return{preference:Fg.TOP_CENTER}}dispose(){this.codeEditor.removeOverlayWidget(this)}};use.ID="editor.contrib.quickInputWidget";let M_e=use;on(x3.ID,x3,ri.Lazy);class YDt{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function JDt(s){if(!s||!Array.isArray(s))return[];const e=[];let t=0;for(let i=0,n=s.length;i{const u=nkt(d.token,h.token);return u!==0?u:d.index-h.index});let t=Vo.None,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){const d=s.shift();d.fontStyle!==Vo.NotSet&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const o=new ekt;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(n),c=new iRe(t,r,a),l=new nRe(c);for(let d=0,h=s.length;d"u"){const n=this._match(t),o=ikt(t);i=(n.metadata|o<>>0,this._cache.set(t,i)}return(i|e<>>0}}const tkt=/\b(comment|string|regex|regexp)\b/;function ikt(s){const e=s.match(tkt);if(!e)return nr.Other;switch(e[1]){case"comment":return nr.Comment;case"string":return nr.String;case"regex":return nr.RegEx;case"regexp":return nr.RegEx}throw new Error("Unexpected match for standard token type!")}function nkt(s,e){return se?1:0}class iRe{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 iRe(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==Vo.NotSet&&(this._fontStyle=e),t!==Il.None&&(this._foreground=t),i!==Il.None&&(this._background=i),this.metadata=(this._fontStyle<>>0}}class skt{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 nRe{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 skt(this._mainRule,e)}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,n;t===-1?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);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 nRe(this._mainRule.clone()),this._children.set(r,c)),c.insert(a,t,i,n)}}function okt(s){const e=[];for(let t=1,i=s.length;t({format:n.format,location:n.location.toString()}))}}s.toJSONObject=e;function t(i){const n=o=>Lt(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Lt(o.format)&&Lt(o.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(o=>({format:o.format,location:N.parse(o.location)}))}}s.fromJSONObject=t})(Z2e||(Z2e={}));class dkt{constructor(){this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:g(4497,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:g(4498,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${We.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){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:n};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return n&&(a.deprecationMessage=n),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(;We.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 n=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of n.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${We.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(r=>!We.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` +`)}}const IU=new dkt;Qe.add(pYe.IconContribution,IU);function oi(s,e,t,i){return IU.registerIcon(s,e,t,i)}function sRe(){return IU}function hkt(){const s=rGe();for(const e in s){const t="\\"+s[e].toString(16);IU.registerIcon(e,{fontCharacter:t})}}hkt();const mYe="vscode://schemas/icons",_Ye=Qe.as(QA.JSONContribution);_Ye.registerSchema(mYe,IU.getIconSchema());const eWe=new cn(()=>_Ye.notifySchemaChanged(mYe),200);IU.onDidChange(()=>{eWe.isScheduled()||eWe.schedule()});const vYe=oi("widget-close",ve.close,g(4499,"Icon for the close action in widgets.")),ukt=oi("goto-previous-location",ve.arrowUp,g(4500,"Icon for goto previous editor location.")),gkt=oi("goto-next-location",ve.arrowDown,g(4501,"Icon for goto next editor location."));We.modify(ve.sync,"spin");We.modify(ve.loading,"spin");function fkt(s){const e=new Z,t=e.add(new I),i=sRe();return e.add(i.onDidChange(()=>t.fire())),s&&e.add(s.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=s?s.getProductIconTheme():new bYe,o={},r=[],a=[];for(const c of i.getIcons()){const l=n.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}: ${fq(d.id)};`,`${u}: '${l.fontCharacter}';`),r.push(`.codicon-${c.id}:before { content: '${l.fontCharacter}'; font-family: ${fq(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=>`${Yu(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${u}; font-family: ${fq(c)};${d}${h} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` +`)}}}class bYe{getIcon(e){const t=sRe();let i=e.defaults;for(;We.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const JE="vs",A5="vs-dark",VO="hc-black",zO="hc-light",wYe=Qe.as(mTe.ColorContribution),pkt=Qe.as(pqe.ThemingContribution);class yYe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Kq(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,me.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=N_e(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,me.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=wYe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case JE:return Qg.LIGHT;case VO:return Qg.HIGH_CONTRAST_DARK;case zO:return Qg.HIGH_CONTRAST_LIGHT;default:return Qg.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=N_e(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=fYe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=zv.getForeground(o),a=zv.getFontStyle(o);return{foreground:r,italic:!!(a&Vo.Italic),bold:!!(a&Vo.Bold),underline:!!(a&Vo.Underline),strikethrough:!!(a&Vo.Strikethrough)}}get tokenColorMap(){return[]}}function Kq(s){return s===JE||s===A5||s===VO||s===zO}function N_e(s){switch(s){case JE:return rkt;case A5:return akt;case VO:return ckt;case zO:return lkt}}function sK(s){const e=N_e(s);return new yYe(s,e)}class mkt extends V{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 bYe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(JE,sK(JE)),this._knownThemes.set(A5,sK(A5)),this._knownThemes.set(VO,sK(VO)),this._knownThemes.set(zO,sK(zO));const e=this._register(fkt(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(JE),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Fj(si,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return E8(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=ul(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),V.None}_registerShadowDomContainer(e){const t=ul(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(JE),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=si.matchMedia("(forced-colors: active)").matches;if(e!==Iy(this._theme.type)){let t;qre(this._theme.type)?t=e?VO:A5:t=e?zO:JE,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)}};pkt.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of wYe.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${Bre(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` +`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(okt(o)),this._themeCSS=e.join(` `),this._updateCSS(),Ta.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 cv=ae("themeService");let U_e=class extends V{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=Jl.Unknown,this._onDidChangeScreenReaderOptimized=new I,this._onDidChangeReducedMotion=new I,this._onDidChangeLinkUnderline=new I,this._accessibilityModeEnabledContext=K7.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const o=si.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(o),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(ue(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()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===Jl.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){Mr(e)}status(e){Ah(e)}};U_e=D([_(0,Le),_(1,pu),_(2,Te)],U_e);var LP,lV;let V_e=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new z_e(i)}createMenu(e,t,i){return new bJ(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new bJ(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),o=n.getActions(i);return n.dispose(),o}getMenuContexts(e){const t=new QO(e,!1);return new Set([...t.structureContextKeys,...t.preconditionContextKeys,...t.toggledContextKeys])}resetHiddenStates(e){this._hiddenStates.reset(e)}};V_e=D([_(0,vi),_(1,Ut),_(2,$i)],V_e);var fL;let z_e=(fL=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(LP._key,Ie.PROFILE,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(Ie.PROFILE,LP._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(LP._key,Ie.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),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}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&&crt(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(LP._key,e,Ie.PROFILE,an.USER)}finally{this._ignoreChangeEvent=!1}}},LP=fL,fL._key="menu.hiddenCommands",fL);z_e=LP=D([_(0,$i)],z_e);class QO{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,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=this._sort(jn.getMenuItems(this._id));let t;for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_sort(e){return e}_collectContextKeys(e){if(QO._fillInKbExprKeys(e.when,this._structureContextKeys),bT(e)){if(e.command.precondition&&QO._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;QO._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&jn.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let $_e=lV=class extends QO{constructor(e,t,i,n,o,r){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=o,this._contextKeyService=r,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const c=bT(a);c&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const l=kkt(this._id,c?a.command:a,this._hiddenStates);if(c){const d=TYe(this._commandService,this._keybindingService,a.command.id,a.when);(r??=[]).push(new Sc(a.command,a.alt,e,l,d,this._contextKeyService,this._commandService))}else{const d=new lV(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Ar.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new Ty(a,l,h))}}r&&r.length>0&&t.push([n,r])}return t}_sort(e){return e.sort(lV._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(i){if(!n)return-1}else return 1;if(i==="navigation")return-1;if(n==="navigation")return 1;const a=i.localeCompare(n);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:lV._compareTitles(bT(e)?e.command.title:e.title,bT(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,n=typeof t=="string"?t:t.original;return i.localeCompare(n)}};$_e=lV=D([_(3,vi),_(4,Ut),_(5,Le)],$_e);let bJ=class{constructor(e,t,i,n,o,r){this._disposables=new Z,this._menuInfo=new $_e(e,t,i.emitEventsForSubmenuChanges,n,o,r);const a=new cn(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(jn.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 Are({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()}};bJ=D([_(3,vi),_(4,Ut),_(5,Le)],bJ);function kkt(s,e,t){const i=aht(e)?e.submenu.id:e.id,n=typeof e.title=="string"?e.title:e.title.value,o=rl({id:`hide/${s.id}/${i}`,label:g(1292,"Hide '{0}'",n),run(){t.updateHidden(s,i,!0)}}),r=rl({id:`toggle/${s.id}/${i}`,label:n,get checked(){return!t.isHidden(s,i)},run(){t.updateHidden(s,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function TYe(s,e,t,i=void 0,n=!0){return rl({id:`configureKeybinding/${t}`,label:g(1293,"Configure Keybinding"),enabled:n,run(){const r=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;s.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(r?` +when:${r}`:""))}})}var G_e,pL;let K_e=(pL=class extends V{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(Ky||bGe)&&this.installWebKitWriteTextWorkaround(),this._register(M.runAndSubscribe(tm,({window:i,disposables:n})=>{n.add(ue(i.document,"copy",()=>this.clearResources()))},{window:si,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new dc;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,ky().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(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(ue(t,"click",e)),i.add(ue(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 ky().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=Hu(),i=t.activeElement,n=t.body.appendChild(fe("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),Yr(i)&&i.focus(),n.remove()}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await ky().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 Wc(e.substring(0,G_e.MAX_RESOURCE_STATE_SOURCE_LENGTH))}async hasResources(){return this.resources.length>0}clearResources(){this.resources=[],this.resourcesStateHash=void 0}},G_e=pL,pL.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,pL);K_e=G_e=D([_(0,pu),_(1,Ge)],K_e);const dg=ae("clipboardService"),k5="data-keybinding-context";let _Re=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 _se=class _se extends _Re{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}collectAllValues(){return Object.create(null)}};_se.INSTANCE=new _se;let rW=_se;const Uz=class Uz extends _Re{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Dh.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===St.DEFAULT){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new Q_e(o))}else{const o=[];for(const r of n.affectedKeys){const a=`config.${r}`,c=this._values.findSuperstr(a);c!==void 0&&(o.push(...hi.map(c,([l])=>l)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new Q_e(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Uz._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Uz._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)?n=JSON.stringify(i):n=i}return this._values.set(e,n),n}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()}}};Uz._keyPrefix="config.";let q_e=Uz;class Ikt{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 gWe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Q_e{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 Tkt{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 Lkt(s,e){return s.allKeysContainedIn(new Set(Object.keys(e)))}class LYe extends V{constructor(e){super(),this._onDidChangeContext=this._register(new kk({merge:t=>new Tkt(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 Ikt(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 Rkt(this,e)}createOverlay(e=hi.empty()){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new vRe(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 gWe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new gWe(e))}getContext(e){return this._isDisposed?rW.INSTANCE:this.getContextValuesContainer(Mkt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let j_e=class extends LYe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new q_e(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?rW.INSTANCE:this._contexts.get(e)||rW.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 _Re(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}updateParent(e){throw new Error("Cannot update parent of root ContextKeyService")}};j_e=D([_(0,Te)],j_e);class Rkt extends LYe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new wn),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(k5)){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(k5,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;Lkt(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(k5),super.dispose())}getContextValuesContainer(e){return this._isDisposed?rW.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 n=this._parent.getContextValuesContainer(this._parent.contextId);t.updateParent(n);const o=t.collectAllValues(),r={...o8(i,o),...o8(o,i)},a=Object.keys(r);this._onDidChangeContext.fire(new Q_e(a))}}class fWe{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 vRe{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 fWe(this.parent.getContext(e),this.overlay)}getContextValuesContainer(e){const t=this.parent.getContextValuesContainer(e);return new fWe(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=hi.empty()){return new vRe(this,e)}updateParent(){throw new Error("Not supported.")}}function Mkt(s){for(;s;){if(s.hasAttribute(k5)){const e=s.getAttribute(k5);return e?parseInt(e,10):NaN}s=s.parentElement}return 0}function Nkt(s,e,t){s.get(Le).createKey(String(e),Pkt(t))}function Pkt(s){return S2(s,e=>{if(typeof e=="object"&&e.$mid===ws.Uri)return N.revive(e).toString();if(e instanceof N)return e.toString()})}_t.registerCommand("_setContext",Nkt);_t.registerCommand({id:"getContextKeyInfo",handler(){return[...Q.all()].sort((s,e)=>s.key.localeCompare(e.key))},metadata:{description:g(1294,"A command that returns information about context keys"),args:[]}});_t.registerCommand("_generateContextKeyInfo",function(){const s=[],e=new Set;for(const t of Q.all())e.has(t.key)||(e.add(t.key),s.push(t));s.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(s,void 0,2))});let Fkt=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class pWe{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),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.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 Fkt(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._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const ov=ae("themeService");let P_e=class extends V{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=jl.Unknown,this._onDidChangeScreenReaderOptimized=new I,this._onDidChangeReducedMotion=new I,this._onDidChangeLinkUnderline=new I,this._accessibilityModeEnabledContext=V7.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const o=si.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(o),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(ue(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()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===jl.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){Mr(e)}status(e){Ch(e)}};P_e=D([_(0,Le),_(1,fu),_(2,Te)],P_e);var kP,aV;let F_e=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new O_e(i)}createMenu(e,t,i){return new _J(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new _J(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),o=n.getActions(i);return n.dispose(),o}getMenuContexts(e){const t=new $O(e,!1);return new Set([...t.structureContextKeys,...t.preconditionContextKeys,...t.toggledContextKeys])}resetHiddenStates(e){this._hiddenStates.reset(e)}};F_e=D([_(0,vi),_(1,Ut),_(2,$i)],F_e);var dL;let O_e=(dL=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(kP._key,Ie.PROFILE,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(Ie.PROFILE,kP._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(kP._key,Ie.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),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}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&&Jot(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(kP._key,e,Ie.PROFILE,an.USER)}finally{this._ignoreChangeEvent=!1}}},kP=dL,dL._key="menu.hiddenCommands",dL);O_e=kP=D([_(0,$i)],O_e);class $O{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,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=this._sort(jn.getMenuItems(this._id));let t;for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_sort(e){return e}_collectContextKeys(e){if($O._fillInKbExprKeys(e.when,this._structureContextKeys),pT(e)){if(e.command.precondition&&$O._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;$O._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&jn.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let B_e=aV=class extends $O{constructor(e,t,i,n,o,r){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=o,this._contextKeyService=r,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const c=pT(a);c&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const l=_kt(this._id,c?a.command:a,this._hiddenStates);if(c){const d=CYe(this._commandService,this._keybindingService,a.command.id,a.when);(r??=[]).push(new Sc(a.command,a.alt,e,l,d,this._contextKeyService,this._commandService))}else{const d=new aV(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Ar.join(...d.map(u=>u[1]));h.length>0&&(r??=[]).push(new Dy(a,l,h))}}r&&r.length>0&&t.push([n,r])}return t}_sort(e){return e.sort(aV._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(i){if(!n)return-1}else return 1;if(i==="navigation")return-1;if(n==="navigation")return 1;const a=i.localeCompare(n);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:aV._compareTitles(pT(e)?e.command.title:e.title,pT(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,n=typeof t=="string"?t:t.original;return i.localeCompare(n)}};B_e=aV=D([_(3,vi),_(4,Ut),_(5,Le)],B_e);let _J=class{constructor(e,t,i,n,o,r){this._disposables=new Z,this._menuInfo=new B_e(e,t,i.emitEventsForSubmenuChanges,n,o,r);const a=new cn(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(jn.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 wre({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()}};_J=D([_(3,vi),_(4,Ut),_(5,Le)],_J);function _kt(s,e,t){const i=Ydt(e)?e.submenu.id:e.id,n=typeof e.title=="string"?e.title:e.title.value,o=ol({id:`hide/${s.id}/${i}`,label:g(1292,"Hide '{0}'",n),run(){t.updateHidden(s,i,!0)}}),r=ol({id:`toggle/${s.id}/${i}`,label:n,get checked(){return!t.isHidden(s,i)},run(){t.updateHidden(s,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function CYe(s,e,t,i=void 0,n=!0){return ol({id:`configureKeybinding/${t}`,label:g(1293,"Configure Keybinding"),enabled:n,run(){const r=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;s.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(r?` +when:${r}`:""))}})}var W_e,hL;let H_e=(hL=class extends V{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(zy||hGe)&&this.installWebKitWriteTextWorkaround(),this._register(M.runAndSubscribe(Xp,({window:i,disposables:n})=>{n.add(ue(i.document,"copy",()=>this.clearResources()))},{window:si,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new dc;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,Ey().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(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(ue(t,"click",e)),i.add(ue(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 Ey().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=Bu(),i=t.activeElement,n=t.body.appendChild(fe("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),Yr(i)&&i.focus(),n.remove()}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await Ey().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 Wc(e.substring(0,W_e.MAX_RESOURCE_STATE_SOURCE_LENGTH))}async hasResources(){return this.resources.length>0}clearResources(){this.resources=[],this.resourcesStateHash=void 0}},W_e=hL,hL.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,hL);H_e=W_e=D([_(0,fu),_(1,Ge)],H_e);const ag=ae("clipboardService"),E5="data-keybinding-context";let oRe=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 gse=class gse extends oRe{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}collectAllValues(){return Object.create(null)}};gse.INSTANCE=new gse;let iW=gse;const Bz=class Bz extends oRe{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Eh.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===St.DEFAULT){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new V_e(o))}else{const o=[];for(const r of n.affectedKeys){const a=`config.${r}`,c=this._values.findSuperstr(a);c!==void 0&&(o.push(...hi.map(c,([l])=>l)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new V_e(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Bz._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Bz._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)?n=JSON.stringify(i):n=i}return this._values.set(e,n),n}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()}}};Bz._keyPrefix="config.";let U_e=Bz;class vkt{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 tWe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class V_e{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 bkt{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 wkt(s,e){return s.allKeysContainedIn(new Set(Object.keys(e)))}class SYe extends V{constructor(e){super(),this._onDidChangeContext=this._register(new Sk({merge:t=>new bkt(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 vkt(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 ykt(this,e)}createOverlay(e=hi.empty()){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new rRe(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 tWe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new tWe(e))}getContext(e){return this._isDisposed?iW.INSTANCE:this.getContextValuesContainer(Ckt(e))}dispose(){super.dispose(),this._isDisposed=!0}}let z_e=class extends SYe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new U_e(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?iW.INSTANCE:this._contexts.get(e)||iW.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 oRe(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}updateParent(e){throw new Error("Cannot update parent of root ContextKeyService")}};z_e=D([_(0,Te)],z_e);class ykt extends SYe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new wn),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(E5)){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(E5,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;wkt(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(E5),super.dispose())}getContextValuesContainer(e){return this._isDisposed?iW.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 n=this._parent.getContextValuesContainer(this._parent.contextId);t.updateParent(n);const o=t.collectAllValues(),r={...i8(i,o),...i8(o,i)},a=Object.keys(r);this._onDidChangeContext.fire(new V_e(a))}}class iWe{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 rRe{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 iWe(this.parent.getContext(e),this.overlay)}getContextValuesContainer(e){const t=this.parent.getContextValuesContainer(e);return new iWe(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=hi.empty()){return new rRe(this,e)}updateParent(){throw new Error("Not supported.")}}function Ckt(s){for(;s;){if(s.hasAttribute(E5)){const e=s.getAttribute(E5);return e?parseInt(e,10):NaN}s=s.parentElement}return 0}function Skt(s,e,t){s.get(Le).createKey(String(e),Akt(t))}function Akt(s){return b2(s,e=>{if(typeof e=="object"&&e.$mid===ws.Uri)return N.revive(e).toString();if(e instanceof N)return e.toString()})}_t.registerCommand("_setContext",Skt);_t.registerCommand({id:"getContextKeyInfo",handler(){return[...Y.all()].sort((s,e)=>s.key.localeCompare(e.key))},metadata:{description:g(1294,"A command that returns information about context keys"),args:[]}});_t.registerCommand("_generateContextKeyInfo",function(){const s=[],e=new Set;for(const t of Y.all())e.has(t.key)||(e.add(t.key),s.push(t));s.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(s,void 0,2))});let Ekt=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class nWe{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),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.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 Ekt(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]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}const Okt=!1;class mWe extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class T3{constructor(e=new Uc,t=!1,i,n=Okt){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(we,this),this._globalGraph=n?i?._globalGraph??new pWe(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,bt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)wN(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,n=new class extends T3{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=I5.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw Cre("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{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof wi?(i=I5.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=I5.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=b_.getServiceDependencies(e).sort((a,c)=>a.index-c.index),o=[];for(const a of n){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=n.length>0?n[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 wi)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 wi?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 n=new pWe(c=>c.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const c=r.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),n.lookupOrInsertNode(c),o++>1e3)throw new mWe(n);for(const l of b_.getServiceDependencies(c.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(l.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${l.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(c.id),String(l.id)),d instanceof wi){const h={id:l.id,desc:d,_trace:c._trace.branch(l.id,!0)};n.lookup(h)||r.push(h),n.insertEdge(c,h)}}}}for(;;){const c=n.roots();if(c.length===0){if(!n.isEmpty())throw new mWe(n);break}for(const{data:l}of c){if(this._getServiceInstanceOrDescriptor(l.id)instanceof wi){const h=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setCreatedServiceInstance(l.id,h)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof wi)return this._createServiceInstance(e,t,i,n,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o,r){if(n){const a=new T3(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const c=new Map,l=new hpe(()=>{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 hl,c.set(h,p)),(v,b,w)=>{if(l.isInitialized)return l.value[h](v,b,w);{const y={listener:[v,b,w],disposable:void 0},C=p.push(y);return Ee(()=>{C(),y.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 j0;(function(s){s[s.None=0]="None",s[s.Creation=1]="Creation",s[s.Invocation=2]="Invocation",s[s.Branch=3]="Branch"})(j0||(j0={}));const Df=class Df{static traceInvocation(e,t){return e?new Df(j0.Invocation,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}const xkt=!1;class sWe extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class D3{constructor(e=new Uc,t=!1,i,n=xkt){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(we,this),this._globalGraph=n?i?._globalGraph??new nWe(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,bt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)mN(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,n=new class extends D3{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=x5.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw vre("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{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof wi?(i=x5.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=x5.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=m_.getServiceDependencies(e).sort((a,c)=>a.index-c.index),o=[];for(const a of n){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=n.length>0?n[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 wi)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 wi?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 n=new nWe(c=>c.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const c=r.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),n.lookupOrInsertNode(c),o++>1e3)throw new sWe(n);for(const l of m_.getServiceDependencies(c.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(l.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${l.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(c.id),String(l.id)),d instanceof wi){const h={id:l.id,desc:d,_trace:c._trace.branch(l.id,!0)};n.lookup(h)||r.push(h),n.insertEdge(c,h)}}}}for(;;){const c=n.roots();if(c.length===0){if(!n.isEmpty())throw new sWe(n);break}for(const{data:l}of c){if(this._getServiceInstanceOrDescriptor(l.id)instanceof wi){const h=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setCreatedServiceInstance(l.id,h)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof wi)return this._createServiceInstance(e,t,i,n,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o,r){if(n){const a=new D3(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const c=new Map,l=new ope(()=>{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 dl,c.set(h,p)),(v,b,w)=>{if(l.isInitialized)return l.value[h](v,b,w);{const y={listener:[v,b,w],disposable:void 0},C=p.push(y);return Ee(()=>{C(),y.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 G0;(function(s){s[s.None=0]="None",s[s.Creation=1]="Creation",s[s.Invocation=2]="Invocation",s[s.Branch=3]="Branch"})(G0||(G0={}));const Af=class Af{static traceInvocation(e,t){return e?new Af(G0.Invocation,t.name||new Error().stack.split(` `).slice(3,4).join(` -`)):Df._None}static traceCreation(e,t){return e?new Df(j0.Creation,t.name):Df._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Df(j0.Branch,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Df._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 n=[`${this.type===j0.Creation?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Df._totals.toFixed(2)}ms)`];(e>2||t)&&Df.all.add(n.join(` -`))}};Df.all=new Set,Df._None=new class extends Df{constructor(){super(j0.None,null)}stop(){}branch(){return this}},Df._totals=0;let I5=Df;const Bkt=new Set([pe.inMemory,pe.vscodeSourceControl,pe.walkThrough,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeCopilotBackingChatCodeBlock]);class Wkt{constructor(){this._byResource=new ui,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new ui,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,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??hi.empty():N.isUri(e)?this._byResource.get(e)?.values()??hi.empty():hi.map(hi.concat(...this._byOwner.values()),t=>t[1])}}class Hkt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ui,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 n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Bkt.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ws.Error?t.errors+=1:i===Ws.Warning?t.warnings+=1:i===Ws.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 RE{constructor(){this._onMarkerChanged=new Are({delay:0,merge:RE._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Wkt,this._stats=new Hkt(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(uU(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=RE._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,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:n,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const o of n){const r=hi.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(eo(t)){const o=new ui;for(const{resource:r,marker:a}of t){const c=RE._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:n,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(RE._accept(c,n)){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(RE._accept(c,n)){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(RE._accept(l,n)){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 ui;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}const bRe=ae("policy");let RYe=class extends V{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=as.createEmptyModel(this.logService)}async initialize(){return this.resetConfigurationModel(),this._register(Qe.as(Nn.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,Qe.as(Nn.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=as.createEmptyModel(this.logService);const e=Qe.as(Nn.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const o=i[n],r=t[n];o!==void 0?this._configurationModel.setValue(n,o):r?this._configurationModel.setValue(n,r.default):this._configurationModel.removeValue(n)}}};class Ukt{constructor(){this.onDidChangeConfiguration=M.None,this.configurationModel=as.createEmptyModel(new Syt)}async initialize(){return this.configurationModel}}let Y_e=class extends V{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=as.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=[],n=Qe.as(Nn.Configuration).getConfigurationProperties();for(const o of e){const r=n[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 CA(t)||await this.policyService.updatePolicyDefinitions(t),i}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);const t=Qe.as(Nn.Configuration).getPolicyConfigurations(),i=Fi(e.map(n=>t.get(n)));this.update(i,!0)}update(e,t){this.logService.trace("PolicyConfiguration#update",e);const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n=[],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:!Ys(this._configurationModel.getValue(r),c))&&n.push([r,c])}else this._configurationModel.getValue(r)!==void 0&&n.push([r,void 0])}if(n.length){this.logService.trace("PolicyConfiguration#changed",n);const r=this._configurationModel;this._configurationModel=as.createEmptyModel(this.logService);for(const a of r.keys)this._configurationModel.setValue(a,r.getValue(a));for(const[a,c]of n)c===void 0?this._configurationModel.removeValue(a):this._configurationModel.setValue(a,c);t&&this._onDidChangeConfiguration.fire(this._configurationModel)}}};Y_e=D([_(1,bRe),_(2,Ge)],Y_e);const lv=ae("accessibilitySignalService");class MYe extends V{constructor(e,t=[]){super(),this.logger=new Cyt([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 Vkt{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 J_e=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Hrt(new Vkt(t))):Promise.reject(new Error("Model not found"))}registerTextModelContentProvider(e,t){return{dispose:function(){}}}canHandleResource(e){return!1}};J_e=D([_(0,gi)],J_e);const vse=class vse{show(){return vse.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};vse.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let X_e=vse;class zkt{withProgress(e,t,i){return t({report:()=>{}})}}class $kt{constructor(){this.stateResource=N.from({scheme:"monaco",authority:"stateResource"}),this.userRoamingDataHome=N.from({scheme:"monaco",authority:"userRoamingDataHome"}),this.keyboardLayoutResource=N.from({scheme:"monaco",authority:"keyboardLayoutResource"}),this.argvResource=N.from({scheme:"monaco",authority:"argvResource"}),this.untitledWorkspacesHome=N.from({scheme:"monaco",authority:"untitledWorkspacesHome"}),this.workspaceStorageHome=N.from({scheme:"monaco",authority:"workspaceStorageHome"}),this.localHistoryHome=N.from({scheme:"monaco",authority:"localHistoryHome"}),this.cacheHome=N.from({scheme:"monaco",authority:"cacheHome"}),this.userDataSyncHome=N.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=N.from({scheme:"monaco",authority:"logsHome"}),this.logLevel=void 0,this.extensionLogLevel=void 0,this.verbose=!1,this.isBuilt=!1,this.disableTelemetry=!1,this.serviceMachineIdResource=N.from({scheme:"monaco",authority:"serviceMachineIdResource"}),this.policyFile=void 0}}class Gkt{constructor(){this.onWillShowDialog=M.None,this.onDidShowDialog=M.None}async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` +`)):Af._None}static traceCreation(e,t){return e?new Af(G0.Creation,t.name):Af._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Af(G0.Branch,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Af._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 n=[`${this.type===G0.Creation?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Af._totals.toFixed(2)}ms)`];(e>2||t)&&Af.all.add(n.join(` +`))}};Af.all=new Set,Af._None=new class extends Af{constructor(){super(G0.None,null)}stop(){}branch(){return this}},Af._totals=0;let x5=Af;const Dkt=new Set([pe.inMemory,pe.vscodeSourceControl,pe.walkThrough,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeCopilotBackingChatCodeBlock]);class kkt{constructor(){this._byResource=new ui,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new ui,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,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return typeof e=="string"?this._byOwner.get(e)?.values()??hi.empty():N.isUri(e)?this._byResource.get(e)?.values()??hi.empty():hi.map(hi.concat(...this._byOwner.values()),t=>t[1])}}class Ikt{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ui,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 n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Dkt.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ws.Error?t.errors+=1:i===Ws.Warning?t.warnings+=1:i===Ws.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 IE{constructor(){this._onMarkerChanged=new wre({delay:0,merge:IE._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new kkt,this._stats=new Ikt(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(aU(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=IE._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,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:n,severity:o,message:r,source:a,startLineNumber:c,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const o of n){const r=hi.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(eo(t)){const o=new ui;for(const{resource:r,marker:a}of t){const c=IE._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:n,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(IE._accept(c,n)){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(IE._accept(c,n)){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(IE._accept(l,n)){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 ui;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}const aRe=ae("policy");let AYe=class extends V{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=as.createEmptyModel(this.logService)}async initialize(){return this.resetConfigurationModel(),this._register(Qe.as(Nn.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,Qe.as(Nn.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:e})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=as.createEmptyModel(this.logService);const e=Qe.as(Nn.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const o=i[n],r=t[n];o!==void 0?this._configurationModel.setValue(n,o):r?this._configurationModel.setValue(n,r.default):this._configurationModel.removeValue(n)}}};class Tkt{constructor(){this.onDidChangeConfiguration=M.None,this.configurationModel=as.createEmptyModel(new uyt)}async initialize(){return this.configurationModel}}let $_e=class extends V{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=as.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=[],n=Qe.as(Nn.Configuration).getConfigurationProperties();for(const o of e){const r=n[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 wA(t)||await this.policyService.updatePolicyDefinitions(t),i}onDidChangePolicies(e){this.logService.trace("PolicyConfiguration#onDidChangePolicies",e);const t=Qe.as(Nn.Configuration).getPolicyConfigurations(),i=Fi(e.map(n=>t.get(n)));this.update(i,!0)}update(e,t){this.logService.trace("PolicyConfiguration#update",e);const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n=[],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:!Ys(this._configurationModel.getValue(r),c))&&n.push([r,c])}else this._configurationModel.getValue(r)!==void 0&&n.push([r,void 0])}if(n.length){this.logService.trace("PolicyConfiguration#changed",n);const r=this._configurationModel;this._configurationModel=as.createEmptyModel(this.logService);for(const a of r.keys)this._configurationModel.setValue(a,r.getValue(a));for(const[a,c]of n)c===void 0?this._configurationModel.removeValue(a):this._configurationModel.setValue(a,c);t&&this._onDidChangeConfiguration.fire(this._configurationModel)}}};$_e=D([_(1,aRe),_(2,Ge)],$_e);const rv=ae("accessibilitySignalService");class EYe extends V{constructor(e,t=[]){super(),this.logger=new hyt([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 Lkt{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 G_e=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Irt(new Lkt(t))):Promise.reject(new Error("Model not found"))}registerTextModelContentProvider(e,t){return{dispose:function(){}}}canHandleResource(e){return!1}};G_e=D([_(0,gi)],G_e);const fse=class fse{show(){return fse.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};fse.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let K_e=fse;class Rkt{withProgress(e,t,i){return t({report:()=>{}})}}class Mkt{constructor(){this.stateResource=N.from({scheme:"monaco",authority:"stateResource"}),this.userRoamingDataHome=N.from({scheme:"monaco",authority:"userRoamingDataHome"}),this.keyboardLayoutResource=N.from({scheme:"monaco",authority:"keyboardLayoutResource"}),this.argvResource=N.from({scheme:"monaco",authority:"argvResource"}),this.untitledWorkspacesHome=N.from({scheme:"monaco",authority:"untitledWorkspacesHome"}),this.workspaceStorageHome=N.from({scheme:"monaco",authority:"workspaceStorageHome"}),this.localHistoryHome=N.from({scheme:"monaco",authority:"localHistoryHome"}),this.cacheHome=N.from({scheme:"monaco",authority:"cacheHome"}),this.userDataSyncHome=N.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=N.from({scheme:"monaco",authority:"logsHome"}),this.logLevel=void 0,this.extensionLogLevel=void 0,this.verbose=!1,this.isBuilt=!1,this.disableTelemetry=!1,this.serviceMachineIdResource=N.from({scheme:"monaco",authority:"serviceMachineIdResource"}),this.policyFile=void 0}}class Nkt{constructor(){this.onWillShowDialog=M.None,this.onDidShowDialog=M.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),si.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const n=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&n.push(e.cancelButton),t=await n[0]?.run({checkboxChecked:!1})}return{result:t}}async info(e,t){await this.prompt({type:Xe.Info,message:e,detail:t})}async warn(e,t){await this.prompt({type:Xe.Warning,message:e,detail:t})}async error(e,t){await this.prompt({type:Xe.Error,message:e,detail:t})}input(){return Promise.resolve({confirmed:!1})}about(){return Promise.resolve(void 0)}}const Vz=class Vz{constructor(){this.onDidAddNotification=M.None,this.onDidRemoveNotification=M.None,this.onDidChangeFilter=M.None}info(e){return this.notify({severity:Xe.Info,message:e})}warn(e){return this.notify({severity:Xe.Warning,message:e})}error(e){return this.notify({severity:Xe.Error,message:e})}notify(e){switch(e.severity){case Xe.Error:console.error(e.message);break;case Xe.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Vz.NO_OP}prompt(e,t,i,n){return Vz.NO_OP}status(e,t){return V.None}setFilter(e){}getFilter(e){return Dme.OFF}getFilters(){return[]}removeFilter(e){}};Vz.NO_OP=new Xwt;let Z_e=Vz,eve=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=_t.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};eve=D([_(0,we)],eve);let jk=class extends dje{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const p=new Z;p.add(ue(f,ke.KEY_DOWN,m=>{const v=new En(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),p.add(ue(f,ke.KEY_UP,m=>{const v=new En(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Kkt(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,n){return jr(_t.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:ape(i.keybinding,po),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 si.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new Dx(void 0,o.command,o.commandArgs,r,t,null,!1);else{const c=this.resolveKeybinding(a);for(const l of c)i[n++]=new Dx(l,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeybinding(e){return Y2.resolveKeybinding(e,po)}resolveKeyboardEvent(e){const t=new Ih(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Y2([t],po)}resolveUserBinding(e){return[]}_dumpDebugInfo(){return""}_dumpDebugInfoJSON(){return""}registerSchemaContribution(e){}enableKeybindingHoldMode(e){}};jk=D([_(0,Le),_(1,vi),_(2,Yi),_(3,bi),_(4,Ge),_(5,Kt)],jk);class Kkt extends V{constructor(e,t){super(),this.domNode=e,this._register(t)}}function _We(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof N)}let wJ=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new RYe(e);this._configuration=new u3(t.reload(),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),new ui,as.createEmptyModel(e),new ui,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=_We(e)?e:_We(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[o,r]=n;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const n=new PLe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);n.source=St.MEMORY,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}updateValue(e,t,i,n){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:[]}}};wJ=D([_(0,Ge)],wJ);let tve=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(n=>{this._onDidChangeConfiguration.fire({affectedKeys:n.affectedKeys,affectsConfiguration:(o,r)=>n.affectsConfiguration(r)})})}getValue(e,t,i){const n=oe.isIPosition(t)?t:null,o=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,n):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 n=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:n})}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,n){return this.configurationService.updateValue(t,i,{resource:e},n)}};tve=D([_(0,Te),_(1,gi),_(2,xi)],tve);let ive=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:pr||Qt?` +`+t),si.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const n=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&n.push(e.cancelButton),t=await n[0]?.run({checkboxChecked:!1})}return{result:t}}async info(e,t){await this.prompt({type:Xe.Info,message:e,detail:t})}async warn(e,t){await this.prompt({type:Xe.Warning,message:e,detail:t})}async error(e,t){await this.prompt({type:Xe.Error,message:e,detail:t})}input(){return Promise.resolve({confirmed:!1})}about(){return Promise.resolve(void 0)}}const Wz=class Wz{constructor(){this.onDidAddNotification=M.None,this.onDidRemoveNotification=M.None,this.onDidChangeFilter=M.None}info(e){return this.notify({severity:Xe.Info,message:e})}warn(e){return this.notify({severity:Xe.Warning,message:e})}error(e){return this.notify({severity:Xe.Error,message:e})}notify(e){switch(e.severity){case Xe.Error:console.error(e.message);break;case Xe.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Wz.NO_OP}prompt(e,t,i,n){return Wz.NO_OP}status(e,t){return V.None}setFilter(e){}getFilter(e){return yme.OFF}getFilters(){return[]}removeFilter(e){}};Wz.NO_OP=new Uwt;let q_e=Wz,Q_e=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=_t.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};Q_e=D([_(0,we)],Q_e);let $k=class extends ije{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const p=new Z;p.add(ue(f,ke.KEY_DOWN,m=>{const v=new En(m);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),p.add(ue(f,ke.KEY_UP,m=>{const v=new En(m);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new Pkt(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,n){return jr(_t.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:tpe(i.keybinding,po),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 si.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new Ax(void 0,o.command,o.commandArgs,r,t,null,!1);else{const c=this.resolveKeybinding(a);for(const l of c)i[n++]=new Ax(l,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeybinding(e){return K2.resolveKeybinding(e,po)}resolveKeyboardEvent(e){const t=new Dh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new K2([t],po)}resolveUserBinding(e){return[]}_dumpDebugInfo(){return""}_dumpDebugInfoJSON(){return""}registerSchemaContribution(e){}enableKeybindingHoldMode(e){}};$k=D([_(0,Le),_(1,vi),_(2,Yi),_(3,bi),_(4,Ge),_(5,Kt)],$k);class Pkt extends V{constructor(e,t){super(),this.domNode=e,this._register(t)}}function oWe(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof N)}let vJ=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new I,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new AYe(e);this._configuration=new l3(t.reload(),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),as.createEmptyModel(e),new ui,as.createEmptyModel(e),new ui,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=oWe(e)?e:oWe(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[o,r]=n;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const n=new SLe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);n.source=St.MEMORY,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}updateValue(e,t,i,n){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:[]}}};vJ=D([_(0,Ge)],vJ);let j_e=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(n=>{this._onDidChangeConfiguration.fire({affectedKeys:n.affectedKeys,affectsConfiguration:(o,r)=>n.affectsConfiguration(r)})})}getValue(e,t,i){const n=oe.isIPosition(t)?t:null,o=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,n):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 n=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:n})}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,n){return this.configurationService.updateValue(t,i,{resource:e},n)}};j_e=D([_(0,Te),_(1,gi),_(2,xi)],j_e);let Y_e=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:pr||Qt?` `:`\r -`}};ive=D([_(0,Te)],ive);class qkt{constructor(){this.telemetryLevel=Kg.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 JF=class JF{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=N.from({scheme:JF.SCHEME,authority:"model",path:"/"});this.workspace={id:_je,folders:[new pae({uri:e,name:"",index:0})]}}getCompleteWorkspace(){return Promise.resolve(this.getWorkspace())}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace?this.workspace.configuration?qi.WORKSPACE:qi.FOLDER:qi.EMPTY}getWorkspaceFolder(e){return e&&e.scheme===JF.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===JF.SCHEME}isCurrentWorkspace(e){return!0}};JF.SCHEME="inmemory";let nve=JF;function yJ(s,e,t){if(!e||!(s instanceof wJ))return;const i=[];Object.keys(e).forEach(n=>{HSt(n)&&i.push([`editor.${n}`,e[n]]),t&&USt(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let sve=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return V.None}async apply(e,t){const i=Array.isArray(e)?e:gae.convert(e),n=new Map;for(const a of i){if(!(a instanceof tA))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=n.get(c);l||(l=[],n.set(c,l)),l.push(Zn.replaceMove(F.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,c]of n)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),r+=1,o+=c.length;return{ariaSummary:$p(Xme.bulkEditServiceSummary,o,r),isApplied:o>0}}};sve=D([_(0,gi)],sve);class Qkt{constructor(){this.onDidChangeFormatters=M.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return _i(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 ove=class extends FSt{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};ove=D([_(0,pu),_(1,Kt)],ove);class jkt{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 Ykt extends QY{constructor(){super()}}class Jkt extends MYe{constructor(){super(new yyt)}}let rve=class extends p_e{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.configure({blockMouse:!1})}};rve=D([_(0,Yi),_(1,bi),_(2,mf),_(3,Ut),_(4,Oa),_(5,Le)],rve);class Xkt{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return H6e.const(!1)}getDelayMs(e,t){return 0}isSoundEnabled(e){return!1}isAnnouncementEnabled(e){return!1}onSoundEnabledChanged(e){return M.None}async playSound(e,t){}playSignalLoop(e){return Ee(()=>{})}}ce(Ge,Jkt,qt.Eager);ce(Te,wJ,qt.Eager);ce(Ec,tve,qt.Eager);ce(CTe,ive,qt.Eager);ce(yi,nve,qt.Eager);ce(Fs,Qkt,qt.Eager);ce(Yi,qkt,qt.Eager);ce(to,Gkt,qt.Eager);ce(Za,$kt,qt.Eager);ce(bi,Z_e,qt.Eager);ce(Am,RE,qt.Eager);ce(xi,Ykt,qt.Eager);ce(cv,Dkt,qt.Eager);ce(gi,C_e,qt.Eager);ce(DTe,y_e,qt.Eager);ce(Le,j_e,qt.Eager);ce(cg,zkt,qt.Eager);ce(XA,X_e,qt.Eager);ce($i,AEt,qt.Eager);ce(Ml,Lpe,qt.Eager);ce(PN,sve,qt.Eager);ce(uC,jkt,qt.Eager);ce(fn,J_e,qt.Eager);ce(mr,U_e,qt.Eager);ce(lg,DDt,qt.Eager);ce(vi,eve,qt.Eager);ce(Ut,jk,qt.Eager);ce(In,k3,qt.Eager);ce(mf,ove,qt.Eager);ce(Ao,w_e,qt.Eager);ce(dg,K_e,qt.Eager);ce(lr,rve,qt.Eager);ce(Oa,V_e,qt.Eager);ce(lv,Xkt,qt.Eager);var Dt;(function(s){const e=new Uc;for(const[c,l]of Spe())e.set(c,l);const t=new T3(e,!0);e.set(we,t);function i(c){n||r({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof wi?t.invokeFunction(d=>d.get(c)):l}s.get=i;let n=!1;const o=new I;function r(c){if(n)return t;n=!0;for(const[l,d]of Spe())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof wi&&e.set(d,c[l])}return o.fire(),t}s.initialize=r;function a(c){if(n)return c();const l=new Z,d=l.add(o.event(()=>{d.dispose(),l.add(c())}));return l}s.withServices=a})(Dt||(Dt={}));var Zkt=".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,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.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}}}}}}}}.monaco-diff-editor .diff-hidden-lines-compact{display:flex;height:11px;.line-left,.line-right{border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);height:1px;margin:auto;opacity:.5;width:100%}.line-left{width:20px}.text{text-wrap:nowrap;color:var(--vscode-editorCodeLens-foreground);font-size:11px;line-height:11px;margin:0 4px}}";ut(Zkt,{});class vm{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new vm(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new vm(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,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,mt.Immediate)}}class tx{static capture(e){if(e.hasPendingScrollAnimation())return new tx(e.getScrollTop(),e.getContentHeight(),null,0);let t=null,i=0;const n=e.getVisibleRanges();return n.length>0&&(t=n.at(-1).getEndPosition(),i=e.getBottomForLineNumber(t.lineNumber)-e.getScrollTop()),new tx(e.getScrollTop(),e.getContentHeight(),t,i)}constructor(e,t,i,n){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n}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,mt.Immediate)}}}function eIt(s,e,t,i){if(s.length===0)return e;if(e.length===0)return s;const n=[];let o=0,r=0;for(;od?(n.push(c),r++):(n.push(i(a,c)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function gF(s,e){return s.appendChild(e),Ee(()=>{e.remove()})}function tIt(s,e){return s.prepend(e),Ee(()=>{e.remove()})}class NYe extends V{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 KKe(e,t)),this._width=jt(this,this.elementSizeObserver.getWidth()),this._height=jt(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>ts(n=>{this._width.set(this.elementSizeObserver.getWidth(),n),this._height.set(this.elementSizeObserver.getHeight(),n)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function vWe(s,e,t){let i=e.get(),n=i,o=i;const r=jt("animatedValue",i);let a=-1;const c=300;let l;t.add(LU({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)},(h,u)=>{l!==void 0&&(s.cancelAnimationFrame(l),l=void 0),n=o,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;o=Math.floor(iIt(h,n,i-n,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const bse=class bse{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${bse._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};bse._counter=0;let ave=bse;function IA(s,e){return ai(t=>{for(let[i,n]of Object.entries(e))n&&typeof n=="object"&&"read"in n&&(n=n.read(t)),typeof n=="number"&&(n=`${n}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),s.style[i]=n})}function SJ(s,e,t,i){const n=new Z,o=[];return n.add(cu((r,a)=>{const c=e.read(r),l=new Map,d=new Map;t&&t(!0),s.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(LU({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),s.changeViewZones(f=>{for(const p of u.zoneIds)f.layoutZone(p)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),s.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),n}class nIt extends ci{dispose(){super.dispose(!0)}}function bWe(s,e){const t=Ak(e,n=>n.original.startLineNumber<=s.lineNumber);if(!t)return F.fromPositions(s);if(t.original.endLineNumberExclusive<=s.lineNumber){const n=s.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return F.fromPositions(new oe(n,s.column))}if(!t.innerChanges)return F.fromPositions(new oe(t.modified.startLineNumber,1));const i=Ak(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(s));if(!i){const n=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return F.fromPositions(new oe(n,s.column))}if(i.originalRange.containsPosition(s))return i.modifiedRange;{const n=sIt(i.originalRange.getEndPosition(),s);return F.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function sIt(s,e){return s.lineNumber===e.lineNumber?new eg(0,e.column-s.column):new eg(e.lineNumber-s.lineNumber,e.column-1)}function oIt(s,e){let t;return s.filter(i=>{const n=e(i,t);return t=i,n})}class aW{static create(e,t=void 0){return new Phe(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new Z;return n.add(t),n.add(e),new Phe(e,n,i)}static createOfNonDisposable(e,t,i=void 0){return new Phe(e,t,i)}}class Phe extends aW{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new rIt(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class rIt extends aW{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}function yRe(s,e,t){return zAt({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>t.getValue(s)??e)}function Iv(s,e,t){const i=s.bindTo(e);return v6({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}let wWe=class extends V{constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=Kn(this,this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new xj(n=>yRe(n.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new xj({getCacheKey:kAt},n=>Ze(o=>{const r=this._signalConfigValue.get(n.signal).read(o);return!!((n.modality==="sound"||n.modality===void 0)&&yWe(r.sound,()=>this.screenReaderAttached.read(o),n.userGesture)||(n.modality==="announcement"||n.modality===void 0)&&yWe(r.announcement,()=>this.screenReaderAttached.read(o),n.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new $Le(this._signalEnabledState.get({signal:e,userGesture:t,modality:i}))}async playSignal(e,t={}){const i=t.modality==="announcement"||t.modality===void 0,n=e.announcementMessage;i&&this.isAnnouncementEnabled(e,t.userGesture)&&n&&this.accessibilityService.status(n),(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 n=new Set(t.filter(o=>this.isSoundEnabled(o)).map(o=>o.sound.getSound()));await Promise.all(Array.from(n).map(o=>this.playSound(o,!0)))}sendSignalTelemetry(e,t){const i=this.accessibilityService.isScreenReaderOptimized(),n=e.name+(t?`::${t}`:"")+(i?"{screenReaderOptimized}":"");this.sentTelemetry.has(n)||this.getVolumeInPercent()===0||(this.sentTelemetry.add(n),this.telemetryService.publicLog2("signal.played",{signal:e.name,source:t??"",isScreenReaderOptimized:i}))}getVolumeInPercent(){const e=this.configurationService.getValue("accessibility.signalOptions.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=ef.asBrowserUri(`vs/platform/accessibilitySignal/browser/media/${e.fileName}`).toString(!0);try{const n=this.sounds.get(i);if(n)n.volume=this.getVolumeInPercent()/100,n.currentTime=0,await n.play();else{const o=await aIt(i,this.getVolumeInPercent()/100);this.sounds.set(i,o)}}catch(n){n.message.includes("play() can only be initiated by a user gesture")||console.error("Error while playing sound",n)}finally{this.playingSounds.delete(e)}}playSignalLoop(e,t){let i=!0;const n=()=>{i&&this.playSignal(e,{allowManyInParallel:!0}).finally(()=>{setTimeout(()=>{i&&n()},t)})};return n(),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){if(!this.configurationService.getValue("accessibility.signalOptions.debouncePositionChanges"))return 0;let n;return e.name===cl.errorAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.errorAtPosition"):e.name===cl.warningAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.warningAtPosition"):n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.general"),t==="sound"?n.sound:n.announcement}};wWe=D([_(0,Te),_(1,mr),_(2,Yi)],wWe);function yWe(s,e,t){return s==="on"||s==="always"||s==="auto"&&e()||s==="userGesture"&&t}function aIt(s,e){return new Promise((t,i)=>{const n=new Audio(s);n.volume=e,n.addEventListener("ended",()=>{t(n)}),n.addEventListener("error",o=>{i(o.error)}),n.play().catch(o=>{i(o)})})}const Bn=class Bn{static register(e){return new Bn(e.fileName)}constructor(e){this.fileName=e}};Bn.error=Bn.register({fileName:"error.mp3"}),Bn.warning=Bn.register({fileName:"warning.mp3"}),Bn.success=Bn.register({fileName:"success.mp3"}),Bn.foldedArea=Bn.register({fileName:"foldedAreas.mp3"}),Bn.break=Bn.register({fileName:"break.mp3"}),Bn.quickFixes=Bn.register({fileName:"quickFixes.mp3"}),Bn.taskCompleted=Bn.register({fileName:"taskCompleted.mp3"}),Bn.taskFailed=Bn.register({fileName:"taskFailed.mp3"}),Bn.terminalBell=Bn.register({fileName:"terminalBell.mp3"}),Bn.diffLineInserted=Bn.register({fileName:"diffLineInserted.mp3"}),Bn.diffLineDeleted=Bn.register({fileName:"diffLineDeleted.mp3"}),Bn.diffLineModified=Bn.register({fileName:"diffLineModified.mp3"}),Bn.chatRequestSent=Bn.register({fileName:"chatRequestSent.mp3"}),Bn.chatResponseReceived1=Bn.register({fileName:"chatResponseReceived1.mp3"}),Bn.chatResponseReceived2=Bn.register({fileName:"chatResponseReceived2.mp3"}),Bn.chatResponseReceived3=Bn.register({fileName:"chatResponseReceived3.mp3"}),Bn.chatResponseReceived4=Bn.register({fileName:"chatResponseReceived4.mp3"}),Bn.clear=Bn.register({fileName:"clear.mp3"}),Bn.save=Bn.register({fileName:"save.mp3"}),Bn.format=Bn.register({fileName:"format.mp3"}),Bn.voiceRecordingStarted=Bn.register({fileName:"voiceRecordingStarted.mp3"}),Bn.voiceRecordingStopped=Bn.register({fileName:"voiceRecordingStopped.mp3"}),Bn.progress=Bn.register({fileName:"progress.mp3"});let ur=Bn;class cIt{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 Ki=class Ki{constructor(e,t,i,n,o,r){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r}static register(e){const t=new cIt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Ki(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return Ki._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};Ki._signals=new Set,Ki.errorAtPosition=Ki.register({name:g(2242,"Error at Position"),sound:ur.error,announcementMessage:g(2243,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),Ki.warningAtPosition=Ki.register({name:g(2244,"Warning at Position"),sound:ur.warning,announcementMessage:g(2245,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),Ki.errorOnLine=Ki.register({name:g(2246,"Error on Line"),sound:ur.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(2247,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),Ki.warningOnLine=Ki.register({name:g(2248,"Warning on Line"),sound:ur.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(2249,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),Ki.foldedArea=Ki.register({name:g(2250,"Folded Area on Line"),sound:ur.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(2251,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),Ki.break=Ki.register({name:g(2252,"Breakpoint on Line"),sound:ur.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(2253,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),Ki.inlineSuggestion=Ki.register({name:g(2254,"Inline Suggestion on Line"),sound:ur.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),Ki.terminalQuickFix=Ki.register({name:g(2255,"Terminal Quick Fix"),sound:ur.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(2256,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),Ki.onDebugBreak=Ki.register({name:g(2257,"Debugger Stopped on Breakpoint"),sound:ur.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(2258,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),Ki.noInlayHints=Ki.register({name:g(2259,"No Inlay Hints on Line"),sound:ur.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(2260,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),Ki.taskCompleted=Ki.register({name:g(2261,"Task Completed"),sound:ur.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(2262,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),Ki.taskFailed=Ki.register({name:g(2263,"Task Failed"),sound:ur.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(2264,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),Ki.terminalCommandFailed=Ki.register({name:g(2265,"Terminal Command Failed"),sound:ur.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(2266,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),Ki.terminalCommandSucceeded=Ki.register({name:g(2267,"Terminal Command Succeeded"),sound:ur.success,announcementMessage:g(2268,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),Ki.terminalBell=Ki.register({name:g(2269,"Terminal Bell"),sound:ur.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(2270,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),Ki.notebookCellCompleted=Ki.register({name:g(2271,"Notebook Cell Completed"),sound:ur.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(2272,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),Ki.notebookCellFailed=Ki.register({name:g(2273,"Notebook Cell Failed"),sound:ur.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(2274,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),Ki.diffLineInserted=Ki.register({name:g(2275,"Diff Line Inserted"),sound:ur.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),Ki.diffLineDeleted=Ki.register({name:g(2276,"Diff Line Deleted"),sound:ur.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),Ki.diffLineModified=Ki.register({name:g(2277,"Diff Line Modified"),sound:ur.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),Ki.chatRequestSent=Ki.register({name:g(2278,"Chat Request Sent"),sound:ur.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(2279,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),Ki.chatResponseReceived=Ki.register({name:g(2280,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[ur.chatResponseReceived1,ur.chatResponseReceived2,ur.chatResponseReceived3,ur.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),Ki.progress=Ki.register({name:g(2281,"Progress"),sound:ur.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(2282,"Progress"),settingsKey:"accessibility.signals.progress"}),Ki.clear=Ki.register({name:g(2283,"Clear"),sound:ur.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(2284,"Clear"),settingsKey:"accessibility.signals.clear"}),Ki.save=Ki.register({name:g(2285,"Save"),sound:ur.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(2286,"Save"),settingsKey:"accessibility.signals.save"}),Ki.format=Ki.register({name:g(2287,"Format"),sound:ur.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(2288,"Format"),settingsKey:"accessibility.signals.format"}),Ki.voiceRecordingStarted=Ki.register({name:g(2289,"Voice Recording Started"),sound:ur.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),Ki.voiceRecordingStopped=Ki.register({name:g(2290,"Voice Recording Stopped"),sound:ur.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let cl=Ki;var lIt=".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}";ut(lIt,{});const dIt=oi("diff-review-insert",ve.add,g(5250,"Icon for 'Insert' in accessible diff viewer.")),hIt=oi("diff-review-remove",ve.remove,g(5251,"Icon for 'Remove' in accessible diff viewer.")),uIt=oi("diff-review-close",ve.close,g(5252,"Icon for 'Close' in accessible diff viewer."));var pB;let Ix=(pB=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=r,this._diffs=a,this._models=c,this._instantiationService=l,this._state=AI(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(cve,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(lve,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){ts(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){ts(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){ts(e=>{this._setVisible(!1,e)})}},pB._ttPolicy=QA("diffReview",{createHTML:e=>e}),pB);Ix=D([_(8,we)],Ix);let cve=class extends V{constructor(e,t,i,n,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=o,this._groups=jt(this,[]),this._currentGroupIdx=jt(this,0),this._currentElementIdx=jt(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(ai(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const c=gIt(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());ts(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===zh.Deleted?this._accessibilitySignalService.playSignal(cl.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===zh.Added&&this._accessibilitySignalService.playSignal(cl.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ai(r=>{const a=this.currentElement.read(r);if(a&&a.type!==zh.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(F.fromPositions(new oe(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||SM(t,n=>{this._currentGroupIdx.set(mi.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),n),this._currentElementIdx.set(0,n)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||ts(i=>{this._currentElementIdx.set(mi.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&&ts(n=>{this._currentElementIdx.set(i,n)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===zh.Deleted?this._models.originalReveal(F.fromPositions(new oe(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==zh.Header?F.fromPositions(new oe(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};cve=D([_(4,lv)],cve);const v4=3;function gIt(s,e,t){const i=[];for(const n of P1e(s,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*v4)){const o=[];o.push(new pIt);const r=new pi(Math.max(1,n[0].original.startLineNumber-v4),Math.min(n[n.length-1].original.endLineNumberExclusive+v4,e+1)),a=new pi(Math.max(1,n[0].modified.startLineNumber-v4),Math.min(n[n.length-1].modified.endLineNumberExclusive+v4,t+1));v6e(n,(d,h)=>{const u=new pi(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new pi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{o.push(new vIt(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{o.push(new mIt(h,p))}),h.modified.forEach(p=>{o.push(new _It(h,p))}))});const c=n[0].modified.join(n[n.length-1].modified),l=n[0].original.join(n[n.length-1].original);i.push(new fIt(new L_(c,l),o))}return i}var zh;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(zh||(zh={}));class fIt{constructor(e,t){this.range=e,this.lines=t}}class pIt{constructor(){this.type=zh.Header}}class mIt{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=zh.Deleted,this.modifiedLineNumber=void 0}}class _It{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=zh.Added,this.originalLineNumber=void 0}}class vIt{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=zh.Unchanged}}let lve=class extends V{constructor(e,t,i,n,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,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 hd(a)),this._register(ai(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new rn("diffreview.close",g(5253,"Close"),"close-diff-review "+We.asClassName(uIt),!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 EU(this._content,{})),aa(this.domNode,this._scrollbar.getDomNode(),a),this._register(ai(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{aa(this.domNode)})),this._register(IA(this.domNode,{width:this._width,height:this._height})),this._register(IA(this._content,{width:this._width,height:this._height})),this._register(cu((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Ro(this.domNode,"keydown",c=>{(c.equals(S.DownArrow)||c.equals(U.CtrlCmd|S.DownArrow)||c.equals(U.Alt|S.DownArrow))&&(c.preventDefault(),this._model.goToNextLine()),(c.equals(S.UpArrow)||c.equals(U.CtrlCmd|S.UpArrow)||c.equals(U.Alt|S.UpArrow))&&(c.preventDefault(),this._model.goToPreviousLine()),(c.equals(S.Escape)||c.equals(U.CtrlCmd|S.Escape)||c.equals(U.Alt|S.Escape)||c.equals(U.Shift|S.Escape))&&(c.preventDefault(),this._model.close()),(c.equals(S.Space)||c.equals(S.Enter))&&(c.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",g(5254,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Dl(n,i.get(x.fontInfo)),aa(this._content,n);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===zh.Header){const p=document.createElement("div");p.className="diff-review-row",p.setAttribute("role","listitem");const m=d.range,v=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,w=L=>L===0?g(5255,"no lines changed"):L===1?g(5256,"1 line changed"):g(5257,"{0} lines changed",L),y=w(m.original.length),C=w(m.modified.length);p.setAttribute("aria-label",g(5258,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,b,m.original.startLineNumber,y,m.modified.startLineNumber,C));const A=document.createElement("div");A.className="diff-review-cell diff-review-summary",A.appendChild(document.createTextNode(`${v+1}/${b}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),p.appendChild(A),u=p}else u=this._createRow(h,l,this._width.get(),t,o,a,i,r,c);n.appendChild(u);const f=Ze(p=>this._model.currentElement.read(p)===h);e.add(ai(p=>{const m=f.read(p);u.tabIndex=m?0:-1,m&&u.focus()})),e.add(ue(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,r,a,c,l){const d=n.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 b=null;switch(e.type){case zh.Added:p="diff-review-row line-insert",m=" char-insert",b=dIt;break;case zh.Deleted:p="diff-review-row line-delete",m=" char-delete",b=hIt;break}const w=document.createElement("div");w.style.minWidth=i+"px",w.className=p,w.setAttribute("role","listitem"),w.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,w.appendChild(y);const C=document.createElement("span");C.style.width=h+"px",C.style.minWidth=h+"px",C.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.originalLineNumber))):C.innerText=" ",y.appendChild(C);const A=document.createElement("span");A.style.width=f+"px",A.style.minWidth=f+"px",A.style.paddingRight="10px",A.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?A.appendChild(document.createTextNode(String(e.modifiedLineNumber))):A.innerText=" ",y.appendChild(A);const L=document.createElement("span");if(L.className=v,b){const R=document.createElement("span");R.className=We.asClassName(b),R.innerText="  ",L.appendChild(R)}else L.innerText="  ";y.appendChild(L);let k;if(e.modifiedLineNumber!==void 0){let R=this._getLineHtml(c,a,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Ix._ttPolicy&&(R=Ix._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=c.getLineContent(e.modifiedLineNumber)}else{let R=this._getLineHtml(o,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Ix._ttPolicy&&(R=Ix._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(5259,"blank"));let P="";switch(e.type){case zh.Unchanged:e.originalLineNumber===e.modifiedLineNumber?P=g(5260,"{0} unchanged line {1}",k,e.originalLineNumber):P=g(5261,"{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case zh.Added:P=g(5262,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case zh.Deleted:P=g(5263,"- {0} original line {1}",k,e.originalLineNumber);break}return w.setAttribute("aria-label",P),w}_getLineHtml(e,t,i,n,o){const r=e.getLineContent(n),a=t.get(x.fontInfo),c=gd.createEmpty(r,o),l=fp.isBasicASCII(r,e.mightContainNonBasicASCII()),d=fp.containsRTL(r,l,e.mightContainRTL());return Ure(new yI(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)!==Lk.OFF,null)).html}};lve=D([_(5,xi)],lve);class bIt{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}}W("diffEditor.move.border","#8b8b8b9c",g(4988,"The border color for text that got moved in the diff editor."));W("diffEditor.moveActive.border","#FFA500",g(4989,"The active border color for text that got moved in the diff editor."));W("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},g(4990,"The color of the shadow around unchanged region widgets."));const wIt=oi("diff-insert",ve.add,g(4991,"Line decoration for inserts in the diff editor.")),PYe=oi("diff-remove",ve.remove,g(4992,"Line decoration for removals in the diff editor.")),AJ=Gt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+We.asClassName(wIt),marginClassName:"gutter-insert"}),L3=Gt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+We.asClassName(PYe),marginClassName:"gutter-delete"}),CWe=Gt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),SWe=Gt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),EJ=Gt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),CRe=Gt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),SRe=Gt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),cW=Gt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),ARe=Gt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),ERe=Gt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class yIt{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=jt(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class E6{static fromFn(e){return new E6(e())}constructor(e){this._value=jt(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(ts(i=>{this._value.set(new AWe(t,void 0),i)}),t),t=>{throw ts(i=>{this._value.set(new AWe(void 0,t),i)}),t})}}class AWe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class CIt{constructor(e){this._computePromise=e,this._lazyValue=new yIt(()=>new E6(this._computePromise())),this.cachedPromiseResult=Ze(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function T5(s,e,t,i){return e||(e=n=>n!=null),new Promise((n,o)=>{let r=!0,a=!1;const c=s.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=ai(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(r?a=!0:l.dispose(),u?o(u===!0?f:u):n(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),o(new Ma)});if(i.isCancellationRequested){l.dispose(),d.dispose(),o(new Ma);return}}r=!1,a&&l.dispose()})}var a0;const x6=ae("diffProviderFactoryService");let dve=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(hve,e)}};dve=D([_(0,we)],dve);ce(x6,dve,qt.Delayed);var mL;let hve=(mL=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,n){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,n);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 q_(new pi(1,2),new pi(1,t.getLineCount()+1),[new Gp(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=a0.diffCache.get(o);if(a&&a.context===r)return a.result;const c=js.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}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return a0.diffCache.size>10&&a0.diffCache.delete(a0.diffCache.keys().next().value),a0.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()}},a0=mL,mL.diffCache=new Map,mL);hve=a0=D([_(1,Ml),_(2,Yi)],hve);function kae(){return D2&&!!D2.VSCODE_DEV}function FYe(s){if(kae()){const e=SIt();return e.add(s),{dispose(){e.delete(s)}}}else return{dispose(){}}}function SIt(){cK||(cK=new Set);const s=globalThis;return s.$hotReload_applyNewExports||(s.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e},i=[];for(const n of cK){const o=n(t);o&&i.push(o)}if(i.length>0)return n=>{let o=!1;for(const r of i)r(n)&&(o=!0);return o}}),cK}let cK;kae()&&FYe(({oldExports:s,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const n in i){const o=i[n];if(console.log(`[hot-reload] Patching prototype methods of '${n}'`,{exportedItem:o}),typeof o=="function"&&o.prototype){const r=s[n];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 '${n}.${a}'`),Object.defineProperty(r.prototype,a,c)}i[n]=r}}}return!0}});function Fg(s,e){return AIt([s],e),s}function AIt(s,e){kae()&&id("reload",i=>FYe(({oldExports:n})=>{if([...Object.values(n)].some(o=>s.includes(o)))return o=>(i(void 0),!0)})).read(e)}let xJ=class extends V{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=jt(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=jt(this,void 0),this.diff=this._diff,this._unchangedRegions=jt(this,void 0),this.unchangedRegions=Ze(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(ts(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=jt(this,void 0),this._activeMovedText=jt(this,void 0),this._hoveredMovedText=jt(this,void 0),this.activeMovedText=Ze(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new ci,this._diffProvider=Ze(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=id("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const n=gC("contentChangedSignal"),o=this._register(new cn(()=>n.trigger(void 0),200));this._register(ai(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?pi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?pi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Tx(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(Fc),u=[];let f=!1;for(const p of P1e(h,(m,v)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(p.length>1){f=!0;const m=p.reduce((b,w)=>b+w.lineCount,0),v=new Tx(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"}})));ts(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const r=(a,c,l)=>{const d=Tx.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(C=>e.original.getDecorationRange(C)).map(C=>C?pi.fromRangeInclusive(C):void 0),b=u.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?pi.fromRangeInclusive(C):void 0);let y=oIt(u.regions.map((C,A)=>{if(!v[A]||!b[A])return;const L=v[A].length;return new Tx(v[A].startLineNumber,b[A].startLineNumber,L,Math.min(C.visibleLineCountTop.get(),L),Math.min(C.visibleLineCountBottom.get(),L-C.visibleLineCountTop.get()))}).filter(Fc),(C,A)=>!A||C.modifiedLineNumber>=A.modifiedLineNumber+A.lineCount&&C.originalLineNumber>=A.originalLineNumber+A.lineCount).map(C=>new L_(C.getHiddenOriginalRange(l),C.getHiddenModifiedRange(l)));y=L_.clip(y,pi.ofLength(1,e.original.getLineCount()),pi.ofLength(1,e.modified.getLineCount())),h=L_.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const v of d){const b=h.filter(w=>w.original.intersectsStrict(v.originalUnchangedRange)&&w.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(b,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()&&DS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&DS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(cu(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),n.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),Fg(BKe,a),Fg(Tpe,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=DS.fromModelContentChanges(f.changes);d=vY(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=DS.fromModelContentChanges(f.changes);h=vY(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=EIt(u,e.original,e.modified),u=u,u=u,ts(f=>{r(u,f),this._lastDiff=u;const p=xRe.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 n=this._unchangedRegions.get()?.regions||[];for(const o of n)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 n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t,i);return}}async waitForDiff(){await T5(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(n=>pi.deserialize(n.range)),i=this._unchangedRegions.get();!i||!t||ts(n=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,n);break}})}};xJ=D([_(2,x6)],xJ);function EIt(s,e,t){return{changes:s.changes.map(i=>new q_(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>xIt(n,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function xIt(s,e,t){let i=s.originalRange,n=s.modifiedRange;return i.startColumn===1&&n.startColumn===1&&(i.endColumn!==1||n.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&i.endLineNumbernew OYe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class OYe{constructor(e){this.lineRangeMapping=e}}class Tx{static fromDiffs(e,t,i,n,o){const r=q_.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+n?(u&&!f&&(h-=o),f&&!u&&(l+=o,d+=o,h-=o),a.push(new Tx(l,d,h,0,0))):h>=o*2+n&&(l+=o,d+=o,h-=o*2,a.push(new Tx(l,d,h,0,0)))}return a}get originalUnchangedRange(){return pi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return pi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=jt(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=jt(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Ze(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=jt(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-n),0);tOe(n===r),tOe(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new jp(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(n.ranges.length===0)this.showAll(t),i.push(this);else{let c=0;for(const l of n.ranges){const d=c===n.ranges.length-1;c++;const h=(d?a:l.endLineNumberExclusive)-r,u=new Tx(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 pi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return pi.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,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,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 n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===g_.FromCloserSide&&n{this._contextMenuService.showContextMenu({domForShadowRoot:u?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:p,y:m}),getActions:()=>{const v=[],b=n.modified.isEmpty;return v.push(new rn("diff.clipboard.copyDeletedContent",b?n.original.length>1?g(9956,"Copy deleted lines"):g(9957,"Copy deleted line"):n.original.length>1?g(9958,"Copy changed lines"):g(9959,"Copy changed line"),void 0,!0,async()=>{const y=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(y)})),n.original.length>1&&v.push(new rn("diff.clipboard.copyDeletedLineContent",b?g(9960,"Copy deleted line ({0})",n.original.startLineNumber+h):g(9961,"Copy changed line ({0})",n.original.startLineNumber+h),void 0,!0,async()=>{let y=this._originalTextModel.getLineContent(n.original.startLineNumber+h);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===Sh.LF?` +`}};Y_e=D([_(0,Te)],Y_e);class Fkt{constructor(){this.telemetryLevel=zg.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 qF=class qF{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=N.from({scheme:qF.SCHEME,authority:"model",path:"/"});this.workspace={id:lje,folders:[new hae({uri:e,name:"",index:0})]}}getCompleteWorkspace(){return Promise.resolve(this.getWorkspace())}getWorkspace(){return this.workspace}getWorkbenchState(){return this.workspace?this.workspace.configuration?qi.WORKSPACE:qi.FOLDER:qi.EMPTY}getWorkspaceFolder(e){return e&&e.scheme===qF.SCHEME?this.workspace.folders[0]:null}isInsideWorkspace(e){return e&&e.scheme===qF.SCHEME}isCurrentWorkspace(e){return!0}};qF.SCHEME="inmemory";let J_e=qF;function bJ(s,e,t){if(!e||!(s instanceof vJ))return;const i=[];Object.keys(e).forEach(n=>{ISt(n)&&i.push([`editor.${n}`,e[n]]),t&&TSt(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let X_e=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}setPreviewHandler(){return V.None}async apply(e,t){const i=Array.isArray(e)?e:lae.convert(e),n=new Map;for(const a of i){if(!(a instanceof eA))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=n.get(c);l||(l=[],n.set(c,l)),l.push(Zn.replaceMove(F.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,c]of n)a.pushStackElement(),a.pushEditOperations([],c,()=>[]),a.pushStackElement(),r+=1,o+=c.length;return{ariaSummary:Up(Kme.bulkEditServiceSummary,o,r),isApplied:o>0}}};X_e=D([_(0,gi)],X_e);class Okt{constructor(){this.onDidChangeFormatters=M.None}getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return _i(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 Z_e=class extends ESt{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};Z_e=D([_(0,fu),_(1,Kt)],Z_e);class Bkt{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 Wkt extends KY{constructor(){super()}}class Hkt extends EYe{constructor(){super(new dyt)}}let eve=class extends l_e{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.configure({blockMouse:!1})}};eve=D([_(0,Yi),_(1,bi),_(2,gf),_(3,Ut),_(4,Oa),_(5,Le)],eve);class Ukt{async playSignal(e,t){}async playSignals(e){}getEnabledState(e,t,i){return R6e.const(!1)}getDelayMs(e,t){return 0}isSoundEnabled(e){return!1}isAnnouncementEnabled(e){return!1}onSoundEnabledChanged(e){return M.None}async playSound(e,t){}playSignalLoop(e){return Ee(()=>{})}}ce(Ge,Hkt,qt.Eager);ce(Te,vJ,qt.Eager);ce(Ec,j_e,qt.Eager);ce(dTe,Y_e,qt.Eager);ce(yi,J_e,qt.Eager);ce(Fs,Okt,qt.Eager);ce(Yi,Fkt,qt.Eager);ce(to,Nkt,qt.Eager);ce(Za,Mkt,qt.Eager);ce(bi,q_e,qt.Eager);ce(ym,IE,qt.Eager);ce(xi,Wkt,qt.Eager);ce(ov,mkt,qt.Eager);ce(gi,m_e,qt.Eager);ce(pTe,p_e,qt.Eager);ce(Le,z_e,qt.Eager);ce(og,Rkt,qt.Eager);ce(YA,K_e,qt.Eager);ce($i,gEt,qt.Eager);ce(Rl,Epe,qt.Eager);ce(LN,X_e,qt.Eager);ce(cC,Bkt,qt.Eager);ce(fn,G_e,qt.Eager);ce(mr,P_e,qt.Eager);ce(rg,mDt,qt.Eager);ce(vi,Q_e,qt.Eager);ce(Ut,$k,qt.Eager);ce(In,E3,qt.Eager);ce(gf,Z_e,qt.Eager);ce(Ao,f_e,qt.Eager);ce(ag,H_e,qt.Eager);ce(lr,eve,qt.Eager);ce(Oa,F_e,qt.Eager);ce(rv,Ukt,qt.Eager);var Dt;(function(s){const e=new Uc;for(const[c,l]of _pe())e.set(c,l);const t=new D3(e,!0);e.set(we,t);function i(c){n||r({});const l=e.get(c);if(!l)throw new Error("Missing service "+c);return l instanceof wi?t.invokeFunction(d=>d.get(c)):l}s.get=i;let n=!1;const o=new I;function r(c){if(n)return t;n=!0;for(const[l,d]of _pe())e.get(l)||e.set(l,d);for(const l in c)if(c.hasOwnProperty(l)){const d=ae(l);e.get(d)instanceof wi&&e.set(d,c[l])}return o.fire(),t}s.initialize=r;function a(c){if(n)return c();const l=new Z,d=l.add(o.event(()=>{d.dispose(),l.add(c())}));return l}s.withServices=a})(Dt||(Dt={}));var Vkt=".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,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.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}}}}}}}}.monaco-diff-editor .diff-hidden-lines-compact{display:flex;height:11px;.line-left,.line-right{border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);height:1px;margin:auto;opacity:.5;width:100%}.line-left{width:20px}.text{text-wrap:nowrap;color:var(--vscode-editorCodeLens-foreground);font-size:11px;line-height:11px;margin:0 4px}}";ut(Vkt,{});class pm{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new pm(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new pm(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,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,mt.Immediate)}}class XE{static capture(e){if(e.hasPendingScrollAnimation())return new XE(e.getScrollTop(),e.getContentHeight(),null,0);let t=null,i=0;const n=e.getVisibleRanges();return n.length>0&&(t=n.at(-1).getEndPosition(),i=e.getBottomForLineNumber(t.lineNumber)-e.getScrollTop()),new XE(e.getScrollTop(),e.getContentHeight(),t,i)}constructor(e,t,i,n){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n}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,mt.Immediate)}}}function zkt(s,e,t,i){if(s.length===0)return e;if(e.length===0)return s;const n=[];let o=0,r=0;for(;od?(n.push(c),r++):(n.push(i(a,c)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function lF(s,e){return s.appendChild(e),Ee(()=>{e.remove()})}function $kt(s,e){return s.prepend(e),Ee(()=>{e.remove()})}class xYe extends V{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 BKe(e,t)),this._width=jt(this,this.elementSizeObserver.getWidth()),this._height=jt(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>ts(n=>{this._width.set(this.elementSizeObserver.getWidth(),n),this._height.set(this.elementSizeObserver.getHeight(),n)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function rWe(s,e,t){let i=e.get(),n=i,o=i;const r=jt("animatedValue",i);let a=-1;const c=300;let l;t.add(xU({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)},(h,u)=>{l!==void 0&&(s.cancelAnimationFrame(l),l=void 0),n=o,i=e.read(h),a=Date.now()-(u.animate?0:c),d()}));function d(){const h=Date.now()-a;o=Math.floor(Gkt(h,n,i-n,c)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const pse=class pse{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${pse._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};pse._counter=0;let tve=pse;function DA(s,e){return ai(t=>{for(let[i,n]of Object.entries(e))n&&typeof n=="object"&&"read"in n&&(n=n.read(t)),typeof n=="number"&&(n=`${n}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),s.style[i]=n})}function yJ(s,e,t,i){const n=new Z,o=[];return n.add(au((r,a)=>{const c=e.read(r),l=new Map,d=new Map;t&&t(!0),s.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(xU({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),s.changeViewZones(f=>{for(const p of u.zoneIds)f.layoutZone(p)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),s.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i?.clear(),t&&t(!1)}}),n}class Kkt extends ci{dispose(){super.dispose(!0)}}function aWe(s,e){const t=bk(e,n=>n.original.startLineNumber<=s.lineNumber);if(!t)return F.fromPositions(s);if(t.original.endLineNumberExclusive<=s.lineNumber){const n=s.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return F.fromPositions(new oe(n,s.column))}if(!t.innerChanges)return F.fromPositions(new oe(t.modified.startLineNumber,1));const i=bk(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(s));if(!i){const n=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return F.fromPositions(new oe(n,s.column))}if(i.originalRange.containsPosition(s))return i.modifiedRange;{const n=qkt(i.originalRange.getEndPosition(),s);return F.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function qkt(s,e){return s.lineNumber===e.lineNumber?new Ju(0,e.column-s.column):new Ju(e.lineNumber-s.lineNumber,e.column-1)}function Qkt(s,e){let t;return s.filter(i=>{const n=e(i,t);return t=i,n})}class nW{static create(e,t=void 0){return new khe(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new Z;return n.add(t),n.add(e),new khe(e,n,i)}static createOfNonDisposable(e,t,i=void 0){return new khe(e,t,i)}}class khe extends nW{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new jkt(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class jkt extends nW{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}function lRe(s,e,t){return RAt({debugName:()=>`Configuration Key "${s}"`},i=>t.onDidChangeConfiguration(n=>{n.affectsConfiguration(s)&&i(n)}),()=>t.getValue(s)??e)}function xv(s,e,t){const i=s.bindTo(e);return f6({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}let cWe=class extends V{constructor(e,t,i){super(),this.configurationService=e,this.accessibilityService=t,this.telemetryService=i,this.sounds=new Map,this.screenReaderAttached=Kn(this,this.accessibilityService.onDidChangeScreenReaderOptimized,()=>this.accessibilityService.isScreenReaderOptimized()),this.sentTelemetry=new Set,this.playingSounds=new Set,this._signalConfigValue=new Aj(n=>lRe(n.settingsKey,{sound:"off",announcement:"off"},this.configurationService)),this._signalEnabledState=new Aj({getCacheKey:_At},n=>Ze(o=>{const r=this._signalConfigValue.get(n.signal).read(o);return!!((n.modality==="sound"||n.modality===void 0)&&lWe(r.sound,()=>this.screenReaderAttached.read(o),n.userGesture)||(n.modality==="announcement"||n.modality===void 0)&&lWe(r.announcement,()=>this.screenReaderAttached.read(o),n.userGesture))}).recomputeInitiallyAndOnChange(this._store))}getEnabledState(e,t,i){return new RLe(this._signalEnabledState.get({signal:e,userGesture:t,modality:i}))}async playSignal(e,t={}){const i=t.modality==="announcement"||t.modality===void 0,n=e.announcementMessage;i&&this.isAnnouncementEnabled(e,t.userGesture)&&n&&this.accessibilityService.status(n),(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 n=new Set(t.filter(o=>this.isSoundEnabled(o)).map(o=>o.sound.getSound()));await Promise.all(Array.from(n).map(o=>this.playSound(o,!0)))}sendSignalTelemetry(e,t){const i=this.accessibilityService.isScreenReaderOptimized(),n=e.name+(t?`::${t}`:"")+(i?"{screenReaderOptimized}":"");this.sentTelemetry.has(n)||this.getVolumeInPercent()===0||(this.sentTelemetry.add(n),this.telemetryService.publicLog2("signal.played",{signal:e.name,source:t??"",isScreenReaderOptimized:i}))}getVolumeInPercent(){const e=this.configurationService.getValue("accessibility.signalOptions.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=Jg.asBrowserUri(`vs/platform/accessibilitySignal/browser/media/${e.fileName}`).toString(!0);try{const n=this.sounds.get(i);if(n)n.volume=this.getVolumeInPercent()/100,n.currentTime=0,await n.play();else{const o=await Ykt(i,this.getVolumeInPercent()/100);this.sounds.set(i,o)}}catch(n){n.message.includes("play() can only be initiated by a user gesture")||console.error("Error while playing sound",n)}finally{this.playingSounds.delete(e)}}playSignalLoop(e,t){let i=!0;const n=()=>{i&&this.playSignal(e,{allowManyInParallel:!0}).finally(()=>{setTimeout(()=>{i&&n()},t)})};return n(),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){if(!this.configurationService.getValue("accessibility.signalOptions.debouncePositionChanges"))return 0;let n;return e.name===al.errorAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.errorAtPosition"):e.name===al.warningAtPosition.name&&i==="positional"?n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.warningAtPosition"):n=this.configurationService.getValue("accessibility.signalOptions.experimental.delays.general"),t==="sound"?n.sound:n.announcement}};cWe=D([_(0,Te),_(1,mr),_(2,Yi)],cWe);function lWe(s,e,t){return s==="on"||s==="always"||s==="auto"&&e()||s==="userGesture"&&t}function Ykt(s,e){return new Promise((t,i)=>{const n=new Audio(s);n.volume=e,n.addEventListener("ended",()=>{t(n)}),n.addEventListener("error",o=>{i(o.error)}),n.play().catch(o=>{i(o)})})}const Bn=class Bn{static register(e){return new Bn(e.fileName)}constructor(e){this.fileName=e}};Bn.error=Bn.register({fileName:"error.mp3"}),Bn.warning=Bn.register({fileName:"warning.mp3"}),Bn.success=Bn.register({fileName:"success.mp3"}),Bn.foldedArea=Bn.register({fileName:"foldedAreas.mp3"}),Bn.break=Bn.register({fileName:"break.mp3"}),Bn.quickFixes=Bn.register({fileName:"quickFixes.mp3"}),Bn.taskCompleted=Bn.register({fileName:"taskCompleted.mp3"}),Bn.taskFailed=Bn.register({fileName:"taskFailed.mp3"}),Bn.terminalBell=Bn.register({fileName:"terminalBell.mp3"}),Bn.diffLineInserted=Bn.register({fileName:"diffLineInserted.mp3"}),Bn.diffLineDeleted=Bn.register({fileName:"diffLineDeleted.mp3"}),Bn.diffLineModified=Bn.register({fileName:"diffLineModified.mp3"}),Bn.chatRequestSent=Bn.register({fileName:"chatRequestSent.mp3"}),Bn.chatResponseReceived1=Bn.register({fileName:"chatResponseReceived1.mp3"}),Bn.chatResponseReceived2=Bn.register({fileName:"chatResponseReceived2.mp3"}),Bn.chatResponseReceived3=Bn.register({fileName:"chatResponseReceived3.mp3"}),Bn.chatResponseReceived4=Bn.register({fileName:"chatResponseReceived4.mp3"}),Bn.clear=Bn.register({fileName:"clear.mp3"}),Bn.save=Bn.register({fileName:"save.mp3"}),Bn.format=Bn.register({fileName:"format.mp3"}),Bn.voiceRecordingStarted=Bn.register({fileName:"voiceRecordingStarted.mp3"}),Bn.voiceRecordingStopped=Bn.register({fileName:"voiceRecordingStopped.mp3"}),Bn.progress=Bn.register({fileName:"progress.mp3"});let ur=Bn;class Jkt{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 Ki=class Ki{constructor(e,t,i,n,o,r){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r}static register(e){const t=new Jkt("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Ki(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return Ki._signals.add(i),i}static get allAccessibilitySignals(){return[...this._signals]}};Ki._signals=new Set,Ki.errorAtPosition=Ki.register({name:g(2242,"Error at Position"),sound:ur.error,announcementMessage:g(2243,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),Ki.warningAtPosition=Ki.register({name:g(2244,"Warning at Position"),sound:ur.warning,announcementMessage:g(2245,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),Ki.errorOnLine=Ki.register({name:g(2246,"Error on Line"),sound:ur.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:g(2247,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),Ki.warningOnLine=Ki.register({name:g(2248,"Warning on Line"),sound:ur.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:g(2249,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),Ki.foldedArea=Ki.register({name:g(2250,"Folded Area on Line"),sound:ur.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:g(2251,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),Ki.break=Ki.register({name:g(2252,"Breakpoint on Line"),sound:ur.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:g(2253,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),Ki.inlineSuggestion=Ki.register({name:g(2254,"Inline Suggestion on Line"),sound:ur.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),Ki.terminalQuickFix=Ki.register({name:g(2255,"Terminal Quick Fix"),sound:ur.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:g(2256,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),Ki.onDebugBreak=Ki.register({name:g(2257,"Debugger Stopped on Breakpoint"),sound:ur.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:g(2258,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),Ki.noInlayHints=Ki.register({name:g(2259,"No Inlay Hints on Line"),sound:ur.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:g(2260,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),Ki.taskCompleted=Ki.register({name:g(2261,"Task Completed"),sound:ur.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:g(2262,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),Ki.taskFailed=Ki.register({name:g(2263,"Task Failed"),sound:ur.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:g(2264,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),Ki.terminalCommandFailed=Ki.register({name:g(2265,"Terminal Command Failed"),sound:ur.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:g(2266,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),Ki.terminalCommandSucceeded=Ki.register({name:g(2267,"Terminal Command Succeeded"),sound:ur.success,announcementMessage:g(2268,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),Ki.terminalBell=Ki.register({name:g(2269,"Terminal Bell"),sound:ur.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:g(2270,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),Ki.notebookCellCompleted=Ki.register({name:g(2271,"Notebook Cell Completed"),sound:ur.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:g(2272,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),Ki.notebookCellFailed=Ki.register({name:g(2273,"Notebook Cell Failed"),sound:ur.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:g(2274,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),Ki.diffLineInserted=Ki.register({name:g(2275,"Diff Line Inserted"),sound:ur.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),Ki.diffLineDeleted=Ki.register({name:g(2276,"Diff Line Deleted"),sound:ur.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),Ki.diffLineModified=Ki.register({name:g(2277,"Diff Line Modified"),sound:ur.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),Ki.chatRequestSent=Ki.register({name:g(2278,"Chat Request Sent"),sound:ur.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:g(2279,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),Ki.chatResponseReceived=Ki.register({name:g(2280,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[ur.chatResponseReceived1,ur.chatResponseReceived2,ur.chatResponseReceived3,ur.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),Ki.progress=Ki.register({name:g(2281,"Progress"),sound:ur.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:g(2282,"Progress"),settingsKey:"accessibility.signals.progress"}),Ki.clear=Ki.register({name:g(2283,"Clear"),sound:ur.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:g(2284,"Clear"),settingsKey:"accessibility.signals.clear"}),Ki.save=Ki.register({name:g(2285,"Save"),sound:ur.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:g(2286,"Save"),settingsKey:"accessibility.signals.save"}),Ki.format=Ki.register({name:g(2287,"Format"),sound:ur.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:g(2288,"Format"),settingsKey:"accessibility.signals.format"}),Ki.voiceRecordingStarted=Ki.register({name:g(2289,"Voice Recording Started"),sound:ur.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),Ki.voiceRecordingStopped=Ki.register({name:g(2290,"Voice Recording Stopped"),sound:ur.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let al=Ki;var Xkt=".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}";ut(Xkt,{});const Zkt=oi("diff-review-insert",ve.add,g(5250,"Icon for 'Insert' in accessible diff viewer.")),eIt=oi("diff-review-remove",ve.remove,g(5251,"Icon for 'Remove' in accessible diff viewer.")),tIt=oi("diff-review-close",ve.close,g(5252,"Icon for 'Close' in accessible diff viewer."));var hB;let xx=(hB=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=r,this._diffs=a,this._models=c,this._instantiationService=l,this._state=vI(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(ive,this._diffs,this._models,this._setVisible,this._canClose)),p=h.add(this._instantiationService.createInstance(nve,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:p}}).recomputeInitiallyAndOnChange(this._store)}next(){ts(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){ts(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){ts(e=>{this._setVisible(!1,e)})}},hB._ttPolicy=KA("diffReview",{createHTML:e=>e}),hB);xx=D([_(8,we)],xx);let ive=class extends V{constructor(e,t,i,n,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=o,this._groups=jt(this,[]),this._currentGroupIdx=jt(this,0),this._currentElementIdx=jt(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(ai(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const c=iIt(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());ts(l=>{const d=this._models.getModifiedPosition();if(d){const h=c.findIndex(u=>d?.lineNumber{const a=this.currentElement.read(r);a?.type===Vh.Deleted?this._accessibilitySignalService.playSignal(al.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===Vh.Added&&this._accessibilitySignalService.playSignal(al.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ai(r=>{const a=this.currentElement.read(r);if(a&&a.type!==Vh.Header){const c=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(F.fromPositions(new oe(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||bM(t,n=>{this._currentGroupIdx.set(mi.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),n),this._currentElementIdx.set(0,n)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||ts(i=>{this._currentElementIdx.set(mi.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&&ts(n=>{this._currentElementIdx.set(i,n)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===Vh.Deleted?this._models.originalReveal(F.fromPositions(new oe(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==Vh.Header?F.fromPositions(new oe(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};ive=D([_(4,rv)],ive);const g4=3;function iIt(s,e,t){const i=[];for(const n of S1e(s,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*g4)){const o=[];o.push(new sIt);const r=new pi(Math.max(1,n[0].original.startLineNumber-g4),Math.min(n[n.length-1].original.endLineNumberExclusive+g4,e+1)),a=new pi(Math.max(1,n[0].modified.startLineNumber-g4),Math.min(n[n.length-1].modified.endLineNumberExclusive+g4,t+1));d6e(n,(d,h)=>{const u=new pi(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new pi(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(p=>{o.push(new aIt(p,f.startLineNumber+(p-u.startLineNumber)))}),h&&(h.original.forEach(p=>{o.push(new oIt(h,p))}),h.modified.forEach(p=>{o.push(new rIt(h,p))}))});const c=n[0].modified.join(n[n.length-1].modified),l=n[0].original.join(n[n.length-1].original);i.push(new nIt(new k_(c,l),o))}return i}var Vh;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(Vh||(Vh={}));class nIt{constructor(e,t){this.range=e,this.lines=t}}class sIt{constructor(){this.type=Vh.Header}}class oIt{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Vh.Deleted,this.modifiedLineNumber=void 0}}class rIt{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Vh.Added,this.originalLineNumber=void 0}}class aIt{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Vh.Unchanged}}let nve=class extends V{constructor(e,t,i,n,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,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 ld(a)),this._register(ai(c=>{this._actionBar.clear(),this._model.canClose.read(c)&&this._actionBar.push(new rn("diffreview.close",g(5253,"Close"),"close-diff-review "+We.asClassName(tIt),!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 wU(this._content,{})),aa(this.domNode,this._scrollbar.getDomNode(),a),this._register(ai(c=>{this._height.read(c),this._width.read(c),this._scrollbar.scanDomNode()})),this._register(Ee(()=>{aa(this.domNode)})),this._register(DA(this.domNode,{width:this._width,height:this._height})),this._register(DA(this._content,{width:this._width,height:this._height})),this._register(au((c,l)=>{this._model.currentGroup.read(c),this._render(l)})),this._register(Ro(this.domNode,"keydown",c=>{(c.equals(S.DownArrow)||c.equals(U.CtrlCmd|S.DownArrow)||c.equals(U.Alt|S.DownArrow))&&(c.preventDefault(),this._model.goToNextLine()),(c.equals(S.UpArrow)||c.equals(U.CtrlCmd|S.UpArrow)||c.equals(U.Alt|S.UpArrow))&&(c.preventDefault(),this._model.goToPreviousLine()),(c.equals(S.Escape)||c.equals(U.CtrlCmd|S.Escape)||c.equals(U.Alt|S.Escape)||c.equals(U.Shift|S.Escape))&&(c.preventDefault(),this._model.close()),(c.equals(S.Space)||c.equals(S.Enter))&&(c.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",g(5254,"Accessible Diff Viewer. Use arrow up and down to navigate.")),xl(n,i.get(x.fontInfo)),aa(this._content,n);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===Vh.Header){const p=document.createElement("div");p.className="diff-review-row",p.setAttribute("role","listitem");const m=d.range,v=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,w=L=>L===0?g(5255,"no lines changed"):L===1?g(5256,"1 line changed"):g(5257,"{0} lines changed",L),y=w(m.original.length),C=w(m.modified.length);p.setAttribute("aria-label",g(5258,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,b,m.original.startLineNumber,y,m.modified.startLineNumber,C));const A=document.createElement("div");A.className="diff-review-cell diff-review-summary",A.appendChild(document.createTextNode(`${v+1}/${b}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),p.appendChild(A),u=p}else u=this._createRow(h,l,this._width.get(),t,o,a,i,r,c);n.appendChild(u);const f=Ze(p=>this._model.currentElement.read(p)===h);e.add(ai(p=>{const m=f.read(p);u.tabIndex=m?0:-1,m&&u.focus()})),e.add(ue(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,r,a,c,l){const d=n.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 b=null;switch(e.type){case Vh.Added:p="diff-review-row line-insert",m=" char-insert",b=Zkt;break;case Vh.Deleted:p="diff-review-row line-delete",m=" char-delete",b=eIt;break}const w=document.createElement("div");w.style.minWidth=i+"px",w.className=p,w.setAttribute("role","listitem"),w.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,w.appendChild(y);const C=document.createElement("span");C.style.width=h+"px",C.style.minWidth=h+"px",C.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.originalLineNumber))):C.innerText=" ",y.appendChild(C);const A=document.createElement("span");A.style.width=f+"px",A.style.minWidth=f+"px",A.style.paddingRight="10px",A.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?A.appendChild(document.createTextNode(String(e.modifiedLineNumber))):A.innerText=" ",y.appendChild(A);const L=document.createElement("span");if(L.className=v,b){const R=document.createElement("span");R.className=We.asClassName(b),R.innerText="  ",L.appendChild(R)}else L.innerText="  ";y.appendChild(L);let k;if(e.modifiedLineNumber!==void 0){let R=this._getLineHtml(c,a,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);xx._ttPolicy&&(R=xx._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=c.getLineContent(e.modifiedLineNumber)}else{let R=this._getLineHtml(o,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);xx._ttPolicy&&(R=xx._ttPolicy.createHTML(R)),y.insertAdjacentHTML("beforeend",R),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=g(5259,"blank"));let P="";switch(e.type){case Vh.Unchanged:e.originalLineNumber===e.modifiedLineNumber?P=g(5260,"{0} unchanged line {1}",k,e.originalLineNumber):P=g(5261,"{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case Vh.Added:P=g(5262,"+ {0} modified line {1}",k,e.modifiedLineNumber);break;case Vh.Deleted:P=g(5263,"- {0} original line {1}",k,e.originalLineNumber);break}return w.setAttribute("aria-label",P),w}_getLineHtml(e,t,i,n,o){const r=e.getLineContent(n),a=t.get(x.fontInfo),c=hd.createEmpty(r,o),l=hp.isBasicASCII(r,e.mightContainNonBasicASCII()),d=hp.containsRTL(r,l,e.mightContainRTL());return Ore(new pI(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)!==xk.OFF,null)).html}};nve=D([_(5,xi)],nve);class cIt{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}}W("diffEditor.move.border","#8b8b8b9c",g(4988,"The border color for text that got moved in the diff editor."));W("diffEditor.moveActive.border","#FFA500",g(4989,"The active border color for text that got moved in the diff editor."));W("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},g(4990,"The color of the shadow around unchanged region widgets."));const lIt=oi("diff-insert",ve.add,g(4991,"Line decoration for inserts in the diff editor.")),DYe=oi("diff-remove",ve.remove,g(4992,"Line decoration for removals in the diff editor.")),CJ=Gt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+We.asClassName(lIt),marginClassName:"gutter-insert"}),k3=Gt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+We.asClassName(DYe),marginClassName:"gutter-delete"}),dWe=Gt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),hWe=Gt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),SJ=Gt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),dRe=Gt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),hRe=Gt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),sW=Gt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),uRe=Gt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),gRe=Gt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class dIt{get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=jt(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}}class y6{static fromFn(e){return new y6(e())}constructor(e){this._value=jt(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(ts(i=>{this._value.set(new uWe(t,void 0),i)}),t),t=>{throw ts(i=>{this._value.set(new uWe(void 0,t),i)}),t})}}class uWe{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}class hIt{constructor(e){this._computePromise=e,this._lazyValue=new dIt(()=>new y6(this._computePromise())),this.cachedPromiseResult=Ze(this,t=>this._lazyValue.cachedValue.read(t)?.promiseResult.read(t))}getPromise(){return this._lazyValue.getValue().promise}}function D5(s,e,t,i){return e||(e=n=>n!=null),new Promise((n,o)=>{let r=!0,a=!1;const c=s.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),l=ai(d=>{const{isFinished:h,error:u,state:f}=c.read(d);(h||u)&&(r?a=!0:l.dispose(),u?o(u===!0?f:u):n(f))});if(i){const d=i.onCancellationRequested(()=>{l.dispose(),d.dispose(),o(new Ma)});if(i.isCancellationRequested){l.dispose(),d.dispose(),o(new Ma);return}}r=!1,a&&l.dispose()})}var s0;const C6=ae("diffProviderFactoryService");let sve=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(ove,e)}};sve=D([_(0,we)],sve);ce(C6,sve,qt.Delayed);var uL;let ove=(uL=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,n){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,n);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 $_(new pi(1,2),new pi(1,t.getLineCount()+1),[new Vp(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=s0.diffCache.get(o);if(a&&a.context===r)return a.result;const c=js.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}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return s0.diffCache.size>10&&s0.diffCache.delete(s0.diffCache.keys().next().value),s0.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()}},s0=uL,uL.diffCache=new Map,uL);ove=s0=D([_(1,Rl),_(2,Yi)],ove);function Aae(){return S2&&!!S2.VSCODE_DEV}function kYe(s){if(Aae()){const e=uIt();return e.add(s),{dispose(){e.delete(s)}}}else return{dispose(){}}}function uIt(){oK||(oK=new Set);const s=globalThis;return s.$hotReload_applyNewExports||(s.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e},i=[];for(const n of oK){const o=n(t);o&&i.push(o)}if(i.length>0)return n=>{let o=!1;for(const r of i)r(n)&&(o=!0);return o}}),oK}let oK;Aae()&&kYe(({oldExports:s,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{for(const n in i){const o=i[n];if(console.log(`[hot-reload] Patching prototype methods of '${n}'`,{exportedItem:o}),typeof o=="function"&&o.prototype){const r=s[n];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 '${n}.${a}'`),Object.defineProperty(r.prototype,a,c)}i[n]=r}}}return!0}});function Mg(s,e){return gIt([s],e),s}function gIt(s,e){Aae()&&ed("reload",i=>kYe(({oldExports:n})=>{if([...Object.values(n)].some(o=>s.includes(o)))return o=>(i(void 0),!0)})).read(e)}let AJ=class extends V{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=jt(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=jt(this,void 0),this.diff=this._diff,this._unchangedRegions=jt(this,void 0),this.unchangedRegions=Ze(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(ts(c=>{for(const l of this._unchangedRegions.get()?.regions||[])l.collapseAll(c)}),[])),this.movedTextToCompare=jt(this,void 0),this._activeMovedText=jt(this,void 0),this._hoveredMovedText=jt(this,void 0),this.activeMovedText=Ze(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new ci,this._diffProvider=Ze(this,a=>{const c=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),l=ed("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:l}}),this._register(Ee(()=>this._cancellationTokenSource.cancel()));const n=lC("contentChangedSignal"),o=this._register(new cn(()=>n.trigger(void 0),200));this._register(ai(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?pi.fromRangeInclusive(p):void 0),d=c.modifiedDecorationIds.map(p=>e.modified.getDecorationRange(p)).map(p=>p?pi.fromRangeInclusive(p):void 0),h=c.regions.map((p,m)=>!l[m]||!d[m]?void 0:new Dx(l[m].startLineNumber,d[m].startLineNumber,l[m].length,p.visibleLineCountTop.read(a),p.visibleLineCountBottom.read(a))).filter(Fc),u=[];let f=!1;for(const p of S1e(h,(m,v)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(p.length>1){f=!0;const m=p.reduce((b,w)=>b+w.lineCount,0),v=new Dx(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"}})));ts(v=>{this._unchangedRegions.set({regions:u,originalDecorationIds:p,modifiedDecorationIds:m},v)})}}));const r=(a,c,l)=>{const d=Dx.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(C=>e.original.getDecorationRange(C)).map(C=>C?pi.fromRangeInclusive(C):void 0),b=u.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?pi.fromRangeInclusive(C):void 0);let y=Qkt(u.regions.map((C,A)=>{if(!v[A]||!b[A])return;const L=v[A].length;return new Dx(v[A].startLineNumber,b[A].startLineNumber,L,Math.min(C.visibleLineCountTop.get(),L),Math.min(C.visibleLineCountBottom.get(),L-C.visibleLineCountTop.get()))}).filter(Fc),(C,A)=>!A||C.modifiedLineNumber>=A.modifiedLineNumber+A.lineCount&&C.originalLineNumber>=A.originalLineNumber+A.lineCount).map(C=>new k_(C.getHiddenOriginalRange(l),C.getHiddenModifiedRange(l)));y=k_.clip(y,pi.ofLength(1,e.original.getLineCount()),pi.ofLength(1,e.modified.getLineCount())),h=k_.inverse(y,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const v of d){const b=h.filter(w=>w.original.intersectsStrict(v.originalUnchangedRange)&&w.modified.intersectsStrict(v.modifiedUnchangedRange));f.push(...v.setVisibleRanges(b,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()&&xS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{this._diff.get()&&xS.fromModelContentChanges(a.changes),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(au(async(a,c)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),n.read(a);const l=this._diffProvider.read(a);l.onChangeSignal.read(a),Mg(TKe,a),Mg(Ape,a),this._isDiffUpToDate.set(!1,void 0);let d=[];c.add(e.original.onDidChangeContent(f=>{const p=xS.fromModelContentChanges(f.changes);d=mY(d,p)}));let h=[];c.add(e.modified.onDidChangeContent(f=>{const p=xS.fromModelContentChanges(f.changes);h=mY(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=fIt(u,e.original,e.modified),u=u,u=u,ts(f=>{r(u,f),this._lastDiff=u;const p=fRe.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 n=this._unchangedRegions.get()?.regions||[];for(const o of n)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 n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t,i);return}}async waitForDiff(){await D5(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(n=>pi.deserialize(n.range)),i=this._unchangedRegions.get();!i||!t||ts(n=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,n);break}})}};AJ=D([_(2,C6)],AJ);function fIt(s,e,t){return{changes:s.changes.map(i=>new $_(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>pIt(n,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function pIt(s,e,t){let i=s.originalRange,n=s.modifiedRange;return i.startColumn===1&&n.startColumn===1&&(i.endColumn!==1||n.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&i.endLineNumbernew IYe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class IYe{constructor(e){this.lineRangeMapping=e}}class Dx{static fromDiffs(e,t,i,n,o){const r=$_.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+n?(u&&!f&&(h-=o),f&&!u&&(l+=o,d+=o,h-=o),a.push(new Dx(l,d,h,0,0))):h>=o*2+n&&(l+=o,d+=o,h-=o*2,a.push(new Dx(l,d,h,0,0)))}return a}get originalUnchangedRange(){return pi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return pi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=jt(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=jt(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Ze(this,c=>this.visibleLineCountTop.read(c)+this.visibleLineCountBottom.read(c)===this.lineCount&&!this.isDragged.read(c)),this.isDragged=jt(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-n),0);zFe(n===r),zFe(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new Kp(e.map(c=>c.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(n.ranges.length===0)this.showAll(t),i.push(this);else{let c=0;for(const l of n.ranges){const d=c===n.ranges.length-1;c++;const h=(d?a:l.endLineNumberExclusive)-r,u=new Dx(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 pi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return pi.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,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,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 n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===d_.FromCloserSide&&n{this._contextMenuService.showContextMenu({domForShadowRoot:u?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:p,y:m}),getActions:()=>{const v=[],b=n.modified.isEmpty;return v.push(new rn("diff.clipboard.copyDeletedContent",b?n.original.length>1?g(9956,"Copy deleted lines"):g(9957,"Copy deleted line"):n.original.length>1?g(9958,"Copy changed lines"):g(9959,"Copy changed line"),void 0,!0,async()=>{const y=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(y)})),n.original.length>1&&v.push(new rn("diff.clipboard.copyDeletedLineContent",b?g(9960,"Copy deleted line ({0})",n.original.startLineNumber+h):g(9961,"Copy changed line ({0})",n.original.startLineNumber+h),void 0,!0,async()=>{let y=this._originalTextModel.getLineContent(n.original.startLineNumber+h);y===""&&(y=this._originalTextModel.getEndOfLineSequence()===yh.LF?` `:`\r -`),await this._clipboardService.writeText(y)})),i.getOption(x.readOnly)||v.push(new rn("diff.inline.revertChange",g(9962,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Ro(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=Cr(this._diffActions),b=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+b)})),this._register(i.onMouseMove(p=>{(p.target.type===Rt.CONTENT_VIEW_ZONE||p.target.type===Rt.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===Rt.CONTENT_VIEW_ZONE||p.target.type===Rt.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:n}=Cr(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ls});function BYe(s,e,t,i){Dl(i,e.fontInfo);const n=t.length>0,o=new wU(1e4);let r=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=fp.isBasicASCII(c,n),d=fp.containsRTL(c,l,o),h=n6(new yI(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!==Lk.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let uve=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=jt(this,0),this._originalScrollOffset=jt(this,0),this._originalScrollOffsetAnimated=vWe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=jt(this,0),this._modifiedScrollOffset=jt(this,0),this._modifiedScrollOffsetAnimated=vWe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=jt("invalidateAlignmentsState",0),u=this._register(new cn(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(x.wrappingInfo)||y.hasChanged(x.lineHeight))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(x.wrappingInfo)||y.hasChanged(x.lineHeight))&&u.schedule()}));const f=this._diffModel.map(y=>y?Kn(this,y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===nD.Completed):void 0).map((y,C)=>y?.read(C)),p=Ze(y=>{const C=this._diffModel.read(y),A=C?.diff.read(y);if(!C||!A)return null;h.read(y);const k=this._options.renderSideBySide.read(y);return DWe(this._editors.original,this._editors.modified,A.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=Ze(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);if(!C)return null;h.read(y);const A=C.changes.map(L=>new OYe(L));return DWe(this._editors.original,this._editors.modified,A,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const y=document.createElement("div");return y.className="diagonal-fill",y}const b=this._register(new Z);this.viewZones=AI(this,(y,C)=>{b.clear();const A=p.read(y)||[],L=[],k=[],P=this._modifiedTopPadding.read(y);P>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:P,showInHiddenAreas:!0,suppressMouseDown:!0});const R=this._originalTopPadding.read(y);R>0&&L.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:R,showInHiddenAreas:!0,suppressMouseDown:!0});const z=this._options.renderSideBySide.read(y),G=z?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(G){const Ne=this._editors.original.getModel();for(const lt of A)if(lt.diff)for(let xt=lt.originalRange.startLineNumber;xtNe.getLineCount())return{orig:L,mod:k};G?.addRequest(Ne.getLineContent(xt),null,null)}}const Y=G?.finalize()??[];let j=0;const ne=this._editors.modified.getOption(x.lineHeight),ge=this._diffModel.read(y)?.movedTextToCompare.read(y),De=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,Oe=this._editors.original.getModel()?.mightContainRTL()??!1,yt=Iae.fromEditor(this._editors.modified);for(const Ne of A)if(Ne.diff&&!z&&(!this._options.useTrueInlineDiffRendering.read(y)||!DRe(Ne.diff))){if(!Ne.originalRange.isEmpty){f.read(y);const xt=document.createElement("div");xt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ji=this._editors.original.getModel();if(Ne.originalRange.endLineNumberExclusive-1>Ji.getLineCount())return{orig:L,mod:k};const Ii=new WYe(Ne.originalRange.mapToLineArray(ds=>Ji.tokenization.getLineTokens(ds)),Ne.originalRange.mapToLineArray(ds=>Y[j++]),De,Oe),ns=[];for(const ds of Ne.diff.innerChanges||[])ns.push(new MO(ds.originalRange.delta(-(Ne.diff.original.startLineNumber-1)),cW.className,Ja.Regular));const zs=BYe(Ii,yt,ns,xt),Pn=document.createElement("div");if(Pn.className="inline-deleted-margin-view-zone",Dl(Pn,yt.fontInfo),this._options.renderIndicators.read(y))for(let ds=0;dsqn(Xr),Pn,this._editors.modified,Ne.diff,this._diffEditorWidget,zs.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ds=0;ds1&&L.push({afterLineNumber:Ne.originalRange.startLineNumber+ds,domNode:v(),heightInPx:(Zo-1)*ne,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Ne.modifiedRange.startLineNumber-1,domNode:xt,heightInPx:zs.heightInLines*ne,minWidthInPx:zs.minWidthInPx,marginDomNode:Pn,setZoneId(ds){Xr=ds},showInHiddenAreas:!0,suppressMouseDown:!0})}const lt=document.createElement("div");lt.className="gutter-delete",L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Ne.modifiedHeightInPx,marginDomNode:lt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const lt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;if(lt>0){if(ge?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Ne.originalRange.endLineNumberExclusive-1))continue;L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:lt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let xt=function(){const Ii=document.createElement("div");return Ii.className="arrow-revert-change "+We.asClassName(ve.arrowRight),C.add(ue(Ii,"mousedown",ns=>ns.stopPropagation())),C.add(ue(Ii,"click",ns=>{ns.stopPropagation(),o.revert(Ne.diff)})),fe("div",{},Ii)};if(ge?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ne.modifiedRange.endLineNumberExclusive-1))continue;let Ji;Ne.diff&&Ne.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(y)&&(Ji=xt()),k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-lt,marginDomNode:Ji,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Ne of m.read(y)??[]){if(!ge?.lineRangeMapping.original.intersect(Ne.originalRange)||!ge?.lineRangeMapping.modified.intersect(Ne.modifiedRange))continue;const lt=Ne.modifiedHeightInPx-Ne.originalHeightInPx;lt>0?L.push({afterLineNumber:Ne.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:lt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Ne.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-lt,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:L,mod:k}});let w=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.modified.setScrollLeft(y.scrollLeft),w=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.original.setScrollLeft(y.scrollLeft),w=!1)})),this._originalScrollTop=Kn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Kn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ai(y=>{const C=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,mt.Immediate)})),this._register(ai(y=>{const C=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,mt.Immediate)})),this._register(ai(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);let A=0;if(C){const L=this._editors.original.getTopForLineNumber(C.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();A=this._editors.modified.getTopForLineNumber(C.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-L}A>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(A,void 0)):A<0?(this._modifiedTopPadding.set(-A,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()-A,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+A,void 0,!0)}))}};uve=D([_(8,dg),_(9,lr)],uve);function DWe(s,e,t,i,n,o){const r=new Uy(kWe(s,i)),a=new Uy(kWe(e,n)),c=s.getOption(x.lineHeight),l=e.getOption(x.lineHeight),d=[];let h=0,u=0;function f(p,m){for(;;){let v=r.peek(),b=a.peek();if(v&&v.lineNumber>=p&&(v=void 0),b&&b.lineNumber>=m&&(b=void 0),!v&&!b)break;const w=v?v.lineNumber-h:Number.MAX_VALUE,y=b?b.lineNumber-u:Number.MAX_VALUE;wy?(a.dequeue(),v={lineNumber:b.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:pi.ofLength(v.lineNumber,1),modifiedRange:pi.ofLength(b.lineNumber,1),originalHeightInPx:c+v.heightInPx,modifiedHeightInPx:l+b.heightInPx,diff:void 0})}}for(const p of t){let y=function(C,A,L=!1){if(CG.lineNumberG+Y.heightInPx,0)??0,z=a.takeWhile(G=>G.lineNumberG+Y.heightInPx,0)??0;d.push({originalRange:k,modifiedRange:P,originalHeightInPx:k.length*c+R,modifiedHeightInPx:P.length*l+z,diff:p.lineRangeMapping}),w=C,b=A};const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,b=m.modified.startLineNumber,w=m.original.startLineNumber;if(o)for(const C of m.innerChanges||[]){C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&y(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber);const A=s.getModel(),L=C.originalRange.endLineNumber<=A.getLineCount()?A.getLineMaxColumn(C.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;C.originalRange.endColumn1&&i.push({lineNumber:c,heightInPx:r*(l-1)})}for(const c of s.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 eIt(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}function DRe(s){return s.innerChanges?s.innerChanges.every(e=>IWe(e.modifiedRange)&&IWe(e.originalRange)):!1}function IWe(s){return s.startLineNumber===s.endLineNumber}const zz=class zz extends V{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Kn(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Kn(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=id("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=jt(this,0),this._modifiedViewZonesChangedSignal=id("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=id("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=AI(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 P(Oe,yt){const Ne=yt.getTopForLineNumber(Oe.startLineNumber,!0),lt=yt.getTopForLineNumber(Oe.endLineNumberExclusive,!0);return(Ne+lt)/2}const R=P(k.lineRangeMapping.original,this._editors.original),z=this._originalScrollTop.read(d),G=P(k.lineRangeMapping.modified,this._editors.modified),Y=this._modifiedScrollTop.read(d),j=R-z,ne=G-Y,ge=Math.min(R,G),De=Math.max(R,G);return{range:new mi(ge,De),from:j,to:ne,fromWithoutScroll:R,toWithoutScroll:G,move:k}});v.sort(C6e(Cc(k=>k.fromWithoutScroll>k.toWithoutScroll,urt),Cc(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,nu)));const b=kRe.compute(v.map(k=>k.range)),w=10,y=p.verticalScrollbarWidth,C=(b.getTrackCount()-1)*10+w*2,A=y+C+(m.contentLeft-zz.movedCodeBlockPadding);let L=0;for(const k of v){const P=b.getTrack(L),R=y+w+P*10,z=15,G=15,Y=A,j=m.glyphMarginWidth+m.lineNumbersWidth,ne=18,ge=document.createElementNS("http://www.w3.org/2000/svg","rect");ge.classList.add("arrow-rectangle"),ge.setAttribute("x",`${Y-j}`),ge.setAttribute("y",`${k.to-ne/2}`),ge.setAttribute("width",`${j}`),ge.setAttribute("height",`${ne}`),this._element.appendChild(ge);const De=document.createElementNS("http://www.w3.org/2000/svg","g"),Oe=document.createElementNS("http://www.w3.org/2000/svg","path");Oe.setAttribute("d",`M 0 ${k.from} L ${R} ${k.from} L ${R} ${k.to} L ${Y-G} ${k.to}`),Oe.setAttribute("fill","none"),De.appendChild(Oe);const yt=document.createElementNS("http://www.w3.org/2000/svg","polygon");yt.classList.add("arrow"),h.add(ai(Ne=>{Oe.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne)),yt.classList.toggle("currentMove",k.move===u.activeMovedText.read(Ne))})),yt.setAttribute("points",`${Y-G},${k.to-z/2} ${Y},${k.to} ${Y-G},${k.to+z/2}`),De.appendChild(yt),this._element.appendChild(De),L++}this.width.set(C,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(ai(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-zz.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(FN(this._state));const r=Ze(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new fF(nd(f.lineRangeMapping.original.startLineNumber-1),18),modified:new fF(nd(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(SJ(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(SJ(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(cu((d,h)=>{const u=r.read(d);for(const f of u)h.add(new TWe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new TWe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=id("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=id("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(LU({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)}))}};zz.movedCodeBlockPadding=4;let jO=zz;class kRe{static compute(e){const t=[],i=[];for(const n of e){let o=t.findIndex(r=>!r.intersectsStrict(n));o===-1&&(t.length>=6?o=ort(t,Cc(a=>a.intersectWithRangeLength(n),nu)):(o=t.length,t.push(new wTe))),t[o].addRange(n),i.push(o)}return new kRe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class TWe extends wRe{constructor(e,t,i,n,o){const r=Bt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Bt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Bt("div.text-content@textContent"),Bt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Kn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(IA(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let c;i.changes.length>0?c=this._kind==="original"?g(5264,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(5265,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):c=this._kind==="original"?g(5266,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(5267,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new hd(this._nodes.actionBar,{highlightToggledItems:!0})),d=new rn("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new rn("","Compare",We.asClassName(ve.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ai(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}class kIt extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Ze(this,o=>{const r=this._diffModel.read(o),a=r?.diff.read(o);if(!a)return null;const c=this._diffModel.read(o).movedTextToCompare.read(o),l=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),h=[],u=[];if(!c)for(const p of a.mappings)if(p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:l?L3:SWe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:l?AJ:CWe}),p.lineRangeMapping.modified.isEmpty||p.lineRangeMapping.original.isEmpty)p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:ARe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:CRe});else{const m=this._options.useTrueInlineDiffRendering.read(o)&&DRe(p.lineRangeMapping);for(const v of p.lineRangeMapping.innerChanges||[])if(p.lineRangeMapping.original.contains(v.originalRange.startLineNumber)&&h.push({range:v.originalRange,options:v.originalRange.isEmpty()&&d?ERe:cW}),p.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber)&&u.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()&&d&&!m?SRe:EJ}),m){const b=r.model.original.getValueInRange(v.originalRange);u.push({range:v.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(c)for(const p of c.changes){const m=p.original.toInclusiveRange();m&&h.push({range:m,options:l?L3:SWe});const v=p.modified.toInclusiveRange();v&&u.push({range:v,options:l?AJ:CWe});for(const b of p.innerChanges||[])h.push({range:b.originalRange,options:cW}),u.push({range:b.modifiedRange,options:EJ})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const p of a.movedTexts)h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(p===f?" currentMove":""),blockPadding:[jO.movedCodeBlockPadding,0,jO.movedCodeBlockPadding,jO.movedCodeBlockPadding]}}),u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(p===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(CJ(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register(CJ(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class IIt{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=_6(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,n)}),this._sashRatio=jt(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:oi-r?i-r:o}}class HYe extends V{constructor(e,t,i,n,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Od(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:fi.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(ai(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(ai(a=>{const c=this._enabled.read(a);this._sash.state=c?oa.Enabled:oa.Disabled,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class TIt extends V{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Kn(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Kn(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=id("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=id("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=gC("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Bt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{ts(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Ee(()=>o.disconnect())),this._register(ai(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(ai(r=>this.render(r)))}dispose(){super.dispose(),aa(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(),n=new Set(this.views.keys()),o=mi.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new pi(r.startLineNumber,r.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);ts(l=>{for(const d of c){if(!d.range.intersect(a))continue;n.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=jt("item",d),b=this.itemProvider.createView(v,m);h=new LIt(v,b,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(mi.ofStartAndLength(u,p),o)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class LIt{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class UYe extends $_{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class gve extends MKe{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 eg(e-1,t)}}var RIt=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";ut(RIt,{});class VYe extends V{constructor(e,t,i={orientation:F_.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Q1e),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register($k()),this.options=i,this.toggleMenuAction=this._register(new R3(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new hd(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,o)=>{if(n.id===R3.ID)return this.toggleMenuActionViewItem=new sA(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:We.asClassNameArray(i.moreIcon??ve.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(n,o);if(r)return r}if(n instanceof Nk){const r=new sA(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.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(n=>{this.actionBar.push(n,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(n)})})}isEmpty(){return this.actionBar.isEmpty()}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const wse=class wse extends rn{constructor(e,t){t=t||g(10094,"More Actions..."),super(wse.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}};wse.ID="toolbar.toggle.more";let R3=wse;var aA;(function(s){s[s.NoHide=-1]="NoHide",s[s.Ignore=0]="Ignore",s[s.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(aA||(aA={}));let lW=class extends VYe{constructor(e,t,i,n,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=n,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 n=e.slice(),o=t.slice(),r=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==aA.NoHide)for(let d=0;df?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let f=0;f=h&&(n[f]=void 0,c[f]=p))}}uM(n),uM(c),super.setActions(n,Ar.join(c,o)),(r.length>0||n.length>0)&&this._sessionDisposables.add(ue(this.getElement(),"contextmenu",d=>{const h=new Eh(ct(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof Sc&&u.menuKeybinding)f.push(u.menuKeybinding);else if(!(u instanceof Ty||u instanceof R3)){const m=!!this._keybindingService.lookupKeybinding(u.id);f.push(TYe(this._commandService,this._keybindingService,u.id,void 0,m))}if(r.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===aA.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})}))}};lW=D([_(2,Oa),_(3,Le),_(4,lr),_(5,Ut),_(6,vi),_(7,Yi)],lW);let bm=class extends lW{constructor(e,t,i,n,o,r,a,c,l){super(e,{resetMenu:t,...i},n,o,r,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];fC(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 Ni("This toolbar is populated from a menu.")}};bm=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,vi),_(8,Yi)],bm);const Fhe=[],lK=35;let fve=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(_e.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Kn(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=Ze(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=Ze(this,d=>this._hasActions.read(d)?lK:0),this.elements=Bt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:lK+"px"}},[]),this._currentDiff=Ze(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=Ze(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return Fhe;const f=this._editors.modifiedSelections.read(d);if(f.every(b=>b.isEmpty()))return Fhe;const p=new jp(f.map(b=>pi.fromRangeInclusive(b))),v=u.mappings.filter(b=>b.lineRangeMapping.innerChanges&&p.intersects(b.lineRangeMapping.modified)).map(b=>({mapping:b,rangeMappings:b.lineRangeMapping.innerChanges.filter(w=>f.some(y=>F.areIntersecting(w.modifiedRange,y)))}));return v.length===0||v.every(b=>b.rangeMappings.length===0)?Fhe:v}),this._register(tIt(e,this.elements.root)),this._register(ue(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(IA(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),mh(this,d=>this._showSash.read(d)?new HYe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,_6(this,u=>this._sashLayout.sashLeft.read(u)-lK,(u,f)=>this._sashLayout.sashLeft.set(u+lK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new TIt(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=q_.fromRangeMappings(p.flatMap(b=>b.rangeMappings));return[new LWe(v,!0,_e.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const m=this._currentDiff.read(h);return f.mappings.map(v=>new LWe(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===m?.lineRangeMapping,_e.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))},createView:(d,h)=>this._instantiationService.createInstance(pve,d,h,this)})),this._register(ue(this.elements.gutter,ke.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 gve(this._editors.modifiedModel.get()),n=new gve(this._editors.original.getModel());return new B2(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};fve=D([_(6,we),_(7,Le),_(8,Oa)],fve);class LWe{constructor(e,t,i,n,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let pve=class extends V{constructor(e,t,i,n){super(),this._item=e,this._elements=Bt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Bt("div.background@background",{},[]),Bt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=jt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(xM,"element",!0,{position:{hoverPosition:vo.RIGHT}}));this._register(gF(t,this._elements.root)),this._register(ai(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(cu((r,a)=>{this._elements.buttons.replaceChildren();const c=a.add(n.createInstance(bm,this._elements.buttons,this._menuId.read(r),{orientation:F_.VERTICAL,hoverDelegate:o,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:aA.Ignore,actionRunner:new UYe(()=>{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 n=e.length/2-i/2,o=i;let r=e.start+n;const a=mi.tryCreate(o,t.endExclusive-o-i),c=mi.tryCreate(e.start+o,e.endExclusive-i-o);c&&a&&c.start{const n=$E._map.get(e);n&&($E._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new TU(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=jt(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._versionId=fJ({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=fJ({owner:this,equalsFn:Fq(J2(dt.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Jh({owner:this,equalsFn:Fq(J2(oe.equals))},t=>this.selections.read(t)?.map(i=>i.getStartPosition())??null),this.isFocused=Kn(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=_6(this,t=>(this.versionId.read(t),this.model.read(t)?.getValue()??""),(t,i)=>{const n=this.model.get();n!==null&&t!==n.getValue()&&n.setValue(t)}),this.valueIsEmpty=Ze(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Jh({owner:this,equalsFn:Fq(dt.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=Jh({owner:this,equalsFn:oe.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.onDidType=gC(this),this.scrollTop=Kn(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Kn(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Kn(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.contentWidth=Kn(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this._overlayWidgetCounter=0,this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(t=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(t=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}}))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e){return Kn(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new Z,i=this.editor.createDecorationsCollection();return t.add(v6({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._overlayWidgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=ai(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return Ee(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};$E._map=new Map;let mve=$E;function _ve(s,e){return UAt({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(s)){const n=t.change;n!==void 0&&i.deltas.push(n),i.didChange=!0}return!0}},(t,i)=>{const n=s.read(t);i.didChange&&e(n,i.deltas)})}function MIt(s,e){const t=new Z,i=_ve(s,(n,o)=>{t.clear(),e(n,o,t)});return{dispose(){i.dispose(),t.dispose()}}}var jq,_L;let DJ=(_L=class extends V{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=mh(this,c=>{const l=this._editors.modifiedModel.read(c),d=jq._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===Oi.ContentFlush)return;const l=this._diffModel.get();ts(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,g_.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,g_.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Oi.ContentFlush)return;const l=this._diffModel.get();ts(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,g_.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,g_.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=AI(this,(c,l)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],u=[],f=this._options.renderSideBySide.read(c),p=this._options.compactMode.read(c),m=o.read(c);for(let v=0;vb.getHiddenOriginalRange(C).startLineNumber-1),y=new fF(w,12);h.push(y),l.add(new RWe(this._editors.original,y,b,!f))}{const w=Ze(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new fF(w,12);u.push(y),l.add(new RWe(this._editors.modified,y,b))}}else{{const w=Ze(this,C=>b.getHiddenOriginalRange(C).startLineNumber-1),y=new fF(w,24);h.push(y),l.add(new MWe(this._editors.original,y,b,b.originalUnchangedRange,!f,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,g_.FromBottom,void 0),this._options))}{const w=Ze(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new fF(w,24);u.push(y),l.add(new MWe(this._editors.modified,y,b,b.modifiedUnchangedRange,!1,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,g_.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 Mt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(5244,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+We.asClassName(ve.fold),zIndex:10001};this._register(CJ(this._editors.original,Ze(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:F.fromPositions(new oe(h.originalLineNumber,1)),options:a});return d}))),this._register(CJ(this._editors.modified,Ze(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:pi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(ai(c=>{const l=o.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(Fc)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(Fc))}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()}}))}},jq=_L,_L._breadcrumbsSourceFactory=jt(jq,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),_L);DJ=jq=D([_(3,we)],DJ);class RWe extends wRe{constructor(e,t,i,n=!1){const o=Bt("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=Bt("div.diff-hidden-lines-compact",[Bt("div.line-left",[]),Bt("div.text@text",[]),Bt("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(ai(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,c=g(5245,"{0} hidden lines",a);this._nodes.text.innerText=c}}))}}class MWe extends wRe{constructor(e,t,i,n,o,r,a,c){const l=Bt("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=Bt("div.diff-hidden-lines",[Bt("div.top@top",{title:g(5246,"Click or drag to show more above")}),Bt("div.center@content",{style:{display:"flex"}},[Bt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[fe("a",{title:g(5247,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Eb("$(unfold)"))]),Bt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Bt("div.bottom@bottom",{title:g(5248,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?aa(this._nodes.first):this._register(IA(this._nodes.first,{width:Xh(this._editor).layoutInfoContentLeft})),this._register(ai(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const f=this._unchangedRegion.isDragged.read(h),p=this._editor.getDomNode();p&&(p.classList.toggle("draggingUnchangedRegion",!!f),f==="top"?(p.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),p.classList.toggle("canMoveBottom",!u)):f==="bottom"?(p.classList.toggle("canMoveTop",!u),p.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(p.classList.toggle("canMoveTop",!1),p.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(ue(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=ct(this._nodes.top),v=ue(m,"mousemove",w=>{const C=w.clientY-u;f=f||Math.abs(C)>2;const A=Math.round(C/d.getOption(x.lineHeight)),L=Math.max(0,Math.min(p+A,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=ue(m,"mouseup",w=>{f||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),v.dispose(),b.dispose()})})),this._register(ue(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=ct(this._nodes.bottom),v=ue(m,"mousemove",w=>{const C=w.clientY-u;f=f||Math.abs(C)>2;const A=Math.round(C/d.getOption(x.lineHeight)),L=Math.max(0,Math.min(p-A,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const P=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(P-k))}),b=ue(m,"mouseup",w=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!f){const y=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),b.dispose()})})),this._register(ai(h=>{const u=[];if(!this._hide){const f=i.getHiddenModifiedRange(h).length,p=g(5245,"{0} hidden lines",f),m=fe("span",{title:g(5249,"Double click to unfold")},p);m.addEventListener("dblclick",w=>{w.button===0&&(w.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(m);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){u.push(fe("span",void 0,"  |  "));for(let w=0;w{this._revealModifiedHiddenLine(y.startLineNumber)}}}}aa(this._nodes.others,...u)}))}}var bv,BS;let dW=(BS=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=bv.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=Kn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=Ze(u=>{const f=c.read(u),p=f.getColor(bft)||(f.getColor(my)||Ope).transparent(2),m=f.getColor(wft)||(f.getColor(iF)||Bpe).transparent(2);return{insertColor:p,removeColor:m}}),d=ls(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Bt("div.diffOverview",{style:{position:"absolute",top:"0px",width:bv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(gF(h,d.domNode)),this._register(Ro(h,ke.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(ue(h,ke.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(gF(this._rootElement,h)),this._register(cu((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(gF(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(gF(h,v.getDomNode()))),!m||!v)return;const b=id("viewZoneChanged",this._editors.original.onDidChangeViewZones),w=id("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=id("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=id("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(ai(A=>{b.read(A),w.read(A),y.read(A),C.read(A);const L=l.read(A),k=p?.diff.read(A)?.mappings;function P(G,Y,j){const ne=j._getViewModel();return ne?G.filter(ge=>ge.length>0).map(ge=>{const De=ne.coordinatesConverter.convertModelPositionToViewPosition(new oe(ge.startLineNumber,1)),Oe=ne.coordinatesConverter.convertModelPositionToViewPosition(new oe(ge.endLineNumberExclusive,1)),yt=Oe.lineNumber-De.lineNumber;return new Gqe(De.lineNumber,Oe.lineNumber,yt,Y.toString())}):[]}const R=P((k||[]).map(G=>G.lineRangeMapping.original),L.removeColor,this._editors.original),z=P((k||[]).map(G=>G.lineRangeMapping.modified),L.insertColor,this._editors.modified);m?.setZones(R),v?.setZones(z)})),f.add(ai(A=>{const L=this._rootHeight.read(A),k=this._rootWidth.read(A),P=this._modifiedEditorLayoutInfo.read(A);if(P){const R=bv.ENTIRE_DIFF_OVERVIEW_WIDTH-2*bv.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:L,right:R+bv.ONE_OVERVIEW_WIDTH,width:bv.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:L,right:0,width:bv.ONE_OVERVIEW_WIDTH});const z=this._editors.modifiedScrollTop.read(A),G=this._editors.modifiedScrollHeight.read(A),Y=this._editors.modified.getOption(x.scrollbar),j=new G2(Y.verticalHasArrows?Y.arrowSize:0,Y.verticalScrollbarSize,0,P.height,G,z);d.setTop(j.getSliderPosition()),d.setHeight(j.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=L+"px",h.style.left=k-bv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(bv.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},bv=BS,BS.ONE_OVERVIEW_WIDTH=15,BS.ENTIRE_DIFF_OVERVIEW_WIDTH=BS.ONE_OVERVIEW_WIDTH*2,BS);dW=bv=D([_(6,pn)],dW);const Ohe=[];class NIt extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=Ze(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return Ohe;const c=this._editors.modifiedSelections.read(o);if(c.every(u=>u.isEmpty()))return Ohe;const l=new jp(c.map(u=>pi.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=>F.areIntersecting(f.modifiedRange,p)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?Ohe:h}),this._register(cu((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 kJ(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 kJ(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 yse=class yse extends V{getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${yse.counter++}`,this._domNode=Bt("div.revertButton",{title:this._revertSelection?g(5268,"Revert Selected Changes"):g(5269,"Revert Change")},[Yy(ve.arrowRight)]).root,this._register(ue(this._domNode,ke.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(ue(this._domNode,ke.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(ue(this._domNode,ke.CLICK,o=>{this._diffs instanceof L_?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:K_.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};yse.counter=0;let kJ=yse,vve=class extends V{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,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=Kn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Kn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Xh(this.modified),this.originalObs=Xh(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Kn(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Jh({owner:this,equalsFn:oe.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new oe(1,1)),this.originalCursor=Kn(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new oe(1,1)),this.isOriginalFocused=Xh(this.original).isFocused,this.isModifiedFocused=Xh(this.modified).isFocused,this.isFocused=Ze(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(LU({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),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+dW.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=wh.revealHorizontalRightPadding.defaultValue+dW.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(5270," 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,""):""}};vve=D([_(5,we),_(6,Ut)],vve);const Cse=class Cse extends V{constructor(){super(...arguments),this._id=++Cse.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=mt.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=mt.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=mt.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=mt.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=mt.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=mt.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=mt.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=mt.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=mt.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=mt.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=mt.Smooth,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=mt.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=mt.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=mt.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)}};Cse.idCounter=0;let bve=Cse,IJ=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=jt(this,0),this._screenReaderMode=Kn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Ze(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Ze(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=Ze(this,n=>this.compactMode.read(n)&&this.shouldRenderInlineViewInSmartMode.read(n)?!1:this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=Ze(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=Ze(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=Ze(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=Ze(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=Ze(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=Ze(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=Ze(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=Ze(this,n=>this._options.read(n).maxComputationTime),this.showMoves=Ze(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=Ze(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=Ze(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=Ze(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=Ze(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=Ze(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=Ze(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=Ze(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Ze(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=Ze(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=Ze(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=Ze(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=Ze(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=jt(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>KAt(this,o=>{const r=n?.diff.read(o);return r?PIt(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...NWe(e,Ol)};this._options=jt(this,i)}updateOptions(e){const t=NWe(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)}setModel(e){this._model.set(e,void 0)}};IJ=D([_(1,mr)],IJ);function PIt(s,e){return s.mappings.every(t=>FIt(t.lineRangeMapping)||OIt(t.lineRangeMapping)||e&&DRe(t.lineRangeMapping))}function FIt(s){return s.original.length===0}function OIt(s){return s.modified.length===0}function NWe(s,e){return{enableSplitViewResizing:Et(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Oat(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Et(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Et(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:ZI(s.maxComputationTime,e.maxComputationTime,0,Un.MAX_SAFE_SMALL_INTEGER),maxFileSize:ZI(s.maxFileSize,e.maxFileSize,0,Un.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:Et(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Et(s.renderIndicators,e.renderIndicators),originalEditable:Et(s.originalEditable,e.originalEditable),diffCodeLens:Et(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Et(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Kr(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Kr(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Et(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Et(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:Et(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:Et(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:Et(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:ZI(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Un.MAX_SAFE_SMALL_INTEGER),minimumLineCount:ZI(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Un.MAX_SAFE_SMALL_INTEGER),revealLineCount:ZI(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Un.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:Et(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Et(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:ZI(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Un.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:Et(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:Et(s.renderGutterMenu,e.renderGutterMenu),compactMode:Et(s.compactMode,e.compactMode)}}var mB;let vp=(mB=class extends bve{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,n,o,r,a,c){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=Bt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Bt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Bt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Bt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(f3(this,void 0)),this._diffModel=Ze(this,C=>this._diffModelSrc.read(C)?.object),this.onDidChangeModel=M.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Uc([Le,this._contextKeyService]))),this._boundarySashes=jt(this,void 0),this._accessibleDiffViewerShouldBeVisible=jt(this,!1),this._accessibleDiffViewerVisible=Ze(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=jt(this,void 0),this._layoutInfo=Ze(this,C=>{const A=this._rootSizeObserver.width.read(C),L=this._rootSizeObserver.height.read(C);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=L+"px";const k=this._sash.read(C),P=this._gutter.read(C),R=P?.width.read(C)??0,z=this._overviewRulerPart.read(C)?.width??0;let G,Y,j,ne,ge;if(!!k){const Oe=k.sashLeft.read(C),yt=this._movedBlocksLinesPart.read(C)?.width.read(C)??0;G=0,Y=Oe-R-yt,ge=Oe-R,j=Oe,ne=A-j-z}else{ge=0;const Oe=this._options.inlineViewHideOriginalLineNumbers.read(C);G=R,Oe?Y=0:Y=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(C)),j=R+Y,ne=A-j-z}return this.elements.original.style.left=G+"px",this.elements.original.style.width=Y+"px",this._editors.original.layout({width:Y,height:L},!0),P?.layout(ge),this.elements.modified.style.left=j+"px",this.elements.modified.style.width=ne+"px",this._editors.modified.layout({width:ne,height:L},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((C,A)=>C?.diff.read(A)),this.onDidUpdateDiff=M.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.elements.root.remove())),this._rootSizeObserver=this._register(new NYe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(IJ,t),this._register(ai(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(J.isEmbeddedDiffEditor.key,!1),this._register(Iv(J.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(Iv(J.comparingMovedCode,this._contextKeyService,C=>!!this._diffModel.read(C)?.movedTextToCompare.read(C))),this._register(Iv(J.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(Iv(J.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(Iv(J.hasChanges,this._contextKeyService,C=>(this._diffModel.read(C)?.diff.read(C)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(vve,this.elements.original,this.elements.modified,this._options,i,(C,A,L,k)=>this._createInnerEditor(C,A,L,k))),this._register(Iv(J.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(Iv(J.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(Iv(J.diffEditorOriginalUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.original.uri.toString()??"")),this._register(Iv(J.diffEditorModifiedUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.modified.uri.toString()??"")),this._overviewRulerPart=mh(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(Fg(dW,C),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(A=>A.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,A)=>C-(this._overviewRulerPart.read(A)?.width??0))};this._sashLayout=new IIt(this._options,l),this._sash=mh(this,C=>{const A=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",A),A?new HYe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=mh(this,C=>this._instantiationService.createInstance(Fg(DJ,C),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);mh(this,C=>this._instantiationService.createInstance(Fg(kIt,C),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=mh(this,C=>this._instantiationService.createInstance(Fg(uve,C),ct(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=Ze(this,C=>{const A=p.read(C).viewZones.read(C).orig,L=d.read(C).viewZones.read(C).origViewZones;return A.concat(L)}),v=Ze(this,C=>{const A=p.read(C).viewZones.read(C).mod,L=d.read(C).viewZones.read(C).modViewZones;return A.concat(L)});this._register(SJ(this._editors.original,m,C=>{f=C},h));let b;this._register(SJ(this._editors.modified,v,C=>{f=C,f?b=vm.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=mh(this,C=>this._instantiationService.createInstance(Fg(Ix,C),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(A,L)=>this._accessibleDiffViewerShouldBeVisible.set(A,L),this._options.onlyShowAccessibleDiffViewer.map(A=>!A),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((A,L)=>A?.diff.read(L)?.mappings.map(k=>k.lineRangeMapping)),new bIt(this._editors))).recomputeInitiallyAndOnChange(this._store);const w=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(IA(this.elements.modified,{visibility:w})),this._register(IA(this.elements.original,{visibility:w})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=mh(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(Fg(fve,C),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(FN(this._layoutInfo)),mh(this,C=>new(Fg(jO,C))(this.elements.root,this._diffModel,this._layoutInfo.map(A=>A.originalEditor),this._layoutInfo.map(A=>A.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,C=>{this._movedBlocksLinesPart.set(C,void 0)}),this._register(M.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!0))),this._register(M.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!1)));const y=this._diffModel.map(this,(C,A)=>{if(C)return C.diff.read(A)===void 0&&!C.isDiffUpToDate.read(A)});this._register(cu((C,A)=>{if(y.read(C)===!0){const L=this._editorProgressService.show(!0,1e3);A.add(Ee(()=>L.done()))}})),this._register(cu((C,A)=>{A.add(new(Fg(NIt,C))(this._editors,this._diffModel,this._options,this))})),this._register(cu((C,A)=>{const L=this._diffModel.read(C);if(L)for(const k of[L.model.original,L.model.modified])A.add(k.onWillDispose(P=>{vt(new Ni("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(ai(C=>{this._options.setModel(this._diffModel.read(C))}))}getViewWidth(){return this._rootSizeObserver.width.get()}getContentHeight(){return this._editors.modified.getContentHeight()}_createInnerEditor(e,t,i,n){return e.createInstance(Hk,t,i,n)}_createDiffEditorContributions(){const e=ap.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){vt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return CU.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(xJ,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?aW.create(e).createNewRef(this):aW.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&SM(t,n=>{const o=e?.object;Kn.batchEventsGlobally(n,()=>{this._editors.original.setModel(o?o.model.original:null),this._editors.modified.setModel(o?o.model.modified:null)});const r=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{r?.dispose()},0)})}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?BIt(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(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.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 n;e==="next"?n=t.find(o=>o.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=Ak(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 n;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=bWe(o.getStartPosition(),r),c=bWe(o.getEndPosition(),r);n=F.plusRange(a,c)}}return{destination:i,destinationSelection:n}}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&&ts(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&ts(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Oi.Explicit){const i=this._diffModel.get()?.diff.get()?.mappings.find(n=>t?n.lineRangeMapping.modified.contains(e.position.lineNumber):n.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(cl.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(cl.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(cl.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},mB.ENTIRE_DIFF_OVERVIEW_WIDTH=dW.ENTIRE_DIFF_OVERVIEW_WIDTH,mB);vp=D([_(3,Le),_(4,we),_(5,Kt),_(6,lv),_(7,XA)],vp);function BIt(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=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:n,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 WIt=0,PWe=!1;function HIt(s){if(!s){if(PWe)return;PWe=!0}Hgt(s||si.document.body)}let Yk=class extends Hk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||qY.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+qY.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,n,o,r,l,d,h,u,f),c instanceof jk?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,HIt(p.ariaContainerElement),bje((m,v)=>i.createInstance(xM,m,v,{})),Fje(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 n="DYNAMIC_"+ ++WIt,o=he.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}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"),V.None;const t=e.id,i=e.label,n=he.and(he.equals("editorId",this.getId()),he.deserialize(e.precondition)),o=e.keybindings,r=he.and(n,he.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(_t.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:n,group:a,order:c};d.add(jn.appendMenuItem(_e.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,r));const u=new qqe(h,i,i,void 0,n,(...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 kY)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Yk=D([_(2,we),_(3,Kt),_(4,vi),_(5,Le),_(6,ec),_(7,Ut),_(8,pn),_(9,bi),_(10,mr),_(11,Vs),_(12,it)],Yk);let IM=class extends Yk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){const b={...t};yJ(h,b,!1);const w=l.registerEditorContainer(e);typeof b.theme=="string"&&l.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!b.autoDetectHighContrast);const y=b.model;delete b.model,super(e,b,i,n,o,r,a,c,l,d,u,m,v),this._configurationService=h,this._standaloneThemeService=l,this._register(w);let C;if(typeof y>"u"){const A=p.getLanguageIdByMimeType(b.language)||b.language||Ca;C=zYe(f,p,b.value||"",A,void 0),this._ownsModel=!0}else C=y,this._ownsModel=!1;if(this._attachModel(C),C){const A={oldModelUrl:null,newModelUrl:C.uri};this._onDidChangeModel.fire(A)}}dispose(){super.dispose()}updateOptions(e){yJ(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)}};IM=D([_(2,we),_(3,Kt),_(4,vi),_(5,Le),_(6,ec),_(7,Ut),_(8,cv),_(9,bi),_(10,Te),_(11,mr),_(12,gi),_(13,xi),_(14,Vs),_(15,it)],IM);let TJ=class extends vp{constructor(e,t,i,n,o,r,a,c,l,d,h,u){const f={...t};yJ(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},n,i,o,u,d),this._configurationService=c,this._standaloneThemeService=r,this._register(p)}dispose(){super.dispose()}updateOptions(e){yJ(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(Yk,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)}};TJ=D([_(2,we),_(3,Le),_(4,Kt),_(5,cv),_(6,bi),_(7,Te),_(8,lr),_(9,XA),_(10,dg),_(11,lv)],TJ);function zYe(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(` -`);let r=t;return o!==-1&&(r=t.substring(0,o)),FWe(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return FWe(s,t,e.createById(i),n)}function FWe(s,e,t,i){return s.createModel(e,t,i)}var UIt=".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}}}";ut(UIt,{});class VIt{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let LJ=class extends V{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=jt(this,void 0),this._collapsed=Ze(this,r=>this._viewModel.read(r)?.collapsed.read(r)),this._editorContentHeight=jt(this,500),this.contentHeight=Ze(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=jt(this,0),this._modifiedWidth=jt(this,0),this._originalContentWidth=jt(this,0),this._originalWidth=jt(this,0),this.maxScroll=Ze(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=Bt("div.multiDiffEntry",[Bt("div.header@header",[Bt("div.header-content",[Bt("div.collapse-button@collapseButton"),Bt("div.file-path",[Bt("div.title.modified.show-file-icons@primaryPath",[]),Bt("div.status.deleted@status",["R"]),Bt("div.title.original.show-file-icons@secondaryPath",[])]),Bt("div.actions@actions")])]),Bt("div.editorParent",[Bt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(vp,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Xh(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Xh(this.editor.getOriginalEditor()).isFocused,this.isFocused=Ze(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 Jd(this._elements.collapseButton,{});this._register(ai(r=>{o.element.className="",o.icon=this._collapsed.read(r)?ve.chevronRight:ve.chevronDown})),this._register(o.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(ai(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=>{rV(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(ai(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(bm,this._elements.actions,_e.MultiDiffEditorFileToolbar,{actionRunner:this._register(new UYe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>WN(n,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(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){rV(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;rV(n=>{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,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)})}render(e,t,i,n){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(n.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,rV(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"}};LJ=D([_(3,we)],LJ);class zIt{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(n=>this._itemData.get(n).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()}}let wve=class extends V{constructor(e,t,i,n,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=Bt("div.scrollContent",[Bt("div@content",{style:{overflow:"hidden"}}),Bt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new yN({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Ll(ct(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new l6(this._scrollableElements.root,{vertical:Co.Auto,horizontal:Co.Auto,useShadows:!1},this._scrollable)),this._elements=Bt("div.monaco-component.multiDiffEditor",{},[Bt("div",{},[this._scrollableElement.getDomNode()]),Bt("div.placeholder@placeholder",{},[Bt("div",[g(9360,"No Changed Files")])])]),this._sizeObserver=this._register(new NYe(this._element,void 0)),this._objectPool=this._register(new zIt(c=>{const l=this._instantiationService.createInstance(LJ,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=Kn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Kn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=AI(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new Ni}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new GIt(p,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=this._lastDocStates?.[m.getKey()];return v&&ts(b=>{m.setViewState(v,b)}),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=Ze(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 Uc([Le,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(J.inMultiDiffEditor.key,!0),this._register(cu((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(J.multiDiffEditorAllCollapsed.key,!1);this._register(ai(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(ai(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(ai(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(ai(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=N1e(f,Cc(m=>m.maxScroll.read(c).maxScroll,nu));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(ai(c=>{rV(l=>{this.render(c)})})))}setScrollState(e){this._scrollableElement.setScrollPosition({scrollLeft:e.left,scrollTop:e.top})}reveal(e,t){const i=this._viewItems.get(),n=i.findIndex(l=>l.viewModel.originalUri?.toString()===e.original?.toString()&&l.viewModel.modifiedUri?.toString()===e.modified?.toString());if(n===-1)throw new Ni("Resource not found in diff editor");const o=i[n];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,ts(t=>{if(e.docStates)for(const i of this._viewItems.get()){const n=e.docStates[i.getKey()];n&&i.setViewState(n,t)}})}findDocumentDiffItem(e){return this._viewItems.get().find(i=>i.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||i.viewModel.diffEditorViewModel.model.original.uri.toString()===e.toString())?.viewModel.documentDiffItem}tryGetCodeEditor(e){const t=this._viewItems.get().find(n=>n.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||n.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,n=0,o=0;const r=this._sizeObserver.height.read(e),a=mi.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=mi.ofStartAndLength(n,h),f=mi.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=mi.ofStartAndLength(t+i,r);l.render(u,p,c,m)}n+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};wve=D([_(4,Le),_(5,we)],wve);function $It(s,e){const t=s.getModel(),i=s.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{s.getModel()===t&&i.clear()},350)}class GIt extends V{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(f3(this,void 0)),this.contentHeight=Ze(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=Ze(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=Ze(this,o=>this._templateRef.read(o)?.object),this._isHidden=jt(this,!1),this._isFocused=Ze(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(ai(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(ai(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.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return ts(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(),n=e.selections?.map(dt.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const o=this._templateRef.get();o&&n&&o.object.editor.setSelections(n)}_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&&ts(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new VIt(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,n)}}class $Ye extends V{async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){ts(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){ts(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=Ije(this.model,this.model.documents),this.items=YY(this,this._documents,(i,n)=>n.add(this._instantiationService.createInstance(yve,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=Ze(this,i=>this.items.read(i).find(n=>n.isFocused.read(i))),this.activeDiffItem=GAt(this,(i,n)=>this.focusedDiffItem.read(i)??n)}}let yve=class extends V{get diffEditorViewModel(){return this.diffEditorViewModelRef.object}get originalUri(){return this.documentDiffItem.original?.uri}get modifiedUri(){return this.documentDiffItem.modified?.uri}setIsFocused(e,t){this._isFocusedSource.set(e,t)}get documentDiffItem(){return this.documentDiffItemRef.object}constructor(e,t,i,n){super(),this._editorViewModel=t,this._instantiationService=i,this._modelService=n,this.collapsed=jt(this,!1),this.lastTemplateData=jt(this,{contentHeight:500,selections:void 0}),this.isActive=Ze(this,d=>this._editorViewModel.activeDiffItem.read(d)===this),this._isFocusedSource=jt(this,nd(!1)),this.isFocused=Ze(this,d=>this._isFocusedSource.read(d).read(d)),this.isAlive=jt(this,!0),this._register(Ee(()=>{this.isAlive.set(!1,void 0)})),this.documentDiffItemRef=this._register(e.createNewRef(this));function o(d){return{...d,hideUnchangedRegions:{enabled:!0}}}const r=this._instantiationService.createInstance(IJ,o(this.documentDiffItem.options||{}));this.documentDiffItem.onOptionsDidChange&&this._register(this.documentDiffItem.onOptionsDidChange(()=>{r.updateOptions(o(this.documentDiffItem.options||{}))}));const a=new Z,c=this.documentDiffItem.original??a.add(this._modelService.createModel("",null)),l=this.documentDiffItem.modified??a.add(this._modelService.createModel("",null));a.add(this.documentDiffItemRef.createNewRef(this)),this.diffEditorViewModelRef=this._register(aW.createWithDisposable(this._instantiationService.createInstance(xJ,{original:c,modified:l},r),a,this))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};yve=D([_(2,we),_(3,gi)],yve);W("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},g(9361,"The background color of the diff editor's header"));W("multiDiffEditor.background","editorBackground",g(9362,"The background color of the multi file diff editor"));W("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},g(9363,"The border color of the multi file diff editor"));let Cve=class extends V{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=jt(this,void 0),this._viewModel=jt(this,void 0),this._widgetImpl=AI(this,(n,o)=>(Fg(LJ,n),o.add(this._instantiationService.createInstance(Fg(wve,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=Ze(this,n=>this._widgetImpl.read(n).activeControl.read(n)),this.onDidChangeActiveControl=M.fromObservableLight(this._activeControl),this._register(FN(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new $Ye(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)}findDocumentDiffItem(e){return this._widgetImpl.get().findDocumentDiffItem(e)}};Cve=D([_(2,we)],Cve);const IRe=ae("IEditorCancelService"),GYe=new Q("cancellableOperation",!1,g(9366,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(IRe,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=GYe.bindTo(n.get(Le)),r=new hl;return{key:o,tokens:r}}),this._tokens.set(s,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(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},qt.Delayed);class KIt extends ci{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(IRe).add(e,this))}dispose(){this._unregister(),super.dispose()}}qe(new class extends hc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:Ae.EditorContrib,primary:S.Escape},precondition:GYe})}runEditorCommand(s,e){s.get(IRe).cancel(e)}});var jo;(function(s){s[s.Value=1]="Value",s[s.Selection=2]="Selection",s[s.Position=4]="Position",s[s.Scroll=8]="Scroll"})(jo||(jo={}));let Tae=class Sve{constructor(e,t){if(this.flags=t,this.flags&jo.Value){const i=e.getModel();this.modelVersionId=i?$p("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&jo.Position?this.position=e.getPosition():this.position=null,this.flags&jo.Selection?this.selection=e.getSelection():this.selection=null,this.flags&jo.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof Sve))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 Sve(e,this.flags))}};class Jk extends KIt{constructor(e,t,i,n){super(e,n),this._listener=new Z,t&jo.Position&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!F.containsPosition(i,o.position))&&this.cancel()})),t&jo.Selection&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!F.containsRange(i,o.selection))&&this.cancel()})),t&jo.Scroll&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&jo.Value&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class TRe extends ci{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class hW{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=vm.capture(e),o=hW._handleEolEdits(e,t);o.length===1&&hW._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>Zn.replace(F.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>Zn.replaceMove(F.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}function KYe(s){return s.scheme===pe.vscodeRemote?s.authority:void 0}function D6(s){if(!s)return;const e=s.indexOf("+");return e<0?s:s.substr(0,e)}const qIt="extensions.user.cache",QIt="extensions.builtin.cache",qYe="undefined_publisher",jIt=["ui","workspace","web"];function dK(s){if(typeof s=="object"&&s!==null&&s.supported!==!0)return s.description}const QYe=["AI","Azure","Chat","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","Other"];var br;(function(s){s[s.System=0]="System",s[s.User=1]="User"})(br||(br={}));var Es;(function(s){s.WIN32_X64="win32-x64",s.WIN32_ARM64="win32-arm64",s.LINUX_X64="linux-x64",s.LINUX_ARM64="linux-arm64",s.LINUX_ARMHF="linux-armhf",s.ALPINE_X64="alpine-x64",s.ALPINE_ARM64="alpine-arm64",s.DARWIN_X64="darwin-x64",s.DARWIN_ARM64="darwin-arm64",s.WEB="web",s.UNIVERSAL="universal",s.UNKNOWN="unknown",s.UNDEFINED="undefined"})(Es||(Es={}));class Sn{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,n=typeof t=="string"?t:t.value;return ua(i,n)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class A_{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(Sn.toKey(e))}delete(e){return this._set.delete(Sn.toKey(e))}has(e){return this._set.has(Sn.toKey(e))}}class va{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(Sn.toKey(e))}get(e){return this._map.get(Sn.toKey(e))}has(e){return this._map.has(Sn.toKey(e))}set(e,t){this._map.set(Sn.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function YIt(s){return LRe(s)}function LRe(s){return s.contributes&&s.contributes.localizations?s.contributes.localizations.length>0:!1}function JIt(s,e){if(e){const t=`onResolveRemoteAuthority:${D6(e)}`;return!!s.activationEvents?.includes(t)}return!1}function XIt(s){return s.map(e=>{const[t,i]=e.split("@");return{proposalName:t,version:i?parseInt(i):void 0}})}function ZIt(s){return s.map(e=>e.split("@")[0])}function Lae(s,e,t){const i=[],n=new A_,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.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 uW;(function(s){s[s.File=1]="File",s[s.Selection=2]="Selection"})(uW||(uW={}));var om;(function(s){s[s.Explicit=1]="Explicit",s[s.Silent=2]="Silent"})(om||(om={}));const $z=class $z{static setFormatterSelector(e){return{dispose:$z._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=hi.first($z._selectors);if(o)return await o(e,t,i,n)}};$z._selectors=new hl;let gW=$z;async function Rae(s,e,t,i,n,o,r){const a=s.get(we),{documentRangeFormattingEditProvider:c}=s.get(it),l=Qr(e)?e.getModel():e,d=c.ordered(l),h=await gW.select(d,l,i,uW.Selection);h&&(n.report(h),await a.invokeFunction(jYe,h,e,t,o,r))}async function jYe(s,e,t,i,n,o){const r=s.get(Ml),a=s.get(Ge),c=s.get(lv);let l,d;Qr(t)?(l=t.getModel(),d=new Jk(t,jo.Value|jo.Position,void 0,n)):(l=t,d=new TRe(t,n));const h=[];let u=0;for(const b of H_(i).sort(F.compareRangesUsingStarts))u>0&&F.areIntersectingOrTouching(h[u-1],b)?h[u-1]=F.fromPositions(h[u-1].getStartPosition(),b.getEndPosition()):u=h.push(b);const f=async b=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,b);const w=await e.provideDocumentRangeFormattingEdits(l,b,l.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,w),w},p=(b,w)=>{if(!b.length||!w.length)return!1;const y=b.reduce((C,A)=>F.plusRange(C,A.range),b[0].range);if(!w.some(C=>F.intersectRanges(y,C.range)))return!1;for(const C of b)for(const A of w)if(F.intersectRanges(C.range,A.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const b=await e.provideDocumentRangesFormattingEdits(l,h,l.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),v.push(b)}else{for(const b of h){if(d.token.isCancellationRequested)return!0;v.push(await f(b))}for(let b=0;b({text:y.text,range:F.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:C}of y)if(F.areIntersectingOrTouching(C,w))return[new dt(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return c.playSignal(cl.format,{userGesture:o}),!0}async function Ave(s,e,t,i,n,o){const r=s.get(we),a=s.get(it),c=Qr(e)?e.getModel():e,l=Lae(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await gW.select(l,c,t,uW.File);d&&(i.report(d),await r.invokeFunction(YYe,d,e,t,n,o))}async function YYe(s,e,t,i,n,o){const r=s.get(Ml),a=s.get(lv);let c,l;Qr(t)?(c=t.getModel(),l=new Jk(t,jo.Value|jo.Position,void 0,n)):(c=t,l=new TRe(t,n));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(Qr(t))hW.execute(t,d,i!==om.Silent),i!==om.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),mt.Immediate);else{const[{range:h}]=d,u=new dt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);c.pushEditOperations([u],d.map(f=>({text:f.text,range:F.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:p}of f)if(F.areIntersectingOrTouching(p,u))return[new dt(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(cl.format,{userGesture:o}),!0}async function e0t(s,e,t,i,n,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(No);if(eo(c))return await s.computeMoreMinimalEdits(t.uri,c)}}async function t0t(s,e,t,i,n){const o=Lae(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(No);if(eo(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function JYe(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(No).then(c=>s.computeMoreMinimalEdits(t.uri,c))}_t.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;Tt(N.isUri(t)),Tt(F.isIRange(i));const o=s.get(fn),r=s.get(Ml),a=s.get(it),c=await o.createModelReference(t);try{return e0t(r,a,c.object.textEditorModel,F.lift(i),n,He.None)}finally{c.dispose()}});_t.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;Tt(N.isUri(t));const n=s.get(fn),o=s.get(Ml),r=s.get(it),a=await n.createModelReference(t);try{return t0t(o,r,a.object.textEditorModel,i,He.None)}finally{a.dispose()}});_t.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string");const r=s.get(fn),a=s.get(Ml),c=s.get(it),l=await r.createModelReference(t);try{return JYe(a,c,l.object.textEditorModel,oe.lift(i),n,o,He.None)}finally{l.dispose()}});var Cl;(function(s){s[s.provider=0]="provider",s[s.userDefined=1]="userDefined",s[s.recovered=2]="recovered"})(Cl||(Cl={}));const i0t={[Cl.provider]:" ",[Cl.userDefined]:"u",[Cl.recovered]:"r"},OWe=65535,Vv=16777215,BWe=4278190080;class Bhe{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<OWe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Bhe(e.length),this._userDefinedStates=new Bhe(e.length),this._recoveredStates=new Bhe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=n};for(let i=0,n=this._startIndexes.length;iVv||r>Vv)throw new Error("startLineNumber or endLineNumber must not exceed "+Vv);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]&Vv}getEndLineNumber(e){return this._endIndexes[e]&Vv}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)?Cl.userDefined:this.isRecovered(e)?Cl.recovered:Cl.provider}setSource(e,t){t===Cl.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===Cl.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 n=0;n>>24)+((this._endIndexes[e]&BWe)>>>16);return t===OWe?-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)?b=>bb=d.startLineNumber))l&&l.startLineNumber===d.startLineNumber?(d.source===Cl.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=Cl.provider),l=o(++a)):(m=d,d.isCollapsed&&d.source===Cl.provider&&(m.source=Cl.recovered)),d=r(++c);else{let v=c,b=d;for(;;){if(!b||b.startLineNumber>l.endLineNumber){m=l;break}if(b.source===Cl.userDefined&&b.endLineNumber>l.endLineNumber)break;b=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 n0t{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-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,r=-1;const a=c=>{for(;nr&&(r=l),n++}};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=n=>{for(const o of e)if(!(o.startLineNumber>n.endLineNumber||n.startLineNumber>o.endLineNumber))return!0;return!1};for(let n=0;ni&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(n,o)=>{for(const r of e)if(n=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??Cl.provider})}const n=$f.sanitizeAndMerge(this._regions,t,i);this.updatePost($f.fromFoldRanges(n))}_getLinesChecksum(e,t){return Wc(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){const r=this._regions.toRegion(n);(!t||t(r,o))&&i.push(r),o++,n=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=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=n,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=n,a=this._regions.length;r1){const a=s.getRegionsInside(o,(c,l)=>c.isCollapsed!==r&&l0)for(const o of i){const r=s.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&n.push(r),t>1)){const a=s.getRegionsInside(r,(c,l)=>c.isCollapsed!==e&&lr.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);n.push(...r)}s.toggleCollapseState(n)}function o0t(s,e,t){const i=[];for(const n of t){const o=s.getAllRegionsAtLine(n,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}s.toggleCollapseState(i)}function r0t(s,e,t,i){const n=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(c=>r.containsLine(c)),o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function ZYe(s,e,t){const i=[];for(const r of t){const a=s.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const n=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function MRe(s,e,t){const i=s.textModel,n=s.regions,o=[];for(let r=n.length-1;r>=0;r--)if(t!==n.isCollapsed(r)){const a=n.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(n.toRegion(r))}s.toggleCollapseState(o)}function NRe(s,e,t){const i=s.regions,n=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&n.push(i.toRegion(o));s.toggleCollapseState(n)}function a0t(s,e){let t=null;const i=e.getRegionAtLine(s);if(i!==null&&(t=i.startLineNumber,s===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function c0t(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){if(s!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)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 l0t(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=n)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>s)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||Ab(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return WWe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=r=>((!n||!u0t(r,n))&&(n=WWe(this._hiddenRanges,r)),n?n.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 u0t(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function WWe(s,e){const t=w2(s,i=>e=0&&s[t].endLineNumber>=e?s[t]:null}const g0t=5e3,f0t="indent";class PRe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=f0t}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(_0t(this.editorModel,i,n,this.foldingRangesLimit))}}let p0t=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Vv||t>Vv)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=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),n=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],n[r]=this._endIndexes[o];return new $f(i,n)}else{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let c=0;ct){n=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=sae(h,o);(u{}};function _0t(s,e,t,i=m0t){const n=s.getOptions().tabSize,o=new p0t(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],c=s.getLineCount()+1;a.push({indent:-1,endAbove:c,line:c});for(let l=s.getLineCount();l>0;l--){const d=s.getLineContent(l),h=sae(d,n);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(s)}const v0t=W("editor.foldBackground",{light:st(AS,.3),dark:st(AS,.3),hcDark:null,hcLight:null},g(1685,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},g(1686,"Color of the collapsed text after the first line of a folded range."));W("editorGutter.foldingControlForeground",nY,g(1687,"Color of the folding control in the editor gutter."));const RJ=oi("folding-expanded",ve.chevronDown,g(1688,"Icon for expanded ranges in the editor glyph margin.")),MJ=oi("folding-collapsed",ve.chevronRight,g(1689,"Icon for collapsed ranges in the editor glyph margin.")),HWe=oi("folding-manual-collapsed",MJ,g(1690,"Icon for manually collapsed ranges in the editor glyph margin.")),UWe=oi("folding-manual-expanded",RJ,g(1691,"Icon for manually expanded ranges in the editor glyph margin.")),Whe={color:$o(v0t),position:Th.Inline},fP=g(1692,"Click to expand the range."),hK=g(1693,"Click to collapse the range."),$a=class $a{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?$a.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?$a.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:$a.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:$a.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?$a.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$a.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?$a.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$a.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?$a.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:$a.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?$a.MANUALLY_EXPANDED_VISUAL_DECORATION:$a.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};$a.COLLAPSED_VISUAL_DECORATION=Gt.register({description:"folding-collapsed-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(MJ)}),$a.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Gt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Whe,isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(MJ)}),$a.MANUALLY_COLLAPSED_VISUAL_DECORATION=Gt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(HWe)}),$a.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Gt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Whe,isWholeLine:!0,linesDecorationsTooltip:fP,firstLineDecorationClassName:We.asClassName(HWe)}),$a.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:fP}),$a.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Whe,isWholeLine:!0,linesDecorationsTooltip:fP}),$a.EXPANDED_VISUAL_DECORATION=Gt.register({description:"folding-expanded-visual-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+We.asClassName(RJ),linesDecorationsTooltip:hK}),$a.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Gt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:We.asClassName(RJ),linesDecorationsTooltip:hK}),$a.MANUALLY_EXPANDED_VISUAL_DECORATION=Gt.register({description:"folding-manually-expanded-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+We.asClassName(UWe),linesDecorationsTooltip:hK}),$a.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Gt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:We.asClassName(UWe),linesDecorationsTooltip:hK}),$a.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),$a.HIDDEN_RANGE_DECORATION=Gt.register({description:"folding-hidden-range-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges});let Eve=$a;const b0t={},w0t="syntax";class FRe{constructor(e,t,i,n,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=o,this.id=w0t,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 y0t(this.providers,this.editorModel,e).then(t=>t?S0t(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function y0t(s,e,t){let i=null;const n=s.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,b0t,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})}},No));return Promise.all(n).then(o=>i)}class C0t{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>Vv||t>Vv)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||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 n=0;ne){i=a;break}t+=c}}const n=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 C0t(e);let n;const o=[];for(const r of t)if(!n)n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>n.start)if(r.end<=n.end)o.push(n),n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>n.end){do n=o.pop();while(n&&r.start>n.end);n&&o.push(n),n=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var c0;const md=new Q("foldingEnabled",!1);var vL;let TA=(vL=class extends V{static get(e){return e.getContribution(c0.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return c0._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return c0._foldingRangeSelector=e,{dispose:()=>{c0._foldingRangeSelector=void 0}}}constructor(e,t,i,n,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new eJe(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 Eve(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=md.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 s0t(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new h0t(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Mh(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new cn(()=>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 PRe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=c0.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new FRe(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 js,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Rr(o=>i.compute(o));return n.then(o=>{if(o&&n===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(l_.Imports.value,!0);d&&(r=vm.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=>(vt(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 n=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&n.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,vt)}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 Rt.GUTTER_LINE_DECORATIONS:{const n=e.target.detail,o=e.target.element.offsetLeft;if(n.offsetX-o<4)return;i=!0;break}case Rt.CONTENT_EMPTY:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case Rt.CONTENT_TEXT:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.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,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(e.target.type!==Rt.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(n||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,mt.Smooth)}},c0=vL,vL.ID="editor.contrib.folding",vL);TA=c0=D([_(1,Le),_(2,Vs),_(3,bi),_(4,Sp),_(5,it)],TA);class eJe{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 Zd extends tt{runEditorCommand(e,t,i){const n=e.get(Vs),o=TA.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,n);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 tJe(s){if(!Ya(s)){if(!kn(s))return!1;const e=s;if(!Ya(e.levels)&&!lc(e.levels)||!Ya(e.direction)&&!Lt(e.direction)||!Ya(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(lc)))return!1}return!0}class A0t extends Zd{constructor(){super({id:"editor.unfold",label:g(453,"Unfold"),alias:"Unfold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.BracketRight,mac:{primary:U.CtrlCmd|U.Alt|S.BracketRight},weight:Ae.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(y)})),i.getOption(x.readOnly)||v.push(new rn("diff.inline.revertChange",g(9962,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Ro(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:v}=Cr(this._diffActions),b=Math.floor(d/3);p.preventDefault(),f(p.posx,m+v+b)})),this._register(i.onMouseMove(p=>{(p.target.type===Rt.CONTENT_VIEW_ZONE||p.target.type===Rt.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===Rt.CONTENT_VIEW_ZONE||p.target.type===Rt.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:n}=Cr(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let c=0;for(let l=0;ls});function TYe(s,e,t,i){xl(i,e.fontInfo);const n=t.length>0,o=new pU(1e4);let r=0,a=0;const c=[];for(let u=0;u');const c=e.getLineContent(),l=hp.isBasicASCII(c,n),d=hp.containsRTL(c,l,o),h=Z7(new pI(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!==xk.OFF,null),a);return a.appendString(""),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}let rve=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=c,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=jt(this,0),this._originalScrollOffset=jt(this,0),this._originalScrollOffsetAnimated=rWe(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=jt(this,0),this._modifiedScrollOffset=jt(this,0),this._modifiedScrollOffsetAnimated=rWe(this._targetWindow,this._modifiedScrollOffset,this._store);const h=jt("invalidateAlignmentsState",0),u=this._register(new cn(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(y=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(y=>{(y.hasChanged(x.wrappingInfo)||y.hasChanged(x.lineHeight))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(y=>{(y.hasChanged(x.wrappingInfo)||y.hasChanged(x.lineHeight))&&u.schedule()}));const f=this._diffModel.map(y=>y?Kn(this,y.model.original.onDidChangeTokens,()=>y.model.original.tokenization.backgroundTokenizationState===eD.Completed):void 0).map((y,C)=>y?.read(C)),p=Ze(y=>{const C=this._diffModel.read(y),A=C?.diff.read(y);if(!C||!A)return null;h.read(y);const k=this._options.renderSideBySide.read(y);return pWe(this._editors.original,this._editors.modified,A.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=Ze(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);if(!C)return null;h.read(y);const A=C.changes.map(L=>new IYe(L));return pWe(this._editors.original,this._editors.modified,A,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const y=document.createElement("div");return y.className="diagonal-fill",y}const b=this._register(new Z);this.viewZones=vI(this,(y,C)=>{b.clear();const A=p.read(y)||[],L=[],k=[],P=this._modifiedTopPadding.read(y);P>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:P,showInHiddenAreas:!0,suppressMouseDown:!0});const R=this._originalTopPadding.read(y);R>0&&L.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:R,showInHiddenAreas:!0,suppressMouseDown:!0});const z=this._options.renderSideBySide.read(y),G=z?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(G){const Pe=this._editors.original.getModel();for(const lt of A)if(lt.diff)for(let xt=lt.originalRange.startLineNumber;xtPe.getLineCount())return{orig:L,mod:k};G?.addRequest(Pe.getLineContent(xt),null,null)}}const j=G?.finalize()??[];let K=0;const ie=this._editors.modified.getOption(x.lineHeight),ge=this._diffModel.read(y)?.movedTextToCompare.read(y),xe=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,Re=this._editors.original.getModel()?.mightContainRTL()??!1,yt=Eae.fromEditor(this._editors.modified);for(const Pe of A)if(Pe.diff&&!z&&(!this._options.useTrueInlineDiffRendering.read(y)||!pRe(Pe.diff))){if(!Pe.originalRange.isEmpty){f.read(y);const xt=document.createElement("div");xt.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ji=this._editors.original.getModel();if(Pe.originalRange.endLineNumberExclusive-1>Ji.getLineCount())return{orig:L,mod:k};const Ii=new LYe(Pe.originalRange.mapToLineArray(ds=>Ji.tokenization.getLineTokens(ds)),Pe.originalRange.mapToLineArray(ds=>j[K++]),xe,Re),ns=[];for(const ds of Pe.diff.innerChanges||[])ns.push(new IO(ds.originalRange.delta(-(Pe.diff.original.startLineNumber-1)),sW.className,Ja.Regular));const zs=TYe(Ii,yt,ns,xt),Pn=document.createElement("div");if(Pn.className="inline-deleted-margin-view-zone",xl(Pn,yt.fontInfo),this._options.renderIndicators.read(y))for(let ds=0;dsqn(Xr),Pn,this._editors.modified,Pe.diff,this._diffEditorWidget,zs.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let ds=0;ds1&&L.push({afterLineNumber:Pe.originalRange.startLineNumber+ds,domNode:v(),heightInPx:(Zo-1)*ie,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Pe.modifiedRange.startLineNumber-1,domNode:xt,heightInPx:zs.heightInLines*ie,minWidthInPx:zs.minWidthInPx,marginDomNode:Pn,setZoneId(ds){Xr=ds},showInHiddenAreas:!0,suppressMouseDown:!0})}const lt=document.createElement("div");lt.className="gutter-delete",L.push({afterLineNumber:Pe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:Pe.modifiedHeightInPx,marginDomNode:lt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const lt=Pe.modifiedHeightInPx-Pe.originalHeightInPx;if(lt>0){if(ge?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Pe.originalRange.endLineNumberExclusive-1))continue;L.push({afterLineNumber:Pe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:lt,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let xt=function(){const Ii=document.createElement("div");return Ii.className="arrow-revert-change "+We.asClassName(ve.arrowRight),C.add(ue(Ii,"mousedown",ns=>ns.stopPropagation())),C.add(ue(Ii,"click",ns=>{ns.stopPropagation(),o.revert(Pe.diff)})),fe("div",{},Ii)};if(ge?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Pe.modifiedRange.endLineNumberExclusive-1))continue;let Ji;Pe.diff&&Pe.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(y)&&(Ji=xt()),k.push({afterLineNumber:Pe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-lt,marginDomNode:Ji,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Pe of m.read(y)??[]){if(!ge?.lineRangeMapping.original.intersect(Pe.originalRange)||!ge?.lineRangeMapping.modified.intersect(Pe.modifiedRange))continue;const lt=Pe.modifiedHeightInPx-Pe.originalHeightInPx;lt>0?L.push({afterLineNumber:Pe.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:lt,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Pe.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-lt,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:L,mod:k}});let w=!1;this._register(this._editors.original.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.modified.setScrollLeft(y.scrollLeft),w=!1)})),this._register(this._editors.modified.onDidScrollChange(y=>{y.scrollLeftChanged&&!w&&(w=!0,this._editors.original.setScrollLeft(y.scrollLeft),w=!1)})),this._originalScrollTop=Kn(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Kn(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ai(y=>{const C=this._originalScrollTop.read(y)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(y))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(y));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,mt.Immediate)})),this._register(ai(y=>{const C=this._modifiedScrollTop.read(y)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(y))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(y));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,mt.Immediate)})),this._register(ai(y=>{const C=this._diffModel.read(y)?.movedTextToCompare.read(y);let A=0;if(C){const L=this._editors.original.getTopForLineNumber(C.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();A=this._editors.modified.getTopForLineNumber(C.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-L}A>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(A,void 0)):A<0?(this._modifiedTopPadding.set(-A,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()-A,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+A,void 0,!0)}))}};rve=D([_(8,ag),_(9,lr)],rve);function pWe(s,e,t,i,n,o){const r=new By(mWe(s,i)),a=new By(mWe(e,n)),c=s.getOption(x.lineHeight),l=e.getOption(x.lineHeight),d=[];let h=0,u=0;function f(p,m){for(;;){let v=r.peek(),b=a.peek();if(v&&v.lineNumber>=p&&(v=void 0),b&&b.lineNumber>=m&&(b=void 0),!v&&!b)break;const w=v?v.lineNumber-h:Number.MAX_VALUE,y=b?b.lineNumber-u:Number.MAX_VALUE;wy?(a.dequeue(),v={lineNumber:b.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:pi.ofLength(v.lineNumber,1),modifiedRange:pi.ofLength(b.lineNumber,1),originalHeightInPx:c+v.heightInPx,modifiedHeightInPx:l+b.heightInPx,diff:void 0})}}for(const p of t){let y=function(C,A,L=!1){if(CG.lineNumberG+j.heightInPx,0)??0,z=a.takeWhile(G=>G.lineNumberG+j.heightInPx,0)??0;d.push({originalRange:k,modifiedRange:P,originalHeightInPx:k.length*c+R,modifiedHeightInPx:P.length*l+z,diff:p.lineRangeMapping}),w=C,b=A};const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let v=!0,b=m.modified.startLineNumber,w=m.original.startLineNumber;if(o)for(const C of m.innerChanges||[]){C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&y(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber);const A=s.getModel(),L=C.originalRange.endLineNumber<=A.getLineCount()?A.getLineMaxColumn(C.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;C.originalRange.endColumn1&&i.push({lineNumber:c,heightInPx:r*(l-1)})}for(const c of s.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 zkt(t,i,c=>c.lineNumber,(c,l)=>({lineNumber:c.lineNumber,heightInPx:c.heightInPx+l.heightInPx}))}function pRe(s){return s.innerChanges?s.innerChanges.every(e=>_We(e.modifiedRange)&&_We(e.originalRange)):!1}function _We(s){return s.startLineNumber===s.endLineNumber}const Hz=class Hz extends V{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=Kn(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Kn(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=ed("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=jt(this,0),this._modifiedViewZonesChangedSignal=ed("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=ed("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=vI(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 P(Re,yt){const Pe=yt.getTopForLineNumber(Re.startLineNumber,!0),lt=yt.getTopForLineNumber(Re.endLineNumberExclusive,!0);return(Pe+lt)/2}const R=P(k.lineRangeMapping.original,this._editors.original),z=this._originalScrollTop.read(d),G=P(k.lineRangeMapping.modified,this._editors.modified),j=this._modifiedScrollTop.read(d),K=R-z,ie=G-j,ge=Math.min(R,G),xe=Math.max(R,G);return{range:new mi(ge,xe),from:K,to:ie,fromWithoutScroll:R,toWithoutScroll:G,move:k}});v.sort(f6e(Cc(k=>k.fromWithoutScroll>k.toWithoutScroll,trt),Cc(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,iu)));const b=mRe.compute(v.map(k=>k.range)),w=10,y=p.verticalScrollbarWidth,C=(b.getTrackCount()-1)*10+w*2,A=y+C+(m.contentLeft-Hz.movedCodeBlockPadding);let L=0;for(const k of v){const P=b.getTrack(L),R=y+w+P*10,z=15,G=15,j=A,K=m.glyphMarginWidth+m.lineNumbersWidth,ie=18,ge=document.createElementNS("http://www.w3.org/2000/svg","rect");ge.classList.add("arrow-rectangle"),ge.setAttribute("x",`${j-K}`),ge.setAttribute("y",`${k.to-ie/2}`),ge.setAttribute("width",`${K}`),ge.setAttribute("height",`${ie}`),this._element.appendChild(ge);const xe=document.createElementNS("http://www.w3.org/2000/svg","g"),Re=document.createElementNS("http://www.w3.org/2000/svg","path");Re.setAttribute("d",`M 0 ${k.from} L ${R} ${k.from} L ${R} ${k.to} L ${j-G} ${k.to}`),Re.setAttribute("fill","none"),xe.appendChild(Re);const yt=document.createElementNS("http://www.w3.org/2000/svg","polygon");yt.classList.add("arrow"),h.add(ai(Pe=>{Re.classList.toggle("currentMove",k.move===u.activeMovedText.read(Pe)),yt.classList.toggle("currentMove",k.move===u.activeMovedText.read(Pe))})),yt.setAttribute("points",`${j-G},${k.to-z/2} ${j},${k.to} ${j-G},${k.to+z/2}`),xe.appendChild(yt),this._element.appendChild(xe),L++}this.width.set(C,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(ai(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-Hz.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(RN(this._state));const r=Ze(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new dF(td(f.lineRangeMapping.original.startLineNumber-1),18),modified:new dF(td(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(yJ(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(yJ(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(au((d,h)=>{const u=r.read(d);for(const f of u)h.add(new vWe(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new vWe(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=ed("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),c=ed("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let l="modified";this._register(xU({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)}))}};Hz.movedCodeBlockPadding=4;let GO=Hz;class mRe{static compute(e){const t=[],i=[];for(const n of e){let o=t.findIndex(r=>!r.intersectsStrict(n));o===-1&&(t.length>=6?o=Qot(t,Cc(a=>a.intersectWithRangeLength(n),iu)):(o=t.length,t.push(new cTe))),t[o].addRange(n),i.push(o)}return new mRe(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class vWe extends cRe{constructor(e,t,i,n,o){const r=Bt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Bt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Bt("div.text-content@textContent"),Bt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Kn(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(DA(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let c;i.changes.length>0?c=this._kind==="original"?g(5264,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(5265,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):c=this._kind==="original"?g(5266,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):g(5267,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new ld(this._nodes.actionBar,{highlightToggledItems:!0})),d=new rn("",c,"",!1);l.push(d,{icon:!1,label:!0});const h=new rn("","Compare",We.asClassName(ve.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ai(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),l.push(h,{icon:!1,label:!0})}}class _It extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Ze(this,o=>{const r=this._diffModel.read(o),a=r?.diff.read(o);if(!a)return null;const c=this._diffModel.read(o).movedTextToCompare.read(o),l=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),h=[],u=[];if(!c)for(const p of a.mappings)if(p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:l?k3:hWe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:l?CJ:dWe}),p.lineRangeMapping.modified.isEmpty||p.lineRangeMapping.original.isEmpty)p.lineRangeMapping.original.isEmpty||h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:uRe}),p.lineRangeMapping.modified.isEmpty||u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:dRe});else{const m=this._options.useTrueInlineDiffRendering.read(o)&&pRe(p.lineRangeMapping);for(const v of p.lineRangeMapping.innerChanges||[])if(p.lineRangeMapping.original.contains(v.originalRange.startLineNumber)&&h.push({range:v.originalRange,options:v.originalRange.isEmpty()&&d?gRe:sW}),p.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber)&&u.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()&&d&&!m?hRe:SJ}),m){const b=r.model.original.getValueInRange(v.originalRange);u.push({range:v.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(c)for(const p of c.changes){const m=p.original.toInclusiveRange();m&&h.push({range:m,options:l?k3:hWe});const v=p.modified.toInclusiveRange();v&&u.push({range:v,options:l?CJ:dWe});for(const b of p.innerChanges||[])h.push({range:b.originalRange,options:sW}),u.push({range:b.modifiedRange,options:SJ})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const p of a.movedTexts)h.push({range:p.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(p===f?" currentMove":""),blockPadding:[GO.movedCodeBlockPadding,0,GO.movedCodeBlockPadding,GO.movedCodeBlockPadding]}}),u.push({range:p.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(p===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(wJ(this._editors.original,this._decorations.map(o=>o?.originalDecorations||[]))),this._register(wJ(this._editors.modified,this._decorations.map(o=>o?.modifiedDecorations||[])))}}class vIt{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=g6(this,i=>{const n=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(n,i)},(i,n)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,n)}),this._sashRatio=jt(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:oi-r?i-r:o}}class RYe extends V{constructor(e,t,i,n,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Pd(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:fi.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(ai(a=>{const c=this._boundarySashes.read(a);c&&(this._sash.orthogonalEndSash=c.bottom)})),this._register(ai(a=>{const c=this._enabled.read(a);this._sash.state=c?oa.Enabled:oa.Disabled,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class bIt extends V{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Kn(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Kn(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=ed("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=ed("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=lC("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Bt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{ts(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Ee(()=>o.disconnect())),this._register(ai(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(ai(r=>this.render(r)))}dispose(){super.dispose(),aa(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(),n=new Set(this.views.keys()),o=mi.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new pi(r.startLineNumber,r.endLineNumber+1),c=this.itemProvider.getIntersectingGutterItems(a,e);ts(l=>{for(const d of c){if(!d.range.intersect(a))continue;n.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=jt("item",d),b=this.itemProvider.createView(v,m);h=new wIt(v,b,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(mi.ofStartAndLength(u,p),o)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class wIt{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class MYe extends U_{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class ave extends EKe{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 Ju(e-1,t)}}var yIt=".monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}";ut(yIt,{});class NYe extends V{constructor(e,t,i={orientation:M_.HORIZONTAL}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new F1e),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new Z),i.hoverDelegate=i.hoverDelegate??this._register(Wk()),this.options=i,this.toggleMenuAction=this._register(new I3(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new ld(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(n,o)=>{if(n.id===I3.ID)return this.toggleMenuActionViewItem=new nA(n,n.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:We.asClassNameArray(i.moreIcon??ve.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(n,o);if(r)return r}if(n instanceof Ik){const r=new nA(n,n.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:n.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(n=>{this.actionBar.push(n,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(n)})})}isEmpty(){return this.actionBar.isEmpty()}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const mse=class mse extends rn{constructor(e,t){t=t||g(10094,"More Actions..."),super(mse.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}};mse.ID="toolbar.toggle.more";let I3=mse;var rA;(function(s){s[s.NoHide=-1]="NoHide",s[s.Ignore=0]="Ignore",s[s.RenderInSecondaryGroup=1]="RenderInSecondaryGroup"})(rA||(rA={}));let oW=class extends NYe{constructor(e,t,i,n,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=n,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 n=e.slice(),o=t.slice(),r=[];let a=0;const c=[];let l=!1;if(this._options?.hiddenItemStrategy!==rA.NoHide)for(let d=0;df?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let f=0;f=h&&(n[f]=void 0,c[f]=p))}}cM(n),cM(c),super.setActions(n,Ar.join(c,o)),(r.length>0||n.length>0)&&this._sessionDisposables.add(ue(this.getElement(),"contextmenu",d=>{const h=new Sh(ct(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof Sc&&u.menuKeybinding)f.push(u.menuKeybinding);else if(!(u instanceof Dy||u instanceof I3)){const m=!!this._keybindingService.lookupKeybinding(u.id);f.push(CYe(this._commandService,this._keybindingService,u.id,void 0,m))}if(r.length>0){let m=!1;if(a===1&&this._options?.hiddenItemStrategy===rA.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})}))}};oW=D([_(2,Oa),_(3,Le),_(4,lr),_(5,Ut),_(6,vi),_(7,Yi)],oW);let mm=class extends oW{constructor(e,t,i,n,o,r,a,c,l){super(e,{resetMenu:t,...i},n,o,r,a,c,l),this._onDidChangeMenuItems=this._store.add(new I),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),h=()=>{const u=[],f=[];dC(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 Ni("This toolbar is populated from a menu.")}};mm=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,vi),_(8,Yi)],mm);const Ihe=[],rK=35;let cve=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=c,this._menuService=l,this._menu=this._register(this._menuService.createMenu(_e.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Kn(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=Ze(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=Ze(this,d=>this._hasActions.read(d)?rK:0),this.elements=Bt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:rK+"px"}},[]),this._currentDiff=Ze(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=Ze(this,d=>{const u=this._diffModel.read(d)?.diff.read(d);if(!u)return Ihe;const f=this._editors.modifiedSelections.read(d);if(f.every(b=>b.isEmpty()))return Ihe;const p=new Kp(f.map(b=>pi.fromRangeInclusive(b))),v=u.mappings.filter(b=>b.lineRangeMapping.innerChanges&&p.intersects(b.lineRangeMapping.modified)).map(b=>({mapping:b,rangeMappings:b.lineRangeMapping.innerChanges.filter(w=>f.some(y=>F.areIntersecting(w.modifiedRange,y)))}));return v.length===0||v.every(b=>b.rangeMappings.length===0)?Ihe:v}),this._register($kt(e,this.elements.root)),this._register(ue(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(DA(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),fh(this,d=>this._showSash.read(d)?new RYe(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,g6(this,u=>this._sashLayout.sashLeft.read(u)-rK,(u,f)=>this._sashLayout.sashLeft.set(u+rK,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new bIt(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=$_.fromRangeMappings(p.flatMap(b=>b.rangeMappings));return[new bWe(v,!0,_e.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const m=this._currentDiff.read(h);return f.mappings.map(v=>new bWe(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===m?.lineRangeMapping,_e.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))},createView:(d,h)=>this._instantiationService.createInstance(lve,d,h,this)})),this._register(ue(this.elements.gutter,ke.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 ave(this._editors.modifiedModel.get()),n=new ave(this._editors.original.getModel());return new N2(t.map(a=>a.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};cve=D([_(6,we),_(7,Le),_(8,Oa)],cve);class bWe{constructor(e,t,i,n,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let lve=class extends V{constructor(e,t,i,n){super(),this._item=e,this._elements=Bt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Bt("div.background@background",{},[]),Bt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=jt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(CM,"element",!0,{position:{hoverPosition:vo.RIGHT}}));this._register(lF(t,this._elements.root)),this._register(ai(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(au((r,a)=>{this._elements.buttons.replaceChildren();const c=a.add(n.createInstance(mm,this._elements.buttons,this._menuId.read(r),{orientation:M_.VERTICAL,hoverDelegate:o,toolbarOptions:{primaryGroup:l=>l.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:rA.Ignore,actionRunner:new MYe(()=>{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 n=e.length/2-i/2,o=i;let r=e.start+n;const a=mi.tryCreate(o,t.endExclusive-o-i),c=mi.tryCreate(e.start+o,e.endExclusive-i-o);c&&a&&c.start{const n=UE._map.get(e);n&&(UE._map.delete(e),n.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new EU(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=jt(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.readOnly)),this._versionId=uJ({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=uJ({owner:this,equalsFn:Nq(q2(dt.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Yh({owner:this,equalsFn:Nq(q2(oe.equals))},t=>this.selections.read(t)?.map(i=>i.getStartPosition())??null),this.isFocused=Kn(this,t=>{const i=this.editor.onDidFocusEditorWidget(t),n=this.editor.onDidBlurEditorWidget(t);return{dispose(){i.dispose(),n.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=g6(this,t=>(this.versionId.read(t),this.model.read(t)?.getValue()??""),(t,i)=>{const n=this.model.get();n!==null&&t!==n.getValue()&&n.setValue(t)}),this.valueIsEmpty=Ze(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=Yh({owner:this,equalsFn:Nq(dt.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=Yh({owner:this,equalsFn:oe.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.onDidType=lC(this),this.scrollTop=Kn(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Kn(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Kn(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.contentWidth=Kn(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this._overlayWidgetCounter=0,this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(t=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(t=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}}))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e){return Kn(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new Z,i=this.editor.createDecorationsCollection();return t.add(f6({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._overlayWidgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=ai(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return Ee(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}};UE._map=new Map;let dve=UE;function hve(s,e){return TAt({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(s)){const n=t.change;n!==void 0&&i.deltas.push(n),i.didChange=!0}return!0}},(t,i)=>{const n=s.read(t);i.didChange&&e(n,i.deltas)})}function CIt(s,e){const t=new Z,i=hve(s,(n,o)=>{t.clear(),e(n,o,t)});return{dispose(){i.dispose(),t.dispose()}}}var qq,gL;let EJ=(gL=class extends V{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=fh(this,c=>{const l=this._editors.modifiedModel.read(c),d=qq._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===Oi.ContentFlush)return;const l=this._diffModel.get();ts(d=>{for(const h of this._editors.original.getSelections()||[])l?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,d_.FromCloserSide,d),l?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,d_.FromCloserSide,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===Oi.ContentFlush)return;const l=this._diffModel.get();ts(d=>{for(const h of this._editors.modified.getSelections()||[])l?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,d_.FromCloserSide,d),l?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,d_.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=vI(this,(c,l)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],u=[],f=this._options.renderSideBySide.read(c),p=this._options.compactMode.read(c),m=o.read(c);for(let v=0;vb.getHiddenOriginalRange(C).startLineNumber-1),y=new dF(w,12);h.push(y),l.add(new wWe(this._editors.original,y,b,!f))}{const w=Ze(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new dF(w,12);u.push(y),l.add(new wWe(this._editors.modified,y,b))}}else{{const w=Ze(this,C=>b.getHiddenOriginalRange(C).startLineNumber-1),y=new dF(w,24);h.push(y),l.add(new yWe(this._editors.original,y,b,b.originalUnchangedRange,!f,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,d_.FromBottom,void 0),this._options))}{const w=Ze(this,C=>b.getHiddenModifiedRange(C).startLineNumber-1),y=new dF(w,24);u.push(y),l.add(new yWe(this._editors.modified,y,b,b.modifiedUnchangedRange,!1,d,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,d_.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 Mt(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(g(5244,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+We.asClassName(ve.fold),zIndex:10001};this._register(wJ(this._editors.original,Ze(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:F.fromPositions(new oe(h.originalLineNumber,1)),options:a});return d}))),this._register(wJ(this._editors.modified,Ze(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:pi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(ai(c=>{const l=o.read(c);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(l.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(Fc)),this._editors.modified.setHiddenAreas(l.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(Fc))}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()}}))}},qq=gL,gL._breadcrumbsSourceFactory=jt(qq,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),gL);EJ=qq=D([_(3,we)],EJ);class wWe extends cRe{constructor(e,t,i,n=!1){const o=Bt("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=Bt("div.diff-hidden-lines-compact",[Bt("div.line-left",[]),Bt("div.text@text",[]),Bt("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(ai(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,c=g(5245,"{0} hidden lines",a);this._nodes.text.innerText=c}}))}}class yWe extends cRe{constructor(e,t,i,n,o,r,a,c){const l=Bt("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=c,this._nodes=Bt("div.diff-hidden-lines",[Bt("div.top@top",{title:g(5246,"Click or drag to show more above")}),Bt("div.center@content",{style:{display:"flex"}},[Bt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[fe("a",{title:g(5247,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Cb("$(unfold)"))]),Bt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Bt("div.bottom@bottom",{title:g(5248,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?aa(this._nodes.first):this._register(DA(this._nodes.first,{width:Jh(this._editor).layoutInfoContentLeft})),this._register(ai(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const f=this._unchangedRegion.isDragged.read(h),p=this._editor.getDomNode();p&&(p.classList.toggle("draggingUnchangedRegion",!!f),f==="top"?(p.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),p.classList.toggle("canMoveBottom",!u)):f==="bottom"?(p.classList.toggle("canMoveTop",!u),p.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(p.classList.toggle("canMoveTop",!1),p.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(ue(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const m=ct(this._nodes.top),v=ue(m,"mousemove",w=>{const C=w.clientY-u;f=f||Math.abs(C)>2;const A=Math.round(C/d.getOption(x.lineHeight)),L=Math.max(0,Math.min(p+A,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=ue(m,"mouseup",w=>{f||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),v.dispose(),b.dispose()})})),this._register(ue(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const m=ct(this._nodes.bottom),v=ue(m,"mousemove",w=>{const C=w.clientY-u;f=f||Math.abs(C)>2;const A=Math.round(C/d.getOption(x.lineHeight)),L=Math.max(0,Math.min(p-A,this._unchangedRegion.getMaxVisibleLineCountBottom())),k=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const P=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(P-k))}),b=ue(m,"mouseup",w=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!f){const y=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),b.dispose()})})),this._register(ai(h=>{const u=[];if(!this._hide){const f=i.getHiddenModifiedRange(h).length,p=g(5245,"{0} hidden lines",f),m=fe("span",{title:g(5249,"Double click to unfold")},p);m.addEventListener("dblclick",w=>{w.button===0&&(w.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(m);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){u.push(fe("span",void 0,"  |  "));for(let w=0;w{this._revealModifiedHiddenLine(y.startLineNumber)}}}}aa(this._nodes.others,...u)}))}}var mv,OS;let rW=(OS=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=mv.ENTIRE_DIFF_OVERVIEW_WIDTH;const c=Kn(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=Ze(u=>{const f=c.read(u),p=f.getColor(cft)||(f.getColor(gy)||Lpe).transparent(2),m=f.getColor(lft)||(f.getColor(XP)||Rpe).transparent(2);return{insertColor:p,removeColor:m}}),d=ls(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Bt("div.diffOverview",{style:{position:"absolute",top:"0px",width:mv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(lF(h,d.domNode)),this._register(Ro(h,ke.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(ue(h,ke.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(lF(this._rootElement,h)),this._register(au((u,f)=>{const p=this._diffModel.read(u),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(lF(h,m.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(f.add(v),f.add(lF(h,v.getDomNode()))),!m||!v)return;const b=ed("viewZoneChanged",this._editors.original.onDidChangeViewZones),w=ed("viewZoneChanged",this._editors.modified.onDidChangeViewZones),y=ed("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=ed("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(ai(A=>{b.read(A),w.read(A),y.read(A),C.read(A);const L=l.read(A),k=p?.diff.read(A)?.mappings;function P(G,j,K){const ie=K._getViewModel();return ie?G.filter(ge=>ge.length>0).map(ge=>{const xe=ie.coordinatesConverter.convertModelPositionToViewPosition(new oe(ge.startLineNumber,1)),Re=ie.coordinatesConverter.convertModelPositionToViewPosition(new oe(ge.endLineNumberExclusive,1)),yt=Re.lineNumber-xe.lineNumber;return new Oqe(xe.lineNumber,Re.lineNumber,yt,j.toString())}):[]}const R=P((k||[]).map(G=>G.lineRangeMapping.original),L.removeColor,this._editors.original),z=P((k||[]).map(G=>G.lineRangeMapping.modified),L.insertColor,this._editors.modified);m?.setZones(R),v?.setZones(z)})),f.add(ai(A=>{const L=this._rootHeight.read(A),k=this._rootWidth.read(A),P=this._modifiedEditorLayoutInfo.read(A);if(P){const R=mv.ENTIRE_DIFF_OVERVIEW_WIDTH-2*mv.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:L,right:R+mv.ONE_OVERVIEW_WIDTH,width:mv.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:L,right:0,width:mv.ONE_OVERVIEW_WIDTH});const z=this._editors.modifiedScrollTop.read(A),G=this._editors.modifiedScrollHeight.read(A),j=this._editors.modified.getOption(x.scrollbar),K=new U2(j.verticalHasArrows?j.arrowSize:0,j.verticalScrollbarSize,0,P.height,G,z);d.setTop(K.getSliderPosition()),d.setHeight(K.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=L+"px",h.style.left=k-mv.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(mv.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},mv=OS,OS.ONE_OVERVIEW_WIDTH=15,OS.ENTIRE_DIFF_OVERVIEW_WIDTH=OS.ONE_OVERVIEW_WIDTH*2,OS);rW=mv=D([_(6,pn)],rW);const The=[];class SIt extends V{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=Ze(this,o=>{const a=this._diffModel.read(o)?.diff.read(o);if(!a)return The;const c=this._editors.modifiedSelections.read(o);if(c.every(u=>u.isEmpty()))return The;const l=new Kp(c.map(u=>pi.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=>F.areIntersecting(f.modifiedRange,p)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?The:h}),this._register(au((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 xJ(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 xJ(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 _se=class _se extends V{getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${_se.counter++}`,this._domNode=Bt("div.revertButton",{title:this._revertSelection?g(5268,"Revert Selected Changes"):g(5269,"Revert Change")},[qy(ve.arrowRight)]).root,this._register(ue(this._domNode,ke.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(ue(this._domNode,ke.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(ue(this._domNode,ke.CLICK,o=>{this._diffs instanceof k_?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:z_.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};_se.counter=0;let xJ=_se,uve=class extends V{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,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=Kn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Kn(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Jh(this.modified),this.originalObs=Jh(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Kn(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Yh({owner:this,equalsFn:oe.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new oe(1,1)),this.originalCursor=Kn(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new oe(1,1)),this.isOriginalFocused=Jh(this.original).isFocused,this.isModifiedFocused=Jh(this.modified).isFocused,this.isFocused=Ze(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(xU({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),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+rW.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=vh.revealHorizontalRightPadding.defaultValue+rW.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(5270," 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,""):""}};uve=D([_(5,we),_(6,Ut)],uve);const vse=class vse extends V{constructor(){super(...arguments),this._id=++vse.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=mt.Smooth){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=mt.Smooth){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=mt.Smooth){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=mt.Smooth){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=mt.Smooth){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=mt.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=mt.Smooth){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=mt.Smooth){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=mt.Smooth){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=mt.Smooth){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=mt.Smooth,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=mt.Smooth){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=mt.Smooth){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=mt.Smooth){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=mt.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)}};vse.idCounter=0;let gve=vse,DJ=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=jt(this,0),this._screenReaderMode=Kn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Ze(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Ze(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=Ze(this,n=>this.compactMode.read(n)&&this.shouldRenderInlineViewInSmartMode.read(n)?!1:this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=Ze(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=Ze(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=Ze(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=Ze(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=Ze(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=Ze(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=Ze(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=Ze(this,n=>this._options.read(n).maxComputationTime),this.showMoves=Ze(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=Ze(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=Ze(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=Ze(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=Ze(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=Ze(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=Ze(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=Ze(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Ze(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.compactMode=Ze(this,n=>this._options.read(n).compactMode),this.trueInlineDiffRenderingEnabled=Ze(this,n=>this._options.read(n).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=Ze(this,n=>!this.renderSideBySide.read(n)&&this.trueInlineDiffRenderingEnabled.read(n)),this.hideUnchangedRegions=Ze(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Ze(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount),this._model=jt(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,n=>PAt(this,o=>{const r=n?.diff.read(o);return r?AIt(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,n=>!!n),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...CWe(e,Fl)};this._options=jt(this,i)}updateOptions(e){const t=CWe(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)}setModel(e){this._model.set(e,void 0)}};DJ=D([_(1,mr)],DJ);function AIt(s,e){return s.mappings.every(t=>EIt(t.lineRangeMapping)||xIt(t.lineRangeMapping)||e&&pRe(t.lineRangeMapping))}function EIt(s){return s.original.length===0}function xIt(s){return s.modified.length===0}function CWe(s,e){return{enableSplitViewResizing:Et(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:xat(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Et(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Et(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:YI(s.maxComputationTime,e.maxComputationTime,0,Un.MAX_SAFE_SMALL_INTEGER),maxFileSize:YI(s.maxFileSize,e.maxFileSize,0,Un.MAX_SAFE_SMALL_INTEGER),ignoreTrimWhitespace:Et(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Et(s.renderIndicators,e.renderIndicators),originalEditable:Et(s.originalEditable,e.originalEditable),diffCodeLens:Et(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Et(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Kr(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Kr(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Et(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Et(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:Et(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:Et(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:Et(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:YI(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,Un.MAX_SAFE_SMALL_INTEGER),minimumLineCount:YI(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,Un.MAX_SAFE_SMALL_INTEGER),revealLineCount:YI(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,Un.MAX_SAFE_SMALL_INTEGER)},isInEmbeddedEditor:Et(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Et(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:YI(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,Un.MAX_SAFE_SMALL_INTEGER),useInlineViewWhenSpaceIsLimited:Et(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:Et(s.renderGutterMenu,e.renderGutterMenu),compactMode:Et(s.compactMode,e.compactMode)}}var uB;let pp=(uB=class extends gve{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}get collapseUnchangedRegions(){return this._options.hideUnchangedRegions.get()}constructor(e,t,i,n,o,r,a,c){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=c,this.elements=Bt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Bt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Bt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Bt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(h3(this,void 0)),this._diffModel=Ze(this,C=>this._diffModelSrc.read(C)?.object),this.onDidChangeModel=M.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Uc([Le,this._contextKeyService]))),this._boundarySashes=jt(this,void 0),this._accessibleDiffViewerShouldBeVisible=jt(this,!1),this._accessibleDiffViewerVisible=Ze(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=jt(this,void 0),this._layoutInfo=Ze(this,C=>{const A=this._rootSizeObserver.width.read(C),L=this._rootSizeObserver.height.read(C);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=L+"px";const k=this._sash.read(C),P=this._gutter.read(C),R=P?.width.read(C)??0,z=this._overviewRulerPart.read(C)?.width??0;let G,j,K,ie,ge;if(!!k){const Re=k.sashLeft.read(C),yt=this._movedBlocksLinesPart.read(C)?.width.read(C)??0;G=0,j=Re-R-yt,ge=Re-R,K=Re,ie=A-K-z}else{ge=0;const Re=this._options.inlineViewHideOriginalLineNumbers.read(C);G=R,Re?j=0:j=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(C)),K=R+j,ie=A-K-z}return this.elements.original.style.left=G+"px",this.elements.original.style.width=j+"px",this._editors.original.layout({width:j,height:L},!0),P?.layout(ge),this.elements.modified.style.left=K+"px",this.elements.modified.style.width=ie+"px",this._editors.modified.layout({width:ie,height:L},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((C,A)=>C?.diff.read(A)),this.onDidUpdateDiff=M.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.elements.root.remove())),this._rootSizeObserver=this._register(new xYe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(DJ,t),this._register(ai(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(J.isEmbeddedDiffEditor.key,!1),this._register(xv(J.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(xv(J.comparingMovedCode,this._contextKeyService,C=>!!this._diffModel.read(C)?.movedTextToCompare.read(C))),this._register(xv(J.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(xv(J.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(xv(J.hasChanges,this._contextKeyService,C=>(this._diffModel.read(C)?.diff.read(C)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(uve,this.elements.original,this.elements.modified,this._options,i,(C,A,L,k)=>this._createInnerEditor(C,A,L,k))),this._register(xv(J.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(xv(J.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(xv(J.diffEditorOriginalUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.original.uri.toString()??"")),this._register(xv(J.diffEditorModifiedUri,this._contextKeyService,C=>this._diffModel.read(C)?.model.modified.uri.toString()??"")),this._overviewRulerPart=fh(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(Mg(rW,C),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(A=>A.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,A)=>C-(this._overviewRulerPart.read(A)?.width??0))};this._sashLayout=new vIt(this._options,l),this._sash=fh(this,C=>{const A=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",A),A?new RYe(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=fh(this,C=>this._instantiationService.createInstance(Mg(EJ,C),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);fh(this,C=>this._instantiationService.createInstance(Mg(_It,C),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const p=fh(this,C=>this._instantiationService.createInstance(Mg(rve,C),ct(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.get().isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),m=Ze(this,C=>{const A=p.read(C).viewZones.read(C).orig,L=d.read(C).viewZones.read(C).origViewZones;return A.concat(L)}),v=Ze(this,C=>{const A=p.read(C).viewZones.read(C).mod,L=d.read(C).viewZones.read(C).modViewZones;return A.concat(L)});this._register(yJ(this._editors.original,m,C=>{f=C},h));let b;this._register(yJ(this._editors.modified,v,C=>{f=C,f?b=pm.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=fh(this,C=>this._instantiationService.createInstance(Mg(xx,C),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(A,L)=>this._accessibleDiffViewerShouldBeVisible.set(A,L),this._options.onlyShowAccessibleDiffViewer.map(A=>!A),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((A,L)=>A?.diff.read(L)?.mappings.map(k=>k.lineRangeMapping)),new cIt(this._editors))).recomputeInitiallyAndOnChange(this._store);const w=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(DA(this.elements.modified,{visibility:w})),this._register(DA(this.elements.original,{visibility:w})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=fh(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(Mg(cve,C),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(RN(this._layoutInfo)),fh(this,C=>new(Mg(GO,C))(this.elements.root,this._diffModel,this._layoutInfo.map(A=>A.originalEditor),this._layoutInfo.map(A=>A.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,C=>{this._movedBlocksLinesPart.set(C,void 0)}),this._register(M.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!0))),this._register(M.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!1)));const y=this._diffModel.map(this,(C,A)=>{if(C)return C.diff.read(A)===void 0&&!C.isDiffUpToDate.read(A)});this._register(au((C,A)=>{if(y.read(C)===!0){const L=this._editorProgressService.show(!0,1e3);A.add(Ee(()=>L.done()))}})),this._register(au((C,A)=>{A.add(new(Mg(SIt,C))(this._editors,this._diffModel,this._options,this))})),this._register(au((C,A)=>{const L=this._diffModel.read(C);if(L)for(const k of[L.model.original,L.model.modified])A.add(k.onWillDispose(P=>{vt(new Ni("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(ai(C=>{this._options.setModel(this._diffModel.read(C))}))}getViewWidth(){return this._rootSizeObserver.width.get()}getContentHeight(){return this._editors.modified.getContentHeight()}_createInnerEditor(e,t,i,n){return e.createInstance(Pk,t,i,n)}_createDiffEditorContributions(){const e=sp.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){vt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return _U.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(AJ,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?nW.create(e).createNewRef(this):nW.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&bM(t,n=>{const o=e?.object;Kn.batchEventsGlobally(n,()=>{this._editors.original.setModel(o?o.model.original:null),this._editors.modified.setModel(o?o.model.modified:null)});const r=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),n),setTimeout(()=>{r?.dispose()},0)})}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?DIt(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(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.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 n;e==="next"?n=t.find(o=>o.lineRangeMapping.modified.startLineNumber>i)??t[0]:n=bk(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 n;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=aWe(o.getStartPosition(),r),c=aWe(o.getEndPosition(),r);n=F.plusRange(a,c)}}return{destination:i,destinationSelection:n}}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&&ts(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&ts(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===Oi.Explicit){const i=this._diffModel.get()?.diff.get()?.mappings.find(n=>t?n.lineRangeMapping.modified.contains(e.position.lineNumber):n.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(al.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(al.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(al.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},uB.ENTIRE_DIFF_OVERVIEW_WIDTH=rW.ENTIRE_DIFF_OVERVIEW_WIDTH,uB);pp=D([_(3,Le),_(4,we),_(5,Kt),_(6,rv),_(7,YA)],pp);function DIt(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=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:n,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 kIt=0,SWe=!1;function IIt(s){if(!s){if(SWe)return;SWe=!0}Igt(s||si.document.body)}let Gk=class extends Pk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){const p={...t};p.ariaLabel=p.ariaLabel||GY.editorViewAccessibleLabel,p.ariaLabel=p.ariaLabel+";"+GY.accessibilityHelpMessage,super(e,p,{isStandaloneEditor:!0},i,n,o,r,l,d,h,u,f),c instanceof $k?this._standaloneKeybindingService=c:this._standaloneKeybindingService=null,IIt(p.ariaContainerElement),hje((m,v)=>i.createInstance(CM,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 n="DYNAMIC_"+ ++kIt,o=he.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}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"),V.None;const t=e.id,i=e.label,n=he.and(he.equals("editorId",this.getId()),he.deserialize(e.precondition)),o=e.keybindings,r=he.and(n,he.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(_t.registerCommand(h,l)),a){const f={command:{id:h,title:i},when:n,group:a,order:c};d.add(jn.appendMenuItem(_e.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,l,r));const u=new Wqe(h,i,i,void 0,n,(...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 xY)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Gk=D([_(2,we),_(3,Kt),_(4,vi),_(5,Le),_(6,ec),_(7,Ut),_(8,pn),_(9,bi),_(10,mr),_(11,Vs),_(12,it)],Gk);let EM=class extends Gk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){const b={...t};bJ(h,b,!1);const w=l.registerEditorContainer(e);typeof b.theme=="string"&&l.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!b.autoDetectHighContrast);const y=b.model;delete b.model,super(e,b,i,n,o,r,a,c,l,d,u,m,v),this._configurationService=h,this._standaloneThemeService=l,this._register(w);let C;if(typeof y>"u"){const A=p.getLanguageIdByMimeType(b.language)||b.language||Ca;C=PYe(f,p,b.value||"",A,void 0),this._ownsModel=!0}else C=y,this._ownsModel=!1;if(this._attachModel(C),C){const A={oldModelUrl:null,newModelUrl:C.uri};this._onDidChangeModel.fire(A)}}dispose(){super.dispose()}updateOptions(e){bJ(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)}};EM=D([_(2,we),_(3,Kt),_(4,vi),_(5,Le),_(6,ec),_(7,Ut),_(8,ov),_(9,bi),_(10,Te),_(11,mr),_(12,gi),_(13,xi),_(14,Vs),_(15,it)],EM);let kJ=class extends pp{constructor(e,t,i,n,o,r,a,c,l,d,h,u){const f={...t};bJ(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},n,i,o,u,d),this._configurationService=c,this._standaloneThemeService=r,this._register(p)}dispose(){super.dispose()}updateOptions(e){bJ(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(Gk,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)}};kJ=D([_(2,we),_(3,Le),_(4,Kt),_(5,ov),_(6,bi),_(7,Te),_(8,lr),_(9,YA),_(10,ag),_(11,rv)],kJ);function PYe(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(` +`);let r=t;return o!==-1&&(r=t.substring(0,o)),AWe(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return AWe(s,t,e.createById(i),n)}function AWe(s,e,t,i){return s.createModel(e,t,i)}var TIt=".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}}}";ut(TIt,{});class LIt{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let IJ=class extends V{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=jt(this,void 0),this._collapsed=Ze(this,r=>this._viewModel.read(r)?.collapsed.read(r)),this._editorContentHeight=jt(this,500),this.contentHeight=Ze(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=jt(this,0),this._modifiedWidth=jt(this,0),this._originalContentWidth=jt(this,0),this._originalWidth=jt(this,0),this.maxScroll=Ze(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=Bt("div.multiDiffEntry",[Bt("div.header@header",[Bt("div.header-content",[Bt("div.collapse-button@collapseButton"),Bt("div.file-path",[Bt("div.title.modified.show-file-icons@primaryPath",[]),Bt("div.status.deleted@status",["R"]),Bt("div.title.original.show-file-icons@secondaryPath",[])]),Bt("div.actions@actions")])]),Bt("div.editorParent",[Bt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(pp,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Jh(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Jh(this.editor.getOriginalEditor()).isFocused,this.isFocused=Ze(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 jd(this._elements.collapseButton,{});this._register(ai(r=>{o.element.className="",o.icon=this._collapsed.read(r)?ve.chevronRight:ve.chevronDown})),this._register(o.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(ai(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=>{sV(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(ai(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(mm,this._elements.actions,_e.MultiDiffEditorFileToolbar,{actionRunner:this._register(new MYe(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>PN(n,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(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){sV(n=>{this._viewModel.set(void 0,n),this.editor.setDiffModel(null,n),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;sV(n=>{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,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,n=>{n||this.setData(void 0)})}render(e,t,i,n){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(n.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,sV(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"}};IJ=D([_(3,we)],IJ);class RIt{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(n=>this._itemData.get(n).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()}}let fve=class extends V{constructor(e,t,i,n,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=Bt("div.scrollContent",[Bt("div@content",{style:{overflow:"hidden"}}),Bt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new _N({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Tl(ct(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new o6(this._scrollableElements.root,{vertical:Co.Auto,horizontal:Co.Auto,useShadows:!1},this._scrollable)),this._elements=Bt("div.monaco-component.multiDiffEditor",{},[Bt("div",{},[this._scrollableElement.getDomNode()]),Bt("div.placeholder@placeholder",{},[Bt("div",[g(9360,"No Changed Files")])])]),this._sizeObserver=this._register(new xYe(this._element,void 0)),this._objectPool=this._register(new RIt(c=>{const l=this._instantiationService.createInstance(IJ,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return l.setData(c),l})),this.scrollTop=Kn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Kn(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=vI(this,(c,l)=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:p=>{throw new Ni}};const h=d.items.read(c),u=new Map;return{items:h.map(p=>{const m=l.add(new NIt(p,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=this._lastDocStates?.[m.getKey()];return v&&ts(b=>{m.setViewState(v,b)}),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=Ze(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 Uc([Le,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(J.inMultiDiffEditor.key,!0),this._register(au((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(J.multiDiffEditorAllCollapsed.key,!1);this._register(ai(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(ai(c=>{const l=this._dimension.read(c);this._sizeObserver.observe(l)})),this._register(ai(c=>{const l=this._viewItems.read(c);this._elements.placeholder.classList.toggle("visible",l.length===0)})),this._scrollableElements.content.style.position="relative",this._register(ai(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=C1e(f,Cc(m=>m.maxScroll.read(c).maxScroll,iu));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(ai(c=>{sV(l=>{this.render(c)})})))}setScrollState(e){this._scrollableElement.setScrollPosition({scrollLeft:e.left,scrollTop:e.top})}reveal(e,t){const i=this._viewItems.get(),n=i.findIndex(l=>l.viewModel.originalUri?.toString()===e.original?.toString()&&l.viewModel.modifiedUri?.toString()===e.modified?.toString());if(n===-1)throw new Ni("Resource not found in diff editor");const o=i[n];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,ts(t=>{if(e.docStates)for(const i of this._viewItems.get()){const n=e.docStates[i.getKey()];n&&i.setViewState(n,t)}})}findDocumentDiffItem(e){return this._viewItems.get().find(i=>i.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||i.viewModel.diffEditorViewModel.model.original.uri.toString()===e.toString())?.viewModel.documentDiffItem}tryGetCodeEditor(e){const t=this._viewItems.get().find(n=>n.viewModel.diffEditorViewModel.model.modified.uri.toString()===e.toString()||n.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,n=0,o=0;const r=this._sizeObserver.height.read(e),a=mi.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=mi.ofStartAndLength(n,h),f=mi.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=mi.ofStartAndLength(t+i,r);l.render(u,p,c,m)}n+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};fve=D([_(4,Le),_(5,we)],fve);function MIt(s,e){const t=s.getModel(),i=s.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{s.getModel()===t&&i.clear()},350)}class NIt extends V{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(h3(this,void 0)),this.contentHeight=Ze(this,o=>this._templateRef.read(o)?.object.contentHeight?.read(o)??this.viewModel.lastTemplateData.read(o).contentHeight),this.maxScroll=Ze(this,o=>this._templateRef.read(o)?.object.maxScroll.read(o)??{maxScroll:0,scrollWidth:0}),this.template=Ze(this,o=>this._templateRef.read(o)?.object),this._isHidden=jt(this,!1),this._isFocused=Ze(this,o=>this.template.read(o)?.isFocused.read(o)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(ai(o=>{const r=this._scrollLeft.read(o);this._templateRef.read(o)?.object.setScrollLeft(r)})),this._register(ai(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.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}getViewState(){return ts(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(),n=e.selections?.map(dt.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const o=this._templateRef.get();o&&n&&o.object.editor.setSelections(n)}_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&&ts(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new LIt(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,n)}}class FYe extends V{async waitForDiffs(){for(const e of this.items.get())await e.diffEditorViewModel.waitForDiff()}collapseAll(){ts(e=>{for(const t of this.items.get())t.collapsed.set(!0,e)})}expandAll(){ts(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=yje(this.model,this.model.documents),this.items=QY(this,this._documents,(i,n)=>n.add(this._instantiationService.createInstance(pve,i,this))).recomputeInitiallyAndOnChange(this._store),this.focusedDiffItem=Ze(this,i=>this.items.read(i).find(n=>n.isFocused.read(i))),this.activeDiffItem=NAt(this,(i,n)=>this.focusedDiffItem.read(i)??n)}}let pve=class extends V{get diffEditorViewModel(){return this.diffEditorViewModelRef.object}get originalUri(){return this.documentDiffItem.original?.uri}get modifiedUri(){return this.documentDiffItem.modified?.uri}setIsFocused(e,t){this._isFocusedSource.set(e,t)}get documentDiffItem(){return this.documentDiffItemRef.object}constructor(e,t,i,n){super(),this._editorViewModel=t,this._instantiationService=i,this._modelService=n,this.collapsed=jt(this,!1),this.lastTemplateData=jt(this,{contentHeight:500,selections:void 0}),this.isActive=Ze(this,d=>this._editorViewModel.activeDiffItem.read(d)===this),this._isFocusedSource=jt(this,td(!1)),this.isFocused=Ze(this,d=>this._isFocusedSource.read(d).read(d)),this.isAlive=jt(this,!0),this._register(Ee(()=>{this.isAlive.set(!1,void 0)})),this.documentDiffItemRef=this._register(e.createNewRef(this));function o(d){return{...d,hideUnchangedRegions:{enabled:!0}}}const r=this._instantiationService.createInstance(DJ,o(this.documentDiffItem.options||{}));this.documentDiffItem.onOptionsDidChange&&this._register(this.documentDiffItem.onOptionsDidChange(()=>{r.updateOptions(o(this.documentDiffItem.options||{}))}));const a=new Z,c=this.documentDiffItem.original??a.add(this._modelService.createModel("",null)),l=this.documentDiffItem.modified??a.add(this._modelService.createModel("",null));a.add(this.documentDiffItemRef.createNewRef(this)),this.diffEditorViewModelRef=this._register(nW.createWithDisposable(this._instantiationService.createInstance(AJ,{original:c,modified:l},r),a,this))}getKey(){return JSON.stringify([this.originalUri?.toString(),this.modifiedUri?.toString()])}};pve=D([_(2,we),_(3,gi)],pve);W("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},g(9361,"The background color of the diff editor's header"));W("multiDiffEditor.background","editorBackground",g(9362,"The background color of the multi file diff editor"));W("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},g(9363,"The border color of the multi file diff editor"));let mve=class extends V{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=jt(this,void 0),this._viewModel=jt(this,void 0),this._widgetImpl=vI(this,(n,o)=>(Mg(IJ,n),o.add(this._instantiationService.createInstance(Mg(fve,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._activeControl=Ze(this,n=>this._widgetImpl.read(n).activeControl.read(n)),this.onDidChangeActiveControl=M.fromObservableLight(this._activeControl),this._register(RN(this._widgetImpl))}reveal(e,t){this._widgetImpl.get().reveal(e,t)}createViewModel(e){return new FYe(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)}findDocumentDiffItem(e){return this._widgetImpl.get().findDocumentDiffItem(e)}};mve=D([_(2,we)],mve);const _Re=ae("IEditorCancelService"),OYe=new Y("cancellableOperation",!1,g(9366,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ce(_Re,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=OYe.bindTo(n.get(Le)),r=new dl;return{key:o,tokens:r}}),this._tokens.set(s,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(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},qt.Delayed);class PIt extends ci{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(_Re).add(e,this))}dispose(){this._unregister(),super.dispose()}}qe(new class extends hc{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:Ae.EditorContrib,primary:S.Escape},precondition:OYe})}runEditorCommand(s,e){s.get(_Re).cancel(e)}});var jo;(function(s){s[s.Value=1]="Value",s[s.Selection=2]="Selection",s[s.Position=4]="Position",s[s.Scroll=8]="Scroll"})(jo||(jo={}));let xae=class _ve{constructor(e,t){if(this.flags=t,this.flags&jo.Value){const i=e.getModel();this.modelVersionId=i?Up("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&jo.Position?this.position=e.getPosition():this.position=null,this.flags&jo.Selection?this.selection=e.getSelection():this.selection=null,this.flags&jo.Scroll?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof _ve))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 _ve(e,this.flags))}};class Kk extends PIt{constructor(e,t,i,n){super(e,n),this._listener=new Z,t&jo.Position&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!F.containsPosition(i,o.position))&&this.cancel()})),t&jo.Selection&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!F.containsRange(i,o.selection))&&this.cancel()})),t&jo.Scroll&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&jo.Value&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class vRe extends ci{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class aW{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=pm.capture(e),o=aW._handleEolEdits(e,t);o.length===1&&aW._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>Zn.replace(F.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>Zn.replaceMove(F.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}function BYe(s){return s.scheme===pe.vscodeRemote?s.authority:void 0}function S6(s){if(!s)return;const e=s.indexOf("+");return e<0?s:s.substr(0,e)}const FIt="extensions.user.cache",OIt="extensions.builtin.cache",WYe="undefined_publisher",BIt=["ui","workspace","web"];function aK(s){if(typeof s=="object"&&s!==null&&s.supported!==!0)return s.description}const HYe=["AI","Azure","Chat","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","Other"];var br;(function(s){s[s.System=0]="System",s[s.User=1]="User"})(br||(br={}));var Es;(function(s){s.WIN32_X64="win32-x64",s.WIN32_ARM64="win32-arm64",s.LINUX_X64="linux-x64",s.LINUX_ARM64="linux-arm64",s.LINUX_ARMHF="linux-armhf",s.ALPINE_X64="alpine-x64",s.ALPINE_ARM64="alpine-arm64",s.DARWIN_X64="darwin-x64",s.DARWIN_ARM64="darwin-arm64",s.WEB="web",s.UNIVERSAL="universal",s.UNKNOWN="unknown",s.UNDEFINED="undefined"})(Es||(Es={}));class Sn{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,n=typeof t=="string"?t:t.value;return ua(i,n)}return e._lower===t._lower}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class y_{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(Sn.toKey(e))}delete(e){return this._set.delete(Sn.toKey(e))}has(e){return this._set.has(Sn.toKey(e))}}class va{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(Sn.toKey(e))}get(e){return this._map.get(Sn.toKey(e))}has(e){return this._map.has(Sn.toKey(e))}set(e,t){this._map.set(Sn.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}function WIt(s){return bRe(s)}function bRe(s){return s.contributes&&s.contributes.localizations?s.contributes.localizations.length>0:!1}function HIt(s,e){if(e){const t=`onResolveRemoteAuthority:${S6(e)}`;return!!s.activationEvents?.includes(t)}return!1}function UIt(s){return s.map(e=>{const[t,i]=e.split("@");return{proposalName:t,version:i?parseInt(i):void 0}})}function VIt(s){return s.map(e=>e.split("@")[0])}function Dae(s,e,t){const i=[],n=new y_,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.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 cW;(function(s){s[s.File=1]="File",s[s.Selection=2]="Selection"})(cW||(cW={}));var im;(function(s){s[s.Explicit=1]="Explicit",s[s.Silent=2]="Silent"})(im||(im={}));const Uz=class Uz{static setFormatterSelector(e){return{dispose:Uz._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=hi.first(Uz._selectors);if(o)return await o(e,t,i,n)}};Uz._selectors=new dl;let lW=Uz;async function kae(s,e,t,i,n,o,r){const a=s.get(we),{documentRangeFormattingEditProvider:c}=s.get(it),l=Qr(e)?e.getModel():e,d=c.ordered(l),h=await lW.select(d,l,i,cW.Selection);h&&(n.report(h),await a.invokeFunction(UYe,h,e,t,o,r))}async function UYe(s,e,t,i,n,o){const r=s.get(Rl),a=s.get(Ge),c=s.get(rv);let l,d;Qr(t)?(l=t.getModel(),d=new Kk(t,jo.Value|jo.Position,void 0,n)):(l=t,d=new vRe(t,n));const h=[];let u=0;for(const b of O_(i).sort(F.compareRangesUsingStarts))u>0&&F.areIntersectingOrTouching(h[u-1],b)?h[u-1]=F.fromPositions(h[u-1].getStartPosition(),b.getEndPosition()):u=h.push(b);const f=async b=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,b);const w=await e.provideDocumentRangeFormattingEdits(l,b,l.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,w),w},p=(b,w)=>{if(!b.length||!w.length)return!1;const y=b.reduce((C,A)=>F.plusRange(C,A.range),b[0].range);if(!w.some(C=>F.intersectRanges(y,C.range)))return!1;for(const C of b)for(const A of w)if(F.intersectRanges(C.range,A.range))return!0;return!1},m=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",e.extensionId?.value,h);const b=await e.provideDocumentRangesFormattingEdits(l,h,l.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",e.extensionId?.value,b),v.push(b)}else{for(const b of h){if(d.token.isCancellationRequested)return!0;v.push(await f(b))}for(let b=0;b({text:y.text,range:F.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:C}of y)if(F.areIntersectingOrTouching(C,w))return[new dt(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return c.playSignal(al.format,{userGesture:o}),!0}async function vve(s,e,t,i,n,o){const r=s.get(we),a=s.get(it),c=Qr(e)?e.getModel():e,l=Dae(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,c),d=await lW.select(l,c,t,cW.File);d&&(i.report(d),await r.invokeFunction(VYe,d,e,t,n,o))}async function VYe(s,e,t,i,n,o){const r=s.get(Rl),a=s.get(rv);let c,l;Qr(t)?(c=t.getModel(),l=new Kk(t,jo.Value|jo.Position,void 0,n)):(c=t,l=new vRe(t,n));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(Qr(t))aW.execute(t,d,i!==im.Silent),i!==im.Silent&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),mt.Immediate);else{const[{range:h}]=d,u=new dt(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);c.pushEditOperations([u],d.map(f=>({text:f.text,range:F.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:p}of f)if(F.areIntersectingOrTouching(p,u))return[new dt(p.startLineNumber,p.startColumn,p.endLineNumber,p.endColumn)];return null})}return a.playSignal(al.format,{userGesture:o}),!0}async function zIt(s,e,t,i,n,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const c=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(No);if(eo(c))return await s.computeMoreMinimalEdits(t.uri,c)}}async function $It(s,e,t,i,n){const o=Dae(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(No);if(eo(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function zYe(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(No).then(c=>s.computeMoreMinimalEdits(t.uri,c))}_t.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;Tt(N.isUri(t)),Tt(F.isIRange(i));const o=s.get(fn),r=s.get(Rl),a=s.get(it),c=await o.createModelReference(t);try{return zIt(r,a,c.object.textEditorModel,F.lift(i),n,He.None)}finally{c.dispose()}});_t.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;Tt(N.isUri(t));const n=s.get(fn),o=s.get(Rl),r=s.get(it),a=await n.createModelReference(t);try{return $It(o,r,a.object.textEditorModel,i,He.None)}finally{a.dispose()}});_t.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string");const r=s.get(fn),a=s.get(Rl),c=s.get(it),l=await r.createModelReference(t);try{return zYe(a,c,l.object.textEditorModel,oe.lift(i),n,o,He.None)}finally{l.dispose()}});var yl;(function(s){s[s.provider=0]="provider",s[s.userDefined=1]="userDefined",s[s.recovered=2]="recovered"})(yl||(yl={}));const GIt={[yl.provider]:" ",[yl.userDefined]:"u",[yl.recovered]:"r"},EWe=65535,Wv=16777215,xWe=4278190080;class Lhe{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<EWe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Lhe(e.length),this._userDefinedStates=new Lhe(e.length),this._recoveredStates=new Lhe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,n)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=n};for(let i=0,n=this._startIndexes.length;iWv||r>Wv)throw new Error("startLineNumber or endLineNumber must not exceed "+Wv);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]&Wv}getEndLineNumber(e){return this._endIndexes[e]&Wv}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)?yl.userDefined:this.isRecovered(e)?yl.recovered:yl.provider}setSource(e,t){t===yl.userDefined?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===yl.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 n=0;n>>24)+((this._endIndexes[e]&xWe)>>>16);return t===EWe?-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)?b=>bb=d.startLineNumber))l&&l.startLineNumber===d.startLineNumber?(d.source===yl.userDefined?m=d:(m=l,m.isCollapsed=d.isCollapsed&&l.endLineNumber===d.endLineNumber,m.source=yl.provider),l=o(++a)):(m=d,d.isCollapsed&&d.source===yl.provider&&(m.source=yl.recovered)),d=r(++c);else{let v=c,b=d;for(;;){if(!b||b.startLineNumber>l.endLineNumber){m=l;break}if(b.source===yl.userDefined&&b.endLineNumber>l.endLineNumber)break;b=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 KIt{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-n.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,r=-1;const a=c=>{for(;nr&&(r=l),n++}};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=n=>{for(const o of e)if(!(o.startLineNumber>n.endLineNumber||n.startLineNumber>o.endLineNumber))return!0;return!1};for(let n=0;ni&&(i=a)}this._decorationProvider.changeDecorations(n=>this._editorDecorationIds=n.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(n,o)=>{for(const r of e)if(n=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??yl.provider})}const n=Uf.sanitizeAndMerge(this._regions,t,i);this.updatePost(Uf.fromFoldRanges(n))}_getLinesChecksum(e,t){return Wc(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){const r=this._regions.toRegion(n);(!t||t(r,o))&&i.push(r),o++,n=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=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=n,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=n,a=this._regions.length;r1){const a=s.getRegionsInside(o,(c,l)=>c.isCollapsed!==r&&l0)for(const o of i){const r=s.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&n.push(r),t>1)){const a=s.getRegionsInside(r,(c,l)=>c.isCollapsed!==e&&lr.isCollapsed!==e&&aa.isCollapsed!==e&&c<=t);n.push(...r)}s.toggleCollapseState(n)}function QIt(s,e,t){const i=[];for(const n of t){const o=s.getAllRegionsAtLine(n,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}s.toggleCollapseState(i)}function jIt(s,e,t,i){const n=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(c=>r.containsLine(c)),o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function GYe(s,e,t){const i=[];for(const r of t){const a=s.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const n=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=s.getRegionsInside(null,n);s.toggleCollapseState(o)}function yRe(s,e,t){const i=s.textModel,n=s.regions,o=[];for(let r=n.length-1;r>=0;r--)if(t!==n.isCollapsed(r)){const a=n.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(n.toRegion(r))}s.toggleCollapseState(o)}function CRe(s,e,t){const i=s.regions,n=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&n.push(i.toRegion(o));s.toggleCollapseState(n)}function YIt(s,e){let t=null;const i=e.getRegionAtLine(s);if(i!==null&&(t=i.startLineNumber,s===t)){const n=i.parentIndex;n!==-1?t=e.regions.getStartLineNumber(n):t=null}return t}function JIt(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){if(s!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let n=0;for(i!==-1&&(n=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=n)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 XIt(s,e){let t=e.getRegionAtLine(s);if(t!==null&&t.startLineNumber===s){const i=t.parentIndex;let n=0;if(i!==-1)n=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;n=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=n)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>s)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||yb(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return DWe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=r=>((!n||!t0t(r,n))&&(n=DWe(this._hiddenRanges,r)),n?n.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 t0t(s,e){return s>=e.startLineNumber&&s<=e.endLineNumber}function DWe(s,e){const t=m2(s,i=>e=0&&s[t].endLineNumber>=e?s[t]:null}const i0t=5e3,n0t="indent";class SRe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=n0t}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(r0t(this.editorModel,i,n,this.foldingRangesLimit))}}let s0t=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Wv||t>Wv)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=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),n=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],n[r]=this._endIndexes[o];return new Uf(i,n)}else{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let c=0;ct){n=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=eae(h,o);(u{}};function r0t(s,e,t,i=o0t){const n=s.getOptions().tabSize,o=new s0t(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],c=s.getLineCount()+1;a.push({indent:-1,endAbove:c,line:c});for(let l=s.getLineCount();l>0;l--){const d=s.getLineContent(l),h=eae(d,n);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(s)}const a0t=W("editor.foldBackground",{light:st(SS,.3),dark:st(SS,.3),hcDark:null,hcLight:null},g(1685,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);W("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},g(1686,"Color of the collapsed text after the first line of a folded range."));W("editorGutter.foldingControlForeground",tY,g(1687,"Color of the folding control in the editor gutter."));const TJ=oi("folding-expanded",ve.chevronDown,g(1688,"Icon for expanded ranges in the editor glyph margin.")),LJ=oi("folding-collapsed",ve.chevronRight,g(1689,"Icon for collapsed ranges in the editor glyph margin.")),kWe=oi("folding-manual-collapsed",LJ,g(1690,"Icon for manually collapsed ranges in the editor glyph margin.")),IWe=oi("folding-manual-expanded",TJ,g(1691,"Icon for manually expanded ranges in the editor glyph margin.")),Rhe={color:$o(a0t),position:kh.Inline},hP=g(1692,"Click to expand the range."),cK=g(1693,"Click to collapse the range."),$a=class $a{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?$a.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?$a.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:$a.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:$a.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?$a.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$a.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?$a.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:$a.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?$a.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:$a.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?$a.MANUALLY_EXPANDED_VISUAL_DECORATION:$a.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};$a.COLLAPSED_VISUAL_DECORATION=Gt.register({description:"folding-collapsed-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:hP,firstLineDecorationClassName:We.asClassName(LJ)}),$a.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Gt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Rhe,isWholeLine:!0,linesDecorationsTooltip:hP,firstLineDecorationClassName:We.asClassName(LJ)}),$a.MANUALLY_COLLAPSED_VISUAL_DECORATION=Gt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:hP,firstLineDecorationClassName:We.asClassName(kWe)}),$a.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Gt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Rhe,isWholeLine:!0,linesDecorationsTooltip:hP,firstLineDecorationClassName:We.asClassName(kWe)}),$a.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:hP}),$a.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,afterContentClassName:"inline-folded",className:"folded-background",minimap:Rhe,isWholeLine:!0,linesDecorationsTooltip:hP}),$a.EXPANDED_VISUAL_DECORATION=Gt.register({description:"folding-expanded-visual-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+We.asClassName(TJ),linesDecorationsTooltip:cK}),$a.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Gt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:We.asClassName(TJ),linesDecorationsTooltip:cK}),$a.MANUALLY_EXPANDED_VISUAL_DECORATION=Gt.register({description:"folding-manually-expanded-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+We.asClassName(IWe),linesDecorationsTooltip:cK}),$a.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Gt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0,firstLineDecorationClassName:We.asClassName(IWe),linesDecorationsTooltip:cK}),$a.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Gt.register({description:"folding-no-controls-range-decoration",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,isWholeLine:!0}),$a.HIDDEN_RANGE_DECORATION=Gt.register({description:"folding-hidden-range-decoration",stickiness:ni.NeverGrowsWhenTypingAtEdges});let bve=$a;const c0t={},l0t="syntax";class ARe{constructor(e,t,i,n,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=o,this.id=l0t,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 d0t(this.providers,this.editorModel,e).then(t=>t?u0t(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function d0t(s,e,t){let i=null;const n=s.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,c0t,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})}},No));return Promise.all(n).then(o=>i)}class h0t{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>Wv||t>Wv)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||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 n=0;ne){i=a;break}t+=c}}const n=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 h0t(e);let n;const o=[];for(const r of t)if(!n)n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>n.start)if(r.end<=n.end)o.push(n),n=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>n.end){do n=o.pop();while(n&&r.start>n.end);n&&o.push(n),n=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var o0;const fd=new Y("foldingEnabled",!1);var fL;let kA=(fL=class extends V{static get(e){return e.getContribution(o0.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return o0._foldingRangeSelector?.(i,t)??i}static setFoldingRangeProviderSelector(e){return o0._foldingRangeSelector=e,{dispose:()=>{o0._foldingRangeSelector=void 0}}}constructor(e,t,i,n,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new Z),this.editor=e,this._foldingLimitReporter=new KYe(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 bve(e),this.foldingDecorationProvider.showFoldingControls=a.get(x.showFoldingControls),this.foldingDecorationProvider.showFoldingHighlights=a.get(x.foldingHighlight),this.foldingEnabled=fd.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 qIt(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new e0t(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Lh(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new cn(()=>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 SRe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=o0.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new ARe(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 js,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Rr(o=>i.compute(o));return n.then(o=>{if(o&&n===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(r_.Imports.value,!0);d&&(r=pm.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=>(vt(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 n=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&n.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}n.length&&(t.toggleCollapseState(n),this.reveal(i[0].getPosition()))}}}).then(void 0,vt)}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 Rt.GUTTER_LINE_DECORATIONS:{const n=e.target.detail,o=e.target.element.offsetLeft;if(n.offsetX-o<4)return;i=!0;break}case Rt.CONTENT_EMPTY:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case Rt.CONTENT_TEXT:{if(this.hiddenRangeModel.hasRanges()){const n=this.editor.getModel();if(n&&t.startColumn===n.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,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(e.target.type!==Rt.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(n||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,mt.Smooth)}},o0=fL,fL.ID="editor.contrib.folding",fL);kA=o0=D([_(1,Le),_(2,Vs),_(3,bi),_(4,wp),_(5,it)],kA);class KYe{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 Jd extends tt{runEditorCommand(e,t,i){const n=e.get(Vs),o=kA.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,n);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 qYe(s){if(!Ya(s)){if(!kn(s))return!1;const e=s;if(!Ya(e.levels)&&!lc(e.levels)||!Ya(e.direction)&&!Lt(e.direction)||!Ya(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(lc)))return!1}return!0}class g0t extends Jd{constructor(){super({id:"editor.unfold",label:g(453,"Unfold"),alias:"Unfold",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.BracketRight,mac:{primary:U.CtrlCmd|U.Alt|S.BracketRight},weight:Ae.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. - `,constraint:tJe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?XYe(t,!1,o,r):PU(t,!1,o,r)}}class E0t extends Zd{constructor(){super({id:"editor.unfoldRecursively",label:g(454,"Unfold Recursively"),alias:"Unfold Recursively",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.BracketRight),weight:Ae.EditorContrib}})}invoke(e,t,i,n){PU(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class x0t extends Zd{constructor(){super({id:"editor.fold",label:g(455,"Fold"),alias:"Fold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.BracketLeft,mac:{primary:U.CtrlCmd|U.Alt|S.BracketLeft},weight:Ae.EditorContrib},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + `,constraint:qYe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?$Ye(t,!1,o,r):TU(t,!1,o,r)}}class f0t extends Jd{constructor(){super({id:"editor.unfoldRecursively",label:g(454,"Unfold Recursively"),alias:"Unfold Recursively",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.BracketRight),weight:Ae.EditorContrib}})}invoke(e,t,i,n){TU(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class p0t extends Jd{constructor(){super({id:"editor.fold",label:g(455,"Fold"),alias:"Fold",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.BracketLeft,mac:{primary:U.CtrlCmd|U.Alt|S.BracketLeft},weight:Ae.EditorContrib},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * '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:tJe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?o0t(t,!0,o):a==="up"?XYe(t,!0,r||1,o):PU(t,!0,r||1,o)}}class D0t extends Zd{constructor(){super({id:"editor.toggleFold",label:g(456,"Toggle Fold"),alias:"Toggle Fold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyL),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);RRe(t,1,n)}}class k0t extends Zd{constructor(){super({id:"editor.foldRecursively",label:g(457,"Fold Recursively"),alias:"Fold Recursively",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.BracketLeft),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);PU(t,!0,Number.MAX_VALUE,n)}}class I0t extends Zd{constructor(){super({id:"editor.toggleFoldRecursively",label:g(458,"Toggle Fold Recursively"),alias:"Toggle Fold Recursively",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyL),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);RRe(t,Number.MAX_VALUE,n)}}class T0t extends Zd{constructor(){super({id:"editor.foldAllBlockComments",label:g(459,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Slash),weight:Ae.EditorContrib}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())NRe(t,l_.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*"+Rh(a.blockCommentStartToken));MRe(t,c,!0)}}}}class L0t extends Zd{constructor(){super({id:"editor.foldAllMarkerRegions",label:g(460,"Fold All Regions"),alias:"Fold All Regions",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit8),weight:Ae.EditorContrib}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())NRe(t,l_.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);MRe(t,c,!0)}}}}class R0t extends Zd{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:g(461,"Unfold All Regions"),alias:"Unfold All Regions",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit9),weight:Ae.EditorContrib}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())NRe(t,l_.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);MRe(t,c,!1)}}}}class M0t extends Zd{constructor(){super({id:"editor.foldAllExcept",label:g(462,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Minus),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);ZYe(t,!0,n)}}class N0t extends Zd{constructor(){super({id:"editor.unfoldAllExcept",label:g(463,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Equal),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);ZYe(t,!1,n)}}class P0t extends Zd{constructor(){super({id:"editor.foldAll",label:g(464,"Fold All"),alias:"Fold All",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0),weight:Ae.EditorContrib}})}invoke(e,t,i){PU(t,!0)}}class F0t extends Zd{constructor(){super({id:"editor.unfoldAll",label:g(465,"Unfold All"),alias:"Unfold All",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyJ),weight:Ae.EditorContrib}})}invoke(e,t,i){PU(t,!1)}}const XF=class XF extends Zd{getFoldingLevel(){return parseInt(this.id.substr(XF.ID_PREFIX.length))}invoke(e,t,i){r0t(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};XF.ID_PREFIX="editor.foldLevel",XF.ID=e=>XF.ID_PREFIX+e;let NJ=XF;class O0t extends Zd{constructor(){super({id:"editor.gotoParentFold",label:g(466,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=a0t(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class B0t extends Zd{constructor(){super({id:"editor.gotoPreviousFold",label:g(467,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=c0t(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class W0t extends Zd{constructor(){super({id:"editor.gotoNextFold",label:g(468,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=l0t(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class H0t extends Zd{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(469,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Comma),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=[],o=i.getSelections();if(o){for(const r of o){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(n.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:Cl.userDefined}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((a,c)=>a.startLineNumber-c.startLineNumber);const r=$f.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost($f.fromFoldRanges(r))}}}}class U0t extends Zd{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(470,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Period),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=i.getSelections();if(n){const o=[];for(const r of n){const{startLineNumber:a,endLineNumber:c}=r;o.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}on(TA.ID,TA,ri.Eager);Re(A0t);Re(E0t);Re(x0t);Re(k0t);Re(I0t);Re(P0t);Re(F0t);Re(T0t);Re(L0t);Re(R0t);Re(M0t);Re(N0t);Re(D0t);Re(O0t);Re(B0t);Re(W0t);Re(H0t);Re(U0t);for(let s=1;s<=7;s++)lht(new NJ({id:NJ.ID(s),label:g(471,"Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:md,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0+s),weight:Ae.EditorContrib}}));_t.registerCommand("_executeFoldingRangeProvider",async function(s,...e){const[t]=e;if(!(t instanceof N))throw Pi();const i=s.get(it),n=s.get(gi).getModel(t);if(!n)throw Pi();const o=s.get(Te);if(!o.getValue("editor.folding",{resource:t}))return[];const r=s.get(Vs),a=o.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new PRe(n,r,c);let d=l;if(a!=="indentation"){const f=TA.getFoldingRangeProviders(i,n);f.length&&(d=new FRe(n,f,()=>{},c,l))}const h=await d.compute(He.None),u=[];try{if(h)for(let f=0;f{const o={...t,limits:{size:Number.MAX_VALUE}};s.openEditor(e,o)}}),rl({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(452,"Configure Limit"),run:()=>n.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:Xe.Warning})}function R5(s){return wa(s?.editor)}function Hhe(s){const e=s;return R5(s)&&e?.group!==void 0}function xve(s){const e=s;return typeof e?.groupId=="number"&&wa(e.editor)}function zWe(s){return typeof s?.groupId=="number"}var cA;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.REPLACE=1]="REPLACE",s[s.MOVE=2]="MOVE",s[s.UNPIN=3]="UNPIN"})(cA||(cA={}));var Do;(function(s){s[s.GROUP_ACTIVE=0]="GROUP_ACTIVE",s[s.GROUP_INDEX=1]="GROUP_INDEX",s[s.GROUP_LABEL=2]="GROUP_LABEL",s[s.GROUP_LOCKED=3]="GROUP_LOCKED",s[s.EDITORS_SELECTION=4]="EDITORS_SELECTION",s[s.EDITOR_OPEN=5]="EDITOR_OPEN",s[s.EDITOR_CLOSE=6]="EDITOR_CLOSE",s[s.EDITOR_MOVE=7]="EDITOR_MOVE",s[s.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",s[s.EDITOR_LABEL=9]="EDITOR_LABEL",s[s.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",s[s.EDITOR_PIN=11]="EDITOR_PIN",s[s.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",s[s.EDITOR_STICKY=13]="EDITOR_STICKY",s[s.EDITOR_DIRTY=14]="EDITOR_DIRTY",s[s.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(Do||(Do={}));var Hs;(function(s){s[s.PRIMARY=1]="PRIMARY",s[s.SECONDARY=2]="SECONDARY",s[s.BOTH=3]="BOTH",s[s.ANY=4]="ANY"})(Hs||(Hs={}));class j0t{getOriginalUri(e,t){if(!e)return;if(wb(e))return Na.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:o}=this.getSideEditors(e);if(n&&o){if(t?.supportSideBySide===Hs.BOTH)return{primary:this.getOriginalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Hs.ANY)return this.getOriginalUri(n,{filterByScheme:t.filterByScheme})??this.getOriginalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Hs.PRIMARY?n:o}}if(E_(e)||L5(e)||kS(e)||wb(e))return;const i=K0t(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return q0t(e)||kS(e)?{primary:e.primary,secondary:e.secondary}:sJe(e)||E_(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(wb(e))return Na.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:o}=this.getSideEditors(e);if(n&&o){if(t?.supportSideBySide===Hs.BOTH)return{primary:this.getCanonicalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Hs.ANY)return this.getCanonicalUri(n,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Hs.PRIMARY?n:o}}if(E_(e)||L5(e)||kS(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 $We;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.KEYBOARD=1]="KEYBOARD",s[s.MOUSE=2]="MOUSE"})($We||($We={}));const Na=new j0t;var GWe;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(GWe||(GWe={}));class Y0t{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(we);for(const[i,n]of this.editorSerializerConstructors)this.createEditorSerializer(i,n,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const n=i.createInstance(t);this.editorSerializerInstances.set(e,n)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return qn(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)}}Qe.add(tC.EditorFactory,new Y0t);async function Uhe(s,e,t){return!s||!s.length?[]:await Promise.all(s.map(async i=>{const n=N.revive(i.fileUri);if(!n){t.info("Cannot resolve the path because it is not valid.",i);return}if(!await e.canHandleResource(n)){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(n)).isDirectory?sn.Directory:sn.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===sn.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return r?{resource:n,options:c}:{resource:n,options:c,forceUntitled:!0}}))}var Zh;(function(s){s[s.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",s[s.SEQUENTIAL=1]="SEQUENTIAL"})(Zh||(Zh={}));function ORe(s){const e=s;if(!e)return!1;const t=e;if(t.modified)return ORe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function oJe(s,e,t){const i=wyt(s,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var wv;const J0t=new Q("workbenchState",void 0,{type:"string",description:g(480,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")}),X0t=new Q("workspaceFolderCount",0,g(481,"The number of root folders in the workspace")),Z0t=new Q("openFolderWorkspaceSupport",!0,!0),e1t=new Q("enterMultiRootWorkspaceSupport",!0,!0),rJe=new Q("emptyWorkspaceSupport",!0,!0),t1t=new Q("dirtyWorkingCopies",!1,g(482,"Whether there are any working copies with unsaved changes")),i1t=new Q("remoteName","",g(483,"The name of the remote the window is connected to or an empty string if not connected to any remote")),n1t=new Q("virtualWorkspace","",g(484,"The scheme of the current workspace is from a virtual file system or an empty string.")),aJe=new Q("temporaryWorkspace",!1,g(485,"The scheme of the current workspace is from a temporary file system.")),s1t=new Q("isFullscreen",!1,g(486,"Whether the main window is in fullscreen mode")),o1t=new Q("isAuxiliaryWindowFocusedContext",!1,g(487,"Whether an auxiliary window is focused")),r1t=new Q("hasWebFileSystemAccess",!1,!0),a1t=new Q("embedderIdentifier",void 0,g(488,"The identifier of the embedder according to the product service, if one is defined"));new Q("activeEditorIsDirty",!1,g(489,"Whether the active editor has unsaved changes"));new Q("activeEditorIsNotPreview",!1,g(490,"Whether the active editor is not in preview mode"));new Q("activeEditorIsFirstInGroup",!1,g(491,"Whether the active editor is the first one in its group"));new Q("activeEditorIsLastInGroup",!1,g(492,"Whether the active editor is the last one in its group"));new Q("activeEditorIsPinned",!1,g(493,"Whether the active editor is pinned"));new Q("activeEditorIsReadonly",!1,g(494,"Whether the active editor is read-only"));new Q("activeCompareEditorCanSwap",!1,g(495,"Whether the active compare editor can swap sides"));const c1t=new Q("activeEditorCanToggleReadonly",!0,g(496,"Whether the active editor can toggle between being read-only or writeable"));new Q("activeEditorCanRevert",!1,g(497,"Whether the active editor can revert"));new Q("activeEditorCanSplitInGroup",!0);const cJe=new Q("activeEditor",null,{type:"string",description:g(498,"The identifier of the active editor")});new Q("activeEditorAvailableEditorIds","",g(499,"The available editor identifiers that are usable for the active editor"));new Q("textCompareEditorVisible",!1,g(500,"Whether a text compare editor is visible"));const Mae=new Q("textCompareEditorActive",!1,g(501,"Whether a text compare editor is active"));new Q("sideBySideEditorActive",!1,g(502,"Whether a side by side editor is active"));new Q("groupEditorsCount",0,g(503,"The number of opened editor groups"));const l1t=new Q("activeEditorGroupEmpty",!1,g(504,"Whether the active editor group is empty")),d1t=new Q("activeEditorGroupIndex",0,g(505,"The index of the active editor group")),h1t=new Q("activeEditorGroupLast",!1,g(506,"Whether the active editor group is the last group")),u1t=new Q("activeEditorGroupLocked",!1,g(507,"Whether the active editor group is locked")),g1t=new Q("multipleEditorGroups",!1,g(508,"Whether there are multiple editor groups opened"));new Q("multipleEditorsSelectedInGroup",!1,g(509,"Whether multiple editors have been selected in an editor group"));new Q("twoEditorsSelectedInGroup",!1,g(510,"Whether exactly two editors have been selected in an editor group"));new Q("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,g(511,"Whether all selected editors in a group have a file or untitled resource associated"));new Q("editorPartMultipleEditorGroups",!1,g(512,"Whether there are multiple editor groups opened in an editor part"));new Q("editorPartMaximizedEditorGroup",!1,g(513,"Editor Part has a maximized group"));new Q("isAuxiliaryEditorPart",!1,g(514,"Editor Part is in an auxiliary window"));const f1t=new Q("editorIsOpen",!1,g(515,"Whether an editor is open")),p1t=new Q("inZenMode",!1,g(516,"Whether Zen mode is enabled")),m1t=new Q("isCenteredLayout",!1,g(517,"Whether centered layout is enabled for the main editor")),_1t=new Q("splitEditorsVertically",!1,g(518,"Whether editors split vertically")),v1t=new Q("mainEditorAreaVisible",!0,g(519,"Whether the editor area in the main window is visible")),b1t=new Q("editorTabsVisible",!0,g(520,"Whether editor tabs are visible")),w1t=new Q("sideBarVisible",!1,g(521,"Whether the sidebar is visible"));new Q("sideBarFocus",!1,g(522,"Whether the sidebar has keyboard focus"));new Q("activeViewlet","",g(523,"The identifier of the active viewlet"));new Q("statusBarFocused",!1,g(524,"Whether the status bar has keyboard focus"));const y1t=new Q("titleBarStyle",pr?"native":"custom",g(525,"Style of the window title bar")),C1t=new Q("titleBarVisible",!1,g(526,"Whether the title bar is visible"));new Q("bannerFocused",!1,g(527,"Whether the banner has keyboard focus"));new Q("notificationFocus",!0,g(528,"Whether a notification has keyboard focus"));new Q("notificationCenterVisible",!1,g(529,"Whether the notifications center is visible"));new Q("notificationToastsVisible",!1,g(530,"Whether a notification toast is visible"));new Q("activeAuxiliary","",g(531,"The identifier of the active auxiliary panel"));new Q("auxiliaryBarFocus",!1,g(532,"Whether the auxiliary bar has keyboard focus"));const S1t=new Q("auxiliaryBarVisible",!1,g(533,"Whether the auxiliary bar is visible"));new Q("activePanel","",g(534,"The identifier of the active panel"));new Q("panelFocus",!1,g(535,"Whether the panel has keyboard focus"));const A1t=new Q("panelPosition","bottom",g(536,"The position of the panel, always 'bottom'")),E1t=new Q("panelAlignment","center",g(537,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'")),x1t=new Q("panelVisible",!1,g(538,"Whether the panel is visible")),D1t=new Q("panelMaximized",!1,g(539,"Whether the panel is maximized")),FU=new Q("focusedView","",g(540,"The identifier of the view that has keyboard focus"));var Ng;let M3=(Ng=class{constructor(e,t,i,n){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=n,this._disposables=new Z,this._schemeKey=wv.Scheme.bindTo(this._contextKeyService),this._filenameKey=wv.Filename.bindTo(this._contextKeyService),this._dirnameKey=wv.Dirname.bindTo(this._contextKeyService),this._pathKey=wv.Path.bindTo(this._contextKeyService),this._langIdKey=wv.LangId.bindTo(this._contextKeyService),this._resourceKey=wv.Resource.bindTo(this._contextKeyService),this._extensionKey=wv.Extension.bindTo(this._contextKeyService),this._hasResource=wv.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=wv.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const o=this.get();this._isFileSystemResource.set(!!(o&&t.hasProvider(o)))})),this._disposables.add(n.onModelAdded(o=>{ji(o.uri,this.get())&&this._setLangId()})),this._disposables.add(n.onModelLanguageChanged(o=>{ji(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,!ji(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?_i(e):null),this._dirnameKey.set(e?this.uriToPath(Lr(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?vU(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===pe.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}},wv=Ng,Ng.Scheme=new Q("resourceScheme",void 0,{type:"string",description:g(541,"The scheme of the resource")}),Ng.Filename=new Q("resourceFilename",void 0,{type:"string",description:g(542,"The file name of the resource")}),Ng.Dirname=new Q("resourceDirname",void 0,{type:"string",description:g(543,"The folder name the resource is contained in")}),Ng.Path=new Q("resourcePath",void 0,{type:"string",description:g(544,"The full path of the resource")}),Ng.LangId=new Q("resourceLangId",void 0,{type:"string",description:g(545,"The language identifier of the resource")}),Ng.Resource=new Q("resource",void 0,{type:"URI",description:g(546,"The full value of the resource including scheme and path")}),Ng.Extension=new Q("resourceExtname",void 0,{type:"string",description:g(547,"The extension name of the resource")}),Ng.HasResource=new Q("resourceSet",void 0,{type:"boolean",description:g(548,"Whether a resource is present or not")}),Ng.IsFileSystemResource=new Q("isFileSystemResource",void 0,{type:"boolean",description:g(549,"Whether the resource is backed by a file system provider")}),Ng);M3=wv=D([_(0,Le),_(1,Jt),_(2,xi),_(3,gi)],M3);function k1t(s,e){return s.invokeFunction(t=>b_.getServiceDependencies(e).sort((i,n)=>i.index-n.index).map(i=>t.get(i.id)))}function BRe(s){const e=s;return class extends e{constructor(...t){super(...t.slice(1),...k1t(t[0],s))}}}class WRe{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 KWe{constructor(e){this.identifier=e}}const Nae=ae("treeViewsDndService");ce(Nae,WRe,qt.Delayed);const lJe=ae("extensionHostDebugService"),I1t="diagnosticsService";class T1t{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 L1t=ae(I1t),HRe=ae("downloadService"),R1t=ae("encryptionService"),EI=ae("extensionGalleryService"),k6=ae("extensionManagementService"),dJe=ae("IGlobalExtensionEnablementService"),M1t=ae("IExtensionTipsService"),N3=ae("IExtensionStorageService"),Pae=ae("IExtensionsProfileScannerService"),N1t=ae("IExtensionsScannerService"),P1t=ae("IExtensionRecommendationNotificationService"),Fae=ae("extensionResourceLoaderService"),F1t=ae("IBuiltinExtensionsScannerService"),Oae=ae("keyboardLayoutService"),hJe=ae("languagePackService");class uJe{constructor(){this.onDidChange=M.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const Er=ae("productService"),pC=ae("remoteAuthorityResolverService"),Bae=ae("IRemoteExtensionsScannerService"),URe=ae("remoteSocketFactoryService"),I6=ae("requestService"),gJe=ae("secretStorageService"),O1t="signService",fJe=ae(O1t);let Wae=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class B1t{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const W1t="extensionTelemetryLog";function Yq(s,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!s.enableTelemetry)}function VRe(s,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||s.enableTelemetry&&s.aiConfig?.ariaKey)}function H1t(s){const e=s.getValue(uje),t=s.getValue(iAt);if(s.getValue(gje)===!1||t===!1)return Kg.NONE;switch(e??Q0.ON){case Q0.ON:return Kg.USAGE;case Q0.ERROR:return Kg.ERROR;case Q0.CRASH:return Kg.CRASH;case Q0.OFF:return Kg.NONE}}const U1t=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function V1t(s){if(!s)return"none";const e=D6(s);return U1t.has(e)?e:"other"}function z1t(s,e){if(!s||!s.includes("/")&&!s.includes("\\"))return s;let t=s;const i=[];for(const a of e)for(;;){const c=a.exec(s);if(!c)break;i.push([c.index,a.lastIndex])}const n=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let r=0;for(t="";;){const a=o.exec(s);if(!a)break;const c=i.some(([l,d])=>a.index",r=o.lastIndex)}return r`;return s}function qWe(s,e){return S2(s,t=>{if(t instanceof Wae||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=z1t(i,e);for(const n of e)i=i.replace(n,"");return i=$1t(i),i}})}var QWe;(function(s){s.AutomationProfile="terminal.integrated.automationProfile.",s.DefaultProfile="terminal.integrated.defaultProfile.",s.Profiles="terminal.integrated.profiles."})(QWe||(QWe={}));var Ww;(function(s){s.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",s.AutomationProfileLinux="terminal.integrated.automationProfile.linux",s.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",s.AutomationProfileWindows="terminal.integrated.automationProfile.windows",s.ProfilesWindows="terminal.integrated.profiles.windows",s.ProfilesMacOs="terminal.integrated.profiles.osx",s.ProfilesLinux="terminal.integrated.profiles.linux",s.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",s.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",s.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",s.UseWslProfiles="terminal.integrated.useWslProfiles",s.TabsDefaultColor="terminal.integrated.tabs.defaultColor",s.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",s.TabsEnabled="terminal.integrated.tabs.enabled",s.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",s.TabsHideCondition="terminal.integrated.tabs.hideCondition",s.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",s.TabsShowActions="terminal.integrated.tabs.showActions",s.TabsLocation="terminal.integrated.tabs.location",s.TabsFocusMode="terminal.integrated.tabs.focusMode",s.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",s.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",s.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",s.CopyOnSelection="terminal.integrated.copyOnSelection",s.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",s.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",s.FontFamily="terminal.integrated.fontFamily",s.FontSize="terminal.integrated.fontSize",s.LetterSpacing="terminal.integrated.letterSpacing",s.LineHeight="terminal.integrated.lineHeight",s.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",s.TabStopWidth="terminal.integrated.tabStopWidth",s.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",s.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",s.BellDuration="terminal.integrated.bellDuration",s.FontWeight="terminal.integrated.fontWeight",s.FontWeightBold="terminal.integrated.fontWeightBold",s.CursorBlinking="terminal.integrated.cursorBlinking",s.CursorStyle="terminal.integrated.cursorStyle",s.CursorStyleInactive="terminal.integrated.cursorStyleInactive",s.CursorWidth="terminal.integrated.cursorWidth",s.Scrollback="terminal.integrated.scrollback",s.DetectLocale="terminal.integrated.detectLocale",s.DefaultLocation="terminal.integrated.defaultLocation",s.GpuAcceleration="terminal.integrated.gpuAcceleration",s.TerminalTitleSeparator="terminal.integrated.tabs.separator",s.TerminalTitle="terminal.integrated.tabs.title",s.TerminalDescription="terminal.integrated.tabs.description",s.RightClickBehavior="terminal.integrated.rightClickBehavior",s.MiddleClickBehavior="terminal.integrated.middleClickBehavior",s.Cwd="terminal.integrated.cwd",s.ConfirmOnExit="terminal.integrated.confirmOnExit",s.ConfirmOnKill="terminal.integrated.confirmOnKill",s.EnableBell="terminal.integrated.enableBell",s.EnableVisualBell="terminal.integrated.enableVisualBell",s.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",s.AllowChords="terminal.integrated.allowChords",s.AllowMnemonics="terminal.integrated.allowMnemonics",s.TabFocusMode="terminal.integrated.tabFocusMode",s.EnvMacOs="terminal.integrated.env.osx",s.EnvLinux="terminal.integrated.env.linux",s.EnvWindows="terminal.integrated.env.windows",s.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",s.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",s.ShowExitAlert="terminal.integrated.showExitAlert",s.SplitCwd="terminal.integrated.splitCwd",s.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",s.WordSeparators="terminal.integrated.wordSeparators",s.EnableFileLinks="terminal.integrated.enableFileLinks",s.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",s.UnicodeVersion="terminal.integrated.unicodeVersion",s.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",s.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",s.HideOnStartup="terminal.integrated.hideOnStartup",s.CustomGlyphs="terminal.integrated.customGlyphs",s.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",s.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",s.InheritEnv="terminal.integrated.inheritEnv",s.ShowLinkHover="terminal.integrated.showLinkHover",s.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",s.AutoReplies="terminal.integrated.autoReplies",s.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",s.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",s.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",s.ShellIntegrationCommandHistory="terminal.integrated.shellIntegration.history",s.EnableImages="terminal.integrated.enableImages",s.SmoothScrolling="terminal.integrated.smoothScrolling",s.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",s.FocusAfterRun="terminal.integrated.focusAfterRun",s.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",s.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",s.DevMode="terminal.integrated.developer.devMode"})(Ww||(Ww={}));var jWe;(function(s){s.PowerShell="pwsh",s.Bash="bash",s.Fish="fish",s.Sh="sh",s.Csh="csh",s.Ksh="ksh",s.Zsh="zsh",s.Python="python"})(jWe||(jWe={}));var YWe;(function(s){s.CommandPrompt="cmd",s.PowerShell="pwsh",s.Wsl="wsl",s.GitBash="gitbash",s.Python="python"})(YWe||(YWe={}));var JWe;(function(s){s[s.Api=0]="Api",s[s.Process=1]="Process",s[s.Sequence=2]="Sequence",s[s.Config=3]="Config"})(JWe||(JWe={}));var Og;(function(s){s.Cwd="cwd",s.InitialCwd="initialCwd",s.FixedDimensions="fixedDimensions",s.Title="title",s.ShellType="shellType",s.HasChildProcesses="hasChildProcesses",s.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",s.OverrideDimensions="overrideDimensions",s.FailedShellIntegrationActivation="failedShellIntegrationActivation",s.UsedShellIntegrationInjection="usedShellIntegrationInjection"})(Og||(Og={}));var fW;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(fW||(fW={}));var XWe;(function(s){s.TerminalView="view",s.Editor="editor"})(XWe||(XWe={}));var ZWe;(function(s){s[s.HighWatermarkChars=1e5]="HighWatermarkChars",s[s.LowWatermarkChars=5e3]="LowWatermarkChars",s[s.CharCountAckSize=5e3]="CharCountAckSize"})(ZWe||(ZWe={}));var eHe;(function(s){s[s.Off=0]="Off",s[s.FinalTerm=1]="FinalTerm",s[s.VSCode=2]="VSCode"})(eHe||(eHe={}));var kT;(function(s){s[s.Unknown=0]="Unknown",s[s.Shutdown=1]="Shutdown",s[s.Process=2]="Process",s[s.User=3]="User",s[s.Extension=4]="Extension"})(kT||(kT={}));const G1t={Backend:"workbench.contributions.terminal.processBackend"};function Dve(s){return s?.toLowerCase()??""}class K1t{constructor(e){this.remoteAuthority=e}affects(e){return Dve(e)===this.remoteAuthority}}class q1t{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=Dve(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 K1t(t))}getTerminalBackend(e){return this._backends.get(Dve(e))}}Qe.add(G1t.Backend,new q1t);const Q1t=ae("terminalLogService"),Hae=ae("tunnelService");var Tv;(function(s){s.Uninitialized="uninitialized",s.Idle="idle",s.Disabled="disabled",s.CheckingForUpdates="checking for updates",s.AvailableForDownload="available for download",s.Downloading="downloading",s.Downloaded="downloaded",s.Updating="updating",s.Ready="ready"})(Tv||(Tv={}));var tHe;(function(s){s[s.Setup=0]="Setup",s[s.Archive=1]="Archive",s[s.Snap=2]="Snap"})(tHe||(tHe={}));var iHe;(function(s){s[s.NotBuilt=0]="NotBuilt",s[s.DisabledByEnvironment=1]="DisabledByEnvironment",s[s.ManuallyDisabled=2]="ManuallyDisabled",s[s.MissingConfiguration=3]="MissingConfiguration",s[s.InvalidConfiguration=4]="InvalidConfiguration",s[s.RunningAsAdmin=5]="RunningAsAdmin"})(iHe||(iHe={}));const j1t={Uninitialized:{type:Tv.Uninitialized},Disabled:s=>({type:Tv.Disabled,reason:s}),Idle:(s,e)=>({type:Tv.Idle,updateType:s,error:e}),CheckingForUpdates:s=>({type:Tv.CheckingForUpdates,explicit:s}),AvailableForDownload:s=>({type:Tv.AvailableForDownload,update:s}),Downloading:{type:Tv.Downloading},Downloaded:s=>({type:Tv.Downloaded,update:s}),Updating:s=>({type:Tv.Updating,update:s}),Ready:s=>({type:Tv.Ready,update:s})},pJe=ae("updateService");var nHe;let Vhe=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const b4=void 0;class J0{constructor(e,t=2**16){this.comparator=e,this[nHe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new Vhe(this._maxLevel,b4,b4)}get size(){return this._size}clear(){this._header=new Vhe(this._maxLevel,b4,b4),this._size=0}has(e){return!!J0._search(this,e,this.comparator)}get(e){return J0._search(this,e,this.comparator)?.value}set(e,t){return J0._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=J0._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]}[(nHe=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 n=e._header;for(let o=e._level-1;o>=0;o--)for(;n.forward[o]&&i(n.forward[o].key,t)<0;)n=n.forward[o];if(n=n.forward[0],n&&i(n.key,t)===0)return n}static _insert(e,t,i,n){const o=[];let r=e._header;for(let a=e._level-1;a>=0;a--){for(;r.forward[a]&&n(r.forward[a].key,t)<0;)r=r.forward[a];o[a]=r}if(r=r.forward[0],r&&n(r.key,t)===0)return r.value=i,!1;{const a=J0._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];n[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]===b4;)e._level-=1;return!0}}const Gz=class Gz{constructor(e){this.uri=e,this.time=Gz._clock++}touch(){return this.time=Gz._clock++,this}};Gz._clock=0;let FJ=Gz,kve=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=n=>{let o=t.get(n.scheme);return o===void 0&&(o=e.hasProvider(n)&&!this._fileService.hasCapability(n,Vn.PathCaseSensitive),t.set(n.scheme,o)),o};this._dispooables.add(M.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(n=>{t.delete(n.scheme)})),this.extUri=new xN(i),this._canonicalUris=new J0((n,o)=>this.extUri.compare(n,o,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=xGe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new FJ(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].timen[1].time?-1:0);FJ._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,n,o,r,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=UQe(o),r){const y=typeof r=="string"?r:r.value;f+=`, ${y}`}let m;switch(l?.id){case lHe:case bTt:m=l.id===lHe?"error":"warning",c=void 0,l=void 0}const v={name:n,text:o,tooltip:r,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let b=d?O3.LEFT:O3.RIGHT;const w=this._entries.get(e);if(w&&(b=w.alignment,h=w.priority),w)return w.accessor.update(v),w.entry=v,B3.DidUpdate;{let y;typeof i=="string"?y={primary:h,secondary:Wc(i)}:y=h;const C=this._statusbarService.addEntry(v,t,b,y);return this._entries.set(e,{accessor:C,entry:v,alignment:b,priority:h,disposable:Ee(()=>{C.dispose(),this._entries.delete(e),this._onDidChange.fire({removed:e})})}),this._onDidChange.fire({added:[e,{entry:v,alignment:b,priority:h}]}),B3.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};Lve=D([_(0,QRe)],Lve);ce(jRe,Lve,qt.Delayed);const kTt=ae("IEditorBreadcrumbsService"),Rx=new bn(220,70),BJ=new bn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),Vae={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}},xm=ae("viewDescriptorService"),Dm=ae("accessibleViewService"),UN=ae("chatWidgetService"),ITt=ae("quickChatService"),DJe=ae("chatAccessibilityService"),TTt=ae("chatCodeBlockContextProviderService"),_f=ae("chatAgentService"),zae=ae("chatAgentNameService"),km=ae("IChatService"),YRe=ae("chatSlashCommandService"),L6=ae("IChatVariablesService"),kJe=ae("IChatWidgetHistoryService"),IJe=ae("ILanguageModelsService"),eE=ae("commentService"),JRe=ae("customEditorService"),XRe=ae("debugService"),TJe=ae("debugVisualizerService"),LTt=ae("IEditSessionsStorageService"),RTt=ae("IEditSessionsLogService"),Xo=ae("extensionsWorkbenchService"),LJe=ae("externalUriOpenerService"),vf=ae("explorerService"),RJe=ae("IInlineChatSavingService "),ZRe=ae("IInlineChatSessionService"),eMe=ae("IInteractiveDocumentService"),MJe=ae("IInteractiveHistoryService"),MTt=ae("IDefaultLogLevelsService"),NJe=ae("multiDiffSourceResolverService"),R6=ae("INotebookEditorWidgetService"),PJe=ae("notebookCellStatusBarService"),$ae=ae("INotebookModelResolverService"),NTt=ae("INotebookExecutionService"),FJe=ae("INotebookExecutionStateService"),OJe=ae("INotebookKernelService"),PTt=ae("INotebookKernelHistoryService"),FTt=ae("notebookKeymapService"),OTt=ae("INotebookLoggingService"),BJe=ae("INotebookRendererMessagingService"),tE=ae("notebookService"),BTt="notebookEditorWorkerService",WTt=ae(BTt),HTt=ae("outputChannelModelService"),UTt=ae("preferencesSearchService"),M6=ae("quickDiff"),tMe=ae("scm"),WJe=ae("scmView"),VTt=ae("replaceService"),zTt=ae("searchViewModelWorkbenchService"),$Tt=ae("notebookSearchService"),GTt=ae("searchHistoryService"),HJe=ae("shareService"),Gae=ae("snippetService"),Kae=ae("speechService");class KTt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const qTt=ae("workspaceTagsService"),UJe=ae("taskService"),OU=ae("terminalService"),QTt=ae("terminalConfigurationService"),VJe=ae("terminalEditorService"),iMe=ae("terminalGroupService"),zJe=ae("terminalInstanceService"),$Je=ae("environmentVariableService"),GJe=ae("terminalProfileResolverService"),KJe=ae("terminalProfileService"),jTt=ae("terminalContributionsService"),qJe=ae("terminalLinkProviderService"),QJe=ae("terminalQuickFixService"),YTt=ae("testCoverageService"),JTt=ae("testingFilterState"),jJe=ae("testProfileService"),YJe=ae("testResultService"),XTt=ae("ITestResultStorage"),JJe=ae("testService"),ZTt=ae("testingContinuousRunService"),eLt=ae("testingDecorationService"),tLt=ae("testingPeekOpener"),iLt="timeline",XJe=ae(iLt),qae=ae("webviewService"),N6=ae("webviewEditorService"),ZJe=ae("webviewViewService"),nLt=ae("walkthroughsService"),sLt=ae("activityService"),eXe=ae("IAiEmbeddingVectorService"),nMe=ae("IAiRelatedInformationService"),tXe=ae("WorkbenchAssignmentService"),Qae=ae("IAuthenticationAccessService"),iXe=ae("IAuthenticationUsageService"),sMe=ae("IAuthenticationService"),nXe=ae("IAuthenticationExtensionsService"),sXe=ae("auxiliaryWindowService"),oLt=ae("bannerService"),DI=ae("jsonEditingService"),oMe=ae("configurationResolverService"),iE=ae("IFileDecorationsService"),nE=ae("ICustomEditorLabelService"),Po=ae("editorGroupsService"),oXe=ae("editorPaneService"),BU=ae("editorResolverService"),ei=ae("editorService"),WU=ae("IExtensionBisectService"),rXe=ae("IExtensionFeaturesManagementService"),rLt=k6,dv=ae("extensionManagementServerService"),P6=rLt,Nl=ae("extensionEnablementService"),rMe=ae("IWebExtensionsScannerService"),aXe=ae("extensionRecommendationsService"),jae=ae("IExtensionIgnoredRecommendationsService"),aLt=ae("IWorkspaceExtensionsConfigService"),cXe=ae("extensionUrlHandler"),Im=ae("extensionManifestPropertiesService"),fs=ae("extensionService"),F6=ae("elevatedFileService"),_d=ae("filesConfigurationService"),cLt=ae("historyService"),xc=ae("hostService"),lLt=ae("ITroubleshootIssueService"),dLt=ae("issueFormService"),hLt=ae("workbenchIssueService");class Rve{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,n=new Ih(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new IO([n]))[0]}resolveKeybinding(e){return Y2.resolveKeybinding(e,this._OS)}}const uLt=ae("keybindingEditingService"),O6=ae("ILanguageDetectionService"),Yae=ae("ILanguageStatusService"),ig=ae("lifecycleService");var Mve;(function(s){s[s.Default=1]="Default",s[s.Last=2]="Last"})(Mve||(Mve={}));var lD;(function(s){s[s.CLOSE=1]="CLOSE",s[s.QUIT=2]="QUIT",s[s.RELOAD=3]="RELOAD",s[s.LOAD=4]="LOAD"})(lD||(lD={}));var M5;(function(s){s[s.NewWindow=1]="NewWindow",s[s.ReloadedWindow=3]="ReloadedWindow",s[s.ReopenedWindow=4]="ReopenedWindow"})(M5||(M5={}));var Rs;(function(s){s[s.Starting=1]="Starting",s[s.Ready=2]="Ready",s[s.Restored=3]="Restored",s[s.Eventually=4]="Eventually"})(Rs||(Rs={}));function gLt(s){switch(s){case Rs.Starting:return"Starting";case Rs.Ready:return"Ready";case Rs.Restored:return"Restored";case Rs.Eventually:return"Eventually"}}var dV,bL;let Nve=(bL=class extends V{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=Rs.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===wy.SHUTDOWN&&this.storageService.store(dV.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,Ie.WORKSPACE,an.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??M5.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(dV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);this.storageService.remove(dV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);let t;switch(e){case lD.RELOAD:t=M5.ReloadedWindow;break;case lD.LOAD:t=M5.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[Sn.toKey(i.identifier)]=n)}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 n=[],o=[],r=[],a=[],c=bHe(this._allExtensions),l=bHe(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){n.push(m.identifier),c.delete(m.identifier);continue}if(!d(m,v)){n.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)){n.push(v.identifier),c.delete(v.identifier);continue}}const h=new A_(this._myExtensions),u=new A_(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=JO.createActivationEventsMap(o),p={versionId:e,toRemove:n,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:n,myToAdd:o}=e,r=new A_(t),a=new A_(n);for(let c=0;cQF.ID_PREFIX+e;let RJ=QF;class x0t extends Jd{constructor(){super({id:"editor.gotoParentFold",label:g(466,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=YIt(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class D0t extends Jd{constructor(){super({id:"editor.gotoPreviousFold",label:g(467,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=JIt(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class k0t extends Jd{constructor(){super({id:"editor.gotoNextFold",label:g(468,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const o=XIt(n[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class I0t extends Jd{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:g(469,"Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Comma),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=[],o=i.getSelections();if(o){for(const r of o){let a=r.endLineNumber;r.endColumn===1&&--a,a>r.startLineNumber&&(n.push({startLineNumber:r.startLineNumber,endLineNumber:a,type:void 0,isCollapsed:!0,source:yl.userDefined}),i.setSelection({startLineNumber:r.startLineNumber,startColumn:1,endLineNumber:r.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((a,c)=>a.startLineNumber-c.startLineNumber);const r=Uf.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost(Uf.fromFoldRanges(r))}}}}class T0t extends Jd{constructor(){super({id:"editor.removeManualFoldingRanges",label:g(470,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Period),weight:Ae.EditorContrib}})}invoke(e,t,i){const n=i.getSelections();if(n){const o=[];for(const r of n){const{startLineNumber:a,endLineNumber:c}=r;o.push(c>=a?{startLineNumber:a,endLineNumber:c}:{endLineNumber:c,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}on(kA.ID,kA,ri.Eager);Me(g0t);Me(f0t);Me(p0t);Me(_0t);Me(v0t);Me(A0t);Me(E0t);Me(b0t);Me(w0t);Me(y0t);Me(C0t);Me(S0t);Me(m0t);Me(x0t);Me(D0t);Me(k0t);Me(I0t);Me(T0t);for(let s=1;s<=7;s++)Xdt(new RJ({id:RJ.ID(s),label:g(471,"Fold Level {0}",s),alias:`Fold Level ${s}`,precondition:fd,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.Digit0+s),weight:Ae.EditorContrib}}));_t.registerCommand("_executeFoldingRangeProvider",async function(s,...e){const[t]=e;if(!(t instanceof N))throw Pi();const i=s.get(it),n=s.get(gi).getModel(t);if(!n)throw Pi();const o=s.get(Te);if(!o.getValue("editor.folding",{resource:t}))return[];const r=s.get(Vs),a=o.getValue("editor.foldingStrategy",{resource:t}),c={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,p)=>{}},l=new SRe(n,r,c);let d=l;if(a!=="indentation"){const f=kA.getFoldingRangeProviders(i,n);f.length&&(d=new ARe(n,f,()=>{},c,l))}const h=await d.compute(He.None),u=[];try{if(h)for(let f=0;f{const o={...t,limits:{size:Number.MAX_VALUE}};s.openEditor(e,o)}}),ol({id:"workbench.action.configureEditorLargeFileConfirmation",label:g(452,"Configure Limit"),run:()=>n.openUserSettings({query:"workbench.editorLargeFileConfirmation"})})],{forceMessage:!0,forceSeverity:Xe.Warning})}function I5(s){return wa(s?.editor)}function Mhe(s){const e=s;return I5(s)&&e?.group!==void 0}function wve(s){const e=s;return typeof e?.groupId=="number"&&wa(e.editor)}function LWe(s){return typeof s?.groupId=="number"}var aA;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.REPLACE=1]="REPLACE",s[s.MOVE=2]="MOVE",s[s.UNPIN=3]="UNPIN"})(aA||(aA={}));var Do;(function(s){s[s.GROUP_ACTIVE=0]="GROUP_ACTIVE",s[s.GROUP_INDEX=1]="GROUP_INDEX",s[s.GROUP_LABEL=2]="GROUP_LABEL",s[s.GROUP_LOCKED=3]="GROUP_LOCKED",s[s.EDITORS_SELECTION=4]="EDITORS_SELECTION",s[s.EDITOR_OPEN=5]="EDITOR_OPEN",s[s.EDITOR_CLOSE=6]="EDITOR_CLOSE",s[s.EDITOR_MOVE=7]="EDITOR_MOVE",s[s.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",s[s.EDITOR_LABEL=9]="EDITOR_LABEL",s[s.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",s[s.EDITOR_PIN=11]="EDITOR_PIN",s[s.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",s[s.EDITOR_STICKY=13]="EDITOR_STICKY",s[s.EDITOR_DIRTY=14]="EDITOR_DIRTY",s[s.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(Do||(Do={}));var Hs;(function(s){s[s.PRIMARY=1]="PRIMARY",s[s.SECONDARY=2]="SECONDARY",s[s.BOTH=3]="BOTH",s[s.ANY=4]="ANY"})(Hs||(Hs={}));class B0t{getOriginalUri(e,t){if(!e)return;if(_b(e))return Na.getOriginalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:o}=this.getSideEditors(e);if(n&&o){if(t?.supportSideBySide===Hs.BOTH)return{primary:this.getOriginalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Hs.ANY)return this.getOriginalUri(n,{filterByScheme:t.filterByScheme})??this.getOriginalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Hs.PRIMARY?n:o}}if(C_(e)||k5(e)||DS(e)||_b(e))return;const i=P0t(e)?e.preferredResource:e.resource;return!i||!t||!t.filterByScheme?i:this.filterUri(i,t.filterByScheme)}getSideEditors(e){return F0t(e)||DS(e)?{primary:e.primary,secondary:e.secondary}:YYe(e)||C_(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(_b(e))return Na.getCanonicalUri(e.result,t);if(t?.supportSideBySide){const{primary:n,secondary:o}=this.getSideEditors(e);if(n&&o){if(t?.supportSideBySide===Hs.BOTH)return{primary:this.getCanonicalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(o,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===Hs.ANY)return this.getCanonicalUri(n,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(o,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===Hs.PRIMARY?n:o}}if(C_(e)||k5(e)||DS(e)||_b(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 RWe;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.KEYBOARD=1]="KEYBOARD",s[s.MOUSE=2]="MOUSE"})(RWe||(RWe={}));const Na=new B0t;var MWe;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT"})(MWe||(MWe={}));class W0t{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(we);for(const[i,n]of this.editorSerializerConstructors)this.createEditorSerializer(i,n,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const n=i.createInstance(t);this.editorSerializerInstances.set(e,n)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return qn(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)}}Qe.add(Xy.EditorFactory,new W0t);async function Nhe(s,e,t){return!s||!s.length?[]:await Promise.all(s.map(async i=>{const n=N.revive(i.fileUri);if(!n){t.info("Cannot resolve the path because it is not valid.",i);return}if(!await e.canHandleResource(n)){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(n)).isDirectory?sn.Directory:sn.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===sn.Directory){t.info("Cannot resolve the path because it is a directory",i);return}const c={...i.options,pinned:!0};return r?{resource:n,options:c}:{resource:n,options:c,forceUntitled:!0}}))}var Xh;(function(s){s[s.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",s[s.SEQUENTIAL=1]="SEQUENTIAL"})(Xh||(Xh={}));function ERe(s){const e=s;if(!e)return!1;const t=e;if(t.modified)return ERe(t.modified);const i=e;return!!(i.contributionsState&&i.viewState&&Array.isArray(i.cursorState))}function JYe(s,e,t){const i=lyt(s,e);return i.forceMessage=t?.forceMessage,i.forceSeverity=t?.forceSeverity,i.allowDialog=t?.allowDialog,i}var _v;const H0t=new Y("workbenchState",void 0,{type:"string",description:g(480,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")}),U0t=new Y("workspaceFolderCount",0,g(481,"The number of root folders in the workspace")),V0t=new Y("openFolderWorkspaceSupport",!0,!0),z0t=new Y("enterMultiRootWorkspaceSupport",!0,!0),XYe=new Y("emptyWorkspaceSupport",!0,!0),$0t=new Y("dirtyWorkingCopies",!1,g(482,"Whether there are any working copies with unsaved changes")),G0t=new Y("remoteName","",g(483,"The name of the remote the window is connected to or an empty string if not connected to any remote")),K0t=new Y("virtualWorkspace","",g(484,"The scheme of the current workspace is from a virtual file system or an empty string.")),ZYe=new Y("temporaryWorkspace",!1,g(485,"The scheme of the current workspace is from a temporary file system.")),q0t=new Y("isFullscreen",!1,g(486,"Whether the main window is in fullscreen mode")),Q0t=new Y("isAuxiliaryWindowFocusedContext",!1,g(487,"Whether an auxiliary window is focused")),j0t=new Y("hasWebFileSystemAccess",!1,!0),Y0t=new Y("embedderIdentifier",void 0,g(488,"The identifier of the embedder according to the product service, if one is defined"));new Y("activeEditorIsDirty",!1,g(489,"Whether the active editor has unsaved changes"));new Y("activeEditorIsNotPreview",!1,g(490,"Whether the active editor is not in preview mode"));new Y("activeEditorIsFirstInGroup",!1,g(491,"Whether the active editor is the first one in its group"));new Y("activeEditorIsLastInGroup",!1,g(492,"Whether the active editor is the last one in its group"));new Y("activeEditorIsPinned",!1,g(493,"Whether the active editor is pinned"));new Y("activeEditorIsReadonly",!1,g(494,"Whether the active editor is read-only"));new Y("activeCompareEditorCanSwap",!1,g(495,"Whether the active compare editor can swap sides"));const J0t=new Y("activeEditorCanToggleReadonly",!0,g(496,"Whether the active editor can toggle between being read-only or writeable"));new Y("activeEditorCanRevert",!1,g(497,"Whether the active editor can revert"));new Y("activeEditorCanSplitInGroup",!0);const eJe=new Y("activeEditor",null,{type:"string",description:g(498,"The identifier of the active editor")});new Y("activeEditorAvailableEditorIds","",g(499,"The available editor identifiers that are usable for the active editor"));new Y("textCompareEditorVisible",!1,g(500,"Whether a text compare editor is visible"));const Iae=new Y("textCompareEditorActive",!1,g(501,"Whether a text compare editor is active"));new Y("sideBySideEditorActive",!1,g(502,"Whether a side by side editor is active"));new Y("groupEditorsCount",0,g(503,"The number of opened editor groups"));const X0t=new Y("activeEditorGroupEmpty",!1,g(504,"Whether the active editor group is empty")),Z0t=new Y("activeEditorGroupIndex",0,g(505,"The index of the active editor group")),e1t=new Y("activeEditorGroupLast",!1,g(506,"Whether the active editor group is the last group")),t1t=new Y("activeEditorGroupLocked",!1,g(507,"Whether the active editor group is locked")),i1t=new Y("multipleEditorGroups",!1,g(508,"Whether there are multiple editor groups opened"));new Y("multipleEditorsSelectedInGroup",!1,g(509,"Whether multiple editors have been selected in an editor group"));new Y("twoEditorsSelectedInGroup",!1,g(510,"Whether exactly two editors have been selected in an editor group"));new Y("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,g(511,"Whether all selected editors in a group have a file or untitled resource associated"));new Y("editorPartMultipleEditorGroups",!1,g(512,"Whether there are multiple editor groups opened in an editor part"));new Y("editorPartMaximizedEditorGroup",!1,g(513,"Editor Part has a maximized group"));new Y("isAuxiliaryEditorPart",!1,g(514,"Editor Part is in an auxiliary window"));const n1t=new Y("editorIsOpen",!1,g(515,"Whether an editor is open")),s1t=new Y("inZenMode",!1,g(516,"Whether Zen mode is enabled")),o1t=new Y("isCenteredLayout",!1,g(517,"Whether centered layout is enabled for the main editor")),r1t=new Y("splitEditorsVertically",!1,g(518,"Whether editors split vertically")),a1t=new Y("mainEditorAreaVisible",!0,g(519,"Whether the editor area in the main window is visible")),c1t=new Y("editorTabsVisible",!0,g(520,"Whether editor tabs are visible")),l1t=new Y("sideBarVisible",!1,g(521,"Whether the sidebar is visible"));new Y("sideBarFocus",!1,g(522,"Whether the sidebar has keyboard focus"));new Y("activeViewlet","",g(523,"The identifier of the active viewlet"));new Y("statusBarFocused",!1,g(524,"Whether the status bar has keyboard focus"));const d1t=new Y("titleBarStyle",pr?"native":"custom",g(525,"Style of the window title bar")),h1t=new Y("titleBarVisible",!1,g(526,"Whether the title bar is visible"));new Y("bannerFocused",!1,g(527,"Whether the banner has keyboard focus"));new Y("notificationFocus",!0,g(528,"Whether a notification has keyboard focus"));new Y("notificationCenterVisible",!1,g(529,"Whether the notifications center is visible"));new Y("notificationToastsVisible",!1,g(530,"Whether a notification toast is visible"));new Y("activeAuxiliary","",g(531,"The identifier of the active auxiliary panel"));new Y("auxiliaryBarFocus",!1,g(532,"Whether the auxiliary bar has keyboard focus"));const u1t=new Y("auxiliaryBarVisible",!1,g(533,"Whether the auxiliary bar is visible"));new Y("activePanel","",g(534,"The identifier of the active panel"));new Y("panelFocus",!1,g(535,"Whether the panel has keyboard focus"));const g1t=new Y("panelPosition","bottom",g(536,"The position of the panel, always 'bottom'")),f1t=new Y("panelAlignment","center",g(537,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'")),p1t=new Y("panelVisible",!1,g(538,"Whether the panel is visible")),m1t=new Y("panelMaximized",!1,g(539,"Whether the panel is maximized")),LU=new Y("focusedView","",g(540,"The identifier of the view that has keyboard focus"));var Lg;let T3=(Lg=class{constructor(e,t,i,n){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=n,this._disposables=new Z,this._schemeKey=_v.Scheme.bindTo(this._contextKeyService),this._filenameKey=_v.Filename.bindTo(this._contextKeyService),this._dirnameKey=_v.Dirname.bindTo(this._contextKeyService),this._pathKey=_v.Path.bindTo(this._contextKeyService),this._langIdKey=_v.LangId.bindTo(this._contextKeyService),this._resourceKey=_v.Resource.bindTo(this._contextKeyService),this._extensionKey=_v.Extension.bindTo(this._contextKeyService),this._hasResource=_v.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=_v.IsFileSystemResource.bindTo(this._contextKeyService),this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{const o=this.get();this._isFileSystemResource.set(!!(o&&t.hasProvider(o)))})),this._disposables.add(n.onModelAdded(o=>{ji(o.uri,this.get())&&this._setLangId()})),this._disposables.add(n.onModelLanguageChanged(o=>{ji(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,!ji(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?_i(e):null),this._dirnameKey.set(e?this.uriToPath(Lr(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?gU(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===pe.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}},_v=Lg,Lg.Scheme=new Y("resourceScheme",void 0,{type:"string",description:g(541,"The scheme of the resource")}),Lg.Filename=new Y("resourceFilename",void 0,{type:"string",description:g(542,"The file name of the resource")}),Lg.Dirname=new Y("resourceDirname",void 0,{type:"string",description:g(543,"The folder name the resource is contained in")}),Lg.Path=new Y("resourcePath",void 0,{type:"string",description:g(544,"The full path of the resource")}),Lg.LangId=new Y("resourceLangId",void 0,{type:"string",description:g(545,"The language identifier of the resource")}),Lg.Resource=new Y("resource",void 0,{type:"URI",description:g(546,"The full value of the resource including scheme and path")}),Lg.Extension=new Y("resourceExtname",void 0,{type:"string",description:g(547,"The extension name of the resource")}),Lg.HasResource=new Y("resourceSet",void 0,{type:"boolean",description:g(548,"Whether a resource is present or not")}),Lg.IsFileSystemResource=new Y("isFileSystemResource",void 0,{type:"boolean",description:g(549,"Whether the resource is backed by a file system provider")}),Lg);T3=_v=D([_(0,Le),_(1,Jt),_(2,xi),_(3,gi)],T3);function _1t(s,e){return s.invokeFunction(t=>m_.getServiceDependencies(e).sort((i,n)=>i.index-n.index).map(i=>t.get(i.id)))}function xRe(s){const e=s;return class extends e{constructor(...t){super(...t.slice(1),..._1t(t[0],s))}}}class DRe{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 NWe{constructor(e){this.identifier=e}}const Tae=ae("treeViewsDndService");ce(Tae,DRe,qt.Delayed);const tJe=ae("extensionHostDebugService"),v1t="diagnosticsService";class b1t{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 w1t=ae(v1t),kRe=ae("downloadService"),y1t=ae("encryptionService"),bI=ae("extensionGalleryService"),A6=ae("extensionManagementService"),iJe=ae("IGlobalExtensionEnablementService"),C1t=ae("IExtensionTipsService"),L3=ae("IExtensionStorageService"),Lae=ae("IExtensionsProfileScannerService"),S1t=ae("IExtensionsScannerService"),A1t=ae("IExtensionRecommendationNotificationService"),Rae=ae("extensionResourceLoaderService"),E1t=ae("IBuiltinExtensionsScannerService"),Mae=ae("keyboardLayoutService"),nJe=ae("languagePackService");class sJe{constructor(){this.onDidChange=M.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}const Er=ae("productService"),hC=ae("remoteAuthorityResolverService"),Nae=ae("IRemoteExtensionsScannerService"),IRe=ae("remoteSocketFactoryService"),E6=ae("requestService"),oJe=ae("secretStorageService"),x1t="signService",rJe=ae(x1t);let Pae=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};class D1t{async publicLog(e,t,i){}async publicLogError(e,t,i){}}const k1t="extensionTelemetryLog";function Qq(s,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!s.enableTelemetry)}function TRe(s,e){return e.extensionTestsLocationURI?!0:!(e.isBuilt||e.disableTelemetry||s.enableTelemetry&&s.aiConfig?.ariaKey)}function I1t(s){const e=s.getValue(sje),t=s.getValue(GSt);if(s.getValue(oje)===!1||t===!1)return zg.NONE;switch(e??$0.ON){case $0.ON:return zg.USAGE;case $0.ERROR:return zg.ERROR;case $0.CRASH:return zg.CRASH;case $0.OFF:return zg.NONE}}const T1t=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function L1t(s){if(!s)return"none";const e=S6(s);return T1t.has(e)?e:"other"}function R1t(s,e){if(!s||!s.includes("/")&&!s.includes("\\"))return s;let t=s;const i=[];for(const a of e)for(;;){const c=a.exec(s);if(!c)break;i.push([c.index,a.lastIndex])}const n=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let r=0;for(t="";;){const a=o.exec(s);if(!a)break;const c=i.some(([l,d])=>a.index",r=o.lastIndex)}return r`;return s}function PWe(s,e){return b2(s,t=>{if(t instanceof Pae||Object.hasOwnProperty.call(t,"isTrustedTelemetryValue"))return t.value;if(typeof t=="string"){let i=t.replaceAll("%20"," ");i=R1t(i,e);for(const n of e)i=i.replace(n,"");return i=M1t(i),i}})}var FWe;(function(s){s.AutomationProfile="terminal.integrated.automationProfile.",s.DefaultProfile="terminal.integrated.defaultProfile.",s.Profiles="terminal.integrated.profiles."})(FWe||(FWe={}));var Fw;(function(s){s.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",s.AutomationProfileLinux="terminal.integrated.automationProfile.linux",s.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",s.AutomationProfileWindows="terminal.integrated.automationProfile.windows",s.ProfilesWindows="terminal.integrated.profiles.windows",s.ProfilesMacOs="terminal.integrated.profiles.osx",s.ProfilesLinux="terminal.integrated.profiles.linux",s.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",s.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",s.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",s.UseWslProfiles="terminal.integrated.useWslProfiles",s.TabsDefaultColor="terminal.integrated.tabs.defaultColor",s.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",s.TabsEnabled="terminal.integrated.tabs.enabled",s.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",s.TabsHideCondition="terminal.integrated.tabs.hideCondition",s.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",s.TabsShowActions="terminal.integrated.tabs.showActions",s.TabsLocation="terminal.integrated.tabs.location",s.TabsFocusMode="terminal.integrated.tabs.focusMode",s.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",s.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",s.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",s.CopyOnSelection="terminal.integrated.copyOnSelection",s.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",s.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",s.FontFamily="terminal.integrated.fontFamily",s.FontSize="terminal.integrated.fontSize",s.LetterSpacing="terminal.integrated.letterSpacing",s.LineHeight="terminal.integrated.lineHeight",s.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",s.TabStopWidth="terminal.integrated.tabStopWidth",s.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",s.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",s.BellDuration="terminal.integrated.bellDuration",s.FontWeight="terminal.integrated.fontWeight",s.FontWeightBold="terminal.integrated.fontWeightBold",s.CursorBlinking="terminal.integrated.cursorBlinking",s.CursorStyle="terminal.integrated.cursorStyle",s.CursorStyleInactive="terminal.integrated.cursorStyleInactive",s.CursorWidth="terminal.integrated.cursorWidth",s.Scrollback="terminal.integrated.scrollback",s.DetectLocale="terminal.integrated.detectLocale",s.DefaultLocation="terminal.integrated.defaultLocation",s.GpuAcceleration="terminal.integrated.gpuAcceleration",s.TerminalTitleSeparator="terminal.integrated.tabs.separator",s.TerminalTitle="terminal.integrated.tabs.title",s.TerminalDescription="terminal.integrated.tabs.description",s.RightClickBehavior="terminal.integrated.rightClickBehavior",s.MiddleClickBehavior="terminal.integrated.middleClickBehavior",s.Cwd="terminal.integrated.cwd",s.ConfirmOnExit="terminal.integrated.confirmOnExit",s.ConfirmOnKill="terminal.integrated.confirmOnKill",s.EnableBell="terminal.integrated.enableBell",s.EnableVisualBell="terminal.integrated.enableVisualBell",s.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",s.AllowChords="terminal.integrated.allowChords",s.AllowMnemonics="terminal.integrated.allowMnemonics",s.TabFocusMode="terminal.integrated.tabFocusMode",s.EnvMacOs="terminal.integrated.env.osx",s.EnvLinux="terminal.integrated.env.linux",s.EnvWindows="terminal.integrated.env.windows",s.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",s.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",s.ShowExitAlert="terminal.integrated.showExitAlert",s.SplitCwd="terminal.integrated.splitCwd",s.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",s.WordSeparators="terminal.integrated.wordSeparators",s.EnableFileLinks="terminal.integrated.enableFileLinks",s.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",s.UnicodeVersion="terminal.integrated.unicodeVersion",s.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",s.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",s.HideOnStartup="terminal.integrated.hideOnStartup",s.CustomGlyphs="terminal.integrated.customGlyphs",s.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",s.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",s.InheritEnv="terminal.integrated.inheritEnv",s.ShowLinkHover="terminal.integrated.showLinkHover",s.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",s.AutoReplies="terminal.integrated.autoReplies",s.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",s.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",s.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",s.ShellIntegrationCommandHistory="terminal.integrated.shellIntegration.history",s.EnableImages="terminal.integrated.enableImages",s.SmoothScrolling="terminal.integrated.smoothScrolling",s.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",s.FocusAfterRun="terminal.integrated.focusAfterRun",s.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",s.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",s.DevMode="terminal.integrated.developer.devMode"})(Fw||(Fw={}));var OWe;(function(s){s.PowerShell="pwsh",s.Bash="bash",s.Fish="fish",s.Sh="sh",s.Csh="csh",s.Ksh="ksh",s.Zsh="zsh",s.Python="python"})(OWe||(OWe={}));var BWe;(function(s){s.CommandPrompt="cmd",s.PowerShell="pwsh",s.Wsl="wsl",s.GitBash="gitbash",s.Python="python"})(BWe||(BWe={}));var WWe;(function(s){s[s.Api=0]="Api",s[s.Process=1]="Process",s[s.Sequence=2]="Sequence",s[s.Config=3]="Config"})(WWe||(WWe={}));var Ng;(function(s){s.Cwd="cwd",s.InitialCwd="initialCwd",s.FixedDimensions="fixedDimensions",s.Title="title",s.ShellType="shellType",s.HasChildProcesses="hasChildProcesses",s.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",s.OverrideDimensions="overrideDimensions",s.FailedShellIntegrationActivation="failedShellIntegrationActivation",s.UsedShellIntegrationInjection="usedShellIntegrationInjection"})(Ng||(Ng={}));var dW;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(dW||(dW={}));var HWe;(function(s){s.TerminalView="view",s.Editor="editor"})(HWe||(HWe={}));var UWe;(function(s){s[s.HighWatermarkChars=1e5]="HighWatermarkChars",s[s.LowWatermarkChars=5e3]="LowWatermarkChars",s[s.CharCountAckSize=5e3]="CharCountAckSize"})(UWe||(UWe={}));var VWe;(function(s){s[s.Off=0]="Off",s[s.FinalTerm=1]="FinalTerm",s[s.VSCode=2]="VSCode"})(VWe||(VWe={}));var AT;(function(s){s[s.Unknown=0]="Unknown",s[s.Shutdown=1]="Shutdown",s[s.Process=2]="Process",s[s.User=3]="User",s[s.Extension=4]="Extension"})(AT||(AT={}));const N1t={Backend:"workbench.contributions.terminal.processBackend"};function yve(s){return s?.toLowerCase()??""}class P1t{constructor(e){this.remoteAuthority=e}affects(e){return yve(e)===this.remoteAuthority}}class F1t{constructor(){this._backends=new Map,this._onDidChangeBackends=new I,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=yve(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 P1t(t))}getTerminalBackend(e){return this._backends.get(yve(e))}}Qe.add(N1t.Backend,new F1t);const O1t=ae("terminalLogService"),Fae=ae("tunnelService");var Dv;(function(s){s.Uninitialized="uninitialized",s.Idle="idle",s.Disabled="disabled",s.CheckingForUpdates="checking for updates",s.AvailableForDownload="available for download",s.Downloading="downloading",s.Downloaded="downloaded",s.Updating="updating",s.Ready="ready"})(Dv||(Dv={}));var zWe;(function(s){s[s.Setup=0]="Setup",s[s.Archive=1]="Archive",s[s.Snap=2]="Snap"})(zWe||(zWe={}));var $We;(function(s){s[s.NotBuilt=0]="NotBuilt",s[s.DisabledByEnvironment=1]="DisabledByEnvironment",s[s.ManuallyDisabled=2]="ManuallyDisabled",s[s.MissingConfiguration=3]="MissingConfiguration",s[s.InvalidConfiguration=4]="InvalidConfiguration",s[s.RunningAsAdmin=5]="RunningAsAdmin"})($We||($We={}));const B1t={Uninitialized:{type:Dv.Uninitialized},Disabled:s=>({type:Dv.Disabled,reason:s}),Idle:(s,e)=>({type:Dv.Idle,updateType:s,error:e}),CheckingForUpdates:s=>({type:Dv.CheckingForUpdates,explicit:s}),AvailableForDownload:s=>({type:Dv.AvailableForDownload,update:s}),Downloading:{type:Dv.Downloading},Downloaded:s=>({type:Dv.Downloaded,update:s}),Updating:s=>({type:Dv.Updating,update:s}),Ready:s=>({type:Dv.Ready,update:s})},aJe=ae("updateService");var GWe;let Phe=class{constructor(e,t,i){this.level=e,this.key=t,this.value=i,this.forward=[]}};const f4=void 0;class q0{constructor(e,t=2**16){this.comparator=e,this[GWe]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(t)|0),this._header=new Phe(this._maxLevel,f4,f4)}get size(){return this._size}clear(){this._header=new Phe(this._maxLevel,f4,f4),this._size=0}has(e){return!!q0._search(this,e,this.comparator)}get(e){return q0._search(this,e,this.comparator)?.value}set(e,t){return q0._insert(this,e,t,this.comparator)&&(this._size+=1),this}delete(e){const t=q0._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]}[(GWe=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 n=e._header;for(let o=e._level-1;o>=0;o--)for(;n.forward[o]&&i(n.forward[o].key,t)<0;)n=n.forward[o];if(n=n.forward[0],n&&i(n.key,t)===0)return n}static _insert(e,t,i,n){const o=[];let r=e._header;for(let a=e._level-1;a>=0;a--){for(;r.forward[a]&&n(r.forward[a].key,t)<0;)r=r.forward[a];o[a]=r}if(r=r.forward[0],r&&n(r.key,t)===0)return r.value=i,!1;{const a=q0._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];n[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]===f4;)e._level-=1;return!0}}const Vz=class Vz{constructor(e){this.uri=e,this.time=Vz._clock++}touch(){return this.time=Vz._clock++,this}};Vz._clock=0;let NJ=Vz,Cve=class{constructor(e){this._fileService=e,this._dispooables=new Z,this._limit=2**16;const t=new Map,i=n=>{let o=t.get(n.scheme);return o===void 0&&(o=e.hasProvider(n)&&!this._fileService.hasCapability(n,Vn.PathCaseSensitive),t.set(n.scheme,o)),o};this._dispooables.add(M.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(n=>{t.delete(n.scheme)})),this.extUri=new CN(i),this._canonicalUris=new q0((n,o)=>this.extUri.compare(n,o,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(e){this._fileService.hasProvider(e)&&(e=vGe(e));const t=this._canonicalUris.get(e);return t?t.touch().uri.with({fragment:e.fragment}):(this._canonicalUris.set(e,new NJ(e)),this._checkTrim(),e)}_checkTrim(){if(this._canonicalUris.sizei[1].timen[1].time?-1:0);NJ._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,n,o,r,a,c,l,d,h,u){let f,p;if(u)f=u.label,p=u.role;else if(f=MQe(o),r){const y=typeof r=="string"?r:r.value;f+=`, ${y}`}let m;switch(l?.id){case JWe:case cTt:m=l.id===JWe?"error":"warning",c=void 0,l=void 0}const v={name:n,text:o,tooltip:r,command:a,color:c,backgroundColor:l,ariaLabel:f,role:p,kind:m};typeof h>"u"&&(h=0);let b=d?N3.LEFT:N3.RIGHT;const w=this._entries.get(e);if(w&&(b=w.alignment,h=w.priority),w)return w.accessor.update(v),w.entry=v,P3.DidUpdate;{let y;typeof i=="string"?y={primary:h,secondary:Wc(i)}:y=h;const C=this._statusbarService.addEntry(v,t,b,y);return this._entries.set(e,{accessor:C,entry:v,alignment:b,priority:h,disposable:Ee(()=>{C.dispose(),this._entries.delete(e),this._onDidChange.fire({removed:e})})}),this._onDidChange.fire({added:[e,{entry:v,alignment:b,priority:h}]}),P3.DidDefine}}unsetEntry(e){this._entries.get(e)?.disposable.dispose(),this._entries.delete(e)}getEntries(){return this._entries.entries()}};Eve=D([_(0,FRe)],Eve);ce(ORe,Eve,qt.Delayed);const _Tt=ae("IEditorBreadcrumbsService"),Ix=new bn(220,70),FJ=new bn(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),Bae={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}},Sm=ae("viewDescriptorService"),Am=ae("accessibleViewService"),ON=ae("chatWidgetService"),vTt=ae("quickChatService"),bJe=ae("chatAccessibilityService"),bTt=ae("chatCodeBlockContextProviderService"),ff=ae("chatAgentService"),Wae=ae("chatAgentNameService"),Em=ae("IChatService"),BRe=ae("chatSlashCommandService"),D6=ae("IChatVariablesService"),wJe=ae("IChatWidgetHistoryService"),yJe=ae("ILanguageModelsService"),XA=ae("commentService"),WRe=ae("customEditorService"),HRe=ae("debugService"),CJe=ae("debugVisualizerService"),wTt=ae("IEditSessionsStorageService"),yTt=ae("IEditSessionsLogService"),Xo=ae("extensionsWorkbenchService"),SJe=ae("externalUriOpenerService"),pf=ae("explorerService"),AJe=ae("IInlineChatSavingService "),URe=ae("IInlineChatSessionService"),VRe=ae("IInteractiveDocumentService"),EJe=ae("IInteractiveHistoryService"),CTt=ae("IDefaultLogLevelsService"),xJe=ae("multiDiffSourceResolverService"),k6=ae("INotebookEditorWidgetService"),DJe=ae("notebookCellStatusBarService"),Hae=ae("INotebookModelResolverService"),STt=ae("INotebookExecutionService"),kJe=ae("INotebookExecutionStateService"),IJe=ae("INotebookKernelService"),ATt=ae("INotebookKernelHistoryService"),ETt=ae("notebookKeymapService"),xTt=ae("INotebookLoggingService"),TJe=ae("INotebookRendererMessagingService"),ZA=ae("notebookService"),DTt="notebookEditorWorkerService",kTt=ae(DTt),ITt=ae("outputChannelModelService"),TTt=ae("preferencesSearchService"),I6=ae("quickDiff"),zRe=ae("scm"),LJe=ae("scmView"),LTt=ae("replaceService"),RTt=ae("searchViewModelWorkbenchService"),MTt=ae("notebookSearchService"),NTt=ae("searchHistoryService"),RJe=ae("shareService"),Uae=ae("snippetService"),Vae=ae("speechService");class PTt{getTags(){return Promise.resolve({})}async getTelemetryWorkspaceId(e,t){}getHashedRemotesFromUri(e,t){return Promise.resolve([])}}const FTt=ae("workspaceTagsService"),MJe=ae("taskService"),RU=ae("terminalService"),OTt=ae("terminalConfigurationService"),NJe=ae("terminalEditorService"),$Re=ae("terminalGroupService"),PJe=ae("terminalInstanceService"),FJe=ae("environmentVariableService"),OJe=ae("terminalProfileResolverService"),BJe=ae("terminalProfileService"),BTt=ae("terminalContributionsService"),WJe=ae("terminalLinkProviderService"),HJe=ae("terminalQuickFixService"),WTt=ae("testCoverageService"),HTt=ae("testingFilterState"),UJe=ae("testProfileService"),VJe=ae("testResultService"),UTt=ae("ITestResultStorage"),zJe=ae("testService"),VTt=ae("testingContinuousRunService"),zTt=ae("testingDecorationService"),$Tt=ae("testingPeekOpener"),GTt="timeline",$Je=ae(GTt),zae=ae("webviewService"),T6=ae("webviewEditorService"),GJe=ae("webviewViewService"),KTt=ae("walkthroughsService"),qTt=ae("activityService"),KJe=ae("IAiEmbeddingVectorService"),GRe=ae("IAiRelatedInformationService"),qJe=ae("WorkbenchAssignmentService"),$ae=ae("IAuthenticationAccessService"),QJe=ae("IAuthenticationUsageService"),KRe=ae("IAuthenticationService"),jJe=ae("IAuthenticationExtensionsService"),YJe=ae("auxiliaryWindowService"),QTt=ae("bannerService"),yI=ae("jsonEditingService"),qRe=ae("configurationResolverService"),eE=ae("IFileDecorationsService"),tE=ae("ICustomEditorLabelService"),Po=ae("editorGroupsService"),JJe=ae("editorPaneService"),MU=ae("editorResolverService"),ei=ae("editorService"),NU=ae("IExtensionBisectService"),XJe=ae("IExtensionFeaturesManagementService"),jTt=A6,av=ae("extensionManagementServerService"),L6=jTt,Ml=ae("extensionEnablementService"),QRe=ae("IWebExtensionsScannerService"),ZJe=ae("extensionRecommendationsService"),Gae=ae("IExtensionIgnoredRecommendationsService"),YTt=ae("IWorkspaceExtensionsConfigService"),eXe=ae("extensionUrlHandler"),xm=ae("extensionManifestPropertiesService"),fs=ae("extensionService"),R6=ae("elevatedFileService"),pd=ae("filesConfigurationService"),JTt=ae("historyService"),xc=ae("hostService"),XTt=ae("ITroubleshootIssueService"),ZTt=ae("issueFormService"),eLt=ae("workbenchIssueService");class xve{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,n=new Dh(t,e.shiftKey,i,e.metaKey,e.keyCode);return this.resolveKeybinding(new EO([n]))[0]}resolveKeybinding(e){return K2.resolveKeybinding(e,this._OS)}}const tLt=ae("keybindingEditingService"),M6=ae("ILanguageDetectionService"),Kae=ae("ILanguageStatusService"),Zu=ae("lifecycleService");var Dve;(function(s){s[s.Default=1]="Default",s[s.Last=2]="Last"})(Dve||(Dve={}));var rD;(function(s){s[s.CLOSE=1]="CLOSE",s[s.QUIT=2]="QUIT",s[s.RELOAD=3]="RELOAD",s[s.LOAD=4]="LOAD"})(rD||(rD={}));var T5;(function(s){s[s.NewWindow=1]="NewWindow",s[s.ReloadedWindow=3]="ReloadedWindow",s[s.ReopenedWindow=4]="ReopenedWindow"})(T5||(T5={}));var Rs;(function(s){s[s.Starting=1]="Starting",s[s.Ready=2]="Ready",s[s.Restored=3]="Restored",s[s.Eventually=4]="Eventually"})(Rs||(Rs={}));function iLt(s){switch(s){case Rs.Starting:return"Starting";case Rs.Ready:return"Ready";case Rs.Restored:return"Restored";case Rs.Eventually:return"Eventually"}}var cV,pL;let kve=(pL=class extends V{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=Rs.Starting,this.phaseWhen=new Map,this._startupKind=this.resolveStartupKind(),this._register(this.storageService.onWillSaveState(i=>{i.reason===_y.SHUTDOWN&&this.storageService.store(cV.LAST_SHUTDOWN_REASON_KEY,this.shutdownReason,Ie.WORKSPACE,an.MACHINE)}))}resolveStartupKind(){const e=this.doResolveStartupKind()??T5.NewWindow;return this.logService.trace(`[lifecycle] starting up (startup kind: ${e})`),e}doResolveStartupKind(){const e=this.storageService.getNumber(cV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);this.storageService.remove(cV.LAST_SHUTDOWN_REASON_KEY,Ie.WORKSPACE);let t;switch(e){case rD.RELOAD:t=T5.ReloadedWindow;break;case rD.LOAD:t=T5.ReopenedWindow;break}return t}set phase(e){if(e0&&(t[Sn.toKey(i.identifier)]=n)}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 n=[],o=[],r=[],a=[],c=aHe(this._allExtensions),l=aHe(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){n.push(m.identifier),c.delete(m.identifier);continue}if(!d(m,v)){n.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)){n.push(v.identifier),c.delete(v.identifier);continue}}const h=new y_(this._myExtensions),u=new y_(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=qO.createActivationEventsMap(o),p={versionId:e,toRemove:n,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:n,myToAdd:o}=e,r=new y_(t),a=new y_(n);for(let c=0;csetTimeout(e,s))}function zLt(s,e,t){let i=Promise.resolve(),n=null;return async o=>{n==null?(n=o,i=i.then(async()=>VLt(t)).then(async()=>{const r=n;n=null,await s(r)})):n=e(n,o),await i}}const $Lt={};let GLt;function KLt(s){return $Lt[s]}function qLt(){return GLt}var gK;ce(uf,class extends _Qe{constructor(){super(Gn.Info,N.file("logs.log"))}doCreateLogger(){return new vQe}},0);ce(ei,class{constructor(){this._serviceBrand=void 0,this.onWillOpenEditor=M.None,this.onDidActiveEditorChange=M.None,this.onDidVisibleEditorsChange=M.None,this.onDidEditorsChange=M.None,this.onDidCloseEditor=M.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=E,this.openEditors=E,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 Dt.get(Kt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Tm,class{constructor(){this._serviceBrand=void 0,this.onDidPaneCompositeOpen=M.None,this.onDidPaneCompositeClose=M.None,this.openPaneComposite=async()=>{},this.getActivePaneComposite=()=>{},this.getPaneComposite=()=>{},this.getPaneComposites=()=>[],this.getPinnedPaneCompositeIds=()=>[],this.getVisiblePaneCompositeIds=()=>[],this.getProgressIndicator=()=>{},this.hideActivePaneComposite=()=>{},this.getLastActivePaneCompositeId=E,this.showActivity=()=>V.None}},0);ce(ks,kve,1);ce(Fo,class{constructor(){this.isDirty=E,this.save=E,this.saveAs=E,this.revert=E,this.read=E,this.readStream=E,this.write=E,this.create=E,this.getEncodedReadable=E,this.getDecodedStream=E,this.dispose=E}get files(){return E()}get untitled(){return E()}get encoding(){return E()}},0);ce(Jt,class{constructor(){this._serviceBrand=void 0,this.onDidChangeFileSystemProviderRegistrations=M.None,this.onDidChangeFileSystemProviderCapabilities=M.None,this.onWillActivateFileSystemProvider=M.None,this.registerProvider=E,this.getProvider=function(){},this.activateProvider=async()=>{},this.canHandleResource=async()=>!1,this.hasProvider=()=>!1,this.hasCapability=()=>!1,this.listCapabilities=()=>[],this.onDidFilesChange=M.None,this.onDidRunOperation=M.None,this.resolve=E,this.resolveAll=E,this.stat=E,this.exists=async()=>!1,this.readFile=E,this.readFileStream=E,this.writeFile=E,this.move=E,this.canMove=E,this.copy=E,this.canCopy=E,this.cloneFile=E,this.createFile=E,this.canCreateFile=E,this.createFolder=E,this.del=E,this.canDelete=E,this.onDidWatchError=M.None,this.watch=E,this.createWatcher=E}dispose(){}},0);let QLt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=E,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.createEditorActions=E,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=E,this.notifyIndexChanged=E,this.relayout=E,this.dispose=E,this.toJSON=E,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=E,this.onDidModelChange=M.None,this.onWillDispose=M.None,this.onDidActiveEditorChange=M.None,this.onWillCloseEditor=M.None,this.onDidCloseEditor=M.None,this.onWillMoveEditor=M.None,this.onWillOpenEditor=M.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=E,this.openEditor=E,this.openEditors=E,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=E,this.moveEditors=E,this.copyEditor=E,this.copyEditors=E,this.closeEditor=E,this.closeEditors=E,this.closeAllEditors=E,this.replaceEditors=E,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=E,this.isLast=E}get groupsView(){return E()}notifyLabelChanged(){}get titleHeight(){return E()}get element(){return E()}get scopedContextKeyService(){return Dt.get(Le)}focus(){}};const HJ=new QLt;let jLt=class{constructor(){this.windowId=si.vscodeWindowId,this.hasMaximizedGroup=()=>!1,this.onDidLayout=M.None,this.onDidScroll=M.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=E,this.isLayoutCentered=E,this.enforcePartOptions=E,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.onDidChangeGroupMaximized=M.None,this.activeGroup=HJ,this.groups=[HJ],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=E,this.getSize=E,this.setSize=E,this.arrangeGroups=E,this.toggleMaximizeGroup=E,this.toggleExpandGroup=E,this.applyLayout=E,this.getLayout=E,this.setGroupOrientation=E,this.findGroup=()=>{},this.addGroup=E,this.removeGroup=E,this.moveGroup=E,this.mergeGroup=E,this.mergeAllGroups=E,this.copyGroup=E,this.partOptions=Vae,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=E}get contentDimension(){return E()}get sideGroup(){return E()}},YLt=class{constructor(){this.registerContextKeyProvider=E,this.saveWorkingSet=E,this.getWorkingSets=E,this.applyWorkingSet=E,this.deleteWorkingSet=E,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new jLt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=E,this.createAuxiliaryEditorPart=E,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=E,this.toggleExpandGroup=E,this.partOptions=Vae,this.createEditorDropTarget=E,this._serviceBrand=void 0,this.getLayout=E,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidLayout=M.None,this.onDidScroll=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.activeGroup=HJ,this.groups=[HJ],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=E,this.getSize=E,this.setSize=E,this.arrangeGroups=E,this.applyLayout=E,this.centerLayout=E,this.isLayoutCentered=()=>!1,this.setGroupOrientation=E,this.findGroup=()=>{},this.addGroup=E,this.removeGroup=E,this.moveGroup=E,this.mergeGroup=E,this.mergeAllGroups=E,this.copyGroup=E,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=E}get contentDimension(){return E()}get sideGroup(){return E()}};ce(Po,YLt,0);ce(oLt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(_Lt,class{constructor(){this.getPart=E,this.createAuxiliaryTitlebarPart=E,this.dispose=E,this.onMenubarVisibilityChange=M.None,this.isCommandCenterVisible=!1,this.onDidChangeCommandCenterVisibility=M.None,this.registerVariables=()=>{}}updateProperties(){}},0);ce(zb,class{constructor(){this.onWillRunWorkingCopyFileOperation=M.None,this.onDidFailWorkingCopyFileOperation=M.None,this.onDidRunWorkingCopyFileOperation=M.None,this.addFileOperationParticipant=E,this.hasSaveParticipants=!1,this.addSaveParticipant=E,this.runSaveParticipants=E,this.create=E,this.createFolder=E,this.move=E,this.copy=E,this.delete=E,this.registerWorkingCopyProvider=E,this.getDirty=()=>[]}},0);ce(bf,class{constructor(){this.defaultUriScheme="file",this.fileURI=E,this.userHome=E,this.hasValidBasename=E,this.resolvedUserHome=void 0}get path(){return E()}},1);ce(Er,class{constructor(){this._serviceBrand=void 0,this.version="1.92.2",this.commit="fee1edb8d6d72a0ddff41e5f71a671c23ed924b9",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(M1t,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(Yae,class{constructor(){this.onDidChange=M.None,this.addStatus=E,this.getLanguageStatus=E}},1);ce(xc,class{constructor(){this.getPathForFile=()=>{},this.onDidChangeFullScreen=M.None,this.onDidChangeFocus=M.None,this.hasFocus=!1,this.hadLastFocus=async()=>!1,this.focus=E,this.onDidChangeActiveWindow=M.None,this.openWindow=E,this.toggleFullScreen=E,this.moveTop=E,this.getCursorScreenPoint=E,this.restart=E,this.reload=E,this.close=E,this.withExpectedShutdown=E}},0);ce(ig,class extends Nve{constructor(){super(...arguments),this.shutdown=E}},0);ce(O6,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(fs,BLt,0);ce(Oae,class{constructor(){this.onDidChangeKeyboardLayout=M.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new Rve(!1,po),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(tce,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(uXe,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=M.None}},0);let Pve=class{constructor(e){this.profileService=e,this.onDidDefaultSettingsContentChanged=M.None,this.getDefaultSettingsContent=()=>{},this.hasDefaultSettingsContent=()=>!1,this.getSetting=()=>{},this.userSettingsResource=this.profileService.currentProfile.settingsResource,this.workspaceSettingsResource=null,this.getFolderSettingsResource=E,this.createPreferencesEditorModel=E,this.resolveModel=E,this.createSettings2EditorModel=E,this.openRawDefaultSettings=E,this.openSettings=E,this.openUserSettings=E,this.openRemoteSettings=E,this.openWorkspaceSettings=E,this.openFolderSettings=E,this.openGlobalKeybindingSettings=E,this.openDefaultKeybindingsFile=E,this.getEditableSettingsURI=E,this.createSplitJsonEditorInput=E,this.openApplicationSettings=E,this.openLanguageSpecificSettings=E}};Pve=D([_(0,ug)],Pve);ce(B6,Pve,0);ce(mLt,class{constructor(){this.onDidEncounterLanguage=M.None,this.createGrammar=E,this.startDebugMode=E,this.createTokenizer=E}},0);let Fve=class{constructor(e){this.profileService=e,this.onDidResetWorkspaces=M.None,this.isEnabled=()=>!1,this.createNamedProfile=E,this.createTransientProfile=E,this.resetWorkspaces=E,this.cleanUp=E,this.cleanUpTransientProfiles=E,this.defaultProfile=this.profileService.currentProfile,this.onDidChangeProfiles=M.None,this.profiles=[this.profileService.currentProfile],this.createProfile=E,this.updateProfile=E,this.setProfileForWorkspace=E,this.getProfile=()=>this.profileService.currentProfile,this.removeProfile=E}get profilesHome(){return E()}};Fve=D([_(0,ug)],Fve);ce(Em,Fve,0);ce(HLt,class{constructor(){this.onDidChange=M.None,this.readStorageData=E,this.updateStorageData=E,this.withProfileScopedStorageService=E}},0);let Ove=class extends SLt{constructor(e){super({...cV("__default__profile__","Default",e.userRoamingDataHome,Pt(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};Ove=D([_(0,Za)],Ove);ce(ug,Ove,0);ce(bRe,uJe,0);ce(Gae,class{constructor(){this.getSnippetFiles=E,this.isEnabled=E,this.updateEnablement=E,this.updateUsageTimestamp=E,this.getSnippets=async()=>[],this.getSnippetsSync=E}},0);const JLt={getSession:()=>{},getSessions:()=>[],getBreakpoints:()=>[],areBreakpointsActivated:()=>!1,getFunctionBreakpoints:()=>[],getDataBreakpoints:()=>[],getExceptionBreakpoints:()=>[],getExceptionBreakpointsForSession:()=>[],getInstructionBreakpoints:()=>[],getWatchExpressions:()=>[],onDidChangeBreakpoints:M.None,onDidChangeCallStack:M.None,onDidChangeWatchExpressions:M.None,fetchCallstack:E,getId:E,registerBreakpointModes:E,getBreakpointModes:()=>[],onDidChangeWatchExpressionValue:M.None};class XLt{constructor(){this.setVisualizedExpression=E,this.getVisualizedExpression=()=>{},this.onDidChangeVisualization=M.None,this.getId=E,this.focusedSession=void 0,this.focusedThread=void 0,this.focusedStackFrame=void 0,this.getSelectedExpression=E,this.setSelectedExpression=E,this.updateViews=E,this.isMultiSessionView=E,this.onDidFocusSession=M.None,this.onDidFocusStackFrame=M.None,this.onDidSelectExpression=M.None,this.onDidEvaluateLazyExpression=M.None,this.onWillUpdateViews=M.None,this.onDidFocusThread=M.None,this.evaluateLazyExpression=E}}class ZLt{constructor(){this.onDidRegisterDebugger=M.None,this.hasEnabledDebuggers=()=>!1,this.getDebugAdapterDescriptor=E,this.getDebuggerLabel=E,this.someDebuggerInterestedInLanguage=()=>!1,this.getDebugger=()=>{},this.activateDebuggers=E,this.registerDebugAdapterFactory=()=>V.None,this.createDebugAdapter=E,this.registerDebugAdapterDescriptorFactory=E,this.unregisterDebugAdapterDescriptorFactory=E,this.substituteVariables=E,this.runInTerminal=E,this.getEnabledDebugger=E,this.guessDebugger=E,this.onDidDebuggersExtPointRead=M.None}}ce(XRe,class{constructor(){this.initializingOptions=void 0,this.sendBreakpoints=E,this.updateDataBreakpoint=E,this.onDidChangeState=M.None,this.onDidNewSession=M.None,this.onWillNewSession=M.None,this.onDidEndSession=M.None,this.getConfigurationManager=E,this.getAdapterManager=()=>new ZLt,this.focusStackFrame=E,this.canSetBreakpointsIn=E,this.addBreakpoints=E,this.updateBreakpoints=E,this.enableOrDisableBreakpoints=E,this.setBreakpointsActivated=E,this.removeBreakpoints=E,this.addFunctionBreakpoint=E,this.updateFunctionBreakpoint=E,this.removeFunctionBreakpoints=E,this.addDataBreakpoint=E,this.removeDataBreakpoints=E,this.addInstructionBreakpoint=E,this.removeInstructionBreakpoints=E,this.setExceptionBreakpointCondition=E,this.setExceptionBreakpointsForSession=E,this.sendAllBreakpoints=E,this.addWatchExpression=E,this.renameWatchExpression=E,this.moveWatchExpression=E,this.removeWatchExpressions=E,this.startDebugging=E,this.restartSession=E,this.stopSession=E,this.sourceIsNotAvailable=E,this.getModel=()=>JLt,this.getViewModel=()=>new XLt,this.runTo=E}get state(){return E()}},0);ce(I6,class{constructor(){this.lookupAuthorization=E,this.lookupKerberosAuthorization=E,this.request=E,this.resolveProxy=E,this.loadCertificates=E}},0);ce(vae,class{constructor(){this.onDidInitiateOpenFilesTrustRequest=M.None,this.onDidInitiateWorkspaceTrustRequest=M.None,this.onDidInitiateWorkspaceTrustRequestOnStartup=M.None,this.completeOpenFilesTrustRequest=E,this.requestOpenFilesTrust=async()=>1,this.cancelWorkspaceTrustRequest=E,this.completeWorkspaceTrustRequest=E,this.requestWorkspaceTrust=async()=>!0,this.requestWorkspaceTrustOnStartup=()=>null}},0);ce(sLt,class{constructor(){this.onDidChangeActivity=M.None,this.getViewContainerActivities=E,this.getActivity=E,this.showViewContainerActivity=()=>V.None,this.showViewActivity=()=>V.None,this.showAccountsActivity=()=>V.None,this.showGlobalActivity=()=>V.None}},0);ce(lJe,class{constructor(){this.reload=E,this.onReload=M.None,this.close=E,this.onClose=M.None,this.attachSession=E,this.onAttachSession=M.None,this.terminateSession=E,this.onTerminateSession=M.None,this.openExtensionDevelopmentHostWindow=E}},0);ce(Lm,class{constructor(){this.getFocusedViewName=E,this.onDidChangeFocusedView=M.None,this.onDidChangeViewContainerVisibility=M.None,this.isViewContainerVisible=()=>!1,this.openViewContainer=E,this.closeViewContainer=E,this.getVisibleViewContainer=E,this.getActiveViewPaneContainerWithId=()=>null,this.onDidChangeViewVisibility=M.None,this.isViewVisible=()=>!1,this.openView=async()=>null,this.closeView=E,this.getActiveViewWithId=()=>null,this.getViewWithId=()=>null,this.getViewProgressIndicator=()=>{}}},0);ce(xm,class{constructor(){this.viewContainers=[],this.onDidChangeViewContainers=M.None,this.getDefaultViewContainer=()=>{},this.getViewContainerById=()=>null,this.isViewContainerRemovedPermanently=E,this.getDefaultViewContainerLocation=()=>null,this.getViewContainerLocation=()=>null,this.getViewContainersByLocation=E,this.getViewContainerModel=()=>({onDidChangeAllViewDescriptors:M.None,visibleViewDescriptors:[]}),this.onDidChangeContainerLocation=M.None,this.moveViewContainerToLocation=E,this.getViewContainerBadgeEnablementState=E,this.setViewContainerBadgeEnablementState=E,this.getViewDescriptorById=()=>null,this.getViewContainerByViewId=()=>null,this.getDefaultContainerById=()=>null,this.getViewLocationById=()=>null,this.onDidChangeContainer=M.None,this.moveViewsToContainer=E,this.onDidChangeLocation=M.None,this.moveViewToLocation=()=>null,this.reset=()=>null}},0);ce(cLt,class{constructor(){this.suspendTracking=()=>({dispose(){}}),this.goForward=E,this.goBack=E,this.goPrevious=E,this.goLast=E,this.reopenLastClosedEditor=E,this.getHistory=()=>[],this.removeFromHistory=E,this.getLastActiveWorkspaceRoot=()=>{},this.getLastActiveFile=()=>{},this.openNextRecentlyUsedEditor=E,this.openPreviouslyUsedEditor=E,this.clear=E,this.clearRecentlyOpened=E}},0);ce(UJe,class{constructor(){this.onDidChangeTaskConfig=M.None,this.onDidStateChange=M.None,this.supportsMultipleTaskExecutions=!1,this.configureAction=E,this.run=E,this.inTerminal=()=>!1,this.getActiveTasks=async()=>[],this.getBusyTasks=E,this.terminate=E,this.tasks=E,this.taskTypes=E,this.getWorkspaceTasks=E,this.getSavedTasks=E,this.removeRecentlyUsedTask=E,this.getTask=E,this.tryResolveTask=E,this.createSorter=E,this.getTaskDescription=E,this.customize=E,this.openConfig=E,this.registerTaskProvider=E,this.registerTaskSystem=()=>{},this.onDidChangeTaskSystemInfo=M.None,this.hasTaskSystemInfo=!1,this.registerSupportedExecutions=()=>{},this.extensionCallbackTaskComplete=E,this.isReconnected=!1,this.onDidReconnectToTasks=M.None}},0);ce(oMe,class{constructor(){this.resolveWithEnvironment=E,this.resolveAsync=E,this.resolveAnyAsync=E,this.resolveAnyMap=E,this.resolveWithInteractionReplace=E,this.resolveWithInteraction=E,this.contributeVariable=E}},0);ce(hg,class{constructor(){this.endConnection=E,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(cht,B1t,0);let Bve=class{constructor(e){this.modelService=e,this.aiTextSearch=E,this.textSearchSplitSyncAsync=E,this.registerSearchResultProvider=E}async textSearch(){return{results:[],messages:[]}}async fileSearch(){return{results:this.modelService.getModels().map(e=>({resource:e.uri})),messages:[]}}async clearCache(){}};Bve=D([_(0,gi)],Bve);ce(Zae,Bve,0);ce($Re,class{constructor(){this.registerEditSessionIdentityProvider=()=>V.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>V.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce(iC,class{constructor(){this.addFolders=E,this.removeFolders=E,this.updateFolders=E,this.enterWorkspace=E,this.createAndEnterWorkspace=E,this.saveAndEnterWorkspace=E,this.copyWorkspaceSettings=E,this.pickNewWorkspacePath=E}},0);ce(gXe,class{constructor(){this.getStartTime=E,this.whenReady=E,this.setPerformanceMarks=()=>{},this.getPerformanceMarks=E,this.getDuration=E}get perfBaseline(){return E()}get startupMetrics(){return E()}},0);ce(Xo,class{constructor(){this.shouldRequireConsentToUpdate=async()=>{},this.updateAutoUpdateValue=E,this.getResourceExtensions=E,this.updateRunningExtensions=E,this.togglePreRelease=E,this.isAutoUpdateEnabledFor=E,this.updateAutoUpdateEnablementFor=E,this.isAutoUpdateEnabled=E,this.getAutoUpdateValue=E,this.updateAll=E,this.toggleApplyExtensionToAllProfiles=E,this.whenInitialized=Promise.resolve(),this.onChange=M.None,this.onReset=M.None,this.preferPreReleases=!1,this.local=[],this.installed=[],this.outdated=[],this.queryLocal=E,this.queryGallery=E,this.getExtensions=E,this.canInstall=E,this.install=E,this.installInServer=E,this.uninstall=E,this.installVersion=E,this.reinstall=E,this.canSetLanguage=E,this.setLanguage=E,this.setEnablement=E,this.pinExtension=E,this.open=E,this.checkForUpdates=E,this.getExtensionStatus=E,this.isExtensionIgnoredToSync=E,this.toggleExtensionIgnoredToSync=E}},0);ce(dv,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=E,this.getExtensionInstallLocation=E}},0);ce(aXe,class{constructor(){this.onDidChangeRecommendations=M.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(iTt,class{constructor(){this.onError=M.None,this.turnOn=E,this.turnOff=E,this.triggerSync=E}},0);ce(Y1t,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=E,this.updateSynchronizedExtensions=E}},0);ce(P1t,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=E,this.promptWorkspaceRecommendations=E}},0);ce(rMe,class{constructor(){this.scanSystemExtensions=async()=>[],this.scanUserExtensions=async()=>[],this.scanExtensionsUnderDevelopment=async()=>[],this.scanExistingExtension=async()=>null,this.addExtension=E,this.addExtensionFromGallery=E,this.removeExtension=async()=>{},this.copyExtensions=async()=>{},this.updateMetadata=E,this.scanExtensionManifest=async()=>null}},0);ce(N1t,class{constructor(){this.onDidChangeCache=M.None,this.getTargetPlatform=E,this.scanAllExtensions=E,this.scanSystemExtensions=E,this.scanUserExtensions=E,this.scanExtensionsUnderDevelopment=E,this.scanExistingExtension=E,this.scanOneOrMultipleExtensions=E,this.scanMultipleExtensions=E,this.scanMetadata=E,this.updateMetadata=E,this.initializeDefaultProfileExtensions=E}get systemExtensionsLocation(){return E()}get userExtensionsLocation(){return E()}},0);ce(Pae,class{constructor(){this.onAddExtensions=M.None,this.onDidAddExtensions=M.None,this.onRemoveExtensions=M.None,this.onDidRemoveExtensions=M.None,this.scanProfileExtensions=E,this.addExtensionsToProfile=E,this.updateMetadata=E,this.removeExtensionFromProfile=E}},0);ce(jae,class{constructor(){this.onDidChangeIgnoredRecommendations=M.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=M.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=E}},0);ce(aLt,class{constructor(){this.onDidChangeExtensionsConfigs=M.None,this.getExtensionsConfigs=E,this.getRecommendations=E,this.getUnwantedRecommendations=E,this.toggleRecommendation=E,this.toggleUnwantedRecommendation=E}},0);ce(Nl,class{constructor(){this.getEnablementStates=e=>e.map(()=>8),this.onEnablementChanged=M.None,this.getEnablementState=()=>8,this.getDependenciesEnablementStates=()=>[],this.canChangeEnablement=()=>!1,this.canChangeWorkspaceEnablement=()=>!1,this.isEnabled=()=>!0,this.isEnabledEnablementState=()=>!0,this.isDisabledGlobally=()=>!1,this.setEnablement=E,this.updateExtensionsEnablementsWhenWorkspaceTrustChanges=E}},0);ce(Hae,class{constructor(){this.canChangeProtocol=!1,this.tunnels=Promise.resolve([]),this.canChangePrivacy=!1,this.privacyOptions=[],this.onTunnelOpened=M.None,this.onTunnelClosed=M.None,this.canElevate=!1,this.hasTunnelProvider=!1,this.onAddedTunnelProvider=M.None,this.canTunnel=()=>!1,this.openTunnel=E,this.getExistingTunnel=async()=>{},this.setEnvironmentTunnel=E,this.closeTunnel=E,this.setTunnelProvider=E,this.setTunnelFeatures=E,this.isPortPrivileged=()=>!1}},0);ce(_d,class{constructor(){this.onDidChangeAutoSaveConfiguration=M.None,this.onDidChangeAutoSaveDisabled=M.None,this.hasShortAutoSaveDelay=()=>!1,this.disableAutoSave=E,this.onDidChangeReadonly=M.None,this.onDidChangeFilesAssociation=M.None,this.onAutoSaveConfigurationChange=M.None,this.getAutoSaveConfiguration=E,this.getAutoSaveMode=E,this.toggleAutoSave=E,this.onReadonlyChange=M.None,this.isReadonly=E,this.updateReadonly=E,this.onFilesAssociationChange=M.None,this.isHotExitEnabled=!0,this.hotExitConfiguration=void 0,this.preventSaveConflicts=E}},0);ce(W6,class{constructor(){this.onDidCreate=M.None,this.canDispose=()=>!0,this.isUntitledWithAssociatedResource=()=>!1,this.onDidChangeDirty=M.None,this.onDidChangeEncoding=M.None,this.onDidChangeLabel=M.None,this.onWillDispose=M.None,this.create=E,this.get=()=>{},this.getValue=()=>{},this.resolve=E}},0);ce(H6,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Rm,class{constructor(){this.onDidRegister=M.None,this.onDidUnregister=M.None,this.onDidChangeDirty=M.None,this.onDidChangeContent=M.None,this.onDidSave=M.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 V.None}},0);ce(iE,class{constructor(){this.onDidChangeDecorations=M.None,this.registerDecorationsProvider=E,this.getDecoration=()=>{}}},0);ce(F6,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=E}},0);ce(ag,class{constructor(){this.preferredHome=E,this.defaultFilePath=E,this.defaultFolderPath=E,this.defaultWorkspacePath=E,this.pickFileFolderAndOpen=E,this.pickFileAndOpen=E,this.pickFolderAndOpen=E,this.pickWorkspaceAndOpen=E,this.pickFileToSave=E,this.showSaveDialog=E,this.showSaveConfirm=E,this.showOpenDialog=E}},0);ce(DI,class{constructor(){this.write=E}},1);ce(xI,class{constructor(){this.enterWorkspace=E,this.createUntitledWorkspace=E,this.deleteUntitledWorkspace=E,this.getWorkspaceIdentifier=E,this.onDidChangeRecentlyOpened=M.None,this.addRecentlyOpened=E,this.removeRecentlyOpened=E,this.clearRecentlyOpened=E,this.getRecentlyOpened=E,this.getDirtyWorkspaces=E}},1);ce(ece,class{constructor(){this.createTextEditor=E,this.resolveTextEditor=E}},0);ce(BU,class{constructor(){this.getAllUserAssociations=E,this.getAssociationsForResource=E,this.updateUserAssociations=E,this.onDidChangeEditorRegistrations=M.None,this.bufferChangeEvents=E,this.resolveEditor=E,this.getEditors=()=>[]}registerEditor(){return{dispose:()=>{}}}},0);ce(Jae,class{constructor(){this.onActiveOutputChannel=M.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(HTt,class{constructor(){this.createOutputChannelModel=E}},1);ce(Fae,class{constructor(){this.readExtensionResource=E,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=E}},0);ce(F1t,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(vf,class{constructor(){this.roots=[],this.getContext=E,this.hasViewFocus=E,this.setEditable=E,this.getEditable=E,this.getEditableData=E,this.isEditable=E,this.findClosest=E,this.findClosestRoot=E,this.refresh=E,this.setToCopy=E,this.isCut=E,this.applyBulkEdit=E,this.select=E,this.registerView=E}get sortOrderConfiguration(){return E()}},1);ce(N3,class{constructor(){this.getExtensionState=()=>{},this.getExtensionStateRaw=()=>{},this.setExtensionState=E,this.onDidChangeExtensionStorageToSync=M.None,this.setKeysForSync=E,this.getKeysForSync=()=>{},this.addToMigrationList=E,this.getSourceExtensionToMigrate=()=>{}}},1);ce(dJe,class{constructor(){this.onDidChangeEnablement=M.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(hJe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=KLt(t)?.[e];return i!=null?N.parse(i):void 0}},1);ce(Nae,class{constructor(){this.removeDragOperationTransfer=E,this.addDragOperationTransfer=E}},1);ce(kTt,class{constructor(){this.register=E,this.getWidget=()=>{}}},0);ce(hXe,class{constructor(){this.onDidChange=M.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=E}},0);ce(pJe,class{constructor(){this.onStateChange=M.None,this.state=j1t.Uninitialized,this.checkForUpdates=E,this.downloadUpdate=E,this.applyUpdate=E,this.quitAndInstall=E,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=E}},0);ce(QRe,class{constructor(){this.getPart=E,this.createAuxiliaryStatusbarPart=E,this.createScoped=E,this.dispose=E,this.onDidChangeEntryVisibility=M.None,this.addEntry=()=>({dispose:()=>{},update:()=>{}}),this.isEntryVisible=()=>!1,this.updateEntryVisibility=()=>{},this.focus=()=>{},this.focusNextEntry=()=>{},this.focusPreviousEntry=()=>{},this.isEntryFocused=()=>!1,this.overrideStyle=()=>V.None}},0);ce(EI,class{constructor(){this.isEnabled=()=>!1,this.query=E,this.getExtensions=E,this.isExtensionCompatible=E,this.getCompatibleExtension=E,this.getAllCompatibleVersions=E,this.download=E,this.downloadSignatureArchive=E,this.reportStatistic=E,this.getReadme=E,this.getManifest=E,this.getChangelog=E,this.getCoreTranslation=E,this.getExtensionsControlManifest=E}},0);ce(OU,class{constructor(){this.revealTerminal=E,this.focusInstance=E,this.onAnyInstanceData=M.None,this.moveIntoNewEditor=E,this.detachedInstances=[],this.onAnyInstanceDataInput=M.None,this.onAnyInstanceIconChange=M.None,this.onAnyInstanceMaximumDimensionsChange=M.None,this.onAnyInstancePrimaryStatusChange=M.None,this.onAnyInstanceProcessIdReady=M.None,this.onAnyInstanceSelectionChange=M.None,this.onAnyInstanceTitleChange=M.None,this.createDetachedTerminal=E,this.onDidChangeSelection=M.None,this.detachedXterms=[],this.whenConnected=Promise.resolve(),this.restoredGroupCount=0,this.createDetachedXterm=E,this.instances=[],this.revealActiveTerminal=E,this.isProcessSupportRegistered=!1,this.connectionState=1,this.defaultLocation=fW.Panel,this.onDidChangeActiveGroup=M.None,this.onDidDisposeGroup=M.None,this.onDidCreateInstance=M.None,this.onDidReceiveProcessId=M.None,this.onDidChangeInstanceDimensions=M.None,this.onDidMaximumDimensionsChange=M.None,this.onDidRequestStartExtensionTerminal=M.None,this.onDidChangeInstanceTitle=M.None,this.onDidChangeInstanceIcon=M.None,this.onDidChangeInstanceColor=M.None,this.onDidChangeInstancePrimaryStatus=M.None,this.onDidInputInstanceData=M.None,this.onDidRegisterProcessSupport=M.None,this.onDidChangeConnectionState=M.None,this.createTerminal=E,this.getInstanceFromId=E,this.getInstanceFromIndex=E,this.getReconnectedTerminals=()=>{},this.getActiveOrCreateInstance=E,this.moveToEditor=E,this.moveToTerminalView=E,this.getPrimaryBackend=E,this.refreshActiveGroup=E,this.registerProcessSupport=()=>{},this.showProfileQuickPick=E,this.setContainers=E,this.requestStartExtensionTerminal=E,this.isAttachedToTerminal=E,this.getEditableData=E,this.setEditable=E,this.isEditable=E,this.safeDisposeTerminal=E,this.getDefaultInstanceHost=E,this.getInstanceHost=E,this.resolveLocation=E,this.setNativeDelegate=E,this.toggleEscapeSequenceLogging=E,this.getEditingTerminal=E,this.setEditingTerminal=E,this.activeInstance=void 0,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}createOnInstanceCapabilityEvent(){return{event:M.None,dispose(){}}}createOnInstanceEvent(e){return new Yrt(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return E()}},1);ce(QTt,class{constructor(){this.onConfigChanged=M.None,this.setPanelContainer=E,this.configFontIsMonospace=E,this.getFont=E}get config(){return E()}},1);ce(VJe,class{constructor(){this.focusInstance=E,this.instances=[],this.openEditor=E,this.detachActiveEditorInstance=E,this.detachInstance=E,this.splitInstance=E,this.revealActiveEditor=E,this.resolveResource=E,this.reviveInput=E,this.getInputFromResource=E,this.activeInstance=void 0,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}},1);ce(iMe,class{constructor(){this.focusInstance=E,this.lastAccessedMenu="inline-tab",this.instances=[],this.groups=[],this.activeGroup=void 0,this.activeGroupIndex=0,this.onDidChangeActiveGroup=M.None,this.onDidDisposeGroup=M.None,this.onDidChangeGroups=M.None,this.onDidShow=M.None,this.onDidChangePanelOrientation=M.None,this.createGroup=E,this.getGroupForInstance=E,this.moveGroup=E,this.moveGroupToEnd=E,this.moveInstance=E,this.unsplitInstance=E,this.joinInstances=E,this.instanceIsSplit=E,this.getGroupLabels=E,this.setActiveGroupByIndex=E,this.setActiveGroupToNext=E,this.setActiveGroupToPrevious=E,this.setActiveInstanceByIndex=E,this.setContainer=E,this.showPanel=E,this.hidePanel=E,this.focusTabs=E,this.focusHover=E,this.showTabs=E,this.updateVisibility=E,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}},1);ce(zJe,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=M.None,this.convertProfileToShellLaunchConfig=E,this.createInstance=E,this.getBackend=E,this.didRegisterBackend=E}},1);ce(KJe,class{constructor(){this.availableProfiles=[],this.contributedProfiles=[],this.profilesReady=Promise.resolve(),this.getPlatformKey=E,this.refreshAvailableProfiles=E,this.getDefaultProfileName=()=>{},this.getDefaultProfile=()=>{},this.onDidChangeAvailableProfiles=M.None,this.getContributedDefaultProfile=E,this.registerContributedProfile=E,this.getContributedProfileProvider=E,this.registerTerminalProfileProvider=E}},1);ce(Q1t,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(qJe,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=M.None,this.onDidRemoveLinkProvider=M.None,this.registerLinkProvider=E}},1);ce(jTt,class{constructor(){this.terminalProfiles=[]}},1);ce(GJe,class{constructor(){this.resolveIcon=E,this.resolveShellLaunchConfig=E,this.getDefaultProfile=async()=>({profileName:"bash",path:"/bin/bash",isDefault:!0}),this.getDefaultShell=E,this.getDefaultShellArgs=E,this.getDefaultIcon=E,this.getEnvironment=E,this.createProfileFromShellAndShellArgs=E}},1);ce($Je,class{constructor(){this.collections=new Map,this.onDidChangeCollections=M.None,this.set=E,this.delete=E}get mergedCollection(){return E()}},1);ce(QJe,class{constructor(){this.onDidRegisterProvider=M.None,this.onDidRegisterCommandSelector=M.None,this.onDidUnregisterProvider=M.None,this.extensionQuickFixes=Promise.resolve([]),this.providers=new Map,this.registerQuickFixProvider=E,this.registerCommandSelector=E}},1);ce(ALt,class{constructor(){this.enabled=!1,this.authenticationProviders=[],this.all=[],this.current=void 0,this.accountStatus="unavailable",this.onDidChangeAccountStatus=M.None,this.turnOn=E,this.turnoff=E,this.signIn=E,this.resetSyncedData=E,this.showSyncActivity=E,this.syncNow=E,this.synchroniseUserDataSyncStoreType=E,this.showConflicts=E,this.accept=E,this.getAllLogResources=E,this.downloadSyncActivity=E}},1);ce(mJe,class{constructor(){this.onDidChangeEnablement=M.None,this.isEnabled=()=>!1,this.canToggleEnablement=()=>!1,this.setEnablement=E,this.onDidChangeResourceEnablement=M.None,this.isResourceEnabled=()=>!1,this.setResourceEnablement=E,this.getResourceSyncStateVersion=()=>{}}},1);ce(uLt,class{constructor(){this.addKeybinding=E,this.editKeybinding=E,this.removeKeybinding=E,this.resetKeybinding=E}},1);ce(UTt,class{constructor(){this.getLocalSearchProvider=E,this.getRemoteSearchProvider=E}},1);ce(tE,class{constructor(){this.tryGetDataProviderSync=()=>{},this.canResolve=async()=>!1,this.onAddViewType=M.None,this.onWillRemoveViewType=M.None,this.onDidChangeOutputRenderers=M.None,this.onWillAddNotebookDocument=M.None,this.onDidAddNotebookDocument=M.None,this.onWillRemoveNotebookDocument=M.None,this.onDidRemoveNotebookDocument=M.None,this.registerNotebookSerializer=E,this.withNotebookDataProvider=E,this.getOutputMimeTypeInfo=E,this.getViewTypeProvider=()=>{},this.getRendererInfo=()=>{},this.getRenderers=()=>[],this.getStaticPreloads=E,this.updateMimePreferredRenderer=E,this.saveMimeDisplayOrder=E,this.createNotebookTextModel=E,this.getNotebookTextModel=()=>{},this.getNotebookTextModels=E,this.listNotebookDocuments=()=>[],this.registerContributedNotebookType=E,this.getContributedNotebookType=E,this.getContributedNotebookTypes=()=>[],this.getNotebookProviderResourceRoots=()=>[],this.setToCopy=E,this.getToCopy=E,this.clearEditorCache=E}},1);ce(VTt,class{constructor(){this.replace=E,this.openReplacePreview=E,this.updateReplacePreview=E}},1);ce(GTt,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.load=E,this.save=E}},1);ce(R6,class{constructor(){this.retrieveWidget=E,this.retrieveExistingWidgetFromURI=()=>{},this.retrieveAllExistingWidgets=()=>[],this.onDidAddNotebookEditor=M.None,this.onDidRemoveNotebookEditor=M.None,this.addNotebookEditor=E,this.removeNotebookEditor=E,this.getNotebookEditor=()=>{},this.listNotebookEditors=()=>[]}},1);ce(zTt,class{get searchModel(){return E()}},1);ce($ae,class{constructor(){this.onDidSaveNotebook=M.None,this.onDidChangeDirty=M.None,this.onWillFailWithConflict=M.None,this.isDirty=E,this.resolve=E}},1);ce(pXe,class{constructor(){this.onDidRegisterHandler=M.None,this.registerHandler=()=>V.None,this.findEditor=()=>{}}},1);ce(aMe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=M.None,this.markActive=E}},1);ce(zRe,class{constructor(){this.registerCanonicalUriProvider=E}},1);ce(jRe,class{constructor(){this.onDidChange=M.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(tXe,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(km,class{constructor(){this.adoptRequest=E,this.isEnabled=()=>!1,this.resendRequest=E,this.clearAllHistoryEntries=E,this.onDidSubmitAgent=M.None,this.hasSessions=()=>!1,this.onDidDisposeSession=M.None,this.transferredSessionData=void 0,this.onDidSubmitSlashCommand=M.None,this.getSessionId=()=>{},this.transferredSessionId=void 0,this.transferChatSession=E,this.registerSlashCommandProvider=E,this.getProviderInfos=()=>[],this.startSession=E,this.getSession=()=>{},this.getOrRestoreSession=()=>{},this.loadSessionFromContent=()=>{},this.sendRequest=E,this.removeRequest=E,this.cancelCurrentRequestForSession=E,this.getSlashCommands=E,this.clearSession=E,this.addRequest=E,this.addCompleteRequest=E,this.sendRequestToProvider=E,this.getHistory=()=>[],this.removeHistoryEntry=E,this.onDidPerformUserAction=M.None,this.notifyUserAction=E}},1);ce(_Xe,class{constructor(){this.update=E}},1);ce(ITt,class{constructor(){this.focused=!1,this.onDidClose=M.None,this.enabled=!1,this.toggle=E,this.focus=E,this.open=E,this.close=E,this.openInChatView=E}},1);ce(_f,class{constructor(){this._serviceBrand=void 0,this.agentHasDupeName=()=>!1,this.registerAgentCompletionProvider=E,this.getAgentCompletionItems=E,this.getAgentByFullyQualifiedId=E,this.getContributedDefaultAgent=()=>{},this.registerAgentImplementation=E,this.registerDynamicAgent=E,this.getActivatedAgents=()=>[],this.getAgentsByName=()=>[],this.getFollowups=E,this.getDefaultAgent=E,this.getSecondaryAgent=E,this.updateAgent=E,this.onDidChangeAgents=M.None,this.registerAgentData=E,this.registerAgentCallback=E,this.registerAgent=E,this.invokeAgent=E,this.getAgents=E,this.getAgent=E,this.hasAgent=E}},1);ce(zae,class{getAgentNameRestriction(){return!0}},1);ce(pLt,class{constructor(){this.onDidCreateTerminal=M.None,this.createTerminal=E}},1);ce(JRe,class{constructor(){this.getCustomEditor=E,this.getAllCustomEditors=E,this.getContributedCustomEditors=E,this.getUserConfiguredCustomEditors=E,this.registerCustomEditorCapabilities=()=>V.None,this.getCustomEditorCapabilities=()=>{}}get models(){return E()}},1);ce(qae,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=M.None,this.createWebviewElement=E,this.createWebviewOverlay=E}},1);ce(ZJe,class{constructor(){this.onNewResolverRegistered=M.None,this.register=E,this.resolve=E}},1);ce(lXe,class{constructor(){this.setLocale=E}clearLocalePreference(){return Promise.resolve()}},1);ce(N6,class{constructor(){this.onDidChangeActiveWebviewEditor=M.None,this.openWebview=E,this.openRevivedWebview=E,this.revealWebview=E,this.registerResolver=()=>V.None,this.shouldPersist=E,this.resolveWebview=E}get iconManager(){return E()}},1);ce(pC,class{constructor(){this.onDidChangeConnectionData=M.None,this.resolveAuthority=E,this.getConnectionData=E,this.getCanonicalURI=E,this._clearResolvedAuthority=E,this._setResolvedAuthority=E,this._setResolvedAuthorityError=E,this._setAuthorityConnectionToken=E,this._setCanonicalURIProvider=E}},1);ce(LJe,class{constructor(){this.registerExternalOpenerProvider=()=>V.None,this.getOpener=async()=>{}}},1);ce(Dm,class{constructor(){this.configureKeybindings=E,this.openHelpLink=E,this.navigateToCodeBlock=E,this.getCodeBlockContext=()=>{},this.showLastProvider=E,this.showAccessibleViewHelp=E,this.goToSymbol=E,this.disableHint=E,this.next=E,this.previous=E,this.getOpenAriaHint=E,this.show=E,this.registerProvider=E,this.getPosition=E,this.setPosition=E,this.getLastPosition=E}},1);ce(WLt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(P6,class{constructor(){this.uninstallExtensions=E,this.resetPinnedStateForAllUserExtensions=E,this.getInstalledWorkspaceExtensionLocations=()=>[],this.onDidEnableExtensions=M.None,this.isWorkspaceExtensionsSupported=()=>!1,this.getExtensions=async()=>[],this.getInstalledWorkspaceExtensions=async()=>[],this.installResourceExtension=E,this.toggleAppliationScope=async e=>e,this.onInstallExtension=M.None,this.onDidInstallExtensions=M.None,this.onUninstallExtension=M.None,this.onDidUninstallExtension=M.None,this.onDidChangeProfile=M.None,this.installVSIX=E,this.installFromLocation=E,this.updateFromGallery=E,this.onDidUpdateExtensionMetadata=M.None,this.zip=E,this.unzip=E,this.getManifest=E,this.install=E,this.canInstall=E,this.installFromGallery=E,this.installGalleryExtensions=E,this.installExtensionsFromProfile=E,this.uninstall=E,this.reinstallFromGallery=E,this.getInstalled=async()=>[],this.getExtensionsControlManifest=E,this.copyExtensions=E,this.updateMetadata=E,this.download=E,this.registerParticipant=E,this.getTargetPlatform=E,this.cleanUp=E}},1);ce(Im,class{constructor(){this.prefersExecuteOnUI=E,this.prefersExecuteOnWorkspace=E,this.prefersExecuteOnWeb=E,this.canExecuteOnUI=E,this.canExecuteOnWorkspace=E,this.canExecuteOnWeb=E,this.getExtensionKind=E,this.getUserConfiguredExtensionKind=E,this.getExtensionUntrustedWorkspaceSupportType=E,this.getExtensionVirtualWorkspaceSupportType=E}},1);ce(_ae,class{isWorkspaceTrustEnabled(){return!1}},1);ce(Bae,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(Uae,class{constructor(){this.create=E,this.open=async()=>!1,this.registerHandler=E}},1);ce(URe,class{constructor(){this.register=E,this.connect=E}},1);ce(M6,class{constructor(){this.onDidChangeQuickDiffProviders=M.None,this.addQuickDiffProvider=E,this.getQuickDiffs=E}},1);ce(tMe,class{constructor(){this.onDidChangeInputValueProviders=M.None,this.getDefaultInputValueProvider=E,this.registerSCMInputValueProvider=E,this.onDidAddRepository=M.None,this.onDidRemoveRepository=M.None,this.repositories=[],this.repositoryCount=0,this.registerSCMProvider=E,this.getRepository=E}},1);ce(HRe,class{constructor(){this.download=E}},1);ce(cXe,class{constructor(){this.registerExtensionHandler=E,this.unregisterExtensionHandler=E}},1);ce(eE,class{constructor(){this.resourceHasCommentingRanges=()=>!1,this.onDidChangeActiveEditingCommentThread=M.None,this.setActiveEditingCommentThread=E,this.setActiveCommentAndThread=E,this.onDidSetResourceCommentInfos=M.None,this.onDidSetAllCommentThreads=M.None,this.onDidUpdateCommentThreads=M.None,this.onDidUpdateNotebookCommentThreads=M.None,this.onDidChangeActiveCommentThread=M.None,this.onDidChangeCurrentCommentThread=M.None,this.onDidUpdateCommentingRanges=M.None,this.onDidChangeActiveCommentingRange=M.None,this.onDidSetDataProvider=M.None,this.onDidDeleteDataProvider=M.None,this.onDidChangeCommentingEnabled=M.None,this.isCommentingEnabled=!1,this.setDocumentComments=E,this.setWorkspaceComments=E,this.removeWorkspaceComments=E,this.registerCommentController=E,this.unregisterCommentController=()=>{},this.getCommentController=E,this.createCommentThreadTemplate=E,this.updateCommentThreadTemplate=E,this.getCommentMenus=E,this.updateComments=E,this.updateNotebookComments=E,this.disposeCommentThread=E,this.getDocumentComments=async()=>[],this.getNotebookComments=async()=>[],this.updateCommentingRanges=E,this.hasReactionHandler=E,this.toggleReaction=E,this.setActiveCommentThread=E,this.setCurrentCommentThread=E,this.enableCommenting=E,this.registerContinueOnCommentProvider=E,this.removeContinueOnComment=E}get commentsModel(){return E()}},1);ce(PJe,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeItems=M.None,this.registerCellStatusBarItemProvider=E,this.getStatusBarItemsForCell=E}},1);ce(OJe,class{constructor(){this.onDidNotebookVariablesUpdate=M.None,this.notifyVariablesChange=E,this.onDidAddKernel=M.None,this.onDidRemoveKernel=M.None,this.onDidChangeSelectedNotebooks=M.None,this.onDidChangeNotebookAffinity=M.None,this.registerKernel=E,this.getMatchingKernel=E,this.getSelectedOrSuggestedKernel=E,this.selectKernelForNotebook=E,this.preselectKernelForNotebook=E,this.updateKernelNotebookAffinity=E,this.onDidChangeKernelDetectionTasks=M.None,this.registerNotebookKernelDetectionTask=E,this.getKernelDetectionTasks=E,this.onDidChangeSourceActions=M.None,this.getSourceActions=E,this.getRunningSourceActions=E,this.registerKernelSourceActionProvider=E,this.getKernelSourceActions2=E}},1);ce(BJe,class{constructor(){this.onShouldPostMessage=M.None,this.prepare=E,this.getScoped=E,this.receiveMessage=E}},1);ce(MJe,class{constructor(){this.addToHistory=E,this.getPreviousValue=E,this.getNextValue=E,this.replaceLast=E,this.clearHistory=E,this.has=E}},1);ce(eMe,class{constructor(){this.onWillAddInteractiveDocument=M.None,this.onWillRemoveInteractiveDocument=M.None,this.willCreateInteractiveDocument=E,this.willRemoveInteractiveDocument=E}},1);ce(fLt,class{async getExtensionIdProvidingCurrentLocale(){return qLt()}},0);ce(vLt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=E}},0);ce(WU,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=E,this.next=E,this.reset=E}},0);ce(oTt,class{constructor(){this.onTokenFailed=M.None,this.account=void 0,this.onDidChangeAccount=M.None}updateAccount(){return Promise.resolve()}},0);ce(UN,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=E,this.getWidgetByInputUri=E}},1);ce(Xae,class{constructor(){this.onDidChangeHelpInformation=M.None,this.onDidChangeTargetType=M.None,this.targetType=[],this.onDidChangeEditable=M.None,this.setEditable=E,this.getEditableData=E,this.forward=E,this.close=E,this.setTunnelInformation=E,this.setCandidateFilter=E,this.onFoundNewCandidates=E,this.restore=E,this.enablePortsFeatures=E,this.onEnabledPortsFeatures=M.None,this.portsFeaturesEnabled=!1,this.namedProcesses=new Map}get helpInformation(){return E()}get tunnelModel(){return E()}},1);ce(sMe,class{constructor(){this.getAccounts=async()=>[],this.onDidRegisterAuthenticationProvider=M.None,this.onDidUnregisterAuthenticationProvider=M.None,this.onDidChangeSessions=M.None,this.onDidChangeDeclaredProviders=M.None,this.declaredProviders=[],this.registerDeclaredAuthenticationProvider=E,this.unregisterDeclaredAuthenticationProvider=E,this.isAuthenticationProviderRegistered=()=>!1,this.registerAuthenticationProvider=E,this.unregisterAuthenticationProvider=E,this.getProviderIds=()=>[],this.getProvider=E,this.getSessions=E,this.createSession=E,this.removeSession=E}},1);ce(Qae,class{constructor(){this.onDidChangeExtensionSessionAccess=M.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=E,this.removeAllowedExtensions=E}},1);ce(nXe,class{constructor(){this.updateSessionPreference=E,this.getSessionPreference=()=>{},this.removeSessionPreference=E,this.selectSession=E,this.requestSessionAccess=E,this.requestNewSession=E}},1);ce(iXe,class{constructor(){this.readAccountUsages=E,this.removeAccountUsage=E,this.addAccountUsage=E}},1);ce(XJe,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeTimeline=M.None,this.onDidChangeUri=M.None,this.registerTimelineProvider=E,this.unregisterTimelineProvider=E,this.getSources=()=>[],this.getTimeline=E,this.setUri=E}},1);ce(JJe,class{constructor(){this.getTestsRelatedToCode=async()=>[],this.getCodeRelatedToTest=async()=>[],this.registerExtHost=()=>V.None,this.provideTestFollowups=E,this.onDidCancelTestRun=M.None,this.onWillProcessDiff=M.None,this.onDidProcessDiff=M.None,this.registerTestController=E,this.getTestController=()=>{},this.refreshTests=E,this.cancelRefreshTests=E,this.startContinuousRun=E,this.runTests=E,this.runResolvedTests=E,this.syncTests=E,this.cancelTestRun=E,this.publishDiff=E}get excluded(){return E()}get collection(){return E()}get showInlineOutput(){return E()}},1);ce(gJe,class{constructor(){this.onDidChangeSecret=M.None,this.type="in-memory",this.get=async()=>{},this.set=E,this.delete=E}},1);ce(HJe,class{constructor(){this.registerShareProvider=E,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(fXe,class{constructor(){this.createProfileFromTemplate=async()=>{},this.resolveProfileTemplate=async()=>null,this.exportProfile2=E,this.createFromProfile=E,this.createProfile=E,this.editProfile=E,this.registerProfileContentHandler=()=>V.None,this.unregisterProfileContentHandler=()=>{},this.exportProfile=E,this.importProfile=E,this.showProfileContents=E,this.createFromCurrentProfile=E,this.createTroubleshootProfile=E,this.setProfile=E}},1);ce(hLt,class{constructor(){this.registerIssueDataProvider=E,this.openReporter=E,this.openProcessExplorer=E,this.registerIssueUriRequestHandler=E}},1);ce(WJe,class{constructor(){this.repositories=[],this.onDidChangeRepositories=M.None,this.visibleRepositories=[],this.onDidChangeVisibleRepositories=M.None,this.isVisible=()=>!1,this.toggleVisibility=E,this.toggleSortKey=E,this.focusedRepository=void 0,this.onDidFocusRepository=M.None,this.focus=E}get menus(){return E()}},1);ce(FJe,class{constructor(){this.onDidChangeExecution=M.None,this.onDidChangeLastRunFailState=M.None,this.forceCancelNotebookExecutions=E,this.getCellExecutionsForNotebook=E,this.getCellExecutionsByHandleForNotebook=E,this.getCellExecution=E,this.createCellExecution=E,this.getExecution=E,this.createExecution=E,this.getLastFailedCellForNotebook=E}},1);ce(jJe,class{constructor(){this.onDidChange=M.None,this.addProfile=E,this.updateProfile=E,this.removeProfile=E,this.capabilitiesForTest=E,this.configure=E,this.all=()=>[],this.getGroupDefaultProfiles=()=>[],this.setGroupDefaultProfiles=E,this.getControllerProfiles=()=>[]}},1);ce(R1t,class{constructor(){this.setUsePlainTextEncryption=E,this.getKeyStorageProvider=E,this.encrypt=E,this.decrypt=E,this.isEncryptionAvailable=E}},1);ce(YJe,class{constructor(){this.onResultsChanged=M.None,this.onTestChanged=M.None,this.results=[],this.clear=E,this.createLiveResult=E,this.push=E,this.getResult=()=>{},this.getStateById=()=>{}}},1);ce(XTt,class{constructor(){this.read=E,this.persist=E}},1);ce(eLt,class{constructor(){this.onDidChange=M.None,this.invalidateResultMessage=E,this.syncDecorations=E,this.getDecoratedTestPosition=E}},1);ce(tce,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(L1t,T1t,1);ce($Tt,class{notebookSearch(){return{openFilesToScan:new Dk,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new Dk)}}},1);ce(IJe,class{constructor(){this.sendChatRequest=E,this.selectLanguageModels=E,this.computeTokenLength=E,this.onDidChangeLanguageModels=M.None,this.getLanguageModelIds=()=>[],this.lookupLanguageModel=()=>{},this.registerLanguageModelChat=E,this.makeLanguageModelChatRequest=E}},1);ce(YRe,class{constructor(){this.onDidChangeCommands=E,this.registerSlashData=E,this.registerSlashCallback=E,this.registerSlashCommand=E,this.executeCommand=E,this.getCommands=E,this.hasCommand=E}},1);ce(L6,class{constructor(){this.attachContext=E,this.getVariable=()=>{},this.resolveVariable=async()=>[],this.getDynamicVariables=E,this.getDynamicReferences=E,this.registerVariable=E,this.getVariables=E,this.resolveVariables=E,this.hasVariable=E}},1);ce(nMe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=E,this.registerAiRelatedInformationProvider=E}},1);ce(eXe,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=E,this.registerAiEmbeddingVectorProvider=E}},1);ce(fJe,(gK=class{async createNewMessage(e){return{id:String(gK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},gK._nextId=1,gK),1);ce(ZTt,class{constructor(){this.lastRunProfileIds=new Set,this.onDidChange=M.None,this.isSpecificallyEnabledFor=()=>!1,this.isEnabledForAParentOf=()=>!1,this.isEnabledForAChildOf=()=>!1,this.isEnabled=()=>!1,this.start=E,this.stop=E}},1);ce(JTt,class{constructor(){this.onDidRequestInputFocus=M.None,this.focusInput=E,this.setText=E,this.isFilteringFor=()=>!1,this.toggleFilteringFor=E}get text(){return E()}get reveal(){return E()}get globList(){return E()}get includeTags(){return E()}get excludeTags(){return E()}get fuzzy(){return E()}},1);ce(tLt,class{constructor(){this.tryPeekFirstError=E,this.peekUri=E,this.openCurrentInEditor=E,this.open=E,this.closeAllPeeks=E}get historyVisible(){return E()}},1);ce(sXe,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=M.None,this.hasWindow=()=>!1,this.open=E}},1);ce(Kae,class{constructor(){this.onDidStartTextToSpeechSession=M.None,this.onDidEndTextToSpeechSession=M.None,this.hasActiveTextToSpeechSession=!1,this.createTextToSpeechSession=E,this.onDidChangeHasSpeechProvider=M.None,this.onDidStartSpeechToTextSession=M.None,this.onDidEndSpeechToTextSession=M.None,this.hasActiveSpeechToTextSession=!1,this.onDidStartKeywordRecognition=M.None,this.onDidEndKeywordRecognition=M.None,this.hasActiveKeywordRecognition=!1,this.recognizeKeyword=E,this.onDidRegisterSpeechProvider=M.None,this.onDidUnregisterSpeechProvider=M.None,this.hasSpeechProvider=!1,this.registerSpeechProvider=E,this.createSpeechToTextSession=E}},1);ce(YTt,class{constructor(){this.openCoverage=E,this.closeCoverage=E}get showInline(){return E()}get filterToTest(){return E()}get selected(){return E()}},1);ce(DJe,class{constructor(){this.acceptRequest=E,this.acceptResponse=E}},1);ce(kJe,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.getHistory=()=>[],this.saveHistory=E}},1);ce(TTt,class{constructor(){this.providers=[],this.registerProvider=()=>V.None}},1);ce(ZRe,class{constructor(){this.onDidMoveSession=M.None,this.onDidMoveSessio=M.None,this.onDidStashSession=M.None,this.moveSession=E,this.getCodeEditor=E,this.stashSession=E,this.onWillStartSession=M.None,this.onDidEndSession=M.None,this.createSession=E,this.getSession=()=>{},this.releaseSession=E,this.registerSessionKeyComputer=E,this.recordings=E,this.dispose=E}},1);ce(WTt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=E,this.canPromptRecommendation=async()=>!1}},1);ce(PTt,class{constructor(){this.getKernels=E,this.addMostRecentKernel=E}},1);ce(NTt,class{constructor(){this.executeNotebookCells=E,this.cancelNotebookCells=E,this.cancelNotebookCellHandles=E,this.registerExecutionParticipant=E}},1);ce(FTt,class{},1);ce(OTt,class{constructor(){this.info=E,this.debug=E}},1);ce(nLt,class{constructor(){this.onDidAddWalkthrough=M.None,this.onDidRemoveWalkthrough=M.None,this.onDidChangeWalkthrough=M.None,this.onDidProgressStep=M.None,this.getWalkthroughs=E,this.getWalkthrough=E,this.registerWalkthrough=E,this.progressByEvent=E,this.progressStep=E,this.deprogressStep=E,this.markWalkthroughOpened=E}},1);ce(J1t,class{constructor(){this.onDidChangeUserDataSyncStore=M.None,this.userDataSyncStore=void 0,this.switch=E,this.getPreviousUserDataSyncStore=E}},1);ce(X1t,class{constructor(){this.onDidChangeDonotMakeRequestsUntil=M.None,this.donotMakeRequestsUntil=void 0,this.onTokenFailed=M.None,this.onTokenSucceed=M.None,this.setAuthToken=E,this.manifest=E,this.readResource=E,this.writeResource=E,this.deleteResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E,this.getAllCollections=E,this.createCollection=E,this.deleteCollection=E,this.getActivityData=E,this.clear=E}},1);ce(sTt,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(eTt,class{constructor(){this.status="uninitialized",this.onDidChangeStatus=M.None,this.conflicts=[],this.onDidChangeConflicts=M.None,this.onDidChangeLocal=M.None,this.onSyncErrors=M.None,this.onDidChangeLastSyncTime=M.None,this.onDidResetRemote=M.None,this.onDidResetLocal=M.None,this.createSyncTask=E,this.createManualSyncTask=E,this.resolveContent=E,this.accept=E,this.reset=E,this.resetRemote=E,this.cleanUpRemoteData=E,this.resetLocal=E,this.hasLocalData=E,this.hasPreviouslySynced=E,this.replace=E,this.saveRemoteActivityData=E,this.extractActivityData=E}},1);ce(rTt,class{constructor(){this.onDidChange=M.None,this.getMachines=E,this.addCurrentMachine=E,this.removeCurrentMachine=E,this.renameMachine=E,this.setEnablements=E}},1);ce(tTt,class{constructor(){this.getRemoteSyncedProfiles=E,this.getLocalSyncedProfiles=E,this.getRemoteSyncResourceHandles=E,this.getLocalSyncResourceHandles=E,this.getAssociatedResources=E,this.getMachineId=E,this.getLocalSyncedMachines=E,this.resolveContent=E,this.resolveUserDataSyncResource=E}},1);ce(Z1t,class{constructor(){this.writeResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E}},1);ce(nTt,class{constructor(){this.resolveDefaultCoreIgnoredSettings=async()=>[],this.resolveUserBindings=E,this.resolveFormattingOptions=E,this.resolveDefaultIgnoredSettings=E}},1);ce(bLt,class{constructor(){this.createProfile=E,this.createAndEnterProfile=E,this.createAndEnterTransientProfile=E,this.removeProfile=E,this.updateProfile=E,this.switchProfile=E,this.getBuiltinProfileTemplates=E}},1);ce(ELt,class{constructor(){this.onDidAddEntry=M.None,this.onDidChangeEntry=M.None,this.onDidReplaceEntry=M.None,this.onDidRemoveEntry=M.None,this.onDidMoveEntries=M.None,this.onDidRemoveEntries=M.None,this.addEntry=E,this.updateEntry=E,this.removeEntry=E,this.moveEntries=E,this.getEntries=async()=>[],this.getAll=async()=>[],this.removeAll=E}},1);ce(RJe,class{constructor(){this.markChanged=E}},1);ce(dXe,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=E,this.removeNotebookDocument=E}},1);ce(TJe,class{constructor(){this.registerTree=E,this.getVisualizedNodeFor=E,this.getVisualizedChildren=E,this.editTreeItem=E,this.getApplicableFor=E,this.register=E}},1);ce(RTt,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(LTt,class{constructor(){this.SIZE_LIMIT=0,this.isSignedIn=!1,this.onDidSignIn=M.None,this.onDidSignOut=M.None,this.storeClient=void 0,this.lastReadResources=new Map,this.lastWrittenResources=new Map,this.initialize=E,this.read=E,this.write=E,this.delete=E,this.list=E,this.getMachineById=E}},1);ce(NJe,class{constructor(){this.registerResolver=()=>V.None,this.resolve=async()=>{}}},1);ce(qTt,KTt,1);ce(rXe,class{constructor(){this.onDidChangeEnablement=M.None,this.isEnabled=()=>!0,this.setEnablement=E,this.getEnablementData=E,this.getAccess=E,this.onDidChangeAccessData=M.None,this.getAccessData=()=>{},this.setStatus=E}},1);ce(oXe,class{constructor(){this.onWillInstantiateEditorPane=M.None,this.didInstantiateEditorPane=()=>!1}},1);ce(xLt,class{constructor(){this.matches=E,this.getWorkspaceStateFolders=E}},1);ce(MTt,class{constructor(){this.onDidChangeDefaultLogLevels=M.None,this.getDefaultLogLevel=async()=>Gn.Off,this.getDefaultLogLevels=E,this.setDefaultLogLevel=E,this.migrateLogLevels=E}},1);ce(nE,class{constructor(){this.onDidChange=M.None,this.getName=()=>{}}},1);ce(lLt,class{constructor(){this.isActive=()=>!1,this.start=E,this.resume=E,this.stop=E}},1);ce(ULt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(nce,class{isValid(){return!1}},1);ce(vXe,class{constructor(){this.onDidChangeTools=M.None,this.registerToolData=E,this.registerToolImplementation=E,this.getTools=()=>[],this.invokeTool=E}},1);ce(dLt,class{constructor(){this.openReporter=E,this.reloadWithExtensionsDisabled=E,this.showConfirmCloseDialog=E,this.showClipboardDialog=E,this.sendReporterMenu=E,this.closeReporter=E}},1);const eRt="vscode://schemas/vscode-product",tRt={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts"},aiTextSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProviderNew.d.ts"},attributableCoverage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts"},authGetSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authGetSessions.d.ts"},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts"},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:2},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},chatVariableResolver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribIssueReporter:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribIssueReporter.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlHistoryItemChangesMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemChangesMenu.d.ts"},contribSourceControlHistoryItemGroupMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},createFileSystemWatcher:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts"},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},documentPaste:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileComments:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileComments.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProviderNew.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts"},findFiles2New:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2New.d.ts"},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFilesNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFilesNew.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},idToken:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},inlineEdit:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},lmTools:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.lmTools.d.ts",version:2},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookCellExecutionState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickInputButtonLocation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},showLocal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellIntegration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts"},testMessageStackTrace:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textSearchCompleteNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchCompleteNew.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProviderNew.d.ts"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},RM=Object.freeze(tRt),cMe=Qe.as(YA.JSONContribution);class iRt{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(Xe.Error,e)}warn(e){this._msg(Xe.Warning,e)}info(e){this._msg(Xe.Info,e)}}class P5{static _toSet(e){const t=new A_;for(let i=0,n=e.length;i!i.has(a.description.identifier)),r=e.filter(a=>!n.has(a.description.identifier));return new P5(o,r)}constructor(e,t){this.added=e,this.removed=t}}class nRt{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=P5.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){vt(e)}}}const sRt={type:"string",enum:["ui","workspace"],enumDescriptions:[g(4415,"UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),g(4416,"Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")]},bXe="vscode://schemas/vscode-extensions",Wve={properties:{engines:{type:"object",description:g(4417,"Engine compatibility."),properties:{vscode:{type:"string",description:g(4418,"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(4419,"The publisher of the VS Code extension."),type:"string"},displayName:{description:g(4420,"The display name for the extension used in the VS Code gallery."),type:"string"},categories:{description:g(4421,"The categories used by the VS Code gallery to categorize the extension."),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:QYe},{type:"string",const:"Languages",deprecationMessage:g(4422,"Use 'Programming Languages' instead")}]}},galleryBanner:{type:"object",description:g(4423,"Banner used in the VS Code marketplace."),properties:{color:{description:g(4424,"The banner color on the VS Code marketplace page header."),type:"string"},theme:{description:g(4425,"The color theme for the font used in the banner."),type:"string",enum:["dark","light"]}}},contributes:{description:g(4426,"All contributions of the VS Code extension represented by this package."),type:"object",properties:{},default:{}},preview:{type:"boolean",description:g(4427,"Sets the extension to be flagged as a Preview in the Marketplace.")},enableProposedApi:{type:"boolean",deprecationMessage:g(4428,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:g(4429,"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(RM).map(s=>s),markdownEnumDescriptions:Object.values(RM).map(s=>s.proposal)}},api:{markdownDescription:g(4430,"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(4431,"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(4432,"Activation events for the VS Code extension."),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:g(4433,"An activation event emmited when a webview is loaded of a certain viewType"),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:g(4434,"An activation event emitted whenever a file that resolves to the specified language gets opened."),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:g(4435,"An activation event emitted whenever the specified command gets invoked."),body:"onCommand:${2:commandId}"},{label:"onDebug",description:g(4436,"An activation event emitted whenever a user is about to start debugging or about to setup debug configurations."),body:"onDebug"},{label:"onDebugInitialConfigurations",description:g(4437,'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(4438,'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(4439,"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(4440,"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(4441,"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(4442,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:"onStartupFinished"},{label:"onTaskType",description:g(4443,"An activation event emitted whenever tasks of a certain type need to be listed or resolved."),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:g(4444,"An activation event emitted whenever a file or folder is accessed with the given scheme."),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:g(4445,"An activation event emitted whenever an edit session is accessed with the given scheme."),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:g(4446,"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(4447,"An activation event emitted whenever the specified view is expanded.")},{label:"onUri",body:"onUri",description:g(4448,"An activation event emitted whenever a system-wide Uri directed towards this extension is open.")},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:g(4449,"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(4450,"An activation event emitted whenever the specified custom editor becomes visible.")},{label:"onNotebook",body:"onNotebook:${1:type}",description:g(4451,"An activation event emitted whenever the specified notebook document is opened.")},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:g(4452,"An activation event emitted whenever sessions are requested from the specified authentication provider.")},{label:"onRenderer",description:g(4453,"An activation event emitted whenever a notebook output renderer is used."),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:g(4454,"An activation event emitted when a specific terminal profile is launched.")},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:g(4455,"An activation event emitted when a command matches the selector associated with this ID")},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:g(4456,"An activation event emitted when a specified walkthrough is opened.")},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:g(4457,"An activation event emitted when the issue reporter is opened.")},{label:"onChatParticipant",body:"onChatParticipant:${1:participantId}",description:g(4458,"An activation event emitted when the specified chat participant is invoked.")},{label:"onLanguageModelTool",body:"onLanguageModelTool:${1:toolName}",description:g(4459,"An activation event emitted when the specified language model tool is invoked.")},{label:"*",description:g(4460,"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(4461,"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(4462,"Badge image URL.")},href:{type:"string",description:g(4463,"Badge link.")},description:{type:"string",description:g(4464,"Badge description.")}}}},markdown:{type:"string",description:g(4465,"Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:g(4466,"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(4467,"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:W3}},extensionPack:{description:g(4468,"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:W3}},extensionKind:{description:g(4469,"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:sRt,default:["workspace"],defaultSnippets:[{body:["ui"],description:g(4470,"Define an extension which can run only on the local machine when connected to remote window.")},{body:["workspace"],description:g(4471,"Define an extension which can run only on the remote machine when connected remote window.")},{body:["ui","workspace"],description:g(4472,"Define an extension which can run on either side, with a preference towards running on the local machine.")},{body:["workspace","ui"],description:g(4473,"Define an extension which can run on either side, with a preference towards running on the remote machine.")},{body:[],description:g(4474,"Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.")}]},capabilities:{description:g(4475,"Declare the set of supported capabilities by the extension."),type:"object",properties:{virtualWorkspaces:{description:g(4476,"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(4477,"Declares the level of support for virtual workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(4478,"The extension will be enabled in virtual workspaces with some functionality disabled."),g(4479,"The extension will be enabled in virtual workspaces with all functionality enabled."),g(4480,"The extension will not be enabled in virtual workspaces.")]},description:{type:"string",markdownDescription:g(4481,"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(4482,"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(4483,"Declares the level of support for untrusted workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(4484,"The extension will be enabled in untrusted workspaces with some functionality disabled."),g(4485,"The extension will be enabled in untrusted workspaces with all functionality enabled."),g(4486,"The extension will not be enabled in untrusted workspaces.")]},restrictedConfigurations:{description:g(4487,"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(4488,"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(4489,"Specify the location from where users can sponsor your extension."),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:g(4490,"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(4491,"Script executed before the package is published as a VS Code extension."),type:"string"},"vscode:uninstall":{description:g(4492,"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(4493,"The path to a 128x128 pixel icon.")},l10n:{type:"string",description:g(4494,"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(4495,"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 oRt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new nRt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&JO.register(e.extensionPoint,e.activationEventsGenerator),Wve.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,cMe.registerSchema(bXe,Wve),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const wXe={ExtensionsRegistry:"ExtensionsRegistry"};Qe.add(wXe.ExtensionsRegistry,new oRt);const eh=Qe.as(wXe.ExtensionsRegistry);cMe.registerSchema(bXe,Wve);cMe.registerSchema(eRt,{properties:{extensionEnabledApiProposals:{description:g(4496,"API proposals that the respective extensions can freely use."),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(RM),markdownEnumDescriptions:Object.values(RM).map(s=>s.proposal)}}]}}}});var J_;(function(s){s.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(J_||(J_={}));class rRt{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())}}Qe.add(J_.ExtensionFeaturesRegistry,new rRt);var cf;(function(s){s.Workbench="workbench.contributions.kind"})(cf||(cf={}));var yc;(function(s){s[s.BlockStartup=1]="BlockStartup",s[s.BlockRestore=2]="BlockRestore",s[s.AfterRestored=3]="AfterRestored",s[s.Eventually=4]="Eventually"})(yc||(yc={}));function wHe(s){const e=s;return!!e&&typeof e.editorTypeId=="string"}function aRt(s){switch(s){case Rs.Restored:return yc.AfterRestored;case Rs.Eventually:return yc.Eventually}}function yHe(s){switch(s){case yc.BlockStartup:return Rs.Starting;case yc.BlockRestore:return Rs.Ready;case yc.AfterRestored:return Rs.Restored;case yc.Eventually:return Rs.Eventually}}const GE=class GE extends V{constructor(){super(...arguments),this.contributionsByPhase=new Map,this.contributionsByEditor=new Map,this.contributionsById=new Map,this.instancesById=new Map,this.instanceDisposables=this._register(new Z),this.timingsByPhase=new Map,this.pendingRestoredContributions=new dc,this.whenRestored=this.pendingRestoredContributions.p}get timings(){return this.timingsByPhase}registerWorkbenchContribution2(e,t,i){const n={id:e,ctor:t};this.instantiationService&&this.lifecycleService&&this.logService&&this.environmentService&&this.editorPaneService&&(typeof i=="number"&&this.lifecycleService.phase>=i||typeof e=="string"&&wHe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,n,typeof i=="number"?yHe(i):this.lifecycleService.phase):(typeof i=="number"&&Cj(this.contributionsByPhase,yHe(i),[]).push(n),typeof e=="string"&&(this.contributionsById.has(e)?console.error(`IWorkbenchContributionsRegistry#registerWorkbenchContribution(): Can't register multiple contributions with same id '${e}'`):this.contributionsById.set(e,n),wHe(i)&&Cj(this.contributionsByEditor,i.editorTypeId,[]).push(n)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,aRt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,n=this.logService,o=this.environmentService;if(!t||!i||!n||!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.phase{this.instanceDisposables.clear()}));for(const a of[Rs.Starting,Rs.Ready,Rs.Restored,Rs.Eventually])this.instantiateByPhase(t,i,n,o,a);for(const a of this.contributionsByEditor.keys())r.didInstantiateEditorPane(a)&&this.onEditor(a,t,i,n,o);this._register(r.onWillInstantiateEditorPane(a=>this.onEditor(a.typeId,t,i,n,o)))}onEditor(e,t,i,n,o){const r=this.contributionsByEditor.get(e);if(r){this.contributionsByEditor.delete(e);for(const a of r)this.safeCreateContribution(t,n,o,a,i.phase)}}instantiateByPhase(e,t,i,n,o){t.phase>=o?this.doInstantiateByPhase(e,i,n,o):t.when(o).then(()=>this.doInstantiateByPhase(e,i,n,o))}async doInstantiateByPhase(e,t,i,n){const o=this.contributionsByPhase.get(n);if(o)switch(this.contributionsByPhase.delete(n),n){case Rs.Starting:case Rs.Ready:{cs(`code/willCreateWorkbenchContributions/${n}`);for(const r of o)this.safeCreateContribution(e,t,i,r,n);cs(`code/didCreateWorkbenchContributions/${n}`);break}case Rs.Restored:case Rs.Eventually:{n===Rs.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(o,e,t,i,n);break}}}doInstantiateWhenIdle(e,t,i,n,o){cs(`code/willCreateWorkbenchContributions/${o}`);let r=0;const a=o===Rs.Eventually?3e3:500,c=l=>{for(;r(o{for(const t of e){const i=t.value,n=t.collector,o=t.description.extensionLocation;if(!i||!Array.isArray(i)){n.error(g(674,"'configuration.jsonValidation' must be a array"));return}i.forEach(r=>{if(!Lt(r.fileMatch)&&!(Array.isArray(r.fileMatch)&&r.fileMatch.every(Lt))){n.error(g(675,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=r.url;if(!Lt(a)){n.error(g(676,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=Pt(o,a);qy(c,o)||n.warn(g(677,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",CHe.name,c.toString(),o.path))}catch(c){n.error(g(678,"'configuration.jsonValidation.url' is an invalid relative URL: {0}",c.message))}else if(!/^[^:/?#]+:\/\//.test(a)){n.error(g(679,"'configuration.jsonValidation.url' must be an absolute URL or start with './' to reference schemas located in the extension."));return}})}})}}class lRt extends V{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(680,"File Match"),g(681,"Schema")],n=t.map(o=>[new Mt().appendMarkdown(`\`${Array.isArray(o.fileMatch)?o.fileMatch.join(", "):o.fileMatch}\``),o.url]);return{data:{headers:i,rows:n},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(682,"JSON Validation"),access:{canToggle:!1},renderer:new wi(lRt)});var _B;let UJ=(_B=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(cRt)}},_B.ID="workbench.contrib.jsonValidationExtensionPoint",_B);UJ=D([_(0,we)],UJ);Qu(UJ.ID,UJ,yc.BlockStartup);const Hve=Qe.as(kTe.ColorContribution),fK=Hve.getColorReferenceSchema(),yXe="^\\w+[.\\w+]*$",dRt=eh.registerExtensionPoint({extensionPoint:"colors",jsonSchema:{description:g(683,"Contributes extension defined themable colors"),type:"array",items:{type:"object",properties:{id:{type:"string",description:g(684,"The identifier of the themable color"),pattern:yXe,patternErrorMessage:g(685,"Identifiers must only contain letters, digits and dots and can not start with a dot")},description:{type:"string",description:g(686,"The description of the themable color")},defaults:{type:"object",properties:{light:{description:g(687,"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:[fK,{type:"string",format:"color-hex"}]},dark:{description:g(688,"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:[fK,{type:"string",format:"color-hex"}]},highContrast:{description:g(689,"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:[fK,{type:"string",format:"color-hex"}]},highContrastLight:{description:g(690,"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:[fK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class hRt{constructor(){dRt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,o=i.collector;if(!n||!Array.isArray(n)){o.error(g(691,"'configuration.colors' must be a array"));return}const r=(a,c)=>a.length>0?a[0]==="#"?me.Format.CSS.parseHex(a):a:(o.error(g(692,"{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)),me.red);for(const a of n){if(typeof a.id!="string"||a.id.length===0){o.error(g(693,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(yXe)){o.error(g(694,"'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(695,"'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(696,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){o.error(g(697,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){o.error(g(698,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}Hve.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 n=i.value;for(const o of n)Hve.deregisterColor(o.id)}})}}class uRt extends V{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(699,"ID"),g(700,"Description"),g(701,"Dark Default"),g(702,"Light Default"),g(703,"High Contrast Default")],n=r=>r[0]==="#"?me.fromHex(r):void 0,o=t.sort((r,a)=>r.id.localeCompare(a.id)).map(r=>[new Mt().appendMarkdown(`\`${r.id}\``),r.description,n(r.defaults.dark)??new Mt().appendMarkdown(`\`${r.defaults.dark}\``),n(r.defaults.light)??new Mt().appendMarkdown(`\`${r.defaults.light}\``),n(r.defaults.highContrast)??new Mt().appendMarkdown(`\`${r.defaults.highContrast}\``)]);return{data:{headers:i,rows:o},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(704,"Colors"),access:{canToggle:!1},renderer:new wi(uRt)});var vB;let VJ=(vB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(hRt)}},vB.ID="workbench.contrib.colorExtensionPoint",vB);VJ=D([_(0,we)],VJ);Qu(VJ.ID,VJ,yc.BlockStartup);const hV=Qe.as(SYe.IconContribution),gRt=hV.getIconReferenceSchema(),CXe=`^${We.iconNameSegment}(-${We.iconNameSegment})+$`,fRt=eh.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(705,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:CXe,description:g(706,"The identifier of the themable icon"),patternErrorMessage:g(707,"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(708,"The description of the themable icon")},default:{anyOf:[gRt,{type:"object",properties:{fontPath:{description:g(709,"The path of the icon font that defines the icon."),type:"string"},fontCharacter:{description:g(710,"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(711,"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 pRt{constructor(){fRt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,o=i.collector;if(!n||typeof n!="object"){o.error(g(712,"'configuration.icons' must be an object with the icon names as properties."));return}for(const r in n){if(!r.match(CXe)){o.error(g(713,"'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=n[r];if(typeof a.description!="string"||a.description.length===0){o.error(g(714,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")hV.registerIcon(r,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=Gy(c.fontPath).substring(1),d=mRt[l];if(!d){o.warn(g(715,"Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.",l));return}const h=i.description.extensionLocation,u=Pt(h,c.fontPath);if(!qy(u,h)){o.warn(g(716,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=_Rt(i.description,c.fontPath),p=hV.registerIconFont(f,{src:[{location:u,format:d}]});hV.registerIcon(r,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else o.error(g(717,"'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 n=i.value;for(const o in n)hV.deregisterIcon(o)}})}}const mRt={ttf:"truetype",woff:"woff",woff2:"woff2"};function _Rt(s,e){return Vi.join(s.identifier.value,e)}var bB;let zJ=(bB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(pRt)}},bB.ID="workbench.contrib.iconExtensionPoint",bB);zJ=D([_(0,we)],zJ);Qu(zJ.ID,zJ,yc.BlockStartup);const ca=Object.freeze({View:Pe(4523,"View"),Help:Pe(4524,"Help"),Test:Pe(4525,"Test"),File:Pe(4526,"File"),Preferences:Pe(4527,"Preferences"),Developer:Pe(4528,"Developer")});class vRt extends li{constructor(){super({id:"menu.resetHiddenStates",title:Pe(4502,"Reset All Menus"),category:ca.View,f1:!0})}run(e){e.get(Oa).resetHiddenStates(),e.get(Ge).info("did RESET all menu hidden states")}}At(vRt);var bRt='.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}';ut(bRt,{});let lf=class extends Hk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,r,a,c,l,d,h,u,f),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){gp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};lf=D([_(4,we),_(5,Kt),_(6,vi),_(7,Le),_(8,pn),_(9,bi),_(10,mr),_(11,Vs),_(12,it)],lf);var wRt=".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}";ut(wRt,{});const SHe=new me(new dn(0,122,204)),yRt={showArrow:!0,showFrame:!0,className:"",frameColor:SHe,arrowColor:SHe,keepEditorSelection:!1},CRt="vs.editor.contrib.zoneWidget";class SRt{constructor(e,t,i,n,o,r,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class ARt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const Sse=class Sse{constructor(e){this._editor=e,this._ruleName=Sse._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),CS(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(){CS(this._ruleName),Uf(`.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:F.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:ni.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};Sse._IdGenerator=new DU(".arrow-decoration-");let Uve=Sse;class lMe{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=xs(t),gp(this.options,yRt,!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 n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}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 Uve(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(Bc())}show(e,t){const i=F.isIRange(e)?F.lift(e):F.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Gt.EMPTY}])}updatePositionAndHeight(e,t){this._viewZone&&(e=F.isIRange(e)?F.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:F.isIRange(e)?e:F.fromPositions(e),options:Gt.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(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"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 SRt(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 ARt(CRt+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 F(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,mt.Smooth):this.editor.revealRange(e,mt.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 Od(this.domNode,this,{orientation:fi.HORIZONTAL})),this.options.isResizeable||(this._resizeSash.state=oa.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),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;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 SXe=ae("IPeekViewService");ce(SXe,class{constructor(){this._widgets=new Map}addExclusiveWidget(s,e){const t=this._widgets.get(s);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(s);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(s))};this._widgets.set(s,{widget:e,listener:e.onDidClose(i)})}},qt.Delayed);var ng;(function(s){s.inPeekEditor=new Q("inReferenceSearchEditor",!0,g(5106,"Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(ng||(ng={}));var wB;let $J=(wB=class{constructor(e,t){e instanceof lf&&ng.inPeekEditor.bindTo(t)}dispose(){}},wB.ID="editor.contrib.referenceController",wB);$J=D([_(1,Le)],$J);on($J.ID,$J,ri.Eager);function AXe(s){const e=s.get(Kt).getFocusedCodeEditor();return e instanceof lf?e.getParentEditor():e}const ERt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let H3=class extends lMe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,gp(this.options,ERt,!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=fe(".head"),this._bodyElement=fe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=fe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Ro(this._titleElement,"click",o=>this._onTitleClick(o))),re(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=fe("span.filename"),this._secondaryHeading=fe("span.dirname"),this._metaHeading=fe("span.meta"),re(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=fe(".peekview-actions");re(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new hd(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new rn("peekview.close",g(5107,"Close"),We.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:WN.bind(void 0,this.instantiationService),orientation:F_.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ms(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Yh(this._metaHeading)):zd(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,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`)}};H3=D([_(2,we)],H3);const sce=W("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5108,"Background color of the peek view title area.")),dMe=W("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Rl},g(5109,"Color of the peek view title.")),hMe=W("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(5110,"Color of the peek view title info.")),uMe=W("peekView.border",{dark:mm,light:mm,hcDark:wt,hcLight:wt},g(5111,"Color of the peek view borders and arrow.")),xRt=W("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5112,"Background color of the peek view result list."));W("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:me.white,hcLight:Rl},g(5113,"Foreground color for line nodes in the peek view result list."));W("peekViewResult.fileForeground",{dark:me.white,light:"#1E1E1E",hcDark:me.white,hcLight:Rl},g(5114,"Foreground color for file nodes in the peek view result list."));W("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g(5115,"Background color of the selected entry in the peek view result list."));W("peekViewResult.selectionForeground",{dark:me.white,light:"#6C6C6C",hcDark:me.white,hcLight:Rl},g(5116,"Foreground color of the selected entry in the peek view result list."));const EXe=W("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:me.black,hcLight:me.white},g(5117,"Background color of the peek view editor."));W("peekViewEditorGutter.background",EXe,g(5118,"Background color of the gutter in the peek view editor."));W("peekViewEditorStickyScroll.background",EXe,g(5119,"Background color of sticky scroll in the peek view editor."));W("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g(5120,"Match highlight color in the peek view result list."));W("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g(5121,"Match highlight color in the peek view editor."));W("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(5122,"Match highlight border in the peek view editor."));class Xk{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=Vme.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(5095,"{0} in {1} on line {2} at column {3}",e.value,_i(this.uri),this.range.startLineNumber,this.range.startColumn):g(5094,"in {0} on line {1} at column {2}",_i(this.uri),this.range.startLineNumber,this.range.startColumn)}}class DRt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:r,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new F(n,c.startColumn,n,o),d=new F(r,a,r,Un.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 U3{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ui}dispose(){bt(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(5096,"1 symbol in {0}, full path {1}",_i(this.uri),this.uri.fsPath):g(5097,"{0} symbols in {1}, full path {2}",e,_i(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 DRt(i))}catch(i){vt(i)}return this}}class of{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(of._compareReferences);let n;for(const o of e)if((!n||!xn.isEqual(n.uri,o.uri,!0))&&(n=new U3(this,o.uri),this.groups.push(n)),n.children.length===0||of._compareReferences(o,n.children[n.children.length-1])!==0){const r=new Xk(i===o,n,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){bt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new of(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g(5098,"No results found"):this.references.length===1?g(5099,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g(5100,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g(5101,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%o:n=(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,o)=>({idx:o,prefixLen:$y(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,o)=>n.prefixLen>o.prefixLen?-1:n.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()&&F.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 xn.compare(e.uri,t.uri)||F.compareRangesUsingStarts(e.range,t.range)}}var kRt=".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}";ut(kRt,{});var Vve;let zve=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof of||e instanceof U3}getChildren(e){if(e instanceof of)return e.groups;if(e instanceof U3)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};zve=D([_(0,fn)],zve);class IRt{getHeight(){return 23}getTemplateId(e){return e instanceof U3?GJ.id:KJ.id}}let $ve=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof Xk){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return _i(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};$ve=D([_(0,Ut)],$ve);class TRt{getId(e){return e instanceof Xk?e.id:e.uri}}let Gve=class extends V{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new D3(i,{supportHighlights:!0})),this.badge=new x_e(re(i,fe(".count")),{},Uje),e.appendChild(i)}set(e,t){const i=Lr(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 n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(g(11226,"{0} references",n)):this.badge.setTitleFormat(g(11227,"{0} reference",n))}};Gve=D([_(1,Fs)],Gve);var wL;let GJ=(wL=class{constructor(e){this._instantiationService=e,this.templateId=Vve.id}renderTemplate(e){return this._instantiationService.createInstance(Gve,e)}renderElement(e,t,i){i.set(e.element,xU(e.filterData))}disposeTemplate(e){e.dispose()}},Vve=wL,wL.id="FileReferencesRenderer",wL);GJ=Vve=D([_(0,we)],GJ);class LRt extends V{constructor(e){super(),this.label=this._register(new rD(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${_i(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:n,highlight:o}=i;t&&!N_.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,xU(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[o]))}}}const Ase=class Ase{constructor(){this.templateId=Ase.id}renderTemplate(e){return new LRt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};Ase.id="OneReferenceRenderer";let KJ=Ase;class RRt{getWidgetAriaLabel(){return g(11228,"References")}getAriaLabel(e){return e.ariaMessage}}const Ese=class Ese{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 n=0,o=e.children.length;n{const o=n.deltaDecorations([],t);for(let r=0;r{o.equals(S.Escape)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(NRt,"ReferencesWidget",this._treeContainer,new IRt,[this._instantiationService.createInstance(GJ),this._instantiationService.createInstance(KJ)],this._instantiationService.createInstance(zve),i),this._splitView.addView({onDidChange:M.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},Kk.Distribute),this._splitView.addView({onDidChange:M.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)}},Kk.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(o,r)=>{o instanceof Xk&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")})),zd(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new bn(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(9797,"No results"),Yh(this._messageContainer),Promise.resolve(void 0)):(zd(this._messageContainer),this._decorationsManager=new Kve(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 n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Yh(this._treeContainer),Yh(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 Xk)return e;if(e instanceof U3&&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!==pe.inMemory?this.setTitle(EA(e.uri),this._uriLabel.getUriLabel(Lr(e.uri))):this.setTitle(g(9798,"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 n=await i;if(!this._model){n.dispose();return}bt(this._previewModelReference);const o=n.object;if(o){const r=this._preview.getModel()===o.textEditorModel?mt.Smooth:mt.Immediate,a=F.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};qve=D([_(3,pn),_(4,fn),_(5,we),_(6,SXe),_(7,Fs),_(8,JA),_(9,Ut),_(10,xi),_(11,Vs)],qve);var Xq;const VN=new Q("referenceSearchVisible",!1,g(4503,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var yL;let NM=(yL=class{static get(e){return e.getContribution(Xq.ID)}constructor(e,t,i,n,o,r,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=VN.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 n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))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=MRt.fromJSON(this._storageService.get(o,Ie.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(qve,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g(4504,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),Ie.PROFILE,an.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(4505,"{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 n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!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=F.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:Db.JUMP,pinned:t}},this._editor).then(n=>{if(this._ignoreModelChangeEvent=!1,!n||!this._widget){this.closeWidget();return}if(this._editor===n)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=Xq.get(n),r=this._model.clone();this.closeWidget(),n.focus(),o?.toggleWidget(i,Rr(a=>Promise.resolve(r)),this._peekMode??!1)}},n=>{this._ignoreModelChangeEvent=!1,vt(n)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:Db.JUMP,pinned:i}},this._editor,t)}},Xq=yL,yL.ID="editor.contrib.referencesController",yL);NM=Xq=D([_(2,Le),_(3,Kt),_(4,bi),_(5,we),_(6,$i),_(7,Te)],NM);function zN(s,e){const t=AXe(s);if(!t)return;const i=NM.get(t);i&&e(i)}So.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:Ae.EditorContrib,primary:rr(U.CtrlCmd|S.KeyK,S.F2),when:he.or(VN,ng.inPeekEditor),handler(s){zN(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});So.registerCommandAndKeybindingRule({id:"goToNextReference",weight:Ae.EditorContrib-10,primary:S.F4,secondary:[S.F12],when:he.or(VN,ng.inPeekEditor),handler(s){zN(s,e=>{e.goToNextOrPreviousReference(!0)})}});So.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:Ae.EditorContrib-10,primary:U.Shift|S.F4,secondary:[U.Shift|S.F12],when:he.or(VN,ng.inPeekEditor),handler(s){zN(s,e=>{e.goToNextOrPreviousReference(!1)})}});_t.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");_t.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");_t.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");_t.registerCommand("closeReferenceSearch",s=>zN(s,e=>e.closeWidget()));So.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.EditorContrib-101,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(ng.inPeekEditor,he.not("config.editor.stablePeek"))});So.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.WorkbenchContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(VN,he.not("config.editor.stablePeek"),he.or(J.editorTextFocus,nRe.negate()))});So.registerCommandAndKeybindingRule({id:"revealReference",weight:Ae.WorkbenchContrib,primary:S.Enter,mac:{primary:S.Enter,secondary:[U.CtrlCmd|S.DownArrow]},when:he.and(VN,Sae,aRe.negate(),cRe.negate()),handler(s){const t=s.get(lg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Xk&&zN(s,i=>i.revealReference(t[0]))}});So.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Enter,mac:{primary:U.WinCtrl|S.Enter},when:he.and(VN,Sae,aRe.negate(),cRe.negate()),handler(s){const t=s.get(lg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Xk&&zN(s,i=>i.openReference(t[0],!0,!0))}});_t.registerCommand("openReference",s=>{const t=s.get(lg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof Xk&&zN(s,i=>i.openReference(t[0],!1,!0))});let Qve=class extends NM{constructor(e,t,i,n,o,r,a){super(!1,e,t,i,n,o,r,a)}};Qve=D([_(1,Le),_(2,Kt),_(3,bi),_(4,we),_(5,$i),_(6,Te)],Qve);on(NM.ID,Qve,ri.Lazy);const nFe=class nFe extends V{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(U.Alt)&&(this._altListeningMouse||(this._altMouseTriggered=!1),this._altListeningMouse=!0)})),this._register(this._editor.onKeyUp(t=>{t.equals(U.Alt)&&(this._altMouseTriggered&&t.preventDefault(),this._altListeningMouse=!1,this._altMouseTriggered=!1)}))}};nFe.ID="editor.contrib.menuPreventer";let MA=nFe;on(MA.ID,MA,ri.BeforeFirstInteraction);let V3=class extends vp{constructor(e,t,i,n,o,r,a,c,l){super(e,n.getRawOptions(),i,o,r,a,c,l),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(d=>this._onParentConfigurationChanged(d)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){gp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};V3=D([_(4,Le),_(5,we),_(6,Kt),_(7,lv),_(8,XA)],V3);const U6=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)}}}getImplementations(){return this._implementations}};class xXe extends pd{constructor(e){super(),this.label=e,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._domNode=fe(".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(){Ms(this._domNode),this._domNode.style.backgroundColor=Fpe(_y,ze(Hc)),this._domNode.style.color=Fpe(bM,ze(Rl)),this._domNode.style.border=`1px solid ${ze(wt)}`,re(this._domNode,fe("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let qJ=class extends V{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(fC(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[n]=i,o=this.createWidget(n,e);e.add(o),e.add(o.onClick(()=>n.run(this.getActionArg()))),o.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};qJ=D([_(1,Oa),_(2,Le)],qJ);let AHe=class extends qJ{constructor(e,t,i,n){super(e.menuId,i,n),this.options=e,this.instantiationService=t,this.render()}createWidget(e,t){const i=this.instantiationService.createInstance(xXe,e.label),n=i.getDomNode();return this.options.container.appendChild(n),t.add(Ee(()=>n.remove())),i}getActionArg(){return this.options.getActionArg()}};AHe=D([_(1,we),_(2,Oa),_(3,Le)],AHe);var Zq,FD;let EHe=(FD=class extends V{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),Qr(t)?this.doHighlightRange(t,e):W2(t)&&Qr(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&&ji(t,e.resource)&&Qr(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===Oi.NotSet||t.reason===Oi.Explicit||t.reason===Oi.Undo||t.reason===Oi.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?Zq._WHOLE_LINE_RANGE_HIGHLIGHT:Zq._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},Zq=FD,FD._WHOLE_LINE_RANGE_HIGHLIGHT=Gt.register({description:"codeeditor-range-highlight-whole",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),FD._RANGE_HIGHLIGHT=Gt.register({description:"codeeditor-range-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),FD);EHe=Zq=D([_(0,ei)],EHe);let QJ=class extends xXe{constructor(e,t,i,n){super(i&&n.lookupKeybinding(i)?`${t} (${n.lookupKeybinding(i).getLabel()})`:t),this.editor=e}getId(){return"editor.overlayWidget.floatingClickWidget"}getPosition(){return{preference:Wg.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};QJ=D([_(3,Ut)],QJ);var yB;let xHe=(yB=class extends qJ{constructor(e,t,i,n){super(_e.EditorContent,i,n),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(QJ,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof lf)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},yB.ID="editor.contrib.floatingClickMenu",yB);xHe=D([_(1,we),_(2,Oa),_(3,Le)],xHe);Object.freeze({id:"application",order:100,title:g(4506,"Application"),type:"object"});const V6=Object.freeze({id:"workbench",order:7,title:g(4507,"Workbench"),type:"object"}),PRt=Object.freeze({id:"security",scope:at.APPLICATION,title:g(4508,"Security"),type:"object",order:7}),FRt=Object.freeze({id:"problems",title:g(4509,"Problems"),type:"object",order:101}),DXe=Object.freeze({id:"window",order:8,title:g(4510,"Window"),type:"object"}),Mm={ConfigurationMigration:"base.contributions.configuration.migration"};class ORt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const eQ=new ORt;Qe.add(Mm.ConfigurationMigration,eQ);var CB;let jJ=(CB=class extends V{constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const n of i.added)await this.migrateConfigurationsForFolder(n,eQ.migrations)})),this.migrateConfigurations(eQ.migrations),this._register(eQ.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}),n=this.workspaceService.getWorkbenchState()===qi.WORKSPACE?[["user",St.USER],["userLocal",St.USER_LOCAL],["userRemote",St.USER_REMOTE],["workspace",St.WORKSPACE],["workspaceFolder",St.WORKSPACE_FOLDER]]:[["user",St.USER],["userLocal",St.USER_LOCAL],["userRemote",St.USER_REMOTE],["workspace",St.WORKSPACE]];for(const[o,r]of n){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,n,o){const r=c=>{const d=this.configurationService.inspect(c,{resource:n})[t];if(d)return o?d.overrides?.find(({identifiers:h})=>Ys(h,o))?.value:d.value},a=await e.migrateFn(i,r);return Array.isArray(a)?a:[[e.key,a]]}},CB.ID="workbench.contrib.configurationMigration",CB);jJ=D([_(0,Te),_(1,yi)],jJ);var SB;let YJ=(SB=class extends V{constructor(e){super(),this.remoteAgentService=e,this._ready=new dc,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Qn&&(await this.remoteAgentService.getEnvironment())?.os!==Ds.Windows)return;Qe.as(Nn.Configuration).registerConfiguration({...PRt,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:g(4511,"UNC host names must not contain backslashes.")},default:[],markdownDescription:g(4512,"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:at.MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:g(4513,"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:at.MACHINE}}})}},SB.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",SB);YJ=D([_(0,hg)],YJ);const w4="window.newWindowProfile";var AB;let JJ=(AB=class extends V{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!==St.DEFAULT&&i.affectsConfiguration(w4)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=Qe.as(Nn.Configuration),t={...DXe,properties:{[w4]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),g(4514,"Active Window")],description:g(4515,"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:at.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(w4);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(w4);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(w4,t?.name)}},AB.ID="workbench.contrib.dynamicWindowConfiguration",AB);JJ=D([_(0,Em),_(1,Te)],JJ);class BRt extends li{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Pe(4976,"Toggle Collapse Unchanged Regions"),icon:ve.map,toggled:he.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:he.has("isInDiffEditor"),menu:{when:he.has("isInDiffEditor"),id:_e.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class kXe extends li{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Pe(4977,"Toggle Show Moved Code Blocks"),precondition:he.has("isInDiffEditor")})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class IXe extends li{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Pe(4978,"Toggle Use Inline View When Space Is Limited"),precondition:he.has("isInDiffEditor")})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const z6=Pe(4979,"Diff Editor");class WRt extends gf{constructor(){super({id:"diffEditor.switchSide",title:Pe(4980,"Switch Side"),icon:ve.arrowSwap,precondition:he.has("isInDiffEditor"),f1:!0,category:z6})}runEditorCommand(e,t,i){const n=HU(e);if(n instanceof vp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class HRt extends gf{constructor(){super({id:"diffEditor.exitCompareMove",title:Pe(4981,"Exit Compare Move"),icon:ve.close,precondition:J.comparingMovedCode,f1:!1,category:z6,keybinding:{weight:1e4,primary:S.Escape}})}runEditorCommand(e,t,...i){const n=HU(e);n instanceof vp&&n.exitCompareMove()}}class URt extends gf{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Pe(4982,"Collapse All Unchanged Regions"),icon:ve.fold,precondition:he.has("isInDiffEditor"),f1:!0,category:z6})}runEditorCommand(e,t,...i){const n=HU(e);n instanceof vp&&n.collapseAllUnchangedRegions()}}class VRt extends gf{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Pe(4983,"Show All Unchanged Regions"),icon:ve.unfold,precondition:he.has("isInDiffEditor"),f1:!0,category:z6})}runEditorCommand(e,t,...i){const n=HU(e);n instanceof vp&&n.showAllUnchangedRegions()}}class jve extends li{constructor(){super({id:"diffEditor.revert",title:Pe(4984,"Revert"),f1:!1,category:z6})}run(e,t){const i=zRt(e,t.originalUri,t.modifiedUri);i instanceof vp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const TXe=Pe(4985,"Accessible Diff Viewer"),xse=class xse extends li{constructor(){super({id:xse.id,title:Pe(4986,"Go to Next Difference"),category:TXe,precondition:he.has("isInDiffEditor"),keybinding:{primary:S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){HU(e)?.accessibleDiffViewerNext()}};xse.id="editor.action.accessibleDiffViewer.next";let mW=xse;const Dse=class Dse extends li{constructor(){super({id:Dse.id,title:Pe(4987,"Go to Previous Difference"),category:TXe,precondition:he.has("isInDiffEditor"),keybinding:{primary:U.Shift|S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){HU(e)?.accessibleDiffViewerPrev()}};Dse.id="editor.action.accessibleDiffViewer.prev";let z3=Dse;function zRt(s,e,t){return s.get(Kt).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 HU(s){const t=s.get(Kt).listDiffEditors(),i=Bc();if(i)for(const n of t){const o=n.getContainerDomNode();if($Rt(o,i))return n}return null}function $Rt(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}var Pb;(function(s){s.Terminal="terminal",s.TerminalChat="terminal-chat",s.TerminalHelp="terminal-help",s.DiffEditor="diffEditor",s.Chat="panelChat",s.InlineChat="inlineChat",s.InlineCompletions="inlineCompletions",s.KeybindingsEditor="keybindingsEditor",s.Notebook="notebook",s.Editor="editor",s.Hover="hover",s.Notification="notification",s.EmptyEditorHint="emptyEditorHint",s.Comments="comments",s.Repl="repl",s.ReplHelp="replHelp",s.RunAndDebug="runAndDebug"})(Pb||(Pb={}));var wm;(function(s){s.Help="help",s.View="view"})(wm||(wm={}));var DHe;(function(s){s.Previous="previous",s.Next="next"})(DHe||(DHe={}));class LXe extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.id=e,this.options=t,this.provideContent=i,this.onClose=n,this.verbositySettingKey=o,this.onOpen=r,this.actions=a,this.provideNextContent=c,this.providePreviousContent=l,this.onDidChangeContent=d,this.onKeyDown=h,this.getSymbols=u,this.onDidRequestClearLastProvider=f}}const GRt=new Q("hasSpeechProvider",!1,{type:"boolean",description:g(6234,"A speech provider is registered to the speech service.")}),KRt=new Q("speechToTextInProgress",!1,{type:"boolean",description:g(6235,"A speech-to-text session is in progress.")});new Q("textToSpeechInProgress",!1,{type:"boolean",description:g(6236,"A text-to-speech session is in progress.")});var pF;(function(s){s[s.Started=1]="Started",s[s.Recognizing=2]="Recognizing",s[s.Recognized=3]="Recognized",s[s.Stopped=4]="Stopped",s[s.Error=5]="Error"})(pF||(pF={}));var Yve;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(Yve||(Yve={}));var kHe;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped",s[s.Canceled=3]="Canceled"})(kHe||(kHe={}));var XO;(function(s){s.SpeechTimeout="accessibility.voice.speechTimeout",s.AutoSynthesize="accessibility.voice.autoSynthesize",s.SpeechLanguage="accessibility.voice.speechLanguage"})(XO||(XO={}));XO.SpeechLanguage;const qRt={"da-DK":{name:g(6237,"Danish (Denmark)")},"de-DE":{name:g(6238,"German (Germany)")},"en-AU":{name:g(6239,"English (Australia)")},"en-CA":{name:g(6240,"English (Canada)")},"en-GB":{name:g(6241,"English (United Kingdom)")},"en-IE":{name:g(6242,"English (Ireland)")},"en-IN":{name:g(6243,"English (India)")},"en-NZ":{name:g(6244,"English (New Zealand)")},"en-US":{name:g(6245,"English (United States)")},"es-ES":{name:g(6246,"Spanish (Spain)")},"es-MX":{name:g(6247,"Spanish (Mexico)")},"fr-CA":{name:g(6248,"French (Canada)")},"fr-FR":{name:g(6249,"French (France)")},"hi-IN":{name:g(6250,"Hindi (India)")},"it-IT":{name:g(6251,"Italian (Italy)")},"ja-JP":{name:g(6252,"Japanese (Japan)")},"ko-KR":{name:g(6253,"Korean (South Korea)")},"nl-NL":{name:g(6254,"Dutch (Netherlands)")},"pt-PT":{name:g(6255,"Portuguese (Portugal)")},"pt-BR":{name:g(6256,"Portuguese (Brazil)")},"ru-RU":{name:g(6257,"Russian (Russia)")},"sv-SE":{name:g(6258,"Swedish (Sweden)")},"tr-TR":{name:g(6259,"Turkish (Türkiye)")},"zh-CN":{name:g(6260,"Chinese (Simplified, China)")},"zh-HK":{name:g(6261,"Chinese (Traditional, Hong Kong)")},"zh-TW":{name:g(6262,"Chinese (Traditional, Taiwan)")}},NA=new Q("accessibilityHelpIsShown",!1,!0),bp=new Q("accessibleViewIsShown",!1,!0),XJ=new Q("accessibleViewSupportsNavigation",!1,!0),IHe=new Q("accessibleViewVerbosityEnabled",!1,!0),THe=new Q("accessibleViewGoToSymbolSupported",!1,!0);new Q("accessibleViewOnLastLine",!1,!0);const ZJ=new Q("accessibleViewCurrentProviderId",void 0,void 0);new Q("accessibleViewInCodeBlock",void 0,void 0);const eX=new Q("accessibleViewContainsCodeBlocks",void 0,void 0),LHe=new Q("accessibleViewHasUnassignedKeybindings",void 0,void 0),RHe=new Q("accessibleViewHasAssignedKeybindings",void 0,void 0);var Jve;(function(s){s.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",s.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",s.HideAccessibleView="accessibility.hideAccessibleView",s.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(Jve||(Jve={}));var MHe;(function(s){s[s.Default=.75]="Default",s[s.Minimum=.2]="Minimum",s[s.Maximum=1]="Maximum"})(MHe||(MHe={}));var vr;(function(s){s.Terminal="accessibility.verbosity.terminal",s.DiffEditor="accessibility.verbosity.diffEditor",s.Chat="accessibility.verbosity.panelChat",s.InlineChat="accessibility.verbosity.inlineChat",s.TerminalChat="accessibility.verbosity.terminalChat",s.InlineCompletions="accessibility.verbosity.inlineCompletions",s.KeybindingsEditor="accessibility.verbosity.keybindingsEditor",s.Notebook="accessibility.verbosity.notebook",s.Editor="accessibility.verbosity.editor",s.Hover="accessibility.verbosity.hover",s.Notification="accessibility.verbosity.notification",s.EmptyEditorHint="accessibility.verbosity.emptyEditorHint",s.ReplInputHint="accessibility.verbosity.replInputHint",s.Comments="accessibility.verbosity.comments",s.DiffEditorActive="accessibility.verbosity.diffEditorActive",s.Debug="accessibility.verbosity.debug"})(vr||(vr={}));const yf={type:"boolean",default:!0,tags:["accessibility"]},RXe=Object.freeze({id:"accessibility",title:g(4679,"Accessibility"),type:"object"}),Ua={type:"string",enum:["auto","on","off"],default:"auto",enumDescriptions:[g(4680,"Enable sound when a screen reader is attached."),g(4681,"Enable sound."),g(4682,"Disable sound.")],tags:["accessibility"]},bd={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},wd={type:"string",enum:["auto","off"],default:"auto",enumDescriptions:[g(4683,"Enable announcement, will only play when in screen reader optimized mode."),g(4684,"Disable announcement.")],tags:["accessibility"]},UI={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...RXe,scope:at.RESOURCE,properties:(vr.Terminal+"",{description:g(4685,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...yf},vr.DiffEditor+"",{description:g(4686,"Provide information about how to navigate changes in the diff editor when it is focused."),...yf},vr.Chat+"",{description:g(4687,"Provide information about how to access the chat help menu when the chat input is focused."),...yf},vr.InlineChat+"",{description:g(4688,"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."),...yf},vr.InlineCompletions+"",{description:g(4689,"Provide information about how to access the inline completions hover and Accessible View."),...yf},vr.KeybindingsEditor+"",{description:g(4690,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...yf},vr.Notebook+"",{description:g(4691,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...yf},vr.Hover+"",{description:g(4692,"Provide information about how to open the hover in an Accessible View."),...yf},vr.Notification+"",{description:g(4693,"Provide information about how to open the notification in an Accessible View."),...yf},vr.EmptyEditorHint+"",{description:g(4694,"Provide information about relevant actions in an empty text editor."),...yf},vr.ReplInputHint+"",{description:g(4695,"Provide information about relevant actions For the Repl input."),...yf},vr.Comments+"",{description:g(4696,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...yf},vr.DiffEditorActive+"",{description:g(4697,"Indicate when a diff editor becomes the active editor."),...yf},vr.Debug+"",{description:g(4698,"Provide information about how to access the debug console accessibility help dialog when the debug console or run and debug viewlet is focused. Note that a reload of the window is required for this to take effect."),...yf},Jve.AccessibleViewCloseOnKeyPress+"",g(4699,"On keypress, close the Accessible View and focus the element from which it was invoked."),g(4700,"The volume of the sounds in percent (0-100)."),g(4701,"Whether or not position changes should be debounced"),g(4702,"The delay in milliseconds before an announcement is made."),g(4703,"The delay in milliseconds before a sound is played."),g(4704,"The delay in milliseconds before an announcement is made when there's a warning at the position."),g(4705,"The delay in milliseconds before a sound is played when there's a warning at the position."),g(4706,"The delay in milliseconds before an announcement is made when there's an error at the position."),g(4707,"The delay in milliseconds before a sound is played when there's an error at the position."),{...bd,description:g(4708,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."),properties:({description:g(4709,"Plays a sound when the active line has a breakpoint."),...Ua},{description:g(4710,"Announces when the active line has a breakpoint."),...wd})},{...UI,description:g(4711,"Plays a sound / audio cue when the active line has an inline suggestion."),properties:{description:g(4712,"Plays a sound when the active line has an inline suggestion."),...Ua}},{...bd,description:g(4713,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."),properties:({description:g(4714,"Plays a sound when the active line has an error."),...Ua},{description:g(4715,"Announces when the active line has an error."),...wd})},{...bd,description:g(4716,"Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."),properties:({description:g(4717,"Plays a sound when the active line has a folded area that can be unfolded."),...Ua},{description:g(4718,"Announces when the active line has a folded area that can be unfolded."),...wd})},{...bd,description:g(4719,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4720,"Plays a sound when the active line has a warning."),...Ua},{description:g(4721,"Announces when the active line has a warning."),...wd})},{...bd,description:g(4722,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4723,"Plays a sound when the active line has a warning."),...Ua},{description:g(4724,"Announces when the active line has a warning."),...wd})},{...bd,description:g(4725,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4726,"Plays a sound when the active line has a warning."),...Ua},{description:g(4727,"Announces when the active line has a warning."),...wd})},{...bd,description:g(4728,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."),properties:({description:g(4729,"Plays a sound when the debugger stopped on a breakpoint."),...Ua},{description:g(4730,"Announces when the debugger stopped on a breakpoint."),...wd})},{...bd,description:g(4731,"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(4732,"Plays a sound when trying to read a line with inlay hints that has no inlay hints."),...Ua},{description:g(4733,"Announces when trying to read a line with inlay hints that has no inlay hints."),...wd})},{...bd,description:g(4734,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."),properties:({description:g(4735,"Plays a sound when a task is completed."),...Ua},{description:g(4736,"Announces when a task is completed."),...wd})},{...bd,description:g(4737,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."),properties:({description:g(4738,"Plays a sound when a task fails (non-zero exit code)."),...Ua},{description:g(4739,"Announces when a task fails (non-zero exit code)."),...wd})},{...bd,description:g(4740,"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(4741,"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."),...Ua},{description:g(4742,"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."),...wd})},{...bd,description:g(4743,"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(4744,"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."),...Ua},{description:g(4745,"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."),...wd})},{...bd,description:g(4746,"Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."),properties:({description:g(4747,"Plays a sound when terminal Quick Fixes are available."),...Ua},{description:g(4748,"Announces when terminal Quick Fixes are available."),...wd})},{...bd,description:g(4749,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."),properties:({description:g(4750,"Plays a sound when the terminal bell is ringing."),...Ua},{description:g(4751,"Announces when the terminal bell is ringing."),...wd})},{...UI,description:g(4752,"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(4753,"Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...UI,description:g(4754,"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(4755,"Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...UI,description:g(4756,"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(4757,"Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...bd,description:g(4758,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."),properties:({description:g(4759,"Plays a sound when a notebook cell execution is successfully completed."),...Ua},{description:g(4760,"Announces when a notebook cell execution is successfully completed."),...wd})},{...bd,description:g(4761,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."),properties:({description:g(4762,"Plays a sound when a notebook cell execution fails."),...Ua},{description:g(4763,"Announces when a notebook cell execution fails."),...wd})},{...bd,description:g(4764,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."),properties:({description:g(4765,"Plays a sound when a chat request is made."),...Ua},{description:g(4766,"Announces when a chat request is made."),...wd})},{...bd,description:g(4767,"Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."),properties:({description:g(4768,"Plays a sound on loop while progress is occurring."),...Ua},{description:g(4769,"Alerts on loop while progress is occurring."),...wd})},{...UI,description:g(4770,"Plays a sound / audio cue when the response has been received."),properties:{description:g(4771,"Plays a sound on loop while the response has been received."),...Ua}},{...UI,description:g(4772,"Plays a sound / audio cue when the voice recording has started."),properties:{description:g(4773,"Plays a sound when the voice recording has started."),...Ua}},{...UI,description:g(4774,"Plays a sound / audio cue when the voice recording has stopped."),properties:{description:g(4775,"Plays a sound when the voice recording has stopped."),...Ua}},{...bd,description:g(4776,"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(4777,"Plays a sound when a feature is cleared."),...Ua},{description:g(4778,"Announces when a feature is cleared."),...wd})},g(4779,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."),g(4780,"Plays a sound when a file is saved."),g(4781,"Plays the sound when a user explicitly saves a file."),g(4782,"Plays the sound whenever a file is saved, including auto save."),g(4783,"Never plays the sound."),g(4784,"Announces when a file is saved."),g(4785,"Announces when a user explicitly saves a file."),g(4786,"Announces whenever a file is saved, including auto save."),g(4787,"Never plays the announcement."),g(4788,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."),g(4789,"Plays a sound when a file or notebook is formatted."),g(4790,"Plays the sound when a user explicitly formats a file."),g(4791,"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(4792,"Never plays the sound."),g(4793,"Announces when a file or notebook is formatted."),g(4794,"Announces when a user explicitly formats a file."),g(4795,"Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(4796,"Never announces."),g(4797,"Controls whether links should be underlined in the workbench."),g(4798,"Controls whether variable changes should be announced in the debug watch view."))});const QRt=1200;var EB;let NHe=(EB=class extends V{constructor(e,t){super(),this.speechService=e,this.productService=t,this._register(M.runAndSubscribe(e.onDidChangeHasSpeechProvider,()=>this.updateConfiguration()))}updateConfiguration(){if(!this.speechService.hasSpeechProvider)return;const e=this.getLanguages(),t=Object.keys(e).sort((n,o)=>e[n].name.localeCompare(e[o].name));Qe.as(Nn.Configuration).registerConfiguration({...RXe,properties:{[XO.SpeechTimeout]:{markdownDescription:g(4802,"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:QRt,minimum:0,tags:["accessibility"]},[XO.SpeechLanguage]:{markdownDescription:g(4803,"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(n=>e[n].name),enumItemLabels:t.map(n=>e[n].name)},[XO.AutoSynthesize]:{type:"boolean",markdownDescription:g(4804,"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(4805,"Auto (Use Display Language)")},...qRt}}},EB.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",EB);NHe=D([_(0,Kae),_(1,Er)],NHe);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(s,e)=>[["accessibility.signalOptions.volume",{value:s}],["audioCues.volume",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["audioCues.debouncePositionChanges",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(s,e)=>{const t=zhe(e,"general"),i=zhe(e,"errorAtPosition"),n=zhe(e,"warningAtPosition"),o=jRt(e),r=YRt(e);return[["accessibility.signalOptions.volume",{value:o}],["accessibility.signalOptions.debouncePositionChanges",{value:r}],["accessibility.signalOptions.experimental.delays.general",{value:t}],["accessibility.signalOptions.experimental.delays.errorAtPosition",{value:i}],["accessibility.signalOptions.experimental.delays.warningAtPosition",{value:n}],["accessibility.signalOptions",{value:void 0}]]}}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:s=>[["accessibility.signalOptions.volume",{value:s}],["accessibility.signals.sounds.volume",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}]);function zhe(s,e){return s(`accessibility.signalOptions.experimental.delays.${e}`)||s("accessibility.signalOptions")?.["experimental.delays"]?.[`${e}`]||s("accessibility.signalOptions")?.delays?.[`${e}`]}function jRt(s){return s("accessibility.signalOptions.volume")||s("accessibility.signalOptions")?.volume||s("accessibility.signals.sounds.volume")||s("audioCues.volume")}function YRt(s){return s("accessibility.signalOptions.debouncePositionChanges")||s("accessibility.signalOptions")?.debouncePositionChanges||s("accessibility.signals.debouncePositionChanges")||s("audioCues.debouncePositionChanges")}Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(s,e)=>[["accessibility.signals.progress",{value:s}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations(cl.allAccessibilitySignals.map(s=>s.legacySoundSettingsKey?{key:s.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],n=s.legacyAnnouncementSettingsKey;let o;return n&&(o=t(n)??void 0,o!==void 0&&typeof o!="string"&&(o=o?"auto":"off")),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${s.settingsKey}`,{value:o!==void 0?{announcement:o,sound:e}:{sound:e}}]),i}}:void 0).filter(Fc));Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations(cl.allAccessibilitySignals.filter(s=>!!s.legacyAnnouncementSettingsKey&&!!s.legacySoundSettingsKey).map(s=>({key:s.legacyAnnouncementSettingsKey,migrateFn:(e,t)=>{const i=[],n=t(s.settingsKey)?.sound||t(s.legacySoundSettingsKey);return e!==void 0&&typeof e!="string"&&(e=e?"auto":"off"),i.push([`${s.settingsKey}`,{value:e!==void 0?{announcement:e,sound:n}:{sound:n}}]),i.push([`${s.legacyAnnouncementSettingsKey}`,{value:void 0}]),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i}})));var Xd;(function(s){s.OpenAccessibleView="editor.action.accessibleView",s.OpenAccessibilityHelp="editor.action.accessibilityHelp",s.DisableVerbosityHint="editor.action.accessibleViewDisableHint",s.GoToSymbol="editor.action.accessibleViewGoToSymbol",s.ShowNext="editor.action.accessibleViewNext",s.ShowPrevious="editor.action.accessibleViewPrevious",s.AccessibleViewAcceptInlineCompletion="editor.action.accessibleViewAcceptInlineCompletion",s.NextCodeBlock="editor.action.accessibleViewNextCodeBlock",s.PreviousCodeBlock="editor.action.accessibleViewPreviousCodeBlock",s.AccessibilityHelpConfigureKeybindings="editor.action.accessibilityHelpConfigureKeybindings",s.AccessibilityHelpConfigureAssignedKeybindings="editor.action.accessibilityHelpConfigureAssignedKeybindings",s.AccessibilityHelpOpenHelpLink="editor.action.accessibilityHelpOpenHelpLink"})(Xd||(Xd={}));function JRt(s){const e=new Z,t=e.add(GGe());return e.add(ai(i=>{t.setStyle(s.read(i))})),e}const MXe="editor.action.inlineSuggest.commit",NXe="editor.action.inlineSuggest.showPrevious",PXe="editor.action.inlineSuggest.showNext";var XRt=".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}";ut(XRt,{});class $3{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 B2([...this.parts.map(i=>new au(F.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 ${s.identifier.value}`)}class ELt{constructor(e,t,i,n){this.codeLoadingTime=e,this.activateCallTime=t,this.activateResolvedTime=i,this.activationReason=n}}class xLt{constructor(e,t){this.description=e,this.value=t}}var Lb;(function(s){s[s.Normal=0]="Normal",s[s.Immediate=1]="Immediate"})(Lb||(Lb={}));function Xae(s){return{type:s.isBuiltin?br.System:br.User,isBuiltin:s.isBuiltin||s.isUserBuiltin,identifier:{id:xw(s.publisher,s.name),uuid:s.uuid},manifest:s,location:s.extensionLocation,targetPlatform:s.targetPlatform,validations:[],isValid:!0}}function aD(s,e){const t=DM(s.manifest.publisher,s.manifest.name);return{id:t,identifier:new Sn(t),isBuiltin:s.type===br.System,isUserBuiltin:s.type===br.User&&s.isBuiltin,isUnderDevelopment:!!e,extensionLocation:s.location,uuid:s.identifier.uuid,targetPlatform:s.targetPlatform,publisherDisplayName:s.publisherDisplayName,...s.manifest}}class DLt{constructor(){this.onDidRegisterExtensions=M.None,this.onDidChangeExtensionsStatus=M.None,this.onDidChangeExtensions=M.None,this.onWillActivateByEvent=M.None,this.onDidChangeResponsiveChange=M.None,this.onWillStop=M.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 lXe=ae("ILanguageModelStatsService"),kLt=ae("accessibleViewInformationService"),ILt=ae("IUserDataProfileStorageService"),TLt=ae("integrityService"),Zae=ae("ITrustedDomainService"),dXe=ae("ILanguageModelToolsService");function E(){throw new Error("unsupported")}async function LLt(s){await new Promise(e=>setTimeout(e,s))}function RLt(s,e,t){let i=Promise.resolve(),n=null;return async o=>{n==null?(n=o,i=i.then(async()=>LLt(t)).then(async()=>{const r=n;n=null,await s(r)})):n=e(n,o),await i}}const MLt={};let NLt;function PLt(s){return MLt[s]}function FLt(){return NLt}var dK;ce(lf,class extends lQe{constructor(){super(Gn.Info,N.file("logs.log"))}doCreateLogger(){return new dQe}},0);ce(ei,class{constructor(){this._serviceBrand=void 0,this.onWillOpenEditor=M.None,this.onDidActiveEditorChange=M.None,this.onDidVisibleEditorsChange=M.None,this.onDidEditorsChange=M.None,this.onDidCloseEditor=M.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=E,this.openEditors=E,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 Dt.get(Kt).getFocusedCodeEditor()??void 0}createScoped(){return this}},0);ce(Dm,class{constructor(){this._serviceBrand=void 0,this.onDidPaneCompositeOpen=M.None,this.onDidPaneCompositeClose=M.None,this.openPaneComposite=async()=>{},this.getActivePaneComposite=()=>{},this.getPaneComposite=()=>{},this.getPaneComposites=()=>[],this.getPinnedPaneCompositeIds=()=>[],this.getVisiblePaneCompositeIds=()=>[],this.getProgressIndicator=()=>{},this.hideActivePaneComposite=()=>{},this.getLastActivePaneCompositeId=E,this.showActivity=()=>V.None}},0);ce(ks,Cve,1);ce(Fo,class{constructor(){this.isDirty=E,this.save=E,this.saveAs=E,this.revert=E,this.read=E,this.readStream=E,this.write=E,this.create=E,this.getEncodedReadable=E,this.getDecodedStream=E,this.dispose=E}get files(){return E()}get untitled(){return E()}get encoding(){return E()}},0);ce(Jt,class{constructor(){this._serviceBrand=void 0,this.onDidChangeFileSystemProviderRegistrations=M.None,this.onDidChangeFileSystemProviderCapabilities=M.None,this.onWillActivateFileSystemProvider=M.None,this.registerProvider=E,this.getProvider=function(){},this.activateProvider=async()=>{},this.canHandleResource=async()=>!1,this.hasProvider=()=>!1,this.hasCapability=()=>!1,this.listCapabilities=()=>[],this.onDidFilesChange=M.None,this.onDidRunOperation=M.None,this.resolve=E,this.resolveAll=E,this.stat=E,this.exists=async()=>!1,this.readFile=E,this.readFileStream=E,this.writeFile=E,this.move=E,this.canMove=E,this.copy=E,this.canCopy=E,this.cloneFile=E,this.createFile=E,this.canCreateFile=E,this.createFolder=E,this.del=E,this.canDelete=E,this.onDidWatchError=M.None,this.watch=E,this.createWatcher=E}dispose(){}},0);let OLt=class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=E,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.createEditorActions=E,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=E,this.notifyIndexChanged=E,this.relayout=E,this.dispose=E,this.toJSON=E,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=E,this.onDidModelChange=M.None,this.onWillDispose=M.None,this.onDidActiveEditorChange=M.None,this.onWillCloseEditor=M.None,this.onDidCloseEditor=M.None,this.onWillMoveEditor=M.None,this.onWillOpenEditor=M.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=E,this.openEditor=E,this.openEditors=E,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=E,this.moveEditors=E,this.copyEditor=E,this.copyEditors=E,this.closeEditor=E,this.closeEditors=E,this.closeAllEditors=E,this.replaceEditors=E,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=E,this.isLast=E}get groupsView(){return E()}notifyLabelChanged(){}get titleHeight(){return E()}get element(){return E()}get scopedContextKeyService(){return Dt.get(Le)}focus(){}};const BJ=new OLt;let BLt=class{constructor(){this.windowId=si.vscodeWindowId,this.hasMaximizedGroup=()=>!1,this.onDidLayout=M.None,this.onDidScroll=M.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=E,this.isLayoutCentered=E,this.enforcePartOptions=E,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.onDidChangeGroupMaximized=M.None,this.activeGroup=BJ,this.groups=[BJ],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=E,this.getSize=E,this.setSize=E,this.arrangeGroups=E,this.toggleMaximizeGroup=E,this.toggleExpandGroup=E,this.applyLayout=E,this.getLayout=E,this.setGroupOrientation=E,this.findGroup=()=>{},this.addGroup=E,this.removeGroup=E,this.moveGroup=E,this.mergeGroup=E,this.mergeAllGroups=E,this.copyGroup=E,this.partOptions=Bae,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=E}get contentDimension(){return E()}get sideGroup(){return E()}},WLt=class{constructor(){this.registerContextKeyProvider=E,this.saveWorkingSet=E,this.getWorkingSets=E,this.applyWorkingSet=E,this.deleteWorkingSet=E,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new BLt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=E,this.createAuxiliaryEditorPart=E,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=E,this.toggleExpandGroup=E,this.partOptions=Bae,this.createEditorDropTarget=E,this._serviceBrand=void 0,this.getLayout=E,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidLayout=M.None,this.onDidScroll=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.activeGroup=BJ,this.groups=[BJ],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=E,this.getSize=E,this.setSize=E,this.arrangeGroups=E,this.applyLayout=E,this.centerLayout=E,this.isLayoutCentered=()=>!1,this.setGroupOrientation=E,this.findGroup=()=>{},this.addGroup=E,this.removeGroup=E,this.moveGroup=E,this.mergeGroup=E,this.mergeAllGroups=E,this.copyGroup=E,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=E}get contentDimension(){return E()}get sideGroup(){return E()}};ce(Po,WLt,0);ce(QTt,class{focus(){}focusNextAction(){}focusPreviousAction(){}hide(){}show(){}},0);ce(rLt,class{constructor(){this.getPart=E,this.createAuxiliaryTitlebarPart=E,this.dispose=E,this.onMenubarVisibilityChange=M.None,this.isCommandCenterVisible=!1,this.onDidChangeCommandCenterVisibility=M.None,this.registerVariables=()=>{}}updateProperties(){}},0);ce(Hb,class{constructor(){this.onWillRunWorkingCopyFileOperation=M.None,this.onDidFailWorkingCopyFileOperation=M.None,this.onDidRunWorkingCopyFileOperation=M.None,this.addFileOperationParticipant=E,this.hasSaveParticipants=!1,this.addSaveParticipant=E,this.runSaveParticipants=E,this.create=E,this.createFolder=E,this.move=E,this.copy=E,this.delete=E,this.registerWorkingCopyProvider=E,this.getDirty=()=>[]}},0);ce(mf,class{constructor(){this.defaultUriScheme="file",this.fileURI=E,this.userHome=E,this.hasValidBasename=E,this.resolvedUserHome=void 0}get path(){return E()}},1);ce(Er,class{constructor(){this._serviceBrand=void 0,this.version="1.92.2",this.commit="fee1edb8d6d72a0ddff41e5f71a671c23ed924b9",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(C1t,class{constructor(){this._serviceBrand=void 0,this.getConfigBasedTips=async()=>[],this.getImportantExecutableBasedTips=async()=>[],this.getOtherExecutableBasedTips=async()=>[]}},0);ce(Kae,class{constructor(){this.onDidChange=M.None,this.addStatus=E,this.getLanguageStatus=E}},1);ce(xc,class{constructor(){this.getPathForFile=()=>{},this.onDidChangeFullScreen=M.None,this.onDidChangeFocus=M.None,this.hasFocus=!1,this.hadLastFocus=async()=>!1,this.focus=E,this.onDidChangeActiveWindow=M.None,this.openWindow=E,this.toggleFullScreen=E,this.moveTop=E,this.getCursorScreenPoint=E,this.restart=E,this.reload=E,this.close=E,this.withExpectedShutdown=E}},0);ce(Zu,class extends kve{constructor(){super(...arguments),this.shutdown=E}},0);ce(M6,class{isEnabledForLanguage(){return!1}async detectLanguage(){}},0);ce(fs,DLt,0);ce(Mae,class{constructor(){this.onDidChangeKeyboardLayout=M.None,this.getRawKeyboardMapping=()=>null,this.getCurrentKeyboardLayout=()=>null,this.getAllKeyboardLayouts=()=>[],this.getKeyboardMapper=()=>new xve(!1,po),this.validateCurrentKeyboardMapping=()=>{}}},1);ce(Jae,class{async requiresInitialization(){return!1}async whenInitializationFinished(){}async initializeRequiredResources(){}async initializeInstalledExtensions(){}async initializeOtherResources(){}},0);ce(sXe,class{constructor(){this.dark=!1,this.highContrast=!1,this.onDidChangeColorScheme=M.None}},0);let Ive=class{constructor(e){this.profileService=e,this.onDidDefaultSettingsContentChanged=M.None,this.getDefaultSettingsContent=()=>{},this.hasDefaultSettingsContent=()=>!1,this.getSetting=()=>{},this.userSettingsResource=this.profileService.currentProfile.settingsResource,this.workspaceSettingsResource=null,this.getFolderSettingsResource=E,this.createPreferencesEditorModel=E,this.resolveModel=E,this.createSettings2EditorModel=E,this.openRawDefaultSettings=E,this.openSettings=E,this.openUserSettings=E,this.openRemoteSettings=E,this.openWorkspaceSettings=E,this.openFolderSettings=E,this.openGlobalKeybindingSettings=E,this.openDefaultKeybindingsFile=E,this.getEditableSettingsURI=E,this.createSplitJsonEditorInput=E,this.openApplicationSettings=E,this.openLanguageSpecificSettings=E}};Ive=D([_(0,lg)],Ive);ce(N6,Ive,0);ce(oLt,class{constructor(){this.onDidEncounterLanguage=M.None,this.createGrammar=E,this.startDebugMode=E,this.createTokenizer=E}},0);let Tve=class{constructor(e){this.profileService=e,this.onDidResetWorkspaces=M.None,this.isEnabled=()=>!1,this.createNamedProfile=E,this.createTransientProfile=E,this.resetWorkspaces=E,this.cleanUp=E,this.cleanUpTransientProfiles=E,this.defaultProfile=this.profileService.currentProfile,this.onDidChangeProfiles=M.None,this.profiles=[this.profileService.currentProfile],this.createProfile=E,this.updateProfile=E,this.setProfileForWorkspace=E,this.getProfile=()=>this.profileService.currentProfile,this.removeProfile=E}get profilesHome(){return E()}};Tve=D([_(0,lg)],Tve);ce(Cm,Tve,0);ce(ILt,class{constructor(){this.onDidChange=M.None,this.readStorageData=E,this.updateStorageData=E,this.withProfileScopedStorageService=E}},0);let Lve=class extends uLt{constructor(e){super({...rV("__default__profile__","Default",e.userRoamingDataHome,Pt(e.cacheHome,"CachedProfilesData")),isDefault:!0})}};Lve=D([_(0,Za)],Lve);ce(lg,Lve,0);ce(aRe,sJe,0);ce(Uae,class{constructor(){this.getSnippetFiles=E,this.isEnabled=E,this.updateEnablement=E,this.updateUsageTimestamp=E,this.getSnippets=async()=>[],this.getSnippetsSync=E}},0);const HLt={getSession:()=>{},getSessions:()=>[],getBreakpoints:()=>[],areBreakpointsActivated:()=>!1,getFunctionBreakpoints:()=>[],getDataBreakpoints:()=>[],getExceptionBreakpoints:()=>[],getExceptionBreakpointsForSession:()=>[],getInstructionBreakpoints:()=>[],getWatchExpressions:()=>[],onDidChangeBreakpoints:M.None,onDidChangeCallStack:M.None,onDidChangeWatchExpressions:M.None,fetchCallstack:E,getId:E,registerBreakpointModes:E,getBreakpointModes:()=>[],onDidChangeWatchExpressionValue:M.None};class ULt{constructor(){this.setVisualizedExpression=E,this.getVisualizedExpression=()=>{},this.onDidChangeVisualization=M.None,this.getId=E,this.focusedSession=void 0,this.focusedThread=void 0,this.focusedStackFrame=void 0,this.getSelectedExpression=E,this.setSelectedExpression=E,this.updateViews=E,this.isMultiSessionView=E,this.onDidFocusSession=M.None,this.onDidFocusStackFrame=M.None,this.onDidSelectExpression=M.None,this.onDidEvaluateLazyExpression=M.None,this.onWillUpdateViews=M.None,this.onDidFocusThread=M.None,this.evaluateLazyExpression=E}}class VLt{constructor(){this.onDidRegisterDebugger=M.None,this.hasEnabledDebuggers=()=>!1,this.getDebugAdapterDescriptor=E,this.getDebuggerLabel=E,this.someDebuggerInterestedInLanguage=()=>!1,this.getDebugger=()=>{},this.activateDebuggers=E,this.registerDebugAdapterFactory=()=>V.None,this.createDebugAdapter=E,this.registerDebugAdapterDescriptorFactory=E,this.unregisterDebugAdapterDescriptorFactory=E,this.substituteVariables=E,this.runInTerminal=E,this.getEnabledDebugger=E,this.guessDebugger=E,this.onDidDebuggersExtPointRead=M.None}}ce(HRe,class{constructor(){this.initializingOptions=void 0,this.sendBreakpoints=E,this.updateDataBreakpoint=E,this.onDidChangeState=M.None,this.onDidNewSession=M.None,this.onWillNewSession=M.None,this.onDidEndSession=M.None,this.getConfigurationManager=E,this.getAdapterManager=()=>new VLt,this.focusStackFrame=E,this.canSetBreakpointsIn=E,this.addBreakpoints=E,this.updateBreakpoints=E,this.enableOrDisableBreakpoints=E,this.setBreakpointsActivated=E,this.removeBreakpoints=E,this.addFunctionBreakpoint=E,this.updateFunctionBreakpoint=E,this.removeFunctionBreakpoints=E,this.addDataBreakpoint=E,this.removeDataBreakpoints=E,this.addInstructionBreakpoint=E,this.removeInstructionBreakpoints=E,this.setExceptionBreakpointCondition=E,this.setExceptionBreakpointsForSession=E,this.sendAllBreakpoints=E,this.addWatchExpression=E,this.renameWatchExpression=E,this.moveWatchExpression=E,this.removeWatchExpressions=E,this.startDebugging=E,this.restartSession=E,this.stopSession=E,this.sourceIsNotAvailable=E,this.getModel=()=>HLt,this.getViewModel=()=>new ULt,this.runTo=E}get state(){return E()}},0);ce(E6,class{constructor(){this.lookupAuthorization=E,this.lookupKerberosAuthorization=E,this.request=E,this.resolveProxy=E,this.loadCertificates=E}},0);ce(fae,class{constructor(){this.onDidInitiateOpenFilesTrustRequest=M.None,this.onDidInitiateWorkspaceTrustRequest=M.None,this.onDidInitiateWorkspaceTrustRequestOnStartup=M.None,this.completeOpenFilesTrustRequest=E,this.requestOpenFilesTrust=async()=>1,this.cancelWorkspaceTrustRequest=E,this.completeWorkspaceTrustRequest=E,this.requestWorkspaceTrust=async()=>!0,this.requestWorkspaceTrustOnStartup=()=>null}},0);ce(qTt,class{constructor(){this.onDidChangeActivity=M.None,this.getViewContainerActivities=E,this.getActivity=E,this.showViewContainerActivity=()=>V.None,this.showViewActivity=()=>V.None,this.showAccountsActivity=()=>V.None,this.showGlobalActivity=()=>V.None}},0);ce(tJe,class{constructor(){this.reload=E,this.onReload=M.None,this.close=E,this.onClose=M.None,this.attachSession=E,this.onAttachSession=M.None,this.terminateSession=E,this.onTerminateSession=M.None,this.openExtensionDevelopmentHostWindow=E}},0);ce(km,class{constructor(){this.getFocusedViewName=E,this.onDidChangeFocusedView=M.None,this.onDidChangeViewContainerVisibility=M.None,this.isViewContainerVisible=()=>!1,this.openViewContainer=E,this.closeViewContainer=E,this.getVisibleViewContainer=E,this.getActiveViewPaneContainerWithId=()=>null,this.onDidChangeViewVisibility=M.None,this.isViewVisible=()=>!1,this.openView=async()=>null,this.closeView=E,this.getActiveViewWithId=()=>null,this.getViewWithId=()=>null,this.getViewProgressIndicator=()=>{}}},0);ce(Sm,class{constructor(){this.viewContainers=[],this.onDidChangeViewContainers=M.None,this.getDefaultViewContainer=()=>{},this.getViewContainerById=()=>null,this.isViewContainerRemovedPermanently=E,this.getDefaultViewContainerLocation=()=>null,this.getViewContainerLocation=()=>null,this.getViewContainersByLocation=E,this.getViewContainerModel=()=>({onDidChangeAllViewDescriptors:M.None,visibleViewDescriptors:[]}),this.onDidChangeContainerLocation=M.None,this.moveViewContainerToLocation=E,this.getViewContainerBadgeEnablementState=E,this.setViewContainerBadgeEnablementState=E,this.getViewDescriptorById=()=>null,this.getViewContainerByViewId=()=>null,this.getDefaultContainerById=()=>null,this.getViewLocationById=()=>null,this.onDidChangeContainer=M.None,this.moveViewsToContainer=E,this.onDidChangeLocation=M.None,this.moveViewToLocation=()=>null,this.reset=()=>null}},0);ce(JTt,class{constructor(){this.suspendTracking=()=>({dispose(){}}),this.goForward=E,this.goBack=E,this.goPrevious=E,this.goLast=E,this.reopenLastClosedEditor=E,this.getHistory=()=>[],this.removeFromHistory=E,this.getLastActiveWorkspaceRoot=()=>{},this.getLastActiveFile=()=>{},this.openNextRecentlyUsedEditor=E,this.openPreviouslyUsedEditor=E,this.clear=E,this.clearRecentlyOpened=E}},0);ce(MJe,class{constructor(){this.onDidChangeTaskConfig=M.None,this.onDidStateChange=M.None,this.supportsMultipleTaskExecutions=!1,this.configureAction=E,this.run=E,this.inTerminal=()=>!1,this.getActiveTasks=async()=>[],this.getBusyTasks=E,this.terminate=E,this.tasks=E,this.taskTypes=E,this.getWorkspaceTasks=E,this.getSavedTasks=E,this.removeRecentlyUsedTask=E,this.getTask=E,this.tryResolveTask=E,this.createSorter=E,this.getTaskDescription=E,this.customize=E,this.openConfig=E,this.registerTaskProvider=E,this.registerTaskSystem=()=>{},this.onDidChangeTaskSystemInfo=M.None,this.hasTaskSystemInfo=!1,this.registerSupportedExecutions=()=>{},this.extensionCallbackTaskComplete=E,this.isReconnected=!1,this.onDidReconnectToTasks=M.None}},0);ce(qRe,class{constructor(){this.resolveWithEnvironment=E,this.resolveAsync=E,this.resolveAnyAsync=E,this.resolveAnyMap=E,this.resolveWithInteractionReplace=E,this.resolveWithInteraction=E,this.contributeVariable=E}},0);ce(cg,class{constructor(){this.endConnection=E,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(Jdt,D1t,0);let Rve=class{constructor(e){this.modelService=e,this.aiTextSearch=E,this.textSearchSplitSyncAsync=E,this.registerSearchResultProvider=E}async textSearch(){return{results:[],messages:[]}}async fileSearch(){return{results:this.modelService.getModels().map(e=>({resource:e.uri})),messages:[]}}async clearCache(){}};Rve=D([_(0,gi)],Rve);ce(jae,Rve,0);ce(RRe,class{constructor(){this.registerEditSessionIdentityProvider=()=>V.None,this.getEditSessionIdentifier=async()=>{},this.provideEditSessionIdentityMatch=async()=>{},this.addEditSessionIdentityCreateParticipant=()=>V.None,this.onWillCreateEditSessionIdentity=async()=>{}}},0);ce(Zy,class{constructor(){this.addFolders=E,this.removeFolders=E,this.updateFolders=E,this.enterWorkspace=E,this.createAndEnterWorkspace=E,this.saveAndEnterWorkspace=E,this.copyWorkspaceSettings=E,this.pickNewWorkspacePath=E}},0);ce(oXe,class{constructor(){this.getStartTime=E,this.whenReady=E,this.setPerformanceMarks=()=>{},this.getPerformanceMarks=E,this.getDuration=E}get perfBaseline(){return E()}get startupMetrics(){return E()}},0);ce(Xo,class{constructor(){this.shouldRequireConsentToUpdate=async()=>{},this.updateAutoUpdateValue=E,this.getResourceExtensions=E,this.updateRunningExtensions=E,this.togglePreRelease=E,this.isAutoUpdateEnabledFor=E,this.updateAutoUpdateEnablementFor=E,this.isAutoUpdateEnabled=E,this.getAutoUpdateValue=E,this.updateAll=E,this.toggleApplyExtensionToAllProfiles=E,this.whenInitialized=Promise.resolve(),this.onChange=M.None,this.onReset=M.None,this.preferPreReleases=!1,this.local=[],this.installed=[],this.outdated=[],this.queryLocal=E,this.queryGallery=E,this.getExtensions=E,this.canInstall=E,this.install=E,this.installInServer=E,this.uninstall=E,this.installVersion=E,this.reinstall=E,this.canSetLanguage=E,this.setLanguage=E,this.setEnablement=E,this.pinExtension=E,this.open=E,this.checkForUpdates=E,this.getExtensionStatus=E,this.isExtensionIgnoredToSync=E,this.toggleExtensionIgnoredToSync=E}},0);ce(av,class{constructor(){this._serviceBrand=void 0,this.localExtensionManagementServer=null,this.remoteExtensionManagementServer=null,this.webExtensionManagementServer=null,this.getExtensionManagementServer=E,this.getExtensionInstallLocation=E}},0);ce(ZJe,class{constructor(){this.onDidChangeRecommendations=M.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(G1t,class{constructor(){this.onError=M.None,this.turnOn=E,this.turnOff=E,this.triggerSync=E}},0);ce(W1t,class{constructor(){this.getIgnoredExtensions=()=>[],this.hasToNeverSyncExtension=()=>!1,this.hasToAlwaysSyncExtension=()=>!1,this.updateIgnoredExtensions=E,this.updateSynchronizedExtensions=E}},0);ce(A1t,class{constructor(){this.ignoredRecommendations=[],this.hasToIgnoreRecommendationNotifications=()=>!1,this.promptImportantExtensionsInstallNotification=E,this.promptWorkspaceRecommendations=E}},0);ce(QRe,class{constructor(){this.scanSystemExtensions=async()=>[],this.scanUserExtensions=async()=>[],this.scanExtensionsUnderDevelopment=async()=>[],this.scanExistingExtension=async()=>null,this.addExtension=E,this.addExtensionFromGallery=E,this.removeExtension=async()=>{},this.copyExtensions=async()=>{},this.updateMetadata=E,this.scanExtensionManifest=async()=>null}},0);ce(S1t,class{constructor(){this.onDidChangeCache=M.None,this.getTargetPlatform=E,this.scanAllExtensions=E,this.scanSystemExtensions=E,this.scanUserExtensions=E,this.scanExtensionsUnderDevelopment=E,this.scanExistingExtension=E,this.scanOneOrMultipleExtensions=E,this.scanMultipleExtensions=E,this.scanMetadata=E,this.updateMetadata=E,this.initializeDefaultProfileExtensions=E}get systemExtensionsLocation(){return E()}get userExtensionsLocation(){return E()}},0);ce(Lae,class{constructor(){this.onAddExtensions=M.None,this.onDidAddExtensions=M.None,this.onRemoveExtensions=M.None,this.onDidRemoveExtensions=M.None,this.scanProfileExtensions=E,this.addExtensionsToProfile=E,this.updateMetadata=E,this.removeExtensionFromProfile=E}},0);ce(Gae,class{constructor(){this.onDidChangeIgnoredRecommendations=M.None,this.ignoredRecommendations=[],this.onDidChangeGlobalIgnoredRecommendation=M.None,this.globalIgnoredRecommendations=[],this.toggleGlobalIgnoredRecommendation=E}},0);ce(YTt,class{constructor(){this.onDidChangeExtensionsConfigs=M.None,this.getExtensionsConfigs=E,this.getRecommendations=E,this.getUnwantedRecommendations=E,this.toggleRecommendation=E,this.toggleUnwantedRecommendation=E}},0);ce(Ml,class{constructor(){this.getEnablementStates=e=>e.map(()=>8),this.onEnablementChanged=M.None,this.getEnablementState=()=>8,this.getDependenciesEnablementStates=()=>[],this.canChangeEnablement=()=>!1,this.canChangeWorkspaceEnablement=()=>!1,this.isEnabled=()=>!0,this.isEnabledEnablementState=()=>!0,this.isDisabledGlobally=()=>!1,this.setEnablement=E,this.updateExtensionsEnablementsWhenWorkspaceTrustChanges=E}},0);ce(Fae,class{constructor(){this.canChangeProtocol=!1,this.tunnels=Promise.resolve([]),this.canChangePrivacy=!1,this.privacyOptions=[],this.onTunnelOpened=M.None,this.onTunnelClosed=M.None,this.canElevate=!1,this.hasTunnelProvider=!1,this.onAddedTunnelProvider=M.None,this.canTunnel=()=>!1,this.openTunnel=E,this.getExistingTunnel=async()=>{},this.setEnvironmentTunnel=E,this.closeTunnel=E,this.setTunnelProvider=E,this.setTunnelFeatures=E,this.isPortPrivileged=()=>!1}},0);ce(pd,class{constructor(){this.onDidChangeAutoSaveConfiguration=M.None,this.onDidChangeAutoSaveDisabled=M.None,this.hasShortAutoSaveDelay=()=>!1,this.disableAutoSave=E,this.onDidChangeReadonly=M.None,this.onDidChangeFilesAssociation=M.None,this.onAutoSaveConfigurationChange=M.None,this.getAutoSaveConfiguration=E,this.getAutoSaveMode=E,this.toggleAutoSave=E,this.onReadonlyChange=M.None,this.isReadonly=E,this.updateReadonly=E,this.onFilesAssociationChange=M.None,this.isHotExitEnabled=!0,this.hotExitConfiguration=void 0,this.preventSaveConflicts=E}},0);ce(P6,class{constructor(){this.onDidCreate=M.None,this.canDispose=()=>!0,this.isUntitledWithAssociatedResource=()=>!1,this.onDidChangeDirty=M.None,this.onDidChangeEncoding=M.None,this.onDidChangeLabel=M.None,this.onWillDispose=M.None,this.create=E,this.get=()=>{},this.getValue=()=>{},this.resolve=E}},0);ce(F6,class{async hasBackups(){return!1}hasBackupSync(){return!1}async getBackups(){return[]}async resolve(){}async backup(){}async discardBackup(){}async discardBackups(){}},0);ce(Im,class{constructor(){this.onDidRegister=M.None,this.onDidUnregister=M.None,this.onDidChangeDirty=M.None,this.onDidChangeContent=M.None,this.onDidSave=M.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 V.None}},0);ce(eE,class{constructor(){this.onDidChangeDecorations=M.None,this.registerDecorationsProvider=E,this.getDecoration=()=>{}}},0);ce(R6,class{constructor(){this.isSupported=()=>!1,this.writeFileElevated=E}},0);ce(sg,class{constructor(){this.preferredHome=E,this.defaultFilePath=E,this.defaultFolderPath=E,this.defaultWorkspacePath=E,this.pickFileFolderAndOpen=E,this.pickFileAndOpen=E,this.pickFolderAndOpen=E,this.pickWorkspaceAndOpen=E,this.pickFileToSave=E,this.showSaveDialog=E,this.showSaveConfirm=E,this.showOpenDialog=E}},0);ce(yI,class{constructor(){this.write=E}},1);ce(wI,class{constructor(){this.enterWorkspace=E,this.createUntitledWorkspace=E,this.deleteUntitledWorkspace=E,this.getWorkspaceIdentifier=E,this.onDidChangeRecentlyOpened=M.None,this.addRecentlyOpened=E,this.removeRecentlyOpened=E,this.clearRecentlyOpened=E,this.getRecentlyOpened=E,this.getDirtyWorkspaces=E}},1);ce(Yae,class{constructor(){this.createTextEditor=E,this.resolveTextEditor=E}},0);ce(MU,class{constructor(){this.getAllUserAssociations=E,this.getAssociationsForResource=E,this.updateUserAssociations=E,this.onDidChangeEditorRegistrations=M.None,this.bufferChangeEvents=E,this.resolveEditor=E,this.getEditors=()=>[]}registerEditor(){return{dispose:()=>{}}}},0);ce(qae,class{constructor(){this.onActiveOutputChannel=M.None}getChannel(){}getChannelDescriptor(){}getChannelDescriptors(){return[]}getActiveChannel(){}async showChannel(){}},1);ce(ITt,class{constructor(){this.createOutputChannelModel=E}},1);ce(Rae,class{constructor(){this.readExtensionResource=E,this.supportsExtensionGalleryResources=!1,this.isExtensionGalleryResource=()=>!1,this.getExtensionGalleryResourceURL=E}},0);ce(E1t,class{scanBuiltinExtensions(){return Promise.resolve([])}},0);ce(pf,class{constructor(){this.roots=[],this.getContext=E,this.hasViewFocus=E,this.setEditable=E,this.getEditable=E,this.getEditableData=E,this.isEditable=E,this.findClosest=E,this.findClosestRoot=E,this.refresh=E,this.setToCopy=E,this.isCut=E,this.applyBulkEdit=E,this.select=E,this.registerView=E}get sortOrderConfiguration(){return E()}},1);ce(L3,class{constructor(){this.getExtensionState=()=>{},this.getExtensionStateRaw=()=>{},this.setExtensionState=E,this.onDidChangeExtensionStorageToSync=M.None,this.setKeysForSync=E,this.getKeysForSync=()=>{},this.addToMigrationList=E,this.getSourceExtensionToMigrate=()=>{}}},1);ce(iJe,class{constructor(){this.onDidChangeEnablement=M.None}getDisabledExtensions(){return[]}enableExtension(){return Promise.resolve(!0)}disableExtension(){return Promise.resolve(!0)}},1);ce(nJe,class{async getAvailableLanguages(){return[]}async getInstalledLanguages(){return[]}async getBuiltInExtensionTranslationsUri(e,t){const i=PLt(t)?.[e];return i!=null?N.parse(i):void 0}},1);ce(Tae,class{constructor(){this.removeDragOperationTransfer=E,this.addDragOperationTransfer=E}},1);ce(_Tt,class{constructor(){this.register=E,this.getWidget=()=>{}}},0);ce(nXe,class{constructor(){this.onDidChange=M.None,this.canCreateOutline=()=>!1,this.createOutline=async()=>{},this.registerOutlineCreator=E}},0);ce(aJe,class{constructor(){this.onStateChange=M.None,this.state=B1t.Uninitialized,this.checkForUpdates=E,this.downloadUpdate=E,this.applyUpdate=E,this.quitAndInstall=E,this.isLatestVersion=async()=>!0,this._applySpecificUpdate=E}},0);ce(FRe,class{constructor(){this.getPart=E,this.createAuxiliaryStatusbarPart=E,this.createScoped=E,this.dispose=E,this.onDidChangeEntryVisibility=M.None,this.addEntry=()=>({dispose:()=>{},update:()=>{}}),this.isEntryVisible=()=>!1,this.updateEntryVisibility=()=>{},this.focus=()=>{},this.focusNextEntry=()=>{},this.focusPreviousEntry=()=>{},this.isEntryFocused=()=>!1,this.overrideStyle=()=>V.None}},0);ce(bI,class{constructor(){this.isEnabled=()=>!1,this.query=E,this.getExtensions=E,this.isExtensionCompatible=E,this.getCompatibleExtension=E,this.getAllCompatibleVersions=E,this.download=E,this.downloadSignatureArchive=E,this.reportStatistic=E,this.getReadme=E,this.getManifest=E,this.getChangelog=E,this.getCoreTranslation=E,this.getExtensionsControlManifest=E}},0);ce(RU,class{constructor(){this.revealTerminal=E,this.focusInstance=E,this.onAnyInstanceData=M.None,this.moveIntoNewEditor=E,this.detachedInstances=[],this.onAnyInstanceDataInput=M.None,this.onAnyInstanceIconChange=M.None,this.onAnyInstanceMaximumDimensionsChange=M.None,this.onAnyInstancePrimaryStatusChange=M.None,this.onAnyInstanceProcessIdReady=M.None,this.onAnyInstanceSelectionChange=M.None,this.onAnyInstanceTitleChange=M.None,this.createDetachedTerminal=E,this.onDidChangeSelection=M.None,this.detachedXterms=[],this.whenConnected=Promise.resolve(),this.restoredGroupCount=0,this.createDetachedXterm=E,this.instances=[],this.revealActiveTerminal=E,this.isProcessSupportRegistered=!1,this.connectionState=1,this.defaultLocation=dW.Panel,this.onDidChangeActiveGroup=M.None,this.onDidDisposeGroup=M.None,this.onDidCreateInstance=M.None,this.onDidReceiveProcessId=M.None,this.onDidChangeInstanceDimensions=M.None,this.onDidMaximumDimensionsChange=M.None,this.onDidRequestStartExtensionTerminal=M.None,this.onDidChangeInstanceTitle=M.None,this.onDidChangeInstanceIcon=M.None,this.onDidChangeInstanceColor=M.None,this.onDidChangeInstancePrimaryStatus=M.None,this.onDidInputInstanceData=M.None,this.onDidRegisterProcessSupport=M.None,this.onDidChangeConnectionState=M.None,this.createTerminal=E,this.getInstanceFromId=E,this.getInstanceFromIndex=E,this.getReconnectedTerminals=()=>{},this.getActiveOrCreateInstance=E,this.moveToEditor=E,this.moveToTerminalView=E,this.getPrimaryBackend=E,this.refreshActiveGroup=E,this.registerProcessSupport=()=>{},this.showProfileQuickPick=E,this.setContainers=E,this.requestStartExtensionTerminal=E,this.isAttachedToTerminal=E,this.getEditableData=E,this.setEditable=E,this.isEditable=E,this.safeDisposeTerminal=E,this.getDefaultInstanceHost=E,this.getInstanceHost=E,this.resolveLocation=E,this.setNativeDelegate=E,this.toggleEscapeSequenceLogging=E,this.getEditingTerminal=E,this.setEditingTerminal=E,this.activeInstance=void 0,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}createOnInstanceCapabilityEvent(){return{event:M.None,dispose(){}}}createOnInstanceEvent(e){return new Wrt(this.instances,this.onDidCreateInstance,this.onDidDisposeInstance,e)}get configHelper(){return E()}},1);ce(OTt,class{constructor(){this.onConfigChanged=M.None,this.setPanelContainer=E,this.configFontIsMonospace=E,this.getFont=E}get config(){return E()}},1);ce(NJe,class{constructor(){this.focusInstance=E,this.instances=[],this.openEditor=E,this.detachActiveEditorInstance=E,this.detachInstance=E,this.splitInstance=E,this.revealActiveEditor=E,this.resolveResource=E,this.reviveInput=E,this.getInputFromResource=E,this.activeInstance=void 0,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}},1);ce($Re,class{constructor(){this.focusInstance=E,this.lastAccessedMenu="inline-tab",this.instances=[],this.groups=[],this.activeGroup=void 0,this.activeGroupIndex=0,this.onDidChangeActiveGroup=M.None,this.onDidDisposeGroup=M.None,this.onDidChangeGroups=M.None,this.onDidShow=M.None,this.onDidChangePanelOrientation=M.None,this.createGroup=E,this.getGroupForInstance=E,this.moveGroup=E,this.moveGroupToEnd=E,this.moveInstance=E,this.unsplitInstance=E,this.joinInstances=E,this.instanceIsSplit=E,this.getGroupLabels=E,this.setActiveGroupByIndex=E,this.setActiveGroupToNext=E,this.setActiveGroupToPrevious=E,this.setActiveInstanceByIndex=E,this.setContainer=E,this.showPanel=E,this.hidePanel=E,this.focusTabs=E,this.focusHover=E,this.showTabs=E,this.updateVisibility=E,this.onDidDisposeInstance=M.None,this.onDidFocusInstance=M.None,this.onDidChangeActiveInstance=M.None,this.onDidChangeInstances=M.None,this.onDidChangeInstanceCapability=M.None,this.setActiveInstance=E,this.focusActiveInstance=E,this.getInstanceFromResource=E}},1);ce(PJe,class{constructor(){this.getRegisteredBackends=()=>[].values(),this.onDidCreateInstance=M.None,this.convertProfileToShellLaunchConfig=E,this.createInstance=E,this.getBackend=E,this.didRegisterBackend=E}},1);ce(BJe,class{constructor(){this.availableProfiles=[],this.contributedProfiles=[],this.profilesReady=Promise.resolve(),this.getPlatformKey=E,this.refreshAvailableProfiles=E,this.getDefaultProfileName=()=>{},this.getDefaultProfile=()=>{},this.onDidChangeAvailableProfiles=M.None,this.getContributedDefaultProfile=E,this.registerContributedProfile=E,this.getContributedProfileProvider=E,this.registerTerminalProfileProvider=E}},1);ce(O1t,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(WJe,class{constructor(){this.linkProviders=new Set([]),this.onDidAddLinkProvider=M.None,this.onDidRemoveLinkProvider=M.None,this.registerLinkProvider=E}},1);ce(BTt,class{constructor(){this.terminalProfiles=[]}},1);ce(OJe,class{constructor(){this.resolveIcon=E,this.resolveShellLaunchConfig=E,this.getDefaultProfile=async()=>({profileName:"bash",path:"/bin/bash",isDefault:!0}),this.getDefaultShell=E,this.getDefaultShellArgs=E,this.getDefaultIcon=E,this.getEnvironment=E,this.createProfileFromShellAndShellArgs=E}},1);ce(FJe,class{constructor(){this.collections=new Map,this.onDidChangeCollections=M.None,this.set=E,this.delete=E}get mergedCollection(){return E()}},1);ce(HJe,class{constructor(){this.onDidRegisterProvider=M.None,this.onDidRegisterCommandSelector=M.None,this.onDidUnregisterProvider=M.None,this.extensionQuickFixes=Promise.resolve([]),this.providers=new Map,this.registerQuickFixProvider=E,this.registerCommandSelector=E}},1);ce(gLt,class{constructor(){this.enabled=!1,this.authenticationProviders=[],this.all=[],this.current=void 0,this.accountStatus="unavailable",this.onDidChangeAccountStatus=M.None,this.turnOn=E,this.turnoff=E,this.signIn=E,this.resetSyncedData=E,this.showSyncActivity=E,this.syncNow=E,this.synchroniseUserDataSyncStoreType=E,this.showConflicts=E,this.accept=E,this.getAllLogResources=E,this.downloadSyncActivity=E}},1);ce(cJe,class{constructor(){this.onDidChangeEnablement=M.None,this.isEnabled=()=>!1,this.canToggleEnablement=()=>!1,this.setEnablement=E,this.onDidChangeResourceEnablement=M.None,this.isResourceEnabled=()=>!1,this.setResourceEnablement=E,this.getResourceSyncStateVersion=()=>{}}},1);ce(tLt,class{constructor(){this.addKeybinding=E,this.editKeybinding=E,this.removeKeybinding=E,this.resetKeybinding=E}},1);ce(TTt,class{constructor(){this.getLocalSearchProvider=E,this.getRemoteSearchProvider=E}},1);ce(ZA,class{constructor(){this.tryGetDataProviderSync=()=>{},this.canResolve=async()=>!1,this.onAddViewType=M.None,this.onWillRemoveViewType=M.None,this.onDidChangeOutputRenderers=M.None,this.onWillAddNotebookDocument=M.None,this.onDidAddNotebookDocument=M.None,this.onWillRemoveNotebookDocument=M.None,this.onDidRemoveNotebookDocument=M.None,this.registerNotebookSerializer=E,this.withNotebookDataProvider=E,this.getOutputMimeTypeInfo=E,this.getViewTypeProvider=()=>{},this.getRendererInfo=()=>{},this.getRenderers=()=>[],this.getStaticPreloads=E,this.updateMimePreferredRenderer=E,this.saveMimeDisplayOrder=E,this.createNotebookTextModel=E,this.getNotebookTextModel=()=>{},this.getNotebookTextModels=E,this.listNotebookDocuments=()=>[],this.registerContributedNotebookType=E,this.getContributedNotebookType=E,this.getContributedNotebookTypes=()=>[],this.getNotebookProviderResourceRoots=()=>[],this.setToCopy=E,this.getToCopy=E,this.clearEditorCache=E}},1);ce(LTt,class{constructor(){this.replace=E,this.openReplacePreview=E,this.updateReplacePreview=E}},1);ce(NTt,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.load=E,this.save=E}},1);ce(k6,class{constructor(){this.retrieveWidget=E,this.retrieveExistingWidgetFromURI=()=>{},this.retrieveAllExistingWidgets=()=>[],this.onDidAddNotebookEditor=M.None,this.onDidRemoveNotebookEditor=M.None,this.addNotebookEditor=E,this.removeNotebookEditor=E,this.getNotebookEditor=()=>{},this.listNotebookEditors=()=>[]}},1);ce(RTt,class{get searchModel(){return E()}},1);ce(Hae,class{constructor(){this.onDidSaveNotebook=M.None,this.onDidChangeDirty=M.None,this.onWillFailWithConflict=M.None,this.isDirty=E,this.resolve=E}},1);ce(aXe,class{constructor(){this.onDidRegisterHandler=M.None,this.registerHandler=()=>V.None,this.findEditor=()=>{}}},1);ce(jRe,class{constructor(){this.isActive=!1,this.onDidChangeIsActive=M.None,this.markActive=E}},1);ce(LRe,class{constructor(){this.registerCanonicalUriProvider=E}},1);ce(ORe,class{constructor(){this.onDidChange=M.None}setOrUpdateEntry(){return 1}unsetEntry(){}getEntries(){return[]}},1);ce(qJe,class{constructor(){this.getCurrentExperiments=async()=>[],this.getTreatment=async()=>{}}},1);ce(Em,class{constructor(){this.adoptRequest=E,this.isEnabled=()=>!1,this.resendRequest=E,this.clearAllHistoryEntries=E,this.onDidSubmitAgent=M.None,this.hasSessions=()=>!1,this.onDidDisposeSession=M.None,this.transferredSessionData=void 0,this.onDidSubmitSlashCommand=M.None,this.getSessionId=()=>{},this.transferredSessionId=void 0,this.transferChatSession=E,this.registerSlashCommandProvider=E,this.getProviderInfos=()=>[],this.startSession=E,this.getSession=()=>{},this.getOrRestoreSession=()=>{},this.loadSessionFromContent=()=>{},this.sendRequest=E,this.removeRequest=E,this.cancelCurrentRequestForSession=E,this.getSlashCommands=E,this.clearSession=E,this.addRequest=E,this.addCompleteRequest=E,this.sendRequestToProvider=E,this.getHistory=()=>[],this.removeHistoryEntry=E,this.onDidPerformUserAction=M.None,this.notifyUserAction=E}},1);ce(lXe,class{constructor(){this.update=E}},1);ce(vTt,class{constructor(){this.focused=!1,this.onDidClose=M.None,this.enabled=!1,this.toggle=E,this.focus=E,this.open=E,this.close=E,this.openInChatView=E}},1);ce(ff,class{constructor(){this._serviceBrand=void 0,this.agentHasDupeName=()=>!1,this.registerAgentCompletionProvider=E,this.getAgentCompletionItems=E,this.getAgentByFullyQualifiedId=E,this.getContributedDefaultAgent=()=>{},this.registerAgentImplementation=E,this.registerDynamicAgent=E,this.getActivatedAgents=()=>[],this.getAgentsByName=()=>[],this.getFollowups=E,this.getDefaultAgent=E,this.getSecondaryAgent=E,this.updateAgent=E,this.onDidChangeAgents=M.None,this.registerAgentData=E,this.registerAgentCallback=E,this.registerAgent=E,this.invokeAgent=E,this.getAgents=E,this.getAgent=E,this.hasAgent=E}},1);ce(Wae,class{getAgentNameRestriction(){return!0}},1);ce(sLt,class{constructor(){this.onDidCreateTerminal=M.None,this.createTerminal=E}},1);ce(WRe,class{constructor(){this.getCustomEditor=E,this.getAllCustomEditors=E,this.getContributedCustomEditors=E,this.getUserConfiguredCustomEditors=E,this.registerCustomEditorCapabilities=()=>V.None,this.getCustomEditorCapabilities=()=>{}}get models(){return E()}},1);ce(zae,class{constructor(){this.webviews=[],this.onDidChangeActiveWebview=M.None,this.createWebviewElement=E,this.createWebviewOverlay=E}},1);ce(GJe,class{constructor(){this.onNewResolverRegistered=M.None,this.register=E,this.resolve=E}},1);ce(tXe,class{constructor(){this.setLocale=E}clearLocalePreference(){return Promise.resolve()}},1);ce(T6,class{constructor(){this.onDidChangeActiveWebviewEditor=M.None,this.openWebview=E,this.openRevivedWebview=E,this.revealWebview=E,this.registerResolver=()=>V.None,this.shouldPersist=E,this.resolveWebview=E}get iconManager(){return E()}},1);ce(hC,class{constructor(){this.onDidChangeConnectionData=M.None,this.resolveAuthority=E,this.getConnectionData=E,this.getCanonicalURI=E,this._clearResolvedAuthority=E,this._setResolvedAuthority=E,this._setResolvedAuthorityError=E,this._setAuthorityConnectionToken=E,this._setCanonicalURIProvider=E}},1);ce(SJe,class{constructor(){this.registerExternalOpenerProvider=()=>V.None,this.getOpener=async()=>{}}},1);ce(Am,class{constructor(){this.configureKeybindings=E,this.openHelpLink=E,this.navigateToCodeBlock=E,this.getCodeBlockContext=()=>{},this.showLastProvider=E,this.showAccessibleViewHelp=E,this.goToSymbol=E,this.disableHint=E,this.next=E,this.previous=E,this.getOpenAriaHint=E,this.show=E,this.registerProvider=E,this.getPosition=E,this.setPosition=E,this.getLastPosition=E}},1);ce(kLt,class{constructor(){this.hasShownAccessibleView=()=>!1}},1);ce(L6,class{constructor(){this.uninstallExtensions=E,this.resetPinnedStateForAllUserExtensions=E,this.getInstalledWorkspaceExtensionLocations=()=>[],this.onDidEnableExtensions=M.None,this.isWorkspaceExtensionsSupported=()=>!1,this.getExtensions=async()=>[],this.getInstalledWorkspaceExtensions=async()=>[],this.installResourceExtension=E,this.toggleAppliationScope=async e=>e,this.onInstallExtension=M.None,this.onDidInstallExtensions=M.None,this.onUninstallExtension=M.None,this.onDidUninstallExtension=M.None,this.onDidChangeProfile=M.None,this.installVSIX=E,this.installFromLocation=E,this.updateFromGallery=E,this.onDidUpdateExtensionMetadata=M.None,this.zip=E,this.unzip=E,this.getManifest=E,this.install=E,this.canInstall=E,this.installFromGallery=E,this.installGalleryExtensions=E,this.installExtensionsFromProfile=E,this.uninstall=E,this.reinstallFromGallery=E,this.getInstalled=async()=>[],this.getExtensionsControlManifest=E,this.copyExtensions=E,this.updateMetadata=E,this.download=E,this.registerParticipant=E,this.getTargetPlatform=E,this.cleanUp=E}},1);ce(xm,class{constructor(){this.prefersExecuteOnUI=E,this.prefersExecuteOnWorkspace=E,this.prefersExecuteOnWeb=E,this.canExecuteOnUI=E,this.canExecuteOnWorkspace=E,this.canExecuteOnWeb=E,this.getExtensionKind=E,this.getUserConfiguredExtensionKind=E,this.getExtensionUntrustedWorkspaceSupportType=E,this.getExtensionVirtualWorkspaceSupportType=E}},1);ce(gae,class{isWorkspaceTrustEnabled(){return!1}},1);ce(Nae,class{whenExtensionsReady(){throw new Error("Method not implemented.")}async scanExtensions(){return[]}async scanSingleExtension(){return null}},1);ce(Oae,class{constructor(){this.create=E,this.open=async()=>!1,this.registerHandler=E}},1);ce(IRe,class{constructor(){this.register=E,this.connect=E}},1);ce(I6,class{constructor(){this.onDidChangeQuickDiffProviders=M.None,this.addQuickDiffProvider=E,this.getQuickDiffs=E}},1);ce(zRe,class{constructor(){this.onDidChangeInputValueProviders=M.None,this.getDefaultInputValueProvider=E,this.registerSCMInputValueProvider=E,this.onDidAddRepository=M.None,this.onDidRemoveRepository=M.None,this.repositories=[],this.repositoryCount=0,this.registerSCMProvider=E,this.getRepository=E}},1);ce(kRe,class{constructor(){this.download=E}},1);ce(eXe,class{constructor(){this.registerExtensionHandler=E,this.unregisterExtensionHandler=E}},1);ce(XA,class{constructor(){this.resourceHasCommentingRanges=()=>!1,this.onDidChangeActiveEditingCommentThread=M.None,this.setActiveEditingCommentThread=E,this.setActiveCommentAndThread=E,this.onDidSetResourceCommentInfos=M.None,this.onDidSetAllCommentThreads=M.None,this.onDidUpdateCommentThreads=M.None,this.onDidUpdateNotebookCommentThreads=M.None,this.onDidChangeActiveCommentThread=M.None,this.onDidChangeCurrentCommentThread=M.None,this.onDidUpdateCommentingRanges=M.None,this.onDidChangeActiveCommentingRange=M.None,this.onDidSetDataProvider=M.None,this.onDidDeleteDataProvider=M.None,this.onDidChangeCommentingEnabled=M.None,this.isCommentingEnabled=!1,this.setDocumentComments=E,this.setWorkspaceComments=E,this.removeWorkspaceComments=E,this.registerCommentController=E,this.unregisterCommentController=()=>{},this.getCommentController=E,this.createCommentThreadTemplate=E,this.updateCommentThreadTemplate=E,this.getCommentMenus=E,this.updateComments=E,this.updateNotebookComments=E,this.disposeCommentThread=E,this.getDocumentComments=async()=>[],this.getNotebookComments=async()=>[],this.updateCommentingRanges=E,this.hasReactionHandler=E,this.toggleReaction=E,this.setActiveCommentThread=E,this.setCurrentCommentThread=E,this.enableCommenting=E,this.registerContinueOnCommentProvider=E,this.removeContinueOnComment=E}get commentsModel(){return E()}},1);ce(DJe,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeItems=M.None,this.registerCellStatusBarItemProvider=E,this.getStatusBarItemsForCell=E}},1);ce(IJe,class{constructor(){this.onDidNotebookVariablesUpdate=M.None,this.notifyVariablesChange=E,this.onDidAddKernel=M.None,this.onDidRemoveKernel=M.None,this.onDidChangeSelectedNotebooks=M.None,this.onDidChangeNotebookAffinity=M.None,this.registerKernel=E,this.getMatchingKernel=E,this.getSelectedOrSuggestedKernel=E,this.selectKernelForNotebook=E,this.preselectKernelForNotebook=E,this.updateKernelNotebookAffinity=E,this.onDidChangeKernelDetectionTasks=M.None,this.registerNotebookKernelDetectionTask=E,this.getKernelDetectionTasks=E,this.onDidChangeSourceActions=M.None,this.getSourceActions=E,this.getRunningSourceActions=E,this.registerKernelSourceActionProvider=E,this.getKernelSourceActions2=E}},1);ce(TJe,class{constructor(){this.onShouldPostMessage=M.None,this.prepare=E,this.getScoped=E,this.receiveMessage=E}},1);ce(EJe,class{constructor(){this.addToHistory=E,this.getPreviousValue=E,this.getNextValue=E,this.replaceLast=E,this.clearHistory=E,this.has=E}},1);ce(VRe,class{constructor(){this.onWillAddInteractiveDocument=M.None,this.onWillRemoveInteractiveDocument=M.None,this.willCreateInteractiveDocument=E,this.willRemoveInteractiveDocument=E}},1);ce(nLt,class{async getExtensionIdProvidingCurrentLocale(){return FLt()}},0);ce(aLt,class{constructor(){this.getRemoteProfiles=async()=>[],this.getRemoteProfile=E}},0);ce(NU,class{constructor(){this.isDisabledByBisect=()=>!1,this.isActive=!1,this.disabledCount=0,this.start=E,this.next=E,this.reset=E}},0);ce(Q1t,class{constructor(){this.onTokenFailed=M.None,this.account=void 0,this.onDidChangeAccount=M.None}updateAccount(){return Promise.resolve()}},0);ce(ON,class{constructor(){this.getWidgetBySessionId=()=>{},this.lastFocusedWidget=void 0,this.revealViewForProvider=E,this.getWidgetByInputUri=E}},1);ce(Qae,class{constructor(){this.onDidChangeHelpInformation=M.None,this.onDidChangeTargetType=M.None,this.targetType=[],this.onDidChangeEditable=M.None,this.setEditable=E,this.getEditableData=E,this.forward=E,this.close=E,this.setTunnelInformation=E,this.setCandidateFilter=E,this.onFoundNewCandidates=E,this.restore=E,this.enablePortsFeatures=E,this.onEnabledPortsFeatures=M.None,this.portsFeaturesEnabled=!1,this.namedProcesses=new Map}get helpInformation(){return E()}get tunnelModel(){return E()}},1);ce(KRe,class{constructor(){this.getAccounts=async()=>[],this.onDidRegisterAuthenticationProvider=M.None,this.onDidUnregisterAuthenticationProvider=M.None,this.onDidChangeSessions=M.None,this.onDidChangeDeclaredProviders=M.None,this.declaredProviders=[],this.registerDeclaredAuthenticationProvider=E,this.unregisterDeclaredAuthenticationProvider=E,this.isAuthenticationProviderRegistered=()=>!1,this.registerAuthenticationProvider=E,this.unregisterAuthenticationProvider=E,this.getProviderIds=()=>[],this.getProvider=E,this.getSessions=E,this.createSession=E,this.removeSession=E}},1);ce($ae,class{constructor(){this.onDidChangeExtensionSessionAccess=M.None,this.isAccessAllowed=()=>!1,this.readAllowedExtensions=()=>[],this.updateAllowedExtensions=E,this.removeAllowedExtensions=E}},1);ce(jJe,class{constructor(){this.updateSessionPreference=E,this.getSessionPreference=()=>{},this.removeSessionPreference=E,this.selectSession=E,this.requestSessionAccess=E,this.requestNewSession=E}},1);ce(QJe,class{constructor(){this.readAccountUsages=E,this.removeAccountUsage=E,this.addAccountUsage=E}},1);ce($Je,class{constructor(){this.onDidChangeProviders=M.None,this.onDidChangeTimeline=M.None,this.onDidChangeUri=M.None,this.registerTimelineProvider=E,this.unregisterTimelineProvider=E,this.getSources=()=>[],this.getTimeline=E,this.setUri=E}},1);ce(zJe,class{constructor(){this.getTestsRelatedToCode=async()=>[],this.getCodeRelatedToTest=async()=>[],this.registerExtHost=()=>V.None,this.provideTestFollowups=E,this.onDidCancelTestRun=M.None,this.onWillProcessDiff=M.None,this.onDidProcessDiff=M.None,this.registerTestController=E,this.getTestController=()=>{},this.refreshTests=E,this.cancelRefreshTests=E,this.startContinuousRun=E,this.runTests=E,this.runResolvedTests=E,this.syncTests=E,this.cancelTestRun=E,this.publishDiff=E}get excluded(){return E()}get collection(){return E()}get showInlineOutput(){return E()}},1);ce(oJe,class{constructor(){this.onDidChangeSecret=M.None,this.type="in-memory",this.get=async()=>{},this.set=E,this.delete=E}},1);ce(RJe,class{constructor(){this.registerShareProvider=E,this.getShareActions=()=>[],this.provideShare=async()=>{}}},1);ce(rXe,class{constructor(){this.createProfileFromTemplate=async()=>{},this.resolveProfileTemplate=async()=>null,this.exportProfile2=E,this.createFromProfile=E,this.createProfile=E,this.editProfile=E,this.registerProfileContentHandler=()=>V.None,this.unregisterProfileContentHandler=()=>{},this.exportProfile=E,this.importProfile=E,this.showProfileContents=E,this.createFromCurrentProfile=E,this.createTroubleshootProfile=E,this.setProfile=E}},1);ce(eLt,class{constructor(){this.registerIssueDataProvider=E,this.openReporter=E,this.openProcessExplorer=E,this.registerIssueUriRequestHandler=E}},1);ce(LJe,class{constructor(){this.repositories=[],this.onDidChangeRepositories=M.None,this.visibleRepositories=[],this.onDidChangeVisibleRepositories=M.None,this.isVisible=()=>!1,this.toggleVisibility=E,this.toggleSortKey=E,this.focusedRepository=void 0,this.onDidFocusRepository=M.None,this.focus=E}get menus(){return E()}},1);ce(kJe,class{constructor(){this.onDidChangeExecution=M.None,this.onDidChangeLastRunFailState=M.None,this.forceCancelNotebookExecutions=E,this.getCellExecutionsForNotebook=E,this.getCellExecutionsByHandleForNotebook=E,this.getCellExecution=E,this.createCellExecution=E,this.getExecution=E,this.createExecution=E,this.getLastFailedCellForNotebook=E}},1);ce(UJe,class{constructor(){this.onDidChange=M.None,this.addProfile=E,this.updateProfile=E,this.removeProfile=E,this.capabilitiesForTest=E,this.configure=E,this.all=()=>[],this.getGroupDefaultProfiles=()=>[],this.setGroupDefaultProfiles=E,this.getControllerProfiles=()=>[]}},1);ce(y1t,class{constructor(){this.setUsePlainTextEncryption=E,this.getKeyStorageProvider=E,this.encrypt=E,this.decrypt=E,this.isEncryptionAvailable=E}},1);ce(VJe,class{constructor(){this.onResultsChanged=M.None,this.onTestChanged=M.None,this.results=[],this.clear=E,this.createLiveResult=E,this.push=E,this.getResult=()=>{},this.getStateById=()=>{}}},1);ce(UTt,class{constructor(){this.read=E,this.persist=E}},1);ce(zTt,class{constructor(){this.onDidChange=M.None,this.invalidateResultMessage=E,this.syncDecorations=E,this.getDecoratedTestPosition=E}},1);ce(Jae,class{constructor(){this.requiresInitialization=async()=>!1,this.whenInitializationFinished=async()=>{},this.initializeRequiredResources=async()=>{},this.initializeInstalledExtensions=async()=>{},this.initializeOtherResources=async()=>{}}},1);ce(w1t,b1t,1);ce(MTt,class{notebookSearch(){return{openFilesToScan:new Ck,completeData:Promise.resolve({results:[],messages:[]}),allScannedFiles:Promise.resolve(new Ck)}}},1);ce(yJe,class{constructor(){this.sendChatRequest=E,this.selectLanguageModels=E,this.computeTokenLength=E,this.onDidChangeLanguageModels=M.None,this.getLanguageModelIds=()=>[],this.lookupLanguageModel=()=>{},this.registerLanguageModelChat=E,this.makeLanguageModelChatRequest=E}},1);ce(BRe,class{constructor(){this.onDidChangeCommands=E,this.registerSlashData=E,this.registerSlashCallback=E,this.registerSlashCommand=E,this.executeCommand=E,this.getCommands=E,this.hasCommand=E}},1);ce(D6,class{constructor(){this.attachContext=E,this.getVariable=()=>{},this.resolveVariable=async()=>[],this.getDynamicVariables=E,this.getDynamicReferences=E,this.registerVariable=E,this.getVariables=E,this.resolveVariables=E,this.hasVariable=E}},1);ce(GRe,class{constructor(){this.isEnabled=()=>!1,this.getRelatedInformation=E,this.registerAiRelatedInformationProvider=E}},1);ce(KJe,class{constructor(){this.isEnabled=()=>!1,this.getEmbeddingVector=E,this.registerAiEmbeddingVectorProvider=E}},1);ce(rJe,(dK=class{async createNewMessage(e){return{id:String(dK._nextId++),data:e}}async validate(){return!0}async sign(e){return e}},dK._nextId=1,dK),1);ce(VTt,class{constructor(){this.lastRunProfileIds=new Set,this.onDidChange=M.None,this.isSpecificallyEnabledFor=()=>!1,this.isEnabledForAParentOf=()=>!1,this.isEnabledForAChildOf=()=>!1,this.isEnabled=()=>!1,this.start=E,this.stop=E}},1);ce(HTt,class{constructor(){this.onDidRequestInputFocus=M.None,this.focusInput=E,this.setText=E,this.isFilteringFor=()=>!1,this.toggleFilteringFor=E}get text(){return E()}get reveal(){return E()}get globList(){return E()}get includeTags(){return E()}get excludeTags(){return E()}get fuzzy(){return E()}},1);ce($Tt,class{constructor(){this.tryPeekFirstError=E,this.peekUri=E,this.openCurrentInEditor=E,this.open=E,this.closeAllPeeks=E}get historyVisible(){return E()}},1);ce(YJe,class{constructor(){this.getWindow=()=>{},this.onDidOpenAuxiliaryWindow=M.None,this.hasWindow=()=>!1,this.open=E}},1);ce(Vae,class{constructor(){this.onDidStartTextToSpeechSession=M.None,this.onDidEndTextToSpeechSession=M.None,this.hasActiveTextToSpeechSession=!1,this.createTextToSpeechSession=E,this.onDidChangeHasSpeechProvider=M.None,this.onDidStartSpeechToTextSession=M.None,this.onDidEndSpeechToTextSession=M.None,this.hasActiveSpeechToTextSession=!1,this.onDidStartKeywordRecognition=M.None,this.onDidEndKeywordRecognition=M.None,this.hasActiveKeywordRecognition=!1,this.recognizeKeyword=E,this.onDidRegisterSpeechProvider=M.None,this.onDidUnregisterSpeechProvider=M.None,this.hasSpeechProvider=!1,this.registerSpeechProvider=E,this.createSpeechToTextSession=E}},1);ce(WTt,class{constructor(){this.openCoverage=E,this.closeCoverage=E}get showInline(){return E()}get filterToTest(){return E()}get selected(){return E()}},1);ce(bJe,class{constructor(){this.acceptRequest=E,this.acceptResponse=E}},1);ce(wJe,class{constructor(){this.onDidClearHistory=M.None,this.clearHistory=E,this.getHistory=()=>[],this.saveHistory=E}},1);ce(bTt,class{constructor(){this.providers=[],this.registerProvider=()=>V.None}},1);ce(URe,class{constructor(){this.onDidMoveSession=M.None,this.onDidMoveSessio=M.None,this.onDidStashSession=M.None,this.moveSession=E,this.getCodeEditor=E,this.stashSession=E,this.onWillStartSession=M.None,this.onDidEndSession=M.None,this.createSession=E,this.getSession=()=>{},this.releaseSession=E,this.registerSessionKeyComputer=E,this.recordings=E,this.dispose=E}},1);ce(kTt,class{constructor(){this.canComputeDiff=()=>!1,this.computeDiff=E,this.canPromptRecommendation=async()=>!1}},1);ce(ATt,class{constructor(){this.getKernels=E,this.addMostRecentKernel=E}},1);ce(STt,class{constructor(){this.executeNotebookCells=E,this.cancelNotebookCells=E,this.cancelNotebookCellHandles=E,this.registerExecutionParticipant=E}},1);ce(ETt,class{},1);ce(xTt,class{constructor(){this.info=E,this.debug=E}},1);ce(KTt,class{constructor(){this.onDidAddWalkthrough=M.None,this.onDidRemoveWalkthrough=M.None,this.onDidChangeWalkthrough=M.None,this.onDidProgressStep=M.None,this.getWalkthroughs=E,this.getWalkthrough=E,this.registerWalkthrough=E,this.progressByEvent=E,this.progressStep=E,this.deprogressStep=E,this.markWalkthroughOpened=E}},1);ce(H1t,class{constructor(){this.onDidChangeUserDataSyncStore=M.None,this.userDataSyncStore=void 0,this.switch=E,this.getPreviousUserDataSyncStore=E}},1);ce(U1t,class{constructor(){this.onDidChangeDonotMakeRequestsUntil=M.None,this.donotMakeRequestsUntil=void 0,this.onTokenFailed=M.None,this.onTokenSucceed=M.None,this.setAuthToken=E,this.manifest=E,this.readResource=E,this.writeResource=E,this.deleteResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E,this.getAllCollections=E,this.createCollection=E,this.deleteCollection=E,this.getActivityData=E,this.clear=E}},1);ce(q1t,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(z1t,class{constructor(){this.status="uninitialized",this.onDidChangeStatus=M.None,this.conflicts=[],this.onDidChangeConflicts=M.None,this.onDidChangeLocal=M.None,this.onSyncErrors=M.None,this.onDidChangeLastSyncTime=M.None,this.onDidResetRemote=M.None,this.onDidResetLocal=M.None,this.createSyncTask=E,this.createManualSyncTask=E,this.resolveContent=E,this.accept=E,this.reset=E,this.resetRemote=E,this.cleanUpRemoteData=E,this.resetLocal=E,this.hasLocalData=E,this.hasPreviouslySynced=E,this.replace=E,this.saveRemoteActivityData=E,this.extractActivityData=E}},1);ce(j1t,class{constructor(){this.onDidChange=M.None,this.getMachines=E,this.addCurrentMachine=E,this.removeCurrentMachine=E,this.renameMachine=E,this.setEnablements=E}},1);ce($1t,class{constructor(){this.getRemoteSyncedProfiles=E,this.getLocalSyncedProfiles=E,this.getRemoteSyncResourceHandles=E,this.getLocalSyncResourceHandles=E,this.getAssociatedResources=E,this.getMachineId=E,this.getLocalSyncedMachines=E,this.resolveContent=E,this.resolveUserDataSyncResource=E}},1);ce(V1t,class{constructor(){this.writeResource=E,this.getAllResourceRefs=E,this.resolveResourceContent=E}},1);ce(K1t,class{constructor(){this.resolveDefaultCoreIgnoredSettings=async()=>[],this.resolveUserBindings=E,this.resolveFormattingOptions=E,this.resolveDefaultIgnoredSettings=E}},1);ce(cLt,class{constructor(){this.createProfile=E,this.createAndEnterProfile=E,this.createAndEnterTransientProfile=E,this.removeProfile=E,this.updateProfile=E,this.switchProfile=E,this.getBuiltinProfileTemplates=E}},1);ce(fLt,class{constructor(){this.onDidAddEntry=M.None,this.onDidChangeEntry=M.None,this.onDidReplaceEntry=M.None,this.onDidRemoveEntry=M.None,this.onDidMoveEntries=M.None,this.onDidRemoveEntries=M.None,this.addEntry=E,this.updateEntry=E,this.removeEntry=E,this.moveEntries=E,this.getEntries=async()=>[],this.getAll=async()=>[],this.removeAll=E}},1);ce(AJe,class{constructor(){this.markChanged=E}},1);ce(iXe,class{constructor(){this.getNotebook=()=>{},this.addNotebookDocument=E,this.removeNotebookDocument=E}},1);ce(CJe,class{constructor(){this.registerTree=E,this.getVisualizedNodeFor=E,this.getVisualizedChildren=E,this.editTreeItem=E,this.getApplicableFor=E,this.register=E}},1);ce(yTt,class{constructor(){this.onDidChangeLogLevel=M.None,this.getLevel=E,this.setLevel=E,this.trace=E,this.debug=E,this.info=E,this.warn=E,this.error=E,this.flush=E,this.dispose=E}},1);ce(wTt,class{constructor(){this.SIZE_LIMIT=0,this.isSignedIn=!1,this.onDidSignIn=M.None,this.onDidSignOut=M.None,this.storeClient=void 0,this.lastReadResources=new Map,this.lastWrittenResources=new Map,this.initialize=E,this.read=E,this.write=E,this.delete=E,this.list=E,this.getMachineById=E}},1);ce(xJe,class{constructor(){this.registerResolver=()=>V.None,this.resolve=async()=>{}}},1);ce(FTt,PTt,1);ce(XJe,class{constructor(){this.onDidChangeEnablement=M.None,this.isEnabled=()=>!0,this.setEnablement=E,this.getEnablementData=E,this.getAccess=E,this.onDidChangeAccessData=M.None,this.getAccessData=()=>{},this.setStatus=E}},1);ce(JJe,class{constructor(){this.onWillInstantiateEditorPane=M.None,this.didInstantiateEditorPane=()=>!1}},1);ce(pLt,class{constructor(){this.matches=E,this.getWorkspaceStateFolders=E}},1);ce(CTt,class{constructor(){this.onDidChangeDefaultLogLevels=M.None,this.getDefaultLogLevel=async()=>Gn.Off,this.getDefaultLogLevels=E,this.setDefaultLogLevel=E,this.migrateLogLevels=E}},1);ce(tE,class{constructor(){this.onDidChange=M.None,this.getName=()=>{}}},1);ce(XTt,class{constructor(){this.isActive=()=>!1,this.start=E,this.resume=E,this.stop=E}},1);ce(TLt,class{async isPure(){return{isPure:!1,proof:[]}}},1);ce(Zae,class{isValid(){return!1}},1);ce(dXe,class{constructor(){this.onDidChangeTools=M.None,this.registerToolData=E,this.registerToolImplementation=E,this.getTools=()=>[],this.invokeTool=E}},1);ce(ZTt,class{constructor(){this.openReporter=E,this.reloadWithExtensionsDisabled=E,this.showConfirmCloseDialog=E,this.showClipboardDialog=E,this.sendReporterMenu=E,this.closeReporter=E}},1);const zLt="vscode://schemas/vscode-product",$Lt={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts"},aiTextSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProviderNew.d.ts"},attributableCoverage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts"},authGetSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authGetSessions.d.ts"},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts"},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:2},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},chatVariableResolver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribIssueReporter:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribIssueReporter.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlHistoryItemChangesMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemChangesMenu.d.ts"},contribSourceControlHistoryItemGroupMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},createFileSystemWatcher:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts"},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},documentPaste:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentPaste.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileComments:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileComments.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProviderNew.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts"},findFiles2New:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2New.d.ts"},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFilesNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFilesNew.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},idToken:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},inlineEdit:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},lmTools:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.lmTools.d.ts",version:2},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookCellExecutionState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickInputButtonLocation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},showLocal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.showLocal.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellIntegration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellIntegration.d.ts"},testMessageStackTrace:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textSearchCompleteNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchCompleteNew.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProviderNew:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProviderNew.d.ts"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},kM=Object.freeze($Lt),YRe=Qe.as(QA.JSONContribution);class GLt{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(Xe.Error,e)}warn(e){this._msg(Xe.Warning,e)}info(e){this._msg(Xe.Info,e)}}class R5{static _toSet(e){const t=new y_;for(let i=0,n=e.length;i!i.has(a.description.identifier)),r=e.filter(a=>!n.has(a.description.identifier));return new R5(o,r)}constructor(e,t){this.added=e,this.removed=t}}class KLt{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=R5.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){vt(e)}}}const qLt={type:"string",enum:["ui","workspace"],enumDescriptions:[g(4415,"UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),g(4416,"Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")]},hXe="vscode://schemas/vscode-extensions",Mve={properties:{engines:{type:"object",description:g(4417,"Engine compatibility."),properties:{vscode:{type:"string",description:g(4418,"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(4419,"The publisher of the VS Code extension."),type:"string"},displayName:{description:g(4420,"The display name for the extension used in the VS Code gallery."),type:"string"},categories:{description:g(4421,"The categories used by the VS Code gallery to categorize the extension."),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:HYe},{type:"string",const:"Languages",deprecationMessage:g(4422,"Use 'Programming Languages' instead")}]}},galleryBanner:{type:"object",description:g(4423,"Banner used in the VS Code marketplace."),properties:{color:{description:g(4424,"The banner color on the VS Code marketplace page header."),type:"string"},theme:{description:g(4425,"The color theme for the font used in the banner."),type:"string",enum:["dark","light"]}}},contributes:{description:g(4426,"All contributions of the VS Code extension represented by this package."),type:"object",properties:{},default:{}},preview:{type:"boolean",description:g(4427,"Sets the extension to be flagged as a Preview in the Marketplace.")},enableProposedApi:{type:"boolean",deprecationMessage:g(4428,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:g(4429,"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(kM).map(s=>s),markdownEnumDescriptions:Object.values(kM).map(s=>s.proposal)}},api:{markdownDescription:g(4430,"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(4431,"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(4432,"Activation events for the VS Code extension."),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:g(4433,"An activation event emmited when a webview is loaded of a certain viewType"),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:g(4434,"An activation event emitted whenever a file that resolves to the specified language gets opened."),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:g(4435,"An activation event emitted whenever the specified command gets invoked."),body:"onCommand:${2:commandId}"},{label:"onDebug",description:g(4436,"An activation event emitted whenever a user is about to start debugging or about to setup debug configurations."),body:"onDebug"},{label:"onDebugInitialConfigurations",description:g(4437,'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(4438,'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(4439,"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(4440,"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(4441,"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(4442,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:"onStartupFinished"},{label:"onTaskType",description:g(4443,"An activation event emitted whenever tasks of a certain type need to be listed or resolved."),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:g(4444,"An activation event emitted whenever a file or folder is accessed with the given scheme."),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:g(4445,"An activation event emitted whenever an edit session is accessed with the given scheme."),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:g(4446,"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(4447,"An activation event emitted whenever the specified view is expanded.")},{label:"onUri",body:"onUri",description:g(4448,"An activation event emitted whenever a system-wide Uri directed towards this extension is open.")},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:g(4449,"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(4450,"An activation event emitted whenever the specified custom editor becomes visible.")},{label:"onNotebook",body:"onNotebook:${1:type}",description:g(4451,"An activation event emitted whenever the specified notebook document is opened.")},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:g(4452,"An activation event emitted whenever sessions are requested from the specified authentication provider.")},{label:"onRenderer",description:g(4453,"An activation event emitted whenever a notebook output renderer is used."),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:g(4454,"An activation event emitted when a specific terminal profile is launched.")},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:g(4455,"An activation event emitted when a command matches the selector associated with this ID")},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:g(4456,"An activation event emitted when a specified walkthrough is opened.")},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:g(4457,"An activation event emitted when the issue reporter is opened.")},{label:"onChatParticipant",body:"onChatParticipant:${1:participantId}",description:g(4458,"An activation event emitted when the specified chat participant is invoked.")},{label:"onLanguageModelTool",body:"onLanguageModelTool:${1:toolName}",description:g(4459,"An activation event emitted when the specified language model tool is invoked.")},{label:"*",description:g(4460,"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(4461,"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(4462,"Badge image URL.")},href:{type:"string",description:g(4463,"Badge link.")},description:{type:"string",description:g(4464,"Badge description.")}}}},markdown:{type:"string",description:g(4465,"Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:g(4466,"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(4467,"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:F3}},extensionPack:{description:g(4468,"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:F3}},extensionKind:{description:g(4469,"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:qLt,default:["workspace"],defaultSnippets:[{body:["ui"],description:g(4470,"Define an extension which can run only on the local machine when connected to remote window.")},{body:["workspace"],description:g(4471,"Define an extension which can run only on the remote machine when connected remote window.")},{body:["ui","workspace"],description:g(4472,"Define an extension which can run on either side, with a preference towards running on the local machine.")},{body:["workspace","ui"],description:g(4473,"Define an extension which can run on either side, with a preference towards running on the remote machine.")},{body:[],description:g(4474,"Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.")}]},capabilities:{description:g(4475,"Declare the set of supported capabilities by the extension."),type:"object",properties:{virtualWorkspaces:{description:g(4476,"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(4477,"Declares the level of support for virtual workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(4478,"The extension will be enabled in virtual workspaces with some functionality disabled."),g(4479,"The extension will be enabled in virtual workspaces with all functionality enabled."),g(4480,"The extension will not be enabled in virtual workspaces.")]},description:{type:"string",markdownDescription:g(4481,"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(4482,"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(4483,"Declares the level of support for untrusted workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[g(4484,"The extension will be enabled in untrusted workspaces with some functionality disabled."),g(4485,"The extension will be enabled in untrusted workspaces with all functionality enabled."),g(4486,"The extension will not be enabled in untrusted workspaces.")]},restrictedConfigurations:{description:g(4487,"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(4488,"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(4489,"Specify the location from where users can sponsor your extension."),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:g(4490,"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(4491,"Script executed before the package is published as a VS Code extension."),type:"string"},"vscode:uninstall":{description:g(4492,"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(4493,"The path to a 128x128 pixel icon.")},l10n:{type:"string",description:g(4494,"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(4495,"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 QLt{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new KLt(e.extensionPoint,e.defaultExtensionKind);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&qO.register(e.extensionPoint,e.activationEventsGenerator),Mve.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,YRe.registerSchema(hXe,Mve),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const uXe={ExtensionsRegistry:"ExtensionsRegistry"};Qe.add(uXe.ExtensionsRegistry,new QLt);const Xd=Qe.as(uXe.ExtensionsRegistry);YRe.registerSchema(hXe,Mve);YRe.registerSchema(zLt,{properties:{extensionEnabledApiProposals:{description:g(4496,"API proposals that the respective extensions can freely use."),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(kM),markdownEnumDescriptions:Object.values(kM).map(s=>s.proposal)}}]}}}});var Q_;(function(s){s.ExtensionFeaturesRegistry="workbench.registry.extensionFeatures"})(Q_||(Q_={}));class jLt{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())}}Qe.add(Q_.ExtensionFeaturesRegistry,new jLt);var of;(function(s){s.Workbench="workbench.contributions.kind"})(of||(of={}));var yc;(function(s){s[s.BlockStartup=1]="BlockStartup",s[s.BlockRestore=2]="BlockRestore",s[s.AfterRestored=3]="AfterRestored",s[s.Eventually=4]="Eventually"})(yc||(yc={}));function cHe(s){const e=s;return!!e&&typeof e.editorTypeId=="string"}function YLt(s){switch(s){case Rs.Restored:return yc.AfterRestored;case Rs.Eventually:return yc.Eventually}}function lHe(s){switch(s){case yc.BlockStartup:return Rs.Starting;case yc.BlockRestore:return Rs.Ready;case yc.AfterRestored:return Rs.Restored;case yc.Eventually:return Rs.Eventually}}const VE=class VE extends V{constructor(){super(...arguments),this.contributionsByPhase=new Map,this.contributionsByEditor=new Map,this.contributionsById=new Map,this.instancesById=new Map,this.instanceDisposables=this._register(new Z),this.timingsByPhase=new Map,this.pendingRestoredContributions=new dc,this.whenRestored=this.pendingRestoredContributions.p}get timings(){return this.timingsByPhase}registerWorkbenchContribution2(e,t,i){const n={id:e,ctor:t};this.instantiationService&&this.lifecycleService&&this.logService&&this.environmentService&&this.editorPaneService&&(typeof i=="number"&&this.lifecycleService.phase>=i||typeof e=="string"&&cHe(i)&&this.editorPaneService.didInstantiateEditorPane(i.editorTypeId))?this.safeCreateContribution(this.instantiationService,this.logService,this.environmentService,n,typeof i=="number"?lHe(i):this.lifecycleService.phase):(typeof i=="number"&&wj(this.contributionsByPhase,lHe(i),[]).push(n),typeof e=="string"&&(this.contributionsById.has(e)?console.error(`IWorkbenchContributionsRegistry#registerWorkbenchContribution(): Can't register multiple contributions with same id '${e}'`):this.contributionsById.set(e,n),cHe(i)&&wj(this.contributionsByEditor,i.editorTypeId,[]).push(n)))}registerWorkbenchContribution(e,t){this.registerWorkbenchContribution2(void 0,e,YLt(t))}getWorkbenchContribution(e){if(this.instancesById.has(e))return this.instancesById.get(e);const t=this.instantiationService,i=this.lifecycleService,n=this.logService,o=this.environmentService;if(!t||!i||!n||!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.phase{this.instanceDisposables.clear()}));for(const a of[Rs.Starting,Rs.Ready,Rs.Restored,Rs.Eventually])this.instantiateByPhase(t,i,n,o,a);for(const a of this.contributionsByEditor.keys())r.didInstantiateEditorPane(a)&&this.onEditor(a,t,i,n,o);this._register(r.onWillInstantiateEditorPane(a=>this.onEditor(a.typeId,t,i,n,o)))}onEditor(e,t,i,n,o){const r=this.contributionsByEditor.get(e);if(r){this.contributionsByEditor.delete(e);for(const a of r)this.safeCreateContribution(t,n,o,a,i.phase)}}instantiateByPhase(e,t,i,n,o){t.phase>=o?this.doInstantiateByPhase(e,i,n,o):t.when(o).then(()=>this.doInstantiateByPhase(e,i,n,o))}async doInstantiateByPhase(e,t,i,n){const o=this.contributionsByPhase.get(n);if(o)switch(this.contributionsByPhase.delete(n),n){case Rs.Starting:case Rs.Ready:{cs(`code/willCreateWorkbenchContributions/${n}`);for(const r of o)this.safeCreateContribution(e,t,i,r,n);cs(`code/didCreateWorkbenchContributions/${n}`);break}case Rs.Restored:case Rs.Eventually:{n===Rs.Eventually&&await this.pendingRestoredContributions.p,this.doInstantiateWhenIdle(o,e,t,i,n);break}}}doInstantiateWhenIdle(e,t,i,n,o){cs(`code/willCreateWorkbenchContributions/${o}`);let r=0;const a=o===Rs.Eventually?3e3:500,c=l=>{for(;r(o{for(const t of e){const i=t.value,n=t.collector,o=t.description.extensionLocation;if(!i||!Array.isArray(i)){n.error(g(674,"'configuration.jsonValidation' must be a array"));return}i.forEach(r=>{if(!Lt(r.fileMatch)&&!(Array.isArray(r.fileMatch)&&r.fileMatch.every(Lt))){n.error(g(675,"'configuration.jsonValidation.fileMatch' must be defined as a string or an array of strings."));return}const a=r.url;if(!Lt(a)){n.error(g(676,"'configuration.jsonValidation.url' must be a URL or relative path"));return}if(a.startsWith("./"))try{const c=Pt(o,a);$y(c,o)||n.warn(g(677,"Expected `contributes.{0}.url` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",dHe.name,c.toString(),o.path))}catch(c){n.error(g(678,"'configuration.jsonValidation.url' is an invalid relative URL: {0}",c.message))}else if(!/^[^:/?#]+:\/\//.test(a)){n.error(g(679,"'configuration.jsonValidation.url' must be an absolute URL or start with './' to reference schemas located in the extension."));return}})}})}}class XLt extends V{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(680,"File Match"),g(681,"Schema")],n=t.map(o=>[new Mt().appendMarkdown(`\`${Array.isArray(o.fileMatch)?o.fileMatch.join(", "):o.fileMatch}\``),o.url]);return{data:{headers:i,rows:n},dispose:()=>{}}}}Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"jsonValidation",label:g(682,"JSON Validation"),access:{canToggle:!1},renderer:new wi(XLt)});var gB;let WJ=(gB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(JLt)}},gB.ID="workbench.contrib.jsonValidationExtensionPoint",gB);WJ=D([_(0,we)],WJ);Ku(WJ.ID,WJ,yc.BlockStartup);const Nve=Qe.as(mTe.ColorContribution),hK=Nve.getColorReferenceSchema(),gXe="^\\w+[.\\w+]*$",ZLt=Xd.registerExtensionPoint({extensionPoint:"colors",jsonSchema:{description:g(683,"Contributes extension defined themable colors"),type:"array",items:{type:"object",properties:{id:{type:"string",description:g(684,"The identifier of the themable color"),pattern:gXe,patternErrorMessage:g(685,"Identifiers must only contain letters, digits and dots and can not start with a dot")},description:{type:"string",description:g(686,"The description of the themable color")},defaults:{type:"object",properties:{light:{description:g(687,"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:[hK,{type:"string",format:"color-hex"}]},dark:{description:g(688,"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:[hK,{type:"string",format:"color-hex"}]},highContrast:{description:g(689,"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:[hK,{type:"string",format:"color-hex"}]},highContrastLight:{description:g(690,"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:[hK,{type:"string",format:"color-hex"}]}},required:["light","dark"]}}}}});class eRt{constructor(){ZLt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,o=i.collector;if(!n||!Array.isArray(n)){o.error(g(691,"'configuration.colors' must be a array"));return}const r=(a,c)=>a.length>0?a[0]==="#"?me.Format.CSS.parseHex(a):a:(o.error(g(692,"{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)),me.red);for(const a of n){if(typeof a.id!="string"||a.id.length===0){o.error(g(693,"'configuration.colors.id' must be defined and can not be empty"));return}if(!a.id.match(gXe)){o.error(g(694,"'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(695,"'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(696,"'configuration.colors.defaults' must be defined and must contain 'light' and 'dark'"));return}if(c.highContrast&&typeof c.highContrast!="string"){o.error(g(697,"If defined, 'configuration.colors.defaults.highContrast' must be a string."));return}if(c.highContrastLight&&typeof c.highContrastLight!="string"){o.error(g(698,"If defined, 'configuration.colors.defaults.highContrastLight' must be a string."));return}Nve.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 n=i.value;for(const o of n)Nve.deregisterColor(o.id)}})}}class tRt extends V{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(699,"ID"),g(700,"Description"),g(701,"Dark Default"),g(702,"Light Default"),g(703,"High Contrast Default")],n=r=>r[0]==="#"?me.fromHex(r):void 0,o=t.sort((r,a)=>r.id.localeCompare(a.id)).map(r=>[new Mt().appendMarkdown(`\`${r.id}\``),r.description,n(r.defaults.dark)??new Mt().appendMarkdown(`\`${r.defaults.dark}\``),n(r.defaults.light)??new Mt().appendMarkdown(`\`${r.defaults.light}\``),n(r.defaults.highContrast)??new Mt().appendMarkdown(`\`${r.defaults.highContrast}\``)]);return{data:{headers:i,rows:o},dispose:()=>{}}}}Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"colors",label:g(704,"Colors"),access:{canToggle:!1},renderer:new wi(tRt)});var fB;let HJ=(fB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(eRt)}},fB.ID="workbench.contrib.colorExtensionPoint",fB);HJ=D([_(0,we)],HJ);Ku(HJ.ID,HJ,yc.BlockStartup);const lV=Qe.as(pYe.IconContribution),iRt=lV.getIconReferenceSchema(),fXe=`^${We.iconNameSegment}(-${We.iconNameSegment})+$`,nRt=Xd.registerExtensionPoint({extensionPoint:"icons",jsonSchema:{description:g(705,"Contributes extension defined themable icons"),type:"object",propertyNames:{pattern:fXe,description:g(706,"The identifier of the themable icon"),patternErrorMessage:g(707,"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(708,"The description of the themable icon")},default:{anyOf:[iRt,{type:"object",properties:{fontPath:{description:g(709,"The path of the icon font that defines the icon."),type:"string"},fontCharacter:{description:g(710,"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(711,"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 sRt{constructor(){nRt.setHandler((e,t)=>{for(const i of t.added){const n=i.value,o=i.collector;if(!n||typeof n!="object"){o.error(g(712,"'configuration.icons' must be an object with the icon names as properties."));return}for(const r in n){if(!r.match(fXe)){o.error(g(713,"'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=n[r];if(typeof a.description!="string"||a.description.length===0){o.error(g(714,"'configuration.icons.description' must be defined and can not be empty"));return}const c=a.default;if(typeof c=="string")lV.registerIcon(r,{id:c},a.description);else if(typeof c=="object"&&typeof c.fontPath=="string"&&typeof c.fontCharacter=="string"){const l=Vy(c.fontPath).substring(1),d=oRt[l];if(!d){o.warn(g(715,"Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.",l));return}const h=i.description.extensionLocation,u=Pt(h,c.fontPath);if(!$y(u,h)){o.warn(g(716,"Expected `contributes.icons.default.fontPath` ({0}) to be included inside extension's folder ({0}).",u.path,h.path));return}const f=rRt(i.description,c.fontPath),p=lV.registerIconFont(f,{src:[{location:u,format:d}]});lV.registerIcon(r,{fontCharacter:c.fontCharacter,font:{id:f,definition:p}},a.description)}else o.error(g(717,"'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 n=i.value;for(const o in n)lV.deregisterIcon(o)}})}}const oRt={ttf:"truetype",woff:"woff",woff2:"woff2"};function rRt(s,e){return Vi.join(s.identifier.value,e)}var pB;let UJ=(pB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(sRt)}},pB.ID="workbench.contrib.iconExtensionPoint",pB);UJ=D([_(0,we)],UJ);Ku(UJ.ID,UJ,yc.BlockStartup);const ca=Object.freeze({View:Fe(4523,"View"),Help:Fe(4524,"Help"),Test:Fe(4525,"Test"),File:Fe(4526,"File"),Preferences:Fe(4527,"Preferences"),Developer:Fe(4528,"Developer")});class aRt extends li{constructor(){super({id:"menu.resetHiddenStates",title:Fe(4502,"Reset All Menus"),category:ca.View,f1:!0})}run(e){e.get(Oa).resetHiddenStates(),e.get(Ge).info("did RESET all menu hidden states")}}At(aRt);var cRt='.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}';ut(cRt,{});let rf=class extends Pk{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,r,a,c,l,d,h,u,f),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){dp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};rf=D([_(4,we),_(5,Kt),_(6,vi),_(7,Le),_(8,pn),_(9,bi),_(10,mr),_(11,Vs),_(12,it)],rf);var lRt=".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}";ut(lRt,{});const hHe=new me(new dn(0,122,204)),dRt={showArrow:!0,showFrame:!0,className:"",frameColor:hHe,arrowColor:hHe,keepEditorSelection:!1},hRt="vs.editor.contrib.zoneWidget";class uRt{constructor(e,t,i,n,o,r,a,c){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=c,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class gRt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const bse=class bse{constructor(e){this._editor=e,this._ruleName=bse._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),yS(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(){yS(this._ruleName),Bf(`.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:F.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:ni.NeverGrowsWhenTypingAtEdges}}])}hide(){this._decorations.clear()}};bse._IdGenerator=new CU(".arrow-decoration-");let Pve=bse;class JRe{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=xs(t),dp(this.options,dRt,!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 n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}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 Pve(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(Bc())}show(e,t){const i=F.isIRange(e)?F.lift(e):F.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Gt.EMPTY}])}updatePositionAndHeight(e,t){this._viewZone&&(e=F.isIRange(e)?F.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:F.isIRange(e)?e:F.fromPositions(e),options:Gt.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(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"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 uRt(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 gRt(hRt+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 F(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,mt.Smooth):this.editor.revealRange(e,mt.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 Pd(this.domNode,this,{orientation:fi.HORIZONTAL})),this.options.isResizeable||(this._resizeSash.state=oa.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),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;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 pXe=ae("IPeekViewService");ce(pXe,class{constructor(){this._widgets=new Map}addExclusiveWidget(s,e){const t=this._widgets.get(s);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(s);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(s))};this._widgets.set(s,{widget:e,listener:e.onDidClose(i)})}},qt.Delayed);var eg;(function(s){s.inPeekEditor=new Y("inReferenceSearchEditor",!0,g(5106,"Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(eg||(eg={}));var mB;let VJ=(mB=class{constructor(e,t){e instanceof rf&&eg.inPeekEditor.bindTo(t)}dispose(){}},mB.ID="editor.contrib.referenceController",mB);VJ=D([_(1,Le)],VJ);on(VJ.ID,VJ,ri.Eager);function mXe(s){const e=s.get(Kt).getFocusedCodeEditor();return e instanceof rf?e.getParentEditor():e}const fRt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let O3=class extends JRe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new I,this.onDidClose=this._onDidClose.event,dp(this.options,fRt,!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=fe(".head"),this._bodyElement=fe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=fe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Ro(this._titleElement,"click",o=>this._onTitleClick(o))),re(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=fe("span.filename"),this._secondaryHeading=fe("span.dirname"),this._metaHeading=fe("span.meta"),re(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=fe(".peekview-actions");re(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new ld(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new rn("peekview.close",g(5107,"Close"),We.asClassName(ve.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:PN.bind(void 0,this.instantiationService),orientation:M_.HORIZONTAL}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ms(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,jh(this._metaHeading)):Ud(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(x.lineHeight)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,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`)}};O3=D([_(2,we)],O3);const ece=W("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5108,"Background color of the peek view title area.")),XRe=W("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Ll},g(5109,"Color of the peek view title.")),ZRe=W("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},g(5110,"Color of the peek view title info.")),eMe=W("peekView.border",{dark:gm,light:gm,hcDark:wt,hcLight:wt},g(5111,"Color of the peek view borders and arrow.")),pRt=W("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},g(5112,"Background color of the peek view result list."));W("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:me.white,hcLight:Ll},g(5113,"Foreground color for line nodes in the peek view result list."));W("peekViewResult.fileForeground",{dark:me.white,light:"#1E1E1E",hcDark:me.white,hcLight:Ll},g(5114,"Foreground color for file nodes in the peek view result list."));W("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},g(5115,"Background color of the selected entry in the peek view result list."));W("peekViewResult.selectionForeground",{dark:me.white,light:"#6C6C6C",hcDark:me.white,hcLight:Ll},g(5116,"Foreground color of the selected entry in the peek view result list."));const _Xe=W("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:me.black,hcLight:me.white},g(5117,"Background color of the peek view editor."));W("peekViewEditorGutter.background",_Xe,g(5118,"Background color of the gutter in the peek view editor."));W("peekViewEditorStickyScroll.background",_Xe,g(5119,"Background color of sticky scroll in the peek view editor."));W("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},g(5120,"Match highlight color in the peek view result list."));W("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},g(5121,"Match highlight color in the peek view editor."));W("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Js,hcLight:Js},g(5122,"Match highlight border in the peek view editor."));class qk{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=Fme.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(5095,"{0} in {1} on line {2} at column {3}",e.value,_i(this.uri),this.range.startLineNumber,this.range.startColumn):g(5094,"in {0} on line {1} at column {2}",_i(this.uri),this.range.startLineNumber,this.range.startColumn)}}class mRt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:r,endColumn:a}=e,c=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new F(n,c.startColumn,n,o),d=new F(r,a,r,Un.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 B3{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ui}dispose(){bt(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(5096,"1 symbol in {0}, full path {1}",_i(this.uri),this.uri.fsPath):g(5097,"{0} symbols in {1}, full path {2}",e,_i(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 mRt(i))}catch(i){vt(i)}return this}}class tf{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(tf._compareReferences);let n;for(const o of e)if((!n||!xn.isEqual(n.uri,o.uri,!0))&&(n=new B3(this,o.uri),this.groups.push(n)),n.children.length===0||tf._compareReferences(o,n.children[n.children.length-1])!==0){const r=new qk(i===o,n,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){bt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new tf(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?g(5098,"No results found"):this.references.length===1?g(5099,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?g(5100,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):g(5101,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&n+10?(t?n=(n+1)%o:n=(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,o)=>({idx:o,prefixLen:Uy(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,o)=>n.prefixLen>o.prefixLen?-1:n.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()&&F.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 xn.compare(e.uri,t.uri)||F.compareRangesUsingStarts(e.range,t.range)}}var _Rt=".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}";ut(_Rt,{});var Fve;let Ove=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof tf||e instanceof B3}getChildren(e){if(e instanceof tf)return e.groups;if(e instanceof B3)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Ove=D([_(0,fn)],Ove);class vRt{getHeight(){return 23}getTemplateId(e){return e instanceof B3?zJ.id:$J.id}}let Bve=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof qk){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return _i(e.uri)}mightProducePrintableCharacter(e){return this._keybindingService.mightProducePrintableCharacter(e)}};Bve=D([_(0,Ut)],Bve);class bRt{getId(e){return e instanceof qk?e.id:e.uri}}let Wve=class extends V{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new A3(i,{supportHighlights:!0})),this.badge=new w_e(re(i,fe(".count")),{},Mje),e.appendChild(i)}set(e,t){const i=Lr(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 n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(g(11226,"{0} references",n)):this.badge.setTitleFormat(g(11227,"{0} reference",n))}};Wve=D([_(1,Fs)],Wve);var mL;let zJ=(mL=class{constructor(e){this._instantiationService=e,this.templateId=Fve.id}renderTemplate(e){return this._instantiationService.createInstance(Wve,e)}renderElement(e,t,i){i.set(e.element,yU(e.filterData))}disposeTemplate(e){e.dispose()}},Fve=mL,mL.id="FileReferencesRenderer",mL);zJ=Fve=D([_(0,we)],zJ);class wRt extends V{constructor(e){super(),this.label=this._register(new nD(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${_i(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:n,highlight:o}=i;t&&!L_.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,yU(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[o]))}}}const wse=class wse{constructor(){this.templateId=wse.id}renderTemplate(e){return new wRt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};wse.id="OneReferenceRenderer";let $J=wse;class yRt{getWidgetAriaLabel(){return g(11228,"References")}getAriaLabel(e){return e.ariaMessage}}const yse=class yse{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 n=0,o=e.children.length;n{const o=n.deltaDecorations([],t);for(let r=0;r{o.equals(S.Escape)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(SRt,"ReferencesWidget",this._treeContainer,new vRt,[this._instantiationService.createInstance(zJ),this._instantiationService.createInstance($J)],this._instantiationService.createInstance(Ove),i),this._splitView.addView({onDidChange:M.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},Uk.Distribute),this._splitView.addView({onDidChange:M.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)}},Uk.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(o,r)=>{o instanceof qk&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(o=>{o.sideBySide?n(o.element,"side"):o.editorOptions.pinned?n(o.element,"goto"):n(o.element,"show")})),Ud(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new bn(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(9797,"No results"),jh(this._messageContainer),Promise.resolve(void 0)):(Ud(this._messageContainer),this._decorationsManager=new Hve(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 n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),jh(this._treeContainer),jh(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 qk)return e;if(e instanceof B3&&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!==pe.inMemory?this.setTitle(SA(e.uri),this._uriLabel.getUriLabel(Lr(e.uri))):this.setTitle(g(9798,"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 n=await i;if(!this._model){n.dispose();return}bt(this._previewModelReference);const o=n.object;if(o){const r=this._preview.getModel()===o.textEditorModel?mt.Smooth:mt.Immediate,a=F.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};Uve=D([_(3,pn),_(4,fn),_(5,we),_(6,pXe),_(7,Fs),_(8,jA),_(9,Ut),_(10,xi),_(11,Vs)],Uve);var Yq;const BN=new Y("referenceSearchVisible",!1,g(4503,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var _L;let TM=(_L=class{static get(e){return e.getContribution(Yq.ID)}constructor(e,t,i,n,o,r,a,c){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=c,this._disposables=new Z,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=BN.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 n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))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=CRt.fromJSON(this._storageService.get(o,Ie.PROFILE,"{}"));this._widget=this._instantiationService.createInstance(Uve,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(g(4504,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),Ie.PROFILE,an.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(4505,"{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 n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!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=F.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:Ab.JUMP,pinned:t}},this._editor).then(n=>{if(this._ignoreModelChangeEvent=!1,!n||!this._widget){this.closeWidget();return}if(this._editor===n)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=Yq.get(n),r=this._model.clone();this.closeWidget(),n.focus(),o?.toggleWidget(i,Rr(a=>Promise.resolve(r)),this._peekMode??!1)}},n=>{this._ignoreModelChangeEvent=!1,vt(n)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:Ab.JUMP,pinned:i}},this._editor,t)}},Yq=_L,_L.ID="editor.contrib.referencesController",_L);TM=Yq=D([_(2,Le),_(3,Kt),_(4,bi),_(5,we),_(6,$i),_(7,Te)],TM);function WN(s,e){const t=mXe(s);if(!t)return;const i=TM.get(t);i&&e(i)}So.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:Ae.EditorContrib,primary:rr(U.CtrlCmd|S.KeyK,S.F2),when:he.or(BN,eg.inPeekEditor),handler(s){WN(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});So.registerCommandAndKeybindingRule({id:"goToNextReference",weight:Ae.EditorContrib-10,primary:S.F4,secondary:[S.F12],when:he.or(BN,eg.inPeekEditor),handler(s){WN(s,e=>{e.goToNextOrPreviousReference(!0)})}});So.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:Ae.EditorContrib-10,primary:U.Shift|S.F4,secondary:[U.Shift|S.F12],when:he.or(BN,eg.inPeekEditor),handler(s){WN(s,e=>{e.goToNextOrPreviousReference(!1)})}});_t.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");_t.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");_t.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");_t.registerCommand("closeReferenceSearch",s=>WN(s,e=>e.closeWidget()));So.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.EditorContrib-101,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(eg.inPeekEditor,he.not("config.editor.stablePeek"))});So.registerKeybindingRule({id:"closeReferenceSearch",weight:Ae.WorkbenchContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(BN,he.not("config.editor.stablePeek"),he.or(J.editorTextFocus,GLe.negate()))});So.registerCommandAndKeybindingRule({id:"revealReference",weight:Ae.WorkbenchContrib,primary:S.Enter,mac:{primary:S.Enter,secondary:[U.CtrlCmd|S.DownArrow]},when:he.and(BN,bae,jLe.negate(),YLe.negate()),handler(s){const t=s.get(rg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof qk&&WN(s,i=>i.revealReference(t[0]))}});So.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Enter,mac:{primary:U.WinCtrl|S.Enter},when:he.and(BN,bae,jLe.negate(),YLe.negate()),handler(s){const t=s.get(rg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof qk&&WN(s,i=>i.openReference(t[0],!0,!0))}});_t.registerCommand("openReference",s=>{const t=s.get(rg).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof qk&&WN(s,i=>i.openReference(t[0],!1,!0))});let Vve=class extends TM{constructor(e,t,i,n,o,r,a){super(!1,e,t,i,n,o,r,a)}};Vve=D([_(1,Le),_(2,Kt),_(3,bi),_(4,we),_(5,$i),_(6,Te)],Vve);on(TM.ID,Vve,ri.Lazy);const GPe=class GPe extends V{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(U.Alt)&&(this._altListeningMouse||(this._altMouseTriggered=!1),this._altListeningMouse=!0)})),this._register(this._editor.onKeyUp(t=>{t.equals(U.Alt)&&(this._altMouseTriggered&&t.preventDefault(),this._altListeningMouse=!1,this._altMouseTriggered=!1)}))}};GPe.ID="editor.contrib.menuPreventer";let LA=GPe;on(LA.ID,LA,ri.BeforeFirstInteraction);let W3=class extends pp{constructor(e,t,i,n,o,r,a,c,l){super(e,n.getRawOptions(),i,o,r,a,c,l),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(d=>this._onParentConfigurationChanged(d)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){dp(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};W3=D([_(4,Le),_(5,we),_(6,Kt),_(7,rv),_(8,YA)],W3);const O6=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)}}}getImplementations(){return this._implementations}};class vXe extends gd{constructor(e){super(),this.label=e,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._domNode=fe(".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(){Ms(this._domNode),this._domNode.style.backgroundColor=Tpe(fy,ze(Hc)),this._domNode.style.color=Tpe(pM,ze(Ll)),this._domNode.style.border=`1px solid ${ze(wt)}`,re(this._domNode,fe("")).textContent=this.label,this.onclick(this._domNode,()=>this._onClick.fire())}}let GJ=class extends V{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(dC(this.menu,{renderShortTitle:!0,shouldForwardArgs:!0},i),i.length===0)return;const[n]=i,o=this.createWidget(n,e);e.add(o),e.add(o.onClick(()=>n.run(this.getActionArg()))),o.render()};this._register(this.menu.onDidChange(t)),t()}getActionArg(){}isVisible(){return!0}};GJ=D([_(1,Oa),_(2,Le)],GJ);let uHe=class extends GJ{constructor(e,t,i,n){super(e.menuId,i,n),this.options=e,this.instantiationService=t,this.render()}createWidget(e,t){const i=this.instantiationService.createInstance(vXe,e.label),n=i.getDomNode();return this.options.container.appendChild(n),t.add(Ee(()=>n.remove())),i}getActionArg(){return this.options.getActionArg()}};uHe=D([_(1,we),_(2,Oa),_(3,Le)],uHe);var Jq,LD;let gHe=(LD=class extends V{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),Qr(t)?this.doHighlightRange(t,e):P2(t)&&Qr(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&&ji(t,e.resource)&&Qr(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===Oi.NotSet||t.reason===Oi.Explicit||t.reason===Oi.Undo||t.reason===Oi.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?Jq._WHOLE_LINE_RANGE_HIGHLIGHT:Jq._RANGE_HIGHLIGHT}dispose(){super.dispose(),this.editor?.getModel()&&(this.removeHighlightRange(),this.editor=null)}},Jq=LD,LD._WHOLE_LINE_RANGE_HIGHLIGHT=Gt.register({description:"codeeditor-range-highlight-whole",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight",isWholeLine:!0}),LD._RANGE_HIGHLIGHT=Gt.register({description:"codeeditor-range-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"rangeHighlight"}),LD);gHe=Jq=D([_(0,ei)],gHe);let KJ=class extends vXe{constructor(e,t,i,n){super(i&&n.lookupKeybinding(i)?`${t} (${n.lookupKeybinding(i).getLabel()})`:t),this.editor=e}getId(){return"editor.overlayWidget.floatingClickWidget"}getPosition(){return{preference:Fg.BOTTOM_RIGHT_CORNER}}render(){super.render(),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}};KJ=D([_(3,Ut)],KJ);var _B;let fHe=(_B=class extends GJ{constructor(e,t,i,n){super(_e.EditorContent,i,n),this.editor=e,this.instantiationService=t,this.render()}createWidget(e){return this.instantiationService.createInstance(KJ,this.editor,e.label,e.id)}isVisible(){return!(this.editor instanceof rf)&&this.editor?.hasModel()&&!this.editor.getOption(x.inDiffEditor)}getActionArg(){return this.editor.getModel()?.uri}},_B.ID="editor.contrib.floatingClickMenu",_B);fHe=D([_(1,we),_(2,Oa),_(3,Le)],fHe);Object.freeze({id:"application",order:100,title:g(4506,"Application"),type:"object"});const B6=Object.freeze({id:"workbench",order:7,title:g(4507,"Workbench"),type:"object"}),ARt=Object.freeze({id:"security",scope:at.APPLICATION,title:g(4508,"Security"),type:"object",order:7}),ERt=Object.freeze({id:"problems",title:g(4509,"Problems"),type:"object",order:101}),bXe=Object.freeze({id:"window",order:8,title:g(4510,"Window"),type:"object"}),Tm={ConfigurationMigration:"base.contributions.configuration.migration"};class xRt{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new I,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const Xq=new xRt;Qe.add(Tm.ConfigurationMigration,Xq);var vB;let qJ=(vB=class extends V{constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const n of i.added)await this.migrateConfigurationsForFolder(n,Xq.migrations)})),this.migrateConfigurations(Xq.migrations),this._register(Xq.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}),n=this.workspaceService.getWorkbenchState()===qi.WORKSPACE?[["user",St.USER],["userLocal",St.USER_LOCAL],["userRemote",St.USER_REMOTE],["workspace",St.WORKSPACE],["workspaceFolder",St.WORKSPACE_FOLDER]]:[["user",St.USER],["userLocal",St.USER_LOCAL],["userRemote",St.USER_REMOTE],["workspace",St.WORKSPACE]];for(const[o,r]of n){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,n,o){const r=c=>{const d=this.configurationService.inspect(c,{resource:n})[t];if(d)return o?d.overrides?.find(({identifiers:h})=>Ys(h,o))?.value:d.value},a=await e.migrateFn(i,r);return Array.isArray(a)?a:[[e.key,a]]}},vB.ID="workbench.contrib.configurationMigration",vB);qJ=D([_(0,Te),_(1,yi)],qJ);var bB;let QJ=(bB=class extends V{constructor(e){super(),this.remoteAgentService=e,this._ready=new dc,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Qn&&(await this.remoteAgentService.getEnvironment())?.os!==Ds.Windows)return;Qe.as(Nn.Configuration).registerConfiguration({...ARt,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:g(4511,"UNC host names must not contain backslashes.")},default:[],markdownDescription:g(4512,"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:at.MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:g(4513,"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:at.MACHINE}}})}},bB.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",bB);QJ=D([_(0,cg)],QJ);const p4="window.newWindowProfile";var wB;let jJ=(wB=class extends V{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!==St.DEFAULT&&i.affectsConfiguration(p4)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=Qe.as(Nn.Configuration),t={...bXe,properties:{[p4]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),g(4514,"Active Window")],description:g(4515,"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:at.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(p4);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(p4);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(p4,t?.name)}},wB.ID="workbench.contrib.dynamicWindowConfiguration",wB);jJ=D([_(0,Cm),_(1,Te)],jJ);class DRt extends li{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Fe(4976,"Toggle Collapse Unchanged Regions"),icon:ve.map,toggled:he.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:he.has("isInDiffEditor"),menu:{when:he.has("isInDiffEditor"),id:_e.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class wXe extends li{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Fe(4977,"Toggle Show Moved Code Blocks"),precondition:he.has("isInDiffEditor")})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class yXe extends li{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Fe(4978,"Toggle Use Inline View When Space Is Limited"),precondition:he.has("isInDiffEditor")})}run(e,...t){const i=e.get(Te),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const W6=Fe(4979,"Diff Editor");class kRt extends df{constructor(){super({id:"diffEditor.switchSide",title:Fe(4980,"Switch Side"),icon:ve.arrowSwap,precondition:he.has("isInDiffEditor"),f1:!0,category:W6})}runEditorCommand(e,t,i){const n=PU(e);if(n instanceof pp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class IRt extends df{constructor(){super({id:"diffEditor.exitCompareMove",title:Fe(4981,"Exit Compare Move"),icon:ve.close,precondition:J.comparingMovedCode,f1:!1,category:W6,keybinding:{weight:1e4,primary:S.Escape}})}runEditorCommand(e,t,...i){const n=PU(e);n instanceof pp&&n.exitCompareMove()}}class TRt extends df{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Fe(4982,"Collapse All Unchanged Regions"),icon:ve.fold,precondition:he.has("isInDiffEditor"),f1:!0,category:W6})}runEditorCommand(e,t,...i){const n=PU(e);n instanceof pp&&n.collapseAllUnchangedRegions()}}class LRt extends df{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Fe(4983,"Show All Unchanged Regions"),icon:ve.unfold,precondition:he.has("isInDiffEditor"),f1:!0,category:W6})}runEditorCommand(e,t,...i){const n=PU(e);n instanceof pp&&n.showAllUnchangedRegions()}}class zve extends li{constructor(){super({id:"diffEditor.revert",title:Fe(4984,"Revert"),f1:!1,category:W6})}run(e,t){const i=RRt(e,t.originalUri,t.modifiedUri);i instanceof pp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const CXe=Fe(4985,"Accessible Diff Viewer"),Cse=class Cse extends li{constructor(){super({id:Cse.id,title:Fe(4986,"Go to Next Difference"),category:CXe,precondition:he.has("isInDiffEditor"),keybinding:{primary:S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){PU(e)?.accessibleDiffViewerNext()}};Cse.id="editor.action.accessibleDiffViewer.next";let uW=Cse;const Sse=class Sse extends li{constructor(){super({id:Sse.id,title:Fe(4987,"Go to Previous Difference"),category:CXe,precondition:he.has("isInDiffEditor"),keybinding:{primary:U.Shift|S.F7,weight:Ae.EditorContrib},f1:!0})}run(e){PU(e)?.accessibleDiffViewerPrev()}};Sse.id="editor.action.accessibleDiffViewer.prev";let H3=Sse;function RRt(s,e,t){return s.get(Kt).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 PU(s){const t=s.get(Kt).listDiffEditors(),i=Bc();if(i)for(const n of t){const o=n.getContainerDomNode();if(MRt(o,i))return n}return null}function MRt(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}var Rb;(function(s){s.Terminal="terminal",s.TerminalChat="terminal-chat",s.TerminalHelp="terminal-help",s.DiffEditor="diffEditor",s.Chat="panelChat",s.InlineChat="inlineChat",s.InlineCompletions="inlineCompletions",s.KeybindingsEditor="keybindingsEditor",s.Notebook="notebook",s.Editor="editor",s.Hover="hover",s.Notification="notification",s.EmptyEditorHint="emptyEditorHint",s.Comments="comments",s.Repl="repl",s.ReplHelp="replHelp",s.RunAndDebug="runAndDebug"})(Rb||(Rb={}));var _m;(function(s){s.Help="help",s.View="view"})(_m||(_m={}));var pHe;(function(s){s.Previous="previous",s.Next="next"})(pHe||(pHe={}));class SXe extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.id=e,this.options=t,this.provideContent=i,this.onClose=n,this.verbositySettingKey=o,this.onOpen=r,this.actions=a,this.provideNextContent=c,this.providePreviousContent=l,this.onDidChangeContent=d,this.onKeyDown=h,this.getSymbols=u,this.onDidRequestClearLastProvider=f}}const NRt=new Y("hasSpeechProvider",!1,{type:"boolean",description:g(6234,"A speech provider is registered to the speech service.")}),PRt=new Y("speechToTextInProgress",!1,{type:"boolean",description:g(6235,"A speech-to-text session is in progress.")});new Y("textToSpeechInProgress",!1,{type:"boolean",description:g(6236,"A text-to-speech session is in progress.")});var hF;(function(s){s[s.Started=1]="Started",s[s.Recognizing=2]="Recognizing",s[s.Recognized=3]="Recognized",s[s.Stopped=4]="Stopped",s[s.Error=5]="Error"})(hF||(hF={}));var $ve;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})($ve||($ve={}));var mHe;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped",s[s.Canceled=3]="Canceled"})(mHe||(mHe={}));var QO;(function(s){s.SpeechTimeout="accessibility.voice.speechTimeout",s.AutoSynthesize="accessibility.voice.autoSynthesize",s.SpeechLanguage="accessibility.voice.speechLanguage"})(QO||(QO={}));QO.SpeechLanguage;const FRt={"da-DK":{name:g(6237,"Danish (Denmark)")},"de-DE":{name:g(6238,"German (Germany)")},"en-AU":{name:g(6239,"English (Australia)")},"en-CA":{name:g(6240,"English (Canada)")},"en-GB":{name:g(6241,"English (United Kingdom)")},"en-IE":{name:g(6242,"English (Ireland)")},"en-IN":{name:g(6243,"English (India)")},"en-NZ":{name:g(6244,"English (New Zealand)")},"en-US":{name:g(6245,"English (United States)")},"es-ES":{name:g(6246,"Spanish (Spain)")},"es-MX":{name:g(6247,"Spanish (Mexico)")},"fr-CA":{name:g(6248,"French (Canada)")},"fr-FR":{name:g(6249,"French (France)")},"hi-IN":{name:g(6250,"Hindi (India)")},"it-IT":{name:g(6251,"Italian (Italy)")},"ja-JP":{name:g(6252,"Japanese (Japan)")},"ko-KR":{name:g(6253,"Korean (South Korea)")},"nl-NL":{name:g(6254,"Dutch (Netherlands)")},"pt-PT":{name:g(6255,"Portuguese (Portugal)")},"pt-BR":{name:g(6256,"Portuguese (Brazil)")},"ru-RU":{name:g(6257,"Russian (Russia)")},"sv-SE":{name:g(6258,"Swedish (Sweden)")},"tr-TR":{name:g(6259,"Turkish (Türkiye)")},"zh-CN":{name:g(6260,"Chinese (Simplified, China)")},"zh-HK":{name:g(6261,"Chinese (Traditional, Hong Kong)")},"zh-TW":{name:g(6262,"Chinese (Traditional, Taiwan)")}},RA=new Y("accessibilityHelpIsShown",!1,!0),mp=new Y("accessibleViewIsShown",!1,!0),YJ=new Y("accessibleViewSupportsNavigation",!1,!0),_He=new Y("accessibleViewVerbosityEnabled",!1,!0),vHe=new Y("accessibleViewGoToSymbolSupported",!1,!0);new Y("accessibleViewOnLastLine",!1,!0);const JJ=new Y("accessibleViewCurrentProviderId",void 0,void 0);new Y("accessibleViewInCodeBlock",void 0,void 0);const XJ=new Y("accessibleViewContainsCodeBlocks",void 0,void 0),bHe=new Y("accessibleViewHasUnassignedKeybindings",void 0,void 0),wHe=new Y("accessibleViewHasAssignedKeybindings",void 0,void 0);var Gve;(function(s){s.DimUnfocusedEnabled="accessibility.dimUnfocused.enabled",s.DimUnfocusedOpacity="accessibility.dimUnfocused.opacity",s.HideAccessibleView="accessibility.hideAccessibleView",s.AccessibleViewCloseOnKeyPress="accessibility.accessibleView.closeOnKeyPress"})(Gve||(Gve={}));var yHe;(function(s){s[s.Default=.75]="Default",s[s.Minimum=.2]="Minimum",s[s.Maximum=1]="Maximum"})(yHe||(yHe={}));var vr;(function(s){s.Terminal="accessibility.verbosity.terminal",s.DiffEditor="accessibility.verbosity.diffEditor",s.Chat="accessibility.verbosity.panelChat",s.InlineChat="accessibility.verbosity.inlineChat",s.TerminalChat="accessibility.verbosity.terminalChat",s.InlineCompletions="accessibility.verbosity.inlineCompletions",s.KeybindingsEditor="accessibility.verbosity.keybindingsEditor",s.Notebook="accessibility.verbosity.notebook",s.Editor="accessibility.verbosity.editor",s.Hover="accessibility.verbosity.hover",s.Notification="accessibility.verbosity.notification",s.EmptyEditorHint="accessibility.verbosity.emptyEditorHint",s.ReplInputHint="accessibility.verbosity.replInputHint",s.Comments="accessibility.verbosity.comments",s.DiffEditorActive="accessibility.verbosity.diffEditorActive",s.Debug="accessibility.verbosity.debug"})(vr||(vr={}));const vf={type:"boolean",default:!0,tags:["accessibility"]},AXe=Object.freeze({id:"accessibility",title:g(4679,"Accessibility"),type:"object"}),Ua={type:"string",enum:["auto","on","off"],default:"auto",enumDescriptions:[g(4680,"Enable sound when a screen reader is attached."),g(4681,"Enable sound."),g(4682,"Disable sound.")],tags:["accessibility"]},_d={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto",announcement:"auto"}},vd={type:"string",enum:["auto","off"],default:"auto",enumDescriptions:[g(4683,"Enable announcement, will only play when in screen reader optimized mode."),g(4684,"Disable announcement.")],tags:["accessibility"]},PI={type:"object",tags:["accessibility"],additionalProperties:!1,default:{sound:"auto"}};({...AXe,scope:at.RESOURCE,properties:(vr.Terminal+"",{description:g(4685,"Provide information about how to access the terminal accessibility help menu when the terminal is focused."),...vf},vr.DiffEditor+"",{description:g(4686,"Provide information about how to navigate changes in the diff editor when it is focused."),...vf},vr.Chat+"",{description:g(4687,"Provide information about how to access the chat help menu when the chat input is focused."),...vf},vr.InlineChat+"",{description:g(4688,"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."),...vf},vr.InlineCompletions+"",{description:g(4689,"Provide information about how to access the inline completions hover and Accessible View."),...vf},vr.KeybindingsEditor+"",{description:g(4690,"Provide information about how to change a keybinding in the keybindings editor when a row is focused."),...vf},vr.Notebook+"",{description:g(4691,"Provide information about how to focus the cell container or inner editor when a notebook cell is focused."),...vf},vr.Hover+"",{description:g(4692,"Provide information about how to open the hover in an Accessible View."),...vf},vr.Notification+"",{description:g(4693,"Provide information about how to open the notification in an Accessible View."),...vf},vr.EmptyEditorHint+"",{description:g(4694,"Provide information about relevant actions in an empty text editor."),...vf},vr.ReplInputHint+"",{description:g(4695,"Provide information about relevant actions For the Repl input."),...vf},vr.Comments+"",{description:g(4696,"Provide information about actions that can be taken in the comment widget or in a file which contains comments."),...vf},vr.DiffEditorActive+"",{description:g(4697,"Indicate when a diff editor becomes the active editor."),...vf},vr.Debug+"",{description:g(4698,"Provide information about how to access the debug console accessibility help dialog when the debug console or run and debug viewlet is focused. Note that a reload of the window is required for this to take effect."),...vf},Gve.AccessibleViewCloseOnKeyPress+"",g(4699,"On keypress, close the Accessible View and focus the element from which it was invoked."),g(4700,"The volume of the sounds in percent (0-100)."),g(4701,"Whether or not position changes should be debounced"),g(4702,"The delay in milliseconds before an announcement is made."),g(4703,"The delay in milliseconds before a sound is played."),g(4704,"The delay in milliseconds before an announcement is made when there's a warning at the position."),g(4705,"The delay in milliseconds before a sound is played when there's a warning at the position."),g(4706,"The delay in milliseconds before an announcement is made when there's an error at the position."),g(4707,"The delay in milliseconds before a sound is played when there's an error at the position."),{..._d,description:g(4708,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."),properties:({description:g(4709,"Plays a sound when the active line has a breakpoint."),...Ua},{description:g(4710,"Announces when the active line has a breakpoint."),...vd})},{...PI,description:g(4711,"Plays a sound / audio cue when the active line has an inline suggestion."),properties:{description:g(4712,"Plays a sound when the active line has an inline suggestion."),...Ua}},{..._d,description:g(4713,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."),properties:({description:g(4714,"Plays a sound when the active line has an error."),...Ua},{description:g(4715,"Announces when the active line has an error."),...vd})},{..._d,description:g(4716,"Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."),properties:({description:g(4717,"Plays a sound when the active line has a folded area that can be unfolded."),...Ua},{description:g(4718,"Announces when the active line has a folded area that can be unfolded."),...vd})},{..._d,description:g(4719,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4720,"Plays a sound when the active line has a warning."),...Ua},{description:g(4721,"Announces when the active line has a warning."),...vd})},{..._d,description:g(4722,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4723,"Plays a sound when the active line has a warning."),...Ua},{description:g(4724,"Announces when the active line has a warning."),...vd})},{..._d,description:g(4725,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),properties:({description:g(4726,"Plays a sound when the active line has a warning."),...Ua},{description:g(4727,"Announces when the active line has a warning."),...vd})},{..._d,description:g(4728,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."),properties:({description:g(4729,"Plays a sound when the debugger stopped on a breakpoint."),...Ua},{description:g(4730,"Announces when the debugger stopped on a breakpoint."),...vd})},{..._d,description:g(4731,"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(4732,"Plays a sound when trying to read a line with inlay hints that has no inlay hints."),...Ua},{description:g(4733,"Announces when trying to read a line with inlay hints that has no inlay hints."),...vd})},{..._d,description:g(4734,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."),properties:({description:g(4735,"Plays a sound when a task is completed."),...Ua},{description:g(4736,"Announces when a task is completed."),...vd})},{..._d,description:g(4737,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."),properties:({description:g(4738,"Plays a sound when a task fails (non-zero exit code)."),...Ua},{description:g(4739,"Announces when a task fails (non-zero exit code)."),...vd})},{..._d,description:g(4740,"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(4741,"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."),...Ua},{description:g(4742,"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."),...vd})},{..._d,description:g(4743,"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(4744,"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."),...Ua},{description:g(4745,"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."),...vd})},{..._d,description:g(4746,"Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."),properties:({description:g(4747,"Plays a sound when terminal Quick Fixes are available."),...Ua},{description:g(4748,"Announces when terminal Quick Fixes are available."),...vd})},{..._d,description:g(4749,"Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."),properties:({description:g(4750,"Plays a sound when the terminal bell is ringing."),...Ua},{description:g(4751,"Announces when the terminal bell is ringing."),...vd})},{...PI,description:g(4752,"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(4753,"Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...PI,description:g(4754,"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(4755,"Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{...PI,description:g(4756,"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(4757,"Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),...Ua}},{..._d,description:g(4758,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."),properties:({description:g(4759,"Plays a sound when a notebook cell execution is successfully completed."),...Ua},{description:g(4760,"Announces when a notebook cell execution is successfully completed."),...vd})},{..._d,description:g(4761,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."),properties:({description:g(4762,"Plays a sound when a notebook cell execution fails."),...Ua},{description:g(4763,"Announces when a notebook cell execution fails."),...vd})},{..._d,description:g(4764,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."),properties:({description:g(4765,"Plays a sound when a chat request is made."),...Ua},{description:g(4766,"Announces when a chat request is made."),...vd})},{..._d,description:g(4767,"Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."),properties:({description:g(4768,"Plays a sound on loop while progress is occurring."),...Ua},{description:g(4769,"Alerts on loop while progress is occurring."),...vd})},{...PI,description:g(4770,"Plays a sound / audio cue when the response has been received."),properties:{description:g(4771,"Plays a sound on loop while the response has been received."),...Ua}},{...PI,description:g(4772,"Plays a sound / audio cue when the voice recording has started."),properties:{description:g(4773,"Plays a sound when the voice recording has started."),...Ua}},{...PI,description:g(4774,"Plays a sound / audio cue when the voice recording has stopped."),properties:{description:g(4775,"Plays a sound when the voice recording has stopped."),...Ua}},{..._d,description:g(4776,"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(4777,"Plays a sound when a feature is cleared."),...Ua},{description:g(4778,"Announces when a feature is cleared."),...vd})},g(4779,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."),g(4780,"Plays a sound when a file is saved."),g(4781,"Plays the sound when a user explicitly saves a file."),g(4782,"Plays the sound whenever a file is saved, including auto save."),g(4783,"Never plays the sound."),g(4784,"Announces when a file is saved."),g(4785,"Announces when a user explicitly saves a file."),g(4786,"Announces whenever a file is saved, including auto save."),g(4787,"Never plays the announcement."),g(4788,"Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."),g(4789,"Plays a sound when a file or notebook is formatted."),g(4790,"Plays the sound when a user explicitly formats a file."),g(4791,"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(4792,"Never plays the sound."),g(4793,"Announces when a file or notebook is formatted."),g(4794,"Announces when a user explicitly formats a file."),g(4795,"Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),g(4796,"Never announces."),g(4797,"Controls whether links should be underlined in the workbench."),g(4798,"Controls whether variable changes should be announced in the debug watch view."))});const ORt=1200;var yB;let CHe=(yB=class extends V{constructor(e,t){super(),this.speechService=e,this.productService=t,this._register(M.runAndSubscribe(e.onDidChangeHasSpeechProvider,()=>this.updateConfiguration()))}updateConfiguration(){if(!this.speechService.hasSpeechProvider)return;const e=this.getLanguages(),t=Object.keys(e).sort((n,o)=>e[n].name.localeCompare(e[o].name));Qe.as(Nn.Configuration).registerConfiguration({...AXe,properties:{[QO.SpeechTimeout]:{markdownDescription:g(4802,"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:ORt,minimum:0,tags:["accessibility"]},[QO.SpeechLanguage]:{markdownDescription:g(4803,"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(n=>e[n].name),enumItemLabels:t.map(n=>e[n].name)},[QO.AutoSynthesize]:{type:"boolean",markdownDescription:g(4804,"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(4805,"Auto (Use Display Language)")},...FRt}}},yB.ID="workbench.contrib.dynamicSpeechAccessibilityConfiguration",yB);CHe=D([_(0,Vae),_(1,Er)],CHe);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.volume",migrateFn:(s,e)=>[["accessibility.signalOptions.volume",{value:s}],["audioCues.volume",{value:void 0}]]}]);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"audioCues.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["audioCues.debouncePositionChanges",{value:void 0}]]}]);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signalOptions",migrateFn:(s,e)=>{const t=Fhe(e,"general"),i=Fhe(e,"errorAtPosition"),n=Fhe(e,"warningAtPosition"),o=BRt(e),r=WRt(e);return[["accessibility.signalOptions.volume",{value:o}],["accessibility.signalOptions.debouncePositionChanges",{value:r}],["accessibility.signalOptions.experimental.delays.general",{value:t}],["accessibility.signalOptions.experimental.delays.errorAtPosition",{value:i}],["accessibility.signalOptions.experimental.delays.warningAtPosition",{value:n}],["accessibility.signalOptions",{value:void 0}]]}}]);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.sounds.volume",migrateFn:s=>[["accessibility.signalOptions.volume",{value:s}],["accessibility.signals.sounds.volume",{value:void 0}]]}]);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.debouncePositionChanges",migrateFn:s=>[["accessibility.signalOptions.debouncePositionChanges",{value:s}],["accessibility.signals.debouncePositionChanges",{value:void 0}]]}]);function Fhe(s,e){return s(`accessibility.signalOptions.experimental.delays.${e}`)||s("accessibility.signalOptions")?.["experimental.delays"]?.[`${e}`]||s("accessibility.signalOptions")?.delays?.[`${e}`]}function BRt(s){return s("accessibility.signalOptions.volume")||s("accessibility.signalOptions")?.volume||s("accessibility.signals.sounds.volume")||s("audioCues.volume")}function WRt(s){return s("accessibility.signalOptions.debouncePositionChanges")||s("accessibility.signalOptions")?.debouncePositionChanges||s("accessibility.signals.debouncePositionChanges")||s("audioCues.debouncePositionChanges")}Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"accessibility.signals.chatResponsePending",migrateFn:(s,e)=>[["accessibility.signals.progress",{value:s}],["accessibility.signals.chatResponsePending",{value:void 0}]]}]);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations(al.allAccessibilitySignals.map(s=>s.legacySoundSettingsKey?{key:s.legacySoundSettingsKey,migrateFn:(e,t)=>{const i=[],n=s.legacyAnnouncementSettingsKey;let o;return n&&(o=t(n)??void 0,o!==void 0&&typeof o!="string"&&(o=o?"auto":"off")),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i.push([`${s.settingsKey}`,{value:o!==void 0?{announcement:o,sound:e}:{sound:e}}]),i}}:void 0).filter(Fc));Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations(al.allAccessibilitySignals.filter(s=>!!s.legacyAnnouncementSettingsKey&&!!s.legacySoundSettingsKey).map(s=>({key:s.legacyAnnouncementSettingsKey,migrateFn:(e,t)=>{const i=[],n=t(s.settingsKey)?.sound||t(s.legacySoundSettingsKey);return e!==void 0&&typeof e!="string"&&(e=e?"auto":"off"),i.push([`${s.settingsKey}`,{value:e!==void 0?{announcement:e,sound:n}:{sound:n}}]),i.push([`${s.legacyAnnouncementSettingsKey}`,{value:void 0}]),i.push([`${s.legacySoundSettingsKey}`,{value:void 0}]),i}})));var Yd;(function(s){s.OpenAccessibleView="editor.action.accessibleView",s.OpenAccessibilityHelp="editor.action.accessibilityHelp",s.DisableVerbosityHint="editor.action.accessibleViewDisableHint",s.GoToSymbol="editor.action.accessibleViewGoToSymbol",s.ShowNext="editor.action.accessibleViewNext",s.ShowPrevious="editor.action.accessibleViewPrevious",s.AccessibleViewAcceptInlineCompletion="editor.action.accessibleViewAcceptInlineCompletion",s.NextCodeBlock="editor.action.accessibleViewNextCodeBlock",s.PreviousCodeBlock="editor.action.accessibleViewPreviousCodeBlock",s.AccessibilityHelpConfigureKeybindings="editor.action.accessibilityHelpConfigureKeybindings",s.AccessibilityHelpConfigureAssignedKeybindings="editor.action.accessibilityHelpConfigureAssignedKeybindings",s.AccessibilityHelpOpenHelpLink="editor.action.accessibilityHelpOpenHelpLink"})(Yd||(Yd={}));function HRt(s){const e=new Z,t=e.add(OGe());return e.add(ai(i=>{t.setStyle(s.read(i))})),e}const EXe="editor.action.inlineSuggest.commit",xXe="editor.action.inlineSuggest.showPrevious",DXe="editor.action.inlineSuggest.showNext";var URt=".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}";ut(URt,{});class U3{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 N2([...this.parts.map(i=>new ru(F.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 B2([...this.parts.map(o=>new au(F.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 tX{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=ov(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 Xve{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new tX(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=ov(this.text)}renderForScreenReader(e){return this.newLines.join(` -`)}render(e,t=!1){const i=this.columnRange.toRange(this.lineNumber);return t?new B2([new au(F.fromPositions(i.getStartPosition()),"("),new au(F.fromPositions(i.getEndPosition()),`)[${this.newLines.join(` -`)}]`)]).applyToString(e):new B2([new au(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 PHe(s,e){return is(s,e,FXe)}function FXe(s,e){return s===e?!0:!s||!e?!1:s instanceof $3&&e instanceof $3||s instanceof Xve&&e instanceof Xve?s.equals(e):!1}const ZRt=[];function eMt(){return ZRt}class OXe{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ni(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new F(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function BXe(s,e){const t=new Z,i=s.createDecorationsCollection();return t.add(v6({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function tMt(s,e){return new oe(s.lineNumber+e.lineNumber-1,e.lineNumber===1?s.column+e.column-1:e.column)}function FHe(s,e){return new oe(s.lineNumber-e.lineNumber+1,s.lineNumber-e.lineNumber===0?s.column-e.column+1:s.column)}const OHe="ghost-text";let Zve=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=jt(this,!1),this.currentTextModel=Kn(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Ze(this,n=>{if(this.isDisposed.read(n))return;const o=this.currentTextModel.read(n);if(o!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;const a=r instanceof Xve?r.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const b=l[l.length-1];v&&b.decorations.push(new eu(b.content.length+1,b.content.length+1+m[0].length,v,Ja.Regular)),b.content+=m[0],m=m.slice(1)}for(const b of m)l.push({content:b,decorations:v?[new eu(1,b.length+1,v,Ja.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,OHe),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 OXe(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:o}}),this.decorations=Ze(this,n=>{const o=this.uiState.read(n);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:F.fromPositions(new oe(o.lineNumber,a.column)),options:{description:OHe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:w_.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new WXe(this.editor,this.languageService.languageIdCodec,Ze(n=>{const o=this.uiState.read(n);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(BXe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Zve=D([_(2,xi)],Zve);class WXe extends V{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=id("editorOptionChanged",M.filter(this.editor.onDidChangeConfiguration,n=>n.hasChanged(x.disableMonospaceOptimizations)||n.hasChanged(x.stopRenderingLineAfter)||n.hasChanged(x.renderWhitespace)||n.hasChanged(x.renderControlCharacters)||n.hasChanged(x.fontLigatures)||n.hasChanged(x.fontInfo)||n.hasChanged(x.lineHeight))),this._register(ai(n=>{const o=this.lines.read(n);this.editorOptionsChanged.read(n),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 n=this.editor.getModel();if(!n)return;const{tabSize:o}=n.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");iMt(c,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:Io.Right})}})}}function iMt(s,e,t,i,n){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 wU(1e4);u.appendString('
    ');for(let m=0,v=t.length;m');const y=H7(w),C=E2(w),A=gd.createEmpty(w,n);n6(new yI(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,w,!1,y,C,0,A,b.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,c,l!==Lk.OFF,null),u),u.appendString("
    ")}u.appendString(""),Dl(s,d);const f=u.build(),p=BHe?BHe.createHTML(f):f;s.innerHTML=p}const BHe=QA("editorGhostText",{createHTML:s=>s}),Cw=class Cw extends V{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=Cw.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=Cw.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=Cw.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=Cw.suppressSuggestions.bindTo(this.contextKeyService),this._register(ai(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(ai(i=>{const n=this.model.read(i);let o=!1,r=!0;const a=n?.primaryGhostText.read(i);if(n?.selectedSuggestItem&&a&&a.parts.length>0){const{column:c,lines:l}=a.parts[0],d=l[0],h=n.textModel.getLineIndentColumn(a.lineNumber);if(c<=h){let f=kh(d);f===-1&&(f=d.length-1),o=f>0;const p=n.textModel.getOptions().tabSize;r=qa.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ze(this,n=>{const o=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!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(cu((n,o)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=AI((l,d)=>{const h=d.add(this.instantiationService.createInstance(_W,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(ai(u=>{this.position.read(u)&&r.lastTriggerKind.read(u)!==em.Explicit&&r.triggerExplicitly()})),h}),c=b6(this,(l,d)=>!!this.position.read(l)||!!d);o.add(ai(l=>{c.read(l)&&a.read(l)}))}))}};ebe=D([_(2,we)],ebe);const sMt=oi("inline-suggestion-hints-next",ve.chevronRight,g(9866,"Icon for show next parameter hint.")),oMt=oi("inline-suggestion-hints-previous",ve.chevronLeft,g(9867,"Icon for show previous parameter hint."));var OD;let _W=(OD=class extends V{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new rn(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=g(9868,"{0} ({1})",t,o.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${tQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Bt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Bt("div@toolBar")]),this.previousAction=this.createCommandAction(NXe,g(9869,"Previous"),We.asClassName(oMt)),this.availableSuggestionCountAction=new rn("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(PXe,g(9870,"Next"),We.asClassName(sMt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new cn(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new cn(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(tbe,this.nodes.toolBar,_e.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof Sc)return c.createInstance(aMt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new rMt(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=>{tQ._dropDownVisible=u})),this._register(ai(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(ai(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(ai(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 b of v)b instanceof Sc&&p.push(b);p.length>0&&p.unshift(new Ar),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[es.ABOVE,es.BELOW],positionAffinity:Io.LeftOfInjectedText}}},tQ=OD,OD._dropDownVisible=!1,OD.id=0,OD);_W=tQ=D([_(6,vi),_(7,we),_(8,Ut),_(9,Le),_(10,Oa)],_W);class rMt extends Jy{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 aMt=class extends Lb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Bt("div.keybinding").root;this._register(new qk(t,po,{disableTitle:!0,...pYe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},tbe=class extends lW{constructor(e,t,i,n,o,r,a,c,l){super(e,{resetMenu:t,...i},n,o,r,a,c,l),this.menuId=t,this.options2=i,this.menuService=n,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=[];fC(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){is(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){is(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};tbe=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,vi),_(8,Yi)],tbe);function cMt(s,e){const t=new Zqe,i=new tQe(t,l=>e.getLanguageConfiguration(l)),n=new eQe(new lMt([s]),i),o=gme(n,[],void 0,!0);let r="";const a=s.getLineContent();function c(l,d){if(l.kind===Go.Pair)if(c(l.openingBracket,d),d=Tr(d,l.openingBracket.length),l.child&&(c(l.child,d),d=Tr(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=Tr(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);r+=u}else if(l.kind!==Go.UnexpectedClosingBracket){if(l.kind===Go.Text||l.kind===Go.Bracket)r+=a.substring(d,Tr(d,l.length));else if(l.kind===Go.List)for(const h of l.children)c(h,d),d=Tr(d,h.length)}}return c(o,tu),r}class lMt{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 Xt;(function(s){s[s.Dollar=0]="Dollar",s[s.Colon=1]="Colon",s[s.Comma=2]="Comma",s[s.CurlyOpen=3]="CurlyOpen",s[s.CurlyClose=4]="CurlyClose",s[s.Backslash=5]="Backslash",s[s.Forwardslash=6]="Forwardslash",s[s.Pipe=7]="Pipe",s[s.Int=8]="Int",s[s.VariableName=9]="VariableName",s[s.Format=10]="Format",s[s.Plus=11]="Plus",s[s.Dash=12]="Dash",s[s.QuestionMark=13]="QuestionMark",s[s.EOF=14]="EOF"})(Xt||(Xt={}));const Ym=class Ym{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=B.Digit0&&e<=B.Digit9}static isVariableCharacter(e){return e===B.Underline||e>=B.a&&e<=B.z||e>=B.A&&e<=B.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:Xt.EOF,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=Ym._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Ym.isDigitCharacter(i)){n=Xt.Int;do t+=1,i=this.value.charCodeAt(e+t);while(Ym.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Ym.isVariableCharacter(i)){n=Xt.VariableName;do i=this.value.charCodeAt(e+ ++t);while(Ym.isVariableCharacter(i)||Ym.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=Xt.Format;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ym._table[i]>"u"&&!Ym.isDigitCharacter(i)&&!Ym.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Ym._table={[B.DollarSign]:Xt.Dollar,[B.Colon]:Xt.Colon,[B.Comma]:Xt.Comma,[B.OpenCurlyBrace]:Xt.CurlyOpen,[B.CloseCurlyBrace]:Xt.CurlyClose,[B.Backslash]:Xt.Backslash,[B.Slash]:Xt.Forwardslash,[B.Pipe]:Xt.Pipe,[B.Plus]:Xt.Plus,[B.Dash]:Xt.Dash,[B.QuestionMark]:Xt.QuestionMark};let ibe=Ym;class UU{constructor(){this._children=[]}appendChild(e){return e instanceof $d&&this._children[this._children.length-1]instanceof $d?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,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 $6)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class $d extends UU{static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){super(),this.value=e}toString(){return this.value}toTextmateString(){return $d.escape(this.value)}len(){return this.value.length}clone(){return new $d(this.value)}}class HXe extends UU{}class zg extends HXe{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 VU?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 zg(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class VU extends UU{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof $d&&(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 VU;return this.options.forEach(e.appendChild,e),e}}class gMe extends UU{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=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 zv&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof zv){let n=e[i.index]||"";n=i.resolve(n),t+=n}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 gMe;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 zv extends UU{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}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,n)=>n===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 zv(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class vW extends HXe{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 $d(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 vW(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function WHe(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class $6 extends UU{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof zg&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return WHe([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof zg&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof vW&&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 $6;return this._children=this.children.map(t=>t.clone()),e}walk(e){WHe(this.children,e)}}class X_{constructor(){this._scanner=new ibe,this._token={type:Xt.EOF,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static asInsertText(e){return new X_().parse(e).toString()}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new $6;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk(c=>(c instanceof zg&&(c.isFinalTabstop?n.set(0,void 0):!n.has(c.index)&&c.children.length>0?n.set(c.index,c.children):o.push(c)),!0));const r=(c,l)=>{const d=n.get(c.index);if(!d)return;const h=new zg(c.index);h.transform=c.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof zg&&n.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 zg(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===Xt.EOF)return!1;if(this._token.type===Xt.Backslash){const n=this._scanner.next();if(n.type!==Xt.Dollar&&n.type!==Xt.CurlyClose&&n.type!==Xt.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(Xt.Backslash,!0))?(t=this._accept(Xt.Dollar,!0)||this._accept(Xt.CurlyClose,!0)||this._accept(Xt.Backslash,!0)||t,e.appendChild(new $d(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(Xt.Dollar)&&(t=this._accept(Xt.VariableName,!0)||this._accept(Xt.Int,!0))?(e.appendChild(/^\d+$/.test(t)?new zg(Number(t)):new vW(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(Xt.Dollar)&&this._accept(Xt.CurlyOpen)&&(t=this._accept(Xt.Int,!0))))return this._backTo(i);const o=new zg(Number(t));if(this._accept(Xt.Colon))for(;;){if(this._accept(Xt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new $d("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(Xt.Pipe)){const r=new VU;for(;;){if(this._parseChoiceElement(r)){if(this._accept(Xt.Comma))continue;if(this._accept(Xt.Pipe)&&(o.appendChild(r),this._accept(Xt.CurlyClose)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(Xt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Xt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===Xt.Comma||this._token.type===Xt.Pipe);){let n;if((n=this._accept(Xt.Backslash,!0))?n=this._accept(Xt.Comma,!0)||this._accept(Xt.Pipe,!0)||this._accept(Xt.Backslash,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new $d(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(Xt.Dollar)&&this._accept(Xt.CurlyOpen)&&(t=this._accept(Xt.VariableName,!0))))return this._backTo(i);const o=new vW(t);if(this._accept(Xt.Colon))for(;;){if(this._accept(Xt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new $d("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(Xt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Xt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new gMe;let i="",n="";for(;!this._accept(Xt.Forwardslash);){let o;if(o=this._accept(Xt.Backslash,!0)){o=this._accept(Xt.Forwardslash,!0)||o,i+=o;continue}if(this._token.type!==Xt.EOF){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(Xt.Forwardslash);){let o;if(o=this._accept(Xt.Backslash,!0)){o=this._accept(Xt.Backslash,!0)||this._accept(Xt.Forwardslash,!0)||o,t.appendChild(new $d(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(Xt.CurlyClose);){if(this._token.type!==Xt.EOF){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(Xt.Dollar))return!1;let i=!1;this._accept(Xt.CurlyOpen)&&(i=!0);const n=this._accept(Xt.Int,!0);if(n)if(i){if(this._accept(Xt.CurlyClose))return e.appendChild(new zv(Number(n))),!0;if(!this._accept(Xt.Colon))return this._backTo(t),!1}else return e.appendChild(new zv(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(Xt.Forwardslash)){const o=this._accept(Xt.VariableName,!0);return!o||!this._accept(Xt.CurlyClose)?(this._backTo(t),!1):(e.appendChild(new zv(Number(n),o)),!0)}else if(this._accept(Xt.Plus)){const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new zv(Number(n),void 0,o,void 0)),!0}else if(this._accept(Xt.Dash)){const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new zv(Number(n),void 0,void 0,o)),!0}else if(this._accept(Xt.QuestionMark)){const o=this._until(Xt.Colon);if(o){const r=this._until(Xt.CurlyClose);if(r)return e.appendChild(new zv(Number(n),void 0,o,r)),!0}}else{const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new zv(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==Xt.EOF?(e.appendChild(new $d(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}async function UXe(s,e,t,i,n=He.None,o){const r=e instanceof oe?gMt(e,t):e,a=s.all(t),c=new P7;for(const b of a)b.groupId&&c.add(b.groupId,b);function l(b){if(!b.yieldsToGroupIds)return[];const w=[];for(const y of b.yieldsToGroupIds||[]){const C=c.get(y);for(const A of C)w.push(A)}return w}const d=new Map,h=new Set;function u(b,w){if(w=[...w,b],h.has(b))return w;h.add(b);try{const y=l(b);for(const C of y){const A=u(C,w);if(A)return A}}finally{h.delete(b)}}function f(b){const w=d.get(b);if(w)return w;const y=u(b,[]);y&&No(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(A=>A.toString?A.toString():""+A).join(" -> ")}`));const C=new dc;return d.set(b,C.p),(async()=>{if(!y){const A=l(b);for(const L of A){const k=await f(L);if(k&&k.items.length>0)return}}try{return e instanceof oe?await b.provideInlineCompletions(t,e,i,n):await b.provideInlineEdits?.(t,e,i,n)}catch(A){No(A);return}})().then(A=>C.complete(A),A=>C.error(A)),C.p}const p=await Promise.all(a.map(async b=>({provider:b,completions:await f(b)}))),m=new Map,v=[];for(const b of p){const w=b.completions;if(!w)continue;const y=new hMt(w,b.provider);v.push(y);for(const C of w.items){const A=uMt.from(C,y,r,t,o);m.set(A.hash(),A)}}return new dMt(Array.from(m.values()),new Set(m.keys()),v)}class dMt{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 hMt=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)}},uMt=class nbe{static from(e,t,i,n,o){let r,a,c=e.range?F.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=HHe(r,c.getStartPosition(),n,o);const l=r.length-e.insertText.length;l!==0&&(c=new F(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=HHe(e.insertText.snippet,c.getStartPosition(),n,o);const h=e.insertText.snippet.length-l;h!==0&&(c=new F(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new X_().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof $d?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:c})}else Z7();return new nbe(r,e.command,c,r,a,e.additionalTextEdits||eMt(),e,t)}constructor(e,t,i,n,o,r,a,c){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=c,e=e.replace(/\r\n|\r/g,` +`)))]).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 N2([...this.parts.map(o=>new ru(F.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 ZJ{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=iv(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 Kve{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new ZJ(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=iv(this.text)}renderForScreenReader(e){return this.newLines.join(` +`)}render(e,t=!1){const i=this.columnRange.toRange(this.lineNumber);return t?new N2([new ru(F.fromPositions(i.getStartPosition()),"("),new ru(F.fromPositions(i.getEndPosition()),`)[${this.newLines.join(` +`)}]`)]).applyToString(e):new N2([new ru(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 SHe(s,e){return is(s,e,kXe)}function kXe(s,e){return s===e?!0:!s||!e?!1:s instanceof U3&&e instanceof U3||s instanceof Kve&&e instanceof Kve?s.equals(e):!1}const VRt=[];function zRt(){return VRt}class IXe{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ni(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new F(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function TXe(s,e){const t=new Z,i=s.createDecorationsCollection();return t.add(f6({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function $Rt(s,e){return new oe(s.lineNumber+e.lineNumber-1,e.lineNumber===1?s.column+e.column-1:e.column)}function AHe(s,e){return new oe(s.lineNumber-e.lineNumber+1,s.lineNumber-e.lineNumber===0?s.column-e.column+1:s.column)}const EHe="ghost-text";let qve=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=jt(this,!1),this.currentTextModel=Kn(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Ze(this,n=>{if(this.isDisposed.read(n))return;const o=this.currentTextModel.read(n);if(o!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;const a=r instanceof Kve?r.columnRange:void 0,c=[],l=[];function d(m,v){if(l.length>0){const b=l[l.length-1];v&&b.decorations.push(new Zh(b.content.length+1,b.content.length+1+m[0].length,v,Ja.Regular)),b.content+=m[0],m=m.slice(1)}for(const b of m)l.push({content:b,decorations:v?[new Zh(1,b.length+1,v,Ja.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,EHe),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 IXe(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:c,additionalLines:l,hiddenRange:p,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:o}}),this.decorations=Ze(this,n=>{const o=this.uiState.read(n);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:F.fromPositions(new oe(o.lineNumber,a.column)),options:{description:EHe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:__.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new LXe(this.editor,this.languageService.languageIdCodec,Ze(n=>{const o=this.uiState.read(n);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(TXe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};qve=D([_(2,xi)],qve);class LXe extends V{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=ed("editorOptionChanged",M.filter(this.editor.onDidChangeConfiguration,n=>n.hasChanged(x.disableMonospaceOptimizations)||n.hasChanged(x.stopRenderingLineAfter)||n.hasChanged(x.renderWhitespace)||n.hasChanged(x.renderControlCharacters)||n.hasChanged(x.fontLigatures)||n.hasChanged(x.fontInfo)||n.hasChanged(x.lineHeight))),this._register(ai(n=>{const o=this.lines.read(n);this.editorOptionsChanged.read(n),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 n=this.editor.getModel();if(!n)return;const{tabSize:o}=n.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");GRt(c,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=r.addZone({afterLineNumber:e,heightInLines:a,domNode:c,afterColumnAffinity:Io.Right})}})}}function GRt(s,e,t,i,n){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 pU(1e4);u.appendString('
    ');for(let m=0,v=t.length;m');const y=F7(w),C=y2(w),A=hd.createEmpty(w,n);Z7(new pI(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,w,!1,y,C,0,A,b.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,c,l!==xk.OFF,null),u),u.appendString("
    ")}u.appendString(""),xl(s,d);const f=u.build(),p=xHe?xHe.createHTML(f):f;s.innerHTML=p}const xHe=KA("editorGhostText",{createHTML:s=>s}),bw=class bw extends V{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=bw.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=bw.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=bw.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=bw.suppressSuggestions.bindTo(this.contextKeyService),this._register(ai(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(ai(i=>{const n=this.model.read(i);let o=!1,r=!0;const a=n?.primaryGhostText.read(i);if(n?.selectedSuggestItem&&a&&a.parts.length>0){const{column:c,lines:l}=a.parts[0],d=l[0],h=n.textModel.getLineIndentColumn(a.lineNumber);if(c<=h){let f=xh(d);f===-1&&(f=d.length-1),o=f>0;const p=n.textModel.getOptions().tabSize;r=qa.visibleColumnFromColumn(d,f+1,p)this.editor.getOption(x.inlineSuggest).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ze(this,n=>{const o=this.model.read(n)?.primaryGhostText.read(n);if(!this.alwaysShowToolbar.read(n)||!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(au((n,o)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=vI((l,d)=>{const h=d.add(this.instantiationService.createInstance(gW,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands));return e.addContentWidget(h),d.add(Ee(()=>e.removeContentWidget(h))),d.add(ai(u=>{this.position.read(u)&&r.lastTriggerKind.read(u)!==Jp.Explicit&&r.triggerExplicitly()})),h}),c=p6(this,(l,d)=>!!this.position.read(l)||!!d);o.add(ai(l=>{c.read(l)&&a.read(l)}))}))}};Qve=D([_(2,we)],Qve);const qRt=oi("inline-suggestion-hints-next",ve.chevronRight,g(9866,"Icon for show next parameter hint.")),QRt=oi("inline-suggestion-hints-previous",ve.chevronLeft,g(9867,"Icon for show previous parameter hint."));var RD;let gW=(RD=class extends V{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new rn(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=g(9868,"{0} ({1})",t,o.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=l,this._contextKeyService=d,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${Zq.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Bt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Bt("div@toolBar")]),this.previousAction=this.createCommandAction(xXe,g(9869,"Previous"),We.asClassName(QRt)),this.availableSuggestionCountAction=new rn("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(DXe,g(9870,"Next"),We.asClassName(qRt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new cn(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new cn(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(c.createInstance(jve,this.nodes.toolBar,_e.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,f)=>{if(u instanceof Sc)return c.createInstance(YRt,u,void 0);if(u===this.availableSuggestionCountAction){const p=new jRt(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=>{Zq._dropDownVisible=u})),this._register(ai(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(ai(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(ai(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 b of v)b instanceof Sc&&p.push(b);p.length>0&&p.unshift(new Ar),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[es.ABOVE,es.BELOW],positionAffinity:Io.LeftOfInjectedText}}},Zq=RD,RD._dropDownVisible=!1,RD.id=0,RD);gW=Zq=D([_(6,vi),_(7,we),_(8,Ut),_(9,Le),_(10,Oa)],gW);class jRt extends Qy{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 YRt=class extends kb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Bt("div.keybinding").root;this._register(new Vk(t,po,{disableTitle:!0,...aYe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},jve=class extends oW{constructor(e,t,i,n,o,r,a,c,l){super(e,{resetMenu:t,...i},n,o,r,a,c,l),this.menuId=t,this.options2=i,this.menuService=n,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=[];dC(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){is(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){is(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};jve=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,vi),_(8,Yi)],jve);function JRt(s,e){const t=new Gqe,i=new qqe(t,l=>e.getLanguageConfiguration(l)),n=new Kqe(new XRt([s]),i),o=ame(n,[],void 0,!0);let r="";const a=s.getLineContent();function c(l,d){if(l.kind===Go.Pair)if(c(l.openingBracket,d),d=Tr(d,l.openingBracket.length),l.child&&(c(l.child,d),d=Tr(d,l.child.length)),l.closingBracket)c(l.closingBracket,d),d=Tr(d,l.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(l.openingBracket.languageId).findClosingTokenText(l.openingBracket.bracketIds);r+=u}else if(l.kind!==Go.UnexpectedClosingBracket){if(l.kind===Go.Text||l.kind===Go.Bracket)r+=a.substring(d,Tr(d,l.length));else if(l.kind===Go.List)for(const h of l.children)c(h,d),d=Tr(d,h.length)}}return c(o,eu),r}class XRt{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 Xt;(function(s){s[s.Dollar=0]="Dollar",s[s.Colon=1]="Colon",s[s.Comma=2]="Comma",s[s.CurlyOpen=3]="CurlyOpen",s[s.CurlyClose=4]="CurlyClose",s[s.Backslash=5]="Backslash",s[s.Forwardslash=6]="Forwardslash",s[s.Pipe=7]="Pipe",s[s.Int=8]="Int",s[s.VariableName=9]="VariableName",s[s.Format=10]="Format",s[s.Plus=11]="Plus",s[s.Dash=12]="Dash",s[s.QuestionMark=13]="QuestionMark",s[s.EOF=14]="EOF"})(Xt||(Xt={}));const qm=class qm{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=B.Digit0&&e<=B.Digit9}static isVariableCharacter(e){return e===B.Underline||e>=B.a&&e<=B.z||e>=B.A&&e<=B.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:Xt.EOF,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=qm._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(qm.isDigitCharacter(i)){n=Xt.Int;do t+=1,i=this.value.charCodeAt(e+t);while(qm.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(qm.isVariableCharacter(i)){n=Xt.VariableName;do i=this.value.charCodeAt(e+ ++t);while(qm.isVariableCharacter(i)||qm.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=Xt.Format;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof qm._table[i]>"u"&&!qm.isDigitCharacter(i)&&!qm.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};qm._table={[B.DollarSign]:Xt.Dollar,[B.Colon]:Xt.Colon,[B.Comma]:Xt.Comma,[B.OpenCurlyBrace]:Xt.CurlyOpen,[B.CloseCurlyBrace]:Xt.CurlyClose,[B.Backslash]:Xt.Backslash,[B.Slash]:Xt.Forwardslash,[B.Pipe]:Xt.Pipe,[B.Plus]:Xt.Plus,[B.Dash]:Xt.Dash,[B.QuestionMark]:Xt.QuestionMark};let Yve=qm;class FU{constructor(){this._children=[]}appendChild(e){return e instanceof Vd&&this._children[this._children.length-1]instanceof Vd?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,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 H6)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Vd extends FU{static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){super(),this.value=e}toString(){return this.value}toTextmateString(){return Vd.escape(this.value)}len(){return this.value.length}clone(){return new Vd(this.value)}}class RXe extends FU{}class Hg extends RXe{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 OU?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 Hg(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class OU extends FU{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Vd&&(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 OU;return this.options.forEach(e.appendChild,e),e}}class tMe extends FU{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=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 Hv&&!!o.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Hv){let n=e[i.index]||"";n=i.resolve(n),t+=n}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 tMe;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 Hv extends FU{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}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,n)=>n===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 Hv(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class fW extends RXe{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 Vd(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 fW(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function DHe(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class H6 extends FU{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Hg&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return DHe([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Hg&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof fW&&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 H6;return this._children=this.children.map(t=>t.clone()),e}walk(e){DHe(this.children,e)}}class j_{constructor(){this._scanner=new Yve,this._token={type:Xt.EOF,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static asInsertText(e){return new j_().parse(e).toString()}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new H6;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk(c=>(c instanceof Hg&&(c.isFinalTabstop?n.set(0,void 0):!n.has(c.index)&&c.children.length>0?n.set(c.index,c.children):o.push(c)),!0));const r=(c,l)=>{const d=n.get(c.index);if(!d)return;const h=new Hg(c.index);h.transform=c.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof Hg&&n.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 Hg(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===Xt.EOF)return!1;if(this._token.type===Xt.Backslash){const n=this._scanner.next();if(n.type!==Xt.Dollar&&n.type!==Xt.CurlyClose&&n.type!==Xt.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(Xt.Backslash,!0))?(t=this._accept(Xt.Dollar,!0)||this._accept(Xt.CurlyClose,!0)||this._accept(Xt.Backslash,!0)||t,e.appendChild(new Vd(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(Xt.Dollar)&&(t=this._accept(Xt.VariableName,!0)||this._accept(Xt.Int,!0))?(e.appendChild(/^\d+$/.test(t)?new Hg(Number(t)):new fW(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(Xt.Dollar)&&this._accept(Xt.CurlyOpen)&&(t=this._accept(Xt.Int,!0))))return this._backTo(i);const o=new Hg(Number(t));if(this._accept(Xt.Colon))for(;;){if(this._accept(Xt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Vd("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(Xt.Pipe)){const r=new OU;for(;;){if(this._parseChoiceElement(r)){if(this._accept(Xt.Comma))continue;if(this._accept(Xt.Pipe)&&(o.appendChild(r),this._accept(Xt.CurlyClose)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(Xt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Xt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===Xt.Comma||this._token.type===Xt.Pipe);){let n;if((n=this._accept(Xt.Backslash,!0))?n=this._accept(Xt.Comma,!0)||this._accept(Xt.Pipe,!0)||this._accept(Xt.Backslash,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Vd(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(Xt.Dollar)&&this._accept(Xt.CurlyOpen)&&(t=this._accept(Xt.VariableName,!0))))return this._backTo(i);const o=new fW(t);if(this._accept(Xt.Colon))for(;;){if(this._accept(Xt.CurlyClose))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Vd("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(Xt.Forwardslash)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(Xt.CurlyClose)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new tMe;let i="",n="";for(;!this._accept(Xt.Forwardslash);){let o;if(o=this._accept(Xt.Backslash,!0)){o=this._accept(Xt.Forwardslash,!0)||o,i+=o;continue}if(this._token.type!==Xt.EOF){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(Xt.Forwardslash);){let o;if(o=this._accept(Xt.Backslash,!0)){o=this._accept(Xt.Backslash,!0)||this._accept(Xt.Forwardslash,!0)||o,t.appendChild(new Vd(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(Xt.CurlyClose);){if(this._token.type!==Xt.EOF){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(Xt.Dollar))return!1;let i=!1;this._accept(Xt.CurlyOpen)&&(i=!0);const n=this._accept(Xt.Int,!0);if(n)if(i){if(this._accept(Xt.CurlyClose))return e.appendChild(new Hv(Number(n))),!0;if(!this._accept(Xt.Colon))return this._backTo(t),!1}else return e.appendChild(new Hv(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(Xt.Forwardslash)){const o=this._accept(Xt.VariableName,!0);return!o||!this._accept(Xt.CurlyClose)?(this._backTo(t),!1):(e.appendChild(new Hv(Number(n),o)),!0)}else if(this._accept(Xt.Plus)){const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new Hv(Number(n),void 0,o,void 0)),!0}else if(this._accept(Xt.Dash)){const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new Hv(Number(n),void 0,void 0,o)),!0}else if(this._accept(Xt.QuestionMark)){const o=this._until(Xt.Colon);if(o){const r=this._until(Xt.CurlyClose);if(r)return e.appendChild(new Hv(Number(n),void 0,o,r)),!0}}else{const o=this._until(Xt.CurlyClose);if(o)return e.appendChild(new Hv(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==Xt.EOF?(e.appendChild(new Vd(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}async function MXe(s,e,t,i,n=He.None,o){const r=e instanceof oe?iMt(e,t):e,a=s.all(t),c=new L7;for(const b of a)b.groupId&&c.add(b.groupId,b);function l(b){if(!b.yieldsToGroupIds)return[];const w=[];for(const y of b.yieldsToGroupIds||[]){const C=c.get(y);for(const A of C)w.push(A)}return w}const d=new Map,h=new Set;function u(b,w){if(w=[...w,b],h.has(b))return w;h.add(b);try{const y=l(b);for(const C of y){const A=u(C,w);if(A)return A}}finally{h.delete(b)}}function f(b){const w=d.get(b);if(w)return w;const y=u(b,[]);y&&No(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(A=>A.toString?A.toString():""+A).join(" -> ")}`));const C=new dc;return d.set(b,C.p),(async()=>{if(!y){const A=l(b);for(const L of A){const k=await f(L);if(k&&k.items.length>0)return}}try{return e instanceof oe?await b.provideInlineCompletions(t,e,i,n):await b.provideInlineEdits?.(t,e,i,n)}catch(A){No(A);return}})().then(A=>C.complete(A),A=>C.error(A)),C.p}const p=await Promise.all(a.map(async b=>({provider:b,completions:await f(b)}))),m=new Map,v=[];for(const b of p){const w=b.completions;if(!w)continue;const y=new eMt(w,b.provider);v.push(y);for(const C of w.items){const A=tMt.from(C,y,r,t,o);m.set(A.hash(),A)}}return new ZRt(Array.from(m.values()),new Set(m.keys()),v)}class ZRt{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 eMt=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)}},tMt=class Jve{static from(e,t,i,n,o){let r,a,c=e.range?F.lift(e.range):i;if(typeof e.insertText=="string"){if(r=e.insertText,o&&e.completeBracketPairs){r=kHe(r,c.getStartPosition(),n,o);const l=r.length-e.insertText.length;l!==0&&(c=new F(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=kHe(e.insertText.snippet,c.getStartPosition(),n,o);const h=e.insertText.snippet.length-l;h!==0&&(c=new F(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+h))}const d=new j_().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Vd?(r=d.children[0].value,a=void 0):(r=d.toString(),a={snippet:e.insertText.snippet,range:c})}else j7();return new Jve(r,e.command,c,r,a,e.additionalTextEdits||zRt(),e,t)}constructor(e,t,i,n,o,r,a,c){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=c,e=e.replace(/\r\n|\r/g,` `),n=e.replace(/\r\n|\r/g,` -`)}withRange(e){return new nbe(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 au(this.range,this.insertText)}};function gMt(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new F(s.lineNumber,t.startColumn,s.lineNumber,i):F.fromPositions(s,s.with(void 0,i))}function HHe(s,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,a=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),s)?.sliceAndInflate(e.column-1,o.length,0);return a?cMt(a,i):s}function IT(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,go.LF),o=$y(n,s.text),r=eg.ofText(n.substring(0,o)).addToPosition(s.range.getStartPosition()),a=s.text.substring(o),c=F.fromPositions(r,s.range.getEndPosition());return new au(c,a)}function VXe(s,e){return s.text.startsWith(e.text)&&fMt(s.range,e.range)}function UHe(s,e,t,i,n=0){let o=IT(s,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=ho(r).length;if(o.range.startColumn-1<=a){const p=ho(o.text).length,m=r.substring(o.range.startColumn-1,a),[v,b]=[o.range.getStartPosition(),o.range.getEndPosition()],w=v.column+m.length<=b.column?v.delta(0,m.length):b,y=F.fromPositions(w,b),C=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(p);o=new au(y,C)}const l=e.getValueInRange(o.range),d=pMt(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-n;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,b=Math.max(p.modifiedStart,Math.min(v,f)),w=o.text.substring(p.modifiedStart,b),y=o.text.substring(b,Math.max(p.modifiedStart,v));w.length>0&&u.push(new tX(m,w,!1)),y.length>0&&u.push(new tX(m,y,!0))}return new $3(h,u)}function fMt(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let pK;function pMt(s,e){if(pK?.originalValue===s&&pK?.newValue===e)return pK?.changes;{let t=zHe(s,e,!0);if(t){const i=VHe(t);if(i>0){const n=zHe(s,e,!1);n&&VHe(n)5e3||e.length>5e3)return;function i(l){let d=0;for(let h=0,u=l.length;hd&&(d=f)}return d}const n=Math.max(i(s),i(e));function o(l){if(l<0)throw new Error("unexpected");return n+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 sbe=class extends V{constructor(e,t,i,n,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=o,this._updateOperation=this._register(new wn),this.inlineCompletions=f3("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=f3("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const n=new _Mt(e,t,this.textModel.getVersionId()),o=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(n))return this._updateOperation.value.promise;if(o.get()?.request.satisfies(n))return Promise.resolve(!0);const r=!!this._updateOperation.value;this._updateOperation.clear();const a=new ci,c=(async()=>{if((r||t.triggerKind===em.Automatic)&&await mMt(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const h=new Date,u=await UXe(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const f=new Date;this._debounceValue.update(this.textModel,f.getTime()-h.getTime());const p=new bMt(u,n,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(),ts(m=>{o.set(p,m)}),!0})(),l=new vMt(n,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()}};sbe=D([_(3,it),_(4,Vs)],sbe);function mMt(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class _Mt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&Fq(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,DAt())&&(e.context.triggerKind===em.Automatic||this.context.triggerKind===em.Explicit)&&this.versionId===e.versionId}}class vMt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class bMt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,n){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=n,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 $He(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 n=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new $He(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class $He{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=Jh({owner:this,equalsFn:F.equalsRange},o=>(this._modelVersion.read(o),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??$he)}toSingleTextEdit(e){return new au(this._updatedRange.read(e)??$he,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=IT(this._toFilterTextReplacement(i),e),o=this._updatedRange.read(i);if(!o||!this.inlineCompletion.range.getStartPosition().equals(o.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const r=e.getValueInRange(n.range,go.LF),a=n.text,c=Math.max(0,t.column-n.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(n.range.startLineNumber);return n.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(d=d.trimStart())),l.startsWith(h)&&!!LQe(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&eg.ofRange(i).isGreaterThanOrEqualTo(eg.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new au(this._updatedRange.read(e)??$he,this.inlineCompletion.filterText)}}const $he=new F(1,1,1,1),wMt=g(11236,"input"),yMt=g(11237,"Preserve Case");class CMt extends ZA{constructor(e){super({icon:ve.preserveCase,title:yMt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const sFe=class sFe extends pd{constructor(e,t,i,n){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=n.placeholder||"",this.validation=n.validation,this.label=n.label||wMt;const o=n.appendPreserveCaseLabel||"",r=n.history||[],a=!!n.flexibleHeight,c=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new qLe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new CMt({appendTitle:o,isChecked:!1,...n.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(S.LeftArrow)||u.equals(S.RightArrow)||u.equals(S.Escape)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let p=-1;u.equals(S.RightArrow)?p=(f+1)%d.length:u.equals(S.LeftArrow)&&(f===0?p=d.length-1:p=f-1),u.equals(S.Escape)?(d[f].blur(),this.inputBox.focus()):p>=0&&d[p].focus(),en.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()}};sFe.OPTION_CHANGE="optionChange";let obe=sFe;const fMe=new Q("suggestWidgetVisible",!1,g(9874,"Whether suggestion are visible")),pMe="historyNavigationWidgetFocus",zXe="historyNavigationForwardsEnabled",$Xe="historyNavigationBackwardsEnabled";let F5;const mK=[];function oce(s,e){if(mK.includes(e))throw new Error("Cannot register the same widget multiple times");mK.push(e);const t=new Z,i=new Q(pMe,!1).bindTo(s),n=new Q(zXe,!0).bindTo(s),o=new Q($Xe,!0).bindTo(s),r=()=>{i.set(!0),F5=e},a=()=>{i.set(!1),F5===e&&(F5=void 0)};return av(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{mK.splice(mK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let iX=class extends qLe{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.element));this._register(oce(o,this))}};iX=D([_(3,Le)],iX);let rbe=class extends b3{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(oce(o,this.inputBox))}};rbe=D([_(3,Le)],rbe);let abe=class extends obe{constructor(e,t,i,n,o=!1){super(e,t,o,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(oce(r,this.inputBox))}};abe=D([_(3,Le)],abe);So.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:Ae.WorkbenchContrib,when:he.and(he.has(pMe),he.equals($Xe,!0),he.not("isComposing"),fMe.isEqualTo(!1)),primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],handler:s=>{F5?.showPreviousValue()}});So.registerCommandAndKeybindingRule({id:"history.showNext",weight:Ae.WorkbenchContrib,when:he.and(he.has(pMe),he.equals(zXe,!0),he.not("isComposing"),fMe.isEqualTo(!1)),primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],handler:s=>{F5?.showNextValue()}});const Ui={Visible:fMe,HasFocusedSuggestion:new Q("suggestWidgetHasFocusedSuggestion",!1,g(5209,"Whether any suggestion is focused")),DetailsVisible:new Q("suggestWidgetDetailsVisible",!1,g(5210,"Whether suggestion details are visible")),MultipleSuggestions:new Q("suggestWidgetMultipleSuggestions",!1,g(5211,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Q("suggestionMakesTextEdit",!0,g(5212,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Q("acceptSuggestionOnEnter",!0,g(5213,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Q("suggestionHasInsertAndReplaceRange",!1,g(5214,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Q("suggestionInsertMode",void 0,{type:"string",description:g(5215,"Whether the default behaviour is to insert or replace")}),CanResolve:new Q("suggestionCanResolve",!1,g(5216,"Whether the current suggestion supports to resolve further details"))},hD=new _e("suggestWidgetStatusBar");let SMt=class{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=N_.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,F.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||F.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||F.spansMultipleLines(t.range.insert)||F.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 n.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 js(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{Fr(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var lA;(function(s){s[s.Top=0]="Top",s[s.Inline=1]="Inline",s[s.Bottom=2]="Bottom"})(lA||(lA={}));const kse=class kse{constructor(e=lA.Bottom,t=new Set,i=new Set,n=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=o}};kse.default=new kse;let G3=kse,ix;function AMt(){return ix}function EMt(s){const e=ix;return ix=s,e}class xMt{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function mMe(s,e,t,i=G3.default,n={triggerKind:Ku.Invoke},o=He.None){const r=new js;t=t.clone();const a=e.getWordAtPosition(t),c=a?new F(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):F.fromPositions(t),l={replace:c,insert:c.setEndPosition(t.lineNumber,t.column)},d=[],h=new Z,u=[];let f=!1;const p=(v,b,w)=>{let y=!1;if(!b)return y;for(const C of b.suggestions)if(!i.kindFilter.has(C.kind)){if(!i.showDeprecated&&C?.tags?.includes(I2.Deprecated))continue;C.range||(C.range=l),C.sortText||(C.sortText=typeof C.label=="string"?C.label:C.label.label),!f&&C.insertTextRules&&C.insertTextRules&Yg.InsertAsSnippet&&(f=X_.guessNeedsClipboard(C.insertText)),d.push(new SMt(t,C,b,v)),y=!0}return wN(b)&&h.add(b),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:w.elapsed()}),y},m=(async()=>{if(!ix||i.kindFilter.has(Me.Snippet))return;const v=i.providerItemsToReuse.get(ix);if(v){v.forEach(y=>d.push(y));return}if(i.providerFilter.size>0&&!i.providerFilter.has(ix))return;const b=new js,w=await ix.provideCompletionItems(e,t,n,o);p(ix,w,b)})();for(const v of s.orderedGroups(e)){let b=!1;if(await Promise.all(v.map(async w=>{if(i.providerItemsToReuse.has(w)){const y=i.providerItemsToReuse.get(w);y.forEach(C=>d.push(C)),b=b||y.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(w)))try{const y=new js,C=await w.provideCompletionItems(e,t,n,o);b=p(w,C,y)||b}catch(y){No(y)}})),b||o.isCancellationRequested)break}return await m,o.isCancellationRequested?(h.dispose(),Promise.reject(new Ma)):new xMt(d.sort(IMt(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function _Me(s,e){if(s.sortTextLow&&e.sortTextLow){if(s.sortTextLowe.sortTextLow)return 1}return s.textLabele.textLabel?1:s.completion.kind-e.completion.kind}function DMt(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===Me.Snippet)return-1;if(e.completion.kind===Me.Snippet)return 1}return _Me(s,e)}function kMt(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===Me.Snippet)return 1;if(e.completion.kind===Me.Snippet)return-1}return _Me(s,e)}const rce=new Map;rce.set(lA.Top,DMt);rce.set(lA.Bottom,kMt);rce.set(lA.Inline,_Me);function IMt(s){return rce.get(s)}_t.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,o]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string"||!n),Tt(typeof o=="number"||!o);const{completionProvider:r}=s.get(it),a=await s.get(fn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await mMe(r,a.object.textEditorModel,d,void 0,{triggerCharacter:n??void 0,triggerKind:n?Ku.TriggerCharacter:Ku.Invoke});for(const u of h.items)l.length<(o??0)&&l.push(u.resolve(He.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 GXe(s,e){s.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class mF{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 nr.Comment:return e.comments;case nr.String:return e.strings;default:return e.other}}}var TMt=".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}";ut(TMt,{});function LMt(s,e){const{os:t,tildify:i,relative:n}=e;if(n){const a=RMt(s,n,t);if(typeof a=="string")return a}let o=s.fsPath;if(t===Ds.Windows&&!Qn?o=o.replace(/\//g,"\\"):t!==Ds.Windows&&Qn&&(o=o.replace(/\\/g,"/")),t!==Ds.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;s.scheme!==i.userHome.scheme&&s.path[0]===Vi.sep&&s.path[1]!==Vi.sep?c=i.userHome.with({path:s.path}).fsPath:c=o,o=KXe(c,a,t)}return(t===Ds.Windows?cc:Vi).normalize(Kw(o,t===Ds.Windows))}function RMt(s,e,t){const i=t===Ds.Windows?cc:Vi,n=t===Ds.Linux?xn:Rre,o=e.getWorkspace(),r=lm(o.folders);if(!r)return;s.scheme!==r.uri.scheme&&s.path[0]===Vi.sep&&s.path[1]!==Vi.sep&&(s=r.uri.with({path:s.path}));const a=e.getWorkspaceFolder(s);if(!a)return;let c;if(n.isEqual(a.uri,s)?c="":c=n.relativePath(a.uri,s)??"",c&&(c=i.normalize(c)),o.folders.length>1&&!e.noPrefix){const l=a.name?a.name:n.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function Kw(s,e=Qn){return CGe(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}let Ghe=Object.create(null);function KXe(s,e,t=po){if(t===Ds.Windows||!s||!e)return s;let i=Ghe.original===e?Ghe.normalized:void 0;i||(i=e,Qn&&(i=S8(i)),i=`${zy(i,Vi.sep)}${Vi.sep}`,Ghe={original:e,normalized:i});let n=s;return Qn&&(n=S8(n)),(t===Ds.Linux?n.startsWith(i):W7(n,i))?`~/${n.substr(i.length)}`:s}function MMt(s,e){return s.replace(/^~($|\/|\\)/,`${e}$1`)}const GHe="…",y4="\\\\",C4="~";function NMt(s,e=ou){const t=new Array(s.length);let i=!1;for(let n=0;n=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&&s[u].indexOf(e)>-1?e+h:h,m=s[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+GHe+e),u=u+h,d+l{if(o.type===gw.SEPARATOR){const a=t[r-1],c=t[r+1];return[a,c].every(l=>l&&(l.type===gw.VARIABLE||l.type===gw.TEXT)&&l.value.length>0)}return!0}).map(o=>o.value).join("")}function vMe(s,e){return Qt||e?s.replace(/\(&&\w\)|&&/g,""):Qn?s.replace(/&&|&/g,t=>t==="&"?"&&":"&"):s.replace(/&&/g,"_")}const FMt=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 KHe{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 qHe{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,n=o.multiline)}if(i&&n&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=ho(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(l=>l===e?!1:(l instanceof $d&&(a=ho(ov(l.value).pop())),!0));const c=$y(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 QHe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Ko(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Ko(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return Cb(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Lr(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 jHe{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}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(n=>!Gu(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let nX=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),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};nX=D([_(2,Vs)],nX);const Sw=class Sw{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 Sw.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Sw.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Sw.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Sw.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(),n=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 n+r+":"+c}}};Sw.dayNames=[g(9881,"Sunday"),g(9882,"Monday"),g(9883,"Tuesday"),g(9884,"Wednesday"),g(9885,"Thursday"),g(9886,"Friday"),g(9887,"Saturday")],Sw.dayNamesShort=[g(9888,"Sun"),g(9889,"Mon"),g(9890,"Tue"),g(9891,"Wed"),g(9892,"Thu"),g(9893,"Fri"),g(9894,"Sat")],Sw.monthNames=[g(9895,"January"),g(9896,"February"),g(9897,"March"),g(9898,"April"),g(9899,"May"),g(9900,"June"),g(9901,"July"),g(9902,"August"),g(9903,"September"),g(9904,"October"),g(9905,"November"),g(9906,"December")],Sw.monthNamesShort=[g(9907,"Jan"),g(9908,"Feb"),g(9909,"Mar"),g(9910,"Apr"),g(9911,"May"),g(9912,"Jun"),g(9913,"Jul"),g(9914,"Aug"),g(9915,"Sep"),g(9916,"Oct"),g(9917,"Nov"),g(9918,"Dec")];let sX=Sw;class YHe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=GO(this._workspaceService.getWorkspace());if(!nAt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(P_(e))return Ko(e.uri.path);let t=Ko(e.configPath.path);return t.endsWith(xb)&&(t=t.substr(0,t.length-xb.length-1)),t}_resoveWorkspacePath(e){if(P_(e))return Kw(e.uri.fsPath);const t=Ko(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Kw(i):"/"}}class JHe{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 ar()}}var yv;const Jm=class Jm{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=i8(t.placeholders,zg.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 n=this._snippet.offset(i),o=this._snippet.fullLen(i),r=F.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?Jm._decor.inactiveFinal:Jm._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 n=[];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",n)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{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 dt(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(c,a.isFinalTabstop?Jm._decor.activeFinal:Jm._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);n.changeDecorationOptions(h,d.isFinalTabstop?Jm._decor.activeFinal:Jm._decor.active),o.add(d)}}for(const[a,c]of this._placeholderDecorations)o.has(a)||n.changeDecorationOptions(c,a.isFinalTabstop?Jm._decor.inactiveFinal:Jm._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof zg){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 n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const o=this._placeholderDecorations.get(n),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(n.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 VU,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n 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=n.index+(r+1)/this._nestingLevel:c.index=n.index+c.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const c of o._snippet.placeholders){const l=o._snippet.offset(c),d=o._snippet.fullLen(c),h=F.fromPositions(t.getPositionAt(o._offset+l),t.getPositionAt(o._offset+l+d)),u=i.addDecoration(h,Jm._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=i8(this._snippet.placeholders,zg.compareByIndex)})}getEnclosingRange(){let e;const t=this._editor.getModel();for(const i of this._placeholderDecorations.values()){const n=t.getDecorationRange(i)??void 0;e?e=e.plusRange(n):e=n}return e}};Jm._decor={active:Gt.register({description:"snippet-placeholder-1",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:Gt.register({description:"snippet-placeholder-2",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:Gt.register({description:"snippet-placeholder-3",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:Gt.register({description:"snippet-placeholder-4",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let oX=Jm;const XHe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let rX=yv=class{static adjustWhitespace(e,t,i,n,o){const r=e.getLineContent(t.lineNumber),a=ho(r,0,t.column-1);let c;return n.walk(l=>{if(!(l instanceof $d)||l.parent instanceof VU||o&&!o.has(l))return!0;const d=l.value.split(/\r\n|\r|\n/);if(i){const u=n.offset(l);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??n.toString();const f=c.charCodeAt(u-1);(f===B.LineFeed||f===B.CarriageReturn)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fC.get(yi)),p=e.invokeWithinContext(C=>new QHe(C.get(Fs),u)),m=()=>a,v=u.getValueInRange(yv.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(yv.adjustSelection(u,e.getSelection(),0,n)),w=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((C,A)=>({selection:C,idx:A})).sort((C,A)=>F.compareRangesUsingStarts(C.selection,A.selection));for(const{selection:C,idx:A}of y){let L=yv.adjustSelection(u,C,i,0),k=yv.adjustSelection(u,C,0,n);v!==u.getValueInRange(L)&&(L=C),b!==u.getValueInRange(k)&&(k=C);const P=C.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(k.endLineNumber,k.endColumn),R=new X_().parse(t,!0,o),z=P.getStartPosition(),G=yv.adjustWhitespace(u,z,r||A>0&&w!==u.getLineFirstNonWhitespaceColumn(C.positionLineNumber),R);R.resolveVariables(new KHe([p,new jHe(m,A,y.length,e.getOption(x.multiCursorPaste)==="spread"),new qHe(u,C,A,c),new nX(u,C,l),new sX,new YHe(f),new JHe])),d[A]=Zn.replace(P,R.toString()),d[A].identifier={major:A,minor:0},d[A]._isTracked=!0,h[A]=new oX(e,R,G)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new X_,h=new $6,u=new KHe([e.invokeWithinContext(p=>new QHe(p.get(Fs),l)),new jHe(()=>o,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new qHe(l,e.getSelection(),0,r),new nX(l,e.getSelection(),a),new sX,new YHe(e.invokeWithinContext(p=>p.get(yi))),new JHe]);t=t.sort((p,m)=>F.compareRangesUsingStarts(p.range,m.range));let f=0;for(let p=0;p0){const A=t[p-1].range,L=F.fromPositions(A.getEndPosition(),m.getStartPosition()),k=new $d(l.getValueInRange(L));h.appendChild(k),f+=k.value.length}const b=d.parseFragment(v,h);yv.adjustWhitespace(l,m.getStartPosition(),!0,h,new Set(b)),h.resolveVariables(u);const w=h.toString(),y=w.slice(f);f=w.length;const C=Zn.replace(m,y);C.identifier={major:p,minor:0},C._isTracked=!0,c.push(C)}return d.ensureFinalTabstop(h,i,!0),{edits:c,snippets:[new oX(e,h,"")]}}constructor(e,t,i=XHe,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){bt(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"?yv.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):yv.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 n=i.filter(o=>!!o.identifier);for(let o=0;odt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=XHe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=yv.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;cdt.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 n=i.move(e);t.push(...n)}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(...n.get(r))})}e.sort(F.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(F.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}};rX=yv=D([_(3,Vs)],rX);var RP;const _K={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var ey;let fc=(ey=class{static get(e){return e.getContribution(RP.ID)}constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=RP.InSnippetMode.bindTo(n),this._hasNextTabstop=RP.HasNextTabstop.bindTo(n),this._hasPrevTabstop=RP.HasPrevTabstop.bindTo(n)}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"?_K:{..._K,...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"?_K:{..._K,...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?(Tt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new rX(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:n.getLanguageId(),pattern:n.uri.fsPath,scheme:n.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(()=>{GXe(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()}},RP=ey,ey.ID="snippetController2",ey.InSnippetMode=new Q("inSnippetMode",!1,g(1558,"Whether the editor in current in snippet mode")),ey.HasNextTabstop=new Q("hasNextTabstop",!1,g(1559,"Whether there is a next tab stop when in snippet mode")),ey.HasPrevTabstop=new Q("hasPrevTabstop",!1,g(1560,"Whether there is a previous tab stop when in snippet mode")),ey);fc=RP=D([_(1,Ge),_(2,it),_(3,Le),_(4,Vs)],fc);on(fc.ID,fc,ri.Lazy);const ace=hc.bindToContribution(fc.get);qe(new ace({id:"jumpToNextSnippetPlaceholder",precondition:he.and(fc.InSnippetMode,fc.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Tab}}));qe(new ace({id:"jumpToPrevSnippetPlaceholder",precondition:he.and(fc.InSnippetMode,fc.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));qe(new ace({id:"leaveSnippet",precondition:fc.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new ace({id:"acceptSnippet",precondition:fc.InSnippetMode,handler:s=>s.finish()}));let cbe=class extends V{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,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(sbe,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=jt(this,!1),this._forceUpdateExplicitlySignal=gC(this),this._selectedInlineCompletionId=jt(this,void 0),this._primaryPosition=Ze(this,p=>this._positions.read(p)[0]??new oe(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([TC.Redo,TC.Undo,TC.AcceptWord]),this._fetchInlineCompletionsPromise=Dje({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:em.Automatic}),handleChange:(p,m)=>(p.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(p.change))?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=em.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 b=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(p);if(b&&!w){const k=this._source.inlineCompletions.get();ts(P=>{(!k||b.request.versionId>k.request.versionId)&&this._source.inlineCompletions.set(b.clone(),P),this._source.clearSuggestWidgetInlineCompletions(P)})}const y=this._primaryPosition.read(p),C={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:w?.toSelectedSuggestionInfo()},A=this.selectedInlineCompletion.get(),L=m.preserveCurrentCompletion||A?.forwardStable?A:void 0;return this._source.fetch(y,C,L)}),this._filteredInlineCompletionItems=Jh({owner:this,equalsFn:J2()},p=>{const m=this._source.inlineCompletions.read(p);if(!m)return[];const v=this._primaryPosition.read(p);return m.inlineCompletions.filter(w=>w.isVisible(this.textModel,v,p))}),this.selectedInlineCompletionIndex=Ze(this,p=>{const m=this._selectedInlineCompletionId.read(p),v=this._filteredInlineCompletionItems.read(p),b=this._selectedInlineCompletionId===void 0?-1:v.findIndex(w=>w.semanticId===m);return b===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):b}),this.selectedInlineCompletion=Ze(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=Jh({owner:this,equalsFn:J2()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=Ze(this,p=>{if(this.lastTriggerKind.read(p)===em.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=Jh({owner:this,equalsFn:(p,m)=>!p||!m?p===m:PHe(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 b=IT(v.toSingleTextEdit(),m),w=this._computeAugmentation(b,p);if(!this._suggestPreviewEnabled.read(p)&&!w)return;const C=w?.edit??b,A=w?w.edit.text.length-b.text.length:0,L=this._suggestPreviewMode.read(p),k=this._positions.read(p),P=[C,...Khe(this.textModel,k,C)],R=P.map((G,Y)=>UHe(G,m,L,k[Y],A)).filter(Fc),z=R[0]??new $3(C.range.endLineNumber,[]);return{edits:P,primaryGhostText:z,ghostTexts:R,inlineCompletion:w?.completion,suggestItem:v}}else{if(!this._isActive.read(p))return;const b=this.selectedInlineCompletion.read(p);if(!b)return;const w=b.toSingleTextEdit(p),y=this._inlineSuggestMode.read(p),C=this._positions.read(p),A=[w,...Khe(this.textModel,C,w)],L=A.map((k,P)=>UHe(k,m,y,C[P],0)).filter(Fc);return L[0]?{edits:A,primaryGhostText:L[0],ghostTexts:L,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostTexts=Jh({owner:this,equalsFn:PHe},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=Jh({owner:this,equalsFn:FXe},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(FN(this._fetchInlineCompletionsPromise));let f;this._register(ai(p=>{const v=this.state.read(p)?.inlineCompletion;if(v?.semanticId!==f?.semanticId&&(f=v,v)){const b=v.inlineCompletion,w=b.source;w.provider.handleItemDidShow?.(w.inlineCompletions,b.sourceInlineCompletion,b.insertText)}}))}_getReason(e){return e?.isUndoing?TC.Undo:e?.isRedoing?TC.Redo:this.isAcceptingPartially?TC.AcceptWord:TC.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){SM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){SM(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),o=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Fc);return rrt(o,a=>{let c=a.toSingleTextEdit(t);return c=IT(c,i,F.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),VXe(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 Ni;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(i.command&&i.source.addRef(),e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Zn.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),fc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const n=t.edits,o=ZHe(n).map(r=>dt.fromPositions(r));e.executeEdits("inlineSuggestion.accept",[...n.map(r=>Zn.replace(r.range,r.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,No),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(n),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 n=i.match(/\n/);return n&&n.index!==void 0?n.index+1:i.length},Jx.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new Ni;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const o=n.primaryGhostText,r=n.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=F.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new au(p,m),b=[v,...Khe(this.textModel,u,v)],w=ZHe(b).map(y=>dt.fromPositions(y));e.executeEdits("inlineSuggestion.accept",b.map(y=>Zn.replace(y.range,y.text))),e.setSelections(w,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),mt.Immediate)}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const p=F.fromPositions(r.range.getStartPosition(),eg.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,go.LF);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,m.length,{kind:i})}}finally{r.source.removeRef()}}handleSuggestAccepted(e){const t=IT(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const n=i.completion.inlineCompletion;n.source.provider.handlePartialAccept?.(n.source.inlineCompletions,n.sourceInlineCompletion,t.text.length,{kind:Jx.Suggest})}};cbe=D([_(9,we),_(10,vi),_(11,Vs)],cbe);var TC;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})(TC||(TC={}));function Khe(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),o=t.range.getStartPosition(),r=t.range.getEndPosition(),a=s.getValueInRange(F.fromPositions(i,r)),c=FHe(i,o);if(c.lineNumber<1)return vt(new Ni(`positionWithinTextEdit line number should be bigger than 0. - Invalid subtraction between ${i.toString()} and ${o.toString()}`)),[];const l=OMt(t.text,c);return n.map(d=>{const h=tMt(FHe(d,o),r),u=s.getValueInRange(F.fromPositions(d,h)),f=$y(a,u),p=F.fromPositions(d,d.delta(0,f));return new au(p,l)})}function OMt(s,e){let t="";const i=hat(s);for(let n=e.lineNumber-1;no.range,F.compareRangesUsingStarts)),i=new B2(e.apply(s)).getNewRanges();return e.inverse().apply(i).map(o=>o.getEndPosition())}var uV;class bMe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=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,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:v8.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class WMt extends bMe{constructor(){super("recentlyUsedByPrefix"),this._trie=Dh.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const o=`${e.getLanguageId()}/${n}`;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:v8.fromString(i.type),this._trie.set(t,i)}}}var BD;let lbe=(BD=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new cn(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===wy.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 n=uV._strategyCtors.get(i)||eUe;this._strategy=new n;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?Ie.PROFILE:Ie.WORKSPACE,a=this._storageService.get(`${uV._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")?Ie.PROFILE:Ie.WORKSPACE,i=JSON.stringify(this._strategy);this._storageService.store(`${uV._storagePrefix}/${this._strategy.name}`,i,t,an.MACHINE)}}},uV=BD,BD._strategyCtors=new Map([["recentlyUsedByPrefix",WMt],["recentlyUsed",BMt],["first",eUe]]),BD._storagePrefix="suggest/memories",BD);lbe=uV=D([_(0,$i),_(1,Te)],lbe);const cce=ae("ISuggestMemories");ce(cce,lbe,qt.Delayed);var dbe,CL;let aX=(CL=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=dbe.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(),n=this._editor.getSelection(),o=i.getWordAtPosition(n.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},dbe=CL,CL.AtEnd=new Q("atEndOfWord",!1),CL);aX=dbe=D([_(1,Le)],aX);var gV,SL;let bW=(SL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=gV.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(gV._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 n=i;for(let o=t.items.length;o>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));o--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=gV._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},gV=SL,SL.OtherSuggestions=new Q("hasOtherSuggestions",!1),SL);bW=gV=D([_(1,Le)],bW);const Tp=class Tp{async provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>Tp._bracketsRightYield(a,0,e,n,r)),await new Promise(a=>Tp._bracketsLeftYield(a,0,e,n,r,o))}return i}static _bracketsRightYield(e,t,i,n,o){const r=new Map,a=Date.now();for(;;){if(t>=Tp._maxRounds){e();break}if(!n){e();break}const c=i.bracketPairs.findNextBracket(n);if(!c){e();break}if(Date.now()-a>Tp._maxDuration){setTimeout(()=>Tp._bracketsRightYield(e,t+1,i,n,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 hl,o.set(d,u)),u.push(c.range)}}n=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,r){const a=new Map,c=Date.now();for(;;){if(t>=Tp._maxRounds&&o.size===0){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-c>Tp._maxDuration){setTimeout(()=>Tp._bracketsLeftYield(e,t+1,i,n,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=F.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=F.fromPositions(l.range.getStartPosition(),p.getEndPosition());r.push({range:m}),r.push({range:v}),Tp._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)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);o!==0&&o!==t.startColumn&&(i.push({range:F.fromPositions(new oe(n,o),t.getEndPosition())}),i.push({range:F.fromPositions(new oe(n,1),t.getEndPosition())}));const r=n-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:F.fromPositions(new oe(r,a),t.getEndPosition())}),i.push({range:F.fromPositions(new oe(r,1),t.getEndPosition())}))}}};Tp._maxDuration=30,Tp._maxRounds=2;let cX=Tp;const Aw=class Aw{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return Aw.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Aw.None;const[o]=await new cX().provideSelectionRanges(i,[n]);if(o.length===0)return Aw.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return Aw.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends Aw{distance(c,l){if(!n.equals(t.getPosition()))return 0;if(l.kind===Me.Keyword)return 2<<20;const d=typeof l.label=="string"?l.label:l.label.label,h=r[d];if(uU(h))return 2<<20;const u=y2(h,F.fromPositions(c),F.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=o.length;for(const m of o){if(!F.containsRange(m.range,f))break;p-=1}return p}}}};Aw.None=new class extends Aw{distance(){return 0}};let lX=Aw,tUe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var ME;(function(s){s[s.Nothing=0]="Nothing",s[s.All=1]="All",s[s.Incr=2]="Incr"})(ME||(ME={}));class nx{constructor(e,t,i,n,o,r,a=a3.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=nx._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=ME.All,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=nx._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=nx._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!==ME.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const r=this._refilterKind===ME.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||r.length>2e3?Uk:cCt;for(let l=0;l=f)d.score=N_.Default;else if(typeof d.completion.filterText=="string"){const m=c(n,o,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;wS(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=oCt(n,o,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(n,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=ME.Nothing,this._stats={pLabelLen:e.length?zge(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===Me.Snippet)return 1;if(t.completion.kind===Me.Snippet)return-1}return nx._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===Me.Snippet)return-1;if(t.completion.kind===Me.Snippet)return 1}return nx._compareCompletionItems(e,t)}}var hbe;class VI{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.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 uD;(function(s){s[s.Idle=0]="Idle",s[s.Manual=1]="Manual",s[s.Auto=2]="Auto"})(uD||(uD={}));function HMt(s,e,t){if(!e.getContextKeyValue(ju.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(ju.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}function UMt(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(ju.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}let dX=hbe=class{constructor(e,t,i,n,o,r,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,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 Cm,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 dt(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(){bt(this._triggerCharacterListener),bt([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 n of i.triggerCharacters||[]){let o=e.get(n);o||(o=new Set,o.add(AMt()),e.set(n,o)),o.add(i)}const t=i=>{if(!UMt(this._editor,this._contextKeyService)||VI.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let n="";fM(i.charCodeAt(i.length-1))?Pc(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const o=e.get(n);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:Ku.TriggerCharacter,triggerCharacter:n,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?uD.Auto:uD.Manual:uD.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!==Oi.NotSet&&e.reason!==Oi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Oi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Oi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){mF.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&fc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!VI.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(!mF.isAllOff(i)){if(!mF.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(mF.valueFor(i,o)!=="on")return}HMt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Tt(this._editor.hasModel()),Tt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new VI(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new VI(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 n={triggerKind:e.triggerKind??Ku.Invoke};e.triggerCharacter&&(n={triggerKind:Ku.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new ci;const o=this._editor.getOption(x.snippetSuggestions);let r=lA.Inline;switch(o){case"top":r=lA.Top;break;case"bottom":r=lA.Bottom;break}const{itemKind:a,showDeprecated:c}=hbe.createSuggestFilter(this._editor),l=new G3(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=lX.create(this._editorWorkerService,this._editor),h=mMe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),l,n,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 VI(m,this._editor.getPosition(),e),b={...a3.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new nx(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),b,p),this._completionDisposables.add(u.disposable),this._onNewContext(v),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const w of u.items)w.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${w.provider._debugDisplayName}`,w.completion)}).catch(vt)}_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(Me.Snippet);const n=e.getOption(x.suggest);return n.showMethods||t.add(Me.Method),n.showFunctions||t.add(Me.Function),n.showConstructors||t.add(Me.Constructor),n.showFields||t.add(Me.Field),n.showVariables||t.add(Me.Variable),n.showClasses||t.add(Me.Class),n.showStructs||t.add(Me.Struct),n.showInterfaces||t.add(Me.Interface),n.showModules||t.add(Me.Module),n.showProperties||t.add(Me.Property),n.showEvents||t.add(Me.Event),n.showOperators||t.add(Me.Operator),n.showUnits||t.add(Me.Unit),n.showValues||t.add(Me.Value),n.showConstants||t.add(Me.Constant),n.showEnums||t.add(Me.Enum),n.showEnumMembers||t.add(Me.EnumMember),n.showKeywords||t.add(Me.Keyword),n.showWords||t.add(Me.Text),n.showColors||t.add(Me.Color),n.showFiles||t.add(Me.File),n.showReferences||t.add(Me.Reference),n.showColors||t.add(Me.Customcolor),n.showFolders||t.add(Me.Folder),n.showTypeParameters||t.add(Me.TypeParameter),n.showSnippets||t.add(Me.Snippet),n.showUsers||t.add(Me.User),n.showIssues||t.add(Me.Issue),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(ho(e.leadingLineContent)!==ho(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(VI.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[n,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(n):t.set(n,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:Ku.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 n=VI.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(n&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};dX=hbe=D([_(1,Ml),_(2,dg),_(3,Yi),_(4,Ge),_(5,Le),_(6,Te),_(7,it),_(8,Za)],dX);class VMt{constructor(e,t,i,n){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!==uD.Idle){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&n(this._active.item)}}))}_onItem(e){if(!e||!eo(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new jj;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 Ise=class Ise{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(),n=i.length;let o=!1;for(let a=0;aIse._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 Sc?i.createInstance(C6,a,{useComma:!0}):void 0;this._leftActions=new hd(this.element,{actionViewItemProvider:r}),this._rightActions=new hd(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=[],n=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):n.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};gbe=D([_(2,we),_(3,Oa),_(4,Le)],gbe);var KMt=".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)}";ut(KMt,{});W("symbolIcon.arrayForeground",zi,g(9919,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.booleanForeground",zi,g(9920,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9921,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.colorForeground",zi,g(9922,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constantForeground",zi,g(9923,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9924,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9925,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9926,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9927,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9928,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.fileForeground",zi,g(9929,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.folderForeground",zi,g(9930,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9931,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9932,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keyForeground",zi,g(9933,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keywordForeground",zi,g(9934,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9935,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.moduleForeground",zi,g(9936,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.namespaceForeground",zi,g(9937,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.nullForeground",zi,g(9938,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.numberForeground",zi,g(9939,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.objectForeground",zi,g(9940,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.operatorForeground",zi,g(9941,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.packageForeground",zi,g(9942,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.propertyForeground",zi,g(9943,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.referenceForeground",zi,g(9944,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.snippetForeground",zi,g(9945,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.stringForeground",zi,g(9946,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.structForeground",zi,g(9947,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.textForeground",zi,g(9948,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.typeParameterForeground",zi,g(9949,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.unitForeground",zi,g(9950,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9951,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));class wMe{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 bn(0,0),this._minSize=new bn(0,0),this._maxSize=new bn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Od(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:fi.VERTICAL}),this._westSash=new Od(this.domNode,{getVerticalSashLeft:()=>0},{orientation:fi.VERTICAL}),this._northSash=new Od(this.domNode,{getHorizontalSashTop:()=>0},{orientation:fi.HORIZONTAL,orthogonalEdge:sJ.North}),this._southSash=new Od(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:fi.HORIZONTAL,orthogonalEdge:sJ.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(M.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(M.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(n=>{e&&(i=n.currentX-n.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(n=>{e&&(i=-(n.currentX-n.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(n=>{e&&(t=-(n.currentY-n.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(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(M.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(M.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{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,n){this._northSash.state=e?oa.Enabled:oa.Disabled,this._eastSash.state=t?oa.Enabled:oa.Disabled,this._southSash.state=i?oa.Enabled:oa.Disabled,this._westSash.state=n?oa.Enabled:oa.Disabled}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(r,t));const a=new bn(t,e);bn.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}}function yMe(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let fbe=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 bn(330,0),this.domNode=fe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Y_,{editor:e}),this._body=fe(".body"),this._scrollbar=new EU(this._body,{alwaysConsumeMouseWheel:!0}),re(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=re(this._body,fe(".header")),this._close=re(this._header,fe("span"+We.asCSSSelector(ve.close))),this._close.title=g(9952,"Close"),this._type=re(this._header,fe("p.type")),this._docs=re(this._body,fe("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(),n=e.get(x.suggestFontSize)||t.fontSize,o=e.get(x.suggestLineHeight)||t.lineHeight,r=t.fontWeight,a=`${n}px`,c=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/n}`,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(9953,"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:n}=e.completion;if(t){let o="";o+=`score: ${e.score[0]} +`)}withRange(e){return new Jve(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 ru(this.range,this.insertText)}};function iMt(s,e){const t=e.getWordAtPosition(s),i=e.getLineMaxColumn(s.lineNumber);return t?new F(s.lineNumber,t.startColumn,s.lineNumber,i):F.fromPositions(s,s.with(void 0,i))}function kHe(s,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+s,a=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),s)?.sliceAndInflate(e.column-1,o.length,0);return a?JRt(a,i):s}function ET(s,e,t){const i=t?s.range.intersectRanges(t):s.range;if(!i)return s;const n=e.getValueInRange(i,go.LF),o=Uy(n,s.text),r=Ju.ofText(n.substring(0,o)).addToPosition(s.range.getStartPosition()),a=s.text.substring(o),c=F.fromPositions(r,s.range.getEndPosition());return new ru(c,a)}function NXe(s,e){return s.text.startsWith(e.text)&&nMt(s.range,e.range)}function IHe(s,e,t,i,n=0){let o=ET(s,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=ho(r).length;if(o.range.startColumn-1<=a){const p=ho(o.text).length,m=r.substring(o.range.startColumn-1,a),[v,b]=[o.range.getStartPosition(),o.range.getEndPosition()],w=v.column+m.length<=b.column?v.delta(0,m.length):b,y=F.fromPositions(w,b),C=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(p);o=new ru(y,C)}const l=e.getValueInRange(o.range),d=sMt(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-n;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,b=Math.max(p.modifiedStart,Math.min(v,f)),w=o.text.substring(p.modifiedStart,b),y=o.text.substring(b,Math.max(p.modifiedStart,v));w.length>0&&u.push(new ZJ(m,w,!1)),y.length>0&&u.push(new ZJ(m,y,!0))}return new U3(h,u)}function nMt(s,e){return e.getStartPosition().equals(s.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(s.getEndPosition())}let uK;function sMt(s,e){if(uK?.originalValue===s&&uK?.newValue===e)return uK?.changes;{let t=LHe(s,e,!0);if(t){const i=THe(t);if(i>0){const n=LHe(s,e,!1);n&&THe(n)5e3||e.length>5e3)return;function i(l){let d=0;for(let h=0,u=l.length;hd&&(d=f)}return d}const n=Math.max(i(s),i(e));function o(l){if(l<0)throw new Error("unexpected");return n+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 Xve=class extends V{constructor(e,t,i,n,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=o,this._updateOperation=this._register(new wn),this.inlineCompletions=h3("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=h3("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){const n=new rMt(e,t,this.textModel.getVersionId()),o=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(this._updateOperation.value?.request.satisfies(n))return this._updateOperation.value.promise;if(o.get()?.request.satisfies(n))return Promise.resolve(!0);const r=!!this._updateOperation.value;this._updateOperation.clear();const a=new ci,c=(async()=>{if((r||t.triggerKind===Jp.Automatic)&&await oMt(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const h=new Date,u=await MXe(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==n.versionId)return!1;const f=new Date;this._debounceValue.update(this.textModel,f.getTime()-h.getTime());const p=new cMt(u,n,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(),ts(m=>{o.set(p,m)}),!0})(),l=new aMt(n,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()}};Xve=D([_(3,it),_(4,Vs)],Xve);function oMt(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}class rMt{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&Nq(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,mAt())&&(e.context.triggerKind===Jp.Automatic||this.context.triggerKind===Jp.Explicit)&&this.versionId===e.versionId}}class aMt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class cMt{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,n){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=n,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 RHe(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 n=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new RHe(e,n,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class RHe{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=n,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=Yh({owner:this,equalsFn:F.equalsRange},o=>(this._modelVersion.read(o),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??Ohe)}toSingleTextEdit(e){return new ru(this._updatedRange.read(e)??Ohe,this.inlineCompletion.insertText)}isVisible(e,t,i){const n=ET(this._toFilterTextReplacement(i),e),o=this._updatedRange.read(i);if(!o||!this.inlineCompletion.range.getStartPosition().equals(o.getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const r=e.getValueInRange(n.range,go.LF),a=n.text,c=Math.max(0,t.column-n.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(n.range.startLineNumber);return n.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),l=l.trimStart(),l.length===0&&(d=d.trimStart())),l.startsWith(h)&&!!SQe(u,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&Ju.ofRange(i).isGreaterThanOrEqualTo(Ju.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new ru(this._updatedRange.read(e)??Ohe,this.inlineCompletion.filterText)}}const Ohe=new F(1,1,1,1),lMt=g(11236,"input"),dMt=g(11237,"Preserve Case");class hMt extends JA{constructor(e){super({icon:ve.preserveCase,title:dMt+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Pr("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const KPe=class KPe extends gd{constructor(e,t,i,n){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=n.placeholder||"",this.validation=n.validation,this.label=n.label||lMt;const o=n.appendPreserveCaseLabel||"",r=n.history||[],a=!!n.flexibleHeight,c=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new PLe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:n.showHistoryHint,flexibleHeight:a,flexibleWidth:c,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new hMt({appendTitle:o,isChecked:!1,...n.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(S.LeftArrow)||u.equals(S.RightArrow)||u.equals(S.Escape)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let p=-1;u.equals(S.RightArrow)?p=(f+1)%d.length:u.equals(S.LeftArrow)&&(f===0?p=d.length-1:p=f-1),u.equals(S.Escape)?(d[f].blur(),this.inputBox.focus()):p>=0&&d[p].focus(),en.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()}};KPe.OPTION_CHANGE="optionChange";let Zve=KPe;const iMe=new Y("suggestWidgetVisible",!1,g(9874,"Whether suggestion are visible")),nMe="historyNavigationWidgetFocus",PXe="historyNavigationForwardsEnabled",FXe="historyNavigationBackwardsEnabled";let M5;const gK=[];function tce(s,e){if(gK.includes(e))throw new Error("Cannot register the same widget multiple times");gK.push(e);const t=new Z,i=new Y(nMe,!1).bindTo(s),n=new Y(PXe,!0).bindTo(s),o=new Y(FXe,!0).bindTo(s),r=()=>{i.set(!0),M5=e},a=()=>{i.set(!1),M5===e&&(M5=void 0)};return sv(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ee(()=>{gK.splice(gK.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:n,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let eX=class extends PLe{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.element));this._register(tce(o,this))}};eX=D([_(3,Le)],eX);let ebe=class extends m3{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(tce(o,this.inputBox))}};ebe=D([_(3,Le)],ebe);let tbe=class extends Zve{constructor(e,t,i,n,o=!1){super(e,t,o,i);const r=this._register(n.createScoped(this.inputBox.element));this._register(tce(r,this.inputBox))}};tbe=D([_(3,Le)],tbe);So.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:Ae.WorkbenchContrib,when:he.and(he.has(nMe),he.equals(FXe,!0),he.not("isComposing"),iMe.isEqualTo(!1)),primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],handler:s=>{M5?.showPreviousValue()}});So.registerCommandAndKeybindingRule({id:"history.showNext",weight:Ae.WorkbenchContrib,when:he.and(he.has(nMe),he.equals(PXe,!0),he.not("isComposing"),iMe.isEqualTo(!1)),primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],handler:s=>{M5?.showNextValue()}});const Ui={Visible:iMe,HasFocusedSuggestion:new Y("suggestWidgetHasFocusedSuggestion",!1,g(5209,"Whether any suggestion is focused")),DetailsVisible:new Y("suggestWidgetDetailsVisible",!1,g(5210,"Whether suggestion details are visible")),MultipleSuggestions:new Y("suggestWidgetMultipleSuggestions",!1,g(5211,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Y("suggestionMakesTextEdit",!0,g(5212,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Y("acceptSuggestionOnEnter",!0,g(5213,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Y("suggestionHasInsertAndReplaceRange",!1,g(5214,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Y("suggestionInsertMode",void 0,{type:"string",description:g(5215,"Whether the default behaviour is to insert or replace")}),CanResolve:new Y("suggestionCanResolve",!1,g(5216,"Whether the current suggestion supports to resolve further details"))},cD=new _e("suggestWidgetStatusBar");let uMt=class{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=L_.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,F.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||F.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||F.spansMultipleLines(t.range.insert)||F.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 n.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 js(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(n=>{Object.assign(this.completion,n),this._resolveDuration=i.elapsed()},n=>{Fr(n)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}};var cA;(function(s){s[s.Top=0]="Top",s[s.Inline=1]="Inline",s[s.Bottom=2]="Bottom"})(cA||(cA={}));const Ase=class Ase{constructor(e=cA.Bottom,t=new Set,i=new Set,n=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=o}};Ase.default=new Ase;let V3=Ase,ZE;function gMt(){return ZE}function fMt(s){const e=ZE;return ZE=s,e}class pMt{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}async function sMe(s,e,t,i=V3.default,n={triggerKind:$u.Invoke},o=He.None){const r=new js;t=t.clone();const a=e.getWordAtPosition(t),c=a?new F(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):F.fromPositions(t),l={replace:c,insert:c.setEndPosition(t.lineNumber,t.column)},d=[],h=new Z,u=[];let f=!1;const p=(v,b,w)=>{let y=!1;if(!b)return y;for(const C of b.suggestions)if(!i.kindFilter.has(C.kind)){if(!i.showDeprecated&&C?.tags?.includes(E2.Deprecated))continue;C.range||(C.range=l),C.sortText||(C.sortText=typeof C.label=="string"?C.label:C.label.label),!f&&C.insertTextRules&&C.insertTextRules&qg.InsertAsSnippet&&(f=j_.guessNeedsClipboard(C.insertText)),d.push(new uMt(t,C,b,v)),y=!0}return mN(b)&&h.add(b),u.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:w.elapsed()}),y},m=(async()=>{if(!ZE||i.kindFilter.has(Ne.Snippet))return;const v=i.providerItemsToReuse.get(ZE);if(v){v.forEach(y=>d.push(y));return}if(i.providerFilter.size>0&&!i.providerFilter.has(ZE))return;const b=new js,w=await ZE.provideCompletionItems(e,t,n,o);p(ZE,w,b)})();for(const v of s.orderedGroups(e)){let b=!1;if(await Promise.all(v.map(async w=>{if(i.providerItemsToReuse.has(w)){const y=i.providerItemsToReuse.get(w);y.forEach(C=>d.push(C)),b=b||y.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(w)))try{const y=new js,C=await w.provideCompletionItems(e,t,n,o);b=p(w,C,y)||b}catch(y){No(y)}})),b||o.isCancellationRequested)break}return await m,o.isCancellationRequested?(h.dispose(),Promise.reject(new Ma)):new pMt(d.sort(vMt(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function oMe(s,e){if(s.sortTextLow&&e.sortTextLow){if(s.sortTextLowe.sortTextLow)return 1}return s.textLabele.textLabel?1:s.completion.kind-e.completion.kind}function mMt(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===Ne.Snippet)return-1;if(e.completion.kind===Ne.Snippet)return 1}return oMe(s,e)}function _Mt(s,e){if(s.completion.kind!==e.completion.kind){if(s.completion.kind===Ne.Snippet)return 1;if(e.completion.kind===Ne.Snippet)return-1}return oMe(s,e)}const ice=new Map;ice.set(cA.Top,mMt);ice.set(cA.Bottom,_Mt);ice.set(cA.Inline,oMe);function vMt(s){return ice.get(s)}_t.registerCommand("_executeCompletionItemProvider",async(s,...e)=>{const[t,i,n,o]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string"||!n),Tt(typeof o=="number"||!o);const{completionProvider:r}=s.get(it),a=await s.get(fn).createModelReference(t);try{const c={incomplete:!1,suggestions:[]},l=[],d=a.object.textEditorModel.validatePosition(i),h=await sMe(r,a.object.textEditorModel,d,void 0,{triggerCharacter:n??void 0,triggerKind:n?$u.TriggerCharacter:$u.Invoke});for(const u of h.items)l.length<(o??0)&&l.push(u.resolve(He.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 OXe(s,e){s.getContribution("editor.contrib.suggestController")?.triggerSuggest(new Set().add(e),void 0,!0)}class uF{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 nr.Comment:return e.comments;case nr.String:return e.strings;default:return e.other}}}var bMt=".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}";ut(bMt,{});function wMt(s,e){const{os:t,tildify:i,relative:n}=e;if(n){const a=yMt(s,n,t);if(typeof a=="string")return a}let o=s.fsPath;if(t===Ds.Windows&&!Qn?o=o.replace(/\//g,"\\"):t!==Ds.Windows&&Qn&&(o=o.replace(/\\/g,"/")),t!==Ds.Windows&&i?.userHome){const a=i.userHome.fsPath;let c;s.scheme!==i.userHome.scheme&&s.path[0]===Vi.sep&&s.path[1]!==Vi.sep?c=i.userHome.with({path:s.path}).fsPath:c=o,o=BXe(c,a,t)}return(t===Ds.Windows?cc:Vi).normalize(zw(o,t===Ds.Windows))}function yMt(s,e,t){const i=t===Ds.Windows?cc:Vi,n=t===Ds.Linux?xn:kre,o=e.getWorkspace(),r=rm(o.folders);if(!r)return;s.scheme!==r.uri.scheme&&s.path[0]===Vi.sep&&s.path[1]!==Vi.sep&&(s=r.uri.with({path:s.path}));const a=e.getWorkspaceFolder(s);if(!a)return;let c;if(n.isEqual(a.uri,s)?c="":c=n.relativePath(a.uri,s)??"",c&&(c=i.normalize(c)),o.folders.length>1&&!e.noPrefix){const l=a.name?a.name:n.basenameOrAuthority(a.uri);c=c?`${l} • ${c}`:l}return c}function zw(s,e=Qn){return fGe(s,e)?s.charAt(0).toUpperCase()+s.slice(1):s}let Bhe=Object.create(null);function BXe(s,e,t=po){if(t===Ds.Windows||!s||!e)return s;let i=Bhe.original===e?Bhe.normalized:void 0;i||(i=e,Qn&&(i=w8(i)),i=`${Hy(i,Vi.sep)}${Vi.sep}`,Bhe={original:e,normalized:i});let n=s;return Qn&&(n=w8(n)),(t===Ds.Linux?n.startsWith(i):P7(n,i))?`~/${n.substr(i.length)}`:s}function CMt(s,e){return s.replace(/^~($|\/|\\)/,`${e}$1`)}const MHe="…",m4="\\\\",_4="~";function SMt(s,e=su){const t=new Array(s.length);let i=!1;for(let n=0;n=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&&s[u].indexOf(e)>-1?e+h:h,m=s[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+MHe+e),u=u+h,d+l{if(o.type===dw.SEPARATOR){const a=t[r-1],c=t[r+1];return[a,c].every(l=>l&&(l.type===dw.VARIABLE||l.type===dw.TEXT)&&l.value.length>0)}return!0}).map(o=>o.value).join("")}function rMe(s,e){return Qt||e?s.replace(/\(&&\w\)|&&/g,""):Qn?s.replace(/&&|&/g,t=>t==="&"?"&&":"&"):s.replace(/&&/g,"_")}const EMt=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 NHe{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 PHe{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,n=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,n=o.multiline)}if(i&&n&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=ho(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(l=>l===e?!1:(l instanceof Vd&&(a=ho(iv(l.value).pop())),!0));const c=Uy(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 FHe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return Ko(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=Ko(this._model.uri.fsPath),n=i.lastIndexOf(".");return n<=0?i:i.slice(0,n)}else{if(t==="TM_DIRECTORY")return bb(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(Lr(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 OHe{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}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(n=>!zu(n));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let tX=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),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n){if(t==="LINE_COMMENT")return n.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return n.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return n.blockCommentEndToken||void 0}}};tX=D([_(2,Vs)],tX);const ww=class ww{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 ww.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return ww.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return ww.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return ww.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(),n=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 n+r+":"+c}}};ww.dayNames=[g(9881,"Sunday"),g(9882,"Monday"),g(9883,"Tuesday"),g(9884,"Wednesday"),g(9885,"Thursday"),g(9886,"Friday"),g(9887,"Saturday")],ww.dayNamesShort=[g(9888,"Sun"),g(9889,"Mon"),g(9890,"Tue"),g(9891,"Wed"),g(9892,"Thu"),g(9893,"Fri"),g(9894,"Sat")],ww.monthNames=[g(9895,"January"),g(9896,"February"),g(9897,"March"),g(9898,"April"),g(9899,"May"),g(9900,"June"),g(9901,"July"),g(9902,"August"),g(9903,"September"),g(9904,"October"),g(9905,"November"),g(9906,"December")],ww.monthNamesShort=[g(9907,"Jan"),g(9908,"Feb"),g(9909,"Mar"),g(9910,"Apr"),g(9911,"May"),g(9912,"Jun"),g(9913,"Jul"),g(9914,"Aug"),g(9915,"Sep"),g(9916,"Oct"),g(9917,"Nov"),g(9918,"Dec")];let iX=ww;class BHe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=UO(this._workspaceService.getWorkspace());if(!KSt(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(R_(e))return Ko(e.uri.path);let t=Ko(e.configPath.path);return t.endsWith(Sb)&&(t=t.substr(0,t.length-Sb.length-1)),t}_resoveWorkspacePath(e){if(R_(e))return zw(e.uri.fsPath);const t=Ko(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?zw(i):"/"}}class WHe{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 ar()}}var vv;const Qm=class Qm{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Zz(t.placeholders,Hg.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 n=this._snippet.offset(i),o=this._snippet.fullLen(i),r=F.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),a=i.isFinalTabstop?Qm._decor.inactiveFinal:Qm._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 n=[];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",n)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(n=>{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 dt(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),n.changeDecorationOptions(c,a.isFinalTabstop?Qm._decor.activeFinal:Qm._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);n.changeDecorationOptions(h,d.isFinalTabstop?Qm._decor.activeFinal:Qm._decor.active),o.add(d)}}for(const[a,c]of this._placeholderDecorations)o.has(a)||n.changeDecorationOptions(c,a.isFinalTabstop?Qm._decor.inactiveFinal:Qm._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Hg){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 n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const o=this._placeholderDecorations.get(n),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(n.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 OU,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const n 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=n.index+(r+1)/this._nestingLevel:c.index=n.index+c.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const a=this._placeholderDecorations.get(n);i.removeDecoration(a),this._placeholderDecorations.delete(n);for(const c of o._snippet.placeholders){const l=o._snippet.offset(c),d=o._snippet.fullLen(c),h=F.fromPositions(t.getPositionAt(o._offset+l),t.getPositionAt(o._offset+l+d)),u=i.addDecoration(h,Qm._decor.inactive);this._placeholderDecorations.set(c,u)}}this._placeholderGroups=Zz(this._snippet.placeholders,Hg.compareByIndex)})}getEnclosingRange(){let e;const t=this._editor.getModel();for(const i of this._placeholderDecorations.values()){const n=t.getDecorationRange(i)??void 0;e?e=e.plusRange(n):e=n}return e}};Qm._decor={active:Gt.register({description:"snippet-placeholder-1",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),inactive:Gt.register({description:"snippet-placeholder-2",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"snippet-placeholder"}),activeFinal:Gt.register({description:"snippet-placeholder-3",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"}),inactiveFinal:Gt.register({description:"snippet-placeholder-4",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"finish-snippet-placeholder"})};let nX=Qm;const HHe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let sX=vv=class{static adjustWhitespace(e,t,i,n,o){const r=e.getLineContent(t.lineNumber),a=ho(r,0,t.column-1);let c;return n.walk(l=>{if(!(l instanceof Vd)||l.parent instanceof OU||o&&!o.has(l))return!0;const d=l.value.split(/\r\n|\r|\n/);if(i){const u=n.offset(l);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{c=c??n.toString();const f=c.charCodeAt(u-1);(f===B.LineFeed||f===B.CarriageReturn)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fC.get(yi)),p=e.invokeWithinContext(C=>new FHe(C.get(Fs),u)),m=()=>a,v=u.getValueInRange(vv.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(vv.adjustSelection(u,e.getSelection(),0,n)),w=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((C,A)=>({selection:C,idx:A})).sort((C,A)=>F.compareRangesUsingStarts(C.selection,A.selection));for(const{selection:C,idx:A}of y){let L=vv.adjustSelection(u,C,i,0),k=vv.adjustSelection(u,C,0,n);v!==u.getValueInRange(L)&&(L=C),b!==u.getValueInRange(k)&&(k=C);const P=C.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(k.endLineNumber,k.endColumn),R=new j_().parse(t,!0,o),z=P.getStartPosition(),G=vv.adjustWhitespace(u,z,r||A>0&&w!==u.getLineFirstNonWhitespaceColumn(C.positionLineNumber),R);R.resolveVariables(new NHe([p,new OHe(m,A,y.length,e.getOption(x.multiCursorPaste)==="spread"),new PHe(u,C,A,c),new tX(u,C,l),new iX,new BHe(f),new WHe])),d[A]=Zn.replace(P,R.toString()),d[A].identifier={major:A,minor:0},d[A]._isTracked=!0,h[A]=new nX(e,R,G)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const c=[],l=e.getModel(),d=new j_,h=new H6,u=new NHe([e.invokeWithinContext(p=>new FHe(p.get(Fs),l)),new OHe(()=>o,0,e.getSelections().length,e.getOption(x.multiCursorPaste)==="spread"),new PHe(l,e.getSelection(),0,r),new tX(l,e.getSelection(),a),new iX,new BHe(e.invokeWithinContext(p=>p.get(yi))),new WHe]);t=t.sort((p,m)=>F.compareRangesUsingStarts(p.range,m.range));let f=0;for(let p=0;p0){const A=t[p-1].range,L=F.fromPositions(A.getEndPosition(),m.getStartPosition()),k=new Vd(l.getValueInRange(L));h.appendChild(k),f+=k.value.length}const b=d.parseFragment(v,h);vv.adjustWhitespace(l,m.getStartPosition(),!0,h,new Set(b)),h.resolveVariables(u);const w=h.toString(),y=w.slice(f);f=w.length;const C=Zn.replace(m,y);C.identifier={major:p,minor:0},C._isTracked=!0,c.push(C)}return d.ensureFinalTabstop(h,i,!0),{edits:c,snippets:[new nX(e,h,"")]}}constructor(e,t,i=HHe,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){bt(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"?vv.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):vv.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 n=i.filter(o=>!!o.identifier);for(let o=0;odt.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=HHe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=vv.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;cdt.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 n=i.move(e);t.push(...n)}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(...n.get(r))})}e.sort(F.compareRangesUsingStarts);for(const[i,n]of t){if(n.length!==e.length){t.delete(i);continue}n.sort(F.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}};sX=vv=D([_(3,Vs)],sX);var IP;const fK={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var Jw;let fc=(Jw=class{static get(e){return e.getContribution(IP.ID)}constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new Z,this._modelVersionId=-1,this._inSnippet=IP.InSnippetMode.bindTo(n),this._hasNextTabstop=IP.HasNextTabstop.bindTo(n),this._hasPrevTabstop=IP.HasPrevTabstop.bindTo(n)}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"?fK:{...fK,...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"?fK:{...fK,...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?(Tt(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new sX(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:n.getLanguageId(),pattern:n.uri.fsPath,scheme:n.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(()=>{OXe(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()}},IP=Jw,Jw.ID="snippetController2",Jw.InSnippetMode=new Y("inSnippetMode",!1,g(1558,"Whether the editor in current in snippet mode")),Jw.HasNextTabstop=new Y("hasNextTabstop",!1,g(1559,"Whether there is a next tab stop when in snippet mode")),Jw.HasPrevTabstop=new Y("hasPrevTabstop",!1,g(1560,"Whether there is a previous tab stop when in snippet mode")),Jw);fc=IP=D([_(1,Ge),_(2,it),_(3,Le),_(4,Vs)],fc);on(fc.ID,fc,ri.Lazy);const nce=hc.bindToContribution(fc.get);qe(new nce({id:"jumpToNextSnippetPlaceholder",precondition:he.and(fc.InSnippetMode,fc.HasNextTabstop),handler:s=>s.next(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Tab}}));qe(new nce({id:"jumpToPrevSnippetPlaceholder",precondition:he.and(fc.InSnippetMode,fc.HasPrevTabstop),handler:s=>s.prev(),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));qe(new nce({id:"leaveSnippet",precondition:fc.InSnippetMode,handler:s=>s.cancel(!0),kbOpts:{weight:Ae.EditorContrib+30,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new nce({id:"acceptSnippet",precondition:fc.InSnippetMode,handler:s=>s.finish()}));let ibe=class extends V{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,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(Xve,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=jt(this,!1),this._forceUpdateExplicitlySignal=lC(this),this._selectedInlineCompletionId=jt(this,void 0),this._primaryPosition=Ze(this,p=>this._positions.read(p)[0]??new oe(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([IC.Redo,IC.Undo,IC.AcceptWord]),this._fetchInlineCompletionsPromise=bje({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Jp.Automatic}),handleChange:(p,m)=>(p.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(p.change))?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdateExplicitlySignal)&&(m.inlineCompletionTriggerKind=Jp.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 b=this._source.suggestWidgetInlineCompletions.get(),w=this.selectedSuggestItem.read(p);if(b&&!w){const k=this._source.inlineCompletions.get();ts(P=>{(!k||b.request.versionId>k.request.versionId)&&this._source.inlineCompletions.set(b.clone(),P),this._source.clearSuggestWidgetInlineCompletions(P)})}const y=this._primaryPosition.read(p),C={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:w?.toSelectedSuggestionInfo()},A=this.selectedInlineCompletion.get(),L=m.preserveCurrentCompletion||A?.forwardStable?A:void 0;return this._source.fetch(y,C,L)}),this._filteredInlineCompletionItems=Yh({owner:this,equalsFn:q2()},p=>{const m=this._source.inlineCompletions.read(p);if(!m)return[];const v=this._primaryPosition.read(p);return m.inlineCompletions.filter(w=>w.isVisible(this.textModel,v,p))}),this.selectedInlineCompletionIndex=Ze(this,p=>{const m=this._selectedInlineCompletionId.read(p),v=this._filteredInlineCompletionItems.read(p),b=this._selectedInlineCompletionId===void 0?-1:v.findIndex(w=>w.semanticId===m);return b===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):b}),this.selectedInlineCompletion=Ze(this,p=>{const m=this._filteredInlineCompletionItems.read(p),v=this.selectedInlineCompletionIndex.read(p);return m[v]}),this.activeCommands=Yh({owner:this,equalsFn:q2()},p=>this.selectedInlineCompletion.read(p)?.inlineCompletion.source.inlineCompletions.commands??[]),this.lastTriggerKind=this._source.inlineCompletions.map(this,p=>p?.request.context.triggerKind),this.inlineCompletionsCount=Ze(this,p=>{if(this.lastTriggerKind.read(p)===Jp.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=Yh({owner:this,equalsFn:(p,m)=>!p||!m?p===m:SHe(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 b=ET(v.toSingleTextEdit(),m),w=this._computeAugmentation(b,p);if(!this._suggestPreviewEnabled.read(p)&&!w)return;const C=w?.edit??b,A=w?w.edit.text.length-b.text.length:0,L=this._suggestPreviewMode.read(p),k=this._positions.read(p),P=[C,...Whe(this.textModel,k,C)],R=P.map((G,j)=>IHe(G,m,L,k[j],A)).filter(Fc),z=R[0]??new U3(C.range.endLineNumber,[]);return{edits:P,primaryGhostText:z,ghostTexts:R,inlineCompletion:w?.completion,suggestItem:v}}else{if(!this._isActive.read(p))return;const b=this.selectedInlineCompletion.read(p);if(!b)return;const w=b.toSingleTextEdit(p),y=this._inlineSuggestMode.read(p),C=this._positions.read(p),A=[w,...Whe(this.textModel,C,w)],L=A.map((k,P)=>IHe(k,m,y,C[P],0)).filter(Fc);return L[0]?{edits:A,primaryGhostText:L[0],ghostTexts:L,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostTexts=Yh({owner:this,equalsFn:SHe},p=>{const m=this.state.read(p);if(m)return m.ghostTexts}),this.primaryGhostText=Yh({owner:this,equalsFn:kXe},p=>{const m=this.state.read(p);if(m)return m?.primaryGhostText}),this._register(RN(this._fetchInlineCompletionsPromise));let f;this._register(ai(p=>{const v=this.state.read(p)?.inlineCompletion;if(v?.semanticId!==f?.semanticId&&(f=v,v)){const b=v.inlineCompletion,w=b.source;w.provider.handleItemDidShow?.(w.inlineCompletions,b.sourceInlineCompletion,b.insertText)}}))}_getReason(e){return e?.isUndoing?IC.Undo:e?.isRedoing?IC.Redo:this.isAcceptingPartially?IC.AcceptWord:IC.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){bM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){bM(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t),o=n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Fc);return jot(o,a=>{let c=a.toSingleTextEdit(t);return c=ET(c,i,F.fromPositions(c.range.getStartPosition(),e.range.getEndPosition())),NXe(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 Ni;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(i.command&&i.source.addRef(),e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[Zn.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),fc.get(e)?.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const n=t.edits,o=UHe(n).map(r=>dt.fromPositions(r));e.executeEdits("inlineSuggestion.accept",[...n.map(r=>Zn.replace(r.range,r.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,No),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const n=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(n),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 n=i.match(/\n/);return n&&n.index!==void 0?n.index+1:i.length},Qx.Line)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new Ni;const n=this.state.get();if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;const o=n.primaryGhostText,r=n.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=F.fromPositions(f,c),m=e.getModel().getValueInRange(p)+h,v=new ru(p,m),b=[v,...Whe(this.textModel,u,v)],w=UHe(b).map(y=>dt.fromPositions(y));e.executeEdits("inlineSuggestion.accept",b.map(y=>Zn.replace(y.range,y.text))),e.setSelections(w,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),mt.Immediate)}finally{this._isAcceptingPartially=!1}if(r.source.provider.handlePartialAccept){const p=F.fromPositions(r.range.getStartPosition(),Ju.ofText(h).addToPosition(c)),m=e.getModel().getValueInRange(p,go.LF);r.source.provider.handlePartialAccept(r.source.inlineCompletions,r.sourceInlineCompletion,m.length,{kind:i})}}finally{r.source.removeRef()}}handleSuggestAccepted(e){const t=ET(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const n=i.completion.inlineCompletion;n.source.provider.handlePartialAccept?.(n.source.inlineCompletions,n.sourceInlineCompletion,t.text.length,{kind:Qx.Suggest})}};ibe=D([_(9,we),_(10,vi),_(11,Vs)],ibe);var IC;(function(s){s[s.Undo=0]="Undo",s[s.Redo=1]="Redo",s[s.AcceptWord=2]="AcceptWord",s[s.Other=3]="Other"})(IC||(IC={}));function Whe(s,e,t){if(e.length===1)return[];const i=e[0],n=e.slice(1),o=t.range.getStartPosition(),r=t.range.getEndPosition(),a=s.getValueInRange(F.fromPositions(i,r)),c=AHe(i,o);if(c.lineNumber<1)return vt(new Ni(`positionWithinTextEdit line number should be bigger than 0. + Invalid subtraction between ${i.toString()} and ${o.toString()}`)),[];const l=xMt(t.text,c);return n.map(d=>{const h=$Rt(AHe(d,o),r),u=s.getValueInRange(F.fromPositions(d,h)),f=Uy(a,u),p=F.fromPositions(d,d.delta(0,f));return new ru(p,l)})}function xMt(s,e){let t="";const i=eat(s);for(let n=e.lineNumber-1;no.range,F.compareRangesUsingStarts)),i=new N2(e.apply(s)).getNewRanges();return e.inverse().apply(i).map(o=>o.getEndPosition())}var dV;class aMe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=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,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:p8.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class kMt extends aMe{constructor(){super("recentlyUsedByPrefix"),this._trie=Eh.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const o=`${e.getLanguageId()}/${n}`;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:p8.fromString(i.type),this._trie.set(t,i)}}}var MD;let nbe=(MD=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new Z,this._persistSoon=new cn(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===_y.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 n=dV._strategyCtors.get(i)||VHe;this._strategy=new n;try{const r=this._configService.getValue("editor.suggest.shareSuggestSelections")?Ie.PROFILE:Ie.WORKSPACE,a=this._storageService.get(`${dV._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")?Ie.PROFILE:Ie.WORKSPACE,i=JSON.stringify(this._strategy);this._storageService.store(`${dV._storagePrefix}/${this._strategy.name}`,i,t,an.MACHINE)}}},dV=MD,MD._strategyCtors=new Map([["recentlyUsedByPrefix",kMt],["recentlyUsed",DMt],["first",VHe]]),MD._storagePrefix="suggest/memories",MD);nbe=dV=D([_(0,$i),_(1,Te)],nbe);const sce=ae("ISuggestMemories");ce(sce,nbe,qt.Delayed);var sbe,vL;let oX=(vL=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=sbe.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(),n=this._editor.getSelection(),o=i.getWordAtPosition(n.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===n.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},sbe=vL,vL.AtEnd=new Y("atEndOfWord",!1),vL);oX=sbe=D([_(1,Le)],oX);var hV,bL;let pW=(bL=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=hV.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(hV._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 n=i;for(let o=t.items.length;o>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,!(n===i||!t.items[n].completion.additionalTextEdits));o--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=hV._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},hV=bL,bL.OtherSuggestions=new Y("hasOtherSuggestions",!1),bL);pW=hV=D([_(1,Le)],pW);const Dp=class Dp{async provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>Dp._bracketsRightYield(a,0,e,n,r)),await new Promise(a=>Dp._bracketsLeftYield(a,0,e,n,r,o))}return i}static _bracketsRightYield(e,t,i,n,o){const r=new Map,a=Date.now();for(;;){if(t>=Dp._maxRounds){e();break}if(!n){e();break}const c=i.bracketPairs.findNextBracket(n);if(!c){e();break}if(Date.now()-a>Dp._maxDuration){setTimeout(()=>Dp._bracketsRightYield(e,t+1,i,n,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 dl,o.set(d,u)),u.push(c.range)}}n=c.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,r){const a=new Map,c=Date.now();for(;;){if(t>=Dp._maxRounds&&o.size===0){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-c>Dp._maxDuration){setTimeout(()=>Dp._bracketsLeftYield(e,t+1,i,n,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=F.fromPositions(l.range.getEndPosition(),p.getStartPosition()),v=F.fromPositions(l.range.getStartPosition(),p.getEndPosition());r.push({range:m}),r.push({range:v}),Dp._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)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);o!==0&&o!==t.startColumn&&(i.push({range:F.fromPositions(new oe(n,o),t.getEndPosition())}),i.push({range:F.fromPositions(new oe(n,1),t.getEndPosition())}));const r=n-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:F.fromPositions(new oe(r,a),t.getEndPosition())}),i.push({range:F.fromPositions(new oe(r,1),t.getEndPosition())}))}}};Dp._maxDuration=30,Dp._maxRounds=2;let rX=Dp;const yw=class yw{static async create(e,t){if(!t.getOption(x.suggest).localityBonus||!t.hasModel())return yw.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return yw.None;const[o]=await new rX().provideSelectionRanges(i,[n]);if(o.length===0)return yw.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return yw.None;const a=i.getWordUntilPosition(n);return delete r[a.word],new class extends yw{distance(c,l){if(!n.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(aU(h))return 2<<20;const u=_2(h,F.fromPositions(c),F.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let p=o.length;for(const m of o){if(!F.containsRange(m.range,f))break;p-=1}return p}}}};yw.None=new class extends yw{distance(){return 0}};let aX=yw,zHe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};var TE;(function(s){s[s.Nothing=0]="Nothing",s[s.All=1]="All",s[s.Incr=2]="Incr"})(TE||(TE={}));class ex{constructor(e,t,i,n,o,r,a=s3.default,c=void 0){this.clipboardText=c,this._snippetCompareFn=ex._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=TE.All,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=ex._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=ex._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!==TE.Nothing&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const r=this._refilterKind===TE.All?this._items:this._filteredItems,a=[],c=!this._options.filterGraceful||r.length>2e3?Fk:Jyt;for(let l=0;l=f)d.score=L_.Default;else if(typeof d.completion.filterText=="string"){const m=c(n,o,p,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;bS(d.completion.filterText,d.textLabel)===0?d.score=m:(d.score=Qyt(n,o,p,d.textLabel,d.labelLow,0),d.score[0]=m[0])}else{const m=c(n,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=TE.Nothing,this._stats={pLabelLen:e.length?Oge(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 ex._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 ex._compareCompletionItems(e,t)}}var obe;class FI{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.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 lD;(function(s){s[s.Idle=0]="Idle",s[s.Manual=1]="Manual",s[s.Auto=2]="Auto"})(lD||(lD={}));function IMt(s,e,t){if(!e.getContextKeyValue(qu.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(qu.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}function TMt(s,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(qu.suppressSuggestions.key);return i!==void 0?!i:!s.getOption(x.inlineSuggest).suppressSuggestions}let cX=obe=class{constructor(e,t,i,n,o,r,a,c,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,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 bm,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 dt(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(){bt(this._triggerCharacterListener),bt([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 n of i.triggerCharacters||[]){let o=e.get(n);o||(o=new Set,o.add(gMt()),e.set(n,o)),o.add(i)}const t=i=>{if(!TMt(this._editor,this._contextKeyService)||FI.shouldAutoTrigger(this._editor))return;if(!i){const r=this._editor.getPosition();i=this._editor.getModel().getLineContent(r.lineNumber).substr(0,r.column-1)}let n="";dM(i.charCodeAt(i.length-1))?Pc(i.charCodeAt(i.length-2))&&(n=i.substr(i.length-2)):n=i.charAt(i.length-1);const o=e.get(n);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:$u.TriggerCharacter,triggerCharacter:n,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?lD.Auto:lD.Manual:lD.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!==Oi.NotSet&&e.reason!==Oi.Explicit||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===Oi.NotSet?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===Oi.Explicit&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){uF.isAllOff(this._editor.getOption(x.quickSuggestions))||this._editor.getOption(x.suggest).snippetsPreventQuickSuggestions&&fc.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!FI.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(!uF.isAllOff(i)){if(!uF.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(uF.valueFor(i,o)!=="on")return}IMt(this._editor,this._contextKeyService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(x.quickSuggestionsDelay)))}_refilterCompletionItems(){Tt(this._editor.hasModel()),Tt(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new FI(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new FI(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 n={triggerKind:e.triggerKind??$u.Invoke};e.triggerCharacter&&(n={triggerKind:$u.TriggerCharacter,triggerCharacter:e.triggerCharacter}),this._requestToken=new ci;const o=this._editor.getOption(x.snippetSuggestions);let r=cA.Inline;switch(o){case"top":r=cA.Top;break;case"bottom":r=cA.Bottom;break}const{itemKind:a,showDeprecated:c}=obe.createSuggestFilter(this._editor),l=new V3(r,e.completionOptions?.kindFilter??a,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,c),d=aX.create(this._editorWorkerService,this._editor),h=sMe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),l,n,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 FI(m,this._editor.getPosition(),e),b={...s3.default,firstMatchCanBeWeak:!this._editor.getOption(x.suggest).matchOnWordStartOnly};if(this._completionModel=new ex(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),b,p),this._completionDisposables.add(u.disposable),this._onNewContext(v),this._reportDurationsTelemetry(u.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const w of u.items)w.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${w.provider._debugDisplayName}`,w.completion)}).catch(vt)}_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 n=e.getOption(x.suggest);return n.showMethods||t.add(Ne.Method),n.showFunctions||t.add(Ne.Function),n.showConstructors||t.add(Ne.Constructor),n.showFields||t.add(Ne.Field),n.showVariables||t.add(Ne.Variable),n.showClasses||t.add(Ne.Class),n.showStructs||t.add(Ne.Struct),n.showInterfaces||t.add(Ne.Interface),n.showModules||t.add(Ne.Module),n.showProperties||t.add(Ne.Property),n.showEvents||t.add(Ne.Event),n.showOperators||t.add(Ne.Operator),n.showUnits||t.add(Ne.Unit),n.showValues||t.add(Ne.Value),n.showConstants||t.add(Ne.Constant),n.showEnums||t.add(Ne.Enum),n.showEnumMembers||t.add(Ne.EnumMember),n.showKeywords||t.add(Ne.Keyword),n.showWords||t.add(Ne.Text),n.showColors||t.add(Ne.Color),n.showFiles||t.add(Ne.File),n.showReferences||t.add(Ne.Reference),n.showColors||t.add(Ne.Customcolor),n.showFolders||t.add(Ne.Folder),n.showTypeParameters||t.add(Ne.TypeParameter),n.showSnippets||t.add(Ne.Snippet),n.showUsers||t.add(Ne.User),n.showIssues||t.add(Ne.Issue),{itemKind:t,showDeprecated:n.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(ho(e.leadingLineContent)!==ho(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(FI.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[n,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(n):t.set(n,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:$u.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 n=FI.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(n&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};cX=obe=D([_(1,Rl),_(2,ag),_(3,Yi),_(4,Ge),_(5,Le),_(6,Te),_(7,it),_(8,Za)],cX);class LMt{constructor(e,t,i,n){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!==lD.Idle){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(x.acceptSuggestionOnCommitCharacter)&&n(this._active.item)}}))}_onItem(e){if(!e||!eo(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new qj;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 Ese=class Ese{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(),n=i.length;let o=!1;for(let a=0;aEse._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 Sc?i.createInstance(v6,a,{useComma:!0}):void 0;this._leftActions=new ld(this.element,{actionViewItemProvider:r}),this._rightActions=new ld(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=[],n=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):n.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(n)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};abe=D([_(2,we),_(3,Oa),_(4,Le)],abe);var PMt=".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)}";ut(PMt,{});W("symbolIcon.arrayForeground",zi,g(9919,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.booleanForeground",zi,g(9920,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9921,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.colorForeground",zi,g(9922,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constantForeground",zi,g(9923,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9924,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9925,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9926,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},g(9927,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9928,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.fileForeground",zi,g(9929,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.folderForeground",zi,g(9930,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9931,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9932,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keyForeground",zi,g(9933,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.keywordForeground",zi,g(9934,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},g(9935,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.moduleForeground",zi,g(9936,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.namespaceForeground",zi,g(9937,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.nullForeground",zi,g(9938,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.numberForeground",zi,g(9939,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.objectForeground",zi,g(9940,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.operatorForeground",zi,g(9941,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.packageForeground",zi,g(9942,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.propertyForeground",zi,g(9943,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.referenceForeground",zi,g(9944,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.snippetForeground",zi,g(9945,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.stringForeground",zi,g(9946,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.structForeground",zi,g(9947,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.textForeground",zi,g(9948,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.typeParameterForeground",zi,g(9949,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.unitForeground",zi,g(9950,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));W("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},g(9951,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));class cMe{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 bn(0,0),this._minSize=new bn(0,0),this._maxSize=new bn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Pd(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:fi.VERTICAL}),this._westSash=new Pd(this.domNode,{getVerticalSashLeft:()=>0},{orientation:fi.VERTICAL}),this._northSash=new Pd(this.domNode,{getHorizontalSashTop:()=>0},{orientation:fi.HORIZONTAL,orthogonalEdge:iJ.North}),this._southSash=new Pd(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:fi.HORIZONTAL,orthogonalEdge:iJ.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(M.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(M.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(n=>{e&&(i=n.currentX-n.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(n=>{e&&(i=-(n.currentX-n.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(n=>{e&&(t=-(n.currentY-n.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(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(M.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(M.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{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,n){this._northSash.state=e?oa.Enabled:oa.Disabled,this._eastSash.state=t?oa.Enabled:oa.Disabled,this._southSash.state=i?oa.Enabled:oa.Disabled,this._westSash.state=n?oa.Enabled:oa.Disabled}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(r,t));const a=new bn(t,e);bn.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}}function lMe(s){return!!s&&!!(s.completion.documentation||s.completion.detail&&s.completion.detail!==s.completion.label)}let cbe=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 bn(330,0),this.domNode=fe(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(q_,{editor:e}),this._body=fe(".body"),this._scrollbar=new wU(this._body,{alwaysConsumeMouseWheel:!0}),re(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=re(this._body,fe(".header")),this._close=re(this._header,fe("span"+We.asCSSSelector(ve.close))),this._close.title=g(9952,"Close"),this._type=re(this._header,fe("p.type")),this._docs=re(this._body,fe("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(),n=e.get(x.suggestFontSize)||t.fontSize,o=e.get(x.suggestLineHeight)||t.lineHeight,r=t.fontWeight,a=`${n}px`,c=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/n}`,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(9953,"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:n}=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("")} -`,n=new Mt().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!yMe(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,Yh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Ms(this._type),this._type.title="",zd(this._type),this.domNode.classList.add("no-type");if(Ms(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Ms(this._docs);const o=this._markdownRenderer.render(n);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 bn(e,t);bn.equals(i,this._size)||(this._size=i,UGe(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}};fbe=D([_(1,we)],fbe);class qMt{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 wMe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let c=!1;a.west&&(r=n.width-a.dimension.width,c=!0),a.north&&(o=n.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,n=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 n=z_(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new bn(220,2*o.lineHeight),a=e.top,c=function(){const A=n.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),L=-o.borderWidth+e.left+e.width,k=new bn(A,n.height-e.top-o.borderHeight-o.verticalPadding),P=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:r.with(Math.min(A,r.width))}}(),l=function(){const A=e.left-o.borderWidth-o.horizontalPadding,L=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),k=new bn(A,n.height-e.top-o.borderHeight-o.verticalPadding),P=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:r.with(Math.min(A,r.width))}}(),d=function(){const A=e.left,L=-o.borderWidth+e.top+e.height,k=new bn(e.width-o.borderHeight,n.height-e.top-e.height-o.verticalPadding);return{top:L,left:A,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:r.with(k.width)}}(),h=[c,l,d],u=h.find(A=>A.fit>=0)??h.sort((A,L)=>L.fit-A.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 b;i?m<=u.maxSizeTop.height?(p=!0,b=u.maxSizeTop):(p=!1,b=u.maxSizeBottom):m<=u.maxSizeBottom.height?(p=!1,b=u.maxSizeBottom):(p=!0,b=u.maxSizeTop);let{top:w,left:y}=u;!p&&m>e.height&&(w=f-m);const C=this._editor.getDomNode();if(C){const A=C.getBoundingClientRect();w-=A.top,y-=A.left}this._applyTopLeft({left:y,top:w}),this._resizable.enableSashes(!p,u===c,p,u!==c),this._resizable.minSize=u.minSize,this._resizable.maxSize=b,this._resizable.layout(m,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const QMt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Mx(s,e,t,i,n){if(We.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(N.isUri(n))return[];const o=i===ba.ROOT_FOLDER?["rootfolder-icon"]:i===ba.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===pe.data)r=Mk.parseMetaData(t).get(Mk.META_DATA_LABEL);else{const a=t.path.match(QMt);a?(r=vK(a[2].toLowerCase()),a[1]&&o.push(`${vK(a[1].toLowerCase())}-name-dir-icon`)):r=vK(t.authority.toLowerCase())}if(i===ba.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===ba.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 b=this._editor.getOptions(),w=b.get(x.fontInfo),y=w.getMassagedFontFamily(),C=w.fontFeatureSettings,A=b.get(x.suggestFontSize)||w.fontSize,L=b.get(x.suggestLineHeight)||w.lineHeight,k=w.fontWeight,P=w.letterSpacing,R=`${A}px`,z=`${L}px`,G=`${P}px`;i.style.fontSize=R,i.style.fontWeight=k,i.style.letterSpacing=G,a.style.fontFamily=y,a.style.fontFeatureSettings=C,a.style.lineHeight=z,n.style.height=z,n.style.width=z,m.style.height=z,m.style.width=z}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.root.id=qXe(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:xU(e.score)},r=[];if(n.kind===Me.Color&&JMt.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(n.kind===Me.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),ba.FILE),c=Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),ba.FILE);o.extraClasses=a.length>c.length?a:c}else n.kind===Me.Folder&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),ba.FOLDER),Mx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),ba.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...We.asClassNameArray(v8.toIcon(n.kind))));n.tags&&n.tags.indexOf(I2.Deprecated)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=qhe(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=qhe(n.label.detail||""),i.detailsLabel.textContent=qhe(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?Yh(i.detailsLabel):zd(i.detailsLabel),yMe(e)?(i.right.classList.add("can-expand-details"),Yh(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"),zd(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};pbe=D([_(1,gi),_(2,xi),_(3,pn)],pbe);function qhe(s){return s.replace(/\r\n|\r|\n/g,"")}var MP;W("editorSuggestWidget.background",xh,g(5228,"Background color of the suggest widget."));W("editorSuggestWidget.border",r6,g(5229,"Border color of the suggest widget."));const XMt=W("editorSuggestWidget.foreground",Rl,g(5230,"Foreground color of the suggest widget."));W("editorSuggestWidget.selectedForeground",K8,g(5231,"Foreground color of the selected entry in the suggest widget."));W("editorSuggestWidget.selectedIconForeground",FTe,g(5232,"Icon foreground color of the selected entry in the suggest widget."));const ZMt=W("editorSuggestWidget.selectedBackground",q8,g(5233,"Background color of the selected entry in the suggest widget."));W("editorSuggestWidget.highlightForeground",nF,g(5234,"Color of the match highlights in the suggest widget."));W("editorSuggestWidget.focusHighlightForeground",upt,g(5235,"Color of the match highlights in the suggest widget when an item is focused."));W("editorSuggestWidgetStatus.foreground",st(XMt,.5),g(5236,"Foreground color of the suggest widget status."));var _n;(function(s){s[s.Hidden=0]="Hidden",s[s.Loading=1]="Loading",s[s.Empty=2]="Empty",s[s.Open=3]="Open",s[s.Frozen=4]="Frozen",s[s.Details=5]="Details",s[s.onDetailsKeyDown=6]="onDetailsKeyDown"})(_n||(_n={}));class eNt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof lf}`}restore(){const e=this._service.get(this._key,Ie.PROFILE)??"";try{const t=JSON.parse(e);if(bn.is(t))return bn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),Ie.PROFILE,an.MACHINE)}reset(){this._service.remove(this._key,Ie.PROFILE)}}var WD;let mbe=(WD=class{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=_n.Hidden,this._isAuto=!1,this._pendingLayout=new wn,this._pendingShowDetails=new wn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Cm,this._disposables=new Z,this._onDidSelect=new kk,this._onDidFocus=new kk,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 wMe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new tNt(this,e),this._persistedSize=new eNt(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:b}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-b)<=m)&&(b=a.persistedSize?.height??p.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=m)&&(v=a.persistedSize?.width??p.width),this._persistedSize.store(new bn(v,b))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=re(this.element.domNode,fe(".message")),this._listElement=re(this.element.domNode,fe(".tree"));const c=this._disposables.add(o.createInstance(fbe,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new qMt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=o.createInstance(pbe,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Xa("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(5239,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;if(typeof u.completion.label!="string"){const{detail:b,description:w}=u.completion.label;b&&w?f=g(5240,"{0} {1}, {2}",f,b,w):b?f=g(5241,"{0} {1}",f,b):w&&(f=g(5242,"{0}, {1}",f,w))}if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,v=$p("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g(5243,"{0}, docs: {1}",f,v)}}}),this._list.style(BN({listInactiveFocusBackground:ZMt,listInactiveFocusOutline:Js})),this._status=o.createInstance(gbe,this.element.domNode,hD);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(x.suggest).showStatusBar);h(),this._disposables.add(n.onDidColorThemeChange(u=>this._onThemeChange(u))),this._onThemeChange(n.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=Ui.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Ui.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Ui.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Ui.HasFocusedSuggestion.bindTo(i),this._disposables.add(Ro(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!==_n.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=Ry(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=Rr(async n=>{const o=jy(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),r=n.onCancellationRequested(()=>o.dispose());try{return await t.resolve(n)}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:qXe(i)}))}).catch(vt)),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===_n.Frozen),this.element.domNode.classList.remove("message"),e){case _n.Hidden:zd(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 _n.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=MP.LOADING_MESSAGE,zd(this._listElement,this._status.element),Yh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ah(MP.LOADING_MESSAGE);break;case _n.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=MP.NO_SUGGESTIONS_MESSAGE,zd(this._listElement,this._status.element),Yh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ah(MP.NO_SUGGESTIONS_MESSAGE);break;case _n.Open:zd(this._messageElement),Yh(this._listElement,this._status.element),this._show();break;case _n.Frozen:zd(this._messageElement),Yh(this._listElement,this._status.element),this._show();break;case _n.Details:zd(this._messageElement),Yh(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===_n.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=jy(()=>this._setState(_n.Loading),t)))}showSuggestions(e,t,i,n,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!==_n.Empty&&this._state!==_n.Hidden){this._setState(_n.Frozen);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(n?_n.Hidden:_n.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?_n.Frozen:_n.Open),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Uj(ct(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 _n.Hidden:return!1;case _n.Details:return this._details.widget.pageDown(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case _n.Hidden:return!1;case _n.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.scrollBottom(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.pageUp(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case _n.Hidden:return!1;case _n.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.scrollTop(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==_n.Hidden&&this._state!==_n.Empty&&this._state!==_n.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===_n.Details?(this._setState(_n.Open),this._details.widget.domNode.classList.remove("focused")):this._state===_n.Open&&this._isDetailsVisible()&&(this._setState(_n.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")):(yMe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===_n.Open||this._state===_n.Details||this._state===_n.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=Uj(ct(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(_n.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=Cr(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);n===this._cappedHeight?.capped&&(n=this._cappedHeight.wanted),nv&&(n=v),n>f||this._forceRenderingAbove&&p>150?(this._contentWidget.setPreference(es.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(es.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new bn(a,i.defaultSize.height),this.element.maxSize=new bn(r,v),this.element.minSize=new bn(220,l),this._cappedHeight=n===c?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(o,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,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]===es.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=Ka(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===_n.Empty||this._state===_n.Loading?0:t,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new bn(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",Ie.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,Ie.PROFILE,an.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},MP=WD,WD.LOADING_MESSAGE=g(5237,"Loading..."),WD.NO_SUGGESTIONS_MESSAGE=g(5238,"No suggestions."),WD);mbe=MP=D([_(1,$i),_(2,Le),_(3,pn),_(4,we)],mbe);class tNt{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:n}=this._widget.getLayoutInfo();return new bn(t+2*i+n,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 _be;class iNt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Gt.register({description:"suggest-line-suffix",stickiness:ni.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),o=e.getPositionAt(n+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(F.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 Wl;(function(s){s[s.None=0]="None",s[s.NoBeforeUndoStop=1]="NoBeforeUndoStop",s[s.NoAfterUndoStop=2]="NoAfterUndoStop",s[s.KeepAlternativeSuggestions=4]="KeepAlternativeSuggestions",s[s.AlternativeOverwriteConfig=8]="AlternativeOverwriteConfig"})(Wl||(Wl={}));var AL;let Xg=(AL=class{static get(e){return e.getContribution(_be.ID)}constructor(e,t,i,n,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new wn,this._toDispose=new Z,this._selectors=new nNt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(dX,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=Ui.InsertMode.bindTo(n);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 XV(ct(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(mbe,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Wl.None),this));const u=new VMt(this.editor,h,this.model,v=>this._insertSuggestion(v,Wl.NoAfterUndoStop));this._toDispose.add(u);const f=Ui.MakesTextEdit.bindTo(this._contextKeyService),p=Ui.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Ui.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ee(()=>{f.reset(),p.reset(),m.reset()})),this._toDispose.add(h.onDidFocus(({item:v})=>{const b=this.editor.getPosition(),w=v.editStart.column,y=b.column;let C=!0;this.editor.getOption(x.acceptSuggestionOnEnter)==="smart"&&this.model.state===uD.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&Yg.InsertAsSnippet)&&y-w===v.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:w,endLineNumber:b.lineNumber,endColumn:y})!==v.completion.insertText),f.set(C),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 Ih(!0,!1,!1,!1,S.KeyC))||Qt&&v.toKeyCodeChord().equals(new Ih(!1,!1,!1,!0,S.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new XV(ct(e.getDomNode()),()=>this._toDispose.add(new ube(this.editor,this.model)))),this._alternatives=this._toDispose.add(new XV(ct(e.getDomNode()),()=>this._toDispose.add(new bW(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(aX,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new iNt(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===uD.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!==Ku.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===Ku.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=Ui.AcceptSuggestionsOnEnter.bindTo(n),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=fc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:r}=e,a=[],c=new ci;t&Wl.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(r,!!(t&Wl.AlternativeOverwriteConfig));this._memoryService.memorize(n,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=vm.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let v=F.lift(m.range);if(v.startLineNumber===r.position.lineNumber&&v.startColumn>r.position.column){const b=this.editor.getPosition().column-r.position.column,w=b,y=F.spansMultipleLines(v)?0:b;v=new F(v.startLineNumber,v.startColumn+w,v.endLineNumber,v.endColumn+y)}return Zn.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new js;let m;const v=n.onDidChangeContent(C=>{if(C.isFlush){c.cancel(),v.dispose();return}for(const A of C.changes){const L=F.getEndPosition(A.range);(!m||oe.isBefore(L,m))&&(m=L)}}),b=t;t|=Wl.NoAfterUndoStop;let w=!1;const y=this.editor.onWillType(()=>{y.dispose(),w=!0,b&Wl.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(A=>oe.isBefore(m,F.getStartPosition(A.range))))return!1;w&&this.editor.pushUndoStop();const C=vm.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(A=>Zn.replaceMove(F.lift(A.range),A.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(w||!(b&Wl.NoAfterUndoStop))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),C),u=C===!0?1:C===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&Yg.InsertAsSnippet||(f=X_.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&Yg.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Wl.NoAfterUndoStop||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===hX.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new js;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?No(m):vt(m)}).finally(()=>{h=p.elapsed()}))}t&Wl.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(p,Wl.NoBeforeUndoStop|Wl.NoAfterUndoStop|(t&Wl.AlternativeOverwriteConfig?Wl.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,n,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,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:Wc(_i(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:vU(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:o})}getOverwriteInfo(e,t){Tt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const n=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:n+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(eo(e.completion.additionalTextEdits)){const t=g(1562,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Mr(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(),mt.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)},n=o=>{if(o.completion.insertTextRules&Yg.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};M.once(this.model.onDidTrigger)(o=>{const r=[];M.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{bt(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(bt(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(!n(l)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:l,model:a},Wl.KeepAlternativeSuggestions|Wl.NoBeforeUndoStop|Wl.NoAfterUndoStop)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,mt.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=Wl.KeepAlternativeSuggestions),t&&(n|=Wl.AlternativeOverwriteConfig),this._insertSuggestion(i,n)}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)}},_be=AL,AL.ID="editor.contrib.suggestController",AL);Xg=_be=D([_(1,cce),_(2,vi),_(3,Le),_(4,we),_(5,Ge),_(6,Yi)],Xg);class nNt{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 Tse=class Tse extends tt{constructor(){super({id:Tse.id,label:g(1563,"Trigger Suggest"),alias:"Trigger Suggest",precondition:he.and(J.writable,J.hasCompletionItemProvider,Ui.Visible.toNegated()),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.Alt|S.Escape,U.CtrlCmd|S.KeyI]},weight:Ae.EditorContrib}})}run(e,t,i){const n=Xg.get(t);if(!n)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),n.triggerSuggest(void 0,o,void 0)}};Tse.id="editor.action.triggerSuggest";let hX=Tse;on(Xg.ID,Xg,ri.BeforeFirstInteraction);Re(hX);const wp=Ae.EditorContrib+90,mu=hc.bindToContribution(Xg.get);qe(new mu({id:"acceptSelectedSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:S.Tab,kbExpr:he.and(Ui.Visible,J.textInputFocus),weight:wp},{primary:S.Enter,kbExpr:he.and(Ui.Visible,J.textInputFocus,Ui.AcceptSuggestionsOnEnter,Ui.MakesTextEdit),weight:wp}],menuOpts:[{menuId:hD,title:g(1564,"Insert"),group:"left",order:1,when:Ui.HasInsertAndReplaceRange.toNegated()},{menuId:hD,title:g(1564,"Insert"),group:"left",order:1,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("insert"))},{menuId:hD,title:g(1565,"Replace"),group:"left",order:1,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("replace"))}]}));qe(new mu({id:"acceptAlternativeSelectedSuggestion",precondition:he.and(Ui.Visible,J.textInputFocus,Ui.HasFocusedSuggestion),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.Shift|S.Enter,secondary:[U.Shift|S.Tab]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:hD,group:"left",order:2,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("insert")),title:g(1565,"Replace")},{menuId:hD,group:"left",order:2,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("replace")),title:g(1564,"Insert")}]}));_t.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");qe(new mu({id:"hideSuggestWidget",precondition:Ui.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new mu({id:"selectNextSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow,U.WinCtrl|S.KeyN]}}}));qe(new mu({id:"selectNextPageSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.PageDown,secondary:[U.CtrlCmd|S.PageDown]}}));qe(new mu({id:"selectLastSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));qe(new mu({id:"selectPrevSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow,U.WinCtrl|S.KeyP]}}}));qe(new mu({id:"selectPrevPageSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.PageUp,secondary:[U.CtrlCmd|S.PageUp]}}));qe(new mu({id:"selectFirstSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));qe(new mu({id:"focusSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.CtrlCmd|S.KeyI]}}}));qe(new mu({id:"focusAndAcceptSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));qe(new mu({id:"toggleSuggestionDetails",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.CtrlCmd|S.KeyI]}},menuOpts:[{menuId:hD,group:"right",order:1,when:he.and(Ui.DetailsVisible,Ui.CanResolve),title:g(1566,"show less")},{menuId:hD,group:"right",order:1,when:he.and(Ui.DetailsVisible.toNegated(),Ui.CanResolve),title:g(1567,"show more")}]}));qe(new mu({id:"toggleExplainMode",precondition:Ui.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Slash}}));qe(new mu({id:"toggleSuggestionFocus",precondition:Ui.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Alt|S.Space,mac:{primary:U.WinCtrl|U.Alt|S.Space}}}));qe(new mu({id:"insertBestCompletion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),aX.AtEnd,Ui.Visible.toNegated(),bW.OtherSuggestions.toNegated(),fc.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(kn(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:wp,primary:S.Tab}}));qe(new mu({id:"insertNextSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),bW.OtherSuggestions,Ui.Visible.toNegated(),fc.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:S.Tab}}));qe(new mu({id:"insertPrevSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),bW.OtherSuggestions,Ui.Visible.toNegated(),fc.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:wp,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));Re(class extends tt{constructor(){super({id:"editor.action.resetSuggestSize",label:g(1568,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){Xg.get(e)?.resetWidgetSize()}});class sNt extends V{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new I),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(o=>{o.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(o=>{o.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=Xg.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(a,c,l)=>{const d=this.editor.getModel();if(!d)return-1;const h=this.suggestControllerPreselector(),u=h?IT(h,d):void 0;if(!u)return-1;const f=oe.lift(c),p=l.map((v,b)=>{const w=O5.fromSuggestion(n,d,f,v,this.isShiftKeyPressed),y=IT(w.toSingleTextEdit(),d),C=VXe(u,y);return{index:b,valid:C,prefixLength:y.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=N1e(p,Cc(v=>v.prefixLength,nu));return m?m.index:-1}}));let o=!1;const r=()=>{o||(o=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(M.once(n.model.onDidTrigger)(a=>{r()})),this._register(n.onWillInsertSuggestItem(a=>{const c=this.editor.getPosition(),l=this.editor.getModel();if(!c||!l)return;const d=O5.fromSuggestion(n,l,c,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!oNt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=Xg.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();if(!(!t||!i||!n))return O5.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){Xg.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){Xg.get(this.editor)?.forceRenderingAbove()}}class O5{static fromSuggestion(e,t,i,n,o){let{insertText:r}=n.completion,a=!1;if(n.completion.insertTextRules&Yg.InsertAsSnippet){const l=new X_().parse(r);l.children.length<100&&rX.adjustWhitespace(t,i,!0,l),r=l.toString(),a=!0}const c=e.getOverwriteInfo(n,o);return new O5(F.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),r,n.completion.kind,a)}constructor(e,t,i,n){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new pGe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new au(this.range,this.insertText)}}function oNt(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var vbe,EL;let fu=(EL=class extends V{static get(e){return e.getContribution(vbe.ID)}constructor(e,t,i,n,o,r,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this._editorObs=Xh(this.editor),this._positions=Ze(this,u=>this._editorObs.selections.read(u)?.map(f=>f.getEndPosition())??[new oe(1,1)]),this._suggestWidgetAdaptor=this._register(new sNt(this.editor,()=>(this._editorObs.forceUpdate(),this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(void 0)),u=>this._editorObs.forceUpdate(f=>{this.model.get()?.handleSuggestAccepted(u)}))),this._suggestWidgetSelectedItem=Kn(this,u=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(f=>u(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=Kn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Kn(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=Ze(this,u=>this._enabledInConfig.read(u)&&(!this._isScreenReaderEnabled.read(u)||!this._editorDictationInProgress.read(u))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this.model=mh(this,u=>{if(this._editorObs.isReadonly.read(u))return;const f=this._editorObs.model.read(u);return f?this._instantiationService.createInstance(cbe,f,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).preview),Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).previewMode),Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=Ze(this,u=>this.model.read(u)?.ghostTexts.read(u)??[]),this._stablizedGhostTexts=rNt(this._ghostTexts,this._store),this._ghostTextWidgets=YY(this,this._stablizedGhostTexts,(u,f)=>f.add(this._instantiationService.createInstance(Zve,this.editor,{ghostText:u,minReservedLineCount:nd(0),targetTextModel:this.model.map(p=>p?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=gC(this),this._fontFamily=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._register(new ju(this._contextKeyService,this.model)),this._register(_ve(this._editorObs.onDidType,(u,f)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(this._commandService.onDidExecuteCommand(u=>{new Set([FO.Tab.id,FO.DeleteLeft.id,FO.DeleteRight.id,MXe,"acceptSelectedSuggestion"]).has(u.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(p=>{this.model.get()?.trigger(p)})})),this._register(_ve(this._editorObs.selections,(u,f)=>{f.some(p=>p.reason===Oi.Explicit||p.source==="api")&&this.model.get()?.stop()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(x.inlineSuggest).keepOnBlur||_W.dropDownVisible||ts(u=>{this.model.get()?.stop(u)})})),this._register(ai(u=>{const f=this.model.read(u)?.state.read(u);f?.suggestItem?f.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ee(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const h=b6(this,(u,f)=>{const m=this.model.read(u)?.state.read(u);return this._suggestWidgetSelectedItem.get()?f:m?.inlineCompletion?.semanticId});this._register(MIt(Ze(u=>(this._playAccessibilitySignal.read(u),h.read(u),{})),async(u,f,p)=>{const m=this.model.get(),v=m?.state.get();if(!v||!m)return;const b=m.textModel.getLineContent(v.primaryGhostText.lineNumber);await Sr(50,Zge(p)),await T5(this._suggestWidgetSelectedItem,Ya,()=>!1,Zge(p)),await this._accessibilitySignalService.playSignal(cl.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(b))})),this._register(new ebe(this.editor,this.model,this._instantiationService)),this._register(JRt(Ze(u=>{const f=this._fontFamily.read(u);return f===""||f==="default"?"":` +`,n=new Mt().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!lMe(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,jh(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else Ms(this._type),this._type.title="",Ud(this._type),this.domNode.classList.add("no-type");if(Ms(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Ms(this._docs);const o=this._markdownRenderer.render(n);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 bn(e,t);bn.equals(i,this._size)||(this._size=i,MGe(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}};cbe=D([_(1,we)],cbe);class FMt{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 cMe,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let c=!1;a.west&&(r=n.width-a.dimension.width,c=!0),a.north&&(o=n.height-a.dimension.height,c=!0),c&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,n=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 n=H_(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new bn(220,2*o.lineHeight),a=e.top,c=function(){const A=n.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),L=-o.borderWidth+e.left+e.width,k=new bn(A,n.height-e.top-o.borderHeight-o.verticalPadding),P=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:r.with(Math.min(A,r.width))}}(),l=function(){const A=e.left-o.borderWidth-o.horizontalPadding,L=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),k=new bn(A,n.height-e.top-o.borderHeight-o.verticalPadding),P=k.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:A-t.width,maxSizeTop:k,maxSizeBottom:P,minSize:r.with(Math.min(A,r.width))}}(),d=function(){const A=e.left,L=-o.borderWidth+e.top+e.height,k=new bn(e.width-o.borderHeight,n.height-e.top-e.height-o.verticalPadding);return{top:L,left:A,fit:k.height-t.height,maxSizeBottom:k,maxSizeTop:k,minSize:r.with(k.width)}}(),h=[c,l,d],u=h.find(A=>A.fit>=0)??h.sort((A,L)=>L.fit-A.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 b;i?m<=u.maxSizeTop.height?(p=!0,b=u.maxSizeTop):(p=!1,b=u.maxSizeBottom):m<=u.maxSizeBottom.height?(p=!1,b=u.maxSizeBottom):(p=!0,b=u.maxSizeTop);let{top:w,left:y}=u;!p&&m>e.height&&(w=f-m);const C=this._editor.getDomNode();if(C){const A=C.getBoundingClientRect();w-=A.top,y-=A.left}this._applyTopLeft({left:y,top:w}),this._resizable.enableSashes(!p,u===c,p,u!==c),this._resizable.minSize=u.minSize,this._resizable.maxSize=b,this._resizable.layout(m,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const OMt=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function Tx(s,e,t,i,n){if(We.isThemeIcon(n))return[`codicon-${n.id}`,"predefined-file-icon"];if(N.isUri(n))return[];const o=i===ba.ROOT_FOLDER?["rootfolder-icon"]:i===ba.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===pe.data)r=kk.parseMetaData(t).get(kk.META_DATA_LABEL);else{const a=t.path.match(OMt);a?(r=pK(a[2].toLowerCase()),a[1]&&o.push(`${pK(a[1].toLowerCase())}-name-dir-icon`)):r=pK(t.authority.toLowerCase())}if(i===ba.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===ba.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 b=this._editor.getOptions(),w=b.get(x.fontInfo),y=w.getMassagedFontFamily(),C=w.fontFeatureSettings,A=b.get(x.suggestFontSize)||w.fontSize,L=b.get(x.suggestLineHeight)||w.lineHeight,k=w.fontWeight,P=w.letterSpacing,R=`${A}px`,z=`${L}px`,G=`${P}px`;i.style.fontSize=R,i.style.fontWeight=k,i.style.letterSpacing=G,a.style.fontFamily=y,a.style.fontFeatureSettings=C,a.style.lineHeight=z,n.style.height=z,n.style.width=z,m.style.height=z,m.style.width=z}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.root.id=WXe(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:yU(e.score)},r=[];if(n.kind===Ne.Color&&HMt.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(n.kind===Ne.File&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=Tx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),ba.FILE),c=Tx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),ba.FILE);o.extraClasses=a.length>c.length?a:c}else n.kind===Ne.Folder&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[Tx(this._modelService,this._languageService,N.from({scheme:"fake",path:e.textLabel}),ba.FOLDER),Tx(this._modelService,this._languageService,N.from({scheme:"fake",path:n.detail}),ba.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...We.asClassNameArray(p8.toIcon(n.kind))));n.tags&&n.tags.indexOf(E2.Deprecated)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof n.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=Hhe(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=Hhe(n.label.detail||""),i.detailsLabel.textContent=Hhe(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(x.suggest).showInlineDetails?jh(i.detailsLabel):Ud(i.detailsLabel),lMe(e)?(i.right.classList.add("can-expand-details"),jh(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"),Ud(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};lbe=D([_(1,gi),_(2,xi),_(3,pn)],lbe);function Hhe(s){return s.replace(/\r\n|\r|\n/g,"")}var TP;W("editorSuggestWidget.background",Ah,g(5228,"Background color of the suggest widget."));W("editorSuggestWidget.border",i6,g(5229,"Border color of the suggest widget."));const UMt=W("editorSuggestWidget.foreground",Ll,g(5230,"Foreground color of the suggest widget."));W("editorSuggestWidget.selectedForeground",z8,g(5231,"Foreground color of the selected entry in the suggest widget."));W("editorSuggestWidget.selectedIconForeground",ATe,g(5232,"Icon foreground color of the selected entry in the suggest widget."));const VMt=W("editorSuggestWidget.selectedBackground",$8,g(5233,"Background color of the selected entry in the suggest widget."));W("editorSuggestWidget.highlightForeground",ZP,g(5234,"Color of the match highlights in the suggest widget."));W("editorSuggestWidget.focusHighlightForeground",tpt,g(5235,"Color of the match highlights in the suggest widget when an item is focused."));W("editorSuggestWidgetStatus.foreground",st(UMt,.5),g(5236,"Foreground color of the suggest widget status."));var _n;(function(s){s[s.Hidden=0]="Hidden",s[s.Loading=1]="Loading",s[s.Empty=2]="Empty",s[s.Open=3]="Open",s[s.Frozen=4]="Frozen",s[s.Details=5]="Details",s[s.onDetailsKeyDown=6]="onDetailsKeyDown"})(_n||(_n={}));class zMt{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof rf}`}restore(){const e=this._service.get(this._key,Ie.PROFILE)??"";try{const t=JSON.parse(e);if(bn.is(t))return bn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),Ie.PROFILE,an.MACHINE)}reset(){this._service.remove(this._key,Ie.PROFILE)}}var ND;let dbe=(ND=class{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=_n.Hidden,this._isAuto=!1,this._pendingLayout=new wn,this._pendingShowDetails=new wn,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new bm,this._disposables=new Z,this._onDidSelect=new Sk,this._onDidFocus=new Sk,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 cMe,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new $Mt(this,e),this._persistedSize=new zMt(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:b}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-b)<=m)&&(b=a.persistedSize?.height??p.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=m)&&(v=a.persistedSize?.width??p.width),this._persistedSize.store(new bn(v,b))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=re(this.element.domNode,fe(".message")),this._listElement=re(this.element.domNode,fe(".tree"));const c=this._disposables.add(o.createInstance(cbe,this.editor));c.onDidClose(this.toggleDetails,this,this._disposables),this._details=new FMt(c,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(x.suggest).showIcons);l();const d=o.createInstance(lbe,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new Xa("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(5239,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;if(typeof u.completion.label!="string"){const{detail:b,description:w}=u.completion.label;b&&w?f=g(5240,"{0} {1}, {2}",f,b,w):b?f=g(5241,"{0} {1}",f,b):w&&(f=g(5242,"{0}, {1}",f,w))}if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,v=Up("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return g(5243,"{0}, docs: {1}",f,v)}}}),this._list.style(NN({listInactiveFocusBackground:VMt,listInactiveFocusOutline:Js})),this._status=o.createInstance(abe,this.element.domNode,cD);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(x.suggest).showStatusBar);h(),this._disposables.add(n.onDidColorThemeChange(u=>this._onThemeChange(u))),this._onThemeChange(n.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=Ui.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Ui.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Ui.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Ui.HasFocusedSuggestion.bindTo(i),this._disposables.add(Ro(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!==_n.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=Iy(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=Rr(async n=>{const o=Ky(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),r=n.onCancellationRequested(()=>o.dispose());try{return await t.resolve(n)}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:WXe(i)}))}).catch(vt)),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===_n.Frozen),this.element.domNode.classList.remove("message"),e){case _n.Hidden:Ud(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 _n.Loading:this.element.domNode.classList.add("message"),this._messageElement.textContent=TP.LOADING_MESSAGE,Ud(this._listElement,this._status.element),jh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ch(TP.LOADING_MESSAGE);break;case _n.Empty:this.element.domNode.classList.add("message"),this._messageElement.textContent=TP.NO_SUGGESTIONS_MESSAGE,Ud(this._listElement,this._status.element),jh(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Ch(TP.NO_SUGGESTIONS_MESSAGE);break;case _n.Open:Ud(this._messageElement),jh(this._listElement,this._status.element),this._show();break;case _n.Frozen:Ud(this._messageElement),jh(this._listElement,this._status.element),this._show();break;case _n.Details:Ud(this._messageElement),jh(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===_n.Hidden&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Ky(()=>this._setState(_n.Loading),t)))}showSuggestions(e,t,i,n,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!==_n.Empty&&this._state!==_n.Hidden){this._setState(_n.Frozen);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(n?_n.Hidden:_n.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?_n.Frozen:_n.Open),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Wj(ct(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 _n.Hidden:return!1;case _n.Details:return this._details.widget.pageDown(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case _n.Hidden:return!1;case _n.Loading:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.scrollBottom(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.pageUp(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case _n.Hidden:return!1;case _n.Loading:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case _n.Hidden:return!1;case _n.Details:return this._details.widget.scrollTop(),!0;case _n.Loading:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==_n.Hidden&&this._state!==_n.Empty&&this._state!==_n.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===_n.Details?(this._setState(_n.Open),this._details.widget.domNode.classList.remove("focused")):this._state===_n.Open&&this._isDetailsVisible()&&(this._setState(_n.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")):(lMe(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===_n.Open||this._state===_n.Details||this._state===_n.Frozen)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=Wj(ct(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(_n.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=Cr(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);n===this._cappedHeight?.capped&&(n=this._cappedHeight.wanted),nv&&(n=v),n>f||this._forceRenderingAbove&&p>150?(this._contentWidget.setPreference(es.ABOVE),this.element.enableSashes(!0,!0,!1,!1),v=m):(this._contentWidget.setPreference(es.BELOW),this.element.enableSashes(!1,!0,!0,!1),v=f),this.element.preferredSize=new bn(a,i.defaultSize.height),this.element.maxSize=new bn(r,v),this.element.minSize=new bn(220,l),this._cappedHeight=n===c?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(o,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,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]===es.BELOW)}getLayoutInfo(){const e=this.editor.getOption(x.fontInfo),t=Ka(this.editor.getOption(x.suggestLineHeight)||e.lineHeight,8,1e3),i=!this.editor.getOption(x.suggest).showStatusBar||this._state===_n.Empty||this._state===_n.Loading?0:t,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new bn(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",Ie.PROFILE,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,Ie.PROFILE,an.USER)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},TP=ND,ND.LOADING_MESSAGE=g(5237,"Loading..."),ND.NO_SUGGESTIONS_MESSAGE=g(5238,"No suggestions."),ND);dbe=TP=D([_(1,$i),_(2,Le),_(3,pn),_(4,we)],dbe);class $Mt{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:n}=this._widget.getLayoutInfo();return new bn(t+2*i+n,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 hbe;class GMt{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Gt.register({description:"suggest-line-suffix",stickiness:ni.NeverGrowsWhenTypingAtEdges}),e.getLineMaxColumn(t.lineNumber)!==t.column){const n=e.getOffsetAt(t),o=e.getPositionAt(n+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(F.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 Bl;(function(s){s[s.None=0]="None",s[s.NoBeforeUndoStop=1]="NoBeforeUndoStop",s[s.NoAfterUndoStop=2]="NoAfterUndoStop",s[s.KeepAlternativeSuggestions=4]="KeepAlternativeSuggestions",s[s.AlternativeOverwriteConfig=8]="AlternativeOverwriteConfig"})(Bl||(Bl={}));var wL;let jg=(wL=class{static get(e){return e.getContribution(hbe.ID)}constructor(e,t,i,n,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new wn,this._toDispose=new Z,this._selectors=new KMt(h=>h.priority),this._onWillInsertSuggestItem=new I,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(cX,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const c=Ui.InsertMode.bindTo(n);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 jV(ct(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(dbe,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(v=>this._insertSuggestion(v,Bl.None),this));const u=new LMt(this.editor,h,this.model,v=>this._insertSuggestion(v,Bl.NoAfterUndoStop));this._toDispose.add(u);const f=Ui.MakesTextEdit.bindTo(this._contextKeyService),p=Ui.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=Ui.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Ee(()=>{f.reset(),p.reset(),m.reset()})),this._toDispose.add(h.onDidFocus(({item:v})=>{const b=this.editor.getPosition(),w=v.editStart.column,y=b.column;let C=!0;this.editor.getOption(x.acceptSuggestionOnEnter)==="smart"&&this.model.state===lD.Auto&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&qg.InsertAsSnippet)&&y-w===v.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:w,endLineNumber:b.lineNumber,endColumn:y})!==v.completion.insertText),f.set(C),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 Dh(!0,!1,!1,!1,S.KeyC))||Qt&&v.toKeyCodeChord().equals(new Dh(!1,!1,!1,!0,S.KeyC))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),h})),this._overtypingCapturer=this._toDispose.add(new jV(ct(e.getDomNode()),()=>this._toDispose.add(new rbe(this.editor,this.model)))),this._alternatives=this._toDispose.add(new jV(ct(e.getDomNode()),()=>this._toDispose.add(new pW(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(oX,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new GMt(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===lD.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!==$u.TriggerCharacter:p.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===$u.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=Ui.AcceptSuggestionsOnEnter.bindTo(n),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=fc.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:r}=e,a=[],c=new ci;t&Bl.NoBeforeUndoStop||this.editor.pushUndoStop();const l=this.getOverwriteInfo(r,!!(t&Bl.AlternativeOverwriteConfig));this._memoryService.memorize(n,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=pm.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let v=F.lift(m.range);if(v.startLineNumber===r.position.lineNumber&&v.startColumn>r.position.column){const b=this.editor.getPosition().column-r.position.column,w=b,y=F.spansMultipleLines(v)?0:b;v=new F(v.startLineNumber,v.startColumn+w,v.endLineNumber,v.endColumn+y)}return Zn.replaceMove(v,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new js;let m;const v=n.onDidChangeContent(C=>{if(C.isFlush){c.cancel(),v.dispose();return}for(const A of C.changes){const L=F.getEndPosition(A.range);(!m||oe.isBefore(L,m))&&(m=L)}}),b=t;t|=Bl.NoAfterUndoStop;let w=!1;const y=this.editor.onWillType(()=>{y.dispose(),w=!0,b&Bl.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(A=>oe.isBefore(m,F.getStartPosition(A.range))))return!1;w&&this.editor.pushUndoStop();const C=pm.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(A=>Zn.replaceMove(F.lift(A.range),A.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(w||!(b&Bl.NoAfterUndoStop))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),C),u=C===!0?1:C===!1?0:-2}).finally(()=>{v.dispose(),y.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&qg.InsertAsSnippet||(f=j_.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&qg.KeepWhitespace),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&Bl.NoAfterUndoStop||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===lX.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new js;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?No(m):vt(m)}).finally(()=>{h=p.elapsed()}))}t&Bl.KeepAlternativeSuggestions&&this._alternatives.value.set(e,p=>{for(c.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(p,Bl.NoBeforeUndoStop|Bl.NoAfterUndoStop|(t&Bl.AlternativeOverwriteConfig?Bl.AlternativeOverwriteConfig:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,n,d,h,u),this.model.clear(),c.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,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:Wc(_i(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:gU(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:o})}getOverwriteInfo(e,t){Tt(this.editor.hasModel());let i=this.editor.getOption(x.suggest).insertMode==="replace";t&&(i=!i);const n=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:n+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(eo(e.completion.additionalTextEdits)){const t=g(1562,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Mr(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(),mt.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)},n=o=>{if(o.completion.insertTextRules&qg.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};M.once(this.model.onDidTrigger)(o=>{const r=[];M.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{bt(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(bt(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(!n(l)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:c,item:l,model:a},Bl.KeepAlternativeSuggestions|Bl.NoBeforeUndoStop|Bl.NoAfterUndoStop)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,mt.Smooth),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=Bl.KeepAlternativeSuggestions),t&&(n|=Bl.AlternativeOverwriteConfig),this._insertSuggestion(i,n)}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)}},hbe=wL,wL.ID="editor.contrib.suggestController",wL);jg=hbe=D([_(1,sce),_(2,vi),_(3,Le),_(4,we),_(5,Ge),_(6,Yi)],jg);class KMt{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 xse=class xse extends tt{constructor(){super({id:xse.id,label:g(1563,"Trigger Suggest"),alias:"Trigger Suggest",precondition:he.and(J.writable,J.hasCompletionItemProvider,Ui.Visible.toNegated()),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.Alt|S.Escape,U.CtrlCmd|S.KeyI]},weight:Ae.EditorContrib}})}run(e,t,i){const n=jg.get(t);if(!n)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),n.triggerSuggest(void 0,o,void 0)}};xse.id="editor.action.triggerSuggest";let lX=xse;on(jg.ID,jg,ri.BeforeFirstInteraction);Me(lX);const _p=Ae.EditorContrib+90,pu=hc.bindToContribution(jg.get);qe(new pu({id:"acceptSelectedSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion),handler(s){s.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:S.Tab,kbExpr:he.and(Ui.Visible,J.textInputFocus),weight:_p},{primary:S.Enter,kbExpr:he.and(Ui.Visible,J.textInputFocus,Ui.AcceptSuggestionsOnEnter,Ui.MakesTextEdit),weight:_p}],menuOpts:[{menuId:cD,title:g(1564,"Insert"),group:"left",order:1,when:Ui.HasInsertAndReplaceRange.toNegated()},{menuId:cD,title:g(1564,"Insert"),group:"left",order:1,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("insert"))},{menuId:cD,title:g(1565,"Replace"),group:"left",order:1,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("replace"))}]}));qe(new pu({id:"acceptAlternativeSelectedSuggestion",precondition:he.and(Ui.Visible,J.textInputFocus,Ui.HasFocusedSuggestion),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:U.Shift|S.Enter,secondary:[U.Shift|S.Tab]},handler(s){s.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:cD,group:"left",order:2,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("insert")),title:g(1565,"Replace")},{menuId:cD,group:"left",order:2,when:he.and(Ui.HasInsertAndReplaceRange,Ui.InsertMode.isEqualTo("replace")),title:g(1564,"Insert")}]}));_t.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");qe(new pu({id:"hideSuggestWidget",precondition:Ui.Visible,handler:s=>s.cancelSuggestWidget(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new pu({id:"selectNextSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectNextSuggestion(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow,U.WinCtrl|S.KeyN]}}}));qe(new pu({id:"selectNextPageSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectNextPageSuggestion(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:S.PageDown,secondary:[U.CtrlCmd|S.PageDown]}}));qe(new pu({id:"selectLastSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectLastSuggestion()}));qe(new pu({id:"selectPrevSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevSuggestion(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow,U.WinCtrl|S.KeyP]}}}));qe(new pu({id:"selectPrevPageSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectPrevPageSuggestion(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:S.PageUp,secondary:[U.CtrlCmd|S.PageUp]}}));qe(new pu({id:"selectFirstSuggestion",precondition:he.and(Ui.Visible,he.or(Ui.MultipleSuggestions,Ui.HasFocusedSuggestion.negate())),handler:s=>s.selectFirstSuggestion()}));qe(new pu({id:"focusSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion.negate()),handler:s=>s.focusSuggestion(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.CtrlCmd|S.KeyI]}}}));qe(new pu({id:"focusAndAcceptSuggestion",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion.negate()),handler:s=>{s.focusSuggestion(),s.acceptSelectedSuggestion(!0,!1)}}));qe(new pu({id:"toggleSuggestionDetails",precondition:he.and(Ui.Visible,Ui.HasFocusedSuggestion),handler:s=>s.toggleSuggestionDetails(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Space,secondary:[U.CtrlCmd|S.KeyI],mac:{primary:U.WinCtrl|S.Space,secondary:[U.CtrlCmd|S.KeyI]}},menuOpts:[{menuId:cD,group:"right",order:1,when:he.and(Ui.DetailsVisible,Ui.CanResolve),title:g(1566,"show less")},{menuId:cD,group:"right",order:1,when:he.and(Ui.DetailsVisible.toNegated(),Ui.CanResolve),title:g(1567,"show more")}]}));qe(new pu({id:"toggleExplainMode",precondition:Ui.Visible,handler:s=>s.toggleExplainMode(),kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Slash}}));qe(new pu({id:"toggleSuggestionFocus",precondition:Ui.Visible,handler:s=>s.toggleSuggestionFocus(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Alt|S.Space,mac:{primary:U.WinCtrl|U.Alt|S.Space}}}));qe(new pu({id:"insertBestCompletion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),oX.AtEnd,Ui.Visible.toNegated(),pW.OtherSuggestions.toNegated(),fc.InSnippetMode.toNegated()),handler:(s,e)=>{s.triggerSuggestAndAcceptBest(kn(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:_p,primary:S.Tab}}));qe(new pu({id:"insertNextSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),pW.OtherSuggestions,Ui.Visible.toNegated(),fc.InSnippetMode.toNegated()),handler:s=>s.acceptNextSuggestion(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:S.Tab}}));qe(new pu({id:"insertPrevSuggestion",precondition:he.and(J.textInputFocus,he.equals("config.editor.tabCompletion","on"),pW.OtherSuggestions,Ui.Visible.toNegated(),fc.InSnippetMode.toNegated()),handler:s=>s.acceptPrevSuggestion(),kbOpts:{weight:_p,kbExpr:J.textInputFocus,primary:U.Shift|S.Tab}}));Me(class extends tt{constructor(){super({id:"editor.action.resetSuggestSize",label:g(1568,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(s,e){jg.get(e)?.resetWidgetSize()}});class qMt extends V{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new I),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(o=>{o.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(o=>{o.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=jg.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(a,c,l)=>{const d=this.editor.getModel();if(!d)return-1;const h=this.suggestControllerPreselector(),u=h?ET(h,d):void 0;if(!u)return-1;const f=oe.lift(c),p=l.map((v,b)=>{const w=N5.fromSuggestion(n,d,f,v,this.isShiftKeyPressed),y=ET(w.toSingleTextEdit(),d),C=NXe(u,y);return{index:b,valid:C,prefixLength:y.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),m=C1e(p,Cc(v=>v.prefixLength,iu));return m?m.index:-1}}));let o=!1;const r=()=>{o||(o=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(M.once(n.model.onDidTrigger)(a=>{r()})),this._register(n.onWillInsertSuggestItem(a=>{const c=this.editor.getPosition(),l=this.editor.getModel();if(!c||!l)return;const d=N5.fromSuggestion(n,l,c,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!QMt(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=jg.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();if(!(!t||!i||!n))return N5.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){jg.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){jg.get(this.editor)?.forceRenderingAbove()}}class N5{static fromSuggestion(e,t,i,n,o){let{insertText:r}=n.completion,a=!1;if(n.completion.insertTextRules&qg.InsertAsSnippet){const l=new j_().parse(r);l.children.length<100&&sX.adjustWhitespace(t,i,!0,l),r=l.toString(),a=!0}const c=e.getOverwriteInfo(n,o);return new N5(F.fromPositions(i.delta(0,-c.overwriteBefore),i.delta(0,Math.max(c.overwriteAfter,0))),r,n.completion.kind,a)}constructor(e,t,i,n){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new aGe(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new ru(this.range,this.insertText)}}function QMt(s,e){return s===e?!0:!s||!e?!1:s.equals(e)}var ube,yL;let gu=(yL=class extends V{static get(e){return e.getContribution(ube.ID)}constructor(e,t,i,n,o,r,a,c,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=c,this._keybindingService=l,this._accessibilityService=d,this._editorObs=Jh(this.editor),this._positions=Ze(this,u=>this._editorObs.selections.read(u)?.map(f=>f.getEndPosition())??[new oe(1,1)]),this._suggestWidgetAdaptor=this._register(new qMt(this.editor,()=>(this._editorObs.forceUpdate(),this.model.get()?.selectedInlineCompletion.get()?.toSingleTextEdit(void 0)),u=>this._editorObs.forceUpdate(f=>{this.model.get()?.handleSuggestAccepted(u)}))),this._suggestWidgetSelectedItem=Kn(this,u=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(f=>u(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).enabled),this._isScreenReaderEnabled=Kn(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Kn(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=Ze(this,u=>this._enabledInConfig.read(u)&&(!this._isScreenReaderEnabled.read(u)||!this._editorDictationInProgress.read(u))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this.model=fh(this,u=>{if(this._editorObs.isReadonly.read(u))return;const f=this._editorObs.model.read(u);return f?this._instantiationService.createInstance(ibe,f,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).preview),Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.suggest).previewMode),Kn(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=Ze(this,u=>this.model.read(u)?.ghostTexts.read(u)??[]),this._stablizedGhostTexts=jMt(this._ghostTexts,this._store),this._ghostTextWidgets=QY(this,this._stablizedGhostTexts,(u,f)=>f.add(this._instantiationService.createInstance(qve,this.editor,{ghostText:u,minReservedLineCount:td(0),targetTextModel:this.model.map(p=>p?.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=lC(this),this._fontFamily=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineSuggest).fontFamily),this._register(new qu(this._contextKeyService,this.model)),this._register(hve(this._editorObs.onDidType,(u,f)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(this._commandService.onDidExecuteCommand(u=>{new Set([RO.Tab.id,RO.DeleteLeft.id,RO.DeleteRight.id,EXe,"acceptSelectedSuggestion"]).has(u.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(p=>{this.model.get()?.trigger(p)})})),this._register(hve(this._editorObs.selections,(u,f)=>{f.some(p=>p.reason===Oi.Explicit||p.source==="api")&&this.model.get()?.stop()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(x.inlineSuggest).keepOnBlur||gW.dropDownVisible||ts(u=>{this.model.get()?.stop(u)})})),this._register(ai(u=>{const f=this.model.read(u)?.state.read(u);f?.suggestItem?f.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Ee(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const h=p6(this,(u,f)=>{const m=this.model.read(u)?.state.read(u);return this._suggestWidgetSelectedItem.get()?f:m?.inlineCompletion?.semanticId});this._register(CIt(Ze(u=>(this._playAccessibilitySignal.read(u),h.read(u),{})),async(u,f,p)=>{const m=this.model.get(),v=m?.state.get();if(!v||!m)return;const b=m.textModel.getLineContent(v.primaryGhostText.lineNumber);await Sr(50,qge(p)),await D5(this._suggestWidgetSelectedItem,Ya,()=>!1,qge(p)),await this._accessibilitySignalService.playSignal(al.inlineSuggestion),this.editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(b))})),this._register(new Qve(this.editor,this.model,this._instantiationService)),this._register(HRt(Ze(u=>{const f=this._fontFamily.read(u);return f===""||f==="default"?"":` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${f}; -}`}))),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.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 n;!t&&i&&this.editor.getOption(x.inlineCompletionsAccessibilityVerbose)&&(n=g(5093,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Mr(n?e+", "+n: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(){ts(e=>{this.model.get()?.stop(e)})}},vbe=EL,EL.ID="editor.contrib.inlineCompletionsController",EL);fu=vbe=D([_(1,we),_(2,Le),_(3,Te),_(4,vi),_(5,Sp),_(6,it),_(7,lv),_(8,Ut),_(9,mr)],fu);function rNt(s,e){const t=jt("result",[]),i=[];return e.add(ai(n=>{const o=s.read(n);ts(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[c],r))})})),t}const G6={id:_e.AccessibleView,group:"navigation",when:bp},K6={id:_e.CommandPalette,group:"",order:1};class aNt extends li{constructor(){super({id:Xd.ShowNext,precondition:he.and(bp,XJ),keybinding:{primary:U.Alt|S.BracketRight,weight:Ae.WorkbenchContrib},menu:[K6,{...G6,when:he.and(bp,XJ)}],icon:ve.arrowDown,title:g(10002,"Show Next in Accessible View")})}run(e){e.get(Dm).next()}}At(aNt);class cNt extends li{constructor(){super({id:Xd.NextCodeBlock,precondition:he.and(eX,he.equals(ZJ.key,Pb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageDown,mac:{primary:U.CtrlCmd|U.Alt|S.PageDown},weight:Ae.WorkbenchContrib},icon:ve.arrowRight,menu:{...G6,when:he.and(bp,eX)},title:g(10003,"Accessible View: Next Code Block")})}run(e){e.get(Dm).navigateToCodeBlock("next")}}At(cNt);class lNt extends li{constructor(){super({id:Xd.PreviousCodeBlock,precondition:he.and(eX,he.equals(ZJ.key,Pb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageUp,mac:{primary:U.CtrlCmd|U.Alt|S.PageUp},weight:Ae.WorkbenchContrib},icon:ve.arrowLeft,menu:{...G6,when:he.and(bp,eX)},title:g(10004,"Accessible View: Previous Code Block")})}run(e){e.get(Dm).navigateToCodeBlock("previous")}}At(lNt);class dNt extends li{constructor(){super({id:Xd.ShowPrevious,precondition:he.and(bp,XJ),keybinding:{primary:U.Alt|S.BracketLeft,weight:Ae.WorkbenchContrib},icon:ve.arrowUp,menu:[K6,{...G6,when:he.and(bp,XJ)}],title:g(10005,"Show Previous in Accessible View")})}run(e){e.get(Dm).previous()}}At(dNt);class hNt extends li{constructor(){super({id:Xd.GoToSymbol,precondition:he.and(he.or(bp,NA),THe),keybinding:{primary:U.CtrlCmd|U.Shift|S.KeyO,secondary:[U.CtrlCmd|U.Shift|S.Period],weight:Ae.WorkbenchContrib+10},icon:ve.symbolField,menu:[K6,{...G6,when:he.and(he.or(bp,NA),THe)}],title:g(10006,"Go To Symbol in Accessible View")})}run(e){e.get(Dm).goToSymbol()}}At(hNt);function QXe(s){return s.register(),s}QXe(new wI({id:Xd.OpenAccessibilityHelp,precondition:void 0,kbOpts:{primary:U.Alt|S.F1,weight:Ae.WorkbenchContrib,linux:{primary:U.Alt|U.Shift|S.F1,secondary:[U.Alt|S.F1]},kbExpr:NA.toNegated()},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10007,"Open Accessibility Help"),order:1}]}));const uNt=QXe(new wI({id:Xd.OpenAccessibleView,precondition:void 0,kbOpts:{primary:U.Alt|S.F2,weight:Ae.WorkbenchContrib,linux:{primary:U.Alt|U.Shift|S.F2,secondary:[U.Alt|S.F2]}},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10008,"Open Accessible View"),order:1}]}));class gNt extends li{constructor(){super({id:Xd.DisableVerbosityHint,precondition:he.and(he.or(bp,NA),IHe),keybinding:{primary:U.Alt|S.F6,weight:Ae.WorkbenchContrib},icon:ve.bellSlash,menu:[K6,{id:_e.AccessibleView,group:"navigation",when:he.and(he.or(bp,NA),IHe)}],title:g(10009,"Disable Accessible View Hint")})}run(e){e.get(Dm).disableHint()}}At(gNt);class fNt extends li{constructor(){super({id:Xd.AccessibilityHelpConfigureKeybindings,precondition:he.and(NA,LHe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyK,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:3,when:LHe}],title:g(10010,"Accessibility Help Configure Unassigned Keybindings")})}async run(e){await e.get(Dm).configureKeybindings(!0)}}At(fNt);class pNt extends li{constructor(){super({id:Xd.AccessibilityHelpConfigureAssignedKeybindings,precondition:he.and(NA,RHe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyA,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:4,when:RHe}],title:g(10011,"Accessibility Help Configure Assigned Keybindings")})}async run(e){await e.get(Dm).configureKeybindings(!1)}}At(pNt);class mNt extends li{constructor(){super({id:Xd.AccessibilityHelpOpenHelpLink,precondition:he.and(NA),keybinding:{primary:U.Alt|S.KeyH,weight:Ae.WorkbenchContrib},title:g(10012,"Accessibility Help Open Help Link")})}run(e){e.get(Dm).openHelpLink()}}At(mNt);class _Nt extends li{constructor(){super({id:Xd.AccessibleViewAcceptInlineCompletion,precondition:he.and(bp,he.equals(ZJ.key,Pb.InlineCompletions)),keybinding:{primary:U.CtrlCmd|S.Slash,mac:{primary:U.WinCtrl|S.Slash},weight:Ae.WorkbenchContrib},icon:ve.check,menu:[K6,{id:_e.AccessibleView,group:"navigation",order:0,when:he.and(bp,he.equals(ZJ.key,Pb.InlineCompletions))}],title:g(10013,"Accept Inline Completion")})}async run(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=fu.get(i)?.model.get(),o=n?.state.get();!n||!o||(await n.accept(i),n.stop(),i.focus())}}At(_Nt);const iUe=new Q("chatSessionResponseVote","",{type:"string",description:g(7024,"When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.")}),vNt=new Q("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(7025,"When the agent or command was automatically detected")}),bNt=new Q("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(7026,"True when the current chat response supports issue reporting.")}),jXe=new Q("chatSessionResponseFiltered",!1,{type:"boolean",description:g(7027,"True when the chat response was filtered out by the server.")}),K3=new Q("chatSessionRequestInProgress",!1,{type:"boolean",description:g(7028,"True when the current request is still in progress.")}),wNt=new Q("chatResponse",!1,{type:"boolean",description:g(7029,"The chat item is a response.")}),yNt=new Q("chatRequest",!1,{type:"boolean",description:g(7030,"The chat item is a request")}),CNt=new Q("chatEditApplied",!1,{type:"boolean",description:g(7031,"True when the chat text edits have been applied.")}),CMe=new Q("chatInputHasText",!1,{type:"boolean",description:g(7032,"True when the chat input has text.")}),SNt=new Q("chatInputHasFocus",!1,{type:"boolean",description:g(7033,"True when the chat input has focus.")}),SMe=new Q("inChatInput",!1,{type:"boolean",description:g(7034,"True when focus is in the chat input, false otherwise.")}),ANt=new Q("inChat",!1,{type:"boolean",description:g(7035,"True when focus is in the chat widget, false otherwise.")}),YXe=new Q("chatIsEnabled",!1,{type:"boolean",description:g(7036,"True when chat is enabled because a default chat participant is registered.")}),ENt=new Q("chatCursorAtTop",!1),JXe=new Q("chatInputHasAgent",!1),xNt=new Q("chatLocation",void 0),DNt=new Q("quickChatHasFocus",!1,{type:"boolean",description:g(7037,"True when the quick chat UI has focus, false otherwise.")});var kNt=".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)}}";ut(kNt,{});var iQ;const XXe=new Q("editorDictation.inProgress",!1),ZXe=Pe(10420,"Voice");class INt extends gf{constructor(){super({id:"workbench.action.editorDictation.start",title:Pe(10421,"Start Dictation in Editor"),category:ZXe,precondition:he.and(GRt,KRt.toNegated(),J.readOnly.toNegated()),f1:!0,keybinding:{primary:U.CtrlCmd|U.Alt|S.KeyV,weight:Ae.WorkbenchContrib,secondary:Qn?[U.Alt|S.Backquote]:void 0}})}runEditorCommand(e,t){const n=e.get(Ut).enableKeybindingHoldMode(this.desc.id);if(n){let o=!1;const r=setTimeout(()=>{o=!0},500);n.finally(()=>{clearTimeout(r),o&&nC.get(t)?.stop()})}nC.get(t)?.start()}}const Lse=class Lse extends gf{constructor(){super({id:Lse.ID,title:Pe(10422,"Stop Dictation in Editor"),category:ZXe,precondition:XXe,f1:!0,keybinding:{primary:S.Escape,weight:Ae.WorkbenchContrib+100}})}runEditorCommand(e,t){nC.get(t)?.stop()}};Lse.ID="workbench.action.editorDictation.stop";let q3=Lse;class TNt extends V{constructor(e,t){super(),this.editor=e,this.suppressMouseDown=!0,this.allowEditorOverflow=!0,this.domNode=document.createElement("div");const i=this._register(new hd(this.domNode)),n=t.lookupKeybinding(q3.ID)?.getLabel();i.push(rl({id:q3.ID,label:n?g(10423,"Stop Dictation ({0})",n):g(10424,"Stop Dictation"),class:We.asClassName(ve.micFilled),run:()=>nC.get(e)?.stop()}),{icon:!0,label:!1,keybinding:n}),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())?es.ABOVE:es.BELOW,es.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 xL;let nC=(xL=class extends V{static get(e){return e.getContribution(iQ.ID)}constructor(e,t,i,n){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=n,this.widget=this._register(new TNt(this.editor,this.keybindingService)),this.editorDictationInProgress=XXe.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new wn)}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,n=0;const o=(c,l)=>{i||(i=qn(this.editor.getPosition()));const d=new oe(i.lineNumber,i.column+c.length);this.editor.executeEdits(iQ.ID,[Zn.replace(F.fromPositions(i,i.with(void 0,i.column+n)),c)],[dt.fromPositions(d)]),l?t.set([{range:F.fromPositions(i,i.with(void 0,i.column+c.length)),options:{description:"editor-dictation-preview",inlineClassName:"ghost-text-decoration-preview"}}]):t.clear(),n=c.length,l||(i=void 0,n=0),this.editor.revealPositionInCenterIfOutsideViewport(d)},r=new ci;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 pF.Started:this.widget.active();break;case pF.Stopped:e.dispose();break;case pF.Recognizing:{if(!c.text)return;o(c.text,!0);break}case pF.Recognized:{if(!c.text)return;o(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},iQ=xL,xL.ID="editorDictation",xL);nC=iQ=D([_(1,Kae),_(2,Le),_(3,Ut)],nC);on(nC.ID,nC,ri.Lazy);At(INt);At(q3);var bbe,DL;let Fb=(DL=class{static get(e){return e.getContribution(bbe.ID)}constructor(e,t,i,n,o,r,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,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&&vM(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(x.contextmenu)&&l.keyCode===S.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===Rt.OVERLAY_WIDGET||e.target.type===Rt.CONTENT_TEXT&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===Rt.SCROLLBAR)return this._showScrollbarContextMenu(e.event);if(e.target.type!==Rt.CONTENT_TEXT&&e.target.type!==Rt.CONTENT_EMPTY&&e.target.type!==Rt.TEXTAREA)return;if(this._editor.focus(),e.target.position){let i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==Rt.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=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const o of n){const[,r]=o;let a=0;for(const c of r)if(c instanceof Ty){const l=this._getMenuActions(e,c.item.submenu);l.length>0&&(i.push(new Nk(c.id,c.label,l)),a++)}else i.push(c),a++;a&&i.push(new Ar)}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 n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),mt.Immediate),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Cr(this._editor.getDomNode()),c=a.left+r.left,l=a.top+r.top+r.height;n={x:c,y:l}}const o=this._editor.getOption(x.useShadowDOM)&&!dm;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new Jy(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=r;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new Jy(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()||oAt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(x.minimap);let i=0;const n=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 Nk(`menu-action-${++i}`,l,d,void 0),r=(l,d,h,u,f)=>{if(!d)return n({label:l,enabled:d,run:()=>{}});const p=v=>()=>{this._configurationService.updateValue(h,v)},m=[];for(const v of f)m.push(n({label:v.label,checked:u===v.value,run:p(v.value)}));return o(l,m)},a=[];a.push(n({label:g(1373,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Ar),a.push(n({label:g(1374,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(g(1375,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g(1376,"Proportional"),value:"proportional"},{label:g(1377,"Fill"),value:"fill"},{label:g(1378,"Fit"),value:"fit"}])),a.push(r(g(1379,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g(1380,"Mouse Over"),value:"mouseover"},{label:g(1381,"Always"),value:"always"}]));const c=this._editor.getOption(x.useShadowDOM)&&!dm;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()}},bbe=DL,DL.ID="editor.contrib.contextmenu",DL);Fb=bbe=D([_(1,lr),_(2,mf),_(3,Le),_(4,Ut),_(5,Oa),_(6,Te),_(7,yi)],Fb);class LNt extends tt{constructor(){super({id:"editor.action.showContextMenu",label:g(1382,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|S.F10,weight:Ae.EditorContrib}})}run(e,t){Fb.get(t)?.showContextMenu()}}on(Fb.ID,Fb,ri.BeforeFirstInteraction);Re(LNt);class RNt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new X_().parse(e,!1),i=new Map;let n=0;for(const r of t.placeholders)n=Math.max(n,r.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(n===0){const r=Cg(t.children);this.isTrivial=r instanceof zg&&r.isFinalTabstop}const o=[...t.children];for(;o.length>0;){const r=o.shift();if(r instanceof vW){if(r.children.length===0&&!FMt[r.name]){const a=i.has(r.name)?i.get(r.name):++n;i.set(r.name,a);const c=new zg(a).appendChild(new $d(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 eZe{constructor(e,t,i,n,o,r,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=n,this.description=o,this.body=r,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=n.toLowerCase(),this._bodyInsights=new XV(ky(),()=>new RNt(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 MNt(s){return kn(s)&&!!s.body}var Hw;(function(s){s[s.User=1]="User",s[s.Workspace=2]="Workspace",s[s.Extension=3]="Extension"})(Hw||(Hw={}));class Qhe{constructor(e,t,i,n,o,r){this.source=e,this.location=t,this.defaultScopes=i,this._extension=n,this._fileService=o,this._extensionResourceLoaderService=r,this.data=[],this.isGlobalSnippets=Gy(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"===Ko(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const n of this.data){const o=n.scopes.length;if(o===0)t.push(n);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=sf(e);if(sD(t)==="object")for(const[i,n]of Object.entries(t))if(MNt(n))this._parseSnippet(i,n,this.data);else for(const[o,r]of Object.entries(n))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:n,prefix:o,body:r,description:a}=t;if(o||(o=""),Array.isArray(r)&&(r=r.join(` +}`}))),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.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 n;!t&&i&&this.editor.getOption(x.inlineCompletionsAccessibilityVerbose)&&(n=g(5093,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Mr(n?e+", "+n: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(){ts(e=>{this.model.get()?.stop(e)})}},ube=yL,yL.ID="editor.contrib.inlineCompletionsController",yL);gu=ube=D([_(1,we),_(2,Le),_(3,Te),_(4,vi),_(5,wp),_(6,it),_(7,rv),_(8,Ut),_(9,mr)],gu);function jMt(s,e){const t=jt("result",[]),i=[];return e.add(ai(n=>{const o=s.read(n);ts(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[c],r))})})),t}const U6={id:_e.AccessibleView,group:"navigation",when:mp},V6={id:_e.CommandPalette,group:"",order:1};class YMt extends li{constructor(){super({id:Yd.ShowNext,precondition:he.and(mp,YJ),keybinding:{primary:U.Alt|S.BracketRight,weight:Ae.WorkbenchContrib},menu:[V6,{...U6,when:he.and(mp,YJ)}],icon:ve.arrowDown,title:g(10002,"Show Next in Accessible View")})}run(e){e.get(Am).next()}}At(YMt);class JMt extends li{constructor(){super({id:Yd.NextCodeBlock,precondition:he.and(XJ,he.equals(JJ.key,Rb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageDown,mac:{primary:U.CtrlCmd|U.Alt|S.PageDown},weight:Ae.WorkbenchContrib},icon:ve.arrowRight,menu:{...U6,when:he.and(mp,XJ)},title:g(10003,"Accessible View: Next Code Block")})}run(e){e.get(Am).navigateToCodeBlock("next")}}At(JMt);class XMt extends li{constructor(){super({id:Yd.PreviousCodeBlock,precondition:he.and(XJ,he.equals(JJ.key,Rb.Chat)),keybinding:{primary:U.CtrlCmd|U.Alt|S.PageUp,mac:{primary:U.CtrlCmd|U.Alt|S.PageUp},weight:Ae.WorkbenchContrib},icon:ve.arrowLeft,menu:{...U6,when:he.and(mp,XJ)},title:g(10004,"Accessible View: Previous Code Block")})}run(e){e.get(Am).navigateToCodeBlock("previous")}}At(XMt);class ZMt extends li{constructor(){super({id:Yd.ShowPrevious,precondition:he.and(mp,YJ),keybinding:{primary:U.Alt|S.BracketLeft,weight:Ae.WorkbenchContrib},icon:ve.arrowUp,menu:[V6,{...U6,when:he.and(mp,YJ)}],title:g(10005,"Show Previous in Accessible View")})}run(e){e.get(Am).previous()}}At(ZMt);class eNt extends li{constructor(){super({id:Yd.GoToSymbol,precondition:he.and(he.or(mp,RA),vHe),keybinding:{primary:U.CtrlCmd|U.Shift|S.KeyO,secondary:[U.CtrlCmd|U.Shift|S.Period],weight:Ae.WorkbenchContrib+10},icon:ve.symbolField,menu:[V6,{...U6,when:he.and(he.or(mp,RA),vHe)}],title:g(10006,"Go To Symbol in Accessible View")})}run(e){e.get(Am).goToSymbol()}}At(eNt);function HXe(s){return s.register(),s}HXe(new fI({id:Yd.OpenAccessibilityHelp,precondition:void 0,kbOpts:{primary:U.Alt|S.F1,weight:Ae.WorkbenchContrib,linux:{primary:U.Alt|U.Shift|S.F1,secondary:[U.Alt|S.F1]},kbExpr:RA.toNegated()},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10007,"Open Accessibility Help"),order:1}]}));const tNt=HXe(new fI({id:Yd.OpenAccessibleView,precondition:void 0,kbOpts:{primary:U.Alt|S.F2,weight:Ae.WorkbenchContrib,linux:{primary:U.Alt|U.Shift|S.F2,secondary:[U.Alt|S.F2]}},menuOpts:[{menuId:_e.CommandPalette,group:"",title:g(10008,"Open Accessible View"),order:1}]}));class iNt extends li{constructor(){super({id:Yd.DisableVerbosityHint,precondition:he.and(he.or(mp,RA),_He),keybinding:{primary:U.Alt|S.F6,weight:Ae.WorkbenchContrib},icon:ve.bellSlash,menu:[V6,{id:_e.AccessibleView,group:"navigation",when:he.and(he.or(mp,RA),_He)}],title:g(10009,"Disable Accessible View Hint")})}run(e){e.get(Am).disableHint()}}At(iNt);class nNt extends li{constructor(){super({id:Yd.AccessibilityHelpConfigureKeybindings,precondition:he.and(RA,bHe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyK,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:3,when:bHe}],title:g(10010,"Accessibility Help Configure Unassigned Keybindings")})}async run(e){await e.get(Am).configureKeybindings(!0)}}At(nNt);class sNt extends li{constructor(){super({id:Yd.AccessibilityHelpConfigureAssignedKeybindings,precondition:he.and(RA,wHe),icon:ve.key,keybinding:{primary:U.Alt|S.KeyA,weight:Ae.WorkbenchContrib},menu:[{id:_e.AccessibleView,group:"navigation",order:4,when:wHe}],title:g(10011,"Accessibility Help Configure Assigned Keybindings")})}async run(e){await e.get(Am).configureKeybindings(!1)}}At(sNt);class oNt extends li{constructor(){super({id:Yd.AccessibilityHelpOpenHelpLink,precondition:he.and(RA),keybinding:{primary:U.Alt|S.KeyH,weight:Ae.WorkbenchContrib},title:g(10012,"Accessibility Help Open Help Link")})}run(e){e.get(Am).openHelpLink()}}At(oNt);class rNt extends li{constructor(){super({id:Yd.AccessibleViewAcceptInlineCompletion,precondition:he.and(mp,he.equals(JJ.key,Rb.InlineCompletions)),keybinding:{primary:U.CtrlCmd|S.Slash,mac:{primary:U.WinCtrl|S.Slash},weight:Ae.WorkbenchContrib},icon:ve.check,menu:[V6,{id:_e.AccessibleView,group:"navigation",order:0,when:he.and(mp,he.equals(JJ.key,Rb.InlineCompletions))}],title:g(10013,"Accept Inline Completion")})}async run(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=gu.get(i)?.model.get(),o=n?.state.get();!n||!o||(await n.accept(i),n.stop(),i.focus())}}At(rNt);const $He=new Y("chatSessionResponseVote","",{type:"string",description:g(7024,"When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.")}),aNt=new Y("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:g(7025,"When the agent or command was automatically detected")}),cNt=new Y("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:g(7026,"True when the current chat response supports issue reporting.")}),UXe=new Y("chatSessionResponseFiltered",!1,{type:"boolean",description:g(7027,"True when the chat response was filtered out by the server.")}),z3=new Y("chatSessionRequestInProgress",!1,{type:"boolean",description:g(7028,"True when the current request is still in progress.")}),lNt=new Y("chatResponse",!1,{type:"boolean",description:g(7029,"The chat item is a response.")}),dNt=new Y("chatRequest",!1,{type:"boolean",description:g(7030,"The chat item is a request")}),hNt=new Y("chatEditApplied",!1,{type:"boolean",description:g(7031,"True when the chat text edits have been applied.")}),dMe=new Y("chatInputHasText",!1,{type:"boolean",description:g(7032,"True when the chat input has text.")}),uNt=new Y("chatInputHasFocus",!1,{type:"boolean",description:g(7033,"True when the chat input has focus.")}),hMe=new Y("inChatInput",!1,{type:"boolean",description:g(7034,"True when focus is in the chat input, false otherwise.")}),gNt=new Y("inChat",!1,{type:"boolean",description:g(7035,"True when focus is in the chat widget, false otherwise.")}),VXe=new Y("chatIsEnabled",!1,{type:"boolean",description:g(7036,"True when chat is enabled because a default chat participant is registered.")}),fNt=new Y("chatCursorAtTop",!1),zXe=new Y("chatInputHasAgent",!1),pNt=new Y("chatLocation",void 0),mNt=new Y("quickChatHasFocus",!1,{type:"boolean",description:g(7037,"True when the quick chat UI has focus, false otherwise.")});var _Nt=".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)}}";ut(_Nt,{});var eQ;const $Xe=new Y("editorDictation.inProgress",!1),GXe=Fe(10420,"Voice");class vNt extends df{constructor(){super({id:"workbench.action.editorDictation.start",title:Fe(10421,"Start Dictation in Editor"),category:GXe,precondition:he.and(NRt,PRt.toNegated(),J.readOnly.toNegated()),f1:!0,keybinding:{primary:U.CtrlCmd|U.Alt|S.KeyV,weight:Ae.WorkbenchContrib,secondary:Qn?[U.Alt|S.Backquote]:void 0}})}runEditorCommand(e,t){const n=e.get(Ut).enableKeybindingHoldMode(this.desc.id);if(n){let o=!1;const r=setTimeout(()=>{o=!0},500);n.finally(()=>{clearTimeout(r),o&&eC.get(t)?.stop()})}eC.get(t)?.start()}}const Dse=class Dse extends df{constructor(){super({id:Dse.ID,title:Fe(10422,"Stop Dictation in Editor"),category:GXe,precondition:$Xe,f1:!0,keybinding:{primary:S.Escape,weight:Ae.WorkbenchContrib+100}})}runEditorCommand(e,t){eC.get(t)?.stop()}};Dse.ID="workbench.action.editorDictation.stop";let $3=Dse;class bNt extends V{constructor(e,t){super(),this.editor=e,this.suppressMouseDown=!0,this.allowEditorOverflow=!0,this.domNode=document.createElement("div");const i=this._register(new ld(this.domNode)),n=t.lookupKeybinding($3.ID)?.getLabel();i.push(ol({id:$3.ID,label:n?g(10423,"Stop Dictation ({0})",n):g(10424,"Stop Dictation"),class:We.asClassName(ve.micFilled),run:()=>eC.get(e)?.stop()}),{icon:!0,label:!1,keybinding:n}),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())?es.ABOVE:es.BELOW,es.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 CL;let eC=(CL=class extends V{static get(e){return e.getContribution(eQ.ID)}constructor(e,t,i,n){super(),this.editor=e,this.speechService=t,this.contextKeyService=i,this.keybindingService=n,this.widget=this._register(new bNt(this.editor,this.keybindingService)),this.editorDictationInProgress=$Xe.bindTo(this.contextKeyService),this.sessionDisposables=this._register(new wn)}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,n=0;const o=(c,l)=>{i||(i=qn(this.editor.getPosition()));const d=new oe(i.lineNumber,i.column+c.length);this.editor.executeEdits(eQ.ID,[Zn.replace(F.fromPositions(i,i.with(void 0,i.column+n)),c)],[dt.fromPositions(d)]),l?t.set([{range:F.fromPositions(i,i.with(void 0,i.column+c.length)),options:{description:"editor-dictation-preview",inlineClassName:"ghost-text-decoration-preview"}}]):t.clear(),n=c.length,l||(i=void 0,n=0),this.editor.revealPositionInCenterIfOutsideViewport(d)},r=new ci;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 hF.Started:this.widget.active();break;case hF.Stopped:e.dispose();break;case hF.Recognizing:{if(!c.text)return;o(c.text,!0);break}case hF.Recognized:{if(!c.text)return;o(`${c.text} `,!1);break}}}))}stop(){this.sessionDisposables.clear()}},eQ=CL,CL.ID="editorDictation",CL);eC=eQ=D([_(1,Vae),_(2,Le),_(3,Ut)],eC);on(eC.ID,eC,ri.Lazy);At(vNt);At($3);var gbe,SL;let Mb=(SL=class{static get(e){return e.getContribution(gbe.ID)}constructor(e,t,i,n,o,r,a,c){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,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&&fM(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(l=>{this._editor.getOption(x.contextmenu)&&l.keyCode===S.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===Rt.OVERLAY_WIDGET||e.target.type===Rt.CONTENT_TEXT&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===Rt.SCROLLBAR)return this._showScrollbarContextMenu(e.event);if(e.target.type!==Rt.CONTENT_TEXT&&e.target.type!==Rt.CONTENT_EMPTY&&e.target.type!==Rt.TEXTAREA)return;if(this._editor.focus(),e.target.position){let i=!1;for(const n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==Rt.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=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const o of n){const[,r]=o;let a=0;for(const c of r)if(c instanceof Dy){const l=this._getMenuActions(e,c.item.submenu);l.length>0&&(i.push(new Ik(c.id,c.label,l)),a++)}else i.push(c),a++;a&&i.push(new Ar)}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 n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),mt.Immediate),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Cr(this._editor.getDomNode()),c=a.left+r.left,l=a.top+r.top+r.height;n={x:c,y:l}}const o=this._editor.getOption(x.useShadowDOM)&&!am;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new Qy(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const c=r;return typeof c.getActionViewItem=="function"?c.getActionViewItem():new Qy(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()||QSt(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(x.minimap);let i=0;const n=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 Ik(`menu-action-${++i}`,l,d,void 0),r=(l,d,h,u,f)=>{if(!d)return n({label:l,enabled:d,run:()=>{}});const p=v=>()=>{this._configurationService.updateValue(h,v)},m=[];for(const v of f)m.push(n({label:v.label,checked:u===v.value,run:p(v.value)}));return o(l,m)},a=[];a.push(n({label:g(1373,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Ar),a.push(n({label:g(1374,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(g(1375,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:g(1376,"Proportional"),value:"proportional"},{label:g(1377,"Fill"),value:"fill"},{label:g(1378,"Fit"),value:"fit"}])),a.push(r(g(1379,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:g(1380,"Mouse Over"),value:"mouseover"},{label:g(1381,"Always"),value:"always"}]));const c=this._editor.getOption(x.useShadowDOM)&&!am;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()}},gbe=SL,SL.ID="editor.contrib.contextmenu",SL);Mb=gbe=D([_(1,lr),_(2,gf),_(3,Le),_(4,Ut),_(5,Oa),_(6,Te),_(7,yi)],Mb);class wNt extends tt{constructor(){super({id:"editor.action.showContextMenu",label:g(1382,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|S.F10,weight:Ae.EditorContrib}})}run(e,t){Mb.get(t)?.showContextMenu()}}on(Mb.ID,Mb,ri.BeforeFirstInteraction);Me(wNt);class yNt{constructor(e){this.isBogous=!1,this.isTrivial=!1,this.usesClipboardVariable=!1,this.usesSelectionVariable=!1,this.codeSnippet=e;const t=new j_().parse(e,!1),i=new Map;let n=0;for(const r of t.placeholders)n=Math.max(n,r.index);if(t.placeholders.length===0)this.isTrivial=!0;else if(n===0){const r=bg(t.children);this.isTrivial=r instanceof Hg&&r.isFinalTabstop}const o=[...t.children];for(;o.length>0;){const r=o.shift();if(r instanceof fW){if(r.children.length===0&&!EMt[r.name]){const a=i.has(r.name)?i.get(r.name):++n;i.set(r.name,a);const c=new Hg(a).appendChild(new Vd(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 KXe{constructor(e,t,i,n,o,r,a,c,l,d){this.isFileTemplate=e,this.scopes=t,this.name=i,this.prefix=n,this.description=o,this.body=r,this.source=a,this.snippetSource=c,this.snippetIdentifier=l,this.extensionId=d,this.prefixLow=n.toLowerCase(),this._bodyInsights=new jV(Ey(),()=>new yNt(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 CNt(s){return kn(s)&&!!s.body}var Ow;(function(s){s[s.User=1]="User",s[s.Workspace=2]="Workspace",s[s.Extension=3]="Extension"})(Ow||(Ow={}));class Uhe{constructor(e,t,i,n,o,r){this.source=e,this.location=t,this.defaultScopes=i,this._extension=n,this._fileService=o,this._extensionResourceLoaderService=r,this.data=[],this.isGlobalSnippets=Vy(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"===Ko(this.location.path)&&t.push(...this.data)}_scopeSelect(e,t){for(const n of this.data){const o=n.scopes.length;if(o===0)t.push(n);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=ef(e);if(tD(t)==="object")for(const[i,n]of Object.entries(t))if(CNt(n))this._parseSnippet(i,n,this.data);else for(const[o,r]of Object.entries(n))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:n,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===Hw.Workspace?l=g(6745,"Workspace Snippet"):this.isGlobalSnippets?l=g(6746,"Global User Snippet"):l=g(6747,"User Snippet");for(const d of hi.wrap(o))i.push(new eZe(!!n,c,e,d,a,r,l,this.source,this._extension?`${DN(this._extension.extensionLocation,this.location)}/${e}`:`${Ko(this.location.path)}/${e}`,this._extension?.identifier))}}const wW=eh.registerExtensionPoint({extensionPoint:"languages",jsonSchema:{description:g(2464,"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(2465,"ID of the language."),type:"string"},aliases:{description:g(2466,"Name aliases for the language."),type:"array",items:{type:"string"}},extensions:{description:g(2467,"File extensions associated to the language."),default:[".foo"],type:"array",items:{type:"string"}},filenames:{description:g(2468,"File names associated to the language."),type:"array",items:{type:"string"}},filenamePatterns:{description:g(2469,"File name glob patterns associated to the language."),type:"array",items:{type:"string"}},mimetypes:{description:g(2470,"Mime types associated to the language."),type:"array",items:{type:"string"}},firstLine:{description:g(2471,"A regular expression matching the first line of a file of the language."),type:"string"},configuration:{description:g(2472,"A relative path to a file containing configuration options for the language."),type:"string",default:"./language-configuration.json"},icon:{type:"object",description:g(2473,"A icon to use as file icon, if no icon theme provides one for the language."),properties:{light:{description:g(2474,"Icon path when a light theme is used"),type:"string"},dark:{description:g(2475,"Icon path when a dark theme is used"),type:"string"}}}}}},activationEventsGenerator:(s,e)=>{for(const t of s)t.id&&t.configuration&&e.push(`onLanguage:${t.id}`)}});class NNt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.languages}render(e){const t=e.contributes,i=t?.languages||[],n=[];for(const d of i)tZe(d)&&n.push({id:d.id,name:(d.aliases||[])[0]||d.id,extensions:d.extensions||[],hasGrammar:!1,hasSnippets:!1});const o=O1e(n,d=>d.id);if((t?.grammars||[]).forEach(d=>{if(!Lt(d.language))return;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,n.push(h))}),(t?.snippets||[]).forEach(d=>{if(!Lt(d.language))return;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,n.push(h))}),!n.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const c=[g(2476,"ID"),g(2477,"Name"),g(2478,"File Extensions"),g(2479,"Grammar"),g(2480,"Snippets")],l=n.sort((d,h)=>d.id.localeCompare(h.id)).map(d=>[d.id,d.name,new Mt().appendMarkdown(`${d.extensions.map(h=>`\`${h}\``).join(" ")}`),d.hasGrammar?"✔︎":"—",d.hasSnippets?"✔︎":"—"]);return{data:{headers:c,rows:l},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"languages",label:g(2481,"Programming Languages"),access:{canToggle:!1},renderer:new wi(NNt)});let wbe=class extends QY{constructor(e,t,i,n){super(i.verbose||i.isExtensionDevelopment||!i.isBuilt),this.logService=n,this._configurationService=t,this._extensionService=e,wW.setHandler(o=>{const r=[];for(let a=0,c=o.length;a{o.affectsConfiguration(NLe)&&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();lAt(),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 n=this.getMimeType(i)||`text/x-${i}`;rAt({id:i,mime:n,filepattern:t})}),this._onDidChange.fire()}};wbe=D([_(0,fs),_(1,Te),_(2,Za),_(3,Ge)],wbe);function bK(s){return typeof s>"u"?!0:Array.isArray(s)?s.every(e=>typeof e=="string"):!1}function tZe(s,e){return s?typeof s.id!="string"?(e?.error(g(2484,"property `{0}` is mandatory and must be of type `string`","id")),!1):bK(s.extensions)?bK(s.filenames)?typeof s.firstLine<"u"&&typeof s.firstLine!="string"?(e?.error(g(2487,"property `{0}` can be omitted and must be of type `string`","firstLine")),!1):typeof s.configuration<"u"&&typeof s.configuration!="string"?(e?.error(g(2488,"property `{0}` can be omitted and must be of type `string`","configuration")),!1):bK(s.aliases)?bK(s.mimetypes)?typeof s.icon<"u"&&(typeof s.icon!="object"||typeof s.icon.light!="string"||typeof s.icon.dark!="string")?(e?.error(g(2491,"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(2490,"property `{0}` can be omitted and must be of type `string[]`","mimetypes")),!1):(e?.error(g(2489,"property `{0}` can be omitted and must be of type `string[]`","aliases")),!1):(e?.error(g(2486,"property `{0}` can be omitted and must be of type `string[]`","filenames")),!1):(e?.error(g(2485,"property `{0}` can be omitted and must be of type `string[]`","extensions")),!1):(e?.error(g(2483,"Empty value for `contributes.{0}`",wW.name)),!1)}const iZe="_snippet.markAsUsed";_t.registerCommand(iZe,(s,...e)=>{const t=s.get(Gae),[i]=e;i instanceof eZe&&t.updateUsageTimestamp(i)});class fV{constructor(e,t){this.snippet=e,this.label={label:e.prefix,description:e.name},this.detail=g(6748,"{0} ({1})",e.description||e.name,e.source),this.insertText=e.codeSnippet,this.extensionId=e.extensionId,this.range=t,this.sortText=`${e.snippetSource===Hw.Extension?"z":"a"}-${e.prefix}`,this.kind=Me.Snippet,this.insertTextRules=Yg.InsertAsSnippet,this.command={id:iZe,title:"",arguments:[e]}}resolve(){return this.documentation=new Mt().appendCodeblock("",X_.asInsertText(this.snippet.codeSnippet)),this}static compareByLabel(e,t){return gm(e.label.label,t.label.label)}}let ybe=class{constructor(e,t,i){this._languageService=e,this._snippets=t,this._languageConfigurationService=i,this._debugDisplayName="snippetCompletions"}async provideCompletionItems(e,t,i){const n=new js,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===Ku.TriggerCharacter&&!v.prefixLow.startsWith(h))continue;let b;for(const R of l)if(!(R.prefixLow.match(/^\s/)&&!v.prefixLow.match(/^\s/))&&HQe(R.prefixLow,0,R.prefixLow.length,v.prefixLow,0,v.prefixLow.length)){b=R;break}if(!b)continue;const w=b.startColumn-1,y=v.prefixLow.length-(d-w),C=Ere(a,v.prefixLow,d,d+y,d-w),A=t.with(void 0,w+1);let L=C===0?t.column+y:t.column;dG.open===a[A.column-1]&&v.prefix.startsWith(G.open)&&v.prefix[v.prefix.length-1]===G.close)&&L++;const k=F.fromPositions({lineNumber:o,column:b.startColumn},{lineNumber:o,column:L}),P=k.setEndPosition(o,t.column);m.push(new fV(v,{replace:k,insert:P})),p.delete(v)}if(!h&&(/\s/.test(a[t.column-2])||!a))for(const v of p){const b=F.fromPositions(t),w=a.indexOf(v.prefixLow,d)===d?b.setEndPosition(t.lineNumber,t.column+v.prefixLow.length):b;m.push(new fV(v,{replace:w,insert:b}))}return this._disambiguateSnippets(m),{suggestions:m,duration:n.elapsed()}}_disambiguateSnippets(e){e.sort(fV.compareByLabel);for(let t=0;tt+1&&(e[t].label.label=g(6749,"{0}, {1}",e[t].label.label,e[t].snippet.name),t=n)}}resolveCompletionItem(e){return e instanceof fV?e.resolve():e}_computeSnippetPositions(e,t,i,n){const o=[];for(let r=1;r0||o.length===0)&&o.push({startColumn:i.startColumn,prefixLow:n.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}};ybe=D([_(0,xi),_(1,Gae),_(2,Vs)],ybe);var nQ,sQ,uX;(function(s){function e(t,i,n){if(Gu(i.path))return t.collector.error(g(2991,"Expected string in `contributes.{0}.path`. Provided value: {1}",t.description.name,String(i.path))),null;if(Gu(i.language)&&!i.path.endsWith(".code-snippets"))return t.collector.error(g(2992,"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(!Gu(i.language)&&!n.isRegisteredLanguageId(i.language))return t.collector.error(g(2993,"Unknown language in `contributes.{0}.language`. Provided value: {1}",t.description.name,String(i.language))),null;const o=t.description.extensionLocation,r=Pt(o,i.path);return qy(r,o)?{language:i.language,location:r}:(t.collector.error(g(2994,"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)}s.toValidSnippet=e,s.snippetsContribution={description:g(2995,"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(2996,"Language identifier for which this snippet is contributed to."),type:"string"},path:{description:g(2997,"Path of the snippets file. The path is relative to the extension folder and typically starts with './snippets/'."),type:"string"}}}},s.point=eh.registerExtensionPoint({extensionPoint:"snippets",deps:[wW],jsonSchema:s.snippetsContribution})})(uX||(uX={}));function PNt(s,e,t){return jr(s.watch(e),s.onDidFilesChange(i=>{i.affects(e)&&t()}))}var kL;let Cbe=(kL=class{constructor(e){this._storageService=e;const t=e.get(nQ._key,Ie.PROFILE,"");let i;try{i=JSON.parse(t)}catch{}this._ignored=A6e(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(nQ._key,JSON.stringify(Array.from(this._ignored)),Ie.PROFILE,an.USER)}},nQ=kL,kL._key="snippets.ignoredSnippets",kL);Cbe=nQ=D([_(0,$i)],Cbe);var IL;let Sbe=(IL=class{constructor(e){this._storageService=e;const t=e.get(sQ._key,Ie.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(sQ._key,JSON.stringify(t),Ie.PROFILE,an.USER)}},sQ=IL,IL._key="snippets.usageTimestamps",IL);Sbe=sQ=D([_(0,$i)],Sbe);let nUe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this._environmentService=e,this._userDataProfileService=t,this._contextService=i,this._languageService=n,this._logService=o,this._fileService=r,this._textfileService=a,this._extensionResourceLoaderService=c,this._disposables=new Z,this._pendingWork=[],this._files=new ui,this._pendingWork.push(Promise.resolve(l.when(Rs.Restored).then(()=>{this._initExtensionSnippets(),this._initUserSnippets(),this._initWorkspaceSnippets()}))),EMt(new ybe(this._languageService,this,h)),this._enablement=d.createInstance(Cbe),this._usageTimestamps=d.createInstance(Sbe)}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=[],n=[];if(e){if(this._languageService.isRegisteredLanguageId(e))for(const o of this._files.values())n.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())n.push(o.load().then(r=>w6e(i,i.length,r.data)).catch(r=>this._logService.error(r,o.location.toString())));return await Promise.all(n),this._filterAndSortSnippets(i,t)}getSnippetsSync(e,t){const i=[];if(this._languageService.isRegisteredLanguageId(e))for(const n of this._files.values())n.load().catch(o=>{}),n.select(e,i);return this._filterAndSortSnippets(i,t)}_filterAndSortSnippets(e,t){const i=[];for(const n of e)!n.prefix&&!t?.includeNoPrefixSnippets||!this.isEnabled(n)&&!t?.includeDisabledSnippets||typeof t?.fileTemplateSnippets=="boolean"&&t.fileTemplateSnippets!==n.isFileTemplate||i.push(n);return i.sort((n,o)=>{let r=0;if(!t?.noRecencySort){const a=this._usageTimestamps.getUsageTimestamp(n.snippetIdentifier)??-1;r=(this._usageTimestamps.getUsageTimestamp(o.snippetIdentifier)??-1)-a}return r===0&&(r=this._compareSnippet(n,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===Hw.Extension&&this._files.delete(t);for(const t of e)for(const i of t.value){const n=uX.toValidSnippet(t,i,this._languageService);if(!n)continue;const o=this._files.get(n.location);if(o)o.defaultScopes?o.defaultScopes.push(n.language):o.defaultScopes=[];else{const r=new Qhe(Hw.Extension,n.location,n.language?[n.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(2998,"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(2999,'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 n=>{const o=n.toResource(".vscode");await this._fileService.exists(o)?this._initFolderSnippets(Hw.Workspace,o,t):t.add(this._fileService.onDidFilesChange(a=>{a.contains(o,To.ADDED)&&this._initFolderSnippets(Hw.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(Hw.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 n=new Z,o=async()=>{if(n.clear(),!!await this._fileService.exists(t))try{const r=await this._fileService.resolve(t);for(const a of r.children||[])n.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=>{qy(r.model.resource,t)&&o()})),i.add(PNt(this._fileService,t,o)),i.add(n),o()}_addSnippetFile(e,t){const i=vU(e);if(t===Hw.User&&i===".json"){const n=_i(e).replace(/\.json/,"");this._files.set(e,new Qhe(t,e,[n],void 0,this._fileService,this._extensionResourceLoaderService))}else i===".code-snippets"&&this._files.set(e,new Qhe(t,e,void 0,void 0,this._fileService,this._extensionResourceLoaderService));return{dispose:()=>this._files.delete(e)}}};nUe=D([_(0,Za),_(1,ug),_(2,yi),_(3,xi),_(4,Ge),_(5,Jt),_(6,Fo),_(7,Fae),_(8,ig),_(9,we),_(10,Vs)],nUe);function FNt(s,e){const i=s.getLineContent(e.lineNumber).substr(0,e.column-1),n=Math.max(0,i.length-100);for(let o=i.length-1;o>=n;o--){const r=i.charAt(o);if(/\s/.test(r))return i.substr(o+1)}return n===0?i:""}var oQ,HD;let PA=(HD=class{static get(e){return e.getContribution(oQ.ID)}constructor(e,t,i,n,o){this._editor=e,this._snippetService=t,this._clipboardService=i,this._languageFeaturesService=n,this._activeSnippets=[],this._hasSnippets=oQ.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),n=this._snippetService.getSnippetsSync(i);if(!n){this._hasSnippets.set(!1);return}if(F.isEmpty(e)){const r=FNt(t,e.getPosition());if(r)for(const a of n)r.endsWith(a.prefix)&&this._activeSnippets.push(a)}else if(!F.spansMultipleLines(e)&&t.getValueLengthInRange(e)<=100){const r=t.getValueInRange(e);if(r)for(const a of n)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=F.fromPositions(c.delta(0,-d.prefix.length),c);return new fV(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 Tae(this._editor,jo.Value|jo.Position);if(t=await this._clipboardService.readText(),!i.validate(this._editor))return}fc.get(this._editor)?.insert(e.codeSnippet,{overwriteBefore:e.prefix.length,overwriteAfter:0,clipboardText:t})}else this._activeSnippets.length>1&&this._completionProvider&&GXe(this._editor,this._completionProvider)}},oQ=HD,HD.ID="editor.tabCompletionController",HD.ContextKey=new Q("hasSnippetCompletions",void 0),HD);PA=oQ=D([_(1,Gae),_(2,dg),_(3,it),_(4,Le)],PA);on(PA.ID,PA,ri.Eager);const ONt=hc.bindToContribution(PA.get);qe(new ONt({id:"insertSnippet",precondition:PA.ContextKey,handler:s=>s.performSnippetCompletions(),kbOpts:{weight:Ae.EditorContrib,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus,fc.InSnippetMode.toNegated()),primary:S.Tab}}));var x_;(function(s){s.activeCursorHasCommentingRange=new Q("activeCursorHasCommentingRange",!1,{description:g(5301,"Whether the position at the active cursor has a commenting range"),type:"boolean"}),s.activeEditorHasCommentingRange=new Q("activeEditorHasCommentingRange",!1,{description:g(5302,"Whether the active editor has a commenting range"),type:"boolean"}),s.WorkspaceHasCommenting=new Q("workspaceHasCommenting",!1,{description:g(5303,"Whether the open workspace has either comments or commenting ranges."),type:"boolean"}),s.commentThreadIsEmpty=new Q("commentThreadIsEmpty",!1,{type:"boolean",description:g(5304,"Set when the comment thread has no comments")}),s.commentIsEmpty=new Q("commentIsEmpty",!1,{type:"boolean",description:g(5305,"Set when the comment has no input")}),s.commentContext=new Q("comment",void 0,{type:"string",description:g(5306,"The context value of the comment")}),s.commentThreadContext=new Q("commentThread",void 0,{type:"string",description:g(5307,"The context value of the comment thread")}),s.commentControllerContext=new Q("commentController",void 0,{type:"string",description:g(5308,"The comment controller id associated with a comment thread")}),s.commentFocused=new Q("commentFocused",!1,{type:"boolean",description:g(5309,"Set when the comment is focused")})})(x_||(x_={}));function q6(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function BNt(s,e,t){const i={id:ar(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class lce{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 hi.some(this,([i,n])=>n.asFile())&&t.push("files"),sZe(gX(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 gX(e)}}function gX(s){return s.toLowerCase()}function nZe(s,e){return sZe(gX(s),e.map(gX))}function sZe(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,o]=t;return o==="*"?e.some(r=>r.startsWith(n+"/")):!1}const Zk=Object.freeze({create:s=>ja(s.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===Ow.Workspace?l=g(6745,"Workspace Snippet"):this.isGlobalSnippets?l=g(6746,"Global User Snippet"):l=g(6747,"User Snippet");for(const d of hi.wrap(o))i.push(new KXe(!!n,c,e,d,a,r,l,this.source,this._extension?`${SN(this._extension.extensionLocation,this.location)}/${e}`:`${Ko(this.location.path)}/${e}`,this._extension?.identifier))}}const mW=Xd.registerExtensionPoint({extensionPoint:"languages",jsonSchema:{description:g(2464,"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(2465,"ID of the language."),type:"string"},aliases:{description:g(2466,"Name aliases for the language."),type:"array",items:{type:"string"}},extensions:{description:g(2467,"File extensions associated to the language."),default:[".foo"],type:"array",items:{type:"string"}},filenames:{description:g(2468,"File names associated to the language."),type:"array",items:{type:"string"}},filenamePatterns:{description:g(2469,"File name glob patterns associated to the language."),type:"array",items:{type:"string"}},mimetypes:{description:g(2470,"Mime types associated to the language."),type:"array",items:{type:"string"}},firstLine:{description:g(2471,"A regular expression matching the first line of a file of the language."),type:"string"},configuration:{description:g(2472,"A relative path to a file containing configuration options for the language."),type:"string",default:"./language-configuration.json"},icon:{type:"object",description:g(2473,"A icon to use as file icon, if no icon theme provides one for the language."),properties:{light:{description:g(2474,"Icon path when a light theme is used"),type:"string"},dark:{description:g(2475,"Icon path when a dark theme is used"),type:"string"}}}}}},activationEventsGenerator:(s,e)=>{for(const t of s)t.id&&t.configuration&&e.push(`onLanguage:${t.id}`)}});class SNt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.languages}render(e){const t=e.contributes,i=t?.languages||[],n=[];for(const d of i)qXe(d)&&n.push({id:d.id,name:(d.aliases||[])[0]||d.id,extensions:d.extensions||[],hasGrammar:!1,hasSnippets:!1});const o=E1e(n,d=>d.id);if((t?.grammars||[]).forEach(d=>{if(!Lt(d.language))return;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,n.push(h))}),(t?.snippets||[]).forEach(d=>{if(!Lt(d.language))return;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,n.push(h))}),!n.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const c=[g(2476,"ID"),g(2477,"Name"),g(2478,"File Extensions"),g(2479,"Grammar"),g(2480,"Snippets")],l=n.sort((d,h)=>d.id.localeCompare(h.id)).map(d=>[d.id,d.name,new Mt().appendMarkdown(`${d.extensions.map(h=>`\`${h}\``).join(" ")}`),d.hasGrammar?"✔︎":"—",d.hasSnippets?"✔︎":"—"]);return{data:{headers:c,rows:l},dispose:()=>{}}}}Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"languages",label:g(2481,"Programming Languages"),access:{canToggle:!1},renderer:new wi(SNt)});let fbe=class extends KY{constructor(e,t,i,n){super(i.verbose||i.isExtensionDevelopment||!i.isBuilt),this.logService=n,this._configurationService=t,this._extensionService=e,mW.setHandler(o=>{const r=[];for(let a=0,c=o.length;a{o.affectsConfiguration(CLe)&&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();XSt(),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 n=this.getMimeType(i)||`text/x-${i}`;jSt({id:i,mime:n,filepattern:t})}),this._onDidChange.fire()}};fbe=D([_(0,fs),_(1,Te),_(2,Za),_(3,Ge)],fbe);function mK(s){return typeof s>"u"?!0:Array.isArray(s)?s.every(e=>typeof e=="string"):!1}function qXe(s,e){return s?typeof s.id!="string"?(e?.error(g(2484,"property `{0}` is mandatory and must be of type `string`","id")),!1):mK(s.extensions)?mK(s.filenames)?typeof s.firstLine<"u"&&typeof s.firstLine!="string"?(e?.error(g(2487,"property `{0}` can be omitted and must be of type `string`","firstLine")),!1):typeof s.configuration<"u"&&typeof s.configuration!="string"?(e?.error(g(2488,"property `{0}` can be omitted and must be of type `string`","configuration")),!1):mK(s.aliases)?mK(s.mimetypes)?typeof s.icon<"u"&&(typeof s.icon!="object"||typeof s.icon.light!="string"||typeof s.icon.dark!="string")?(e?.error(g(2491,"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(2490,"property `{0}` can be omitted and must be of type `string[]`","mimetypes")),!1):(e?.error(g(2489,"property `{0}` can be omitted and must be of type `string[]`","aliases")),!1):(e?.error(g(2486,"property `{0}` can be omitted and must be of type `string[]`","filenames")),!1):(e?.error(g(2485,"property `{0}` can be omitted and must be of type `string[]`","extensions")),!1):(e?.error(g(2483,"Empty value for `contributes.{0}`",mW.name)),!1)}const QXe="_snippet.markAsUsed";_t.registerCommand(QXe,(s,...e)=>{const t=s.get(Uae),[i]=e;i instanceof KXe&&t.updateUsageTimestamp(i)});class uV{constructor(e,t){this.snippet=e,this.label={label:e.prefix,description:e.name},this.detail=g(6748,"{0} ({1})",e.description||e.name,e.source),this.insertText=e.codeSnippet,this.extensionId=e.extensionId,this.range=t,this.sortText=`${e.snippetSource===Ow.Extension?"z":"a"}-${e.prefix}`,this.kind=Ne.Snippet,this.insertTextRules=qg.InsertAsSnippet,this.command={id:QXe,title:"",arguments:[e]}}resolve(){return this.documentation=new Mt().appendCodeblock("",j_.asInsertText(this.snippet.codeSnippet)),this}static compareByLabel(e,t){return dm(e.label.label,t.label.label)}}let pbe=class{constructor(e,t,i){this._languageService=e,this._snippets=t,this._languageConfigurationService=i,this._debugDisplayName="snippetCompletions"}async provideCompletionItems(e,t,i){const n=new js,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===$u.TriggerCharacter&&!v.prefixLow.startsWith(h))continue;let b;for(const R of l)if(!(R.prefixLow.match(/^\s/)&&!v.prefixLow.match(/^\s/))&&RQe(R.prefixLow,0,R.prefixLow.length,v.prefixLow,0,v.prefixLow.length)){b=R;break}if(!b)continue;const w=b.startColumn-1,y=v.prefixLow.length-(d-w),C=yre(a,v.prefixLow,d,d+y,d-w),A=t.with(void 0,w+1);let L=C===0?t.column+y:t.column;dG.open===a[A.column-1]&&v.prefix.startsWith(G.open)&&v.prefix[v.prefix.length-1]===G.close)&&L++;const k=F.fromPositions({lineNumber:o,column:b.startColumn},{lineNumber:o,column:L}),P=k.setEndPosition(o,t.column);m.push(new uV(v,{replace:k,insert:P})),p.delete(v)}if(!h&&(/\s/.test(a[t.column-2])||!a))for(const v of p){const b=F.fromPositions(t),w=a.indexOf(v.prefixLow,d)===d?b.setEndPosition(t.lineNumber,t.column+v.prefixLow.length):b;m.push(new uV(v,{replace:w,insert:b}))}return this._disambiguateSnippets(m),{suggestions:m,duration:n.elapsed()}}_disambiguateSnippets(e){e.sort(uV.compareByLabel);for(let t=0;tt+1&&(e[t].label.label=g(6749,"{0}, {1}",e[t].label.label,e[t].snippet.name),t=n)}}resolveCompletionItem(e){return e instanceof uV?e.resolve():e}_computeSnippetPositions(e,t,i,n){const o=[];for(let r=1;r0||o.length===0)&&o.push({startColumn:i.startColumn,prefixLow:n.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}};pbe=D([_(0,xi),_(1,Uae),_(2,Vs)],pbe);var tQ,iQ,dX;(function(s){function e(t,i,n){if(zu(i.path))return t.collector.error(g(2991,"Expected string in `contributes.{0}.path`. Provided value: {1}",t.description.name,String(i.path))),null;if(zu(i.language)&&!i.path.endsWith(".code-snippets"))return t.collector.error(g(2992,"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(!zu(i.language)&&!n.isRegisteredLanguageId(i.language))return t.collector.error(g(2993,"Unknown language in `contributes.{0}.language`. Provided value: {1}",t.description.name,String(i.language))),null;const o=t.description.extensionLocation,r=Pt(o,i.path);return $y(r,o)?{language:i.language,location:r}:(t.collector.error(g(2994,"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)}s.toValidSnippet=e,s.snippetsContribution={description:g(2995,"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(2996,"Language identifier for which this snippet is contributed to."),type:"string"},path:{description:g(2997,"Path of the snippets file. The path is relative to the extension folder and typically starts with './snippets/'."),type:"string"}}}},s.point=Xd.registerExtensionPoint({extensionPoint:"snippets",deps:[mW],jsonSchema:s.snippetsContribution})})(dX||(dX={}));function ANt(s,e,t){return jr(s.watch(e),s.onDidFilesChange(i=>{i.affects(e)&&t()}))}var AL;let mbe=(AL=class{constructor(e){this._storageService=e;const t=e.get(tQ._key,Ie.PROFILE,"");let i;try{i=JSON.parse(t)}catch{}this._ignored=m6e(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(tQ._key,JSON.stringify(Array.from(this._ignored)),Ie.PROFILE,an.USER)}},tQ=AL,AL._key="snippets.ignoredSnippets",AL);mbe=tQ=D([_(0,$i)],mbe);var EL;let _be=(EL=class{constructor(e){this._storageService=e;const t=e.get(iQ._key,Ie.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(iQ._key,JSON.stringify(t),Ie.PROFILE,an.USER)}},iQ=EL,EL._key="snippets.usageTimestamps",EL);_be=iQ=D([_(0,$i)],_be);let GHe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this._environmentService=e,this._userDataProfileService=t,this._contextService=i,this._languageService=n,this._logService=o,this._fileService=r,this._textfileService=a,this._extensionResourceLoaderService=c,this._disposables=new Z,this._pendingWork=[],this._files=new ui,this._pendingWork.push(Promise.resolve(l.when(Rs.Restored).then(()=>{this._initExtensionSnippets(),this._initUserSnippets(),this._initWorkspaceSnippets()}))),fMt(new pbe(this._languageService,this,h)),this._enablement=d.createInstance(mbe),this._usageTimestamps=d.createInstance(_be)}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=[],n=[];if(e){if(this._languageService.isRegisteredLanguageId(e))for(const o of this._files.values())n.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())n.push(o.load().then(r=>u6e(i,i.length,r.data)).catch(r=>this._logService.error(r,o.location.toString())));return await Promise.all(n),this._filterAndSortSnippets(i,t)}getSnippetsSync(e,t){const i=[];if(this._languageService.isRegisteredLanguageId(e))for(const n of this._files.values())n.load().catch(o=>{}),n.select(e,i);return this._filterAndSortSnippets(i,t)}_filterAndSortSnippets(e,t){const i=[];for(const n of e)!n.prefix&&!t?.includeNoPrefixSnippets||!this.isEnabled(n)&&!t?.includeDisabledSnippets||typeof t?.fileTemplateSnippets=="boolean"&&t.fileTemplateSnippets!==n.isFileTemplate||i.push(n);return i.sort((n,o)=>{let r=0;if(!t?.noRecencySort){const a=this._usageTimestamps.getUsageTimestamp(n.snippetIdentifier)??-1;r=(this._usageTimestamps.getUsageTimestamp(o.snippetIdentifier)??-1)-a}return r===0&&(r=this._compareSnippet(n,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===Ow.Extension&&this._files.delete(t);for(const t of e)for(const i of t.value){const n=dX.toValidSnippet(t,i,this._languageService);if(!n)continue;const o=this._files.get(n.location);if(o)o.defaultScopes?o.defaultScopes.push(n.language):o.defaultScopes=[];else{const r=new Uhe(Ow.Extension,n.location,n.language?[n.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(2998,"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(2999,'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 n=>{const o=n.toResource(".vscode");await this._fileService.exists(o)?this._initFolderSnippets(Ow.Workspace,o,t):t.add(this._fileService.onDidFilesChange(a=>{a.contains(o,To.ADDED)&&this._initFolderSnippets(Ow.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(Ow.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 n=new Z,o=async()=>{if(n.clear(),!!await this._fileService.exists(t))try{const r=await this._fileService.resolve(t);for(const a of r.children||[])n.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=>{$y(r.model.resource,t)&&o()})),i.add(ANt(this._fileService,t,o)),i.add(n),o()}_addSnippetFile(e,t){const i=gU(e);if(t===Ow.User&&i===".json"){const n=_i(e).replace(/\.json/,"");this._files.set(e,new Uhe(t,e,[n],void 0,this._fileService,this._extensionResourceLoaderService))}else i===".code-snippets"&&this._files.set(e,new Uhe(t,e,void 0,void 0,this._fileService,this._extensionResourceLoaderService));return{dispose:()=>this._files.delete(e)}}};GHe=D([_(0,Za),_(1,lg),_(2,yi),_(3,xi),_(4,Ge),_(5,Jt),_(6,Fo),_(7,Rae),_(8,Zu),_(9,we),_(10,Vs)],GHe);function ENt(s,e){const i=s.getLineContent(e.lineNumber).substr(0,e.column-1),n=Math.max(0,i.length-100);for(let o=i.length-1;o>=n;o--){const r=i.charAt(o);if(/\s/.test(r))return i.substr(o+1)}return n===0?i:""}var nQ,PD;let MA=(PD=class{static get(e){return e.getContribution(nQ.ID)}constructor(e,t,i,n,o){this._editor=e,this._snippetService=t,this._clipboardService=i,this._languageFeaturesService=n,this._activeSnippets=[],this._hasSnippets=nQ.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),n=this._snippetService.getSnippetsSync(i);if(!n){this._hasSnippets.set(!1);return}if(F.isEmpty(e)){const r=ENt(t,e.getPosition());if(r)for(const a of n)r.endsWith(a.prefix)&&this._activeSnippets.push(a)}else if(!F.spansMultipleLines(e)&&t.getValueLengthInRange(e)<=100){const r=t.getValueInRange(e);if(r)for(const a of n)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=F.fromPositions(c.delta(0,-d.prefix.length),c);return new uV(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 xae(this._editor,jo.Value|jo.Position);if(t=await this._clipboardService.readText(),!i.validate(this._editor))return}fc.get(this._editor)?.insert(e.codeSnippet,{overwriteBefore:e.prefix.length,overwriteAfter:0,clipboardText:t})}else this._activeSnippets.length>1&&this._completionProvider&&OXe(this._editor,this._completionProvider)}},nQ=PD,PD.ID="editor.tabCompletionController",PD.ContextKey=new Y("hasSnippetCompletions",void 0),PD);MA=nQ=D([_(1,Uae),_(2,ag),_(3,it),_(4,Le)],MA);on(MA.ID,MA,ri.Eager);const xNt=hc.bindToContribution(MA.get);qe(new xNt({id:"insertSnippet",precondition:MA.ContextKey,handler:s=>s.performSnippetCompletions(),kbOpts:{weight:Ae.EditorContrib,kbExpr:he.and(J.editorTextFocus,J.tabDoesNotMoveFocus,fc.InSnippetMode.toNegated()),primary:S.Tab}}));var S_;(function(s){s.activeCursorHasCommentingRange=new Y("activeCursorHasCommentingRange",!1,{description:g(5301,"Whether the position at the active cursor has a commenting range"),type:"boolean"}),s.activeEditorHasCommentingRange=new Y("activeEditorHasCommentingRange",!1,{description:g(5302,"Whether the active editor has a commenting range"),type:"boolean"}),s.WorkspaceHasCommenting=new Y("workspaceHasCommenting",!1,{description:g(5303,"Whether the open workspace has either comments or commenting ranges."),type:"boolean"}),s.commentThreadIsEmpty=new Y("commentThreadIsEmpty",!1,{type:"boolean",description:g(5304,"Set when the comment thread has no comments")}),s.commentIsEmpty=new Y("commentIsEmpty",!1,{type:"boolean",description:g(5305,"Set when the comment has no input")}),s.commentContext=new Y("comment",void 0,{type:"string",description:g(5306,"The context value of the comment")}),s.commentThreadContext=new Y("commentThread",void 0,{type:"string",description:g(5307,"The context value of the comment thread")}),s.commentControllerContext=new Y("commentController",void 0,{type:"string",description:g(5308,"The comment controller id associated with a comment thread")}),s.commentFocused=new Y("commentFocused",!1,{type:"boolean",description:g(5309,"Set when the comment is focused")})})(S_||(S_={}));function z6(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function DNt(s,e,t){const i={id:ar(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class oce{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 hi.some(this,([i,n])=>n.asFile())&&t.push("files"),YXe(hX(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 hX(e)}}function hX(s){return s.toLowerCase()}function jXe(s,e){return YXe(hX(s),e.map(hX))}function YXe(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,o]=t;return o==="*"?e.some(r=>r.startsWith(n+"/")):!1}const Qk=Object.freeze({create:s=>ja(s.map(e=>e.toString())).join(`\r `),split:s=>s.split(`\r -`),parse:s=>Zk.split(s).filter(e=>!e.startsWith("#"))}),Ew=class Ew{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+Ew.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Ew((this.value?[this.value,...e]:e).join(Ew.sep))}};Ew.sep=".",Ew.None=new Ew("@@none@@"),Ew.Empty=new Ew("");let Yn=Ew;var Yp;(function(s){function e(o){return typeof o?.showDirectoryPicker=="function"}s.supported=e;function t(o){const r=o;return r?typeof r.kind=="string"&&typeof r.queryPermission=="function"&&typeof r.requestPermission=="function":!1}s.isFileSystemHandle=t;function i(o){return o.kind==="file"}s.isFileSystemFileHandle=i;function n(o){return o.kind==="directory"}s.isFileSystemDirectoryHandle=n})(Yp||(Yp={}));class WNt{get capabilities(){return this._capabilities||(this._capabilities=Vn.FileReadWrite|Vn.FileReadStream,pr&&(this._capabilities|=Vn.PathCaseSensitive)),this._capabilities}constructor(e,t,i){this.indexedDB=e,this.store=t,this.logService=i,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.extUri=pr?xn:Rre,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",ot.FileNotFound);if(Yp.isFileSystemFileHandle(t)){const i=await t.getFile();return{type:sn.File,mtime:i.lastModified,ctime:0,size:i.size}}return{type:sn.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",ot.FileNotFound);const i=[];for await(const[n,o]of t)i.push([n,Yp.isFileSystemFileHandle(o)?sn.File:sn.Directory]);return i}catch(t){throw this.toFileSystemProviderError(t)}}readFileStream(e,t,i){const n=jA(o=>$e.concat(o.map(r=>$e.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",ot.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)),n.end(a)}else{const a=r.stream().getReader();let c=await a.read();for(;!c.done&&!(i.isCancellationRequested||(await n.write(c.value),i.isCancellationRequested));)c=await a.read();n.end(void 0)}}catch(o){n.error(this.toFileSystemProviderError(o)),n.end()}})(),n}async readFile(e){try{const t=await this.getFileHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",ot.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 n=await this.getFileHandle(e);if(!i.create||!i.overwrite){if(n){if(!i.overwrite)throw this.createFileSystemProviderError(e,"File already exists, writeFile",ot.FileExists)}else if(!i.create)throw this.createFileSystemProviderError(e,"No such file, writeFile",ot.FileNotFound)}if(!n){const r=await this.getDirectoryHandle(this.extUri.dirname(e));if(!r)throw this.createFileSystemProviderError(e,"No such parent directory, writeFile",ot.FileNotFound);if(n=await r.getFileHandle(this.extUri.basename(e),{create:!0}),!n)throw this.createFileSystemProviderError(e,"Unable to create file , writeFile",ot.Unknown)}const o=await n.createWritable();await o.write(t),await o.close()}catch(n){throw this.toFileSystemProviderError(n)}}async mkdir(e){try{const t=await this.getDirectoryHandle(this.extUri.dirname(e));if(!t)throw this.createFileSystemProviderError(e,"No such parent directory, mkdir",ot.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",ot.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 n=await this.getFileHandle(e);if(n){const o=await n.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(607,"Rename is only supported for files."),ot.Unavailable)}catch(n){throw this.toFileSystemProviderError(n)}}watch(e,t){return V.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 n=Gy(e.name),o=Ko(e.name,n);let r=1;do i=`/${o}-${r++}${n}`;while(t.has(i)&&!await t.get(i)?.isSameEntry(e))}t.set(i,e);try{await this.indexedDB?.runInTransaction(this.store,"readwrite",n=>n.put(e,i))}catch(n){this.logService.error(n)}return N.from({scheme:pe.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 n=xn.basename(e);try{t=await i.getFileHandle(n)}catch{try{t=await i.getDirectoryHandle(n)}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(xn.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 n=await this.getDirectoryHandle(i);try{return await n?.getDirectoryHandle(xn.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 n=await this.indexedDB?.runInTransaction(this.store,"readonly",o=>o.get(t));if(Yp.isFileSystemHandle(n)){let o=await n.queryPermission()==="granted";try{o||(o=await n.requestPermission()==="granted")}catch(r){this.logService.error(r)}if(o)return Yp.isFileSystemFileHandle(n)?this._files.set(t,n):Yp.isFileSystemDirectoryHandle(n)&&this._directories.set(t,n),n}throw this.createFileSystemProviderError(e,"No file system handle registered",ot.Unavailable)}toFileSystemProviderError(e){if(e instanceof xA)return e;let t=ot.Unknown;return e.name==="NotAllowedError"&&(e=new Error(g(608,"Insufficient permissions. Please retry and allow the operation.")),t=ot.Unavailable),us(e,t)}createFileSystemProviderError(e,t,i){return us(new Error(`${t} (${Rk(e.path)})`),i)}}const PM={EDITORS:"CodeEditors",FILES:"CodeFiles"};function HNt(s){const e=[];if(s.dataTransfer&&s.dataTransfer.types.length>0){const n=s.dataTransfer.getData(PM.EDITORS);if(n)try{e.push(...j2(n))}catch{}else try{const a=s.dataTransfer.getData(sp.RESOURCES);e.push(...UNt(a))}catch{}if(s.dataTransfer?.files)for(let a=0;aVNt(r,e));for(const r of o)t.push({resource:r.resource,contents:r.contents?.toString(),isExternal:!0,allowWorkspaceOpen:r.isDirectory})}return t}function UNt(s){const e=[];if(s){const t=JSON.parse(s);for(const i of t)if(i.indexOf(":")>0){const{selection:n,uri:o}=KLe(N.parse(i));e.push({resource:o,options:{selection:n}})}}return e}async function VNt(s,e){if(Yp.supported(si)){const i=e.dataTransfer?.items;if(i)return zNt(s,i)}const t=e.dataTransfer?.files;return t?$Nt(s,t):[]}async function zNt(s,e){const t=s.get(Jt).getProvider(pe.file);if(!(t instanceof WNt))return[];const i=[];for(let n=0;n{try{const a=await o.getAsFileSystemHandle();if(!a){r.complete(void 0);return}Yp.isFileSystemFileHandle(a)?r.complete({resource:await t.registerFileHandle(a),isDirectory:!1}):Yp.isFileSystemDirectoryHandle(a)?r.complete({resource:await t.registerDirectoryHandle(a),isDirectory:!0}):r.complete(void 0)}catch{r.complete(void 0)}})()}}return Fi(await Promise.all(i.map(n=>n.p)))}async function $Nt(s,e){const t=s.get(to),i=[];for(let n=0;n100*Nc.MB){t.warn(g(5675,"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 dc;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:N.from({scheme:pe.untitled,path:l}),contents:typeof d=="string"?$e.fromString(d):$e.wrap(new Uint8Array(d))})},a.readAsArrayBuffer(o)}}return Fi(await Promise.all(i.map(n=>n.p)))}function rZe(s,...e){if(!s.dataTransfer)return!1;const t=s.dataTransfer.types,i=[];for(let n=0;n=0)return!0;return!1}class GNt{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 AMe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Qe.add(AMe.DragAndDropContribution,new GNt);const Kz=class Kz{constructor(){}static getInstance(){return Kz.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)}};Kz.INSTANCE=new Kz;let fX=Kz;function aZe(s){const e=new lce;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(o=>t.getAsString(o));e.append(i,q6(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,KNt(n))}}return e}function KNt(s){const e=s.path?N.parse(s.path):void 0;return BNt(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const qNt=Object.freeze([PM.EDITORS,PM.FILES,sp.RESOURCES,sp.INTERNAL_URI_LIST]);function cZe(s,e=!1){const t=aZe(s),i=t.get(sp.INTERNAL_URI_LIST);if(i)t.replace(Us.uriList,i);else if(e||!t.has(Us.uriList)){const n=[];for(const o of s.items){const r=o.getAsFile();if(r){const a=r.path;try{a?n.push(N.file(a).toString()):n.push(N.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(Us.uriList,q6(Zk.create(n)))}for(const n of qNt)t.delete(n);return t}class EMe{async provideDocumentPasteEdits(e,t,i,n,o){const r=await this.getEdit(i,o);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const o=await this.getEdit(i,n);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}const ZF=class ZF extends EMe{constructor(){super(...arguments),this.id=ZF.id,this.kind=ZF.kind,this.dropMimeTypes=[Us.text],this.pasteMimeTypes=[Us.text]}async getEdit(e,t){const i=e.get(Us.text);if(!i||e.has(Us.uriList))return;const n=await i.asString();return{handledMimeType:Us.text,title:g(5042,"Insert Plain Text"),insertText:n,kind:this.kind}}};ZF.id="text",ZF.kind=new Yn("text.plain");let FM=ZF;class lZe extends EMe{constructor(){super(...arguments),this.kind=new Yn("uri.absolute"),this.dropMimeTypes=[Us.uriList],this.pasteMimeTypes=[Us.uriList]}async getEdit(e,t){const i=await dZe(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map(({uri:a,originalText:c})=>a.scheme===pe.file?a.fsPath:(n++,c)).join(" ");let r;return n>0?r=i.length>1?g(5043,"Insert Uris"):g(5044,"Insert Uri"):r=i.length>1?g(5045,"Insert Paths"):g(5046,"Insert Path"),{handledMimeType:Us.uriList,insertText:o,title:r,kind:this.kind}}}let pX=class extends EMe{constructor(e){super(),this._workspaceContextService=e,this.kind=new Yn("uri.relative"),this.dropMimeTypes=[Us.uriList],this.pasteMimeTypes=[Us.uriList]}async getEdit(e,t){const i=await dZe(e);if(!i.length||t.isCancellationRequested)return;const n=Fi(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?DN(r.uri,o):void 0}));if(n.length)return{handledMimeType:Us.uriList,insertText:n.join(" "),title:i.length>1?g(5047,"Insert Relative Paths"):g(5048,"Insert Relative Path"),kind:this.kind}}};pX=D([_(0,yi)],pX);class QNt{constructor(){this.kind=new Yn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Us.text}]}async provideDocumentPasteEdits(e,t,i,n,o){if(n.triggerKind!==b8.PasteAs&&!n.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(5049,"Insert HTML"),kind:this.kind}]}}}async function dZe(s){const e=s.get(Us.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of Zk.parse(t))try{i.push({uri:N.parse(n),originalText:n})}catch{}return i}let Abe=class extends V{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new FM)),this._register(e.documentDropEditProvider.register("*",new lZe)),this._register(e.documentDropEditProvider.register("*",new pX(t)))}};Abe=D([_(0,it),_(1,yi)],Abe);let Ebe=class extends V{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new FM)),this._register(e.documentPasteEditProvider.register("*",new lZe)),this._register(e.documentPasteEditProvider.register("*",new pX(t))),this._register(e.documentPasteEditProvider.register("*",new QNt))}};Ebe=D([_(0,it),_(1,yi)],Ebe);function hZe(s,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new tA(s,{range:i,text:typeof t.insertText=="string"?X_.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function uZe(s){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 s)for(const a of r.yieldTo??[])for(const c of s)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(s);const i=new Set,n=[];function o(r){if(!r.length)return[];const a=r[0];if(n.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&&(n.push(a),c=o(l),n.pop()),i.add(a),[...c,a,...o(r.slice(1))]}return o(Array.from(s))}var jNt=".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)}";ut(jNt,{});const YNt=Gt.register({description:"inline-progress-widget",stickiness:ni.NeverGrowsWhenTypingAtEdges,showIfCollapsed:!0,after:{content:X6e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Rse=class Rse extends V{constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=fe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=fe("span.icon");this.domNode.append(t),t.classList.add(...We.asClassNameArray(ve.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(x.lineHeight);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(x.fontSize)||n.hasChanged(x.lineHeight))&&i()})),this._register(ue(this.domNode,ke.CLICK,n=>{this.delegate.cancel()}))}getId(){return Rse.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[es.EXACT]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};Rse.baseId="editor.widget.inlineProgressWidget";let xbe=Rse,mX=class extends V{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new wn),this._currentWidget=this._register(new wn),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,o){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=jy(()=>{const a=F.fromPositions(e);this._currentDecorations.set([{range:a,options:YNt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(xbe,this.id,this._editor,a,t,n))},o??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};mX=D([_(2,we)],mX);var JNt=".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}";ut(JNt,{});var rQ,UD;let Lh=(UD=class{static get(e){return e.getContribution(rQ.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new wn,this._messageListeners=new Z,this._mouseOverMessage=!1,this._editor=e,this._visible=rQ.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){Mr(dd(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=dd(e)?f6(e,{actionHandler:{callback:n=>{this.closeMessage(),uae(this._openerService,n,dd(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new sUe(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(M.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&wc(Bc(),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(ue(this._messageWidget.value.getDomNode(),ke.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),ke.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new F(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(sUe.fadeOut(this._messageWidget.value))}},rQ=UD,UD.ID="editor.contrib.messageController",UD.MESSAGE_VISIBLE=new Q("messageVisible",!1,g(5105,"Whether the editor is currently showing an inline message")),UD);Lh=rQ=D([_(1,Le),_(2,Ao)],Lh);const XNt=hc.bindToContribution(Lh.get);qe(new XNt({id:"leaveEditorMessage",precondition:Lh.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:Ae.EditorContrib+30,primary:S.Escape}}));let sUe=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},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,mt.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 n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),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:[es.ABOVE,es.BELOW],positionAffinity:Io.Right}}afterRender(e){this._domNode.classList.toggle("below",e===es.BELOW)}};on(Lh.ID,Lh,ri.Lazy);var ud;(function(s){s[s.Explorer=1]="Explorer",s[s.Scm=3]="Scm",s[s.Extensions=5]="Extensions",s[s.Window=10]="Window",s[s.Notification=15]="Notification",s[s.Dialog=20]="Dialog"})(ud||(ud={}));const oFe=class oFe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};oFe.None=Object.freeze({report(){}});let lu=oFe,oUe=class extends V{constructor(e,t){super(),this.deferred=new dc,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}};oUe=D([_(1,cg)],oUe);var ZNt=".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}";ut(ZNt,{});var Dbe,TL;let kbe=(TL=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,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(M.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=fe(".post-edit-widget"),this.button=this._register(new Jd(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ue(this.domNode,ke.CLICK,()=>this.showSelector()))}getId(){return Dbe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[es.BELOW]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Cr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>rl({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Dbe=TL,TL.baseId="editor.widget.postEditWidget",TL);kbe=Dbe=D([_(7,lr),_(8,Le),_(9,Ut)],kbe);let _X=class extends V{constructor(e,t,i,n,o,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=o,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new wn),this._register(M.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,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 b=this._editor.getModel();b&&(await b.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,n,o))},l=(v,b)=>{Fr(v)||(this._notificationService.error(b),i&&this.show(e[0],t,c))};let d;try{d=await n(a,o)}catch(v){return l(v,g(9845,`Error resolving edit '{0}': -{1}`,a.title,Nr(v)))}if(o.isCancellationRequested)return;const h=hZe(r.uri,e,d),u=e[0],f=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:ni.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(9846,`Error applying edit '{0}': -{1}`,a.title,Nr(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(kbe,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};_X=D([_(4,we),_(5,PN),_(6,bi)],_X);var l0;const gZe="editor.changePasteType",xMe=new Q("pasteWidgetVisible",!1,g(4993,"Whether the paste widget is showing")),jhe="application/vnd.code.copyMetadata";var LL;let sC=(LL=class extends V{static get(e){return e.getContribution(l0.ID)}constructor(e,t,i,n,o,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const c=e.getContainerDomNode();this._register(ue(c,"copy",l=>this.handleCopy(l))),this._register(ue(c,"cut",l=>this.handleCopy(l))),this._register(ue(c,"paste",l=>this.handlePaste(l),!0)),this._pasteProgressManager=this._register(new mX("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(_X,"pasteIntoEditor",e,xMe,{id:gZe,label:g(4994,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Hu().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()||(Wn&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!i?.length)return;const n=this._editor.getOption(x.emptySelectionClipboard);let o=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!n)return;o=[new F(o[0].startLineNumber,1,o[0].startLineNumber,1+t.getLineLength(o[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,n,Qn),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=aZe(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=ar();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=Rr(async m=>{const v=Fi(await Promise.all(d.map(async b=>{try{return await b.prepareDocumentPaste(t,o,h,m)}catch(w){console.error(w);return}})));v.reverse();for(const b of v)for(const[w,y]of b)h.replace(w,y);return h});l0._currentCopyOperation?.dataTransferPromise.cancel(),l0._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Lh.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 n=this.fetchCopyMetadata(e),o=cZe(e.clipboardData);o.delete(jhe);const r=[...e.clipboardData.types,...n?.providerCopyMimeTypes??[],Us.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=>nZe(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,n):this.doPasteInline(a,i,o,n,e)}showPasteAsNoEditMessage(e,t){Lh.get(this._editor)?.showMessage(g(4995,"No paste edits for '{0}' found",t instanceof Yn?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,n,o){const r=this._editor;if(!r.hasModel())return;const a=new Jk(r,jo.Value|jo.Selection,void 0),c=Rr(async l=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new Z,f=u.add(new ci(l));u.add(a.token.onCancellationRequested(()=>f.cancel()));const p=f.token;try{if(await this.mergeInDataFromCopy(i,n,p),p.isCancellationRequested)return;const m=e.filter(w=>this.isSupportedPasteProvider(w,i));if(!m.length||m.length===1&&m[0]instanceof FM)return this.applyDefaultPasteHandler(i,n,p,o);const v={triggerKind:b8.Automatic},b=await this.getPasteEdits(m,i,h,t,v,p);if(u.add(b),p.isCancellationRequested)return;if(b.edits.length===1&&b.edits[0].provider instanceof FM)return this.applyDefaultPasteHandler(i,n,p,o);if(b.edits.length){const w=d.getOption(x.pasteAs).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:b.edits},w,(y,C)=>new Promise((A,L)=>{(async()=>{try{const k=y.provider.resolveDocumentPasteEdit?.(y,C),P=new dc,R=k&&await this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(4996,"Resolving paste edit. Click to cancel"),Promise.race([P.p,k]),{cancel:()=>(P.cancel(),L(new Ma))},0);return R&&(y.additionalEdit=R.additionalEdit),A(y)}catch(k){return L(k)}})()}),p)}await this.applyDefaultPasteHandler(i,n,p,o)}finally{u.dispose(),this._currentPasteOperation===c&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(4997,"Running paste handlers. Click to cancel and do basic paste"),c,{cancel:async()=>{try{if(c.cancel(),a.token.isCancellationRequested)return;await this.applyDefaultPasteHandler(i,n,a.token,o)}finally{a.dispose()}}}).then(()=>{a.dispose()}),this._currentPasteOperation=c}showPasteAsPick(e,t,i,n,o){const r=Rr(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new Z,h=d.add(new Jk(c,jo.Value|jo.Selection,void 0,a));try{if(await this.mergeInDataFromCopy(n,o,h.token),h.token.isCancellationRequested)return;let u=t.filter(b=>this.isSupportedPasteProvider(b,n,e));e&&(u=u.filter(b=>this.providerMatchesPreference(b,e)));const f={triggerKind:b8.PasteAs,only:e&&e instanceof Yn?e:void 0};let p=d.add(await this.getPasteEdits(u,n,l,i,f,h.token));if(h.token.isCancellationRequested)return;if(e&&(p={edits:p.edits.filter(b=>e instanceof Yn?e.contains(b.kind):e.providerId===b.provider.id),dispose:p.dispose}),!p.edits.length){f.only&&this.showPasteAsNoEditMessage(i,f.only);return}let m;if(e?m=p.edits.at(0):m=(await this._quickInputService.pick(p.edits.map(w=>({label:w.title,description:w.kind?.value,edit:w})),{placeHolder:g(4998,"Select Paste Action")}))?.edit,!m)return;const v=hZe(l.uri,i,m);await this._bulkEditService.apply(v,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:ud.Window,title:g(4999,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(jhe,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(jhe);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=eme.getTextData(e.clipboardData);if(n)return{defaultPastePayload:{mode:n.mode,multicursorText:n.multicursorText??null,pasteOnNewLine:!!n.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){if(t?.id&&l0._currentCopyOperation?.handle===t.id){const n=await l0._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,r]of n)e.replace(o,r)}if(!e.has(Us.uriList)){const n=await this._clipboardService.readResources();if(i.isCancellationRequested)return;n.length&&e.append(Us.uriList,q6(Zk.create(n)))}}async getPasteEdits(e,t,i,n,o,r){const a=new Z,c=await U_(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentPasteEdits?.(i,n,t,o,r);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:d}))}catch(h){Fr(h)||console.error(h);return}})),r),l=Fi(c??[]).flat().filter(d=>!o.only||o.only.contains(d.kind));return{edits:uZe(l),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const r=await(e.get(Us.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._editor.trigger("keyboard",oc.Paste,a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(n=>t.matches(n))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof Yn?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},l0=LL,LL.ID="editor.contrib.copyPasteActionController",LL);sC=l0=D([_(1,we),_(2,PN),_(3,dg),_(4,it),_(5,In),_(6,cg)],sC);const ys=new class{constructor(){this.QuickFix=new Yn("quickfix"),this.Refactor=new Yn("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 Yn("notebook"),this.Source=new Yn("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var sd;(function(s){s.IfSingle="ifSingle",s.First="first",s.Never="never"})(sd||(sd={}));var sg;(function(s){s.Refactor="refactor",s.RefactorPreview="refactor preview",s.Lightbulb="lightbulb",s.Default="other (default)",s.SourceAction="source action",s.QuickFix="quick fix action",s.FixAll="fix all",s.OrganizeImports="organize imports",s.AutoFix="auto fix",s.QuickFixHover="quick fix hover window",s.OnSave="save participants",s.ProblemsView="problems view"})(sg||(sg={}));function ePt(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>fZe(e,t,s.include))||!s.includeSourceActions&&ys.Source.contains(e))}function tPt(s,e){const t=e.kind?new Yn(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>fZe(t,i,s.include))||!s.includeSourceActions&&t&&ys.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function fZe(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class qw{static fromUser(e,t){return!e||typeof e!="object"?new qw(t.kind,t.apply,!1):new qw(qw.getKindFromUser(e,t.kind),qw.getApplyFromUser(e,t.apply),qw.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return sd.First;case"never":return sd.Never;case"ifsingle":return sd.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Yn(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 iPt{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){No(i)}t&&(this.action.edit=t.edit)}return this}}const DMe="editor.action.codeAction",kMe="editor.action.quickFix",pZe="editor.action.autoFix",IMe="editor.action.refactor",TMe="editor.action.sourceAction",Ibe="editor.action.organizeImports",Tbe="editor.action.fixAll";class B5 extends V{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:eo(e.diagnostics)?eo(t.diagnostics)?B5.codeActionsPreferredComparator(e,t):-1:eo(t.diagnostics)?1:B5.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(B5.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ys.QuickFix.contains(new Yn(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 rUe={actions:[],documentation:void 0};async function ZO(s,e,t,i,n,o){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],ys.Notebook]},c={only:r.include?.value,trigger:i.type},l=new TRe(e,o),d=i.type===Ch.Auto,h=nPt(s,e,d?a:r),u=new Z,f=h.map(async m=>{try{n.report(m);const v=await m.provideCodeActions(e,t,c,l.token);if(v&&u.add(v),l.token.isCancellationRequested)return rUe;const b=(v?.actions||[]).filter(y=>y&&tPt(r,y)),w=oPt(m,b,r.include);return{actions:b.map(y=>new iPt(y,m)),documentation:w}}catch(v){if(Fr(v))throw v;return No(v),rUe}}),p=s.onDidChange(()=>{const m=s.all(e);is(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(w=>w.actions).flat(),b=[...Fi(m.map(w=>w.documentation)),...sPt(s,e,i,v)];return new B5(v,b,u)}finally{p.dispose(),l.dispose()}}function nPt(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>ePt(t,new Yn(n))):!0)}function*sPt(s,e,t,i){if(e&&i.length)for(const n of s.all(e))n._getAdditionalMenuItems&&(yield*n._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(o=>o.action)))}function oPt(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new Yn(n.kind),command:n.command}));if(t){let n;for(const o of i)o.kind.contains(t)&&(n?n.kind.contains(o.kind)&&(n=o):n=o);if(n)return n?.command}for(const n of e)if(n.kind){for(const o of i)if(o.kind.contains(new Yn(n.kind)))return o.command}}var Nx;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions",s.FromAILightbulb="fromAILightbulb"})(Nx||(Nx={}));async function mZe(s,e,t,i,n=He.None){const o=s.get(PN),r=s.get(vi),a=s.get(Yi),c=s.get(bi);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.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!==Nx.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=rPt(l);c.error(typeof d=="string"?d:g(4521,"An unknown error occurred while applying the code action"))}}function rPt(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}_t.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,n){if(!(e instanceof N))throw Pi();const{codeActionProvider:o}=s.get(it),r=s.get(gi).getModel(e);if(!r)throw Pi();const a=dt.isISelection(t)?dt.liftSelection(t):F.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Pi();const c=typeof i=="string"?new Yn(i):void 0,l=await ZO(o,r,a,{type:Ch.Invoke,triggerAction:sg.Default,filter:{includeSourceActions:!0,include:c}},lu.None,He.None),d=[],h=Math.min(l.validActions.length,typeof n=="number"?n:0);for(let u=0;uu.action)}finally{setTimeout(()=>l.dispose(),100)}});var Lbe,RL;let Rbe=(RL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new ya(()=>this.keybindingService.getKeybindings().filter(t=>Lbe.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Ibe?i={kind:ys.SourceOrganizeImports.value}:t.command===Tbe&&(i={kind:ys.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...qw.fromUser(i,{kind:Yn.None,apply:sd.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Yn(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}},Lbe=RL,RL.codeActionCommands=[IMe,DMe,TMe,Ibe,Tbe],RL);Rbe=Lbe=D([_(0,Ut)],Rbe);var aPt='.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}';ut(aPt,{});const _Ze="acceptSelectedCodeAction",vZe="previewSelectedCodeAction";var p_;(function(s){s.Action="action",s.Header="header"})(p_||(p_={}));class cPt{get templateId(){return p_.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 Mbe=class{get templateId(){return p_.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 n=new qk(e,po);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=We.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=ze(e.group.icon.color.id))):(i.icon.className=We.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=bZe(e.label),i.keybinding.set(e.keybinding),uTe(!!e.keybinding,i.keybinding.element);const n=this._keybindingService.lookupKeybinding(_Ze)?.getLabel(),o=this._keybindingService.lookupKeybinding(vZe)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:n&&o?this._supportsPreview&&e.canPreview?i.container.title=g(11229,"{0} to Apply, {1} to Preview",n,o):i.container.title=g(11230,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};Mbe=D([_(1,Ut)],Mbe);class lPt extends UIEvent{constructor(){super("acceptSelectedAction")}}class aUe extends UIEvent{constructor(){super("previewSelectedAction")}}function dPt(s){if(s.kind==="action")return s.label}let Nbe=class extends V{constructor(e,t,i,n,o,r){super(),this._delegate=n,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new ci),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===p_.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Xa(e,this.domNode,a,[new Mbe(t,this._keybindingService),new cPt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:dPt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===p_.Action){let l=c.label?bZe(c?.label):"";return c.disabled&&(l=g(11231,"{0}, Disabled Reason: {1}",l,c.disabled)),l}return null},getWidgetAriaLabel:()=>g(11232,"Action Widget"),getRole:c=>c.kind===p_.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(ON),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===p_.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,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);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(n,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],n=this._list.element(i);if(!this.focusCondition(n))return;const o=e?new aUe:new lPt;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 aUe):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===p_.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([])}};Nbe=D([_(4,mf),_(5,Ut)],Nbe);function bZe(s){return s.replace(/\r\n|\r|\n/g," ")}const wZe=Object.freeze({kind:Yn.Empty,title:g(9847,"More Actions...")}),hPt=Object.freeze([{kind:ys.QuickFix,title:g(9848,"Quick Fix")},{kind:ys.RefactorExtract,title:g(9849,"Extract"),icon:ve.wrench},{kind:ys.RefactorInline,title:g(9850,"Inline"),icon:ve.wrench},{kind:ys.RefactorRewrite,title:g(9851,"Rewrite"),icon:ve.wrench},{kind:ys.RefactorMove,title:g(9852,"Move"),icon:ve.wrench},{kind:ys.SurroundWith,title:g(9853,"Surround With"),icon:ve.surroundWith},{kind:ys.Source,title:g(9854,"Source Action"),icon:ve.symbolFile},wZe]);function uPt(s,e,t){if(!e)return s.map(o=>({kind:p_.Action,item:o,group:wZe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!o.action.edit?.edits.length}));const i=hPt.map(o=>({group:o,actions:[]}));for(const o of s){const r=o.action.kind?new Yn(o.action.kind):Yn.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const n=[];for(const o of i)if(o.actions.length){n.push({kind:p_.Header,group:o.group});for(const r of o.actions){const a=o.group;n.push({kind:p_.Action,item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:ve.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var gPt='.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{content:"";display:block;height:100%;left:0;opacity:.3;position:absolute;top:0;width:100%;z-index:1}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{cursor:pointer;display:block}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}';ut(gPt,{});var NP;const cUe=oi("gutter-lightbulb",ve.lightBulb,g(5031,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),lUe=oi("gutter-lightbulb-auto-fix",ve.lightbulbAutofix,g(5032,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),dUe=oi("gutter-lightbulb-sparkle",ve.lightbulbSparkle,g(5033,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),hUe=oi("gutter-lightbulb-aifix-auto-fix",ve.lightbulbSparkleAutofix,g(5034,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),uUe=oi("gutter-lightbulb-sparkle-filled",ve.sparkleFilled,g(5035,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var Ad;(function(s){let e;(function(i){i[i.Hidden=0]="Hidden",i[i.Showing=1]="Showing"})(e=s.Type||(s.Type={})),s.Hidden={type:e.Hidden};class t{constructor(n,o,r,a){this.actions=n,this.trigger=o,this.editorPosition=r,this.widgetPosition=a,this.type=e.Showing}}s.Showing=t})(Ad||(Ad={}));var WS;let Q3=(WS=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._state=Ad.Hidden,this._gutterState=Ad.Hidden,this._iconClasses=[],this.gutterDecoration=NP.GUTTER_DECORATION,this._domNode=fe("div.lightBulbWidget"),this._domNode.role="listbox",this._register(fd.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==Ad.Type.Showing||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide(),(this.gutterState.type!==Ad.Type.Showing||!n||this.gutterState.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(fdt(this._domNode,i=>{if(this.state.type!==Ad.Type.Showing)return;this._editor.focus(),i.preventDefault();const{top:n,height:o}=Cr(this._domNode),r=this._editor.getOption(x.lineHeight);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(M.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(pZe)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(kMe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{const n=["codicon-"+cUe.id,"codicon-"+hUe.id,"codicon-"+lUe.id,"codicon-"+dUe.id,"codicon-"+uUe.id];if(!i.target.element||!n.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==Ad.Type.Showing)return;this._editor.focus();const{top:o,height:r}=Cr(i.target.element),a=this._editor.getOption(x.lineHeight);let c=Math.floor(a/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,f=w=>w>2&&this._editor.getTopForLineNumber(w)===this._editor.getTopForLineNumber(w-1);let p=r,m=1;if(!u){const w=y=>{const C=o.getLineContent(y);return/^\s*$|^\s+/.test(C)||C.length<=m};if(r>1&&!f(r-1)){const y=o.getLineCount(),C=r===y,A=r>1&&w(r-1),L=!C&&w(r+1),k=w(r),P=!L&&!A;let R=!1;const z=this._editor.getLineDecorations(r);if(z)for(const G of z)G.options.glyphMarginClassName?.includes(ve.debugBreakpoint.id)&&(R=!0);if(!L&&!A&&!R)return this.gutterState=new Ad.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:NP._posPref}),this.renderGutterLightbub(),this.hide();A||C||P&&!k?p-=1:(L||P&&k)&&(p+=1)}else{if(r===1&&(r===o.getLineCount()||!w(r+1)&&!w(r)))return this.gutterState=new Ad.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:NP._posPref}),this.renderGutterLightbub(),this.hide();if(r{this._gutterDecorationID=t.addDecoration(new F(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new F(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===Ad.Type.Showing&&(t?this.title=g(5036,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=g(5037,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=g(5038,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=g(5039,"Show Code Actions")))}set title(e){this._domNode.title=e}},NP=WS,WS.GUTTER_DECORATION=Gt.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:We.asClassName(ve.lightBulb),glyphMargin:{position:K_.Left},stickiness:ni.NeverGrowsWhenTypingAtEdges}),WS.ID="editor.contrib.lightbulbWidget",WS._posPref=[es.EXACT],WS);Q3=NP=D([_(1,Ut)],Q3);W("actionBar.toggledBackground",a6,g(9855,"Background color for toggled action items in action bar."));const OM={Visible:new Q("codeActionMenuVisible",!1,g(9856,"Whether the action widget list is visible"))},$N=ae("actionWidgetService");let BM=class extends V{get isVisible(){return OM.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new wn)}show(e,t,i,n,o,r,a){const c=OM.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(Nbe,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>o,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 n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)n.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(ue(a,ke.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),o.add(ue(l,ke.POINTER_MOVE,()=>l.remove())),o.add(ue(l,ke.MOUSE_DOWN,()=>l.remove()));let d=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(n.appendChild(f.getContainer().parentElement),o.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const u=o.add(Ac(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=fe(e),n=new hd(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};BM=D([_(0,mf),_(1,Le),_(2,we)],BM);ce($N,BM,qt.Delayed);const Q6=Ae.EditorContrib+1e3;At(class extends li{constructor(){super({id:"hideCodeActionWidget",title:Pe(9857,"Hide action widget"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.Escape,secondary:[U.Shift|S.Escape]}})}run(s){s.get($N).hide(!0)}});At(class extends li{constructor(){super({id:"selectPrevCodeAction",title:Pe(9858,"Select previous action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow,U.WinCtrl|S.KeyP]}}})}run(s){const e=s.get($N);e instanceof BM&&e.focusPrevious()}});At(class extends li{constructor(){super({id:"selectNextCodeAction",title:Pe(9859,"Select next action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow,U.WinCtrl|S.KeyN]}}})}run(s){const e=s.get($N);e instanceof BM&&e.focusNext()}});At(class extends li{constructor(){super({id:_Ze,title:Pe(9860,"Accept selected action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:S.Enter,secondary:[U.CtrlCmd|S.Period]}})}run(s){const e=s.get($N);e instanceof BM&&e.acceptSelected()}});At(class extends li{constructor(){super({id:vZe,title:Pe(9861,"Preview selected action"),precondition:OM.Visible,keybinding:{weight:Q6,primary:U.CtrlCmd|S.Enter}})}run(s){const e=s.get($N);e instanceof BM&&e.acceptSelected(!0)}});const yZe=new Q("supportedCodeAction",""),gUe="_typescript.applyFixAllCodeAction";class fPt extends V{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new Cm),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=>ji(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:Ch.Auto,triggerAction:sg.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===Ch.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==a_.Off){{if(i===a_.On)return t;if(i===a_.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 Fv;(function(s){let e;(function(i){i[i.Empty=0]="Empty",i[i.Triggered=1]="Triggered"})(e=s.Type||(s.Type={})),s.Empty={type:e.Empty};class t{constructor(n,o,r){this.trigger=n,this.position=o,this._cancellablePromise=r,this.type=e.Triggered,this.actions=r.catch(a=>{if(Fr(a))return CZe;throw a})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=t})(Fv||(Fv={}));const CZe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class pPt extends V{constructor(e,t,i,n,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new wn),this._state=Fv.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=yZe.bindTo(n),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(Fv.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(Fv.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 fPt(this._editor,this._markerService,i=>{if(!i){this.setState(Fv.Empty);return}const n=i.selection.getStartPosition(),o=Rr(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===Ch.Invoke&&(i.trigger.triggerAction===sg.QuickFix||i.trigger.filter?.include?.contains(ys.QuickFix))){const l=await ZO(this._registry,e,i.selection,i.trigger,lu.None,c),d=[...l.allActions];if(c.isCancellationRequested)return CZe;const h=l.validActions?.some(f=>f.action.kind?ys.QuickFix.contains(new Yn(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(gUe))&&(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 w of u){const y=w.endColumn,C=w.endLineNumber,A=w.startLineNumber;if(C===f.lineNumber||A===f.lineNumber){p=new oe(C,y);const L={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:ys.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new dt(p.lineNumber,p.column,p.lineNumber,p.column),P=await ZO(this._registry,e,k,L,lu.None,c);if(P.validActions.length!==0){for(const R of P.validActions)R.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(gUe))&&(R.action.diagnostics=[...u.filter(z=>z.relatedInformation)]);l.allActions.length===0&&d.push(...P.allActions),Math.abs(f.column-y)C.findIndex(A=>A.action.title===w.action.title)===y);return b.sort((w,y)=>w.action.isPreferred&&!y.action.isPreferred?-1:!w.action.isPreferred&&y.action.isPreferred||w.action.isAI&&!y.action.isAI?1:!w.action.isAI&&y.action.isAI?-1:0),{validActions:b,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}}return ZO(this._registry,e,i.selection,i.trigger,lu.None,c)});i.trigger.type===Ch.Invoke&&this._progressService?.showWhile(o,250);const r=new Fv.Triggered(i.trigger,n,o);let a=!1;this._state.type===Fv.Type.Triggered&&(a=this._state.trigger.type===Ch.Invoke&&r.type===Fv.Type.Triggered&&r.trigger.type===Ch.Auto&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:Ch.Auto,triggerAction:sg.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===Fv.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var PP;const mPt="quickfix-edit-highlight";var VD;let WM=(VD=class extends V{static get(e){return e.getContribution(PP.ID)}constructor(e,t,i,n,o,r,a,c,l,d){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._activeCodeActions=this._register(new wn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new pPt(this._editor,o.codeActionProvider,t,i,r,c)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new ya(()=>{const h=this._editor.getContribution(Q3.ID);return h&&this._register(h.onClick(u=>this.showCodeActionsFromLightbulb(u.actions,u))),h}),this._resolver=n.createInstance(Rbe),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],n=i.action.command;n&&n.id==="inlineChat.start"&&n.arguments&&n.arguments.length>=1&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,Nx.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,n){if(!this._editor.hasModel())return;Lh.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:Ch.Invoke,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,n){try{await this._instantiationService.invokeFunction(mZe,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:Ch.Auto,triggerAction:sg.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==Fv.Type.Triggered){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(i){vt(i);return}if(!this._disposed)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===Ch.Invoke){if(e.trigger.filter?.include){const n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this._applyCodeAction(n,!1,!1,Nx.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const o=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(o&&o.action.disabled){Lh.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)){Lh.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===sd.First&&t.validActions.length===0||e.autoApply===sd.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===sd.First&&t.validActions.length>0||e.autoApply===sd.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=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?Nx.FromAILightbulb:Nx.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:l=>{this._editor?.focus(),n.clear()},onHover:async(l,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=l.action.kind;if(u){const f=new Yn(u);h=[ys.RefactorExtract,ys.RefactorInline,ys.RefactorRewrite,ys.RefactorMove,ys.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(n.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(f=>({range:f,options:PP.DECORATION})):d.map(f=>({range:f,options:PP.DECORATION}));n.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:PP.DECORATION}));n.set(u);const f=h[0];if(f.startLineNumber&&f.startColumn){const p=this._editor.getModel()?.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn})?.word;Ah(g(5028,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,uPt(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,mt.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Cr(this._editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height;return{x:n,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 n=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&&n.push(this._showDisabled?{id:"hideMoreActions",label:g(5029,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g(5030,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}},PP=VD,VD.ID="editor.contrib.codeActionController",VD.DECORATION=Gt.register({description:"quickfix-highlight",className:mPt}),VD);WM=PP=D([_(1,Am),_(2,Le),_(3,we),_(4,it),_(5,XA),_(6,vi),_(7,Te),_(8,$N),_(9,we)],WM);Cp((s,e)=>{((n,o)=>{o&&e.addRule(`.monaco-editor ${n} { background-color: ${o}; }`)})(".quickfix-edit-highlight",s.getColor(_b));const i=s.getColor(Cx);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Ry(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var Pbe;const SZe="editor.experimental.dropIntoEditor.defaultProvider",AZe="editor.changeDropType",LMe=new Q("dropWidgetVisible",!1,g(5050,"Whether the drop widget is showing"));var ML;let HM=(ML=class extends V{static get(e){return e.getContribution(Pbe.ID)}constructor(e,t,i,n,o){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=fX.getInstance(),this._dropProgressManager=this._register(t.createInstance(mX,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(_X,"dropIntoEditor",e,LMe,{id:AZe,label:g(5051,"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 n=Rr(async o=>{const r=new Z,a=r.add(new Jk(e,jo.Value,void 0,o));try{const c=await this.extractDataTransferData(i);if(c.size===0||a.token.isCancellationRequested)return;const l=e.getModel();if(!l)return;const d=this._languageFeaturesService.documentDropEditProvider.ordered(l).filter(u=>u.dropMimeTypes?u.dropMimeTypes.some(f=>c.matches(f)):!0),h=r.add(await this.getDropEdits(d,l,t,c,a));if(a.token.isCancellationRequested)return;if(h.edits.length){const u=this.getInitialActiveEditIndex(l,h.edits),f=e.getOption(x.dropIntoEditor).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([F.fromPositions(t)],{activeEditIndex:u,allEdits:h.edits},f,async p=>p,o)}}finally{r.dispose(),this._currentOperation===n&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,g(5052,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),this._currentOperation=n}async getDropEdits(e,t,i,n,o){const r=new Z,a=await U_(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentDropEdits(t,i,n,o.token);return d&&r.add(d),d?.edits.map(h=>({...h,providerId:l.id}))}catch(d){console.error(d)}})),o.token),c=Fi(a??[]).flat();return{edits:uZe(c),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(SZe,{resource:e.uri});for(const[n,o]of Object.entries(i)){const r=new Yn(o),a=t.findIndex(c=>r.value===c.providerId&&c.handledMimeType&&nZe(n,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new lce;const t=cZe(e.dataTransfer);if(this.treeItemsTransfer.hasData(KWe.prototype)){const i=this.treeItemsTransfer.getData(KWe.prototype);if(Array.isArray(i))for(const n of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},Pbe=ML,ML.ID="editor.contrib.dropIntoEditorController",ML);HM=Pbe=D([_(1,we),_(2,Te),_(3,it),_(4,Nae)],HM);var _Pt=".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}";ut(_Pt,{});function Fbe(s,e){return!!s[e]}class Yhe{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Fbe(e.event,t.triggerModifier),this.hasSideBySideModifier=Fbe(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class fUe{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Fbe(e,t.triggerModifier)}}class wK{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function pUe(s){return s==="altKey"?Qt?new wK(S.Meta,"metaKey",S.Alt,"altKey"):new wK(S.Ctrl,"ctrlKey",S.Alt,"altKey"):Qt?new wK(S.Alt,"altKey",S.Meta,"metaKey"):new wK(S.Alt,"altKey",S.Ctrl,"ctrlKey")}class dce extends V{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=pUe(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 n=pUe(this._editor.getOption(x.multiCursorModifier));if(this._opts.equals(n))return;this._opts=n,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new Yhe(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new Yhe(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new Yhe(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new fUe(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new fUe(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 vPt=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 vX{constructor(e){this._disposables=new Z;let t=[];for(const[i,n]of e){const o=i.links.map(r=>new vPt(r,n));t=vX._union(t,o),wN(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,r,a;for(n=0,r=0,o=e.length,a=t.length;nPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},No));return Promise.all(n).then(()=>{const o=new vX(Fi(i));return t.isCancellationRequested?(o.dispose(),new vX([])):o})}_t.registerCommand("_executeLinkProvider",async(s,...e)=>{let[t,i]=e;Tt(t instanceof N),typeof i!="number"&&(i=0);const{linkProvider:n}=s.get(it),o=s.get(gi).getModel(t);if(!o)return[];const r=await EZe(n,o,He.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 dce(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=Rr(t=>EZe(this.providers,e,t));try{const t=new js(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){vt(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(x.multiCursorModifier)==="altKey",i=[],n=Object.keys(this.currentOccurrences);for(const r of n){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(eB.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{n.activate(o,i),this.activeLinkDecorationId=n.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:n}=e;n.resolve(He.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===pe.file&&o.startsWith(`${pe.file}:`)){const a=N.parse(o);if(a.scheme===pe.file){const c=Zm(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(o=Pt(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(1508,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):r==="missing"?this.notificationService.warn(g(1509,"Failed to open this link because its target is missing.")):vt(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 n=this.currentOccurrences[i.id];if(n)return n}return null}isEnabled(e,t){return!!(e.target.type===Rt.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()}},Obe=NL,NL.ID="editor.linkDetector",NL);yW=Obe=D([_(1,Ao),_(2,bi),_(3,it),_(4,Sp)],yW);const mUe={general:Gt.register({description:"detected-link",stickiness:ni.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Gt.register({description:"detected-link-active",stickiness:ni.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class eB{static decoration(e,t){return{range:e.range,options:eB._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?mUe.active:mUe.general};return n.hoverMessage=bPt(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,eB._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,eB._getOptions(this.link,t,!1))}}function bPt(s,e){const t=s.url&&/^command:/i.test(s.url.toString()),i=s.tooltip?s.tooltip:t?g(1510,"Execute command"):g(1511,"Follow link"),n=e?Qt?g(1512,"cmd + click"):g(1513,"ctrl + click"):Qt?g(1514,"option + click"):g(1515,"alt + click");if(s.url){let o="";if(/^command:/i.test(s.url.toString())){const a=s.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];o=g(1516,"Execute command {0}",c)}}return new Mt("",!0).appendLink(s.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${n})`)}else return new Mt().appendText(`${i} (${n})`)}class wPt extends tt{constructor(){super({id:"editor.action.openLink",label:g(1517,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=yW.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const o of n){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}on(yW.ID,yW,ri.AfterFirstRender);Re(wPt);const hce="editor.contrib.selectionClipboard",xZe="editor.action.showHover",yPt="editor.action.showDefinitionPreviewHover",CPt="editor.action.scrollUpHover",SPt="editor.action.scrollDownHover",APt="editor.action.scrollLeftHover",EPt="editor.action.scrollRightHover",xPt="editor.action.pageUpHover",DPt="editor.action.pageDownHover",kPt="editor.action.goToTopHover",IPt="editor.action.goToBottomHover",zU="editor.action.increaseHoverVerbosityLevel",TPt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",LPt=g(9864,"Increase Hover Verbosity Level"),$U="editor.action.decreaseHoverVerbosityLevel",RPt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",MPt=g(9865,"Decrease Hover Verbosity Level");var Hl;(function(s){s[s.Idle=0]="Idle",s[s.FirstWait=1]="FirstWait",s[s.SecondWait=2]="SecondWait",s[s.WaitingForAsync=3]="WaitingForAsync",s[s.WaitingForAsyncShowingLoading=4]="WaitingForAsyncShowingLoading"})(Hl||(Hl={}));var oC;(function(s){s[s.Delayed=0]="Delayed",s[s.Immediate=1]="Immediate"})(oC||(oC={}));var FA;(function(s){s[s.Mouse=0]="Mouse",s[s.Keyboard=1]="Keyboard"})(FA||(FA={}));let NPt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class DZe extends V{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 cn(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new cn(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new cn(()=>this._triggerLoadingMessage(),0)),this._state=Hl.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(Hl.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Flt(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===Hl.WaitingForAsync||this._state===Hl.WaitingForAsyncShowingLoading)&&this._setState(Hl.Idle)}catch(e){vt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?Hl.Idle:Hl.WaitingForAsync)}_triggerLoadingMessage(){this._state===Hl.WaitingForAsync&&this._setState(Hl.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===Hl.FirstWait||this._state===Hl.SecondWait)return;const e=this._state===Hl.Idle,t=this._state===Hl.WaitingForAsyncShowingLoading;this._onResult.fire(new NPt(this._result.slice(0),e,t))}start(e){if(e===oC.Delayed)this._state===Hl.Idle&&(this._setState(Hl.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case Hl.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case Hl.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(Hl.Idle,!1)}}const PPt=30,FPt=24;class OPt extends V{constructor(e,t=new bn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new wMe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=bn.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 bn(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:Cr(t).top+i.top-PPt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Cr(t),o=z_(t.ownerDocument.body),r=n.top+i.top+i.height;return o.height-r-FPt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(n,i),e),r=Math.min(e,o);let a;return this._editor.getOption(x.hover).above?a=r<=n?es.ABOVE:es.BELOW:a=r<=i?es.BELOW:es.ABOVE,a===es.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 ew;const _Ue=30,BPt=6;var zD;let bX=(zD=class extends OPt{get isVisibleFromKeyboard(){return this._renderedHover?.source===FA.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,o){const r=e.getOption(x.lineHeight)+8,a=150,c=new bn(a,r);super(e,c),this._configurationService=i,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new CLe),this._onDidResize=this._register(new I),this.onDidResize=this._onDidResize.event,this._minimumSize=c,this._hoverVisibleKey=J.hoverVisible.bindTo(t),this._hoverFocusedKey=J.hoverFocused.bindTo(t),re(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(Ac(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return ew.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return ew._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return ew._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){ew._applyMaxDimensions(this._hover.contentsDomNode,e,t),ew._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 bn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){ew._lastDimensions=new bn(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._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===es.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=BPt;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.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=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,ew._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,ew._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?Io.LeftOfInjectedText:void 0,preference:[this._positionPreference??es.ABOVE]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=fb(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??es.ABOVE,this.onContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const o=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&xQe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");o&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+o)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new bn(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 bn(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 bn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=fb(e),i=Pd(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=fb(e),i=Pd(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=fb(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._renderedHover.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-_Ue})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+_Ue})}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})}},ew=zD,zD.ID="editor.contrib.resizableContentHoverWidget",zD._lastDimensions=new bn(0,0),zD);bX=ew=D([_(1,Le),_(2,Te),_(3,mr),_(4,Ut)],bX);function vUe(s,e,t,i,n,o){const r=t+n/2,a=i+o/2,c=Math.max(Math.abs(s-r)-n/2,0),l=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(c*c+l*l)}var du;(function(s){s[s.Range=1]="Range",s[s.ForeignElement=2]="ForeignElement"})(du||(du={}));class Jhe{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=du.Range}equals(e){return e.type===du.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===du.Range&&t.lineNumber===this.range.startLineNumber}}class aQ{constructor(e,t,i,n,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=du.ForeignElement}equals(e){return e.type===du.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===du.ForeignElement&&this.owner===e.owner}}class UM{constructor(e){this.renderedHoverParts=e}dispose(){for(const e of this.renderedHoverParts)e.dispose()}}const GN=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class wX{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=FA.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==du.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,c=r.range.endLineNumber===n?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 Qd.EMPTY;const i=wX._getLineDecorations(this._editor,t);return Qd.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Qd.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=wX._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Fi(t)}}class kZe{constructor(e,t,i){this.anchor=e,this.hoverParts=t,this.isComplete=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new WPt(this,this.anchor,t,this.isComplete)}}class WPt extends kZe{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}const bUe=fe;let yX=class extends V{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this.actions=[],this._hasContent=!1,this.hoverElement=bUe("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=re(this.hoverElement,bUe("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(SLe.render(this.actionsElement,e,i));return this.actions.push(n),n}append(e){const t=re(this.actionsElement,e);return this._hasContent=!0,t}};yX=D([_(0,Ut)],yX);class HPt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function UPt(s,e,t,i,n){const o=await Promise.resolve(s.provideHover(t,i,n)).catch(No);if(!(!o||!VPt(o)))return new HPt(s,o,e)}function RMe(s,e,t,i,n=!1){const r=s.ordered(e,n).map((a,c)=>UPt(a,c,e,t,i));return Qd.fromPromises(r).coalesce()}function IZe(s,e,t,i,n=!1){return RMe(s,e,t,i,n).map(o=>o.hover).toPromise()}rg("_executeHoverProvider",(s,e,t)=>{const i=s.get(it);return IZe(i.hoverProvider,e,t,He.None)});rg("_executeHoverProvider_recursive",(s,e,t)=>{const i=s.get(it);return IZe(i.hoverProvider,e,t,He.None,!0)});function VPt(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}const _F=fe,zPt=oi("hover-increase-verbosity",ve.add,g(5160,"Icon for increaseing hover verbosity.")),$Pt=oi("hover-decrease-verbosity",ve.remove,g(5161,"Icon for decreasing hover verbosity."));class m_{constructor(e,t,i,n,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class TZe{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Mc.Increase:return this.hover.canIncreaseVerbosity??!1;case Mc.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let j3=class{constructor(e,t,i,n,o,r,a,c){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=o,this._keybindingService=r,this._hoverService=a,this._commandService=c,this.hoverOrdinal=3}createLoadingMessage(e){return new m_(this,e.range,[new Mt().appendText(g(5162,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==du.Range)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];let a=1e3;const c=i.getLineLength(n),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 m_(this,e.range,[{value:g(5163,"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 m_(this,e.range,[{value:g(5164,"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===n?p.range.startColumn:1,v=p.range.endLineNumber===n?p.range.endColumn:o,b=p.options.hoverMessage;if(!b||Q2(b))continue;p.options.beforeContentClassName&&(f=!0);const w=new F(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new m_(this,w,H_(b),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==du.Range)return Qd.EMPTY;const n=this._editor.getModel(),o=this._languageFeaturesService.hoverProvider;return o.has(n)?this._getMarkdownHovers(o,n,e,i):Qd.EMPTY}_getMarkdownHovers(e,t,i,n){const o=i.range.getStartPosition();return RMe(e,t,o,n).filter(c=>!Q2(c.hover.contents)).map(c=>{const l=c.hover.range?F.lift(c.hover.range):i.range,d=new TZe(c.hover,c.provider,o);return new m_(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new GPt(t,e.fragment,this,this._editor,this._languageService,this._openerService,this._commandService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}getAccessibleContent(e){return this._renderedHoverParts?.getAccessibleContent(e)??""}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}updateMarkdownHoverVerbosityLevel(e,t,i){return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t,i))}};j3=D([_(1,xi),_(2,Ao),_(3,Te),_(4,it),_(5,Ut),_(6,ec),_(7,vi)],j3);class yK{constructor(e,t,i){this.hoverPart=e,this.hoverElement=t,this.disposables=i}get hoverAccessibleContent(){return this.hoverElement.innerText.trim()}dispose(){this.disposables.dispose()}}class GPt{constructor(e,t,i,n,o,r,a,c,l,d,h){this._hoverParticipant=i,this._editor=n,this._languageService=o,this._openerService=r,this._commandService=a,this._keybindingService=c,this._hoverService=l,this._configurationService=d,this._onFinishedRendering=h,this._ongoingHoverOperations=new Map,this._disposables=new Z,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(Ee(()=>{this.renderedHoverParts.forEach(u=>{u.dispose()}),this._ongoingHoverOperations.forEach(u=>{u.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(Cc(n=>n.ordinal,nu)),e.map(n=>{const o=this._renderHoverPart(n,i);return t.appendChild(o.hoverElement),o})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,o=e.source,r=new Z;if(r.add(i),!o)return new yK(e,n,r);const a=o.supportsVerbosityAction(Mc.Increase),c=o.supportsVerbosityAction(Mc.Decrease);if(!a&&!c)return new yK(e,n,r);const l=_F("div.verbosity-actions");return n.prepend(l),r.add(this._renderHoverExpansionAction(l,Mc.Increase,a)),r.add(this._renderHoverExpansionAction(l,Mc.Decrease,c)),new yK(e,n,r)}_renderMarkdownHover(e,t){return LZe(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const n=new Z,o=t===Mc.Increase,r=re(e,_F(We.asCSSSelector(o?zPt:$Pt)));r.tabIndex=0;const a=new xM("mouse",!1,{target:e,position:{hoverPosition:vo.LEFT}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(a,r,RZe(this._keybindingService,t))),!i)return r.classList.add("disabled"),n;r.classList.add("enabled");const c=()=>this._commandService.executeCommand(t===Mc.Increase?zU:$U);return n.add(new DQe(r,c)),n.add(new kQe(r,c,[S.Enter,S.Space])),n}async updateMarkdownHoverPartVerbosityLevel(e,t,i=!0){const n=this._editor.getModel();if(!n)return;const o=this._getRenderedHoverPartAtIndex(t),r=o?.hoverPart.source;if(!o||!r?.supportsVerbosityAction(e))return;const a=await this._fetchHover(r,n,e);if(!a)return;const c=new TZe(a,r.hoverProvider,r.hoverPosition),l=o.hoverPart,d=new m_(this._hoverParticipant,l.range,a.contents,l.isBeforeContent,l.ordinal,c),h=this._renderHoverPart(d,this._onFinishedRendering);return this._replaceRenderedHoverPartAtIndex(t,h,d),i&&this._focusOnHoverPartWithIndex(t),{hoverPart:d,hoverElement:h.hoverElement}}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(r=>r.hoverPart===e);if(t===-1)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){const i=this._getRenderedHoverPartAtIndex(e),n=i?.hoverPart.source;return!(!i||!n?.supportsVerbosityAction(t))}async _fetchHover(e,t,i){let n=i===Mc.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),n+=r.verbosityDelta);const a=new ci;this._ongoingHoverOperations.set(o,{verbosityDelta:n,tokenSource:a});const c={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,c))}catch(d){No(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),l}_replaceRenderedHoverPartAtIndex(e,t,i){if(e>=this.renderedHoverParts.length||e<0)return;const n=this.renderedHoverParts[e],o=n.hoverElement,r=t.hoverElement,a=Array.from(r.children);o.replaceChildren(...a);const c=new yK(i,o,t.disposables);o.focus(),n.dispose(),this.renderedHoverParts[e]=c}_focusOnHoverPartWithIndex(e){this.renderedHoverParts[e].hoverElement.focus()}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function KPt(s,e,t,i,n){e.sort(Cc(r=>r.ordinal,nu));const o=[];for(const r of e)o.push(LZe(t,r,i,n,s.onContentsChanged));return new UM(o)}function LZe(s,e,t,i,n){const o=new Z,r=_F("div.hover-row"),a=_F("div.hover-row-contents");r.appendChild(a);const c=e.contents;for(const d of c){if(Q2(d))continue;const h=_F("div.markdown-hover"),u=re(h,_F("div.hover-contents")),f=o.add(new Y_({editor:s},t,i));o.add(f.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",n()}));const p=o.add(f.render(d));u.appendChild(p.element),a.appendChild(h)}return{hoverPart:e,hoverElement:r,dispose(){o.dispose()}}}function RZe(s,e){switch(e){case Mc.Increase:{const t=s.lookupKeybinding(zU);return t?g(5165,"Increase Hover Verbosity ({0})",t.getLabel()):g(5166,"Increase Hover Verbosity")}case Mc.Decrease:{const t=s.lookupKeybinding($U);return t?g(5167,"Decrease Hover Verbosity ({0})",t.getLabel()):g(5168,"Decrease Hover Verbosity")}}}const MZe=[];function j6(s){MZe.push(s)}function qPt(){return MZe.slice(0)}class MMe{constructor(e,t){this._editorWorkerClient=new STe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,o=t.color,r=o.alpha,a=new me(new dn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),c=r?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),l=r?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),d=r?me.Format.CSS.formatHex(a):me.Format.CSS.formatHexA(a),h=[];return h.push({label:c,textEdit:{range:n,text:c}}),h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h}}let Bbe=class extends V{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new MMe(e,t)))}};Bbe=D([_(0,gi),_(1,Vs),_(2,it)],Bbe);j6(Bbe);async function NZe(s,e,t,i=!0){return NMe(new QPt,s,e,t,i)}function PZe(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}class QPt{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({colorInfo:r,provider:e});return Array.isArray(o)}}class jPt{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class YPt{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const o=await e.provideColorPresentations(t,this.colorInfo,He.None);return Array.isArray(o)&&n.push(...o),Array.isArray(o)}}async function NMe(s,e,t,i,n){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 MMe)r=d;else try{await s.compute(d,t,i,a)&&(o=!0)}catch(h){No(h)}}return o?a:r&&n?(await s.compute(r,t,i,a),a):[]}function FZe(s,e){const{colorProvider:t}=s.get(it),i=s.get(gi).getModel(e);if(!i)throw Pi();const n=s.get(Te).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}_t.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof N))throw Pi();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:o}=FZe(s,t);return NMe(new jPt,n,i,He.None,o)});_t.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:o}=i;if(!(n instanceof N)||!Array.isArray(t)||t.length!==4||!F.isIRange(o))throw Pi();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=FZe(s,n),[l,d,h,u]=t;return NMe(new YPt({range:o,color:{red:l,green:d,blue:h,alpha:u}}),a,r,He.None,c)});var Wbe;const OZe=Object.create({});var $D;let VM=($D=class extends V{constructor(e,t,i,n){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 aY(this._editor),this._decoratorLimitReporter=new JPt,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:Wbe.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 n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.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 Cm,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Rr(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new js(!1),n=await NZe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){vt(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:Gt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,o)=>this._colorDatas.set(n,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let o=0;othis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},Wbe=$D,$D.ID="editor.contrib.colorDetector",$D.RECOMPUTE_TIME=1e3,$D);VM=Wbe=D([_(1,Te),_(2,it),_(3,Sp)],VM);class JPt{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())}}on(VM.ID,VM,ri.AfterFirstRender);class XPt{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 n=0;n{this.backgroundColor=r.getColor(sY)||me.white})),this._register(ue(this._pickedColorNode,ke.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ue(this._originalColorNode,ke.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=me.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 tFt(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=me.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 tFt extends V{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"),re(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),re(this._button,t),re(t,ep(".button"+We.asCSSSelector(oi("color-picker-close",ve.close,g(9863,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(ue(this._button,ke.CLICK,()=>{this._onClicked.fire()}))}}class iFt extends V{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=ep(".colorpicker-body"),re(e,this._domNode),this._saturationBox=new nFt(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 sFt(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new oFt(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new rFt(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 me(new fy(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new fy(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new me(new fy(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 nFt extends V{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=ep(".saturation-wrap"),re(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",re(this._domNode,this._canvas),this.selection=ep(".saturation-selection"),re(this._domNode,this.selection),this.layout(),this._register(ue(this._domNode,ke.POINTER_DOWN,n=>this.onPointerDown(n))),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 SU);const t=Cr(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=ue(e.target.ownerDocument,ke.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)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}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 me(new fy(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.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=me.Format.CSS.format(t),i.fill(),i.fillStyle=n,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 BZe extends V{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=re(e,ep(".standalone-strip")),this.overlay=re(this.domNode,ep(".standalone-overlay"))):(this.domNode=re(e,ep(".strip")),this.overlay=re(this.domNode,ep(".overlay"))),this.slider=re(this.domNode,ep(".slider")),this.slider.style.top="0px",this._register(ue(this.domNode,ke.POINTER_DOWN,n=>this.onPointerDown(n))),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 SU),i=Cr(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 n=ue(e.target.ownerDocument,ke.POINTER_UP,()=>{this._onColorFlushed.fire(),n.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 sFt extends BZe{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:n}=e.rgba,o=new me(new dn(t,i,n,1)),r=new me(new dn(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class oFt extends BZe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class rFt extends V{constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=re(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ue(this._button,ke.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const Mse=class Mse extends pd{constructor(e,t,i,n,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(L8.getInstance(ct(e)).onDidChange(()=>this.layout())),this._domNode=ep(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new eFt(this._domNode,this.model,n,o)),this.body=this._register(new iFt(this._domNode,this.model,this.pixelRatio,o))}getId(){return Mse.ID}layout(){this.body.layout()}get domNode(){return this._domNode}};Mse.ID="editor.contrib.colorPickerWidget";let Hbe=Mse;class aFt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Y3=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Qd.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=VM.get(this._editor);if(!n)return[];for(const o of t){if(!n.isColorDecoration(o))continue;const r=n.getColorData(o.range.getStartPosition());if(r)return[await WZe(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){const i=HZe(this,this._editor,this._themeService,t,e);if(!i)return new UM([]);this._colorPicker=i.colorPicker;const n={hoverPart:i.hoverPart,hoverElement:this._colorPicker.domNode,dispose(){i.disposables.dispose()}};return new UM([n])}getAccessibleContent(e){return g(5040,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}isColorPickerVisible(){return!!this._colorPicker}};Y3=D([_(1,pn)],Y3);class cFt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let J3=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()||!VM.get(this._editor))return null;const o=await NZe(i,this._editor.getModel(),He.None);let r=null,a=null;for(const h of o){const u=h.colorInfo;F.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const c=r??e,l=a??t,d=!!r;return{colorHover:await WZe(this,this._editor.getModel(),c,l),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new F(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await cQ(this._editor.getModel(),t,this._color,i,e),i=UZe(this._editor,i,t))}renderHoverParts(e,t){return HZe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};J3=D([_(1,pn)],J3);async function WZe(s,e,t,i){const n=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:c}=t.color,l=new dn(Math.round(o*255),Math.round(r*255),Math.round(a*255),c),d=new me(l),h=await PZe(e,t,i,He.None),u=new XPt(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,n),s instanceof Y3?new aFt(s,F.lift(t.range),u,i):new cFt(s,F.lift(t.range),u,i)}function HZe(s,e,t,i,n){if(i.length===0||!e.hasModel())return;if(n.setMinimumDimensions){const u=e.getOption(x.lineHeight)+8;n.setMinimumDimensions(new bn(302,u))}const o=new Z,r=i[0],a=e.getModel(),c=r.model,l=o.add(new Hbe(n.fragment,c,e.getOption(x.pixelRatio),t,s instanceof J3));let d=!1,h=new F(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(s instanceof J3){const u=r.model.color;s.color=u,cQ(a,c,u,h,r),o.add(c.onColorFlushed(f=>{s.color=f}))}else o.add(c.onColorFlushed(async u=>{await cQ(a,c,u,h,r),d=!0,h=UZe(e,h,c)}));return o.add(c.onDidChangeColor(u=>{cQ(a,c,u,h,r)})),o.add(e.onDidChangeModelContent(u=>{d?d=!1:(n.hide(),e.focus())})),{hoverPart:r,colorPicker:l,disposables:o}}function UZe(s,e,t){const i=[],n=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(n),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const o=F.lift(n.range),r=s.getModel()._setTrackedRange(null,o,ni.GrowsOnlyWhenTypingAfter);return s.executeEdits("colorpicker",i),s.pushUndoStop(),s.getModel()._getTrackedRange(r)??o}async function cQ(s,e,t,i,n){const o=await PZe(s,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,He.None);e.colorPresentations=o||[]}class VZe{constructor(e,t){this.range=e,this.direction=t}}class PMe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new PMe(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){No(t),this._isResolved=!1}}}const eO=class eO{static async create(e,t,i,n){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,n);(l?.hints.length||a.onDidChangeInlayHints)&&o.push([l??eO._emptyInlayHintList,a])}catch(l){No(l)}}));if(await Promise.all(r.flat()),n.isCancellationRequested||t.isDisposed())throw new Ma;return new eO(i,o,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const n=[];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=eO._getRangeAtPosition(i,c);let h;d.getStartPosition().isBefore(c)?(h=F.fromPositions(d.getStartPosition(),c),l="after"):(h=F.fromPositions(c,d.getEndPosition()),l="before"),n.push(new PMe(a,new VZe(h,l),r))}}this.items=n.sort((o,r)=>oe.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new F(i,n.startColumn,i,n.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(ji(h.uri,a.uri))l=!0,d=d||F.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=jr(i,n)}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:F.collapseToStart(t.range),selectionRevealType:rA.NearTopIfOutsideViewport}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?g(5103,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):g(5104,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};Ube=D([_(0,Le),_(1,Kt),_(2,bi),_(3,Ut)],Ube);ce(uce,Ube,qt.Delayed);qe(new class extends hc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:FMe,kbOpts:{weight:Ae.EditorContrib,primary:S.F12}})}runEditorCommand(s,e){return s.get(uce).revealNext(e)}});So.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:Ae.EditorContrib,when:FMe,primary:S.Escape,handler(s){s.get(uce).reset()}});let Vbe=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(),bt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,jr(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)}};Vbe=D([_(0,Kt)],Vbe);function zbe(s,e){return e.uri.scheme===s.uri.scheme?!0:!A8(e.uri,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeChatCodeCompareBlock,pe.vscodeCopilotBackingChatCodeBlock)}async function Y6(s,e,t,i,n){const r=t.ordered(s,i).map(c=>Promise.resolve(n(c,s,e)).then(void 0,l=>{No(l)})),a=await Promise.all(r);return Fi(a.flat()).filter(c=>zbe(s,c))}function J6(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideDefinition(r,a,n))}function OMe(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideDeclaration(r,a,n))}function BMe(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideImplementation(r,a,n))}function WMe(s,e,t,i,n){return Y6(e,t,s,i,(o,r,a)=>o.provideTypeDefinition(r,a,n))}function X6(s,e,t,i,n,o){return Y6(e,t,s,n,async(r,a,c)=>{const l=(await r.provideReferences(a,c,{includeDeclaration:!0},o))?.filter(h=>zbe(a,h));if(!i||!l||l.length!==2)return l;const d=(await r.provideReferences(a,c,{includeDeclaration:!1},o))?.filter(h=>zbe(a,h));return d&&d.length===1?d:l})}async function mC(s){const e=await s(),t=new of(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}rg("_executeDefinitionProvider",(s,e,t)=>{const i=s.get(it),n=J6(i.definitionProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(it),n=J6(i.definitionProvider,e,t,!0,He.None);return mC(()=>n)});rg("_executeTypeDefinitionProvider",(s,e,t)=>{const i=s.get(it),n=WMe(i.typeDefinitionProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeTypeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(it),n=WMe(i.typeDefinitionProvider,e,t,!0,He.None);return mC(()=>n)});rg("_executeDeclarationProvider",(s,e,t)=>{const i=s.get(it),n=OMe(i.declarationProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeDeclarationProvider_recursive",(s,e,t)=>{const i=s.get(it),n=OMe(i.declarationProvider,e,t,!0,He.None);return mC(()=>n)});rg("_executeReferenceProvider",(s,e,t)=>{const i=s.get(it),n=X6(i.referenceProvider,e,t,!1,!1,He.None);return mC(()=>n)});rg("_executeReferenceProvider_recursive",(s,e,t)=>{const i=s.get(it),n=X6(i.referenceProvider,e,t,!1,!0,He.None);return mC(()=>n)});rg("_executeImplementationProvider",(s,e,t)=>{const i=s.get(it),n=BMe(i.implementationProvider,e,t,!1,He.None);return mC(()=>n)});rg("_executeImplementationProvider_recursive",(s,e,t)=>{const i=s.get(it),n=BMe(i.implementationProvider,e,t,!0,He.None);return mC(()=>n)});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextPeek,title:g(1409,"Peek"),group:"navigation",order:100});class CW{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof CW||oe.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const Xm=class Xm extends gf{static all(){return Xm._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of hi.wrap(t.menu))(i.id===_e.EditorContext||i.id===_e.EditorContextPeek)&&(i.when=he.and(e.precondition,i.when));return t}constructor(e,t){super(Xm._patchConfig(t)),this.configuration=e,Xm._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(bi),r=e.get(Kt),a=e.get(XA),c=e.get(uce),l=e.get(it),d=e.get(we),h=t.getModel(),u=t.getPosition(),f=CW.is(i)?i:new CW(h,u),p=new Jk(t,jo.Value|jo.Position),m=U_(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;Mr(v.ariaMessage);let b;if(v.referenceAt(h.uri,u)){const y=this._getAlternativeCommand(t);!Xm._activeAlternativeCommands.has(y)&&Xm._allSymbolNavigationCommands.has(y)&&(b=Xm._allSymbolNavigationCommands.get(y))}const w=v.references.length;if(w===0){if(!this.configuration.muteMessage){const y=h.getWordAtPosition(u);Lh.get(t)?.showMessage(this._getNoResultFoundMessage(y),u)}}else if(w===1&&b)Xm._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(y=>b.runEditorCommand(y,t,i,n).finally(()=>{Xm._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,c,t,v,n)},v=>{o.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,o){const r=this._getGoToPreference(i);if(!(i instanceof lf)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,o);else{const a=n.firstReference(),c=n.references.length>1&&r==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,n,o):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,o){let r;if(mGe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:F.collapseToStart(r),selectionRevealType:rA.NearTopIfOutsideViewport,selectionSource:Db.JUMP}},e,n);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 n=NM.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Rr(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};Xm._allSymbolNavigationCommands=new Map,Xm._activeAlternativeCommands=new Set;let OA=Xm;class Z6 extends OA{async _getLocationModel(e,t,i,n){return new of(await J6(e.definitionProvider,t,i,!1,n),g(1410,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(1411,"No definition found for '{0}'",e.word):g(1412,"No definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDefinitions}}var GD;At((GD=class extends Z6{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:GD.id,title:{...Pe(1413,"Go to Definition"),mnemonicTitle:g(1414,"Go to &&Definition")},precondition:J.hasDefinitionProvider,keybinding:[{when:J.editorTextFocus,primary:S.F12,weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,iRe),primary:U.CtrlCmd|S.F12,weight:Ae.EditorContrib}],menu:[{id:_e.EditorContext,group:"navigation",order:1.1},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),_t.registerCommandAlias("editor.action.goToDeclaration",GD.id)}},GD.id="editor.action.revealDefinition",GD));var KD;At((KD=class extends Z6{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:KD.id,title:Pe(1415,"Open Definition to the Side"),precondition:he.and(J.hasDefinitionProvider,J.isInEmbeddedEditor.toNegated()),keybinding:[{when:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,S.F12),weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,iRe),primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.F12),weight:Ae.EditorContrib}]}),_t.registerCommandAlias("editor.action.openDeclarationToTheSide",KD.id)}},KD.id="editor.action.revealDefinitionAside",KD));var qD;At((qD=class extends Z6{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:qD.id,title:Pe(1416,"Peek Definition"),precondition:he.and(J.hasDefinitionProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.Alt|S.F12,linux:{primary:U.CtrlCmd|U.Shift|S.F10},weight:Ae.EditorContrib},menu:{id:_e.EditorContextPeek,group:"peek",order:2}}),_t.registerCommandAlias("editor.action.previewDeclaration",qD.id)}},qD.id="editor.action.peekDefinition",qD));class $Ze extends OA{async _getLocationModel(e,t,i,n){return new of(await OMe(e.declarationProvider,t,i,!1,n),g(1417,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?g(1418,"No declaration found for '{0}'",e.word):g(1419,"No declaration found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDeclarations}}var PL;At((PL=class extends $Ze{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:PL.id,title:{...Pe(1420,"Go to Declaration"),mnemonicTitle:g(1421,"Go to &&Declaration")},precondition:he.and(J.hasDeclarationProvider,J.isInEmbeddedEditor.toNegated()),menu:[{id:_e.EditorContext,group:"navigation",order:1.3},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g(1418,"No declaration found for '{0}'",e.word):g(1419,"No declaration found")}},PL.id="editor.action.revealDeclaration",PL));At(class extends $Ze{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Pe(1422,"Peek Declaration"),precondition:he.and(J.hasDeclarationProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:3}})}});class GZe extends OA{async _getLocationModel(e,t,i,n){return new of(await WMe(e.typeDefinitionProvider,t,i,!1,n),g(1423,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(1424,"No type definition found for '{0}'",e.word):g(1425,"No type definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleTypeDefinitions}}var FL;At((FL=class extends GZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:FL.ID,title:{...Pe(1426,"Go to Type Definition"),mnemonicTitle:g(1427,"Go to &&Type Definition")},precondition:J.hasTypeDefinitionProvider,keybinding:{when:J.editorTextFocus,primary:0,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.4},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},FL.ID="editor.action.goToTypeDefinition",FL));var OL;At((OL=class extends GZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:OL.ID,title:Pe(1428,"Peek Type Definition"),precondition:he.and(J.hasTypeDefinitionProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:4}})}},OL.ID="editor.action.peekTypeDefinition",OL));class KZe extends OA{async _getLocationModel(e,t,i,n){return new of(await BMe(e.implementationProvider,t,i,!1,n),g(1429,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?g(1430,"No implementation found for '{0}'",e.word):g(1431,"No implementation found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleImplementations}}var BL;At((BL=class extends KZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:BL.ID,title:{...Pe(1432,"Go to Implementations"),mnemonicTitle:g(1433,"Go to &&Implementations")},precondition:J.hasImplementationProvider,keybinding:{when:J.editorTextFocus,primary:U.CtrlCmd|S.F12,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.45},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},BL.ID="editor.action.goToImplementation",BL));var WL;At((WL=class extends KZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:WL.ID,title:Pe(1434,"Peek Implementations"),precondition:he.and(J.hasImplementationProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.F12,weight:Ae.EditorContrib},menu:{id:_e.EditorContextPeek,group:"peek",order:5}})}},WL.ID="editor.action.peekImplementation",WL));class qZe extends OA{_getNoResultFoundMessage(e){return e?g(1435,"No references found for '{0}'",e.word):g(1436,"No references found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleReferences}}At(class extends qZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Pe(1437,"Go to References"),mnemonicTitle:g(1438,"Go to &&References")},precondition:he.and(J.hasReferenceProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.Shift|S.F12,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.45},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new of(await X6(e.referenceProvider,t,i,!0,!1,n),g(1439,"References"))}});At(class extends qZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Pe(1440,"Peek References"),precondition:he.and(J.hasReferenceProvider,ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new of(await X6(e.referenceProvider,t,i,!1,!1,n),g(1439,"References"))}});class lFt extends OA{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Pe(1441,"Go to Any Symbol"),precondition:he.and(ng.notInPeekEditor,J.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new of(this._references,g(1442,"Locations"))}_getNoResultFoundMessage(e){return e&&g(1443,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(x.gotoLocation).multipleReferences}_getAlternativeCommand(){return""}}_t.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:N},{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(s,e,t,i,n,o,r)=>{Tt(N.isUri(e)),Tt(oe.isIPosition(t)),Tt(Array.isArray(i)),Tt(typeof n>"u"||typeof n=="string"),Tt(typeof r>"u"||typeof r=="boolean");const a=s.get(Kt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Qr(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,mt.Smooth),c.invokeWithinContext(l=>{const d=new class extends lFt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,n);l.get(we).invokeFunction(d.run.bind(d),c)})}});_t.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:N},{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(s,e,t,i,n)=>{s.get(vi).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});_t.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{Tt(N.isUri(e)),Tt(oe.isIPosition(t));const i=s.get(it),n=s.get(Kt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(o=>{if(!Qr(o)||!o.hasModel())return;const r=NM.get(o);if(!r)return;const a=Rr(l=>X6(i.referenceProvider,o.getModel(),oe.lift(t),!1,!1,l).then(d=>new of(d,g(1439,"References")))),c=new F(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(c,a,!1))})}});_t.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function dFt(s,e,t,i){const n=s.get(fn),o=s.get(lr),r=s.get(vi),a=s.get(we),c=s.get(bi);if(await i.item.resolve(He.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(jn.getMenuItems(_e.EditorContext).map(f=>bT(f)?f.command.id:ar()));for(const f of OA.all())h.has(f.desc.id)&&d.push(new rn(f.desc.id,Sc.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await n.createModelReference(l.uri);try{const m=new CW(p.object.textEditorModel,F.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 Ar),d.push(new rn(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:Xe.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=Cr(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function QZe(s,e,t,i){const o=await s.get(fn).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,c=r.get(Le),l=ng.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new Z6({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new CW(o.object.textEditorModel,F.getStartPosition(i.range)),F.lift(i.range))}),o.dispose()}var FP;class SX{constructor(){this._entries=new um(50)}get(e){const t=SX._key(e);return this._entries.get(t)}set(e,t){const i=SX._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const jZe=ae("IInlayHintsCache");ce(jZe,SX,qt.Delayed);class $be{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 hFt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var LC;(function(s){s[s.Normal=0]="Normal",s[s.Invisible=1]="Invisible"})(LC||(LC={}));var HS;let SW=(HS=class{static get(e){return e.getContribution(FP.ID)??void 0}constructor(e,t,i,n,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new aY(this._editor),this._activeRenderMode=LC.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=LC.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=LC.Normal,c=LC.Invisible):(a=LC.Invisible,c=LC.Normal),this._activeRenderMode=a,this._sessionDisposables.add(pb.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 n;const o=new Set,r=new cn(async()=>{const a=Date.now();n?.dispose(!0),n=new ci;const c=t.onWillDispose(()=>n?.cancel());try{const l=n.token,d=await CX.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){vt(l)}finally{n.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(r),this._sessionDisposables.add(Ee(()=>n?.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=>{n?.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 dce(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[o]=n,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const c=new ci;i.add(Ee(()=>c.dispose(!0))),r.item.resolve(c.token),this._activeInlayHintPart=r.part.command||r.part.location?new hFt(r,o.hasTriggerModifier):void 0;const l=a.validatePosition(r.item.hint.position).lineNumber,d=new F(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 n=>{const o=this._getInlayHintLabelPart(n);if(o){const r=o.part;r.location?this._instaService.invokeFunction(QZe,n,this._editor,r.location):Fj.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(He.None),eo(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(o=>Zn.replace(F.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Yr(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(dFt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==Rt.CONTENT_TEXT)return;const t=e.target.detail.injectedText?.options;if(t instanceof Wk&&t?.attachedData instanceof $be)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:Xe.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,n]of this._decorationsMetadata){if(t.has(n.item))continue;const o=e.getDecorationRange(i);if(o){const r=new VZe(o,n.item.anchor.direction),a=n.item.with({anchor:r});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const o of i.sort(F.compareRangesUsingStarts)){const r=t.validateRange(new F(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));n.length===0||!F.areIntersectingOrTouching(n[n.length-1],r)?n.push(r):n[n.length-1]=F.plusRange(n[n.length-1],r)}return n}_updateHintsDecorators(e,t){const i=[],n=(p,m,v,b,w)=>{const y={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:b,attachedData:w};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:ni.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===LC.Normal?y:void 0}}})},o=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${r/3|0}px`,display:"inline-block"});n(p,v," ",m?w_.Right:w_.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>FP._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&&(A=A.slice(0,-k)+"…",L=!0),n(p,this._ruleFactory.createClassNameRef(C),uFt(A),y&&!p.hint.paddingRight?w_.Right:w_.None,new $be(p,v)),L)break}if(p.hint.paddingRight&&o(p,!0),i.length>FP._MAX_DECORATORS)break}const u=[];for(const[p,m]of this._decorationsMetadata){const v=this._editor.getModel()?.getDecorationRange(p);v&&e.some(b=>b.containsRange(v))&&(u.push(p),m.classNameRef.dispose(),this._decorationsMetadata.delete(p))}const f=vm.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||n;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===n&&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 n of this._editor.getLineDecorations(e)){const o=this._decorationsMetadata.get(n.id);o&&!t.has(o.item.hint)&&(t.add(o.item.hint),i.push(o.item))}return i}},FP=HS,HS.ID="editor.contrib.InlayHints",HS._MAX_DECORATORS=1500,HS._MAX_LABEL_LEN=43,HS);SW=FP=D([_(1,it),_(2,Sp),_(3,jZe),_(4,vi),_(5,bi),_(6,we)],SW);function uFt(s){return s.replace(/[ \t]/g," ")}_t.registerCommand("_executeInlayHintProvider",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(F.isIRange(i));const{inlayHintsProvider:n}=s.get(it),o=await s.get(fn).createModelReference(t);try{const r=await CX.create(n,o.object.textEditorModel,[F.lift(i)],He.None),a=r.items.map(c=>c.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});class wUe extends aQ{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let AX=class extends j3{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,r,c,n,o,l),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!SW.get(this._editor)||e.target.type!==Rt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof Wk&&i.attachedData instanceof $be?new wUe(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof wUe?new Qd(async n=>{const{part:o}=e;if(await o.item.resolve(i),i.isCancellationRequested)return;let r;typeof o.item.hint.tooltip=="string"?r=new Mt().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(r=o.item.hint.tooltip),r&&n.emitOne(new m_(this,e.range,[r],!1,0)),eo(o.item.hint.textEdits)&&n.emitOne(new m_(this,e.range,[new Mt().appendText(g(5175,"Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Mt().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&n.emitOne(new m_(this,e.range,[a],!1,1)),o.part.location||o.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?Qt?g(5176,"cmd + click"):g(5177,"ctrl + click"):Qt?g(5178,"option + click"):g(5179,"alt + click");o.part.location&&o.part.command?l=new Mt().appendText(g(5180,"Go to Definition ({0}), right click for more",h)):o.part.location?l=new Mt().appendText(g(5181,"Go to Definition ({0})",h)):o.part.command&&(l=new Mt(`[${g(5182,"Execute Command")}](${zZe(o.part.command)} "${o.part.command.title}") (${h})`,{isTrusted:!0})),l&&n.emitOne(new m_(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(o,i);for await(const l of c)n.emitOne(l)}):Qd.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Qd.EMPTY;const{uri:i,range:n}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?RMe(this._languageFeaturesService.hoverProvider,r,new oe(n.startLineNumber,n.startColumn),t).filter(a=>!Q2(a.hover.contents)).map(a=>new m_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Qd.EMPTY}finally{o.dispose()}}};AX=D([_(1,xi),_(2,Ao),_(3,Ut),_(4,ec),_(5,Te),_(6,fn),_(7,it),_(8,vi)],AX);class HMe extends V{constructor(e,t,i,n,o,r){super();const a=t.anchor,c=t.hoverParts;this._renderedHoverParts=this._register(new Gbe(e,i,c,r,o));const{showAtPosition:l,showAtSecondaryPosition:d}=HMe.computeHoverPositions(e,a.range,c);this.shouldAppearBeforeContent=c.some(h=>h.isBeforeContent),this.showAtPosition=l,this.showAtSecondaryPosition=d,this.initialMousePosX=a.initialMousePosX,this.initialMousePosY=a.initialMousePosY,this.shouldFocus=n.shouldFocus,this.source=n.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}getAccessibleWidgetContent(){return this._renderedHoverParts.getAccessibleContent()}getAccessibleWidgetContentAtIndex(e){return this._renderedHoverParts.getAccessibleHoverContentAtIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}doesHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts.doesHoverAtIndexSupportVerbosityAction(e,t)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,u=h.convertModelRangeToViewRange(t),f=d.getLineMinColumn(u.startLineNumber),p=new oe(u.startLineNumber,f);n=h.convertViewPositionToModelPosition(p).column}const o=t.startLineNumber;let r=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===o,f=h.endLineNumber===o;if(u&&f){const m=h.startColumn,v=Math.min(r,m);r=Math.max(v,n)}d.forceShowAtRange&&(a=h)}let c,l;if(a){const d=a.getStartPosition();c=d,l=d}else c=t.getStartPosition(),l=new oe(o,r);return{showAtPosition:c,showAtSecondaryPosition:l}}}class gFt{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}const Nse=class Nse extends V{constructor(e,t,i,n,o){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=o,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,o,n)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return V.None;let i=t[0].range;for(const o of t){const r=o.range;i=F.plusRange(i,r)}const n=e.createDecorationsCollection();return n.set([{range:i,options:Nse._DECORATION_OPTIONS}]),Ee(()=>{n.clear()})}_renderParts(e,t,i,n){const o=new yX(n),r={fragment:this._fragment,statusBar:o,...i},a=new Z;for(const l of e){const d=this._renderHoverPartsForParticipant(t,l,r);a.add(d);for(const h of d.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:l,hoverPart:h.hoverPart,hoverElement:h.hoverElement})}const c=this._renderStatusBar(this._fragment,o);return c&&(a.add(c),this._renderedParts.push({type:"statusBar",hoverElement:c.hoverElement,actions:c.actions})),Ee(()=>{a.dispose()})}_renderHoverPartsForParticipant(e,t,i){const n=e.filter(r=>r.owner===t);return n.length>0?t.renderHoverParts(i,n):new UM([])}_renderStatusBar(e,t){if(t.hasContent)return new gFt(e,t)}_registerListenersOnRenderedParts(){const e=new Z;return this._renderedParts.forEach((t,i)=>{const n=t.hoverElement;n.tabIndex=0,e.add(ue(n,ke.FOCUS_IN,o=>{o.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(ue(n,ke.FOCUS_OUT,o=>{o.stopPropagation(),this._focusedHoverPartIndex=-1}))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof j3&&!(i instanceof AX));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof Y3)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}getAccessibleContent(){const e=[];for(let t=0;tQk.split(s).filter(e=>!e.startsWith("#"))}),Cw=class Cw{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+Cw.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Cw((this.value?[this.value,...e]:e).join(Cw.sep))}};Cw.sep=".",Cw.None=new Cw("@@none@@"),Cw.Empty=new Cw("");let Yn=Cw;var qp;(function(s){function e(o){return typeof o?.showDirectoryPicker=="function"}s.supported=e;function t(o){const r=o;return r?typeof r.kind=="string"&&typeof r.queryPermission=="function"&&typeof r.requestPermission=="function":!1}s.isFileSystemHandle=t;function i(o){return o.kind==="file"}s.isFileSystemFileHandle=i;function n(o){return o.kind==="directory"}s.isFileSystemDirectoryHandle=n})(qp||(qp={}));class kNt{get capabilities(){return this._capabilities||(this._capabilities=Vn.FileReadWrite|Vn.FileReadStream,pr&&(this._capabilities|=Vn.PathCaseSensitive)),this._capabilities}constructor(e,t,i){this.indexedDB=e,this.store=t,this.logService=i,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.extUri=pr?xn:kre,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",ot.FileNotFound);if(qp.isFileSystemFileHandle(t)){const i=await t.getFile();return{type:sn.File,mtime:i.lastModified,ctime:0,size:i.size}}return{type:sn.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",ot.FileNotFound);const i=[];for await(const[n,o]of t)i.push([n,qp.isFileSystemFileHandle(o)?sn.File:sn.Directory]);return i}catch(t){throw this.toFileSystemProviderError(t)}}readFileStream(e,t,i){const n=qA(o=>$e.concat(o.map(r=>$e.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",ot.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)),n.end(a)}else{const a=r.stream().getReader();let c=await a.read();for(;!c.done&&!(i.isCancellationRequested||(await n.write(c.value),i.isCancellationRequested));)c=await a.read();n.end(void 0)}}catch(o){n.error(this.toFileSystemProviderError(o)),n.end()}})(),n}async readFile(e){try{const t=await this.getFileHandle(e);if(!t)throw this.createFileSystemProviderError(e,"No such file or directory, readFile",ot.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 n=await this.getFileHandle(e);if(!i.create||!i.overwrite){if(n){if(!i.overwrite)throw this.createFileSystemProviderError(e,"File already exists, writeFile",ot.FileExists)}else if(!i.create)throw this.createFileSystemProviderError(e,"No such file, writeFile",ot.FileNotFound)}if(!n){const r=await this.getDirectoryHandle(this.extUri.dirname(e));if(!r)throw this.createFileSystemProviderError(e,"No such parent directory, writeFile",ot.FileNotFound);if(n=await r.getFileHandle(this.extUri.basename(e),{create:!0}),!n)throw this.createFileSystemProviderError(e,"Unable to create file , writeFile",ot.Unknown)}const o=await n.createWritable();await o.write(t),await o.close()}catch(n){throw this.toFileSystemProviderError(n)}}async mkdir(e){try{const t=await this.getDirectoryHandle(this.extUri.dirname(e));if(!t)throw this.createFileSystemProviderError(e,"No such parent directory, mkdir",ot.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",ot.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 n=await this.getFileHandle(e);if(n){const o=await n.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(607,"Rename is only supported for files."),ot.Unavailable)}catch(n){throw this.toFileSystemProviderError(n)}}watch(e,t){return V.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 n=Vy(e.name),o=Ko(e.name,n);let r=1;do i=`/${o}-${r++}${n}`;while(t.has(i)&&!await t.get(i)?.isSameEntry(e))}t.set(i,e);try{await this.indexedDB?.runInTransaction(this.store,"readwrite",n=>n.put(e,i))}catch(n){this.logService.error(n)}return N.from({scheme:pe.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 n=xn.basename(e);try{t=await i.getFileHandle(n)}catch{try{t=await i.getDirectoryHandle(n)}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(xn.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 n=await this.getDirectoryHandle(i);try{return await n?.getDirectoryHandle(xn.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 n=await this.indexedDB?.runInTransaction(this.store,"readonly",o=>o.get(t));if(qp.isFileSystemHandle(n)){let o=await n.queryPermission()==="granted";try{o||(o=await n.requestPermission()==="granted")}catch(r){this.logService.error(r)}if(o)return qp.isFileSystemFileHandle(n)?this._files.set(t,n):qp.isFileSystemDirectoryHandle(n)&&this._directories.set(t,n),n}throw this.createFileSystemProviderError(e,"No file system handle registered",ot.Unavailable)}toFileSystemProviderError(e){if(e instanceof AA)return e;let t=ot.Unknown;return e.name==="NotAllowedError"&&(e=new Error(g(608,"Insufficient permissions. Please retry and allow the operation.")),t=ot.Unavailable),us(e,t)}createFileSystemProviderError(e,t,i){return us(new Error(`${t} (${Dk(e.path)})`),i)}}const LM={EDITORS:"CodeEditors",FILES:"CodeFiles"};function INt(s){const e=[];if(s.dataTransfer&&s.dataTransfer.types.length>0){const n=s.dataTransfer.getData(LM.EDITORS);if(n)try{e.push(...G2(n))}catch{}else try{const a=s.dataTransfer.getData(tp.RESOURCES);e.push(...TNt(a))}catch{}if(s.dataTransfer?.files)for(let a=0;aLNt(r,e));for(const r of o)t.push({resource:r.resource,contents:r.contents?.toString(),isExternal:!0,allowWorkspaceOpen:r.isDirectory})}return t}function TNt(s){const e=[];if(s){const t=JSON.parse(s);for(const i of t)if(i.indexOf(":")>0){const{selection:n,uri:o}=NLe(N.parse(i));e.push({resource:o,options:{selection:n}})}}return e}async function LNt(s,e){if(qp.supported(si)){const i=e.dataTransfer?.items;if(i)return RNt(s,i)}const t=e.dataTransfer?.files;return t?MNt(s,t):[]}async function RNt(s,e){const t=s.get(Jt).getProvider(pe.file);if(!(t instanceof kNt))return[];const i=[];for(let n=0;n{try{const a=await o.getAsFileSystemHandle();if(!a){r.complete(void 0);return}qp.isFileSystemFileHandle(a)?r.complete({resource:await t.registerFileHandle(a),isDirectory:!1}):qp.isFileSystemDirectoryHandle(a)?r.complete({resource:await t.registerDirectoryHandle(a),isDirectory:!0}):r.complete(void 0)}catch{r.complete(void 0)}})()}}return Fi(await Promise.all(i.map(n=>n.p)))}async function MNt(s,e){const t=s.get(to),i=[];for(let n=0;n100*Nc.MB){t.warn(g(5675,"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 dc;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:N.from({scheme:pe.untitled,path:l}),contents:typeof d=="string"?$e.fromString(d):$e.wrap(new Uint8Array(d))})},a.readAsArrayBuffer(o)}}return Fi(await Promise.all(i.map(n=>n.p)))}function XXe(s,...e){if(!s.dataTransfer)return!1;const t=s.dataTransfer.types,i=[];for(let n=0;n=0)return!0;return!1}class NNt{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 uMe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Qe.add(uMe.DragAndDropContribution,new NNt);const zz=class zz{constructor(){}static getInstance(){return zz.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)}};zz.INSTANCE=new zz;let uX=zz;function ZXe(s){const e=new oce;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(o=>t.getAsString(o));e.append(i,z6(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,PNt(n))}}return e}function PNt(s){const e=s.path?N.parse(s.path):void 0;return DNt(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const FNt=Object.freeze([LM.EDITORS,LM.FILES,tp.RESOURCES,tp.INTERNAL_URI_LIST]);function eZe(s,e=!1){const t=ZXe(s),i=t.get(tp.INTERNAL_URI_LIST);if(i)t.replace(Us.uriList,i);else if(e||!t.has(Us.uriList)){const n=[];for(const o of s.items){const r=o.getAsFile();if(r){const a=r.path;try{a?n.push(N.file(a).toString()):n.push(N.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(Us.uriList,z6(Qk.create(n)))}for(const n of FNt)t.delete(n);return t}class gMe{async provideDocumentPasteEdits(e,t,i,n,o){const r=await this.getEdit(i,o);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const o=await this.getEdit(i,n);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}const jF=class jF extends gMe{constructor(){super(...arguments),this.id=jF.id,this.kind=jF.kind,this.dropMimeTypes=[Us.text],this.pasteMimeTypes=[Us.text]}async getEdit(e,t){const i=e.get(Us.text);if(!i||e.has(Us.uriList))return;const n=await i.asString();return{handledMimeType:Us.text,title:g(5042,"Insert Plain Text"),insertText:n,kind:this.kind}}};jF.id="text",jF.kind=new Yn("text.plain");let RM=jF;class tZe extends gMe{constructor(){super(...arguments),this.kind=new Yn("uri.absolute"),this.dropMimeTypes=[Us.uriList],this.pasteMimeTypes=[Us.uriList]}async getEdit(e,t){const i=await iZe(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map(({uri:a,originalText:c})=>a.scheme===pe.file?a.fsPath:(n++,c)).join(" ");let r;return n>0?r=i.length>1?g(5043,"Insert Uris"):g(5044,"Insert Uri"):r=i.length>1?g(5045,"Insert Paths"):g(5046,"Insert Path"),{handledMimeType:Us.uriList,insertText:o,title:r,kind:this.kind}}}let gX=class extends gMe{constructor(e){super(),this._workspaceContextService=e,this.kind=new Yn("uri.relative"),this.dropMimeTypes=[Us.uriList],this.pasteMimeTypes=[Us.uriList]}async getEdit(e,t){const i=await iZe(e);if(!i.length||t.isCancellationRequested)return;const n=Fi(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?SN(r.uri,o):void 0}));if(n.length)return{handledMimeType:Us.uriList,insertText:n.join(" "),title:i.length>1?g(5047,"Insert Relative Paths"):g(5048,"Insert Relative Path"),kind:this.kind}}};gX=D([_(0,yi)],gX);class ONt{constructor(){this.kind=new Yn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Us.text}]}async provideDocumentPasteEdits(e,t,i,n,o){if(n.triggerKind!==m8.PasteAs&&!n.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(5049,"Insert HTML"),kind:this.kind}]}}}async function iZe(s){const e=s.get(Us.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of Qk.parse(t))try{i.push({uri:N.parse(n),originalText:n})}catch{}return i}let vbe=class extends V{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new RM)),this._register(e.documentDropEditProvider.register("*",new tZe)),this._register(e.documentDropEditProvider.register("*",new gX(t)))}};vbe=D([_(0,it),_(1,yi)],vbe);let bbe=class extends V{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new RM)),this._register(e.documentPasteEditProvider.register("*",new tZe)),this._register(e.documentPasteEditProvider.register("*",new gX(t))),this._register(e.documentPasteEditProvider.register("*",new ONt))}};bbe=D([_(0,it),_(1,yi)],bbe);function nZe(s,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new eA(s,{range:i,text:typeof t.insertText=="string"?j_.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function sZe(s){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 s)for(const a of r.yieldTo??[])for(const c of s)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(s);const i=new Set,n=[];function o(r){if(!r.length)return[];const a=r[0];if(n.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&&(n.push(a),c=o(l),n.pop()),i.add(a),[...c,a,...o(r.slice(1))]}return o(Array.from(s))}var BNt=".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)}";ut(BNt,{});const WNt=Gt.register({description:"inline-progress-widget",stickiness:ni.NeverGrowsWhenTypingAtEdges,showIfCollapsed:!0,after:{content:$6e,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),kse=class kse extends V{constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=fe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=fe("span.icon");this.domNode.append(t),t.classList.add(...We.asClassNameArray(ve.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(x.lineHeight);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(x.fontSize)||n.hasChanged(x.lineHeight))&&i()})),this._register(ue(this.domNode,ke.CLICK,n=>{this.delegate.cancel()}))}getId(){return kse.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[es.EXACT]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};kse.baseId="editor.widget.inlineProgressWidget";let wbe=kse,fX=class extends V{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new wn),this._currentWidget=this._register(new wn),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,o){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Ky(()=>{const a=F.fromPositions(e);this._currentDecorations.set([{range:a,options:WNt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(wbe,this.id,this._editor,a,t,n))},o??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};fX=D([_(2,we)],fX);var HNt=".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}";ut(HNt,{});var sQ,FD;let Ih=(FD=class{static get(e){return e.getContribution(sQ.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new wn,this._messageListeners=new Z,this._mouseOverMessage=!1,this._editor=e,this._visible=sQ.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){Mr(cd(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=cd(e)?d6(e,{actionHandler:{callback:n=>{this.closeMessage(),cae(this._openerService,n,cd(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new KHe(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(M.debounce(this._editor.onDidBlurEditorText,(n,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&wc(Bc(),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(ue(this._messageWidget.value.getDomNode(),ke.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),ke.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new F(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(KHe.fadeOut(this._messageWidget.value))}},sQ=FD,FD.ID="editor.contrib.messageController",FD.MESSAGE_VISIBLE=new Y("messageVisible",!1,g(5105,"Whether the editor is currently showing an inline message")),FD);Ih=sQ=D([_(1,Le),_(2,Ao)],Ih);const UNt=hc.bindToContribution(Ih.get);qe(new UNt({id:"leaveEditorMessage",precondition:Ih.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:Ae.EditorContrib+30,primary:S.Escape}}));let KHe=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},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,mt.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 n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),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:[es.ABOVE,es.BELOW],positionAffinity:Io.Right}}afterRender(e){this._domNode.classList.toggle("below",e===es.BELOW)}};on(Ih.ID,Ih,ri.Lazy);var dd;(function(s){s[s.Explorer=1]="Explorer",s[s.Scm=3]="Scm",s[s.Extensions=5]="Extensions",s[s.Window=10]="Window",s[s.Notification=15]="Notification",s[s.Dialog=20]="Dialog"})(dd||(dd={}));const qPe=class qPe{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};qPe.None=Object.freeze({report(){}});let cu=qPe,qHe=class extends V{constructor(e,t){super(),this.deferred=new dc,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}};qHe=D([_(1,og)],qHe);var VNt=".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}";ut(VNt,{});var ybe,xL;let Cbe=(xL=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,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(M.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=fe(".post-edit-widget"),this.button=this._register(new jd(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ue(this.domNode,ke.CLICK,()=>this.showSelector()))}getId(){return ybe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[es.BELOW]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Cr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>ol({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},ybe=xL,xL.baseId="editor.widget.postEditWidget",xL);Cbe=ybe=D([_(7,lr),_(8,Le),_(9,Ut)],Cbe);let pX=class extends V{constructor(e,t,i,n,o,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=o,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new wn),this._register(M.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,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 b=this._editor.getModel();b&&(await b.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,n,o))},l=(v,b)=>{Fr(v)||(this._notificationService.error(b),i&&this.show(e[0],t,c))};let d;try{d=await n(a,o)}catch(v){return l(v,g(9845,`Error resolving edit '{0}': +{1}`,a.title,Nr(v)))}if(o.isCancellationRequested)return;const h=nZe(r.uri,e,d),u=e[0],f=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:ni.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(9846,`Error applying edit '{0}': +{1}`,a.title,Nr(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(Cbe,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};pX=D([_(4,we),_(5,LN),_(6,bi)],pX);var r0;const oZe="editor.changePasteType",fMe=new Y("pasteWidgetVisible",!1,g(4993,"Whether the paste widget is showing")),Vhe="application/vnd.code.copyMetadata";var DL;let tC=(DL=class extends V{static get(e){return e.getContribution(r0.ID)}constructor(e,t,i,n,o,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=o,this._quickInputService=r,this._progressService=a,this._editor=e;const c=e.getContainerDomNode();this._register(ue(c,"copy",l=>this.handleCopy(l))),this._register(ue(c,"cut",l=>this.handleCopy(l))),this._register(ue(c,"paste",l=>this.handlePaste(l),!0)),this._pasteProgressManager=this._register(new fX("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(pX,"pasteIntoEditor",e,fMe,{id:oZe,label:g(4994,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},Bu().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()||(Wn&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!i?.length)return;const n=this._editor.getOption(x.emptySelectionClipboard);let o=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!n)return;o=[new F(o[0].startLineNumber,1,o[0].startLineNumber,1+t.getLineLength(o[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(i,n,Qn),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=ZXe(e.clipboardData),u=d.flatMap(m=>m.copyMimeTypes??[]),f=ar();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:u,defaultPastePayload:l});const p=Rr(async m=>{const v=Fi(await Promise.all(d.map(async b=>{try{return await b.prepareDocumentPaste(t,o,h,m)}catch(w){console.error(w);return}})));v.reverse();for(const b of v)for(const[w,y]of b)h.replace(w,y);return h});r0._currentCopyOperation?.dataTransferPromise.cancel(),r0._currentCopyOperation={handle:f,dataTransferPromise:p}}async handlePaste(e){if(!e.clipboardData||!this._editor.hasTextFocus())return;Ih.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 n=this.fetchCopyMetadata(e),o=eZe(e.clipboardData);o.delete(Vhe);const r=[...e.clipboardData.types,...n?.providerCopyMimeTypes??[],Us.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=>jXe(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,n):this.doPasteInline(a,i,o,n,e)}showPasteAsNoEditMessage(e,t){Ih.get(this._editor)?.showMessage(g(4995,"No paste edits for '{0}' found",t instanceof Yn?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,n,o){const r=this._editor;if(!r.hasModel())return;const a=new Kk(r,jo.Value|jo.Selection,void 0),c=Rr(async l=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new Z,f=u.add(new ci(l));u.add(a.token.onCancellationRequested(()=>f.cancel()));const p=f.token;try{if(await this.mergeInDataFromCopy(i,n,p),p.isCancellationRequested)return;const m=e.filter(w=>this.isSupportedPasteProvider(w,i));if(!m.length||m.length===1&&m[0]instanceof RM)return this.applyDefaultPasteHandler(i,n,p,o);const v={triggerKind:m8.Automatic},b=await this.getPasteEdits(m,i,h,t,v,p);if(u.add(b),p.isCancellationRequested)return;if(b.edits.length===1&&b.edits[0].provider instanceof RM)return this.applyDefaultPasteHandler(i,n,p,o);if(b.edits.length){const w=d.getOption(x.pasteAs).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:b.edits},w,(y,C)=>new Promise((A,L)=>{(async()=>{try{const k=y.provider.resolveDocumentPasteEdit?.(y,C),P=new dc,R=k&&await this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(4996,"Resolving paste edit. Click to cancel"),Promise.race([P.p,k]),{cancel:()=>(P.cancel(),L(new Ma))},0);return R&&(y.additionalEdit=R.additionalEdit),A(y)}catch(k){return L(k)}})()}),p)}await this.applyDefaultPasteHandler(i,n,p,o)}finally{u.dispose(),this._currentPasteOperation===c&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),g(4997,"Running paste handlers. Click to cancel and do basic paste"),c,{cancel:async()=>{try{if(c.cancel(),a.token.isCancellationRequested)return;await this.applyDefaultPasteHandler(i,n,a.token,o)}finally{a.dispose()}}}).then(()=>{a.dispose()}),this._currentPasteOperation=c}showPasteAsPick(e,t,i,n,o){const r=Rr(async a=>{const c=this._editor;if(!c.hasModel())return;const l=c.getModel(),d=new Z,h=d.add(new Kk(c,jo.Value|jo.Selection,void 0,a));try{if(await this.mergeInDataFromCopy(n,o,h.token),h.token.isCancellationRequested)return;let u=t.filter(b=>this.isSupportedPasteProvider(b,n,e));e&&(u=u.filter(b=>this.providerMatchesPreference(b,e)));const f={triggerKind:m8.PasteAs,only:e&&e instanceof Yn?e:void 0};let p=d.add(await this.getPasteEdits(u,n,l,i,f,h.token));if(h.token.isCancellationRequested)return;if(e&&(p={edits:p.edits.filter(b=>e instanceof Yn?e.contains(b.kind):e.providerId===b.provider.id),dispose:p.dispose}),!p.edits.length){f.only&&this.showPasteAsNoEditMessage(i,f.only);return}let m;if(e?m=p.edits.at(0):m=(await this._quickInputService.pick(p.edits.map(w=>({label:w.title,description:w.kind?.value,edit:w})),{placeHolder:g(4998,"Select Paste Action")}))?.edit,!m)return;const v=nZe(l.uri,i,m);await this._bulkEditService.apply(v,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:dd.Window,title:g(4999,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(Vhe,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(Vhe);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=Qpe.getTextData(e.clipboardData);if(n)return{defaultPastePayload:{mode:n.mode,multicursorText:n.multicursorText??null,pasteOnNewLine:!!n.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){if(t?.id&&r0._currentCopyOperation?.handle===t.id){const n=await r0._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,r]of n)e.replace(o,r)}if(!e.has(Us.uriList)){const n=await this._clipboardService.readResources();if(i.isCancellationRequested)return;n.length&&e.append(Us.uriList,z6(Qk.create(n)))}}async getPasteEdits(e,t,i,n,o,r){const a=new Z,c=await B_(Promise.all(e.map(async d=>{try{const h=await d.provideDocumentPasteEdits?.(i,n,t,o,r);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:d}))}catch(h){Fr(h)||console.error(h);return}})),r),l=Fi(c??[]).flat().filter(d=>!o.only||o.only.contains(d.kind));return{edits:sZe(l),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const r=await(e.get(Us.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;const a={clipboardEvent:n,text:r,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._editor.trigger("keyboard",oc.Paste,a)}isSupportedPasteProvider(e,t,i){return e.pasteMimeTypes?.some(n=>t.matches(n))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof Yn?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},r0=DL,DL.ID="editor.contrib.copyPasteActionController",DL);tC=r0=D([_(1,we),_(2,LN),_(3,ag),_(4,it),_(5,In),_(6,og)],tC);const ys=new class{constructor(){this.QuickFix=new Yn("quickfix"),this.Refactor=new Yn("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 Yn("notebook"),this.Source=new Yn("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var id;(function(s){s.IfSingle="ifSingle",s.First="first",s.Never="never"})(id||(id={}));var tg;(function(s){s.Refactor="refactor",s.RefactorPreview="refactor preview",s.Lightbulb="lightbulb",s.Default="other (default)",s.SourceAction="source action",s.QuickFix="quick fix action",s.FixAll="fix all",s.OrganizeImports="organize imports",s.AutoFix="auto fix",s.QuickFixHover="quick fix hover window",s.OnSave="save participants",s.ProblemsView="problems view"})(tg||(tg={}));function zNt(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>rZe(e,t,s.include))||!s.includeSourceActions&&ys.Source.contains(e))}function $Nt(s,e){const t=e.kind?new Yn(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>rZe(t,i,s.include))||!s.includeSourceActions&&t&&ys.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function rZe(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}class $w{static fromUser(e,t){return!e||typeof e!="object"?new $w(t.kind,t.apply,!1):new $w($w.getKindFromUser(e,t.kind),$w.getApplyFromUser(e,t.apply),$w.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return id.First;case"never":return id.Never;case"ifsingle":return id.IfSingle;default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Yn(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 GNt{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){No(i)}t&&(this.action.edit=t.edit)}return this}}const pMe="editor.action.codeAction",mMe="editor.action.quickFix",aZe="editor.action.autoFix",_Me="editor.action.refactor",vMe="editor.action.sourceAction",Sbe="editor.action.organizeImports",Abe="editor.action.fixAll";class P5 extends V{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:eo(e.diagnostics)?eo(t.diagnostics)?P5.codeActionsPreferredComparator(e,t):-1:eo(t.diagnostics)?1:P5.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(P5.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ys.QuickFix.contains(new Yn(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 QHe={actions:[],documentation:void 0};async function jO(s,e,t,i,n,o){const r=i.filter||{},a={...r,excludes:[...r.excludes||[],ys.Notebook]},c={only:r.include?.value,trigger:i.type},l=new vRe(e,o),d=i.type===wh.Auto,h=KNt(s,e,d?a:r),u=new Z,f=h.map(async m=>{try{n.report(m);const v=await m.provideCodeActions(e,t,c,l.token);if(v&&u.add(v),l.token.isCancellationRequested)return QHe;const b=(v?.actions||[]).filter(y=>y&&$Nt(r,y)),w=QNt(m,b,r.include);return{actions:b.map(y=>new GNt(y,m)),documentation:w}}catch(v){if(Fr(v))throw v;return No(v),QHe}}),p=s.onDidChange(()=>{const m=s.all(e);is(m,h)||l.cancel()});try{const m=await Promise.all(f),v=m.map(w=>w.actions).flat(),b=[...Fi(m.map(w=>w.documentation)),...qNt(s,e,i,v)];return new P5(v,b,u)}finally{p.dispose(),l.dispose()}}function KNt(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>zNt(t,new Yn(n))):!0)}function*qNt(s,e,t,i){if(e&&i.length)for(const n of s.all(e))n._getAdditionalMenuItems&&(yield*n._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(o=>o.action)))}function QNt(s,e,t){if(!s.documentation)return;const i=s.documentation.map(n=>({kind:new Yn(n.kind),command:n.command}));if(t){let n;for(const o of i)o.kind.contains(t)&&(n?n.kind.contains(o.kind)&&(n=o):n=o);if(n)return n?.command}for(const n of e)if(n.kind){for(const o of i)if(o.kind.contains(new Yn(n.kind)))return o.command}}var Lx;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions",s.FromAILightbulb="fromAILightbulb"})(Lx||(Lx={}));async function cZe(s,e,t,i,n=He.None){const o=s.get(LN),r=s.get(vi),a=s.get(Yi),c=s.get(bi);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.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!==Lx.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(l){const d=jNt(l);c.error(typeof d=="string"?d:g(4521,"An unknown error occurred while applying the code action"))}}function jNt(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}_t.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,n){if(!(e instanceof N))throw Pi();const{codeActionProvider:o}=s.get(it),r=s.get(gi).getModel(e);if(!r)throw Pi();const a=dt.isISelection(t)?dt.liftSelection(t):F.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Pi();const c=typeof i=="string"?new Yn(i):void 0,l=await jO(o,r,a,{type:wh.Invoke,triggerAction:tg.Default,filter:{includeSourceActions:!0,include:c}},cu.None,He.None),d=[],h=Math.min(l.validActions.length,typeof n=="number"?n:0);for(let u=0;uu.action)}finally{setTimeout(()=>l.dispose(),100)}});var Ebe,kL;let xbe=(kL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new ya(()=>this.keybindingService.getKeybindings().filter(t=>Ebe.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Sbe?i={kind:ys.SourceOrganizeImports.value}:t.command===Abe&&(i={kind:ys.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...$w.fromUser(i,{kind:Yn.None,apply:id.Never})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Yn(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,o)=>n?n.kind.contains(o.kind)?o:n:o,void 0)}},Ebe=kL,kL.codeActionCommands=[_Me,pMe,vMe,Sbe,Abe],kL);xbe=Ebe=D([_(0,Ut)],xbe);var YNt='.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}';ut(YNt,{});const lZe="acceptSelectedCodeAction",dZe="previewSelectedCodeAction";var u_;(function(s){s.Action="action",s.Header="header"})(u_||(u_={}));class JNt{get templateId(){return u_.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 Dbe=class{get templateId(){return u_.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 n=new Vk(e,po);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=We.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=ze(e.group.icon.color.id))):(i.icon.className=We.asClassName(ve.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=hZe(e.label),i.keybinding.set(e.keybinding),eTe(!!e.keybinding,i.keybinding.element);const n=this._keybindingService.lookupKeybinding(lZe)?.getLabel(),o=this._keybindingService.lookupKeybinding(dZe)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:n&&o?this._supportsPreview&&e.canPreview?i.container.title=g(11229,"{0} to Apply, {1} to Preview",n,o):i.container.title=g(11230,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};Dbe=D([_(1,Ut)],Dbe);class XNt extends UIEvent{constructor(){super("acceptSelectedAction")}}class jHe extends UIEvent{constructor(){super("previewSelectedAction")}}function ZNt(s){if(s.kind==="action")return s.label}let kbe=class extends V{constructor(e,t,i,n,o,r){super(),this._delegate=n,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new ci),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:c=>c.kind===u_.Header?this._headerLineHeight:this._actionLineHeight,getTemplateId:c=>c.kind};this._list=this._register(new Xa(e,this.domNode,a,[new Dbe(t,this._keybindingService),new JNt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:ZNt},accessibilityProvider:{getAriaLabel:c=>{if(c.kind===u_.Action){let l=c.label?hZe(c?.label):"";return c.disabled&&(l=g(11231,"{0}, Disabled Reason: {1}",l,c.disabled)),l}return null},getWidgetAriaLabel:()=>g(11232,"Action Widget"),getRole:c=>c.kind===u_.Action?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(MN),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===u_.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,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);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(n,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],n=this._list.element(i);if(!this.focusCondition(n))return;const o=e?new jHe:new XNt;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 jHe):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===u_.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([])}};kbe=D([_(4,gf),_(5,Ut)],kbe);function hZe(s){return s.replace(/\r\n|\r|\n/g," ")}const uZe=Object.freeze({kind:Yn.Empty,title:g(9847,"More Actions...")}),ePt=Object.freeze([{kind:ys.QuickFix,title:g(9848,"Quick Fix")},{kind:ys.RefactorExtract,title:g(9849,"Extract"),icon:ve.wrench},{kind:ys.RefactorInline,title:g(9850,"Inline"),icon:ve.wrench},{kind:ys.RefactorRewrite,title:g(9851,"Rewrite"),icon:ve.wrench},{kind:ys.RefactorMove,title:g(9852,"Move"),icon:ve.wrench},{kind:ys.SurroundWith,title:g(9853,"Surround With"),icon:ve.surroundWith},{kind:ys.Source,title:g(9854,"Source Action"),icon:ve.symbolFile},uZe]);function tPt(s,e,t){if(!e)return s.map(o=>({kind:u_.Action,item:o,group:uZe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!o.action.edit?.edits.length}));const i=ePt.map(o=>({group:o,actions:[]}));for(const o of s){const r=o.action.kind?new Yn(o.action.kind):Yn.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const n=[];for(const o of i)if(o.actions.length){n.push({kind:u_.Header,group:o.group});for(const r of o.actions){const a=o.group;n.push({kind:u_.Action,item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:ve.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var iPt='.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{content:"";display:block;height:100%;left:0;opacity:.3;position:absolute;top:0;width:100%;z-index:1}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{cursor:pointer;display:block}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}';ut(iPt,{});var LP;const YHe=oi("gutter-lightbulb",ve.lightBulb,g(5031,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),JHe=oi("gutter-lightbulb-auto-fix",ve.lightbulbAutofix,g(5032,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),XHe=oi("gutter-lightbulb-sparkle",ve.lightbulbSparkle,g(5033,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),ZHe=oi("gutter-lightbulb-aifix-auto-fix",ve.lightbulbSparkleAutofix,g(5034,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),eUe=oi("gutter-lightbulb-sparkle-filled",ve.sparkleFilled,g(5035,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var Cd;(function(s){let e;(function(i){i[i.Hidden=0]="Hidden",i[i.Showing=1]="Showing"})(e=s.Type||(s.Type={})),s.Hidden={type:e.Hidden};class t{constructor(n,o,r,a){this.actions=n,this.trigger=o,this.editorPosition=r,this.widgetPosition=a,this.type=e.Showing}}s.Showing=t})(Cd||(Cd={}));var BS;let G3=(BS=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new I),this.onClick=this._onClick.event,this._state=Cd.Hidden,this._gutterState=Cd.Hidden,this._iconClasses=[],this.gutterDecoration=LP.GUTTER_DECORATION,this._domNode=fe("div.lightBulbWidget"),this._domNode.role="listbox",this._register(ud.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const n=this._editor.getModel();(this.state.type!==Cd.Type.Showing||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide(),(this.gutterState.type!==Cd.Type.Showing||!n||this.gutterState.editorPosition.lineNumber>=n.getLineCount())&&this.gutterHide()})),this._register(ndt(this._domNode,i=>{if(this.state.type!==Cd.Type.Showing)return;this._editor.focus(),i.preventDefault();const{top:n,height:o}=Cr(this._domNode),r=this._editor.getOption(x.lineHeight);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(M.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding(aZe)?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding(mMe)?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{const n=["codicon-"+YHe.id,"codicon-"+ZHe.id,"codicon-"+JHe.id,"codicon-"+XHe.id,"codicon-"+eUe.id];if(!i.target.element||!n.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==Cd.Type.Showing)return;this._editor.focus();const{top:o,height:r}=Cr(i.target.element),a=this._editor.getOption(x.lineHeight);let c=Math.floor(a/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,f=w=>w>2&&this._editor.getTopForLineNumber(w)===this._editor.getTopForLineNumber(w-1);let p=r,m=1;if(!u){const w=y=>{const C=o.getLineContent(y);return/^\s*$|^\s+/.test(C)||C.length<=m};if(r>1&&!f(r-1)){const y=o.getLineCount(),C=r===y,A=r>1&&w(r-1),L=!C&&w(r+1),k=w(r),P=!L&&!A;let R=!1;const z=this._editor.getLineDecorations(r);if(z)for(const G of z)G.options.glyphMarginClassName?.includes(ve.debugBreakpoint.id)&&(R=!0);if(!L&&!A&&!R)return this.gutterState=new Cd.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:LP._posPref}),this.renderGutterLightbub(),this.hide();A||C||P&&!k?p-=1:(L||P&&k)&&(p+=1)}else{if(r===1&&(r===o.getLineCount()||!w(r+1)&&!w(r)))return this.gutterState=new Cd.Showing(e,t,i,{position:{lineNumber:p,column:m},preference:LP._posPref}),this.renderGutterLightbub(),this.hide();if(r{this._gutterDecorationID=t.addDecoration(new F(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new F(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===Cd.Type.Showing&&(t?this.title=g(5036,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=g(5037,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=g(5038,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=g(5039,"Show Code Actions")))}set title(e){this._domNode.title=e}},LP=BS,BS.GUTTER_DECORATION=Gt.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:We.asClassName(ve.lightBulb),glyphMargin:{position:z_.Left},stickiness:ni.NeverGrowsWhenTypingAtEdges}),BS.ID="editor.contrib.lightbulbWidget",BS._posPref=[es.EXACT],BS);G3=LP=D([_(1,Ut)],G3);W("actionBar.toggledBackground",n6,g(9855,"Background color for toggled action items in action bar."));const MM={Visible:new Y("codeActionMenuVisible",!1,g(9856,"Whether the action widget list is visible"))},HN=ae("actionWidgetService");let NM=class extends V{get isVisible(){return MM.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new wn)}show(e,t,i,n,o,r,a){const c=MM.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(kbe,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>o,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 n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)n.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(ue(a,ke.MOUSE_DOWN,f=>f.stopPropagation()));const c=document.createElement("div"),l=e.appendChild(c);l.classList.add("context-view-pointerBlock"),o.add(ue(l,ke.POINTER_MOVE,()=>l.remove())),o.add(ue(l,ke.MOUSE_DOWN,()=>l.remove()));let d=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(n.appendChild(f.getContainer().parentElement),o.add(f),d=f.getContainer().offsetWidth)}const h=this._list.value?.layout(d);n.style.width=`${h}px`;const u=o.add(Ac(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=fe(e),n=new ld(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};NM=D([_(0,gf),_(1,Le),_(2,we)],NM);ce(HN,NM,qt.Delayed);const $6=Ae.EditorContrib+1e3;At(class extends li{constructor(){super({id:"hideCodeActionWidget",title:Fe(9857,"Hide action widget"),precondition:MM.Visible,keybinding:{weight:$6,primary:S.Escape,secondary:[U.Shift|S.Escape]}})}run(s){s.get(HN).hide(!0)}});At(class extends li{constructor(){super({id:"selectPrevCodeAction",title:Fe(9858,"Select previous action"),precondition:MM.Visible,keybinding:{weight:$6,primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.CtrlCmd|S.UpArrow,U.WinCtrl|S.KeyP]}}})}run(s){const e=s.get(HN);e instanceof NM&&e.focusPrevious()}});At(class extends li{constructor(){super({id:"selectNextCodeAction",title:Fe(9859,"Select next action"),precondition:MM.Visible,keybinding:{weight:$6,primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.CtrlCmd|S.DownArrow,U.WinCtrl|S.KeyN]}}})}run(s){const e=s.get(HN);e instanceof NM&&e.focusNext()}});At(class extends li{constructor(){super({id:lZe,title:Fe(9860,"Accept selected action"),precondition:MM.Visible,keybinding:{weight:$6,primary:S.Enter,secondary:[U.CtrlCmd|S.Period]}})}run(s){const e=s.get(HN);e instanceof NM&&e.acceptSelected()}});At(class extends li{constructor(){super({id:dZe,title:Fe(9861,"Preview selected action"),precondition:MM.Visible,keybinding:{weight:$6,primary:U.CtrlCmd|S.Enter}})}run(s){const e=s.get(HN);e instanceof NM&&e.acceptSelected(!0)}});const gZe=new Y("supportedCodeAction",""),tUe="_typescript.applyFixAllCodeAction";class nPt extends V{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new bm),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=>ji(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:wh.Auto,triggerAction:tg.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===wh.Invoke)return t;const i=this._editor.getOption(x.lightbulb).enabled;if(i!==s_.Off){{if(i===s_.On)return t;if(i===s_.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 Mv;(function(s){let e;(function(i){i[i.Empty=0]="Empty",i[i.Triggered=1]="Triggered"})(e=s.Type||(s.Type={})),s.Empty={type:e.Empty};class t{constructor(n,o,r){this.trigger=n,this.position=o,this._cancellablePromise=r,this.type=e.Triggered,this.actions=r.catch(a=>{if(Fr(a))return fZe;throw a})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=t})(Mv||(Mv={}));const fZe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class sPt extends V{constructor(e,t,i,n,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new wn),this._state=Mv.Empty,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=gZe.bindTo(n),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(Mv.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(Mv.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 nPt(this._editor,this._markerService,i=>{if(!i){this.setState(Mv.Empty);return}const n=i.selection.getStartPosition(),o=Rr(async c=>{if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===wh.Invoke&&(i.trigger.triggerAction===tg.QuickFix||i.trigger.filter?.include?.contains(ys.QuickFix))){const l=await jO(this._registry,e,i.selection,i.trigger,cu.None,c),d=[...l.allActions];if(c.isCancellationRequested)return fZe;const h=l.validActions?.some(f=>f.action.kind?ys.QuickFix.contains(new Yn(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(tUe))&&(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 w of u){const y=w.endColumn,C=w.endLineNumber,A=w.startLineNumber;if(C===f.lineNumber||A===f.lineNumber){p=new oe(C,y);const L={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:i.trigger.filter?.include?i.trigger.filter?.include:ys.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:i.trigger.context?.notAvailableMessage||"",position:p}},k=new dt(p.lineNumber,p.column,p.lineNumber,p.column),P=await jO(this._registry,e,k,L,cu.None,c);if(P.validActions.length!==0){for(const R of P.validActions)R.action.command?.arguments?.some(z=>typeof z=="string"&&z.includes(tUe))&&(R.action.diagnostics=[...u.filter(z=>z.relatedInformation)]);l.allActions.length===0&&d.push(...P.allActions),Math.abs(f.column-y)C.findIndex(A=>A.action.title===w.action.title)===y);return b.sort((w,y)=>w.action.isPreferred&&!y.action.isPreferred?-1:!w.action.isPreferred&&y.action.isPreferred||w.action.isAI&&!y.action.isAI?1:!w.action.isAI&&y.action.isAI?-1:0),{validActions:b,allActions:d,documentation:l.documentation,hasAutoFix:l.hasAutoFix,hasAIFix:l.hasAIFix,allAIFixes:l.allAIFixes,dispose:()=>{l.dispose()}}}}return jO(this._registry,e,i.selection,i.trigger,cu.None,c)});i.trigger.type===wh.Invoke&&this._progressService?.showWhile(o,250);const r=new Mv.Triggered(i.trigger,n,o);let a=!1;this._state.type===Mv.Type.Triggered&&(a=this._state.trigger.type===wh.Invoke&&r.type===Mv.Type.Triggered&&r.trigger.type===wh.Auto&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:wh.Auto,triggerAction:tg.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===Mv.Type.Triggered&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var RP;const oPt="quickfix-edit-highlight";var OD;let PM=(OD=class extends V{static get(e){return e.getContribution(RP.ID)}constructor(e,t,i,n,o,r,a,c,l,d){super(),this._commandService=a,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=d,this._activeCodeActions=this._register(new wn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new sPt(this._editor,o.codeActionProvider,t,i,r,c)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new ya(()=>{const h=this._editor.getContribution(G3.ID);return h&&this._register(h.onClick(u=>this.showCodeActionsFromLightbulb(u.actions,u))),h}),this._resolver=n.createInstance(xbe),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],n=i.action.command;n&&n.id==="inlineChat.start"&&n.arguments&&n.arguments.length>=1&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,Lx.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,n){if(!this._editor.hasModel())return;Ih.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:wh.Invoke,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,n){try{await this._instantiationService.invokeFunction(cZe,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:wh.Auto,triggerAction:tg.QuickFix,filter:{}})}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==Mv.Type.Triggered){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(i){vt(i);return}if(!this._disposed)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),e.trigger.type===wh.Invoke){if(e.trigger.filter?.include){const n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this._applyCodeAction(n,!1,!1,Lx.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const o=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(o&&o.action.disabled){Ih.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)){Ih.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===id.First&&t.validActions.length===0||e.autoApply===id.IfSingle&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===id.First&&t.validActions.length>0||e.autoApply===id.IfSingle&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const n=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?Lx.FromAILightbulb:Lx.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:l=>{this._editor?.focus(),n.clear()},onHover:async(l,d)=>{if(d.isCancellationRequested)return;let h=!1;const u=l.action.kind;if(u){const f=new Yn(u);h=[ys.RefactorExtract,ys.RefactorInline,ys.RefactorRewrite,ys.RefactorMove,ys.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(n.clear(),d&&d.length>0){const u=h&&h?.length>1?h.map(f=>({range:f,options:RP.DECORATION})):d.map(f=>({range:f,options:RP.DECORATION}));n.set(u)}else if(h&&h.length>0){const u=h.map(p=>({range:p,options:RP.DECORATION}));n.set(u);const f=h[0];if(f.startLineNumber&&f.startColumn){const p=this._editor.getModel()?.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn})?.word;Ch(g(5028,"Context: {0} at line {1} and column {2}.",p,f.startLineNumber,f.startColumn))}}}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,tPt(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,mt.Immediate),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Cr(this._editor.getDomNode()),n=i.left+t.left,o=i.top+t.top+t.height;return{x:n,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 n=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&&n.push(this._showDisabled?{id:"hideMoreActions",label:g(5029,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:g(5030,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}},RP=OD,OD.ID="editor.contrib.codeActionController",OD.DECORATION=Gt.register({description:"quickfix-highlight",className:oPt}),OD);PM=RP=D([_(1,ym),_(2,Le),_(3,we),_(4,it),_(5,YA),_(6,vi),_(7,Te),_(8,HN),_(9,we)],PM);bp((s,e)=>{((n,o)=>{o&&e.addRule(`.monaco-editor ${n} { background-color: ${o}; }`)})(".quickfix-edit-highlight",s.getColor(fb));const i=s.getColor(bx);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Iy(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var Ibe;const pZe="editor.experimental.dropIntoEditor.defaultProvider",mZe="editor.changeDropType",bMe=new Y("dropWidgetVisible",!1,g(5050,"Whether the drop widget is showing"));var IL;let FM=(IL=class extends V{static get(e){return e.getContribution(Ibe.ID)}constructor(e,t,i,n,o){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=uX.getInstance(),this._dropProgressManager=this._register(t.createInstance(fX,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(pX,"dropIntoEditor",e,bMe,{id:mZe,label:g(5051,"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 n=Rr(async o=>{const r=new Z,a=r.add(new Kk(e,jo.Value,void 0,o));try{const c=await this.extractDataTransferData(i);if(c.size===0||a.token.isCancellationRequested)return;const l=e.getModel();if(!l)return;const d=this._languageFeaturesService.documentDropEditProvider.ordered(l).filter(u=>u.dropMimeTypes?u.dropMimeTypes.some(f=>c.matches(f)):!0),h=r.add(await this.getDropEdits(d,l,t,c,a));if(a.token.isCancellationRequested)return;if(h.edits.length){const u=this.getInitialActiveEditIndex(l,h.edits),f=e.getOption(x.dropIntoEditor).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([F.fromPositions(t)],{activeEditIndex:u,allEdits:h.edits},f,async p=>p,o)}}finally{r.dispose(),this._currentOperation===n&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,g(5052,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),this._currentOperation=n}async getDropEdits(e,t,i,n,o){const r=new Z,a=await B_(Promise.all(e.map(async l=>{try{const d=await l.provideDocumentDropEdits(t,i,n,o.token);return d&&r.add(d),d?.edits.map(h=>({...h,providerId:l.id}))}catch(d){console.error(d)}})),o.token),c=Fi(a??[]).flat();return{edits:sZe(c),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(pZe,{resource:e.uri});for(const[n,o]of Object.entries(i)){const r=new Yn(o),a=t.findIndex(c=>r.value===c.providerId&&c.handledMimeType&&jXe(n,[c.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new oce;const t=eZe(e.dataTransfer);if(this.treeItemsTransfer.hasData(NWe.prototype)){const i=this.treeItemsTransfer.getData(NWe.prototype);if(Array.isArray(i))for(const n of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(n.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},Ibe=IL,IL.ID="editor.contrib.dropIntoEditorController",IL);FM=Ibe=D([_(1,we),_(2,Te),_(3,it),_(4,Tae)],FM);var rPt=".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}";ut(rPt,{});function Tbe(s,e){return!!s[e]}class zhe{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Tbe(e.event,t.triggerModifier),this.hasSideBySideModifier=Tbe(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class iUe{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Tbe(e,t.triggerModifier)}}class _K{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function nUe(s){return s==="altKey"?Qt?new _K(S.Meta,"metaKey",S.Alt,"altKey"):new _K(S.Ctrl,"ctrlKey",S.Alt,"altKey"):Qt?new _K(S.Alt,"altKey",S.Meta,"metaKey"):new _K(S.Alt,"altKey",S.Ctrl,"ctrlKey")}class rce extends V{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=nUe(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 n=nUe(this._editor.getOption(x.multiCursorModifier));if(this._opts.equals(n))return;this._opts=n,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new zhe(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new zhe(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new zhe(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new iUe(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new iUe(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 aPt=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 mX{constructor(e){this._disposables=new Z;let t=[];for(const[i,n]of e){const o=i.links.map(r=>new aPt(r,n));t=mX._union(t,o),mN(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,r,a;for(n=0,r=0,o=e.length,a=t.length;nPromise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[r]=[a,o])},No));return Promise.all(n).then(()=>{const o=new mX(Fi(i));return t.isCancellationRequested?(o.dispose(),new mX([])):o})}_t.registerCommand("_executeLinkProvider",async(s,...e)=>{let[t,i]=e;Tt(t instanceof N),typeof i!="number"&&(i=0);const{linkProvider:n}=s.get(it),o=s.get(gi).getModel(t);if(!o)return[];const r=await _Ze(n,o,He.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 rce(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=Rr(t=>_Ze(this.providers,e,t));try{const t=new js(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){vt(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(x.multiCursorModifier)==="altKey",i=[],n=Object.keys(this.currentOccurrences);for(const r of n){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(YO.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{n.activate(o,i),this.activeLinkDecorationId=n.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:n}=e;n.resolve(He.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===pe.file&&o.startsWith(`${pe.file}:`)){const a=N.parse(o);if(a.scheme===pe.file){const c=Ym(a);let l=null;c.startsWith("/./")||c.startsWith("\\.\\")?l=`.${c.substr(1)}`:(c.startsWith("//./")||c.startsWith("\\\\.\\"))&&(l=`.${c.substr(2)}`),l&&(o=Pt(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(1508,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):r==="missing"?this.notificationService.warn(g(1509,"Failed to open this link because its target is missing.")):vt(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 n=this.currentOccurrences[i.id];if(n)return n}return null}isEnabled(e,t){return!!(e.target.type===Rt.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()}},Lbe=TL,TL.ID="editor.linkDetector",TL);_W=Lbe=D([_(1,Ao),_(2,bi),_(3,it),_(4,wp)],_W);const sUe={general:Gt.register({description:"detected-link",stickiness:ni.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Gt.register({description:"detected-link-active",stickiness:ni.NeverGrowsWhenTypingAtEdges,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class YO{static decoration(e,t){return{range:e.range,options:YO._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n={...i?sUe.active:sUe.general};return n.hoverMessage=cPt(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,YO._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,YO._getOptions(this.link,t,!1))}}function cPt(s,e){const t=s.url&&/^command:/i.test(s.url.toString()),i=s.tooltip?s.tooltip:t?g(1510,"Execute command"):g(1511,"Follow link"),n=e?Qt?g(1512,"cmd + click"):g(1513,"ctrl + click"):Qt?g(1514,"option + click"):g(1515,"alt + click");if(s.url){let o="";if(/^command:/i.test(s.url.toString())){const a=s.url.toString().match(/^command:([^?#]+)/);if(a){const c=a[1];o=g(1516,"Execute command {0}",c)}}return new Mt("",!0).appendLink(s.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${n})`)}else return new Mt().appendText(`${i} (${n})`)}class lPt extends tt{constructor(){super({id:"editor.action.openLink",label:g(1517,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=_W.get(t);if(!i||!t.hasModel())return;const n=t.getSelections();for(const o of n){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}on(_W.ID,_W,ri.AfterFirstRender);Me(lPt);const ace="editor.contrib.selectionClipboard",vZe="editor.action.showHover",dPt="editor.action.showDefinitionPreviewHover",hPt="editor.action.scrollUpHover",uPt="editor.action.scrollDownHover",gPt="editor.action.scrollLeftHover",fPt="editor.action.scrollRightHover",pPt="editor.action.pageUpHover",mPt="editor.action.pageDownHover",_Pt="editor.action.goToTopHover",vPt="editor.action.goToBottomHover",BU="editor.action.increaseHoverVerbosityLevel",bPt="editor.action.increaseHoverVerbosityLevelFromAccessibleView",wPt=g(9864,"Increase Hover Verbosity Level"),WU="editor.action.decreaseHoverVerbosityLevel",yPt="editor.action.decreaseHoverVerbosityLevelFromAccessibleView",CPt=g(9865,"Decrease Hover Verbosity Level");var Wl;(function(s){s[s.Idle=0]="Idle",s[s.FirstWait=1]="FirstWait",s[s.SecondWait=2]="SecondWait",s[s.WaitingForAsync=3]="WaitingForAsync",s[s.WaitingForAsyncShowingLoading=4]="WaitingForAsyncShowingLoading"})(Wl||(Wl={}));var iC;(function(s){s[s.Delayed=0]="Delayed",s[s.Immediate=1]="Immediate"})(iC||(iC={}));var NA;(function(s){s[s.Mouse=0]="Mouse",s[s.Keyboard=1]="Keyboard"})(NA||(NA={}));let SPt=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class bZe extends V{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 cn(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new cn(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new cn(()=>this._triggerLoadingMessage(),0)),this._state=Wl.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(Wl.SecondWait),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Elt(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===Wl.WaitingForAsync||this._state===Wl.WaitingForAsyncShowingLoading)&&this._setState(Wl.Idle)}catch(e){vt(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?Wl.Idle:Wl.WaitingForAsync)}_triggerLoadingMessage(){this._state===Wl.WaitingForAsync&&this._setState(Wl.WaitingForAsyncShowingLoading)}_fireResult(){if(this._state===Wl.FirstWait||this._state===Wl.SecondWait)return;const e=this._state===Wl.Idle,t=this._state===Wl.WaitingForAsyncShowingLoading;this._onResult.fire(new SPt(this._result.slice(0),e,t))}start(e){if(e===iC.Delayed)this._state===Wl.Idle&&(this._setState(Wl.FirstWait),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case Wl.Idle:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case Wl.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(Wl.Idle,!1)}}const APt=30,EPt=24;class xPt extends V{constructor(e,t=new bn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new cMe),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=bn.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 bn(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:Cr(t).top+i.top-APt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Cr(t),o=H_(t.ownerDocument.body),r=n.top+i.top+i.height;return o.height-r-EPt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(n,i),e),r=Math.min(e,o);let a;return this._editor.getOption(x.hover).above?a=r<=n?es.ABOVE:es.BELOW:a=r<=i?es.BELOW:es.ABOVE,a===es.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 Jb;const oUe=30,DPt=6;var BD;let _X=(BD=class extends xPt{get isVisibleFromKeyboard(){return this._renderedHover?.source===NA.Keyboard}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,o){const r=e.getOption(x.lineHeight)+8,a=150,c=new bn(a,r);super(e,c),this._configurationService=i,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new dLe),this._onDidResize=this._register(new I),this.onDidResize=this._onDidResize.event,this._minimumSize=c,this._hoverVisibleKey=J.hoverVisible.bindTo(t),this._hoverFocusedKey=J.hoverFocused.bindTo(t),re(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(Ac(this._resizableNode.domNode));this._register(l.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(l.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return Jb.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Jb._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Jb._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Jb._applyMaxDimensions(this._hover.contentsDomNode,e,t),Jb._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 bn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){Jb._lastDimensions=new bn(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._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===es.ABOVE?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=DPt;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.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=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,Jb._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Jb._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?Io.LeftOfInjectedText:void 0,preference:[this._positionPreference??es.ABOVE]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=hb(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??es.ABOVE,this.onContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const o=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&vQe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");o&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+o)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new bn(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 bn(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 bn(e,this._minimumSize.height)}onContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=hb(e),i=Md(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=hb(e),i=Md(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const n=hb(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._renderedHover.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-oUe})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+oUe})}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})}},Jb=BD,BD.ID="editor.contrib.resizableContentHoverWidget",BD._lastDimensions=new bn(0,0),BD);_X=Jb=D([_(1,Le),_(2,Te),_(3,mr),_(4,Ut)],_X);function rUe(s,e,t,i,n,o){const r=t+n/2,a=i+o/2,c=Math.max(Math.abs(s-r)-n/2,0),l=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(c*c+l*l)}var lu;(function(s){s[s.Range=1]="Range",s[s.ForeignElement=2]="ForeignElement"})(lu||(lu={}));class $he{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=lu.Range}equals(e){return e.type===lu.Range&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===lu.Range&&t.lineNumber===this.range.startLineNumber}}class oQ{constructor(e,t,i,n,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=lu.ForeignElement}equals(e){return e.type===lu.ForeignElement&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===lu.ForeignElement&&this.owner===e.owner}}class OM{constructor(e){this.renderedHoverParts=e}dispose(){for(const e of this.renderedHoverParts)e.dispose()}}const UN=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class vX{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=NA.Mouse,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==lu.Range&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,c=r.range.endLineNumber===n?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 Kd.EMPTY;const i=vX._getLineDecorations(this._editor,t);return Kd.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Kd.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=vX._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Fi(t)}}class wZe{constructor(e,t,i){this.anchor=e,this.hoverParts=t,this.isComplete=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new kPt(this,this.anchor,t,this.isComplete)}}class kPt extends wZe{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}const aUe=fe;let bX=class extends V{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this.actions=[],this._hasContent=!1,this.hoverElement=aUe("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=re(this.hoverElement,aUe("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(hLe.render(this.actionsElement,e,i));return this.actions.push(n),n}append(e){const t=re(this.actionsElement,e);return this._hasContent=!0,t}};bX=D([_(0,Ut)],bX);class IPt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function TPt(s,e,t,i,n){const o=await Promise.resolve(s.provideHover(t,i,n)).catch(No);if(!(!o||!LPt(o)))return new IPt(s,o,e)}function wMe(s,e,t,i,n=!1){const r=s.ordered(e,n).map((a,c)=>TPt(a,c,e,t,i));return Kd.fromPromises(r).coalesce()}function yZe(s,e,t,i,n=!1){return wMe(s,e,t,i,n).map(o=>o.hover).toPromise()}ng("_executeHoverProvider",(s,e,t)=>{const i=s.get(it);return yZe(i.hoverProvider,e,t,He.None)});ng("_executeHoverProvider_recursive",(s,e,t)=>{const i=s.get(it);return yZe(i.hoverProvider,e,t,He.None,!0)});function LPt(s){const e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}const gF=fe,RPt=oi("hover-increase-verbosity",ve.add,g(5160,"Icon for increaseing hover verbosity.")),MPt=oi("hover-decrease-verbosity",ve.remove,g(5161,"Icon for decreasing hover verbosity."));class g_{constructor(e,t,i,n,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===lu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class CZe{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case Mc.Increase:return this.hover.canIncreaseVerbosity??!1;case Mc.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let K3=class{constructor(e,t,i,n,o,r,a,c){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=o,this._keybindingService=r,this._hoverService=a,this._commandService=c,this.hoverOrdinal=3}createLoadingMessage(e){return new g_(this,e.range,[new Mt().appendText(g(5162,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==lu.Range)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];let a=1e3;const c=i.getLineLength(n),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 g_(this,e.range,[{value:g(5163,"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 g_(this,e.range,[{value:g(5164,"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===n?p.range.startColumn:1,v=p.range.endLineNumber===n?p.range.endColumn:o,b=p.options.hoverMessage;if(!b||$2(b))continue;p.options.beforeContentClassName&&(f=!0);const w=new F(e.range.startLineNumber,m,e.range.startLineNumber,v);r.push(new g_(this,w,O_(b),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==lu.Range)return Kd.EMPTY;const n=this._editor.getModel(),o=this._languageFeaturesService.hoverProvider;return o.has(n)?this._getMarkdownHovers(o,n,e,i):Kd.EMPTY}_getMarkdownHovers(e,t,i,n){const o=i.range.getStartPosition();return wMe(e,t,o,n).filter(c=>!$2(c.hover.contents)).map(c=>{const l=c.hover.range?F.lift(c.hover.range):i.range,d=new CZe(c.hover,c.provider,o);return new g_(this,l,c.hover.contents,!1,c.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new NPt(t,e.fragment,this,this._editor,this._languageService,this._openerService,this._commandService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}getAccessibleContent(e){return this._renderedHoverParts?.getAccessibleContent(e)??""}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts?.doesMarkdownHoverAtIndexSupportVerbosityAction(e,t)??!1}updateMarkdownHoverVerbosityLevel(e,t,i){return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t,i))}};K3=D([_(1,xi),_(2,Ao),_(3,Te),_(4,it),_(5,Ut),_(6,ec),_(7,vi)],K3);class vK{constructor(e,t,i){this.hoverPart=e,this.hoverElement=t,this.disposables=i}get hoverAccessibleContent(){return this.hoverElement.innerText.trim()}dispose(){this.disposables.dispose()}}class NPt{constructor(e,t,i,n,o,r,a,c,l,d,h){this._hoverParticipant=i,this._editor=n,this._languageService=o,this._openerService=r,this._commandService=a,this._keybindingService=c,this._hoverService=l,this._configurationService=d,this._onFinishedRendering=h,this._ongoingHoverOperations=new Map,this._disposables=new Z,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(Ee(()=>{this.renderedHoverParts.forEach(u=>{u.dispose()}),this._ongoingHoverOperations.forEach(u=>{u.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(Cc(n=>n.ordinal,iu)),e.map(n=>{const o=this._renderHoverPart(n,i);return t.appendChild(o.hoverElement),o})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,o=e.source,r=new Z;if(r.add(i),!o)return new vK(e,n,r);const a=o.supportsVerbosityAction(Mc.Increase),c=o.supportsVerbosityAction(Mc.Decrease);if(!a&&!c)return new vK(e,n,r);const l=gF("div.verbosity-actions");return n.prepend(l),r.add(this._renderHoverExpansionAction(l,Mc.Increase,a)),r.add(this._renderHoverExpansionAction(l,Mc.Decrease,c)),new vK(e,n,r)}_renderMarkdownHover(e,t){return SZe(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const n=new Z,o=t===Mc.Increase,r=re(e,gF(We.asCSSSelector(o?RPt:MPt)));r.tabIndex=0;const a=new CM("mouse",!1,{target:e,position:{hoverPosition:vo.LEFT}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(a,r,AZe(this._keybindingService,t))),!i)return r.classList.add("disabled"),n;r.classList.add("enabled");const c=()=>this._commandService.executeCommand(t===Mc.Increase?BU:WU);return n.add(new bQe(r,c)),n.add(new wQe(r,c,[S.Enter,S.Space])),n}async updateMarkdownHoverPartVerbosityLevel(e,t,i=!0){const n=this._editor.getModel();if(!n)return;const o=this._getRenderedHoverPartAtIndex(t),r=o?.hoverPart.source;if(!o||!r?.supportsVerbosityAction(e))return;const a=await this._fetchHover(r,n,e);if(!a)return;const c=new CZe(a,r.hoverProvider,r.hoverPosition),l=o.hoverPart,d=new g_(this._hoverParticipant,l.range,a.contents,l.isBeforeContent,l.ordinal,c),h=this._renderHoverPart(d,this._onFinishedRendering);return this._replaceRenderedHoverPartAtIndex(t,h,d),i&&this._focusOnHoverPartWithIndex(t),{hoverPart:d,hoverElement:h.hoverElement}}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(r=>r.hoverPart===e);if(t===-1)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}doesMarkdownHoverAtIndexSupportVerbosityAction(e,t){const i=this._getRenderedHoverPartAtIndex(e),n=i?.hoverPart.source;return!(!i||!n?.supportsVerbosityAction(t))}async _fetchHover(e,t,i){let n=i===Mc.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),n+=r.verbosityDelta);const a=new ci;this._ongoingHoverOperations.set(o,{verbosityDelta:n,tokenSource:a});const c={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,c))}catch(d){No(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),l}_replaceRenderedHoverPartAtIndex(e,t,i){if(e>=this.renderedHoverParts.length||e<0)return;const n=this.renderedHoverParts[e],o=n.hoverElement,r=t.hoverElement,a=Array.from(r.children);o.replaceChildren(...a);const c=new vK(i,o,t.disposables);o.focus(),n.dispose(),this.renderedHoverParts[e]=c}_focusOnHoverPartWithIndex(e){this.renderedHoverParts[e].hoverElement.focus()}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function PPt(s,e,t,i,n){e.sort(Cc(r=>r.ordinal,iu));const o=[];for(const r of e)o.push(SZe(t,r,i,n,s.onContentsChanged));return new OM(o)}function SZe(s,e,t,i,n){const o=new Z,r=gF("div.hover-row"),a=gF("div.hover-row-contents");r.appendChild(a);const c=e.contents;for(const d of c){if($2(d))continue;const h=gF("div.markdown-hover"),u=re(h,gF("div.hover-contents")),f=o.add(new q_({editor:s},t,i));o.add(f.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",n()}));const p=o.add(f.render(d));u.appendChild(p.element),a.appendChild(h)}return{hoverPart:e,hoverElement:r,dispose(){o.dispose()}}}function AZe(s,e){switch(e){case Mc.Increase:{const t=s.lookupKeybinding(BU);return t?g(5165,"Increase Hover Verbosity ({0})",t.getLabel()):g(5166,"Increase Hover Verbosity")}case Mc.Decrease:{const t=s.lookupKeybinding(WU);return t?g(5167,"Decrease Hover Verbosity ({0})",t.getLabel()):g(5168,"Decrease Hover Verbosity")}}}const EZe=[];function G6(s){EZe.push(s)}function FPt(){return EZe.slice(0)}class yMe{constructor(e,t){this._editorWorkerClient=new hTe(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,o=t.color,r=o.alpha,a=new me(new dn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),c=r?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),l=r?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),d=r?me.Format.CSS.formatHex(a):me.Format.CSS.formatHexA(a),h=[];return h.push({label:c,textEdit:{range:n,text:c}}),h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h}}let Rbe=class extends V{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new yMe(e,t)))}};Rbe=D([_(0,gi),_(1,Vs),_(2,it)],Rbe);G6(Rbe);async function xZe(s,e,t,i=!0){return CMe(new OPt,s,e,t,i)}function DZe(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}class OPt{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({colorInfo:r,provider:e});return Array.isArray(o)}}class BPt{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class WPt{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const o=await e.provideColorPresentations(t,this.colorInfo,He.None);return Array.isArray(o)&&n.push(...o),Array.isArray(o)}}async function CMe(s,e,t,i,n){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 yMe)r=d;else try{await s.compute(d,t,i,a)&&(o=!0)}catch(h){No(h)}}return o?a:r&&n?(await s.compute(r,t,i,a),a):[]}function kZe(s,e){const{colorProvider:t}=s.get(it),i=s.get(gi).getModel(e);if(!i)throw Pi();const n=s.get(Te).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}_t.registerCommand("_executeDocumentColorProvider",function(s,...e){const[t]=e;if(!(t instanceof N))throw Pi();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:o}=kZe(s,t);return CMe(new BPt,n,i,He.None,o)});_t.registerCommand("_executeColorPresentationProvider",function(s,...e){const[t,i]=e,{uri:n,range:o}=i;if(!(n instanceof N)||!Array.isArray(t)||t.length!==4||!F.isIRange(o))throw Pi();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:c}=kZe(s,n),[l,d,h,u]=t;return CMe(new WPt({range:o,color:{red:l,green:d,blue:h,alpha:u}}),a,r,He.None,c)});var Mbe;const IZe=Object.create({});var WD;let BM=(WD=class extends V{constructor(e,t,i,n){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 oY(this._editor),this._decoratorLimitReporter=new HPt,this._colorDecorationClassRefs=this._register(new Z),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:Mbe.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 n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.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 bm,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Rr(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new js(!1),n=await xZe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){vt(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:Gt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,o)=>this._colorDatas.set(n,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(x.colorDecoratorsLimit);for(let o=0;othis._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},Mbe=WD,WD.ID="editor.contrib.colorDetector",WD.RECOMPUTE_TIME=1e3,WD);BM=Mbe=D([_(1,Te),_(2,it),_(3,wp)],BM);class HPt{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())}}on(BM.ID,BM,ri.AfterFirstRender);class UPt{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 n=0;n{this.backgroundColor=r.getColor(iY)||me.white})),this._register(ue(this._pickedColorNode,ke.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ue(this._originalColorNode,ke.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=me.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 $Pt(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=me.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 $Pt extends V{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"),re(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),re(this._button,t),re(t,Jf(".button"+We.asCSSSelector(oi("color-picker-close",ve.close,g(9863,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(ue(this._button,ke.CLICK,()=>{this._onClicked.fire()}))}}class GPt extends V{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Jf(".colorpicker-body"),re(e,this._domNode),this._saturationBox=new KPt(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 qPt(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new QPt(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new jPt(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 me(new hy(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new hy(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new me(new hy(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 KPt extends V{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=Jf(".saturation-wrap"),re(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",re(this._domNode,this._canvas),this.selection=Jf(".saturation-selection"),re(this._domNode,this.selection),this.layout(),this._register(ue(this._domNode,ke.POINTER_DOWN,n=>this.onPointerDown(n))),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 vU);const t=Cr(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=ue(e.target.ownerDocument,ke.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)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}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 me(new hy(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.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=me.Format.CSS.format(t),i.fill(),i.fillStyle=n,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 TZe extends V{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=re(e,Jf(".standalone-strip")),this.overlay=re(this.domNode,Jf(".standalone-overlay"))):(this.domNode=re(e,Jf(".strip")),this.overlay=re(this.domNode,Jf(".overlay"))),this.slider=re(this.domNode,Jf(".slider")),this.slider.style.top="0px",this._register(ue(this.domNode,ke.POINTER_DOWN,n=>this.onPointerDown(n))),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 vU),i=Cr(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 n=ue(e.target.ownerDocument,ke.POINTER_UP,()=>{this._onColorFlushed.fire(),n.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 qPt extends TZe{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:n}=e.rgba,o=new me(new dn(t,i,n,1)),r=new me(new dn(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class QPt extends TZe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class jPt extends V{constructor(e){super(),this._onClicked=this._register(new I),this.onClicked=this._onClicked.event,this._button=re(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ue(this._button,ke.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const Ise=class Ise extends gd{constructor(e,t,i,n,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(k8.getInstance(ct(e)).onDidChange(()=>this.layout())),this._domNode=Jf(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new zPt(this._domNode,this.model,n,o)),this.body=this._register(new GPt(this._domNode,this.model,this.pixelRatio,o))}getId(){return Ise.ID}layout(){this.body.layout()}get domNode(){return this._domNode}};Ise.ID="editor.contrib.colorPickerWidget";let Nbe=Ise;class YPt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===lu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let q3=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Kd.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=BM.get(this._editor);if(!n)return[];for(const o of t){if(!n.isColorDecoration(o))continue;const r=n.getColorData(o.range.getStartPosition());if(r)return[await LZe(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){const i=RZe(this,this._editor,this._themeService,t,e);if(!i)return new OM([]);this._colorPicker=i.colorPicker;const n={hoverPart:i.hoverPart,hoverElement:this._colorPicker.domNode,dispose(){i.disposables.dispose()}};return new OM([n])}getAccessibleContent(e){return g(5040,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}isColorPickerVisible(){return!!this._colorPicker}};q3=D([_(1,pn)],q3);class JPt{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let Q3=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()||!BM.get(this._editor))return null;const o=await xZe(i,this._editor.getModel(),He.None);let r=null,a=null;for(const h of o){const u=h.colorInfo;F.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const c=r??e,l=a??t,d=!!r;return{colorHover:await LZe(this,this._editor.getModel(),c,l),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new F(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await rQ(this._editor.getModel(),t,this._color,i,e),i=MZe(this._editor,i,t))}renderHoverParts(e,t){return RZe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};Q3=D([_(1,pn)],Q3);async function LZe(s,e,t,i){const n=e.getValueInRange(t.range),{red:o,green:r,blue:a,alpha:c}=t.color,l=new dn(Math.round(o*255),Math.round(r*255),Math.round(a*255),c),d=new me(l),h=await DZe(e,t,i,He.None),u=new UPt(d,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(d,n),s instanceof q3?new YPt(s,F.lift(t.range),u,i):new JPt(s,F.lift(t.range),u,i)}function RZe(s,e,t,i,n){if(i.length===0||!e.hasModel())return;if(n.setMinimumDimensions){const u=e.getOption(x.lineHeight)+8;n.setMinimumDimensions(new bn(302,u))}const o=new Z,r=i[0],a=e.getModel(),c=r.model,l=o.add(new Nbe(n.fragment,c,e.getOption(x.pixelRatio),t,s instanceof Q3));let d=!1,h=new F(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(s instanceof Q3){const u=r.model.color;s.color=u,rQ(a,c,u,h,r),o.add(c.onColorFlushed(f=>{s.color=f}))}else o.add(c.onColorFlushed(async u=>{await rQ(a,c,u,h,r),d=!0,h=MZe(e,h,c)}));return o.add(c.onDidChangeColor(u=>{rQ(a,c,u,h,r)})),o.add(e.onDidChangeModelContent(u=>{d?d=!1:(n.hide(),e.focus())})),{hoverPart:r,colorPicker:l,disposables:o}}function MZe(s,e,t){const i=[],n=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(n),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const o=F.lift(n.range),r=s.getModel()._setTrackedRange(null,o,ni.GrowsOnlyWhenTypingAfter);return s.executeEdits("colorpicker",i),s.pushUndoStop(),s.getModel()._getTrackedRange(r)??o}async function rQ(s,e,t,i,n){const o=await DZe(s,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,He.None);e.colorPresentations=o||[]}class NZe{constructor(e,t){this.range=e,this.direction=t}}class SMe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new SMe(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){No(t),this._isResolved=!1}}}const YF=class YF{static async create(e,t,i,n){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async c=>{try{const l=await a.provideInlayHints(t,c,n);(l?.hints.length||a.onDidChangeInlayHints)&&o.push([l??YF._emptyInlayHintList,a])}catch(l){No(l)}}));if(await Promise.all(r.flat()),n.isCancellationRequested||t.isDisposed())throw new Ma;return new YF(i,o,t)}constructor(e,t,i){this._disposables=new Z,this.ranges=e,this.provider=new Set;const n=[];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=YF._getRangeAtPosition(i,c);let h;d.getStartPosition().isBefore(c)?(h=F.fromPositions(d.getStartPosition(),c),l="after"):(h=F.fromPositions(c,d.getEndPosition()),l="before"),n.push(new SMe(a,new NZe(h,l),r))}}this.items=n.sort((o,r)=>oe.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new F(i,n.startColumn,i,n.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(ji(h.uri,a.uri))l=!0,d=d||F.containsPosition(h.range,c);else if(l)break;(!l||!d)&&this.reset()});this._currentState=jr(i,n)}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:F.collapseToStart(t.range),selectionRevealType:oA.NearTopIfOutsideViewport}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?g(5103,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):g(5104,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};Pbe=D([_(0,Le),_(1,Kt),_(2,bi),_(3,Ut)],Pbe);ce(cce,Pbe,qt.Delayed);qe(new class extends hc{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:AMe,kbOpts:{weight:Ae.EditorContrib,primary:S.F12}})}runEditorCommand(s,e){return s.get(cce).revealNext(e)}});So.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:Ae.EditorContrib,when:AMe,primary:S.Escape,handler(s){s.get(cce).reset()}});let Fbe=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(),bt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,jr(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)}};Fbe=D([_(0,Kt)],Fbe);function Obe(s,e){return e.uri.scheme===s.uri.scheme?!0:!y8(e.uri,pe.walkThroughSnippet,pe.vscodeChatCodeBlock,pe.vscodeChatCodeCompareBlock,pe.vscodeCopilotBackingChatCodeBlock)}async function K6(s,e,t,i,n){const r=t.ordered(s,i).map(c=>Promise.resolve(n(c,s,e)).then(void 0,l=>{No(l)})),a=await Promise.all(r);return Fi(a.flat()).filter(c=>Obe(s,c))}function q6(s,e,t,i,n){return K6(e,t,s,i,(o,r,a)=>o.provideDefinition(r,a,n))}function EMe(s,e,t,i,n){return K6(e,t,s,i,(o,r,a)=>o.provideDeclaration(r,a,n))}function xMe(s,e,t,i,n){return K6(e,t,s,i,(o,r,a)=>o.provideImplementation(r,a,n))}function DMe(s,e,t,i,n){return K6(e,t,s,i,(o,r,a)=>o.provideTypeDefinition(r,a,n))}function Q6(s,e,t,i,n,o){return K6(e,t,s,n,async(r,a,c)=>{const l=(await r.provideReferences(a,c,{includeDeclaration:!0},o))?.filter(h=>Obe(a,h));if(!i||!l||l.length!==2)return l;const d=(await r.provideReferences(a,c,{includeDeclaration:!1},o))?.filter(h=>Obe(a,h));return d&&d.length===1?d:l})}async function uC(s){const e=await s(),t=new tf(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}ng("_executeDefinitionProvider",(s,e,t)=>{const i=s.get(it),n=q6(i.definitionProvider,e,t,!1,He.None);return uC(()=>n)});ng("_executeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(it),n=q6(i.definitionProvider,e,t,!0,He.None);return uC(()=>n)});ng("_executeTypeDefinitionProvider",(s,e,t)=>{const i=s.get(it),n=DMe(i.typeDefinitionProvider,e,t,!1,He.None);return uC(()=>n)});ng("_executeTypeDefinitionProvider_recursive",(s,e,t)=>{const i=s.get(it),n=DMe(i.typeDefinitionProvider,e,t,!0,He.None);return uC(()=>n)});ng("_executeDeclarationProvider",(s,e,t)=>{const i=s.get(it),n=EMe(i.declarationProvider,e,t,!1,He.None);return uC(()=>n)});ng("_executeDeclarationProvider_recursive",(s,e,t)=>{const i=s.get(it),n=EMe(i.declarationProvider,e,t,!0,He.None);return uC(()=>n)});ng("_executeReferenceProvider",(s,e,t)=>{const i=s.get(it),n=Q6(i.referenceProvider,e,t,!1,!1,He.None);return uC(()=>n)});ng("_executeReferenceProvider_recursive",(s,e,t)=>{const i=s.get(it),n=Q6(i.referenceProvider,e,t,!1,!0,He.None);return uC(()=>n)});ng("_executeImplementationProvider",(s,e,t)=>{const i=s.get(it),n=xMe(i.implementationProvider,e,t,!1,He.None);return uC(()=>n)});ng("_executeImplementationProvider_recursive",(s,e,t)=>{const i=s.get(it),n=xMe(i.implementationProvider,e,t,!0,He.None);return uC(()=>n)});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextPeek,title:g(1409,"Peek"),group:"navigation",order:100});class vW{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof vW||oe.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const jm=class jm extends df{static all(){return jm._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of hi.wrap(t.menu))(i.id===_e.EditorContext||i.id===_e.EditorContextPeek)&&(i.when=he.and(e.precondition,i.when));return t}constructor(e,t){super(jm._patchConfig(t)),this.configuration=e,jm._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(bi),r=e.get(Kt),a=e.get(YA),c=e.get(cce),l=e.get(it),d=e.get(we),h=t.getModel(),u=t.getPosition(),f=vW.is(i)?i:new vW(h,u),p=new Kk(t,jo.Value|jo.Position),m=B_(this._getLocationModel(l,f.model,f.position,p.token),p.token).then(async v=>{if(!v||p.token.isCancellationRequested)return;Mr(v.ariaMessage);let b;if(v.referenceAt(h.uri,u)){const y=this._getAlternativeCommand(t);!jm._activeAlternativeCommands.has(y)&&jm._allSymbolNavigationCommands.has(y)&&(b=jm._allSymbolNavigationCommands.get(y))}const w=v.references.length;if(w===0){if(!this.configuration.muteMessage){const y=h.getWordAtPosition(u);Ih.get(t)?.showMessage(this._getNoResultFoundMessage(y),u)}}else if(w===1&&b)jm._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(y=>b.runEditorCommand(y,t,i,n).finally(()=>{jm._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,c,t,v,n)},v=>{o.error(v)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,o){const r=this._getGoToPreference(i);if(!(i instanceof rf)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,o);else{const a=n.firstReference(),c=n.references.length>1&&r==="gotoAndPeek",l=await this._openReference(i,e,a,this.configuration.openToSide,!c);c&&l?this._openInPeek(l,n,o):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,o){let r;if(cGe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:F.collapseToStart(r),selectionRevealType:oA.NearTopIfOutsideViewport,selectionSource:Ab.JUMP}},e,n);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 n=TM.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Rr(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};jm._allSymbolNavigationCommands=new Map,jm._activeAlternativeCommands=new Set;let PA=jm;class j6 extends PA{async _getLocationModel(e,t,i,n){return new tf(await q6(e.definitionProvider,t,i,!1,n),g(1410,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(1411,"No definition found for '{0}'",e.word):g(1412,"No definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDefinitions}}var HD;At((HD=class extends j6{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:HD.id,title:{...Fe(1413,"Go to Definition"),mnemonicTitle:g(1414,"Go to &&Definition")},precondition:J.hasDefinitionProvider,keybinding:[{when:J.editorTextFocus,primary:S.F12,weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,$Le),primary:U.CtrlCmd|S.F12,weight:Ae.EditorContrib}],menu:[{id:_e.EditorContext,group:"navigation",order:1.1},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),_t.registerCommandAlias("editor.action.goToDeclaration",HD.id)}},HD.id="editor.action.revealDefinition",HD));var UD;At((UD=class extends j6{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:UD.id,title:Fe(1415,"Open Definition to the Side"),precondition:he.and(J.hasDefinitionProvider,J.isInEmbeddedEditor.toNegated()),keybinding:[{when:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,S.F12),weight:Ae.EditorContrib},{when:he.and(J.editorTextFocus,$Le),primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.F12),weight:Ae.EditorContrib}]}),_t.registerCommandAlias("editor.action.openDeclarationToTheSide",UD.id)}},UD.id="editor.action.revealDefinitionAside",UD));var VD;At((VD=class extends j6{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:VD.id,title:Fe(1416,"Peek Definition"),precondition:he.and(J.hasDefinitionProvider,eg.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.Alt|S.F12,linux:{primary:U.CtrlCmd|U.Shift|S.F10},weight:Ae.EditorContrib},menu:{id:_e.EditorContextPeek,group:"peek",order:2}}),_t.registerCommandAlias("editor.action.previewDeclaration",VD.id)}},VD.id="editor.action.peekDefinition",VD));class FZe extends PA{async _getLocationModel(e,t,i,n){return new tf(await EMe(e.declarationProvider,t,i,!1,n),g(1417,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?g(1418,"No declaration found for '{0}'",e.word):g(1419,"No declaration found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleDeclarations}}var LL;At((LL=class extends FZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:LL.id,title:{...Fe(1420,"Go to Declaration"),mnemonicTitle:g(1421,"Go to &&Declaration")},precondition:he.and(J.hasDeclarationProvider,J.isInEmbeddedEditor.toNegated()),menu:[{id:_e.EditorContext,group:"navigation",order:1.3},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?g(1418,"No declaration found for '{0}'",e.word):g(1419,"No declaration found")}},LL.id="editor.action.revealDeclaration",LL));At(class extends FZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:Fe(1422,"Peek Declaration"),precondition:he.and(J.hasDeclarationProvider,eg.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:3}})}});class OZe extends PA{async _getLocationModel(e,t,i,n){return new tf(await DMe(e.typeDefinitionProvider,t,i,!1,n),g(1423,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?g(1424,"No type definition found for '{0}'",e.word):g(1425,"No type definition found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleTypeDefinitions}}var RL;At((RL=class extends OZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:RL.ID,title:{...Fe(1426,"Go to Type Definition"),mnemonicTitle:g(1427,"Go to &&Type Definition")},precondition:J.hasTypeDefinitionProvider,keybinding:{when:J.editorTextFocus,primary:0,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.4},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},RL.ID="editor.action.goToTypeDefinition",RL));var ML;At((ML=class extends OZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:ML.ID,title:Fe(1428,"Peek Type Definition"),precondition:he.and(J.hasTypeDefinitionProvider,eg.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:4}})}},ML.ID="editor.action.peekTypeDefinition",ML));class BZe extends PA{async _getLocationModel(e,t,i,n){return new tf(await xMe(e.implementationProvider,t,i,!1,n),g(1429,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?g(1430,"No implementation found for '{0}'",e.word):g(1431,"No implementation found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleImplementations}}var NL;At((NL=class extends BZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:NL.ID,title:{...Fe(1432,"Go to Implementations"),mnemonicTitle:g(1433,"Go to &&Implementations")},precondition:J.hasImplementationProvider,keybinding:{when:J.editorTextFocus,primary:U.CtrlCmd|S.F12,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.45},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},NL.ID="editor.action.goToImplementation",NL));var PL;At((PL=class extends BZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:PL.ID,title:Fe(1434,"Peek Implementations"),precondition:he.and(J.hasImplementationProvider,eg.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.F12,weight:Ae.EditorContrib},menu:{id:_e.EditorContextPeek,group:"peek",order:5}})}},PL.ID="editor.action.peekImplementation",PL));class WZe extends PA{_getNoResultFoundMessage(e){return e?g(1435,"No references found for '{0}'",e.word):g(1436,"No references found")}_getAlternativeCommand(e){return e.getOption(x.gotoLocation).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(x.gotoLocation).multipleReferences}}At(class extends WZe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...Fe(1437,"Go to References"),mnemonicTitle:g(1438,"Go to &&References")},precondition:he.and(J.hasReferenceProvider,eg.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),keybinding:{when:J.editorTextFocus,primary:U.Shift|S.F12,weight:Ae.EditorContrib},menu:[{id:_e.EditorContext,group:"navigation",order:1.45},{id:_e.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new tf(await Q6(e.referenceProvider,t,i,!0,!1,n),g(1439,"References"))}});At(class extends WZe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:Fe(1440,"Peek References"),precondition:he.and(J.hasReferenceProvider,eg.notInPeekEditor,J.isInEmbeddedEditor.toNegated()),menu:{id:_e.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new tf(await Q6(e.referenceProvider,t,i,!1,!1,n),g(1439,"References"))}});class XPt extends PA{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:Fe(1441,"Go to Any Symbol"),precondition:he.and(eg.notInPeekEditor,J.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new tf(this._references,g(1442,"Locations"))}_getNoResultFoundMessage(e){return e&&g(1443,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(x.gotoLocation).multipleReferences}_getAlternativeCommand(){return""}}_t.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:N},{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(s,e,t,i,n,o,r)=>{Tt(N.isUri(e)),Tt(oe.isIPosition(t)),Tt(Array.isArray(i)),Tt(typeof n>"u"||typeof n=="string"),Tt(typeof r>"u"||typeof r=="boolean");const a=s.get(Kt),c=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Qr(c))return c.setPosition(t),c.revealPositionInCenterIfOutsideViewport(t,mt.Smooth),c.invokeWithinContext(l=>{const d=new class extends XPt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,n);l.get(we).invokeFunction(d.run.bind(d),c)})}});_t.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:N},{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(s,e,t,i,n)=>{s.get(vi).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});_t.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{Tt(N.isUri(e)),Tt(oe.isIPosition(t));const i=s.get(it),n=s.get(Kt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(o=>{if(!Qr(o)||!o.hasModel())return;const r=TM.get(o);if(!r)return;const a=Rr(l=>Q6(i.referenceProvider,o.getModel(),oe.lift(t),!1,!1,l).then(d=>new tf(d,g(1439,"References")))),c=new F(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(c,a,!1))})}});_t.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function ZPt(s,e,t,i){const n=s.get(fn),o=s.get(lr),r=s.get(vi),a=s.get(we),c=s.get(bi);if(await i.item.resolve(He.None),!i.part.location)return;const l=i.part.location,d=[],h=new Set(jn.getMenuItems(_e.EditorContext).map(f=>pT(f)?f.command.id:ar()));for(const f of PA.all())h.has(f.desc.id)&&d.push(new rn(f.desc.id,Sc.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const p=await n.createModelReference(l.uri);try{const m=new vW(p.object.textEditorModel,F.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 Ar),d.push(new rn(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(p){c.notify({severity:Xe.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=Cr(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function HZe(s,e,t,i){const o=await s.get(fn).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,c=r.get(Le),l=eg.inPeekEditor.getValue(c),d=!a&&t.getOption(x.definitionLinkOpensInPeek)&&!l;return new j6({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new vW(o.object.textEditorModel,F.getStartPosition(i.range)),F.lift(i.range))}),o.dispose()}var MP;class yX{constructor(){this._entries=new lm(50)}get(e){const t=yX._key(e);return this._entries.get(t)}set(e,t){const i=yX._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const UZe=ae("IInlayHintsCache");ce(UZe,yX,qt.Delayed);class Bbe{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 eFt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var TC;(function(s){s[s.Normal=0]="Normal",s[s.Invisible=1]="Invisible"})(TC||(TC={}));var WS;let bW=(WS=class{static get(e){return e.getContribution(MP.ID)??void 0}constructor(e,t,i,n,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new Z,this._sessionDisposables=new Z,this._decorationsMetadata=new Map,this._ruleFactory=new oY(this._editor),this._activeRenderMode=TC.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=TC.Normal;else{let a,c;e.enabled==="onUnlessPressed"?(a=TC.Normal,c=TC.Invisible):(a=TC.Invisible,c=TC.Normal),this._activeRenderMode=a,this._sessionDisposables.add(ub.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 n;const o=new Set,r=new cn(async()=>{const a=Date.now();n?.dispose(!0),n=new ci;const c=t.onWillDispose(()=>n?.cancel());try{const l=n.token,d=await wX.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){vt(l)}finally{n.dispose(),c.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(r),this._sessionDisposables.add(Ee(()=>n?.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=>{n?.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 rce(this._editor)),i=new Z;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(n=>{const[o]=n,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const c=new ci;i.add(Ee(()=>c.dispose(!0))),r.item.resolve(c.token),this._activeInlayHintPart=r.part.command||r.part.location?new eFt(r,o.hasTriggerModifier):void 0;const l=a.validatePosition(r.item.hint.position).lineNumber,d=new F(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 n=>{const o=this._getInlayHintLabelPart(n);if(o){const r=o.part;r.location?this._instaService.invokeFunction(HZe,n,this._editor,r.location):Nj.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(He.None),eo(i.item.hint.textEdits))){const n=i.item.hint.textEdits.map(o=>Zn.replace(F.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",n),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!Yr(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(ZPt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(e.target.type!==Rt.CONTENT_TEXT)return;const t=e.target.detail.injectedText?.options;if(t instanceof Nk&&t?.attachedData instanceof Bbe)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:Xe.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,n]of this._decorationsMetadata){if(t.has(n.item))continue;const o=e.getDecorationRange(i);if(o){const r=new NZe(o,n.item.anchor.direction),a=n.item.with({anchor:r});t.set(n.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),n=[];for(const o of i.sort(F.compareRangesUsingStarts)){const r=t.validateRange(new F(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));n.length===0||!F.areIntersectingOrTouching(n[n.length-1],r)?n.push(r):n[n.length-1]=F.plusRange(n[n.length-1],r)}return n}_updateHintsDecorators(e,t){const i=[],n=(p,m,v,b,w)=>{const y={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:m.className,cursorStops:b,attachedData:w};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:ni.AlwaysGrowsWhenTypingAtEdges,[p.anchor.direction]:this._activeRenderMode===TC.Normal?y:void 0}}})},o=(p,m)=>{const v=this._ruleFactory.createClassNameRef({width:`${r/3|0}px`,display:"inline-block"});n(p,v," ",m?__.Right:__.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>MP._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&&(A=A.slice(0,-k)+"…",L=!0),n(p,this._ruleFactory.createClassNameRef(C),tFt(A),y&&!p.hint.paddingRight?__.Right:__.None,new Bbe(p,v)),L)break}if(p.hint.paddingRight&&o(p,!0),i.length>MP._MAX_DECORATORS)break}const u=[];for(const[p,m]of this._decorationsMetadata){const v=this._editor.getModel()?.getDecorationRange(p);v&&e.some(b=>b.containsRange(v))&&(u.push(p),m.classNameRef.dispose(),this._decorationsMetadata.delete(p))}const f=pm.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||n;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===n&&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 n of this._editor.getLineDecorations(e)){const o=this._decorationsMetadata.get(n.id);o&&!t.has(o.item.hint)&&(t.add(o.item.hint),i.push(o.item))}return i}},MP=WS,WS.ID="editor.contrib.InlayHints",WS._MAX_DECORATORS=1500,WS._MAX_LABEL_LEN=43,WS);bW=MP=D([_(1,it),_(2,wp),_(3,UZe),_(4,vi),_(5,bi),_(6,we)],bW);function tFt(s){return s.replace(/[ \t]/g," ")}_t.registerCommand("_executeInlayHintProvider",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(F.isIRange(i));const{inlayHintsProvider:n}=s.get(it),o=await s.get(fn).createModelReference(t);try{const r=await wX.create(n,o.object.textEditorModel,[F.lift(i)],He.None),a=r.items.map(c=>c.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});class cUe extends oQ{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let CX=class extends K3{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,r,c,n,o,l),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!bW.get(this._editor)||e.target.type!==Rt.CONTENT_TEXT)return null;const i=e.target.detail.injectedText?.options;return i instanceof Nk&&i.attachedData instanceof Bbe?new cUe(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof cUe?new Kd(async n=>{const{part:o}=e;if(await o.item.resolve(i),i.isCancellationRequested)return;let r;typeof o.item.hint.tooltip=="string"?r=new Mt().appendText(o.item.hint.tooltip):o.item.hint.tooltip&&(r=o.item.hint.tooltip),r&&n.emitOne(new g_(this,e.range,[r],!1,0)),eo(o.item.hint.textEdits)&&n.emitOne(new g_(this,e.range,[new Mt().appendText(g(5175,"Double-click to insert"))],!1,10001));let a;if(typeof o.part.tooltip=="string"?a=new Mt().appendText(o.part.tooltip):o.part.tooltip&&(a=o.part.tooltip),a&&n.emitOne(new g_(this,e.range,[a],!1,1)),o.part.location||o.part.command){let l;const h=this._editor.getOption(x.multiCursorModifier)==="altKey"?Qt?g(5176,"cmd + click"):g(5177,"ctrl + click"):Qt?g(5178,"option + click"):g(5179,"alt + click");o.part.location&&o.part.command?l=new Mt().appendText(g(5180,"Go to Definition ({0}), right click for more",h)):o.part.location?l=new Mt().appendText(g(5181,"Go to Definition ({0})",h)):o.part.command&&(l=new Mt(`[${g(5182,"Execute Command")}](${PZe(o.part.command)} "${o.part.command.title}") (${h})`,{isTrusted:!0})),l&&n.emitOne(new g_(this,e.range,[l],!1,1e4))}const c=await this._resolveInlayHintLabelPartHover(o,i);for await(const l of c)n.emitOne(l)}):Kd.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return Kd.EMPTY;const{uri:i,range:n}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(r)?wMe(this._languageFeaturesService.hoverProvider,r,new oe(n.startLineNumber,n.startColumn),t).filter(a=>!$2(a.hover.contents)).map(a=>new g_(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):Kd.EMPTY}finally{o.dispose()}}};CX=D([_(1,xi),_(2,Ao),_(3,Ut),_(4,ec),_(5,Te),_(6,fn),_(7,it),_(8,vi)],CX);class kMe extends V{constructor(e,t,i,n,o,r){super();const a=t.anchor,c=t.hoverParts;this._renderedHoverParts=this._register(new Wbe(e,i,c,r,o));const{showAtPosition:l,showAtSecondaryPosition:d}=kMe.computeHoverPositions(e,a.range,c);this.shouldAppearBeforeContent=c.some(h=>h.isBeforeContent),this.showAtPosition=l,this.showAtSecondaryPosition=d,this.initialMousePosX=a.initialMousePosX,this.initialMousePosY=a.initialMousePosY,this.shouldFocus=n.shouldFocus,this.source=n.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}getAccessibleWidgetContent(){return this._renderedHoverParts.getAccessibleContent()}getAccessibleWidgetContentAtIndex(e){return this._renderedHoverParts.getAccessibleHoverContentAtIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}doesHoverAtIndexSupportVerbosityAction(e,t){return this._renderedHoverParts.doesHoverAtIndexSupportVerbosityAction(e,t)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,u=h.convertModelRangeToViewRange(t),f=d.getLineMinColumn(u.startLineNumber),p=new oe(u.startLineNumber,f);n=h.convertViewPositionToModelPosition(p).column}const o=t.startLineNumber;let r=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===o,f=h.endLineNumber===o;if(u&&f){const m=h.startColumn,v=Math.min(r,m);r=Math.max(v,n)}d.forceShowAtRange&&(a=h)}let c,l;if(a){const d=a.getStartPosition();c=d,l=d}else c=t.getStartPosition(),l=new oe(o,r);return{showAtPosition:c,showAtSecondaryPosition:l}}}class iFt{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}const Tse=class Tse extends V{constructor(e,t,i,n,o){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=o,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,o,n)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return V.None;let i=t[0].range;for(const o of t){const r=o.range;i=F.plusRange(i,r)}const n=e.createDecorationsCollection();return n.set([{range:i,options:Tse._DECORATION_OPTIONS}]),Ee(()=>{n.clear()})}_renderParts(e,t,i,n){const o=new bX(n),r={fragment:this._fragment,statusBar:o,...i},a=new Z;for(const l of e){const d=this._renderHoverPartsForParticipant(t,l,r);a.add(d);for(const h of d.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:l,hoverPart:h.hoverPart,hoverElement:h.hoverElement})}const c=this._renderStatusBar(this._fragment,o);return c&&(a.add(c),this._renderedParts.push({type:"statusBar",hoverElement:c.hoverElement,actions:c.actions})),Ee(()=>{a.dispose()})}_renderHoverPartsForParticipant(e,t,i){const n=e.filter(r=>r.owner===t);return n.length>0?t.renderHoverParts(i,n):new OM([])}_renderStatusBar(e,t){if(t.hasContent)return new iFt(e,t)}_registerListenersOnRenderedParts(){const e=new Z;return this._renderedParts.forEach((t,i)=>{const n=t.hoverElement;n.tabIndex=0,e.add(ue(n,ke.FOCUS_IN,o=>{o.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(ue(n,ke.FOCUS_OUT,o=>{o.stopPropagation(),this._focusedHoverPartIndex=-1}))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof K3&&!(i instanceof CX));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof q3)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}getAccessibleContent(){const e=[];for(let t=0;tr.type==="hoverPart"&&r.participant===e);if(o===-1)throw new Ni;return t-o}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}};Nse._DECORATION_OPTIONS=Gt.register({description:"content-hover-highlight",className:"hoverHighlight"});let Gbe=Nse,Kbe=class extends V{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._contentHoverWidget=this._register(this._instantiationService.createInstance(bX,this._editor)),this._participants=this._initializeHoverParticipants(),this._computer=new wX(this._editor,this._participants),this._hoverOperation=this._register(new DZe(this._editor,this._computer)),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of GN.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>t.handleResize?.())})),e}_registerListeners(){this._register(this._hoverOperation.onResult(e=>{if(!this._computer.anchor)return;const t=e.hasLoadingMessage?this._addLoadingMessage(e.value):e.value;this._withResult(new kZe(this._computer.anchor,t,e.isComplete))})),this._register(Ro(this._contentHoverWidget.getDomNode(),"keydown",e=>{e.equals(S.Escape)&&this.hide()})),this._register(Ta.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,n,o){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1;const a=this._editor.getOption(x.hover).sticky,c=o&&this._contentHoverWidget.isMouseGettingCloser(o.event.posx,o.event.posy);return a&&c?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._contentHoverWidget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){if(!this._computer.anchor)return e;for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const n=e.hoverParts.length===0,o=this._computer.insistOnKeepingHoverVisible;n&&o||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover=new HMe(this._editor,e,this._participants,this._computer,t,this._keybindingService),this._renderedContentHover.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover):this._renderedContentHover.dispose()}_hideHover(){this._contentHoverWidget.hide()}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._onContentsChanged.fire(),this._contentHoverWidget.onContentsChanged()},setMinimumDimensions:n=>{this._contentHoverWidget.setMinimumDimensions(n)}}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,oC.Delayed,FA.Mouse,!1,e);const o=i[0];return this._startShowingOrUpdateHover(o,oC.Delayed,FA.Mouse,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const o=n.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;switch(i.type){case Rt.CONTENT_TEXT:{t.push(new Jhe(0,i.range,e.event.posx,e.event.posy));break}case Rt.CONTENT_EMPTY:{const n=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-n.priority),t}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new Jhe(0,e,void 0,void 0),t,i,n,null)}getWidgetContent(){const e=this._contentHoverWidget.getDomNode();if(e.textContent)return e.textContent}async updateHoverVerbosityLevel(e,t,i){this._renderedContentHover?.updateHoverVerbosityLevel(e,t,i)}doesHoverAtIndexSupportVerbosityAction(e,t){return this._renderedContentHover?.doesHoverAtIndexSupportVerbosityAction(e,t)??!1}getAccessibleWidgetContent(){return this._renderedContentHover?.getAccessibleWidgetContent()}getAccessibleWidgetContentAtIndex(e){return this._renderedContentHover?.getAccessibleWidgetContentAtIndex(e)}focusedHoverPartIndex(){return this._renderedContentHover?.focusedHoverPartIndex??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){this._contentHoverWidget.focus()}focusHoverPartWithIndex(e){this._renderedContentHover?.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._renderedContentHover?.isColorPickerVisible()??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};Kbe=D([_(1,we),_(2,Ut)],Kbe);var fFt=".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)}";ut(fFt,{});class pFt{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=K_.Center}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],n=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const r=o.options.glyphMargin?.position??K_.Center;if(!n&&r!==this._laneOrLine)continue;const a=n?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!a||Q2(a)||i.push(...H_(a).map(e))}return i}}const yUe=fe,Pse=class Pse extends V{constructor(e,t,i){super(),this._renderDisposeables=this._register(new Z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new CLe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Y_({editor:this._editor},t,i)),this._computer=new pFt(this._editor),this._hoverOperation=this._register(new DZe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.fontInfo)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Pse.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(oC.Delayed))}showsOrWillShow(e){const t=e.target;return t.type===Rt.GUTTER_GLYPH_MARGIN&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===Rt.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(oC.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 n of t){const o=yUe("div.hover-row.markdown-hover"),r=re(o,yUe("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.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),n=this._editor.getScrollTop(),o=this._editor.getOption(x.lineHeight),r=this._hover.containerDomNode.clientHeight,a=i-n-(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`}};Pse.ID="editor.contrib.modesGlyphHoverWidget";let EX=Pse;var qbe;const mFt=!1;var vF;(function(s){s[s.Content=0]="Content",s[s.Glyph=1]="Glyph"})(vF||(vF={}));var HL;let Pa=(HL=class extends V{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 cn(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.hover)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(qbe.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===Rt.OVERLAY_WIDGET&&t.detail===EX.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Rt.CONTENT_WIDGET&&t.detail===bX.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},n=(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)||n(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 n=this._hoverSettings.hidingDelay;if(this._contentWidget?.isVisible&&t&&n>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(n);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){if(!e)return;const i=e.target.element?.classList.contains("colorpicker-color-decoration"),n=this._editor.getOption(x.colorDecoratorsActivatedOn),o=this._hoverSettings.enabled,r=this._hoverState.activatedByDecoratorClick;if(i&&(n==="click"&&!r||n==="hover"&&!o&&!mFt||n==="clickAndHover"&&!o&&!r)||!i&&!o&&!r){this._hideWidgets();return}this._tryShowHoverWidget(e,vF.Content)||this._tryShowHoverWidget(e,vF.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),n=this._getOrCreateGlyphWidget();let o,r;switch(t){case vF.Content:o=i,r=n;break;case vF.Glyph:o=n,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===nf.MoreChordsNeeded||t.kind===nf.KbFound&&(t.commandId===xZe||t.commandId===zU||t.commandId===$U)&&this._contentWidget?.isVisible;e.keyCode===S.Ctrl||e.keyCode===S.Alt||e.keyCode===S.Meta||e.keyCode===S.Shift||i||this._hideWidgets()}_hideWidgets(){this._hoverState.mouseDown&&this._contentWidget?.isColorPickerVisible||_W.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Kbe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(EX,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,n,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}doesHoverAtIndexSupportVerbosityAction(e,t){return this._getOrCreateContentWidget().doesHoverAtIndexSupportVerbosityAction(e,t)}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}focusHoverPartWithIndex(e){this._contentWidget?.focusHoverPartWithIndex(e)}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()}getAccessibleWidgetContent(){return this._contentWidget?.getAccessibleWidgetContent()}getAccessibleWidgetContentAtIndex(e){return this._contentWidget?.getAccessibleWidgetContentAtIndex(e)}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()}},qbe=HL,HL.ID="editor.contrib.hover",HL);Pa=qbe=D([_(1,we),_(2,Ut)],Pa);const _Ft=new Q("commentEditorFocused",!1),W5=5*18,vFt=25*18;let AW=class extends Hk{constructor(e,t,i,n,o,r,a,c,l,d,h,u){const f={contributions:[{id:MA.ID,ctor:MA,instantiation:ri.BeforeFirstInteraction},{id:Fb.ID,ctor:Fb,instantiation:ri.BeforeFirstInteraction},{id:Xg.ID,ctor:Xg,instantiation:ri.Eager},{id:fc.ID,ctor:fc,instantiation:ri.Lazy},{id:PA.ID,ctor:PA,instantiation:ri.Eager},{id:nC.ID,ctor:nC,instantiation:ri.Lazy},...ap.getSomeEditorContributions([sC.ID,HM.ID,yW.ID,Lh.ID,Pa.ID,hce,fu.ID,WM.ID])],contextMenuId:_e.SimpleEditorContext};super(e,t,f,o,r,a,i,c,l,d,h,u),this._commentEditorFocused=_Ft.bindTo(i),this._commentEditorEmpty=x_.commentIsEmpty.bindTo(i),this._commentEditorEmpty.set(!this.getModel()?.getValueLength()),this._parentThread=n,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 ap.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"),fontFamily:e.getValue("editor.fontFamily")}}};AW=D([_(4,we),_(5,Kt),_(6,vi),_(7,pn),_(8,bi),_(9,mr),_(10,Vs),_(11,it)],AW);function YZe(s,e,t){const i=e.getLayoutInfo(),n=e.getOption(x.lineHeight),o=e._getViewModel()?.getLineCount()*n;if(o>i.height||oW5){const r=Math.ceil((o-i.height)/n),a=i.height+n*r;return Ka(a,W5,Ka(s.getLayoutInfo().height-90,W5,vFt))}return t}var QC;(function(s){s.Add="workbench.action.addComment",s.NextThread="editor.action.nextCommentThreadAction",s.PreviousThread="editor.action.previousCommentThreadAction",s.NextRange="editor.action.nextCommentingRange",s.PreviousRange="editor.action.previousCommentingRange",s.ToggleCommenting="workbench.action.toggleCommenting",s.Submit="editor.action.submitComment",s.Hide="workbench.action.hideComment",s.CollapseAll="workbench.action.collapseAllComments",s.ExpandAll="workbench.action.expandAllComments",s.ExpandUnresolved="workbench.action.expandUnresolvedComments"})(QC||(QC={}));const Fse=class Fse extends li{constructor(){super({id:Fse.ID,title:Pe(1570,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:U.CtrlCmd|S.KeyM,mac:{primary:U.WinCtrl|U.Shift|S.KeyM},weight:Ae.EditorContrib},metadata:{description:Pe(1571,"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=!Pk.getTabFocusMode();Pk.setTabFocusMode(t),Mr(t?g(1572,"Pressing Tab will now move focus to the next focusable element"):g(1573,"Pressing Tab will now insert the tab character"))}};Fse.ID="editor.action.toggleTabFocusMode";let xX=Fse;At(xX);var NE;(function(s){s.intro=g(5352,"The editor contains commentable range(s). Some useful commands include:"),s.tabFocus=g(5353,"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}.",``),s.commentCommands=g(5354,"Some useful comment commands include:"),s.escape=g(5355,"- Dismiss Comment (Escape)"),s.nextRange=g(5356,"- Go to Next Commenting Range{0}.",``),s.previousRange=g(5357,"- Go to Previous Commenting Range{0}.",``),s.nextCommentThread=g(5358,"- Go to Next Comment Thread{0}.",``),s.previousCommentThread=g(5359,"- Go to Previous Comment Thread{0}.",``),s.addComment=g(5360,"- Add Comment on Current Selection{0}.",``),s.submitComment=g(5361,"- Submit Comment{0}.",``)})(NE||(NE={}));const bFt="revealInExplorer",wFt="workbench.action.files.revert",yFt="workbench.action.files.saveAs";Pe(5378,"Save As...");const CFt="workbench.action.files.save";Pe(5379,"Save");const SFt="workbench.action.files.saveWithoutFormatting";Pe(5380,"Save without Formatting");const AFt="saveAll";Pe(5381,"Save All");const JZe="workbench.files.action.saveAllInGroup",EFt="workbench.action.files.saveFiles";new Q("groupFocusedInOpenEditors",!1);new Q("dirtyEditorFocusedInOpenEditors",!1);new Q("readonlyEditorFocusedInOpenEditors",!1);new Q("openEditorsSelectedFileOrUntitled",!0);new Q("resourceSelectedForCompare",!1);g(5382,"Remove Folder from Workspace");const xFt="workbench.action.files.newUntitledFile";Pe(5383,"New Untitled Text File");let CUe=class extends V{onClose(){this._editor.focus()}constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=Pb.Editor,this.options={type:wm.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=vr.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(kg.readonlyDiffEditor):t.push(kg.editableDiffEditor):e.get(x.readOnly)?t.push(kg.readonlyEditor):t.push(kg.editableEditor),t.push(kg.listSignalSounds),t.push(kg.listAlerts);const i=DFt(this._keybindingService,this._contextKeyService);i&&t.push(i);const n=XZe(this._keybindingService,this._contextKeyService,this._editor);return n&&t.push(n),e.get(x.stickyScroll).enabled&&t.push(kg.stickScroll),e.get(x.tabFocusMode)?t.push(kg.tabFocusModeOnMsg):t.push(kg.tabFocusModeOffMsg),t.push(kg.setBreakpoint),t.push(kg.debugExecuteSelection),t.join(` -`)}};CUe=D([_(1,Ut),_(2,Le)],CUe);function XZe(s,e,t){if(e.getContext(t.getDomNode()).getValue(x_.activeEditorHasCommentingRange.key))return[NE.intro,NE.addComment,NE.nextCommentThread,NE.previousCommentThread,NE.nextRange,NE.previousRange].join(` -`)}function DFt(s,e){if(YXe.getValue(e))return[kg.quickChat,kg.startInlineChat].join(` -`)}class kFt{constructor(){this.priority=105,this.name="diff-editor",this.when=SN.create("isInDiffEditor",!0),this.type=wm.Help}getProvider(e){const t=e.get(ei),i=e.get(Kt),n=e.get(Ut),o=e.get(Le);if(!(t.activeTextEditorControl instanceof vp))return;const r=i.getActiveCodeEditor()||i.getFocusedCodeEditor();if(!r)return;const a=g(4516,"Run the command Diff Editor: Switch Side{0} to toggle between the original and modified editors.",""),c=g(4517,"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(4518,"You are in a diff editor."),g(4519,"View the next{0} or previous{1} diff in diff review mode, which is optimized for screen readers.","",""),a,c,g(4520,"To control which accessibility signals should be played, the following settings can be configured: {0}.",l.join(", "))],h=XZe(n,o,r);return h&&d.push(h),new LXe(Pb.DiffEditor,{type:wm.Help},()=>d.join(` -`),()=>r.focus(),vr.DiffEditor)}}var xB;let DX=(xB=class extends V{constructor(e,t,i,n){if(super(),this._diffEditor=e,this._instantiationService=t,this._textResourceConfigurationService=i,this._notificationService=n,!(this._diffEditor instanceof V3)){const a=Kn(this,c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(cu((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(QJ,this._diffEditor.getModifiedEditor(),g(718,"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(Xe.Warning,g(719,"The diff algorithm was stopped early (after {0} ms.)",this._diffEditor.maxComputationTime),[{label:g(720,"Remove Limit"),run:()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.maxComputationTime",0)}}],{})}))}}},xB.ID="editor.contrib.diffEditorHelper",xB);DX=D([_(1,we),_(2,Ec),_(3,bi)],DX);nKe(DX.ID,DX);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(s,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:s}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);U6.register(new kFt);var DB;let kX=(DB=class extends V{constructor(e,t,i){super(),this._editor=e,this._notificationService=t,this._configurationService=i,this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){const e=this._editor.getModel();if(e&&e.isTooLargeForTokenization()){const t=g(721,"{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.",Ko(e.uri.path));this._notificationService.prompt(Xe.Info,t,[{label:g(722,"Forcefully Enable Features"),run:()=>{this._configurationService.updateValue("editor.largeFileOptimizations",!1).then(()=>{this._notificationService.info(g(723,"Please reopen file in order for this setting to take effect."))},i=>{this._notificationService.error(i)})}}],{neverShowAgain:{id:"editor.contrib.largeFileOptimizationsWarner"}})}}},DB.ID="editor.contrib.largeFileOptimizationsWarner",DB);kX=D([_(1,bi),_(2,Te)],kX);on(kX.ID,kX,ri.AfterFirstRender);class IFt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=ZZe(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,o=i.length;na.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 n=0,o=0;const r=e.length;for(let a=1,c=s.getLineCount();a<=c;a++){const l=s.getLineContent(a),d=l.length+1;let h=0;if(o"u"))return typeof s=="string"?$e.fromString(s):{read:()=>{const e=s.read();return typeof e=="string"?$e.fromString(e):null}}}let Qbe=class extends Bje{constructor(e,t,i,n,o){const r=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...Vje},l=o.getColorTheme(),d=l.getColor(Hc),u=l.getColor(sce)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,r,a,n,c,{ariaLabel:g(10418,"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)}};Qbe=D([_(3,mf),_(4,pn)],Qbe);const tO=class tO extends rn{constructor(e){super(tO.ID,tO.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};tO.ID="quickDiff.base.switch",tO.LABEL=g(10419,"Switch Quick Diff Base");let jbe=tO;var Ybe,d0;class PFt extends $_{runAction(e,t){return e instanceof Sc?e.run(...t):super.runAction(e,t)}}const eet=new Q("dirtyDiffVisible",!1);function FFt(s){const e=s.modifiedEndLineNumber-s.modifiedStartLineNumber+1,t=s.originalEndLineNumber-s.originalStartLineNumber+1;return s.originalEndLineNumber===0?e:s.modifiedEndLineNumber===0?t:e+t}function Jbe(s){return s.modifiedEndLineNumber===0?s.modifiedStartLineNumber===0?1:s.modifiedStartLineNumber:s.modifiedEndLineNumber}function OFt(s,e){return s===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:s>=e.modifiedStartLineNumber&&s<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let H5=class extends rn{constructor(e,t,i,n,o){const r=n.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)))}};H5=D([_(3,Ut),_(4,we)],H5);var dp;(function(s){s[s.Modify=0]="Modify",s[s.Add=1]="Add",s[s.Delete=2]="Delete"})(dp||(dp={}));function UMe(s){return s.originalEndLineNumber===0?dp.Add:s.modifiedEndLineNumber===0?dp.Delete:dp.Modify}function BFt(s,e){switch(e){case dp.Modify:return s.getColor(VMe);case dp.Add:return s.getColor(zMe);case dp.Delete:return s.getColor($Me)}}function eG(s){const e=s.get(Kt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof V3)return t.getParentEditor();return AXe(s)}let Xbe=class extends H3{constructor(e,t,i,n,o,r){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},n),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=_i(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],n=i.change;if(this._index=e,this.contextKeyService.createKey("originalResourceScheme",this.model.changes[e].uri.scheme),this.updateActions(),this._provider=i.label,this.change=n,!this.model.original)return;M.once(this.diffEditor.onDidUpdateDiff)(()=>setTimeout(()=>this.revealChange(n),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(Jbe(n),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(FFt(n)+8,Math.floor(h/3));this.renderTitle(i.label);const f=UMe(n),p=BFt(this.themeService.getColorTheme(),f);this.style({frameColor:p,arrowColor:p});const m=[];let v=e;for(const b of this.model.changes)b.label===this.model.changes[this._index].label&&(m.push(b.change),i===b&&(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 n;this.shouldUseDropdown()?(n=this.model.changes.length>1?g(6335,"{0} of {1} changes",i+1,t.length):g(6336,"{0} of {1} change",i+1,t.length),this.dropdownContainer.style.display="inherit"):(n=this.model.changes.length>1?g(6333,"{0} - {1} of {2} changes",e,i+1,t.length):g(6334,"{0} - {1} of {2} change",e,i+1,t.length),this.dropdownContainer.style.display="none"),this.setTitle(this.title,n)}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=n;r!==this._index;r>=0?r--:r=this.model.changes.length-1)if(this.model.changes[r].label===t){n=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(H5,this.editor,new tet(this.editor),We.asClassName(Skt)),t=this.instantiationService.createInstance(H5,this.editor,new iet(this.editor),We.asClassName(Akt));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(_e.SCMChangeContext,this.contextKeyService),fC(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 rn("peekview.close",g(6337,"Close"),We.asClassName(ve.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=Ore(this._titleElement,fe(".dropdown")),this.dropdown=this.instantiationService.createInstance(Qbe,new jbe(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 PFt;return e.onDidRun(t=>{!(t.action instanceof H5)&&!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(V3,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,mt.Immediate)}_applyTheme(e){const t=e.getColor(uMe)||me.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(sce)||me.transparent,primaryHeadingColor:e.getColor(dMe),secondaryHeadingColor:e.getColor(hMe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,mt.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};Xbe=D([_(2,pn),_(3,we),_(4,Oa),_(5,Le)],Xbe);class tet extends tt{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(6338,"Show Previous Change"),alias:"Show Previous Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??eG(e);if(!t)return;const i=rC.get(t);i&&i.canNavigate()&&i.previous()}}Re(tet);class iet extends tt{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(6339,"Show Next Change"),alias:"Show Next Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??eG(e);if(!t)return;const i=rC.get(t);i&&i.canNavigate()&&i.next()}}Re(iet);jn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(6340,"Next &&Change")},order:1});jn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(6341,"Previous &&Change")},order:2});class WFt extends tt{constructor(){super({id:"workbench.action.editor.previousChange",label:g(6342,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=eG(e),i=e.get(lv),n=e.get(mr),o=e.get(Kt);if(!t||!t.hasModel())return;const r=rC.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 set(d.change,i),net(d.change,t,n,o)}}Re(WFt);class HFt extends tt{constructor(){super({id:"workbench.action.editor.nextChange",label:g(6343,"Go to Next Change"),alias:"Go to Next Change",precondition:Mae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=e.get(lv),i=eG(e),n=e.get(mr),o=e.get(Kt);if(!i||!i.hasModel())return;const r=rC.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 set(d,t),net(d,i,n,o)}}function net(s,e,t,i){const n=new oe(s.modifiedStartLineNumber,1);e.setPosition(n),e.revealPositionInCenter(n),t.isScreenReaderOptimized()&&(e.setSelection({startLineNumber:s.modifiedStartLineNumber,startColumn:0,endLineNumber:s.modifiedStartLineNumber,endColumn:Number.MAX_VALUE}),i.getActiveCodeEditor()?.writeScreenReaderContent("diff-navigation"))}async function set(s,e){switch(UMe(s)){case dp.Add:e.playSignal(cl.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case dp.Delete:e.playSignal(cl.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case dp.Modify:e.playSignal(cl.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Re(HFt);So.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:Ae.EditorContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(eet),handler:s=>{const e=eG(s);if(!e)return;const t=rC.get(e);t&&t.close()}});var UL;let rC=(UL=class extends V{static get(e){return e.getContribution(Ybe.ID)}constructor(e,t,i,n){if(super(),this.editor=e,this.configurationService=i,this.instantiationService=n,this.modelRegistry=null,this.model=null,this.widget=null,this.session=V.None,this.mouseDownInfo=null,this.enabled=!1,this.gutterActionDisposables=new Z,this.enabled=!t.getContextKeyValue("isInDiffEditor"),this.stylesheet=gl(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=eet.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const o=M.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=` +`)}return t.participant.getAccessibleContent(t.hoverPart)}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;const n=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,t);if(n===void 0)return;const o=await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e,n,i);o&&(this._renderedParts[t]={type:"hoverPart",participant:this._markdownHoverParticipant,hoverPart:o.hoverPart,hoverElement:o.hoverElement},this._context.onContentsChanged())}doesHoverAtIndexSupportVerbosityAction(e,t){if(!this._markdownHoverParticipant)return!1;const i=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,e);return i===void 0?!1:this._markdownHoverParticipant.doesMarkdownHoverAtIndexSupportVerbosityAction(i,t)}isColorPickerVisible(){return this._colorHoverParticipant?.isColorPickerVisible()??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const o=this._renderedParts.findIndex(r=>r.type==="hoverPart"&&r.participant===e);if(o===-1)throw new Ni;return t-o}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}};Tse._DECORATION_OPTIONS=Gt.register({description:"content-hover-highlight",className:"hoverHighlight"});let Wbe=Tse,Hbe=class extends V{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._contentHoverWidget=this._register(this._instantiationService.createInstance(_X,this._editor)),this._participants=this._initializeHoverParticipants(),this._computer=new vX(this._editor,this._participants),this._hoverOperation=this._register(new bZe(this._editor,this._computer)),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of UN.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>t.handleResize?.())})),e}_registerListeners(){this._register(this._hoverOperation.onResult(e=>{if(!this._computer.anchor)return;const t=e.hasLoadingMessage?this._addLoadingMessage(e.value):e.value;this._withResult(new wZe(this._computer.anchor,t,e.isComplete))})),this._register(Ro(this._contentHoverWidget.getDomNode(),"keydown",e=>{e.equals(S.Escape)&&this.hide()})),this._register(Ta.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,n,o){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1;const a=this._editor.getOption(x.hover).sticky,c=o&&this._contentHoverWidget.isMouseGettingCloser(o.event.posx,o.event.posy);return a&&c?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._contentHoverWidget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){if(!this._computer.anchor)return e;for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const n=e.hoverParts.length===0,o=this._computer.insistOnKeepingHoverVisible;n&&o||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover=new kMe(this._editor,e,this._participants,this._computer,t,this._keybindingService),this._renderedContentHover.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover):this._renderedContentHover.dispose()}_hideHover(){this._contentHoverWidget.hide()}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._onContentsChanged.fire(),this._contentHoverWidget.onContentsChanged()},setMinimumDimensions:n=>{this._contentHoverWidget.setMinimumDimensions(n)}}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,iC.Delayed,NA.Mouse,!1,e);const o=i[0];return this._startShowingOrUpdateHover(o,iC.Delayed,NA.Mouse,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const o=n.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;switch(i.type){case Rt.CONTENT_TEXT:{t.push(new $he(0,i.range,e.event.posx,e.event.posy));break}case Rt.CONTENT_EMPTY:{const n=this._editor.getOption(x.fontInfo).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-n.priority),t}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new $he(0,e,void 0,void 0),t,i,n,null)}getWidgetContent(){const e=this._contentHoverWidget.getDomNode();if(e.textContent)return e.textContent}async updateHoverVerbosityLevel(e,t,i){this._renderedContentHover?.updateHoverVerbosityLevel(e,t,i)}doesHoverAtIndexSupportVerbosityAction(e,t){return this._renderedContentHover?.doesHoverAtIndexSupportVerbosityAction(e,t)??!1}getAccessibleWidgetContent(){return this._renderedContentHover?.getAccessibleWidgetContent()}getAccessibleWidgetContentAtIndex(e){return this._renderedContentHover?.getAccessibleWidgetContentAtIndex(e)}focusedHoverPartIndex(){return this._renderedContentHover?.focusedHoverPartIndex??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){this._contentHoverWidget.focus()}focusHoverPartWithIndex(e){this._renderedContentHover?.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._renderedContentHover?.isColorPickerVisible()??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};Hbe=D([_(1,we),_(2,Ut)],Hbe);var nFt=".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)}";ut(nFt,{});class sFt{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=z_.Center}computeSync(){const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],n=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const r=o.options.glyphMargin?.position??z_.Center;if(!n&&r!==this._laneOrLine)continue;const a=n?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!a||$2(a)||i.push(...O_(a).map(e))}return i}}const lUe=fe,Lse=class Lse extends V{constructor(e,t,i){super(),this._renderDisposeables=this._register(new Z),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new dLe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new q_({editor:this._editor},t,i)),this._computer=new sFt(this._editor),this._hoverOperation=this._register(new bZe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.fontInfo)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Lse.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(iC.Delayed))}showsOrWillShow(e){const t=e.target;return t.type===Rt.GUTTER_GLYPH_MARGIN&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===Rt.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(iC.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 n of t){const o=lUe("div.hover-row.markdown-hover"),r=re(o,lUe("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.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),n=this._editor.getScrollTop(),o=this._editor.getOption(x.lineHeight),r=this._hover.containerDomNode.clientHeight,a=i-n-(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`}};Lse.ID="editor.contrib.modesGlyphHoverWidget";let SX=Lse;var Ube;const oFt=!1;var fF;(function(s){s[s.Content=0]="Content",s[s.Glyph=1]="Glyph"})(fF||(fF={}));var FL;let Pa=(FL=class extends V{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 cn(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(x.hover)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(Ube.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===Rt.OVERLAY_WIDGET&&t.detail===SX.ID:!1}_isMouseOnContentHoverWidget(e){const t=e.target;return t?t.type===Rt.CONTENT_WIDGET&&t.detail===_X.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},n=(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)||n(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 n=this._hoverSettings.hidingDelay;if(this._contentWidget?.isVisible&&t&&n>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(n);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){if(!e)return;const i=e.target.element?.classList.contains("colorpicker-color-decoration"),n=this._editor.getOption(x.colorDecoratorsActivatedOn),o=this._hoverSettings.enabled,r=this._hoverState.activatedByDecoratorClick;if(i&&(n==="click"&&!r||n==="hover"&&!o&&!oFt||n==="clickAndHover"&&!o&&!r)||!i&&!o&&!r){this._hideWidgets();return}this._tryShowHoverWidget(e,fF.Content)||this._tryShowHoverWidget(e,fF.Glyph)||this._hideWidgets()}_tryShowHoverWidget(e,t){const i=this._getOrCreateContentWidget(),n=this._getOrCreateGlyphWidget();let o,r;switch(t){case fF.Content:o=i,r=n;break;case fF.Glyph:o=n,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===Zg.MoreChordsNeeded||t.kind===Zg.KbFound&&(t.commandId===vZe||t.commandId===BU||t.commandId===WU)&&this._contentWidget?.isVisible;e.keyCode===S.Ctrl||e.keyCode===S.Alt||e.keyCode===S.Meta||e.keyCode===S.Shift||i||this._hideWidgets()}_hideWidgets(){this._hoverState.mouseDown&&this._contentWidget?.isColorPickerVisible||gW.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._glyphWidget?.hide(),this._contentWidget?.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Hbe,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(SX,this._editor)),this._glyphWidget}hideContentHover(){this._hideWidgets()}showContentHover(e,t,i,n,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}doesHoverAtIndexSupportVerbosityAction(e,t){return this._getOrCreateContentWidget().doesHoverAtIndexSupportVerbosityAction(e,t)}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}focusHoverPartWithIndex(e){this._contentWidget?.focusHoverPartWithIndex(e)}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()}getAccessibleWidgetContent(){return this._contentWidget?.getAccessibleWidgetContent()}getAccessibleWidgetContentAtIndex(e){return this._contentWidget?.getAccessibleWidgetContentAtIndex(e)}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()}},Ube=FL,FL.ID="editor.contrib.hover",FL);Pa=Ube=D([_(1,we),_(2,Ut)],Pa);const rFt=new Y("commentEditorFocused",!1),F5=5*18,aFt=25*18;let wW=class extends Pk{constructor(e,t,i,n,o,r,a,c,l,d,h,u){const f={contributions:[{id:LA.ID,ctor:LA,instantiation:ri.BeforeFirstInteraction},{id:Mb.ID,ctor:Mb,instantiation:ri.BeforeFirstInteraction},{id:jg.ID,ctor:jg,instantiation:ri.Eager},{id:fc.ID,ctor:fc,instantiation:ri.Lazy},{id:MA.ID,ctor:MA,instantiation:ri.Eager},{id:eC.ID,ctor:eC,instantiation:ri.Lazy},...sp.getSomeEditorContributions([tC.ID,FM.ID,_W.ID,Ih.ID,Pa.ID,ace,gu.ID,PM.ID])],contextMenuId:_e.SimpleEditorContext};super(e,t,f,o,r,a,i,c,l,d,h,u),this._commentEditorFocused=rFt.bindTo(i),this._commentEditorEmpty=S_.commentIsEmpty.bindTo(i),this._commentEditorEmpty.set(!this.getModel()?.getValueLength()),this._parentThread=n,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 sp.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"),fontFamily:e.getValue("editor.fontFamily")}}};wW=D([_(4,we),_(5,Kt),_(6,vi),_(7,pn),_(8,bi),_(9,mr),_(10,Vs),_(11,it)],wW);function VZe(s,e,t){const i=e.getLayoutInfo(),n=e.getOption(x.lineHeight),o=e._getViewModel()?.getLineCount()*n;if(o>i.height||oF5){const r=Math.ceil((o-i.height)/n),a=i.height+n*r;return Ka(a,F5,Ka(s.getLayoutInfo().height-90,F5,aFt))}return t}var qC;(function(s){s.Add="workbench.action.addComment",s.NextThread="editor.action.nextCommentThreadAction",s.PreviousThread="editor.action.previousCommentThreadAction",s.NextRange="editor.action.nextCommentingRange",s.PreviousRange="editor.action.previousCommentingRange",s.ToggleCommenting="workbench.action.toggleCommenting",s.Submit="editor.action.submitComment",s.Hide="workbench.action.hideComment",s.CollapseAll="workbench.action.collapseAllComments",s.ExpandAll="workbench.action.expandAllComments",s.ExpandUnresolved="workbench.action.expandUnresolvedComments"})(qC||(qC={}));const Rse=class Rse extends li{constructor(){super({id:Rse.ID,title:Fe(1570,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:U.CtrlCmd|S.KeyM,mac:{primary:U.WinCtrl|U.Shift|S.KeyM},weight:Ae.EditorContrib},metadata:{description:Fe(1571,"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=!Tk.getTabFocusMode();Tk.setTabFocusMode(t),Mr(t?g(1572,"Pressing Tab will now move focus to the next focusable element"):g(1573,"Pressing Tab will now insert the tab character"))}};Rse.ID="editor.action.toggleTabFocusMode";let AX=Rse;At(AX);var LE;(function(s){s.intro=g(5352,"The editor contains commentable range(s). Some useful commands include:"),s.tabFocus=g(5353,"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}.",``),s.commentCommands=g(5354,"Some useful comment commands include:"),s.escape=g(5355,"- Dismiss Comment (Escape)"),s.nextRange=g(5356,"- Go to Next Commenting Range{0}.",``),s.previousRange=g(5357,"- Go to Previous Commenting Range{0}.",``),s.nextCommentThread=g(5358,"- Go to Next Comment Thread{0}.",``),s.previousCommentThread=g(5359,"- Go to Previous Comment Thread{0}.",``),s.addComment=g(5360,"- Add Comment on Current Selection{0}.",``),s.submitComment=g(5361,"- Submit Comment{0}.",``)})(LE||(LE={}));const cFt="revealInExplorer",lFt="workbench.action.files.revert",dFt="workbench.action.files.saveAs";Fe(5378,"Save As...");const hFt="workbench.action.files.save";Fe(5379,"Save");const uFt="workbench.action.files.saveWithoutFormatting";Fe(5380,"Save without Formatting");const gFt="saveAll";Fe(5381,"Save All");const zZe="workbench.files.action.saveAllInGroup",fFt="workbench.action.files.saveFiles";new Y("groupFocusedInOpenEditors",!1);new Y("dirtyEditorFocusedInOpenEditors",!1);new Y("readonlyEditorFocusedInOpenEditors",!1);new Y("openEditorsSelectedFileOrUntitled",!0);new Y("resourceSelectedForCompare",!1);g(5382,"Remove Folder from Workspace");const pFt="workbench.action.files.newUntitledFile";Fe(5383,"New Untitled Text File");let dUe=class extends V{onClose(){this._editor.focus()}constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._contextKeyService=i,this.id=Rb.Editor,this.options={type:_m.Help,readMoreUrl:"https://go.microsoft.com/fwlink/?linkid=851010"},this.verbositySettingKey=vr.Editor}provideContent(){const e=this._editor.getOptions(),t=[];e.get(x.inDiffEditor)?e.get(x.readOnly)?t.push(Eg.readonlyDiffEditor):t.push(Eg.editableDiffEditor):e.get(x.readOnly)?t.push(Eg.readonlyEditor):t.push(Eg.editableEditor),t.push(Eg.listSignalSounds),t.push(Eg.listAlerts);const i=mFt(this._keybindingService,this._contextKeyService);i&&t.push(i);const n=$Ze(this._keybindingService,this._contextKeyService,this._editor);return n&&t.push(n),e.get(x.stickyScroll).enabled&&t.push(Eg.stickScroll),e.get(x.tabFocusMode)?t.push(Eg.tabFocusModeOnMsg):t.push(Eg.tabFocusModeOffMsg),t.push(Eg.setBreakpoint),t.push(Eg.debugExecuteSelection),t.join(` +`)}};dUe=D([_(1,Ut),_(2,Le)],dUe);function $Ze(s,e,t){if(e.getContext(t.getDomNode()).getValue(S_.activeEditorHasCommentingRange.key))return[LE.intro,LE.addComment,LE.nextCommentThread,LE.previousCommentThread,LE.nextRange,LE.previousRange].join(` +`)}function mFt(s,e){if(VXe.getValue(e))return[Eg.quickChat,Eg.startInlineChat].join(` +`)}class _Ft{constructor(){this.priority=105,this.name="diff-editor",this.when=bN.create("isInDiffEditor",!0),this.type=_m.Help}getProvider(e){const t=e.get(ei),i=e.get(Kt),n=e.get(Ut),o=e.get(Le);if(!(t.activeTextEditorControl instanceof pp))return;const r=i.getActiveCodeEditor()||i.getFocusedCodeEditor();if(!r)return;const a=g(4516,"Run the command Diff Editor: Switch Side{0} to toggle between the original and modified editors.",""),c=g(4517,"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(4518,"You are in a diff editor."),g(4519,"View the next{0} or previous{1} diff in diff review mode, which is optimized for screen readers.","",""),a,c,g(4520,"To control which accessibility signals should be played, the following settings can be configured: {0}.",l.join(", "))],h=$Ze(n,o,r);return h&&d.push(h),new SXe(Rb.DiffEditor,{type:_m.Help},()=>d.join(` +`),()=>r.focus(),vr.DiffEditor)}}var CB;let EX=(CB=class extends V{constructor(e,t,i,n){if(super(),this._diffEditor=e,this._instantiationService=t,this._textResourceConfigurationService=i,this._notificationService=n,!(this._diffEditor instanceof W3)){const a=Kn(this,c=>this._diffEditor.onDidUpdateDiff(c),()=>this._diffEditor.getDiffComputationResult()).map(c=>c&&!c.identical&&c.changes2.length===0);this._register(au((c,l)=>{if(a.read(c)){const d=l.add(this._instantiationService.createInstance(KJ,this._diffEditor.getModifiedEditor(),g(718,"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(Xe.Warning,g(719,"The diff algorithm was stopped early (after {0} ms.)",this._diffEditor.maxComputationTime),[{label:g(720,"Remove Limit"),run:()=>{this._textResourceConfigurationService.updateValue(this._diffEditor.getModel().modified.uri,"diffEditor.maxComputationTime",0)}}],{})}))}}},CB.ID="editor.contrib.diffEditorHelper",CB);EX=D([_(1,we),_(2,Ec),_(3,bi)],EX);jGe(EX.ID,EX);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"diffEditor.experimental.collapseUnchangedRegions",migrateFn:(s,e)=>[["diffEditor.hideUnchangedRegions.enabled",{value:s}],["diffEditor.experimental.collapseUnchangedRegions",{value:void 0}]]}]);O6.register(new _Ft);var SB;let xX=(SB=class extends V{constructor(e,t,i){super(),this._editor=e,this._notificationService=t,this._configurationService=i,this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){const e=this._editor.getModel();if(e&&e.isTooLargeForTokenization()){const t=g(721,"{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.",Ko(e.uri.path));this._notificationService.prompt(Xe.Info,t,[{label:g(722,"Forcefully Enable Features"),run:()=>{this._configurationService.updateValue("editor.largeFileOptimizations",!1).then(()=>{this._notificationService.info(g(723,"Please reopen file in order for this setting to take effect."))},i=>{this._notificationService.error(i)})}}],{neverShowAgain:{id:"editor.contrib.largeFileOptimizationsWarner"}})}}},SB.ID="editor.contrib.largeFileOptimizationsWarner",SB);xX=D([_(1,bi),_(2,Te)],xX);on(xX.ID,xX,ri.AfterFirstRender);class vFt{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=GZe(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,o=i.length;na.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 n=0,o=0;const r=e.length;for(let a=1,c=s.getLineCount();a<=c;a++){const l=s.getLineContent(a),d=l.length+1;let h=0;if(o"u"))return typeof s=="string"?$e.fromString(s):{read:()=>{const e=s.read();return typeof e=="string"?$e.fromString(e):null}}}let Vbe=class extends Tje{constructor(e,t,i,n,o){const r=t.map(f=>({provider:f,text:f}));let a=t.indexOf(i);a===-1&&(a=0);const c={...Nje},l=o.getColorTheme(),d=l.getColor(Hc),u=l.getColor(ece)?.makeOpaque(d)??d;c.selectBackground=u.lighten(.6).toString(),super(null,e,r,a,n,c,{ariaLabel:g(10418,"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)}};Vbe=D([_(3,gf),_(4,pn)],Vbe);const JF=class JF extends rn{constructor(e){super(JF.ID,JF.LABEL,void 0,void 0),this.callback=e}async run(e){return this.callback(e)}};JF.ID="quickDiff.base.switch",JF.LABEL=g(10419,"Switch Quick Diff Base");let zbe=JF;var $be,a0;class AFt extends U_{runAction(e,t){return e instanceof Sc?e.run(...t):super.runAction(e,t)}}const KZe=new Y("dirtyDiffVisible",!1);function EFt(s){const e=s.modifiedEndLineNumber-s.modifiedStartLineNumber+1,t=s.originalEndLineNumber-s.originalStartLineNumber+1;return s.originalEndLineNumber===0?e:s.modifiedEndLineNumber===0?t:e+t}function Gbe(s){return s.modifiedEndLineNumber===0?s.modifiedStartLineNumber===0?1:s.modifiedStartLineNumber:s.modifiedEndLineNumber}function xFt(s,e){return s===1&&e.modifiedStartLineNumber===0&&e.modifiedEndLineNumber===0?!0:s>=e.modifiedStartLineNumber&&s<=(e.modifiedEndLineNumber||e.modifiedStartLineNumber)}let O5=class extends rn{constructor(e,t,i,n,o){const r=n.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)))}};O5=D([_(3,Ut),_(4,we)],O5);var ap;(function(s){s[s.Modify=0]="Modify",s[s.Add=1]="Add",s[s.Delete=2]="Delete"})(ap||(ap={}));function IMe(s){return s.originalEndLineNumber===0?ap.Add:s.modifiedEndLineNumber===0?ap.Delete:ap.Modify}function DFt(s,e){switch(e){case ap.Modify:return s.getColor(TMe);case ap.Add:return s.getColor(LMe);case ap.Delete:return s.getColor(RMe)}}function Y6(s){const e=s.get(Kt).listDiffEditors();for(const t of e)if(t.hasTextFocus()&&t instanceof W3)return t.getParentEditor();return mXe(s)}let Kbe=class extends O3{constructor(e,t,i,n,o,r){super(e,{isResizeable:!0,frameWidth:1,keepEditorSelection:!0,className:"dirty-diff"},n),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=_i(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],n=i.change;if(this._index=e,this.contextKeyService.createKey("originalResourceScheme",this.model.changes[e].uri.scheme),this.updateActions(),this._provider=i.label,this.change=n,!this.model.original)return;M.once(this.diffEditor.onDidUpdateDiff)(()=>setTimeout(()=>this.revealChange(n),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(Gbe(n),1),l=this.editor.getOption(x.lineHeight),d=this.editor.getLayoutInfo().height,h=Math.floor(d/l),u=Math.min(EFt(n)+8,Math.floor(h/3));this.renderTitle(i.label);const f=IMe(n),p=DFt(this.themeService.getColorTheme(),f);this.style({frameColor:p,arrowColor:p});const m=[];let v=e;for(const b of this.model.changes)b.label===this.model.changes[this._index].label&&(m.push(b.change),i===b&&(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 n;this.shouldUseDropdown()?(n=this.model.changes.length>1?g(6335,"{0} of {1} changes",i+1,t.length):g(6336,"{0} of {1} change",i+1,t.length),this.dropdownContainer.style.display="inherit"):(n=this.model.changes.length>1?g(6333,"{0} - {1} of {2} changes",e,i+1,t.length):g(6334,"{0} - {1} of {2} change",e,i+1,t.length),this.dropdownContainer.style.display="none"),this.setTitle(this.title,n)}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=n;r!==this._index;r>=0?r--:r=this.model.changes.length-1)if(this.model.changes[r].label===t){n=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(O5,this.editor,new qZe(this.editor),We.asClassName(ukt)),t=this.instantiationService.createInstance(O5,this.editor,new QZe(this.editor),We.asClassName(gkt));this._disposables.add(e),this._disposables.add(t);const i=[];this.menu&&this.menu.dispose(),this.menu=this.menuService.createMenu(_e.SCMChangeContext,this.contextKeyService),dC(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 rn("peekview.close",g(6337,"Close"),We.asClassName(ve.close),!0,()=>this.dispose()),{label:!1,icon:!0})}_fillHead(e){super._fillHead(e,!0),this.dropdownContainer=Mre(this._titleElement,fe(".dropdown")),this.dropdown=this.instantiationService.createInstance(Vbe,new zbe(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 AFt;return e.onDidRun(t=>{!(t.action instanceof O5)&&!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(W3,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,mt.Immediate)}_applyTheme(e){const t=e.getColor(eMe)||me.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(ece)||me.transparent,primaryHeadingColor:e.getColor(XRe),secondaryHeadingColor:e.getColor(ZRe)})}revealRange(e){this.editor.revealLineInCenterIfOutsideViewport(e.endLineNumber,mt.Smooth)}hasFocus(){return this.diffEditor.hasTextFocus()}dispose(){super.dispose(),this.menu?.dispose()}};Kbe=D([_(2,pn),_(3,we),_(4,Oa),_(5,Le)],Kbe);class qZe extends tt{constructor(e){super({id:"editor.action.dirtydiff.previous",label:g(6338,"Show Previous Change"),alias:"Show Previous Change",precondition:Iae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??Y6(e);if(!t)return;const i=nC.get(t);i&&i.canNavigate()&&i.previous()}}Me(qZe);class QZe extends tt{constructor(e){super({id:"editor.action.dirtydiff.next",label:g(6339,"Show Next Change"),alias:"Show Next Change",precondition:Iae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F3,weight:Ae.EditorContrib}}),this.outerEditor=e}run(e){const t=this.outerEditor??Y6(e);if(!t)return;const i=nC.get(t);i&&i.canNavigate()&&i.next()}}Me(QZe);jn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.next",title:g(6340,"Next &&Change")},order:1});jn.appendMenuItem(_e.MenubarGoMenu,{group:"7_change_nav",command:{id:"editor.action.dirtydiff.previous",title:g(6341,"Previous &&Change")},order:2});class kFt extends tt{constructor(){super({id:"workbench.action.editor.previousChange",label:g(6342,"Go to Previous Change"),alias:"Go to Previous Change",precondition:Iae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=Y6(e),i=e.get(rv),n=e.get(mr),o=e.get(Kt);if(!t||!t.hasModel())return;const r=nC.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 YZe(d.change,i),jZe(d.change,t,n,o)}}Me(kFt);class IFt extends tt{constructor(){super({id:"workbench.action.editor.nextChange",label:g(6343,"Go to Next Change"),alias:"Go to Next Change",precondition:Iae.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Alt|S.F5,weight:Ae.EditorContrib}})}async run(e){const t=e.get(rv),i=Y6(e),n=e.get(mr),o=e.get(Kt);if(!i||!i.hasModel())return;const r=nC.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 YZe(d,t),jZe(d,i,n,o)}}function jZe(s,e,t,i){const n=new oe(s.modifiedStartLineNumber,1);e.setPosition(n),e.revealPositionInCenter(n),t.isScreenReaderOptimized()&&(e.setSelection({startLineNumber:s.modifiedStartLineNumber,startColumn:0,endLineNumber:s.modifiedStartLineNumber,endColumn:Number.MAX_VALUE}),i.getActiveCodeEditor()?.writeScreenReaderContent("diff-navigation"))}async function YZe(s,e){switch(IMe(s)){case ap.Add:e.playSignal(al.diffLineInserted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case ap.Delete:e.playSignal(al.diffLineDeleted,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break;case ap.Modify:e.playSignal(al.diffLineModified,{allowManyInParallel:!0,source:"dirtyDiffDecoration"});break}}Me(IFt);So.registerCommandAndKeybindingRule({id:"closeDirtyDiff",weight:Ae.EditorContrib+50,primary:S.Escape,secondary:[U.Shift|S.Escape],when:he.and(KZe),handler:s=>{const e=Y6(s);if(!e)return;const t=nC.get(e);t&&t.close()}});var OL;let nC=(OL=class extends V{static get(e){return e.getContribution($be.ID)}constructor(e,t,i,n){if(super(),this.editor=e,this.configurationService=i,this.instantiationService=n,this.modelRegistry=null,this.model=null,this.widget=null,this.session=V.None,this.mouseDownInfo=null,this.enabled=!1,this.gutterActionDisposables=new Z,this.enabled=!t.getContextKeyValue("isInDiffEditor"),this.stylesheet=ul(void 0,void 0,this._store),this.enabled){this.isDirtyDiffVisible=KZe.bindTo(t),this._register(e.onDidChangeModel(()=>this.close()));const o=M.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; } @@ -733,7 +733,7 @@ Its package.json#enabledApiProposals-property declares: ${s.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,n=i.findIndex(o=>o===this.widget.index);t=i[JFe(n+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,n=i.findIndex(o=>o===this.widget.index);t=i[JFe(n-1,i.length)]}this.widget.showChange(t)}close(){this.session.dispose(),this.session=V.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(Xbe,this.editor,t),this.isDirtyDiffVisible.set(!0);const i=new Z;return i.add(M.once(this.widget.onDidClose)(this.close,this)),M.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!==Rt.GUTTER_LINE_DECORATIONS||!e.target.element||e.target.element.className.indexOf("dirty-diff-glyph")<0)return;const i=e.target.detail,n=e.target.element.offsetLeft,o=i.offsetX-n;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!==Rt.GUTTER_LINE_DECORATIONS||!this.modelRegistry)return;const n=this.editor.getModel();if(!n)return;const o=this.modelRegistry.getModel(n,this.editor);if(!o)return;const r=o.changes.findIndex(a=>OFt(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()}},Ybe=UL,UL.ID="editor.contrib.dirtydiff",UL);rC=Ybe=D([_(1,Le),_(2,Te),_(3,we)],rC);const VMe=W("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(6344,"Editor gutter background color for lines that are modified.")),zMe=W("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(6345,"Editor gutter background color for lines that are added.")),$Me=W("editorGutter.deletedBackground",TN,g(6346,"Editor gutter background color for lines that are deleted.")),SUe=W("minimapGutter.modifiedBackground",VMe,g(6347,"Minimap gutter background color for lines that are modified.")),AUe=W("minimapGutter.addedBackground",zMe,g(6348,"Minimap gutter background color for lines that are added.")),UFt=W("minimapGutter.deletedBackground",$Me,g(6349,"Minimap gutter background color for lines that are deleted.")),EUe=W("editorOverviewRuler.modifiedForeground",st(VMe,.6),g(6350,"Overview ruler marker color for modified content.")),xUe=W("editorOverviewRuler.addedForeground",st(zMe,.6),g(6351,"Overview ruler marker color for added content.")),VFt=W("editorOverviewRuler.deletedForeground",st($Me,.6),g(6352,"Overview ruler marker color for deleted content."));let Zbe=d0=class extends V{static createDecoration(e,t,i){const n={description:"dirty-diff-decoration",isWholeLine:i.isWholeLine};return i.gutter&&(n.linesDecorationsClassName=`dirty-diff-glyph ${e}`,n.linesDecorationsTooltip=t),i.overview.active&&(n.overviewRuler={color:$o(i.overview.color),position:kl.Left}),i.minimap.active&&(n.minimap={color:$o(i.minimap.color),position:Th.Gutter}),Gt.createDynamic(n)}constructor(e,t,i,n){super(),this.codeEditor=t,this.model=i,this.configurationService=n,this.editorModel=e;const o=n.getValue("scm.diffDecorations"),r=o==="all"||o==="gutter",a=o==="all"||o==="overview",c=o==="all"||o==="minimap",l=g(6353,"Added lines");this.addedOptions=d0.createDecoration("dirty-diff-added",l,{gutter:r,overview:{active:a,color:xUe},minimap:{active:c,color:AUe},isWholeLine:!0}),this.addedPatternOptions=d0.createDecoration("dirty-diff-added-pattern",l,{gutter:r,overview:{active:a,color:xUe},minimap:{active:c,color:AUe},isWholeLine:!0});const d=g(6354,"Changed lines");this.modifiedOptions=d0.createDecoration("dirty-diff-modified",d,{gutter:r,overview:{active:a,color:EUe},minimap:{active:c,color:SUe},isWholeLine:!0}),this.modifiedPatternOptions=d0.createDecoration("dirty-diff-modified-pattern",d,{gutter:r,overview:{active:a,color:EUe},minimap:{active:c,color:SUe},isWholeLine:!0}),this.deletedOptions=d0.createDecoration("dirty-diff-deleted",g(6355,"Removed lines"),{gutter:r,overview:{active:a,color:VFt},minimap:{active:c,color:UFt},isWholeLine:!1}),this._register(n.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 n=i.change,o=UMe(n),r=n.modifiedStartLineNumber,a=n.modifiedEndLineNumber||r;switch(o){case dp.Add:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case dp.Delete:return{range:{startLineNumber:r,startColumn:Number.MAX_VALUE,endLineNumber:r,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case dp.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}};Zbe=d0=D([_(3,Te)],Zbe);function DUe(s,e){let t=s.modifiedStartLineNumber-e.modifiedStartLineNumber;return t!==0||(t=s.modifiedEndLineNumber-e.modifiedEndLineNumber,t!==0)||(t=s.originalStartLineNumber-e.originalStartLineNumber,t!==0)?t:s.originalEndLineNumber-e.originalEndLineNumber}async function zFt(s,e,t,i){const n=await s.getQuickDiffs(e,t,i);return n.length>0?n[0].originalResource:null}let ewe=class extends V{get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,n,o,r,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=n,this.configurationService=o,this.textModelResolverService=r,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new Y7(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(M.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=M.any(e.provider.onDidChange,e.provider.onDidChangeResources);t.add(i(this.triggerDiff,this));const n=M.filter(this.scmService.onDidRemoveRepository,o=>o===e);t.add(n(()=>bt(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=>vt(e)):Promise.resolve(null)}setChanges(e,t){const i=F1e(this._changes,e,(n,o)=>DUe(n.change,o.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:ud.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"),n=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,n);if(l)for(const d of l)d&&o.push({change:d,label:c.label,uri:c.originalResource})}const r=o.sort((c,l)=>DUe(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):is(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),RFt(i.object)){const n=this._model.getEncoding();n&&i.object.setEncoding(n,Z3.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?Ly(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let n;!i&&t&&(n=this.quickDiffs.find(r=>r.isSCM)?.label);const o=[];for(let r=0;r=e)if(n&&a.label!==n)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 n=this.changes.length-1;n>=0;n--){if(i&&this.changes[n].label!==i)continue;const o=this.changes[n].change;if(t){if(o.modifiedStartLineNumber<=e)return n}else if(Jbe(o)bt(e)),this.repositoryDisposables.clear()}};ewe=D([_(1,tMe),_(2,M6),_(3,Ml),_(4,Te),_(5,fn),_(6,cg)],ewe);class $Ft{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let kUe=class extends V{constructor(e,t,i,n){super(),this.editorService=e,this.instantiationService=t,this.configurationService=i,this.textFileService=n,this.enabled=!1,this.viewState={width:3,visibility:"always"},this.items=new ui,this.transientDisposables=this._register(new Z),this.stylesheet=gl(void 0,void 0,this._store);const o=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(o(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const r=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(r(this.onDidChangeDiffWidthConfiguration,this)),this.onDidChangeDiffWidthConfiguration();const a=M.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,n=i.findIndex(o=>o===this.widget.index);t=i[WFe(n+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,n=i.findIndex(o=>o===this.widget.index);t=i[WFe(n-1,i.length)]}this.widget.showChange(t)}close(){this.session.dispose(),this.session=V.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(Kbe,this.editor,t),this.isDirtyDiffVisible.set(!0);const i=new Z;return i.add(M.once(this.widget.onDidClose)(this.close,this)),M.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!==Rt.GUTTER_LINE_DECORATIONS||!e.target.element||e.target.element.className.indexOf("dirty-diff-glyph")<0)return;const i=e.target.detail,n=e.target.element.offsetLeft,o=i.offsetX-n;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!==Rt.GUTTER_LINE_DECORATIONS||!this.modelRegistry)return;const n=this.editor.getModel();if(!n)return;const o=this.modelRegistry.getModel(n,this.editor);if(!o)return;const r=o.changes.findIndex(a=>xFt(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()}},$be=OL,OL.ID="editor.contrib.dirtydiff",OL);nC=$be=D([_(1,Le),_(2,Te),_(3,we)],nC);const TMe=W("editorGutter.modifiedBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#2090D3"},g(6344,"Editor gutter background color for lines that are modified.")),LMe=W("editorGutter.addedBackground",{dark:"#487E02",light:"#48985D",hcDark:"#487E02",hcLight:"#48985D"},g(6345,"Editor gutter background color for lines that are added.")),RMe=W("editorGutter.deletedBackground",xN,g(6346,"Editor gutter background color for lines that are deleted.")),hUe=W("minimapGutter.modifiedBackground",TMe,g(6347,"Minimap gutter background color for lines that are modified.")),uUe=W("minimapGutter.addedBackground",LMe,g(6348,"Minimap gutter background color for lines that are added.")),TFt=W("minimapGutter.deletedBackground",RMe,g(6349,"Minimap gutter background color for lines that are deleted.")),gUe=W("editorOverviewRuler.modifiedForeground",st(TMe,.6),g(6350,"Overview ruler marker color for modified content.")),fUe=W("editorOverviewRuler.addedForeground",st(LMe,.6),g(6351,"Overview ruler marker color for added content.")),LFt=W("editorOverviewRuler.deletedForeground",st(RMe,.6),g(6352,"Overview ruler marker color for deleted content."));let qbe=a0=class extends V{static createDecoration(e,t,i){const n={description:"dirty-diff-decoration",isWholeLine:i.isWholeLine};return i.gutter&&(n.linesDecorationsClassName=`dirty-diff-glyph ${e}`,n.linesDecorationsTooltip=t),i.overview.active&&(n.overviewRuler={color:$o(i.overview.color),position:Dl.Left}),i.minimap.active&&(n.minimap={color:$o(i.minimap.color),position:kh.Gutter}),Gt.createDynamic(n)}constructor(e,t,i,n){super(),this.codeEditor=t,this.model=i,this.configurationService=n,this.editorModel=e;const o=n.getValue("scm.diffDecorations"),r=o==="all"||o==="gutter",a=o==="all"||o==="overview",c=o==="all"||o==="minimap",l=g(6353,"Added lines");this.addedOptions=a0.createDecoration("dirty-diff-added",l,{gutter:r,overview:{active:a,color:fUe},minimap:{active:c,color:uUe},isWholeLine:!0}),this.addedPatternOptions=a0.createDecoration("dirty-diff-added-pattern",l,{gutter:r,overview:{active:a,color:fUe},minimap:{active:c,color:uUe},isWholeLine:!0});const d=g(6354,"Changed lines");this.modifiedOptions=a0.createDecoration("dirty-diff-modified",d,{gutter:r,overview:{active:a,color:gUe},minimap:{active:c,color:hUe},isWholeLine:!0}),this.modifiedPatternOptions=a0.createDecoration("dirty-diff-modified-pattern",d,{gutter:r,overview:{active:a,color:gUe},minimap:{active:c,color:hUe},isWholeLine:!0}),this.deletedOptions=a0.createDecoration("dirty-diff-deleted",g(6355,"Removed lines"),{gutter:r,overview:{active:a,color:LFt},minimap:{active:c,color:TFt},isWholeLine:!1}),this._register(n.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 n=i.change,o=IMe(n),r=n.modifiedStartLineNumber,a=n.modifiedEndLineNumber||r;switch(o){case ap.Add:return{range:{startLineNumber:r,startColumn:1,endLineNumber:a,endColumn:1},options:e.added?this.addedPatternOptions:this.addedOptions};case ap.Delete:return{range:{startLineNumber:r,startColumn:Number.MAX_VALUE,endLineNumber:r,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case ap.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}};qbe=a0=D([_(3,Te)],qbe);function pUe(s,e){let t=s.modifiedStartLineNumber-e.modifiedStartLineNumber;return t!==0||(t=s.modifiedEndLineNumber-e.modifiedEndLineNumber,t!==0)||(t=s.originalStartLineNumber-e.originalStartLineNumber,t!==0)?t:s.originalEndLineNumber-e.originalEndLineNumber}async function RFt(s,e,t,i){const n=await s.getQuickDiffs(e,t,i);return n.length>0?n[0].originalResource:null}let Qbe=class extends V{get original(){return this._originalTextModels}get changes(){return this._changes}get mapChanges(){return this._mapChanges}constructor(e,t,i,n,o,r,a){super(),this.scmService=t,this.quickDiffService=i,this.editorWorkerService=n,this.configurationService=o,this.textModelResolverService=r,this.progressService=a,this._quickDiffs=[],this._originalModels=new Map,this._originalTextModels=[],this.diffDelayer=new K7(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(M.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=M.any(e.provider.onDidChange,e.provider.onDidChangeResources);t.add(i(this.triggerDiff,this));const n=M.filter(this.scmService.onDidRemoveRepository,o=>o===e);t.add(n(()=>bt(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=>vt(e)):Promise.resolve(null)}setChanges(e,t){const i=A1e(this._changes,e,(n,o)=>pUe(n.change,o.change));this._changes=e,this._mapChanges=t,this._onDidChange.fire({changes:e,diff:i})}diff(){return this.progressService.withProgress({location:dd.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"),n=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,n);if(l)for(const d of l)d&&o.push({change:d,label:c.label,uri:c.originalResource})}const r=o.sort((c,l)=>pUe(c.change,l.change)),a=new Map;for(let c=0;cthis._disposed?[]:e.length===0?(this._quickDiffs=[],this._originalModels.clear(),this._originalTextModels=[],[]):is(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),yFt(i.object)){const n=this._model.getEncoding();n&&i.object.setEncoding(n,Y3.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?ky(this._model.textEditorModel):void 0)}findNextClosestChange(e,t=!0,i){let n;!i&&t&&(n=this.quickDiffs.find(r=>r.isSCM)?.label);const o=[];for(let r=0;r=e)if(n&&a.label!==n)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 n=this.changes.length-1;n>=0;n--){if(i&&this.changes[n].label!==i)continue;const o=this.changes[n].change;if(t){if(o.modifiedStartLineNumber<=e)return n}else if(Gbe(o)bt(e)),this.repositoryDisposables.clear()}};Qbe=D([_(1,zRe),_(2,I6),_(3,Rl),_(4,Te),_(5,fn),_(6,og)],Qbe);class MFt{constructor(e,t){this.model=e,this.decorator=t}dispose(){this.decorator.dispose(),this.model.dispose()}}let mUe=class extends V{constructor(e,t,i,n){super(),this.editorService=e,this.instantiationService=t,this.configurationService=i,this.textFileService=n,this.enabled=!1,this.viewState={width:3,visibility:"always"},this.items=new ui,this.transientDisposables=this._register(new Z),this.stylesheet=ul(void 0,void 0,this._store);const o=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorations"));this._register(o(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration();const r=M.filter(i.onDidChangeConfiguration,c=>c.affectsConfiguration("scm.diffDecorationsGutterWidth"));this._register(r(this.onDidChangeDiffWidthConfiguration,this)),this.onDidChangeDiffWidthConfiguration();const a=M.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; @@ -751,70 +751,70 @@ Its package.json#enabledApiProposals-property declares: ${s.enabledApiProposals? .monaco-editor .dirty-diff-deleted { opacity: ${e.visibility==="always"?1:0}; } - `}enable(){this.enabled&&this.disable(),this.transientDisposables.add(M.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)bt(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(Qr(e)){const t=e.getModel(),i=rC.get(e);if(i&&(i.modelRegistry=this),t&&(!this.items.has(t.uri)||!this.items.get(t.uri).has(e.getId()))){const n=this.textFileService.files.get(t.uri);if(n?.isResolved()){const o=this.instantiationService.createInstance(ewe,n),r=new Zbe(n.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 $Ft(o,r))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(n=>Qr(n)&&n.getModel()?.uri.toString()===e.toString()&&n.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()}};kUe=D([_(0,ei),_(1,we),_(2,Te),_(3,Fo)],kUe);on(rC.ID,rC,ri.AfterFirstRender);Re(class extends tt{constructor(){super({id:"editor.action.formatChanges",label:g(4522,"Format Modified Lines"),alias:"Format Modified Lines",precondition:he.and(J.writable,J.hasDocumentSelectionFormattingProvider)})}async run(e,t){const i=e.get(we);if(!t.hasModel())return;const n=await i.invokeFunction(oet,t.getModel());if(eo(n))return i.invokeFunction(Rae,t,n,om.Explicit,lu.None,He.None,!0)}});async function oet(s,e){const t=s.get(M6),i=s.get(Ml),n=s.get(fn),o=await zFt(t,e.uri,e.getLanguageId(),Ly(e));if(!o)return null;const r=[],a=await n.createModelReference(o);try{if(!i.canComputeDirtyDiff(o,e.uri))return;const c=await i.computeDirtyDiff(o,e.uri,!1);if(!eo(c))return;for(const l of c)r.push(e.validateRange(new F(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return r}let twe=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}),n=this.configurationService.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource});i&&this.doTrimTrailingWhitespace(e.textEditorModel,t.reason===Cn.AUTO,n)}doTrimTrailingWhitespace(e,t,i){let n=[],o=[];const r=gce(e,this.codeEditorService);if(r&&(n=r.getSelections(),t)){o=n.map(l=>l.getPosition());const c=fc.get(r)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)o.push(new oe(l,e.getLineMaxColumn(l)))}const a=ZZe(e,o,i);a.length&&e.pushEditOperations(n,a,c=>n)}};twe=D([_(0,Te),_(1,Kt)],twe);function gce(s,e){let t=null;if(s.isAttachedToEditor()){for(const i of e.listCodeEditors())if(i.hasModel()&&i.getModel()===s){if(i.hasTextFocus())return i;t=i}}return t}let iwe=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),n=T_(i)===-1;if(!t||n)return;const o=[Zn.insert(new oe(t,e.getLineMaxColumn(t)),e.getEOL())],r=gce(e,this.codeEditorService);r?r.executeEdits("insertFinalNewLine",o,r.getSelections()):e.pushEditOperations([],o,()=>null)}};iwe=D([_(0,Te),_(1,Kt)],iwe);let nwe=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===Cn.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 n=[],o=0;const r=gce(e,this.codeEditorService);if(r&&(n=r.getSelections(),t))for(let d=0,h=n.length;do&&(o=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,o+1),l=e.validateRange(new F(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(n,[Zn.delete(l)],d=>n),r?.setSelections(n))}};nwe=D([_(0,Te),_(1,Kt)],nwe);let swe=class{constructor(e,t,i){this.configurationService=e,this.codeEditorService=t,this.instantiationService=i}async participate(e,t,i,n){if(!e.textEditorModel||t.reason===Cn.AUTO)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=new lu(h=>{i.report({message:g(724,"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=gce(o,this.codeEditorService)||o,d=this.configurationService.getValue("editor.formatOnSaveMode",r);if(d==="file")await this.instantiationService.invokeFunction(Ave,l,om.Silent,a,n);else{const h=await this.instantiationService.invokeFunction(oet,Qr(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction(Ave,l,om.Silent,a,n):h&&await this.instantiationService.invokeFunction(Rae,l,h,om.Silent,a,n,!1)}}};swe=D([_(0,Te),_(1,Kt),_(2,we)],swe);let owe=class extends V{constructor(e,t,i,n,o,r){super(),this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i,this.hostService=n,this.editorService=o,this.codeEditorService=r,this._register(this.hostService.onDidChangeFocus(()=>{this.triggerCodeActionsCommand()})),this._register(this.editorService.onDidActiveEditorChange(()=>{this.triggerCodeActionsCommand()}))}async triggerCodeActionsCommand(){if(this.configurationService.getValue("editor.codeActions.triggerOnFocusChange")&&this.configurationService.getValue("files.autoSave")==="afterDelay"){const e=this.codeEditorService.getActiveCodeEditor()?.getModel();if(!e)return;const t={overrideIdentifier:e.getLanguageId(),resource:e.uri},i=this.configurationService.getValue("editor.codeActionsOnSave",t);if(!i||Array.isArray(i))return;const n=Object.keys(i).filter(a=>i[a]&&i[a]==="always"&&ys.Source.contains(new Yn(a))),o=new ci,r=[];for(const a of n)r.push(new Yn(a));await this.applyOnSaveActions(e,r,[],lu.None,o.token)}}async participate(e,t,i,n){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===Cn.AUTO||t.reason!==Cn.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)=>ys.SourceFixAll.contains(u)?ys.SourceFixAll.contains(f)?0:-1:ys.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 Yn(u));i.report({message:g(725,"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===Cn.EXPLICIT);await this.applyOnSaveActions(o,h,d,i,n)}createCodeActionsOnSave(e){const t=e.map(i=>new Yn(i));return t.filter(i=>t.every(n=>n.equals(i)||!n.contains(i)))}async applyOnSaveActions(e,t,i,n,o){const r=new class{constructor(){this._names=new Set}_report(){n.report({message:g(726,"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(n.report({message:g(727,"Applying code action '{0}'.",l.action.title)}),await this.instantiationService.invokeFunction(mZe,l,Nx.OnSave,{},o),o.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,n,o){return ZO(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:Ch.Auto,triggerAction:sg.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},n,o)}};owe=D([_(0,Te),_(1,we),_(2,it),_(3,xc),_(4,ei),_(5,Kt)],owe);let rwe=class extends V{constructor(e,t){super(),this.instantiationService=e,this.textFileService=t,this.registerSaveParticipants()}registerSaveParticipants(){this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(twe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(owe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(swe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(iwe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(nwe)))}};rwe=D([_(0,we),_(1,Fo)],rwe);const GFt=Qe.as(cf.Workbench);GFt.registerWorkbenchContribution(rwe,Rs.Restored);const Ose=class Ose extends li{constructor(){super({id:Ose.ID,title:{...Pe(728,"Toggle Minimap"),mnemonicTitle:g(729,"&&Minimap")},category:ca.View,f1:!0,toggled:he.equals("config.editor.minimap.enabled",!0),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:1}})}async run(e){const t=e.get(Te),i=!t.getValue("editor.minimap.enabled");return t.updateValue("editor.minimap.enabled",i)}};Ose.ID="editor.action.toggleMinimap";let awe=Ose;At(awe);const iO=class iO extends li{constructor(){super({id:iO.ID,title:Pe(730,"Toggle Multi-Cursor Modifier"),f1:!0})}run(e){const t=e.get(Te),n=t.getValue("editor").multiCursorModifier==="ctrlCmd"?"alt":"ctrlCmd";return t.updateValue(iO.multiCursorModifierConfigurationKey,n)}};iO.ID="workbench.action.toggleMultiCursorModifier",iO.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let e9=iO;const GMe=new Q("multiCursorModifier","altKey");let cwe=class extends V{constructor(e,t){super(),this.configurationService=e,this._multiCursorModifier=GMe.bindTo(t),this._update(),this._register(e.onDidChangeConfiguration(i=>{i.affectsConfiguration("editor.multiCursorModifier")&&this._update()}))}_update(){const t=this.configurationService.getValue("editor").multiCursorModifier==="ctrlCmd"?"ctrlCmd":"altKey";this._multiCursorModifier.set(t)}};cwe=D([_(0,Te),_(1,Le)],cwe);Qe.as(cf.Workbench).registerWorkbenchContribution(cwe,Rs.Restored);At(e9);jn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:e9.ID,title:g(731,"Switch to Alt+Click for Multi-Cursor")},when:GMe.isEqualTo("ctrlCmd"),order:1});jn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:e9.ID,title:Qt?g(732,"Switch to Cmd+Click for Multi-Cursor"):g(733,"Switch to Ctrl+Click for Multi-Cursor")},when:GMe.isEqualTo("altKey"),order:1});const Bse=class Bse extends li{constructor(){super({id:Bse.ID,title:{...Pe(734,"Toggle Control Characters"),mnemonicTitle:g(735,"Render &&Control Characters")},category:ca.View,f1:!0,toggled:he.equals("config.editor.renderControlCharacters",!0),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:5}})}run(e){const t=e.get(Te),i=!t.getValue("editor.renderControlCharacters");return t.updateValue("editor.renderControlCharacters",i)}};Bse.ID="editor.action.toggleRenderControlCharacter";let lwe=Bse;At(lwe);const ret="transientWordWrapState",KMe="isWordWrapMinified",qMe="isDominatedByLongLines",aet=new Q("canToggleWordWrap",!1,!0),cet=new Q("editorWordWrap",!1,g(736,"Whether the editor is currently using word wrapping."));function IX(s,e,t){t.setTransientModelProperty(s,ret,e)}function TX(s,e){return e.getTransientModelProperty(s,ret)}const fce="editor.action.toggleWordWrap";class KFt extends tt{constructor(){super({id:fce,label:g(737,"View: Toggle Word Wrap"),alias:"View: Toggle Word Wrap",precondition:void 0,kbOpts:{kbExpr:null,primary:U.Alt|S.KeyZ,weight:Ae.EditorContrib}})}run(e,t){const i=e.get(Kt);if(!xW(i,t))return;const n=t.getModel(),o=TX(n,i);let r;o?r=null:r={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},IX(n,r,i);const a=qFt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;xW(i,d)&&(IX(d.getModel(),r,i),a.updateOptions({}))}}}function qFt(s,e){if(!s.getOption(x.inDiffEditor))return null;for(const t of e.listDiffEditors()){const i=t.getOriginalEditor(),n=t.getModifiedEditor();if(i===s||n===s)return t}return null}var kB;let LX=(kB=class extends V{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(KMe,o.isWordWrapMinified),a=this._contextKeyService.createKey(qMe,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(!xW(this._codeEditorService,this._editor))return;const d=TX(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})}},kB.ID="editor.contrib.toggleWordWrapController",kB);LX=D([_(1,Le),_(2,Kt)],LX);var IB;let RX=(IB=class extends V{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=TX(e.getModel(),this._codeEditorService),n=TX(t.getModel(),this._codeEditorService);i&&!n&&xW(this._codeEditorService,e)&&(IX(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&n&&xW(this._codeEditorService,t)&&(IX(e.getModel(),n,this._codeEditorService),this._diffEditor.updateOptions({}))}},IB.ID="diffeditor.contrib.toggleWordWrapController",IB);RX=D([_(1,Kt)],RX);function xW(s,e){if(!e||e.isSimpleWidget||!e.getModel())return!1;if(e.getOption(x.inDiffEditor)){for(const i of s.listDiffEditors())if(i.getOriginalEditor()===e&&!i.renderSideBySide)return!1}return!0}var TB;let MX=(TB=class extends V{constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(M.runAndSubscribe(tm,({window:n,disposables:o})=>{o.add(ue(n,"focus",()=>this._update(),!0)),o.add(ue(n,"blur",()=>this._update(),!0))},{window:si,disposables:this._store})),this._register(this._editorService.onDidActiveEditorChange(()=>this._update())),this._canToggleWordWrap=aet.bindTo(this._contextService),this._editorWordWrap=cet.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(xW(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)}},TB.ID="workbench.contrib.editorWordWrapContextKeyTracker",TB);MX=D([_(0,ei),_(1,Kt),_(2,Le)],MX);Qu(MX.ID,MX,yc.AfterRestored);on(LX.ID,LX,ri.Eager);nKe(RX.ID,RX);Re(KFt);jn.appendMenuItem(_e.EditorTitle,{command:{id:fce,title:g(738,"Disable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(he.has(qMe),he.has(KMe))});jn.appendMenuItem(_e.EditorTitle,{command:{id:fce,title:g(739,"Enable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(J.inDiffEditor.negate(),he.has(qMe),he.not(KMe))});jn.appendMenuItem(_e.MenubarViewMenu,{command:{id:fce,title:g(740,"&&Word Wrap"),toggled:cet,precondition:aet},order:1,group:"5_editor"});const Wse=class Wse extends li{constructor(){super({id:Wse.ID,title:{...Pe(741,"Toggle Render Whitespace"),mnemonicTitle:g(742,"&&Render Whitespace")},category:ca.View,f1:!0,toggled:he.notEquals("config.editor.renderWhitespace","none"),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:4}})}run(e){const t=e.get(Te),i=t.getValue("editor.renderWhitespace");let n;return i==="none"?n="all":n="none",t.updateValue("editor.renderWhitespace",n)}};Wse.ID="editor.action.toggleRenderWhitespace";let dwe=Wse;At(dwe);class QFt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}Qe.add("gutterActionsRegistry",new QFt);const jFt=Qe.as("gutterActionsRegistry");var LB;let NX=(LB=class extends V{constructor(e,t,i,n,o){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=n,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&&!(Qt&&e.event.leftButton&&e.event.ctrlKey)&&!t||e.target.type!==Rt.GUTTER_LINE_NUMBERS&&e.target.type!==Rt.GUTTER_GLYPH_MARGIN||!e.target.position||!i)return;const n=e.target.position.lineNumber,o=this.contextKeyService.createOverlay([["editorLineNumber",n]]),r=this.menuService.createMenu(_e.EditorLineNumberContext,o),a=[];this.instantiationService.invokeFunction(c=>{for(const d of jFt.getGutterActionsGenerators()){const h=new Map;d({lineNumber:n,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:n,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Rt.GUTTER_LINE_NUMBERS){const d=this.editor.getSelections(),h={startLineNumber:n,endLineNumber:n,startColumn:1,endColumn:i.getLineLength(n)+1};d?.some(f=>!f.isEmpty()&&f.intersectRanges(h)!==null)||this.editor.setSelection(h,Db.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Ar.join(...a.map(d=>d[1])),onHide:()=>r.dispose()})})}},LB.ID="workbench.contrib.editorLineNumberContextMenu",LB);NX=D([_(1,lr),_(2,Oa),_(3,Le),_(4,we)],NX);on(NX.ID,NX,ri.AfterFirstRender);var bu,ty;let Cy=(ty=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=n,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(gW.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(bu.configName)&&this._updateStatus())),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered();let e=[...this._extensionService.extensions];e=e.sort((t,i)=>{const n=t.categories?.find(r=>r==="Formatters"||r==="Programming Languages"),o=i.categories?.find(r=>r==="Formatters"||r==="Programming Languages");return n&&!o?-1:!n&&o?1:t.name.localeCompare(i.name)}),bu.extensionIds.length=0,bu.extensionItemLabels.length=0,bu.extensionDescriptions.length=0,bu.extensionIds.push(null),bu.extensionItemLabels.push(g(4529,"None")),bu.extensionDescriptions.push(g(4530,"None"));for(const t of e)(t.main||t.browser)&&(bu.extensionIds.push(t.identifier.value),bu.extensionItemLabels.push(t.displayName??""),bu.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const n=this._configService.getValue(bu.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(n){const a=t.find(l=>Sn.equals(l.extensionId,n));if(a)return a;const c=await this._extensionService.getExtension(n);if(c&&this._extensionEnablementService.isEnabled(ice(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===uW.File?g(4531,"Extension '{0}' is configured as formatter but it cannot format '{1}'-files",c.displayName||c.name,l):g(4532,"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 n?g(4534,"Extension '{0}' is configured as formatter but not available. Select a different default formatter to continue.",n):g(4533,"There are multiple formatters for '{0}' files. One of them should be configured as default formatter.",bu._maybeQuotes(o))}async _selectFormatter(e,t,i,n){const o=await this._analyzeFormatter(n,e,t);if(typeof o!="string")return o;if(i!==om.Silent){const{confirmed:r}=await this._dialogService.confirm({message:g(4535,"Configure Default Formatter"),detail:o,primaryButton:g(4536,"&&Configure...")});if(r)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(Xe.Info,o,[{label:g(4537,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:K2.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})),n=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),o=await this._quickInputService.pick(i,{placeHolder:g(4538,"Select a default formatter for '{0}' files",bu._maybeQuotes(n))});if(!(!o||!e[o.index].extensionId))return this._configService.updateValue(bu.configName,e[o.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[o.index]}_updateStatus(){this._languageStatusStore.clear();const e=s6(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Lae(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const n=new ci;this._languageStatusStore.add(Ee(()=>n.dispose(!0))),this._analyzeFormatter(uW.File,i,t).then(o=>{if(n.token.isCancellationRequested||typeof o!="string")return;const r={id:`formatter/configure/dfl/${ar()}`,title:g(4539,"Configure...")};this._languageStatusStore.add(_t.registerCommand(r.id,()=>this._pickAndPersistDefaultFormatter(i,t))),this._languageStatusStore.add(this._languageStatusService.addStatus({id:"formatter.conflict",name:g(4540,"Formatter Conflicts"),selector:{language:t.getLanguageId(),pattern:t.uri.fsPath},severity:Xe.Error,label:g(4541,"Formatting"),detail:o,busy:!1,source:"",command:r,accessibilityInfo:void 0}))})}},bu=ty,ty.configName="editor.defaultFormatter",ty.extensionIds=[],ty.extensionItemLabels=[],ty.extensionDescriptions=[],ty);Cy=bu=D([_(0,fs),_(1,Nl),_(2,Te),_(3,bi),_(4,to),_(5,In),_(6,xi),_(7,it),_(8,Yae),_(9,ei)],Cy);Qe.as(cf.Workbench).registerWorkbenchContribution(Cy,Rs.Restored);Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{[Cy.configName]:{description:g(4542,"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:Cy.extensionIds,enumItemLabels:Cy.extensionItemLabels,markdownEnumDescriptions:Cy.extensionDescriptions}}});function det(s,e,t,i){function n(o){return o.extensionId?Sn.toKey(o.extensionId):"unknown"}s.publicLog2("formatterpick",{mode:e,extensions:t.map(n),pick:i?n(i):"none"})}async function het(s,e,t){const i=s.get(In),n=s.get(Te),o=s.get(xi),r={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=n.getValue(Cy.configName,r);let c;const l=t.map((u,f)=>{const p=Sn.equals(u.extensionId,a),m={index:f,label:u.displayName||"",description:p?g(4543,"(default)"):void 0};return p&&(c=m),m}),d={label:g(4544,"Configure Default Formatter...")},h=await i.pick([...l,{type:"separator"},d],{placeHolder:g(4545,"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(4538,"Select a default formatter for '{0}' files",Cy._maybeQuotes(u))});f&&t[f.index].extensionId&&n.updateValue(Cy.configName,t[f.index].extensionId.value,r);return}else return h.index;else return}Re(class extends tt{constructor(){super({id:"editor.action.formatDocument.multiple",label:g(4546,"Format Document With..."),alias:"Format Document...",precondition:he.and(J.writable,J.hasMultipleDocumentFormattingProvider),contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t,i){if(!t.hasModel())return;const n=e.get(we),o=e.get(Yi),r=e.get(it),a=t.getModel(),c=Lae(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),l=await n.invokeFunction(het,a,c);typeof l=="number"&&await n.invokeFunction(YYe,c[l],t,om.Explicit,He.None),det(o,"document",c,typeof l=="number"&&c[l]||void 0)}});Re(class extends tt{constructor(){super({id:"editor.action.formatSelection.multiple",label:g(4547,"Format Selection With..."),alias:"Format Code...",precondition:he.and(he.and(J.writable),J.hasMultipleDocumentSelectionFormattingProvider),contextMenuOpts:{when:he.and(J.hasNonEmptySelection),group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(we),n=e.get(it),o=e.get(Yi),r=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new F(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)));const c=n.documentRangeFormattingEditProvider.ordered(r),l=await i.invokeFunction(het,r,c);typeof l=="number"&&await i.invokeFunction(jYe,c[l],t,a,He.None,!0),det(o,"range",c,typeof l=="number"&&c[l]||void 0)}});const GU="workbench.view.extensions";var Qo;(function(s){s[s.Installing=0]="Installing",s[s.Installed=1]="Installed",s[s.Uninstalling=2]="Uninstalling",s[s.Uninstalled=3]="Uninstalled"})(Qo||(Qo={}));var $m;(function(s){s.ReloadWindow="reloadWindow",s.RestartExtensions="restartExtensions",s.DownloadUpdate="downloadUpdate",s.ApplyUpdate="applyUpdate",s.QuitAndInstall="quitAndInstall"})($m||($m={}));var t9;(function(s){s.Readme="readme",s.Features="features",s.Changelog="changelog",s.Dependencies="dependencies",s.ExtensionPack="extensionPack"})(t9||(t9={}));const YFt="extensions.autoUpdate";let IUe=class extends V{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?Ra(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};IUe=D([_(1,Xo)],IUe);const JFt="workbench.extensions.action.toggleIgnoreExtension",XFt="workbench.extensions.action.installVSIX";new Q("hasOutdatedExtensions",!1);new Q("hasGallery",!1);const ZFt="_theme_",eOt="0_install",tOt="0_update";new _e("extensionsSearchActionsMenu");g(5291,"Views");const iOt=oi("default-view-icon",ve.window,g(5292,"Default view icon."));var eI;(function(s){s.ViewContainersRegistry="workbench.registry.view.containers",s.ViewsRegistry="workbench.registry.view"})(eI||(eI={}));var ir;(function(s){s[s.Sidebar=0]="Sidebar",s[s.Panel=1]="Panel",s[s.AuxiliaryBar=2]="AuxiliaryBar"})(ir||(ir={}));ir.Sidebar,ir.Panel,ir.AuxiliaryBar;function PX(s){switch(s){case ir.Sidebar:return"sidebar";case ir.Panel:return"panel";case ir.AuxiliaryBar:return"auxiliarybar"}}class nOt extends V{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 n=this.get(e.id);if(n)return n;const o=e;return o.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:o.openCommandActionDescriptor??{id:o.id},Cj(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),n=i?.indexOf(e);if(n!==-1){i?.splice(n,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)}}Qe.add(eI.ViewContainersRegistry,new nOt);var FX;(function(s){s.Open="2_open",s.Debug="4_debug",s.SCM="5_scm",s.More="9_more"})(FX||(FX={}));function sOt(s,e){const t=s.group??FX.More,i=e.group??FX.More;return t!==i?t.localeCompare(i):(s.order??5)-(e.order??5)}class oOt extends V{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 P7}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 n=this.removeViews(e,i);n.length&&(this.addViews(n,t),this._onDidChangeContainer.fire({views:n,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(n=>n.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(n=>n.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[n,o]of t)this._viewWelcomeContents.add(e,o),i.set(n,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(sOt)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const n of e){if(this.getView(n.id)!==null)throw new Error(g(5293,"A view with id '{0}' is already registered",n.id));i.push(n)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const n=[],o=[];for(const r of i)e.includes(r)?n.push(r):o.push(r);return n.length&&(o.length?this._views.set(t,o):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),n}}Qe.add(eI.ViewsRegistry,new oOt);var hwe;(function(s){s[s.Default=0]="Default",s[s.Expand=1]="Expand"})(hwe||(hwe={}));var TUe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(TUe||(TUe={}));class Xhe{constructor(e,t){this.resolved=!1,this._hasResolve=!1,gp(this,e),this._hasResolve=!!t,this.resolve=async i=>{if(t&&!this.resolved){const n=await t(i);n&&(this.tooltip=this.tooltip??n.tooltip,this.command=this.command??n.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 tw extends Error{constructor(e){super(g(5294,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return e.name==="NoTreeViewError"}}async function rOt(s,e){const t=await s.openPaneComposite(GU,ir.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Re(class extends tt{constructor(){super({id:"editor.action.formatDocument.none",label:g(4548,"Format Document"),alias:"Format Document",precondition:he.and(J.writable,J.hasDocumentFormattingProvider.toNegated()),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyF,linux:{primary:U.CtrlCmd|U.Shift|S.KeyI},weight:Ae.EditorContrib}})}async run(e,t){if(!t.hasModel())return;const i=e.get(vi),n=e.get(Tm),o=e.get(bi),r=e.get(to),a=e.get(it),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(4549,"This file cannot be formatted because it is too large"));else{const d=c.getLanguageId(),h=g(4550,"There is no formatter for '{0}' files installed.",d),{confirmed:u}=await r.confirm({message:h,primaryButton:g(4551,"&&Install Formatter...")});u&&rOt(n,`category:formatters ${d}`)}}});var wg,iy;let N1=(iy=class extends V{constructor(e,t){super(),this._extensionService=e,this._configurationService=t,this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(TA.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),wg.extensionIds.length=0,wg.extensionItemLabels.length=0,wg.extensionDescriptions.length=0,wg.extensionIds.push(null),wg.extensionItemLabels.push(g(743,"All")),wg.extensionDescriptions.push(g(744,"All active folding range providers"));const e=[],t=[];for(const n of this._extensionService.extensions)(n.main||n.browser)&&(n.categories?.find(o=>o==="Programming Languages")?e.push(n):t.push(n));const i=(n,o)=>n.name.localeCompare(o.name);for(const n of e.sort(i))wg.extensionIds.push(n.identifier.value),wg.extensionItemLabels.push(n.displayName??""),wg.extensionDescriptions.push(n.description??"");for(const n of t.sort(i))wg.extensionIds.push(n.identifier.value),wg.extensionItemLabels.push(n.displayName??""),wg.extensionDescriptions.push(n.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(wg.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(n=>n.id===i)}},wg=iy,iy.configName="editor.defaultFoldingRangeProvider",iy.extensionIds=[],iy.extensionItemLabels=[],iy.extensionDescriptions=[],iy);N1=wg=D([_(0,fs),_(1,Te)],N1);Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{[N1.configName]:{description:g(745,"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:N1.extensionIds,enumItemLabels:N1.extensionItemLabels,markdownEnumDescriptions:N1.extensionDescriptions}}});Qe.as(cf.Workbench).registerWorkbenchContribution(N1,Rs.Restored);var aOt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";ut(aOt,{});let i9=class extends V{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:(Ms(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={},n,o){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=re(e,fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Pr("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new ii(this.el,"click")),a=this._register(new ii(this.el,"keypress")),c=M.chain(a.event,h=>h.map(u=>new En(u)).filter(u=>u.keyCode===S.Enter)),l=this._register(new ii(this.el,uo.Tap)).event;this._register(fd.addTarget(this.el));const d=M.any(r.event,c,l);this._register(d(h=>{this.enabled&&(en.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.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};i9=D([_(3,ec),_(4,Ao)],i9);var lQ,QD;let zM=(QD=class{static get(e){return e.getContribution(lQ.ID)??void 0}constructor(e,t,i,n){this._editor=e,this._accessibilitySignalService=i,this._instaService=n,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(747,"Code with Inlay Hint Information")),this._ctxIsReading=lQ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Ms(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 ci;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const n=this._editor.getModel(),o=[];let r=0,a=!1;for(const c of t){const l=n.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(i9,d,{href:zZe(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(n.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),aa(this._ariaElement,...o),this._ariaElement.focus(),this._ctxIsReading.set(!0),this._sessionDispoosables.add(ue(this._ariaElement,"focusout",()=>{this._reset()}))}startInlayHintsReading(){if(!this._editor.hasModel())return;const e=this._editor.getPosition().lineNumber,t=SW.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(cl.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},lQ=QD,QD.IsReading=new Q("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(746,"Whether the current line and its inlay hints are currently focused")}),QD.ID="editor.contrib.InlayHintsAccessibility",QD);zM=lQ=D([_(1,Le),_(2,lv),_(3,we)],zM);At(class extends gf{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Pe(748,"Read Line With Inline Hints"),precondition:J.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){zM.get(t)?.startInlayHintsReading()}});At(class extends gf{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Pe(749,"Stop Inlay Hints Reading"),precondition:zM.IsReading,f1:!0,keybinding:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(e,t){zM.get(t)?.stopInlayHintsReading()}});on(zM.ID,zM,ri.Lazy);var Lv;(function(s){s.languages="languages",s.actions="actions",s.kind="kind",s.title="title",s.description="description"})(Lv||(Lv={}));const cOt=Object.freeze({type:"array",markdownDescription:g(4552,"Configure which editor to use for a resource."),items:{type:"object",required:[Lv.languages,Lv.actions],properties:{[Lv.languages]:{type:"array",description:g(4553,"Language modes that the code actions are enabled for."),items:{type:"string"}},[Lv.actions]:{type:"object",required:[Lv.kind,Lv.title],properties:{[Lv.kind]:{type:"string",markdownDescription:g(4554,"`CodeActionKind` of the contributed code action.")},[Lv.title]:{type:"string",description:g(4555,"Label for the code action used in the UI.")},[Lv.description]:{type:"string",description:g(4556,"Description of what the code action does.")}}}}}}),lOt={extensionPoint:"codeActions",deps:[wW],jsonSchema:cOt};class dOt extends V{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(),n=[g(4557,"Title"),g(4558,"Kind"),g(4559,"Description"),g(4560,"Languages")],o=i.sort((r,a)=>r.title.localeCompare(a.title)).map(r=>[r.title,new Mt().appendMarkdown(`\`${r.kind}\``),r.description??"",new Mt().appendMarkdown(`${r.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:n,rows:o},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(4561,"Code Actions"),access:{canToggle:!1},renderer:new wi(dOt)});var PE;(function(s){s.when="when",s.title="title",s.command="command"})(PE||(PE={}));const hOt=Object.freeze({type:"object",description:g(4562,"Contributed documentation."),properties:{refactoring:{type:"array",description:g(4563,"Contributed documentation for refactorings."),items:{type:"object",description:g(4564,"Contributed documentation for refactoring."),required:[PE.title,PE.when,PE.command],properties:{[PE.title]:{type:"string",description:g(4565,"Label for the documentation used in the UI.")},[PE.when]:{type:"string",description:g(4566,"When clause.")},[PE.command]:{type:"string",description:g(4567,"Command executed.")}}}}}}),uOt={extensionPoint:"documentation",deps:[wW],jsonSchema:hOt},LUe=s=>({type:"string",enum:["always","explicit","never",!0,!1],enumDescriptions:[g(4568,"Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes."),g(4569,"Triggers Code Actions only when explicitly saved"),g(4570,"Never triggers Code Actions on save"),g(4571,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(4572,'Never triggers Code Actions on save. This value will be deprecated in favor of "never".')],default:"explicit",description:s}),RUe=s=>({type:["string","boolean"],enum:["explicit","never",!0,!1],enumDescriptions:[g(4573,"Triggers Code Actions only when explicitly saved."),g(4574,"Never triggers Code Actions on save."),g(4575,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(4576,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "never".')],default:"explicit",description:s}),dQ={oneOf:[{type:"object",additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(4577,'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:at.LANGUAGE_OVERRIDABLE},uwe=Object.freeze({...Vb,properties:{"editor.codeActionsOnSave":dQ}}),hQ={oneOf:[{type:"object",additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(4578,'Run a series of Code Actions for a notebook on save. Code Actions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"notebook.source.organizeImports": "explicit"`'),type:"object",additionalProperties:{type:["string","boolean"],enum:["explicit","never",!0,!1]},default:{}},gOt=Object.freeze({...Vb,properties:{"notebook.codeActionsOnSave":hQ}});let gwe=class extends V{constructor(e,t,i){super(),this.languageFeatures=i,this._contributedCodeActions=[],this.settings=new Set,this._onDidChangeContributions=this._register(new I),i.codeActionProvider.onDidChange(()=>{this.updateSettingsFromCodeActionProviders(),this.updateConfigurationSchemaFromContribs()},2e3),e.setHandler(n=>{this._contributedCodeActions=n.flatMap(o=>o.value).filter(o=>Array.isArray(o.actions)),this.updateConfigurationSchema(this._contributedCodeActions),this._onDidChangeContributions.fire()}),t.registerSchemaContribution({getSchemaAdditions:()=>this.getSchemaAdditions(),onDidChange:this._onDidChangeContributions.event})}updateSettingsFromCodeActionProviders(){this.languageFeatures.codeActionProvider.allNoModel().forEach(t=>{t.providedCodeActionKinds&&t.providedCodeActionKinds.forEach(i=>{!this.settings.has(i)&&ys.Source.contains(new Yn(i))&&this.settings.add(i)})})}updateConfigurationSchema(e){const t={},i={};for(const[n,o]of this.getSourceActions(e))this.settings.add(n),t[n]=LUe(g(4579,"Controls whether '{0}' actions should be run on file save.",o.title)),i[n]=RUe(g(4579,"Controls whether '{0}' actions should be run on file save.",o.title));dQ.properties=t,hQ.properties=i,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(uwe)}updateConfigurationSchemaFromContribs(){const e={...dQ.properties},t={...hQ.properties};for(const i of this.settings)e[i]||(e[i]=LUe(g(4579,"Controls whether '{0}' actions should be run on file save.",i)),t[i]=RUe(g(4579,"Controls whether '{0}' actions should be run on file save.",i)));dQ.properties=e,hQ.properties=t,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(uwe)}getSourceActions(e){const t=new Map;for(const i of e)for(const n of i.actions){const o=new Yn(n.kind);ys.Source.contains(o)&&t.set(o.value,n)}return t}getSchemaAdditions(){const e=(i,n)=>({if:{required:["command"],properties:{command:{const:i}}},then:{properties:{args:{required:["kind"],properties:{kind:{anyOf:[{enum:n.map(o=>o.kind),enumDescriptions:n.map(o=>o.description??o.title)},{type:"string"}]}}}}}}),t=i=>{const n=this._contributedCodeActions.flatMap(r=>r.actions),o=new Map;for(const r of n)!o.has(r.kind)&&i.contains(new Yn(r.kind))&&o.set(r.kind,r);return Array.from(o.values())};return[e(DMe,t(Yn.Empty)),e(IMe,t(ys.Refactor)),e(TMe,t(ys.Source))]}};gwe=D([_(1,Ut),_(2,it)],gwe);let fwe=class extends V{constructor(e,t,i){super(),this.contextKeyService=t,this.contributions=[],this.emptyCodeActionsList={actions:[],dispose:()=>{}},this._register(i.codeActionProvider.register("*",this)),e.setHandler(n=>{this.contributions=[];for(const o of n)if(o.value.refactoring)for(const r of o.value.refactoring){const a=he.deserialize(r.when);a&&this.contributions.push({title:r.title,when:a,command:r.command})}})}async provideCodeActions(e,t,i,n){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==ys.Refactor.value&&!t.some(i=>i.kind&&ys.Refactor.contains(new Yn(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};fwe=D([_(1,Le),_(2,it)],fwe);const fOt=eh.registerExtensionPoint(lOt),pOt=eh.registerExtensionPoint(uOt);Qe.as(Nn.Configuration).registerConfiguration(uwe);Qe.as(Nn.Configuration).registerConfiguration(gOt);let pwe=class{constructor(e){e.createInstance(gwe,fOt),e.createInstance(fwe,pOt)}};pwe=D([_(0,we)],pwe);Qe.as(cf.Workbench).registerWorkbenchContribution(pwe,Rs.Eventually);var RB;let OX=(RB=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},RB.ID="workbench.contrib.listContext",RB);OX=D([_(0,Le)],OX);Qu(OX.ID,OX,yc.BlockStartup);var MB;let BX=(MB=class extends V{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=qPt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){vt(i)}}},MB.ID="workbench.contrib.editorFeaturesInstantiator",MB);BX=D([_(0,Kt),_(1,we)],BX);Qu(BX.ID,BX,yc.BlockRestore);let mwe=class extends V{constructor(e,t){super();const i=n=>e.activeContainer.classList.toggle("context-menu-visible",n);this._register(t.onDidShowContextMenu(()=>i(!0))),this._register(t.onDidHideContextMenu(()=>i(!1)))}};mwe=D([_(0,pu),_(1,lr)],mwe);Qe.as(cf.Workbench).registerWorkbenchContribution(mwe,Rs.Eventually);_t.registerCommand("_executeMappedEditsProvider",async(s,e,t,i)=>{const n=s.get(fn),o=s.get(it),r=await n.createModelReference(e);let a=null;try{const c=o.mappedEditsProvider.ordered(r.object.textEditorModel);if(c.length>0){const l=c[0],d=new ci;a=await l.provideMappedEdits(r.object.textEditorModel,t,i,d.token)}}finally{r.dispose()}return a});const kI=pu;var NB;let WX=(NB=class extends V{constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new ya(()=>this.createActions()),this.registerListeners()}createActions(){return[new rn("undo",g(750,"Undo"),void 0,!0,async()=>Hu().execCommand("undo")),new rn("redo",g(751,"Redo"),void 0,!0,async()=>Hu().execCommand("redo")),new Ar,new rn("editor.action.clipboardCutAction",g(752,"Cut"),void 0,!0,async()=>Hu().execCommand("cut")),new rn("editor.action.clipboardCopyAction",g(753,"Copy"),void 0,!0,async()=>Hu().execCommand("copy")),new rn("editor.action.clipboardPasteAction",g(754,"Paste"),void 0,!0,async e=>{if(ad)Hu().execCommand("paste");else{const t=await this.clipboardService.readText();if(Mdt(e)||Ndt(e)){const i=e.selectionStart||0,n=e.selectionEnd||0;e.value=`${e.value.substring(0,i)}${t}${e.value.substring(n,e.value.length)}`,e.selectionStart=i+t.length,e.selectionEnd=e.selectionStart,e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}}}),new Ar,new rn("editor.action.selectAll",g(755,"Select All"),void 0,!0,async()=>Hu().execCommand("selectAll"))]}registerListeners(){this._register(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(ue(e,"contextmenu",i=>this.onContextMenu(ct(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Yr(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;en.stop(t,!0);const n=new Eh(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>n,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},NB.ID="workbench.contrib.textInputActionsProvider",NB);WX=D([_(0,kI),_(1,lr),_(2,dg)],WX);Qu(WX.ID,WX,yc.BlockRestore);var mOt='.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}';ut(mOt,{});const _Ot="rendererLog",uet="workbench.action.showWindowLog";let Ef;const Zhe=globalThis.vscode;if(typeof Zhe<"u"&&typeof Zhe.context<"u"){const s=Zhe.context.configuration();if(s)Ef=s.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(Ef=globalThis._VSCODE_PRODUCT_JSON,D2.VSCODE_DEV&&Object.assign(Ef,{nameShort:`${Ef.nameShort} Dev`,nameLong:`${Ef.nameLong} Dev`,dataFolderName:`${Ef.dataFolderName}-dev`,serverDataFolderName:Ef.serverDataFolderName?`${Ef.serverDataFolderName}-dev`:void 0}),!Ef.version){const s=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Ef,{version:s.version})}}else Ef={},Object.keys(Ef).length===0&&Object.assign(Ef,{version:"1.91.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 vOt=Ef;class bOt extends li{constructor(){super({id:"workbench.action.inspectContextKeys",title:Pe(756,"Inspect Context Keys"),category:ca.Developer,f1:!0})}run(e){const t=e.get(Le),i=new Z,n=gl(void 0,void 0,i);Uf("*","cursor: crosshair !important;",n);const o=document.createElement("div"),r=Hu();r.body.appendChild(o),i.add(Ee(()=>o.remove())),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 ii(r,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=Cr(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 ii(r,"mousedown",!0));M.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new ii(r,"mouseup",!0));M.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),bt(i)},null,i)}}class bF extends li{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Pe(757,"Toggle Screencast Mode"),category:ca.Developer,f1:!0})}run(e){if(bF.disposable){bF.disposable.dispose(),bF.disposable=void 0;return}const t=e.get(pu),i=e.get(Te),n=e.get(Ut),o=new Z,r=t.activeContainer,a=re(r,fe(".screencast-mouse"));o.add(Ee(()=>a.remove()));const c=re(r,fe(".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,ne){ne.add(ne.add(new ii(j,"mousedown",!0)).event(ge=>l.fire(ge))),ne.add(ne.add(new ii(j,"mouseup",!0)).event(ge=>d.fire(ge))),ne.add(ne.add(new ii(j,"mousemove",!0)).event(ge=>h.fire(ge)))}for(const{window:j,disposables:ne}of D8())u(t.getContainer(j),ne);o.add(tm(({window:j,disposables:ne})=>u(t.getContainer(j),ne))),o.add(t.onDidChangeActiveContainer(()=>{t.activeContainer.appendChild(a),t.activeContainer.appendChild(c)}));const f=()=>{a.style.borderColor=me.fromHex(i.getValue("screencastMode.mouseIndicatorColor")).toString()};let p;const m=()=>{p=Ka(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 ne=h.event(ge=>{a.style.top=`${ge.clientY-p/2}px`,a.style.left=`${ge.clientX-p/2}px`,a.style.transform=`scale(${.8})`});M.once(d.event)(()=>{a.style.display="none",ne.dispose()})}));const v=()=>{c.style.fontSize=`${Ka(i.getValue("screencastMode.fontSize")||56,20,100)}px`},b=()=>{c.style.bottom=`${Ka(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let w;const y=()=>{w=Ka(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),b(),y(),o.add(i.onDidChangeConfiguration(j=>{j.affectsConfiguration("screencastMode.verticalOffset")&&b(),j.affectsConfiguration("screencastMode.fontSize")&&v(),j.affectsConfiguration("screencastMode.keyboardOverlayTimeout")&&y(),j.affectsConfiguration("screencastMode.mouseIndicatorColor")&&f(),j.affectsConfiguration("screencastMode.mouseIndicatorSize")&&m()}));const C=o.add(new I),A=o.add(new I),L=o.add(new I),k=o.add(new I);function P(j,ne){ne.add(ne.add(new ii(j,"keydown",!0)).event(ge=>C.fire(ge))),ne.add(ne.add(new ii(j,"compositionstart",!0)).event(ge=>A.fire(ge))),ne.add(ne.add(new ii(j,"compositionupdate",!0)).event(ge=>L.fire(ge))),ne.add(ne.add(new ii(j,"compositionend",!0)).event(ge=>k.fire(ge)))}for(const{window:j,disposables:ne}of D8())P(j,ne);o.add(tm(({window:j,disposables:ne})=>P(j,ne)));let R=0,z,G=!1;const Y=new cn(()=>{c.textContent="",z=void 0,R=0},w);o.add(A.event(j=>{G=!0})),o.add(L.event(j=>{j.data&&G?(R>20&&(c.innerText="",R=0),z=z??re(c,fe("span.key")),z.textContent=j.data):G&&(c.innerText="",re(c,fe("span.key",{},"Backspace"))),Y.schedule()})),o.add(k.event(j=>{z=void 0,R++})),o.add(C.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")?G=!0:(z=void 0,G=!1),Y.schedule();return}if(j.isComposing)return;const ne=i.getValue("screencastMode.keyboardOptions"),ge=new En(j),De=n.softDispatch(ge,ge.target);if(De.kind===nf.KbFound&&De.commandId&&!(ne.showSingleEditorCursorMoves??!0)&&["cursorLeft","cursorRight","cursorUp","cursorDown"].includes(De.commandId))return;(ge.ctrlKey||ge.altKey||ge.metaKey||ge.shiftKey||R>20||ge.keyCode===S.Backspace||ge.keyCode===S.Escape||ge.keyCode===S.UpArrow||ge.keyCode===S.DownArrow||ge.keyCode===S.LeftArrow||ge.keyCode===S.RightArrow)&&(c.innerText="",R=0);const Oe=n.resolveKeyboardEvent(ge),yt=this._isKbFound(De)&&De.commandId?this.getCommandDetails(De.commandId):void 0;let Ne=yt?.title,lt=Oe.getLabel();if(yt&&((ne.showCommandGroups??!1)&&yt.category&&(Ne=`${yt.category}: ${Ne} `),this._isKbFound(De)&&De.commandId)){const xt=n.lookupKeybindings(De.commandId).filter(Ji=>Ji.getLabel()?.endsWith(lt??""));xt.length>0&&(lt=xt[xt.length-1].getLabel())}(ne.showCommands??!0)&&Ne&&re(c,fe("span.title",{},`${Ne} `)),((ne.showKeys??!0)||(ne.showKeybindings??!0)&&this._isKbFound(De))&&(lt=lt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),re(c,fe("span.key",{},lt??""))),R++,Y.schedule()})),bF.disposable=o}_isKbFound(e){return e.kind===nf.KbFound}getCommandDetails(e){const t=jn.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=_t.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class wOt extends li{constructor(){super({id:"workbench.action.logStorage",title:Pe(758,"Log Storage Database Contents"),category:ca.Developer,f1:!0})}run(e){const t=e.get($i),i=e.get(to);t.log(),i.info(g(759,"The storage database contents have been logged to the developer tools."),g(760,"Open developer tools from the menu and select the Console tab."))}}class yOt extends li{constructor(){super({id:"workbench.action.logWorkingCopies",title:Pe(761,"Log Working Copies"),category:ca.Developer,f1:!0})}async run(e){const t=e.get(Rm),i=e.get(H6),n=e.get(Ge),o=e.get(Jae),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||""})`):[""]];n.info(a.join(` -`)),o.showChannel(_Ot,!0)}}const Hse=class Hse extends li{constructor(){super({id:"workbench.action.removeLargeStorageDatabaseEntries",title:Pe(762,"Remove Large Storage Database Entries..."),category:ca.Developer,f1:!0})}async run(e){const t=e.get($i),i=e.get(In),n=e.get(ug),o=e.get(to),r=e.get(Za),a=[];for(const h of[Ie.APPLICATION,Ie.PROFILE,Ie.WORKSPACE])if(!(h===Ie.PROFILE&&n.currentProfile.isDefault))for(const u of[an.MACHINE,an.USER])for(const f of t.keys(h,u)){const p=t.get(f,h);p&&(!r.isBuilt||p.length>Hse.SIZE_THRESHOLD)&&a.push({key:f,scope:h,target:u,size:p.length,label:f,description:Nc.formatSize(p.length),detail:g(763,"Scope: {0}, Target: {1}",h===Ie.APPLICATION?g(764,"Global"):h===Ie.PROFILE?g(765,"Profile"):g(766,"Workspace"),u===an.MACHINE?g(767,"Machine"):g(768,"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(769,"Remove"),f.placeholder=g(770,"Select large entries to remove from storage"),a.length===0&&(f.description=g(771,"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(772,"Do you want to remove the selected storage entries from the database?"),detail:g(773,`{0} + `}enable(){this.enabled&&this.disable(),this.transientDisposables.add(M.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)bt(e.values());this.items.clear(),this.enabled=!1}}onEditorsChanged(){for(const e of this.editorService.visibleTextEditorControls)if(Qr(e)){const t=e.getModel(),i=nC.get(e);if(i&&(i.modelRegistry=this),t&&(!this.items.has(t.uri)||!this.items.get(t.uri).has(e.getId()))){const n=this.textFileService.files.get(t.uri);if(n?.isResolved()){const o=this.instantiationService.createInstance(Qbe,n),r=new qbe(n.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 MFt(o,r))}}}for(const[e,t]of this.items)for(const i of t.keys())this.editorService.visibleTextEditorControls.find(n=>Qr(n)&&n.getModel()?.uri.toString()===e.toString()&&n.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()}};mUe=D([_(0,ei),_(1,we),_(2,Te),_(3,Fo)],mUe);on(nC.ID,nC,ri.AfterFirstRender);Me(class extends tt{constructor(){super({id:"editor.action.formatChanges",label:g(4522,"Format Modified Lines"),alias:"Format Modified Lines",precondition:he.and(J.writable,J.hasDocumentSelectionFormattingProvider)})}async run(e,t){const i=e.get(we);if(!t.hasModel())return;const n=await i.invokeFunction(JZe,t.getModel());if(eo(n))return i.invokeFunction(kae,t,n,im.Explicit,cu.None,He.None,!0)}});async function JZe(s,e){const t=s.get(I6),i=s.get(Rl),n=s.get(fn),o=await RFt(t,e.uri,e.getLanguageId(),ky(e));if(!o)return null;const r=[],a=await n.createModelReference(o);try{if(!i.canComputeDirtyDiff(o,e.uri))return;const c=await i.computeDirtyDiff(o,e.uri,!1);if(!eo(c))return;for(const l of c)r.push(e.validateRange(new F(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber||l.modifiedStartLineNumber,Number.MAX_SAFE_INTEGER)))}finally{a.dispose()}return r}let jbe=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}),n=this.configurationService.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:e.textEditorModel.getLanguageId(),resource:e.resource});i&&this.doTrimTrailingWhitespace(e.textEditorModel,t.reason===Cn.AUTO,n)}doTrimTrailingWhitespace(e,t,i){let n=[],o=[];const r=lce(e,this.codeEditorService);if(r&&(n=r.getSelections(),t)){o=n.map(l=>l.getPosition());const c=fc.get(r)?.getSessionEnclosingRange();if(c)for(let l=c.startLineNumber;l<=c.endLineNumber;l++)o.push(new oe(l,e.getLineMaxColumn(l)))}const a=GZe(e,o,i);a.length&&e.pushEditOperations(n,a,c=>n)}};jbe=D([_(0,Te),_(1,Kt)],jbe);function lce(s,e){let t=null;if(s.isAttachedToEditor()){for(const i of e.listCodeEditors())if(i.hasModel()&&i.getModel()===s){if(i.hasTextFocus())return i;t=i}}return t}let Ybe=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),n=D_(i)===-1;if(!t||n)return;const o=[Zn.insert(new oe(t,e.getLineMaxColumn(t)),e.getEOL())],r=lce(e,this.codeEditorService);r?r.executeEdits("insertFinalNewLine",o,r.getSelections()):e.pushEditOperations([],o,()=>null)}};Ybe=D([_(0,Te),_(1,Kt)],Ybe);let Jbe=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===Cn.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 n=[],o=0;const r=lce(e,this.codeEditorService);if(r&&(n=r.getSelections(),t))for(let d=0,h=n.length;do&&(o=u)}const a=this.findLastNonEmptyLine(e),c=Math.max(a+1,o+1),l=e.validateRange(new F(c,1,i,e.getLineMaxColumn(i)));l.isEmpty()||(e.pushEditOperations(n,[Zn.delete(l)],d=>n),r?.setSelections(n))}};Jbe=D([_(0,Te),_(1,Kt)],Jbe);let Xbe=class{constructor(e,t,i){this.configurationService=e,this.codeEditorService=t,this.instantiationService=i}async participate(e,t,i,n){if(!e.textEditorModel||t.reason===Cn.AUTO)return;const o=e.textEditorModel,r={overrideIdentifier:o.getLanguageId(),resource:o.uri},a=new cu(h=>{i.report({message:g(724,"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=lce(o,this.codeEditorService)||o,d=this.configurationService.getValue("editor.formatOnSaveMode",r);if(d==="file")await this.instantiationService.invokeFunction(vve,l,im.Silent,a,n);else{const h=await this.instantiationService.invokeFunction(JZe,Qr(l)?l.getModel():l);h===null&&d==="modificationsIfAvailable"?await this.instantiationService.invokeFunction(vve,l,im.Silent,a,n):h&&await this.instantiationService.invokeFunction(kae,l,h,im.Silent,a,n,!1)}}};Xbe=D([_(0,Te),_(1,Kt),_(2,we)],Xbe);let Zbe=class extends V{constructor(e,t,i,n,o,r){super(),this.configurationService=e,this.instantiationService=t,this.languageFeaturesService=i,this.hostService=n,this.editorService=o,this.codeEditorService=r,this._register(this.hostService.onDidChangeFocus(()=>{this.triggerCodeActionsCommand()})),this._register(this.editorService.onDidActiveEditorChange(()=>{this.triggerCodeActionsCommand()}))}async triggerCodeActionsCommand(){if(this.configurationService.getValue("editor.codeActions.triggerOnFocusChange")&&this.configurationService.getValue("files.autoSave")==="afterDelay"){const e=this.codeEditorService.getActiveCodeEditor()?.getModel();if(!e)return;const t={overrideIdentifier:e.getLanguageId(),resource:e.uri},i=this.configurationService.getValue("editor.codeActionsOnSave",t);if(!i||Array.isArray(i))return;const n=Object.keys(i).filter(a=>i[a]&&i[a]==="always"&&ys.Source.contains(new Yn(a))),o=new ci,r=[];for(const a of n)r.push(new Yn(a));await this.applyOnSaveActions(e,r,[],cu.None,o.token)}}async participate(e,t,i,n){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===Cn.AUTO||t.reason!==Cn.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)=>ys.SourceFixAll.contains(u)?ys.SourceFixAll.contains(f)?0:-1:ys.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 Yn(u));i.report({message:g(725,"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===Cn.EXPLICIT);await this.applyOnSaveActions(o,h,d,i,n)}createCodeActionsOnSave(e){const t=e.map(i=>new Yn(i));return t.filter(i=>t.every(n=>n.equals(i)||!n.contains(i)))}async applyOnSaveActions(e,t,i,n,o){const r=new class{constructor(){this._names=new Set}_report(){n.report({message:g(726,"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(n.report({message:g(727,"Applying code action '{0}'.",l.action.title)}),await this.instantiationService.invokeFunction(cZe,l,Lx.OnSave,{},o),o.isCancellationRequested)return}catch{}finally{c.dispose()}}}getActionsToRun(e,t,i,n,o){return jO(this.languageFeaturesService.codeActionProvider,e,e.getFullModelRange(),{type:wh.Auto,triggerAction:tg.OnSave,filter:{include:t,excludes:i,includeSourceActions:!0}},n,o)}};Zbe=D([_(0,Te),_(1,we),_(2,it),_(3,xc),_(4,ei),_(5,Kt)],Zbe);let ewe=class extends V{constructor(e,t){super(),this.instantiationService=e,this.textFileService=t,this.registerSaveParticipants()}registerSaveParticipants(){this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(jbe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Zbe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Xbe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Ybe))),this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(Jbe)))}};ewe=D([_(0,we),_(1,Fo)],ewe);const NFt=Qe.as(of.Workbench);NFt.registerWorkbenchContribution(ewe,Rs.Restored);const Mse=class Mse extends li{constructor(){super({id:Mse.ID,title:{...Fe(728,"Toggle Minimap"),mnemonicTitle:g(729,"&&Minimap")},category:ca.View,f1:!0,toggled:he.equals("config.editor.minimap.enabled",!0),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:1}})}async run(e){const t=e.get(Te),i=!t.getValue("editor.minimap.enabled");return t.updateValue("editor.minimap.enabled",i)}};Mse.ID="editor.action.toggleMinimap";let twe=Mse;At(twe);const XF=class XF extends li{constructor(){super({id:XF.ID,title:Fe(730,"Toggle Multi-Cursor Modifier"),f1:!0})}run(e){const t=e.get(Te),n=t.getValue("editor").multiCursorModifier==="ctrlCmd"?"alt":"ctrlCmd";return t.updateValue(XF.multiCursorModifierConfigurationKey,n)}};XF.ID="workbench.action.toggleMultiCursorModifier",XF.multiCursorModifierConfigurationKey="editor.multiCursorModifier";let J3=XF;const MMe=new Y("multiCursorModifier","altKey");let iwe=class extends V{constructor(e,t){super(),this.configurationService=e,this._multiCursorModifier=MMe.bindTo(t),this._update(),this._register(e.onDidChangeConfiguration(i=>{i.affectsConfiguration("editor.multiCursorModifier")&&this._update()}))}_update(){const t=this.configurationService.getValue("editor").multiCursorModifier==="ctrlCmd"?"ctrlCmd":"altKey";this._multiCursorModifier.set(t)}};iwe=D([_(0,Te),_(1,Le)],iwe);Qe.as(of.Workbench).registerWorkbenchContribution(iwe,Rs.Restored);At(J3);jn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:J3.ID,title:g(731,"Switch to Alt+Click for Multi-Cursor")},when:MMe.isEqualTo("ctrlCmd"),order:1});jn.appendMenuItem(_e.MenubarSelectionMenu,{group:"4_config",command:{id:J3.ID,title:Qt?g(732,"Switch to Cmd+Click for Multi-Cursor"):g(733,"Switch to Ctrl+Click for Multi-Cursor")},when:MMe.isEqualTo("altKey"),order:1});const Nse=class Nse extends li{constructor(){super({id:Nse.ID,title:{...Fe(734,"Toggle Control Characters"),mnemonicTitle:g(735,"Render &&Control Characters")},category:ca.View,f1:!0,toggled:he.equals("config.editor.renderControlCharacters",!0),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:5}})}run(e){const t=e.get(Te),i=!t.getValue("editor.renderControlCharacters");return t.updateValue("editor.renderControlCharacters",i)}};Nse.ID="editor.action.toggleRenderControlCharacter";let nwe=Nse;At(nwe);const XZe="transientWordWrapState",NMe="isWordWrapMinified",PMe="isDominatedByLongLines",ZZe=new Y("canToggleWordWrap",!1,!0),eet=new Y("editorWordWrap",!1,g(736,"Whether the editor is currently using word wrapping."));function DX(s,e,t){t.setTransientModelProperty(s,XZe,e)}function kX(s,e){return e.getTransientModelProperty(s,XZe)}const dce="editor.action.toggleWordWrap";class PFt extends tt{constructor(){super({id:dce,label:g(737,"View: Toggle Word Wrap"),alias:"View: Toggle Word Wrap",precondition:void 0,kbOpts:{kbExpr:null,primary:U.Alt|S.KeyZ,weight:Ae.EditorContrib}})}run(e,t){const i=e.get(Kt);if(!CW(i,t))return;const n=t.getModel(),o=kX(n,i);let r;o?r=null:r={wordWrapOverride:t.getOption(x.wrappingInfo).wrappingColumn===-1?"on":"off"},DX(n,r,i);const a=FFt(t,i);if(a){const c=a.getOriginalEditor(),l=a.getModifiedEditor(),d=c===t?l:c;CW(i,d)&&(DX(d.getModel(),r,i),a.updateOptions({}))}}}function FFt(s,e){if(!s.getOption(x.inDiffEditor))return null;for(const t of e.listDiffEditors()){const i=t.getOriginalEditor(),n=t.getModifiedEditor();if(i===s||n===s)return t}return null}var AB;let IX=(AB=class extends V{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(NMe,o.isWordWrapMinified),a=this._contextKeyService.createKey(PMe,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(!CW(this._codeEditorService,this._editor))return;const d=kX(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})}},AB.ID="editor.contrib.toggleWordWrapController",AB);IX=D([_(1,Le),_(2,Kt)],IX);var EB;let TX=(EB=class extends V{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=kX(e.getModel(),this._codeEditorService),n=kX(t.getModel(),this._codeEditorService);i&&!n&&CW(this._codeEditorService,e)&&(DX(t.getModel(),i,this._codeEditorService),this._diffEditor.updateOptions({})),!i&&n&&CW(this._codeEditorService,t)&&(DX(e.getModel(),n,this._codeEditorService),this._diffEditor.updateOptions({}))}},EB.ID="diffeditor.contrib.toggleWordWrapController",EB);TX=D([_(1,Kt)],TX);function CW(s,e){if(!e||e.isSimpleWidget||!e.getModel())return!1;if(e.getOption(x.inDiffEditor)){for(const i of s.listDiffEditors())if(i.getOriginalEditor()===e&&!i.renderSideBySide)return!1}return!0}var xB;let LX=(xB=class extends V{constructor(e,t,i){super(),this._editorService=e,this._codeEditorService=t,this._contextService=i,this._register(M.runAndSubscribe(Xp,({window:n,disposables:o})=>{o.add(ue(n,"focus",()=>this._update(),!0)),o.add(ue(n,"blur",()=>this._update(),!0))},{window:si,disposables:this._store})),this._register(this._editorService.onDidActiveEditorChange(()=>this._update())),this._canToggleWordWrap=ZZe.bindTo(this._contextService),this._editorWordWrap=eet.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(CW(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)}},xB.ID="workbench.contrib.editorWordWrapContextKeyTracker",xB);LX=D([_(0,ei),_(1,Kt),_(2,Le)],LX);Ku(LX.ID,LX,yc.AfterRestored);on(IX.ID,IX,ri.Eager);jGe(TX.ID,TX);Me(PFt);jn.appendMenuItem(_e.EditorTitle,{command:{id:dce,title:g(738,"Disable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(he.has(PMe),he.has(NMe))});jn.appendMenuItem(_e.EditorTitle,{command:{id:dce,title:g(739,"Enable wrapping for this file"),icon:ve.wordWrap},group:"navigation",order:1,when:he.and(J.inDiffEditor.negate(),he.has(PMe),he.not(NMe))});jn.appendMenuItem(_e.MenubarViewMenu,{command:{id:dce,title:g(740,"&&Word Wrap"),toggled:eet,precondition:ZZe},order:1,group:"5_editor"});const Pse=class Pse extends li{constructor(){super({id:Pse.ID,title:{...Fe(741,"Toggle Render Whitespace"),mnemonicTitle:g(742,"&&Render Whitespace")},category:ca.View,f1:!0,toggled:he.notEquals("config.editor.renderWhitespace","none"),menu:{id:_e.MenubarAppearanceMenu,group:"4_editor",order:4}})}run(e){const t=e.get(Te),i=t.getValue("editor.renderWhitespace");let n;return i==="none"?n="all":n="none",t.updateValue("editor.renderWhitespace",n)}};Pse.ID="editor.action.toggleRenderWhitespace";let swe=Pse;At(swe);class OFt{constructor(){this._registeredGutterActionsGenerators=new Set}registerGutterActionsGenerator(e){return this._registeredGutterActionsGenerators.add(e),{dispose:()=>{this._registeredGutterActionsGenerators.delete(e)}}}getGutterActionsGenerators(){return Array.from(this._registeredGutterActionsGenerators.values())}}Qe.add("gutterActionsRegistry",new OFt);const BFt=Qe.as("gutterActionsRegistry");var DB;let RX=(DB=class extends V{constructor(e,t,i,n,o){super(),this.editor=e,this.contextMenuService=t,this.menuService=i,this.contextKeyService=n,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&&!(Qt&&e.event.leftButton&&e.event.ctrlKey)&&!t||e.target.type!==Rt.GUTTER_LINE_NUMBERS&&e.target.type!==Rt.GUTTER_GLYPH_MARGIN||!e.target.position||!i)return;const n=e.target.position.lineNumber,o=this.contextKeyService.createOverlay([["editorLineNumber",n]]),r=this.menuService.createMenu(_e.EditorLineNumberContext,o),a=[];this.instantiationService.invokeFunction(c=>{for(const d of BFt.getGutterActionsGenerators()){const h=new Map;d({lineNumber:n,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:n,uri:i.uri},shouldForwardArgs:!0});if(a.push(...l),e.target.type===Rt.GUTTER_LINE_NUMBERS){const d=this.editor.getSelections(),h={startLineNumber:n,endLineNumber:n,startColumn:1,endColumn:i.getLineLength(n)+1};d?.some(f=>!f.isEmpty()&&f.intersectRanges(h)!==null)||this.editor.setSelection(h,Ab.PROGRAMMATIC)}this.contextMenuService.showContextMenu({getAnchor:()=>e.event,getActions:()=>Ar.join(...a.map(d=>d[1])),onHide:()=>r.dispose()})})}},DB.ID="workbench.contrib.editorLineNumberContextMenu",DB);RX=D([_(1,lr),_(2,Oa),_(3,Le),_(4,we)],RX);on(RX.ID,RX,ri.AfterFirstRender);var vu,Xw;let by=(Xw=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this._extensionService=e,this._extensionEnablementService=t,this._configService=i,this._notificationService=n,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(lW.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(vu.configName)&&this._updateStatus())),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered();let e=[...this._extensionService.extensions];e=e.sort((t,i)=>{const n=t.categories?.find(r=>r==="Formatters"||r==="Programming Languages"),o=i.categories?.find(r=>r==="Formatters"||r==="Programming Languages");return n&&!o?-1:!n&&o?1:t.name.localeCompare(i.name)}),vu.extensionIds.length=0,vu.extensionItemLabels.length=0,vu.extensionDescriptions.length=0,vu.extensionIds.push(null),vu.extensionItemLabels.push(g(4529,"None")),vu.extensionDescriptions.push(g(4530,"None"));for(const t of e)(t.main||t.browser)&&(vu.extensionIds.push(t.identifier.value),vu.extensionItemLabels.push(t.displayName??""),vu.extensionDescriptions.push(t.description??""))}static _maybeQuotes(e){return e.match(/\s/)?`'${e}'`:e}async _analyzeFormatter(e,t,i){const n=this._configService.getValue(vu.configName,{resource:i.uri,overrideIdentifier:i.getLanguageId()});if(n){const a=t.find(l=>Sn.equals(l.extensionId,n));if(a)return a;const c=await this._extensionService.getExtension(n);if(c&&this._extensionEnablementService.isEnabled(Xae(c))){const l=this._languageService.getLanguageName(i.getLanguageId())||i.getLanguageId();return e===cW.File?g(4531,"Extension '{0}' is configured as formatter but it cannot format '{1}'-files",c.displayName||c.name,l):g(4532,"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 n?g(4534,"Extension '{0}' is configured as formatter but not available. Select a different default formatter to continue.",n):g(4533,"There are multiple formatters for '{0}' files. One of them should be configured as default formatter.",vu._maybeQuotes(o))}async _selectFormatter(e,t,i,n){const o=await this._analyzeFormatter(n,e,t);if(typeof o!="string")return o;if(i!==im.Silent){const{confirmed:r}=await this._dialogService.confirm({message:g(4535,"Configure Default Formatter"),detail:o,primaryButton:g(4536,"&&Configure...")});if(r)return this._pickAndPersistDefaultFormatter(e,t)}else this._notificationService.prompt(Xe.Info,o,[{label:g(4537,"Configure..."),run:()=>this._pickAndPersistDefaultFormatter(e,t)}],{priority:V2.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})),n=this._languageService.getLanguageName(t.getLanguageId())||t.getLanguageId(),o=await this._quickInputService.pick(i,{placeHolder:g(4538,"Select a default formatter for '{0}' files",vu._maybeQuotes(n))});if(!(!o||!e[o.index].extensionId))return this._configService.updateValue(vu.configName,e[o.index].extensionId.value,{resource:t.uri,overrideIdentifier:t.getLanguageId()}),e[o.index]}_updateStatus(){this._languageStatusStore.clear();const e=e6(this._editorService.activeTextEditorControl);if(!e||!e.hasModel())return;const t=e.getModel(),i=Dae(this._languageFeaturesService.documentFormattingEditProvider,this._languageFeaturesService.documentRangeFormattingEditProvider,t);if(i.length===0)return;const n=new ci;this._languageStatusStore.add(Ee(()=>n.dispose(!0))),this._analyzeFormatter(cW.File,i,t).then(o=>{if(n.token.isCancellationRequested||typeof o!="string")return;const r={id:`formatter/configure/dfl/${ar()}`,title:g(4539,"Configure...")};this._languageStatusStore.add(_t.registerCommand(r.id,()=>this._pickAndPersistDefaultFormatter(i,t))),this._languageStatusStore.add(this._languageStatusService.addStatus({id:"formatter.conflict",name:g(4540,"Formatter Conflicts"),selector:{language:t.getLanguageId(),pattern:t.uri.fsPath},severity:Xe.Error,label:g(4541,"Formatting"),detail:o,busy:!1,source:"",command:r,accessibilityInfo:void 0}))})}},vu=Xw,Xw.configName="editor.defaultFormatter",Xw.extensionIds=[],Xw.extensionItemLabels=[],Xw.extensionDescriptions=[],Xw);by=vu=D([_(0,fs),_(1,Ml),_(2,Te),_(3,bi),_(4,to),_(5,In),_(6,xi),_(7,it),_(8,Kae),_(9,ei)],by);Qe.as(of.Workbench).registerWorkbenchContribution(by,Rs.Restored);Qe.as(Nn.Configuration).registerConfiguration({...Wb,properties:{[by.configName]:{description:g(4542,"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:by.extensionIds,enumItemLabels:by.extensionItemLabels,markdownEnumDescriptions:by.extensionDescriptions}}});function tet(s,e,t,i){function n(o){return o.extensionId?Sn.toKey(o.extensionId):"unknown"}s.publicLog2("formatterpick",{mode:e,extensions:t.map(n),pick:i?n(i):"none"})}async function iet(s,e,t){const i=s.get(In),n=s.get(Te),o=s.get(xi),r={resource:e.uri,overrideIdentifier:e.getLanguageId()},a=n.getValue(by.configName,r);let c;const l=t.map((u,f)=>{const p=Sn.equals(u.extensionId,a),m={index:f,label:u.displayName||"",description:p?g(4543,"(default)"):void 0};return p&&(c=m),m}),d={label:g(4544,"Configure Default Formatter...")},h=await i.pick([...l,{type:"separator"},d],{placeHolder:g(4545,"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(4538,"Select a default formatter for '{0}' files",by._maybeQuotes(u))});f&&t[f.index].extensionId&&n.updateValue(by.configName,t[f.index].extensionId.value,r);return}else return h.index;else return}Me(class extends tt{constructor(){super({id:"editor.action.formatDocument.multiple",label:g(4546,"Format Document With..."),alias:"Format Document...",precondition:he.and(J.writable,J.hasMultipleDocumentFormattingProvider),contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t,i){if(!t.hasModel())return;const n=e.get(we),o=e.get(Yi),r=e.get(it),a=t.getModel(),c=Dae(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),l=await n.invokeFunction(iet,a,c);typeof l=="number"&&await n.invokeFunction(VYe,c[l],t,im.Explicit,He.None),tet(o,"document",c,typeof l=="number"&&c[l]||void 0)}});Me(class extends tt{constructor(){super({id:"editor.action.formatSelection.multiple",label:g(4547,"Format Selection With..."),alias:"Format Code...",precondition:he.and(he.and(J.writable),J.hasMultipleDocumentSelectionFormattingProvider),contextMenuOpts:{when:he.and(J.hasNonEmptySelection),group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(we),n=e.get(it),o=e.get(Yi),r=t.getModel();let a=t.getSelection();a.isEmpty()&&(a=new F(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)));const c=n.documentRangeFormattingEditProvider.ordered(r),l=await i.invokeFunction(iet,r,c);typeof l=="number"&&await i.invokeFunction(UYe,c[l],t,a,He.None,!0),tet(o,"range",c,typeof l=="number"&&c[l]||void 0)}});const HU="workbench.view.extensions";var Qo;(function(s){s[s.Installing=0]="Installing",s[s.Installed=1]="Installed",s[s.Uninstalling=2]="Uninstalling",s[s.Uninstalled=3]="Uninstalled"})(Qo||(Qo={}));var Um;(function(s){s.ReloadWindow="reloadWindow",s.RestartExtensions="restartExtensions",s.DownloadUpdate="downloadUpdate",s.ApplyUpdate="applyUpdate",s.QuitAndInstall="quitAndInstall"})(Um||(Um={}));var X3;(function(s){s.Readme="readme",s.Features="features",s.Changelog="changelog",s.Dependencies="dependencies",s.ExtensionPack="extensionPack"})(X3||(X3={}));const WFt="extensions.autoUpdate";let _Ue=class extends V{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?Ra(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};_Ue=D([_(1,Xo)],_Ue);const HFt="workbench.extensions.action.toggleIgnoreExtension",UFt="workbench.extensions.action.installVSIX";new Y("hasOutdatedExtensions",!1);new Y("hasGallery",!1);const VFt="_theme_",zFt="0_install",$Ft="0_update";new _e("extensionsSearchActionsMenu");g(5291,"Views");const GFt=oi("default-view-icon",ve.window,g(5292,"Default view icon."));var jk;(function(s){s.ViewContainersRegistry="workbench.registry.view.containers",s.ViewsRegistry="workbench.registry.view"})(jk||(jk={}));var ir;(function(s){s[s.Sidebar=0]="Sidebar",s[s.Panel=1]="Panel",s[s.AuxiliaryBar=2]="AuxiliaryBar"})(ir||(ir={}));ir.Sidebar,ir.Panel,ir.AuxiliaryBar;function MX(s){switch(s){case ir.Sidebar:return"sidebar";case ir.Panel:return"panel";case ir.AuxiliaryBar:return"auxiliarybar"}}class KFt extends V{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 n=this.get(e.id);if(n)return n;const o=e;return o.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:o.openCommandActionDescriptor??{id:o.id},wj(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),n=i?.indexOf(e);if(n!==-1){i?.splice(n,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)}}Qe.add(jk.ViewContainersRegistry,new KFt);var NX;(function(s){s.Open="2_open",s.Debug="4_debug",s.SCM="5_scm",s.More="9_more"})(NX||(NX={}));function qFt(s,e){const t=s.group??NX.More,i=e.group??NX.More;return t!==i?t.localeCompare(i):(s.order??5)-(e.order??5)}class QFt extends V{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 L7}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 n=this.removeViews(e,i);n.length&&(this.addViews(n,t),this._onDidChangeContainer.fire({views:n,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(n=>n.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(n=>n.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[n,o]of t)this._viewWelcomeContents.add(e,o),i.set(n,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(qFt)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const n of e){if(this.getView(n.id)!==null)throw new Error(g(5293,"A view with id '{0}' is already registered",n.id));i.push(n)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const n=[],o=[];for(const r of i)e.includes(r)?n.push(r):o.push(r);return n.length&&(o.length?this._views.set(t,o):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),n}}Qe.add(jk.ViewsRegistry,new QFt);var owe;(function(s){s[s.Default=0]="Default",s[s.Expand=1]="Expand"})(owe||(owe={}));var vUe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(vUe||(vUe={}));class Ghe{constructor(e,t){this.resolved=!1,this._hasResolve=!1,dp(this,e),this._hasResolve=!!t,this.resolve=async i=>{if(t&&!this.resolved){const n=await t(i);n&&(this.tooltip=this.tooltip??n.tooltip,this.command=this.command??n.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 Xb extends Error{constructor(e){super(g(5294,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return e.name==="NoTreeViewError"}}async function jFt(s,e){const t=await s.openPaneComposite(HU,ir.Sidebar,!0);t&&(t?.getViewPaneContainer()).search(e)}Me(class extends tt{constructor(){super({id:"editor.action.formatDocument.none",label:g(4548,"Format Document"),alias:"Format Document",precondition:he.and(J.writable,J.hasDocumentFormattingProvider.toNegated()),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyF,linux:{primary:U.CtrlCmd|U.Shift|S.KeyI},weight:Ae.EditorContrib}})}async run(e,t){if(!t.hasModel())return;const i=e.get(vi),n=e.get(Dm),o=e.get(bi),r=e.get(to),a=e.get(it),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(4549,"This file cannot be formatted because it is too large"));else{const d=c.getLanguageId(),h=g(4550,"There is no formatter for '{0}' files installed.",d),{confirmed:u}=await r.confirm({message:h,primaryButton:g(4551,"&&Install Formatter...")});u&&jFt(n,`category:formatters ${d}`)}}});var _g,Zw;let T1=(Zw=class extends V{constructor(e,t){super(),this._extensionService=e,this._configurationService=t,this._store.add(this._extensionService.onDidChangeExtensions(this._updateConfigValues,this)),this._store.add(kA.setFoldingRangeProviderSelector(this._selectFoldingRangeProvider.bind(this))),this._updateConfigValues()}async _updateConfigValues(){await this._extensionService.whenInstalledExtensionsRegistered(),_g.extensionIds.length=0,_g.extensionItemLabels.length=0,_g.extensionDescriptions.length=0,_g.extensionIds.push(null),_g.extensionItemLabels.push(g(743,"All")),_g.extensionDescriptions.push(g(744,"All active folding range providers"));const e=[],t=[];for(const n of this._extensionService.extensions)(n.main||n.browser)&&(n.categories?.find(o=>o==="Programming Languages")?e.push(n):t.push(n));const i=(n,o)=>n.name.localeCompare(o.name);for(const n of e.sort(i))_g.extensionIds.push(n.identifier.value),_g.extensionItemLabels.push(n.displayName??""),_g.extensionDescriptions.push(n.description??"");for(const n of t.sort(i))_g.extensionIds.push(n.identifier.value),_g.extensionItemLabels.push(n.displayName??""),_g.extensionDescriptions.push(n.description??"")}_selectFoldingRangeProvider(e,t){const i=this._configurationService.getValue(_g.configName,{overrideIdentifier:t.getLanguageId()});if(i)return e.filter(n=>n.id===i)}},_g=Zw,Zw.configName="editor.defaultFoldingRangeProvider",Zw.extensionIds=[],Zw.extensionItemLabels=[],Zw.extensionDescriptions=[],Zw);T1=_g=D([_(0,fs),_(1,Te)],T1);Qe.as(Nn.Configuration).registerConfiguration({...Wb,properties:{[T1.configName]:{description:g(745,"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:T1.extensionIds,enumItemLabels:T1.extensionItemLabels,markdownEnumDescriptions:T1.extensionDescriptions}}});Qe.as(of.Workbench).registerWorkbenchContribution(T1,Rs.Restored);var YFt=".monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}";ut(YFt,{});let Z3=class extends V{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:(Ms(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={},n,o){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=re(e,fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Pr("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new ii(this.el,"click")),a=this._register(new ii(this.el,"keypress")),c=M.chain(a.event,h=>h.map(u=>new En(u)).filter(u=>u.keyCode===S.Enter)),l=this._register(new ii(this.el,uo.Tap)).event;this._register(ud.addTarget(this.el));const d=M.any(r.event,c,l);this._register(d(h=>{this.enabled&&(en.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.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};Z3=D([_(3,ec),_(4,Ao)],Z3);var aQ,zD;let WM=(zD=class{static get(e){return e.getContribution(aQ.ID)??void 0}constructor(e,t,i,n){this._editor=e,this._accessibilitySignalService=i,this._instaService=n,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(747,"Code with Inlay Hint Information")),this._ctxIsReading=aQ.IsReading.bindTo(t)}dispose(){this._sessionDispoosables.dispose(),this._ctxIsReading.reset(),this._ariaElement.remove()}_reset(){Ms(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 ci;this._sessionDispoosables.add(i);for(const c of t)await c.resolve(i.token);if(i.token.isCancellationRequested)return;const n=this._editor.getModel(),o=[];let r=0,a=!1;for(const c of t){const l=n.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(Z3,d,{href:PZe(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(n.getValueInRange({startLineNumber:e,startColumn:r+1,endLineNumber:e,endColumn:Number.MAX_SAFE_INTEGER})),aa(this._ariaElement,...o),this._ariaElement.focus(),this._ctxIsReading.set(!0),this._sessionDispoosables.add(ue(this._ariaElement,"focusout",()=>{this._reset()}))}startInlayHintsReading(){if(!this._editor.hasModel())return;const e=this._editor.getPosition().lineNumber,t=bW.get(this._editor)?.getInlayHintsForLine(e);!t||t.length===0?this._accessibilitySignalService.playSignal(al.noInlayHints):this._read(e,t)}stopInlayHintsReading(){this._reset(),this._editor.focus()}},aQ=zD,zD.IsReading=new Y("isReadingLineWithInlayHints",!1,{type:"boolean",description:g(746,"Whether the current line and its inlay hints are currently focused")}),zD.ID="editor.contrib.InlayHintsAccessibility",zD);WM=aQ=D([_(1,Le),_(2,rv),_(3,we)],WM);At(class extends df{constructor(){super({id:"inlayHints.startReadingLineWithHint",title:Fe(748,"Read Line With Inline Hints"),precondition:J.hasInlayHintsProvider,f1:!0})}runEditorCommand(e,t){WM.get(t)?.startInlayHintsReading()}});At(class extends df{constructor(){super({id:"inlayHints.stopReadingLineWithHint",title:Fe(749,"Stop Inlay Hints Reading"),precondition:WM.IsReading,f1:!0,keybinding:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(e,t){WM.get(t)?.stopInlayHintsReading()}});on(WM.ID,WM,ri.Lazy);var kv;(function(s){s.languages="languages",s.actions="actions",s.kind="kind",s.title="title",s.description="description"})(kv||(kv={}));const JFt=Object.freeze({type:"array",markdownDescription:g(4552,"Configure which editor to use for a resource."),items:{type:"object",required:[kv.languages,kv.actions],properties:{[kv.languages]:{type:"array",description:g(4553,"Language modes that the code actions are enabled for."),items:{type:"string"}},[kv.actions]:{type:"object",required:[kv.kind,kv.title],properties:{[kv.kind]:{type:"string",markdownDescription:g(4554,"`CodeActionKind` of the contributed code action.")},[kv.title]:{type:"string",description:g(4555,"Label for the code action used in the UI.")},[kv.description]:{type:"string",description:g(4556,"Description of what the code action does.")}}}}}}),XFt={extensionPoint:"codeActions",deps:[mW],jsonSchema:JFt};class ZFt extends V{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(),n=[g(4557,"Title"),g(4558,"Kind"),g(4559,"Description"),g(4560,"Languages")],o=i.sort((r,a)=>r.title.localeCompare(a.title)).map(r=>[r.title,new Mt().appendMarkdown(`\`${r.kind}\``),r.description??"",new Mt().appendMarkdown(`${r.languages.map(a=>`\`${a}\``).join(" ")}`)]);return{data:{headers:n,rows:o},dispose:()=>{}}}}Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"codeActions",label:g(4561,"Code Actions"),access:{canToggle:!1},renderer:new wi(ZFt)});var RE;(function(s){s.when="when",s.title="title",s.command="command"})(RE||(RE={}));const eOt=Object.freeze({type:"object",description:g(4562,"Contributed documentation."),properties:{refactoring:{type:"array",description:g(4563,"Contributed documentation for refactorings."),items:{type:"object",description:g(4564,"Contributed documentation for refactoring."),required:[RE.title,RE.when,RE.command],properties:{[RE.title]:{type:"string",description:g(4565,"Label for the documentation used in the UI.")},[RE.when]:{type:"string",description:g(4566,"When clause.")},[RE.command]:{type:"string",description:g(4567,"Command executed.")}}}}}}),tOt={extensionPoint:"documentation",deps:[mW],jsonSchema:eOt},bUe=s=>({type:"string",enum:["always","explicit","never",!0,!1],enumDescriptions:[g(4568,"Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes."),g(4569,"Triggers Code Actions only when explicitly saved"),g(4570,"Never triggers Code Actions on save"),g(4571,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(4572,'Never triggers Code Actions on save. This value will be deprecated in favor of "never".')],default:"explicit",description:s}),wUe=s=>({type:["string","boolean"],enum:["explicit","never",!0,!1],enumDescriptions:[g(4573,"Triggers Code Actions only when explicitly saved."),g(4574,"Never triggers Code Actions on save."),g(4575,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'),g(4576,'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "never".')],default:"explicit",description:s}),cQ={oneOf:[{type:"object",additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(4577,'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:at.LANGUAGE_OVERRIDABLE},rwe=Object.freeze({...Wb,properties:{"editor.codeActionsOnSave":cQ}}),lQ={oneOf:[{type:"object",additionalProperties:{type:"string"}},{type:"array",items:{type:"string"}}],markdownDescription:g(4578,'Run a series of Code Actions for a notebook on save. Code Actions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"notebook.source.organizeImports": "explicit"`'),type:"object",additionalProperties:{type:["string","boolean"],enum:["explicit","never",!0,!1]},default:{}},iOt=Object.freeze({...Wb,properties:{"notebook.codeActionsOnSave":lQ}});let awe=class extends V{constructor(e,t,i){super(),this.languageFeatures=i,this._contributedCodeActions=[],this.settings=new Set,this._onDidChangeContributions=this._register(new I),i.codeActionProvider.onDidChange(()=>{this.updateSettingsFromCodeActionProviders(),this.updateConfigurationSchemaFromContribs()},2e3),e.setHandler(n=>{this._contributedCodeActions=n.flatMap(o=>o.value).filter(o=>Array.isArray(o.actions)),this.updateConfigurationSchema(this._contributedCodeActions),this._onDidChangeContributions.fire()}),t.registerSchemaContribution({getSchemaAdditions:()=>this.getSchemaAdditions(),onDidChange:this._onDidChangeContributions.event})}updateSettingsFromCodeActionProviders(){this.languageFeatures.codeActionProvider.allNoModel().forEach(t=>{t.providedCodeActionKinds&&t.providedCodeActionKinds.forEach(i=>{!this.settings.has(i)&&ys.Source.contains(new Yn(i))&&this.settings.add(i)})})}updateConfigurationSchema(e){const t={},i={};for(const[n,o]of this.getSourceActions(e))this.settings.add(n),t[n]=bUe(g(4579,"Controls whether '{0}' actions should be run on file save.",o.title)),i[n]=wUe(g(4579,"Controls whether '{0}' actions should be run on file save.",o.title));cQ.properties=t,lQ.properties=i,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(rwe)}updateConfigurationSchemaFromContribs(){const e={...cQ.properties},t={...lQ.properties};for(const i of this.settings)e[i]||(e[i]=bUe(g(4579,"Controls whether '{0}' actions should be run on file save.",i)),t[i]=wUe(g(4579,"Controls whether '{0}' actions should be run on file save.",i)));cQ.properties=e,lQ.properties=t,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(rwe)}getSourceActions(e){const t=new Map;for(const i of e)for(const n of i.actions){const o=new Yn(n.kind);ys.Source.contains(o)&&t.set(o.value,n)}return t}getSchemaAdditions(){const e=(i,n)=>({if:{required:["command"],properties:{command:{const:i}}},then:{properties:{args:{required:["kind"],properties:{kind:{anyOf:[{enum:n.map(o=>o.kind),enumDescriptions:n.map(o=>o.description??o.title)},{type:"string"}]}}}}}}),t=i=>{const n=this._contributedCodeActions.flatMap(r=>r.actions),o=new Map;for(const r of n)!o.has(r.kind)&&i.contains(new Yn(r.kind))&&o.set(r.kind,r);return Array.from(o.values())};return[e(pMe,t(Yn.Empty)),e(_Me,t(ys.Refactor)),e(vMe,t(ys.Source))]}};awe=D([_(1,Ut),_(2,it)],awe);let cwe=class extends V{constructor(e,t,i){super(),this.contextKeyService=t,this.contributions=[],this.emptyCodeActionsList={actions:[],dispose:()=>{}},this._register(i.codeActionProvider.register("*",this)),e.setHandler(n=>{this.contributions=[];for(const o of n)if(o.value.refactoring)for(const r of o.value.refactoring){const a=he.deserialize(r.when);a&&this.contributions.push({title:r.title,when:a,command:r.command})}})}async provideCodeActions(e,t,i,n){return this.emptyCodeActionsList}_getAdditionalMenuItems(e,t){return e.only!==ys.Refactor.value&&!t.some(i=>i.kind&&ys.Refactor.contains(new Yn(i.kind)))?[]:this.contributions.filter(i=>this.contextKeyService.contextMatchesRules(i.when)).map(i=>({id:i.command,title:i.title}))}};cwe=D([_(1,Le),_(2,it)],cwe);const nOt=Xd.registerExtensionPoint(XFt),sOt=Xd.registerExtensionPoint(tOt);Qe.as(Nn.Configuration).registerConfiguration(rwe);Qe.as(Nn.Configuration).registerConfiguration(iOt);let lwe=class{constructor(e){e.createInstance(awe,nOt),e.createInstance(cwe,sOt)}};lwe=D([_(0,we)],lwe);Qe.as(of.Workbench).registerWorkbenchContribution(lwe,Rs.Eventually);var kB;let PX=(kB=class{constructor(e){e.createKey("listSupportsTypeNavigation",!0),e.createKey("listSupportsKeyboardNavigation",!0)}},kB.ID="workbench.contrib.listContext",kB);PX=D([_(0,Le)],PX);Ku(PX.ID,PX,yc.BlockStartup);var IB;let FX=(IB=class extends V{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=FPt();for(const t of e)try{const i=this._instantiationService.createInstance(t);typeof i.dispose=="function"&&this._register(i)}catch(i){vt(i)}}},IB.ID="workbench.contrib.editorFeaturesInstantiator",IB);FX=D([_(0,Kt),_(1,we)],FX);Ku(FX.ID,FX,yc.BlockRestore);let dwe=class extends V{constructor(e,t){super();const i=n=>e.activeContainer.classList.toggle("context-menu-visible",n);this._register(t.onDidShowContextMenu(()=>i(!0))),this._register(t.onDidHideContextMenu(()=>i(!1)))}};dwe=D([_(0,fu),_(1,lr)],dwe);Qe.as(of.Workbench).registerWorkbenchContribution(dwe,Rs.Eventually);_t.registerCommand("_executeMappedEditsProvider",async(s,e,t,i)=>{const n=s.get(fn),o=s.get(it),r=await n.createModelReference(e);let a=null;try{const c=o.mappedEditsProvider.ordered(r.object.textEditorModel);if(c.length>0){const l=c[0],d=new ci;a=await l.provideMappedEdits(r.object.textEditorModel,t,i,d.token)}}finally{r.dispose()}return a});const CI=fu;var TB;let OX=(TB=class extends V{constructor(e,t,i){super(),this.layoutService=e,this.contextMenuService=t,this.clipboardService=i,this.textInputActions=new ya(()=>this.createActions()),this.registerListeners()}createActions(){return[new rn("undo",g(750,"Undo"),void 0,!0,async()=>Bu().execCommand("undo")),new rn("redo",g(751,"Redo"),void 0,!0,async()=>Bu().execCommand("redo")),new Ar,new rn("editor.action.clipboardCutAction",g(752,"Cut"),void 0,!0,async()=>Bu().execCommand("cut")),new rn("editor.action.clipboardCopyAction",g(753,"Copy"),void 0,!0,async()=>Bu().execCommand("copy")),new rn("editor.action.clipboardPasteAction",g(754,"Paste"),void 0,!0,async e=>{if(od)Bu().execCommand("paste");else{const t=await this.clipboardService.readText();if(Cdt(e)||Sdt(e)){const i=e.selectionStart||0,n=e.selectionEnd||0;e.value=`${e.value.substring(0,i)}${t}${e.value.substring(n,e.value.length)}`,e.selectionStart=i+t.length,e.selectionEnd=e.selectionStart,e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}}}),new Ar,new rn("editor.action.selectAll",g(755,"Select All"),void 0,!0,async()=>Bu().execCommand("selectAll"))]}registerListeners(){this._register(M.runAndSubscribe(this.layoutService.onDidAddContainer,({container:e,disposables:t})=>{t.add(ue(e,"contextmenu",i=>this.onContextMenu(ct(e),i)))},{container:this.layoutService.mainContainer,disposables:this._store}))}onContextMenu(e,t){if(t.defaultPrevented)return;const i=t.target;if(!Yr(i)||i.nodeName.toLowerCase()!=="input"&&i.nodeName.toLowerCase()!=="textarea")return;en.stop(t,!0);const n=new Sh(e,t);this.contextMenuService.showContextMenu({getAnchor:()=>n,getActions:()=>this.textInputActions.value,getActionsContext:()=>i})}},TB.ID="workbench.contrib.textInputActionsProvider",TB);OX=D([_(0,CI),_(1,lr),_(2,ag)],OX);Ku(OX.ID,OX,yc.BlockRestore);var oOt='.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}';ut(oOt,{});const rOt="rendererLog",net="workbench.action.showWindowLog";let Cf;const Khe=globalThis.vscode;if(typeof Khe<"u"&&typeof Khe.context<"u"){const s=Khe.context.configuration();if(s)Cf=s.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(Cf=globalThis._VSCODE_PRODUCT_JSON,S2.VSCODE_DEV&&Object.assign(Cf,{nameShort:`${Cf.nameShort} Dev`,nameLong:`${Cf.nameLong} Dev`,dataFolderName:`${Cf.dataFolderName}-dev`,serverDataFolderName:Cf.serverDataFolderName?`${Cf.serverDataFolderName}-dev`:void 0}),!Cf.version){const s=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Cf,{version:s.version})}}else Cf={},Object.keys(Cf).length===0&&Object.assign(Cf,{version:"1.91.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 aOt=Cf;class cOt extends li{constructor(){super({id:"workbench.action.inspectContextKeys",title:Fe(756,"Inspect Context Keys"),category:ca.Developer,f1:!0})}run(e){const t=e.get(Le),i=new Z,n=ul(void 0,void 0,i);Bf("*","cursor: crosshair !important;",n);const o=document.createElement("div"),r=Bu();r.body.appendChild(o),i.add(Ee(()=>o.remove())),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 ii(r,"mousemove",!0));i.add(a.event(d=>{const h=d.target,u=Cr(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 ii(r,"mousedown",!0));M.once(c.event)(d=>{d.preventDefault(),d.stopPropagation()},null,i);const l=i.add(new ii(r,"mouseup",!0));M.once(l.event)(d=>{d.preventDefault(),d.stopPropagation();const h=t.getContext(d.target);console.log(h.collectAllValues()),bt(i)},null,i)}}class pF extends li{constructor(){super({id:"workbench.action.toggleScreencastMode",title:Fe(757,"Toggle Screencast Mode"),category:ca.Developer,f1:!0})}run(e){if(pF.disposable){pF.disposable.dispose(),pF.disposable=void 0;return}const t=e.get(fu),i=e.get(Te),n=e.get(Ut),o=new Z,r=t.activeContainer,a=re(r,fe(".screencast-mouse"));o.add(Ee(()=>a.remove()));const c=re(r,fe(".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(K,ie){ie.add(ie.add(new ii(K,"mousedown",!0)).event(ge=>l.fire(ge))),ie.add(ie.add(new ii(K,"mouseup",!0)).event(ge=>d.fire(ge))),ie.add(ie.add(new ii(K,"mousemove",!0)).event(ge=>h.fire(ge)))}for(const{window:K,disposables:ie}of A8())u(t.getContainer(K),ie);o.add(Xp(({window:K,disposables:ie})=>u(t.getContainer(K),ie))),o.add(t.onDidChangeActiveContainer(()=>{t.activeContainer.appendChild(a),t.activeContainer.appendChild(c)}));const f=()=>{a.style.borderColor=me.fromHex(i.getValue("screencastMode.mouseIndicatorColor")).toString()};let p;const m=()=>{p=Ka(i.getValue("screencastMode.mouseIndicatorSize")||20,20,100),a.style.height=`${p}px`,a.style.width=`${p}px`};f(),m(),o.add(l.event(K=>{a.style.top=`${K.clientY-p/2}px`,a.style.left=`${K.clientX-p/2}px`,a.style.display="block",a.style.transform="scale(1)",a.style.transition="transform 0.1s";const ie=h.event(ge=>{a.style.top=`${ge.clientY-p/2}px`,a.style.left=`${ge.clientX-p/2}px`,a.style.transform=`scale(${.8})`});M.once(d.event)(()=>{a.style.display="none",ie.dispose()})}));const v=()=>{c.style.fontSize=`${Ka(i.getValue("screencastMode.fontSize")||56,20,100)}px`},b=()=>{c.style.bottom=`${Ka(i.getValue("screencastMode.verticalOffset")||0,0,90)}%`};let w;const y=()=>{w=Ka(i.getValue("screencastMode.keyboardOverlayTimeout")||800,500,5e3)};v(),b(),y(),o.add(i.onDidChangeConfiguration(K=>{K.affectsConfiguration("screencastMode.verticalOffset")&&b(),K.affectsConfiguration("screencastMode.fontSize")&&v(),K.affectsConfiguration("screencastMode.keyboardOverlayTimeout")&&y(),K.affectsConfiguration("screencastMode.mouseIndicatorColor")&&f(),K.affectsConfiguration("screencastMode.mouseIndicatorSize")&&m()}));const C=o.add(new I),A=o.add(new I),L=o.add(new I),k=o.add(new I);function P(K,ie){ie.add(ie.add(new ii(K,"keydown",!0)).event(ge=>C.fire(ge))),ie.add(ie.add(new ii(K,"compositionstart",!0)).event(ge=>A.fire(ge))),ie.add(ie.add(new ii(K,"compositionupdate",!0)).event(ge=>L.fire(ge))),ie.add(ie.add(new ii(K,"compositionend",!0)).event(ge=>k.fire(ge)))}for(const{window:K,disposables:ie}of A8())P(K,ie);o.add(Xp(({window:K,disposables:ie})=>P(K,ie)));let R=0,z,G=!1;const j=new cn(()=>{c.textContent="",z=void 0,R=0},w);o.add(A.event(K=>{G=!0})),o.add(L.event(K=>{K.data&&G?(R>20&&(c.innerText="",R=0),z=z??re(c,fe("span.key")),z.textContent=K.data):G&&(c.innerText="",re(c,fe("span.key",{},"Backspace"))),j.schedule()})),o.add(k.event(K=>{z=void 0,R++})),o.add(C.event(K=>{if(K.key==="Process"||/[\uac00-\ud787\u3131-\u314e\u314f-\u3163\u3041-\u3094\u30a1-\u30f4\u30fc\u3005\u3006\u3024\u4e00-\u9fa5]/u.test(K.key)){K.code==="Backspace"||K.code.includes("Key")?G=!0:(z=void 0,G=!1),j.schedule();return}if(K.isComposing)return;const ie=i.getValue("screencastMode.keyboardOptions"),ge=new En(K),xe=n.softDispatch(ge,ge.target);if(xe.kind===Zg.KbFound&&xe.commandId&&!(ie.showSingleEditorCursorMoves??!0)&&["cursorLeft","cursorRight","cursorUp","cursorDown"].includes(xe.commandId))return;(ge.ctrlKey||ge.altKey||ge.metaKey||ge.shiftKey||R>20||ge.keyCode===S.Backspace||ge.keyCode===S.Escape||ge.keyCode===S.UpArrow||ge.keyCode===S.DownArrow||ge.keyCode===S.LeftArrow||ge.keyCode===S.RightArrow)&&(c.innerText="",R=0);const Re=n.resolveKeyboardEvent(ge),yt=this._isKbFound(xe)&&xe.commandId?this.getCommandDetails(xe.commandId):void 0;let Pe=yt?.title,lt=Re.getLabel();if(yt&&((ie.showCommandGroups??!1)&&yt.category&&(Pe=`${yt.category}: ${Pe} `),this._isKbFound(xe)&&xe.commandId)){const xt=n.lookupKeybindings(xe.commandId).filter(Ji=>Ji.getLabel()?.endsWith(lt??""));xt.length>0&&(lt=xt[xt.length-1].getLabel())}(ie.showCommands??!0)&&Pe&&re(c,fe("span.title",{},`${Pe} `)),((ie.showKeys??!0)||(ie.showKeybindings??!0)&&this._isKbFound(xe))&&(lt=lt?.replace("UpArrow","↑")?.replace("DownArrow","↓")?.replace("LeftArrow","←")?.replace("RightArrow","→"),re(c,fe("span.key",{},lt??""))),R++,j.schedule()})),pF.disposable=o}_isKbFound(e){return e.kind===Zg.KbFound}getCommandDetails(e){const t=jn.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=_t.getCommand(e);if(i&&i.metadata?.description)return{title:typeof i.metadata.description=="string"?i.metadata.description:i.metadata.description.value}}}class lOt extends li{constructor(){super({id:"workbench.action.logStorage",title:Fe(758,"Log Storage Database Contents"),category:ca.Developer,f1:!0})}run(e){const t=e.get($i),i=e.get(to);t.log(),i.info(g(759,"The storage database contents have been logged to the developer tools."),g(760,"Open developer tools from the menu and select the Console tab."))}}class dOt extends li{constructor(){super({id:"workbench.action.logWorkingCopies",title:Fe(761,"Log Working Copies"),category:ca.Developer,f1:!0})}async run(e){const t=e.get(Im),i=e.get(F6),n=e.get(Ge),o=e.get(qae),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||""})`):[""]];n.info(a.join(` +`)),o.showChannel(rOt,!0)}}const Fse=class Fse extends li{constructor(){super({id:"workbench.action.removeLargeStorageDatabaseEntries",title:Fe(762,"Remove Large Storage Database Entries..."),category:ca.Developer,f1:!0})}async run(e){const t=e.get($i),i=e.get(In),n=e.get(lg),o=e.get(to),r=e.get(Za),a=[];for(const h of[Ie.APPLICATION,Ie.PROFILE,Ie.WORKSPACE])if(!(h===Ie.PROFILE&&n.currentProfile.isDefault))for(const u of[an.MACHINE,an.USER])for(const f of t.keys(h,u)){const p=t.get(f,h);p&&(!r.isBuilt||p.length>Fse.SIZE_THRESHOLD)&&a.push({key:f,scope:h,target:u,size:p.length,label:f,description:Nc.formatSize(p.length),detail:g(763,"Scope: {0}, Target: {1}",h===Ie.APPLICATION?g(764,"Global"):h===Ie.PROFILE?g(765,"Profile"):g(766,"Workspace"),u===an.MACHINE?g(767,"Machine"):g(768,"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(769,"Remove"),f.placeholder=g(770,"Select large entries to remove from storage"),a.length===0&&(f.description=g(771,"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(772,"Do you want to remove the selected storage entries from the database?"),detail:g(773,`{0} This action is irreversible and may result in data loss!`,c.map(h=>h.label).join(` -`)),primaryButton:g(774,"&&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)}};Hse.SIZE_THRESHOLD=1024*16;let _we=Hse,P1,HX=new Set;const TT=new Q("dirtyWorkingCopies","stopped");class COt extends li{constructor(){super({id:"workbench.action.startTrackDisposables",title:Pe(775,"Start Tracking Disposables"),category:ca.Developer,f1:!0,precondition:he.and(TT.isEqualTo("pending").negate(),TT.isEqualTo("started").negate())})}run(e){TT.bindTo(e.get(Le)).set("started"),HX.clear(),P1=new jge,B6e(P1)}}class SOt extends li{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Pe(776,"Snapshot Tracked Disposables"),category:ca.Developer,f1:!0,precondition:TT.isEqualTo("started")})}run(e){TT.bindTo(e.get(Le)).set("pending"),HX=new Set(P1?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class AOt extends li{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Pe(777,"Stop Tracking Disposables"),category:ca.Developer,f1:!0,precondition:TT.isEqualTo("pending")})}run(e){const t=e.get(ei);if(TT.bindTo(e.get(Le)).set("stopped"),P1){const n=new Set;for(const r of new Set(P1.computeLeakingDisposables(1e3)?.leaks)??[])HX.has(r.value)&&n.add(r);const o=P1.computeLeakingDisposables(1e3,Array.from(n));o&&t.openEditor({resource:void 0,contents:o.details})}B6e(null),P1=void 0,HX.clear()}}At(bOt);At(bF);At(wOt);At(yOt);At(_we);vOt.commit||(At(COt),At(SOt),At(AOt));const EOt=Qe.as(Nn.Configuration);EOt.registerConfiguration({id:"screencastMode",order:9,title:g(778,"Screencast Mode"),type:"object",properties:{"screencastMode.verticalOffset":{type:"number",default:20,minimum:0,maximum:90,description:g(779,"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(780,"Controls the font size (in pixels) of the screencast mode keyboard.")},"screencastMode.keyboardOptions":{type:"object",description:g(781,"Options for customizing the keyboard overlay in screencast mode."),properties:{showKeys:{type:"boolean",default:!0,description:g(782,"Show raw keys.")},showKeybindings:{type:"boolean",default:!0,description:g(783,"Show keyboard shortcuts.")},showCommands:{type:"boolean",default:!0,description:g(784,"Show command names.")},showCommandGroups:{type:"boolean",default:!1,description:g(785,"Show command group names, when commands are also shown.")},showSingleEditorCursorMoves:{type:"boolean",default:!0,description:g(786,"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(787,"Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")},"screencastMode.mouseIndicatorColor":{type:"string",format:"color-hex",default:"#FF0000",description:g(788,"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(789,"Controls the size (in pixels) of the mouse indicator in screencast mode.")}}});At(BRt);At(kXe);At(IXe);jn.appendMenuItem(_e.EditorTitle,{command:{id:new IXe().desc.id,title:g(1324,"Use Inline View When Space Is Limited"),toggled:he.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:he.has("isInDiffEditor")},order:11,group:"1_diff",when:he.and(J.diffEditorRenderSideBySideInlineBreakpointReached,he.has("isInDiffEditor"))});jn.appendMenuItem(_e.EditorTitle,{command:{id:new kXe().desc.id,title:g(1325,"Show Moved Code Blocks"),icon:ve.move,toggled:SN.create("config.diffEditor.experimental.showMoves",!0),precondition:he.has("isInDiffEditor")},order:10,group:"1_diff",when:he.has("isInDiffEditor")});At(jve);for(const s of[{icon:ve.arrowRight,key:J.diffEditorInlineMode.toNegated()},{icon:ve.discard,key:J.diffEditorInlineMode}])jn.appendMenuItem(_e.DiffEditorHunkToolbar,{command:{id:new jve().desc.id,title:g(1326,"Revert Block"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),jn.appendMenuItem(_e.DiffEditorSelectionToolbar,{command:{id:new jve().desc.id,title:g(1327,"Revert Selection"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"});At(WRt);At(HRt);At(URt);At(VRt);jn.appendMenuItem(_e.EditorTitle,{command:{id:mW.id,title:g(1328,"Open Accessible Diff Viewer"),precondition:he.has("isInDiffEditor")},order:10,group:"2_diff",when:he.and(J.accessibleDiffViewerVisible.negate(),he.has("isInDiffEditor"))});_t.registerCommandAlias("editor.action.diffReview.next",mW.id);At(mW);_t.registerCommandAlias("editor.action.diffReview.prev",z3.id);At(z3);var xOt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";ut(xOt,{});var vwe;const pce=new Q("selectionAnchorSet",!1);var VL;let tI=(VL=class{static get(e){return e.getContribution(vwe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=pce.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(dt.fromPositions(e,e),{description:"selection-anchor",stickiness:ni.NeverGrowsWhenTypingAtEdges,hoverMessage:new Mt().appendText(g(1329,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Mr(g(1330,"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(dt.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()}},vwe=VL,VL.ID="editor.contrib.selectionAnchorController",VL);tI=vwe=D([_(1,Le)],tI);class DOt extends tt{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(1331,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyB),weight:Ae.EditorContrib}})}async run(e,t){tI.get(t)?.setSelectionAnchor()}}class kOt extends tt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(1332,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:pce})}async run(e,t){tI.get(t)?.goToSelectionAnchor()}}class IOt extends tt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g(1333,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:pce,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyK),weight:Ae.EditorContrib}})}async run(e,t){tI.get(t)?.selectFromAnchorToCursor()}}class TOt extends tt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g(1334,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:pce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.Escape,weight:Ae.EditorContrib}})}async run(e,t){tI.get(t)?.cancelSelectionAnchor()}}on(tI.ID,tI,ri.Lazy);Re(DOt);Re(kOt);Re(IOt);Re(TOt);var LOt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";ut(LOt,{});const ROt=W("editorOverviewRuler.bracketMatchForeground","#A0A0A0",g(1337,"Overview ruler marker color for matching brackets."));class MOt extends tt{constructor(){super({id:"editor.action.jumpToBracket",label:g(1338,"Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Backslash,weight:Ae.EditorContrib}})}run(e,t){BA.get(t)?.jumpToBracket()}}class NOt extends tt{constructor(){super({id:"editor.action.selectToBracket",label:g(1339,"Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Pe(1340,"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 n=!0;i&&i.selectBrackets===!1&&(n=!1),BA.get(t)?.selectToBracket(n)}}class POt extends tt{constructor(){super({id:"editor.action.removeBrackets",label:g(1341,"Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.Backspace,weight:Ae.EditorContrib}})}run(e,t){BA.get(t)?.removeBrackets(this.id)}}class FOt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const KE=class KE extends V{static get(e){return e.getContribution(KE.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new cn(()=>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 n=i.getStartPosition(),o=e.bracketPairs.matchBracket(n);let r=null;if(o)o[0].containsPosition(n)&&!o[1].containsPosition(n)?r=o[1].getStartPosition():o[1].containsPosition(n)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(n);c&&c.range&&(r=c.range.getStartPosition())}}return r?new dt(r.lineNumber,r.column,r.lineNumber,r.column):new dt(n.lineNumber,n.column,n.lineNumber,n.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(n=>{const o=n.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(F.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 dt(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 n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),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 n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[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 n=[];this._lastVersionId===i&&(n=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=n.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Re(HOt);const $M="9_cutcopypaste",UOt=ad||document.queryCommandSupported("cut"),fet=ad||document.queryCommandSupported("copy"),VOt=typeof navigator.clipboard>"u"||rf?document.queryCommandSupported("paste"):!0;function QMe(s){return s.register(),s}const zOt=UOt?QMe(new wI({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:ad?{primary:U.CtrlCmd|S.KeyX,win:{primary:U.CtrlCmd|S.KeyX,secondary:[U.Shift|S.Delete]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1346,"Cu&&t"),order:1},{menuId:_e.EditorContext,group:$M,title:g(1347,"Cut"),when:J.writable,order:1},{menuId:_e.CommandPalette,group:"",title:g(1347,"Cut"),order:1},{menuId:_e.SimpleEditorContext,group:$M,title:g(1347,"Cut"),when:J.writable,order:1}]})):void 0,$Ot=fet?QMe(new wI({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:ad?{primary:U.CtrlCmd|S.KeyC,win:{primary:U.CtrlCmd|S.KeyC,secondary:[U.CtrlCmd|S.Insert]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1348,"&&Copy"),order:2},{menuId:_e.EditorContext,group:$M,title:g(1349,"Copy"),order:2},{menuId:_e.CommandPalette,group:"",title:g(1349,"Copy"),order:1},{menuId:_e.SimpleEditorContext,group:$M,title:g(1349,"Copy"),order:2}]})):void 0;jn.appendMenuItem(_e.MenubarEditMenu,{submenu:_e.MenubarCopy,title:Pe(1350,"Copy As"),group:"2_ccp",order:3});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextCopy,title:Pe(1350,"Copy As"),group:$M,order:3});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1,when:he.and(he.notEquals("resourceScheme","output"),J.editorTextFocus)});jn.appendMenuItem(_e.ExplorerContext,{submenu:_e.ExplorerContextShare,title:Pe(1351,"Share"),group:"11_share",order:-1});const eue=VOt?QMe(new wI({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:ad?{primary:U.CtrlCmd|S.KeyV,win:{primary:U.CtrlCmd|S.KeyV,secondary:[U.Shift|S.Insert]},linux:{primary:U.CtrlCmd|S.KeyV,secondary:[U.Shift|S.Insert]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1352,"&&Paste"),order:4},{menuId:_e.EditorContext,group:$M,title:g(1353,"Paste"),when:J.writable,order:4},{menuId:_e.CommandPalette,group:"",title:g(1353,"Paste"),order:1},{menuId:_e.SimpleEditorContext,group:$M,title:g(1353,"Paste"),when:J.writable,order:4}]})):void 0;class GOt extends tt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g(1354,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t){!t.hasModel()||!t.getOption(x.emptySelectionClipboard)&&t.getSelection().isEmpty()||(Xpe.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Xpe.forceCopyWithSyntaxHighlighting=!1)}}function pet(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Kt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const o=n.getOption(x.emptySelectionClipboard),r=n.getSelection();return r&&r.isEmpty()&&!o||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(Hu().execCommand(e),!0)))}pet(zOt,"cut");pet($Ot,"copy");eue&&(eue.addImplementation(1e4,"code-editor",(s,e)=>{const t=s.get(Kt),i=s.get(dg),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?n.getContainerDomNode().ownerDocument.execCommand("paste")?sC.get(n)?.finishedPaste()??Promise.resolve():Wn?(async()=>{const r=await i.readText();if(r!==""){const a=J8.INSTANCE.get(r);let c=!1,l=null,d=null;a&&(c=n.getOption(x.emptySelectionClipboard)&&!!a.isFromEmptySelection,l=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),n.trigger("keyboard",oc.Paste,{text:r,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),eue.addImplementation(0,"generic-dom",(s,e)=>(Hu().execCommand("paste"),!0)));fet&&Re(GOt);function tG(s){return he.regex(yZe.keys()[0],new RegExp("(\\s|^)"+Rh(s.value)+"\\b"))}const jMe={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g(5e3,"Kind of the code action to run.")},apply:{type:"string",description:g(5001,"Controls when the returned actions are applied."),default:sd.IfSingle,enum:[sd.First,sd.IfSingle,sd.Never],enumDescriptions:[g(5002,"Always apply the first returned code action."),g(5003,"Apply the first returned code action if it is the only one."),g(5004,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g(5005,"Controls if only preferred code actions should be returned.")}}};function KN(s,e,t,i,n=sg.Default){s.hasModel()&&WM.get(s)?.manualTriggerAtCurrentPosition(e,n,t,i)}class KOt extends tt{constructor(){super({id:kMe,label:g(5006,"Quick Fix..."),alias:"Quick Fix...",precondition:he.and(J.writable,J.hasCodeActionsProvider),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Period,weight:Ae.EditorContrib}})}run(e,t){return KN(t,g(5007,"No code actions available"),void 0,void 0,sg.QuickFix)}}class qOt extends hc{constructor(){super({id:DMe,precondition:he.and(J.writable,J.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:jMe}]}})}runEditorCommand(e,t,i){const n=qw.fromUser(i,{kind:Yn.Empty,apply:sd.IfSingle});return KN(t,typeof i?.kind=="string"?n.preferred?g(5008,"No preferred code actions for '{0}' available",i.kind):g(5009,"No code actions for '{0}' available",i.kind):n.preferred?g(5010,"No preferred code actions available"):g(5011,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class QOt extends tt{constructor(){super({id:IMe,label:g(5012,"Refactor..."),alias:"Refactor...",precondition:he.and(J.writable,J.hasCodeActionsProvider),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|S.KeyR,mac:{primary:U.WinCtrl|U.Shift|S.KeyR},weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:2,when:he.and(J.writable,tG(ys.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:jMe}]}})}run(e,t,i){const n=qw.fromUser(i,{kind:ys.Refactor,apply:sd.Never});return KN(t,typeof i?.kind=="string"?n.preferred?g(5013,"No preferred refactorings for '{0}' available",i.kind):g(5014,"No refactorings for '{0}' available",i.kind):n.preferred?g(5015,"No preferred refactorings available"):g(5016,"No refactorings available"),{include:ys.Refactor.contains(n.kind)?n.kind:Yn.None,onlyIncludePreferredActions:n.preferred},n.apply,sg.Refactor)}}class jOt extends tt{constructor(){super({id:TMe,label:g(5017,"Source Action..."),alias:"Source Action...",precondition:he.and(J.writable,J.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:he.and(J.writable,tG(ys.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:jMe}]}})}run(e,t,i){const n=qw.fromUser(i,{kind:ys.Source,apply:sd.Never});return KN(t,typeof i?.kind=="string"?n.preferred?g(5018,"No preferred source actions for '{0}' available",i.kind):g(5019,"No source actions for '{0}' available",i.kind):n.preferred?g(5020,"No preferred source actions available"):g(5021,"No source actions available"),{include:ys.Source.contains(n.kind)?n.kind:Yn.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,sg.SourceAction)}}class YOt extends tt{constructor(){super({id:Ibe,label:g(5022,"Organize Imports"),alias:"Organize Imports",precondition:he.and(J.writable,tG(ys.SourceOrganizeImports)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|U.Alt|S.KeyO,weight:Ae.EditorContrib}})}run(e,t){return KN(t,g(5023,"No organize imports action available"),{include:ys.SourceOrganizeImports,includeSourceActions:!0},sd.IfSingle,sg.OrganizeImports)}}class JOt extends tt{constructor(){super({id:Tbe,label:g(5024,"Fix All"),alias:"Fix All",precondition:he.and(J.writable,tG(ys.SourceFixAll))})}run(e,t){return KN(t,g(5025,"No fix all action available"),{include:ys.SourceFixAll,includeSourceActions:!0},sd.IfSingle,sg.FixAll)}}class XOt extends tt{constructor(){super({id:pZe,label:g(5026,"Auto Fix..."),alias:"Auto Fix...",precondition:he.and(J.writable,tG(ys.QuickFix)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Alt|U.Shift|S.Period,mac:{primary:U.CtrlCmd|U.Alt|S.Period},weight:Ae.EditorContrib}})}run(e,t){return KN(t,g(5027,"No auto fixes available"),{include:ys.QuickFix,onlyIncludePreferredActions:!0},sd.IfSingle,sg.AutoFix)}}on(WM.ID,WM,ri.Eventually);on(Q3.ID,Q3,ri.Lazy);Re(KOt);Re(QOt);Re(jOt);Re(YOt);Re(XOt);Re(JOt);qe(new qOt);Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,description:g(1355,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,description:g(1356,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,markdownDescription:g(1357,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});class bwe{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 met(s,e,t){const i=s.ordered(e),n=new Map,o=new bwe,r=i.map(async(a,c)=>{n.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&o.add(l,a)}catch(l){No(l)}});return await Promise.all(r),o.lenses=o.lenses.sort((a,c)=>a.symbol.range.startLineNumberc.symbol.range.startLineNumber?1:n.get(a.provider)n.get(c.provider)?1:a.symbol.range.startColumnc.symbol.range.startColumn?1:0),o}_t.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;Tt(N.isUri(t)),Tt(typeof i=="number"||!i);const{codeLensProvider:n}=s.get(it),o=s.get(gi).getModel(t);if(!o)throw Pi();const r=[],a=new Z;return met(n,o,He.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,He.None)).then(h=>r.push(h||d.symbol)));return Promise.all(l)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});const _et=ae("ICodeLensCache");class MUe{constructor(e,t){this.lineCount=e,this.data=t}}let wwe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new um(20,.75);const t="codelens/cache";XP(si,()=>e.remove(t,Ie.WORKSPACE));const i="codelens/cache2",n=e.get(i,Ie.WORKSPACE,"{}");this._deserialize(n);const o=M.filter(e.onWillSaveState,r=>r.reason===wy.SHUTDOWN);M.once(o)(r=>{e.store(i,this._serialize(),Ie.WORKSPACE,an.MACHINE)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),n=new bwe;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new MUe(e.getLineCount(),n);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 n=new Set;for(const o of i.data.lenses)n.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],o=[];for(const a of n.lines)o.push({range:new F(a,1,a,11)});const r=new bwe;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new MUe(n.lineCount,r))}}catch{}}};wwe=D([_(0,$i)],wwe);ce(_et,wwe,qt.Delayed);var ZOt=".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}";ut(ZOt,{});class eBt{constructor(e,t,i){this.afterColumn=Un.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 qz=class qz{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${qz._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let o=0;o{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:NUe},h=>this._decorationIds[d]=h),a?a=F.plusRange(a,l.symbol.range):a=F.lift(l.symbol.range)}),this._viewZone=new eBt(a.startLineNumber-1,o,r),this._viewZoneId=n.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new ywe(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),n=this._data[t].symbol;return!!(i&&F.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:NUe},o=>this._decorationIds[n]=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),n=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",n.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",cd.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&&jy(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const o=n.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new cn(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Rr(o=>met(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()-n);i.delay=r,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},vt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ee(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{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 tue;r.forEach(l=>{l.dispose(c,o),this._lenses.splice(this._lenses.indexOf(l),1)}),c.commit(n)})}),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(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ee(()=>{if(this._editor.getModel()){const n=vm.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==Rt.CONTENT_WIDGET)return;let o=n.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 tue;for(const n of this._lenses)n.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 n;for(const a of e.lenses){const c=a.symbol.range.startLineNumber;c<1||c>t||(n&&n[n.length-1].symbol.range.startLineNumber===c?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const o=vm.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new tue;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 n=Date.now(),o=Rr(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},No):(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()-n);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{vt(r),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},PB.ID="css.editor.codeLens",PB);n9=D([_(1,it),_(2,Sp),_(3,vi),_(4,bi),_(5,_et)],n9);on(n9.ID,n9,ri.AfterFirstRender);Re(class extends tt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:J.hasCodeLensProvider,label:g(1358,"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(In),n=e.get(vi),o=e.get(bi),r=t.getSelection().positionLineNumber,a=t.getContribution(n9.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(1359,"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 n.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});const Use=class Use extends V{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!==Rt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==OZe||!i.range)return;const n=this._editor.getContribution(Pa.ID);if(n&&!n.isColorPickerVisible){const o=new F(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(o,oC.Immediate,FA.Mouse,!1,!0)}}};Use.ID="editor.contrib.colorContribution",Use.RECOMPUTE_TIME=1e3;let UX=Use;on(UX.ID,UX,ri.BeforeFirstInteraction);GN.register(Y3);var Cwe,Swe,zL;let GM=(zL=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=J.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=J.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=new Awe(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(Cwe.ID)}},Cwe=zL,zL.ID="editor.contrib.standaloneColorPickerController",zL);GM=Cwe=D([_(1,Le),_(2,gi),_(3,Ut),_(4,we),_(5,it),_(6,Vs)],GM);on(GM.ID,GM,ri.AfterFirstRender);const FUe=8,tBt=22;var $L;let Awe=($L=class extends V{constructor(e,t,i,n,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=n.createInstance(J3,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(Ac(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 Swe.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?[es.ABOVE,es.BELOW]:[es.BELOW,es.ABOVE],positionAffinity:Io.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 iBt(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 MMe(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new yX(this._keybindingService)),o={fragment:i,statusBar:n,onContentsChanged:()=>{},hide:()=>this.hide()};this._colorHover=e;const r=this._standaloneColorPickerParticipant.renderHoverParts(o,[e]);if(!r)return;this._register(r.disposables);const a=r.colorPicker;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),a.layout();const c=a.body,l=c.saturationBox.domNode.clientWidth,d=c.domNode.clientWidth-l-tBt-FUe,h=a.body.enterButton;h?.onClicked(()=>{this.updateEditor(),this.hide()});const u=a.header,f=u.pickedColorNode;f.style.width=l+FUe+"px";const p=u.originalColorNode;p.style.width=d+"px",a.header.closeButton?.onClicked(()=>{this.hide()}),t&&(h&&(h.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},Swe=$L,$L.ID="editor.contrib.standaloneColorPickerWidget",$L);Awe=Swe=D([_(3,we),_(4,gi),_(5,Ut),_(6,it),_(7,Vs)],Awe);class iBt{constructor(e,t){this.value=e,this.foundInEditor=t}}class nBt extends gf{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Pe(1360,"Show or Focus Standalone Color Picker"),mnemonicTitle:g(1361,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:_e.CommandPalette}],metadata:{description:Pe(1362,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){GM.get(t)?.showOrFocus()}}class sBt extends tt{constructor(){super({id:"editor.action.hideColorPicker",label:g(1363,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:J.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:S.Escape,weight:Ae.EditorContrib},metadata:{description:Pe(1364,"Hide the standalone color picker.")}})}run(e,t){GM.get(t)?.hide()}}class oBt extends tt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g(1365,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:J.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:S.Enter,weight:Ae.EditorContrib},metadata:{description:Pe(1366,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){GM.get(t)?.insertColor()}}Re(sBt);Re(oBt);At(nBt);class Px{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 n=t.length,o=e.length;if(i+n>o)return!1;for(let r=0;r=B.A&&a<=B.Z&&a+32===c)&&!(c>=B.A&&c<=B.Z&&c+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,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),b=u.substring(0,p);(v.indexOf(i)>=0||b.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(n&&f+t.length0&&u.charCodeAt(p-1)===B.Space&&(i=" "+i,p-=1),m=Px._createRemoveBlockCommentOperations(new F(a,f+t.length+1,l,p+1),t,i)):(m=Px._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 n=[];return F.isEmpty(e)?n.push(Zn.delete(new F(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Zn.delete(new F(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Zn.delete(new F(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return F.isEmpty(e)?o.push(Zn.replace(new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Zn.insert(new oe(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(Zn.insert(new oe(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),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 n=i[0],o=i[1];return new dt(n.range.endLineNumber,n.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const n=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new dt(n.endLineNumber,n.endColumn+o,n.endLineNumber,n.endColumn+o)}}}var Qw;(function(s){s[s.Toggle=0]="Toggle",s[s.ForceAdd=1]="ForceAdd",s[s.ForceRemove=2]="ForceRemove"})(Qw||(Qw={}));class RC{constructor(e,t,i,n,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=n.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}}}class YMe extends tt{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Vs);if(!t.hasModel())return;const n=t.getModel(),o=[],r=n.getOptions(),a=t.getOption(x.comments),c=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));c.sort((d,h)=>F.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 iue(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new nue(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 nue(new iue(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 nue(new iue(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}};Vse.ID="editor.contrib.cursorUndoRedoController";let DW=Vse;class dBt extends tt{constructor(){super({id:"cursorUndo",label:g(1383,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.KeyU,weight:Ae.EditorContrib}})}run(e,t,i){DW.get(t)?.cursorUndo()}}class hBt extends tt{constructor(){super({id:"cursorRedo",label:g(1384,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){DW.get(t)?.cursorRedo()}}on(DW.ID,DW,ri.Eager);Re(dBt);Re(hBt);var uBt=".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}";ut(uBt,{});class gBt{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 F(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 dt(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 dt(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)||(pP(e)&&(this._modifierPressed=!0),this._mouseDown&&pP(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(pP(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===zC.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 n=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}pP(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 n=this._editor.getSelection();if(n){const{selectionStartLineNumber:o,selectionStartColumn:r}=n;i=[new dt(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new dt(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",Oi.Explicit)}else(!this._dragSelection.containsPosition(t)||(pP(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(zC.ID,new gBt(this._dragSelection,t,pP(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 F(e.lineNumber,e.column,e.lineNumber,e.column),options:zC._DECORATION_OPTIONS}]),this._editor.revealPosition(e,mt.Immediate)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===Rt.CONTENT_TEXT||e.type===Rt.CONTENT_EMPTY}_hitMargin(e){return e.type===Rt.GUTTER_GLYPH_MARGIN||e.type===Rt.GUTTER_LINE_NUMBERS||e.type===Rt.GUTTER_LINE_DECORATIONS}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};zC.ID="editor.contrib.dragAndDrop",zC.TRIGGER_KEY_VALUE=Qt?S.Alt:S.Ctrl,zC._DECORATION_OPTIONS=Gt.register({description:"dnd-target",className:"dnd-target"});let VX=zC;on(VX.ID,VX,ri.BeforeFirstInteraction);on(sC.ID,sC,ri.Eager);j6(Ebe);qe(new class extends hc{constructor(){super({id:gZe,precondition:xMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e){return sC.get(e)?.changePasteType()}});qe(new class extends hc{constructor(){super({id:"editor.hidePasteWidget",precondition:xMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e){sC.get(e)?.clearWidgets()}});var GL;Re((GL=class extends tt{constructor(){super({id:"editor.action.pasteAs",label:g(1386,"Paste As..."),alias:"Paste As...",precondition:J.writable,metadata:{description:"Paste as",args:[{name:"args",schema:GL.argsSchema}]}})}run(e,t,i){let n=typeof i?.kind=="string"?i.kind:void 0;return!n&&i&&(n=typeof i.id=="string"?i.id:void 0),sC.get(t)?.pasteAs(n?new Yn(n):void 0)}},GL.argsSchema={type:"object",properties:{kind:{type:"string",description:g(1385,"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.")}}},GL));Re(class extends tt{constructor(){super({id:"editor.action.pasteAsText",label:g(1387,"Paste as Text"),alias:"Paste as Text",precondition:J.writable})}run(s,e){return sC.get(e)?.pasteAs({providerId:FM.id})}});on(HM.ID,HM,ri.BeforeFirstInteraction);j6(Abe);qe(new class extends hc{constructor(){super({id:AZe,precondition:LMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e,t){HM.get(e)?.changeDropType()}});qe(new class extends hc{constructor(){super({id:"editor.hideDropWidget",precondition:LMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e,t){HM.get(e)?.clearWidgets()}});Qe.as(Nn.Configuration).registerConfiguration({...Vb,properties:{[SZe]:{type:"object",scope:at.LANGUAGE_OVERRIDABLE,description:g(1388,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const ch=class ch{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&&(n.changeDecorationOptions(this._highlightedDecorationId,ch._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,ch._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.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 F(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(o,ch._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=ch._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){n=ch._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 F(h,1,u,1),options:ch._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}o.push({range:new F(h,1,u,1),options:ch._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,ch._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],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}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;rF.compareRangesUsingStarts(r.range,a.range));const n=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):s[0][0].toUpperCase()!==s[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function OUe(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function BUe(s,e,t){const i=e.split(t),n=s[0].split(t);let o="";return i.forEach((r,a)=>{o+=vet([n[a]],r)+t}),o.slice(0,-1)}var kW;(function(s){s[s.StaticValue=0]="StaticValue",s[s.DynamicPieces=1]="DynamicPieces"})(kW||(kW={}));class WUe{constructor(e){this.staticValue=e,this.kind=kW.StaticValue}}class pBt{constructor(e){this.pieces=e,this.kind=kW.DynamicPieces}}class IW{static fromStaticValue(e){return new IW([gD.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===kW.DynamicPieces}constructor(e){!e||e.length===0?this._state=new WUe(""):e.length===1&&e[0].staticValue!==null?this._state=new WUe(e[0].staticValue):this._state=new pBt(e)}buildReplaceString(e,t){if(this._state.kind===kW.StaticValue)return t?vet(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,o=this._state.pieces.length;n0){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=n)break;const r=s.charCodeAt(i);switch(r){case B.Backslash:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case B.n:t.emitUnchanged(i-1),t.emitStatic(` -`,i+1);break;case B.t:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case B.u:case B.U:case B.l:case B.L:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===B.DollarSign){if(i++,i>=n)break;const r=s.charCodeAt(i);if(r===B.DollarSign){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===B.Digit0||r===B.Ampersand){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(B.Digit1<=r&&r<=B.Digit9){let a=r-B.Digit0;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===Oi.Explicit||i.reason===Oi.Undo||i.reason===Oi.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,bt(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)},vBt)):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 F(a.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return a}));const n=this._findMatches(i,!1,Fx);this._decorations.set(n,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&n.length>0){const a=w2(n.map(c=>c.range),c=>F.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,mt.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,mt.Smooth)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===1?(i===1?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new oe(i,n)}_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:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new oe(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()U5._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,n,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>=Fx?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new GC(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 n=this._editor.getModel(),o=n.getValue(go.LF),r=n.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 UTe(r,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,Un.MAX_SAFE_SMALL_INTEGER),n=[];for(let r=0,a=i.length;rr.range),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,Un.MAX_SAFE_SMALL_INTEGER).map(o=>new dt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const n=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 n={inputActiveOptionBorder:ze(Kre),inputActiveOptionForeground:ze(qre),inputActiveOptionBackground:ze(a6)},o=this._register($k());this.caseSensitive=this._register(new Jje({appendTitle:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:o,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new Xje({appendTitle:this._keybindingLabelFor(zo.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:o,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new Zje({appendTitle:this._keybindingLabelFor(zo.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:o,...n})),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(ue(this._domNode,ke.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(ue(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 zse.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Wg.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")}};zse.ID="editor.contrib.findOptionsWidget";let xwe=zse;var _h;(function(s){s[s.NotSet=0]="NotSet",s[s.True=1]="True",s[s.False=2]="False"})(_h||(_h={}));function DK(s,e){return s===_h.True?!0:s===_h.False?!1:e}class wBt extends V{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return DK(this._isRegexOverride,this._isRegex)}get wholeWord(){return DK(this._wholeWordOverride,this._wholeWord)}get matchCase(){return DK(this._matchCaseOverride,this._matchCase)}get preserveCase(){return DK(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=_h.NotSet,this._wholeWord=!1,this._wholeWordOverride=_h.NotSet,this._matchCase=!1,this._matchCaseOverride=_h.NotSet,this._preserveCase=!1,this._preserveCaseOverride=_h.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 n={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,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),typeof i<"u"&&(F.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){const n={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,n.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.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=>!F.equalsRange(h,d)))||(this._searchScope=e.searchScope,n.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:_h.NotSet,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:_h.NotSet,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:_h.NotSet,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:_h.NotSet,r!==this.isRegex&&(o=!0,n.isRegex=!0),a!==this.wholeWord&&(o=!0,n.wholeWord=!0),c!==this.matchCase&&(o=!0,n.matchCase=!0),l!==this.preserveCase&&(o=!0,n.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Fx}}var yBt=".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}";ut(yBt,{});function zX(s){return s.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&s.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const HUe=oi("find-collapsed",ve.chevronRight,g(5053,"Icon to indicate that the editor find widget is collapsed.")),UUe=oi("find-expanded",ve.chevronDown,g(5054,"Icon to indicate that the editor find widget is expanded.")),CBt=oi("find-selection",ve.selection,g(5055,"Icon for 'Find in Selection' in the editor find widget.")),SBt=oi("find-replace",ve.replace,g(5056,"Icon for 'Replace' in the editor find widget.")),ABt=oi("find-replace-all",ve.replaceAll,g(5057,"Icon for 'Replace All' in the editor find widget.")),EBt=oi("find-previous-match",ve.arrowUp,g(5058,"Icon for 'Find Previous' in the editor find widget.")),xBt=oi("find-next-match",ve.arrowDown,g(5059,"Icon for 'Find Next' in the editor find widget.")),DBt=g(5060,"Find / Replace"),kBt=g(5061,"Find"),IBt=g(5062,"Find"),TBt=g(5063,"Previous Match"),LBt=g(5064,"Next Match"),RBt=g(5065,"Find in Selection"),MBt=g(5066,"Close"),NBt=g(5067,"Replace"),PBt=g(5068,"Replace"),FBt=g(5069,"Replace"),OBt=g(5070,"Replace All"),BBt=g(5071,"Toggle Replace"),WBt=g(5072,"Only the first {0} results are highlighted, but all find operations work on the entire text.",Fx),HBt=g(5073,"{0} of {1}"),VUe=g(5074,"No results"),Yb=419,UBt=275,VBt=UBt-54;let S4=69;const zBt=33,zUe="ctrlEnterReplaceAll.windows.donotask",$Ue=Qt?U.WinCtrl:U.CtrlCmd;class sue{constructor(e){this.afterLineNumber=e,this.heightInPx=zBt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function GUe(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function KUe(s,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 sue(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=mce.bindTo(r),this._findFocusTracker=this._register(Ac(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=JMe.bindTo(r),this._replaceFocusTracker=this._register(Ac(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 sue(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 $se.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:Wg.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=Pd(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,vt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=S4+"px",this._state.matchesCount>=Fx?this._matchesCount.title=WBt:this._matchesCount.title="",this._matchesCount.firstChild?.remove();let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Fx&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=$p(HBt,i,t)}else e=VUe;this._matchesCount.appendChild(document.createTextNode(e)),Mr(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),S4=Math.max(S4,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===VUe)return i===""?g(5075,"{0} found",e):g(5076,"{0} found for '{1}'",e,i);if(t){const n=g(5077,"{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)}, ${n}`:n}return g(5078,"{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 n=Cr(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=n.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const c=Vj(this._domNode).left;r>c&&(t=!1);const l=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.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(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.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 sue(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,n.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=n.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,n=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&Pd(this._domNode)>Yb){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=Pd(this._findInput.domNode);return}if(Yb+28+n>=i&&(r=!0),Yb+28+n-S4>=i&&(a=!0),Yb+28+n-S4>=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-n-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=Pd(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&&!F.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($Ue|S.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(S.Tab)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(U.CtrlCmd|S.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(S.UpArrow))return GUe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(S.DownArrow))return KUe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals($Ue|S.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Qn&&ad&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(g(5079,"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(zUe,!0,Ie.PROFILE,an.USER)),this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(S.Tab)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(U.Shift|S.Tab)){this._findInput.focus(),e.preventDefault();return}if(e.equals(U.CtrlCmd|S.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(S.UpArrow))return GUe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(S.DownArrow))return KUe(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 rbe(null,this._contextViewProvider,{width:VBt,label:kBt,placeholder:IBt,appendCaseSensitiveLabel:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(zo.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(zo.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return new RegExp(d,"gu"),null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>zX(this._keybindingService),inputBoxStyles:EM,toggleStyles:JY},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(U.Shift|S.Tab)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(S.Tab)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),pr&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register($k());this._prevBtn=this._register(new mP({label:TBt+this._keybindingLabelFor(zo.PreviousMatchFindAction),icon:EBt,hoverDelegate:i,onTrigger:()=>{qn(this._codeEditor.getAction(zo.PreviousMatchFindAction)).run().then(void 0,vt)}},this._hoverService)),this._nextBtn=this._register(new mP({label:LBt+this._keybindingLabelFor(zo.NextMatchFindAction),icon:xBt,hoverDelegate:i,onTrigger:()=>{qn(this._codeEditor.getAction(zo.NextMatchFindAction)).run().then(void 0,vt)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new ZA({icon:CBt,title:RBt+this._keybindingLabelFor(zo.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:ze(a6),inputActiveOptionBorder:ze(Kre),inputActiveOptionForeground:ze(qre)})),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 mP({label:MBt+this._keybindingLabelFor(zo.CloseFindWidgetCommand),icon:xYe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:d=>{d.equals(S.Tab)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),d.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new abe(null,void 0,{label:NBt,placeholder:PBt,appendPreserveCaseLabel:this._keybindingLabelFor(zo.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>zX(this._keybindingService),inputBoxStyles:EM,toggleStyles:JY},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(S.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($k());this._replaceBtn=this._register(new mP({label:FBt+this._keybindingLabelFor(zo.ReplaceOneAction),icon:SBt,hoverDelegate:r,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(U.Shift|S.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new mP({label:OBt+this._keybindingLabelFor(zo.ReplaceAllAction),icon:ABt,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 mP({label:BBt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Pd(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=DBt,this._domNode.role="dialog",this._domNode.style.width=`${Yb}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Od(this._domNode,this,{orientation:fi.VERTICAL,size:2})),this._resized=!1;let l=Yb;this._register(this._resizeSash.onDidStart(()=>{l=Pd(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=Pd(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=Pd(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};$se.ID="editor.contrib.findWidget";let Dwe=$se;class mP extends pd{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+We.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.setupManagedHover(e.hoverDelegate??Pr("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{if(n.equals(S.Space)||n.equals(S.Enter)){this._opts.onTrigger(),n.preventDefault();return}this._opts.onKeyDown?.(n)})}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(...We.asClassNameArray(HUe)),this._domNode.classList.add(...We.asClassNameArray(UUe))):(this._domNode.classList.remove(...We.asClassNameArray(UUe)),this._domNode.classList.add(...We.asClassNameArray(HUe)))}}Cp((s,e)=>{const t=s.getColor(Cx);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Ry(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(uft);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Ry(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(wt);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const o=s.getColor(dft);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=s.getColor(hft);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var kwe;const $Bt=524288;function Iwe(s,e="single",t=!1){if(!s.hasModel())return null;const i=s.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=s.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(s.getModel().getValueLengthInRange(i)<$Bt)return s.getModel().getValueInRange(i)}return null}var Z_;(function(s){s[s.NoFocusChange=0]="NoFocusChange",s[s.FocusFindInput=1]="FocusFindInput",s[s.FocusReplaceInput=2]="FocusReplaceInput"})(Z_||(Z_={}));var KL;let og=(KL=class extends V{get editor(){return this._editor}static get(e){return e.getContribution(kwe.ID)}constructor(e,t,i,n,o,r){super(),this._editor=e,this._findWidgetVisible=sE.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=o,this._hoverService=r,this._updateHistoryDelayer=new Mh(500),this._state=this._register(new wBt),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(a=>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",Ie.WORKSPACE,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",Ie.WORKSPACE,!1),isRegex:this._storageService.getBoolean("editor.isRegex",Ie.WORKSPACE,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",Ie.WORKSPACE,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Z_.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,Ie.WORKSPACE,an.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,Ie.WORKSPACE,an.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,Ie.WORKSPACE,an.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,Ie.WORKSPACE,an.MACHINE)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",Ie.WORKSPACE,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",Ie.WORKSPACE,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",Ie.WORKSPACE,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",Ie.WORKSPACE,this._state.preserveCase)},!1)}isFindInputFocused(){return!!mce.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=Rh(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 n=Iwe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Rh(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=Iwe(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(o=>!o.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new U5(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(1392,"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)}},kwe=KL,KL.ID="editor.contrib.findController",KL);og=kwe=D([_(1,Le),_(2,$i),_(3,dg),_(4,bi),_(5,ec)],og);let Twe=class extends og{constructor(e,t,i,n,o,r,a,c,l){super(e,i,a,c,r,l),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(x.find).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":{n=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(e.shouldFocus===Z_.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===Z_.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 Dwe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new xwe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};Twe=D([_(1,mf),_(2,Le),_(3,Ut),_(4,pn),_(5,bi),_(6,$i),_(7,dg),_(8,ec)],Twe);const GBt=iKe(new tKe({id:zo.StartFindAction,label:g(1393,"Find"),alias:"Find",precondition:he.or(J.focus,he.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:U.CtrlCmd|S.KeyF,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarEditMenu,group:"3_find",title:g(1394,"&&Find"),order:1}}));GBt.addImplementation(0,(s,e,t)=>{const i=og.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:Z_.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const KBt={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 qBt extends tt{constructor(){super({id:zo.StartFindWithArgs,label:g(1395,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:Ae.EditorContrib},metadata:KBt})}async run(e,t,i){const n=og.get(t);if(n){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 n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:Z_.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},o),n.setGlobalBufferTerm(n.getState().searchString)}}}class QBt extends tt{constructor(){super({id:zo.StartFindWithSelection,label:g(1396,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:U.CtrlCmd|S.KeyE},weight:Ae.EditorContrib}})}async run(e,t){const i=og.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Z_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class bet extends tt{async run(e,t){const i=og.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:Z_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class jBt extends bet{constructor(){super({id:zo.NextMatchFindAction,label:g(1397,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:J.focus,primary:S.F3,mac:{primary:U.CtrlCmd|S.KeyG,secondary:[S.F3]},weight:Ae.EditorContrib},{kbExpr:he.and(J.focus,mce),primary:S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class YBt extends bet{constructor(){super({id:zo.PreviousMatchFindAction,label:g(1398,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:J.focus,primary:U.Shift|S.F3,mac:{primary:U.CtrlCmd|U.Shift|S.KeyG,secondary:[U.Shift|S.F3]},weight:Ae.EditorContrib},{kbExpr:he.and(J.focus,mce),primary:U.Shift|S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class JBt extends tt{constructor(){super({id:zo.GoToMatchFindAction,label:g(1399,"Go to Match..."),alias:"Go to Match...",precondition:sE}),this._highlightDecorations=[]}run(e,t,i){const n=og.get(t);if(!n)return;const o=n.getState().matchesCount;if(o<1){e.get(bi).notify({severity:Xe.Warning,message:g(1400,"No matches. Try searching for something else.")});return}const a=e.get(In).createInputBox();a.placeholder=g(1401,"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=n.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,n.goToMatch(h);const u=n.getState().currentMatch;u&&this.addDecorations(t,u)}else a.validationMessage=g(1402,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{l(d)}),a.onDidAccept(()=>{const d=c(a.value);typeof d=="number"?(n.goToMatch(d),a.hide()):a.validationMessage=g(1402,"Please type a number between 1 and {0}",n.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:$o(Iqe),position:kl.Full}}}])})}}class wet extends tt{async run(e,t){const i=og.get(t);if(!i)return;const n=Iwe(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Z_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class XBt extends wet{constructor(){super({id:zo.NextSelectionMatchFindAction,label:g(1403,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|S.F3,weight:Ae.EditorContrib}})}_run(e){return e.moveToNextMatch()}}class ZBt extends wet{constructor(){super({id:zo.PreviousSelectionMatchFindAction,label:g(1404,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.F3,weight:Ae.EditorContrib}})}_run(e){return e.moveToPrevMatch()}}const e2t=iKe(new tKe({id:zo.StartFindReplaceAction,label:g(1405,"Replace"),alias:"Replace",precondition:he.or(J.focus,he.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:U.CtrlCmd|S.KeyH,mac:{primary:U.CtrlCmd|U.Alt|S.KeyF},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarEditMenu,group:"3_find",title:g(1406,"&&Replace"),order:2}}));e2t.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=og.get(e);if(!i)return!1;const n=e.getSelection(),o=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!o,a=o||r?Z_.FocusReplaceInput:Z_.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})});on(og.ID,Twe,ri.Eager);Re(qBt);Re(QBt);Re(jBt);Re(YBt);Re(JBt);Re(XBt);Re(ZBt);const $b=hc.bindToContribution(og.get);qe(new $b({id:zo.CloseFindWidgetCommand,precondition:sE,handler:s=>s.closeFindWidget(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new $b({id:zo.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:CK.primary,mac:CK.mac,win:CK.win,linux:CK.linux}}));qe(new $b({id:zo.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:SK.primary,mac:SK.mac,win:SK.win,linux:SK.linux}}));qe(new $b({id:zo.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:AK.primary,mac:AK.mac,win:AK.win,linux:AK.linux}}));qe(new $b({id:zo.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:EK.primary,mac:EK.mac,win:EK.win,linux:EK.linux}}));qe(new $b({id:zo.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:xK.primary,mac:xK.mac,win:xK.win,linux:xK.linux}}));qe(new $b({id:zo.ReplaceOneAction,precondition:sE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.Digit1}}));qe(new $b({id:zo.ReplaceOneAction,precondition:sE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,JMe),primary:S.Enter}}));qe(new $b({id:zo.ReplaceAllAction,precondition:sE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Alt|S.Enter}}));qe(new $b({id:zo.ReplaceAllAction,precondition:sE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,JMe),primary:void 0,mac:{primary:U.CtrlCmd|S.Enter}}}));qe(new $b({id:zo.SelectAllMatchesAction,precondition:sE,handler:s=>s.selectAllMatches(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.Alt|S.Enter}}));class t2t extends tt{constructor(){super({id:"editor.action.fontZoomIn",label:g(1389,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){Qp.setZoomLevel(Qp.getZoomLevel()+1)}}class i2t extends tt{constructor(){super({id:"editor.action.fontZoomOut",label:g(1390,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){Qp.setZoomLevel(Qp.getZoomLevel()-1)}}class n2t extends tt{constructor(){super({id:"editor.action.fontZoomReset",label:g(1391,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){Qp.setZoomLevel(0)}}Re(t2t);Re(i2t);Re(n2t);var FB;let $X=(FB=class{constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,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 jj;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const o=n.charCodeAt(n.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(),n=new ci,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){n.cancel(),o.dispose();return}for(let a=0,c=r.changes.length;a{n.token.isCancellationRequested||eo(r)&&(this._accessibilitySignalService.playSignal(cl.format,{userGesture:!1}),hW.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},FB.ID="editor.contrib.autoFormat",FB);$X=D([_(1,it),_(2,Ml),_(3,lv)],$X);var OB;let GX=(OB=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(Rae,this.editor,e,om.Silent,lu.None,He.None,!1).catch(vt))}},OB.ID="editor.contrib.formatOnPaste",OB);GX=D([_(1,it),_(2,we)],GX);class s2t extends tt{constructor(){super({id:"editor.action.formatDocument",label:g(1407,"Format Document"),alias:"Format Document",precondition:he.and(J.notInCompositeEditor,J.writable,J.hasDocumentFormattingProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyF,linux:{primary:U.CtrlCmd|U.Shift|S.KeyI},weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(we);await e.get(XA).showWhile(i.invokeFunction(Ave,t,om.Explicit,lu.None,He.None,!0),250)}}}class o2t extends tt{constructor(){super({id:"editor.action.formatSelection",label:g(1408,"Format Selection"),alias:"Format Selection",precondition:he.and(J.writable,J.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyF),weight:Ae.EditorContrib},contextMenuOpts:{when:J.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(we),n=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new F(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(XA).showWhile(i.invokeFunction(Rae,t,o,om.Explicit,lu.None,He.None,!0),250)}}on($X.ID,$X,ri.BeforeFirstInteraction);on(GX.ID,GX,ri.BeforeFirstInteraction);Re(s2t);Re(o2t);_t.registerCommand("editor.action.format",async s=>{const e=s.get(Kt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(vi);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class jw{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 n=i;for(let o=0;t.children.get(n)!==void 0;o++)n=`${i}_${o}`;return n}static getElementById(e,t){if(!e)return;const i=$y(e,t.id);if(i===e.length)return t;if(!(i0&&F.areIntersecting(e[n-1],t.symbol.range)&&(n-=1)):n=i;const o=[];let r;for(;nr)&&(r=a.severity)}for(const[,a]of t.children)this._updateMarker(o,a);r&&(t.marker={count:o.length,topSev:r}),uM(e)}}class Tw extends jw{static create(e,t,i){const n=new ci(i),o=new Tw(t.uri),r=e.ordered(t),a=r.map((l,d)=>{const h=jw.findId(`provider_${d}`,o),u=new Rwe(h,o,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,n.token)).then(f=>{for(const p of f||[])Tw._makeOutlineElement(p,u);return u},f=>(No(f),u)).then(f=>{jw.empty(f)?f.remove():o._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);is(l,r)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?Tw.create(e,t,i):o._compact()).finally(()=>{n.dispose(),c.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=jw.findId(e,t),n=new Lwe(i,t,e);if(e.children)for(const o of e.children)Tw._makeOutlineElement(o,n);t.children.set(n.id,n)}static get(e){for(;e;){if(e instanceof Tw)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=hi.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 Rwe&&(i=o),o=o.parent}let n;for(const[,o]of this._groups)if(n=o.getItemEnclosingPosition(e),n&&(!i||i===o))break;return n}getItemById(e){return jw.getElementById(e,this)}updateMarker(e){e.sort(F.compareRangesUsingStarts);for(const[,t]of this._groups)t.updateMarker(e.slice(0))}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof Lwe?e.push(t.symbol):e.push(...hi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>F.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Tw._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>oe.compare(F.getStartPosition(i.range),F.getStartPosition(n.range))||oe.compare(F.getEndPosition(n.range),F.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&Tw._flattenDocumentSymbols(e,n.children,n.name)}}const iG=ae("IOutlineModelService");let Mwe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new um(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(n=>{this._cache.delete(n.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!is(o.provider,n)){const a=new ci;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:Tw.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)}};Mwe=D([_(0,it),_(1,Sp),_(2,gi)],Mwe);ce(iG,Mwe,qt.Delayed);_t.registerCommand("_executeDocumentSymbolProvider",async function(s,...e){const[t]=e;Tt(N.isUri(t));const i=s.get(iG),o=await s.get(fn).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,He.None)).getTopLevelSymbols()}finally{o.dispose()}});const Gse=class Gse extends tt{constructor(){super({id:Gse.ID,label:g(5080,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){fu.get(t)?.model.get()?.next()}};Gse.ID=PXe;let Nwe=Gse;const Kse=class Kse extends tt{constructor(){super({id:Kse.ID,label:g(5081,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){fu.get(t)?.model.get()?.previous()}};Kse.ID=NXe;let Pwe=Kse;class r2t extends tt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:g(5082,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:J.writable})}async run(e,t){const i=fu.get(t);await xje(async n=>{await i?.model.get()?.triggerExplicitly(n),i?.playAccessibilitySignal(n)})}}class a2t extends tt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:g(5083,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|S.RightArrow,kbExpr:he.and(J.writable,ju.inlineSuggestionVisible)},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5084,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=fu.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class c2t extends tt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:g(5085,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:he.and(J.writable,ju.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5086,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=fu.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class l2t extends tt{constructor(){super({id:MXe,label:g(5087,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:ju.inlineSuggestionVisible,menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5088,"Accept"),group:"primary",order:1}],kbOpts:{primary:S.Tab,weight:200,kbExpr:he.and(ju.inlineSuggestionVisible,J.tabMovesFocus.toNegated(),ju.inlineSuggestionHasIndentationLessThanTabSize,Ui.Visible.toNegated(),J.hoverFocused.toNegated())}})}async run(e,t){const i=fu.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const qse=class qse extends tt{constructor(){super({id:qse.ID,label:g(5089,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:ju.inlineSuggestionVisible,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=fu.get(t);ts(n=>{i?.model.get()?.stop(n)})}};qse.ID="editor.action.inlineSuggest.hide";let Fwe=qse;const Qse=class Qse extends li{constructor(){super({id:Qse.ID,title:g(5090,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:_e.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:he.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Te),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)}};Qse.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let Owe=Qse;class d2t{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Bwe=class{constructor(e,t,i,n,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=fu.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Rt.CONTENT_VIEW_ZONE){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new aQ(1e3,this,F.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===Rt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new aQ(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Rt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new aQ(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=fu.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new d2t(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&i.add(this.renderScreenReaderText(e,n));const o=n.controller.model.get(),r=this._instantiationService.createInstance(_W,this._editor,!1,nd(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands),a=r.getDomNode();e.fragment.appendChild(a),o.triggerExplicitly(),i.add(r);const c={hoverPart:n,hoverElement:a,dispose(){i.dispose()}};return new UM([c])}getAccessibleContent(e){return g(5091,"There are inline completions here")}renderScreenReaderText(e,t){const i=new Z,n=fe,o=n("div.hover-row.markdown-hover"),r=re(o,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new Y_({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(5092,"Suggestion:"),h=i.add(a.render(new Mt().appendText(d).appendCodeblock("text",l)));r.replaceChildren(h.element)};return i.add(ai(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 aa(r)})),e.fragment.appendChild(o),i}};Bwe=D([_(1,xi),_(2,Ao),_(3,mr),_(4,we),_(5,Yi)],Bwe);class h2t{constructor(){this.type=wm.View,this.priority=95,this.name="inline-completions",this.when=he.and(ju.inlineSuggestionVisible)}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=fu.get(i)?.model.get();if(n?.state.get())return new u2t(i,n)}}class u2t extends V{constructor(e,t){super(),this._editor=e,this._model=t,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this.id=Pb.InlineCompletions,this.verbositySettingKey="accessibility.verbosity.inlineCompletions",this.options={language:this._editor.getModel()?.getLanguageId()??void 0,type:wm.View}}provideContent(){const e=this._model.state.get();if(!e)throw new Error("Inline completion is visible but state is not available");const t=this._model.textModel.getLineContent(e.primaryGhostText.lineNumber),i=e.primaryGhostText.renderForScreenReader(t);if(!i)throw new Error("Inline completion is visible but ghost text is not available");return t+i}provideNextContent(){this._model.next().then(()=>this._onDidChangeContent.fire())}providePreviousContent(){this._model.previous().then(()=>this._onDidChangeContent.fire())}onClose(){this._model.stop(),this._editor.focus()}}on(fu.ID,fu,ri.Eventually);Re(r2t);Re(Nwe);Re(Pwe);Re(a2t);Re(c2t);Re(l2t);Re(Fwe);At(Owe);GN.register(Bwe);U6.register(new h2t);var g2t=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";ut(g2t,{});var pV,jD;let KM=(jD=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,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 dce(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=>{vt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(pV.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===Rt.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 Tae(this.editor,jo.Position|jo.Value|jo.Selection|jo.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Rr(r=>this.findDefinition(e,r));let n;try{n=await this.previousPromise}catch(r){vt(r);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=n[0].originSelectionRange?F.lift(n[0].originSelectionRange):new F(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let r=o;for(const{originSelectionRange:a}of n)a&&(r=F.plusRange(r,a));this.addDecoration(r,new Mt().appendText(g(1444,"Click to show {0} definitions.",n.length)))}else{const r=n[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 Mt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=pV.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new Z6({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Le);return ng.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},pV=jD,jD.ID="editor.contrib.gotodefinitionatposition",jD.MAX_SOURCE_PREVIEW_LINES=8,jD);KM=pV=D([_(1,fn),_(2,xi),_(3,it)],KM);on(KM.ID,KM,ri.BeforeFirstInteraction);class qUe{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Wwe=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,N.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(a,c)=>{let l=gm(a.resource.toString(),c.resource.toString());return l===0&&(n==="position"?l=F.compareRangesUsingStarts(a,c)||Ws.compare(a.severity,c.severity):l=Ws.compare(a.severity,c.severity)||F.compareRangesUsingStarts(a,c)),l},r=()=>{this._markers=this._markerService.read({resource:N.isUri(e)?e:void 0,severities:Ws.Error|Ws.Warning|Ws.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 qUe(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=y2(this._markers,{resource:e.uri},(r,a)=>gm(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rn.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 Wwe(e,this._markerService,this._configService)}};Hwe=D([_(0,Am),_(1,Te)],Hwe);ce(yet,Hwe,qt.Delayed);var f2t='.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}';ut(f2t,{});var p2t=".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)}";ut(p2t,{});var Uwe;(function(s){function e(t){switch(t){case Xe.Ignore:return"severity-ignore "+We.asClassName(ve.info);case Xe.Info:return We.asClassName(ve.info);case Xe.Warning:return We.asClassName(ve.warning);case Xe.Error:return We.asClassName(ve.error);default:return""}}s.className=e})(Uwe||(Uwe={}));var Vwe;class m2t{constructor(e,t,i,n,o){this._openerService=n,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(Ro(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new Cqe(r,{horizontal:Co.Auto,vertical:Co.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(){bt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let r=(t?.length||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=ov(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Ms(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=fe("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=re(this._codeLink,fe("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(Ms(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),eo(n)){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 n){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 Ws.Error:t=g(5123,"Error");break;case Ws.Warning:t=g(5124,"Warning");break;case Ws.Info:t=g(5125,"Info");break;case Ws.Hint:t=g(5126,"Hint");break}let i=g(5127,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}var qL;let s9=(qL=class extends H3{constructor(e,t,i,n,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ws.Warning,this._backgroundColor=me.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(w2t);let t=zwe,i=_2t;this._severity===Ws.Warning?(t=uQ,i=v2t):this._severity===Ws.Info&&(t=$we,i=b2t);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(dMe),secondaryHeadingColor:e.getColor(hMe)})}_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(n=>this.editor.focus()));const t=[],i=this._menuService.getMenuActions(Vwe.TitleMenu,this._contextKeyService);fC(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=re(e,fe(""))}_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 m2t(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 n=F.lift(e),o=this.editor.getPosition(),r=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const c=i>1?g(5128,"{0} of {1} problems",t,i):g(5129,"{0} of {1} problem",t,i);this.setTitle(_i(a.uri),c)}this._icon.className=`codicon ${Uwe.className(Ws.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,mt.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()}},Vwe=qL,qL.TitleMenu=new _e("gotoErrorTitleMenu"),qL);s9=Vwe=D([_(1,pn),_(2,Ao),_(3,Oa),_(4,we),_(5,Le),_(6,Fs)],s9);const QUe=U8(TN,oft),jUe=U8(pm,V8),YUe=U8(mm,z8),zwe=W("editorMarkerNavigationError.background",{dark:QUe,light:QUe,hcDark:wt,hcLight:wt},g(5130,"Editor marker navigation widget error color.")),_2t=W("editorMarkerNavigationError.headerBackground",{dark:st(zwe,.1),light:st(zwe,.1),hcDark:null,hcLight:null},g(5131,"Editor marker navigation widget error heading background.")),uQ=W("editorMarkerNavigationWarning.background",{dark:jUe,light:jUe,hcDark:wt,hcLight:wt},g(5132,"Editor marker navigation widget warning color.")),v2t=W("editorMarkerNavigationWarning.headerBackground",{dark:st(uQ,.1),light:st(uQ,.1),hcDark:"#0C141F",hcLight:st(uQ,.2)},g(5133,"Editor marker navigation widget warning heading background.")),$we=W("editorMarkerNavigationInfo.background",{dark:YUe,light:YUe,hcDark:wt,hcLight:wt},g(5134,"Editor marker navigation widget info color.")),b2t=W("editorMarkerNavigationInfo.headerBackground",{dark:st($we,.1),light:st($we,.1),hcDark:null,hcLight:null},g(5135,"Editor marker navigation widget info heading background.")),w2t=W("editorMarkerNavigation.background",Hc,g(5136,"Editor marker navigation widget background."));var mV,QL;let qM=(QL=class{static get(e){return e.getContribution(mV.ID)}constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=Cet.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(s9,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||!F.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:F.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 n=await this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:rA.NearTop,selection:i.selected.marker}},this._editor);n&&(mV.get(n)?.close(),mV.get(n)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},mV=QL,QL.ID="editor.contrib.markerController",QL);qM=mV=D([_(1,yet),_(2,Le),_(3,Kt),_(4,we)],qM);class _ce extends tt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&qM.get(t)?.nagivate(this._next,this._multiFile)}}const m1=class m1 extends _ce{constructor(){super(!0,!1,{id:m1.ID,label:m1.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Alt|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:s9.TitleMenu,title:m1.LABEL,icon:oi("marker-navigation-next",ve.arrowDown,g(1446,"Icon for goto next marker.")),group:"navigation",order:1}})}};m1.ID="editor.action.marker.next",m1.LABEL=g(1445,"Go to Next Problem (Error, Warning, Info)");let KX=m1;const _1=class _1 extends _ce{constructor(){super(!1,!1,{id:_1.ID,label:_1.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Shift|U.Alt|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:s9.TitleMenu,title:_1.LABEL,icon:oi("marker-navigation-previous",ve.arrowUp,g(1448,"Icon for goto previous marker.")),group:"navigation",order:2}})}};_1.ID="editor.action.marker.prev",_1.LABEL=g(1447,"Go to Previous Problem (Error, Warning, Info)");let Gwe=_1;class y2t extends _ce{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g(1449,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarGoMenu,title:g(1450,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class C2t extends _ce{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g(1451,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Shift|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarGoMenu,title:g(1452,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}on(qM.ID,qM,ri.Lazy);Re(KX);Re(Gwe);Re(y2t);Re(C2t);const Cet=new Q("markersNavigationVisible",!1),S2t=hc.bindToContribution(qM.get);qe(new S2t({id:"closeMarkersNavigation",precondition:Cet,handler:s=>s.close(),kbOpts:{weight:Ae.EditorContrib+50,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));var Rv;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Rv||(Rv={}));class A2t extends tt{constructor(){super({id:xZe,label:g(5137,"Show or Focus Hover"),metadata:{description:Pe(5138,"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:[Rv.NoAutoFocus,Rv.FocusIfVisible,Rv.AutoFocusImmediately],enumDescriptions:[g(5139,"The hover will not automatically take focus."),g(5140,"The hover will take focus only if it is already visible."),g(5141,"The hover will automatically take focus when it appears.")],default:Rv.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyI),weight:Ae.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const n=Pa.get(t);if(!n)return;const o=i?.focus;let r=Rv.FocusIfVisible;Object.values(Rv).includes(o)?r=o:typeof o=="boolean"&&o&&(r=Rv.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new F(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,oC.Immediate,FA.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===Jl.Enabled;n.isHoverVisible?r!==Rv.NoAutoFocus?n.focus():a(c):a(c||r===Rv.AutoFocusImmediately)}}class E2t extends tt{constructor(){super({id:yPt,label:g(5142,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0,metadata:{description:Pe(5143,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Pa.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new F(n.lineNumber,n.column,n.lineNumber,n.column),r=KM.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,oC.Immediate,FA.Keyboard,!0)})}}class x2t extends tt{constructor(){super({id:CPt,label:g(5144,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.UpArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5145,"Scroll up the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollUp()}}class D2t extends tt{constructor(){super({id:SPt,label:g(5146,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.DownArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5147,"Scroll down the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollDown()}}class k2t extends tt{constructor(){super({id:APt,label:g(5148,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.LeftArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5149,"Scroll left the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollLeft()}}class I2t extends tt{constructor(){super({id:EPt,label:g(5150,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.RightArrow,weight:Ae.EditorContrib},metadata:{description:Pe(5151,"Scroll right the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollRight()}}class T2t extends tt{constructor(){super({id:xPt,label:g(5152,"Page Up Hover"),alias:"Page Up Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.PageUp,secondary:[U.Alt|S.UpArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5153,"Page up the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.pageUp()}}class L2t extends tt{constructor(){super({id:DPt,label:g(5154,"Page Down Hover"),alias:"Page Down Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.PageDown,secondary:[U.Alt|S.DownArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5155,"Page down the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.pageDown()}}class R2t extends tt{constructor(){super({id:kPt,label:g(5156,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.Home,secondary:[U.CtrlCmd|S.UpArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5157,"Go to the top of the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.goToTop()}}class M2t extends tt{constructor(){super({id:IPt,label:g(5158,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.End,secondary:[U.CtrlCmd|S.DownArrow],weight:Ae.EditorContrib},metadata:{description:Pe(5159,"Go to the bottom of the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.goToBottom()}}class N2t extends tt{constructor(){super({id:zU,label:LPt,alias:"Increase Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Pa.get(t);if(!n)return;const o=i?.index!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(Mc.Increase,o,i?.focus)}}class P2t extends tt{constructor(){super({id:$U,label:MPt,alias:"Decrease Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Pa.get(t);if(!n)return;const o=i?.index!==void 0?i.index:n.focusedHoverPartIndex();Pa.get(t)?.updateHoverVerbosityLevel(Mc.Decrease,o,i?.focus)}}const Nm=fe;class F2t{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===du.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const JUe={type:Ch.Invoke,filter:{include:ys.QuickFix},triggerAction:sg.QuickFixHover};let Kwe=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==du.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];for(const a of t){const c=a.range.startLineNumber===n?a.range.startColumn:1,l=a.range.endLineNumber===n?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new F(e.range.startLineNumber,c,e.range.startLineNumber,l);r.push(new F2t(this,h,d))}return r}renderHoverParts(e,t){if(!t.length)return new UM([]);const i=new Z,n=[];t.forEach(r=>{const a=this._renderMarkerHover(r);e.fragment.appendChild(a.hoverElement),n.push(a)});const o=t.length===1?t[0]:t.sort((r,a)=>Ws.compare(r.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,o,i),new UM(n)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new Z,i=Nm("div.hover-row"),n=re(i,Nm("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(n);const l=re(n,Nm("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=r,o||a)if(a&&typeof a!="string"){const h=Nm("span");if(o){const m=re(h,Nm("span"));m.innerText=o}const u=re(h,Nm("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ue(u,"click",m=>{this._openerService.open(a.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));const f=re(u,Nm("span"));f.innerText=a.value;const p=re(n,h);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const h=re(n,Nm("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(eo(c))for(const{message:h,resource:u,startLineNumber:f,startColumn:p}of c){const m=re(n,Nm("div"));m.style.marginTop="8px";const v=re(m,Nm("a"));v.innerText=`${_i(u)}(${f}, ${p}): `,v.style.cursor="pointer",t.add(ue(v,"click",w=>{w.stopPropagation(),w.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:f,startColumn:p}}}).catch(vt)}));const b=re(m,Nm("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Ws.Error||t.marker.severity===Ws.Warning||t.marker.severity===Ws.Info){const n=qM.get(this._editor);n&&e.statusBar.addAction({label:g(5169,"View Problem"),commandId:KX.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const n=e.statusBar.append(Nm("div"));this.recentMarkerCodeActionsInfo&&(ZY.makeKey(this.recentMarkerCodeActionsInfo.marker)===ZY.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g(5170,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?V.None:jy(()=>n.textContent=g(5171,"Checking for quick fixes..."),200,i);n.textContent||(n.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(),n.textContent=g(5170,"No quick fixes available");return}n.style.display="none";let c=!1;i.add(Ee(()=>{c||a.dispose()})),e.statusBar.addAction({label:g(5172,"Quick Fix..."),commandId:kMe,run:l=>{c=!0;const d=WM.get(this._editor),h=Cr(l);e.hide(),d?.showCodeActions(JUe,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},vt)}}getCodeActions(e){return Rr(t=>ZO(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),JUe,lu.None,t))}};Kwe=D([_(1,DTe),_(2,Ao),_(3,it)],Kwe);var qX;(function(s){s.increaseVerbosity=g(5173,"- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.",``),s.decreaseVerbosity=g(5174,"- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.",``)})(qX||(qX={}));class O2t{constructor(){this.type=wm.View,this.priority=95,this.name="hover",this.when=J.hoverFocused}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Pa.get(i);if(!n)return;const o=e.get(Ut);return e.get(we).createInstance(W2t,o,i,n)}}class B2t{constructor(){this.priority=100,this.name="hover",this.type=wm.Help,this.when=J.hoverVisible}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Pa.get(i);if(n)return e.get(we).createInstance(Eet,n)}}class Aet extends V{constructor(e){super(),this._hoverController=e,this.id=Pb.Hover,this.verbositySettingKey="accessibility.verbosity.hover",this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._focusedHoverPartIndex=-1}onOpen(){this._hoverController&&(this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!0,this._focusedHoverPartIndex=this._hoverController.focusedHoverPartIndex(),this._register(this._hoverController.onHoverContentsChanged(()=>{this._onDidChangeContent.fire()})))}onClose(){this._hoverController&&(this._focusedHoverPartIndex===-1?this._hoverController.focus():this._hoverController.focusHoverPartWithIndex(this._focusedHoverPartIndex),this._focusedHoverPartIndex=-1,this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!1)}provideContentAtIndex(e,t){if(e!==-1){const i=this._hoverController.getAccessibleWidgetContentAtIndex(e);if(i===void 0)return"";const n=[];return t&&n.push(...this._descriptionsOfVerbosityActionsForIndex(e)),n.push(i),n.join(` +`)),primaryButton:g(774,"&&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)}};Fse.SIZE_THRESHOLD=1024*16;let hwe=Fse,L1,BX=new Set;const xT=new Y("dirtyWorkingCopies","stopped");class hOt extends li{constructor(){super({id:"workbench.action.startTrackDisposables",title:Fe(775,"Start Tracking Disposables"),category:ca.Developer,f1:!0,precondition:he.and(xT.isEqualTo("pending").negate(),xT.isEqualTo("started").negate())})}run(e){xT.bindTo(e.get(Le)).set("started"),BX.clear(),L1=new zge,T6e(L1)}}class uOt extends li{constructor(){super({id:"workbench.action.snapshotTrackedDisposables",title:Fe(776,"Snapshot Tracked Disposables"),category:ca.Developer,f1:!0,precondition:xT.isEqualTo("started")})}run(e){xT.bindTo(e.get(Le)).set("pending"),BX=new Set(L1?.computeLeakingDisposables(1e3)?.leaks.map(i=>i.value))}}class gOt extends li{constructor(){super({id:"workbench.action.stopTrackDisposables",title:Fe(777,"Stop Tracking Disposables"),category:ca.Developer,f1:!0,precondition:xT.isEqualTo("pending")})}run(e){const t=e.get(ei);if(xT.bindTo(e.get(Le)).set("stopped"),L1){const n=new Set;for(const r of new Set(L1.computeLeakingDisposables(1e3)?.leaks)??[])BX.has(r.value)&&n.add(r);const o=L1.computeLeakingDisposables(1e3,Array.from(n));o&&t.openEditor({resource:void 0,contents:o.details})}T6e(null),L1=void 0,BX.clear()}}At(cOt);At(pF);At(lOt);At(dOt);At(hwe);aOt.commit||(At(hOt),At(uOt),At(gOt));const fOt=Qe.as(Nn.Configuration);fOt.registerConfiguration({id:"screencastMode",order:9,title:g(778,"Screencast Mode"),type:"object",properties:{"screencastMode.verticalOffset":{type:"number",default:20,minimum:0,maximum:90,description:g(779,"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(780,"Controls the font size (in pixels) of the screencast mode keyboard.")},"screencastMode.keyboardOptions":{type:"object",description:g(781,"Options for customizing the keyboard overlay in screencast mode."),properties:{showKeys:{type:"boolean",default:!0,description:g(782,"Show raw keys.")},showKeybindings:{type:"boolean",default:!0,description:g(783,"Show keyboard shortcuts.")},showCommands:{type:"boolean",default:!0,description:g(784,"Show command names.")},showCommandGroups:{type:"boolean",default:!1,description:g(785,"Show command group names, when commands are also shown.")},showSingleEditorCursorMoves:{type:"boolean",default:!0,description:g(786,"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(787,"Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")},"screencastMode.mouseIndicatorColor":{type:"string",format:"color-hex",default:"#FF0000",description:g(788,"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(789,"Controls the size (in pixels) of the mouse indicator in screencast mode.")}}});At(DRt);At(wXe);At(yXe);jn.appendMenuItem(_e.EditorTitle,{command:{id:new yXe().desc.id,title:g(1324,"Use Inline View When Space Is Limited"),toggled:he.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:he.has("isInDiffEditor")},order:11,group:"1_diff",when:he.and(J.diffEditorRenderSideBySideInlineBreakpointReached,he.has("isInDiffEditor"))});jn.appendMenuItem(_e.EditorTitle,{command:{id:new wXe().desc.id,title:g(1325,"Show Moved Code Blocks"),icon:ve.move,toggled:bN.create("config.diffEditor.experimental.showMoves",!0),precondition:he.has("isInDiffEditor")},order:10,group:"1_diff",when:he.has("isInDiffEditor")});At(zve);for(const s of[{icon:ve.arrowRight,key:J.diffEditorInlineMode.toNegated()},{icon:ve.discard,key:J.diffEditorInlineMode}])jn.appendMenuItem(_e.DiffEditorHunkToolbar,{command:{id:new zve().desc.id,title:g(1326,"Revert Block"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),jn.appendMenuItem(_e.DiffEditorSelectionToolbar,{command:{id:new zve().desc.id,title:g(1327,"Revert Selection"),icon:s.icon},when:he.and(J.diffEditorModifiedWritable,s.key),order:5,group:"primary"});At(kRt);At(IRt);At(TRt);At(LRt);jn.appendMenuItem(_e.EditorTitle,{command:{id:uW.id,title:g(1328,"Open Accessible Diff Viewer"),precondition:he.has("isInDiffEditor")},order:10,group:"2_diff",when:he.and(J.accessibleDiffViewerVisible.negate(),he.has("isInDiffEditor"))});_t.registerCommandAlias("editor.action.diffReview.next",uW.id);At(uW);_t.registerCommandAlias("editor.action.diffReview.prev",H3.id);At(H3);var pOt=".monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}";ut(pOt,{});var uwe;const hce=new Y("selectionAnchorSet",!1);var BL;let Yk=(BL=class{static get(e){return e.getContribution(uwe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=hce.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(dt.fromPositions(e,e),{description:"selection-anchor",stickiness:ni.NeverGrowsWhenTypingAtEdges,hoverMessage:new Mt().appendText(g(1329,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Mr(g(1330,"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(dt.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()}},uwe=BL,BL.ID="editor.contrib.selectionAnchorController",BL);Yk=uwe=D([_(1,Le)],Yk);class mOt extends tt{constructor(){super({id:"editor.action.setSelectionAnchor",label:g(1331,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyB),weight:Ae.EditorContrib}})}async run(e,t){Yk.get(t)?.setSelectionAnchor()}}class _Ot extends tt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:g(1332,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:hce})}async run(e,t){Yk.get(t)?.goToSelectionAnchor()}}class vOt extends tt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:g(1333,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:hce,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyK),weight:Ae.EditorContrib}})}async run(e,t){Yk.get(t)?.selectFromAnchorToCursor()}}class bOt extends tt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:g(1334,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:hce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.Escape,weight:Ae.EditorContrib}})}async run(e,t){Yk.get(t)?.cancelSelectionAnchor()}}on(Yk.ID,Yk,ri.Lazy);Me(mOt);Me(_Ot);Me(vOt);Me(bOt);var wOt=".monaco-editor .bracket-match{background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border);box-sizing:border-box}";ut(wOt,{});const yOt=W("editorOverviewRuler.bracketMatchForeground","#A0A0A0",g(1337,"Overview ruler marker color for matching brackets."));class COt extends tt{constructor(){super({id:"editor.action.jumpToBracket",label:g(1338,"Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Backslash,weight:Ae.EditorContrib}})}run(e,t){FA.get(t)?.jumpToBracket()}}class SOt extends tt{constructor(){super({id:"editor.action.selectToBracket",label:g(1339,"Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Fe(1340,"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 n=!0;i&&i.selectBrackets===!1&&(n=!1),FA.get(t)?.selectToBracket(n)}}class AOt extends tt{constructor(){super({id:"editor.action.removeBrackets",label:g(1341,"Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.Backspace,weight:Ae.EditorContrib}})}run(e,t){FA.get(t)?.removeBrackets(this.id)}}class EOt{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const zE=class zE extends V{static get(e){return e.getContribution(zE.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new cn(()=>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 n=i.getStartPosition(),o=e.bracketPairs.matchBracket(n);let r=null;if(o)o[0].containsPosition(n)&&!o[1].containsPosition(n)?r=o[1].getStartPosition():o[1].containsPosition(n)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const c=e.bracketPairs.findNextBracket(n);c&&c.range&&(r=c.range.getStartPosition())}}return r?new dt(r.lineNumber,r.column,r.lineNumber,r.column):new dt(n.lineNumber,n.column,n.lineNumber,n.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(n=>{const o=n.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(F.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 dt(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 n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),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 n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[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 n=[];this._lastVersionId===i&&(n=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=n.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Me(IOt);const HM="9_cutcopypaste",TOt=od||document.queryCommandSupported("cut"),oet=od||document.queryCommandSupported("copy"),LOt=typeof navigator.clipboard>"u"||nf?document.queryCommandSupported("paste"):!0;function FMe(s){return s.register(),s}const ROt=TOt?FMe(new fI({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:od?{primary:U.CtrlCmd|S.KeyX,win:{primary:U.CtrlCmd|S.KeyX,secondary:[U.Shift|S.Delete]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1346,"Cu&&t"),order:1},{menuId:_e.EditorContext,group:HM,title:g(1347,"Cut"),when:J.writable,order:1},{menuId:_e.CommandPalette,group:"",title:g(1347,"Cut"),order:1},{menuId:_e.SimpleEditorContext,group:HM,title:g(1347,"Cut"),when:J.writable,order:1}]})):void 0,MOt=oet?FMe(new fI({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:od?{primary:U.CtrlCmd|S.KeyC,win:{primary:U.CtrlCmd|S.KeyC,secondary:[U.CtrlCmd|S.Insert]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1348,"&&Copy"),order:2},{menuId:_e.EditorContext,group:HM,title:g(1349,"Copy"),order:2},{menuId:_e.CommandPalette,group:"",title:g(1349,"Copy"),order:1},{menuId:_e.SimpleEditorContext,group:HM,title:g(1349,"Copy"),order:2}]})):void 0;jn.appendMenuItem(_e.MenubarEditMenu,{submenu:_e.MenubarCopy,title:Fe(1350,"Copy As"),group:"2_ccp",order:3});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextCopy,title:Fe(1350,"Copy As"),group:HM,order:3});jn.appendMenuItem(_e.EditorContext,{submenu:_e.EditorContextShare,title:Fe(1351,"Share"),group:"11_share",order:-1,when:he.and(he.notEquals("resourceScheme","output"),J.editorTextFocus)});jn.appendMenuItem(_e.ExplorerContext,{submenu:_e.ExplorerContextShare,title:Fe(1351,"Share"),group:"11_share",order:-1});const qhe=LOt?FMe(new fI({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:od?{primary:U.CtrlCmd|S.KeyV,win:{primary:U.CtrlCmd|S.KeyV,secondary:[U.Shift|S.Insert]},linux:{primary:U.CtrlCmd|S.KeyV,secondary:[U.Shift|S.Insert]},weight:Ae.EditorContrib}:void 0,menuOpts:[{menuId:_e.MenubarEditMenu,group:"2_ccp",title:g(1352,"&&Paste"),order:4},{menuId:_e.EditorContext,group:HM,title:g(1353,"Paste"),when:J.writable,order:4},{menuId:_e.CommandPalette,group:"",title:g(1353,"Paste"),order:1},{menuId:_e.SimpleEditorContext,group:HM,title:g(1353,"Paste"),when:J.writable,order:4}]})):void 0;class NOt extends tt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:g(1354,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t){!t.hasModel()||!t.getOption(x.emptySelectionClipboard)&&t.getSelection().isEmpty()||(Kpe.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Kpe.forceCopyWithSyntaxHighlighting=!1)}}function ret(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Kt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const o=n.getOption(x.emptySelectionClipboard),r=n.getSelection();return r&&r.isEmpty()&&!o||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(Bu().execCommand(e),!0)))}ret(ROt,"cut");ret(MOt,"copy");qhe&&(qhe.addImplementation(1e4,"code-editor",(s,e)=>{const t=s.get(Kt),i=s.get(ag),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?n.getContainerDomNode().ownerDocument.execCommand("paste")?tC.get(n)?.finishedPaste()??Promise.resolve():Wn?(async()=>{const r=await i.readText();if(r!==""){const a=Q8.INSTANCE.get(r);let c=!1,l=null,d=null;a&&(c=n.getOption(x.emptySelectionClipboard)&&!!a.isFromEmptySelection,l=typeof a.multicursorText<"u"?a.multicursorText:null,d=a.mode),n.trigger("keyboard",oc.Paste,{text:r,pasteOnNewLine:c,multicursorText:l,mode:d})}})():!0:!1}),qhe.addImplementation(0,"generic-dom",(s,e)=>(Bu().execCommand("paste"),!0)));oet&&Me(NOt);function J6(s){return he.regex(gZe.keys()[0],new RegExp("(\\s|^)"+Th(s.value)+"\\b"))}const OMe={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:g(5e3,"Kind of the code action to run.")},apply:{type:"string",description:g(5001,"Controls when the returned actions are applied."),default:id.IfSingle,enum:[id.First,id.IfSingle,id.Never],enumDescriptions:[g(5002,"Always apply the first returned code action."),g(5003,"Apply the first returned code action if it is the only one."),g(5004,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:g(5005,"Controls if only preferred code actions should be returned.")}}};function VN(s,e,t,i,n=tg.Default){s.hasModel()&&PM.get(s)?.manualTriggerAtCurrentPosition(e,n,t,i)}class POt extends tt{constructor(){super({id:mMe,label:g(5006,"Quick Fix..."),alias:"Quick Fix...",precondition:he.and(J.writable,J.hasCodeActionsProvider),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Period,weight:Ae.EditorContrib}})}run(e,t){return VN(t,g(5007,"No code actions available"),void 0,void 0,tg.QuickFix)}}class FOt extends hc{constructor(){super({id:pMe,precondition:he.and(J.writable,J.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:OMe}]}})}runEditorCommand(e,t,i){const n=$w.fromUser(i,{kind:Yn.Empty,apply:id.IfSingle});return VN(t,typeof i?.kind=="string"?n.preferred?g(5008,"No preferred code actions for '{0}' available",i.kind):g(5009,"No code actions for '{0}' available",i.kind):n.preferred?g(5010,"No preferred code actions available"):g(5011,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class OOt extends tt{constructor(){super({id:_Me,label:g(5012,"Refactor..."),alias:"Refactor...",precondition:he.and(J.writable,J.hasCodeActionsProvider),kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|S.KeyR,mac:{primary:U.WinCtrl|U.Shift|S.KeyR},weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:2,when:he.and(J.writable,J6(ys.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:OMe}]}})}run(e,t,i){const n=$w.fromUser(i,{kind:ys.Refactor,apply:id.Never});return VN(t,typeof i?.kind=="string"?n.preferred?g(5013,"No preferred refactorings for '{0}' available",i.kind):g(5014,"No refactorings for '{0}' available",i.kind):n.preferred?g(5015,"No preferred refactorings available"):g(5016,"No refactorings available"),{include:ys.Refactor.contains(n.kind)?n.kind:Yn.None,onlyIncludePreferredActions:n.preferred},n.apply,tg.Refactor)}}class BOt extends tt{constructor(){super({id:vMe,label:g(5017,"Source Action..."),alias:"Source Action...",precondition:he.and(J.writable,J.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:he.and(J.writable,J6(ys.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:OMe}]}})}run(e,t,i){const n=$w.fromUser(i,{kind:ys.Source,apply:id.Never});return VN(t,typeof i?.kind=="string"?n.preferred?g(5018,"No preferred source actions for '{0}' available",i.kind):g(5019,"No source actions for '{0}' available",i.kind):n.preferred?g(5020,"No preferred source actions available"):g(5021,"No source actions available"),{include:ys.Source.contains(n.kind)?n.kind:Yn.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,tg.SourceAction)}}class WOt extends tt{constructor(){super({id:Sbe,label:g(5022,"Organize Imports"),alias:"Organize Imports",precondition:he.and(J.writable,J6(ys.SourceOrganizeImports)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Shift|U.Alt|S.KeyO,weight:Ae.EditorContrib}})}run(e,t){return VN(t,g(5023,"No organize imports action available"),{include:ys.SourceOrganizeImports,includeSourceActions:!0},id.IfSingle,tg.OrganizeImports)}}class HOt extends tt{constructor(){super({id:Abe,label:g(5024,"Fix All"),alias:"Fix All",precondition:he.and(J.writable,J6(ys.SourceFixAll))})}run(e,t){return VN(t,g(5025,"No fix all action available"),{include:ys.SourceFixAll,includeSourceActions:!0},id.IfSingle,tg.FixAll)}}class UOt extends tt{constructor(){super({id:aZe,label:g(5026,"Auto Fix..."),alias:"Auto Fix...",precondition:he.and(J.writable,J6(ys.QuickFix)),kbOpts:{kbExpr:J.textInputFocus,primary:U.Alt|U.Shift|S.Period,mac:{primary:U.CtrlCmd|U.Alt|S.Period},weight:Ae.EditorContrib}})}run(e,t){return VN(t,g(5027,"No auto fixes available"),{include:ys.QuickFix,onlyIncludePreferredActions:!0},id.IfSingle,tg.AutoFix)}}on(PM.ID,PM,ri.Eventually);on(G3.ID,G3,ri.Lazy);Me(POt);Me(OOt);Me(BOt);Me(WOt);Me(UOt);Me(HOt);qe(new FOt);Qe.as(Nn.Configuration).registerConfiguration({...Wb,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,description:g(1355,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});Qe.as(Nn.Configuration).registerConfiguration({...Wb,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,description:g(1356,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Qe.as(Nn.Configuration).registerConfiguration({...Wb,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:at.LANGUAGE_OVERRIDABLE,markdownDescription:g(1357,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});class gwe{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 aet(s,e,t){const i=s.ordered(e),n=new Map,o=new gwe,r=i.map(async(a,c)=>{n.set(a,c);try{const l=await Promise.resolve(a.provideCodeLenses(e,t));l&&o.add(l,a)}catch(l){No(l)}});return await Promise.all(r),o.lenses=o.lenses.sort((a,c)=>a.symbol.range.startLineNumberc.symbol.range.startLineNumber?1:n.get(a.provider)n.get(c.provider)?1:a.symbol.range.startColumnc.symbol.range.startColumn?1:0),o}_t.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;Tt(N.isUri(t)),Tt(typeof i=="number"||!i);const{codeLensProvider:n}=s.get(it),o=s.get(gi).getModel(t);if(!o)throw Pi();const r=[],a=new Z;return aet(n,o,He.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,He.None)).then(h=>r.push(h||d.symbol)));return Promise.all(l)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});const cet=ae("ICodeLensCache");class yUe{constructor(e,t){this.lineCount=e,this.data=t}}let fwe=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new lm(20,.75);const t="codelens/cache";QP(si,()=>e.remove(t,Ie.WORKSPACE));const i="codelens/cache2",n=e.get(i,Ie.WORKSPACE,"{}");this._deserialize(n);const o=M.filter(e.onWillSaveState,r=>r.reason===_y.SHUTDOWN);M.once(o)(r=>{e.store(i,this._serialize(),Ie.WORKSPACE,an.MACHINE)})}put(e,t){const i=t.lenses.map(r=>({range:r.symbol.range,command:r.symbol.command&&{id:"",title:r.symbol.command?.title}})),n=new gwe;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new yUe(e.getLineCount(),n);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 n=new Set;for(const o of i.data.lenses)n.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],o=[];for(const a of n.lines)o.push({range:new F(a,1,a,11)});const r=new gwe;r.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new yUe(n.lineCount,r))}}catch{}}};fwe=D([_(0,$i)],fwe);ce(cet,fwe,qt.Delayed);var VOt=".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}";ut(VOt,{});class zOt{constructor(e,t,i){this.afterColumn=Un.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 $z=class $z{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${$z._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let o=0;o{l.symbol.command&&c.push(l.symbol),i.addDecoration({range:l.symbol.range,options:CUe},h=>this._decorationIds[d]=h),a?a=F.plusRange(a,l.symbol.range):a=F.lift(l.symbol.range)}),this._viewZone=new zOt(a.startLineNumber-1,o,r),this._viewZoneId=n.addZone(this._viewZone),c.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(c,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new pwe(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),n=this._data[t].symbol;return!!(i&&F.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:CUe},o=>this._decorationIds[n]=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),n=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",n.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",rd.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&&Ky(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const o=n.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new cn(()=>{const n=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Rr(o=>aet(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()-n);i.delay=r,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},vt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ee(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{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 Qhe;r.forEach(l=>{l.dispose(c,o),this._lenses.splice(this._lenses.indexOf(l),1)}),c.commit(n)})}),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(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ee(()=>{if(this._editor.getModel()){const n=pm.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==Rt.CONTENT_WIDGET)return;let o=n.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 Qhe;for(const n of this._lenses)n.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 n;for(const a of e.lenses){const c=a.symbol.range.startLineNumber;c<1||c>t||(n&&n[n.length-1].symbol.range.startLineNumber===c?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const o=pm.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(c=>{const l=new Qhe;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 n=Date.now(),o=Rr(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},No):(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()-n);this._resolveCodeLensesScheduler.delay=r,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},r=>{vt(r),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},LB.ID="css.editor.codeLens",LB);e9=D([_(1,it),_(2,wp),_(3,vi),_(4,bi),_(5,cet)],e9);on(e9.ID,e9,ri.AfterFirstRender);Me(class extends tt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:J.hasCodeLensProvider,label:g(1358,"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(In),n=e.get(vi),o=e.get(bi),r=t.getSelection().positionLineNumber,a=t.getContribution(e9.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(1359,"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 n.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});const Ose=class Ose extends V{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!==Rt.CONTENT_TEXT||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==IZe||!i.range)return;const n=this._editor.getContribution(Pa.ID);if(n&&!n.isColorPickerVisible){const o=new F(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(o,iC.Immediate,NA.Mouse,!1,!0)}}};Ose.ID="editor.contrib.colorContribution",Ose.RECOMPUTE_TIME=1e3;let WX=Ose;on(WX.ID,WX,ri.BeforeFirstInteraction);UN.register(q3);var mwe,_we,WL;let UM=(WL=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=o,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=J.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=J.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=new vwe(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(mwe.ID)}},mwe=WL,WL.ID="editor.contrib.standaloneColorPickerController",WL);UM=mwe=D([_(1,Le),_(2,gi),_(3,Ut),_(4,we),_(5,it),_(6,Vs)],UM);on(UM.ID,UM,ri.AfterFirstRender);const AUe=8,$Ot=22;var HL;let vwe=(HL=class extends V{constructor(e,t,i,n,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=n.createInstance(Q3,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(Ac(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 _we.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?[es.ABOVE,es.BELOW]:[es.BELOW,es.ABOVE],positionAffinity:Io.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 GOt(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 yMe(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new bX(this._keybindingService)),o={fragment:i,statusBar:n,onContentsChanged:()=>{},hide:()=>this.hide()};this._colorHover=e;const r=this._standaloneColorPickerParticipant.renderHoverParts(o,[e]);if(!r)return;this._register(r.disposables);const a=r.colorPicker;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),a.layout();const c=a.body,l=c.saturationBox.domNode.clientWidth,d=c.domNode.clientWidth-l-$Ot-AUe,h=a.body.enterButton;h?.onClicked(()=>{this.updateEditor(),this.hide()});const u=a.header,f=u.pickedColorNode;f.style.width=l+AUe+"px";const p=u.originalColorNode;p.style.width=d+"px",a.header.closeButton?.onClicked(()=>{this.hide()}),t&&(h&&(h.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},_we=HL,HL.ID="editor.contrib.standaloneColorPickerWidget",HL);vwe=_we=D([_(3,we),_(4,gi),_(5,Ut),_(6,it),_(7,Vs)],vwe);class GOt{constructor(e,t){this.value=e,this.foundInEditor=t}}class KOt extends df{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...Fe(1360,"Show or Focus Standalone Color Picker"),mnemonicTitle:g(1361,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:_e.CommandPalette}],metadata:{description:Fe(1362,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){UM.get(t)?.showOrFocus()}}class qOt extends tt{constructor(){super({id:"editor.action.hideColorPicker",label:g(1363,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:J.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:S.Escape,weight:Ae.EditorContrib},metadata:{description:Fe(1364,"Hide the standalone color picker.")}})}run(e,t){UM.get(t)?.hide()}}class QOt extends tt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:g(1365,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:J.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:S.Enter,weight:Ae.EditorContrib},metadata:{description:Fe(1366,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){UM.get(t)?.insertColor()}}Me(qOt);Me(QOt);At(KOt);class Rx{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 n=t.length,o=e.length;if(i+n>o)return!1;for(let r=0;r=B.A&&a<=B.Z&&a+32===c)&&!(c>=B.A&&c<=B.Z&&c+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,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),b=u.substring(0,p);(v.indexOf(i)>=0||b.indexOf(i)>=0)&&(f=-1,p=-1)}let m;f!==-1&&p!==-1?(n&&f+t.length0&&u.charCodeAt(p-1)===B.Space&&(i=" "+i,p-=1),m=Rx._createRemoveBlockCommentOperations(new F(a,f+t.length+1,l,p+1),t,i)):(m=Rx._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 n=[];return F.isEmpty(e)?n.push(Zn.delete(new F(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Zn.delete(new F(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Zn.delete(new F(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return F.isEmpty(e)?o.push(Zn.replace(new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Zn.insert(new oe(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(Zn.insert(new oe(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),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 n=i[0],o=i[1];return new dt(n.range.endLineNumber,n.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const n=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new dt(n.endLineNumber,n.endColumn+o,n.endLineNumber,n.endColumn+o)}}}var Gw;(function(s){s[s.Toggle=0]="Toggle",s[s.ForceAdd=1]="ForceAdd",s[s.ForceRemove=2]="ForceRemove"})(Gw||(Gw={}));class LC{constructor(e,t,i,n,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=n.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}}}class BMe extends tt{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Vs);if(!t.hasModel())return;const n=t.getModel(),o=[],r=n.getOptions(),a=t.getOption(x.comments),c=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));c.sort((d,h)=>F.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 jhe(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new Yhe(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 Yhe(new jhe(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 Yhe(new jhe(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}};Bse.ID="editor.contrib.cursorUndoRedoController";let SW=Bse;class ZOt extends tt{constructor(){super({id:"cursorUndo",label:g(1383,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.KeyU,weight:Ae.EditorContrib}})}run(e,t,i){SW.get(t)?.cursorUndo()}}class eBt extends tt{constructor(){super({id:"cursorRedo",label:g(1384,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){SW.get(t)?.cursorRedo()}}on(SW.ID,SW,ri.Eager);Me(ZOt);Me(eBt);var tBt=".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}";ut(tBt,{});class iBt{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 F(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 dt(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 dt(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)||(uP(e)&&(this._modifierPressed=!0),this._mouseDown&&uP(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(x.dragAndDrop)||this._editor.getOption(x.columnSelection)||(uP(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===VC.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 n=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}uP(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 n=this._editor.getSelection();if(n){const{selectionStartLineNumber:o,selectionStartColumn:r}=n;i=[new dt(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new dt(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",Oi.Explicit)}else(!this._dragSelection.containsPosition(t)||(uP(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(VC.ID,new iBt(this._dragSelection,t,uP(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 F(e.lineNumber,e.column,e.lineNumber,e.column),options:VC._DECORATION_OPTIONS}]),this._editor.revealPosition(e,mt.Immediate)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===Rt.CONTENT_TEXT||e.type===Rt.CONTENT_EMPTY}_hitMargin(e){return e.type===Rt.GUTTER_GLYPH_MARGIN||e.type===Rt.GUTTER_LINE_NUMBERS||e.type===Rt.GUTTER_LINE_DECORATIONS}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};VC.ID="editor.contrib.dragAndDrop",VC.TRIGGER_KEY_VALUE=Qt?S.Alt:S.Ctrl,VC._DECORATION_OPTIONS=Gt.register({description:"dnd-target",className:"dnd-target"});let HX=VC;on(HX.ID,HX,ri.BeforeFirstInteraction);on(tC.ID,tC,ri.Eager);G6(bbe);qe(new class extends hc{constructor(){super({id:oZe,precondition:fMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e){return tC.get(e)?.changePasteType()}});qe(new class extends hc{constructor(){super({id:"editor.hidePasteWidget",precondition:fMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e){tC.get(e)?.clearWidgets()}});var UL;Me((UL=class extends tt{constructor(){super({id:"editor.action.pasteAs",label:g(1386,"Paste As..."),alias:"Paste As...",precondition:J.writable,metadata:{description:"Paste as",args:[{name:"args",schema:UL.argsSchema}]}})}run(e,t,i){let n=typeof i?.kind=="string"?i.kind:void 0;return!n&&i&&(n=typeof i.id=="string"?i.id:void 0),tC.get(t)?.pasteAs(n?new Yn(n):void 0)}},UL.argsSchema={type:"object",properties:{kind:{type:"string",description:g(1385,"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.")}}},UL));Me(class extends tt{constructor(){super({id:"editor.action.pasteAsText",label:g(1387,"Paste as Text"),alias:"Paste as Text",precondition:J.writable})}run(s,e){return tC.get(e)?.pasteAs({providerId:RM.id})}});on(FM.ID,FM,ri.BeforeFirstInteraction);G6(vbe);qe(new class extends hc{constructor(){super({id:mZe,precondition:bMe,kbOpts:{weight:Ae.EditorContrib,primary:U.CtrlCmd|S.Period}})}runEditorCommand(s,e,t){FM.get(e)?.changeDropType()}});qe(new class extends hc{constructor(){super({id:"editor.hideDropWidget",precondition:bMe,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape}})}runEditorCommand(s,e,t){FM.get(e)?.clearWidgets()}});Qe.as(Nn.Configuration).registerConfiguration({...Wb,properties:{[pZe]:{type:"object",scope:at.LANGUAGE_OVERRIDABLE,description:g(1388,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const rh=class rh{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&&(n.changeDecorationOptions(this._highlightedDecorationId,rh._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,n.changeDecorationOptions(this._highlightedDecorationId,rh._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(n.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 F(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=n.addDecoration(o,rh._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let n=rh._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){n=rh._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 F(h,1,u,1),options:rh._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=m.startLineNumber,u=m.endLineNumber)}o.push({range:new F(h,1,u,1),options:rh._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,rh._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],n=this._editor.getModel().getDecorationRange(i);if(!(!n||n.endLineNumber>e.lineNumber)){if(n.endLineNumbere.column))return n}}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;rF.compareRangesUsingStarts(r.range,a.range));const n=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):s[0][0].toUpperCase()!==s[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function EUe(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function xUe(s,e,t){const i=e.split(t),n=s[0].split(t);let o="";return i.forEach((r,a)=>{o+=det([n[a]],r)+t}),o.slice(0,-1)}var AW;(function(s){s[s.StaticValue=0]="StaticValue",s[s.DynamicPieces=1]="DynamicPieces"})(AW||(AW={}));class DUe{constructor(e){this.staticValue=e,this.kind=AW.StaticValue}}class sBt{constructor(e){this.pieces=e,this.kind=AW.DynamicPieces}}class EW{static fromStaticValue(e){return new EW([dD.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===AW.DynamicPieces}constructor(e){!e||e.length===0?this._state=new DUe(""):e.length===1&&e[0].staticValue!==null?this._state=new DUe(e[0].staticValue):this._state=new sBt(e)}buildReplaceString(e,t){if(this._state.kind===AW.StaticValue)return t?det(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,o=this._state.pieces.length;n0){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=n)break;const r=s.charCodeAt(i);switch(r){case B.Backslash:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case B.n:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case B.t:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case B.u:case B.U:case B.l:case B.L:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===B.DollarSign){if(i++,i>=n)break;const r=s.charCodeAt(i);if(r===B.DollarSign){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===B.Digit0||r===B.Ampersand){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(B.Digit1<=r&&r<=B.Digit9){let a=r-B.Digit0;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===Oi.Explicit||i.reason===Oi.Undo||i.reason===Oi.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,bt(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)},aBt)):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 F(a.startLineNumber,1,c,this._editor.getModel().getLineMaxColumn(c))}return a}));const n=this._findMatches(i,!1,Mx);this._decorations.set(n,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&n.length>0){const a=m2(n.map(c=>c.range),c=>F.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,mt.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,mt.Smooth)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===1?(i===1?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new oe(i,n)}_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:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new oe(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()B5._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,n,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>=Mx?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new $C(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 n=this._editor.getModel(),o=n.getValue(go.LF),r=n.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 ITe(r,c,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,Un.MAX_SAFE_SMALL_INTEGER),n=[];for(let r=0,a=i.length;rr.range),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,Un.MAX_SAFE_SMALL_INTEGER).map(o=>new dt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const n=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 n={inputActiveOptionBorder:ze(Vre),inputActiveOptionForeground:ze(zre),inputActiveOptionBackground:ze(n6)},o=this._register(Wk());this.caseSensitive=this._register(new zje({appendTitle:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:o,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new $je({appendTitle:this._keybindingLabelFor(zo.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:o,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new Gje({appendTitle:this._keybindingLabelFor(zo.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:o,...n})),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(ue(this._domNode,ke.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(ue(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 Wse.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Fg.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")}};Wse.ID="editor.contrib.findOptionsWidget";let wwe=Wse;var ph;(function(s){s[s.NotSet=0]="NotSet",s[s.True=1]="True",s[s.False=2]="False"})(ph||(ph={}));function AK(s,e){return s===ph.True?!0:s===ph.False?!1:e}class lBt extends V{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return AK(this._isRegexOverride,this._isRegex)}get wholeWord(){return AK(this._wholeWordOverride,this._wholeWord)}get matchCase(){return AK(this._matchCaseOverride,this._matchCase)}get preserveCase(){return AK(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=ph.NotSet,this._wholeWord=!1,this._wholeWordOverride=ph.NotSet,this._matchCase=!1,this._matchCaseOverride=ph.NotSet,this._preserveCase=!1,this._preserveCaseOverride=ph.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 n={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,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),typeof i<"u"&&(F.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){const n={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,n.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.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=>!F.equalsRange(h,d)))||(this._searchScope=e.searchScope,n.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:ph.NotSet,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:ph.NotSet,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:ph.NotSet,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:ph.NotSet,r!==this.isRegex&&(o=!0,n.isRegex=!0),a!==this.wholeWord&&(o=!0,n.wholeWord=!0),c!==this.matchCase&&(o=!0,n.matchCase=!0),l!==this.preserveCase&&(o=!0,n.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Mx}}var dBt=".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}";ut(dBt,{});function UX(s){return s.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()==="Up"&&s.lookupKeybinding("history.showNext")?.getElectronAccelerator()==="Down"}const kUe=oi("find-collapsed",ve.chevronRight,g(5053,"Icon to indicate that the editor find widget is collapsed.")),IUe=oi("find-expanded",ve.chevronDown,g(5054,"Icon to indicate that the editor find widget is expanded.")),hBt=oi("find-selection",ve.selection,g(5055,"Icon for 'Find in Selection' in the editor find widget.")),uBt=oi("find-replace",ve.replace,g(5056,"Icon for 'Replace' in the editor find widget.")),gBt=oi("find-replace-all",ve.replaceAll,g(5057,"Icon for 'Replace All' in the editor find widget.")),fBt=oi("find-previous-match",ve.arrowUp,g(5058,"Icon for 'Find Previous' in the editor find widget.")),pBt=oi("find-next-match",ve.arrowDown,g(5059,"Icon for 'Find Next' in the editor find widget.")),mBt=g(5060,"Find / Replace"),_Bt=g(5061,"Find"),vBt=g(5062,"Find"),bBt=g(5063,"Previous Match"),wBt=g(5064,"Next Match"),yBt=g(5065,"Find in Selection"),CBt=g(5066,"Close"),SBt=g(5067,"Replace"),ABt=g(5068,"Replace"),EBt=g(5069,"Replace"),xBt=g(5070,"Replace All"),DBt=g(5071,"Toggle Replace"),kBt=g(5072,"Only the first {0} results are highlighted, but all find operations work on the entire text.",Mx),IBt=g(5073,"{0} of {1}"),TUe=g(5074,"No results"),qb=419,TBt=275,LBt=TBt-54;let v4=69;const RBt=33,LUe="ctrlEnterReplaceAll.windows.donotask",RUe=Qt?U.WinCtrl:U.CtrlCmd;class Jhe{constructor(e){this.afterLineNumber=e,this.heightInPx=RBt,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function MUe(s,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){s.stopPropagation();return}}function NUe(s,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 Jhe(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=uce.bindTo(r),this._findFocusTracker=this._register(Ac(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=WMe.bindTo(r),this._replaceFocusTracker=this._register(Ac(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 Jhe(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 Hse.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:Fg.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=Md(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,vt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=v4+"px",this._state.matchesCount>=Mx?this._matchesCount.title=kBt:this._matchesCount.title="",this._matchesCount.firstChild?.remove();let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Mx&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Up(IBt,i,t)}else e=TUe;this._matchesCount.appendChild(document.createTextNode(e)),Mr(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),v4=Math.max(v4,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===TUe)return i===""?g(5075,"{0} found",e):g(5076,"{0} found for '{1}'",e,i);if(t){const n=g(5077,"{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)}, ${n}`:n}return g(5078,"{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 n=Cr(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=n.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const c=Hj(this._domNode).left;r>c&&(t=!1);const l=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.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(n=>{i.heightInPx=this._getHeight(),this._viewZoneId=n.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 Jhe(0));const i=this._viewZone;this._codeEditor.changeViewZones(n=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,n.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=n.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,n=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&Md(this._domNode)>qb){this._domNode.style.maxWidth=`${i-28-n-15}px`,this._replaceInput.width=Md(this._findInput.domNode);return}if(qb+28+n>=i&&(r=!0),qb+28+n-v4>=i&&(a=!0),qb+28+n-v4>=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-n-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=Md(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&&!F.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(RUe|S.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(S.Tab)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(U.CtrlCmd|S.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(S.UpArrow))return MUe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(S.DownArrow))return NUe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(RUe|S.Enter))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Qn&&od&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(g(5079,"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(LUe,!0,Ie.PROFILE,an.USER)),this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(S.Tab)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(U.Shift|S.Tab)){this._findInput.focus(),e.preventDefault();return}if(e.equals(U.CtrlCmd|S.DownArrow)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(S.UpArrow))return MUe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(S.DownArrow))return NUe(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 ebe(null,this._contextViewProvider,{width:LBt,label:_Bt,placeholder:vBt,appendCaseSensitiveLabel:this._keybindingLabelFor(zo.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(zo.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(zo.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return new RegExp(d,"gu"),null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>UX(this._keybindingService),inputBoxStyles:yM,toggleStyles:jY},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(U.Shift|S.Tab)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(S.Tab)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),pr&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(Wk());this._prevBtn=this._register(new gP({label:bBt+this._keybindingLabelFor(zo.PreviousMatchFindAction),icon:fBt,hoverDelegate:i,onTrigger:()=>{qn(this._codeEditor.getAction(zo.PreviousMatchFindAction)).run().then(void 0,vt)}},this._hoverService)),this._nextBtn=this._register(new gP({label:wBt+this._keybindingLabelFor(zo.NextMatchFindAction),icon:pBt,hoverDelegate:i,onTrigger:()=>{qn(this._codeEditor.getAction(zo.NextMatchFindAction)).run().then(void 0,vt)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const o=document.createElement("div");o.className="find-actions",n.appendChild(o),o.appendChild(this._matchesCount),o.appendChild(this._prevBtn.domNode),o.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new JA({icon:hBt,title:yBt+this._keybindingLabelFor(zo.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:ze(n6),inputActiveOptionBorder:ze(Vre),inputActiveOptionForeground:ze(zre)})),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 gP({label:CBt+this._keybindingLabelFor(zo.CloseFindWidgetCommand),icon:vYe,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:d=>{d.equals(S.Tab)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),d.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new tbe(null,void 0,{label:SBt,placeholder:ABt,appendPreserveCaseLabel:this._keybindingLabelFor(zo.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>UX(this._keybindingService),inputBoxStyles:yM,toggleStyles:jY},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(S.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(Wk());this._replaceBtn=this._register(new gP({label:EBt+this._keybindingLabelFor(zo.ReplaceOneAction),icon:uBt,hoverDelegate:r,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(U.Shift|S.Tab)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new gP({label:xBt+this._keybindingLabelFor(zo.ReplaceAllAction),icon:gBt,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 gP({label:DBt,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=Md(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=mBt,this._domNode.role="dialog",this._domNode.style.width=`${qb}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(n),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Pd(this._domNode,this,{orientation:fi.VERTICAL,size:2})),this._resized=!1;let l=qb;this._register(this._resizeSash.onDidStart(()=>{l=Md(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=Md(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=Md(this._domNode);if(dthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};Hse.ID="editor.contrib.findWidget";let ywe=Hse;class gP extends gd{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+We.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.setupManagedHover(e.hoverDelegate??Pr("element"),this._domNode,this._opts.label)),this.onclick(this._domNode,n=>{this._opts.onTrigger(),n.preventDefault()}),this.onkeydown(this._domNode,n=>{if(n.equals(S.Space)||n.equals(S.Enter)){this._opts.onTrigger(),n.preventDefault();return}this._opts.onKeyDown?.(n)})}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(...We.asClassNameArray(kUe)),this._domNode.classList.add(...We.asClassNameArray(IUe))):(this._domNode.classList.remove(...We.asClassNameArray(IUe)),this._domNode.classList.add(...We.asClassNameArray(kUe)))}}bp((s,e)=>{const t=s.getColor(bx);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Iy(s.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=s.getColor(tft);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Iy(s.type)?"dashed":"solid"} ${i}; }`);const n=s.getColor(wt);n&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${n}; }`);const o=s.getColor(Zgt);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=s.getColor(eft);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var Cwe;const MBt=524288;function Swe(s,e="single",t=!1){if(!s.hasModel())return null;const i=s.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=s.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(s.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",Ie.WORKSPACE,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",Ie.WORKSPACE,!1),isRegex:this._storageService.getBoolean("editor.isRegex",Ie.WORKSPACE,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",Ie.WORKSPACE,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Y_.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,Ie.WORKSPACE,an.MACHINE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,Ie.WORKSPACE,an.MACHINE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,Ie.WORKSPACE,an.MACHINE),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,Ie.WORKSPACE,an.MACHINE)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",Ie.WORKSPACE,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",Ie.WORKSPACE,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",Ie.WORKSPACE,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",Ie.WORKSPACE,this._state.preserveCase)},!1)}isFindInputFocused(){return!!uce.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=Th(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 n=Swe(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);n&&(this._state.isRegex?i.searchString=Th(n):i.searchString=n)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const n=Swe(this._editor,e.seedSearchStringFromSelection);n&&(i.searchString=n)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const n=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;n&&(i.searchString=n)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const n=this._editor.getSelections();n.some(o=>!o.isEmpty())&&(i.searchScope=n)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new B5(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(1392,"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)}},Cwe=VL,VL.ID="editor.contrib.findController",VL);ig=Cwe=D([_(1,Le),_(2,$i),_(3,ag),_(4,bi),_(5,ec)],ig);let Awe=class extends ig{constructor(e,t,i,n,o,r,a,c,l){super(e,i,a,c,r,l),this._contextViewService=t,this._keybindingService=n,this._themeService=o,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(x.find).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":{n=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(e.shouldFocus===Y_.FocusReplaceInput?this._widget.focusReplaceInput():e.shouldFocus===Y_.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 ywe(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new wwe(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}};Awe=D([_(1,gf),_(2,Le),_(3,Ut),_(4,pn),_(5,bi),_(6,$i),_(7,ag),_(8,ec)],Awe);const NBt=QGe(new qGe({id:zo.StartFindAction,label:g(1393,"Find"),alias:"Find",precondition:he.or(J.focus,he.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:U.CtrlCmd|S.KeyF,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarEditMenu,group:"3_find",title:g(1394,"&&Find"),order:1}}));NBt.addImplementation(0,(s,e,t)=>{const i=ig.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:Y_.FocusFindInput,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(x.find).loop}):!1});const PBt={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 FBt extends tt{constructor(){super({id:zo.StartFindWithArgs,label:g(1395,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:Ae.EditorContrib},metadata:PBt})}async run(e,t,i){const n=ig.get(t);if(n){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 n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(x.find).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(x.find).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:Y_.FocusFindInput,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(x.find).loop},o),n.setGlobalBufferTerm(n.getState().searchString)}}}class OBt extends tt{constructor(){super({id:zo.StartFindWithSelection,label:g(1396,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:U.CtrlCmd|S.KeyE},weight:Ae.EditorContrib}})}async run(e,t){const i=ig.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Y_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class het extends tt{async run(e,t){const i=ig.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:Y_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class BBt extends het{constructor(){super({id:zo.NextMatchFindAction,label:g(1397,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:J.focus,primary:S.F3,mac:{primary:U.CtrlCmd|S.KeyG,secondary:[S.F3]},weight:Ae.EditorContrib},{kbExpr:he.and(J.focus,uce),primary:S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class WBt extends het{constructor(){super({id:zo.PreviousMatchFindAction,label:g(1398,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:J.focus,primary:U.Shift|S.F3,mac:{primary:U.CtrlCmd|U.Shift|S.KeyG,secondary:[U.Shift|S.F3]},weight:Ae.EditorContrib},{kbExpr:he.and(J.focus,uce),primary:U.Shift|S.Enter,weight:Ae.EditorContrib}]})}_run(e){return e.moveToPrevMatch()}}class HBt extends tt{constructor(){super({id:zo.GoToMatchFindAction,label:g(1399,"Go to Match..."),alias:"Go to Match...",precondition:iE}),this._highlightDecorations=[]}run(e,t,i){const n=ig.get(t);if(!n)return;const o=n.getState().matchesCount;if(o<1){e.get(bi).notify({severity:Xe.Warning,message:g(1400,"No matches. Try searching for something else.")});return}const a=e.get(In).createInputBox();a.placeholder=g(1401,"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=n.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,n.goToMatch(h);const u=n.getState().currentMatch;u&&this.addDecorations(t,u)}else a.validationMessage=g(1402,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{l(d)}),a.onDidAccept(()=>{const d=c(a.value);typeof d=="number"?(n.goToMatch(d),a.hide()):a.validationMessage=g(1402,"Please type a number between 1 and {0}",n.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:$o(yqe),position:Dl.Full}}}])})}}class uet extends tt{async run(e,t){const i=ig.get(t);if(!i)return;const n=Swe(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:Y_.NoFocusChange,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(x.find).loop}),this._run(i))}}class UBt extends uet{constructor(){super({id:zo.NextSelectionMatchFindAction,label:g(1403,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|S.F3,weight:Ae.EditorContrib}})}_run(e){return e.moveToNextMatch()}}class VBt extends uet{constructor(){super({id:zo.PreviousSelectionMatchFindAction,label:g(1404,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.F3,weight:Ae.EditorContrib}})}_run(e){return e.moveToPrevMatch()}}const zBt=QGe(new qGe({id:zo.StartFindReplaceAction,label:g(1405,"Replace"),alias:"Replace",precondition:he.or(J.focus,he.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:U.CtrlCmd|S.KeyH,mac:{primary:U.CtrlCmd|U.Alt|S.KeyF},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarEditMenu,group:"3_find",title:g(1406,"&&Replace"),order:2}}));zBt.addImplementation(0,(s,e,t)=>{if(!e.hasModel()||e.getOption(x.readOnly))return!1;const i=ig.get(e);if(!i)return!1;const n=e.getSelection(),o=i.isFindInputFocused(),r=!n.isEmpty()&&n.startLineNumber===n.endLineNumber&&e.getOption(x.find).seedSearchStringFromSelection!=="never"&&!o,a=o||r?Y_.FocusReplaceInput:Y_.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})});on(ig.ID,Awe,ri.Eager);Me(FBt);Me(OBt);Me(BBt);Me(WBt);Me(HBt);Me(UBt);Me(VBt);const Ub=hc.bindToContribution(ig.get);qe(new Ub({id:zo.CloseFindWidgetCommand,precondition:iE,handler:s=>s.closeFindWidget(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new Ub({id:zo.ToggleCaseSensitiveCommand,precondition:void 0,handler:s=>s.toggleCaseSensitive(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:bK.primary,mac:bK.mac,win:bK.win,linux:bK.linux}}));qe(new Ub({id:zo.ToggleWholeWordCommand,precondition:void 0,handler:s=>s.toggleWholeWords(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:wK.primary,mac:wK.mac,win:wK.win,linux:wK.linux}}));qe(new Ub({id:zo.ToggleRegexCommand,precondition:void 0,handler:s=>s.toggleRegex(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:yK.primary,mac:yK.mac,win:yK.win,linux:yK.linux}}));qe(new Ub({id:zo.ToggleSearchScopeCommand,precondition:void 0,handler:s=>s.toggleSearchScope(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:CK.primary,mac:CK.mac,win:CK.win,linux:CK.linux}}));qe(new Ub({id:zo.TogglePreserveCaseCommand,precondition:void 0,handler:s=>s.togglePreserveCase(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:SK.primary,mac:SK.mac,win:SK.win,linux:SK.linux}}));qe(new Ub({id:zo.ReplaceOneAction,precondition:iE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.Digit1}}));qe(new Ub({id:zo.ReplaceOneAction,precondition:iE,handler:s=>s.replace(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,WMe),primary:S.Enter}}));qe(new Ub({id:zo.ReplaceAllAction,precondition:iE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.CtrlCmd|U.Alt|S.Enter}}));qe(new Ub({id:zo.ReplaceAllAction,precondition:iE,handler:s=>s.replaceAll(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:he.and(J.focus,WMe),primary:void 0,mac:{primary:U.CtrlCmd|S.Enter}}}));qe(new Ub({id:zo.SelectAllMatchesAction,precondition:iE,handler:s=>s.selectAllMatches(),kbOpts:{weight:Ae.EditorContrib+5,kbExpr:J.focus,primary:U.Alt|S.Enter}}));class $Bt extends tt{constructor(){super({id:"editor.action.fontZoomIn",label:g(1389,"Increase Editor Font Size"),alias:"Increase Editor Font Size",precondition:void 0})}run(e,t){Gp.setZoomLevel(Gp.getZoomLevel()+1)}}class GBt extends tt{constructor(){super({id:"editor.action.fontZoomOut",label:g(1390,"Decrease Editor Font Size"),alias:"Decrease Editor Font Size",precondition:void 0})}run(e,t){Gp.setZoomLevel(Gp.getZoomLevel()-1)}}class KBt extends tt{constructor(){super({id:"editor.action.fontZoomReset",label:g(1391,"Reset Editor Font Size"),alias:"Reset Editor Font Size",precondition:void 0})}run(e,t){Gp.setZoomLevel(0)}}Me($Bt);Me(GBt);Me(KBt);var RB;let VX=(RB=class{constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,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 qj;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{const o=n.charCodeAt(n.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(),n=new ci,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){n.cancel(),o.dispose();return}for(let a=0,c=r.changes.length;a{n.token.isCancellationRequested||eo(r)&&(this._accessibilitySignalService.playSignal(al.format,{userGesture:!1}),aW.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},RB.ID="editor.contrib.autoFormat",RB);VX=D([_(1,it),_(2,Rl),_(3,rv)],VX);var MB;let zX=(MB=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(kae,this.editor,e,im.Silent,cu.None,He.None,!1).catch(vt))}},MB.ID="editor.contrib.formatOnPaste",MB);zX=D([_(1,it),_(2,we)],zX);class qBt extends tt{constructor(){super({id:"editor.action.formatDocument",label:g(1407,"Format Document"),alias:"Format Document",precondition:he.and(J.notInCompositeEditor,J.writable,J.hasDocumentFormattingProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyF,linux:{primary:U.CtrlCmd|U.Shift|S.KeyI},weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(we);await e.get(YA).showWhile(i.invokeFunction(vve,t,im.Explicit,cu.None,He.None,!0),250)}}}class QBt extends tt{constructor(){super({id:"editor.action.formatSelection",label:g(1408,"Format Selection"),alias:"Format Selection",precondition:he.and(J.writable,J.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyF),weight:Ae.EditorContrib},contextMenuOpts:{when:J.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(we),n=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new F(a.startLineNumber,1,a.startLineNumber,n.getLineMaxColumn(a.startLineNumber)):a);await e.get(YA).showWhile(i.invokeFunction(kae,t,o,im.Explicit,cu.None,He.None,!0),250)}}on(VX.ID,VX,ri.BeforeFirstInteraction);on(zX.ID,zX,ri.BeforeFirstInteraction);Me(qBt);Me(QBt);_t.registerCommand("editor.action.format",async s=>{const e=s.get(Kt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=s.get(vi);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});class Kw{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 n=i;for(let o=0;t.children.get(n)!==void 0;o++)n=`${i}_${o}`;return n}static getElementById(e,t){if(!e)return;const i=Uy(e,t.id);if(i===e.length)return t;if(!(i0&&F.areIntersecting(e[n-1],t.symbol.range)&&(n-=1)):n=i;const o=[];let r;for(;nr)&&(r=a.severity)}for(const[,a]of t.children)this._updateMarker(o,a);r&&(t.marker={count:o.length,topSev:r}),cM(e)}}class Dw extends Kw{static create(e,t,i){const n=new ci(i),o=new Dw(t.uri),r=e.ordered(t),a=r.map((l,d)=>{const h=Kw.findId(`provider_${d}`,o),u=new xwe(h,o,l.displayName??"Unknown Outline Provider",d);return Promise.resolve(l.provideDocumentSymbols(t,n.token)).then(f=>{for(const p of f||[])Dw._makeOutlineElement(p,u);return u},f=>(No(f),u)).then(f=>{Kw.empty(f)?f.remove():o._groups.set(h,f)})}),c=e.onDidChange(()=>{const l=e.ordered(t);is(l,r)||n.cancel()});return Promise.all(a).then(()=>n.token.isCancellationRequested&&!i.isCancellationRequested?Dw.create(e,t,i):o._compact()).finally(()=>{n.dispose(),c.dispose(),n.dispose()})}static _makeOutlineElement(e,t){const i=Kw.findId(e,t),n=new Ewe(i,t,e);if(e.children)for(const o of e.children)Dw._makeOutlineElement(o,n);t.children.set(n.id,n)}static get(e){for(;e;){if(e instanceof Dw)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=hi.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 xwe&&(i=o),o=o.parent}let n;for(const[,o]of this._groups)if(n=o.getItemEnclosingPosition(e),n&&(!i||i===o))break;return n}getItemById(e){return Kw.getElementById(e,this)}updateMarker(e){e.sort(F.compareRangesUsingStarts);for(const[,t]of this._groups)t.updateMarker(e.slice(0))}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof Ewe?e.push(t.symbol):e.push(...hi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>F.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Dw._flattenDocumentSymbols(t,e,""),t.sort((i,n)=>oe.compare(F.getStartPosition(i.range),F.getStartPosition(n.range))||oe.compare(F.getEndPosition(n.range),F.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const n of t)e.push({kind:n.kind,tags:n.tags,name:n.name,detail:n.detail,containerName:n.containerName||i,range:n.range,selectionRange:n.selectionRange,children:void 0}),n.children&&Dw._flattenDocumentSymbols(e,n.children,n.name)}}const X6=ae("IOutlineModelService");let Dwe=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new Z,this._cache=new lm(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(n=>{this._cache.delete(n.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!is(o.provider,n)){const a=new ci;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:a,promise:Dw.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)}};Dwe=D([_(0,it),_(1,wp),_(2,gi)],Dwe);ce(X6,Dwe,qt.Delayed);_t.registerCommand("_executeDocumentSymbolProvider",async function(s,...e){const[t]=e;Tt(N.isUri(t));const i=s.get(X6),o=await s.get(fn).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,He.None)).getTopLevelSymbols()}finally{o.dispose()}});const Use=class Use extends tt{constructor(){super({id:Use.ID,label:g(5080,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:he.and(J.writable,qu.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){gu.get(t)?.model.get()?.next()}};Use.ID=DXe;let kwe=Use;const Vse=class Vse extends tt{constructor(){super({id:Vse.ID,label:g(5081,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:he.and(J.writable,qu.inlineSuggestionVisible),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){gu.get(t)?.model.get()?.previous()}};Vse.ID=xXe;let Iwe=Vse;class jBt extends tt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:g(5082,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:J.writable})}async run(e,t){const i=gu.get(t);await vje(async n=>{await i?.model.get()?.triggerExplicitly(n),i?.playAccessibilitySignal(n)})}}class YBt extends tt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:g(5083,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:he.and(J.writable,qu.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|S.RightArrow,kbExpr:he.and(J.writable,qu.inlineSuggestionVisible)},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5084,"Accept Word"),group:"primary",order:2}]})}async run(e,t){const i=gu.get(t);await i?.model.get()?.acceptNextWord(i.editor)}}class JBt extends tt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:g(5085,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:he.and(J.writable,qu.inlineSuggestionVisible),kbOpts:{weight:Ae.EditorContrib+1},menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5086,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){const i=gu.get(t);await i?.model.get()?.acceptNextLine(i.editor)}}class XBt extends tt{constructor(){super({id:EXe,label:g(5087,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:qu.inlineSuggestionVisible,menuOpts:[{menuId:_e.InlineSuggestionToolbar,title:g(5088,"Accept"),group:"primary",order:1}],kbOpts:{primary:S.Tab,weight:200,kbExpr:he.and(qu.inlineSuggestionVisible,J.tabMovesFocus.toNegated(),qu.inlineSuggestionHasIndentationLessThanTabSize,Ui.Visible.toNegated(),J.hoverFocused.toNegated())}})}async run(e,t){const i=gu.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const zse=class zse extends tt{constructor(){super({id:zse.ID,label:g(5089,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:qu.inlineSuggestionVisible,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=gu.get(t);ts(n=>{i?.model.get()?.stop(n)})}};zse.ID="editor.action.inlineSuggest.hide";let Twe=zse;const $se=class $se extends li{constructor(){super({id:$se.ID,title:g(5090,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:_e.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:he.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(Te),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)}};$se.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let Lwe=$se;class ZBt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===lu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Rwe=class{constructor(e,t,i,n,o,r){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=o,this._telemetryService=r,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=gu.get(this._editor);if(!t)return null;const i=e.target;if(i.type===Rt.CONTENT_VIEW_ZONE){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new oQ(1e3,this,F.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}return i.type===Rt.CONTENT_EMPTY&&t.shouldShowHoverAt(i.range)?new oQ(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===Rt.CONTENT_TEXT&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new oQ(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=gu.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new ZBt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new Z,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(x.screenReaderAnnounceInlineSuggestion)&&i.add(this.renderScreenReaderText(e,n));const o=n.controller.model.get(),r=this._instantiationService.createInstance(gW,this._editor,!1,td(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands),a=r.getDomNode();e.fragment.appendChild(a),o.triggerExplicitly(),i.add(r);const c={hoverPart:n,hoverElement:a,dispose(){i.dispose()}};return new OM([c])}getAccessibleContent(e){return g(5091,"There are inline completions here")}renderScreenReaderText(e,t){const i=new Z,n=fe,o=n("div.hover-row.markdown-hover"),r=re(o,n("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new q_({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(5092,"Suggestion:"),h=i.add(a.render(new Mt().appendText(d).appendCodeblock("text",l)));r.replaceChildren(h.element)};return i.add(ai(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 aa(r)})),e.fragment.appendChild(o),i}};Rwe=D([_(1,xi),_(2,Ao),_(3,mr),_(4,we),_(5,Yi)],Rwe);class e2t{constructor(){this.type=_m.View,this.priority=95,this.name="inline-completions",this.when=he.and(qu.inlineSuggestionVisible)}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)return;const n=gu.get(i)?.model.get();if(n?.state.get())return new t2t(i,n)}}class t2t extends V{constructor(e,t){super(),this._editor=e,this._model=t,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this.id=Rb.InlineCompletions,this.verbositySettingKey="accessibility.verbosity.inlineCompletions",this.options={language:this._editor.getModel()?.getLanguageId()??void 0,type:_m.View}}provideContent(){const e=this._model.state.get();if(!e)throw new Error("Inline completion is visible but state is not available");const t=this._model.textModel.getLineContent(e.primaryGhostText.lineNumber),i=e.primaryGhostText.renderForScreenReader(t);if(!i)throw new Error("Inline completion is visible but ghost text is not available");return t+i}provideNextContent(){this._model.next().then(()=>this._onDidChangeContent.fire())}providePreviousContent(){this._model.previous().then(()=>this._onDidChangeContent.fire())}onClose(){this._model.stop(),this._editor.focus()}}on(gu.ID,gu,ri.Eventually);Me(jBt);Me(kwe);Me(Iwe);Me(YBt);Me(JBt);Me(XBt);Me(Twe);At(Lwe);UN.register(Rwe);O6.register(new e2t);var i2t=".monaco-editor .goto-definition-link{color:var(--vscode-editorLink-activeForeground)!important;cursor:pointer;text-decoration:underline}";ut(i2t,{});var gV,$D;let VM=($D=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,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 rce(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=>{vt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(gV.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===Rt.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 xae(this.editor,jo.Position|jo.Value|jo.Selection|jo.Scroll);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Rr(r=>this.findDefinition(e,r));let n;try{n=await this.previousPromise}catch(r){vt(r);return}if(!n||!n.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=n[0].originSelectionRange?F.lift(n[0].originSelectionRange):new F(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(n.length>1){let r=o;for(const{originSelectionRange:a}of n)a&&(r=F.plusRange(r,a));this.addDecoration(r,new Mt().appendText(g(1444,"Click to show {0} definitions.",n.length)))}else{const r=n[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 Mt().appendCodeblock(h||"",d):void 0),a.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=gV.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const n=!t&&this.editor.getOption(x.definitionLinkOpensInPeek)&&!this.isInPeekEditor(i);return new j6({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Le);return eg.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},gV=$D,$D.ID="editor.contrib.gotodefinitionatposition",$D.MAX_SOURCE_PREVIEW_LINES=8,$D);VM=gV=D([_(1,fn),_(2,xi),_(3,it)],VM);on(VM.ID,VM,ri.BeforeFirstInteraction);class PUe{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Mwe=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,N.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(a,c)=>{let l=dm(a.resource.toString(),c.resource.toString());return l===0&&(n==="position"?l=F.compareRangesUsingStarts(a,c)||Ws.compare(a.severity,c.severity):l=Ws.compare(a.severity,c.severity)||F.compareRangesUsingStarts(a,c)),l},r=()=>{this._markers=this._markerService.read({resource:N.isUri(e)?e:void 0,severities:Ws.Error|Ws.Warning|Ws.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 PUe(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=_2(this._markers,{resource:e.uri},(r,a)=>dm(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rn.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 Mwe(e,this._markerService,this._configService)}};Nwe=D([_(0,ym),_(1,Te)],Nwe);ce(get,Nwe,qt.Delayed);var n2t='.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}';ut(n2t,{});var s2t=".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)}";ut(s2t,{});var Pwe;(function(s){function e(t){switch(t){case Xe.Ignore:return"severity-ignore "+We.asClassName(ve.info);case Xe.Info:return We.asClassName(ve.info);case Xe.Warning:return We.asClassName(ve.warning);case Xe.Error:return We.asClassName(ve.error);default:return""}}s.className=e})(Pwe||(Pwe={}));var Fwe;class o2t{constructor(e,t,i,n,o){this._openerService=n,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(Ro(this._relatedBlock,"click",a=>{a.preventDefault();const c=this._relatedDiagnostics.get(a.target);c&&i(c)})),this._scrollable=new fqe(r,{horizontal:Co.Auto,vertical:Co.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(){bt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let r=(t?.length||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=iv(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);Ms(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=fe("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=re(this._codeLink,fe("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(Ms(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),eo(n)){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 n){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 Ws.Error:t=g(5123,"Error");break;case Ws.Warning:t=g(5124,"Warning");break;case Ws.Info:t=g(5125,"Info");break;case Ws.Hint:t=g(5126,"Hint");break}let i=g(5127,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}var zL;let t9=(zL=class extends O3{constructor(e,t,i,n,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new Z,this._onDidSelectRelatedInformation=new I,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Ws.Warning,this._backgroundColor=me.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(l2t);let t=Owe,i=r2t;this._severity===Ws.Warning?(t=dQ,i=a2t):this._severity===Ws.Info&&(t=Bwe,i=c2t);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(XRe),secondaryHeadingColor:e.getColor(ZRe)})}_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(n=>this.editor.focus()));const t=[],i=this._menuService.getMenuActions(Fwe.TitleMenu,this._contextKeyService);dC(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=re(e,fe(""))}_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 o2t(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 n=F.lift(e),o=this.editor.getPosition(),r=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const c=i>1?g(5128,"{0} of {1} problems",t,i):g(5129,"{0} of {1} problem",t,i);this.setTitle(_i(a.uri),c)}this._icon.className=`codicon ${Pwe.className(Ws.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,mt.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()}},Fwe=zL,zL.TitleMenu=new _e("gotoErrorTitleMenu"),zL);t9=Fwe=D([_(1,pn),_(2,Ao),_(3,Oa),_(4,we),_(5,Le),_(6,Fs)],t9);const FUe=B8(xN,Qgt),OUe=B8(um,W8),BUe=B8(gm,H8),Owe=W("editorMarkerNavigationError.background",{dark:FUe,light:FUe,hcDark:wt,hcLight:wt},g(5130,"Editor marker navigation widget error color.")),r2t=W("editorMarkerNavigationError.headerBackground",{dark:st(Owe,.1),light:st(Owe,.1),hcDark:null,hcLight:null},g(5131,"Editor marker navigation widget error heading background.")),dQ=W("editorMarkerNavigationWarning.background",{dark:OUe,light:OUe,hcDark:wt,hcLight:wt},g(5132,"Editor marker navigation widget warning color.")),a2t=W("editorMarkerNavigationWarning.headerBackground",{dark:st(dQ,.1),light:st(dQ,.1),hcDark:"#0C141F",hcLight:st(dQ,.2)},g(5133,"Editor marker navigation widget warning heading background.")),Bwe=W("editorMarkerNavigationInfo.background",{dark:BUe,light:BUe,hcDark:wt,hcLight:wt},g(5134,"Editor marker navigation widget info color.")),c2t=W("editorMarkerNavigationInfo.headerBackground",{dark:st(Bwe,.1),light:st(Bwe,.1),hcDark:null,hcLight:null},g(5135,"Editor marker navigation widget info heading background.")),l2t=W("editorMarkerNavigation.background",Hc,g(5136,"Editor marker navigation widget background."));var fV,$L;let zM=($L=class{static get(e){return e.getContribution(fV.ID)}constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new Z,this._editor=e,this._widgetVisible=fet.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(t9,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||!F.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:F.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 n=await this._editorService.openCodeEditor({resource:i.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:oA.NearTop,selection:i.selected.marker}},this._editor);n&&(fV.get(n)?.close(),fV.get(n)?.nagivate(e,t))}else this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}}},fV=$L,$L.ID="editor.contrib.markerController",$L);zM=fV=D([_(1,get),_(2,Le),_(3,Kt),_(4,we)],zM);class gce extends tt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&zM.get(t)?.nagivate(this._next,this._multiFile)}}const u1=class u1 extends gce{constructor(){super(!0,!1,{id:u1.ID,label:u1.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Alt|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:t9.TitleMenu,title:u1.LABEL,icon:oi("marker-navigation-next",ve.arrowDown,g(1446,"Icon for goto next marker.")),group:"navigation",order:1}})}};u1.ID="editor.action.marker.next",u1.LABEL=g(1445,"Go to Next Problem (Error, Warning, Info)");let $X=u1;const g1=class g1 extends gce{constructor(){super(!1,!1,{id:g1.ID,label:g1.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Shift|U.Alt|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:t9.TitleMenu,title:g1.LABEL,icon:oi("marker-navigation-previous",ve.arrowUp,g(1448,"Icon for goto previous marker.")),group:"navigation",order:2}})}};g1.ID="editor.action.marker.prev",g1.LABEL=g(1447,"Go to Previous Problem (Error, Warning, Info)");let Wwe=g1;class d2t extends gce{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:g(1449,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarGoMenu,title:g(1450,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class h2t extends gce{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:g(1451,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.Shift|S.F8,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarGoMenu,title:g(1452,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}on(zM.ID,zM,ri.Lazy);Me($X);Me(Wwe);Me(d2t);Me(h2t);const fet=new Y("markersNavigationVisible",!1),u2t=hc.bindToContribution(zM.get);qe(new u2t({id:"closeMarkersNavigation",precondition:fet,handler:s=>s.close(),kbOpts:{weight:Ae.EditorContrib+50,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));var Iv;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Iv||(Iv={}));class g2t extends tt{constructor(){super({id:vZe,label:g(5137,"Show or Focus Hover"),metadata:{description:Fe(5138,"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:[Iv.NoAutoFocus,Iv.FocusIfVisible,Iv.AutoFocusImmediately],enumDescriptions:[g(5139,"The hover will not automatically take focus."),g(5140,"The hover will take focus only if it is already visible."),g(5141,"The hover will automatically take focus when it appears.")],default:Iv.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyI),weight:Ae.EditorContrib}})}run(e,t,i){if(!t.hasModel())return;const n=Pa.get(t);if(!n)return;const o=i?.focus;let r=Iv.FocusIfVisible;Object.values(Iv).includes(o)?r=o:typeof o=="boolean"&&o&&(r=Iv.AutoFocusImmediately);const a=l=>{const d=t.getPosition(),h=new F(d.lineNumber,d.column,d.lineNumber,d.column);n.showContentHover(h,iC.Immediate,NA.Keyboard,l)},c=t.getOption(x.accessibilitySupport)===jl.Enabled;n.isHoverVisible?r!==Iv.NoAutoFocus?n.focus():a(c):a(c||r===Iv.AutoFocusImmediately)}}class f2t extends tt{constructor(){super({id:dPt,label:g(5142,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0,metadata:{description:Fe(5143,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Pa.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new F(n.lineNumber,n.column,n.lineNumber,n.column),r=VM.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,iC.Immediate,NA.Keyboard,!0)})}}class p2t extends tt{constructor(){super({id:hPt,label:g(5144,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.UpArrow,weight:Ae.EditorContrib},metadata:{description:Fe(5145,"Scroll up the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollUp()}}class m2t extends tt{constructor(){super({id:uPt,label:g(5146,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.DownArrow,weight:Ae.EditorContrib},metadata:{description:Fe(5147,"Scroll down the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollDown()}}class _2t extends tt{constructor(){super({id:gPt,label:g(5148,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.LeftArrow,weight:Ae.EditorContrib},metadata:{description:Fe(5149,"Scroll left the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollLeft()}}class v2t extends tt{constructor(){super({id:fPt,label:g(5150,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.RightArrow,weight:Ae.EditorContrib},metadata:{description:Fe(5151,"Scroll right the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.scrollRight()}}class b2t extends tt{constructor(){super({id:pPt,label:g(5152,"Page Up Hover"),alias:"Page Up Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.PageUp,secondary:[U.Alt|S.UpArrow],weight:Ae.EditorContrib},metadata:{description:Fe(5153,"Page up the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.pageUp()}}class w2t extends tt{constructor(){super({id:mPt,label:g(5154,"Page Down Hover"),alias:"Page Down Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.PageDown,secondary:[U.Alt|S.DownArrow],weight:Ae.EditorContrib},metadata:{description:Fe(5155,"Page down the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.pageDown()}}class y2t extends tt{constructor(){super({id:_Pt,label:g(5156,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.Home,secondary:[U.CtrlCmd|S.UpArrow],weight:Ae.EditorContrib},metadata:{description:Fe(5157,"Go to the top of the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.goToTop()}}class C2t extends tt{constructor(){super({id:vPt,label:g(5158,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:J.hoverFocused,kbOpts:{kbExpr:J.hoverFocused,primary:S.End,secondary:[U.CtrlCmd|S.DownArrow],weight:Ae.EditorContrib},metadata:{description:Fe(5159,"Go to the bottom of the editor hover.")}})}run(e,t){const i=Pa.get(t);i&&i.goToBottom()}}class S2t extends tt{constructor(){super({id:BU,label:wPt,alias:"Increase Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Pa.get(t);if(!n)return;const o=i?.index!==void 0?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(Mc.Increase,o,i?.focus)}}class A2t extends tt{constructor(){super({id:WU,label:CPt,alias:"Decrease Hover Verbosity Level",precondition:J.hoverVisible})}run(e,t,i){const n=Pa.get(t);if(!n)return;const o=i?.index!==void 0?i.index:n.focusedHoverPartIndex();Pa.get(t)?.updateHoverVerbosityLevel(Mc.Decrease,o,i?.focus)}}const Lm=fe;class E2t{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===lu.Range&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const WUe={type:wh.Invoke,filter:{include:ys.QuickFix},triggerAction:tg.QuickFixHover};let Hwe=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==lu.Range&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),r=[];for(const a of t){const c=a.range.startLineNumber===n?a.range.startColumn:1,l=a.range.endLineNumber===n?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const h=new F(e.range.startLineNumber,c,e.range.startLineNumber,l);r.push(new E2t(this,h,d))}return r}renderHoverParts(e,t){if(!t.length)return new OM([]);const i=new Z,n=[];t.forEach(r=>{const a=this._renderMarkerHover(r);e.fragment.appendChild(a.hoverElement),n.push(a)});const o=t.length===1?t[0]:t.sort((r,a)=>Ws.compare(r.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,o,i),new OM(n)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new Z,i=Lm("div.hover-row"),n=re(i,Lm("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:c}=e.marker;this._editor.applyFontInfo(n);const l=re(n,Lm("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=r,o||a)if(a&&typeof a!="string"){const h=Lm("span");if(o){const m=re(h,Lm("span"));m.innerText=o}const u=re(h,Lm("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ue(u,"click",m=>{this._openerService.open(a.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));const f=re(u,Lm("span"));f.innerText=a.value;const p=re(n,h);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{const h=re(n,Lm("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(eo(c))for(const{message:h,resource:u,startLineNumber:f,startColumn:p}of c){const m=re(n,Lm("div"));m.style.marginTop="8px";const v=re(m,Lm("a"));v.innerText=`${_i(u)}(${f}, ${p}): `,v.style.cursor="pointer",t.add(ue(v,"click",w=>{w.stopPropagation(),w.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:f,startColumn:p}}}).catch(vt)}));const b=re(m,Lm("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===Ws.Error||t.marker.severity===Ws.Warning||t.marker.severity===Ws.Info){const n=zM.get(this._editor);n&&e.statusBar.addAction({label:g(5169,"View Problem"),commandId:$X.ID,run:()=>{e.hide(),n.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(x.readOnly)){const n=e.statusBar.append(Lm("div"));this.recentMarkerCodeActionsInfo&&(JY.makeKey(this.recentMarkerCodeActionsInfo.marker)===JY.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=g(5170,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?V.None:Ky(()=>n.textContent=g(5171,"Checking for quick fixes..."),200,i);n.textContent||(n.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(),n.textContent=g(5170,"No quick fixes available");return}n.style.display="none";let c=!1;i.add(Ee(()=>{c||a.dispose()})),e.statusBar.addAction({label:g(5172,"Quick Fix..."),commandId:mMe,run:l=>{c=!0;const d=PM.get(this._editor),h=Cr(l);e.hide(),d?.showCodeActions(WUe,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},vt)}}getCodeActions(e){return Rr(t=>jO(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new F(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),WUe,cu.None,t))}};Hwe=D([_(1,pTe),_(2,Ao),_(3,it)],Hwe);var GX;(function(s){s.increaseVerbosity=g(5173,"- The focused hover part verbosity level can be increased with the Increase Hover Verbosity command.",``),s.decreaseVerbosity=g(5174,"- The focused hover part verbosity level can be decreased with the Decrease Hover Verbosity command.",``)})(GX||(GX={}));class x2t{constructor(){this.type=_m.View,this.priority=95,this.name="hover",this.when=J.hoverFocused}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Pa.get(i);if(!n)return;const o=e.get(Ut);return e.get(we).createInstance(k2t,o,i,n)}}class D2t{constructor(){this.priority=100,this.name="hover",this.type=_m.Help,this.when=J.hoverVisible}getProvider(e){const t=e.get(Kt),i=t.getActiveCodeEditor()||t.getFocusedCodeEditor();if(!i)throw new Error("No active or focused code editor");const n=Pa.get(i);if(n)return e.get(we).createInstance(met,n)}}class pet extends V{constructor(e){super(),this._hoverController=e,this.id=Rb.Hover,this.verbositySettingKey="accessibility.verbosity.hover",this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._focusedHoverPartIndex=-1}onOpen(){this._hoverController&&(this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!0,this._focusedHoverPartIndex=this._hoverController.focusedHoverPartIndex(),this._register(this._hoverController.onHoverContentsChanged(()=>{this._onDidChangeContent.fire()})))}onClose(){this._hoverController&&(this._focusedHoverPartIndex===-1?this._hoverController.focus():this._hoverController.focusHoverPartWithIndex(this._focusedHoverPartIndex),this._focusedHoverPartIndex=-1,this._hoverController.shouldKeepOpenOnEditorMouseMoveOrLeave=!1)}provideContentAtIndex(e,t){if(e!==-1){const i=this._hoverController.getAccessibleWidgetContentAtIndex(e);if(i===void 0)return"";const n=[];return t&&n.push(...this._descriptionsOfVerbosityActionsForIndex(e)),n.push(i),n.join(` `)}else{const i=this._hoverController.getAccessibleWidgetContent();if(i===void 0)return"";const n=[];return n.push(i),n.join(` -`)}}_descriptionsOfVerbosityActionsForIndex(e){const t=[],i=this._descriptionOfVerbosityActionForIndex(Mc.Increase,e);i!==void 0&&t.push(i);const n=this._descriptionOfVerbosityActionForIndex(Mc.Decrease,e);return n!==void 0&&t.push(n),t}_descriptionOfVerbosityActionForIndex(e,t){if(this._hoverController.doesHoverAtIndexSupportVerbosityAction(t,e))switch(e){case Mc.Increase:return qX.increaseVerbosity;case Mc.Decrease:return qX.decreaseVerbosity}}}class Eet extends Aet{constructor(e){super(e),this.options={type:wm.Help}}provideContent(){return this.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class W2t extends Aet{constructor(e,t,i){super(i),this._keybindingService=e,this._editor=t,this.options={type:wm.View},this._initializeOptions(this._editor,i)}provideContent(){return this.provideContentAtIndex(this._focusedHoverPartIndex,!1)}get actions(){const e=[];return e.push(this._getActionFor(this._editor,Mc.Increase)),e.push(this._getActionFor(this._editor,Mc.Decrease)),e}_getActionFor(e,t){let i,n,o;switch(t){case Mc.Increase:i=zU,n=TPt,o=ve.add;break;case Mc.Decrease:i=$U,n=RPt,o=ve.remove;break}const r=RZe(this._keybindingService,t),a=this._hoverController.doesHoverAtIndexSupportVerbosityAction(this._focusedHoverPartIndex,t);return new rn(n,r,We.asClassName(o),a,()=>{e.getAction(i)?.run({index:this._focusedHoverPartIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new Eet(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class H2t{constructor(){this.type=wm.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(mf).getContextViewElement(),n=i?.textContent??void 0,o=e.get(ec);if(!(i.classList.contains("accessible-view-container")||!n))return new LXe(Pb.Hover,{language:"typescript",type:wm.View},()=>n,()=>{o.showAndFocusLastHover()},"accessibility.verbosity.hover")}}on(Pa.ID,Pa,ri.BeforeFirstInteraction);Re(A2t);Re(E2t);Re(x2t);Re(D2t);Re(k2t);Re(I2t);Re(T2t);Re(L2t);Re(R2t);Re(M2t);Re(N2t);Re(P2t);GN.register(j3);GN.register(Kwe);Cp((s,e)=>{const t=s.getColor(ZKe);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)}; }`))});U6.register(new O2t);U6.register(new B2t);U6.register(new H2t);function Tg(s,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:r,indentSize:a,insertSpaces:c}=s.getOptions(),l=(m,v)=>(v=v||1,_m.shiftIndent(m,m.length+v,r,a,c)),d=(m,v)=>(v=v||1,_m.unshiftIndent(m,m.length+v,r,a,c)),h=[],u=s.getLineContent(t);let f=ho(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(U2t(s,m))continue;const v=s.getLineContent(m),b=ho(v),w=p;o.shouldDecrease(m,w)&&(p=d(p),f=d(f)),b!==p&&h.push(Zn.replaceMove(new dt(m,1,m,b.length+1),HTe(p,a,c))),!o.shouldIgnore(m)&&(o.shouldIncrease(m,w)?(f=l(f),p=f):o.shouldIndentNextLine(m,w)?p=l(p):p=f)}return h}function U2t(s,e){return s.tokenization.isCheapToTokenize(e)?s.tokenization.getLineTokens(e).getStandardTokenType(0)===nr.String:!1}const jse=class jse extends tt{constructor(){super({id:jse.ID,label:g(1453,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:J.writable,metadata:{description:Pe(1454,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new K2t(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};jse.ID="editor.action.indentationToSpaces";let qwe=jse;const Yse=class Yse extends tt{constructor(){super({id:Yse.ID,label:g(1455,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:J.writable,metadata:{description:Pe(1456,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new q2t(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};Yse.ID="editor.action.indentationToTabs";let Qwe=Yse;class XMe extends tt{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(In),n=e.get(gi),o=t.getModel();if(!o)return;const r=n.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(1457,"Configured Tab Size"):d===r.tabSize?g(1458,"Default Tab Size"):d===a.tabSize?g(1459,"Current Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(1460,"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 Jse=class Jse extends XMe{constructor(){super(!1,!1,{id:Jse.ID,label:g(1461,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Pe(1462,"Use indentation with tabs.")}})}};Jse.ID="editor.action.indentUsingTabs";let jwe=Jse;const Xse=class Xse extends XMe{constructor(){super(!0,!1,{id:Xse.ID,label:g(1463,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Pe(1464,"Use indentation with spaces.")}})}};Xse.ID="editor.action.indentUsingSpaces";let Ywe=Xse;const Zse=class Zse extends XMe{constructor(){super(!0,!0,{id:Zse.ID,label:g(1465,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:Pe(1466,"Change the space size equivalent of the tab.")}})}};Zse.ID="editor.action.changeTabDisplaySize";let Jwe=Zse;const eoe=class eoe extends tt{constructor(){super({id:eoe.ID,label:g(1467,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:Pe(1468,"Detect the indentation from content.")}})}run(e,t){const i=e.get(gi),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}};eoe.ID="editor.action.detectIndentation";let Xwe=eoe;class V2t extends tt{constructor(){super({id:"editor.action.reindentlines",label:g(1469,"Reindent Lines"),alias:"Reindent Lines",precondition:J.writable,metadata:{description:Pe(1470,"Reindent the lines of the editor.")}})}run(e,t){const i=e.get(Vs),n=t.getModel();if(!n)return;const o=xet(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class z2t extends tt{constructor(){super({id:"editor.action.reindentselectedlines",label:g(1471,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:J.writable,metadata:{description:Pe(1472,"Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(Vs),n=t.getModel();if(!n)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=xet(n,i,c,l);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class $2t{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 n of this._edits)t.addEditOperation(F.lift(n.range),n.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 BB;let QX=(BB=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||this.rangeContainsOnlyWhitespaceCharacters(i,e)||G2t(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(x.autoIndent),{tabSize:r,indentSize:a,insertSpaces:c}=i.getOptions(),l=[],d={shiftIndent:p=>_m.shiftIndent(p,p.length+1,r,a,c),unshiftIndent:p=>_m.unshiftIndent(p,p.length+1,r,a,c)};let h=e.startLineNumber;for(;h<=e.endLineNumber;){if(this.shouldIgnoreLine(i,h)){h++;continue}break}if(h>e.endLineNumber)return;let u=i.getLineContent(h);if(!/\S/.test(u.substring(0,e.startColumn-1))){const p=a5(o,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(p!==null){const m=ho(u),v=Tg(p,r),b=Tg(m,r);if(v!==b){const w=V5(v,r,c);l.push({range:new F(h,1,h,m.length+1),text:w}),u=w+u.substring(m.length)}else{const w=vqe(i,h,this._languageConfigurationService);if(w===0||w===mb.UNINDENT_MASK)return}}}const f=h;for(;hi.tokenization.getLineTokens(v),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(v,b)=>i.getLanguageIdAtPosition(v,b)},getLineContent:v=>v===f?u:i.getLineContent(v)},i.getLanguageId(),h+1,d,this._languageConfigurationService);if(m!==null){const v=Tg(m,r),b=Tg(ho(i.getLineContent(h+1)),r);if(v!==b){const w=v-b;for(let y=h+1;y<=e.endLineNumber;y++){const C=i.getLineContent(y),A=ho(C),k=Tg(A,r)+w,P=V5(k,r,c);P!==A&&l.push({range:new F(y,1,y,A.length+1),text:P})}}}}if(l.length>0){this.editor.pushUndoStop();const p=new $2t(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=o=>o.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const r=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(r)}else for(let o=t.startLineNumber;o<=t.endLineNumber;o++){const r=e.getLineContent(o);if(o===t.startLineNumber){const a=r.substring(t.startColumn-1);n=i(a)}else if(o===t.endLineNumber){const a=r.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(o)===0;if(!n)break}return n}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const o=n.findTokenIndexAtOffset(i);if(o>=0&&n.getStandardTokenType(o)===nr.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},BB.ID="editor.contrib.autoIndentOnPaste",BB);QX=D([_(1,Vs)],QX);function G2t(s,e){const t=i=>Agt(s,i)===nr.String;return t(e.getStartPosition())||t(e.getEndPosition())}function Det(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";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=F.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 dt(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+h-1));const u=new Q2t(l,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:gQ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Sr(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(vt)}).catch(vt)):Promise.resolve(void 0)}},gQ=YD,YD.ID="editor.contrib.inPlaceReplaceController",YD.DECORATION=Gt.register({description:"in-place-replace",className:"valueSetReplacement"}),YD);TW=gQ=D([_(1,Ml)],TW);class Y2t extends tt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:g(1473,"Replace with Previous Value"),alias:"Replace with Previous Value",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Comma,weight:Ae.EditorContrib}})}run(e,t){const i=TW.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class J2t extends tt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:g(1474,"Replace with Next Value"),alias:"Replace with Next Value",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Period,weight:Ae.EditorContrib}})}run(e,t){const i=TW.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}on(TW.ID,TW,ri.Lazy);Re(Y2t);Re(J2t);class X2t extends tt{constructor(){super({id:"expandLineSelection",label:g(1475,"Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:Ae.EditorCore,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.KeyL}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,Oi.Explicit,bl.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}Re(X2t);class ket{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=c_.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber{e.getAction(i)?.run({index:this._focusedHoverPartIndex,focus:!1})})}_initializeOptions(e,t){const i=this._register(new met(t));this.options.language=e.getModel()?.getLanguageId(),this.options.customHelp=()=>i.provideContentAtIndex(this._focusedHoverPartIndex,!0)}}class I2t{constructor(){this.type=_m.View,this.priority=90,this.name="extension-hover"}getProvider(e){const i=e.get(gf).getContextViewElement(),n=i?.textContent??void 0,o=e.get(ec);if(!(i.classList.contains("accessible-view-container")||!n))return new SXe(Rb.Hover,{language:"typescript",type:_m.View},()=>n,()=>{o.showAndFocusLastHover()},"accessibility.verbosity.hover")}}on(Pa.ID,Pa,ri.BeforeFirstInteraction);Me(g2t);Me(f2t);Me(p2t);Me(m2t);Me(_2t);Me(v2t);Me(b2t);Me(w2t);Me(y2t);Me(C2t);Me(S2t);Me(A2t);UN.register(K3);UN.register(Hwe);bp((s,e)=>{const t=s.getColor(GKe);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)}; }`))});O6.register(new x2t);O6.register(new D2t);O6.register(new I2t);function Dg(s,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:r,indentSize:a,insertSpaces:c}=s.getOptions(),l=(m,v)=>(v=v||1,fm.shiftIndent(m,m.length+v,r,a,c)),d=(m,v)=>(v=v||1,fm.unshiftIndent(m,m.length+v,r,a,c)),h=[],u=s.getLineContent(t);let f=ho(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(T2t(s,m))continue;const v=s.getLineContent(m),b=ho(v),w=p;o.shouldDecrease(m,w)&&(p=d(p),f=d(f)),b!==p&&h.push(Zn.replaceMove(new dt(m,1,m,b.length+1),kTe(p,a,c))),!o.shouldIgnore(m)&&(o.shouldIncrease(m,w)?(f=l(f),p=f):o.shouldIndentNextLine(m,w)?p=l(p):p=f)}return h}function T2t(s,e){return s.tokenization.isCheapToTokenize(e)?s.tokenization.getLineTokens(e).getStandardTokenType(0)===nr.String:!1}const Gse=class Gse extends tt{constructor(){super({id:Gse.ID,label:g(1453,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:J.writable,metadata:{description:Fe(1454,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new P2t(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};Gse.ID="editor.action.indentationToSpaces";let Uwe=Gse;const Kse=class Kse extends tt{constructor(){super({id:Kse.ID,label:g(1455,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:J.writable,metadata:{description:Fe(1456,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const r=new F2t(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};Kse.ID="editor.action.indentationToTabs";let Vwe=Kse;class HMe extends tt{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(In),n=e.get(gi),o=t.getModel();if(!o)return;const r=n.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(1457,"Configured Tab Size"):d===r.tabSize?g(1458,"Default Tab Size"):d===a.tabSize?g(1459,"Current Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(c,{placeHolder:g(1460,"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 qse=class qse extends HMe{constructor(){super(!1,!1,{id:qse.ID,label:g(1461,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:Fe(1462,"Use indentation with tabs.")}})}};qse.ID="editor.action.indentUsingTabs";let zwe=qse;const Qse=class Qse extends HMe{constructor(){super(!0,!1,{id:Qse.ID,label:g(1463,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:Fe(1464,"Use indentation with spaces.")}})}};Qse.ID="editor.action.indentUsingSpaces";let $we=Qse;const jse=class jse extends HMe{constructor(){super(!0,!0,{id:jse.ID,label:g(1465,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:Fe(1466,"Change the space size equivalent of the tab.")}})}};jse.ID="editor.action.changeTabDisplaySize";let Gwe=jse;const Yse=class Yse extends tt{constructor(){super({id:Yse.ID,label:g(1467,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:Fe(1468,"Detect the indentation from content.")}})}run(e,t){const i=e.get(gi),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}};Yse.ID="editor.action.detectIndentation";let Kwe=Yse;class L2t extends tt{constructor(){super({id:"editor.action.reindentlines",label:g(1469,"Reindent Lines"),alias:"Reindent Lines",precondition:J.writable,metadata:{description:Fe(1470,"Reindent the lines of the editor.")}})}run(e,t){const i=e.get(Vs),n=t.getModel();if(!n)return;const o=_et(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class R2t extends tt{constructor(){super({id:"editor.action.reindentselectedlines",label:g(1471,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:J.writable,metadata:{description:Fe(1472,"Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(Vs),n=t.getModel();if(!n)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=_et(n,i,c,l);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class M2t{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 n of this._edits)t.addEditOperation(F.lift(n.range),n.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 NB;let KX=(NB=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||this.rangeContainsOnlyWhitespaceCharacters(i,e)||N2t(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(x.autoIndent),{tabSize:r,indentSize:a,insertSpaces:c}=i.getOptions(),l=[],d={shiftIndent:p=>fm.shiftIndent(p,p.length+1,r,a,c),unshiftIndent:p=>fm.unshiftIndent(p,p.length+1,r,a,c)};let h=e.startLineNumber;for(;h<=e.endLineNumber;){if(this.shouldIgnoreLine(i,h)){h++;continue}break}if(h>e.endLineNumber)return;let u=i.getLineContent(h);if(!/\S/.test(u.substring(0,e.startColumn-1))){const p=s5(o,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(p!==null){const m=ho(u),v=Dg(p,r),b=Dg(m,r);if(v!==b){const w=W5(v,r,c);l.push({range:new F(h,1,h,m.length+1),text:w}),u=w+u.substring(m.length)}else{const w=dqe(i,h,this._languageConfigurationService);if(w===0||w===gb.UNINDENT_MASK)return}}}const f=h;for(;hi.tokenization.getLineTokens(v),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(v,b)=>i.getLanguageIdAtPosition(v,b)},getLineContent:v=>v===f?u:i.getLineContent(v)},i.getLanguageId(),h+1,d,this._languageConfigurationService);if(m!==null){const v=Dg(m,r),b=Dg(ho(i.getLineContent(h+1)),r);if(v!==b){const w=v-b;for(let y=h+1;y<=e.endLineNumber;y++){const C=i.getLineContent(y),A=ho(C),k=Dg(A,r)+w,P=W5(k,r,c);P!==A&&l.push({range:new F(y,1,y,A.length+1),text:P})}}}}if(l.length>0){this.editor.pushUndoStop();const p=new M2t(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",p),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=o=>o.trim().length===0;let n=!0;if(t.startLineNumber===t.endLineNumber){const r=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);n=i(r)}else for(let o=t.startLineNumber;o<=t.endLineNumber;o++){const r=e.getLineContent(o);if(o===t.startLineNumber){const a=r.substring(t.startColumn-1);n=i(a)}else if(o===t.endLineNumber){const a=r.substring(0,t.endColumn-1);n=i(a)}else n=e.getLineFirstNonWhitespaceColumn(o)===0;if(!n)break}return n}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const o=n.findTokenIndexAtOffset(i);if(o>=0&&n.getStandardTokenType(o)===nr.Comment)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},NB.ID="editor.contrib.autoIndentOnPaste",NB);KX=D([_(1,Vs)],KX);function N2t(s,e){const t=i=>ggt(s,i)===nr.String;return t(e.getStartPosition())||t(e.getEndPosition())}function vet(s,e,t,i){if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let n="";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=F.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 dt(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+h-1));const u=new O2t(l,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,u),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:hQ.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Sr(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(vt)}).catch(vt)):Promise.resolve(void 0)}},hQ=GD,GD.ID="editor.contrib.inPlaceReplaceController",GD.DECORATION=Gt.register({description:"in-place-replace",className:"valueSetReplacement"}),GD);xW=hQ=D([_(1,Rl)],xW);class W2t extends tt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:g(1473,"Replace with Previous Value"),alias:"Replace with Previous Value",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Comma,weight:Ae.EditorContrib}})}run(e,t){const i=xW.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class H2t extends tt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:g(1474,"Replace with Next Value"),alias:"Replace with Next Value",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Period,weight:Ae.EditorContrib}})}run(e,t){const i=xW.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}on(xW.ID,xW,ri.Lazy);Me(W2t);Me(H2t);class U2t extends tt{constructor(){super({id:"expandLineSelection",label:g(1475,"Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:Ae.EditorCore,kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.KeyL}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,Oi.Explicit,vl.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}}Me(U2t);class bet{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=o_.LTR,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumbere.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberw===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(w),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:w=>w===r.startLineNumber?e.getLineContent(h):e.getLineContent(w)},b=a5(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const w=ho(e.getLineContent(h)),y=Tg(b,a),C=Tg(w,a);y!==C&&(f=V5(y,a,l)+this.trimStart(u))}}t.addEditOperation(new F(r.startLineNumber,1,r.startLineNumber,1),f+` -`);const m=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,f);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,l,m);else{const v={tokenization:{getLineTokens:w=>w===r.startLineNumber?e.tokenization.getLineTokens(h):w>=r.startLineNumber+1&&w<=r.endLineNumber+1?e.tokenization.getLineTokens(w-1):e.tokenization.getLineTokens(w),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:w=>w===r.startLineNumber?f:w>=r.startLineNumber+1&&w<=r.endLineNumber+1?e.getLineContent(w-1):e.getLineContent(w)},b=a5(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const w=ho(e.getLineContent(r.startLineNumber)),y=Tg(b,a),C=Tg(w,a);if(y!==C){const A=y-C;this.getIndentEditsOfMovingBlock(e,t,r,a,l,A)}}}}else t.addEditOperation(new F(r.startLineNumber,1,r.startLineNumber,1),f+` +`+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,o=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=dt.createWithDirection(n,o,r,a,this._selectionDirection)}return i}}let qwe=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberw===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(w),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:w=>w===r.startLineNumber?e.getLineContent(h):e.getLineContent(w)},b=s5(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const w=ho(e.getLineContent(h)),y=Dg(b,a),C=Dg(w,a);y!==C&&(f=W5(y,a,l)+this.trimStart(u))}}t.addEditOperation(new F(r.startLineNumber,1,r.startLineNumber,1),f+` +`);const m=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,f);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,l,m);else{const v={tokenization:{getLineTokens:w=>w===r.startLineNumber?e.tokenization.getLineTokens(h):w>=r.startLineNumber+1&&w<=r.endLineNumber+1?e.tokenization.getLineTokens(w-1):e.tokenization.getLineTokens(w),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:w=>w===r.startLineNumber?f:w>=r.startLineNumber+1&&w<=r.endLineNumber+1?e.getLineContent(w-1):e.getLineContent(w)},b=s5(this._autoIndent,v,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const w=ho(e.getLineContent(r.startLineNumber)),y=Dg(b,a),C=Dg(w,a);if(y!==C){const A=y-C;this.getIndentEditsOfMovingBlock(e,t,r,a,l,A)}}}}else t.addEditOperation(new F(r.startLineNumber,1,r.startLineNumber,1),f+` `)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new F(h,1,h+1,1),null),t.addEditOperation(new F(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:n},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=a5(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const v=ho(e.getLineContent(r.startLineNumber)),b=Tg(m,a),w=Tg(v,a);if(b!==w){const y=b-w;this.getIndentEditsOfMovingBlock(e,t,r,a,l,y)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>_m.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>_m.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let r=o.indentation;o.indentAction===yr.None||o.indentAction===yr.Indent?r=o.indentation+o.appendText:o.indentAction===yr.IndentOutdent?r=o.indentation:o.indentAction===yr.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const c=ho(e.getLineContent(n));let l=ho(r);const d=vqe(e,n,this._languageConfigurationService);d!==null&&d&mb.DECREASE_MASK&&(l=t.unshiftIndent(l));const h=Tg(l,i),u=Tg(c,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,o,r){if(T_(r)>=0){const a=e.getLineMaxColumn(o),c=PO(this._autoIndent,e,new F(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(T_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=PO(this._autoIndent,e,new F(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}}matchEnterRule(e,t,i,n,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),T_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=PO(this._autoIndent,e,new F(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent=n)return null;const o=[];for(let a=i;a<=n;a++)o.push(s.getLineContent(a));let r=o.slice(0);return r.sort(o9.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:o,after:r}}function Z2t(s,e,t){const i=Iet(s,e,t);return i?Zn.replace(new F(i.startLineNumber,1,i.endLineNumber,s.getLineMaxColumn(i.endLineNumber)),i.after.join(` -`)):null}class Tet extends tt{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)=>F.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;rnew oe(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(Te),a=t.getModel(),c=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new IFt(o,n,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};toe.ID="editor.action.trimTrailingWhitespace";let eye=toe;class cWt extends tt{constructor(){super({id:"editor.action.deleteLines",label:g(1490,"Delete Line"),alias:"Delete Line",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|S.KeyK,weight:Ae.EditorContrib}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=n.getLineMaxColumn(h)),r.push(Zn.replace(new dt(h,f,u,p),"")),a.push(new dt(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 n=t[0];for(let o=1;o=t[o].startLineNumber?n.endLineNumber=t[o].endLineNumber:(i.push(n),n=t[o]);return i.push(n),i}}class lWt extends tt{constructor(){super({id:"editor.action.indentLines",label:g(1491,"Indent Line"),alias:"Indent Line",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.BracketRight,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,JE.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class dWt extends tt{constructor(){super({id:"editor.action.outdentLines",label:g(1492,"Outdent Line"),alias:"Outdent Line",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.BracketLeft,weight:Ae.EditorContrib}})}run(e,t){FO.Outdent.runEditorCommand(e,t,null)}}class hWt extends tt{constructor(){super({id:"editor.action.insertLineBefore",label:g(1493,"Insert Line Above"),alias:"Insert Line Above",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Enter,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zre.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class uWt extends tt{constructor(){super({id:"editor.action.insertLineAfter",label:g(1494,"Insert Line Below"),alias:"Insert Line Below",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.Enter,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Zre.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Met extends tt{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let c=0,l=n.length-1;cZn.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class gWt extends Met{constructor(){super({id:"deleteAllLeft",label:g(1495,"Delete All Left"),alias:"Delete All Left",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.CtrlCmd|S.Backspace},weight:Ae.EditorContrib}})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const c=r.startLineNumber-o;a=new dt(c,r.startColumn,c,r.startColumn)}else a=new dt(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:n.push(a)}),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const n=e.getModel();return n===null?[]:(i.sort(F.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:n.getLineLength(r)+1;return new F(r,a,o.startLineNumber,1)}else return new F(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new F(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class fWt extends Met{constructor(){super({id:"deleteAllRight",label:g(1496,"Delete All Right"),alias:"Delete All Right",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyK,secondary:[U.CtrlCmd|S.Delete]},weight:Ae.EditorContrib}})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new F(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new F(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return n.sort(F.compareRangesUsingStarts),n}}class pWt extends tt{constructor(){super({id:"editor.action.joinLines",label:g(1497,"Join Lines"),alias:"Join Lines",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyJ},weight:Ae.EditorContrib}})}run(e,t){const i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(F.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(n.equalsSelection(u)&&(n=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new dt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new dt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=n,h=0;for(let u=0,f=o.length;u=1){let z=!0;A===""&&(z=!1),z&&(A.charAt(A.length-1)===" "||A.charAt(A.length-1)===" ")&&(z=!1,A=A.replace(/[\s\uFEFF\xA0]+$/g," "));const G=P.substr(R-1);A+=(z?" ":"")+G,z?b=G.length+1:b=G.length}else b=0}const L=new F(m,v,w,y);if(!L.isEmpty()){let k;p.isEmpty()?(c.push(Zn.replace(L,A)),k=new dt(L.startLineNumber-h,A.length-b+1,m-h,A.length-b+1)):p.startLineNumber===p.endLineNumber?(c.push(Zn.replace(L,A)),k=new dt(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(Zn.replace(L,A)),k=new dt(p.startLineNumber-h,p.startColumn,p.startLineNumber-h,A.length-C)),F.intersectRanges(L,n)!==null?d=k:l.push(k)}h+=L.endLineNumber-L.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,c,l),t.pushUndoStop()}}class mWt extends tt{constructor(){super({id:"editor.action.transpose",label:g(1498,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:J.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=[];for(let r=0,a=i.length;r=d){if(l.lineNumber===n.getLineCount())continue;const h=new F(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new td(new dt(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u))}else{const h=new F(l.lineNumber,Math.max(1,l.column-1),l.lineNumber,l.column+1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new UTe(h,u,new dt(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class qN extends tt{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===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 F(c.lineNumber,l.startColumn,c.lineNumber,l.endColumn),h=n.getValueInRange(d);r.push(Zn.replace(d,this._modifyText(h,o)))}else{const c=n.getValueInRange(a);r.push(Zn.replace(a,this._modifyText(c,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class _Wt extends qN{constructor(){super({id:"editor.action.transformToUppercase",label:g(1499,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:J.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class vWt extends qN{constructor(){super({id:"editor.action.transformToLowercase",label:g(1500,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:J.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class dA{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 ioe=class ioe extends qN{constructor(){super({id:"editor.action.transformToTitlecase",label:g(1501,"Transform to Title Case"),alias:"Transform to Title Case",precondition:J.writable})}_modifyText(e,t){const i=ioe.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}};ioe.titleBoundary=new dA("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let jX=ioe;const sO=class sO extends qN{constructor(){super({id:"editor.action.transformToSnakecase",label:g(1502,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:J.writable})}_modifyText(e,t){const i=sO.caseBoundary.get(),n=sO.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}};sO.caseBoundary=new dA("(\\p{Ll})(\\p{Lu})","gmu"),sO.singleLetters=new dA("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let z5=sO;const noe=class noe extends qN{constructor(){super({id:"editor.action.transformToCamelcase",label:g(1503,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:J.writable})}_modifyText(e,t){const i=noe.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}};noe.wordBoundary=new dA("[_\\s-]","gm");let YX=noe;const oO=class oO extends qN{constructor(){super({id:"editor.action.transformToPascalcase",label:g(1504,"Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:J.writable})}_modifyText(e,t){const i=oO.wordBoundary.get(),n=oO.wordBoundaryToMaintain.get();return!i||!n?e:e.split(n).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};oO.wordBoundary=new dA("[_\\s-]","gm"),oO.wordBoundaryToMaintain=new dA("(?<=\\.)","gm");let JX=oO;const qE=class qE extends qN{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:g(1505,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:J.writable})}_modifyText(e,t){const i=qE.caseBoundary.get(),n=qE.singleLetters.get(),o=qE.underscoreBoundary.get();return!i||!n||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}};qE.caseBoundary=new dA("(\\p{Ll})(\\p{Lu})","gmu"),qE.singleLetters=new dA("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),qE.underscoreBoundary=new dA("(\\S)(_)(\\S)","gm");let XX=qE;Re(eWt);Re(tWt);Re(iWt);Re(nWt);Re(sWt);Re(oWt);Re(rWt);Re(aWt);Re(eye);Re(cWt);Re(lWt);Re(dWt);Re(hWt);Re(uWt);Re(gWt);Re(fWt);Re(pWt);Re(mWt);Re(_Wt);Re(vWt);z5.caseBoundary.isSupported()&&z5.singleLetters.isSupported()&&Re(z5);YX.wordBoundary.isSupported()&&Re(YX);JX.wordBoundary.isSupported()&&Re(JX);jX.titleBoundary.isSupported()&&Re(jX);XX.isSupported()&&Re(XX);var bWt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";ut(bWt,{});var fQ;const Net=new Q("LinkedEditingInputVisible",!1),wWt="linked-editing-decoration";var JD;let LW=(JD=class extends V{static get(e){return e.getContribution(fQ.ID)}constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new Z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=Net.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(M.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new Mh(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new Mh(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:()=>{n.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 n=t.getValueInRange(i);if(this._currentWordPattern){const r=n.match(this._currentWordPattern);if((r?r[0].length:0)!==n.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){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=n;const o=this._currentRequestCts=new ci;try{const r=new js(!1),a=await Pet(this._providers,i,t,o.token);if(this._debounceInformation.update(i,r.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,n!==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:fQ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){Fr(r)||vt(r),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},fQ=JD,JD.ID="editor.contrib.linkedEditing",JD.DECORATION=Gt.register({description:"linked-editing",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,className:wWt}),JD);LW=fQ=D([_(1,Le),_(2,it),_(3,Vs),_(4,Sp)],LW);class yWt extends tt{constructor(){super({id:"editor.action.linkedEditing",label:g(1506,"Start Linked Editing"),alias:"Start Linked Editing",precondition:he.and(J.writable,J.hasRenameProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.F2,weight:Ae.EditorContrib}})}runCommand(e,t){const i=e.get(Kt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&oe.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},vt):super.runCommand(e,t)}run(e,t){const i=LW.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const CWt=hc.bindToContribution(LW.get);qe(new CWt({id:"cancelLinkedEditingInput",precondition:Net,handler:s=>s.clearRanges(),kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib+99,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));function Pet(s,e,t,i){const n=s.ordered(e);return Nre(n.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){No(r);return}}),o=>!!o&&eo(o?.ranges))}W("editor.linkedEditingBackground",{dark:me.fromHex("#f00").transparent(.3),light:me.fromHex("#f00").transparent(.3),hcDark:me.fromHex("#f00").transparent(.3),hcLight:me.white},g(1507,"Background color when the editor auto renames on type."));rg("_executeLinkedEditingProvider",(s,e,t)=>{const{linkedEditingRangeProvider:i}=s.get(it);return Pet(i,e,t,He.None)});on(LW.ID,LW,ri.AfterFirstRender);Re(yWt);const soe=class soe extends V{static get(e){return e.getContribution(soe.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===Rt.CONTENT_TEXT&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};soe.ID="editor.contrib.longLinesHelper";let ZX=soe;on(ZX.ID,ZX,ri.BeforeFirstInteraction);var SWt=".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}";ut(SWt,{});const AWt=W("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},g(5183,"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);W("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},g(5184,"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);W("editor.wordHighlightTextBackground",AWt,g(5185,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const EWt=W("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(5186,"Border color of a symbol during read-access, like reading a variable."));W("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(5187,"Border color of a symbol during write-access, like writing to a variable."));W("editor.wordHighlightTextBorder",EWt,g(5188,"Border color of a textual occurrence for a symbol."));const xWt=W("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",g(5189,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),DWt=W("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",g(5190,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),kWt=W("editorOverviewRuler.wordHighlightTextForeground",tqe,g(5191,"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),IWt=Gt.register({description:"word-highlight-strong",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:$o(DWt),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}}),TWt=Gt.register({description:"word-highlight-text",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:$o(kWt),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}}),LWt=Gt.register({description:"selection-highlight-overview",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:$o(tqe),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}}),RWt=Gt.register({description:"selection-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),MWt=Gt.register({description:"word-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:$o(xWt),position:kl.Center},minimap:{color:$o(Gre),position:Th.Inline}});function NWt(s){return s===w8.Write?IWt:s===w8.Text?TWt:MWt}function PWt(s){return s?RWt:LWt}Cp((s,e)=>{const t=s.getColor(TTe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var tye;function II(s,e){const t=e.filter(i=>!s.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),n=t.length===1?g(1518,"Cursor added: {0}",i):g(1519,"Cursors added: {0}",i);Ah(n)}}class FWt extends tt{constructor(){super({id:"editor.action.insertCursorAbove",label:g(1520,"Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.UpArrow,linux:{primary:U.Shift|U.Alt|S.UpArrow,secondary:[U.CtrlCmd|U.Shift|S.UpArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1521,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Oi.Explicit,bl.addCursorUp(o,r,n)),o.revealTopMostCursor(i.source),II(r,o.getCursorStates())}}class OWt extends tt{constructor(){super({id:"editor.action.insertCursorBelow",label:g(1522,"Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.DownArrow,linux:{primary:U.Shift|U.Alt|S.DownArrow,secondary:[U.CtrlCmd|U.Shift|S.DownArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1523,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Oi.Explicit,bl.addCursorDown(o,r,n)),o.revealBottomMostCursor(i.source),II(r,o.getCursorStates())}}class BWt extends tt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:g(1524,"Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyI,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1525,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n1&&i.push(new dt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];n.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),II(r,o.getCursorStates())}}class WWt extends tt{constructor(){super({id:"editor.action.addCursorsToBottom",label:g(1526,"Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let c=i[0].startLineNumber;c<=n;c++)o.push(new dt(c,i[0].startColumn,c,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),II(a,r.getCursorStates())}}class HWt extends tt{constructor(){super({id:"editor.action.addCursorsToTop",label:g(1527,"Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let a=i[0].startLineNumber;a>=1;a--)n.push(new dt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();n.length>0&&t.setSelections(n),II(r,o.getCursorStates())}}class kK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class r9{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new r9(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!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 dt(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` -`);return new r9(e,t,n,l,o,r,d)}constructor(e,t,i,n,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,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 kK(t.concat(e),e,mt.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new kK(t.slice(0,t.length-1).concat(e),e,mt.Smooth)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}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 dt(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 kK(t.concat(e),e,mt.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new kK(t.slice(0,t.length-1).concat(e),e,mt.Smooth)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}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 dt(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,Un.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER)}}const ooe=class ooe extends V{static get(e){return e.getContribution(ooe.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=r9.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=_h.True,i.matchCaseOverride=_h.True,i.isRegexOverride=_h.False),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:_h.NotSet,matchCaseOverride:_h.NotSet,isRegexOverride:_h.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 dt(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 n=e.getState().matchCase;if(!Fet(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let c=0,l=t.length;c0&&i.isRegex){const n=this._editor.getModel();i.searchScope?t=n.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const n=this._editor.getSelection();for(let o=0,r=t.length;onew dt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};ooe.ID="editor.contrib.multiCursorController";let RW=ooe;class KU extends tt{run(e,t){const i=RW.get(t);if(!i)return;const n=t._getViewModel();if(n){const o=n.getCursorStates(),r=og.get(t);if(r)this._run(i,r);else{const a=e.get(we).createInstance(og,t);this._run(i,a),a.dispose()}II(o,n.getCursorStates())}}}class UWt extends KU{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:g(1528,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|S.KeyD,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1529,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class VWt extends KU{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:g(1530,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1531,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class zWt extends KU{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:g(1532,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyD),weight:Ae.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class $Wt extends KU{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:g(1533,"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 GWt extends KU{constructor(){super({id:"editor.action.selectHighlights",label:g(1534,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.KeyL,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1535,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class KWt extends KU{constructor(){super({id:"editor.action.changeAll",label:g(1536,"Change All Occurrences"),alias:"Change All Occurrences",precondition:he.and(J.writable,J.editorTextFocus),kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.F2,weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class qWt{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,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(F.compareRangesUsingStarts)),this._cachedFindMatches}}var jL;let eZ=(jL=class extends V{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 cn(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(x.selectionHighlight)})),this._register(e.onDidChangeCursorSelection(n=>{this._isEnabled&&(n.selection.isEmpty()?n.reason===Oi.Explicit?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(n=>{this._setState(null)})),this._register(e.onDidChangeModelContent(n=>{this._isEnabled&&this.updateSoon.schedule()}));const i=og.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(tye._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const o=RW.get(i);if(!o)return null;const r=og.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(!Fet(i.getModel(),d,u))return null}a=r9.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 qWt(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(),n=this.editor.getSelections();n.sort(F.compareRangesUsingStarts);const o=[];for(let l=0,d=0,h=i.length,u=n.length;l=u)o.push(f),l++;else{const p=F.compareRangesUsingStarts(f,n[d]);p<0?((n[d].isEmpty()||!F.areIntersecting(f,n[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:PWt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},tye=jL,jL.ID="editor.contrib.selectionHighlighter",jL);eZ=tye=D([_(1,it)],eZ);function Fet(s,e,t){const i=XUe(s,e[0],!t);for(let n=1,o=e.length;nthis.editor.getModel()),this.uiState=Ze(this,n=>{if(this.isDisposed.read(n))return;const o=this.currentTextModel.read(n);if(o!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;let a=this.model.range?.read(n);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(w=>w.length===0),d=[],h=[];function u(w,y){if(h.length>0){const C=h[h.length-1];y&&C.decorations.push(new eu(C.content.length+1,C.content.length+1+w[0].length,y,Ja.Regular)),C.content+=w[0],w=w.slice(1)}for(const C of w)h.push({content:C,decorations:y?[new eu(1,C.length+1,y,Ja.Regular)]:[]})}const f=o.getLineContent(r.lineNumber);let p,m=0;if(!l&&(c||!a)){for(const w of r.parts){let y=w.lines;a&&!c&&(u(y,oue),y=[]),p===void 0?(d.push({column:w.column,text:y[0],preview:w.preview}),y=y.slice(1)):u([f.substring(m,w.column-1)],void 0),y.length>0&&(u(y,oue),p===void 0&&w.column<=f.length&&(p=w.column)),m=w.column-1}p!==void 0&&u([f.substring(m)],void 0)}const v=p!==void 0?new OXe(p,f.length+1):void 0,b=c||!a?r.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:b,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:o,range:a,isSingleLine:c,isPureRemove:l}}),this.decorations=Ze(this,n=>{const o=this.uiState.read(n);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 c=o.range.endLineNumber-o.range.startLineNumber;for(let l=0;l{const o=this.uiState.read(n);return o&&!o.isPureRemove&&(o.isSingleLine||!o.range)?{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(BXe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};iye=D([_(2,xi)],iye);var tHt=".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}";ut(tHt,{});var pQ;let nye=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ze(this,n=>{const o=this.model.read(n)?.model.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!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(cu((n,o)=>{if(!this.model.read(n)||!this.alwaysShowToolbar.read(n))return;const a=o.add(this.instantiationService.createInstance(sye,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ee(()=>e.removeContentWidget(a)))}))}};nye=D([_(2,we)],nye);var XD;let sye=(XD=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,o,r){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=o,this._menuService=r,this.id=`InlineEditHintsContentWidget${pQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Bt("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[Bt("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(n.createInstance(oye,this.nodes.toolBar,this.editor,_e.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof Sc)return n.createInstance(iHt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{pQ._dropDownVisible=a})),this._register(ai(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(ai(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof Sc&&c.push(h);c.length>0&&c.unshift(new Ar),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[es.ABOVE,es.BELOW],positionAffinity:Io.LeftOfInjectedText}}},pQ=XD,XD._dropDownVisible=!1,XD.id=0,XD);sye=pQ=D([_(3,we),_(4,Le),_(5,Oa)],sye);class iHt extends Lb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Bt("div.keybinding").root;this._register(new qk(t,po,{disableTitle:!0,...pYe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let oye=class extends lW{constructor(e,t,i,n,o,r,a,c,l,d){super(e,{resetMenu:i,...n},o,r,a,c,l,d),this.editor=t,this.menuId=i,this.options2=n,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=[];fC(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){is(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){is(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};oye=D([_(4,Oa),_(5,Le),_(6,lr),_(7,Ut),_(8,vi),_(9,Yi)],oye);var nHt=".monaco-editor .inlineEditSideBySide{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);white-space:pre;z-index:39}";ut(nHt,{});var _V,rye;function*sHt(s,e,t=1){e===void 0&&([e,s]=[s,0]);for(let i=s;ii.replace(new RegExp("^"+e),"")),shift:t}}var YL;let aye=(YL=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edit-widget",path:new Date().toString()+String(_V._modelId++)})}constructor(e,t,i,n,o){super(),this._editor=e,this._model=t,this._instantiationService=i,this._diffProviderFactoryService=n,this._modelService=o,this._position=Ze(this,r=>{const a=this._model.read(r);if(!a||a.text.length===0||a.range.startLineNumber===a.range.endLineNumber&&!(a.range.startColumn===a.range.endColumn&&a.range.startColumn===1))return null;const c=this._editor.getModel();if(!c)return null;const l=Array.from(sHt(a.range.startLineNumber,a.range.endLineNumber+1)),d=l.map(m=>c.getLineLastNonWhitespaceColumn(m)),h=Math.max(...d),u=l[d.indexOf(h)],f=new oe(u,h);return{top:a.range.startLineNumber,left:f}}),this._text=Ze(this,r=>{const a=this._model.read(r);if(!a)return{text:"",shift:0};const c=rue(a.text.split(` +`+u),this.shouldAutoIndent(e,r)){const f={tokenization:{getLineTokens:m=>m===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(m),getLanguageId:i,getLanguageIdAtPosition:n},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=s5(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(m!==null){const v=ho(e.getLineContent(r.startLineNumber)),b=Dg(m,a),w=Dg(v,a);if(b!==w){const y=b-w;this.getIndentEditsOfMovingBlock(e,t,r,a,l,y)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>fm.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>fm.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let r=o.indentation;o.indentAction===yr.None||o.indentAction===yr.Indent?r=o.indentation+o.appendText:o.indentAction===yr.IndentOutdent?r=o.indentation:o.indentAction===yr.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const c=ho(e.getLineContent(n));let l=ho(r);const d=dqe(e,n,this._languageConfigurationService);d!==null&&d&gb.DECREASE_MASK&&(l=t.unshiftIndent(l));const h=Dg(l,i),u=Dg(c,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,o,r){if(D_(r)>=0){const a=e.getLineMaxColumn(o),c=LO(this._autoIndent,e,new F(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(D_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=LO(this._autoIndent,e,new F(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}}matchEnterRule(e,t,i,n,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),D_(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const c=e.getLineMaxColumn(a),l=LO(this._autoIndent,e,new F(a,c,a,c),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent=n)return null;const o=[];for(let a=i;a<=n;a++)o.push(s.getLineContent(a));let r=o.slice(0);return r.sort(i9.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:o,after:r}}function V2t(s,e,t){const i=wet(s,e,t);return i?Zn.replace(new F(i.startLineNumber,1,i.endLineNumber,s.getLineMaxColumn(i.endLineNumber)),i.after.join(` +`)):null}class yet extends tt{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)=>F.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;rnew oe(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(Te),a=t.getModel(),c=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a?.getLanguageId(),resource:a?.uri}),l=new vFt(o,n,c);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}};Jse.ID="editor.action.trimTrailingWhitespace";let Qwe=Jse;class J2t extends tt{constructor(){super({id:"editor.action.deleteLines",label:g(1490,"Delete Line"),alias:"Delete Line",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|U.Shift|S.KeyK,weight:Ae.EditorContrib}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let c=0,l=i.length;c1&&(h-=1,f=n.getLineMaxColumn(h)),r.push(Zn.replace(new dt(h,f,u,p),"")),a.push(new dt(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 n=t[0];for(let o=1;o=t[o].startLineNumber?n.endLineNumber=t[o].endLineNumber:(i.push(n),n=t[o]);return i.push(n),i}}class X2t extends tt{constructor(){super({id:"editor.action.indentLines",label:g(1491,"Indent Line"),alias:"Indent Line",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.BracketRight,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,QE.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Z2t extends tt{constructor(){super({id:"editor.action.outdentLines",label:g(1492,"Outdent Line"),alias:"Outdent Line",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.BracketLeft,weight:Ae.EditorContrib}})}run(e,t){RO.Outdent.runEditorCommand(e,t,null)}}class eWt extends tt{constructor(){super({id:"editor.action.insertLineBefore",label:g(1493,"Insert Line Above"),alias:"Insert Line Above",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Enter,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,jre.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class tWt extends tt{constructor(){super({id:"editor.action.insertLineAfter",label:g(1494,"Insert Line Below"),alias:"Insert Line Below",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.Enter,weight:Ae.EditorContrib}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,jre.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class Eet extends tt{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let c=0,l=n.length-1;cZn.replace(c,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class iWt extends Eet{constructor(){super({id:"deleteAllLeft",label:g(1495,"Delete All Left"),alias:"Delete All Left",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.CtrlCmd|S.Backspace},weight:Ae.EditorContrib}})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const c=r.startLineNumber-o;a=new dt(c,r.startColumn,c,r.startColumn)}else a=new dt(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:n.push(a)}),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const n=e.getModel();return n===null?[]:(i.sort(F.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:n.getLineLength(r)+1;return new F(r,a,o.startLineNumber,1)}else return new F(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new F(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class nWt extends Eet{constructor(){super({id:"deleteAllRight",label:g(1496,"Delete All Right"),alias:"Delete All Right",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyK,secondary:[U.CtrlCmd|S.Delete]},weight:Ae.EditorContrib}})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new F(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new F(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return n.sort(F.compareRangesUsingStarts),n}}class sWt extends tt{constructor(){super({id:"editor.action.joinLines",label:g(1497,"Join Lines"),alias:"Join Lines",precondition:J.writable,kbOpts:{kbExpr:J.editorTextFocus,primary:0,mac:{primary:U.WinCtrl|S.KeyJ},weight:Ae.EditorContrib}})}run(e,t){const i=t.getSelections();if(i===null)return;let n=t.getSelection();if(n===null)return;i.sort(F.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(n.equalsSelection(u)&&(n=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new dt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new dt(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const c=[],l=[];let d=n,h=0;for(let u=0,f=o.length;u=1){let z=!0;A===""&&(z=!1),z&&(A.charAt(A.length-1)===" "||A.charAt(A.length-1)===" ")&&(z=!1,A=A.replace(/[\s\uFEFF\xA0]+$/g," "));const G=P.substr(R-1);A+=(z?" ":"")+G,z?b=G.length+1:b=G.length}else b=0}const L=new F(m,v,w,y);if(!L.isEmpty()){let k;p.isEmpty()?(c.push(Zn.replace(L,A)),k=new dt(L.startLineNumber-h,A.length-b+1,m-h,A.length-b+1)):p.startLineNumber===p.endLineNumber?(c.push(Zn.replace(L,A)),k=new dt(p.startLineNumber-h,p.startColumn,p.endLineNumber-h,p.endColumn)):(c.push(Zn.replace(L,A)),k=new dt(p.startLineNumber-h,p.startColumn,p.startLineNumber-h,A.length-C)),F.intersectRanges(L,n)!==null?d=k:l.push(k)}h+=L.endLineNumber-L.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,c,l),t.pushUndoStop()}}class oWt extends tt{constructor(){super({id:"editor.action.transpose",label:g(1498,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:J.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===null)return;const o=[];for(let r=0,a=i.length;r=d){if(l.lineNumber===n.getLineCount())continue;const h=new F(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new Zl(new dt(l.lineNumber,Math.max(1,l.column-1),l.lineNumber+1,1),u))}else{const h=new F(l.lineNumber,Math.max(1,l.column-1),l.lineNumber,l.column+1),u=n.getValueInRange(h).split("").reverse().join("");o.push(new ITe(h,u,new dt(l.lineNumber,l.column+1,l.lineNumber,l.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class zN extends tt{run(e,t){const i=t.getSelections();if(i===null)return;const n=t.getModel();if(n===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 F(c.lineNumber,l.startColumn,c.lineNumber,l.endColumn),h=n.getValueInRange(d);r.push(Zn.replace(d,this._modifyText(h,o)))}else{const c=n.getValueInRange(a);r.push(Zn.replace(a,this._modifyText(c,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class rWt extends zN{constructor(){super({id:"editor.action.transformToUppercase",label:g(1499,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:J.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class aWt extends zN{constructor(){super({id:"editor.action.transformToLowercase",label:g(1500,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:J.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class lA{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 Xse=class Xse extends zN{constructor(){super({id:"editor.action.transformToTitlecase",label:g(1501,"Transform to Title Case"),alias:"Transform to Title Case",precondition:J.writable})}_modifyText(e,t){const i=Xse.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,n=>n.toLocaleUpperCase()):e}};Xse.titleBoundary=new lA("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let qX=Xse;const eO=class eO extends zN{constructor(){super({id:"editor.action.transformToSnakecase",label:g(1502,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:J.writable})}_modifyText(e,t){const i=eO.caseBoundary.get(),n=eO.singleLetters.get();return!i||!n?e:e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase()}};eO.caseBoundary=new lA("(\\p{Ll})(\\p{Lu})","gmu"),eO.singleLetters=new lA("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let H5=eO;const Zse=class Zse extends zN{constructor(){super({id:"editor.action.transformToCamelcase",label:g(1503,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:J.writable})}_modifyText(e,t){const i=Zse.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map(r=>r.substring(0,1).toLocaleUpperCase()+r.substring(1)).join("")}};Zse.wordBoundary=new lA("[_\\s-]","gm");let QX=Zse;const tO=class tO extends zN{constructor(){super({id:"editor.action.transformToPascalcase",label:g(1504,"Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:J.writable})}_modifyText(e,t){const i=tO.wordBoundary.get(),n=tO.wordBoundaryToMaintain.get();return!i||!n?e:e.split(n).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};tO.wordBoundary=new lA("[_\\s-]","gm"),tO.wordBoundaryToMaintain=new lA("(?<=\\.)","gm");let jX=tO;const $E=class $E extends zN{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:g(1505,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:J.writable})}_modifyText(e,t){const i=$E.caseBoundary.get(),n=$E.singleLetters.get(),o=$E.underscoreBoundary.get();return!i||!n||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase()}};$E.caseBoundary=new lA("(\\p{Ll})(\\p{Lu})","gmu"),$E.singleLetters=new lA("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),$E.underscoreBoundary=new lA("(\\S)(_)(\\S)","gm");let YX=$E;Me(z2t);Me($2t);Me(G2t);Me(K2t);Me(q2t);Me(Q2t);Me(j2t);Me(Y2t);Me(Qwe);Me(J2t);Me(X2t);Me(Z2t);Me(eWt);Me(tWt);Me(iWt);Me(nWt);Me(sWt);Me(oWt);Me(rWt);Me(aWt);H5.caseBoundary.isSupported()&&H5.singleLetters.isSupported()&&Me(H5);QX.wordBoundary.isSupported()&&Me(QX);jX.wordBoundary.isSupported()&&Me(jX);qX.titleBoundary.isSupported()&&Me(qX);YX.isSupported()&&Me(YX);var cWt=".monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}";ut(cWt,{});var uQ;const xet=new Y("LinkedEditingInputVisible",!1),lWt="linked-editing-decoration";var KD;let DW=(KD=class extends V{static get(e){return e.getContribution(uQ.ID)}constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new Z),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=xet.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(M.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new Lh(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new Lh(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:()=>{n.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 n=t.getValueInRange(i);if(this._currentWordPattern){const r=n.match(this._currentWordPattern);if((r?r[0].length:0)!==n.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){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=n;const o=this._currentRequestCts=new ci;try{const r=new js(!1),a=await Det(this._providers,i,t,o.token);if(this._debounceInformation.update(i,r.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,n!==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:uQ.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(r){Fr(r)||vt(r),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}setDebounceDuration(e){this._debounceDuration=e}},uQ=KD,KD.ID="editor.contrib.linkedEditing",KD.DECORATION=Gt.register({description:"linked-editing",stickiness:ni.AlwaysGrowsWhenTypingAtEdges,className:lWt}),KD);DW=uQ=D([_(1,Le),_(2,it),_(3,Vs),_(4,wp)],DW);class dWt extends tt{constructor(){super({id:"editor.action.linkedEditing",label:g(1506,"Start Linked Editing"),alias:"Start Linked Editing",precondition:he.and(J.writable,J.hasRenameProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.F2,weight:Ae.EditorContrib}})}runCommand(e,t){const i=e.get(Kt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&oe.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},vt):super.runCommand(e,t)}run(e,t){const i=DW.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const hWt=hc.bindToContribution(DW.get);qe(new hWt({id:"cancelLinkedEditingInput",precondition:xet,handler:s=>s.clearRanges(),kbOpts:{kbExpr:J.editorTextFocus,weight:Ae.EditorContrib+99,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));function Det(s,e,t,i){const n=s.ordered(e);return Tre(n.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){No(r);return}}),o=>!!o&&eo(o?.ranges))}W("editor.linkedEditingBackground",{dark:me.fromHex("#f00").transparent(.3),light:me.fromHex("#f00").transparent(.3),hcDark:me.fromHex("#f00").transparent(.3),hcLight:me.white},g(1507,"Background color when the editor auto renames on type."));ng("_executeLinkedEditingProvider",(s,e,t)=>{const{linkedEditingRangeProvider:i}=s.get(it);return Det(i,e,t,He.None)});on(DW.ID,DW,ri.AfterFirstRender);Me(dWt);const eoe=class eoe extends V{static get(e){return e.getContribution(eoe.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===Rt.CONTENT_TEXT&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};eoe.ID="editor.contrib.longLinesHelper";let JX=eoe;on(JX.ID,JX,ri.BeforeFirstInteraction);var uWt=".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}";ut(uWt,{});const gWt=W("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},g(5183,"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);W("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},g(5184,"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);W("editor.wordHighlightTextBackground",gWt,g(5185,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const fWt=W("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(5186,"Border color of a symbol during read-access, like reading a variable."));W("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Js,hcLight:Js},g(5187,"Border color of a symbol during write-access, like writing to a variable."));W("editor.wordHighlightTextBorder",fWt,g(5188,"Border color of a textual occurrence for a symbol."));const pWt=W("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",g(5189,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),mWt=W("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",g(5190,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),_Wt=W("editorOverviewRuler.wordHighlightTextForeground",qKe,g(5191,"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),vWt=Gt.register({description:"word-highlight-strong",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlightStrong",overviewRuler:{color:$o(mWt),position:Dl.Center},minimap:{color:$o(Ure),position:kh.Inline}}),bWt=Gt.register({description:"word-highlight-text",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlightText",overviewRuler:{color:$o(_Wt),position:Dl.Center},minimap:{color:$o(Ure),position:kh.Inline}}),wWt=Gt.register({description:"selection-highlight-overview",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:$o(qKe),position:Dl.Center},minimap:{color:$o(Ure),position:kh.Inline}}),yWt=Gt.register({description:"selection-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),CWt=Gt.register({description:"word-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"wordHighlight",overviewRuler:{color:$o(pWt),position:Dl.Center},minimap:{color:$o(Ure),position:kh.Inline}});function SWt(s){return s===_8.Write?vWt:s===_8.Text?bWt:CWt}function AWt(s){return s?yWt:wWt}bp((s,e)=>{const t=s.getColor(vTe);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var jwe;function SI(s,e){const t=e.filter(i=>!s.find(n=>n.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),n=t.length===1?g(1518,"Cursor added: {0}",i):g(1519,"Cursors added: {0}",i);Ch(n)}}class EWt extends tt{constructor(){super({id:"editor.action.insertCursorAbove",label:g(1520,"Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.UpArrow,linux:{primary:U.Shift|U.Alt|S.UpArrow,secondary:[U.CtrlCmd|U.Shift|S.UpArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1521,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Oi.Explicit,vl.addCursorUp(o,r,n)),o.revealTopMostCursor(i.source),SI(r,o.getCursorStates())}}class xWt extends tt{constructor(){super({id:"editor.action.insertCursorBelow",label:g(1522,"Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Alt|S.DownArrow,linux:{primary:U.Shift|U.Alt|S.DownArrow,secondary:[U.CtrlCmd|U.Shift|S.DownArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1523,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&i.logicalLine===!1&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,Oi.Explicit,vl.addCursorDown(o,r,n)),o.revealBottomMostCursor(i.source),SI(r,o.getCursorStates())}}class DWt extends tt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:g(1524,"Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.KeyI,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1525,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n1&&i.push(new dt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];n.forEach(c=>this.getCursorsForSelection(c,i,a)),a.length>0&&t.setSelections(a),SI(r,o.getCursorStates())}}class kWt extends tt{constructor(){super({id:"editor.action.addCursorsToBottom",label:g(1526,"Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let c=i[0].startLineNumber;c<=n;c++)o.push(new dt(c,i[0].startColumn,c,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),SI(a,r.getCursorStates())}}class IWt extends tt{constructor(){super({id:"editor.action.addCursorsToTop",label:g(1527,"Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let a=i[0].startLineNumber;a>=1;a--)n.push(new dt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();n.length>0&&t.setSelections(n),SI(r,o.getCursorStates())}}class EK{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class n9{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new n9(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(n=!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 dt(c.startLineNumber,h.startColumn,c.startLineNumber,h.endColumn)}else l=e.getModel().getValueInRange(c).replace(/\r\n/g,` +`);return new n9(e,t,n,l,o,r,d)}constructor(e,t,i,n,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,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 EK(t.concat(e),e,mt.Smooth)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new EK(t.slice(0,t.length-1).concat(e),e,mt.Smooth)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}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 dt(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 EK(t.concat(e),e,mt.Smooth)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new EK(t.slice(0,t.length-1).concat(e),e,mt.Smooth)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}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 dt(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,Un.MAX_SAFE_SMALL_INTEGER):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER)}}const toe=class toe extends V{static get(e){return e.getContribution(toe.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=n9.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=ph.True,i.matchCaseOverride=ph.True,i.isRegexOverride=ph.False),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:ph.NotSet,matchCaseOverride:ph.NotSet,isRegexOverride:ph.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 dt(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 n=e.getState().matchCase;if(!ket(this._editor.getModel(),t,n)){const r=this._editor.getModel(),a=[];for(let c=0,l=t.length;c0&&i.isRegex){const n=this._editor.getModel();i.searchScope?t=n.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER):t=n.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(x.wordSeparators):null,!1,Un.MAX_SAFE_SMALL_INTEGER)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const n=this._editor.getSelection();for(let o=0,r=t.length;onew dt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}selectAllUsingSelections(e){e.length>0&&this._setSelections(e)}};toe.ID="editor.contrib.multiCursorController";let kW=toe;class UU extends tt{run(e,t){const i=kW.get(t);if(!i)return;const n=t._getViewModel();if(n){const o=n.getCursorStates(),r=ig.get(t);if(r)this._run(i,r);else{const a=e.get(we).createInstance(ig,t);this._run(i,a),a.dispose()}SI(o,n.getCursorStates())}}}class TWt extends UU{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:g(1528,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|S.KeyD,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1529,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class LWt extends UU{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:g(1530,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1531,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class RWt extends UU{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:g(1532,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|S.KeyD),weight:Ae.EditorContrib}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class MWt extends UU{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:g(1533,"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 NWt extends UU{constructor(){super({id:"editor.action.selectHighlights",label:g(1534,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:J.focus,primary:U.CtrlCmd|U.Shift|S.KeyL,weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"3_multi",title:g(1535,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class PWt extends UU{constructor(){super({id:"editor.action.changeAll",label:g(1536,"Change All Occurrences"),alias:"Change All Occurrences",precondition:he.and(J.writable,J.editorTextFocus),kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|S.F2,weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class FWt{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,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(F.compareRangesUsingStarts)),this._cachedFindMatches}}var GL;let XX=(GL=class extends V{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 cn(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(n=>{this._isEnabled=e.getOption(x.selectionHighlight)})),this._register(e.onDidChangeCursorSelection(n=>{this._isEnabled&&(n.selection.isEmpty()?n.reason===Oi.Explicit?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(n=>{this._setState(null)})),this._register(e.onDidChangeModelContent(n=>{this._isEnabled&&this.updateSoon.schedule()}));const i=ig.get(e);i&&this._register(i.getState().onFindReplaceStateChange(n=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(jwe._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const o=kW.get(i);if(!o)return null;const r=ig.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(!ket(i.getModel(),d,u))return null}a=n9.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 FWt(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(),n=this.editor.getSelections();n.sort(F.compareRangesUsingStarts);const o=[];for(let l=0,d=0,h=i.length,u=n.length;l=u)o.push(f),l++;else{const p=F.compareRangesUsingStarts(f,n[d]);p<0?((n[d].isEmpty()||!F.areIntersecting(f,n[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:AWt(a)}));this._decorations.set(c)}dispose(){this._setState(null),super.dispose()}},jwe=GL,GL.ID="editor.contrib.selectionHighlighter",GL);XX=jwe=D([_(1,it)],XX);function ket(s,e,t){const i=HUe(s,e[0],!t);for(let n=1,o=e.length;nthis.editor.getModel()),this.uiState=Ze(this,n=>{if(this.isDisposed.read(n))return;const o=this.currentTextModel.read(n);if(o!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;let a=this.model.range?.read(n);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(w=>w.length===0),d=[],h=[];function u(w,y){if(h.length>0){const C=h[h.length-1];y&&C.decorations.push(new Zh(C.content.length+1,C.content.length+1+w[0].length,y,Ja.Regular)),C.content+=w[0],w=w.slice(1)}for(const C of w)h.push({content:C,decorations:y?[new Zh(1,C.length+1,y,Ja.Regular)]:[]})}const f=o.getLineContent(r.lineNumber);let p,m=0;if(!l&&(c||!a)){for(const w of r.parts){let y=w.lines;a&&!c&&(u(y,Xhe),y=[]),p===void 0?(d.push({column:w.column,text:y[0],preview:w.preview}),y=y.slice(1)):u([f.substring(m,w.column-1)],void 0),y.length>0&&(u(y,Xhe),p===void 0&&w.column<=f.length&&(p=w.column)),m=w.column-1}p!==void 0&&u([f.substring(m)],void 0)}const v=p!==void 0?new IXe(p,f.length+1):void 0,b=c||!a?r.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:h,hiddenRange:v,lineNumber:b,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:o,range:a,isSingleLine:c,isPureRemove:l}}),this.decorations=Ze(this,n=>{const o=this.uiState.read(n);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 c=o.range.endLineNumber-o.range.startLineNumber;for(let l=0;l{const o=this.uiState.read(n);return o&&!o.isPureRemove&&(o.isSingleLine||!o.range)?{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(TXe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Ywe=D([_(2,xi)],Ywe);var $Wt=".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}";ut($Wt,{});var gQ;let Jwe=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ze(this,n=>{const o=this.model.read(n)?.model.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!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(au((n,o)=>{if(!this.model.read(n)||!this.alwaysShowToolbar.read(n))return;const a=o.add(this.instantiationService.createInstance(Xwe,this.editor,!0,this.position));e.addContentWidget(a),o.add(Ee(()=>e.removeContentWidget(a)))}))}};Jwe=D([_(2,we)],Jwe);var qD;let Xwe=(qD=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,o,r){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=o,this._menuService=r,this.id=`InlineEditHintsContentWidget${gQ.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Bt("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[Bt("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(_e.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(n.createInstance(Zwe,this.nodes.toolBar,this.editor,_e.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,c)=>{if(a instanceof Sc)return n.createInstance(GWt,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{gQ._dropDownVisible=a})),this._register(ai(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(ai(a=>{const c=[];for(const[l,d]of this.inlineCompletionsActionsMenus.getActions())for(const h of d)h instanceof Sc&&c.push(h);c.length>0&&c.unshift(new Ar),this.toolBar.setAdditionalSecondaryActions(c)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[es.ABOVE,es.BELOW],positionAffinity:Io.LeftOfInjectedText}}},gQ=qD,qD._dropDownVisible=!1,qD.id=0,qD);Xwe=gQ=D([_(3,we),_(4,Le),_(5,Oa)],Xwe);class GWt extends kb{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Bt("div.keybinding").root;this._register(new Vk(t,po,{disableTitle:!0,...aYe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let Zwe=class extends oW{constructor(e,t,i,n,o,r,a,c,l,d){super(e,{resetMenu:i,...n},o,r,a,c,l,d),this.editor=t,this.menuId=i,this.options2=n,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=[];dC(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){is(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){is(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};Zwe=D([_(4,Oa),_(5,Le),_(6,lr),_(7,Ut),_(8,vi),_(9,Yi)],Zwe);var KWt=".monaco-editor .inlineEditSideBySide{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);white-space:pre;z-index:39}";ut(KWt,{});var pV,eye;function*qWt(s,e,t=1){e===void 0&&([e,s]=[s,0]);for(let i=s;ii.replace(new RegExp("^"+e),"")),shift:t}}var KL;let tye=(KL=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edit-widget",path:new Date().toString()+String(pV._modelId++)})}constructor(e,t,i,n,o){super(),this._editor=e,this._model=t,this._instantiationService=i,this._diffProviderFactoryService=n,this._modelService=o,this._position=Ze(this,r=>{const a=this._model.read(r);if(!a||a.text.length===0||a.range.startLineNumber===a.range.endLineNumber&&!(a.range.startColumn===a.range.endColumn&&a.range.startColumn===1))return null;const c=this._editor.getModel();if(!c)return null;const l=Array.from(qWt(a.range.startLineNumber,a.range.endLineNumber+1)),d=l.map(m=>c.getLineLastNonWhitespaceColumn(m)),h=Math.max(...d),u=l[d.indexOf(h)],f=new oe(u,h);return{top:a.range.startLineNumber,left:f}}),this._text=Ze(this,r=>{const a=this._model.read(r);if(!a)return{text:"",shift:0};const c=Zhe(a.text.split(` `));return{text:c.text.join(` -`),shift:c.shift}}),this._originalModel=mh(()=>this._modelService.createModel("",null,_V._createUniqueUri())).keepObserved(this._store),this._modifiedModel=mh(()=>this._modelService.createModel("",null,_V._createUniqueUri())).keepObserved(this._store),this._diff=Ze(this,r=>this._diffPromise.read(r)?.promiseResult.read(r)?.data),this._diffPromise=Ze(this,r=>{const a=this._model.read(r);if(!a)return;const c=this._editor.getModel();if(!c)return;const l=rue(c.getValueInRange(a.range).split(` +`),shift:c.shift}}),this._originalModel=fh(()=>this._modelService.createModel("",null,pV._createUniqueUri())).keepObserved(this._store),this._modifiedModel=fh(()=>this._modelService.createModel("",null,pV._createUniqueUri())).keepObserved(this._store),this._diff=Ze(this,r=>this._diffPromise.read(r)?.promiseResult.read(r)?.data),this._diffPromise=Ze(this,r=>{const a=this._model.read(r);if(!a)return;const c=this._editor.getModel();if(!c)return;const l=Zhe(c.getValueInRange(a.range).split(` `)).text.join(` -`),d=rue(a.text.split(` +`),d=Zhe(a.text.split(` `)).text.join(` -`);this._originalModel.get().setValue(l),this._modifiedModel.get().setValue(d);const h=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return E6.fromFn(async()=>{const u=await h.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!u.identical)return u.changes})}),this._register(cu((r,a)=>{if(!this._model.read(r)||this._position.get()===null)return;const l=a.add(this._instantiationService.createInstance(cye,this._editor,this._position,this._text.map(d=>d.text),this._text.map(d=>d.shift),this._diff));e.addOverlayWidget(l),a.add(Ee(()=>e.removeOverlayWidget(l)))}))}},_V=YL,YL._modelId=0,YL);aye=_V=D([_(2,we),_(3,x6),_(4,gi)],aye);var ZD;let cye=(ZD=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,o,r){super(),this._editor=e,this._position=t,this._text=i,this._shift=n,this._diff=o,this._instantiationService=r,this.id=`InlineEditSideBySideContentWidget${rye.id++}`,this.allowEditorOverflow=!1,this._nodes=fe("div.inlineEditSideBySide",void 0),this._scrollChanged=id("editor.onDidScrollChange",this._editor.onDidScrollChange),this._previewEditor=this._register(this._instantiationService.createInstance(lf,this._nodes,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off",wrappingIndent:"none",wrappingStrategy:void 0},{contributions:[],isSimpleWidget:!0},this._editor)),this._previewEditorObs=Xh(this._previewEditor),this._editorObs=Xh(this._editor),this._previewTextModel=this._register(this._instantiationService.createInstance(C_,"",this._editor.getModel()?.getLanguageId()??Ca,C_.DEFAULT_CREATION_OPTIONS,null)),this._setText=Ze(a=>{const c=this._text.read(a);c&&this._previewTextModel.setValue(c)}).recomputeInitiallyAndOnChange(this._store),this._decorations=Ze(this,a=>{this._setText.read(a);const c=this._position.read(a);if(!c)return{org:[],mod:[]};const l=this._diff.read(a);if(!l)return{org:[],mod:[]};const d=[],h=[];if(l.length===1&&l[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return{org:[],mod:[]};const u=this._shift.get(),f=p=>new F(p.startLineNumber+c.top-1,p.startColumn+u,p.endLineNumber+c.top-1,p.endColumn+u);for(const p of l)if(p.original.isEmpty||d.push({range:f(p.original.toInclusiveRange()),options:L3}),p.modified.isEmpty||h.push({range:p.modified.toInclusiveRange(),options:AJ}),p.modified.isEmpty||p.original.isEmpty)p.original.isEmpty||d.push({range:f(p.original.toInclusiveRange()),options:ARe}),p.modified.isEmpty||h.push({range:p.modified.toInclusiveRange(),options:CRe});else for(const m of p.innerChanges||[])p.original.contains(m.originalRange.startLineNumber)&&d.push({range:f(m.originalRange),options:m.originalRange.isEmpty()?ERe:cW}),p.modified.contains(m.modifiedRange.startLineNumber)&&h.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()?SRe:EJ});return{org:d,mod:h}}),this._originalDecorations=Ze(this,a=>this._decorations.read(a).org),this._modifiedDecorations=Ze(this,a=>this._decorations.read(a).mod),this._previewEditor.setModel(this._previewTextModel),this._register(this._editorObs.setDecorations(this._originalDecorations)),this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)),this._register(ai(a=>{const c=this._previewEditorObs.contentWidth.read(a),l=this._text.read(a).split(` -`).length-1,d=this._editor.getOption(x.lineHeight)*l;c<=0||this._previewEditor.layout({height:d,width:c})})),this._register(ai(a=>{this._position.read(a),this._editor.layoutOverlayWidget(this)})),this._register(ai(a=>{this._scrollChanged.read(a),this._position.read(a)&&this._editor.layoutOverlayWidget(this)}))}getId(){return this.id}getDomNode(){return this._nodes}getPosition(){const e=this._position.get();if(!e)return null;const t=this._editor.getLayoutInfo(),i=this._editor.getScrolledVisiblePosition(new oe(e.top,1));if(!i)return null;const n=i.top-1,o=this._editor.getOffsetForColumn(e.left.lineNumber,e.left.column);return{preference:{left:t.contentLeft+o+10,top:n}}}},rye=ZD,ZD._dropDownVisible=!1,ZD.id=0,ZD);cye=rye=D([_(5,we)],cye);var vV,Up;let iu=(Up=class extends V{static get(e){return e.getContribution(vV.ID)}constructor(e,t,i,n,o,r,a,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=n,this._commandService=o,this._configurationService=r,this._diffProviderFactoryService=a,this._modelService=c,this._isVisibleContext=vV.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=vV.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=jt(this,void 0),this._currentWidget=mh(this._currentEdit,p=>{const m=this._currentEdit.read(p);if(!m)return;const v=m.range.endLineNumber,b=m.range.endColumn,w=m.text.endsWith(` -`)&&!(m.range.startLineNumber===m.range.endLineNumber&&m.range.startColumn===m.range.endColumn)?m.text.slice(0,-1):m.text,y=new $3(v,[new tX(b,w,!1)]),C=m.range.startLineNumber===m.range.endLineNumber&&y.parts.length===1&&y.parts[0].lines.length===1,A=m.text==="";return!C&&!A?void 0:this.instantiationService.createInstance(iye,this.editor,{ghostText:nd(y),minReservedLineCount:nd(0),targetTextModel:nd(this.editor.getModel()??void 0),range:nd(m.range)})}),this._isAccepting=jt(this,!1),this._enabled=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).enabled),this._fontFamily=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).fontFamily);const l=id("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(ai(p=>{this._enabled.read(p)&&(l.read(p),!this._isAccepting.read(p)&&this.getInlineEdit(e,!0))}));const d=Kn(this,e.onDidChangeCursorPosition,()=>e.getPosition());this._register(ai(p=>{if(!this._enabled.read(p))return;const m=d.read(p);m&&this.checkCursorPosition(m)})),this._register(ai(p=>{const m=this._currentEdit.read(p);if(this._isCursorAtInlineEditContext.set(!1),!m){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const v=e.getPosition();v&&this.checkCursorPosition(v)}));const h=id("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(ai(async p=>{this._enabled.read(p)&&(h.read(p),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(x.inlineEdit).keepOnBlur)&&(this._currentRequestCts?.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const u=id("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(ai(p=>{this._enabled.read(p)&&(u.read(p),this.getInlineEdit(e,!0))}));const f=this._register(GGe());this._register(ai(p=>{const m=this._fontFamily.read(p);f.setStyle(m===""||m==="default"?"":` +`);this._originalModel.get().setValue(l),this._modifiedModel.get().setValue(d);const h=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return y6.fromFn(async()=>{const u=await h.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!u.identical)return u.changes})}),this._register(au((r,a)=>{if(!this._model.read(r)||this._position.get()===null)return;const l=a.add(this._instantiationService.createInstance(iye,this._editor,this._position,this._text.map(d=>d.text),this._text.map(d=>d.shift),this._diff));e.addOverlayWidget(l),a.add(Ee(()=>e.removeOverlayWidget(l)))}))}},pV=KL,KL._modelId=0,KL);tye=pV=D([_(2,we),_(3,C6),_(4,gi)],tye);var QD;let iye=(QD=class extends V{static get dropDownVisible(){return this._dropDownVisible}constructor(e,t,i,n,o,r){super(),this._editor=e,this._position=t,this._text=i,this._shift=n,this._diff=o,this._instantiationService=r,this.id=`InlineEditSideBySideContentWidget${eye.id++}`,this.allowEditorOverflow=!1,this._nodes=fe("div.inlineEditSideBySide",void 0),this._scrollChanged=ed("editor.onDidScrollChange",this._editor.onDidScrollChange),this._previewEditor=this._register(this._instantiationService.createInstance(rf,this._nodes,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off",wrappingIndent:"none",wrappingStrategy:void 0},{contributions:[],isSimpleWidget:!0},this._editor)),this._previewEditorObs=Jh(this._previewEditor),this._editorObs=Jh(this._editor),this._previewTextModel=this._register(this._instantiationService.createInstance(b_,"",this._editor.getModel()?.getLanguageId()??Ca,b_.DEFAULT_CREATION_OPTIONS,null)),this._setText=Ze(a=>{const c=this._text.read(a);c&&this._previewTextModel.setValue(c)}).recomputeInitiallyAndOnChange(this._store),this._decorations=Ze(this,a=>{this._setText.read(a);const c=this._position.read(a);if(!c)return{org:[],mod:[]};const l=this._diff.read(a);if(!l)return{org:[],mod:[]};const d=[],h=[];if(l.length===1&&l[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return{org:[],mod:[]};const u=this._shift.get(),f=p=>new F(p.startLineNumber+c.top-1,p.startColumn+u,p.endLineNumber+c.top-1,p.endColumn+u);for(const p of l)if(p.original.isEmpty||d.push({range:f(p.original.toInclusiveRange()),options:k3}),p.modified.isEmpty||h.push({range:p.modified.toInclusiveRange(),options:CJ}),p.modified.isEmpty||p.original.isEmpty)p.original.isEmpty||d.push({range:f(p.original.toInclusiveRange()),options:uRe}),p.modified.isEmpty||h.push({range:p.modified.toInclusiveRange(),options:dRe});else for(const m of p.innerChanges||[])p.original.contains(m.originalRange.startLineNumber)&&d.push({range:f(m.originalRange),options:m.originalRange.isEmpty()?gRe:sW}),p.modified.contains(m.modifiedRange.startLineNumber)&&h.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()?hRe:SJ});return{org:d,mod:h}}),this._originalDecorations=Ze(this,a=>this._decorations.read(a).org),this._modifiedDecorations=Ze(this,a=>this._decorations.read(a).mod),this._previewEditor.setModel(this._previewTextModel),this._register(this._editorObs.setDecorations(this._originalDecorations)),this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)),this._register(ai(a=>{const c=this._previewEditorObs.contentWidth.read(a),l=this._text.read(a).split(` +`).length-1,d=this._editor.getOption(x.lineHeight)*l;c<=0||this._previewEditor.layout({height:d,width:c})})),this._register(ai(a=>{this._position.read(a),this._editor.layoutOverlayWidget(this)})),this._register(ai(a=>{this._scrollChanged.read(a),this._position.read(a)&&this._editor.layoutOverlayWidget(this)}))}getId(){return this.id}getDomNode(){return this._nodes}getPosition(){const e=this._position.get();if(!e)return null;const t=this._editor.getLayoutInfo(),i=this._editor.getScrolledVisiblePosition(new oe(e.top,1));if(!i)return null;const n=i.top-1,o=this._editor.getOffsetForColumn(e.left.lineNumber,e.left.column);return{preference:{left:t.contentLeft+o+10,top:n}}}},eye=QD,QD._dropDownVisible=!1,QD.id=0,QD);iye=eye=D([_(5,we)],iye);var mV,Bp;let tu=(Bp=class extends V{static get(e){return e.getContribution(mV.ID)}constructor(e,t,i,n,o,r,a,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=n,this._commandService=o,this._configurationService=r,this._diffProviderFactoryService=a,this._modelService=c,this._isVisibleContext=mV.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=mV.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=jt(this,void 0),this._currentWidget=fh(this._currentEdit,p=>{const m=this._currentEdit.read(p);if(!m)return;const v=m.range.endLineNumber,b=m.range.endColumn,w=m.text.endsWith(` +`)&&!(m.range.startLineNumber===m.range.endLineNumber&&m.range.startColumn===m.range.endColumn)?m.text.slice(0,-1):m.text,y=new U3(v,[new ZJ(b,w,!1)]),C=m.range.startLineNumber===m.range.endLineNumber&&y.parts.length===1&&y.parts[0].lines.length===1,A=m.text==="";return!C&&!A?void 0:this.instantiationService.createInstance(Ywe,this.editor,{ghostText:td(y),minReservedLineCount:td(0),targetTextModel:td(this.editor.getModel()??void 0),range:td(m.range)})}),this._isAccepting=jt(this,!1),this._enabled=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).enabled),this._fontFamily=Kn(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(x.inlineEdit).fontFamily);const l=ed("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(ai(p=>{this._enabled.read(p)&&(l.read(p),!this._isAccepting.read(p)&&this.getInlineEdit(e,!0))}));const d=Kn(this,e.onDidChangeCursorPosition,()=>e.getPosition());this._register(ai(p=>{if(!this._enabled.read(p))return;const m=d.read(p);m&&this.checkCursorPosition(m)})),this._register(ai(p=>{const m=this._currentEdit.read(p);if(this._isCursorAtInlineEditContext.set(!1),!m){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const v=e.getPosition();v&&this.checkCursorPosition(v)}));const h=ed("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(ai(async p=>{this._enabled.read(p)&&(h.read(p),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(x.inlineEdit).keepOnBlur)&&(this._currentRequestCts?.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const u=ed("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(ai(p=>{this._enabled.read(p)&&(u.read(p),this.getInlineEdit(e,!0))}));const f=this._register(OGe());this._register(ai(p=>{const m=this._fontFamily.read(p);f.setStyle(m===""||m==="default"?"":` .monaco-editor .inline-edit-decoration, .monaco-editor .inline-edit-decoration-preview, .monaco-editor .inline-edit { font-family: ${m}; -}`)})),this._register(new nye(this.editor,this._currentWidget,this.instantiationService)),this._register(new aye(this.editor,this._currentEdit,this.instantiationService,this._diffProviderFactoryService,this._modelService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get();if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(F.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 n=t.range.endLineNumber,o=t.range.endColumn,r=e.getModel()?.getLineLength(n)??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 n=i.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(i);if(o.length===0)return;const r=o[0];this._currentRequestCts=new ci;const a=this._currentRequestCts.token,c=t?L2.Automatic:L2.Invoke;if(t&&await oHt(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)return;const d=await r.provideInlineEdit(i,{triggerKind:c},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);i&&this._currentEdit.set(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();if(!e)return;let t=e.text;e.text.startsWith(` -`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[Zn.replace(F.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,No),this.freeEdit(e),ts(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){this._jumpBackPosition=this.editor.getSelection()?.getStartPosition();const e=this._currentEdit.get();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();t&&t?.rejected&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,No),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(),i=this._currentWidget.get();if(!t||!i)return!1;const n=t,o=i.model;if(F.containsPosition(n.range,e.getStartPosition())||F.containsPosition(n.range,e.getEndPosition()))return!0;const a=o.ghostText.get();return a?a.parts.some(c=>e.containsPosition(new oe(a.lineNumber,c.column))):!1}shouldShowHoverAtViewZone(e){return this._currentWidget.get()?.ownsViewZone(e)??!1}},vV=Up,Up.ID="editor.contrib.inlineEditController",Up.inlineEditVisibleKey="inlineEditVisible",Up.inlineEditVisibleContext=new Q(Up.inlineEditVisibleKey,!1),Up.cursorAtInlineEditKey="cursorAtInlineEdit",Up.cursorAtInlineEditContext=new Q(Up.cursorAtInlineEditKey,!1),Up);iu=vV=D([_(1,we),_(2,Le),_(3,it),_(4,vi),_(5,Te),_(6,x6),_(7,gi)],iu);function oHt(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}let rHt=class extends tt{constructor(){super({id:YWt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:he.and(J.writable,iu.inlineEditVisibleContext),kbOpts:[{weight:Ae.EditorContrib+1,primary:S.Tab,kbExpr:he.and(J.writable,iu.inlineEditVisibleContext,iu.cursorAtInlineEditContext)}],menuOpts:[{menuId:_e.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await iu.get(t)?.accept()}};class aHt extends tt{constructor(){const e=he.and(J.writable,he.not(iu.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e}})}async run(e,t){iu.get(t)?.trigger()}}class cHt extends tt{constructor(){const e=he.and(J.writable,iu.inlineEditVisibleContext,he.not(iu.cursorAtInlineEditKey));super({id:XWt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){iu.get(t)?.jumpToCurrent()}}class lHt extends tt{constructor(){const e=he.and(J.writable,iu.cursorAtInlineEditContext);super({id:ZWt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+10,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){iu.get(t)?.jumpBack()}}class dHt extends tt{constructor(){const e=he.and(J.writable,iu.inlineEditVisibleContext);super({id:JWt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){await iu.get(t)?.clear()}}Re(rHt);Re(dHt);Re(cHt);Re(lHt);Re(aHt);on(iu.ID,iu,ri.Eventually);const hHt="editor.action.inlineEdits.accept",uHt="editor.action.inlineEdits.showPrevious",gHt="editor.action.inlineEdits.showNext",MW=new Q("inlineEditsVisible",!1,g(9879,"Whether an inline edit is visible")),fHt=new Q("inlineEditsIsPinned",!1,g(9880,"Whether an inline edit is visible"));var pHt=".monaco-editor div.inline-edits-widget{--widget-color:var(--vscode-notifications-background);.promptEditor .monaco-editor{--vscode-editor-placeholder-foreground:var(--vscode-editorGhostText-foreground)}.promptEditor,.toolbar{opacity:0;transition:opacity .2s ease-in-out}&.focused,&:hover{.promptEditor,.toolbar{opacity:1}}.preview .monaco-editor{--vscode-editor-background:var(--widget-color);.mtk1{color:var(--vscode-editorGhostText-foreground)}.current-line-margin,.view-overlays .current-line-exact{border:none}}svg{.gradient-start{stop-color:var(--vscode-editor-background)}.gradient-stop{stop-color:var(--widget-color)}}}";ut(pHt,{});const roe=class roe extends V{static get(e){return e.getContribution(roe.ID)}constructor(e){super(),this._editor=e,this._editorObs=Xh(this._editor),this._placeholderText=this._editorObs.getOption(x.placeholder),this._state=Jh({owner:this,equalsFn:jY},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=mHt(this,t=>this._state.read(t)?.placeholder!==void 0),this._view=AI((t,i)=>{if(!this._shouldViewBeAlive.read(t))return;const n=Bt("div.editorPlaceholder");i.add(ai(o=>{const r=this._state.read(o),a=r?.placeholder!==void 0;n.root.style.display=a?"block":"none",n.root.innerText=r?.placeholder??""})),i.add(ai(o=>{const r=this._editorObs.layoutInfo.read(o);n.root.style.left=`${r.contentLeft}px`,n.root.style.width=r.contentWidth-r.verticalScrollbarWidth+"px",n.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),i.add(ai(o=>{n.root.style.fontFamily=this._editorObs.getOption(x.fontFamily).read(o),n.root.style.fontSize=this._editorObs.getOption(x.fontSize).read(o)+"px",n.root.style.lineHeight=this._editorObs.getOption(x.lineHeight).read(o)+"px"})),i.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:nd(0),position:nd(null),domNode:n.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};roe.ID="editor.contrib.placeholderText";let a9=roe;function mHt(s,e){return b6(s,(t,i)=>i===!0?!0:e(t))}let _Ht=class{constructor(e,t,i){this.range=e,this.newLines=t,this.changes=i}},lye=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._userPrompt=i,this._instantiationService=n,this._editorObs=Xh(this._editor),this._elements=Bt("div.inline-edits-widget",{style:{position:"absolute",overflow:"visible",top:"0px",left:"0px"}},[Bt("div@editorContainer",{style:{position:"absolute",top:"0px",left:"0px",width:"500px",height:"500px"}},[Bt("div.toolbar@toolbar",{style:{position:"absolute",top:"-25px",left:"0px"}}),Bt("div.promptEditor@promptEditor",{style:{position:"absolute",top:"-25px",left:"80px",width:"300px",height:"22px"}}),Bt("div.preview@editor",{style:{position:"absolute",top:"0px",left:"0px"}})]),tP("svg",{style:{overflow:"visible",pointerEvents:"none"}},[tP("defs",[tP("linearGradient",{id:"Gradient2",x1:"0",y1:"0",x2:"1",y2:"0"},[tP("stop",{offset:"0%",class:"gradient-stop"}),tP("stop",{offset:"100%",class:"gradient-stop"})])]),tP("path@path",{d:"",fill:"url(#Gradient2)"})])]),this._toolbar=this._register(this._instantiationService.createInstance(bm,this._elements.toolbar,_e.InlineEditsActions,{toolbarOptions:{primaryGroup:r=>r.startsWith("primary")}})),this._previewTextModel=this._register(this._instantiationService.createInstance(C_,"",Ca,C_.DEFAULT_CREATION_OPTIONS,null)),this._setText=Ze(r=>{const a=this._edit.read(r);a&&this._previewTextModel.setValue(a.newLines.join(` -`))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(C_,"",Ca,C_.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(lf,this._elements.promptEditor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,placeholder:"Describe the change you want...",fontFamily:XTe},{contributions:ap.getSomeEditorContributions([Xg.ID,a9.ID,Fb.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(lf,this._elements.editor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0},{contributions:[]},this._editor)),this._previewEditorObs=Xh(this._previewEditor),this._decorations=Ze(this,r=>{this._setText.read(r);const a=this._edit.read(r)?.changes;if(!a)return[];const c=[],l=[];if(a.length===1&&a[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return[];for(const d of a)if(d.original.isEmpty||c.push({range:d.original.toInclusiveRange(),options:L3}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:AJ}),d.modified.isEmpty||d.original.isEmpty)d.original.isEmpty||c.push({range:d.original.toInclusiveRange(),options:ARe}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:CRe});else for(const h of d.innerChanges||[])d.original.contains(h.originalRange.startLineNumber)&&c.push({range:h.originalRange,options:h.originalRange.isEmpty()?ERe:cW}),d.modified.contains(h.modifiedRange.startLineNumber)&&l.push({range:h.modifiedRange,options:h.modifiedRange.isEmpty()?SRe:EJ});return l}),this._layout1=Ze(this,r=>{const a=this._editor.getModel(),c=this._edit.read(r);if(!c)return null;const l=c.range;let d=0;for(let f=l.startLineNumber;f{const a=this._edit.read(r);if(!a)return null;const c=a.range,l=this._editorObs.scrollLeft.read(r),d=this._layout1.read(r).left+20-l,h=this._editor.getTopForLineNumber(c.startLineNumber)-this._editorObs.scrollTop.read(r),u=this._editor.getTopForLineNumber(c.endLineNumberExclusive)-this._editorObs.scrollTop.read(r),f=new F1(d,h),p=new F1(d,u),m=u-h,v=50,b=this._editor.getOption(x.lineHeight)*a.newLines.length,w=m-b,y=new F1(d+v,h+w/2),C=new F1(d+v,u-w/2);return{topCode:f,bottomCode:p,codeHeight:m,topEdit:y,bottomEdit:C,editHeight:b}});const o=Ze(this,r=>this._edit.read(r)!==void 0||this._userPrompt.read(r)!==void 0);this._register(IA(this._elements.root,{display:Ze(this,r=>o.read(r)?"block":"none")})),this._register(gF(this._editor.getDomNode(),this._elements.root)),this._register(Xh(e).createOverlayWidget({domNode:this._elements.root,position:nd(null),allowEditorOverflow:!1,minContentWidthInPx:Ze(r=>{const a=this._layout1.read(r)?.left;if(a===void 0)return 0;const c=this._previewEditorObs.contentWidth.read(r);return a+c})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(ai(r=>{const a=this._layout.read(r);if(!a)return;const{topCode:c,bottomCode:l,topEdit:d,bottomEdit:h,editHeight:u}=a,f=10,p=0,m=40,v=new bHt().moveTo(c).lineTo(c.deltaX(f)).curveTo(c.deltaX(f+m),d.deltaX(-m-p),d.deltaX(-p)).lineTo(d).lineTo(h).lineTo(h.deltaX(-p)).curveTo(h.deltaX(-m-p),l.deltaX(f+m),l.deltaX(f)).lineTo(l).build();this._elements.path.setAttribute("d",v),this._elements.editorContainer.style.top=`${d.y}px`,this._elements.editorContainer.style.left=`${d.x}px`,this._elements.editorContainer.style.height=`${u}px`;const b=this._previewEditorObs.contentWidth.read(r);this._previewEditor.layout({height:u,width:b})})),this._promptEditor.setModel(this._promptTextModel),this._promptEditor.layout(),this._register(wHt(vHt(this._userPrompt,r=>r??"",r=>r),Xh(this._promptEditor).value)),this._register(ai(r=>{const a=Xh(this._promptEditor).isFocused.read(r);this._elements.root.classList.toggle("focused",a)}))}};lye=D([_(3,we)],lye);function vHt(s,e,t){return _6(void 0,i=>e(s.read(i)),(i,n)=>s.set(t(i),n))}class F1{constructor(e,t){this.x=e,this.y=t}add(e){return new F1(this.x+e.x,this.y+e.y)}deltaX(e){return new F1(this.x+e,this.y)}}class bHt{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}curveTo(e,t,i){return this._data+=`C ${e.x} ${e.y} ${t.x} ${t.y} ${i.x} ${i.y} `,this}build(){return this._data}}function wHt(s,e){const t=new Z;return t.add(ai(i=>{const n=s.read(i);e.set(n,void 0)})),t.add(ai(i=>{const n=e.read(i);s.set(n,void 0)})),t}var bV,JL;let dye=(JL=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edits",path:new Date().toString()+String(bV._modelId++)})}constructor(e,t,i,n,o,r,a){super(),this.textModel=e,this._textModelVersionId=t,this._selection=i,this._debounceValue=n,this.languageFeaturesService=o,this._diffProviderFactoryService=r,this._modelService=a,this._forceUpdateExplicitlySignal=gC(this),this._selectedInlineCompletionId=jt(this,void 0),this._isActive=jt(this,!1),this._originalModel=mh(()=>this._modelService.createModel("",null,bV._createUniqueUri())).keepObserved(this._store),this._modifiedModel=mh(()=>this._modelService.createModel("",null,bV._createUniqueUri())).keepObserved(this._store),this._pinnedRange=new CHt(this.textModel,this._textModelVersionId),this.isPinned=this._pinnedRange.range.map(c=>!!c),this.userPrompt=jt(this,void 0),this.inlineEdit=Ze(this,c=>this._inlineEdit.read(c)?.promiseResult.read(c)?.data),this._inlineEdit=Ze(this,c=>{const l=this.selectedInlineEdit.read(c);if(!l)return;const d=l.inlineCompletion.range;if(l.inlineCompletion.insertText.trim()==="")return;let h=l.inlineCompletion.insertText.split(/\r\n|\r|\n/);function u(v){const b=v[0].match(/^\s*/)?.[0]??"";return v.map(w=>w.replace(new RegExp("^"+b),""))}h=u(h);let p=this.textModel.getValueInRange(d).split(/\r\n|\r|\n/);p=u(p),this._originalModel.get().setValue(p.join(` +}`)})),this._register(new Jwe(this.editor,this._currentWidget,this.instantiationService)),this._register(new tye(this.editor,this._currentEdit,this.instantiationService,this._diffProviderFactoryService,this._modelService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get();if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(F.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 n=t.range.endLineNumber,o=t.range.endColumn,r=e.getModel()?.getLineLength(n)??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 n=i.getVersionId(),o=this.languageFeaturesService.inlineEditProvider.all(i);if(o.length===0)return;const r=o[0];this._currentRequestCts=new ci;const a=this._currentRequestCts.token,c=t?D2.Automatic:D2.Invoke;if(t&&await QWt(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)return;const d=await r.provideInlineEdit(i,{triggerKind:c},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);i&&this._currentEdit.set(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();if(!e)return;let t=e.text;e.text.startsWith(` +`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[Zn.replace(F.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,No),this.freeEdit(e),ts(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){this._jumpBackPosition=this.editor.getSelection()?.getStartPosition();const e=this._currentEdit.get();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();t&&t?.rejected&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,No),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(),i=this._currentWidget.get();if(!t||!i)return!1;const n=t,o=i.model;if(F.containsPosition(n.range,e.getStartPosition())||F.containsPosition(n.range,e.getEndPosition()))return!0;const a=o.ghostText.get();return a?a.parts.some(c=>e.containsPosition(new oe(a.lineNumber,c.column))):!1}shouldShowHoverAtViewZone(e){return this._currentWidget.get()?.ownsViewZone(e)??!1}},mV=Bp,Bp.ID="editor.contrib.inlineEditController",Bp.inlineEditVisibleKey="inlineEditVisible",Bp.inlineEditVisibleContext=new Y(Bp.inlineEditVisibleKey,!1),Bp.cursorAtInlineEditKey="cursorAtInlineEdit",Bp.cursorAtInlineEditContext=new Y(Bp.cursorAtInlineEditKey,!1),Bp);tu=mV=D([_(1,we),_(2,Le),_(3,it),_(4,vi),_(5,Te),_(6,C6),_(7,gi)],tu);function QWt(s,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},s);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}let jWt=class extends tt{constructor(){super({id:WWt,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:he.and(J.writable,tu.inlineEditVisibleContext),kbOpts:[{weight:Ae.EditorContrib+1,primary:S.Tab,kbExpr:he.and(J.writable,tu.inlineEditVisibleContext,tu.cursorAtInlineEditContext)}],menuOpts:[{menuId:_e.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){await tu.get(t)?.accept()}};class YWt extends tt{constructor(){const e=he.and(J.writable,he.not(tu.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e}})}async run(e,t){tu.get(t)?.trigger()}}class JWt extends tt{constructor(){const e=he.and(J.writable,tu.inlineEditVisibleContext,he.not(tu.cursorAtInlineEditKey));super({id:UWt,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+1,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){tu.get(t)?.jumpToCurrent()}}class XWt extends tt{constructor(){const e=he.and(J.writable,tu.cursorAtInlineEditContext);super({id:VWt,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib+10,primary:U.CtrlCmd|U.Alt|S.Equal,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){tu.get(t)?.jumpBack()}}class ZWt extends tt{constructor(){const e=he.and(J.writable,tu.inlineEditVisibleContext);super({id:HWt,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:Ae.EditorContrib,primary:S.Escape,kbExpr:e},menuOpts:[{menuId:_e.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){await tu.get(t)?.clear()}}Me(jWt);Me(ZWt);Me(JWt);Me(XWt);Me(YWt);on(tu.ID,tu,ri.Eventually);const eHt="editor.action.inlineEdits.accept",tHt="editor.action.inlineEdits.showPrevious",iHt="editor.action.inlineEdits.showNext",IW=new Y("inlineEditsVisible",!1,g(9879,"Whether an inline edit is visible")),nHt=new Y("inlineEditsIsPinned",!1,g(9880,"Whether an inline edit is visible"));var sHt=".monaco-editor div.inline-edits-widget{--widget-color:var(--vscode-notifications-background);.promptEditor .monaco-editor{--vscode-editor-placeholder-foreground:var(--vscode-editorGhostText-foreground)}.promptEditor,.toolbar{opacity:0;transition:opacity .2s ease-in-out}&.focused,&:hover{.promptEditor,.toolbar{opacity:1}}.preview .monaco-editor{--vscode-editor-background:var(--widget-color);.mtk1{color:var(--vscode-editorGhostText-foreground)}.current-line-margin,.view-overlays .current-line-exact{border:none}}svg{.gradient-start{stop-color:var(--vscode-editor-background)}.gradient-stop{stop-color:var(--widget-color)}}}";ut(sHt,{});const ioe=class ioe extends V{static get(e){return e.getContribution(ioe.ID)}constructor(e){super(),this._editor=e,this._editorObs=Jh(this._editor),this._placeholderText=this._editorObs.getOption(x.placeholder),this._state=Yh({owner:this,equalsFn:qY},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=oHt(this,t=>this._state.read(t)?.placeholder!==void 0),this._view=vI((t,i)=>{if(!this._shouldViewBeAlive.read(t))return;const n=Bt("div.editorPlaceholder");i.add(ai(o=>{const r=this._state.read(o),a=r?.placeholder!==void 0;n.root.style.display=a?"block":"none",n.root.innerText=r?.placeholder??""})),i.add(ai(o=>{const r=this._editorObs.layoutInfo.read(o);n.root.style.left=`${r.contentLeft}px`,n.root.style.width=r.contentWidth-r.verticalScrollbarWidth+"px",n.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),i.add(ai(o=>{n.root.style.fontFamily=this._editorObs.getOption(x.fontFamily).read(o),n.root.style.fontSize=this._editorObs.getOption(x.fontSize).read(o)+"px",n.root.style.lineHeight=this._editorObs.getOption(x.lineHeight).read(o)+"px"})),i.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:td(0),position:td(null),domNode:n.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};ioe.ID="editor.contrib.placeholderText";let s9=ioe;function oHt(s,e){return p6(s,(t,i)=>i===!0?!0:e(t))}let rHt=class{constructor(e,t,i){this.range=e,this.newLines=t,this.changes=i}},nye=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._userPrompt=i,this._instantiationService=n,this._editorObs=Jh(this._editor),this._elements=Bt("div.inline-edits-widget",{style:{position:"absolute",overflow:"visible",top:"0px",left:"0px"}},[Bt("div@editorContainer",{style:{position:"absolute",top:"0px",left:"0px",width:"500px",height:"500px"}},[Bt("div.toolbar@toolbar",{style:{position:"absolute",top:"-25px",left:"0px"}}),Bt("div.promptEditor@promptEditor",{style:{position:"absolute",top:"-25px",left:"80px",width:"300px",height:"22px"}}),Bt("div.preview@editor",{style:{position:"absolute",top:"0px",left:"0px"}})]),XN("svg",{style:{overflow:"visible",pointerEvents:"none"}},[XN("defs",[XN("linearGradient",{id:"Gradient2",x1:"0",y1:"0",x2:"1",y2:"0"},[XN("stop",{offset:"0%",class:"gradient-stop"}),XN("stop",{offset:"100%",class:"gradient-stop"})])]),XN("path@path",{d:"",fill:"url(#Gradient2)"})])]),this._toolbar=this._register(this._instantiationService.createInstance(mm,this._elements.toolbar,_e.InlineEditsActions,{toolbarOptions:{primaryGroup:r=>r.startsWith("primary")}})),this._previewTextModel=this._register(this._instantiationService.createInstance(b_,"",Ca,b_.DEFAULT_CREATION_OPTIONS,null)),this._setText=Ze(r=>{const a=this._edit.read(r);a&&this._previewTextModel.setValue(a.newLines.join(` +`))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(b_,"",Ca,b_.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(rf,this._elements.promptEditor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,placeholder:"Describe the change you want...",fontFamily:HTe},{contributions:sp.getSomeEditorContributions([jg.ID,s9.ID,Mb.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(rf,this._elements.editor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0},{contributions:[]},this._editor)),this._previewEditorObs=Jh(this._previewEditor),this._decorations=Ze(this,r=>{this._setText.read(r);const a=this._edit.read(r)?.changes;if(!a)return[];const c=[],l=[];if(a.length===1&&a[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return[];for(const d of a)if(d.original.isEmpty||c.push({range:d.original.toInclusiveRange(),options:k3}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:CJ}),d.modified.isEmpty||d.original.isEmpty)d.original.isEmpty||c.push({range:d.original.toInclusiveRange(),options:uRe}),d.modified.isEmpty||l.push({range:d.modified.toInclusiveRange(),options:dRe});else for(const h of d.innerChanges||[])d.original.contains(h.originalRange.startLineNumber)&&c.push({range:h.originalRange,options:h.originalRange.isEmpty()?gRe:sW}),d.modified.contains(h.modifiedRange.startLineNumber)&&l.push({range:h.modifiedRange,options:h.modifiedRange.isEmpty()?hRe:SJ});return l}),this._layout1=Ze(this,r=>{const a=this._editor.getModel(),c=this._edit.read(r);if(!c)return null;const l=c.range;let d=0;for(let f=l.startLineNumber;f{const a=this._edit.read(r);if(!a)return null;const c=a.range,l=this._editorObs.scrollLeft.read(r),d=this._layout1.read(r).left+20-l,h=this._editor.getTopForLineNumber(c.startLineNumber)-this._editorObs.scrollTop.read(r),u=this._editor.getTopForLineNumber(c.endLineNumberExclusive)-this._editorObs.scrollTop.read(r),f=new R1(d,h),p=new R1(d,u),m=u-h,v=50,b=this._editor.getOption(x.lineHeight)*a.newLines.length,w=m-b,y=new R1(d+v,h+w/2),C=new R1(d+v,u-w/2);return{topCode:f,bottomCode:p,codeHeight:m,topEdit:y,bottomEdit:C,editHeight:b}});const o=Ze(this,r=>this._edit.read(r)!==void 0||this._userPrompt.read(r)!==void 0);this._register(DA(this._elements.root,{display:Ze(this,r=>o.read(r)?"block":"none")})),this._register(lF(this._editor.getDomNode(),this._elements.root)),this._register(Jh(e).createOverlayWidget({domNode:this._elements.root,position:td(null),allowEditorOverflow:!1,minContentWidthInPx:Ze(r=>{const a=this._layout1.read(r)?.left;if(a===void 0)return 0;const c=this._previewEditorObs.contentWidth.read(r);return a+c})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(ai(r=>{const a=this._layout.read(r);if(!a)return;const{topCode:c,bottomCode:l,topEdit:d,bottomEdit:h,editHeight:u}=a,f=10,p=0,m=40,v=new cHt().moveTo(c).lineTo(c.deltaX(f)).curveTo(c.deltaX(f+m),d.deltaX(-m-p),d.deltaX(-p)).lineTo(d).lineTo(h).lineTo(h.deltaX(-p)).curveTo(h.deltaX(-m-p),l.deltaX(f+m),l.deltaX(f)).lineTo(l).build();this._elements.path.setAttribute("d",v),this._elements.editorContainer.style.top=`${d.y}px`,this._elements.editorContainer.style.left=`${d.x}px`,this._elements.editorContainer.style.height=`${u}px`;const b=this._previewEditorObs.contentWidth.read(r);this._previewEditor.layout({height:u,width:b})})),this._promptEditor.setModel(this._promptTextModel),this._promptEditor.layout(),this._register(lHt(aHt(this._userPrompt,r=>r??"",r=>r),Jh(this._promptEditor).value)),this._register(ai(r=>{const a=Jh(this._promptEditor).isFocused.read(r);this._elements.root.classList.toggle("focused",a)}))}};nye=D([_(3,we)],nye);function aHt(s,e,t){return g6(void 0,i=>e(s.read(i)),(i,n)=>s.set(t(i),n))}class R1{constructor(e,t){this.x=e,this.y=t}add(e){return new R1(this.x+e.x,this.y+e.y)}deltaX(e){return new R1(this.x+e,this.y)}}class cHt{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}curveTo(e,t,i){return this._data+=`C ${e.x} ${e.y} ${t.x} ${t.y} ${i.x} ${i.y} `,this}build(){return this._data}}function lHt(s,e){const t=new Z;return t.add(ai(i=>{const n=s.read(i);e.set(n,void 0)})),t.add(ai(i=>{const n=e.read(i);s.set(n,void 0)})),t}var _V,qL;let sye=(qL=class extends V{static _createUniqueUri(){return N.from({scheme:"inline-edits",path:new Date().toString()+String(_V._modelId++)})}constructor(e,t,i,n,o,r,a){super(),this.textModel=e,this._textModelVersionId=t,this._selection=i,this._debounceValue=n,this.languageFeaturesService=o,this._diffProviderFactoryService=r,this._modelService=a,this._forceUpdateExplicitlySignal=lC(this),this._selectedInlineCompletionId=jt(this,void 0),this._isActive=jt(this,!1),this._originalModel=fh(()=>this._modelService.createModel("",null,_V._createUniqueUri())).keepObserved(this._store),this._modifiedModel=fh(()=>this._modelService.createModel("",null,_V._createUniqueUri())).keepObserved(this._store),this._pinnedRange=new hHt(this.textModel,this._textModelVersionId),this.isPinned=this._pinnedRange.range.map(c=>!!c),this.userPrompt=jt(this,void 0),this.inlineEdit=Ze(this,c=>this._inlineEdit.read(c)?.promiseResult.read(c)?.data),this._inlineEdit=Ze(this,c=>{const l=this.selectedInlineEdit.read(c);if(!l)return;const d=l.inlineCompletion.range;if(l.inlineCompletion.insertText.trim()==="")return;let h=l.inlineCompletion.insertText.split(/\r\n|\r|\n/);function u(v){const b=v[0].match(/^\s*/)?.[0]??"";return v.map(w=>w.replace(new RegExp("^"+b),""))}h=u(h);let p=this.textModel.getValueInRange(d).split(/\r\n|\r|\n/);p=u(p),this._originalModel.get().setValue(p.join(` `)),this._modifiedModel.get().setValue(h.join(` -`));const m=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return E6.fromFn(async()=>{const v=await m.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!v.identical)return new _Ht(pi.fromRangeInclusive(d),u(h),v.changes)})}),this._fetchStore=this._register(new Z),this._inlineEditsFetchResult=f3(this,void 0),this._inlineEdits=Jh({owner:this,equalsFn:jY},c=>this._inlineEditsFetchResult.read(c)?.completions.map(l=>new yHt(l))??[]),this._fetchInlineEditsPromise=Dje({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:em.Automatic}),handleChange:(c,l)=>(c.didChange(this._forceUpdateExplicitlySignal)&&(l.inlineCompletionTriggerKind=em.Explicit),!0)},async(c,l)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(c),this._textModelVersionId.read(c);function d(m,v){return v(m)}const h=this._pinnedRange.range.read(c)??d(this._selection.read(c),m=>m.isEmpty()?void 0:m);if(!h){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const u={triggerKind:l.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(c)},f=Zge(this._fetchStore);await Sr(200,f);const p=await UXe(this.languageFeaturesService.inlineCompletionsProvider,h,this.textModel,u,f);f.isCancellationRequested||this._inlineEditsFetchResult.set(p,void 0)}),this._filteredInlineEditItems=Jh({owner:this,equalsFn:J2()},c=>this._inlineEdits.read(c)),this.selectedInlineCompletionIndex=Ze(this,c=>{const l=this._selectedInlineCompletionId.read(c),d=this._filteredInlineEditItems.read(c),h=this._selectedInlineCompletionId===void 0?-1:d.findIndex(u=>u.semanticId===l);return h===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):h}),this.selectedInlineEdit=Ze(this,c=>{const l=this._filteredInlineEditItems.read(c),d=this.selectedInlineCompletionIndex.read(c);return l[d]}),this.activeCommands=Jh({owner:this,equalsFn:J2()},c=>this.selectedInlineEdit.read(c)?.inlineCompletion.source.inlineCompletions.commands??[]),this._register(FN(this._fetchInlineEditsPromise))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineEditsPromise.get()}async triggerExplicitly(e){SM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){SM(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.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)}togglePin(){this.isPinned.get()?this._pinnedRange.setRange(void 0,void 0):this._pinnedRange.setRange(this._selection.get(),void 0)}async accept(e){if(e.getModel()!==this.textModel)throw new Ni;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},bV=JL,JL._modelId=0,JL);dye=bV=D([_(4,it),_(5,x6),_(6,gi)],dye);class yHt{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class CHt extends V{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=jt(this,[]),this.range=Ze(this,i=>{this._versionId.read(i);const n=this._decorations.read(i)[0];return n?this._textModel.getDecorationRange(n)??null:null}),this._register(Ee(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var hye,XL;let WA=(XL=class extends V{static get(e){return e.getContribution(hye.ID)}constructor(e,t,i,n,o,r){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=n,this._languageFeaturesService=o,this._configurationService=r,this._enabled=yRe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=Xh(this.editor),this._selection=Ze(this,a=>this._editorObs.cursorSelection.read(a)??new dt(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=mh(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const c=this._editorObs.model.read(a);return c?this._instantiationService.createInstance(Fg(dye,a),c,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=b6(this,(a,c)=>c||this.model.read(a)?.inlineEdit.read(a)!==void 0),this._widget=mh(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(Fg(lye,a),this.editor,this.model.map((c,l)=>c?.inlineEdit.read(l)),SHt(c=>this.model.read(c)?.userPrompt??jt("empty","")))}),this._register(Iv(MW,this._contextKeyService,a=>!!this.model.read(a)?.inlineEdit.read(a))),this._register(Iv(fHt,this._contextKeyService,a=>!!this.model.read(a)?.isPinned.read(a))),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},hye=XL,XL.ID="editor.contrib.inlineEditsController",XL);WA=hye=D([_(1,we),_(2,Le),_(3,Sp),_(4,it),_(5,Te)],WA);function SHt(s){return _6(void 0,e=>s(e).read(e),(e,t)=>{s(void 0).set(e,t)})}function nG(s){return{label:s.value,alias:s.original}}const aoe=class aoe extends tt{constructor(){super({id:aoe.ID,...nG(Pe(5192,"Show Next Inline Edit")),precondition:he.and(J.writable,MW),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){WA.get(t)?.model.get()?.next()}};aoe.ID=gHt;let uye=aoe;const coe=class coe extends tt{constructor(){super({id:coe.ID,...nG(Pe(5193,"Show Previous Inline Edit")),precondition:he.and(J.writable,MW),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){WA.get(t)?.model.get()?.previous()}};coe.ID=uHt;let gye=coe;class AHt extends tt{constructor(){super({id:"editor.action.inlineEdits.trigger",...nG(Pe(5194,"Trigger Inline Edit")),precondition:J.writable})}async run(e,t){const i=WA.get(t);await xje(async n=>{await i?.model.get()?.triggerExplicitly(n)})}}class EHt extends tt{constructor(){super({id:hHt,...nG(Pe(5195,"Accept Inline Edit")),precondition:MW,menuOpts:{menuId:_e.InlineEditsActions,title:g(5196,"Accept Inline Edit"),group:"primary",order:1,icon:ve.check},kbOpts:{primary:U.CtrlCmd|S.Space,weight:2e4,kbExpr:MW}})}async run(e,t){t instanceof lf&&(t=t.getParentEditor());const i=WA.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const loe=class loe extends tt{constructor(){super({id:loe.ID,...nG(Pe(5197,"Hide Inline Edit")),precondition:MW,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=WA.get(t);ts(n=>{i?.model.get()?.stop(n)})}};loe.ID="editor.action.inlineEdits.hide";let fye=loe;on(WA.ID,WA,ri.Eventually);Re(AHt);Re(uye);Re(gye);Re(EHt);Re(fye);const QM={Visible:new Q("parameterHintsVisible",!1),MultipleSignatures:new Q("parameterHintsMultipleSignatures",!1)};async function Oet(s,e,t,i,n){const o=s.ordered(e);for(const r of o)try{const a=await r.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){No(a)}}_t.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string"||!n);const o=s.get(it),r=await s.get(fn).createModelReference(t);try{const a=await Oet(o.signatureHelpProvider,r.object.textEditorModel,oe.lift(i),{triggerKind:Dy.Invoke,isRetrigger:!1,triggerCharacter:n},He.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var ah;(function(s){let e;(function(n){n[n.Default=0]="Default",n[n.Active=1]="Active",n[n.Pending=2]="Pending"})(e=s.Type||(s.Type={})),s.Default={type:e.Default};class t{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=e.Pending}}s.Pending=t;class i{constructor(o){this.hints=o,this.type=e.Active}}s.Active=i})(ah||(ah={}));const doe=class doe extends V{constructor(e,t,i=doe.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=ah.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new wn),this.triggerChars=new jj,this.retriggerChars=new jj,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Mh(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===ah.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=ah.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 n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(vt)}next(){if(this.state.type!==ah.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==ah.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===ah.Type.Active&&(this.state=new ah.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===ah.Type.Active||this.state.type===ah.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(xHt);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new ah.Pending(Rr(c=>Oet(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 ah.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=ah.Default),vt(c),!1}}getLastActiveHints(){switch(this.state.type){case ah.Type.Active:return this.state.hints;case ah.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===ah.Type.Active||this.state.type===ah.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 n=i.charCodeAt(0);this.triggerChars.add(n),this.retriggerChars.add(n)}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:Dy.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Dy.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Dy.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};doe.DEFAULT_DELAY=120;let pye=doe;function xHt(s,e){switch(e.triggerKind){case Dy.Invoke:return e;case Dy.ContentChange:return s;case Dy.TriggerCharacter:default:return e}}var DHt='.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 .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily),var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.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}';ut(DHt,{});var mye;const Cf=fe,kHt=oi("parameter-hints-next",ve.chevronDown,g(5198,"Icon for show next parameter hint.")),IHt=oi("parameter-hints-previous",ve.chevronUp,g(5199,"Icon for show previous parameter hint."));var ZL;let _ye=(ZL=class extends V{constructor(e,t,i,n,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 Y_({editor:e},o,n)),this.keyVisible=QM.Visible.bindTo(i),this.keyMultipleSignatures=QM.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Cf(".editor-widget.parameter-hints-widget"),t=re(e,Cf(".phwrapper"));t.tabIndex=-1;const i=re(t,Cf(".controls")),n=re(i,Cf(".button"+We.asCSSSelector(IHt))),o=re(i,Cf(".overloads")),r=re(i,Cf(".button"+We.asCSSSelector(kHt)));this._register(ue(n,"click",u=>{en.stop(u),this.previous()})),this._register(ue(r,"click",u=>{en.stop(u),this.next()}));const a=Cf(".body"),c=new EU(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=re(a,Cf(".signature")),d=re(a,Cf(".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),f=this.domNodes.element;f.style.fontSize=`${u.fontSize}px`,f.style.lineHeight=`${u.lineHeight/u.fontSize}`,f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",u.fontFamily),f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",cd.fontFamily)};h(),this._register(M.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:[es.ABOVE,es.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 n=re(this.domNodes.signature,Cf(".code")),o=i.parameters.length>0,r=i.activeParameter??e.activeParameter;if(o)this.renderParameters(n,i,r);else{const l=re(n,Cf("span"));l.textContent=i.label}const a=i.parameters[r];if(a?.documentation){const l=Cf("span.documentation");if(typeof a.documentation=="string")l.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);l.appendChild(d.element)}re(this.domNodes.docs,Cf("p",{},l))}if(i.documentation!==void 0)if(typeof i.documentation=="string")re(this.domNodes.docs,Cf("p",{},i.documentation));else{const l=this.renderMarkdownDocs(i.documentation);re(this.domNodes.docs,l.element)}const c=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let l="";const d=i.parameters[r];Array.isArray(d.label)?l=i.label.substring(d.label[0],d.label[1]):l=d.label,d.documentation&&(l+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(l+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==l&&(Mr(g(5200,"{0}, hint",l)),this.announcedLabel=l)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new js,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const n=t.elapsed();return n>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:n}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&qn(t.documentation).length>0||t&&typeof t.documentation=="object"&&qn(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&qn(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&qn(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,o),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(o),re(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 n=new RegExp(`(\\W|^)${Rh(i.label)}(?=\\W|$)`,"g");n.test(e.label);const o=n.lastIndex-i.label.length;return o>=0?[o,n.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 mye.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)}},mye=ZL,ZL.ID="editor.widget.parameterHintsWidget",ZL);_ye=mye=D([_(2,Le),_(3,Ao),_(4,xi),_(5,Yi)],_ye);W("editorHoverWidget.highlightForeground",nF,g(5201,"Foreground color of the active item in the parameter hint."));var vye,eR;let NW=(eR=class extends V{static get(e){return e.getContribution(vye.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new pye(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{n?(this.widget.value.show(),this.widget.value.render(n)):this.widget.rawValue?.hide()})),this.widget=new ya(()=>this._register(t.createInstance(_ye,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)}},vye=eR,eR.ID="editor.controller.parameterHints",eR);NW=vye=D([_(1,we),_(2,it)],NW);class THt extends tt{constructor(){super({id:"editor.action.triggerParameterHints",label:g(1541,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:J.hasSignatureHelpProvider,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Space,weight:Ae.EditorContrib}})}run(e,t){NW.get(t)?.trigger({triggerKind:Dy.Invoke})}}on(NW.ID,NW,ri.BeforeFirstInteraction);Re(THt);const ZMe=Ae.EditorContrib+75,eNe=hc.bindToContribution(NW.get);qe(new eNe({id:"closeParameterHints",precondition:QM.Visible,handler:s=>s.cancel(),kbOpts:{weight:ZMe,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new eNe({id:"showPrevParameterHint",precondition:he.and(QM.Visible,QM.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:ZMe,kbExpr:J.focus,primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.Alt|S.UpArrow,U.WinCtrl|S.KeyP]}}}));qe(new eNe({id:"showNextParameterHint",precondition:he.and(QM.Visible,QM.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:ZMe,kbExpr:J.focus,primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.Alt|S.DownArrow,U.WinCtrl|S.KeyN]}}}));var LHt=".monaco-editor{--vscode-editor-placeholder-foreground:var(--vscode-editorGhostText-foreground);.editorPlaceholder{text-wrap:nowrap;color:var(--vscode-editor-placeholder-foreground);overflow:hidden;pointer-events:none;position:absolute;text-overflow:ellipsis;top:0}}";ut(LHt,{});class Bet{constructor(e){this.instantiationService=e}init(...e){}}function RHt(s,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=cu((n,o)=>{const r=Fg(s(),n);o.add(this.instantiationService.createInstance(r,...i))})}dispose(){this._autorun?.dispose()}}}let ZUe=class extends Bet{constructor(e){super(e),this.init()}};ZUe=D([_(0,we)],ZUe);function MHt(s){return kae()?RHt(s,bye):s()}let bye=class extends Bet{constructor(e,t){super(t),this.init(e)}};bye=D([_(1,we)],bye);on(a9.ID,MHt(()=>a9),ri.Eager);W("editor.placeholder.foreground",w_t,g(1542,"Foreground color of the placeholder text in the editor."));var NHt=".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}";ut(NHt,{});const qU=new Q("renameInputVisible",!1,g(5202,"Whether the rename input widget is visible"));let wye=class{constructor(e,t,i,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=qU.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new js,this._inputWithButton=new PHt,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 tNe(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(CI),i=e.getColor(H2);this._domNode.style.backgroundColor=String(e.getColor(xh)??""),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(iqe)??"");const n=e.getColor(o5);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(z2)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(z2)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=n?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;Tt(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=z_(this.getDomNode().ownerDocument.body),t=Cr(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(x.lineHeight),{totalHeight:o}=c9.getLayoutInfo({lineHeight:n}),r=this._nPxAvailableBelow>o*6?[es.BELOW,es.ABOVE]:[es.ABOVE,es.BELOW];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=g(5204,"{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;Tt(this._renameCandidateListView),Tt(this._nPxAvailableAbove!==void 0),Tt(this._nPxAvailableBelow!==void 0);const t=fb(this._inputWithButton.domNode),i=fb(this._label);let n;e===es.BELOW?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Pd(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,n,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const c=new Z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,n===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),c.add(ue(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),c.add(ue(this._inputWithButton.button,ke.KEY_DOWN,d=>{const h=new En(d);(h.equals(S.Enter)||h.equals(S.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 dc;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"),Tt(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),Tt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new ci;const i=t?mM.Invoke:mM.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(n.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){Tt(this._editor.hasModel());const i=this._editor.getSelection();let n=0,o=t.length;return!F.isEmpty(i)&&!F.spansMultipleLines(i)&&F.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,mt.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 n=(...l)=>this._trace("_updateRenameCandidates",...l);n("start");const o=await U_(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(l=>l.status==="fulfilled"&&Fc(l.value)?l.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=ja(r,l=>l.newSymbolName);n(`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(n(`valid distinct candidates - ${r.length} candidates.`),c.forEach(l=>this._candidates.add(l.newSymbolName)),c.length<1){n("returning early - no valid distinct candidates");return}n("setting candidates"),this._renameCandidateListView.setCandidates(c),n("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)}};wye=D([_(2,pn),_(3,Ut),_(4,Le),_(5,Ge)],wye);class tNe{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=tNe._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(BN({listInactiveFocusForeground:K8,listInactiveFocusBackground:q8}))}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`,Ah(g(5205,"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}=c9.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(n=>n.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new c9(r,i)}renderElement(r,a,c){c.populate(r)}disposeTemplate(r){r.dispose()}};return new Xa("NewSymbolNameCandidates",e,n,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class PHt{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(5206,"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(5207,"Generate new name suggestions"),this._buttonCancelHoverText=g(5208,"Cancel"),this._buttonHover=Sm().setupManagedHover(Pr("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(ue(this.input,ke.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,ke.KEY_DOWN,e=>{const t=new En(e);(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow)&&this._onDidInputChange.fire()})),this._disposables.add(ue(this.input,ke.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,ke.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(ue(this.input,ke.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Tt(this._inputNode),this._inputNode}get button(){return Tt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=Yy(ve.sparkle),Ms(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??=Yy(ve.primitiveSquare),Ms(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 Qz=class Qz{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=`${Qz._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=Yy(ve.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Dl(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(ufe.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Qz._PADDING*2}}dispose(){}};Qz._PADDING=2;let c9=Qz;var yye;class iNe{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(` +`));const m=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return y6.fromFn(async()=>{const v=await m.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},He.None);if(!v.identical)return new rHt(pi.fromRangeInclusive(d),u(h),v.changes)})}),this._fetchStore=this._register(new Z),this._inlineEditsFetchResult=h3(this,void 0),this._inlineEdits=Yh({owner:this,equalsFn:qY},c=>this._inlineEditsFetchResult.read(c)?.completions.map(l=>new dHt(l))??[]),this._fetchInlineEditsPromise=bje({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:Jp.Automatic}),handleChange:(c,l)=>(c.didChange(this._forceUpdateExplicitlySignal)&&(l.inlineCompletionTriggerKind=Jp.Explicit),!0)},async(c,l)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(c),this._textModelVersionId.read(c);function d(m,v){return v(m)}const h=this._pinnedRange.range.read(c)??d(this._selection.read(c),m=>m.isEmpty()?void 0:m);if(!h){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const u={triggerKind:l.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(c)},f=qge(this._fetchStore);await Sr(200,f);const p=await MXe(this.languageFeaturesService.inlineCompletionsProvider,h,this.textModel,u,f);f.isCancellationRequested||this._inlineEditsFetchResult.set(p,void 0)}),this._filteredInlineEditItems=Yh({owner:this,equalsFn:q2()},c=>this._inlineEdits.read(c)),this.selectedInlineCompletionIndex=Ze(this,c=>{const l=this._selectedInlineCompletionId.read(c),d=this._filteredInlineEditItems.read(c),h=this._selectedInlineCompletionId===void 0?-1:d.findIndex(u=>u.semanticId===l);return h===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):h}),this.selectedInlineEdit=Ze(this,c=>{const l=this._filteredInlineEditItems.read(c),d=this.selectedInlineCompletionIndex.read(c);return l[d]}),this.activeCommands=Yh({owner:this,equalsFn:q2()},c=>this.selectedInlineEdit.read(c)?.inlineCompletion.source.inlineCompletions.commands??[]),this._register(RN(this._fetchInlineEditsPromise))}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineEditsPromise.get()}async triggerExplicitly(e){bM(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){bM(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.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)}togglePin(){this.isPinned.get()?this._pinnedRange.setRange(void 0,void 0):this._pinnedRange.setRange(this._selection.get(),void 0)}async accept(e){if(e.getModel()!==this.textModel)throw new Ni;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},_V=qL,qL._modelId=0,qL);sye=_V=D([_(4,it),_(5,C6),_(6,gi)],sye);class dHt{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class hHt extends V{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=jt(this,[]),this.range=Ze(this,i=>{this._versionId.read(i);const n=this._decorations.read(i)[0];return n?this._textModel.getDecorationRange(n)??null:null}),this._register(Ee(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var oye,QL;let OA=(QL=class extends V{static get(e){return e.getContribution(oye.ID)}constructor(e,t,i,n,o,r){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=n,this._languageFeaturesService=o,this._configurationService=r,this._enabled=lRe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=Jh(this.editor),this._selection=Ze(this,a=>this._editorObs.cursorSelection.read(a)??new dt(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=fh(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const c=this._editorObs.model.read(a);return c?this._instantiationService.createInstance(Mg(sye,a),c,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=p6(this,(a,c)=>c||this.model.read(a)?.inlineEdit.read(a)!==void 0),this._widget=fh(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(Mg(nye,a),this.editor,this.model.map((c,l)=>c?.inlineEdit.read(l)),uHt(c=>this.model.read(c)?.userPrompt??jt("empty","")))}),this._register(xv(IW,this._contextKeyService,a=>!!this.model.read(a)?.inlineEdit.read(a))),this._register(xv(nHt,this._contextKeyService,a=>!!this.model.read(a)?.isPinned.read(a))),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},oye=QL,QL.ID="editor.contrib.inlineEditsController",QL);OA=oye=D([_(1,we),_(2,Le),_(3,wp),_(4,it),_(5,Te)],OA);function uHt(s){return g6(void 0,e=>s(e).read(e),(e,t)=>{s(void 0).set(e,t)})}function Z6(s){return{label:s.value,alias:s.original}}const noe=class noe extends tt{constructor(){super({id:noe.ID,...Z6(Fe(5192,"Show Next Inline Edit")),precondition:he.and(J.writable,IW),kbOpts:{weight:100,primary:U.Alt|S.BracketRight}})}async run(e,t){OA.get(t)?.model.get()?.next()}};noe.ID=iHt;let rye=noe;const soe=class soe extends tt{constructor(){super({id:soe.ID,...Z6(Fe(5193,"Show Previous Inline Edit")),precondition:he.and(J.writable,IW),kbOpts:{weight:100,primary:U.Alt|S.BracketLeft}})}async run(e,t){OA.get(t)?.model.get()?.previous()}};soe.ID=tHt;let aye=soe;class gHt extends tt{constructor(){super({id:"editor.action.inlineEdits.trigger",...Z6(Fe(5194,"Trigger Inline Edit")),precondition:J.writable})}async run(e,t){const i=OA.get(t);await vje(async n=>{await i?.model.get()?.triggerExplicitly(n)})}}class fHt extends tt{constructor(){super({id:eHt,...Z6(Fe(5195,"Accept Inline Edit")),precondition:IW,menuOpts:{menuId:_e.InlineEditsActions,title:g(5196,"Accept Inline Edit"),group:"primary",order:1,icon:ve.check},kbOpts:{primary:U.CtrlCmd|S.Space,weight:2e4,kbExpr:IW}})}async run(e,t){t instanceof rf&&(t=t.getParentEditor());const i=OA.get(t);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}}const ooe=class ooe extends tt{constructor(){super({id:ooe.ID,...Z6(Fe(5197,"Hide Inline Edit")),precondition:IW,kbOpts:{weight:100,primary:S.Escape}})}async run(e,t){const i=OA.get(t);ts(n=>{i?.model.get()?.stop(n)})}};ooe.ID="editor.action.inlineEdits.hide";let cye=ooe;on(OA.ID,OA,ri.Eventually);Me(gHt);Me(rye);Me(aye);Me(fHt);Me(cye);const $M={Visible:new Y("parameterHintsVisible",!1),MultipleSignatures:new Y("parameterHintsMultipleSignatures",!1)};async function Iet(s,e,t,i,n){const o=s.ordered(e);for(const r of o)try{const a=await r.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){No(a)}}_t.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i)),Tt(typeof n=="string"||!n);const o=s.get(it),r=await s.get(fn).createModelReference(t);try{const a=await Iet(o.signatureHelpProvider,r.object.textEditorModel,oe.lift(i),{triggerKind:Ay.Invoke,isRetrigger:!1,triggerCharacter:n},He.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var oh;(function(s){let e;(function(n){n[n.Default=0]="Default",n[n.Active=1]="Active",n[n.Pending=2]="Pending"})(e=s.Type||(s.Type={})),s.Default={type:e.Default};class t{constructor(o,r){this.request=o,this.previouslyActiveHints=r,this.type=e.Pending}}s.Pending=t;class i{constructor(o){this.hints=o,this.type=e.Active}}s.Active=i})(oh||(oh={}));const roe=class roe extends V{constructor(e,t,i=roe.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new I),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=oh.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new wn),this.triggerChars=new qj,this.retriggerChars=new qj,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Lh(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===oh.Type.Pending&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=oh.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 n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(vt)}next(){if(this.state.type!==oh.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==oh.Type.Active)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(x.parameterHints).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===oh.Type.Active&&(this.state=new oh.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===oh.Type.Active||this.state.type===oh.Type.Pending,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(pHt);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new oh.Pending(Rr(c=>Iet(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 oh.Active(c.value),this._lastSignatureHelpResult.value=c,this._onChangedHints.fire(this.state.hints),!0)}catch(c){return e===this.triggerId&&(this.state=oh.Default),vt(c),!1}}getLastActiveHints(){switch(this.state.type){case oh.Type.Active:return this.state.hints;case oh.Type.Pending:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===oh.Type.Active||this.state.type===oh.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 n=i.charCodeAt(0);this.triggerChars.add(n),this.retriggerChars.add(n)}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:Ay.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Ay.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Ay.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(x.parameterHints).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};roe.DEFAULT_DELAY=120;let lye=roe;function pHt(s,e){switch(e.triggerKind){case Ay.Invoke:return e;case Ay.ContentChange:return s;case Ay.TriggerCharacter:default:return e}}var mHt='.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 .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily),var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.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}';ut(mHt,{});var dye;const bf=fe,_Ht=oi("parameter-hints-next",ve.chevronDown,g(5198,"Icon for show next parameter hint.")),vHt=oi("parameter-hints-previous",ve.chevronUp,g(5199,"Icon for show previous parameter hint."));var jL;let hye=(jL=class extends V{constructor(e,t,i,n,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 q_({editor:e},o,n)),this.keyVisible=$M.Visible.bindTo(i),this.keyMultipleSignatures=$M.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=bf(".editor-widget.parameter-hints-widget"),t=re(e,bf(".phwrapper"));t.tabIndex=-1;const i=re(t,bf(".controls")),n=re(i,bf(".button"+We.asCSSSelector(vHt))),o=re(i,bf(".overloads")),r=re(i,bf(".button"+We.asCSSSelector(_Ht)));this._register(ue(n,"click",u=>{en.stop(u),this.previous()})),this._register(ue(r,"click",u=>{en.stop(u),this.next()}));const a=bf(".body"),c=new wU(a,{alwaysConsumeMouseWheel:!0});this._register(c),t.appendChild(c.getDomNode());const l=re(a,bf(".signature")),d=re(a,bf(".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),f=this.domNodes.element;f.style.fontSize=`${u.fontSize}px`,f.style.lineHeight=`${u.lineHeight/u.fontSize}`,f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",u.fontFamily),f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",rd.fontFamily)};h(),this._register(M.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:[es.ABOVE,es.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 n=re(this.domNodes.signature,bf(".code")),o=i.parameters.length>0,r=i.activeParameter??e.activeParameter;if(o)this.renderParameters(n,i,r);else{const l=re(n,bf("span"));l.textContent=i.label}const a=i.parameters[r];if(a?.documentation){const l=bf("span.documentation");if(typeof a.documentation=="string")l.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);l.appendChild(d.element)}re(this.domNodes.docs,bf("p",{},l))}if(i.documentation!==void 0)if(typeof i.documentation=="string")re(this.domNodes.docs,bf("p",{},i.documentation));else{const l=this.renderMarkdownDocs(i.documentation);re(this.domNodes.docs,l.element)}const c=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let l="";const d=i.parameters[r];Array.isArray(d.label)?l=i.label.substring(d.label[0],d.label[1]):l=d.label,d.documentation&&(l+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(l+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==l&&(Mr(g(5200,"{0}, hint",l)),this.announcedLabel=l)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new js,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const n=t.elapsed();return n>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:n}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&qn(t.documentation).length>0||t&&typeof t.documentation=="object"&&qn(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&qn(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&qn(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,o),a.className="parameter active";const c=document.createElement("span");c.textContent=t.label.substring(o),re(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 n=new RegExp(`(\\W|^)${Th(i.label)}(?=\\W|$)`,"g");n.test(e.label);const o=n.lastIndex-i.label.length;return o>=0?[o,n.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 dye.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)}},dye=jL,jL.ID="editor.widget.parameterHintsWidget",jL);hye=dye=D([_(2,Le),_(3,Ao),_(4,xi),_(5,Yi)],hye);W("editorHoverWidget.highlightForeground",ZP,g(5201,"Foreground color of the active item in the parameter hint."));var uye,YL;let TW=(YL=class extends V{static get(e){return e.getContribution(uye.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new lye(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{n?(this.widget.value.show(),this.widget.value.render(n)):this.widget.rawValue?.hide()})),this.widget=new ya(()=>this._register(t.createInstance(hye,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)}},uye=YL,YL.ID="editor.controller.parameterHints",YL);TW=uye=D([_(1,we),_(2,it)],TW);class bHt extends tt{constructor(){super({id:"editor.action.triggerParameterHints",label:g(1541,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:J.hasSignatureHelpProvider,kbOpts:{kbExpr:J.editorTextFocus,primary:U.CtrlCmd|U.Shift|S.Space,weight:Ae.EditorContrib}})}run(e,t){TW.get(t)?.trigger({triggerKind:Ay.Invoke})}}on(TW.ID,TW,ri.BeforeFirstInteraction);Me(bHt);const UMe=Ae.EditorContrib+75,VMe=hc.bindToContribution(TW.get);qe(new VMe({id:"closeParameterHints",precondition:$M.Visible,handler:s=>s.cancel(),kbOpts:{weight:UMe,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));qe(new VMe({id:"showPrevParameterHint",precondition:he.and($M.Visible,$M.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:UMe,kbExpr:J.focus,primary:S.UpArrow,secondary:[U.Alt|S.UpArrow],mac:{primary:S.UpArrow,secondary:[U.Alt|S.UpArrow,U.WinCtrl|S.KeyP]}}}));qe(new VMe({id:"showNextParameterHint",precondition:he.and($M.Visible,$M.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:UMe,kbExpr:J.focus,primary:S.DownArrow,secondary:[U.Alt|S.DownArrow],mac:{primary:S.DownArrow,secondary:[U.Alt|S.DownArrow,U.WinCtrl|S.KeyN]}}}));var wHt=".monaco-editor{--vscode-editor-placeholder-foreground:var(--vscode-editorGhostText-foreground);.editorPlaceholder{text-wrap:nowrap;color:var(--vscode-editor-placeholder-foreground);overflow:hidden;pointer-events:none;position:absolute;text-overflow:ellipsis;top:0}}";ut(wHt,{});class Tet{constructor(e){this.instantiationService=e}init(...e){}}function yHt(s,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=au((n,o)=>{const r=Mg(s(),n);o.add(this.instantiationService.createInstance(r,...i))})}dispose(){this._autorun?.dispose()}}}let UUe=class extends Tet{constructor(e){super(e),this.init()}};UUe=D([_(0,we)],UUe);function CHt(s){return Aae()?yHt(s,gye):s()}let gye=class extends Tet{constructor(e,t){super(t),this.init(e)}};gye=D([_(1,we)],gye);on(s9.ID,CHt(()=>s9),ri.Eager);W("editor.placeholder.foreground",l_t,g(1542,"Foreground color of the placeholder text in the editor."));var SHt=".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}";ut(SHt,{});const VU=new Y("renameInputVisible",!1,g(5202,"Whether the rename input widget is visible"));let fye=class{constructor(e,t,i,n,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new Z,this._visibleContextKey=VU.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new js,this._inputWithButton=new AHt,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 zMe(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(mI),i=e.getColor(F2);this._domNode.style.backgroundColor=String(e.getColor(Ah)??""),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(QKe)??"");const n=e.getColor(i5);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(W2)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(W2)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=n?.toString()??"none"}_updateFont(){if(this._domNode===void 0)return;Tt(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=H_(this.getDomNode().ownerDocument.body),t=Cr(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(x.lineHeight),{totalHeight:o}=o9.getLayoutInfo({lineHeight:n}),r=this._nPxAvailableBelow>o*6?[es.BELOW,es.ABOVE]:[es.ABOVE,es.BELOW];return{position:this._position,preference:r}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=g(5204,"{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;Tt(this._renameCandidateListView),Tt(this._nPxAvailableAbove!==void 0),Tt(this._nPxAvailableBelow!==void 0);const t=hb(this._inputWithButton.domNode),i=hb(this._label);let n;e===es.BELOW?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Md(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,n,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const c=new Z;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,n===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),c.add(ue(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),c.add(ue(this._inputWithButton.button,ke.KEY_DOWN,d=>{const h=new En(d);(h.equals(S.Enter)||h.equals(S.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 dc;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"),Tt(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),Tt(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new ci;const i=t?uM.Invoke:uM.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(n.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){Tt(this._editor.hasModel());const i=this._editor.getSelection();let n=0,o=t.length;return!F.isEmpty(i)&&!F.spansMultipleLines(i)&&F.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,mt.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 n=(...l)=>this._trace("_updateRenameCandidates",...l);n("start");const o=await B_(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(l=>l.status==="fulfilled"&&Fc(l.value)?l.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=ja(r,l=>l.newSymbolName);n(`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(n(`valid distinct candidates - ${r.length} candidates.`),c.forEach(l=>this._candidates.add(l.newSymbolName)),c.length<1){n("returning early - no valid distinct candidates");return}n("setting candidates"),this._renameCandidateListView.setCandidates(c),n("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)}};fye=D([_(2,pn),_(3,Ut),_(4,Le),_(5,Ge)],fye);class zMe{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=zMe._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(NN({listInactiveFocusForeground:z8,listInactiveFocusBackground:$8}))}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`,Ch(g(5205,"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}=o9.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(n=>n.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new o9(r,i)}renderElement(r,a,c){c.populate(r)}disposeTemplate(r){r.dispose()}};return new Xa("NewSymbolNameCandidates",e,n,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class AHt{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(5206,"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(5207,"Generate new name suggestions"),this._buttonCancelHoverText=g(5208,"Cancel"),this._buttonHover=wm().setupManagedHover(Pr("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(ue(this.input,ke.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,ke.KEY_DOWN,e=>{const t=new En(e);(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow)&&this._onDidInputChange.fire()})),this._disposables.add(ue(this.input,ke.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,ke.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(ue(this.input,ke.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Tt(this._inputNode),this._inputNode}get button(){return Tt(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??=qy(ve.sparkle),Ms(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??=qy(ve.primitiveSquare),Ms(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 Gz=class Gz{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=`${Gz._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=qy(ve.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),xl(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(rfe.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+Gz._PADDING*2}}dispose(){}};Gz._PADDING=2;let o9=Gz;var pye;class $Me{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:F.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,n){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(` -`)};const r=await o.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(g(1543,"No result.")),n);return r}}async function FHt(s,e,t,i){const n=new iNe(e,t,s),o=await n.resolveRenameLocation(He.None);return o?.rejectReason?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,He.None)}var tR;let iI=(tR=class{static get(e){return e.getContribution(yye.ID)}constructor(e,t,i,n,o,r,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new ci,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(wye,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 ci,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new iNe(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new Jk(this.editor,jo.Position|jo.Value,void 0,this._cts.token);let o;try{e("resolving rename location");const p=i.resolveRenameLocation(n.token);this._progressService.showWhile(p,250),o=await p,e("resolved rename location")}catch(p){p instanceof Ma?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"||dd(p))&&Lh.get(this.editor)?.showMessage(p||g(1544,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),Lh.get(this.editor)?.showMessage(o.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new Jk(this.editor,jo.Position|jo.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===mM.Automatic&&(v=v.filter(([b,w])=>w)),v.map(([b])=>b.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=U_(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(F.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(p,{editor:this.editor,showPreview:u.wantsPreview,label:g(1545,"Renaming '{0}' to '{1}'",o?.text,u.newName),code:"undoredo.rename",quotableLabel:g(1546,"Renaming {0} to {1}",o?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&Mr(g(1547,"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(1548,"Rename failed to apply edits")),this._logService.error(m)})},p=>{e("error when providing rename edits",JSON.stringify(p,null," ")),this._notificationService.error(g(1549,"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 n=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",n)}},yye=tR,tR.ID="editor.contrib.renameController",tR);iI=yye=D([_(1,we),_(2,bi),_(3,PN),_(4,XA),_(5,Ge),_(6,Ec),_(7,it),_(8,Yi)],iI);class OHt extends tt{constructor(){super({id:"editor.action.rename",label:g(1550,"Rename Symbol"),alias:"Rename Symbol",precondition:he.and(J.writable,J.hasRenameProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:S.F2,weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Kt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&oe.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},vt):super.runCommand(e,t)}run(e,t){const i=e.get(Ge),n=iI.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}on(iI.ID,iI,ri.Lazy);Re(OHt);const nNe=hc.bindToContribution(iI.get);qe(new nNe({id:"acceptRenameInput",precondition:qU,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Enter}}));qe(new nNe({id:"acceptRenameInputWithPreview",precondition:he.and(qU,he.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:U.CtrlCmd+S.Enter}}));qe(new nNe({id:"cancelRenameInput",precondition:qU,handler:s=>s.cancelRenameInput(),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));At(class extends li{constructor(){super({id:"focusNextRenameSuggestion",title:{...Pe(1551,"Focus Next Rename Suggestion")},precondition:qU,keybinding:[{primary:S.DownArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const i=iI.get(t);i&&i.focusNextRenameSuggestion()}});At(class extends li{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Pe(1552,"Focus Previous Rename Suggestion")},precondition:qU,keybinding:[{primary:S.UpArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const i=iI.get(t);i&&i.focusPreviousRenameSuggestion()}});rg("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;Tt(typeof n=="string");const{renameProvider:o}=s.get(it);return FHt(o,e,t,n)});rg("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(it),o=await new iNe(e,t,i).resolveRenameLocation(He.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o});Qe.as(Nn.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:at.LANGUAGE_OVERRIDABLE,description:g(1553,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var WB;let tZ=(WB=class extends V{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(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{const o=this.editor.getModel()?.getLanguageId();o&&n.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(x.minimap)||(this.options=this.createOptions(e.getOption(x.minimap)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new cn(()=>{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,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!n?.markers))return{foldingRules:n,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===nr.Comment}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),n=e.map(o=>BHt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,n);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 vce(s){return s&&!!s.data}function Het(s){return s&&Array.isArray(s.edits)}class VHt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Uet(s,e){return s.has(e)}function zHt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function Vet(s,e,t,i,n){const o=zHt(s,e),r=await Promise.all(o.map(async a=>{let c,l=null;try{c=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(d){l=d,c=null}return(!c||!vce(c)&&!Het(c))&&(c=null),new VHt(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 $Ht(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class GHt{constructor(e,t){this.provider=e,this.tokens=t}}function KHt(s,e){return s.has(e)}function zet(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function sNe(s,e,t,i){const n=zet(s,e),o=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){No(c),a=null}return(!a||!vce(a))&&(a=null),new GHt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}_t.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;Tt(t instanceof N);const i=s.get(gi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it),o=$Ht(n,i);return o?o[0].getLegend():s.get(vi).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});_t.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;Tt(t instanceof N);const i=s.get(gi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it);if(!Uet(n,i))return s.get(vi).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await Vet(n,i,null,null,He.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!vce(a))return;const c=d9({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),c});_t.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;Tt(t instanceof N);const n=s.get(gi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(it),r=zet(o,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!F.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 sNe(o,n,F.lift(i),He.None);if(a)return a.provider.getLegend()});_t.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;Tt(t instanceof N),Tt(F.isIRange(i));const n=s.get(gi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(it),r=await sNe(o,n,F.lift(i),He.None);if(!(!r||!r.tokens))return d9({id:0,type:"full",data:r.tokens.data})});const oNe="editor.semanticHighlighting";function mQ(s,e,t){const i=t.getValue(oNe,{overrideIdentifier:s.getLanguageId(),resource:s.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var SE;let Cye=class extends V{constructor(e,t,i,n,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new Sye(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()];mQ(d,i,n)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{mQ(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{mQ(d,i,n)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers[d.uri.toString()];h&&c(d,h)})),this._register(n.onDidChangeConfiguration(d=>{d.affectsConfiguration(oNe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Cye=D([_(0,aae),_(1,gi),_(2,pn),_(3,Te),_(4,Sp),_(5,it)],Cye);var ek;let Sye=(ek=class extends V{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:SE.REQUEST_MIN_DELAY,max:SE.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new cn(()=>this._fetchDocumentSemanticTokensNow(),SE.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=()=>{bt(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),bt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Uet(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ci,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Vet(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 js(!1);n.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&&(Fr(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||vt(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,n,o){o=Math.min(o,i.length-n,e.length-t);for(let r=0;r{(n.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(Het(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&&(SE._copy(c,d-p,l,h-p,p),h-=p),f.data&&(SE._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&SE._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(vce(t)){this._currentDocumentResponse=new qHt(e,t.resultId,t.data);const a=wQe(t,i,this._model.getLanguageId());if(n.length>0)for(const c of n)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()}},SE=ek,ek.REQUEST_MIN_DELAY=300,ek.REQUEST_MAX_DELAY=2e3,ek);Sye=SE=D([_(1,aae),_(2,pn),_(3,Sp),_(4,it)],Sye);class qHt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}j6(Cye);var Aye,iR;let PW=(iR=class extends V{static get(e){return e.getContribution(Aye.ID)}constructor(e,t,i,n,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new cn(()=>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(oNe)&&(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(),n=Rr(r=>Promise.resolve(sNe(this._provider,e,t,r))),o=new js(!1);return n.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,wQe(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},Aye=iR,iR.ID="editor.contrib.viewportSemanticTokens",iR);PW=Aye=D([_(1,aae),_(2,pn),_(3,Te),_(4,Sp),_(5,it)],PW);on(PW.ID,PW,ri.AfterFirstRender);class QHt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:r}=n,a=i.column-r;let c=a,l=a,d=0;for(;c>=0;c--){const h=o.charCodeAt(c);if(c!==a&&(h===B.Underline||h===B.Dash))break;if(bx(h)&&Ow(d))break;d=h}for(c+=1;l0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new F(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var Eye;class rNe{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 rNe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var nR;let jM=(nR=class{static get(e){return e.getContribution(Eye.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 Get(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(x.smartSelect),He.None).then(o=>{if(!(!eo(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!is(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 rNe(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 n=this._state.map(o=>dt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},Eye=nR,nR.ID="editor.contrib.smartSelectController",nR);jM=Eye=D([_(1,it)],jM);class $et extends tt{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=jM.get(t);i&&await i.run(this._forward)}}class jHt extends $et{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:g(1554,"Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.RightArrow,mac:{primary:U.CtrlCmd|U.WinCtrl|U.Shift|S.RightArrow,secondary:[U.WinCtrl|U.Shift|S.RightArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(1555,"&&Expand Selection"),order:2}})}}_t.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class YHt extends $et{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:g(1556,"Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.LeftArrow,mac:{primary:U.CtrlCmd|U.WinCtrl|U.Shift|S.LeftArrow,secondary:[U.WinCtrl|U.Shift|S.LeftArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(1557,"&&Shrink Selection"),order:3}})}}on(jM.ID,jM,ri.Lazy);Re(jHt);Re(YHt);async function Get(s,e,t,i,n){const o=s.all(e).concat(new QHt(i.selectSubwords));o.length===1&&o.unshift(new cX);const r=[],a=[];for(const c of o)r.push(Promise.resolve(c.provideSelectionRanges(e,t,n)).then(l=>{if(eo(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||F.containsRange(u,d)&&!F.equalsRange(u,d))&&(l.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return l;const h=[l[0]];for(let u=1;us}),aue="data-sticky-line-index",t4e="data-sticky-is-line",XHt="data-sticky-is-line-number",i4e="data-sticky-is-folding-icon";class ZHt extends V{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 lf),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 n=this._isWidgetHeightZero(e),o=n?void 0:e,r=n?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,n=e.startLineNumbers.findIndex(o=>!i.startLineNumbers.includes(o));return n===-1?0:n}_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))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(x.showFoldingControls)==="mouseover"&&(this._foldingIconStore.add(ue(this._lineNumbersDomNode,ke.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ue(this._lineNumbersDomNode,ke.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){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=eu.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{l=[]}const d=new yI(!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 wU(2e3),u=n6(d,h);let f;e4e?f=e4e.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(aue,String(e)),p.setAttribute(t4e,""),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(aue,String(e)),m.setAttribute(XHt,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=n.contentLeft;m.style.width=`${v}px`;const b=document.createElement("span");c.renderType===wr.On||c.renderType===wr.Interval&&t%10===0?b.innerText=t.toString():c.renderType===wr.Relative&&(b.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),b.className="sticky-line-number-inner",b.style.lineHeight=`${this._lineHeight}px`,b.style.width=`${n.lineNumbersWidth}px`,b.style.paddingLeft=`${n.lineNumbersLeft}px`,m.appendChild(b);const w=this._renderFoldingIconForLine(i,t);w&&m.appendChild(w.domNode),this._editor.applyFontInfo(p),this._editor.applyFontInfo(b),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 y=new eUt(e,t,p,m,w,u.characterMapping,p.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,o=t===this._lineNumbers.length-1,r="0",a="1";i.style.zIndex=o?r:a,n.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,n.style.top=o?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const n=e.regions,o=n.findRange(t),r=n.getStartLineNumber(o);if(!(t===r))return;const c=n.isCollapsed(o),l=new tUt(c,r,n.getEndLineNumber(o),this._lineHeight);return l.setVisible(this._isOnGlyphMargin?!0:c||i==="always"),l.domNode.setAttribute(i4e,""),l}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:Wg.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=WTe(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,aue);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,t4e)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,i4e)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class eUt{constructor(e,t,i,n,o,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a}}class tUt{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=We.asClassName(e?MJ:RJ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class G5{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class nZ{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Ket{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var K5;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(K5||(K5={}));var Ox;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(Ox||(Ox={}));let xye=class extends V{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Mh(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case K5.OUTLINE_MODEL:this._modelProviders.push(new Dye(this._editor,n));case K5.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new Iye(this._editor,t,n));case K5.INDENTATION_MODEL:this._modelProviders.push(new kye(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:n}=t.computeStickyModel(e);this._modelPromise=n;const o=await i;if(this._modelPromise!==n)return null;switch(o){case Ox.CANCELED:return this._updateOperation.clear(),null;case Ox.VALID:return t.stickyModel}}return null}).catch(t=>(vt(t),null))}};xye=D([_(2,we),_(3,it)],xye);class qet extends V{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Ox.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Rr(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?Ox.CANCELED:(this._stickyModel=this.createStickyModel(e,i),Ox.VALID):this._invalid()).then(void 0,i=>(vt(i),Ox.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let Dye=class extends qet{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Tw.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new Ket(o.uri,o.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(hi.first(e.children.values())instanceof Rwe){const a=hi.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 n=[],o=Array.from(i.values()).sort((a,c)=>{const l=new G5(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new G5(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of o)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new nZ(void 0,n,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 n=new G5(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new nZ(n,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 Lwe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};Dye=D([_(1,it)],Dye);class Qet extends qet{constructor(e){super(e),this._foldingLimitReporter=new eJe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new Ket(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new nZ(void 0,[],void 0);for(let o=0;o0&&(this.provider=this._register(new FRe(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};Iye=D([_(2,it)],Iye);class iUt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var HB;let Tye=(HB=class extends V{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 cn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.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 xye(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ci,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,n,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-h)),l=this.updateIndex(y2(a,e.startLineNumber+n,(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 iUt(u,f-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n,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 n of i)t=t.filter(o=>!(o.startLineNumber>=n.startLineNumber&&o.endLineNumber<=n.endLineNumber+1));return t}},HB.ID="store.contrib.stickyScrollController",HB);Tye=D([_(1,it),_(2,Vs)],Tye);var Lye,sR;let HA=(sR=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new Z,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._stickyScrollWidget=new ZHt(this._editor),this._stickyLineCandidateProvider=new Tye(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=$5.Empty,this._onDidResize(),this._readConfiguration();const c=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(ue(c,ke.CONTEXT_MENU,async d=>{this._onContextMenu(ct(c),d)})),this._stickyScrollFocusedContextKey=J.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=J.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Ac(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(ue(c,ke.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}get stickyScrollCandidateProvider(){return this._stickyLineCandidateProvider}get stickyScrollWidgetState(){return this._widgetState}static get(e){return e.getContribution(Lye.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,mt.Smooth))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(F.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Z),t=this._register(new dce(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!==Rt.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 F(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(Ro(n,ke.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(Ro(n,ke.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!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,ke.MOUSE_LEAVE,o=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,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 ci;e.add(Ee(()=>d.dispose(!0)));let h;J6(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new oe(c.startLineNumber,c.startColumn+1),!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!==Rt.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(QZe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Eh(e,t);this._contextMenuService.showContextMenu({menuId:_e.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;RRe(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(x.lineHeight)*t.index+1;this._editor.setScrollTop(n),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=void 0,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=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(x.lineNumbers).renderType===wr.Relative&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,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 n of e.ranges)if(i>=n.fromLineNumber&&i<=n.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._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){this._minRebuildFromLine=void 0,this._foldingModel=await TA.get(this._editor)?.getFoldingModel()??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=$5.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(x.lineHeight),t=Math.min(this._maxStickyLines,this._editor.getOption(x.stickyScroll).maxLineCount),i=this._editor.getScrollTop();let n=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new G5(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,b=this._editor.getTopForLineNumber(u)-i,w=this._editor.getBottomForLineNumber(u)-i;if(p>b&&p<=w){o.push(h),r.push(u+1),n=w-m;break}else m>v&&m<=w&&(o.push(h),r.push(u+1));if(o.length===t)break}}}return this._endLineNumbers=r,new $5(o,r,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},Lye=sR,sR.ID="store.contrib.stickyScrollController",sR);HA=Lye=D([_(1,lr),_(2,it),_(3,we),_(4,Vs),_(5,Sp),_(6,Le)],HA);class nUt extends li{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Pe(5217,"Toggle Editor Sticky Scroll"),mnemonicTitle:g(5218,"&&Toggle Editor Sticky Scroll")},metadata:{description:Pe(5219,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:ca.View,toggled:{condition:he.equals("config.editor.stickyScroll.enabled",!0),title:g(5220,"Sticky Scroll"),mnemonicTitle:g(5221,"&&Sticky Scroll")},menu:[{id:_e.CommandPalette},{id:_e.MenubarAppearanceMenu,group:"4_editor",order:3},{id:_e.StickyScrollContext}]})}async run(e){const t=e.get(Te),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const bce=Ae.EditorContrib;class sUt extends gf{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Pe(5222,"Focus on the editor sticky scroll"),mnemonicTitle:g(5223,"&&Focus Sticky Scroll")},precondition:he.and(he.has("config.editor.stickyScroll.enabled"),J.stickyScrollVisible),menu:[{id:_e.CommandPalette}]})}runEditorCommand(e,t){HA.get(t)?.focus()}}class oUt extends gf{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Pe(5224,"Select the next editor sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.DownArrow}})}runEditorCommand(e,t){HA.get(t)?.focusNext()}}class rUt extends gf{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Pe(5225,"Select the previous sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.UpArrow}})}runEditorCommand(e,t){HA.get(t)?.focusPrevious()}}class aUt extends gf{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Pe(5226,"Go to the focused sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.Enter}})}runEditorCommand(e,t){HA.get(t)?.goToFocused()}}class cUt extends gf{constructor(){super({id:"editor.action.selectEditor",title:Pe(5227,"Select Editor"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:bce,primary:S.Escape}})}runEditorCommand(e,t){HA.get(t)?.selectEditor()}}on(HA.ID,HA,ri.AfterFirstRender);At(nUt);At(sUt);At(rUt);At(oUt);At(aUt);At(cUt);class lUt{constructor(e,t,i,n,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.completion=r}}let Rye=class extends K1e{constructor(e,t,i,n,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,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(He.None)}return e}};Rye=D([_(5,cce)],Rye);let Mye=class extends V{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){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(mF.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(mF.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 F(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,l)){const f=new tUe(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await mMe(this._languageFeatureService.completionProvider,e,t,new G3(void 0,dX.createSuggestFilter(o).itemKind,d?.providers),d&&{triggerKind:Ku.TriggerCharacter,triggerCharacter:d.ch},n);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new nx(f.items,t.column,new tUe(u,0),lX.None,o.getOption(x.suggest),o.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new Rye(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(He.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(F.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))o.triggerCharacters?.includes(i)&&n.add(o);if(n.size!==0)return{providers:n,ch:i}}};Mye=D([_(0,it),_(1,dg),_(2,cce),_(3,Kt)],Mye);j6(Mye);class dUt extends tt{constructor(){super({id:"editor.action.forceRetokenize",label:g(1569,"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 n=new js;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Re(dUt);var hUt=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";ut(hUt,{});var uUt=".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)}";ut(uUt,{});const gUt=26;let Nye=class extends V{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Pye))}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,gUt)}};Nye=D([_(1,we)],Nye);let Pye=class extends V{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Y_,{}),this.element=fe("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=fe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ms(this.element)}show(e){Ms(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=re(this.element,fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(fe(`div${We.asCSSSelector(e.icon)}`));const n=re(this.element,fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=re(this.element,fe("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(i9,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=re(this.element,fe("div.action-container"));this.actionBar=this._register(new hd(o)),this.actionBar.push(this._register(new rn("banner.close","Close Banner",We.asClassName(xYe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Pye=D([_(0,we)],Pye);const fUt=oi("extensions-warning-message",ve.warning,g(1574,"Icon shown with a warning message in the extensions editor."));var UB;let h9=(UB=class extends V{constructor(e,t,i,n){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(1575,"This document contains many non-basic ASCII unicode characters"),command:new g9};else if(o.ambiguousCharacterCount>=r)a={message:g(1576,"This document contains many ambiguous unicode characters"),command:new YM};else if(o.invisibleCharacterCount>=r)a={message:g(1577,"This document contains many invisible unicode characters"),command:new u9};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:fUt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(Nye,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=pUt(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"?ql:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new Fye(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new mUt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},UB.ID="editor.contrib.unicodeHighlighter",UB);h9=D([_(1,Ml),_(2,uC),_(3,we)],h9);function pUt(s,e){return{nonBasicASCII:e.nonBasicASCII===kf?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===kf?!s:e.includeComments,includeStrings:e.includeStrings===kf?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let Fye=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new cn(()=>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 n of t.ranges)i.push({range:n,options:sZ.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!pLe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Yet(i,this._options),inComment:mLe(t,e),inString:_Le(t,e)}}};Fye=D([_(3,Ml)],Fye);class mUt extends V{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 cn(()=>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 n of e){const o=bTe.computeUnicodeHighlights(this._model,this._options,n);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 n of i.ranges)t.push({range:n,options:sZ.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 pLe(t,e)?{reason:Yet(i,this._options),inComment:mLe(t,e),inString:_Le(t,e)}:null}}const jet=g(1578,"Configure Unicode Highlight Options");let Oye=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!==du.Range)return[];const i=this._editor.getModel(),n=this._editor.getContribution(h9.ID);if(!n)return[];const o=[],r=new Set;let a=300;for(const c of t){const l=n.getDecorationInfo(c);if(!l)continue;const h=i.getValueInRange(c.range).codePointAt(0),u=cue(h);let f;switch(l.reason.kind){case y_.Ambiguous:{H7(l.reason.confusableWith)?f=g(1579,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,cue(l.reason.confusableWith.codePointAt(0))):f=g(1580,"The character {0} could be confused with the character {1}, which is more common in source code.",u,cue(l.reason.confusableWith.codePointAt(0)));break}case y_.Invisible:f=g(1581,"The character {0} is invisible.",u);break;case y_.NonBasicAscii:f=g(1582,"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(1583,"Adjust settings"),v=`command:${oZ.ID}?${encodeURIComponent(JSON.stringify(p))}`,b=new Mt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,jet);o.push(new m_(this,c.range,[b],!1,a++))}return o}renderHoverParts(e,t){return KPt(e,t,this._editor,this._languageService,this._openerService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` -`)}};Oye=D([_(1,xi),_(2,Ao)],Oye);function Bye(s){return`U+${s.toString(16).padStart(4,"0")}`}function cue(s){let e=`\`${Bye(s)}\``;return pT.isInvisibleCharacter(s)||(e+=` "${`${_Ut(s)}`}"`),e}function _Ut(s){return s===B.BackTick?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Yet(s,e){return bTe.computeUnicodeHighlightReason(s,e)}const hoe=class hoe{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Gt.createDynamic({description:"unicode-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};hoe.instance=new hoe;let sZ=hoe;const rFe=class rFe extends tt{constructor(){super({id:YM.ID,label:g(1584,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=g(1585,"Disable Highlight In Comments")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.includeComments,!1,St.USER)}};rFe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let Wye=rFe;const aFe=class aFe extends tt{constructor(){super({id:YM.ID,label:g(1586,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=g(1587,"Disable Highlight In Strings")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.includeStrings,!1,St.USER)}};aFe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let Hye=aFe;const uoe=class uoe extends tt{constructor(){super({id:uoe.ID,label:g(1588,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=g(1589,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.ambiguousCharacters,!1,St.USER)}};uoe.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let YM=uoe;const goe=class goe extends tt{constructor(){super({id:goe.ID,label:g(1590,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=g(1591,"Disable Invisible Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.invisibleCharacters,!1,St.USER)}};goe.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let u9=goe;const foe=class foe extends tt{constructor(){super({id:foe.ID,label:g(1592,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=g(1593,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Mu.nonBasicASCII,!1,St.USER)}};foe.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let g9=foe;const poe=class poe extends tt{constructor(){super({id:poe.ID,label:g(1594,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:o,inString:r,inComment:a}=i,c=String.fromCodePoint(n),l=e.get(In),d=e.get(Te);function h(p){return pT.isInvisibleCharacter(p)?g(1595,"Exclude {0} (invisible character) from being highlighted",Bye(p)):g(1596,"Exclude {0} from being highlighted",`${Bye(p)} "${c}"`)}const u=[];if(o.kind===y_.Ambiguous)for(const p of o.notAmbiguousInLocales)u.push({label:g(1597,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{bUt(d,[p])}});if(u.push({label:h(n),run:()=>vUt(d,[n])}),a){const p=new Wye;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r){const p=new Hye;u.push({label:p.label,run:async()=>p.runAction(d)})}if(o.kind===y_.Ambiguous){const p=new YM;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===y_.Invisible){const p=new u9;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===y_.NonBasicAscii){const p=new g9;u.push({label:p.label,run:async()=>p.runAction(d)})}else wUt(o);const f=await l.pick(u,{title:jet});f&&await f.run()}};poe.ID="editor.action.unicodeHighlight.showExcludeOptions";let oZ=poe;async function vUt(s,e){const t=s.getValue(Mu.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(Mu.allowedCharacters,i,St.USER)}async function bUt(s,e){const t=s.inspect(Mu.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const n of e)i[n]=!0;await s.updateValue(Mu.allowedLocales,i,St.USER)}function wUt(s){throw new Error(`Unexpected value: ${s}`)}Re(YM);Re(u9);Re(g9);Re(oZ);on(h9.ID,h9,ri.AfterFirstRender);GN.register(Oye);const Jet="ignoreUnusualLineTerminators";function yUt(s,e,t){s.setModelProperty(e.uri,Jet,t)}function CUt(s,e){return s.getModelProperty(e.uri,Jet)}var VB;let rZ=(VB=class extends V{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(n=>{n.hasChanged(x.unusualLineTerminators)&&(this._config=this._editor.getOption(x.unusualLineTerminators),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||CUt(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(1598,"Unusual Line Terminators"),message:g(1599,"Detected unusual line terminators"),detail:g(1600,"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`.",_i(e.uri)),primaryButton:g(1601,"&&Remove Unusual Line Terminators"),cancelButton:g(1602,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){yUt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},VB.ID="editor.contrib.unusualLineTerminatorsDetector",VB);rZ=D([_(1,to),_(2,Kt)],rZ);on(rZ.ID,rZ,ri.AfterFirstRender);var _c,Uye;const wce=new Q("hasWordHighlights",!1);function Xet(s,e,t,i){const n=s.ordered(e);return Nre(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,No)),eo).then(o=>{if(o){const r=new ui;return r.set(e.uri,o),r}return new ui})}function SUt(s,e,t,i,n,o){const r=s.ordered(e);return Nre(r.map(a=>()=>{const c=o.filter(l=>Ly(l)).filter(l=>cae(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,n)).then(void 0,No)}),a=>a instanceof ui&&a.size>0)}class aNe{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=Rr(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new F(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=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 AUt extends aNe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return Xet(this._providers,e,t.getPosition(),n).then(o=>o||new ui)}}class EUt extends aNe{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return SUt(this._providers,e,t.getPosition(),i,n,this._otherModels).then(o=>o||new ui)}}class Zet extends aNe{constructor(e,t,i,n,o){super(e,t,n),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Sr(250,n).then(()=>{const o=new ui;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new ui;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:w8.Text}));d&&o.set(c.uri,d)}return o})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function xUt(s,e,t,i,n){return s.has(e)?new AUt(e,t,n,s):new Zet(e,t,i,n,[])}function DUt(s,e,t,i,n,o){return s.has(e)?new EUt(e,t,n,s,o):new Zet(e,t,i,n,o)}rg("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(it);return(await Xet(i.documentHighlightProvider,e,t,He.None))?.get(e.uri)});var tk;let Vye=(tk=class{constructor(e,t,i,n,o){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new ui,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=wce.bindTo(n),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():_c.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,_c.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(F.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Mr(`${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,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Mr(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=_c.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),_c.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 n=_c.storedDecorations.get(i.getModel().uri);if(!n)continue;i.removeDecorations(n),t.push(i.getModel().uri);const o=hp.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)_c.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==pe.vscodeNotebookCell&&_c.query?.modelInfo?.model.uri.scheme!==pe.vscodeNotebookCell?(_c.query=null,this._run()):_c.query?.modelInfo&&(_c.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!==Oi.Explicit&&this.editor.getModel()?.uri.scheme!==pe.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===pe.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const c=a.getModel();c&&c!==e&&c.uri.scheme===pe.vscodeNotebookCell&&o.push(c)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!im(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 n){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){_c.query=null,this._stopAll();return}const n=i.startColumn,o=i.endColumn,r=this._getWord();if(!r||r.startColumn>n||r.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=o||[],this._beginRenderDecorations())},vt)}}computeWithModel(e,t,i,n){return n.length?DUt(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),n):xUt(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=hp.get(t);if(!i)continue;const n=[],o=t.getModel()?.uri;if(o&&this.workerRequestValue.has(o)){const r=_c.storedDecorations.get(o),a=this.workerRequestValue.get(o);if(a)for(const l of a)l.range&&n.push({range:l.range,options:NWt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(r??[],n)}),_c.storedDecorations=_c.storedDecorations.set(o,c),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},_c=tk,tk.storedDecorations=new ui,tk.query=null,tk);Vye=_c=D([_(4,Kt)],Vye);var oR;let hp=(oR=class extends V{static get(e){return e.getContribution(Uye.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new Vye(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};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()}},Uye=oR,oR.ID="editor.contrib.wordHighlighter",oR);hp=Uye=D([_(1,Le),_(2,it),_(3,Kt)],hp);class ett extends tt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=hp.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class kUt extends ett{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(1603,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:wce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.F7,weight:Ae.EditorContrib}})}}class IUt extends ett{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(1604,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:wce,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|S.F7,weight:Ae.EditorContrib}})}}class TUt extends tt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(1605,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:wce.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t,i){const n=hp.get(t);n&&n.restoreViewState(!0)}}on(hp.ID,hp,ri.Eager);Re(kUt);Re(IUt);Re(TUt);class yce extends hc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=fm(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),r=t.getSelections(),a=r.length>1,c=r.map(l=>{const d=new oe(l.positionLineNumber,l.positionColumn),h=this._move(n,o,d,this._wordNavigationType,a);return this._moveTo(l,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Oi.Explicit,c.map(l=>Rn.fromModelSelection(l))),c.length===1){const l=new oe(c[0].positionLineNumber,c[0].positionColumn);t.revealPosition(l,mt.Smooth)}}_moveTo(e,t,i){return i?new dt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new dt(t.lineNumber,t.column,t.lineNumber,t.column)}}class TI extends yce{_move(e,t,i,n,o){return hs.moveWordLeft(e,t,i,n,o)}}class LI extends yce{_move(e,t,i,n,o){return hs.moveWordRight(e,t,i,n)}}class LUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class RUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class MUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|S.LeftArrow,mac:{primary:U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}class NUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class PUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class FUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|U.Shift|S.LeftArrow,mac:{primary:U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}class OUt extends TI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class BUt extends TI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class WUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class HUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|S.RightArrow,mac:{primary:U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class UUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordRight",precondition:void 0})}}class VUt extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class zUt extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(K7,S6)?.negate()),primary:U.CtrlCmd|U.Shift|S.RightArrow,mac:{primary:U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}class $Ut extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class GUt extends LI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class KUt extends LI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(fm(wh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class Cce extends hc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Vs);if(!t.hasModel())return;const o=fm(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=n.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 td(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class cNe extends Cce{_delete(e,t){const i=hs.deleteWordLeft(e,t);return i||new F(1,1,1,1)}}class lNe extends Cce{_delete(e,t){const i=hs.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new F(n,o,n,o)}}class qUt extends cNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordStart,id:"deleteWordStartLeft",precondition:J.writable})}}class QUt extends cNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordEnd,id:"deleteWordEndLeft",precondition:J.writable})}}class jUt extends cNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordStart,id:"deleteWordLeft",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Backspace,mac:{primary:U.Alt|S.Backspace},weight:Ae.EditorContrib}})}}class YUt extends lNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordStart,id:"deleteWordStartRight",precondition:J.writable})}}class JUt extends lNe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordEnd,id:"deleteWordEndRight",precondition:J.writable})}}class XUt extends lNe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordEnd,id:"deleteWordRight",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Delete,mac:{primary:U.Alt|S.Delete},weight:Ae.EditorContrib}})}}class ZUt extends tt{constructor(){super({id:"deleteInsideWord",precondition:J.writable,label:g(1608,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=fm(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=hs.deleteInsideWord(n,o,c);return new td(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}qe(new LUt);qe(new RUt);qe(new MUt);qe(new NUt);qe(new PUt);qe(new FUt);qe(new WUt);qe(new HUt);qe(new UUt);qe(new VUt);qe(new zUt);qe(new $Ut);qe(new OUt);qe(new BUt);qe(new GUt);qe(new KUt);qe(new qUt);qe(new QUt);qe(new jUt);qe(new YUt);qe(new JUt);qe(new XUt);Re(ZUt);class e4t extends Cce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordStart,id:"deleteWordPartLeft",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.Backspace},weight:Ae.EditorContrib}})}_delete(e,t){const i=Xre.deleteWordPartLeft(e);return i||new F(1,1,1,1)}}class t4t extends Cce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordEnd,id:"deleteWordPartRight",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.Delete},weight:Ae.EditorContrib}})}_delete(e,t){const i=Xre.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new F(n,o,n,o)}}class ttt extends yce{_move(e,t,i,n,o){return Xre.moveWordPartLeft(e,t,i,o)}}class i4t extends ttt{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}_t.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class n4t extends ttt{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}_t.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class itt extends yce{_move(e,t,i,n,o){return Xre.moveWordPartRight(e,t,i)}}class s4t extends itt{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class o4t extends itt{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}qe(new e4t);qe(new t4t);qe(new i4t);qe(new n4t);qe(new s4t);qe(new o4t);const cFe=class cFe extends V{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Lh.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Mt(g(1606,"Cannot edit in read-only input")):t=new Mt(g(1607,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};cFe.ID="editor.contrib.readOnlyMessageController";let aZ=cFe;on(aZ.ID,aZ,ri.BeforeFirstInteraction);let zye=class extends V{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=jt(this,void 0);const n=id("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=id("_textModel.onDidChangeContent",M.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(cu(async(r,a)=>{n.read(r),o.read(r);const c=a.add(new nIt),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 n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(S6e(Cc(o=>o.range.endLineNumber-o.range.startLineNumber,nu))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};zye=D([_(1,it),_(2,iG)],zye);DJ.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(zye,s));var r4t='.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}';ut(r4t,{});const lFe=class lFe extends V{constructor(e){super(),this.editor=e,this.widget=null,dm&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new $ye(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};lFe.ID="editor.contrib.iPadShowKeyboard";let cZ=lFe;const moe=class moe extends V{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ue(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ue(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return moe.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Wg.BOTTOM_RIGHT_CORNER}}};moe.ID="editor.contrib.ShowKeyboardWidget";let $ye=moe;on(cZ.ID,cZ,ri.Eventually);function Gye(s){return!!s.workspaceUri}function _Q(s){return!!s.folderUri}function a4t(s){return!!s.fileUri}function c4t(s){const e=l4t(s),t=s.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||Qt&&ad?"classic":t}var n4e;(function(s){s.TITLE_BAR_STYLE="window.titleBarStyle",s.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(n4e||(n4e={}));var Lw;(function(s){s.NATIVE="native",s.CUSTOM="custom"})(Lw||(Lw={}));var s4e;(function(s){s.AUTO="auto",s.WINDOWED="windowed",s.NEVER="never"})(s4e||(s4e={}));function l4t(s,e){return e||(e=dNe(s)),e===Lw.NATIVE}function dNe(s){if(Wn)return Lw.CUSTOM;const e=s.getValue("window");if(e){if(Qt&&e.nativeTabs===!0||Qt&&e.nativeFullScreen===!1)return Lw.NATIVE;const n=e.titleBarStyle;if(n===Lw.NATIVE||n===Lw.CUSTOM)return n}return pr?Lw.NATIVE:Lw.CUSTOM}function hNe(s){return{id:ntt(s),configPath:s}}function d4t(s){return{id:ntt(s),uri:s}}function ntt(s){return Wc(s.toString()).toString(16)}const Kye=60,qye=Kye*60,f9=qye*24,o4e=f9*7,r4e=f9*30,a4e=f9*365;function uNe(s,e,t,i){typeof s!="number"&&(s=s.getTime());const n=Math.round((new Date().getTime()-s)/1e3);if(n<-30)return g(793,"in {0}",uNe(new Date().getTime()+n*1e3,!1));if(n<30)return g(794,"now");let o;return n{await Promise.all(ftt.map(t=>t(e)))}),await s.invokeFunction(async e=>{bje((t,i)=>s.createInstance(xM,t,i,{})),Fje(e.get(ec))}),await s.invokeFunction(async e=>{const t=e.get(ig);await Promise.all(ptt.map(i=>i(e))),t.phase=2}),await s.invokeFunction(async e=>{await Promise.all(mtt.map(t=>t(e)))}),fNe.open(),gtt.fire(),s.invokeFunction(async e=>{const t=e.get(ig);Qe.as(cf.Workbench).start(e),Qe.as(tC.EditorFactory).start(e),dtt.fire(e),htt.fire(e),await Promise.race([e.get(kI).whenRestored,Sr(2e3)]),t.phase=3,new cn(()=>{TO(window,()=>{t.phase=4},2500)},2500).schedule()})}let _tt=!1;Dt.withServices(()=>(_tt=!0,V.None));async function vtt(){await fNe.wait()}function btt(){if(_tt)throw new Error("Services are already initialized")}const wtt="inQuickOpen",b4t=new Q(wtt,!1,g(4610,"Whether keyboard focus is inside the quick open control")),_C=he.has(wtt),w4t="inFilesPicker",ytt=he.and(_C,he.has(w4t));function Sce(s,e){return t=>{const i=t.get(Ut),n=t.get(In),r={keybindings:i.lookupKeybindings(s)};n.navigate(!!e,r)}}let c4e=class extends V{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:jgt(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()}};c4e=D([_(0,ei),_(1,Po)],c4e);let Qye=class extends vJ{constructor(e,t,i,n,o,r){super(t,n,o,r,e),this.keybindingService=i,this.inQuickInputContext=b4t.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})}};Qye=D([_(0,Te),_(1,we),_(2,Ut),_(3,Le),_(4,pn),_(5,pu)],Qye);function y4t(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class q5{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=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,n);l>0&&o.push({key:r,score:l})}}return o}static termFrequencies(e){return y4t(q5.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 n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const o of n)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 n of t.textChunks){const o=q5.termFrequencies(n);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,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 n of i.tf.keys()){const o=this.chunkOccurrences.get(n);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=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;n+=l*r}return n}computeEmbedding(e){const t=q5.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,n]of e){const o=this.computeIdf(i);o>0&&(t[i]=n*o)}return t}}function C4t(s){const e=s.slice(0);e.sort((i,n)=>n.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var IS;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(IS||(IS={}));function lue(s){const e=s;return Array.isArray(e.items)}function l4e(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class mNe extends V{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new wn),a=async()=>{const l=r.value=new Z;o?.dispose(!0),e.busy=!1,o=new ci(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 b,w;if(lue(m)?(b=m.items,w=m.active):b=m,b.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(C2(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,w&&(e.activeItems=[w]),!0},p=async m=>{let v=!1,b=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Sr(m.mergeDelay),d.isCancellationRequested)||b||(v=f(m.picks,!0))})(),(async()=>{e.busy=!0;try{const w=await m.additionalPicks;if(d.isCancellationRequested)return;let y,C;lue(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let A,L;if(lue(w)?(A=w.items,L=w.active):A=w,A.length>0||!v){let k;if(!C&&!L){const P=e.activeItems[0];P&&y.indexOf(P)!==-1&&(k=P)}f({items:[...y,...A],active:C||L||k})}}finally{d.isCancellationRequested||(e.busy=!1),b=!0}})()])};if(u!==null)if(l4e(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;l4e(m)?await p(m):f(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.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 IS.NO_ACTION:break;case IS.CLOSE_PICKER:e.hide();break;case IS.REFRESH_PICKER:a();break;case IS.REMOVE_ITEM:{const p=e.items.indexOf(d);if(p!==-1){const m=e.items.slice(),v=m.splice(p,1),b=e.activeItems.filter(y=>y!==v[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,b&&(e.activeItems=b),e.keepScrollPosition=w}break}}}};return n.add(e.onDidTriggerItemButton(({button:l,item:d})=>c(l,d))),n.add(e.onDidTriggerSeparatorButton(({button:l,separator:d})=>c(l,d))),n}}var h0,na,ny;let jye=(ny=class extends mNe{constructor(e,t,i,n,o,r){super(h0.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(p9)),this.options=e}async _getPicks(e,t,i,n){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=hm(()=>{const f=new q5;f.updateDocuments(o.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return C4t(p).filter(m=>m.score>h0.TFIDF_THRESHOLD).slice(0,h0.TFIDF_MAX_RESULTS)}),a=[];for(const f of o){const p=h0.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?h0.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 b=v.find(w=>w.key===f.commandId);b&&(f.tfIdfScore=b.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 b=this.options.suggestedCommandIds.has(f.commandId),w=this.options.suggestedCommandIds.has(p.commandId);if(b&&w)return 0;if(b)return-1;if(w)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,n));return h&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:g(4612,"similar commands")}),p})()}:l}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?g(4615,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,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){Fr(o)||this.dialogService.error(g(4616,"Command '{0}' resulted in an error",e.label),Nr(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},h0=ny,ny.PREFIX=">",ny.TFIDF_THRESHOLD=.5,ny.TFIDF_MAX_RESULTS=5,ny.WORD_FILTER=q2(CM,TE,lae),ny);jye=h0=D([_(1,we),_(2,Ut),_(3,vi),_(4,Yi),_(5,to)],jye);var Zv;let p9=(Zv=class extends V{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===wy.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=na.getConfiguredCommandHistoryLength(this.configurationService),na.cache&&na.cache.limit!==this.configuredCommandsHistoryLength&&(na.cache.limit=this.configuredCommandsHistoryLength,na.hasChanges=!0))}load(){const e=this.storageService.get(na.PREF_KEY_CACHE,Ie.PROFILE);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=na.cache=new um(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}na.counter=this.storageService.getNumber(na.PREF_KEY_COUNTER,Ie.PROFILE,na.counter)}push(e){na.cache&&(na.cache.set(e,na.counter++),na.hasChanges=!0)}peek(e){return na.cache?.peek(e)}saveState(){if(!na.cache||!na.hasChanges)return;const e={usesLRU:!0,entries:[]};na.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(na.PREF_KEY_CACHE,JSON.stringify(e),Ie.PROFILE,an.USER),this.storageService.store(na.PREF_KEY_COUNTER,na.counter,Ie.PROFILE,an.USER),na.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:na.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=na.getConfiguredCommandHistoryLength(e);na.cache=new um(i),na.counter=1,na.hasChanges=!0}},na=Zv,Zv.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Zv.PREF_KEY_CACHE="commandPalette.mru.cache",Zv.PREF_KEY_COUNTER="commandPalette.mru.counter",Zv.counter=1,Zv.hasChanges=!1,Zv);p9=na=D([_(0,$i),_(1,Te),_(2,Ge)],p9);class S4t extends jye{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(GLe(i.metadata.description)?n=i.metadata.description:n={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:n,label:dae(i.label)||i.id})}return t}}class Ob extends nJe{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 Ei.Readonly}hasCapability(e){return e===Ei.None?this.capabilities===Ei.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(Ei.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Ls.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(wa(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:ji(this.resource,Na.getCanonicalUri(e))}prefersEditorPane(e){return lm(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}class A4t{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 E4t extends V{constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(4590,"Network Requests"),when:Ayt.isEqualTo(r3(Gn.Trace)).serialize()})}async logAndRequest(e,t,i){const n=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${n} - begin`,t.type,new A4t(t.headers??{}));try{const o=await i();return this.logger.trace(`${n} - end`,t.type,o.res.statusCode,o.res.headers),o}catch(o){throw this.logger.error(`${n} - error`,t.type,su(o)),o}}}function Ctt(s){return s.res.statusCode&&s.res.statusCode>=200&&s.res.statusCode<300||s.res.statusCode===1223}function Stt(s){return s.res.statusCode===204}async function x4t(s){return Stt(s)?null:(await eD(s.stream)).toString()}async function D4t(s){if(!Ctt(s))throw new Error("Server returned "+s.res.statusCode);return x4t(s)}async function k4t(s){if(!Ctt(s))throw new Error("Server returned "+s.res.statusCode);if(Stt(s))return null;const t=(await eD(s.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: -`+t,i}}let due;function I4t(s){const e=Qe.as(Nn.Configuration),t=due;due={id:"http",order:15,title:g(4591,"HTTP"),type:"object",scope:s,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:g(4592,"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(4593,"Controls whether the proxy server certificate should be verified against the list of supplied CAs."),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:g(4594,"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.noProxy":{type:"array",items:{type:"string"},markdownDescription:g(4595,"Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests."),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:g(4596,"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(4597,"Disable proxy support for extensions."),g(4598,"Enable proxy support for extensions."),g(4599,"Enable proxy support for extensions, fall back to request options, when no proxy found."),g(4600,"Enable proxy support for extensions, override request options.")],default:"override",description:g(4601,"Use the proxy support for extensions."),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:g(4602,"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(4603,"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:[due],remove:t?[t]:[]})}I4t(at.APPLICATION);var wV,Ir;(function(s){s.Panel="panel",s.Terminal="terminal",s.Notebook="notebook",s.Editor="editor"})(Ir||(Ir={}));(function(s){function e(t){switch(t){case"panel":return s.Panel;case"terminal":return s.Terminal;case"notebook":return s.Notebook;case"editor":return s.Editor}return s.Panel}s.fromRaw=e})(Ir||(Ir={}));var zB;let d4e=(zB=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=YXe.bindTo(this.contextKeyService)}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const n=this,o=t.slashCommands;t={...t,get slashCommands(){return o.filter(a=>!a.when||n.contextKeyService.contextMatchesRules(he.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 IK(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 IK(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 IK(i.data,i.impl))}getDefaultAgent(e){return Ak(this.getActivatedAgents(),t=>!!t.isDefault&&t.locations.includes(e))}getContributedDefaultAgent(e){return this.getAgents().find(t=>!!t.isDefault&&t.locations.includes(e))}getSecondaryAgent(){return hi.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(he.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=hi.find(this._agents.values(),i=>Ace(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 IK(e.data,e.impl))}getAgentsByName(e){return this.getAgents().filter(t=>t.name===e)}agentHasDupeName(e){const t=this.getAgent(e);return t?this.getAgentsByName(t.name).filter(i=>i.extensionId.value!==t.extensionId.value).length>0:!1}async invokeAgent(e,t,i,n,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,n,o)}async getFollowups(e,t,i,n,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,n,o):[]}},zB.AGENT_LEADER="@",zB);d4e=D([_(0,Le)],d4e);class IK{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 locations(){return this.data.locations}async invoke(e,t,i,n){return this.impl.invoke(e,t,i,n)}async provideFollowups(e,t,i,n){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,n):[]}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 rR;let h4e=(rR=class{constructor(e,t,i,n){if(this.requestService=t,this.logService=i,this.storageService=n,this.registry=jt(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const o=n.get(wV.StorageKey,Ie.APPLICATION);try{this.registry.set(JSON.parse(o??"{}"),void 0)}catch{n.remove(wV.StorageKey,Ie.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>Sr(5*60*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},He.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await k4t(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(wV.StorageKey,JSON.stringify(i),Ie.APPLICATION,an.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(n=>n[e.toLowerCase()]).map(n=>n?n.some(o=>ua(o,o.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},wV=rR,rR.StorageKey="chat.participantNameRegistry",rR);h4e=wV=D([_(0,Er),_(1,I6),_(2,Ge),_(3,$i)],h4e);function Ace(s){return`${s.extensionId.value}.${s.id}`}function Att(s){const e="name"in s?s:{...s,name:s.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new Sn("")),Mo(e)}var CC;const T4t=oi("chat-editor-label-icon",ve.commentDiscussion,g(7137,"Icon of the chat editor label."));var US;let Yye=(US=class extends Ob{static getNewEditorUri(){const e=Math.floor(Math.random()*1e9);return lZ.generate(e)}static getNextCount(){let e=0;for(;CC.countsInUse.has(e);)e++;return e}constructor(e,t,i){if(super(),this.resource=e,this.options=t,this.chatService=i,typeof lZ.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=CC.getNextCount(),CC.countsInUse.add(this.inputCount),this._register(Ee(()=>CC.countsInUse.delete(this.inputCount)))}get editorId(){return CC.EditorID}get capabilities(){return super.capabilities|Ei.Singleton}matches(e){return e instanceof CC&&e.resource.toString()===this.resource.toString()}get typeId(){return CC.TypeID}getName(){return this.model?.title||g(7138,"Chat")+(this.inputCount>0?` ${this.inputCount+1}`:"")}getIcon(){return T4t}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(Ir.Panel,He.None),this.model?(this.sessionId=this.model.sessionId,this._register(this.model.onDidChange(()=>this._onDidChangeLabel.fire())),this._register(new L4t(this.model))):null}dispose(){super.dispose(),this.sessionId&&this.chatService.clearSession(this.sessionId)}},CC=US,US.countsInUse=new Set,US.TypeID="workbench.input.chatSession",US.EditorID="workbench.editor.chatSession",US);Yye=CC=D([_(2,km)],Yye);class L4t extends V{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 lZ;(function(s){s.scheme=pe.vscodeChatSesssion;function e(i){return N.from({scheme:s.scheme,path:`chat-${i}`})}s.generate=e;function t(i){if(i.scheme!==s.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}}s.parse=t})(lZ||(lZ={}));const R4t="copilot";async function M4t(s){return(await s.openView(P4t))?.widget}const N4t=g(7002,"Generating"),P4t=`workbench.panel.chat.view.${R4t}`,_oe=class _oe{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=_oe.Kind}get promptText(){return this.text}};_oe.Kind="text";let cb=_oe;const _Ne="#",QU="@",nI="/",voe=class voe{constructor(e,t,i,n,o){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=n,this.variableId=o,this.kind=voe.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${_Ne}${this.variableName}${e}`}get promptText(){return this.text}};voe.Kind="var";let m9=voe;const boe=class boe{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=boe.Kind}get text(){return`${QU}${this.agent.name}`}get promptText(){return""}};boe.Kind="agent";let $g=boe;const woe=class woe{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=woe.Kind}get text(){return`${nI}${this.command.name}`}get promptText(){return""}};woe.Kind="subcommand";let JM=woe;const yoe=class yoe{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=yoe.Kind}get text(){return`${nI}${this.slashCommand.command}`}get promptText(){return`${nI}${this.slashCommand.command}`}};yoe.Kind="slash";let FW=yoe;const Coe=class Coe{constructor(e,t,i,n,o,r){this.range=e,this.editorRange=t,this.text=i,this.id=n,this.modelDescription=o,this.data=r,this.kind=Coe.Kind}get referenceText(){return this.text.replace(_Ne,"")}get promptText(){return this.text}};Coe.Kind="dynamic";let OW=Coe;function F4t(s){return{text:s.text,parts:s.parts.map(e=>{if(e.kind===cb.Kind)return new cb(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===m9.Kind)return new m9(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableName||"");if(e.kind===$g.Kind){let t=e.agent;return t=Att(t),new $g(new mi(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===JM.Kind)return new JM(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===FW.Kind)return new FW(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===OW.Kind)return new OW(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,Mo(e.data));throw new Error(`Unknown chat request part: ${e.kind}`)}})}}function O4t(s){const e=s.parts.find(i=>i instanceof $g),t=s.parts.find(i=>i instanceof JM);return{agentPart:e,commandPart:t}}function B4t(s){return!!s&&typeof s=="object"&&"uri"in s&&s.uri instanceof N&&"version"in s&&typeof s.version=="number"&&"ranges"in s&&Array.isArray(s.ranges)&&s.ranges.every(F.isIRange)}function W4t(s){return!!s&&typeof s=="object"&&"documents"in s&&Array.isArray(s.documents)&&s.documents.every(B4t)}var BW;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(BW||(BW={}));var WW;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(WW||(WW={}));var u4e;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(u4e||(u4e={}));var Jye,Xye;const Soe=class Soe{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}get locationData(){return this._locationData}constructor(e,t,i,n=0,o){this._session=e,this.message=t,this._variableData=i,this._attempt=n,this._locationData=o,this.id="request_"+Soe.nextId++}adoptTo(e){this._session=e}};Soe.nextId=0;let dZ=Soe,H4t=class{get onDidChangeValue(){return this._onDidChangeValue.event}get value(){return this._responseParts}constructor(e){this._onDidChangeValue=new I,this._responseRepr="",this._markdownContent="",this._citations=[],this._responseParts=H_(e).map(t=>dd(t)?{content:t,kind:"markdownContent"}:"kind"in t?t:{kind:"treeData",treeData:t}),this._updateRepr(!0)}toString(){return this._responseRepr}toMarkdown(){return this._markdownContent}clear(){this._responseParts=[],this._updateRepr(!0)}updateContent(e,t){if(e.kind==="markdownContent"){const i=this._responseParts.length-1,n=this._responseParts[i];!n||n.kind!=="markdownContent"||!Ett(n.content,e.content)?this._responseParts.push(e):n.content=vQ(n.content,e.content),this._updateRepr(t)}else if(e.kind==="textEdit"){if(e.edits.length>0){let i=!1;for(let n=0;!i&&n{this._updateRepr(!1)});e.task?.().then(o=>{n.dispose(),typeof o=="string"&&(this._responseParts[i].content=new Mt(o)),this._updateRepr(!1)})}else this._responseParts.push(e),this._updateRepr(t)}addCitation(e){this._citations.push(e),this._updateRepr()}_updateRepr(e){this._responseRepr=this._responseParts.map(t=>t.kind==="treeData"?"":t.kind==="inlineReference"?_i("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="command"?t.command.title:t.kind==="textEditGroup"?g(7038,"Made changes."):t.kind==="progressMessage"?"":t.kind==="confirmation"?`${t.title} +`)};const r=await o.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(g(1543,"No result.")),n);return r}}async function EHt(s,e,t,i){const n=new $Me(e,t,s),o=await n.resolveRenameLocation(He.None);return o?.rejectReason?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,He.None)}var JL;let Jk=(JL=class{static get(e){return e.getContribution(pye.ID)}constructor(e,t,i,n,o,r,a,c,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=c,this._telemetryService=l,this._disposableStore=new Z,this._cts=new ci,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(fye,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 ci,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new $Me(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new Kk(this.editor,jo.Position|jo.Value,void 0,this._cts.token);let o;try{e("resolving rename location");const p=i.resolveRenameLocation(n.token);this._progressService.showWhile(p,250),o=await p,e("resolved rename location")}catch(p){p instanceof Ma?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"||cd(p))&&Ih.get(this.editor)?.showMessage(p||g(1544,"An unknown error occurred while resolving rename location"),t));return}finally{n.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),Ih.get(this.editor)?.showMessage(o.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new Kk(this.editor,jo.Position|jo.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===uM.Automatic&&(v=v.filter(([b,w])=>w)),v.map(([b])=>b.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=B_(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(F.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(p,{editor:this.editor,showPreview:u.wantsPreview,label:g(1545,"Renaming '{0}' to '{1}'",o?.text,u.newName),code:"undoredo.rename",quotableLabel:g(1546,"Renaming {0} to {1}",o?.text,u.newName),respectAutoSaveConfig:!0}).then(m=>{e("edits applied"),m.ariaSummary&&Mr(g(1547,"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(1548,"Rename failed to apply edits")),this._logService.error(m)})},p=>{e("error when providing rename edits",JSON.stringify(p,null," ")),this._notificationService.error(g(1549,"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 n=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",n)}},pye=JL,JL.ID="editor.contrib.renameController",JL);Jk=pye=D([_(1,we),_(2,bi),_(3,LN),_(4,YA),_(5,Ge),_(6,Ec),_(7,it),_(8,Yi)],Jk);class xHt extends tt{constructor(){super({id:"editor.action.rename",label:g(1550,"Rename Symbol"),alias:"Rename Symbol",precondition:he.and(J.writable,J.hasRenameProvider),kbOpts:{kbExpr:J.editorTextFocus,primary:S.F2,weight:Ae.EditorContrib},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Kt),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return N.isUri(n)&&oe.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},vt):super.runCommand(e,t)}run(e,t){const i=e.get(Ge),n=Jk.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}on(Jk.ID,Jk,ri.Lazy);Me(xHt);const GMe=hc.bindToContribution(Jk.get);qe(new GMe({id:"acceptRenameInput",precondition:VU,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:S.Enter}}));qe(new GMe({id:"acceptRenameInputWithPreview",precondition:he.and(VU,he.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:he.and(J.focus,he.not("isComposing")),primary:U.CtrlCmd+S.Enter}}));qe(new GMe({id:"cancelRenameInput",precondition:VU,handler:s=>s.cancelRenameInput(),kbOpts:{weight:Ae.EditorContrib+99,kbExpr:J.focus,primary:S.Escape,secondary:[U.Shift|S.Escape]}}));At(class extends li{constructor(){super({id:"focusNextRenameSuggestion",title:{...Fe(1551,"Focus Next Rename Suggestion")},precondition:VU,keybinding:[{primary:S.DownArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const i=Jk.get(t);i&&i.focusNextRenameSuggestion()}});At(class extends li{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Fe(1552,"Focus Previous Rename Suggestion")},precondition:VU,keybinding:[{primary:S.UpArrow,weight:Ae.EditorContrib+99}]})}run(e){const t=e.get(Kt).getFocusedCodeEditor();if(!t)return;const i=Jk.get(t);i&&i.focusPreviousRenameSuggestion()}});ng("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;Tt(typeof n=="string");const{renameProvider:o}=s.get(it);return EHt(o,e,t,n)});ng("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(it),o=await new $Me(e,t,i).resolveRenameLocation(He.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o});Qe.as(Nn.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:at.LANGUAGE_OVERRIDABLE,description:g(1553,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var PB;let ZX=(PB=class extends V{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(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{const o=this.editor.getModel()?.getLanguageId();o&&n.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(x.minimap)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(x.minimap)||(this.options=this.createOptions(e.getOption(x.minimap)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new cn(()=>{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,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!n?.markers))return{foldingRules:n,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===nr.Comment}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),n=e.map(o=>DHt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,n);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 fce(s){return s&&!!s.data}function Ret(s){return s&&Array.isArray(s.edits)}class LHt{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Met(s,e){return s.has(e)}function RHt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function Net(s,e,t,i,n){const o=RHt(s,e),r=await Promise.all(o.map(async a=>{let c,l=null;try{c=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(d){l=d,c=null}return(!c||!fce(c)&&!Ret(c))&&(c=null),new LHt(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 MHt(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class NHt{constructor(e,t){this.provider=e,this.tokens=t}}function PHt(s,e){return s.has(e)}function Pet(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function KMe(s,e,t,i){const n=Pet(s,e),o=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(c){No(c),a=null}return(!a||!fce(a))&&(a=null),new NHt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}_t.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;Tt(t instanceof N);const i=s.get(gi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it),o=MHt(n,i);return o?o[0].getLegend():s.get(vi).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});_t.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;Tt(t instanceof N);const i=s.get(gi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(it);if(!Met(n,i))return s.get(vi).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await Net(n,i,null,null,He.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!fce(a))return;const c=a9({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),c});_t.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;Tt(t instanceof N);const n=s.get(gi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(it),r=Pet(o,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!F.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 KMe(o,n,F.lift(i),He.None);if(a)return a.provider.getLegend()});_t.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;Tt(t instanceof N),Tt(F.isIRange(i));const n=s.get(gi).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(it),r=await KMe(o,n,F.lift(i),He.None);if(!(!r||!r.tokens))return a9({id:0,type:"full",data:r.tokens.data})});const qMe="editor.semanticHighlighting";function fQ(s,e,t){const i=t.getValue(qMe,{overrideIdentifier:s.getLanguageId(),resource:s.uri})?.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var wE;let mye=class extends V{constructor(e,t,i,n,o,r){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new _ye(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()];fQ(d,i,n)?h||a(d):h&&c(d,h)}};t.getModels().forEach(d=>{fQ(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{fQ(d,i,n)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers[d.uri.toString()];h&&c(d,h)})),this._register(n.onDidChangeConfiguration(d=>{d.affectsConfiguration(qMe)&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};mye=D([_(0,nae),_(1,gi),_(2,pn),_(3,Te),_(4,wp),_(5,it)],mye);var jD;let _ye=(jD=class extends V{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:wE.REQUEST_MIN_DELAY,max:wE.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new cn(()=>this._fetchDocumentSemanticTokensNow(),wE.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=()=>{bt(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),bt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Met(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ci,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Net(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 js(!1);n.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&&(Fr(c)||typeof c.message=="string"&&c.message.indexOf("busy")!==-1)||vt(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,n,o){o=Math.min(o,i.length-n,e.length-t);for(let r=0;r{(n.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(Ret(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&&(wE._copy(c,d-p,l,h-p,p),h-=p),f.data&&(wE._copy(f.data,0,l,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&wE._copy(c,0,l,0,d),t={resultId:t.resultId,data:l}}}if(fce(t)){this._currentDocumentResponse=new FHt(e,t.resultId,t.data);const a=uQe(t,i,this._model.getLanguageId());if(n.length>0)for(const c of n)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()}},wE=jD,jD.REQUEST_MIN_DELAY=300,jD.REQUEST_MAX_DELAY=2e3,jD);_ye=wE=D([_(1,nae),_(2,pn),_(3,wp),_(4,it)],_ye);class FHt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}G6(mye);var vye,XL;let LW=(XL=class extends V{static get(e){return e.getContribution(vye.ID)}constructor(e,t,i,n,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new cn(()=>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(qMe)&&(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(),n=Rr(r=>Promise.resolve(KMe(this._provider,e,t,r))),o=new js(!1);return n.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,uQe(c,l,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},vye=XL,XL.ID="editor.contrib.viewportSemanticTokens",XL);LW=vye=D([_(1,nae),_(2,pn),_(3,Te),_(4,wp),_(5,it)],LW);on(LW.ID,LW,ri.AfterFirstRender);class OHt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:r}=n,a=i.column-r;let c=a,l=a,d=0;for(;c>=0;c--){const h=o.charCodeAt(c);if(c!==a&&(h===B.Underline||h===B.Dash))break;if(mx(h)&&Nw(d))break;d=h}for(c+=1;l0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new F(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var bye;class QMe{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 QMe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var ZL;let GM=(ZL=class{static get(e){return e.getContribution(bye.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 Oet(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(x.smartSelect),He.None).then(o=>{if(!(!eo(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!is(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 QMe(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 n=this._state.map(o=>dt.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},bye=ZL,ZL.ID="editor.contrib.smartSelectController",ZL);GM=bye=D([_(1,it)],GM);class Fet extends tt{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=GM.get(t);i&&await i.run(this._forward)}}class BHt extends Fet{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:g(1554,"Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.RightArrow,mac:{primary:U.CtrlCmd|U.WinCtrl|U.Shift|S.RightArrow,secondary:[U.WinCtrl|U.Shift|S.RightArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(1555,"&&Expand Selection"),order:2}})}}_t.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class WHt extends Fet{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:g(1556,"Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|U.Alt|S.LeftArrow,mac:{primary:U.CtrlCmd|U.WinCtrl|U.Shift|S.LeftArrow,secondary:[U.WinCtrl|U.Shift|S.LeftArrow]},weight:Ae.EditorContrib},menuOpts:{menuId:_e.MenubarSelectionMenu,group:"1_basic",title:g(1557,"&&Shrink Selection"),order:3}})}}on(GM.ID,GM,ri.Lazy);Me(BHt);Me(WHt);async function Oet(s,e,t,i,n){const o=s.all(e).concat(new OHt(i.selectSubwords));o.length===1&&o.unshift(new rX);const r=[],a=[];for(const c of o)r.push(Promise.resolve(c.provideSelectionRanges(e,t,n)).then(l=>{if(eo(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||F.containsRange(u,d)&&!F.equalsRange(u,d))&&(l.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return l;const h=[l[0]];for(let u=1;us}),eue="data-sticky-line-index",zUe="data-sticky-is-line",UHt="data-sticky-is-line-number",$Ue="data-sticky-is-folding-icon";class VHt extends V{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 rf),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 n=this._isWidgetHeightZero(e),o=n?void 0:e,r=n?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,n=e.startLineNumbers.findIndex(o=>!i.startLineNumbers.includes(o));return n===-1?0:n}_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))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(x.showFoldingControls)==="mouseover"&&(this._foldingIconStore.add(ue(this._lineNumbersDomNode,ke.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ue(this._lineNumbersDomNode,ke.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){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=Zh.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{l=[]}const d=new pI(!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 pU(2e3),u=Z7(d,h);let f;VUe?f=VUe.createHTML(h.build()):f=h.build();const p=document.createElement("span");p.setAttribute(eue,String(e)),p.setAttribute(zUe,""),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(eue,String(e)),m.setAttribute(UHt,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const v=n.contentLeft;m.style.width=`${v}px`;const b=document.createElement("span");c.renderType===wr.On||c.renderType===wr.Interval&&t%10===0?b.innerText=t.toString():c.renderType===wr.Relative&&(b.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),b.className="sticky-line-number-inner",b.style.lineHeight=`${this._lineHeight}px`,b.style.width=`${n.lineNumbersWidth}px`,b.style.paddingLeft=`${n.lineNumbersLeft}px`,m.appendChild(b);const w=this._renderFoldingIconForLine(i,t);w&&m.appendChild(w.domNode),this._editor.applyFontInfo(p),this._editor.applyFontInfo(b),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 y=new zHt(e,t,p,m,w,u.characterMapping,p.scrollWidth);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,o=t===this._lineNumbers.length-1,r="0",a="1";i.style.zIndex=o?r:a,n.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,n.style.top=o?c:l,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(x.showFoldingControls);if(!e||i==="never")return;const n=e.regions,o=n.findRange(t),r=n.getStartLineNumber(o);if(!(t===r))return;const c=n.isCollapsed(o),l=new $Ht(c,r,n.getEndLineNumber(o),this._lineHeight);return l.setVisible(this._isOnGlyphMargin?!0:c||i==="always"),l.domNode.setAttribute($Ue,""),l}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:Fg.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=DTe(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,eue);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,zUe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,$Ue)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class zHt{constructor(e,t,i,n,o,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a}}class $Ht{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=We.asClassName(e?LJ:TJ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class V5{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class tZ{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Bet{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var z5;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(z5||(z5={}));var Nx;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(Nx||(Nx={}));let wye=class extends V{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Lh(300)),this._updateOperation=this._register(new Z),this._editor.getOption(x.stickyScroll).defaultModel){case z5.OUTLINE_MODEL:this._modelProviders.push(new yye(this._editor,n));case z5.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new Sye(this._editor,t,n));case z5.INDENTATION_MODEL:this._modelProviders.push(new Cye(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:n}=t.computeStickyModel(e);this._modelPromise=n;const o=await i;if(this._modelPromise!==n)return null;switch(o){case Nx.CANCELED:return this._updateOperation.clear(),null;case Nx.VALID:return t.stickyModel}}return null}).catch(t=>(vt(t),null))}};wye=D([_(2,we),_(3,it)],wye);class Wet extends V{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Nx.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Rr(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?Nx.CANCELED:(this._stickyModel=this.createStickyModel(e,i),Nx.VALID):this._invalid()).then(void 0,i=>(vt(i),Nx.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let yye=class extends Wet{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Dw.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new Bet(o.uri,o.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(hi.first(e.children.values())instanceof xwe){const a=hi.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 n=[],o=Array.from(i.values()).sort((a,c)=>{const l=new V5(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new V5(c.symbol.range.startLineNumber,c.symbol.range.endLineNumber);return this._comparator(l,d)});for(const a of o)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new tZ(void 0,n,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 n=new V5(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new tZ(n,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 Ewe?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};yye=D([_(1,it)],yye);class Het extends Wet{constructor(e){super(e),this._foldingLimitReporter=new KYe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new Bet(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new tZ(void 0,[],void 0);for(let o=0;o0&&(this.provider=this._register(new ARe(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){return this.provider?.compute(e)??null}};Sye=D([_(2,it)],Sye);class GHt{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}var FB;let Aye=(FB=class extends V{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 cn(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.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 wye(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ci,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,n,o){if(t.children.length===0)return;let r=o;const a=[];for(let d=0;dd-h)),l=this.updateIndex(_2(a,e.startLineNumber+n,(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 GHt(u,f-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n+1,u))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,h,i,n,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 n of i)t=t.filter(o=>!(o.startLineNumber>=n.startLineNumber&&o.endLineNumber<=n.endLineNumber+1));return t}},FB.ID="store.contrib.stickyScrollController",FB);Aye=D([_(1,it),_(2,Vs)],Aye);var Eye,eR;let BA=(eR=class extends V{constructor(e,t,i,n,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new Z,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._stickyScrollWidget=new VHt(this._editor),this._stickyLineCandidateProvider=new Aye(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=U5.Empty,this._onDidResize(),this._readConfiguration();const c=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(ue(c,ke.CONTEXT_MENU,async d=>{this._onContextMenu(ct(c),d)})),this._stickyScrollFocusedContextKey=J.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=J.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Ac(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(ue(c,ke.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}get stickyScrollCandidateProvider(){return this._stickyLineCandidateProvider}get stickyScrollWidgetState(){return this._widgetState}static get(e){return e.getContribution(Eye.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,mt.Smooth))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(F.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Z),t=this._register(new rce(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!==Rt.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 F(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},n=this._stickyScrollWidget.getDomNode();this._register(Ro(n,ke.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(Ro(n,ke.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!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,ke.MOUSE_LEAVE,o=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,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 ci;e.add(Ee(()=>d.dispose(!0)));let h;q6(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new oe(c.startLineNumber,c.startColumn+1),!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!==Rt.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(HZe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new Sh(e,t);this._contextMenuService.showContextMenu({menuId:_e.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;wRe(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(x.lineHeight)*t.index+1;this._editor.setScrollTop(n),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=void 0,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=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(x.lineNumbers).renderType===wr.Relative&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,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 n of e.ranges)if(i>=n.fromLineNumber&&i<=n.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._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){this._minRebuildFromLine=void 0,this._foldingModel=await kA.get(this._editor)?.getFoldingModel()??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=U5.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(x.lineHeight),t=Math.min(this._maxStickyLines,this._editor.getOption(x.stickyScroll).maxLineCount),i=this._editor.getScrollTop();let n=0;const o=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){const c=new V5(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,b=this._editor.getTopForLineNumber(u)-i,w=this._editor.getBottomForLineNumber(u)-i;if(p>b&&p<=w){o.push(h),r.push(u+1),n=w-m;break}else m>v&&m<=w&&(o.push(h),r.push(u+1));if(o.length===t)break}}}return this._endLineNumbers=r,new U5(o,r,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},Eye=eR,eR.ID="store.contrib.stickyScrollController",eR);BA=Eye=D([_(1,lr),_(2,it),_(3,we),_(4,Vs),_(5,wp),_(6,Le)],BA);class KHt extends li{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Fe(5217,"Toggle Editor Sticky Scroll"),mnemonicTitle:g(5218,"&&Toggle Editor Sticky Scroll")},metadata:{description:Fe(5219,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:ca.View,toggled:{condition:he.equals("config.editor.stickyScroll.enabled",!0),title:g(5220,"Sticky Scroll"),mnemonicTitle:g(5221,"&&Sticky Scroll")},menu:[{id:_e.CommandPalette},{id:_e.MenubarAppearanceMenu,group:"4_editor",order:3},{id:_e.StickyScrollContext}]})}async run(e){const t=e.get(Te),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const pce=Ae.EditorContrib;class qHt extends df{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Fe(5222,"Focus on the editor sticky scroll"),mnemonicTitle:g(5223,"&&Focus Sticky Scroll")},precondition:he.and(he.has("config.editor.stickyScroll.enabled"),J.stickyScrollVisible),menu:[{id:_e.CommandPalette}]})}runEditorCommand(e,t){BA.get(t)?.focus()}}class QHt extends df{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Fe(5224,"Select the next editor sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pce,primary:S.DownArrow}})}runEditorCommand(e,t){BA.get(t)?.focusNext()}}class jHt extends df{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Fe(5225,"Select the previous sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pce,primary:S.UpArrow}})}runEditorCommand(e,t){BA.get(t)?.focusPrevious()}}class YHt extends df{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Fe(5226,"Go to the focused sticky scroll line"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pce,primary:S.Enter}})}runEditorCommand(e,t){BA.get(t)?.goToFocused()}}class JHt extends df{constructor(){super({id:"editor.action.selectEditor",title:Fe(5227,"Select Editor"),precondition:J.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:pce,primary:S.Escape}})}runEditorCommand(e,t){BA.get(t)?.selectEditor()}}on(BA.ID,BA,ri.AfterFirstRender);At(KHt);At(qHt);At(jHt);At(QHt);At(YHt);At(JHt);class XHt{constructor(e,t,i,n,o,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.completion=r}}let xye=class extends N1e{constructor(e,t,i,n,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,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(He.None)}return e}};xye=D([_(5,sce)],xye);let Dye=class extends V{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){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(uF.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(uF.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 F(t.lineNumber,1,t.lineNumber,t.column));if(!d&&this._lastResult?.canBeReused(e,t.lineNumber,l)){const f=new zHe(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=f,this._lastResult.acquire(),h=this._lastResult}else{const f=await sMe(this._languageFeatureService.completionProvider,e,t,new V3(void 0,cX.createSuggestFilter(o).itemKind,d?.providers),d&&{triggerKind:$u.TriggerCharacter,triggerCharacter:d.ch},n);let p;f.needsClipboard&&(p=await this._clipboardService.readText());const m=new ex(f.items,t.column,new zHe(u,0),aX.None,o.getOption(x.suggest),o.getOption(x.snippetSuggestions),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new xye(e,t.lineNumber,l,m,f,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(He.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(F.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))o.triggerCharacters?.includes(i)&&n.add(o);if(n.size!==0)return{providers:n,ch:i}}};Dye=D([_(0,it),_(1,ag),_(2,sce),_(3,Kt)],Dye);G6(Dye);class ZHt extends tt{constructor(){super({id:"editor.action.forceRetokenize",label:g(1569,"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 n=new js;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Me(ZHt);var eUt=".monaco-editor .unicode-highlight{background-color:var(--vscode-editorUnicodeHighlight-background);border:1px solid var(--vscode-editorUnicodeHighlight-border);box-sizing:border-box}";ut(eUt,{});var tUt=".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)}";ut(tUt,{});const iUt=26;let kye=class extends V{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Iye))}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,iUt)}};kye=D([_(1,we)],kye);let Iye=class extends V{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(q_,{}),this.element=fe("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=fe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Ms(this.element)}show(e){Ms(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=re(this.element,fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(fe(`div${We.asCSSSelector(e.icon)}`));const n=re(this.element,fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=re(this.element,fe("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(Z3,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=re(this.element,fe("div.action-container"));this.actionBar=this._register(new ld(o)),this.actionBar.push(this._register(new rn("banner.close","Close Banner",We.asClassName(vYe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Iye=D([_(0,we)],Iye);const nUt=oi("extensions-warning-message",ve.warning,g(1574,"Icon shown with a warning message in the extensions editor."));var OB;let c9=(OB=class extends V{constructor(e,t,i,n){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(1575,"This document contains many non-basic ASCII unicode characters"),command:new d9};else if(o.ambiguousCharacterCount>=r)a={message:g(1576,"This document contains many ambiguous unicode characters"),command:new KM};else if(o.invisibleCharacterCount>=r)a={message:g(1577,"This document contains many invisible unicode characters"),command:new l9};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:nUt,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(kye,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=sUt(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"?Kl:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new Tye(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new oUt(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},OB.ID="editor.contrib.unicodeHighlighter",OB);c9=D([_(1,Rl),_(2,cC),_(3,we)],c9);function sUt(s,e){return{nonBasicASCII:e.nonBasicASCII===Ef?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Ef?!s:e.includeComments,includeStrings:e.includeStrings===Ef?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let Tye=class extends V{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new cn(()=>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 n of t.ranges)i.push({range:n,options:iZ.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!nLe(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Vet(i,this._options),inComment:sLe(t,e),inString:oLe(t,e)}}};Tye=D([_(3,Rl)],Tye);class oUt extends V{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 cn(()=>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 n of e){const o=aTe.computeUnicodeHighlights(this._model,this._options,n);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 n of i.ranges)t.push({range:n,options:iZ.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 nLe(t,e)?{reason:Vet(i,this._options),inComment:sLe(t,e),inString:oLe(t,e)}:null}}const Uet=g(1578,"Configure Unicode Highlight Options");let Lye=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!==lu.Range)return[];const i=this._editor.getModel(),n=this._editor.getContribution(c9.ID);if(!n)return[];const o=[],r=new Set;let a=300;for(const c of t){const l=n.getDecorationInfo(c);if(!l)continue;const h=i.getValueInRange(c.range).codePointAt(0),u=tue(h);let f;switch(l.reason.kind){case v_.Ambiguous:{F7(l.reason.confusableWith)?f=g(1579,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,tue(l.reason.confusableWith.codePointAt(0))):f=g(1580,"The character {0} could be confused with the character {1}, which is more common in source code.",u,tue(l.reason.confusableWith.codePointAt(0)));break}case v_.Invisible:f=g(1581,"The character {0} is invisible.",u);break;case v_.NonBasicAscii:f=g(1582,"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(1583,"Adjust settings"),v=`command:${nZ.ID}?${encodeURIComponent(JSON.stringify(p))}`,b=new Mt("",!0).appendMarkdown(f).appendText(" ").appendLink(v,m,Uet);o.push(new g_(this,c.range,[b],!1,a++))}return o}renderHoverParts(e,t){return PPt(e,t,this._editor,this._languageService,this._openerService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` +`)}};Lye=D([_(1,xi),_(2,Ao)],Lye);function Rye(s){return`U+${s.toString(16).padStart(4,"0")}`}function tue(s){let e=`\`${Rye(s)}\``;return hT.isInvisibleCharacter(s)||(e+=` "${`${rUt(s)}`}"`),e}function rUt(s){return s===B.BackTick?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Vet(s,e){return aTe.computeUnicodeHighlightReason(s,e)}const aoe=class aoe{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Gt.createDynamic({description:"unicode-highlight",stickiness:ni.NeverGrowsWhenTypingAtEdges,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};aoe.instance=new aoe;let iZ=aoe;const QPe=class QPe extends tt{constructor(){super({id:KM.ID,label:g(1584,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=g(1585,"Disable Highlight In Comments")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Lu.includeComments,!1,St.USER)}};QPe.ID="editor.action.unicodeHighlight.disableHighlightingInComments";let Mye=QPe;const jPe=class jPe extends tt{constructor(){super({id:KM.ID,label:g(1586,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=g(1587,"Disable Highlight In Strings")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Lu.includeStrings,!1,St.USER)}};jPe.ID="editor.action.unicodeHighlight.disableHighlightingInStrings";let Nye=jPe;const coe=class coe extends tt{constructor(){super({id:coe.ID,label:g(1588,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=g(1589,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Lu.ambiguousCharacters,!1,St.USER)}};coe.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let KM=coe;const loe=class loe extends tt{constructor(){super({id:loe.ID,label:g(1590,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=g(1591,"Disable Invisible Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Lu.invisibleCharacters,!1,St.USER)}};loe.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let l9=loe;const doe=class doe extends tt{constructor(){super({id:doe.ID,label:g(1592,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=g(1593,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e?.get(Te);n&&this.runAction(n)}async runAction(e){await e.updateValue(Lu.nonBasicASCII,!1,St.USER)}};doe.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let d9=doe;const hoe=class hoe extends tt{constructor(){super({id:hoe.ID,label:g(1594,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:o,inString:r,inComment:a}=i,c=String.fromCodePoint(n),l=e.get(In),d=e.get(Te);function h(p){return hT.isInvisibleCharacter(p)?g(1595,"Exclude {0} (invisible character) from being highlighted",Rye(p)):g(1596,"Exclude {0} from being highlighted",`${Rye(p)} "${c}"`)}const u=[];if(o.kind===v_.Ambiguous)for(const p of o.notAmbiguousInLocales)u.push({label:g(1597,'Allow unicode characters that are more common in the language "{0}".',p),run:async()=>{cUt(d,[p])}});if(u.push({label:h(n),run:()=>aUt(d,[n])}),a){const p=new Mye;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(r){const p=new Nye;u.push({label:p.label,run:async()=>p.runAction(d)})}if(o.kind===v_.Ambiguous){const p=new KM;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===v_.Invisible){const p=new l9;u.push({label:p.label,run:async()=>p.runAction(d)})}else if(o.kind===v_.NonBasicAscii){const p=new d9;u.push({label:p.label,run:async()=>p.runAction(d)})}else lUt(o);const f=await l.pick(u,{title:Uet});f&&await f.run()}};hoe.ID="editor.action.unicodeHighlight.showExcludeOptions";let nZ=hoe;async function aUt(s,e){const t=s.getValue(Lu.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(Lu.allowedCharacters,i,St.USER)}async function cUt(s,e){const t=s.inspect(Lu.allowedLocales).user?.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const n of e)i[n]=!0;await s.updateValue(Lu.allowedLocales,i,St.USER)}function lUt(s){throw new Error(`Unexpected value: ${s}`)}Me(KM);Me(l9);Me(d9);Me(nZ);on(c9.ID,c9,ri.AfterFirstRender);UN.register(Lye);const zet="ignoreUnusualLineTerminators";function dUt(s,e,t){s.setModelProperty(e.uri,zet,t)}function hUt(s,e){return s.getModelProperty(e.uri,zet)}var BB;let sZ=(BB=class extends V{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(n=>{n.hasChanged(x.unusualLineTerminators)&&(this._config=this._editor.getOption(x.unusualLineTerminators),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||hUt(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(1598,"Unusual Line Terminators"),message:g(1599,"Detected unusual line terminators"),detail:g(1600,"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`.",_i(e.uri)),primaryButton:g(1601,"&&Remove Unusual Line Terminators"),cancelButton:g(1602,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){dUt(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},BB.ID="editor.contrib.unusualLineTerminatorsDetector",BB);sZ=D([_(1,to),_(2,Kt)],sZ);on(sZ.ID,sZ,ri.AfterFirstRender);var _c,Pye;const mce=new Y("hasWordHighlights",!1);function $et(s,e,t,i){const n=s.ordered(e);return Tre(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,No)),eo).then(o=>{if(o){const r=new ui;return r.set(e.uri,o),r}return new ui})}function uUt(s,e,t,i,n,o){const r=s.ordered(e);return Tre(r.map(a=>()=>{const c=o.filter(l=>ky(l)).filter(l=>sae(a.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,c,n)).then(void 0,No)}),a=>a instanceof ui&&a.size>0)}class jMe{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=Rr(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new F(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=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 gUt extends jMe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return $et(this._providers,e,t.getPosition(),n).then(o=>o||new ui)}}class fUt extends jMe{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return uUt(this._providers,e,t.getPosition(),i,n,this._otherModels).then(o=>o||new ui)}}class Get extends jMe{constructor(e,t,i,n,o){super(e,t,n),this._otherModels=o,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,n){return Sr(250,n).then(()=>{const o=new ui;let r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new ui;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:_8.Text}));d&&o.set(c.uri,d)}return o})}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty!==n?!1:super.isValid(e,t,i)}}function pUt(s,e,t,i,n){return s.has(e)?new gUt(e,t,n,s):new Get(e,t,i,n,[])}function mUt(s,e,t,i,n,o){return s.has(e)?new fUt(e,t,n,s,o):new Get(e,t,i,n,o)}ng("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(it);return(await $et(i.documentHighlightProvider,e,t,He.None))?.get(e.uri)});var YD;let Fye=(YD=class{constructor(e,t,i,n,o){this.toUnhook=new Z,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new ui,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=o,this._hasWordHighlights=mce.bindTo(n),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():_c.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,_c.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(F.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Mr(`${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,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Mr(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=_c.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),_c.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 n=_c.storedDecorations.get(i.getModel().uri);if(!n)continue;i.removeDecorations(n),t.push(i.getModel().uri);const o=cp.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)_c.storedDecorations.delete(i)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==pe.vscodeNotebookCell&&_c.query?.modelInfo?.model.uri.scheme!==pe.vscodeNotebookCell?(_c.query=null,this._run()):_c.query?.modelInfo&&(_c.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!==Oi.Explicit&&this.editor.getModel()?.uri.scheme!==pe.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===pe.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const c=a.getModel();c&&c!==e&&c.uri.scheme===pe.vscodeNotebookCell&&o.push(c)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!Zp(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 n){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){_c.query=null,this._stopAll();return}const n=i.startColumn,o=i.endColumn,r=this._getWord();if(!r||r.startColumn>n||r.endColumn{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=o||[],this._beginRenderDecorations())},vt)}}computeWithModel(e,t,i,n){return n.length?mUt(this.multiDocumentProviders,e,t,i,this.editor.getOption(x.wordSeparators),n):pUt(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=cp.get(t);if(!i)continue;const n=[],o=t.getModel()?.uri;if(o&&this.workerRequestValue.has(o)){const r=_c.storedDecorations.get(o),a=this.workerRequestValue.get(o);if(a)for(const l of a)l.range&&n.push({range:l.range,options:SWt(l.kind)});let c=[];t.changeDecorations(l=>{c=l.deltaDecorations(r??[],n)}),_c.storedDecorations=_c.storedDecorations.set(o,c),n.length>0&&(i.wordHighlighter?.decorations.set(n),i.wordHighlighter?._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},_c=YD,YD.storedDecorations=new ui,YD.query=null,YD);Fye=_c=D([_(4,Kt)],Fye);var tR;let cp=(tR=class extends V{static get(e){return e.getContribution(Pye.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const o=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new Fye(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};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()}},Pye=tR,tR.ID="editor.contrib.wordHighlighter",tR);cp=Pye=D([_(1,Le),_(2,it),_(3,Kt)],cp);class Ket extends tt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=cp.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class _Ut extends Ket{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:g(1603,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:mce,kbOpts:{kbExpr:J.editorTextFocus,primary:S.F7,weight:Ae.EditorContrib}})}}class vUt extends Ket{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:g(1604,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:mce,kbOpts:{kbExpr:J.editorTextFocus,primary:U.Shift|S.F7,weight:Ae.EditorContrib}})}}class bUt extends tt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:g(1605,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:mce.toNegated(),kbOpts:{kbExpr:J.editorTextFocus,primary:0,weight:Ae.EditorContrib}})}run(e,t,i){const n=cp.get(t);n&&n.restoreViewState(!0)}}on(cp.ID,cp,ri.Eager);Me(_Ut);Me(vUt);Me(bUt);class _ce extends hc{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=hm(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),r=t.getSelections(),a=r.length>1,c=r.map(l=>{const d=new oe(l.positionLineNumber,l.positionColumn),h=this._move(n,o,d,this._wordNavigationType,a);return this._moveTo(l,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",Oi.Explicit,c.map(l=>Rn.fromModelSelection(l))),c.length===1){const l=new oe(c[0].positionLineNumber,c[0].positionColumn);t.revealPosition(l,mt.Smooth)}}_moveTo(e,t,i){return i?new dt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new dt(t.lineNumber,t.column,t.lineNumber,t.column)}}class AI extends _ce{_move(e,t,i,n,o){return hs.moveWordLeft(e,t,i,n,o)}}class EI extends _ce{_move(e,t,i,n,o){return hs.moveWordRight(e,t,i,n)}}class wUt extends AI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordStartLeft",precondition:void 0})}}class yUt extends AI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordEndLeft",precondition:void 0})}}class CUt extends AI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStartFast,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(V7,b6)?.negate()),primary:U.CtrlCmd|S.LeftArrow,mac:{primary:U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}class SUt extends AI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordStartLeftSelect",precondition:void 0})}}class AUt extends AI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordEndLeftSelect",precondition:void 0})}}class EUt extends AI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStartFast,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(V7,b6)?.negate()),primary:U.CtrlCmd|U.Shift|S.LeftArrow,mac:{primary:U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}class xUt extends AI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(hm(vh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class DUt extends AI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(hm(vh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class kUt extends EI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordStartRight",precondition:void 0})}}class IUt extends EI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(V7,b6)?.negate()),primary:U.CtrlCmd|S.RightArrow,mac:{primary:U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class TUt extends EI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordRight",precondition:void 0})}}class LUt extends EI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordStartRightSelect",precondition:void 0})}}class RUt extends EI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:he.and(J.textInputFocus,he.and(V7,b6)?.negate()),primary:U.CtrlCmd|U.Shift|S.RightArrow,mac:{primary:U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}class MUt extends EI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordRightSelect",precondition:void 0})}}class NUt extends EI{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(hm(vh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class PUt extends EI{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordAccessibility,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(hm(vh.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class vce extends hc{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Vs);if(!t.hasModel())return;const o=hm(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=n.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 Zl(p,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class YMe extends vce{_delete(e,t){const i=hs.deleteWordLeft(e,t);return i||new F(1,1,1,1)}}class JMe extends vce{_delete(e,t){const i=hs.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new F(n,o,n,o)}}class FUt extends YMe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordStart,id:"deleteWordStartLeft",precondition:J.writable})}}class OUt extends YMe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordEnd,id:"deleteWordEndLeft",precondition:J.writable})}}class BUt extends YMe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordStart,id:"deleteWordLeft",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Backspace,mac:{primary:U.Alt|S.Backspace},weight:Ae.EditorContrib}})}}class WUt extends JMe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordStart,id:"deleteWordStartRight",precondition:J.writable})}}class HUt extends JMe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:gs.WordEnd,id:"deleteWordEndRight",precondition:J.writable})}}class UUt extends JMe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordEnd,id:"deleteWordRight",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:U.CtrlCmd|S.Delete,mac:{primary:U.Alt|S.Delete},weight:Ae.EditorContrib}})}}class VUt extends tt{constructor(){super({id:"deleteInsideWord",precondition:J.writable,label:g(1608,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=hm(t.getOption(x.wordSeparators),t.getOption(x.wordSegmenterLocales)),o=t.getModel(),a=t.getSelections().map(c=>{const l=hs.deleteInsideWord(n,o,c);return new Zl(l,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}qe(new wUt);qe(new yUt);qe(new CUt);qe(new SUt);qe(new AUt);qe(new EUt);qe(new kUt);qe(new IUt);qe(new TUt);qe(new LUt);qe(new RUt);qe(new MUt);qe(new xUt);qe(new DUt);qe(new NUt);qe(new PUt);qe(new FUt);qe(new OUt);qe(new BUt);qe(new WUt);qe(new HUt);qe(new UUt);Me(VUt);class zUt extends vce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordStart,id:"deleteWordPartLeft",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.Backspace},weight:Ae.EditorContrib}})}_delete(e,t){const i=Qre.deleteWordPartLeft(e);return i||new F(1,1,1,1)}}class $Ut extends vce{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:gs.WordEnd,id:"deleteWordPartRight",precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.Delete},weight:Ae.EditorContrib}})}_delete(e,t){const i=Qre.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new F(n,o,n,o)}}class qet extends _ce{_move(e,t,i,n,o){return Qre.moveWordPartLeft(e,t,i,o)}}class GUt extends qet{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordStart,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.LeftArrow},weight:Ae.EditorContrib}})}}_t.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class KUt extends qet{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordStart,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|U.Shift|S.LeftArrow},weight:Ae.EditorContrib}})}}_t.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Qet extends _ce{_move(e,t,i,n,o){return Qre.moveWordPartRight(e,t,i)}}class qUt extends Qet{constructor(){super({inSelectionMode:!1,wordNavigationType:gs.WordEnd,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|S.RightArrow},weight:Ae.EditorContrib}})}}class QUt extends Qet{constructor(){super({inSelectionMode:!0,wordNavigationType:gs.WordEnd,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:U.WinCtrl|U.Alt|U.Shift|S.RightArrow},weight:Ae.EditorContrib}})}}qe(new zUt);qe(new $Ut);qe(new GUt);qe(new KUt);qe(new qUt);qe(new QUt);const YPe=class YPe extends V{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Ih.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(x.readOnlyMessage);t||(this.editor.isSimpleWidget?t=new Mt(g(1606,"Cannot edit in read-only input")):t=new Mt(g(1607,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};YPe.ID="editor.contrib.readOnlyMessageController";let oZ=YPe;on(oZ.ID,oZ,ri.BeforeFirstInteraction);let Oye=class extends V{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=jt(this,void 0);const n=ed("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=ed("_textModel.onDidChangeContent",M.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(au(async(r,a)=>{n.read(r),o.read(r);const c=a.add(new Kkt),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 n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(p6e(Cc(o=>o.range.endLineNumber-o.range.startLineNumber,iu))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};Oye=D([_(1,it),_(2,X6)],Oye);EJ.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(Oye,s));var jUt='.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}';ut(jUt,{});const JPe=class JPe extends V{constructor(e){super(),this.editor=e,this.widget=null,am&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(x.readOnly);!this.widget&&e?this.widget=new Bye(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};JPe.ID="editor.contrib.iPadShowKeyboard";let rZ=JPe;const uoe=class uoe extends V{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ue(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ue(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return uoe.ID}getDomNode(){return this._domNode}getPosition(){return{preference:Fg.BOTTOM_RIGHT_CORNER}}};uoe.ID="editor.contrib.ShowKeyboardWidget";let Bye=uoe;on(rZ.ID,rZ,ri.Eventually);function Wye(s){return!!s.workspaceUri}function pQ(s){return!!s.folderUri}function YUt(s){return!!s.fileUri}function JUt(s){const e=XUt(s),t=s.getValue("window.menuBarVisibility");return t==="default"||e&&t==="compact"||Qt&&od?"classic":t}var GUe;(function(s){s.TITLE_BAR_STYLE="window.titleBarStyle",s.CUSTOM_TITLE_BAR_VISIBILITY="window.customTitleBarVisibility"})(GUe||(GUe={}));var kw;(function(s){s.NATIVE="native",s.CUSTOM="custom"})(kw||(kw={}));var KUe;(function(s){s.AUTO="auto",s.WINDOWED="windowed",s.NEVER="never"})(KUe||(KUe={}));function XUt(s,e){return e||(e=XMe(s)),e===kw.NATIVE}function XMe(s){if(Wn)return kw.CUSTOM;const e=s.getValue("window");if(e){if(Qt&&e.nativeTabs===!0||Qt&&e.nativeFullScreen===!1)return kw.NATIVE;const n=e.titleBarStyle;if(n===kw.NATIVE||n===kw.CUSTOM)return n}return pr?kw.NATIVE:kw.CUSTOM}function ZMe(s){return{id:jet(s),configPath:s}}function ZUt(s){return{id:jet(s),uri:s}}function jet(s){return Wc(s.toString()).toString(16)}const Hye=60,Uye=Hye*60,h9=Uye*24,qUe=h9*7,QUe=h9*30,jUe=h9*365;function eNe(s,e,t,i){typeof s!="number"&&(s=s.getTime());const n=Math.round((new Date().getTime()-s)/1e3);if(n<-30)return g(793,"in {0}",eNe(new Date().getTime()+n*1e3,!1));if(n<30)return g(794,"now");let o;return n{await Promise.all(rtt.map(t=>t(e)))}),await s.invokeFunction(async e=>{hje((t,i)=>s.createInstance(CM,t,i,{})),kje(e.get(ec))}),await s.invokeFunction(async e=>{const t=e.get(Zu);await Promise.all(att.map(i=>i(e))),t.phase=2}),await s.invokeFunction(async e=>{await Promise.all(ctt.map(t=>t(e)))}),iNe.open(),ott.fire(),s.invokeFunction(async e=>{const t=e.get(Zu);Qe.as(of.Workbench).start(e),Qe.as(Xy.EditorFactory).start(e),itt.fire(e),ntt.fire(e),await Promise.race([e.get(CI).whenRestored,Sr(2e3)]),t.phase=3,new cn(()=>{xO(window,()=>{t.phase=4},2500)},2500).schedule()})}let ltt=!1;Dt.withServices(()=>(ltt=!0,V.None));async function dtt(){await iNe.wait()}function htt(){if(ltt)throw new Error("Services are already initialized")}const utt="inQuickOpen",c4t=new Y(utt,!1,g(4610,"Whether keyboard focus is inside the quick open control")),gC=he.has(utt),l4t="inFilesPicker",gtt=he.and(gC,he.has(l4t));function bce(s,e){return t=>{const i=t.get(Ut),n=t.get(In),r={keybindings:i.lookupKeybindings(s)};n.navigate(!!e,r)}}let YUe=class extends V{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:Bgt(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()}};YUe=D([_(0,ei),_(1,Po)],YUe);let Vye=class extends mJ{constructor(e,t,i,n,o,r){super(t,n,o,r,e),this.keybindingService=i,this.inQuickInputContext=c4t.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})}};Vye=D([_(0,Te),_(1,we),_(2,Ut),_(3,Le),_(4,pn),_(5,fu)],Vye);function d4t(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class $5{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=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,n);l>0&&o.push({key:r,score:l})}}return o}static termFrequencies(e){return d4t($5.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 n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const o of n)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 n of t.textChunks){const o=$5.termFrequencies(n);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,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 n of i.tf.keys()){const o=this.chunkOccurrences.get(n);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=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;n+=l*r}return n}computeEmbedding(e){const t=$5.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,n]of e){const o=this.computeIdf(i);o>0&&(t[i]=n*o)}return t}}function h4t(s){const e=s.slice(0);e.sort((i,n)=>n.score-i.score);const t=e[0]?.score??0;if(t>0)for(const i of e)i.score/=t;return e}var kS;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(kS||(kS={}));function iue(s){const e=s;return Array.isArray(e.items)}function JUe(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class sNe extends V{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new wn),a=async()=>{const l=r.value=new Z;o?.dispose(!0),e.busy=!1,o=new ci(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 b,w;if(iue(m)?(b=m.items,w=m.active):b=m,b.length===0){if(v)return!1;(h.length>0||e.hideInput)&&this.options?.noResultsPick&&(v2(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,w&&(e.activeItems=[w]),!0},p=async m=>{let v=!1,b=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Sr(m.mergeDelay),d.isCancellationRequested)||b||(v=f(m.picks,!0))})(),(async()=>{e.busy=!0;try{const w=await m.additionalPicks;if(d.isCancellationRequested)return;let y,C;iue(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let A,L;if(iue(w)?(A=w.items,L=w.active):A=w,A.length>0||!v){let k;if(!C&&!L){const P=e.activeItems[0];P&&y.indexOf(P)!==-1&&(k=P)}f({items:[...y,...A],active:C||L||k})}}finally{d.isCancellationRequested||(e.busy=!1),b=!0}})()])};if(u!==null)if(JUe(u))await p(u);else if(!(u instanceof Promise))f(u);else{e.busy=!0;try{const m=await u;if(d.isCancellationRequested)return;JUe(m)?await p(m):f(m)}finally{d.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.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 kS.NO_ACTION:break;case kS.CLOSE_PICKER:e.hide();break;case kS.REFRESH_PICKER:a();break;case kS.REMOVE_ITEM:{const p=e.items.indexOf(d);if(p!==-1){const m=e.items.slice(),v=m.splice(p,1),b=e.activeItems.filter(y=>y!==v[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=m,b&&(e.activeItems=b),e.keepScrollPosition=w}break}}}};return n.add(e.onDidTriggerItemButton(({button:l,item:d})=>c(l,d))),n.add(e.onDidTriggerSeparatorButton(({button:l,separator:d})=>c(l,d))),n}}var c0,na,ey;let zye=(ey=class extends sNe{constructor(e,t,i,n,o,r){super(c0.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(u9)),this.options=e}async _getPicks(e,t,i,n){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=cm(()=>{const f=new $5;f.updateDocuments(o.map(m=>({key:m.commandId,textChunks:[this.getTfIdfChunk(m)]})));const p=f.calculateScores(e,i);return h4t(p).filter(m=>m.score>c0.TFIDF_THRESHOLD).slice(0,c0.TFIDF_MAX_RESULTS)}),a=[];for(const f of o){const p=c0.WORD_FILTER(e,f.label)??void 0,m=f.commandAlias?c0.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 b=v.find(w=>w.key===f.commandId);b&&(f.tfIdfScore=b.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 b=this.options.suggestedCommandIds.has(f.commandId),w=this.options.suggestedCommandIds.has(p.commandId);if(b&&w)return 0;if(b)return-1;if(w)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,n));return h&&p[0]?.type!=="separator"&&p.unshift({type:"separator",label:g(4612,"similar commands")}),p})()}:l}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?g(4615,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,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){Fr(o)||this.dialogService.error(g(4616,"Command '{0}' resulted in an error",e.label),Nr(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},c0=ey,ey.PREFIX=">",ey.TFIDF_THRESHOLD=.5,ey.TFIDF_MAX_RESULTS=5,ey.WORD_FILTER=z2(vM,DE,oae),ey);zye=c0=D([_(1,we),_(2,Ut),_(3,vi),_(4,Yi),_(5,to)],zye);var Yv;let u9=(Yv=class extends V{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===_y.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=na.getConfiguredCommandHistoryLength(this.configurationService),na.cache&&na.cache.limit!==this.configuredCommandsHistoryLength&&(na.cache.limit=this.configuredCommandsHistoryLength,na.hasChanges=!0))}load(){const e=this.storageService.get(na.PREF_KEY_CACHE,Ie.PROFILE);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=na.cache=new lm(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}na.counter=this.storageService.getNumber(na.PREF_KEY_COUNTER,Ie.PROFILE,na.counter)}push(e){na.cache&&(na.cache.set(e,na.counter++),na.hasChanges=!0)}peek(e){return na.cache?.peek(e)}saveState(){if(!na.cache||!na.hasChanges)return;const e={usesLRU:!0,entries:[]};na.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(na.PREF_KEY_CACHE,JSON.stringify(e),Ie.PROFILE,an.USER),this.storageService.store(na.PREF_KEY_COUNTER,na.counter,Ie.PROFILE,an.USER),na.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const i=e.getValue().workbench?.commandPalette?.history;return typeof i=="number"?i:na.DEFAULT_COMMANDS_HISTORY_LENGTH}static clearHistory(e,t){const i=na.getConfiguredCommandHistoryLength(e);na.cache=new lm(i),na.counter=1,na.hasChanges=!0}},na=Yv,Yv.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Yv.PREF_KEY_CACHE="commandPalette.mru.cache",Yv.PREF_KEY_COUNTER="commandPalette.mru.counter",Yv.counter=1,Yv.hasChanges=!1,Yv);u9=na=D([_(0,$i),_(1,Te),_(2,Ge)],u9);class u4t extends zye{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let n;i.metadata?.description&&(MLe(i.metadata.description)?n=i.metadata.description:n={original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:n,label:rae(i.label)||i.id})}return t}}class Nb extends jYe{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 Ei.Readonly}hasCapability(e){return e===Ei.None?this.capabilities===Ei.None:(this.capabilities&e)!==0}isReadonly(){return this.hasCapability(Ei.Readonly)}getName(){return`Editor ${this.typeId}`}getDescription(e){}getTitle(e){return this.getName()}getLabelExtraClasses(){return[]}getAriaLabel(){return this.getTitle(Ls.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(wa(e))return this===e;const t=e.options?.override;return this.editorId!==t&&t!==void 0&&this.editorId!==void 0?!1:ji(this.resource,Na.getCanonicalUri(e))}prefersEditorPane(e){return rm(e)}toUntyped(e){}isDisposed(){return this._store.isDisposed}dispose(){this.isDisposed()||this._onWillDispose.fire(),super.dispose()}}class g4t{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 f4t extends V{constructor(e){super(),this.counter=0,this.logger=e.createLogger("network",{name:g(4590,"Network Requests"),when:gyt.isEqualTo(n3(Gn.Trace)).serialize()})}async logAndRequest(e,t,i){const n=`${e} #${++this.counter}: ${t.url}`;this.logger.trace(`${n} - begin`,t.type,new g4t(t.headers??{}));try{const o=await i();return this.logger.trace(`${n} - end`,t.type,o.res.statusCode,o.res.headers),o}catch(o){throw this.logger.error(`${n} - error`,t.type,nu(o)),o}}}function ftt(s){return s.res.statusCode&&s.res.statusCode>=200&&s.res.statusCode<300||s.res.statusCode===1223}function ptt(s){return s.res.statusCode===204}async function p4t(s){return ptt(s)?null:(await Jx(s.stream)).toString()}async function m4t(s){if(!ftt(s))throw new Error("Server returned "+s.res.statusCode);return p4t(s)}async function _4t(s){if(!ftt(s))throw new Error("Server returned "+s.res.statusCode);if(ptt(s))return null;const t=(await Jx(s.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`: +`+t,i}}let nue;function v4t(s){const e=Qe.as(Nn.Configuration),t=nue;nue={id:"http",order:15,title:g(4591,"HTTP"),type:"object",scope:s,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:g(4592,"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(4593,"Controls whether the proxy server certificate should be verified against the list of supplied CAs."),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:g(4594,"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.noProxy":{type:"array",items:{type:"string"},markdownDescription:g(4595,"Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests."),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:g(4596,"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(4597,"Disable proxy support for extensions."),g(4598,"Enable proxy support for extensions."),g(4599,"Enable proxy support for extensions, fall back to request options, when no proxy found."),g(4600,"Enable proxy support for extensions, override request options.")],default:"override",description:g(4601,"Use the proxy support for extensions."),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:g(4602,"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(4603,"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:[nue],remove:t?[t]:[]})}v4t(at.APPLICATION);var vV,Ir;(function(s){s.Panel="panel",s.Terminal="terminal",s.Notebook="notebook",s.Editor="editor"})(Ir||(Ir={}));(function(s){function e(t){switch(t){case"panel":return s.Panel;case"terminal":return s.Terminal;case"notebook":return s.Notebook;case"editor":return s.Editor}return s.Panel}s.fromRaw=e})(Ir||(Ir={}));var WB;let XUe=(WB=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=VXe.bindTo(this.contextKeyService)}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const n=this,o=t.slashCommands;t={...t,get slashCommands(){return o.filter(a=>!a.when||n.contextKeyService.contextMatchesRules(he.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 xK(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 xK(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 xK(i.data,i.impl))}getDefaultAgent(e){return bk(this.getActivatedAgents(),t=>!!t.isDefault&&t.locations.includes(e))}getContributedDefaultAgent(e){return this.getAgents().find(t=>!!t.isDefault&&t.locations.includes(e))}getSecondaryAgent(){return hi.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(he.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=hi.find(this._agents.values(),i=>wce(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 xK(e.data,e.impl))}getAgentsByName(e){return this.getAgents().filter(t=>t.name===e)}agentHasDupeName(e){const t=this.getAgent(e);return t?this.getAgentsByName(t.name).filter(i=>i.extensionId.value!==t.extensionId.value).length>0:!1}async invokeAgent(e,t,i,n,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,n,o)}async getFollowups(e,t,i,n,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,n,o):[]}},WB.AGENT_LEADER="@",WB);XUe=D([_(0,Le)],XUe);class xK{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 locations(){return this.data.locations}async invoke(e,t,i,n){return this.impl.invoke(e,t,i,n)}async provideFollowups(e,t,i,n){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,n):[]}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 iR;let ZUe=(iR=class{constructor(e,t,i,n){if(this.requestService=t,this.logService=i,this.storageService=n,this.registry=jt(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const o=n.get(vV.StorageKey,Ie.APPLICATION);try{this.registry.set(JSON.parse(o??"{}"),void 0)}catch{n.remove(vV.StorageKey,Ie.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>Sr(5*60*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},He.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await _4t(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(vV.StorageKey,JSON.stringify(i),Ie.APPLICATION,an.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(n=>n[e.toLowerCase()]).map(n=>n?n.some(o=>ua(o,o.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},vV=iR,iR.StorageKey="chat.participantNameRegistry",iR);ZUe=vV=D([_(0,Er),_(1,E6),_(2,Ge),_(3,$i)],ZUe);function wce(s){return`${s.extensionId.value}.${s.id}`}function mtt(s){const e="name"in s?s:{...s,name:s.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new Sn("")),Mo(e)}var yC;const b4t=oi("chat-editor-label-icon",ve.commentDiscussion,g(7137,"Icon of the chat editor label."));var HS;let $ye=(HS=class extends Nb{static getNewEditorUri(){const e=Math.floor(Math.random()*1e9);return aZ.generate(e)}static getNextCount(){let e=0;for(;yC.countsInUse.has(e);)e++;return e}constructor(e,t,i){if(super(),this.resource=e,this.options=t,this.chatService=i,typeof aZ.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=yC.getNextCount(),yC.countsInUse.add(this.inputCount),this._register(Ee(()=>yC.countsInUse.delete(this.inputCount)))}get editorId(){return yC.EditorID}get capabilities(){return super.capabilities|Ei.Singleton}matches(e){return e instanceof yC&&e.resource.toString()===this.resource.toString()}get typeId(){return yC.TypeID}getName(){return this.model?.title||g(7138,"Chat")+(this.inputCount>0?` ${this.inputCount+1}`:"")}getIcon(){return b4t}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(Ir.Panel,He.None),this.model?(this.sessionId=this.model.sessionId,this._register(this.model.onDidChange(()=>this._onDidChangeLabel.fire())),this._register(new w4t(this.model))):null}dispose(){super.dispose(),this.sessionId&&this.chatService.clearSession(this.sessionId)}},yC=HS,HS.countsInUse=new Set,HS.TypeID="workbench.input.chatSession",HS.EditorID="workbench.editor.chatSession",HS);$ye=yC=D([_(2,Em)],$ye);class w4t extends V{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 aZ;(function(s){s.scheme=pe.vscodeChatSesssion;function e(i){return N.from({scheme:s.scheme,path:`chat-${i}`})}s.generate=e;function t(i){if(i.scheme!==s.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}}s.parse=t})(aZ||(aZ={}));const y4t="copilot";async function C4t(s){return(await s.openView(A4t))?.widget}const S4t=g(7002,"Generating"),A4t=`workbench.panel.chat.view.${y4t}`,goe=class goe{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=goe.Kind}get promptText(){return this.text}};goe.Kind="text";let ob=goe;const oNe="#",zU="@",Xk="/",foe=class foe{constructor(e,t,i,n,o){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=n,this.variableId=o,this.kind=foe.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${oNe}${this.variableName}${e}`}get promptText(){return this.text}};foe.Kind="var";let g9=foe;const poe=class poe{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=poe.Kind}get text(){return`${zU}${this.agent.name}`}get promptText(){return""}};poe.Kind="agent";let Ug=poe;const moe=class moe{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=moe.Kind}get text(){return`${Xk}${this.command.name}`}get promptText(){return""}};moe.Kind="subcommand";let qM=moe;const _oe=class _oe{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=_oe.Kind}get text(){return`${Xk}${this.slashCommand.command}`}get promptText(){return`${Xk}${this.slashCommand.command}`}};_oe.Kind="slash";let RW=_oe;const voe=class voe{constructor(e,t,i,n,o,r){this.range=e,this.editorRange=t,this.text=i,this.id=n,this.modelDescription=o,this.data=r,this.kind=voe.Kind}get referenceText(){return this.text.replace(oNe,"")}get promptText(){return this.text}};voe.Kind="dynamic";let MW=voe;function E4t(s){return{text:s.text,parts:s.parts.map(e=>{if(e.kind===ob.Kind)return new ob(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===g9.Kind)return new g9(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableName||"");if(e.kind===Ug.Kind){let t=e.agent;return t=mtt(t),new Ug(new mi(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===qM.Kind)return new qM(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===RW.Kind)return new RW(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===MW.Kind)return new MW(new mi(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,Mo(e.data));throw new Error(`Unknown chat request part: ${e.kind}`)}})}}function x4t(s){const e=s.parts.find(i=>i instanceof Ug),t=s.parts.find(i=>i instanceof qM);return{agentPart:e,commandPart:t}}function D4t(s){return!!s&&typeof s=="object"&&"uri"in s&&s.uri instanceof N&&"version"in s&&typeof s.version=="number"&&"ranges"in s&&Array.isArray(s.ranges)&&s.ranges.every(F.isIRange)}function k4t(s){return!!s&&typeof s=="object"&&"documents"in s&&Array.isArray(s.documents)&&s.documents.every(D4t)}var NW;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(NW||(NW={}));var PW;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(PW||(PW={}));var e4e;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(e4e||(e4e={}));var Gye,Kye;const boe=class boe{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}get locationData(){return this._locationData}constructor(e,t,i,n=0,o){this._session=e,this.message=t,this._variableData=i,this._attempt=n,this._locationData=o,this.id="request_"+boe.nextId++}adoptTo(e){this._session=e}};boe.nextId=0;let cZ=boe,I4t=class{get onDidChangeValue(){return this._onDidChangeValue.event}get value(){return this._responseParts}constructor(e){this._onDidChangeValue=new I,this._responseRepr="",this._markdownContent="",this._citations=[],this._responseParts=O_(e).map(t=>cd(t)?{content:t,kind:"markdownContent"}:"kind"in t?t:{kind:"treeData",treeData:t}),this._updateRepr(!0)}toString(){return this._responseRepr}toMarkdown(){return this._markdownContent}clear(){this._responseParts=[],this._updateRepr(!0)}updateContent(e,t){if(e.kind==="markdownContent"){const i=this._responseParts.length-1,n=this._responseParts[i];!n||n.kind!=="markdownContent"||!_tt(n.content,e.content)?this._responseParts.push(e):n.content=mQ(n.content,e.content),this._updateRepr(t)}else if(e.kind==="textEdit"){if(e.edits.length>0){let i=!1;for(let n=0;!i&&n{this._updateRepr(!1)});e.task?.().then(o=>{n.dispose(),typeof o=="string"&&(this._responseParts[i].content=new Mt(o)),this._updateRepr(!1)})}else this._responseParts.push(e),this._updateRepr(t)}addCitation(e){this._citations.push(e),this._updateRepr()}_updateRepr(e){this._responseRepr=this._responseParts.map(t=>t.kind==="treeData"?"":t.kind==="inlineReference"?_i("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="command"?t.command.title:t.kind==="textEditGroup"?g(7038,"Made changes."):t.kind==="progressMessage"?"":t.kind==="confirmation"?`${t.title} ${t.message}`:t.content.value).filter(t=>t.length>0).join(` `),this._responseRepr+=this._citations.length?` -`+xtt(this._citations):"",this._markdownContent=this._responseParts.map(t=>t.kind==="inlineReference"?_i("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="markdownContent"||t.kind==="markdownVuln"?t.content.value:"").filter(t=>t.length>0).join(` +`+vtt(this._citations):"",this._markdownContent=this._responseParts.map(t=>t.kind==="inlineReference"?_i("uri"in t.inlineReference?t.inlineReference.uri:t.inlineReference):t.kind==="markdownContent"||t.kind==="markdownVuln"?t.content.value:"").filter(t=>t.length>0).join(` -`),e||this._onDidChangeValue.fire()}};const Aoe=class Aoe extends V{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 codeCitations(){return this._codeCitations}get progressMessages(){return this._progressMessages}get isStale(){return this._isStale}constructor(e,t,i,n,o,r=!1,a=!1,c,l,d){super(),this._session=t,this._agent=i,this._slashCommand=n,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._codeCitations=[],this._progressMessages=[],this._isStale=!1,this._isStale=Array.isArray(e)&&(e.length!==0||dd(e)&&e.value.length!==0),this._followups=d?[...d]:void 0,this._response=new H4t(e),this._register(this._response.onDidChangeValue(()=>this._onDidChange.fire())),this.id="response_"+Aoe.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())}applyCodeCitation(e){this._codeCitations.push(e),this._response.addCitation(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()}};Aoe.nextId=0;let wF=Aoe;function U4t(s){const e=s;return typeof e=="object"&&typeof e.requesterUsername=="string"}function hue(s){const e=s;return U4t(s)&&typeof e.creationDate=="number"&&typeof e.sessionId=="string"&&s.requests.every(t=>!t.usedContext||W4t(t.usedContext))}var _9;(function(s){s[s.Removal=0]="Removal",s[s.Resend=1]="Resend",s[s.Adoption=2]="Adoption"})(_9||(_9={}));var Lg;(function(s){s[s.Created=0]="Created",s[s.Initializing=1]="Initializing",s[s.Initialized=2]="Initialized"})(Lg||(Lg={}));let hZ=Jye=class extends V{static getDefaultTitle(e){const t=lm(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(Ir.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 Jye.getDefaultTitle(this._requests)}get initialLocation(){return this._initialLocation}constructor(e,t,i,n,o){super(),this.initialData=e,this._initialLocation=t,this.logService=i,this.chatAgentService=n,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=Lg.Created,this._isInitializedDeferred=new dc,this._isImported=!1,this._isImported=!!e&&!hue(e)||(e?.isImported??!1),this._sessionId=hue(e)&&e.sessionId||ar(),this._requests=e?this._deserialize(e):[],this._creationDate=hue(e)&&e.creationDate||Date.now(),this._initialRequesterAvatarIconUri=e?.requesterAvatarIconUri&&N.revive(e.requesterAvatarIconUri),this._initialResponderAvatarIconUri=lfe(e?.responderAvatarIconUri)?N.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(n=>typeof n=="string"?new Mt(n):n);this._welcomeMessage=this.instantiationService.createInstance(Zye,i,[])}try{return t.map(i=>{const n=typeof i.message=="string"?this.getParsedRequestFromString(i.message):F4t(i.message),o=this.reviveVariableData(i.variableData),r=new dZ(this,n,o);if(i.response||i.result||i.responseErrorDetails){const a=i.agent&&"metadata"in i.agent?Att(i.agent):void 0,c="responseErrorDetails"in i?{errorDetails:i.responseErrorDetails}:i.result;r.response=new wF(i.response??[new Mt(i.response)],this,a,i.slashCommand,r.id,!0,i.isCanceled,i.vote,c,i.followups),i.usedContext&&r.response.applyReference(Mo(i.usedContext)),i.contentReferences?.forEach(l=>r.response.applyReference(Mo(l))),i.codeCitations?.forEach(l=>r.response.applyCodeCitation(Mo(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=>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 cb(new mi(0,e.length),{startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1},e)];return{text:e,parts:t}}startInitialize(){if(this.initState!==Lg.Created)throw new Error(`ChatModel is in the wrong state for startInitialize: ${Lg[this.initState]}`);this._initState=Lg.Initializing}deinitialize(){this._initState=Lg.Created,this._isInitializedDeferred=new dc}initialize(e){if(this.initState!==Lg.Initializing)throw new Error(`ChatModel is in the wrong state for initialize: ${Lg[this.initState]}`);this._initState=Lg.Initialized,this._welcomeMessage||(this._welcomeMessage=e),this._isInitializedDeferred.complete(),this._onDidChange.fire({kind:"initialize"})}setInitializationError(e){if(this.initState!==Lg.Initializing)throw new Error(`ChatModel is in the wrong state for setInitializationError: ${Lg[this.initState]}`);this._isInitializedDeferred.isSettled||this._isInitializedDeferred.error(e)}waitForInitialization(){return this._isInitializedDeferred.p}getRequests(){return this._requests}addRequest(e,t,i,n,o,r){const a=new dZ(this,e,t,i,r);return a.response=new wF([],this,n,o,a.id),this._requests.push(a),this._onDidChange.fire({kind:"addRequest",request:a}),a}updateRequest(e,t){e.variableData=t,this._onDidChange.fire({kind:"changedRequest",request:e})}adoptRequest(e){const t=e.session,i=t._requests.findIndex(n=>n.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:_9.Adoption}),this._onDidChange.fire({kind:"addRequest",request:e}))}acceptResponseProgress(e,t,i){if(e.response||(e.response=new wF([],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 n=this.chatAgentService.getAgent(t.agentId);n&&(e.response.setAgent(n,t.command),this._onDidChange.fire({kind:"setAgent",agent:n,command:t.command}))}else t.kind==="codeCitation"?e.response.applyCodeCitation(t):this.logService.error(`Couldn't handle progress: ${JSON.stringify(t)}`)}removeRequest(e,t=_9.Removal){const i=this._requests.findIndex(o=>o.id===e),n=this._requests[i];i!==-1&&(this._onDidChange.fire({kind:"removeRequest",requestId:n.id,responseId:n.response?.id,reason:t}),this._requests.splice(i,1),n.response?.dispose())}cancelRequest(e){e.response&&e.response.cancel()}setResponse(e,t){e.response||(e.response=new wF([],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,codeCitations:e.response?.codeCitations}))}}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()}};hZ=Jye=D([_(2,Ge),_(3,_f),_(4,we)],hZ);var aR;let Zye=(aR=class{get id(){return this._id}constructor(e,t,i){this.content=e,this.sampleQuestions=t,this.chatAgentService=i,this._id="welcome_"+Xye.nextId++}get username(){return this.chatAgentService.getContributedDefaultAgent(Ir.Panel)?.fullName??""}get avatarIcon(){return this.chatAgentService.getDefaultAgent(Ir.Panel)?.metadata.themeIcon}},Xye=aR,aR.nextId=0,aR);Zye=Xye=D([_(2,_f)],Zye);function Ett(s,e){if(s.baseUri&&e.baseUri){if(!(s.baseUri.scheme===e.baseUri.scheme&&s.baseUri.authority===e.baseUri.authority&&s.baseUri.path===e.baseUri.path&&s.baseUri.query===e.baseUri.query&&s.baseUri.fragment===e.baseUri.fragment))return!1}else if(s.baseUri||e.baseUri)return!1;return Ys(s.isTrusted,e.isTrusted)&&s.supportHtml===e.supportHtml&&s.supportThemeIcons===e.supportThemeIcons}function vQ(s,e){const t=typeof e=="string"?e:e.value;return{value:s.value+t,isTrusted:s.isTrusted,supportThemeIcons:s.supportThemeIcons,supportHtml:s.supportHtml,baseUri:s.baseUri}}function xtt(s){if(s.length===0)return"";const e=s.reduce((i,n)=>i.add(n.license),new Set);return e.size===1?g(7039,"Similar code found with 1 license type",e.size):g(7040,"Similar code found with {0} license types",e.size)}const Dtt="http://_vscodecontentref_";function g4e(s){const e=[];for(const t of s){const i=e[e.length-1];if(t.kind==="inlineReference"){const n="uri"in t.inlineReference?t.inlineReference:{uri:t.inlineReference},o=N.parse(Dtt).with({fragment:JSON.stringify(n)}),r=`[${t.name||_i(n.uri)}](${o.toString()})`;if(i?.kind==="markdownContent"){const a=vQ(i.content,new Mt(r));e[e.length-1]={content:a,kind:"markdownContent"}}else e.push({content:new Mt(r),kind:"markdownContent"})}else if(t.kind==="markdownContent"&&i?.kind==="markdownContent"&&Ett(i.content,t.content)){const n=vQ(i.content,t.content);e[e.length-1]={content:n,kind:"markdownContent"}}else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;if(i?.kind==="markdownContent"){const r=vQ(i.content,new Mt(o));e[e.length-1]={content:r,kind:"markdownContent"}}else e.push({content:new Mt(o),kind:"markdownContent"})}else e.push(t)}return e}function V4t(s){const e=[];for(const t of s){const i=e[e.length-1];if(t.kind==="markdownContent")i?.kind==="markdownContent"?e[e.length-1]={content:new Mt(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 Mt(i.content.value+o,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push({content:new Mt(o),kind:"markdownContent"})}}return e}function z4t(s){const e=[];let t=s,i;for(;(i=/(.*?)<\/vscode_annotation>/ms.exec(t))!==null;){const[n,o,r]=i,a=i.index,c=t.substring(0,a),l=c.split(` +`),e||this._onDidChangeValue.fire()}};const woe=class woe extends V{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 codeCitations(){return this._codeCitations}get progressMessages(){return this._progressMessages}get isStale(){return this._isStale}constructor(e,t,i,n,o,r=!1,a=!1,c,l,d){super(),this._session=t,this._agent=i,this._slashCommand=n,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._codeCitations=[],this._progressMessages=[],this._isStale=!1,this._isStale=Array.isArray(e)&&(e.length!==0||cd(e)&&e.value.length!==0),this._followups=d?[...d]:void 0,this._response=new I4t(e),this._register(this._response.onDidChangeValue(()=>this._onDidChange.fire())),this.id="response_"+woe.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())}applyCodeCitation(e){this._codeCitations.push(e),this._response.addCitation(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()}};woe.nextId=0;let mF=woe;function T4t(s){const e=s;return typeof e=="object"&&typeof e.requesterUsername=="string"}function sue(s){const e=s;return T4t(s)&&typeof e.creationDate=="number"&&typeof e.sessionId=="string"&&s.requests.every(t=>!t.usedContext||k4t(t.usedContext))}var f9;(function(s){s[s.Removal=0]="Removal",s[s.Resend=1]="Resend",s[s.Adoption=2]="Adoption"})(f9||(f9={}));var kg;(function(s){s[s.Created=0]="Created",s[s.Initializing=1]="Initializing",s[s.Initialized=2]="Initialized"})(kg||(kg={}));let lZ=Gye=class extends V{static getDefaultTitle(e){const t=rm(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(Ir.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 Gye.getDefaultTitle(this._requests)}get initialLocation(){return this._initialLocation}constructor(e,t,i,n,o){super(),this.initialData=e,this._initialLocation=t,this.logService=i,this.chatAgentService=n,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=kg.Created,this._isInitializedDeferred=new dc,this._isImported=!1,this._isImported=!!e&&!sue(e)||(e?.isImported??!1),this._sessionId=sue(e)&&e.sessionId||ar(),this._requests=e?this._deserialize(e):[],this._creationDate=sue(e)&&e.creationDate||Date.now(),this._initialRequesterAvatarIconUri=e?.requesterAvatarIconUri&&N.revive(e.requesterAvatarIconUri),this._initialResponderAvatarIconUri=nfe(e?.responderAvatarIconUri)?N.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(n=>typeof n=="string"?new Mt(n):n);this._welcomeMessage=this.instantiationService.createInstance(qye,i,[])}try{return t.map(i=>{const n=typeof i.message=="string"?this.getParsedRequestFromString(i.message):E4t(i.message),o=this.reviveVariableData(i.variableData),r=new cZ(this,n,o);if(i.response||i.result||i.responseErrorDetails){const a=i.agent&&"metadata"in i.agent?mtt(i.agent):void 0,c="responseErrorDetails"in i?{errorDetails:i.responseErrorDetails}:i.result;r.response=new mF(i.response??[new Mt(i.response)],this,a,i.slashCommand,r.id,!0,i.isCanceled,i.vote,c,i.followups),i.usedContext&&r.response.applyReference(Mo(i.usedContext)),i.contentReferences?.forEach(l=>r.response.applyReference(Mo(l))),i.codeCitations?.forEach(l=>r.response.applyCodeCitation(Mo(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=>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 ob(new mi(0,e.length),{startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1},e)];return{text:e,parts:t}}startInitialize(){if(this.initState!==kg.Created)throw new Error(`ChatModel is in the wrong state for startInitialize: ${kg[this.initState]}`);this._initState=kg.Initializing}deinitialize(){this._initState=kg.Created,this._isInitializedDeferred=new dc}initialize(e){if(this.initState!==kg.Initializing)throw new Error(`ChatModel is in the wrong state for initialize: ${kg[this.initState]}`);this._initState=kg.Initialized,this._welcomeMessage||(this._welcomeMessage=e),this._isInitializedDeferred.complete(),this._onDidChange.fire({kind:"initialize"})}setInitializationError(e){if(this.initState!==kg.Initializing)throw new Error(`ChatModel is in the wrong state for setInitializationError: ${kg[this.initState]}`);this._isInitializedDeferred.isSettled||this._isInitializedDeferred.error(e)}waitForInitialization(){return this._isInitializedDeferred.p}getRequests(){return this._requests}addRequest(e,t,i,n,o,r){const a=new cZ(this,e,t,i,r);return a.response=new mF([],this,n,o,a.id),this._requests.push(a),this._onDidChange.fire({kind:"addRequest",request:a}),a}updateRequest(e,t){e.variableData=t,this._onDidChange.fire({kind:"changedRequest",request:e})}adoptRequest(e){const t=e.session,i=t._requests.findIndex(n=>n.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:f9.Adoption}),this._onDidChange.fire({kind:"addRequest",request:e}))}acceptResponseProgress(e,t,i){if(e.response||(e.response=new mF([],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 n=this.chatAgentService.getAgent(t.agentId);n&&(e.response.setAgent(n,t.command),this._onDidChange.fire({kind:"setAgent",agent:n,command:t.command}))}else t.kind==="codeCitation"?e.response.applyCodeCitation(t):this.logService.error(`Couldn't handle progress: ${JSON.stringify(t)}`)}removeRequest(e,t=f9.Removal){const i=this._requests.findIndex(o=>o.id===e),n=this._requests[i];i!==-1&&(this._onDidChange.fire({kind:"removeRequest",requestId:n.id,responseId:n.response?.id,reason:t}),this._requests.splice(i,1),n.response?.dispose())}cancelRequest(e){e.response&&e.response.cancel()}setResponse(e,t){e.response||(e.response=new mF([],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,codeCitations:e.response?.codeCitations}))}}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()}};lZ=Gye=D([_(2,Ge),_(3,ff),_(4,we)],lZ);var nR;let qye=(nR=class{get id(){return this._id}constructor(e,t,i){this.content=e,this.sampleQuestions=t,this.chatAgentService=i,this._id="welcome_"+Kye.nextId++}get username(){return this.chatAgentService.getContributedDefaultAgent(Ir.Panel)?.fullName??""}get avatarIcon(){return this.chatAgentService.getDefaultAgent(Ir.Panel)?.metadata.themeIcon}},Kye=nR,nR.nextId=0,nR);qye=Kye=D([_(2,ff)],qye);function _tt(s,e){if(s.baseUri&&e.baseUri){if(!(s.baseUri.scheme===e.baseUri.scheme&&s.baseUri.authority===e.baseUri.authority&&s.baseUri.path===e.baseUri.path&&s.baseUri.query===e.baseUri.query&&s.baseUri.fragment===e.baseUri.fragment))return!1}else if(s.baseUri||e.baseUri)return!1;return Ys(s.isTrusted,e.isTrusted)&&s.supportHtml===e.supportHtml&&s.supportThemeIcons===e.supportThemeIcons}function mQ(s,e){const t=typeof e=="string"?e:e.value;return{value:s.value+t,isTrusted:s.isTrusted,supportThemeIcons:s.supportThemeIcons,supportHtml:s.supportHtml,baseUri:s.baseUri}}function vtt(s){if(s.length===0)return"";const e=s.reduce((i,n)=>i.add(n.license),new Set);return e.size===1?g(7039,"Similar code found with 1 license type",e.size):g(7040,"Similar code found with {0} license types",e.size)}const btt="http://_vscodecontentref_";function t4e(s){const e=[];for(const t of s){const i=e[e.length-1];if(t.kind==="inlineReference"){const n="uri"in t.inlineReference?t.inlineReference:{uri:t.inlineReference},o=N.parse(btt).with({fragment:JSON.stringify(n)}),r=`[${t.name||_i(n.uri)}](${o.toString()})`;if(i?.kind==="markdownContent"){const a=mQ(i.content,new Mt(r));e[e.length-1]={content:a,kind:"markdownContent"}}else e.push({content:new Mt(r),kind:"markdownContent"})}else if(t.kind==="markdownContent"&&i?.kind==="markdownContent"&&_tt(i.content,t.content)){const n=mQ(i.content,t.content);e[e.length-1]={content:n,kind:"markdownContent"}}else if(t.kind==="markdownVuln"){const o=`${t.content.value}`;if(i?.kind==="markdownContent"){const r=mQ(i.content,new Mt(o));e[e.length-1]={content:r,kind:"markdownContent"}}else e.push({content:new Mt(o),kind:"markdownContent"})}else e.push(t)}return e}function L4t(s){const e=[];for(const t of s){const i=e[e.length-1];if(t.kind==="markdownContent")i?.kind==="markdownContent"?e[e.length-1]={content:new Mt(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 Mt(i.content.value+o,{isTrusted:i.content.isTrusted}),kind:"markdownContent"}:e.push({content:new Mt(o),kind:"markdownContent"})}}return e}function R4t(s){const e=[];let t=s,i;for(;(i=/(.*?)<\/vscode_annotation>/ms.exec(t))!==null;){const[n,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:b})=>e.push({title:v,description:b,range:{startLineNumber:l+1,startColumn:u,endLineNumber:l+d+1,endColumn:p}}))}catch{}t=t.substring(0,a)+r+t.substring(a+n.length)}return{newText:t,vulnerabilities:e}}function vNe(s,e){const t=Array.from(s.matchAll(new RegExp("\\[([^\\]]+)\\]\\(([^)]+)\\)|\\p{sc=Han}|=+|\\++|-+|[^\\s\\|\\p{sc=Han}|=|\\+|\\-]+","gu"))),i=t.slice(0,e),n=e>t.length?s.length:i.length?i.at(-1).index+i.at(-1)[0].length:0,o=s.substring(0,n);return{value:o,returnedWordCount:i.length===0?o.length?1:0:i.length,isFullString:n>=s.length,totalWordCount:t.length}}function ktt(s){return vNe(s,Number.MAX_SAFE_INTEGER).returnedWordCount}function Uu(s){return!!s&&typeof s=="object"&&"message"in s}function vs(s){return!!s&&typeof s.setVote<"u"}function tB(s){return!!s&&typeof s=="object"&&"content"in s}let eCe=class extends V{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((n,o)=>{const r=this.instantiationService.createInstance(f4e,n);this._items.push(r),this.updateCodeBlockTextModels(r),n.response&&this.onAddResponse(n.response)}),this._register(e.onDidDispose(()=>this._onDidDisposeModel.fire())),this._register(e.onDidChange(n=>{if(n.kind==="addRequest"){const r=this.instantiationService.createInstance(f4e,n.request);this._items.push(r),this.updateCodeBlockTextModels(r),n.request.response&&this.onAddResponse(n.request.response)}else if(n.kind==="addResponse")this.onAddResponse(n.response);else if(n.kind==="removeRequest"){const r=this._items.findIndex(c=>Uu(c)&&c.id===n.requestId);r>=0&&this._items.splice(r,1);const a=n.responseId&&this._items.findIndex(c=>vs(c)&&c.id===n.responseId);if(typeof a=="number"&&a>=0){const l=this._items.splice(a,1)[0];l instanceof Q5&&l.dispose()}}const o=n.kind==="addRequest"?{kind:"addRequest"}:n.kind==="initialize"?{kind:"initialize"}:null;this._onDidChange.fire(o)}))}onAddResponse(e){const t=this.instantiationService.createInstance(Q5,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 Q5).forEach(e=>e.dispose())}updateCodeBlockTextModels(e){let t;Uu(e)?t=e.messageText:t=V4t(e.response.value).map(o=>o.content.value).join("");let i=0;const n=new zu.Renderer;n.code=(o,r)=>(r??="",this.codeBlockModelCollection.update(this._model.sessionId,e,i++,{text:o,languageId:r}),""),zu.parse(this.ensureFencedCodeBlocksTerminated(t),{renderer:n})}ensureFencedCodeBlocksTerminated(e){const t=e.split(` +`),p=a+r.length-(f+1)+1;try{JSON.parse(decodeURIComponent(o)).forEach(({title:v,description:b})=>e.push({title:v,description:b,range:{startLineNumber:l+1,startColumn:u,endLineNumber:l+d+1,endColumn:p}}))}catch{}t=t.substring(0,a)+r+t.substring(a+n.length)}return{newText:t,vulnerabilities:e}}function rNe(s,e){const t=Array.from(s.matchAll(new RegExp("\\[([^\\]]+)\\]\\(([^)]+)\\)|\\p{sc=Han}|=+|\\++|-+|[^\\s\\|\\p{sc=Han}|=|\\+|\\-]+","gu"))),i=t.slice(0,e),n=e>t.length?s.length:i.length?i.at(-1).index+i.at(-1)[0].length:0,o=s.substring(0,n);return{value:o,returnedWordCount:i.length===0?o.length?1:0:i.length,isFullString:n>=s.length,totalWordCount:t.length}}function wtt(s){return rNe(s,Number.MAX_SAFE_INTEGER).returnedWordCount}function Wu(s){return!!s&&typeof s=="object"&&"message"in s}function vs(s){return!!s&&typeof s.setVote<"u"}function JO(s){return!!s&&typeof s=="object"&&"content"in s}let Qye=class extends V{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((n,o)=>{const r=this.instantiationService.createInstance(i4e,n);this._items.push(r),this.updateCodeBlockTextModels(r),n.response&&this.onAddResponse(n.response)}),this._register(e.onDidDispose(()=>this._onDidDisposeModel.fire())),this._register(e.onDidChange(n=>{if(n.kind==="addRequest"){const r=this.instantiationService.createInstance(i4e,n.request);this._items.push(r),this.updateCodeBlockTextModels(r),n.request.response&&this.onAddResponse(n.request.response)}else if(n.kind==="addResponse")this.onAddResponse(n.response);else if(n.kind==="removeRequest"){const r=this._items.findIndex(c=>Wu(c)&&c.id===n.requestId);r>=0&&this._items.splice(r,1);const a=n.responseId&&this._items.findIndex(c=>vs(c)&&c.id===n.responseId);if(typeof a=="number"&&a>=0){const l=this._items.splice(a,1)[0];l instanceof G5&&l.dispose()}}const o=n.kind==="addRequest"?{kind:"addRequest"}:n.kind==="initialize"?{kind:"initialize"}:null;this._onDidChange.fire(o)}))}onAddResponse(e){const t=this.instantiationService.createInstance(G5,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 G5).forEach(e=>e.dispose())}updateCodeBlockTextModels(e){let t;Wu(e)?t=e.messageText:t=L4t(e.response.value).map(o=>o.content.value).join("");let i=0;const n=new Uu.Renderer;n.code=(o,r)=>(r??="",this.codeBlockModelCollection.update(this._model.sessionId,e,i++,{text:o,languageId:r}),""),Uu.parse(this.ensureFencedCodeBlocksTerminated(t),{renderer:n})}ensureFencedCodeBlocksTerminated(e){const t=e.split(` `);let i=!1;for(let n=0;ne.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={firstWordTime:0,lastUpdateTime:Date.now(),impliedWordLoadRate:0,lastWordCount:0}),this._register(e.onDidChange(()=>{if(this._contentUpdateTimings){const n=Date.now(),o=ktt(e.response.toString()),r=Math.max(n-this._contentUpdateTimings.firstWordTime,250),a=this._contentUpdateTimings.lastWordCount/(r/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over last ${r}ms = ${a} words/s. ${o} words are now available.`),this._contentUpdateTimings={firstWordTime:this._contentUpdateTimings.firstWordTime===0&&this.response.value.some(c=>c.kind==="markdownContent")?n:this._contentUpdateTimings.firstWordTime,lastUpdateTime:n,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)}};Q5=D([_(1,Ge),_(2,zae)],Q5);var HW;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(HW||(HW={}));var p4e;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(p4e||(p4e={}));var tCe;(function(s){s[s.FIRST=0]="FIRST",s[s.LAST=1]="LAST",s[s.NEXT=2]="NEXT",s[s.PREVIOUS=3]="PREVIOUS"})(tCe||(tCe={}));var m4e;(function(s){s[s.MAXIMIZE=0]="MAXIMIZE",s[s.EXPAND=1]="EXPAND",s[s.EVEN=2]="EVEN"})(m4e||(m4e={}));var _4e;(function(s){s[s.COPY_EDITORS=0]="COPY_EDITORS",s[s.MOVE_EDITORS=1]="MOVE_EDITORS"})(_4e||(_4e={}));function v4e(s){const e=s;return wa(e?.editor)&&wa(e?.replacement)}var hu;(function(s){s[s.CREATION_TIME=0]="CREATION_TIME",s[s.MOST_RECENTLY_ACTIVE=1]="MOST_RECENTLY_ACTIVE",s[s.GRID_APPEARANCE=2]="GRID_APPEARANCE"})(hu||(hu={}));function bNe(s){const e=s;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function UW(s){return s.getValue("workbench.editor.openSideBySideDirection")==="down"?HW.DOWN:HW.RIGHT}const hA=-1,ev=-2,$4t=-3;function Itt(s){return typeof s=="number"||bNe(s)}const Ttt=Pe(4617,"Chat"),G4t="workbench.action.chat.open";var $h;(function(s){s.Mode="inlineChat.mode",s.FinishOnType="inlineChat.finishOnType",s.AcceptedOrDiscardBeforeSave="inlineChat.acceptedOrDiscardBeforeSave",s.HoldToSpeech="inlineChat.holdToSpeech",s.AccessibleDiffView="inlineChat.accessibleDiffView",s.ExpTextButtons="inlineChat.experimental.textButtons"})($h||($h={}));var Fy;(function(s){s.Live="live",s.Preview="preview"})(Fy||(Fy={}));Qe.as(Nn.Configuration).registerConfiguration({id:"editor",properties:{[$h.Mode]:{description:g(7041,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:Fy.Live,type:"string",enum:[Fy.Live,Fy.Preview],markdownEnumDescriptions:[g(7042,"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(7043,"Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes.")],tags:["experimental"]},[$h.FinishOnType]:{description:g(7044,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[$h.AcceptedOrDiscardBeforeSave]:{description:g(7045,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[$h.HoldToSpeech]:{description:g(7046,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[$h.AccessibleDiffView]:{description:g(7047,"Whether the inline chat also renders an accessible diff viewer for its changes."),default:"auto",type:"string",enum:["auto","on","off"],markdownEnumDescriptions:[g(7048,"The accessible diff viewer is based screen reader mode being enabled."),g(7049,"The accessible diff viewer is always enabled."),g(7050,"The accessible diff viewer is never enabled.")]},[$h.ExpTextButtons]:{description:g(7051,"Whether to use textual buttons."),default:!1,type:"boolean",tags:["experimental"]}}});const b4e="interactiveEditor";var O1;(function(s){s.None="none",s.Messages="messages",s.MessagesAndEdits="messagesAndEdits"})(O1||(O1={}));const K4t=new Q("inlineChatHasProvider",!1,g(7052,"Whether a provider for interactive editors exists")),q4t=new Q("inlineChatVisible",!1,g(7053,"Whether the interactive editor input is visible")),Q4t=new Q("inlineChatFocused",!1,g(7054,"Whether the interactive editor input is focused")),j4t=new Q("inlineChatResponseFocused",!1,g(7055,"Whether the interactive widget's response is focused"));new Q("inlineChatEmpty",!1,g(7056,"Whether the interactive editor input is empty"));new Q("inlineChatInnerCursorFirst",!1,g(7057,"Whether the cursor of the iteractive editor input is on the first line"));new Q("inlineChatInnerCursorLast",!1,g(7058,"Whether the cursor of the iteractive editor input is on the last line"));const Y4t=new Q("inlineChatOuterCursorPosition","",g(7061,"Whether the cursor of the outer editor is above or below the interactive editor input")),J4t=new Q("inlineChatHasStashedSession",!1,g(7062,"Whether interactive editor has kept a session for quick restore")),X4t=new Q("inlineChatUserDidEdit",void 0,g(7063,"Whether the user did changes ontop of the inline chat")),Z4t=new Q("inlineChatDocumentChanged",!1,g(7064,"Whether the document has changed concurrently")),eVt=new Q("inlineChatChangeHasDiff",!1,g(7065,"Whether the current change supports showing a diff")),tVt=new Q("inlineChatChangeShowsDiff",!1,g(7066,"Whether the current change showing a diff"));new Q("config.inlineChat.mode",Fy.Live);const iVt=new Q("inlineChatRequestInProgress",!1,g(7067,"Whether an inline chat request is currently in progress")),nVt=new Q("inlineChatResponseType",O1.None,g(7068,"What type was the responses have been receieved, nothing yet, just messages, or messaged and local edits"));he.equals(`config.${[$h.ExpTextButtons]}`,!0);const sVt="inlineChat.acceptChanges",oVt="inlineChat.regenerate",rVt="inlineChat.toggleDiff",Ltt=_e.for("inlineChat.execute"),aVt=_e.for("inlineChat.content.status"),cVt=_e.for("inlineChatWidget.status"),lVt=W("inlineChat.foreground",IN,g(7069,"Foreground color of the interactive editor widget")),iCe=W("inlineChat.background",xh,g(7070,"Background color of the interactive editor widget"));W("inlineChat.border",r6,g(7071,"Border color of the interactive editor widget"));W("inlineChat.shadow",CI,g(7072,"Shadow color of the interactive editor widget"));W("inlineChatInput.border",r6,g(7073,"Border color of the interactive editor input"));W("inlineChatInput.focusBorder",mp,g(7074,"Border color of the interactive editor input when focused"));W("inlineChatInput.placeholderForeground",Mft,g(7075,"Foreground color of the interactive editor input placeholder"));W("inlineChatInput.background",z2,g(7076,"Background color of the interactive editor input"));W("inlineChatDiff.inserted",st(my,.5),g(7077,"Background color of inserted text in the interactive editor input"));const dVt=W("editorOverviewRuler.inlineChatInserted",{dark:st(my,.6),light:st(my,.8),hcDark:st(my,.6),hcLight:st(my,.8)},g(7078,"Overview ruler marker color for inline chat inserted content.")),hVt=W("editorOverviewRuler.inlineChatInserted",{dark:st(my,.6),light:st(my,.8),hcDark:st(my,.6),hcLight:st(my,.8)},g(7078,"Overview ruler marker color for inline chat inserted content."));W("inlineChatDiff.removed",st(iF,.5),g(7079,"Background color of removed text in the interactive editor input"));W("editorOverviewRuler.inlineChatRemoved",{dark:st(iF,.6),light:st(iF,.8),hcDark:st(iF,.6),hcLight:st(iF,.8)},g(7080,"Overview ruler marker color for inline chat removed content."));var u0;const jz=class jz{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:jz._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}fixup(e){const t=[];for(const{modified:r}of e){const a=r.isEmpty?new F(r.startLineNumber,1,r.startLineNumber,this._textModel.getLineLength(r.startLineNumber)):new F(r.startLineNumber,1,r.endLineNumberExclusive-1,this._textModel.getLineLength(r.endLineNumberExclusive-1));t.push({range:a,options:jz._options})}const[i,...n]=this._decorationIds,o=this._textModel.deltaDecorations(n,t);this._decorationIds=[i].concat(o),this._onDidChange.fire(this)}get trackedInitialRange(){const[e]=this._decorationIds;return this._textModel.getDecorationRange(e)??new F(1,1,1,1)}get value(){let e;for(const t of this._decorationIds){const i=this._textModel.getDecorationRange(t);i&&(e?e=F.plusRange(e,i):e=i)}return e}};jz._options=Gt.register({description:"inlineChat/session/wholeRange"});let nCe=jz;class uVt{constructor(e,t,i,n,o,r,a,c){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=n,this.agent=o,this.wholeRange=r,this.hunkData=a,this.chatModel=c,this._isUnstashed=!1,this._exchanges=[],this._startTime=new Date,this.textModelNAltVersion=n.getAlternativeVersionId(),this._teldata={extension:Sn.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._exchanges.push(e);this._teldata.rounds+=`${t}|`}get lastExchange(){return this._exchanges[this._exchanges.length-1]}async undoChangesUntil(e){const t=this._exchanges.findIndex(i=>i.prompt.request.id===e);if(t<0)return!1;this.hunkData.ignoreTextModelNChanges=!0;try{const i=this._exchanges[t].prompt.modelAltVersionId;for(;i{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}};oCe=D([_(3,Le),_(4,ZRe),_(5,Ge)],oCe);function w4e(s,e){return s.isEmpty?new F(s.startLineNumber,1,s.startLineNumber,e.getLineLength(s.startLineNumber)):new F(s.startLineNumber,1,s.endLineNumberExclusive-1,e.getLineLength(s.endLineNumberExclusive-1))}var ik;let rCe=(ik=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(n=>{this._ignoreChanges||this._mirrorChanges(n)}))}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===Hh.Pending)for(let c=1;cF.compareRangesUsingStarts(o.rangeN,r.rangeN)),i.sort(F.compareRangesUsingStarts);const n=[];for(const o of e.changes){let r=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(F.getStartPosition(o.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(F.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);n.push(Zn.replace(F.fromPositions(h,u),o.text))}this._textModel0.pushEditOperations(null,n,()=>null)}async recompute(e,t){if(t??=await this._editorWorkerService.computeDiff(this._textModel0.uri,this._textModelN.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,computeMoves:!1},"advanced"),!t||t.changes.length===0)return;const i=[t.changes[0]];for(let o=1;onew pVt(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 n){const c=[],l=[];c.push(o.addDecoration(w4e(a.modified,this._textModelN),u0._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(w4e(a.original,this._textModel0),u0._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(o.addDecoration(d.modifiedRange,u0._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(d.originalRange,u0._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:Hh.Pending})}})})}get size(){return this._data.size}get pending(){return hi.reduce(this._data.values(),(e,{state:t})=>e+(t===Hh.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),n=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 n={getState:()=>i.state,isInsertion:()=>t.original.isEmpty,getRangesN:()=>{const o=i.textModelNDecorations.map(r=>this._textModelN.getDecorationRange(r));return uM(o),o},getRanges0:()=>{const o=i.textModel0Decorations.map(r=>this._textModel0.getDecorationRange(r));return uM(o),o},discardChanges:()=>{if(i.state===Hh.Pending){const o=this._discardEdits(n);this._textModelN.pushEditOperations(null,o,()=>null),i.state=Hh.Rejected}},acceptChanges:()=>{if(i.state===Hh.Pending){const o=[],r=n.getRangesN(),a=n.getRanges0();for(let c=1;cnull),i.state=Hh.Accepted,i.editState.applied+=1}}};e.push(n)}return e}},u0=ik,ik._HUNK_TRACKED_RANGE=Gt.register({description:"inline-chat-hunk-tracked-range",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}),ik._HUNK_THRESHOLD=8,ik);rCe=u0=D([_(0,Ml)],rCe);class pVt{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var Hh;(function(s){s[s.Pending=0]="Pending",s[s.Accepted=1]="Accepted",s[s.Rejected=2]="Rejected"})(Hh||(Hh={}));async function mVt(s,e,t,i){const[n]=s.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}}]);let o=!0;for await(const r of e.newText){if(s.isDisposed())break;const a=s.getDecorationRange(n);if(!a)throw new Error("FAILED to perform async replace edit because the anchor decoration was removed");const c=o?Zn.replace(a,r):Zn.insert(a.getEndPosition(),r);i?.start(),s.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),o=!1}}function _Vt(s,e,t,i){t=Math.max(30,t);const n=new P2;let o=e.text??"";s.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=vNe(o,1);n.emitOne(a.value),o=o.substring(a.value.length),a.isFullString&&(s.cancel(),n.resolve(),r.dispose())},1e3/t);const r=i.onCancellationRequested(()=>{s.cancel(),n.resolve(),r.dispose()});return{range:e.range,newText:n.asyncIterable}}var vVt=".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)}.interactive-result-code-block.compare .interactive-result-header{align-items:center;border-bottom:1px solid var(--vscode-chat-requestBorder);box-sizing:border-box;display:flex;justify-content:space-between;padding:0 3px}.interactive-result-code-block.compare.no-diff .interactive-result-editor,.interactive-result-code-block.compare.no-diff .interactive-result-header{display:none}";ut(vVt,{});function wNe(s){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:s.getValue("editor.accessibilitySupport"),cursorBlinking:s.getValue("editor.cursorBlinking")}}function bVt(){return{isSimpleWidget:!0,contributions:ap.getSomeEditorContributions([MA.ID,hce,Fb.ID,Xg.ID,fc.ID,PA.ID])}}function Jb(s){if(!(!s||!s.resource))return N.isUri(s.resource)?s.resource:s.resource.primary}const wVt={onDidChangeVisibility:M.None};let UA=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=n,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(n=>{n.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(NLe)&&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(cCe,e,t),n={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(n),this.widgets.push(i),n}disposeWidget(e){const t=this.widgets.indexOf(e);t>-1&&(this.widgets.splice(t,1),this.labels.splice(t,1)),bt(e)}clear(){this.widgets=bt(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};UA=D([_(1,we),_(2,Te),_(3,gi),_(4,yi),_(5,xi),_(6,iE),_(7,pn),_(8,Fs),_(9,Fo)],UA);let aCe=class extends UA{get element(){return this.label}constructor(e,t,i,n,o,r,a,c,l,d,h){super(wVt,i,n,o,r,a,c,l,d,h),this.label=this._register(this.create(e,t))}};aCe=D([_(2,we),_(3,Te),_(4,gi),_(5,yi),_(6,xi),_(7,iE),_(8,pn),_(9,Fs),_(10,Fo)],aCe);var X0;(function(s){s[s.Basic=1]="Basic",s[s.Full=2]="Full"})(X0||(X0={}));let cCe=class extends D3{constructor(e,t,i,n,o,r,a,c,l){super(e,t),this.languageService=i,this.modelService=n,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 wn),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===X0.Full,updateDecoration:this.needsRedraw===X0.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=Jb(this.label);t&&ji(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=Jb(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){Jb(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){ji(e,Jb(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=Jb(this.label);N.isUri(e)&&this.label?.name===this.computedWorkspaceFolderLabel&&this.setFile(e,this.options)}}setFile(e,t){const i=t?.hideLabel;let n;if(!i){if(t?.fileKind===ba.ROOT_FOLDER){const r=this.contextService.getWorkspaceFolder(e);r&&(n=r.name,this.computedWorkspaceFolderLabel=n)}n||(n=Kw(EA(e)))}let o;if(!t?.hidePath){const r=this.labelService.getUriLabel(Lr(e),{relative:!0});r&&r!=="."&&(o=r)}this.setResource({resource:e,name:n,description:o,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=Jb(e),n=e?.resource&&!N.isUri(e.resource);if(!t.forceLabel&&!n&&i?.scheme===pe.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&&!n&&i?.scheme===pe.vscodeNotebookCell){const l=this.notebookDocumentService.getNotebook(i),d=l?.getCellIndex(i);l&&d!==void 0&&typeof e.name=="string"&&(t.title=g(9968,"{0} • Cell {1}",e.name,`${d+1}`)),typeof e.name=="string"&&l&&d!==void 0&&typeof e.name=="string"&&(e.name=g(9968,"{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=Jb(e),i=Jb(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=Jb(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!==X0.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?X0.Full:X0.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=Jb(this.label);if(this.options?.title!==void 0&&(t.title=this.options.title),i&&i.scheme!==pe.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=Mx(this.modelService,this.languageService,i,this.options.fileKind,this.options.icon)),N.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!==ba.FILE));const n=this.decoration.value;if(n){if(n.tooltip){if(typeof t.title=="string")t.title=`${t.title} • ${n.tooltip}`;else if(typeof t.title?.markdown=="string"){const o=`${t.title.markdown} • ${n.tooltip}`;t.title={markdown:o,markdownNotSupportedFallback:o}}}n.strikethrough&&(t.strikethrough=!0),this.options.fileDecorations.colors&&t.extraClasses.push(n.labelClassName),this.options.fileDecorations.badges&&(t.extraClasses.push(n.badgeClassName),t.extraClasses.push(n.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}};cCe=D([_(2,xi),_(3,gi),_(4,iE),_(5,Fs),_(6,Fo),_(7,yi),_(8,dXe)],cCe);const s_=fe,yVt="vscode-local-file";function CVt(s){let e;try{e=JSON.parse(s)}catch{throw new Error("Could not parse code block local file data")}let t;try{t=N.revive(e?.uri)}catch{throw new Error("Invalid code block local file data URI")}let i;return e.range&&(i=new F(e.range.startLineNumber+1,e.range.startColumn+1,e.range.endLineNumber+1,e.range.endColumn+1)),{uri:t,range:i}}const Yw=10;let lCe=class extends V{constructor(e,t,i,n,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.isDisposed=!1,this.element=s_(".interactive-result-code-block"),this.contextKeyService=this._register(r.createScoped(this.element));const d=this._register(o.createChild(new Uc([Le,this.contextKeyService]))),h=re(this.element,s_(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...wNe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:Yw,bottom:Yw},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g(10579,"Code block"),overflowWidgetsDomNode:n,...this.getEditorOptionsFromConfig()});const u=re(this.element,s_(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=this._register(d.createChild(new Uc([Le,f])));this.toolbar=this._register(p.createInstance(bm,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=re(this.element,s_(".interactive-result-vulns")),v=re(m,s_(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new Jd(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=re(m,s_("ul.interactive-result-vulns-list")),this._register(this.vulnsButton.onDidClick(()=>{const b=this.currentCodeBlockData.element;b.vulnerabilitiesListExpanded=!b.vulnerabilitiesListExpanded,this.vulnsButton.label=this.getVulnerabilitiesLabel(),this.element.classList.toggle("chat-vulnerabilities-collapsed",!b.vulnerabilitiesListExpanded),this._onDidChangeContentHeight.fire()})),this._register(this.toolbar.onDidChangeDropdownVisibility(b=>{u.classList.toggle("force-visibility",b)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(vr.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.editor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.editor.onDidScrollChange(b=>{this.currentScrollWidth=b.scrollWidth})),this._register(this.editor.onDidContentSizeChange(b=>{b.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),hp.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),hp.get(this.editor)?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(b=>{this.clearWidgets()}))}dispose(){this.isDisposed=!0,super.dispose()}get uri(){return this.editor.getModel()?.uri}createEditor(e,t,i){return this._register(e.createInstance(Hk,t,i,{isSimpleWidget:!1,contributions:ap.getSomeEditorContributions([MA.ID,hce,Fb.ID,hp.ID,PW.ID,BA.ID,jM.ID,Pa.ID,Lh.ID,KM.ID,VM.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Yw-t,2):Yw;this.editor.updateOptions({padding:{top:Yw,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(vr.Chat)?g(10580,"Toolbar for code block which can be reached via tab"):g(10581,"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"?cd.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.isDisposed&&(this.layout(t),i&&(this.disposableStore.clear(),this.disposableStore.add(this.editor.onDidFocusEditorWidget(()=>Pk.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>Pk.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g(10582,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?zd(this.toolbar.getElement()):Yh(this.toolbar.getElement()),e.vulns?.length&&vs(e.element)?(Ms(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),re(this.vulnsListElement,...e.vulns.map(n=>s_("li",void 0,s_("span.chat-vuln-title",void 0,n.title)," "+n.description))),this.vulnsButton.label=this.getVulnerabilitiesLabel()):this.element.classList.add("no-vulns"))}reset(){this.clearWidgets()}clearWidgets(){Pa.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,mt.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),go.TextDefined),codeBlockIndex:e.codeBlockIndex,element:e.element,languageId:t.getLanguageId()}}getVulnerabilitiesLabel(){return!this.currentCodeBlockData||!this.currentCodeBlockData.vulns?"":`${this.currentCodeBlockData.vulns.length>1?g(10583,"{0} vulnerabilities",this.currentCodeBlockData.vulns.length):g(10584,"{0} vulnerability",1)} $(${(i=>i.vulnerabilitiesListExpanded?ve.chevronDown:ve.chevronRight)(this.currentCodeBlockData.element).id})`}};lCe=D([_(4,we),_(5,Le),_(6,gi),_(7,Te),_(8,mr)],lCe);let dCe=class extends V{constructor(e,t){super(),this._modelService=t,this._register(e.registerTextModelContentProvider(pe.vscodeChatCodeBlock,this))}async provideTextContent(e){const t=this._modelService.getModel(e);return t||this._modelService.createModel("",null,e)}};dCe=D([_(0,fn),_(1,gi)],dCe);let hCe=class extends V{constructor(e,t,i,n,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 wn),this.currentScrollWidth=0,this.element=s_(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=re(this.element,s_(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(r.createScoped(this.element));const u=this._register(o.createChild(new Uc([Le,this.contextKeyService]))),f=re(this.element,s_(".interactive-result-header.show-file-icons")),p=re(this.element,s_(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,p,{...wNe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:Yw,bottom:Yw},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g(10579,"Code block"),overflowWidgetsDomNode:n,...this.getEditorOptionsFromConfig()}),this.resourceLabel=this._register(u.createInstance(aCe,f,{supportIcons:!0}));const m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(f),v=this._register(u.createChild(new Uc([Le,m])));this.toolbar=this._register(v.createInstance(bm,f,t,{menuOptions:{shouldForwardArgs:!0}})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(vr.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.diffEditor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(b=>{this.currentScrollWidth=b.scrollWidth})),this._register(this.diffEditor.onDidContentSizeChange(b=>{b.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),hp.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),hp.get(this.diffEditor.getModifiedEditor())?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(b=>{this.clearWidgets()}))}get uri(){return this.diffEditor.getModifiedEditor().getModel()?.uri}createDiffEditor(e,t,i){const n={isSimpleWidget:!1,contributions:ap.getSomeEditorContributions([MA.ID,hce,Fb.ID,hp.ID,PW.ID,BA.ID,jM.ID,Pa.ID,KM.ID])};return this._register(e.createInstance(vp,t,{scrollbar:{useShadows:!1,alwaysConsumeMouseWheel:!1,ignoreHorizontalScrollbarInContentHeight:!0},renderMarginRevertIcon:!1,diffCodeLens:!1,scrollBeyondLastLine:!1,stickyScroll:{enabled:!1},originalAriaLabel:g(10585,"Original"),modifiedAriaLabel:g(10586,"Modified"),diffAlgorithm:"advanced",readOnly:!1,isInEmbeddedEditor:!0,useInlineViewWhenSpaceIsLimited:!0,experimental:{useTrueInlineView:!0},renderSideBySideInlineBreakpoint:300,renderOverviewRuler:!1,compactMode:!0,hideUnchangedRegions:{enabled:!0,contextLineCount:1},renderGutterMenu:!1,lineNumbersMinChars:1,...i},{originalEditor:n,modifiedEditor:n}))}focus(){this.diffEditor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth,t=this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(Yw-t,2):Yw;this.diffEditor.updateOptions({padding:{top:Yw,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(vr.Chat)?g(10580,"Toolbar for code block which can be reached via tab"):g(10581,"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"?cd.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(),n={width:e-2,height:t};this.element.style.height=`${n.height}px`,this.element.style.width=`${n.width}px`,this.diffEditor.layout(n),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(10587,"Code Edits")}),this.resourceLabel.element.setFile(e.edit.uri,{fileKind:ba.FILE,fileDecorations:{colors:!0,badges:!1}})}reset(){this.clearWidgets()}clearWidgets(){Pa.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Pa.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!vs(e.element))return;const i=!!(e.edit.state?.applied??0);if(CNt.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});let r;e.edit.state.applied===1?r=g(10588,"Made 1 change in [[``{0}``]]",o):e.edit.state.applied<0?r=g(10589,"Edits in [[``{0}``]] have been rejected",o):r=g(10590,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,o);const a=ALe(r,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});aa(this.messageElement,a)}const n=await e.diffData;if(n){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const o=this.diffEditor.createViewModel({original:n.original,modified:n.modified});if(await o.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(o),this._lastDiffEditorViewModel.value=o}this.toolbar.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}clearModel(){this.diffEditor.setModel(null)}};hCe=D([_(4,we),_(5,Le),_(6,gi),_(7,Te),_(8,mr),_(9,Fs),_(10,Ao)],hCe);let uCe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new Z2}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||!ji(r.original.uri,t.uri)||r.modified.uri.scheme!==pe.vscodeChatCodeCompareBlock){i=o;break}}const n=i?await this._applyWithDiffEditor(i,t):await this._apply(t);e.setEditApplied(t,n)}async _applyWithDiffEditor(e,t){const i=e.getModel();if(!i)return 0;const n=e.getDiffComputationResult();if(!n||n.identical||!await this._checkSha1(i.original,t))return 0;const o=new gve(i.modified),r=n.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 n of e.edits){const o=n.map(nTe.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(10591,"The original file has been modified."),detail:g(10592,"Do you want to apply the changes anyway?")})).confirmed)}discard(e,t){e.response.value.includes(t)&&(t.state?.applied||e.setEditApplied(t,-1))}};uCe=D([_(0,fn),_(1,Kt),_(2,to)],uCe);var gCe,cR;let uZ=(cR=class{constructor(e,t,i,n,o){this._session=e,this._editor=t,this._zone=i,this._textFileService=n,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(uCe);for(const n of this._session.chatModel.getRequests())if(n.response?.response){for(const o of n.response.response.value)if(o.kind==="textEditGroup"&&!(e&&ji(o.uri,this._session.textModelN.uri))&&(await i.apply(n.response,o,void 0),o.uri.scheme===pe.untitled)){const r=this._textFileService.untitled.get(o.uri);r&&t.push(r)}}for(const n of t)n.isDisposed()||(await n.resolve(),await n.save({reason:Cn.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:gCe._decoBlock});return uM(t),t}},gCe=cR,cR._decoBlock=Gt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),cR);uZ=gCe=D([_(3,Fo),_(4,we)],uZ);let fCe=class extends uZ{constructor(e,t,i,n,o,r,a){super(e,t,i,r,a),this._ctxDocumentChanged=Z4t.bindTo(o);const c=n.getModel(e.targetUri);M.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(){}hasFocus(){return this._zone.widget.hasFocus()}};fCe=D([_(3,gi),_(4,Le),_(5,Fo),_(6,we)],fCe);let pCe=class extends uZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,c,l),this._editorWorkerService=o,this._accessibilityService=r,this._configService=a,this._decoInsertedText=Gt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:kl.Full,color:eOe(dVt)},minimap:{position:Th.Inline,color:eOe(hVt)}}),this._decoInsertedTextRange=Gt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:ni.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=eVt.bindTo(n),this._ctxCurrentChangeShowsDiff=tVt.bindTo(n),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,n){const o=new lu(r=>{const a=new Set;for(const d of r)pi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(pi.fromRange);for(const d of c)d.forEach(h=>a.delete(h));const l=[];for(const d of a)l.push({range:new F(d,1,d,Number.MAX_VALUE),options:this._decoInsertedText});this._progressiveEditingDecorations.append(l)});return this._makeChanges(e,t,i,o,n)}async _makeChanges(e,t,i,n,o){if(o&&this._editor.pushUndoStop(),this._editCount++,i){const r=i.duration/1e3;for(const a of e){const l=ktt(a.text??"")/r,d=_Vt(new X7(this._zone.domNode),a,l,i.token);await mVt(this._session.textModelN,d,n,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,r=>(n?.report(r),null)),t.stop()}async renderChanges(){this._progressiveEditingDecorations.clear();const e=()=>{let t;if(uue(this._editor,(i,n)=>{const o=new Set(this._hunkDisplayData.keys());t=void 0;for(const r of this._session.hunkData.getInfo()){o.delete(r);const a=r.getRangesN();let c=this._hunkDisplayData.get(r);if(c)if(r.getState()!==Hh.Pending)c.remove();else{const l=this._zone.position.lineNumber,d=a[0];c.position=d.getStartPosition().delta(-1),c.distance=l<=d.startLineNumber?d.startLineNumber-l:l-d.endLineNumber}else{const l=[];for(let R=0;R{r.acceptChanges(),e()},h=()=>{r.discardChanges(),e()},u=this._session.textModel0.mightContainNonBasicASCII(),f=this._session.textModel0.mightContainRTL(),p=Iae.fromEditor(this._editor),m=r.getRanges0()[0],v=new WYe(pi.fromRangeInclusive(m).mapToLineArray(R=>this._session.textModel0.tokenization.getLineTokens(R)),[],u,f),b=document.createElement("div");b.className="inline-chat-original-zone2";const y={afterLineNumber:-1,heightInLines:BYe(v,p,[new MO(new F(m.startLineNumber,1,m.startLineNumber,1),"",Ja.Regular)],b).heightInLines,domNode:b},C=()=>{const R=vm.capture(this._editor);uue(this._editor,(z,G)=>{if(Tt(c),c.viewZoneId)G.removeZone(c.viewZoneId),c.viewZoneId=void 0;else{const[Y]=r.getRangesN();y.afterLineNumber=Y.startLineNumber-1,c.viewZoneId=G.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof c?.viewZoneId=="string"),R.restore(this._editor)},A=()=>{uue(this._editor,(R,z)=>{Tt(c);for(const G of c.decorationIds)R.removeDecoration(G);c.viewZoneId&&z.removeZone(c.viewZoneId),c.decorationIds=[],c.viewZoneId=void 0})},L=R=>{Tt(t);const z=[];for(const G of this._session.hunkData.getInfo())G.getState()===Hh.Pending&&z.push(G.getRangesN()[0].getStartPosition().delta(-1));if(!(z.length<2)){for(let G=0;Gt.acceptHunk(),this.discardHunk=async()=>t.discardHunk(),this.move=o=>t.move(o)}else if(this._hunkDisplayData.size>0){let i=!1;for(const n of this._session.hunkData.getInfo())if(n.getState()===Hh.Accepted){i=!0;break}i?this._onDidAccept.fire():this._onDidDiscard.fire()}return t};return e()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue($h.AcceptedOrDiscardBeforeSave);let n;t===0?n=g(10593,"Nothing changed."):e===1?n=i?g(10594,"$(info) Accept or Discard change"):g(10595,"1 change"):n=i?g(10596,"$(info) Accept or Discard {0} changes",e):g(10597,"{0} changes",t);let o;i&&(o=g(10598,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(n,{title:o})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};pCe=D([_(3,Le),_(4,Ml),_(5,mr),_(6,Te),_(7,Fo),_(8,we)],pCe);function uue(s,e){s.changeDecorations(t=>{s.changeViewZones(i=>{e(t,i)})})}var SVt=".monaco-workbench .zone-widget.inline-chat-widget{z-index:3}.monaco-workbench .zone-widget.inline-chat-widget .interactive-session{max-width:unset}.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}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part{padding:4px 6px 0}.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-left:6px;padding-right:20px;padding-top:2px}.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-item-container.interactive-item-compact .chat-notification-widget{border:none;margin-bottom:0;padding:0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-request{border:none}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.minimal>.header{right:10px;top:5px}.monaco-workbench .inline-chat>.status{align-items:center;display:flex;justify-content:space-between;padding:4px 6px 0}.monaco-workbench .inline-chat .status .actions.hidden{display:none}.monaco-workbench .inline-chat .status .label{color:var(--vscode-descriptionForeground);display:flex;font-size:11px;overflow:hidden;white-space:nowrap}.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 3px}.monaco-workbench .inline-chat .status .actions,.monaco-workbench .inline-chat-content-widget .toolbar{display:flex;height:18px;.actions-container{gap:3px}.action-item.text-only .action-label{border-radius:2px;font-size:12px;line-height:16px;padding:0 4px}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{font-size:12px;height:unset;line-height:16px;width:unset}}.monaco-workbench .inline-chat .status .actions,.monaco-workbench .inline-chat-content-widget.contents .toolbar{.monaco-action-bar .action-item.menu-entry.text-only:first-of-type .action-label{background-color:var(--vscode-button-background);color:var(--vscode-button-foreground)}}.monaco-workbench .inline-chat .status{.actions.text-style{display:none}.actions.button-style{display:inherit}}.monaco-workbench .inline-chat .status.text{.actions.text-style{display:inherit}.actions.button-style{display:none}}.monaco-workbench .inline-chat .status .actions>.monaco-button,.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown{margin-right:4px}.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:0 2px;white-space:nowrap}.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 .diff-review{background-color:unset;padding:4px 6px}.monaco-workbench .inline-chat .diff-review.hidden{display:none}.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 .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}";ut(SVt,{});let mCe=class extends ixt{constructor(e,t,i,n,o,r){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=n,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 $_),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,t){const i=this._options?.buttonConfigProvider??(()=>({showLabel:!0}));this._updateStore.clear(),this.clear();const n=this._updateStore.add($k());for(let o=0;o0,a=e[o];let c,l;if(a instanceof Nk&&a.actions.length>0){const[u,...f]=a.actions;c=u,l=this.addButtonWithDropdown({secondary:i(c)?.isSecondary??r,actionRunner:this._actionRunner,actions:f,contextMenuProvider:this._contextMenuService,ariaLabel:c.label})}else c=a,l=this.addButton({secondary:i(c)?.isSecondary??r,ariaLabel:c.label});l.enabled=c.enabled,l.element.classList.add("default-colors"),i(c)?.showLabel??!0?l.label=c.label:l.element.classList.add("monaco-text-button"),i(c)?.showIcon&&(c instanceof Sc&&We.isThemeIcon(c.item.icon)?l.icon=c.item.icon:c.class&&l.element.classList.add(...c.class.split(" ")));const d=this._keybindingService.lookupKeybinding(c.id);let h;d?h=g(11519,"{0} ({1})",c.label,d.getLabel()):h=c.label,this._updateStore.add(this._hoverService.setupManagedHover(n,l.element,h)),this._updateStore.add(l.onDidClick(async()=>{this._actionRunner.run(c)}))}if(t.length>0){const o=this.addButton({secondary:!0,ariaLabel:g(11520,"More Actions")});o.icon=ve.dropDownButton,o.element.classList.add("default-colors","monaco-text-button"),o.enabled=!0,this._updateStore.add(this._hoverService.setupManagedHover(n,o.element,g(11520,"More Actions"))),this._updateStore.add(o.onDidClick(async()=>{this._contextMenuService.showContextMenu({getAnchor:()=>o.element,getActions:()=>t,actionRunner:this._actionRunner,onHide:()=>o.element.setAttribute("aria-expanded","false")}),o.element.setAttribute("aria-expanded","true")}))}this._onDidChange.fire(this)}};mCe=D([_(2,lr),_(3,Ut),_(4,Yi),_(5,ec)],mCe);let _Ce=class extends mCe{constructor(e,t,i,n,o,r,a,c,l){super(e,i,r,a,c,l);const d=n.createMenu(t,o);this._store.add(d);const h=()=>{this.clear();const u=[],f=[];fC(d,i?.menuOptions,{primary:u,secondary:f},i?.toolbarOptions?.primaryGroup),super.update(u,f)};this._store.add(d.onDidChange(h)),h()}dispose(){super.dispose()}update(e){throw new Error("Use Menu or WorkbenchButtonBar")}};_Ce=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,Yi),_(8,ec)],_Ce);var AVt='.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 .detail-container{color:var(--vscode-descriptionForeground);font-size:12px;overflow:hidden}.interactive-item-container .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>.value .chat-used-context{margin-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-item-container.minimal{flex-direction:row}.interactive-item-container.minimal .column.left{display:inline-block;flex-grow:0;padding-top:2px}.interactive-item-container.minimal .column.right{display:inline-block;flex-grow:1}.interactive-item-container.minimal .user>.username{display:none}.interactive-item-container.minimal .detail-container{font-size:unset}.interactive-item-container.minimal>.header{position:absolute;right: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-attached-context .chat-attached-context-attachment .monaco-icon-name-container.warning,.chat-attached-context .chat-attached-context-attachment .monaco-icon-suffix-container.warning,.chat-used-context-list .monaco-icon-name-container.warning,.chat-used-context-list .monaco-icon-suffix-container.warning{color:var(--vscode-notificationsWarningIcon-foreground)}.chat-attached-context .chat-attached-context-attachment.show-file-icons.warning{border-color:var(--vscode-notificationsWarningIcon-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);cursor:pointer}.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 .interactive-item-container.interactive-request .chat-attached-context{margin-top:-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 .interactive-item-container.interactive-request .chat-attached-context .chat-attached-context-attachment{padding-right:6px}.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{-webkit-line-clamp:3;-webkit-box-orient:vertical;color:var(--vscode-textLink-foreground);display:block;display:-webkit-box;font-size:12px;overflow:hidden}.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}.chat-code-citation-label{opacity:.7;white-space:pre-wrap}.chat-code-citation-button-container{display:inline}.chat-code-citation-button-container .monaco-button{border:none;color:var(--vscode-textLink-foreground);display:inline;padding:0}';ut(AVt,{});var EVt=".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}.chat-agent-hover .chat-agent-hover-icon .codicon{align-items:center;display:flex;font-size:23px!important;justify-content:center}.chat-agent-hover-publisher{display:flex;gap:4px}.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-header .chat-agent-hover-details{font-size:12px}.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}";ut(EVt,{});let vCe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(7005,"Chat")}getAriaLabel(e){return Uu(e)?e.messageText:vs(e)?this._getLabelWithCodeBlockCount(e):tB(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` +`)}};Qye=D([_(2,we)],Qye);class i4e{get id(){return this._model.id}get dataId(){return this.id+`_${kg[this._model.session.initState]}_${Wc(this.variables)}`}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}get variables(){return this._model.variableData.variables}get contentReferences(){return this._model.response?.contentReferences}constructor(e){this._model=e}}let G5=class extends V{get model(){return this._model}get id(){return this._model.id}get dataId(){return this._model.id+`_${this._modelChangeCount}_${kg[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:wce(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 codeCitations(){return this._model.codeCitations}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={firstWordTime:0,lastUpdateTime:Date.now(),impliedWordLoadRate:0,lastWordCount:0}),this._register(e.onDidChange(()=>{if(this._contentUpdateTimings){const n=Date.now(),o=wtt(e.response.toString()),r=Math.max(n-this._contentUpdateTimings.firstWordTime,250),a=this._contentUpdateTimings.lastWordCount/(r/1e3);this.trace("onDidChange",`Update- got ${this._contentUpdateTimings.lastWordCount} words over last ${r}ms = ${a} words/s. ${o} words are now available.`),this._contentUpdateTimings={firstWordTime:this._contentUpdateTimings.firstWordTime===0&&this.response.value.some(c=>c.kind==="markdownContent")?n:this._contentUpdateTimings.firstWordTime,lastUpdateTime:n,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)}};G5=D([_(1,Ge),_(2,Wae)],G5);var FW;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(FW||(FW={}));var n4e;(function(s){s[s.HORIZONTAL=0]="HORIZONTAL",s[s.VERTICAL=1]="VERTICAL"})(n4e||(n4e={}));var jye;(function(s){s[s.FIRST=0]="FIRST",s[s.LAST=1]="LAST",s[s.NEXT=2]="NEXT",s[s.PREVIOUS=3]="PREVIOUS"})(jye||(jye={}));var s4e;(function(s){s[s.MAXIMIZE=0]="MAXIMIZE",s[s.EXPAND=1]="EXPAND",s[s.EVEN=2]="EVEN"})(s4e||(s4e={}));var o4e;(function(s){s[s.COPY_EDITORS=0]="COPY_EDITORS",s[s.MOVE_EDITORS=1]="MOVE_EDITORS"})(o4e||(o4e={}));function r4e(s){const e=s;return wa(e?.editor)&&wa(e?.replacement)}var du;(function(s){s[s.CREATION_TIME=0]="CREATION_TIME",s[s.MOST_RECENTLY_ACTIVE=1]="MOST_RECENTLY_ACTIVE",s[s.GRID_APPEARANCE=2]="GRID_APPEARANCE"})(du||(du={}));function aNe(s){const e=s;return!!e&&typeof e.id=="number"&&Array.isArray(e.editors)}function OW(s){return s.getValue("workbench.editor.openSideBySideDirection")==="down"?FW.DOWN:FW.RIGHT}const dA=-1,J_=-2,M4t=-3;function ytt(s){return typeof s=="number"||aNe(s)}const Ctt=Fe(4617,"Chat"),N4t="workbench.action.chat.open";var zh;(function(s){s.Mode="inlineChat.mode",s.FinishOnType="inlineChat.finishOnType",s.AcceptedOrDiscardBeforeSave="inlineChat.acceptedOrDiscardBeforeSave",s.HoldToSpeech="inlineChat.holdToSpeech",s.AccessibleDiffView="inlineChat.accessibleDiffView",s.ExpTextButtons="inlineChat.experimental.textButtons"})(zh||(zh={}));var My;(function(s){s.Live="live",s.Preview="preview"})(My||(My={}));Qe.as(Nn.Configuration).registerConfiguration({id:"editor",properties:{[zh.Mode]:{description:g(7041,"Configure if changes crafted with inline chat are applied directly to the document or are previewed first."),default:My.Live,type:"string",enum:[My.Live,My.Preview],markdownEnumDescriptions:[g(7042,"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(7043,"Changes are previewed only and need to be accepted via the apply button. Ending a session will discard the changes.")],tags:["experimental"]},[zh.FinishOnType]:{description:g(7044,"Whether to finish an inline chat session when typing outside of changed regions."),default:!1,type:"boolean"},[zh.AcceptedOrDiscardBeforeSave]:{description:g(7045,"Whether pending inline chat sessions prevent saving."),default:!0,type:"boolean"},[zh.HoldToSpeech]:{description:g(7046,"Whether holding the inline chat keybinding will automatically enable speech recognition."),default:!0,type:"boolean"},[zh.AccessibleDiffView]:{description:g(7047,"Whether the inline chat also renders an accessible diff viewer for its changes."),default:"auto",type:"string",enum:["auto","on","off"],markdownEnumDescriptions:[g(7048,"The accessible diff viewer is based screen reader mode being enabled."),g(7049,"The accessible diff viewer is always enabled."),g(7050,"The accessible diff viewer is never enabled.")]},[zh.ExpTextButtons]:{description:g(7051,"Whether to use textual buttons."),default:!1,type:"boolean",tags:["experimental"]}}});const a4e="interactiveEditor";var M1;(function(s){s.None="none",s.Messages="messages",s.MessagesAndEdits="messagesAndEdits"})(M1||(M1={}));const P4t=new Y("inlineChatHasProvider",!1,g(7052,"Whether a provider for interactive editors exists")),F4t=new Y("inlineChatVisible",!1,g(7053,"Whether the interactive editor input is visible")),O4t=new Y("inlineChatFocused",!1,g(7054,"Whether the interactive editor input is focused")),B4t=new Y("inlineChatResponseFocused",!1,g(7055,"Whether the interactive widget's response is focused"));new Y("inlineChatEmpty",!1,g(7056,"Whether the interactive editor input is empty"));new Y("inlineChatInnerCursorFirst",!1,g(7057,"Whether the cursor of the iteractive editor input is on the first line"));new Y("inlineChatInnerCursorLast",!1,g(7058,"Whether the cursor of the iteractive editor input is on the last line"));const W4t=new Y("inlineChatOuterCursorPosition","",g(7061,"Whether the cursor of the outer editor is above or below the interactive editor input")),H4t=new Y("inlineChatHasStashedSession",!1,g(7062,"Whether interactive editor has kept a session for quick restore")),U4t=new Y("inlineChatUserDidEdit",void 0,g(7063,"Whether the user did changes ontop of the inline chat")),V4t=new Y("inlineChatDocumentChanged",!1,g(7064,"Whether the document has changed concurrently")),z4t=new Y("inlineChatChangeHasDiff",!1,g(7065,"Whether the current change supports showing a diff")),$4t=new Y("inlineChatChangeShowsDiff",!1,g(7066,"Whether the current change showing a diff"));new Y("config.inlineChat.mode",My.Live);const G4t=new Y("inlineChatRequestInProgress",!1,g(7067,"Whether an inline chat request is currently in progress")),K4t=new Y("inlineChatResponseType",M1.None,g(7068,"What type was the responses have been receieved, nothing yet, just messages, or messaged and local edits"));he.equals(`config.${[zh.ExpTextButtons]}`,!0);const q4t="inlineChat.acceptChanges",Q4t="inlineChat.regenerate",j4t="inlineChat.toggleDiff",Stt=_e.for("inlineChat.execute"),Y4t=_e.for("inlineChat.content.status"),J4t=_e.for("inlineChatWidget.status"),X4t=W("inlineChat.foreground",EN,g(7069,"Foreground color of the interactive editor widget")),Yye=W("inlineChat.background",Ah,g(7070,"Background color of the interactive editor widget"));W("inlineChat.border",i6,g(7071,"Border color of the interactive editor widget"));W("inlineChat.shadow",mI,g(7072,"Shadow color of the interactive editor widget"));W("inlineChatInput.border",i6,g(7073,"Border color of the interactive editor input"));W("inlineChatInput.focusBorder",gp,g(7074,"Border color of the interactive editor input when focused"));W("inlineChatInput.placeholderForeground",Cft,g(7075,"Foreground color of the interactive editor input placeholder"));W("inlineChatInput.background",W2,g(7076,"Background color of the interactive editor input"));W("inlineChatDiff.inserted",st(gy,.5),g(7077,"Background color of inserted text in the interactive editor input"));const Z4t=W("editorOverviewRuler.inlineChatInserted",{dark:st(gy,.6),light:st(gy,.8),hcDark:st(gy,.6),hcLight:st(gy,.8)},g(7078,"Overview ruler marker color for inline chat inserted content.")),eVt=W("editorOverviewRuler.inlineChatInserted",{dark:st(gy,.6),light:st(gy,.8),hcDark:st(gy,.6),hcLight:st(gy,.8)},g(7078,"Overview ruler marker color for inline chat inserted content."));W("inlineChatDiff.removed",st(XP,.5),g(7079,"Background color of removed text in the interactive editor input"));W("editorOverviewRuler.inlineChatRemoved",{dark:st(XP,.6),light:st(XP,.8),hcDark:st(XP,.6),hcLight:st(XP,.8)},g(7080,"Overview ruler marker color for inline chat removed content."));var l0;const Kz=class Kz{constructor(e,t){this._textModel=e,this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this._decorationIds=[],this._decorationIds=e.deltaDecorations([],[{range:t,options:Kz._options}])}dispose(){this._onDidChange.dispose(),this._textModel.isDisposed()||this._textModel.deltaDecorations(this._decorationIds,[])}fixup(e){const t=[];for(const{modified:r}of e){const a=r.isEmpty?new F(r.startLineNumber,1,r.startLineNumber,this._textModel.getLineLength(r.startLineNumber)):new F(r.startLineNumber,1,r.endLineNumberExclusive-1,this._textModel.getLineLength(r.endLineNumberExclusive-1));t.push({range:a,options:Kz._options})}const[i,...n]=this._decorationIds,o=this._textModel.deltaDecorations(n,t);this._decorationIds=[i].concat(o),this._onDidChange.fire(this)}get trackedInitialRange(){const[e]=this._decorationIds;return this._textModel.getDecorationRange(e)??new F(1,1,1,1)}get value(){let e;for(const t of this._decorationIds){const i=this._textModel.getDecorationRange(t);i&&(e?e=F.plusRange(e,i):e=i)}return e}};Kz._options=Gt.register({description:"inlineChat/session/wholeRange"});let Jye=Kz;class tVt{constructor(e,t,i,n,o,r,a,c){this.editMode=e,this.targetUri=t,this.textModel0=i,this.textModelN=n,this.agent=o,this.wholeRange=r,this.hunkData=a,this.chatModel=c,this._isUnstashed=!1,this._exchanges=[],this._startTime=new Date,this.textModelNAltVersion=n.getAlternativeVersionId(),this._teldata={extension:Sn.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._exchanges.push(e);this._teldata.rounds+=`${t}|`}get lastExchange(){return this._exchanges[this._exchanges.length-1]}async undoChangesUntil(e){const t=this._exchanges.findIndex(i=>i.prompt.request.id===e);if(t<0)return!1;this.hunkData.ignoreTextModelNChanges=!0;try{const i=this._exchanges[t].prompt.modelAltVersionId;for(;i{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}};Zye=D([_(3,Le),_(4,URe),_(5,Ge)],Zye);function c4e(s,e){return s.isEmpty?new F(s.startLineNumber,1,s.startLineNumber,e.getLineLength(s.startLineNumber)):new F(s.startLineNumber,1,s.endLineNumberExclusive-1,e.getLineLength(s.endLineNumberExclusive-1))}var JD;let eCe=(JD=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(n=>{this._ignoreChanges||this._mirrorChanges(n)}))}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===Wh.Pending)for(let c=1;cF.compareRangesUsingStarts(o.rangeN,r.rangeN)),i.sort(F.compareRangesUsingStarts);const n=[];for(const o of e.changes){let r=!1,a=0;for(const{rangeN:f,range0:p}of t)if(f.getEndPosition().isBefore(F.getStartPosition(o.range)))a+=this._textModelN.getValueLengthInRange(f),a-=this._textModel0.getValueLengthInRange(p);else if(F.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);n.push(Zn.replace(F.fromPositions(h,u),o.text))}this._textModel0.pushEditOperations(null,n,()=>null)}async recompute(e,t){if(t??=await this._editorWorkerService.computeDiff(this._textModel0.uri,this._textModelN.uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:Number.MAX_SAFE_INTEGER,computeMoves:!1},"advanced"),!t||t.changes.length===0)return;const i=[t.changes[0]];for(let o=1;onew sVt(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 n){const c=[],l=[];c.push(o.addDecoration(c4e(a.modified,this._textModelN),l0._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(c4e(a.original,this._textModel0),l0._HUNK_TRACKED_RANGE));for(const d of a.changes)c.push(o.addDecoration(d.modifiedRange,l0._HUNK_TRACKED_RANGE)),l.push(r.addDecoration(d.originalRange,l0._HUNK_TRACKED_RANGE));this._data.set(a,{editState:e,textModelNDecorations:c,textModel0Decorations:l,state:Wh.Pending})}})})}get size(){return this._data.size}get pending(){return hi.reduce(this._data.values(),(e,{state:t})=>e+(t===Wh.Pending?1:0),0)}_discardEdits(e){const t=[],i=e.getRangesN(),n=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 n={getState:()=>i.state,isInsertion:()=>t.original.isEmpty,getRangesN:()=>{const o=i.textModelNDecorations.map(r=>this._textModelN.getDecorationRange(r));return cM(o),o},getRanges0:()=>{const o=i.textModel0Decorations.map(r=>this._textModel0.getDecorationRange(r));return cM(o),o},discardChanges:()=>{if(i.state===Wh.Pending){const o=this._discardEdits(n);this._textModelN.pushEditOperations(null,o,()=>null),i.state=Wh.Rejected}},acceptChanges:()=>{if(i.state===Wh.Pending){const o=[],r=n.getRangesN(),a=n.getRanges0();for(let c=1;cnull),i.state=Wh.Accepted,i.editState.applied+=1}}};e.push(n)}return e}},l0=JD,JD._HUNK_TRACKED_RANGE=Gt.register({description:"inline-chat-hunk-tracked-range",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}),JD._HUNK_THRESHOLD=8,JD);eCe=l0=D([_(0,Rl)],eCe);class sVt{constructor(e,t,i){this.original=e,this.modified=t,this.changes=i}}var Wh;(function(s){s[s.Pending=0]="Pending",s[s.Accepted=1]="Accepted",s[s.Rejected=2]="Rejected"})(Wh||(Wh={}));async function oVt(s,e,t,i){const[n]=s.deltaDecorations([],[{range:e.range,options:{description:"asyncTextEdit",stickiness:ni.AlwaysGrowsWhenTypingAtEdges}}]);let o=!0;for await(const r of e.newText){if(s.isDisposed())break;const a=s.getDecorationRange(n);if(!a)throw new Error("FAILED to perform async replace edit because the anchor decoration was removed");const c=o?Zn.replace(a,r):Zn.insert(a.getEndPosition(),r);i?.start(),s.pushEditOperations(null,[c],l=>(t?.report(l),null)),i?.stop(),o=!1}}function rVt(s,e,t,i){t=Math.max(30,t);const n=new L2;let o=e.text??"";s.cancelAndSet(()=>{if(i.isCancellationRequested)return;const a=rNe(o,1);n.emitOne(a.value),o=o.substring(a.value.length),a.isFullString&&(s.cancel(),n.resolve(),r.dispose())},1e3/t);const r=i.onCancellationRequested(()=>{s.cancel(),n.resolve(),r.dispose()});return{range:e.range,newText:n.asyncIterable}}var aVt=".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)}.interactive-result-code-block.compare .interactive-result-header{align-items:center;border-bottom:1px solid var(--vscode-chat-requestBorder);box-sizing:border-box;display:flex;justify-content:space-between;padding:0 3px}.interactive-result-code-block.compare.no-diff .interactive-result-editor,.interactive-result-code-block.compare.no-diff .interactive-result-header{display:none}";ut(aVt,{});function cNe(s){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:s.getValue("editor.accessibilitySupport"),cursorBlinking:s.getValue("editor.cursorBlinking")}}function cVt(){return{isSimpleWidget:!0,contributions:sp.getSomeEditorContributions([LA.ID,ace,Mb.ID,jg.ID,fc.ID,MA.ID])}}function Qb(s){if(!(!s||!s.resource))return N.isUri(s.resource)?s.resource:s.resource.primary}const lVt={onDidChangeVisibility:M.None};let WA=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.instantiationService=t,this.configurationService=i,this.modelService=n,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(n=>{n.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(CLe)&&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(iCe,e,t),n={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(n),this.widgets.push(i),n}disposeWidget(e){const t=this.widgets.indexOf(e);t>-1&&(this.widgets.splice(t,1),this.labels.splice(t,1)),bt(e)}clear(){this.widgets=bt(this.widgets),this.labels=[]}dispose(){super.dispose(),this.clear()}};WA=D([_(1,we),_(2,Te),_(3,gi),_(4,yi),_(5,xi),_(6,eE),_(7,pn),_(8,Fs),_(9,Fo)],WA);let tCe=class extends WA{get element(){return this.label}constructor(e,t,i,n,o,r,a,c,l,d,h){super(lVt,i,n,o,r,a,c,l,d,h),this.label=this._register(this.create(e,t))}};tCe=D([_(2,we),_(3,Te),_(4,gi),_(5,yi),_(6,xi),_(7,eE),_(8,pn),_(9,Fs),_(10,Fo)],tCe);var Q0;(function(s){s[s.Basic=1]="Basic",s[s.Full=2]="Full"})(Q0||(Q0={}));let iCe=class extends A3{constructor(e,t,i,n,o,r,a,c,l){super(e,t),this.languageService=i,this.modelService=n,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 wn),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===Q0.Full,updateDecoration:this.needsRedraw===Q0.Full}),this.needsRedraw=void 0))}notifyModelLanguageChanged(e){this.handleModelEvent(e)}notifyModelAdded(e){this.handleModelEvent(e)}handleModelEvent(e){const t=Qb(this.label);t&&ji(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=Qb(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){Qb(this.label)?.scheme===e&&this.render({updateIcon:!1,updateDecoration:!1})}notifyUntitledLabelChange(e){ji(e,Qb(this.label))&&this.render({updateIcon:!1,updateDecoration:!1})}notifyWorkspaceFoldersChange(){if(typeof this.computedWorkspaceFolderLabel=="string"){const e=Qb(this.label);N.isUri(e)&&this.label?.name===this.computedWorkspaceFolderLabel&&this.setFile(e,this.options)}}setFile(e,t){const i=t?.hideLabel;let n;if(!i){if(t?.fileKind===ba.ROOT_FOLDER){const r=this.contextService.getWorkspaceFolder(e);r&&(n=r.name,this.computedWorkspaceFolderLabel=n)}n||(n=zw(SA(e)))}let o;if(!t?.hidePath){const r=this.labelService.getUriLabel(Lr(e),{relative:!0});r&&r!=="."&&(o=r)}this.setResource({resource:e,name:n,description:o,range:t?.range},t)}setResource(e,t=Object.create(null)){const i=Qb(e),n=e?.resource&&!N.isUri(e.resource);if(!t.forceLabel&&!n&&i?.scheme===pe.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&&!n&&i?.scheme===pe.vscodeNotebookCell){const l=this.notebookDocumentService.getNotebook(i),d=l?.getCellIndex(i);l&&d!==void 0&&typeof e.name=="string"&&(t.title=g(9968,"{0} • Cell {1}",e.name,`${d+1}`)),typeof e.name=="string"&&l&&d!==void 0&&typeof e.name=="string"&&(e.name=g(9968,"{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=Qb(e),i=Qb(this.label);return t&&i?t.toString()!==i.toString():!(!t&&!i)}hasPathLabelChanged(e){const t=Qb(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!==Q0.Full&&(this.needsRedraw=e.updateIcon||e.updateDecoration?Q0.Full:Q0.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=Qb(this.label);if(this.options?.title!==void 0&&(t.title=this.options.title),i&&i.scheme!==pe.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=Tx(this.modelService,this.languageService,i,this.options.fileKind,this.options.icon)),N.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!==ba.FILE));const n=this.decoration.value;if(n){if(n.tooltip){if(typeof t.title=="string")t.title=`${t.title} • ${n.tooltip}`;else if(typeof t.title?.markdown=="string"){const o=`${t.title.markdown} • ${n.tooltip}`;t.title={markdown:o,markdownNotSupportedFallback:o}}}n.strikethrough&&(t.strikethrough=!0),this.options.fileDecorations.colors&&t.extraClasses.push(n.labelClassName),this.options.fileDecorations.badges&&(t.extraClasses.push(n.badgeClassName),t.extraClasses.push(n.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}};iCe=D([_(2,xi),_(3,gi),_(4,eE),_(5,Fs),_(6,Fo),_(7,yi),_(8,iXe)],iCe);const t_=fe,dVt="vscode-local-file";function hVt(s){let e;try{e=JSON.parse(s)}catch{throw new Error("Could not parse code block local file data")}let t;try{t=N.revive(e?.uri)}catch{throw new Error("Invalid code block local file data URI")}let i;return e.range&&(i=new F(e.range.startLineNumber+1,e.range.startColumn+1,e.range.endLineNumber+1,e.range.endColumn+1)),{uri:t,range:i}}const qw=10;let nCe=class extends V{constructor(e,t,i,n,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.isDisposed=!1,this.element=t_(".interactive-result-code-block"),this.contextKeyService=this._register(r.createScoped(this.element));const d=this._register(o.createChild(new Uc([Le,this.contextKeyService]))),h=re(this.element,t_(".interactive-result-editor"));this.editor=this.createEditor(d,h,{...cNe(this.configurationService),readOnly:!0,lineNumbers:"off",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:8,dragAndDrop:!1,padding:{top:qw,bottom:qw},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g(10579,"Code block"),overflowWidgetsDomNode:n,...this.getEditorOptionsFromConfig()});const u=re(this.element,t_(".interactive-result-code-block-toolbar")),f=this.editor.contextKeyService.createScoped(u),p=this._register(d.createChild(new Uc([Le,f])));this.toolbar=this._register(p.createInstance(mm,u,t,{menuOptions:{shouldForwardArgs:!0}}));const m=re(this.element,t_(".interactive-result-vulns")),v=re(m,t_(".interactive-result-vulns-header",void 0));this.vulnsButton=this._register(new jd(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=re(m,t_("ul.interactive-result-vulns-list")),this._register(this.vulnsButton.onDidClick(()=>{const b=this.currentCodeBlockData.element;b.vulnerabilitiesListExpanded=!b.vulnerabilitiesListExpanded,this.vulnsButton.label=this.getVulnerabilitiesLabel(),this.element.classList.toggle("chat-vulnerabilities-collapsed",!b.vulnerabilitiesListExpanded),this._onDidChangeContentHeight.fire()})),this._register(this.toolbar.onDidChangeDropdownVisibility(b=>{u.classList.toggle("force-visibility",b)})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(vr.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.editor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.editor.onDidScrollChange(b=>{this.currentScrollWidth=b.scrollWidth})),this._register(this.editor.onDidContentSizeChange(b=>{b.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),cp.get(this.editor)?.stopHighlighting(),this.clearWidgets()})),this._register(this.editor.onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),cp.get(this.editor)?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(b=>{this.clearWidgets()}))}dispose(){this.isDisposed=!0,super.dispose()}get uri(){return this.editor.getModel()?.uri}createEditor(e,t,i){return this._register(e.createInstance(Pk,t,i,{isSimpleWidget:!1,contributions:sp.getSomeEditorContributions([LA.ID,ace,Mb.ID,cp.ID,LW.ID,FA.ID,GM.ID,Pa.ID,Ih.ID,VM.ID,BM.ID])}))}focus(){this.editor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.editor.getLayoutInfo().contentWidth,t=this.editor.getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(qw-t,2):qw;this.editor.updateOptions({padding:{top:qw,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(vr.Chat)?g(10580,"Toolbar for code block which can be reached via tab"):g(10581,"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"?rd.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.isDisposed&&(this.layout(t),i&&(this.disposableStore.clear(),this.disposableStore.add(this.editor.onDidFocusEditorWidget(()=>Tk.setTabFocusMode(!0))),this.disposableStore.add(this.editor.onDidBlurEditorWidget(()=>Tk.setTabFocusMode(!1)))),this.editor.updateOptions({ariaLabel:g(10582,"Code block {0}",e.codeBlockIndex+1),readOnly:!i}),e.hideToolbar?Ud(this.toolbar.getElement()):jh(this.toolbar.getElement()),e.vulns?.length&&vs(e.element)?(Ms(this.vulnsListElement),this.element.classList.remove("no-vulns"),this.element.classList.toggle("chat-vulnerabilities-collapsed",!e.element.vulnerabilitiesListExpanded),re(this.vulnsListElement,...e.vulns.map(n=>t_("li",void 0,t_("span.chat-vuln-title",void 0,n.title)," "+n.description))),this.vulnsButton.label=this.getVulnerabilitiesLabel()):this.element.classList.add("no-vulns"))}reset(){this.clearWidgets()}clearWidgets(){Pa.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,mt.Immediate)),this.toolbar.context={code:t.getTextBuffer().getValueInRange(e.range??t.getFullModelRange(),go.TextDefined),codeBlockIndex:e.codeBlockIndex,element:e.element,languageId:t.getLanguageId()}}getVulnerabilitiesLabel(){return!this.currentCodeBlockData||!this.currentCodeBlockData.vulns?"":`${this.currentCodeBlockData.vulns.length>1?g(10583,"{0} vulnerabilities",this.currentCodeBlockData.vulns.length):g(10584,"{0} vulnerability",1)} $(${(i=>i.vulnerabilitiesListExpanded?ve.chevronDown:ve.chevronRight)(this.currentCodeBlockData.element).id})`}};nCe=D([_(4,we),_(5,Le),_(6,gi),_(7,Te),_(8,mr)],nCe);let sCe=class extends V{constructor(e,t){super(),this._modelService=t,this._register(e.registerTextModelContentProvider(pe.vscodeChatCodeBlock,this))}async provideTextContent(e){const t=this._modelService.getModel(e);return t||this._modelService.createModel("",null,e)}};sCe=D([_(0,fn),_(1,gi)],sCe);let oCe=class extends V{constructor(e,t,i,n,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 wn),this.currentScrollWidth=0,this.element=t_(".interactive-result-code-block"),this.element.classList.add("compare"),this.messageElement=re(this.element,t_(".message")),this.messageElement.setAttribute("role","status"),this.messageElement.tabIndex=0,this.contextKeyService=this._register(r.createScoped(this.element));const u=this._register(o.createChild(new Uc([Le,this.contextKeyService]))),f=re(this.element,t_(".interactive-result-header.show-file-icons")),p=re(this.element,t_(".interactive-result-editor"));this.diffEditor=this.createDiffEditor(u,p,{...cNe(this.configurationService),lineNumbers:"on",selectOnLineNumbers:!0,scrollBeyondLastLine:!1,lineDecorationsWidth:12,dragAndDrop:!1,padding:{top:qw,bottom:qw},mouseWheelZoom:!1,scrollbar:{vertical:"hidden",alwaysConsumeMouseWheel:!1},definitionLinkOpensInPeek:!1,gotoLocation:{multiple:"goto",multipleDeclarations:"goto",multipleDefinitions:"goto",multipleImplementations:"goto"},ariaLabel:g(10579,"Code block"),overflowWidgetsDomNode:n,...this.getEditorOptionsFromConfig()}),this.resourceLabel=this._register(u.createInstance(tCe,f,{supportIcons:!0}));const m=this.diffEditor.getModifiedEditor().contextKeyService.createScoped(f),v=this._register(u.createChild(new Uc([Le,m])));this.toolbar=this._register(v.createInstance(mm,f,t,{menuOptions:{shouldForwardArgs:!0}})),this._configureForScreenReader(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._configureForScreenReader())),this._register(this.configurationService.onDidChangeConfiguration(b=>{b.affectedKeys.has(vr.Chat)&&this._configureForScreenReader()})),this._register(this.options.onDidChange(()=>{this.diffEditor.updateOptions(this.getEditorOptionsFromConfig())})),this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(b=>{this.currentScrollWidth=b.scrollWidth})),this._register(this.diffEditor.onDidContentSizeChange(b=>{b.contentHeightChanged&&this._onDidChangeContentHeight.fire()})),this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(()=>{this.element.classList.remove("focused"),cp.get(this.diffEditor.getModifiedEditor())?.stopHighlighting(),this.clearWidgets()})),this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(()=>{this.element.classList.add("focused"),cp.get(this.diffEditor.getModifiedEditor())?.restoreViewState(!0)})),i.onDidScroll&&this._register(i.onDidScroll(b=>{this.clearWidgets()}))}get uri(){return this.diffEditor.getModifiedEditor().getModel()?.uri}createDiffEditor(e,t,i){const n={isSimpleWidget:!1,contributions:sp.getSomeEditorContributions([LA.ID,ace,Mb.ID,cp.ID,LW.ID,FA.ID,GM.ID,Pa.ID,VM.ID])};return this._register(e.createInstance(pp,t,{scrollbar:{useShadows:!1,alwaysConsumeMouseWheel:!1,ignoreHorizontalScrollbarInContentHeight:!0},renderMarginRevertIcon:!1,diffCodeLens:!1,scrollBeyondLastLine:!1,stickyScroll:{enabled:!1},originalAriaLabel:g(10585,"Original"),modifiedAriaLabel:g(10586,"Modified"),diffAlgorithm:"advanced",readOnly:!1,isInEmbeddedEditor:!0,useInlineViewWhenSpaceIsLimited:!0,experimental:{useTrueInlineView:!0},renderSideBySideInlineBreakpoint:300,renderOverviewRuler:!1,compactMode:!0,hideUnchangedRegions:{enabled:!0,contextLineCount:1},renderGutterMenu:!1,lineNumbersMinChars:1,...i},{originalEditor:n,modifiedEditor:n}))}focus(){this.diffEditor.focus()}updatePaddingForLayout(){const e=this.currentScrollWidth>this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth,t=this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight,i=e?Math.max(qw-t,2):qw;this.diffEditor.updateOptions({padding:{top:qw,bottom:i}})}_configureForScreenReader(){const e=this.toolbar.getElement();this.accessibilityService.isScreenReaderOptimized()?(e.style.display="block",e.ariaLabel=this.configurationService.getValue(vr.Chat)?g(10580,"Toolbar for code block which can be reached via tab"):g(10581,"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"?rd.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(),n={width:e-2,height:t};this.element.style.height=`${n.height}px`,this.element.style.width=`${n.width}px`,this.diffEditor.layout(n),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(10587,"Code Edits")}),this.resourceLabel.element.setFile(e.edit.uri,{fileKind:ba.FILE,fileDecorations:{colors:!0,badges:!1}})}reset(){this.clearWidgets()}clearWidgets(){Pa.get(this.diffEditor.getOriginalEditor())?.hideContentHover(),Pa.get(this.diffEditor.getModifiedEditor())?.hideContentHover()}async updateEditor(e,t){if(!vs(e.element))return;const i=!!(e.edit.state?.applied??0);if(hNt.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});let r;e.edit.state.applied===1?r=g(10588,"Made 1 change in [[``{0}``]]",o):e.edit.state.applied<0?r=g(10589,"Edits in [[``{0}``]] have been rejected",o):r=g(10590,"Made {0} changes in [[``{1}``]]",e.edit.state.applied,o);const a=uLe(r,{renderCodeSegments:!0,actionHandler:{callback:()=>{this.openerService.open(e.edit.uri,{fromUserGesture:!0,allowCommands:!1})},disposables:this._store}});aa(this.messageElement,a)}const n=await e.diffData;if(n){if(i)this.diffEditor.setModel(null),this._lastDiffEditorViewModel.value=void 0;else{const o=this.diffEditor.createViewModel({original:n.original,modified:n.modified});if(await o.waitForDiff(),t.isCancellationRequested)return;this.diffEditor.setModel(o),this._lastDiffEditorViewModel.value=o}this.toolbar.context={edit:e.edit,element:e.element,diffEditor:this.diffEditor}}}clearModel(){this.diffEditor.setModel(null)}};oCe=D([_(4,we),_(5,Le),_(6,gi),_(7,Te),_(8,mr),_(9,Fs),_(10,Ao)],oCe);let rCe=class{constructor(e,t,i){this.modelService=e,this.editorService=t,this.dialogService=i,this._sha1=new j2}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||!ji(r.original.uri,t.uri)||r.modified.uri.scheme!==pe.vscodeChatCodeCompareBlock){i=o;break}}const n=i?await this._applyWithDiffEditor(i,t):await this._apply(t);e.setEditApplied(t,n)}async _applyWithDiffEditor(e,t){const i=e.getModel();if(!i)return 0;const n=e.getDiffComputationResult();if(!n||n.identical||!await this._checkSha1(i.original,t))return 0;const o=new ave(i.modified),r=n.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 n of e.edits){const o=n.map(G1e.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(10591,"The original file has been modified."),detail:g(10592,"Do you want to apply the changes anyway?")})).confirmed)}discard(e,t){e.response.value.includes(t)&&(t.state?.applied||e.setEditApplied(t,-1))}};rCe=D([_(0,fn),_(1,Kt),_(2,to)],rCe);var aCe,sR;let dZ=(sR=class{constructor(e,t,i,n,o){this._session=e,this._editor=t,this._zone=i,this._textFileService=n,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(rCe);for(const n of this._session.chatModel.getRequests())if(n.response?.response){for(const o of n.response.response.value)if(o.kind==="textEditGroup"&&!(e&&ji(o.uri,this._session.textModelN.uri))&&(await i.apply(n.response,o,void 0),o.uri.scheme===pe.untitled)){const r=this._textFileService.untitled.get(o.uri);r&&t.push(r)}}for(const n of t)n.isDisposed()||(await n.resolve(),await n.save({reason:Cn.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:aCe._decoBlock});return cM(t),t}},aCe=sR,sR._decoBlock=Gt.register({description:"inline-chat",showIfCollapsed:!1,isWholeLine:!0,className:"inline-chat-block-selection"}),sR);dZ=aCe=D([_(3,Fo),_(4,we)],dZ);let cCe=class extends dZ{constructor(e,t,i,n,o,r,a){super(e,t,i,r,a),this._ctxDocumentChanged=V4t.bindTo(o);const c=n.getModel(e.targetUri);M.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(){}hasFocus(){return this._zone.widget.hasFocus()}};cCe=D([_(3,gi),_(4,Le),_(5,Fo),_(6,we)],cCe);let lCe=class extends dZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,c,l),this._editorWorkerService=o,this._accessibilityService=r,this._configService=a,this._decoInsertedText=Gt.register({description:"inline-modified-line",className:"inline-chat-inserted-range-linehighlight",isWholeLine:!0,overviewRuler:{position:Dl.Full,color:VFe(Z4t)},minimap:{position:kh.Inline,color:VFe(eVt)}}),this._decoInsertedTextRange=Gt.register({description:"inline-chat-inserted-range-linehighlight",className:"inline-chat-inserted-range",stickiness:ni.NeverGrowsWhenTypingAtEdges}),this._editCount=0,this.acceptHunk=()=>super.acceptHunk(),this.discardHunk=()=>super.discardHunk(),this._hunkDisplayData=new Map,this._ctxCurrentChangeHasDiff=z4t.bindTo(n),this._ctxCurrentChangeShowsDiff=$4t.bindTo(n),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,n){const o=new cu(r=>{const a=new Set;for(const d of r)pi.fromRange(d.range).forEach(h=>a.add(h));const c=this._progressiveEditingDecorations.getRanges().map(pi.fromRange);for(const d of c)d.forEach(h=>a.delete(h));const l=[];for(const d of a)l.push({range:new F(d,1,d,Number.MAX_VALUE),options:this._decoInsertedText});this._progressiveEditingDecorations.append(l)});return this._makeChanges(e,t,i,o,n)}async _makeChanges(e,t,i,n,o){if(o&&this._editor.pushUndoStop(),this._editCount++,i){const r=i.duration/1e3;for(const a of e){const l=wtt(a.text??"")/r,d=rVt(new Q7(this._zone.domNode),a,l,i.token);await oVt(this._session.textModelN,d,n,t)}}else t.start(),this._session.textModelN.pushEditOperations(null,e,r=>(n?.report(r),null)),t.stop()}async renderChanges(){this._progressiveEditingDecorations.clear();const e=()=>{let t;if(oue(this._editor,(i,n)=>{const o=new Set(this._hunkDisplayData.keys());t=void 0;for(const r of this._session.hunkData.getInfo()){o.delete(r);const a=r.getRangesN();let c=this._hunkDisplayData.get(r);if(c)if(r.getState()!==Wh.Pending)c.remove();else{const l=this._zone.position.lineNumber,d=a[0];c.position=d.getStartPosition().delta(-1),c.distance=l<=d.startLineNumber?d.startLineNumber-l:l-d.endLineNumber}else{const l=[];for(let R=0;R{r.acceptChanges(),e()},h=()=>{r.discardChanges(),e()},u=this._session.textModel0.mightContainNonBasicASCII(),f=this._session.textModel0.mightContainRTL(),p=Eae.fromEditor(this._editor),m=r.getRanges0()[0],v=new LYe(pi.fromRangeInclusive(m).mapToLineArray(R=>this._session.textModel0.tokenization.getLineTokens(R)),[],u,f),b=document.createElement("div");b.className="inline-chat-original-zone2";const y={afterLineNumber:-1,heightInLines:TYe(v,p,[new IO(new F(m.startLineNumber,1,m.startLineNumber,1),"",Ja.Regular)],b).heightInLines,domNode:b},C=()=>{const R=pm.capture(this._editor);oue(this._editor,(z,G)=>{if(Tt(c),c.viewZoneId)G.removeZone(c.viewZoneId),c.viewZoneId=void 0;else{const[j]=r.getRangesN();y.afterLineNumber=j.startLineNumber-1,c.viewZoneId=G.addZone(y)}}),this._ctxCurrentChangeShowsDiff.set(typeof c?.viewZoneId=="string"),R.restore(this._editor)},A=()=>{oue(this._editor,(R,z)=>{Tt(c);for(const G of c.decorationIds)R.removeDecoration(G);c.viewZoneId&&z.removeZone(c.viewZoneId),c.decorationIds=[],c.viewZoneId=void 0})},L=R=>{Tt(t);const z=[];for(const G of this._session.hunkData.getInfo())G.getState()===Wh.Pending&&z.push(G.getRangesN()[0].getStartPosition().delta(-1));if(!(z.length<2)){for(let G=0;Gt.acceptHunk(),this.discardHunk=async()=>t.discardHunk(),this.move=o=>t.move(o)}else if(this._hunkDisplayData.size>0){let i=!1;for(const n of this._session.hunkData.getInfo())if(n.getState()===Wh.Accepted){i=!0;break}i?this._onDidAccept.fire():this._onDidDiscard.fire()}return t};return e()?.position}_updateSummaryMessage(e,t){const i=this._configService.getValue(zh.AcceptedOrDiscardBeforeSave);let n;t===0?n=g(10593,"Nothing changed."):e===1?n=i?g(10594,"$(info) Accept or Discard change"):g(10595,"1 change"):n=i?g(10596,"$(info) Accept or Discard {0} changes",e):g(10597,"{0} changes",t);let o;i&&(o=g(10598,"Review (accept or discard) all changes before continuing")),this._zone.widget.updateStatus(n,{title:o})}hasFocus(){return this._zone.widget.hasFocus()}getWholeRangeDecoration(){return[]}};lCe=D([_(3,Le),_(4,Rl),_(5,mr),_(6,Te),_(7,Fo),_(8,we)],lCe);function oue(s,e){s.changeDecorations(t=>{s.changeViewZones(i=>{e(t,i)})})}var uVt=".monaco-workbench .zone-widget.inline-chat-widget{z-index:3}.monaco-workbench .zone-widget.inline-chat-widget .interactive-session{max-width:unset}.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}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part{padding:4px 6px 0}.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-left:6px;padding-right:20px;padding-top:2px}.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-item-container.interactive-item-compact .chat-notification-widget{border:none;margin-bottom:0;padding:0}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-request{border:none}.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.minimal>.header{right:10px;top:5px}.monaco-workbench .inline-chat>.status{align-items:center;display:flex;justify-content:space-between;padding:4px 6px 0}.monaco-workbench .inline-chat .status .actions.hidden{display:none}.monaco-workbench .inline-chat .status .label{color:var(--vscode-descriptionForeground);display:flex;font-size:11px;overflow:hidden;white-space:nowrap}.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 3px}.monaco-workbench .inline-chat .status .actions,.monaco-workbench .inline-chat-content-widget .toolbar{display:flex;height:18px;.actions-container{gap:3px}.action-item.text-only .action-label{border-radius:2px;font-size:12px;line-height:16px;padding:0 4px}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{font-size:12px;height:unset;line-height:16px;width:unset}}.monaco-workbench .inline-chat .status .actions,.monaco-workbench .inline-chat-content-widget.contents .toolbar{.monaco-action-bar .action-item.menu-entry.text-only:first-of-type .action-label{background-color:var(--vscode-button-background);color:var(--vscode-button-foreground)}}.monaco-workbench .inline-chat .status{.actions.text-style{display:none}.actions.button-style{display:inherit}}.monaco-workbench .inline-chat .status.text{.actions.text-style{display:inherit}.actions.button-style{display:none}}.monaco-workbench .inline-chat .status .actions>.monaco-button,.monaco-workbench .inline-chat .status .actions>.monaco-button-dropdown{margin-right:4px}.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:0 2px;white-space:nowrap}.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 .diff-review{background-color:unset;padding:4px 6px}.monaco-workbench .inline-chat .diff-review.hidden{display:none}.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 .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}";ut(uVt,{});let dCe=class extends GEt{constructor(e,t,i,n,o,r){super(e),this._options=t,this._contextMenuService=i,this._keybindingService=n,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 U_),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,t){const i=this._options?.buttonConfigProvider??(()=>({showLabel:!0}));this._updateStore.clear(),this.clear();const n=this._updateStore.add(Wk());for(let o=0;o0,a=e[o];let c,l;if(a instanceof Ik&&a.actions.length>0){const[u,...f]=a.actions;c=u,l=this.addButtonWithDropdown({secondary:i(c)?.isSecondary??r,actionRunner:this._actionRunner,actions:f,contextMenuProvider:this._contextMenuService,ariaLabel:c.label})}else c=a,l=this.addButton({secondary:i(c)?.isSecondary??r,ariaLabel:c.label});l.enabled=c.enabled,l.element.classList.add("default-colors"),i(c)?.showLabel??!0?l.label=c.label:l.element.classList.add("monaco-text-button"),i(c)?.showIcon&&(c instanceof Sc&&We.isThemeIcon(c.item.icon)?l.icon=c.item.icon:c.class&&l.element.classList.add(...c.class.split(" ")));const d=this._keybindingService.lookupKeybinding(c.id);let h;d?h=g(11519,"{0} ({1})",c.label,d.getLabel()):h=c.label,this._updateStore.add(this._hoverService.setupManagedHover(n,l.element,h)),this._updateStore.add(l.onDidClick(async()=>{this._actionRunner.run(c)}))}if(t.length>0){const o=this.addButton({secondary:!0,ariaLabel:g(11520,"More Actions")});o.icon=ve.dropDownButton,o.element.classList.add("default-colors","monaco-text-button"),o.enabled=!0,this._updateStore.add(this._hoverService.setupManagedHover(n,o.element,g(11520,"More Actions"))),this._updateStore.add(o.onDidClick(async()=>{this._contextMenuService.showContextMenu({getAnchor:()=>o.element,getActions:()=>t,actionRunner:this._actionRunner,onHide:()=>o.element.setAttribute("aria-expanded","false")}),o.element.setAttribute("aria-expanded","true")}))}this._onDidChange.fire(this)}};dCe=D([_(2,lr),_(3,Ut),_(4,Yi),_(5,ec)],dCe);let hCe=class extends dCe{constructor(e,t,i,n,o,r,a,c,l){super(e,i,r,a,c,l);const d=n.createMenu(t,o);this._store.add(d);const h=()=>{this.clear();const u=[],f=[];dC(d,i?.menuOptions,{primary:u,secondary:f},i?.toolbarOptions?.primaryGroup),super.update(u,f)};this._store.add(d.onDidChange(h)),h()}dispose(){super.dispose()}update(e){throw new Error("Use Menu or WorkbenchButtonBar")}};hCe=D([_(3,Oa),_(4,Le),_(5,lr),_(6,Ut),_(7,Yi),_(8,ec)],hCe);var gVt='.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 .detail-container{color:var(--vscode-descriptionForeground);font-size:12px;overflow:hidden}.interactive-item-container .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>.value .chat-used-context{margin-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-item-container.minimal{flex-direction:row}.interactive-item-container.minimal .column.left{display:inline-block;flex-grow:0;padding-top:2px}.interactive-item-container.minimal .column.right{display:inline-block;flex-grow:1}.interactive-item-container.minimal .user>.username{display:none}.interactive-item-container.minimal .detail-container{font-size:unset}.interactive-item-container.minimal>.header{position:absolute;right: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-attached-context .chat-attached-context-attachment .monaco-icon-name-container.warning,.chat-attached-context .chat-attached-context-attachment .monaco-icon-suffix-container.warning,.chat-used-context-list .monaco-icon-name-container.warning,.chat-used-context-list .monaco-icon-suffix-container.warning{color:var(--vscode-notificationsWarningIcon-foreground)}.chat-attached-context .chat-attached-context-attachment.show-file-icons.warning{border-color:var(--vscode-notificationsWarningIcon-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);cursor:pointer}.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 .interactive-item-container.interactive-request .chat-attached-context{margin-top:-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 .interactive-item-container.interactive-request .chat-attached-context .chat-attached-context-attachment{padding-right:6px}.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{-webkit-line-clamp:3;-webkit-box-orient:vertical;color:var(--vscode-textLink-foreground);display:block;display:-webkit-box;font-size:12px;overflow:hidden}.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}.chat-code-citation-label{opacity:.7;white-space:pre-wrap}.chat-code-citation-button-container{display:inline}.chat-code-citation-button-container .monaco-button{border:none;color:var(--vscode-textLink-foreground);display:inline;padding:0}';ut(gVt,{});var fVt=".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}.chat-agent-hover .chat-agent-hover-icon .codicon{align-items:center;display:flex;font-size:23px!important;justify-content:center}.chat-agent-hover-publisher{display:flex;gap:4px}.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-header .chat-agent-hover-details{font-size:12px}.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}";ut(fVt,{});let uCe=class{constructor(e){this._accessibleViewService=e}getWidgetRole(){return"list"}getRole(e){return"listitem"}getWidgetAriaLabel(){return g(7005,"Chat")}getAriaLabel(e){return Wu(e)?e.messageText:vs(e)?this._getLabelWithCodeBlockCount(e):JO(e)?e.content.map(t=>"value"in t?t.value:t.map(i=>i.message).join(` `)).join(` -`):""}_getLabelWithCodeBlockCount(e){const t=this._accessibleViewService.getOpenAriaHint(vr.Chat);let i="";const n=e.response.value.filter(a=>!("value"in a))?.length??0;let o="";switch(n){case 0:break;case 1:o=g(7006,"1 file tree");break;default:o=g(7007,"{0} file trees",n);break}const r=zu.lexer(e.response.toString()).filter(a=>a.type==="code")?.length??0;switch(r){case 0:i=t?g(7008,"{0} {1} {2}",o,e.response.toString(),t):g(7009,"{0} {1}",o,e.response.toString());break;case 1:i=t?g(7010,"{0} 1 code block: {1} {2}",o,e.response.toString(),t):g(7011,"{0} 1 code block: {1}",o,e.response.toString());break;default:i=t?g(7012,"{0} {1} code blocks: {2}",o,r,e.response.toString(),t):g(7013,"{0} {1} code blocks",o,r,e.response.toString());break}return i}};vCe=D([_(0,Dm)],vCe);let bCe=class extends zf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,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 Lb(e,{hoverDelegate:r?.hoverDelegate},a,c,l,d,o,h),r?.actionRunner&&(this._primaryAction.actionRunner=r.actionRunner),this._dropdown=new sA(t,i,this._contextMenuProvider,{menuAsChild:r?.menuAsChild??!0,classNames:n?["codicon","codicon-chevron-down",n]:["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=fe(".action-container");this._primaryAction.render(re(this._container,t)),this._dropdownContainer=fe(".dropdown-action-container"),this._dropdown.render(re(this._container,this._dropdownContainer)),this._register(ue(t,ke.KEY_DOWN,i=>{const n=new En(i);n.equals(S.RightArrow)&&(this._primaryAction.element.tabIndex=-1,this._dropdown.focus(),n.stopPropagation())})),this._register(ue(this._dropdownContainer,ke.KEY_DOWN,i=>{const n=new En(i);n.equals(S.LeftArrow)&&(this._primaryAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._primaryAction.element?.focus(),n.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 sA(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()}};bCe=D([_(6,Ut),_(7,bi),_(8,Le),_(9,pn),_(10,mr)],bCe);const Eoe=class Eoe extends li{constructor(){super({id:Eoe.ID,title:Pe(7120,"Send"),f1:!1,category:Ttt,icon:ve.send,precondition:he.and(CMe,K3.negate()),keybinding:{when:SMe,primary:S.Enter,weight:Ae.EditorContrib},menu:[{id:_e.ChatExecuteSecondary,group:"group_1"},{id:_e.ChatExecute,when:K3.negate(),group:"navigation"}]})}run(e,...t){const i=t[0],n=e.get(UN);(i?.widget??n.lastFocusedWidget)?.acceptInput(i?.inputValue)}};Eoe.ID="workbench.action.chat.submit";let wCe=Eoe;const xoe=class xoe extends li{constructor(){super({id:xoe.ID,title:Pe(7121,"Submit to Secondary Agent"),precondition:he.and(CMe,JXe.negate(),K3.negate()),keybinding:{when:SMe,primary:U.CtrlCmd|S.Enter,weight:Ae.EditorContrib},menu:{id:_e.ChatExecuteSecondary,group:"group_1"}})}run(e,...t){const i=t[0],o=e.get(_f).getSecondaryAgent();if(!o)return;const r=e.get(UN),a=i?.widget??r.lastFocusedWidget;a&&(O4t(a.parsedInput).agentPart?a.acceptInput():(a.lastSelectedAgent=o,a.acceptInputWithPrefix(`${QU}${o.name}`)))}};xoe.ID="workbench.action.chat.submitSecondaryAgent";let yCe=xoe;const Doe=class Doe extends li{constructor(){super({id:Doe.ID,title:Pe(7123,"Cancel"),f1:!1,category:Ttt,icon:ve.debugStop,menu:{id:_e.ChatExecute,when:K3,group:"navigation"},keybinding:{weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.Escape,win:{primary:U.Alt|S.Backspace}}})}run(e,...t){const i=t[0],n=e.get(UN),o=i?.widget??n.lastFocusedWidget;if(!o)return;const r=e.get(km);o.viewModel&&r.cancelCurrentRequestForSession(o.viewModel.sessionId)}};Doe.ID="workbench.action.chat.cancel";let CCe=Doe;const xVt=fe;let gZ=class extends V{constructor(e,t,i,n,o,r){super(),this.location=i,this.options=n,this.clickHandler=o,this.chatAgentService=r;const a=re(e,xVt(".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+=`${QU}${c.name} `,"subCommand"in t&&t.subCommand&&(i+=`${nI}${t.subCommand} `)}const n=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 Jd(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(10555,"Follow up question: {0}",n),a.label=new Mt(n),this._register(a.onDidClick(()=>this.clickHandler(t)))}};gZ=D([_(5,_f)],gZ);var bQ;const zI=fe,y4e=250;var nk;let fZ=(nk=class extends V{get attachedContext(){return this._attachedContext}get inputPartHeight(){return this._inputPartHeight}get inputEditor(){return this._inputEditor}constructor(e,t,i,n,o,r,a,c,l,d){super(),this.location=e,this.options=t,this.historyService=i,this.modelService=n,this.instantiationService=o,this.contextKeyService=r,this.configurationService=a,this.keybindingService=c,this.accessibilityService=l,this.logService=d,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._onDidChangeContext=this._register(new I),this.onDidChangeContext=this._onDidChangeContext.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(UA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.inputEditorHeight=0,this.followupsDisposables=this._register(new Z),this.attachedContextDisposables=this._register(new Z),this._inputPartHeight=0,this.inHistoryNavigation=!1,this.inputUri=N.parse(`${bQ.INPUT_SCHEME}:input-${bQ._counter++}`),this.inputEditorMaxHeight=this.options.renderStyle==="compact"?y4e/3:y4e,this.inputEditorHasText=CMe.bindTo(r),this.chatCursorAtTop=ENt.bindTo(r),this.inputEditorHasFocus=SNt.bindTo(r),this.history=this.loadHistory(),this._register(this.historyService.onDidClearHistory(()=>this.history=new J2e([{text:""}],50,C4e))),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration(vr.Chat)&&this.inputEditor.updateOptions({ariaLabel:this._getAriaLabel()})}))}loadHistory(){const e=this.historyService.getHistory(this.location);return e.length===0&&e.push({text:""}),new J2e(e,50,C4e)}_getAriaLabel(){if(this.configurationService.getValue(vr.Chat)){const t=this.keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp)?.getLabel();return t?g(7014,"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(7015,"Chat Input, Type code here and press Enter to run. Use the Chat Accessibility Help command for more information.")}return g(7016,"Chat Input")}updateState(e){if(this.inHistoryNavigation)return;const t={text:this._inputEditor.getValue(),state:e};this.history.isAtEnd()?this.history.replaceLast(t):(this.history.replaceLast(t),this.history.resetCursor())}initForNewChatModel(e,t){this.history=this.loadHistory(),this.history.add({text:e??this.history.current().text,state:t}),e&&this.setValue(e,!1)}logInputHistory(){const e=[...this.history].map(t=>JSON.stringify(t)).join(` -`);this.logService.info(`[${this.location}] Chat input history:`,e)}setVisible(e){this._onDidChangeVisibility.fire(e)}get element(){return this.container}showPreviousValue(){this.history.isAtEnd()?this.saveCurrentValue():this.history.has({text:this._inputEditor.getValue(),state:this.history.current().state})||(this.saveCurrentValue(),this.history.resetCursor()),this.navigateHistory(!0)}showNextValue(){this.history.isAtEnd()||(this.history.has({text:this._inputEditor.getValue(),state:this.history.current().state})||(this.saveCurrentValue(),this.history.resetCursor()),this.navigateHistory(!1))}navigateHistory(e){const t=e?this.history.previous():this.history.next();if(Ah(t.text),this.inHistoryNavigation=!0,this.setValue(t.text,!0),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(S4e(i))}}setValue(e,t){this.inputEditor.setValue(e),this.inputEditor.setPosition({lineNumber:1,column:e.length+1}),t||this.saveCurrentValue()}saveCurrentValue(){const e={text:this._inputEditor.getValue(),state:this.history.current().state};this.history.replaceLast(e)}focus(){this._inputEditor.focus()}hasFocus(){return this._inputEditor.hasWidgetFocus()}async acceptInput(e){if(e){const i={text:this._inputEditor.getValue(),state:this.history.current().state};this.history.replaceLast(i),this.history.add({text:""})}this._onDidLoadInputState.fire({}),this.accessibilityService.isScreenReaderOptimized()&&Qt?this._acceptInputForVoiceover():(this._inputEditor.focus(),this._inputEditor.setValue(""))}_acceptInputForVoiceover(){const e=this._inputEditor.getDomNode();e&&(e.remove(),this._inputEditor.setValue(""),this._inputEditorElement.appendChild(e),this._inputEditor.focus())}clearContext(){if(this._attachedContext.size>0){const e=Array.from(this._attachedContext);this._attachedContext.clear(),this._onDidChangeContext.fire({removed:e})}}attachContext(e,...t){const i=[];if(e&&(i.push(...Array.from(this._attachedContext)),this._attachedContext.clear()),t.length>0)for(const n of t)this._attachedContext.add(n);(i.length>0||t.length>0)&&(this.initAttachedContext(this.attachedContextContainer),e||this._onDidChangeContext.fire({removed:i,added:t}))}render(e,t,i){this.container=re(e,zI(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=re(this.container,zI(".interactive-input-followups")),this.attachedContextContainer=re(this.container,zI(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const n=re(this.container,zI(".interactive-input-and-side-toolbar")),o=re(n,zI(".interactive-input-and-execute-toolbar")),r=this._register(this.contextKeyService.createScoped(o));SMe.bindTo(r).set(!0);const a=this._register(this.instantiationService.createChild(new Uc([Le,r]))),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(oce(r,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=wNe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=XTe,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"},d.stickyScroll={enabled:!1},this._inputEditorElement=re(o,zI(".interactive-input-editor"));const h=bVt();if(h.contributions?.push(...ap.getSomeEditorContributions([Pa.ID])),this._inputEditor=this._register(a.createInstance(Hk,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._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.historyNavigationBackwardsEnablement.set(m),this.historyNavigationForewardsEnablement.set(f.position.equals(S4e(p)))})),this.toolbar=this._register(this.instantiationService.createInstance(bm,o,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:aA.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===Ir.Panel&&(f.id===wCe.ID||f.id===CCe.ID)&&f instanceof Sc){const m=this.instantiationService.createInstance(Sc,{id:"chat.moreExecuteActions",title:g(7017,"More..."),icon:ve.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(SCe,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(bm,n,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){const t=e.offsetHeight;Ms(e),this.attachedContextDisposables.clear(),uTe(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((i,n)=>{const o=re(e,zI(".chat-attached-context-attachment.show-file-icons")),r=this._contextResourceLabels.create(o,{supportIcons:!0}),a=N.isUri(i.value)?i.value:i.value&&typeof i.value=="object"&&"uri"in i.value&&N.isUri(i.value.uri)?i.value.uri:void 0,c=i.value&&typeof i.value=="object"&&"range"in i.value&&F.isIRange(i.value.range)?i.value.range:void 0;if(a&&i.isFile){const h=Ko(a.path),u=Cb(a.path),f=`${h} ${u}`,p=c?g(7018,"Attached file, {0}, line {1} to line {2}",f,c.startLineNumber,c.endLineNumber):g(7019,"Attached file, {0}",f);r.setFile(a,{fileKind:ba.FILE,hidePath:!0,range:c}),o.ariaLabel=p,o.tabIndex=0}else{const h=i.fullName??i.name,u=i.icon?.id?`$(${i.icon.id}) ${h}`:h;r.setLabel(u,void 0),o.ariaLabel=g(7020,"Attached context, {0}",i.name),o.tabIndex=0}const l=new Jd(o,{supportIcons:!0});n===Math.min(this._indexOfLastAttachedContextDeletedWithKeyboard,this.attachedContext.size-1)&&l.focus(),this.attachedContextDisposables.add(l),l.icon=ve.close;const d=l.onDidClick(h=>{if(this._attachedContext.delete(i),d.dispose(),d_(h)){const u=new En(h);(u.equals(S.Enter)||u.equals(S.Space))&&(this._indexOfLastAttachedContextDeletedWithKeyboard=n)}this._onDidChangeHeight.fire(),this._onDidChangeContext.fire({removed:[i]})});this.attachedContextDisposables.add(d)}),t!==e.offsetHeight&&this._onDidChangeHeight.fire()}async renderFollowups(e,t){this.options.renderFollowups&&(this.followupsDisposables.clear(),Ms(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance(gZ,this.followupsContainer,e,this.location,void 0,i=>this._onDidAcceptFollowup.fire({followup:i,response:t}))),this._onDidChangeHeight.fire())}get contentHeight(){const e=this.getLayoutData();return e.followupsHeight+e.inputPartEditorHeight+e.inputPartVerticalPadding+e.inputEditorBorder+e.implicitContextHeight}layout(e,t){return this.cachedDimensions=new bn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const n=this.getLayoutData(),o=Math.min(n.inputPartEditorHeight,e-n.followupsHeight-n.inputPartVerticalPadding),r=t-n.inputPartHorizontalPadding;this.followupsContainer.style.width=`${r}px`,this._inputPartHeight=n.followupsHeight+o+n.inputPartVerticalPadding+n.inputEditorBorder+n.implicitContextHeight;const a=this._inputEditor.getScrollWidth(),l={width:t-n.inputPartHorizontalPadding-n.editorBorder-n.editorPadding-n.executeToolbarWidth-n.sideToolbarWidth-n.toolbarPadding,height:o};if((!this.previousInputEditorDimension||this.previousInputEditorDimension.width!==l.width||this.previousInputEditorDimension.height!==l.height)&&(this._inputEditor.layout(l),this.previousInputEditorDimension=l),i&&a<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?Pd(this.inputSideToolbarContainer)+4:0}}saveState(){const e=[...this.history];this.historyService.saveHistory(this.location,e)}},bQ=nk,nk.INPUT_SCHEME="chatSessionInput",nk._counter=0,nk);fZ=bQ=D([_(2,kJe),_(3,gi),_(4,we),_(5,Le),_(6,Te),_(7,Ut),_(8,mr),_(9,Ge)],fZ);const C4e=s=>JSON.stringify(s);function S4e(s){return{lineNumber:s.getLineCount(),column:s.getLineLength(s.getLineCount())+1}}let SCe=class extends bCe{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,[],"",n,{getKeyBinding:f=>a.lookupKeybinding(f.id,r)},a,c,r,l,d);const h=i.createMenu(_e.ChatExecuteSecondary,r),u=()=>{const f=[];fC(h,{shouldForwardArgs:!0},f);const p=o.getSecondaryAgent();p&&f.forEach(m=>(m.id===yCe.ID&&(m.label=g(7021,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};SCe=D([_(2,Oa),_(3,lr),_(4,_f),_(5,Le),_(6,Ut),_(7,bi),_(8,pn),_(9,mr)],SCe);var DVt='.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:before{color:var(--vscode-editorError-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-warning:before{color:var(--vscode-editorWarning-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-info:before{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.install.hide,.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.hide,.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-other-server: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 .action-item.disabled .action-label.extension-action.label{opacity:.4!important}.monaco-action-bar .action-item.checkbox-action-item.disabled{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}';ut(DVt,{});const kVt="vscode://schemas/extensions";g(9412,"Extensions"),g(9413,"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(9414,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."),g(9415,"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(9414,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'.");const A4e=["{"," // 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(` -`);var E4e;(function(s){s[s.Local=1]="Local",s[s.Remote=2]="Remote",s[s.Web=3]="Web"})(E4e||(E4e={}));g(7542,"Extensions");var Gr;(function(s){s[s.DisabledByTrustRequirement=0]="DisabledByTrustRequirement",s[s.DisabledByExtensionKind=1]="DisabledByExtensionKind",s[s.DisabledByEnvironment=2]="DisabledByEnvironment",s[s.EnabledByEnvironment=3]="EnabledByEnvironment",s[s.DisabledByVirtualWorkspace=4]="DisabledByVirtualWorkspace",s[s.DisabledByExtensionDependency=5]="DisabledByExtensionDependency",s[s.DisabledGlobally=6]="DisabledGlobally",s[s.DisabledWorkspace=7]="DisabledWorkspace",s[s.EnabledGlobally=8]="EnabledGlobally",s[s.EnabledWorkspace=9]="EnabledWorkspace"})(Gr||(Gr={}));var ACe;(function(s){s[s.Workspace=0]="Workspace",s[s.File=1]="File",s[s.Executable=2]="Executable",s[s.WorkspaceConfig=3]="WorkspaceConfig",s[s.DynamicWorkspace=4]="DynamicWorkspace",s[s.Experimental=5]="Experimental",s[s.Application=6]="Application"})(ACe||(ACe={}));const IVt="addRootFolder";Pe(5518,"Add Folder to Workspace...");const TVt="setRootFolder",Mtt="_workbench.pickWorkspaceFolder";_t.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:s=>s.get(ag).pickFileFolderAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"_files.pickFolderAndOpen",handler:(s,e)=>s.get(ag).pickFolderAndOpen(e)});_t.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:s=>s.get(ag).pickFolderAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:s=>s.get(ag).pickFileAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:s=>s.get(ag).pickWorkspaceAndOpen({forceNewWindow:!0})});_t.registerCommand({id:IVt,handler:async s=>{const e=s.get(iC),t=await Ntt(s);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});_t.registerCommand({id:TVt,handler:async s=>{const e=s.get(iC),t=s.get(yi),i=await Ntt(s);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(n=>({uri:n})))}});async function Ntt(s){const e=s.get(ag),t=s.get(bf);return await e.showOpenDialog({openLabel:vMe(g(5519,"&&Add")),title:g(5520,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}_t.registerCommand(Mtt,async function(s,e){const t=s.get(In),i=s.get(Fs),n=s.get(yi),o=s.get(gi),r=s.get(xi),a=n.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(Lr(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:Mx(o,r,u.uri,ba.ROOT_FOLDER)}}),l=(e?e[0]:void 0)||Object.create(null);l.activeItem||(l.activeItem=c[0]),l.placeHolder||(l.placeHolder=g(5521,"Select workspace folder")),typeof l.matchOnDescription!="boolean"&&(l.matchOnDescription=!0);const d=(e?e[1]:void 0)||He.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});_t.registerCommand({id:"vscode.openFolder",handler:(s,e,t)=>{const i=s.get(vi);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 n=N.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=mae(n)||n.scheme===pe.untitled?{workspaceUri:n}:{folderUri:n};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:s=>s==null||s instanceof N},{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:s=>s===void 0||typeof s=="object"||typeof s=="boolean"}]}});_t.registerCommand({id:"vscode.newWindow",handler:(s,e)=>{const t=s.get(vi),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:s=>s===void 0||typeof s=="object"}]}});_t.registerCommand("_workbench.removeFromRecentlyOpened",function(s,e){return s.get(xI).removeRecentlyOpened([e])});_t.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(s,e)=>{const t=s.get(xI);return typeof e=="string"?e=e.match(/^[^:/?#]+:\/\//)?N.parse(e):N.file(e):e=N.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:s=>typeof s=="string"||s instanceof N}]}});_t.registerCommand("_workbench.addToRecentlyOpened",async function(s,e){const t=s.get(xI),i=e.uri,n=e.label,o=e.remoteAuthority;let r;return e.type==="workspace"?r={workspace:await t.getWorkspaceIdentifier(i),label:n,remoteAuthority:o}:e.type==="folder"?r={folderUri:i,label:n,remoteAuthority:o}:r={fileUri:i,label:n,remoteAuthority:o},t.addRecentlyOpened([r])});_t.registerCommand("_workbench.getRecentlyOpened",async function(s){return s.get(xI).getRecentlyOpened()});const sG=pn,yF=".vscode/extensions.json";let x4e=class extends V{constructor(e,t,i,n,o,r){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=n,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(yF))))&&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(n=>this.resolveWorkspaceFolderExtensionConfig(n)))),t}async getRecommendations(){const e=await this.getExtensionsConfigs();return ja(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return ja(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,n=new ui;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const o=i&&i.recommendations?.some(l=>l.toLowerCase()===e),r=t.folders.filter(l=>n.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(3847,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(3848,"Add extension recommendation to"));for(const l of c)Yme(l)?await this.addOrRemoveWorkspaceRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderRecommendation(e,l,n.get(l.uri),!a)}async toggleUnwantedRecommendation(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,n=new ui;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const o=i&&i.unwantedRecommendations?.some(l=>l===e),r=t.folders.filter(l=>n.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(3847,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(3848,"Add extension recommendation to"));for(const l of c)Yme(l)?await this.addOrRemoveWorkspaceUnwantedRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderUnwantedRecommendation(e,l,n.get(l.uri),!a)}async addOrRemoveWorkspaceFolderRecommendation(e,t,i,n){const o=[];if(n){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(yF),o,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,n){const o=[];if(i){if(n){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 n&&o.push({path:["extensions"],value:{recommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,n){const o=[];if(n){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(yF),o,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,n){const o=[];if(i){if(n){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 n&&o.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async pickWorkspaceOrFolders(e,t,i){const n=t?[...e,t]:[...e];if(n.length===1)return n;const o=e.map(a=>({label:a.name,description:g(3849,"Workspace Folder"),workspaceOrFolder:a,iconClasses:Mx(this.modelService,this.languageService,a.uri,ba.ROOT_FOLDER)}));return t&&(o.push({type:"separator"}),o.push({label:g(3850,"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=sf(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(yF)),i=sf(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:ja((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:ja((e.unwantedRecommendations||[]).map(t=>t.toLowerCase()))}}getEditToRemoveValueFromArray(e,t,i){const n=t?.indexOf(i);if(n!==void 0&&n!==-1)return{path:[...e,n],value:void 0}}};x4e=D([_(0,yi),_(1,Jt),_(2,In),_(3,gi),_(4,xi),_(5,DI)],x4e);oi("extensions-view-icon",ve.extensions,g(9483,"View icon of the extensions view."));const LVt=oi("extensions-manage",ve.gear,g(9484,"Icon for the 'Manage' action in the extensions view."));oi("extensions-clear-search-results",ve.clearAll,g(9485,"Icon for the 'Clear Search Result' action in the extensions view."));oi("extensions-refresh",ve.refresh,g(9486,"Icon for the 'Refresh' action in the extensions view."));oi("extensions-filter",ve.filter,g(9487,"Icon for the 'Filter' action in the extensions view."));oi("extensions-install-local-in-remote",ve.cloudDownload,g(9488,"Icon for the 'Install Local Extension in Remote' action in the extensions view."));oi("extensions-install-workspace-recommended",ve.cloudDownload,g(9489,"Icon for the 'Install Workspace Recommended Extensions' action in the extensions view."));oi("extensions-configure-recommended",ve.pencil,g(9490,"Icon for the 'Configure Recommended Extensions' action in the extensions view."));const RVt=oi("extensions-sync-enabled",ve.sync,g(9491,"Icon to indicate that an extension is synced.")),MVt=oi("extensions-sync-ignored",ve.syncIgnored,g(9492,"Icon to indicate that an extension is ignored when syncing."));oi("extensions-remote",ve.remote,g(9493,"Icon to indicate that an extension is remote in the extensions view and editor."));oi("extensions-install-count",ve.cloudDownload,g(9494,"Icon shown along with the install count in the extensions view and editor."));oi("extensions-rating",ve.star,g(9495,"Icon shown along with the rating in the extensions view and editor."));const NVt=oi("extensions-verified-publisher",ve.verifiedFilled,g(9496,"Icon used for the verified extension publisher in the extensions view and editor."));oi("extensions-pre-release",ve.versions,g(9497,"Icon shown for extensions having pre-release versions in extensions view and editor."));oi("extensions-sponsor",ve.heartFilled,g(9498,"Icon used for sponsoring extensions in the extensions view and editor."));oi("extensions-star-full",ve.starFull,g(9499,"Full star icon used for the rating in the extensions editor."));oi("extensions-star-half",ve.starHalf,g(9500,"Half star icon used for the rating in the extensions editor."));oi("extensions-star-empty",ve.starEmpty,g(9501,"Empty star icon used for the rating in the extensions editor."));const jC=oi("extensions-error-message",ve.error,g(9502,"Icon shown with a error message in the extensions editor.")),dh=oi("extensions-warning-message",ve.warning,g(9503,"Icon shown with a warning message in the extensions editor.")),e_=oi("extensions-info-message",ve.info,g(9504,"Icon shown with an info message in the extensions editor.")),$I=oi("extension-workspace-trust",ve.shield,g(9505,"Icon shown with a workspace trust message in the extension editor."));oi("extension-activation-time",ve.history,g(9506,"Icon shown with a activation time message in the extension editor."));function ECe(s){return s.scheme!==pe.file&&s.scheme!==pe.vscodeRemote}function yNe(s){if(s.folders.length)return s.folders.every(e=>ECe(e.uri))?s.folders[0].uri:void 0;if(s.configuration&&ECe(s.configuration))return s.configuration}function Ptt(s){return yNe(s)?.scheme}function Ftt(s){return yNe(s)!==void 0}function Ece(s){return s.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let D4e=class extends V{constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new ci;setTimeout(()=>e.cancel(),1e3);let t;try{t=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}const n=t.firstPage.filter(o=>o.properties.localizedLanguages?.length&&o.tags.some(r=>r.startsWith("lp-"))).map(o=>{const r=o.properties.localizedLanguages?.[0],a=Ece(o);return{...this.createQuickPickItem(a,r,o),extensionId:o.identifier.id,galleryExtension:o}});return n.push(this.createQuickPickItem("en","English")),n}createQuickPickItem(e,t,i){const n=t??e;let o;if(n!==e&&(o=`(${e})`),e.toLowerCase()===ql.toLowerCase()&&(o??="",o+=g(3255," (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:n,description:o}}};D4e=D([_(0,EI)],D4e);var yV,g0,SC,OP,f0,wQ,CV,BP,p0,yQ,CQ,SQ,AQ,EQ,SV,m0,_0,v0,b0,w0,xQ,DQ,kQ,IQ,AV,EV,AE,TQ,LQ;let zW=class extends rn{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super("extension.promptExtensionInstallFailure"),this.extension=e,this.version=t,this.installOperation=i,this.error=n,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(Fr(this.error))return;if(this.logService.error(this.error),this.error.name===uw.Unsupported){const r=Wn?g(7874,"{0} for the Web",this.productService.nameLong):this.productService.nameLong,a=g(7875,"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:Xe.Info,message:a,primaryButton:g(7876,"&&More Information"),cancelButton:g(7877,"Close")});c&&this.openerService.open(Wn?N.parse("https://aka.ms/vscode-web-extensions-guide"):N.parse("https://aka.ms/vscode-remote"));return}if(uw.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:su(this.error),buttons:[{label:g(7878,"Install Pre-Release"),run:()=>{const r=this.instantiationService.createInstance(LT,{installPreReleaseVersion:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(7879,"Cancel")});return}if([uw.Incompatible,uw.IncompatibleApi,uw.IncompatibleTargetPlatform,uw.Malicious,uw.Deprecated].includes(this.error.name)){await this.dialogService.info(su(this.error));return}if(uw.Signature===this.error.name){await this.dialogService.prompt({type:"error",message:g(7880,"{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(7881,"Install Anyway"),run:()=>{const r=this.instantiationService.createInstance(LT,{donotVerifySignature:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(7879,"Cancel")});return}const e=this.installOperation===LA.Update?g(7882,"Error while updating '{0}' extension.",this.extension.displayName||this.extension.identifier.id):g(7883,"Error while installing '{0}' extension.",this.extension.displayName||this.extension.identifier.id);let t;const i=[],n=await this.getDownloadUrl();n&&(t=g(7884,"Please check the [log]({0}) for more details.",`command:${uet}`),i.push({label:g(7885,"Try Downloading Manually..."),run:()=>this.openerService.open(n).then(()=>{this.notificationService.prompt(Xe.Info,g(7886,"Once downloaded, please manually install the downloaded VSIX of '{0}'.",this.extension.identifier.id),[{label:g(7887,"Install from VSIX..."),run:()=>this.commandService.executeCommand(XFt)}])})}));const o=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(Xe.Error,o,i)}async getDownloadUrl(){if(dm||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==Es.UNIVERSAL&&e!==Es.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,He.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==Es.UNKNOWN)return N.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==Es.UNDEFINED?`?targetPlatform=${e}`:""}`)}};zW=D([_(4,Er),_(5,Ao),_(6,bi),_(7,to),_(8,vi),_(9,Ge),_(10,dv),_(11,we),_(12,EI),_(13,Im)],zW);const Pv=class Pv extends rn{constructor(){super(...arguments),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._extension=null,this._hidden=!1,this.hideOnDisabled=!0}get extension(){return this._extension}set extension(e){this._extension=e,this.update()}get hidden(){return this._hidden}set hidden(e){this._hidden!==e&&(this._hidden=e,this._onDidChange.fire({hidden:e}))}_setEnabled(e){super._setEnabled(e),this.hideOnDisabled&&(this.hidden=!e)}};Pv.EXTENSION_ACTION_CLASS="extension-action",Pv.TEXT_ACTION_CLASS=`${Pv.EXTENSION_ACTION_CLASS} text`,Pv.LABEL_ACTION_CLASS=`${Pv.EXTENSION_ACTION_CLASS} label`,Pv.PROMINENT_LABEL_ACTION_CLASS=`${Pv.LABEL_ACTION_CLASS} prominent`,Pv.ICON_ACTION_CLASS=`${Pv.EXTENSION_ACTION_CLASS} icon`;let yn=Pv;class CNe extends yn{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){t=`${t} action-dropdown`,super(e,void 0,t),this.actionsGroups=i,this.menuActionClassNames=[],this._menuActions=[],this.menuActionClassNames=t.split(" "),this.hideOnDisabled=!1,this.extensionActions=i.flat(),this.update(),this._register(M.any(...this.extensionActions.map(n=>n.onDidChange))(()=>this.update(!0))),this.extensionActions.forEach(n=>this._register(n))}update(e){e||this.extensionActions.forEach(n=>n.update());const t=this.actionsGroups.map(n=>n.filter(o=>!o.hidden));let i=[];for(const n of t)n.length&&(i=[...i,...n,new Ar]);i=i.length?i.slice(0,i.length-1):i,this.primaryAction=i[0],this._menuActions=i.length>1?i:[],this._onDidChange.fire({menuActions:this._menuActions}),this.primaryAction?(this.hidden=!1,this.enabled=this.primaryAction.enabled,this.label=this.getLabel(this.primaryAction),this.tooltip=this.primaryAction.tooltip):(this.hidden=!0,this.enabled=!1)}async run(){this.enabled&&await this.primaryAction?.run()}getLabel(e){return e.label}}var sy;let LT=(sy=class extends yn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,n,o,r,a,c,l,d){super("extensions.install",g(7888,"Install"),yV.CLASS,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=n,this.workbenchThemeService=o,this.labelService=r,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new j7,this.hideOnDisabled=!1,this.options={isMachineScoped:!1,...e},this.update(),this._register(this.labelService.onDidChangeFormatters(()=>this.updateLabel(),this))}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){this.enabled=!1,this.class=yV.HIDE,this.hidden=!0,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Qo.Uninstalled&&(this.options.installPreReleaseVersion&&!this.extension.hasPreReleaseVersion||!this.options.installPreReleaseVersion&&!this.extension.hasReleaseVersion||(this.hidden=!1,this.class=yV.CLASS,await this.extensionsWorkbenchService.canInstall(this.extension)&&(this.enabled=!0,this.updateLabel()))))}async run(){if(!this.extension)return;if(this.extension.deprecationInfo){let t=g(7889,"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 n=[{label:g(7881,"Install Anyway"),run:()=>i.InstallAnyway}];if(this.extension.deprecationInfo.extension){t=g(7890,"This extension is deprecated. Use the {0} extension instead.",this.extension.deprecationInfo.extension.displayName);const r=this.extension.deprecationInfo.extension;n.push({label:g(7891,"&&Open {0}",this.extension.deprecationInfo.extension.displayName),run:async()=>{const[a]=await this.extensionsWorkbenchService.getExtensions([{id:r.id,preRelease:r.preRelease}],He.None);return await this.extensionsWorkbenchService.open(a),i.ShowAlternateExtension}})}else if(this.extension.deprecationInfo.settings){t=g(7892,"This extension is deprecated as this functionality is now built-in to VS Code.");const r=this.extension.deprecationInfo.settings;n.push({label:g(7893,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:r.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Mt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:o}=await this.dialogService.prompt({type:Xe.Warning,message:g(7894,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:Lt(t)?t:void 0,custom:Lt(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:n,cancelButton:{run:()=>i.Cancel}});if(o!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),Mr(g(7895,"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){Mr(g(7896,"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=>Oy(o,e)))return this.instantiationService.createInstance(RCe);if((await this.workbenchThemeService.getFileIconThemes()).some(o=>Oy(o,e)))return this.instantiationService.createInstance(MCe);if((await this.workbenchThemeService.getProductIconThemes()).some(o=>Oy(o,e)))return this.instantiationService.createInstance(NCe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance(zW,e,e.latestVersion,LA.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(dD(e))?new Promise((i,n)=>{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(7897,"Install Workspace Extension"):this.options.installPreReleaseVersion&&this.extension?.hasPreReleaseVersion?e?g(7898,"Install Pre-Release"):g(7899,"Install Pre-Release Version"):this.extension?.hasPreReleaseVersion?e?g(7888,"Install"):g(7900,"Install Release Version"):g(7888,"Install")}},yV=sy,sy.CLASS=`${sy.LABEL_ACTION_CLASS} prominent install`,sy.HIDE=`${sy.CLASS} hide`,sy);LT=yV=D([_(1,Xo),_(2,we),_(3,fs),_(4,sG),_(5,Fs),_(6,to),_(7,B6),_(8,Yi),_(9,yi)],LT);let k4e=class extends CNe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions",LT.CLASS,[[e.createInstance(LT,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(LT,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};k4e=D([_(0,we),_(1,Xo)],k4e);const v1=class v1 extends yn{constructor(){super("extension.installing",v1.LABEL,v1.CLASS,!1)}update(){this.class=`${v1.CLASS}${this.extension&&this.extension.state===Qo.Installing?"":" hide"}`}};v1.LABEL=g(7901,"Installing"),v1.CLASS=`${yn.LABEL_ACTION_CLASS} install installing`;let I4e=v1;var oy;let $W=(oy=class extends yn{constructor(e,t,i,n,o,r){super(e,g0.INSTALL_LABEL,g0.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=n,this.extensionManagementServerService=o,this.extensionManifestPropertiesService=r,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=g0.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>Ra(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Qo.Installing&&!e.local&&(this.enabled=!0,this.label=g0.INSTALLING_LABEL,this.class=g0.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Qo.Installed||this.extension.type!==br.User||this.extension.enablementState===Gr.DisabledByEnvironment||this.extension.enablementState===Gr.DisabledByTrustRequirement||this.extension.enablementState===Gr.DisabledByVirtualWorkspace?!1:!!(LRe(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),Mr(g(7895,"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)}},g0=oy,oy.INSTALL_LABEL=g(7888,"Install"),oy.INSTALLING_LABEL=g(7901,"Installing"),oy.Class=`${yn.LABEL_ACTION_CLASS} prominent install-other-server`,oy.InstallingClass=`${yn.LABEL_ACTION_CLASS} install-other-server installing`,oy);$W=g0=D([_(3,Xo),_(4,dv),_(5,Im)],$W);let xCe=class extends $W{constructor(e,t,i,n){super("extensions.remoteinstall",i.remoteExtensionManagementServer,e,t,i,n)}getInstallLabel(){return this.extensionManagementServerService.remoteExtensionManagementServer?g(7902,"Install in {0}",this.extensionManagementServerService.remoteExtensionManagementServer.label):$W.INSTALL_LABEL}};xCe=D([_(1,Xo),_(2,dv),_(3,Im)],xCe);let T4e=class extends $W{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7903,"Install Locally")}};T4e=D([_(0,Xo),_(1,dv),_(2,Im)],T4e);let L4e=class extends $W{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7904,"Install in Browser")}};L4e=D([_(0,Xo),_(1,dv),_(2,Im)],L4e);var ry;let DCe=(ry=class extends yn{constructor(e,t){super("extensions.uninstall",SC.UninstallLabel,SC.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===Qo.Uninstalling){this.label=SC.UninstallingLabel,this.class=SC.UnInstallingClass,this.enabled=!1;return}if(this.label=SC.UninstallLabel,this.class=SC.UninstallClass,this.tooltip=SC.UninstallLabel,e!==Qo.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){Mr(g(7907,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),Mr(g(7908,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){Fr(e)||this.dialogService.error(su(e))}}}},SC=ry,ry.UninstallLabel=g(7905,"Uninstall"),ry.UninstallingLabel=g(7906,"Uninstalling"),ry.UninstallClass=`${yn.LABEL_ACTION_CLASS} uninstall`,ry.UnInstallingClass=`${yn.LABEL_ACTION_CLASS} uninstall uninstalling`,ry);DCe=SC=D([_(0,Xo),_(1,to)],DCe);var ay;let R4e=(ay=class extends yn{constructor(e,t,i,n,o){super("extensions.update",g(7909,"Update"),OP.DisabledClass,!1),this.verbose=e,this.extensionsWorkbenchService=t,this.dialogService=i,this.openerService=n,this.instantiationService=o,this.updateThrottler=new j7,this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement()),this.extension&&(this.label=this.verbose?g(7910,"Update to v{0}",this.extension.latestVersion):g(7909,"Update"))}async computeAndUpdateEnablement(){if(this.enabled=!1,this.class=OP.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Qo.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?OP.EnabledClass:OP.DisabledClass}async run(){if(!this.extension)return;const e=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(e){const{result:t}=await this.dialogService.prompt({type:"warning",title:g(7911,"Update {0} Extension",this.extension.displayName),message:g(7912,`{0} +`):""}_getLabelWithCodeBlockCount(e){const t=this._accessibleViewService.getOpenAriaHint(vr.Chat);let i="";const n=e.response.value.filter(a=>!("value"in a))?.length??0;let o="";switch(n){case 0:break;case 1:o=g(7006,"1 file tree");break;default:o=g(7007,"{0} file trees",n);break}const r=Uu.lexer(e.response.toString()).filter(a=>a.type==="code")?.length??0;switch(r){case 0:i=t?g(7008,"{0} {1} {2}",o,e.response.toString(),t):g(7009,"{0} {1}",o,e.response.toString());break;case 1:i=t?g(7010,"{0} 1 code block: {1} {2}",o,e.response.toString(),t):g(7011,"{0} 1 code block: {1}",o,e.response.toString());break;default:i=t?g(7012,"{0} {1} code blocks: {2}",o,r,e.response.toString(),t):g(7013,"{0} {1} code blocks",o,r,e.response.toString());break}return i}};uCe=D([_(0,Am)],uCe);let gCe=class extends Hf{get onDidChangeDropdownVisibility(){return this._dropdown.onDidChangeVisibility}constructor(e,t,i,n,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 kb(e,{hoverDelegate:r?.hoverDelegate},a,c,l,d,o,h),r?.actionRunner&&(this._primaryAction.actionRunner=r.actionRunner),this._dropdown=new nA(t,i,this._contextMenuProvider,{menuAsChild:r?.menuAsChild??!0,classNames:n?["codicon","codicon-chevron-down",n]:["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=fe(".action-container");this._primaryAction.render(re(this._container,t)),this._dropdownContainer=fe(".dropdown-action-container"),this._dropdown.render(re(this._container,this._dropdownContainer)),this._register(ue(t,ke.KEY_DOWN,i=>{const n=new En(i);n.equals(S.RightArrow)&&(this._primaryAction.element.tabIndex=-1,this._dropdown.focus(),n.stopPropagation())})),this._register(ue(this._dropdownContainer,ke.KEY_DOWN,i=>{const n=new En(i);n.equals(S.LeftArrow)&&(this._primaryAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._primaryAction.element?.focus(),n.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 nA(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()}};gCe=D([_(6,Ut),_(7,bi),_(8,Le),_(9,pn),_(10,mr)],gCe);const yoe=class yoe extends li{constructor(){super({id:yoe.ID,title:Fe(7120,"Send"),f1:!1,category:Ctt,icon:ve.send,precondition:he.and(dMe,z3.negate()),keybinding:{when:hMe,primary:S.Enter,weight:Ae.EditorContrib},menu:[{id:_e.ChatExecuteSecondary,group:"group_1"},{id:_e.ChatExecute,when:z3.negate(),group:"navigation"}]})}run(e,...t){const i=t[0],n=e.get(ON);(i?.widget??n.lastFocusedWidget)?.acceptInput(i?.inputValue)}};yoe.ID="workbench.action.chat.submit";let fCe=yoe;const Coe=class Coe extends li{constructor(){super({id:Coe.ID,title:Fe(7121,"Submit to Secondary Agent"),precondition:he.and(dMe,zXe.negate(),z3.negate()),keybinding:{when:hMe,primary:U.CtrlCmd|S.Enter,weight:Ae.EditorContrib},menu:{id:_e.ChatExecuteSecondary,group:"group_1"}})}run(e,...t){const i=t[0],o=e.get(ff).getSecondaryAgent();if(!o)return;const r=e.get(ON),a=i?.widget??r.lastFocusedWidget;a&&(x4t(a.parsedInput).agentPart?a.acceptInput():(a.lastSelectedAgent=o,a.acceptInputWithPrefix(`${zU}${o.name}`)))}};Coe.ID="workbench.action.chat.submitSecondaryAgent";let pCe=Coe;const Soe=class Soe extends li{constructor(){super({id:Soe.ID,title:Fe(7123,"Cancel"),f1:!1,category:Ctt,icon:ve.debugStop,menu:{id:_e.ChatExecute,when:z3,group:"navigation"},keybinding:{weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.Escape,win:{primary:U.Alt|S.Backspace}}})}run(e,...t){const i=t[0],n=e.get(ON),o=i?.widget??n.lastFocusedWidget;if(!o)return;const r=e.get(Em);o.viewModel&&r.cancelCurrentRequestForSession(o.viewModel.sessionId)}};Soe.ID="workbench.action.chat.cancel";let mCe=Soe;const pVt=fe;let hZ=class extends V{constructor(e,t,i,n,o,r){super(),this.location=i,this.options=n,this.clickHandler=o,this.chatAgentService=r;const a=re(e,pVt(".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+=`${zU}${c.name} `,"subCommand"in t&&t.subCommand&&(i+=`${Xk}${t.subCommand} `)}const n=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 jd(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(10555,"Follow up question: {0}",n),a.label=new Mt(n),this._register(a.onDidClick(()=>this.clickHandler(t)))}};hZ=D([_(5,ff)],hZ);var _Q;const OI=fe,l4e=250;var XD;let uZ=(XD=class extends V{get attachedContext(){return this._attachedContext}get inputPartHeight(){return this._inputPartHeight}get inputEditor(){return this._inputEditor}constructor(e,t,i,n,o,r,a,c,l,d){super(),this.location=e,this.options=t,this.historyService=i,this.modelService=n,this.instantiationService=o,this.contextKeyService=r,this.configurationService=a,this.keybindingService=c,this.accessibilityService=l,this.logService=d,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._onDidChangeContext=this._register(new I),this.onDidChangeContext=this._onDidChangeContext.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(WA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.inputEditorHeight=0,this.followupsDisposables=this._register(new Z),this.attachedContextDisposables=this._register(new Z),this._inputPartHeight=0,this.inHistoryNavigation=!1,this.inputUri=N.parse(`${_Q.INPUT_SCHEME}:input-${_Q._counter++}`),this.inputEditorMaxHeight=this.options.renderStyle==="compact"?l4e/3:l4e,this.inputEditorHasText=dMe.bindTo(r),this.chatCursorAtTop=fNt.bindTo(r),this.inputEditorHasFocus=uNt.bindTo(r),this.history=this.loadHistory(),this._register(this.historyService.onDidClearHistory(()=>this.history=new W2e([{text:""}],50,d4e))),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration(vr.Chat)&&this.inputEditor.updateOptions({ariaLabel:this._getAriaLabel()})}))}loadHistory(){const e=this.historyService.getHistory(this.location);return e.length===0&&e.push({text:""}),new W2e(e,50,d4e)}_getAriaLabel(){if(this.configurationService.getValue(vr.Chat)){const t=this.keybindingService.lookupKeybinding(Yd.OpenAccessibilityHelp)?.getLabel();return t?g(7014,"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(7015,"Chat Input, Type code here and press Enter to run. Use the Chat Accessibility Help command for more information.")}return g(7016,"Chat Input")}updateState(e){if(this.inHistoryNavigation)return;const t={text:this._inputEditor.getValue(),state:e};this.history.isAtEnd()?this.history.replaceLast(t):(this.history.replaceLast(t),this.history.resetCursor())}initForNewChatModel(e,t){this.history=this.loadHistory(),this.history.add({text:e??this.history.current().text,state:t}),e&&this.setValue(e,!1)}logInputHistory(){const e=[...this.history].map(t=>JSON.stringify(t)).join(` +`);this.logService.info(`[${this.location}] Chat input history:`,e)}setVisible(e){this._onDidChangeVisibility.fire(e)}get element(){return this.container}showPreviousValue(){this.history.isAtEnd()?this.saveCurrentValue():this.history.has({text:this._inputEditor.getValue(),state:this.history.current().state})||(this.saveCurrentValue(),this.history.resetCursor()),this.navigateHistory(!0)}showNextValue(){this.history.isAtEnd()||(this.history.has({text:this._inputEditor.getValue(),state:this.history.current().state})||(this.saveCurrentValue(),this.history.resetCursor()),this.navigateHistory(!1))}navigateHistory(e){const t=e?this.history.previous():this.history.next();if(Ch(t.text),this.inHistoryNavigation=!0,this.setValue(t.text,!0),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(h4e(i))}}setValue(e,t){this.inputEditor.setValue(e),this.inputEditor.setPosition({lineNumber:1,column:e.length+1}),t||this.saveCurrentValue()}saveCurrentValue(){const e={text:this._inputEditor.getValue(),state:this.history.current().state};this.history.replaceLast(e)}focus(){this._inputEditor.focus()}hasFocus(){return this._inputEditor.hasWidgetFocus()}async acceptInput(e){if(e){const i={text:this._inputEditor.getValue(),state:this.history.current().state};this.history.replaceLast(i),this.history.add({text:""})}this._onDidLoadInputState.fire({}),this.accessibilityService.isScreenReaderOptimized()&&Qt?this._acceptInputForVoiceover():(this._inputEditor.focus(),this._inputEditor.setValue(""))}_acceptInputForVoiceover(){const e=this._inputEditor.getDomNode();e&&(e.remove(),this._inputEditor.setValue(""),this._inputEditorElement.appendChild(e),this._inputEditor.focus())}clearContext(){if(this._attachedContext.size>0){const e=Array.from(this._attachedContext);this._attachedContext.clear(),this._onDidChangeContext.fire({removed:e})}}attachContext(e,...t){const i=[];if(e&&(i.push(...Array.from(this._attachedContext)),this._attachedContext.clear()),t.length>0)for(const n of t)this._attachedContext.add(n);(i.length>0||t.length>0)&&(this.initAttachedContext(this.attachedContextContainer),e||this._onDidChangeContext.fire({removed:i,added:t}))}render(e,t,i){this.container=re(e,OI(".interactive-input-part")),this.container.classList.toggle("compact",this.options.renderStyle==="compact"),this.followupsContainer=re(this.container,OI(".interactive-input-followups")),this.attachedContextContainer=re(this.container,OI(".chat-attached-context")),this.initAttachedContext(this.attachedContextContainer);const n=re(this.container,OI(".interactive-input-and-side-toolbar")),o=re(n,OI(".interactive-input-and-execute-toolbar")),r=this._register(this.contextKeyService.createScoped(o));hMe.bindTo(r).set(!0);const a=this._register(this.instantiationService.createChild(new Uc([Le,r]))),{historyNavigationBackwardsEnablement:c,historyNavigationForwardsEnablement:l}=this._register(tce(r,this));this.historyNavigationBackwardsEnablement=c,this.historyNavigationForewardsEnablement=l;const d=cNe(this.configurationService);d.overflowWidgetsDomNode=this.options.editorOverflowWidgetsDomNode,d.readOnly=!1,d.ariaLabel=this._getAriaLabel(),d.fontFamily=HTe,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"},d.stickyScroll={enabled:!1},this._inputEditorElement=re(o,OI(".interactive-input-editor"));const h=cVt();if(h.contributions?.push(...sp.getSomeEditorContributions([Pa.ID])),this._inputEditor=this._register(a.createInstance(Pk,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._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.historyNavigationBackwardsEnablement.set(m),this.historyNavigationForewardsEnablement.set(f.position.equals(h4e(p)))})),this.toolbar=this._register(this.instantiationService.createInstance(mm,o,this.options.menus.executeToolbar,{telemetrySource:this.options.menus.telemetrySource,menuOptions:{shouldForwardArgs:!0},hiddenItemStrategy:rA.Ignore,actionViewItemProvider:(f,p)=>{if(this.location===Ir.Panel&&(f.id===fCe.ID||f.id===mCe.ID)&&f instanceof Sc){const m=this.instantiationService.createInstance(Sc,{id:"chat.moreExecuteActions",title:g(7017,"More..."),icon:ve.chevronDown},void 0,void 0,void 0,void 0);return this.instantiationService.createInstance(_Ce,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(mm,n,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){const t=e.offsetHeight;Ms(e),this.attachedContextDisposables.clear(),eTe(!!this.attachedContext.size,this.attachedContextContainer),this.attachedContext.size||(this._indexOfLastAttachedContextDeletedWithKeyboard=-1),[...this.attachedContext.values()].forEach((i,n)=>{const o=re(e,OI(".chat-attached-context-attachment.show-file-icons")),r=this._contextResourceLabels.create(o,{supportIcons:!0}),a=N.isUri(i.value)?i.value:i.value&&typeof i.value=="object"&&"uri"in i.value&&N.isUri(i.value.uri)?i.value.uri:void 0,c=i.value&&typeof i.value=="object"&&"range"in i.value&&F.isIRange(i.value.range)?i.value.range:void 0;if(a&&i.isFile){const h=Ko(a.path),u=bb(a.path),f=`${h} ${u}`,p=c?g(7018,"Attached file, {0}, line {1} to line {2}",f,c.startLineNumber,c.endLineNumber):g(7019,"Attached file, {0}",f);r.setFile(a,{fileKind:ba.FILE,hidePath:!0,range:c}),o.ariaLabel=p,o.tabIndex=0}else{const h=i.fullName??i.name,u=i.icon?.id?`$(${i.icon.id}) ${h}`:h;r.setLabel(u,void 0),o.ariaLabel=g(7020,"Attached context, {0}",i.name),o.tabIndex=0}const l=new jd(o,{supportIcons:!0});n===Math.min(this._indexOfLastAttachedContextDeletedWithKeyboard,this.attachedContext.size-1)&&l.focus(),this.attachedContextDisposables.add(l),l.icon=ve.close;const d=l.onDidClick(h=>{if(this._attachedContext.delete(i),d.dispose(),a_(h)){const u=new En(h);(u.equals(S.Enter)||u.equals(S.Space))&&(this._indexOfLastAttachedContextDeletedWithKeyboard=n)}this._onDidChangeHeight.fire(),this._onDidChangeContext.fire({removed:[i]})});this.attachedContextDisposables.add(d)}),t!==e.offsetHeight&&this._onDidChangeHeight.fire()}async renderFollowups(e,t){this.options.renderFollowups&&(this.followupsDisposables.clear(),Ms(this.followupsContainer),e&&e.length>0&&this.followupsDisposables.add(this.instantiationService.createInstance(hZ,this.followupsContainer,e,this.location,void 0,i=>this._onDidAcceptFollowup.fire({followup:i,response:t}))),this._onDidChangeHeight.fire())}get contentHeight(){const e=this.getLayoutData();return e.followupsHeight+e.inputPartEditorHeight+e.inputPartVerticalPadding+e.inputEditorBorder+e.implicitContextHeight}layout(e,t){return this.cachedDimensions=new bn(t,e),this._layout(e,t)}_layout(e,t,i=!0){this.initAttachedContext(this.attachedContextContainer);const n=this.getLayoutData(),o=Math.min(n.inputPartEditorHeight,e-n.followupsHeight-n.inputPartVerticalPadding),r=t-n.inputPartHorizontalPadding;this.followupsContainer.style.width=`${r}px`,this._inputPartHeight=n.followupsHeight+o+n.inputPartVerticalPadding+n.inputEditorBorder+n.implicitContextHeight;const a=this._inputEditor.getScrollWidth(),l={width:t-n.inputPartHorizontalPadding-n.editorBorder-n.editorPadding-n.executeToolbarWidth-n.sideToolbarWidth-n.toolbarPadding,height:o};if((!this.previousInputEditorDimension||this.previousInputEditorDimension.width!==l.width||this.previousInputEditorDimension.height!==l.height)&&(this._inputEditor.layout(l),this.previousInputEditorDimension=l),i&&a<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?Md(this.inputSideToolbarContainer)+4:0}}saveState(){const e=[...this.history];this.historyService.saveHistory(this.location,e)}},_Q=XD,XD.INPUT_SCHEME="chatSessionInput",XD._counter=0,XD);uZ=_Q=D([_(2,wJe),_(3,gi),_(4,we),_(5,Le),_(6,Te),_(7,Ut),_(8,mr),_(9,Ge)],uZ);const d4e=s=>JSON.stringify(s);function h4e(s){return{lineNumber:s.getLineCount(),column:s.getLineLength(s.getLineCount())+1}}let _Ce=class extends gCe{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,[],"",n,{getKeyBinding:f=>a.lookupKeybinding(f.id,r)},a,c,r,l,d);const h=i.createMenu(_e.ChatExecuteSecondary,r),u=()=>{const f=[];dC(h,{shouldForwardArgs:!0},f);const p=o.getSecondaryAgent();p&&f.forEach(m=>(m.id===pCe.ID&&(m.label=g(7021,"Send to @{0}",p.name)),m)),this.update(t,f)};u(),this._register(h.onDidChange(()=>u()))}};_Ce=D([_(2,Oa),_(3,lr),_(4,ff),_(5,Le),_(6,Ut),_(7,bi),_(8,pn),_(9,mr)],_Ce);var mVt='.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:before{color:var(--vscode-editorError-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-warning:before{color:var(--vscode-editorWarning-foreground)}.monaco-action-bar .action-item .action-label.extension-action.extension-status-info:before{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.install.hide,.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.hide,.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-other-server: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 .action-item.disabled .action-label.extension-action.label{opacity:.4!important}.monaco-action-bar .action-item.checkbox-action-item.disabled{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}';ut(mVt,{});const _Vt="vscode://schemas/extensions";g(9412,"Extensions"),g(9413,"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(9414,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'."),g(9415,"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(9414,"Expected format '${publisher}.${name}'. Example: 'vscode.csharp'.");const u4e=["{"," // 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(` +`);var g4e;(function(s){s[s.Local=1]="Local",s[s.Remote=2]="Remote",s[s.Web=3]="Web"})(g4e||(g4e={}));g(7542,"Extensions");var Gr;(function(s){s[s.DisabledByTrustRequirement=0]="DisabledByTrustRequirement",s[s.DisabledByExtensionKind=1]="DisabledByExtensionKind",s[s.DisabledByEnvironment=2]="DisabledByEnvironment",s[s.EnabledByEnvironment=3]="EnabledByEnvironment",s[s.DisabledByVirtualWorkspace=4]="DisabledByVirtualWorkspace",s[s.DisabledByExtensionDependency=5]="DisabledByExtensionDependency",s[s.DisabledGlobally=6]="DisabledGlobally",s[s.DisabledWorkspace=7]="DisabledWorkspace",s[s.EnabledGlobally=8]="EnabledGlobally",s[s.EnabledWorkspace=9]="EnabledWorkspace"})(Gr||(Gr={}));var vCe;(function(s){s[s.Workspace=0]="Workspace",s[s.File=1]="File",s[s.Executable=2]="Executable",s[s.WorkspaceConfig=3]="WorkspaceConfig",s[s.DynamicWorkspace=4]="DynamicWorkspace",s[s.Experimental=5]="Experimental",s[s.Application=6]="Application"})(vCe||(vCe={}));const vVt="addRootFolder";Fe(5518,"Add Folder to Workspace...");const bVt="setRootFolder",Ett="_workbench.pickWorkspaceFolder";_t.registerCommand({id:"workbench.action.files.openFileFolderInNewWindow",handler:s=>s.get(sg).pickFileFolderAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"_files.pickFolderAndOpen",handler:(s,e)=>s.get(sg).pickFolderAndOpen(e)});_t.registerCommand({id:"workbench.action.files.openFolderInNewWindow",handler:s=>s.get(sg).pickFolderAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"workbench.action.files.openFileInNewWindow",handler:s=>s.get(sg).pickFileAndOpen({forceNewWindow:!0})});_t.registerCommand({id:"workbench.action.openWorkspaceInNewWindow",handler:s=>s.get(sg).pickWorkspaceAndOpen({forceNewWindow:!0})});_t.registerCommand({id:vVt,handler:async s=>{const e=s.get(Zy),t=await xtt(s);!t||!t.length||await e.addFolders(t.map(i=>({uri:i})))}});_t.registerCommand({id:bVt,handler:async s=>{const e=s.get(Zy),t=s.get(yi),i=await xtt(s);!i||!i.length||await e.updateFolders(0,t.getWorkspace().folders.length,i.map(n=>({uri:n})))}});async function xtt(s){const e=s.get(sg),t=s.get(mf);return await e.showOpenDialog({openLabel:rMe(g(5519,"&&Add")),title:g(5520,"Add Folder to Workspace"),canSelectFolders:!0,canSelectMany:!0,defaultUri:await e.defaultFolderPath(),availableFileSystems:[t.defaultUriScheme]})}_t.registerCommand(Ett,async function(s,e){const t=s.get(In),i=s.get(Fs),n=s.get(yi),o=s.get(gi),r=s.get(xi),a=n.getWorkspace().folders;if(!a.length)return;const c=a.map(u=>{const f=u.name,p=i.getUriLabel(Lr(u.uri),{relative:!0});return{label:f,description:p!==f?p:void 0,folder:u,iconClasses:Tx(o,r,u.uri,ba.ROOT_FOLDER)}}),l=(e?e[0]:void 0)||Object.create(null);l.activeItem||(l.activeItem=c[0]),l.placeHolder||(l.placeHolder=g(5521,"Select workspace folder")),typeof l.matchOnDescription!="boolean"&&(l.matchOnDescription=!0);const d=(e?e[1]:void 0)||He.None,h=await t.pick(c,l,d);if(h)return a[c.indexOf(h)]});_t.registerCommand({id:"vscode.openFolder",handler:(s,e,t)=>{const i=s.get(vi);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 n=N.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=uae(n)||n.scheme===pe.untitled?{workspaceUri:n}:{folderUri:n};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:s=>s==null||s instanceof N},{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:s=>s===void 0||typeof s=="object"||typeof s=="boolean"}]}});_t.registerCommand({id:"vscode.newWindow",handler:(s,e)=>{const t=s.get(vi),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:s=>s===void 0||typeof s=="object"}]}});_t.registerCommand("_workbench.removeFromRecentlyOpened",function(s,e){return s.get(wI).removeRecentlyOpened([e])});_t.registerCommand({id:"vscode.removeFromRecentlyOpened",handler:(s,e)=>{const t=s.get(wI);return typeof e=="string"?e=e.match(/^[^:/?#]+:\/\//)?N.parse(e):N.file(e):e=N.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:s=>typeof s=="string"||s instanceof N}]}});_t.registerCommand("_workbench.addToRecentlyOpened",async function(s,e){const t=s.get(wI),i=e.uri,n=e.label,o=e.remoteAuthority;let r;return e.type==="workspace"?r={workspace:await t.getWorkspaceIdentifier(i),label:n,remoteAuthority:o}:e.type==="folder"?r={folderUri:i,label:n,remoteAuthority:o}:r={fileUri:i,label:n,remoteAuthority:o},t.addRecentlyOpened([r])});_t.registerCommand("_workbench.getRecentlyOpened",async function(s){return s.get(wI).getRecentlyOpened()});const eG=pn,_F=".vscode/extensions.json";let f4e=class extends V{constructor(e,t,i,n,o,r){super(),this.workspaceContextService=e,this.fileService=t,this.quickInputService=i,this.modelService=n,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(_F))))&&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(n=>this.resolveWorkspaceFolderExtensionConfig(n)))),t}async getRecommendations(){const e=await this.getExtensionsConfigs();return ja(e.flatMap(t=>t.recommendations?t.recommendations.map(i=>i.toLowerCase()):[]))}async getUnwantedRecommendations(){const e=await this.getExtensionsConfigs();return ja(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,n=new ui;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const o=i&&i.recommendations?.some(l=>l.toLowerCase()===e),r=t.folders.filter(l=>n.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(3847,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(3848,"Add extension recommendation to"));for(const l of c)$me(l)?await this.addOrRemoveWorkspaceRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderRecommendation(e,l,n.get(l.uri),!a)}async toggleUnwantedRecommendation(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?await this.resolveWorkspaceExtensionConfig(t.configuration):void 0,n=new ui;await Promise.all(t.folders.map(async l=>{const d=await this.resolveWorkspaceFolderExtensionConfig(l);n.set(l.uri,d)}));const o=i&&i.unwantedRecommendations?.some(l=>l===e),r=t.folders.filter(l=>n.get(l.uri)?.unwantedRecommendations?.some(d=>d===e)),a=o||r.length>0,c=a?await this.pickWorkspaceOrFolders(r,o?t:void 0,g(3847,"Remove extension recommendation from")):await this.pickWorkspaceOrFolders(t.folders,t.configuration?t:void 0,g(3848,"Add extension recommendation to"));for(const l of c)$me(l)?await this.addOrRemoveWorkspaceUnwantedRecommendation(e,l,i,!a):await this.addOrRemoveWorkspaceFolderUnwantedRecommendation(e,l,n.get(l.uri),!a)}async addOrRemoveWorkspaceFolderRecommendation(e,t,i,n){const o=[];if(n){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(_F),o,!0)}async addOrRemoveWorkspaceRecommendation(e,t,i,n){const o=[];if(i){if(n){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 n&&o.push({path:["extensions"],value:{recommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async addOrRemoveWorkspaceFolderUnwantedRecommendation(e,t,i,n){const o=[];if(n){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(_F),o,!0)}async addOrRemoveWorkspaceUnwantedRecommendation(e,t,i,n){const o=[];if(i){if(n){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 n&&o.push({path:["extensions"],value:{unwantedRecommendations:[e]}});if(o.length)return this.jsonEditingService.write(t.configuration,o,!0)}async pickWorkspaceOrFolders(e,t,i){const n=t?[...e,t]:[...e];if(n.length===1)return n;const o=e.map(a=>({label:a.name,description:g(3849,"Workspace Folder"),workspaceOrFolder:a,iconClasses:Tx(this.modelService,this.languageService,a.uri,ba.ROOT_FOLDER)}));return t&&(o.push({type:"separator"}),o.push({label:g(3850,"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=ef(t.value.toString()).extensions;return i?this.parseExtensionConfig(i):void 0}catch{}}async resolveWorkspaceFolderExtensionConfig(e){try{const t=await this.fileService.readFile(e.toResource(_F)),i=ef(t.value.toString());return this.parseExtensionConfig(i)}catch{}return{}}parseExtensionConfig(e){return{recommendations:ja((e.recommendations||[]).map(t=>t.toLowerCase())),unwantedRecommendations:ja((e.unwantedRecommendations||[]).map(t=>t.toLowerCase()))}}getEditToRemoveValueFromArray(e,t,i){const n=t?.indexOf(i);if(n!==void 0&&n!==-1)return{path:[...e,n],value:void 0}}};f4e=D([_(0,yi),_(1,Jt),_(2,In),_(3,gi),_(4,xi),_(5,yI)],f4e);oi("extensions-view-icon",ve.extensions,g(9483,"View icon of the extensions view."));const wVt=oi("extensions-manage",ve.gear,g(9484,"Icon for the 'Manage' action in the extensions view."));oi("extensions-clear-search-results",ve.clearAll,g(9485,"Icon for the 'Clear Search Result' action in the extensions view."));oi("extensions-refresh",ve.refresh,g(9486,"Icon for the 'Refresh' action in the extensions view."));oi("extensions-filter",ve.filter,g(9487,"Icon for the 'Filter' action in the extensions view."));oi("extensions-install-local-in-remote",ve.cloudDownload,g(9488,"Icon for the 'Install Local Extension in Remote' action in the extensions view."));oi("extensions-install-workspace-recommended",ve.cloudDownload,g(9489,"Icon for the 'Install Workspace Recommended Extensions' action in the extensions view."));oi("extensions-configure-recommended",ve.pencil,g(9490,"Icon for the 'Configure Recommended Extensions' action in the extensions view."));const yVt=oi("extensions-sync-enabled",ve.sync,g(9491,"Icon to indicate that an extension is synced.")),CVt=oi("extensions-sync-ignored",ve.syncIgnored,g(9492,"Icon to indicate that an extension is ignored when syncing."));oi("extensions-remote",ve.remote,g(9493,"Icon to indicate that an extension is remote in the extensions view and editor."));oi("extensions-install-count",ve.cloudDownload,g(9494,"Icon shown along with the install count in the extensions view and editor."));oi("extensions-rating",ve.star,g(9495,"Icon shown along with the rating in the extensions view and editor."));const SVt=oi("extensions-verified-publisher",ve.verifiedFilled,g(9496,"Icon used for the verified extension publisher in the extensions view and editor."));oi("extensions-pre-release",ve.versions,g(9497,"Icon shown for extensions having pre-release versions in extensions view and editor."));oi("extensions-sponsor",ve.heartFilled,g(9498,"Icon used for sponsoring extensions in the extensions view and editor."));oi("extensions-star-full",ve.starFull,g(9499,"Full star icon used for the rating in the extensions editor."));oi("extensions-star-half",ve.starHalf,g(9500,"Half star icon used for the rating in the extensions editor."));oi("extensions-star-empty",ve.starEmpty,g(9501,"Empty star icon used for the rating in the extensions editor."));const QC=oi("extensions-error-message",ve.error,g(9502,"Icon shown with a error message in the extensions editor.")),ch=oi("extensions-warning-message",ve.warning,g(9503,"Icon shown with a warning message in the extensions editor.")),Jm=oi("extensions-info-message",ve.info,g(9504,"Icon shown with an info message in the extensions editor.")),BI=oi("extension-workspace-trust",ve.shield,g(9505,"Icon shown with a workspace trust message in the extension editor."));oi("extension-activation-time",ve.history,g(9506,"Icon shown with a activation time message in the extension editor."));function bCe(s){return s.scheme!==pe.file&&s.scheme!==pe.vscodeRemote}function lNe(s){if(s.folders.length)return s.folders.every(e=>bCe(e.uri))?s.folders[0].uri:void 0;if(s.configuration&&bCe(s.configuration))return s.configuration}function Dtt(s){return lNe(s)?.scheme}function ktt(s){return lNe(s)!==void 0}function yce(s){return s.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}let p4e=class extends V{constructor(e){super(),this.extensionGalleryService=e}async getAvailableLanguages(){const e=new ci;setTimeout(()=>e.cancel(),1e3);let t;try{t=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}const n=t.firstPage.filter(o=>o.properties.localizedLanguages?.length&&o.tags.some(r=>r.startsWith("lp-"))).map(o=>{const r=o.properties.localizedLanguages?.[0],a=yce(o);return{...this.createQuickPickItem(a,r,o),extensionId:o.identifier.id,galleryExtension:o}});return n.push(this.createQuickPickItem("en","English")),n}createQuickPickItem(e,t,i){const n=t??e;let o;if(n!==e&&(o=`(${e})`),e.toLowerCase()===Kl.toLowerCase()&&(o??="",o+=g(3255," (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:n,description:o}}};p4e=D([_(0,bI)],p4e);var bV,d0,CC,NP,h0,vQ,wV,PP,u0,bQ,wQ,yQ,CQ,SQ,yV,g0,f0,p0,m0,_0,AQ,EQ,xQ,DQ,CV,SV,yE,kQ,IQ;let WW=class extends rn{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super("extension.promptExtensionInstallFailure"),this.extension=e,this.version=t,this.installOperation=i,this.error=n,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(Fr(this.error))return;if(this.logService.error(this.error),this.error.name===lw.Unsupported){const r=Wn?g(7874,"{0} for the Web",this.productService.nameLong):this.productService.nameLong,a=g(7875,"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:Xe.Info,message:a,primaryButton:g(7876,"&&More Information"),cancelButton:g(7877,"Close")});c&&this.openerService.open(Wn?N.parse("https://aka.ms/vscode-web-extensions-guide"):N.parse("https://aka.ms/vscode-remote"));return}if(lw.ReleaseVersionNotFound===this.error.name){await this.dialogService.prompt({type:"error",message:nu(this.error),buttons:[{label:g(7878,"Install Pre-Release"),run:()=>{const r=this.instantiationService.createInstance(DT,{installPreReleaseVersion:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(7879,"Cancel")});return}if([lw.Incompatible,lw.IncompatibleApi,lw.IncompatibleTargetPlatform,lw.Malicious,lw.Deprecated].includes(this.error.name)){await this.dialogService.info(nu(this.error));return}if(lw.Signature===this.error.name){await this.dialogService.prompt({type:"error",message:g(7880,"{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(7881,"Install Anyway"),run:()=>{const r=this.instantiationService.createInstance(DT,{donotVerifySignature:!0});return r.extension=this.extension,r.run()}}],cancelButton:g(7879,"Cancel")});return}const e=this.installOperation===IA.Update?g(7882,"Error while updating '{0}' extension.",this.extension.displayName||this.extension.identifier.id):g(7883,"Error while installing '{0}' extension.",this.extension.displayName||this.extension.identifier.id);let t;const i=[],n=await this.getDownloadUrl();n&&(t=g(7884,"Please check the [log]({0}) for more details.",`command:${net}`),i.push({label:g(7885,"Try Downloading Manually..."),run:()=>this.openerService.open(n).then(()=>{this.notificationService.prompt(Xe.Info,g(7886,"Once downloaded, please manually install the downloaded VSIX of '{0}'.",this.extension.identifier.id),[{label:g(7887,"Install from VSIX..."),run:()=>this.commandService.executeCommand(UFt)}])})}));const o=`${e}${t?` ${t}`:""}`;this.notificationService.prompt(Xe.Error,o,i)}async getDownloadUrl(){if(am||!this.extension.gallery||!this.productService.extensionsGallery||!this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionManagementServerService.remoteExtensionManagementServer)return;let e=this.extension.gallery.properties.targetPlatform;if(e!==Es.UNIVERSAL&&e!==Es.UNDEFINED&&this.extensionManagementServerService.remoteExtensionManagementServer)try{const t=await this.galleryService.getManifest(this.extension.gallery,He.None);t&&this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(t)&&(e=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform())}catch(t){this.logService.error(t);return}if(e!==Es.UNKNOWN)return N.parse(`${this.productService.extensionsGallery.serviceUrl}/publishers/${this.extension.publisher}/vsextensions/${this.extension.name}/${this.version}/vspackage${e!==Es.UNDEFINED?`?targetPlatform=${e}`:""}`)}};WW=D([_(4,Er),_(5,Ao),_(6,bi),_(7,to),_(8,vi),_(9,Ge),_(10,av),_(11,we),_(12,bI),_(13,xm)],WW);const Rv=class Rv extends rn{constructor(){super(...arguments),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._extension=null,this._hidden=!1,this.hideOnDisabled=!0}get extension(){return this._extension}set extension(e){this._extension=e,this.update()}get hidden(){return this._hidden}set hidden(e){this._hidden!==e&&(this._hidden=e,this._onDidChange.fire({hidden:e}))}_setEnabled(e){super._setEnabled(e),this.hideOnDisabled&&(this.hidden=!e)}};Rv.EXTENSION_ACTION_CLASS="extension-action",Rv.TEXT_ACTION_CLASS=`${Rv.EXTENSION_ACTION_CLASS} text`,Rv.LABEL_ACTION_CLASS=`${Rv.EXTENSION_ACTION_CLASS} label`,Rv.PROMINENT_LABEL_ACTION_CLASS=`${Rv.LABEL_ACTION_CLASS} prominent`,Rv.ICON_ACTION_CLASS=`${Rv.EXTENSION_ACTION_CLASS} icon`;let yn=Rv;class dNe extends yn{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){t=`${t} action-dropdown`,super(e,void 0,t),this.actionsGroups=i,this.menuActionClassNames=[],this._menuActions=[],this.menuActionClassNames=t.split(" "),this.hideOnDisabled=!1,this.extensionActions=i.flat(),this.update(),this._register(M.any(...this.extensionActions.map(n=>n.onDidChange))(()=>this.update(!0))),this.extensionActions.forEach(n=>this._register(n))}update(e){e||this.extensionActions.forEach(n=>n.update());const t=this.actionsGroups.map(n=>n.filter(o=>!o.hidden));let i=[];for(const n of t)n.length&&(i=[...i,...n,new Ar]);i=i.length?i.slice(0,i.length-1):i,this.primaryAction=i[0],this._menuActions=i.length>1?i:[],this._onDidChange.fire({menuActions:this._menuActions}),this.primaryAction?(this.hidden=!1,this.enabled=this.primaryAction.enabled,this.label=this.getLabel(this.primaryAction),this.tooltip=this.primaryAction.tooltip):(this.hidden=!0,this.enabled=!1)}async run(){this.enabled&&await this.primaryAction?.run()}getLabel(e){return e.label}}var ty;let DT=(ty=class extends yn{set manifest(e){this._manifest=e,this.updateLabel()}constructor(e,t,i,n,o,r,a,c,l,d){super("extensions.install",g(7888,"Install"),bV.CLASS,!1),this.extensionsWorkbenchService=t,this.instantiationService=i,this.runtimeExtensionService=n,this.workbenchThemeService=o,this.labelService=r,this.dialogService=a,this.preferencesService=c,this.telemetryService=l,this.contextService=d,this._manifest=null,this.updateThrottler=new G7,this.hideOnDisabled=!1,this.options={isMachineScoped:!1,...e},this.update(),this._register(this.labelService.onDidChangeFormatters(()=>this.updateLabel(),this))}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement())}async computeAndUpdateEnablement(){this.enabled=!1,this.class=bV.HIDE,this.hidden=!0,this.extension&&(this.extension.isBuiltin||this.extensionsWorkbenchService.canSetLanguage(this.extension)||this.extension.state===Qo.Uninstalled&&(this.options.installPreReleaseVersion&&!this.extension.hasPreReleaseVersion||!this.options.installPreReleaseVersion&&!this.extension.hasReleaseVersion||(this.hidden=!1,this.class=bV.CLASS,await this.extensionsWorkbenchService.canInstall(this.extension)&&(this.enabled=!0,this.updateLabel()))))}async run(){if(!this.extension)return;if(this.extension.deprecationInfo){let t=g(7889,"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 n=[{label:g(7881,"Install Anyway"),run:()=>i.InstallAnyway}];if(this.extension.deprecationInfo.extension){t=g(7890,"This extension is deprecated. Use the {0} extension instead.",this.extension.deprecationInfo.extension.displayName);const r=this.extension.deprecationInfo.extension;n.push({label:g(7891,"&&Open {0}",this.extension.deprecationInfo.extension.displayName),run:async()=>{const[a]=await this.extensionsWorkbenchService.getExtensions([{id:r.id,preRelease:r.preRelease}],He.None);return await this.extensionsWorkbenchService.open(a),i.ShowAlternateExtension}})}else if(this.extension.deprecationInfo.settings){t=g(7892,"This extension is deprecated as this functionality is now built-in to VS Code.");const r=this.extension.deprecationInfo.settings;n.push({label:g(7893,"&&Configure Settings"),run:async()=>(await this.preferencesService.openSettings({query:r.map(a=>`@id:${a}`).join(" ")}),i.ConfigureSettings)})}else this.extension.deprecationInfo.additionalInfo&&(t=new Mt(`${t} ${this.extension.deprecationInfo.additionalInfo}`));const{result:o}=await this.dialogService.prompt({type:Xe.Warning,message:g(7894,"Are you sure you want to install '{0}'?",this.extension.displayName),detail:Lt(t)?t:void 0,custom:Lt(t)?void 0:{markdownDetails:[{markdown:t}]},buttons:n,cancelButton:{run:()=>i.Cancel}});if(o!==i.InstallAnyway)return}this.extensionsWorkbenchService.open(this.extension,{showPreReleaseVersion:this.options.installPreReleaseVersion}),Mr(g(7895,"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){Mr(g(7896,"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=>Ny(o,e)))return this.instantiationService.createInstance(xCe);if((await this.workbenchThemeService.getFileIconThemes()).some(o=>Ny(o,e)))return this.instantiationService.createInstance(DCe);if((await this.workbenchThemeService.getProductIconThemes()).some(o=>Ny(o,e)))return this.instantiationService.createInstance(kCe)}async install(e){try{return await this.extensionsWorkbenchService.install(e,this.options)}catch(t){await this.instantiationService.createInstance(WW,e,e.latestVersion,IA.Install,t).run();return}}async getRunningExtension(e){const t=await this.runtimeExtensionService.getExtension(e.identifier.id);return t||(this.runtimeExtensionService.canAddExtension(aD(e))?new Promise((i,n)=>{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(7897,"Install Workspace Extension"):this.options.installPreReleaseVersion&&this.extension?.hasPreReleaseVersion?e?g(7898,"Install Pre-Release"):g(7899,"Install Pre-Release Version"):this.extension?.hasPreReleaseVersion?e?g(7888,"Install"):g(7900,"Install Release Version"):g(7888,"Install")}},bV=ty,ty.CLASS=`${ty.LABEL_ACTION_CLASS} prominent install`,ty.HIDE=`${ty.CLASS} hide`,ty);DT=bV=D([_(1,Xo),_(2,we),_(3,fs),_(4,eG),_(5,Fs),_(6,to),_(7,N6),_(8,Yi),_(9,yi)],DT);let m4e=class extends dNe{set manifest(e){this.extensionActions.forEach(t=>t.manifest=e),this.update()}constructor(e,t){super("extensions.installActions",DT.CLASS,[[e.createInstance(DT,{installPreReleaseVersion:t.preferPreReleases}),e.createInstance(DT,{installPreReleaseVersion:!t.preferPreReleases})]])}getLabel(e){return e.getLabel(!0)}};m4e=D([_(0,we),_(1,Xo)],m4e);const f1=class f1 extends yn{constructor(){super("extension.installing",f1.LABEL,f1.CLASS,!1)}update(){this.class=`${f1.CLASS}${this.extension&&this.extension.state===Qo.Installing?"":" hide"}`}};f1.LABEL=g(7901,"Installing"),f1.CLASS=`${yn.LABEL_ACTION_CLASS} install installing`;let _4e=f1;var iy;let HW=(iy=class extends yn{constructor(e,t,i,n,o,r){super(e,d0.INSTALL_LABEL,d0.Class,!1),this.server=t,this.canInstallAnyWhere=i,this.extensionsWorkbenchService=n,this.extensionManagementServerService=o,this.extensionManifestPropertiesService=r,this.updateWhenCounterExtensionChanges=!0,this.update()}update(){if(this.enabled=!1,this.class=d0.Class,this.canInstall()){const e=this.extensionsWorkbenchService.installed.filter(t=>Ra(t.identifier,this.extension.identifier)&&t.server===this.server)[0];e?e.state===Qo.Installing&&!e.local&&(this.enabled=!0,this.label=d0.INSTALLING_LABEL,this.class=d0.InstallingClass):(this.enabled=!0,this.label=this.getInstallLabel())}}canInstall(){return!this.extension||!this.server||!this.extension.local||this.extension.state!==Qo.Installed||this.extension.type!==br.User||this.extension.enablementState===Gr.DisabledByEnvironment||this.extension.enablementState===Gr.DisabledByTrustRequirement||this.extension.enablementState===Gr.DisabledByVirtualWorkspace?!1:!!(bRe(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),Mr(g(7895,"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)}},d0=iy,iy.INSTALL_LABEL=g(7888,"Install"),iy.INSTALLING_LABEL=g(7901,"Installing"),iy.Class=`${yn.LABEL_ACTION_CLASS} prominent install-other-server`,iy.InstallingClass=`${yn.LABEL_ACTION_CLASS} install-other-server installing`,iy);HW=d0=D([_(3,Xo),_(4,av),_(5,xm)],HW);let wCe=class extends HW{constructor(e,t,i,n){super("extensions.remoteinstall",i.remoteExtensionManagementServer,e,t,i,n)}getInstallLabel(){return this.extensionManagementServerService.remoteExtensionManagementServer?g(7902,"Install in {0}",this.extensionManagementServerService.remoteExtensionManagementServer.label):HW.INSTALL_LABEL}};wCe=D([_(1,Xo),_(2,av),_(3,xm)],wCe);let v4e=class extends HW{constructor(e,t,i){super("extensions.localinstall",t.localExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7903,"Install Locally")}};v4e=D([_(0,Xo),_(1,av),_(2,xm)],v4e);let b4e=class extends HW{constructor(e,t,i){super("extensions.webInstall",t.webExtensionManagementServer,!1,e,t,i)}getInstallLabel(){return g(7904,"Install in Browser")}};b4e=D([_(0,Xo),_(1,av),_(2,xm)],b4e);var ny;let yCe=(ny=class extends yn{constructor(e,t){super("extensions.uninstall",CC.UninstallLabel,CC.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===Qo.Uninstalling){this.label=CC.UninstallingLabel,this.class=CC.UnInstallingClass,this.enabled=!1;return}if(this.label=CC.UninstallLabel,this.class=CC.UninstallClass,this.tooltip=CC.UninstallLabel,e!==Qo.Installed){this.enabled=!1;return}if(this.extension.isBuiltin){this.enabled=!1;return}this.enabled=!0}async run(){if(this.extension){Mr(g(7907,"Uninstalling extension {0} started.",this.extension.displayName));try{await this.extensionsWorkbenchService.uninstall(this.extension),Mr(g(7908,"Please reload Visual Studio Code to complete the uninstallation of the extension {0}.",this.extension.displayName))}catch(e){Fr(e)||this.dialogService.error(nu(e))}}}},CC=ny,ny.UninstallLabel=g(7905,"Uninstall"),ny.UninstallingLabel=g(7906,"Uninstalling"),ny.UninstallClass=`${yn.LABEL_ACTION_CLASS} uninstall`,ny.UnInstallingClass=`${yn.LABEL_ACTION_CLASS} uninstall uninstalling`,ny);yCe=CC=D([_(0,Xo),_(1,to)],yCe);var sy;let w4e=(sy=class extends yn{constructor(e,t,i,n,o){super("extensions.update",g(7909,"Update"),NP.DisabledClass,!1),this.verbose=e,this.extensionsWorkbenchService=t,this.dialogService=i,this.openerService=n,this.instantiationService=o,this.updateThrottler=new G7,this.update()}update(){this.updateThrottler.queue(()=>this.computeAndUpdateEnablement()),this.extension&&(this.label=this.verbose?g(7910,"Update to v{0}",this.extension.latestVersion):g(7909,"Update"))}async computeAndUpdateEnablement(){if(this.enabled=!1,this.class=NP.DisabledClass,!this.extension||this.extension.deprecationInfo)return;const e=await this.extensionsWorkbenchService.canInstall(this.extension),t=this.extension.state===Qo.Installed;this.enabled=e&&t&&this.extension.outdated,this.class=this.enabled?NP.EnabledClass:NP.DisabledClass}async run(){if(!this.extension)return;const e=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(e){const{result:t}=await this.dialogService.prompt({type:"warning",title:g(7911,"Update {0} Extension",this.extension.displayName),message:g(7912,`{0} -Would you like to update the extension?`,e),buttons:[{label:g(7909,"Update"),run:()=>"update"},{label:g(7913,"Review"),run:()=>"review"},{label:g(7879,"Cancel"),run:()=>"cancel"}]});if(t==="cancel")return;if(t==="review")return this.extension.hasChangelog()?this.extensionsWorkbenchService.open(this.extension,{tab:t9.Changelog}):this.extension.repository?this.openerService.open(this.extension.repository):this.extensionsWorkbenchService.open(this.extension)}return Mr(g(7914,"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),Mr(g(7915,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance(zW,e,e.latestVersion,LA.Update,t).run()}}},OP=ay,ay.EnabledClass=`${ay.LABEL_ACTION_CLASS} prominent update`,ay.DisabledClass=`${ay.EnabledClass} disabled`,ay);R4e=OP=D([_(1,Xo),_(2,to),_(3,Ao),_(4,we)],R4e);var eb;let kCe=(eb=class extends yn{constructor(e,t,i){super(f0.ID,f0.LABEL.value,f0.DisabledClass),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this._register(i.onDidChangeConfiguration(n=>{n.affectsConfiguration(YFt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=f0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.deprecationInfo?.disallowInstall||this.extensionsWorkbenchService.getAutoUpdateValue()==="onlyEnabledExtensions"&&!this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)||(this.enabled=!0,this.class=f0.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),Mr(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},f0=eb,eb.ID="workbench.extensions.action.toggleAutoUpdateForExtension",eb.LABEL=Pe(7916,"Auto Update"),eb.EnabledClass=`${yn.EXTENSION_ACTION_CLASS} auto-update`,eb.DisabledClass=`${eb.EnabledClass} hide`,eb);kCe=f0=D([_(0,Xo),_(1,Nl),_(2,Te)],kCe);var sk;let ICe=(sk=class extends yn{constructor(e){super(wQ.ID,wQ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;Mr(g(7920,"Ignoring updates published by {0}.",this.extension.publisherDisplayName));const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension.publisher,e),Mr(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},wQ=sk,sk.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",sk.LABEL=g(7919,"Auto Update All (From Publisher)"),sk);ICe=wQ=D([_(0,Xo)],ICe);var VS;let M4e=(VS=class extends yn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(7921,"Migrate"),CV.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=CV.DisabledClass,!this.extension?.local||this.extension.state!==Qo.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>Ra(t.identifier,{id:e}))||(this.enabled=!0,this.class=CV.EnabledClass,this.tooltip=g(7922,"Migrate to {0}",this.extension.deprecationInfo.extension.displayName),this.label=this.small?g(7923,"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}],He.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},CV=VS,VS.EnabledClass=`${yn.LABEL_ACTION_CLASS} migrate`,VS.DisabledClass=`${VS.EnabledClass} disabled`,VS);M4e=CV=D([_(1,Xo)],M4e);let pZ=class extends yn{constructor(e,t,i,n,o){super(e,t,i,n),this.instantiationService=o,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(TCe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};pZ=D([_(4,we)],pZ);let TCe=class extends Jy{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),n=Cr(this.element),o={x:n.left,y:n.top+n.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>o,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&Ort(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Ar];return t.length?t.slice(0,t.length-1):t}};TCe=D([_(2,lr)],TCe);async function PVt(s,e,t){return t.invokeFunction(async i=>{const n=i.get(Xo),o=i.get(Nl),r=i.get(Oa),a=i.get(aXe),c=i.get(jae),l=i.get(sG),d=[];if(s){switch(d.push(["extension",s.identifier.id]),d.push(["isBuiltinExtension",s.isBuiltin]),d.push(["isDefaultApplicationScopedExtension",s.local&&YIt(s.local.manifest)]),d.push(["isApplicationScopedExtension",s.local&&s.local.isApplicationScoped]),d.push(["isWorkspaceScopedExtension",s.isWorkspaceScoped]),d.push(["isGalleryExtension",!!s.identifier.uuid]),s.local&&d.push(["extensionSource",s.local.source]),d.push(["extensionHasConfiguration",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes.configuration]),d.push(["extensionHasKeybindings",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes.keybindings]),d.push(["extensionHasCommands",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes?.commands]),d.push(["isExtensionRecommended",!!a.getAllRecommendationsWithReason()[s.identifier.id.toLowerCase()]]),d.push(["isExtensionWorkspaceRecommended",a.getAllRecommendationsWithReason()[s.identifier.id.toLowerCase()]?.reasonId===ACe.Workspace]),d.push(["isUserIgnoredRecommendation",c.globalIgnoredRecommendations.some(m=>m===s.identifier.id.toLowerCase())]),d.push(["isExtensionPinned",s.pinned]),d.push(["isExtensionEnabled",o.isEnabledEnablementState(s.enablementState)]),s.state){case Qo.Installing:d.push(["extensionStatus","installing"]);break;case Qo.Installed:d.push(["extensionStatus","installed"]);break;case Qo.Uninstalling:d.push(["extensionStatus","uninstalling"]);break;case Qo.Uninstalled:d.push(["extensionStatus","uninstalled"]);break}d.push(["installedExtensionIsPreReleaseVersion",!!s.local?.isPreReleaseVersion]),d.push(["installedExtensionIsOptedToPreRelease",!!s.local?.preRelease]),d.push(["galleryExtensionIsPreReleaseVersion",!!s.gallery?.properties.isPreReleaseVersion]),d.push(["galleryExtensionHasPreReleaseVersion",s.gallery?.hasPreReleaseVersion]),d.push(["extensionHasPreReleaseVersion",s.hasPreReleaseVersion]),d.push(["extensionHasReleaseVersion",s.hasReleaseVersion]),d.push(["extensionDisallowInstall",!!s.deprecationInfo?.disallowInstall]);const[u,f,p]=await Promise.all([l.getColorThemes(),l.getFileIconThemes(),l.getProductIconThemes()]);d.push(["extensionHasColorThemes",u.some(m=>Oy(m,s))]),d.push(["extensionHasFileIconThemes",f.some(m=>Oy(m,s))]),d.push(["extensionHasProductIconThemes",p.some(m=>Oy(m,s))]),d.push(["canSetLanguage",n.canSetLanguage(s)]),d.push(["isActiveLanguagePackExtension",s.gallery&&ql===Ece(s.gallery)])}return r.getMenuActions(_e.ExtensionContext,e.createOverlay(d),{shouldForwardArgs:!0})})}function TK(s,e){const t=[];for(const[,i]of s)t.push(i.map(n=>n instanceof Nk?n:e.createInstance(LCe,n)));return t}var cy;let N4e=(cy=class extends pZ{constructor(e,t,i){super(BP.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(7924,"Manage"),this.update()}async getActionGroups(){const e=[],t=await PVt(this.extension,this.contextKeyService,this.instantiationService),i=[],n=[],o=[],r=[];for(const[a,c]of t)a===eOt?n.push(...TK([[a,c]],this.instantiationService)[0]):a===tOt?o.push(...TK([[a,c]],this.instantiationService)[0]):a===ZFt?i.push(...TK([[a,c]],this.instantiationService)[0]):r.push(...TK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(_Z),this.instantiationService.createInstance(mZ)]),e.push([this.instantiationService.createInstance(bZ),this.instantiationService.createInstance(vZ)]),o.length&&e.push(o),e.push([...n.length?n:[],this.instantiationService.createInstance(v9,this.extension,!1),this.instantiationService.createInstance(DCe)]),r.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof yn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=BP.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Qo.Installed,this.class=this.enabled||e===Qo.Uninstalling?BP.Class:BP.HideManageExtensionClass}}},BP=cy,cy.ID="extensions.manage",cy.Class=`${yn.ICON_ACTION_CLASS} manage `+We.asClassName(LVt),cy.HideManageExtensionClass=`${cy.Class} hide`,cy);N4e=BP=D([_(0,we),_(1,fs),_(2,Le)],N4e);let LCe=class extends yn{constructor(e,t){super(e.id,e.label),this.action=e,this.extensionsWorkbenchService=t}get enabled(){return this.action.enabled}set enabled(e){this.action.enabled=e}update(){this.extension&&(this.action.id===JFt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===kCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===ICe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?LM(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?LM(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)}}};LCe=D([_(1,Xo)],LCe);var tb;let P4e=(tb=class extends yn{constructor(e){super(p0.ID,p0.LABEL,p0.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=p0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Qo.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=p0.EnabledClass,this.extension.preRelease?(this.label=g(7926,"Switch to Release Version"),this.tooltip=g(7927,"This will switch and enable updates to release versions")):(this.label=g(7928,"Switch to Pre-Release Version"),this.tooltip=g(7929,"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))}},p0=tb,tb.ID="workbench.extensions.action.togglePreRlease",tb.LABEL=g(7925,"Pre-Release"),tb.EnabledClass=`${yn.LABEL_ACTION_CLASS} pre-release`,tb.DisabledClass=`${tb.EnabledClass} hide`,tb);P4e=p0=D([_(0,Xo)],P4e);var ok;let v9=(ok=class extends yn{constructor(e,t,i,n,o,r,a,c){super(yQ.ID,yQ.LABEL,yn.LABEL_ACTION_CLASS),this.whenInstalled=t,this.extensionsWorkbenchService=i,this.extensionManagementService=n,this.extensionGalleryService=o,this.quickInputService=r,this.instantiationService=a,this.dialogService=c,this.extension=e,this.update()}update(){this.enabled=!!this.extension&&!this.extension.isBuiltin&&!!this.extension.identifier.uuid&&!this.extension.deprecationInfo,this.enabled&&this.whenInstalled&&(this.enabled=!!this.extension?.local&&!!this.extension.server&&this.extension.state===Qo.Installed)}async run(){if(!this.enabled||!this.extension)return;const e=this.extension.server?await this.extension.server.extensionManagementService.getTargetPlatform():await this.extensionManagementService.getTargetPlatform(),t=await this.extensionGalleryService.getAllCompatibleVersions(this.extension.identifier,this.extension.local?.preRelease??this.extension.gallery?.properties.isPreReleaseVersion??!1,e);if(!t.length){await this.dialogService.info(g(7931,"This extension has no other versions."));return}const i=t.map((o,r)=>({id:o.version,label:o.version,description:`${uNe(new Date(Date.parse(o.date)),!0)}${o.isPreReleaseVersion?` (${g(7932,"pre-release")})`:""}${o.version===this.extension?.local?.manifest.version?` (${g(7933,"current")})`:""}`,ariaLabel:`${o.isPreReleaseVersion?"Pre-Release version":"Release version"} ${o.version}`,isPreReleaseVersion:o.isPreReleaseVersion})),n=await this.quickInputService.pick(i,{placeHolder:g(7934,"Select Version to Install"),matchOnDetail:!0});if(n){if(this.extension.local?.manifest.version===n.id)return;try{await this.extensionsWorkbenchService.install(this.extension,{installPreReleaseVersion:n.isPreReleaseVersion,version:n.id})}catch(o){this.instantiationService.createInstance(zW,this.extension,n.id,LA.Install,o).run()}}return null}},yQ=ok,ok.ID="workbench.extensions.action.install.anotherVersion",ok.LABEL=g(7930,"Install Specific Version..."),ok);v9=yQ=D([_(2,Xo),_(3,P6),_(4,EI),_(5,In),_(6,we),_(7,to)],v9);var rk;let mZ=(rk=class extends yn{constructor(e,t){super(CQ.ID,CQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(7936,"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===Qo.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.EnabledWorkspace)}},CQ=rk,rk.ID="extensions.enableForWorkspace",rk.LABEL=g(7935,"Enable (Workspace)"),rk);mZ=CQ=D([_(0,Xo),_(1,Nl)],mZ);var ak;let _Z=(ak=class extends yn{constructor(e,t){super(SQ.ID,SQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(7938,"Enable this extension"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Qo.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.EnabledGlobally)}},SQ=ak,ak.ID="extensions.enableGlobally",ak.LABEL=g(7937,"Enable"),ak);_Z=SQ=D([_(0,Xo),_(1,Nl)],_Z);var ck;let vZ=(ck=class extends yn{constructor(e,t,i,n){super(AQ.ID,AQ.LABEL,yn.LABEL_ACTION_CLASS),this.workspaceContextService=e,this.extensionsWorkbenchService=t,this.extensionEnablementService=i,this.extensionService=n,this.tooltip=g(7940,"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=>Ra({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==qi.EMPTY)&&(this.enabled=this.extension.state===Qo.Installed&&(this.extension.enablementState===Gr.EnabledGlobally||this.extension.enablementState===Gr.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.DisabledWorkspace)}},AQ=ck,ck.ID="extensions.disableForWorkspace",ck.LABEL=g(7939,"Disable (Workspace)"),ck);vZ=AQ=D([_(0,yi),_(1,Xo),_(2,Nl),_(3,fs)],vZ);var lk;let bZ=(lk=class extends yn{constructor(e,t,i){super(EQ.ID,EQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.extensionService=i,this.tooltip=g(7942,"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=>Ra({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Qo.Installed&&(this.extension.enablementState===Gr.EnabledGlobally||this.extension.enablementState===Gr.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.DisabledGlobally)}},EQ=lk,lk.ID="extensions.disableGlobally",lk.LABEL=g(7941,"Disable"),lk);bZ=EQ=D([_(0,Xo),_(1,Nl),_(2,fs)],bZ);let F4e=class extends CNe{constructor(e){super("extensions.enable",yn.LABEL_ACTION_CLASS,[[e.createInstance(_Z),e.createInstance(mZ)]])}};F4e=D([_(0,we)],F4e);let O4e=class extends CNe{constructor(e){super("extensions.disable",yn.LABEL_ACTION_CLASS,[[e.createInstance(bZ),e.createInstance(vZ)]])}};O4e=D([_(0,we)],O4e);var zS;let B4e=(zS=class extends yn{constructor(e,t,i,n,o,r){super("extensions.runtimeState","",SV.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=n,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=SV.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Qo.Installing||e===Qo.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=SV.EnabledClass,this.tooltip=t.reason,this.label=t.action===$m.ReloadWindow?g(7943,"Reload Window"):t.action===$m.RestartExtensions?g(7944,"Restart Extensions"):t.action===$m.QuitAndInstall?g(7945,"Restart to Update"):t.action===$m.ApplyUpdate||t.action===$m.DownloadUpdate?g(7946,"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===$m.ReloadWindow)return this.hostService.reload();if(e?.action===$m.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===$m.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===$m.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===$m.QuitAndInstall)return this.updateService.quitAndInstall()}}},SV=zS,zS.EnabledClass=`${yn.LABEL_ACTION_CLASS} reload`,zS.DisabledClass=`${zS.EnabledClass} disabled`,zS);B4e=SV=D([_(0,xc),_(1,Xo),_(2,pJe),_(3,fs),_(4,Er),_(5,Yi)],B4e);function Oy(s,e){return!!(e&&s.extensionData&&Sn.equals(s.extensionData.extensionId,e.identifier.id))}function SNe(s,e,t,i){const n=[];for(const o of s)Oy(o,t)&&!(i&&o===e)&&n.push({label:o.label,id:o.id});return i&&(n.push({type:"separator",label:g(7933,"current")}),n.push({label:e.label,id:e.id})),n}var ib;let RCe=(ib=class extends yn{constructor(e,t,i,n){super(m0.ID,m0.TITLE.value,m0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.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?m0.EnabledClass:m0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Oy(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 n=this.workbenchThemeService.getColorTheme(),o=new Mh(100),r=SNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7948,"Select Color Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:n.id,"auto")}},m0=ib,ib.ID="workbench.extensions.action.setColorTheme",ib.TITLE=Pe(7947,"Set Color Theme"),ib.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,ib.DisabledClass=`${ib.EnabledClass} disabled`,ib);RCe=m0=D([_(0,fs),_(1,sG),_(2,In),_(3,Nl)],RCe);var nb;let MCe=(nb=class extends yn{constructor(e,t,i,n){super(_0.ID,_0.TITLE.value,_0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.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?_0.EnabledClass:_0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Oy(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 n=this.workbenchThemeService.getFileIconTheme(),o=new Mh(100),r=SNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7950,"Select File Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:n.id,"auto")}},_0=nb,nb.ID="workbench.extensions.action.setFileIconTheme",nb.TITLE=Pe(7949,"Set File Icon Theme"),nb.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,nb.DisabledClass=`${nb.EnabledClass} disabled`,nb);MCe=_0=D([_(0,fs),_(1,sG),_(2,In),_(3,Nl)],MCe);var sb;let NCe=(sb=class extends yn{constructor(e,t,i,n){super(v0.ID,v0.TITLE.value,v0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.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?v0.EnabledClass:v0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Oy(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 n=this.workbenchThemeService.getProductIconTheme(),o=new Mh(100),r=SNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7952,"Select Product Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:n.id,"auto")}},v0=sb,sb.ID="workbench.extensions.action.setProductIconTheme",sb.TITLE=Pe(7951,"Set Product Icon Theme"),sb.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,sb.DisabledClass=`${sb.EnabledClass} disabled`,sb);NCe=v0=D([_(0,fs),_(1,sG),_(2,In),_(3,Nl)],NCe);var ob;let W4e=(ob=class extends yn{constructor(e){super(b0.ID,b0.TITLE.value,b0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=b0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&ql===Ece(this.extension.gallery)||(this.enabled=!0,this.class=b0.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},b0=ob,ob.ID="workbench.extensions.action.setDisplayLanguage",ob.TITLE=Pe(7953,"Set Display Language"),ob.EnabledClass=`${yn.LABEL_ACTION_CLASS} language`,ob.DisabledClass=`${ob.EnabledClass} disabled`,ob);W4e=b0=D([_(0,Xo)],W4e);var rb;let H4e=(rb=class extends yn{constructor(e,t){super(w0.ID,w0.TITLE.value,w0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=w0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&ql!==Ece(this.extension.gallery)||(this.enabled=!0,this.class=w0.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},w0=rb,rb.ID="workbench.extensions.action.clearLanguage",rb.TITLE=Pe(7954,"Clear Display Language"),rb.EnabledClass=`${yn.LABEL_ACTION_CLASS} language`,rb.DisabledClass=`${rb.EnabledClass} disabled`,rb);H4e=w0=D([_(0,Xo),_(1,lXe)],H4e);var dk;let U4e=(dk=class extends rn{constructor(e,t,i){super(xQ.ID,xQ.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(GU,ir.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},He.None);return i?this.extensionWorkbenchService.open(i):null}},xQ=dk,dk.ID="workbench.extensions.action.showRecommendedExtension",dk.LABEL=g(7955,"Show Recommended Extension"),dk);U4e=xQ=D([_(1,Tm),_(2,Xo)],U4e);var hk;let V4e=(hk=class extends rn{constructor(e,t,i,n){super(DQ.ID,DQ.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=n,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(GU,ir.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},He.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(n){this.instantiationService.createInstance(zW,i,i.latestVersion,LA.Install,n).run()}}}},DQ=hk,hk.ID="workbench.extensions.action.installRecommendedExtension",hk.LABEL=g(7956,"Install Recommended Extension"),hk);V4e=DQ=D([_(1,Tm),_(2,we),_(3,Xo)],V4e);var uk;let z4e=(uk=class extends rn{constructor(e,t){super(kQ.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=kQ.Class,this.tooltip=g(7957,"Do not recommend this extension again"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!0),Promise.resolve()}},kQ=uk,uk.ID="extensions.ignore",uk.Class=`${yn.LABEL_ACTION_CLASS} ignore`,uk);z4e=kQ=D([_(1,jae)],z4e);var gk;let $4e=(gk=class extends rn{constructor(e,t){super(IQ.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=IQ.Class,this.tooltip=g(7958,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},IQ=gk,gk.ID="extensions.ignore",gk.Class=`${yn.LABEL_ACTION_CLASS} undo-ignore`,gk);$4e=IQ=D([_(1,jae)],$4e);let wZ=class extends rn{constructor(e,t){super("extensions.searchExtensions",g(7959,"Search Extensions"),void 0,!0),this.searchValue=e,this.paneCompositeService=t}async run(){const e=(await this.paneCompositeService.openPaneComposite(GU,ir.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};wZ=D([_(1,Tm)],wZ);let yZ=class extends rn{constructor(e,t,i,n,o,r,a,c){super(e,t),this.contextService=i,this.fileService=n,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(n=>this.editorService.openEditor({resource:e,options:{pinned:t,selection:n}})),t=>Promise.reject(new Error(g(7960,"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=sf(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 n=RLe(e),o=jme(n,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,A4e).then(()=>({created:!0,extensionsFileResource:e,content:A4e})))}};yZ=D([_(2,yi),_(3,Jt),_(4,Fo),_(5,ei),_(6,DI),_(7,fn)],yZ);var lR;let G4e=(lR=class extends yZ{constructor(e,t,i,n,o,r,a,c){super(e,t,o,i,n,r,a,c),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.update(),this)),this.update()}update(){this.enabled=this.contextService.getWorkbenchState()!==qi.EMPTY}run(){switch(this.contextService.getWorkbenchState()){case qi.FOLDER:return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(yF));case qi.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},lR.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",lR.LABEL=g(7961,"Configure Recommended Extensions (Workspace)"),lR);G4e=D([_(2,Jt),_(3,Fo),_(4,yi),_(5,ei),_(6,DI),_(7,fn)],G4e);var dR;let K4e=(dR=class extends yZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,o,i,n,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(Mtt);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(yF)):null)}},dR.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",dR.LABEL=g(7962,"Configure Recommended Extensions (Workspace Folder)"),dR);K4e=D([_(2,Jt),_(3,Fo),_(4,yi),_(5,ei),_(6,DI),_(7,fn),_(8,vi)],K4e);var $S;let q4e=($S=class extends rn{get extension(){return this._extension}set extension(e){this._extension&&e&&Ra(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","",AV.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?AV.ENABLED_CLASS:AV.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 n=()=>{const r=this.extensionService.extensions.filter(a=>Ra({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(dD(this.extension.local)):!1},o=()=>this.extension.local?this.extensionService.extensions.every(r=>!(Ra({id:r.identifier.value,uuid:r.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(ice(r))))?!0:this.extensionService.canRemoveExtension(dD(this.extension.local)):!1;if(e!==null){if(e===Qo.Installing&&this.status===Qo.Installed)return n()?this.initialStatus===Qo.Installed&&this.version!==t?g(7963,"Updated"):g(7964,"Installed"):null;if(e===Qo.Uninstalling&&this.status===Qo.Uninstalled)return this.initialStatus=this.status,o()?g(7965,"Uninstalled"):null}if(i!==null){const r=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!r&&a)return n()?g(7966,"Enabled"):null;if(r&&!a)return o()?g(7967,"Disabled"):null}return null}run(){return Promise.resolve()}},AV=$S,$S.ENABLED_CLASS=`${yn.TEXT_ACTION_CLASS} extension-status-label`,$S.DISABLED_CLASS=`${$S.ENABLED_CLASS} hide`,$S);q4e=AV=D([_(0,fs),_(1,dv),_(2,Nl)],q4e);var GS;let Q4e=(GS=class extends pZ{constructor(e,t,i,n){super("extensions.sync","",EV.SYNC_CLASS,!1,n),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(M.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===Qo.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?EV.IGNORED_SYNC_CLASS:EV.SYNC_CLASS,this.tooltip=e?g(7968,"This extension is ignored during sync"):g(7969,"This extension is synced")}}async run(){return super.run({actionGroups:[[new rn("extensions.syncignore",this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension)?g(7970,"Sync this extension"):g(7971,"Do not sync this extension"),void 0,!0,()=>this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension))]],disposeActionsOnHide:!0})}},EV=GS,GS.IGNORED_SYNC_CLASS=`${yn.ICON_ACTION_CLASS} extension-sync ${We.asClassName(MVt)}`,GS.SYNC_CLASS=`${GS.ICON_ACTION_CLASS} extension-sync ${We.asClassName(RVt)}`,GS);Q4e=EV=D([_(0,Te),_(1,Xo),_(2,mJe),_(3,we)],Q4e);var hR;let j4e=(hR=class extends yn{get status(){return this._status}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super("extensions.status","",`${AE.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=n,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._status=[],this._onDidChangeStatus=this._register(new I),this.onDidChangeStatus=this._onDidChangeStatus.event,this.updateThrottler=new j7,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:dh,message:new Mt(g(7972,"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}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:dh,message:new Mt(g(7973,"This extension is deprecated. Use the {0} extension instead.",o))},!0)}else if(this.extension.deprecationInfo.settings){const o=`[${g(7974,"settings")}](${N.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(r=>`@id:${r}`).join(" ")]))}`)})`;this.updateStatus({icon:dh,message:new Mt(g(7975,"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 Mt(g(7976,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&o.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:dh,message:o},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.outdated&&this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)){const o=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(o){const r=new Mt;r.appendMarkdown(`${o} `),r.appendMarkdown(g(7977,"Please [review the extension]({0}) and update it manually.",this.extension.hasChangelog()?N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,t9.Changelog]))}`).toString():this.extension.repository?this.extension.repository:N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id]))}`).toString())),this.updateStatus({icon:dh,message:r},!0)}}if(this.extension.gallery&&this.extension.state===Qo.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 Mt(`${g(7978,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,kLt(o))} [${g(7979,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:dh,message:r},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const o=g(7874,"{0} for the Web",this.productService.nameLong),r=new Mt(`${g(7980,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,o)} [${g(7981,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:dh,message:r},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Qo.Installed)return;if(this.extension.enablementState===Gr.DisabledByEnvironment){this.updateStatus({message:new Mt(g(7982,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===Gr.EnabledByEnvironment){this.updateStatus({message:new Mt(g(7983,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===Gr.DisabledByVirtualWorkspace){const o=dK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:e_,message:new Mt(o?sV(o):g(7984,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(Ftt(this.contextService.getWorkspace())){const o=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),r=dK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(o==="limited"||r){this.updateStatus({icon:dh,message:new Mt(r?sV(r):g(7985,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===Gr.DisabledByTrustRequirement||this.extension.enablementState===Gr.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,o])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(o)||o===Gr.DisabledByTrustRequirement)){this.enabled=!0;const o=dK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:$I,message:new Mt(o?sV(o):g(7986,"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=dK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(o==="limited"||r){this.enabled=!0,this.updateStatus({icon:$I,message:new Mt(r?sV(r):g(7987,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===Gr.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(o=>Ra(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 Mt(`${g(7988,"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(7979,"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 Mt(`${g(7989,"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(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`):Wn&&(o=new Mt(`${g(7990,"This extension is disabled because it is defined to run only in {0} for the Desktop.",this.productService.nameLong)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`))):this.extensionManagementServerService.webExtensionManagementServer===this.extension.server&&(o=new Mt(`${g(7991,"This extension is disabled because it is not supported in {0} for the Web.",this.productService.nameLong)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)),o&&this.updateStatus({icon:dh,message:o},!0);return}const e=new Sn(this.extension.identifier.id),t=Qe.as(J_.ExtensionFeaturesRegistry).getExtensionFeatures();for(const o of t){const r=this.extensionFeaturesManagementService.getAccessData(e,o.id)?.current?.status,a=`[${g(7992,"Manage Access")}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,t9.Features,!1,o.id]))}`)})`;if(r?.severity===Xe.Error){this.updateStatus({icon:jC,message:new Mt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}if(r?.severity===Xe.Warning){this.updateStatus({icon:dh,message:new Mt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(LRe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>Ra(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Mt(g(7993,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Mt(g(7994,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:e_,message:a},!0)}return}const o=this.extensionService.extensions.filter(a=>Ra({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],r=o?this.extensionManagementServerService.getExtensionManagementServer(ice(o)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&r===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:e_,message:new Mt(`${g(7995,"This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${g(7979,"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:e_,message:new Mt(`${g(7996,"This extension is enabled in the Local Extension Host because it prefers to run there.")} [${g(7979,"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:e_,message:new Mt(`${g(7997,"This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}}if(this.extension.enablementState===Gr.DisabledByExtensionDependency){this.updateStatus({icon:dh,message:new Mt(g(7998,"This extension has been disabled because it depends on an extension that is disabled."))},!0);return}const i=this.workbenchExtensionEnablementService.isEnabled(this.extension.local),n=this.extensionService.extensions.some(o=>Ra({id:o.identifier.value,uuid:o.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&n){if(this.extension.enablementState===Gr.EnabledWorkspace){this.updateStatus({message:new Mt(g(7999,"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 Mt(g(8e3,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===Gr.EnabledGlobally)return}if(!i&&!n){if(this.extension.enablementState===Gr.DisabledGlobally){this.updateStatus({message:new Mt(g(8001,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===Gr.DisabledWorkspace){this.updateStatus({message:new Mt(g(8002,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!n&&!this.extension.local.isValid){const o=this.extension.local.validations.filter(([r])=>r===Xe.Error).map(([,r])=>r);this.updateStatus({icon:jC,message:new Mt(o.join(" ").trim())},!0)}}updateStatus(e,t){if(e){if(this._status.some(i=>i.message.value===e.message.value&&i.icon?.id===e.icon?.id))return}else{if(this._status.length===0)return;this._status=[]}e&&(this._status.push(e),this._status.sort((i,n)=>n.icon===$I?-1:i.icon===$I?1:n.icon===jC?-1:i.icon===jC?1:n.icon===dh?-1:i.icon===dh?1:n.icon===e_?-1:i.icon===e_?1:0)),t&&(e?.icon===jC?this.class=`${AE.CLASS} extension-status-error ${We.asClassName(jC)}`:e?.icon===dh?this.class=`${AE.CLASS} extension-status-warning ${We.asClassName(dh)}`:e?.icon===e_?this.class=`${AE.CLASS} extension-status-info ${We.asClassName(e_)}`:e?.icon===$I?this.class=`${AE.CLASS} ${We.asClassName($I)}`:this.class=`${AE.CLASS} hide`),this._onDidChangeStatus.fire()}async run(){if(this._status[0]?.icon===$I)return this.commandService.executeCommand("workbench.trust.manage")}},AE=hR,hR.CLASS=`${yn.ICON_ACTION_CLASS} extension-status`,hR);j4e=AE=D([_(0,dv),_(1,Fs),_(2,vi),_(3,_ae),_(4,uC),_(5,Xo),_(6,fs),_(7,Im),_(8,yi),_(9,Er),_(10,Nl),_(11,rXe)],j4e);var fk;let Y4e=(fk=class extends rn{constructor(e=TQ.ID,t=TQ.LABEL,i,n,o,r,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=n,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(8004,"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(wZ,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(dD(t.local))),n=i?g(8005,"Please reload Visual Studio Code to complete reinstalling the extension {0}.",t.identifier.id):g(8006,"Reinstalling the extension {0} is completed.",t.identifier.id),o=i?[{label:g(8007,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(Xe.Info,n,o,{sticky:!0})},t=>this.notificationService.error(t)))}},TQ=fk,fk.ID="workbench.extensions.action.reinstall",fk.LABEL=g(8003,"Reinstall Extension..."),fk);Y4e=TQ=D([_(2,Xo),_(3,dv),_(4,In),_(5,bi),_(6,xc),_(7,we),_(8,fs)],Y4e);var pk;let J4e=(pk=class extends rn{constructor(e=LQ.ID,t=LQ.LABEL,i,n,o,r){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=n,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(8009,"Select Extension"),matchOnDetail:!0});e&&e.extension&&(await this.instantiationService.createInstance(v9,e.extension,!0).run(),await this.instantiationService.createInstance(wZ,e.extension.identifier.id).run())}isEnabled(e){return this.instantiationService.createInstance(v9,e,!0).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,n)=>i.extension.displayName.localeCompare(n.extension.displayName))}},LQ=pk,pk.ID="workbench.extensions.action.install.specificVersion",pk.LABEL=g(8008,"Install Specific Version of Extension..."),pk);J4e=LQ=D([_(2,Xo),_(3,In),_(4,we),_(5,Nl)],J4e);let CZ=class extends rn{constructor(e,t,i,n,o){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=n,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(8010,"Select extensions to install"),e.canSelectMany=!0,i.sort((n,o)=>n.displayName.localeCompare(o.displayName)),e.items=i.map(n=>({extension:n,label:n.displayName,description:n.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:Xe.Info,message:g(8011,"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:ud.Notification,title:g(8012,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(8013,"Successfully installed extensions.")))}}};CZ=D([_(1,Xo),_(2,In),_(3,bi),_(4,cg)],CZ);let X4e=class extends CZ{constructor(e,t,i,n,o,r,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,n,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(8014,"Install Local Extensions in '{0}'...",this.extensionManagementServerService.remoteExtensionManagementServer.label):""}getQuickPickTitle(){return g(8015,"Install Local Extensions in '{0}'",this.extensionManagementServerService.remoteExtensionManagementServer.label)}getExtensionsToInstall(e){return e.filter(t=>{const i=this.instantiationService.createInstance(xCe,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await Zs.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:n,compatible:!0},He.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await Zs.settled(t.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await Zs.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)}}}};X4e=D([_(0,Xo),_(1,In),_(2,cg),_(3,bi),_(4,dv),_(5,EI),_(6,we),_(7,Jt),_(8,Ge)],X4e);let Z4e=class extends CZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,o,n),this.extensionManagementServerService=r,this.extensionGalleryService=a,this.fileService=c,this.logService=l}get label(){return g(8016,"Install Remote Extensions Locally...")}getQuickPickTitle(){return g(8017,"Install Remote Extensions Locally")}getExtensionsToInstall(e){return e.filter(t=>t.type===br.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&Ra(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await Zs.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:n,compatible:!0},He.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await Zs.settled(t.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await Zs.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)}}}};Z4e=D([_(1,Xo),_(2,In),_(3,cg),_(4,bi),_(5,dv),_(6,EI),_(7,Jt),_(8,Ge)],Z4e);_t.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(s,e){return s.get(Tm).openPaneComposite(GU,ir.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const PCe="workbench.extensions.action.showExtensionsWithIds";_t.registerCommand(PCe,function(s,e){return s.get(Tm).openPaneComposite(GU,ir.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const n=e.map(o=>`@id:${o}`).join(" ");i.search(n),i.focus()})});W("extensionButton.background",{dark:_y,light:_y,hcDark:null,hcLight:null},g(8018,"Button background color for extension actions."));W("extensionButton.foreground",{dark:bM,light:bM,hcDark:null,hcLight:null},g(8019,"Button foreground color for extension actions."));W("extensionButton.hoverBackground",{dark:$8,light:$8,hcDark:null,hcLight:null},g(8020,"Button background hover color for extension actions."));W("extensionButton.separator",rqe,g(8021,"Button separator color for extension actions"));W("extensionButton.prominentBackground",{dark:_y,light:_y,hcDark:null,hcLight:null},g(8022,"Button background color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentForeground",{dark:bM,light:bM,hcDark:null,hcLight:null},g(8023,"Button foreground color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentHoverBackground",{dark:$8,light:$8,hcDark:null,hcLight:null},g(8024,"Button background hover color for extension actions that stand out (e.g. install button)."));Cp((s,e)=>{const t=s.getColor(TN);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(jC)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(jC)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(jC)} { color: ${t}; }`));const i=s.getColor(pm);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(dh)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(dh)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(dh)} { color: ${i}; }`));const n=s.getColor(mm);n&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(e_)} { color: ${n}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(e_)} { color: ${n}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(e_)} { color: ${n}; }`))});let SZ=class extends V{constructor(e,t,i){super(),this.chatAgentService=e,this.extensionService=t,this.chatAgentNameService=i,this._onDidChangeContents=this._register(new I),this.onDidChangeContents=this._onDidChangeContents.event;const n=Bt(".chat-agent-hover@root",[Bt(".chat-agent-hover-header",[Bt(".chat-agent-hover-icon@icon"),Bt(".chat-agent-hover-details",[Bt(".chat-agent-hover-name@name"),Bt(".chat-agent-hover-extension",[Bt(".chat-agent-hover-extension-name@extensionName"),Bt(".chat-agent-hover-separator@separator"),Bt(".chat-agent-hover-publisher@publisher")])])]),Bt(".chat-agent-hover-warning@warning"),Bt("span.chat-agent-hover-description@description")]);this.domNode=n.root,this.icon=n.icon,this.name=n.name,this.extensionName=n.extensionName,this.description=n.description,n.separator.textContent="|";const o=fe("span.extension-verified-publisher",void 0,Yy(NVt));this.publisherName=fe("span.chat-agent-hover-publisher-name"),re(n.publisher,o,this.publisherName),n.warning.appendChild(Yy(ve.warning)),n.warning.appendChild(fe("span",void 0,g(10556,"This chat extension is using a reserved name.")))}setAgent(e){const t=this.chatAgentService.getAgent(e);if(t.metadata.icon instanceof N){const o=fe("img.icon");o.src=ef.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(fe(".avatar",void 0,o))}else if(t.metadata.themeIcon){const o=fe(We.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(fe(".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}`:Ace(t),this.extensionName.textContent=t.extensionDisplayName,this.publisherName.textContent=t.publisherDisplayName??t.extensionPublisherId;let n=t.description??"";if(n&&(n.match(/[\.\?\!] *$/)||(n+=".")),this.description.textContent=n,this.domNode.classList.toggle("allowedName",i),this.domNode.classList.toggle("verifiedPublisher",!1),!t.isDynamic){const o=this._register(new ci);this.extensionService.getExtensions([{id:t.extensionId.value}],o.token).then(r=>{o.dispose(),r[0]?.publisherDomain?.verified&&(this.domNode.classList.toggle("verifiedPublisher",!0),this._onDidChangeContents.fire())})}}};SZ=D([_(0,_f),_(1,Xo),_(2,zae)],SZ);function Ott(s,e){return{actions:[{commandId:PCe,label:g(10557,"View Extension"),run:()=>{const t=s();t&&e.executeCommand(PCe,[t.extensionId.value])}}]}}let FCe=class extends V{constructor(e,t=[],i=fe(".chat-attached-context"),n,o){super(),this.variables=e,this.contentReferences=t,this.domNode=i,this.instantiationService=n,this.openerService=o,this.attachedContextDisposables=this._register(new Z),this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(UA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.initAttachedContext(i)}initAttachedContext(e){Ms(e),this.attachedContextDisposables.clear(),uTe(!!this.variables.length,this.domNode),this.variables.forEach(t=>{const i=re(e,fe(".chat-attached-context-attachment.show-file-icons")),n=this._contextResourceLabels.create(i,{supportIcons:!0}),o=N.isUri(t.value)?t.value:t.value&&typeof t.value=="object"&&"uri"in t.value&&N.isUri(t.value.uri)?t.value.uri:void 0,r=t.value&&typeof t.value=="object"&&"range"in t.value&&F.isIRange(t.value.range)?t.value.range:void 0,a=this.contentReferences.find(h=>"variableName"in h.reference&&h.reference.variableName===t.name),c=a?.options?.status?.kind===BW.Omitted,l=c||a?.options?.status?.kind===BW.Partial;if(o){const h=Ko(o.path),u=Cb(o.path),f=`${h} ${u}`;let p;c?p=r?g(10558,"Omitted: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10559,"Omitted: {0}.",f):l?p=r?g(10560,"Partially attached: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10561,"Partially attached: {0}.",f):p=r?g(10562,"Attached: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10563,"Attached: {0}.",f),n.setFile(o,{fileKind:ba.FILE,hidePath:!0,range:r,title:a?.options?.status?.description}),i.ariaLabel=p,i.tabIndex=0,i.style.cursor="pointer",this.attachedContextDisposables.add(ue(i,ke.CLICK,async m=>{en.stop(m,!0),o&&this.openerService.open(o,{fromUserGesture:!0,editorOptions:{selection:r}})}))}else{const h=t.fullName??t.name,u=t.icon?.id?`$(${t.icon.id}) ${h}`:h;n.setLabel(u,a?.options?.status?.description),i.ariaLabel=g(10564,"Attached context: {0}.",t.name),i.tabIndex=0}l&&i.classList.add("warning");const d=a?.options?.status?.description;if(l){i.ariaLabel=`${i.ariaLabel}${d?` ${d}`:""}`;for(const h of[".monaco-icon-suffix-container",".monaco-icon-name-container"]){const u=n.element.querySelector(h);u&&u.classList.add("warning")}}})}};FCe=D([_(3,we),_(4,Ao)],FCe);let OCe=class extends V{constructor(e,t,i,n){super(),this.editorService=i,this.telemetryService=n;const o=xtt(e.citations),r=Bt(".chat-code-citation-message@root",[Bt("span.chat-code-citation-label@label"),Bt(".chat-code-citation-button-container@button")]);r.label.textContent=o+" - ";const a=this._register(new Jd(r.button,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0}));a.label=g(10566,"View matches"),this._register(a.onDidClick(()=>{const c=`# Code Citations +Would you like to update the extension?`,e),buttons:[{label:g(7909,"Update"),run:()=>"update"},{label:g(7913,"Review"),run:()=>"review"},{label:g(7879,"Cancel"),run:()=>"cancel"}]});if(t==="cancel")return;if(t==="review")return this.extension.hasChangelog()?this.extensionsWorkbenchService.open(this.extension,{tab:X3.Changelog}):this.extension.repository?this.openerService.open(this.extension.repository):this.extensionsWorkbenchService.open(this.extension)}return Mr(g(7914,"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),Mr(g(7915,"Updating extension {0} to version {1} completed.",e.displayName,e.latestVersion))}catch(t){this.instantiationService.createInstance(WW,e,e.latestVersion,IA.Update,t).run()}}},NP=sy,sy.EnabledClass=`${sy.LABEL_ACTION_CLASS} prominent update`,sy.DisabledClass=`${sy.EnabledClass} disabled`,sy);w4e=NP=D([_(1,Xo),_(2,to),_(3,Ao),_(4,we)],w4e);var Jv;let CCe=(Jv=class extends yn{constructor(e,t,i){super(h0.ID,h0.LABEL.value,h0.DisabledClass),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this._register(i.onDidChangeConfiguration(n=>{n.affectsConfiguration(WFt)&&this.update()})),this.update()}update(){this.enabled=!1,this.class=h0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.deprecationInfo?.disallowInstall||this.extensionsWorkbenchService.getAutoUpdateValue()==="onlyEnabledExtensions"&&!this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)||(this.enabled=!0,this.class=h0.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),Mr(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},h0=Jv,Jv.ID="workbench.extensions.action.toggleAutoUpdateForExtension",Jv.LABEL=Fe(7916,"Auto Update"),Jv.EnabledClass=`${yn.EXTENSION_ACTION_CLASS} auto-update`,Jv.DisabledClass=`${Jv.EnabledClass} hide`,Jv);CCe=h0=D([_(0,Xo),_(1,Ml),_(2,Te)],CCe);var ZD;let SCe=(ZD=class extends yn{constructor(e){super(vQ.ID,vQ.LABEL),this.extensionsWorkbenchService=e}update(){}async run(){if(!this.extension)return;Mr(g(7920,"Ignoring updates published by {0}.",this.extension.publisherDisplayName));const e=!this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher);await this.extensionsWorkbenchService.updateAutoUpdateEnablementFor(this.extension.publisher,e),Mr(e?g(7917,"Enabled auto updates for",this.extension.displayName):g(7918,"Disabled auto updates for",this.extension.displayName))}},vQ=ZD,ZD.ID="workbench.extensions.action.toggleAutoUpdatesForPublisher",ZD.LABEL=g(7919,"Auto Update All (From Publisher)"),ZD);SCe=vQ=D([_(0,Xo)],SCe);var US;let y4e=(US=class extends yn{constructor(e,t){super("extensionsAction.migrateDeprecatedExtension",g(7921,"Migrate"),wV.DisabledClass,!1),this.small=e,this.extensionsWorkbenchService=t,this.update()}update(){if(this.enabled=!1,this.class=wV.DisabledClass,!this.extension?.local||this.extension.state!==Qo.Installed||!this.extension.deprecationInfo?.extension)return;const e=this.extension.deprecationInfo.extension.id;this.extensionsWorkbenchService.local.some(t=>Ra(t.identifier,{id:e}))||(this.enabled=!0,this.class=wV.EnabledClass,this.tooltip=g(7922,"Migrate to {0}",this.extension.deprecationInfo.extension.displayName),this.label=this.small?g(7923,"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}],He.None);await this.extensionsWorkbenchService.install(t,{isMachineScoped:e?.isMachineScoped})}},wV=US,US.EnabledClass=`${yn.LABEL_ACTION_CLASS} migrate`,US.DisabledClass=`${US.EnabledClass} disabled`,US);y4e=wV=D([_(1,Xo)],y4e);let gZ=class extends yn{constructor(e,t,i,n,o){super(e,t,i,n),this.instantiationService=o,this._actionViewItem=null}createActionViewItem(e){return this._actionViewItem=this.instantiationService.createInstance(ACe,this,e),this._actionViewItem}run({actionGroups:e,disposeActionsOnHide:t}){return this._actionViewItem?.showMenu(e,t),Promise.resolve()}};gZ=D([_(4,we)],gZ);let ACe=class extends Qy{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),n=Cr(this.element),o={x:n.left,y:n.top+n.height+10};this.contextMenuService.showContextMenu({getAnchor:()=>o,getActions:()=>i,actionRunner:this.actionRunner,onHide:()=>{t&&xrt(i)}})}}getActions(e){let t=[];for(const i of e)t=[...t,...i,new Ar];return t.length?t.slice(0,t.length-1):t}};ACe=D([_(2,lr)],ACe);async function AVt(s,e,t){return t.invokeFunction(async i=>{const n=i.get(Xo),o=i.get(Ml),r=i.get(Oa),a=i.get(ZJe),c=i.get(Gae),l=i.get(eG),d=[];if(s){switch(d.push(["extension",s.identifier.id]),d.push(["isBuiltinExtension",s.isBuiltin]),d.push(["isDefaultApplicationScopedExtension",s.local&&WIt(s.local.manifest)]),d.push(["isApplicationScopedExtension",s.local&&s.local.isApplicationScoped]),d.push(["isWorkspaceScopedExtension",s.isWorkspaceScoped]),d.push(["isGalleryExtension",!!s.identifier.uuid]),s.local&&d.push(["extensionSource",s.local.source]),d.push(["extensionHasConfiguration",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes.configuration]),d.push(["extensionHasKeybindings",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes.keybindings]),d.push(["extensionHasCommands",s.local&&!!s.local.manifest.contributes&&!!s.local.manifest.contributes?.commands]),d.push(["isExtensionRecommended",!!a.getAllRecommendationsWithReason()[s.identifier.id.toLowerCase()]]),d.push(["isExtensionWorkspaceRecommended",a.getAllRecommendationsWithReason()[s.identifier.id.toLowerCase()]?.reasonId===vCe.Workspace]),d.push(["isUserIgnoredRecommendation",c.globalIgnoredRecommendations.some(m=>m===s.identifier.id.toLowerCase())]),d.push(["isExtensionPinned",s.pinned]),d.push(["isExtensionEnabled",o.isEnabledEnablementState(s.enablementState)]),s.state){case Qo.Installing:d.push(["extensionStatus","installing"]);break;case Qo.Installed:d.push(["extensionStatus","installed"]);break;case Qo.Uninstalling:d.push(["extensionStatus","uninstalling"]);break;case Qo.Uninstalled:d.push(["extensionStatus","uninstalled"]);break}d.push(["installedExtensionIsPreReleaseVersion",!!s.local?.isPreReleaseVersion]),d.push(["installedExtensionIsOptedToPreRelease",!!s.local?.preRelease]),d.push(["galleryExtensionIsPreReleaseVersion",!!s.gallery?.properties.isPreReleaseVersion]),d.push(["galleryExtensionHasPreReleaseVersion",s.gallery?.hasPreReleaseVersion]),d.push(["extensionHasPreReleaseVersion",s.hasPreReleaseVersion]),d.push(["extensionHasReleaseVersion",s.hasReleaseVersion]),d.push(["extensionDisallowInstall",!!s.deprecationInfo?.disallowInstall]);const[u,f,p]=await Promise.all([l.getColorThemes(),l.getFileIconThemes(),l.getProductIconThemes()]);d.push(["extensionHasColorThemes",u.some(m=>Ny(m,s))]),d.push(["extensionHasFileIconThemes",f.some(m=>Ny(m,s))]),d.push(["extensionHasProductIconThemes",p.some(m=>Ny(m,s))]),d.push(["canSetLanguage",n.canSetLanguage(s)]),d.push(["isActiveLanguagePackExtension",s.gallery&&Kl===yce(s.gallery)])}return r.getMenuActions(_e.ExtensionContext,e.createOverlay(d),{shouldForwardArgs:!0})})}function DK(s,e){const t=[];for(const[,i]of s)t.push(i.map(n=>n instanceof Ik?n:e.createInstance(ECe,n)));return t}var oy;let C4e=(oy=class extends gZ{constructor(e,t,i){super(PP.ID,"","",!0,e),this.extensionService=t,this.contextKeyService=i,this.tooltip=g(7924,"Manage"),this.update()}async getActionGroups(){const e=[],t=await AVt(this.extension,this.contextKeyService,this.instantiationService),i=[],n=[],o=[],r=[];for(const[a,c]of t)a===zFt?n.push(...DK([[a,c]],this.instantiationService)[0]):a===$Ft?o.push(...DK([[a,c]],this.instantiationService)[0]):a===VFt?i.push(...DK([[a,c]],this.instantiationService)[0]):r.push(...DK([[a,c]],this.instantiationService));return i.length&&e.push(i),e.push([this.instantiationService.createInstance(pZ),this.instantiationService.createInstance(fZ)]),e.push([this.instantiationService.createInstance(_Z),this.instantiationService.createInstance(mZ)]),o.length&&e.push(o),e.push([...n.length?n:[],this.instantiationService.createInstance(p9,this.extension,!1),this.instantiationService.createInstance(yCe)]),r.forEach(a=>e.push(a)),e.forEach(a=>a.forEach(c=>{c instanceof yn&&(c.extension=this.extension)})),e}async run(){return await this.extensionService.whenInstalledExtensionsRegistered(),super.run({actionGroups:await this.getActionGroups(),disposeActionsOnHide:!0})}update(){if(this.class=PP.HideManageExtensionClass,this.enabled=!1,this.extension){const e=this.extension.state;this.enabled=e===Qo.Installed,this.class=this.enabled||e===Qo.Uninstalling?PP.Class:PP.HideManageExtensionClass}}},PP=oy,oy.ID="extensions.manage",oy.Class=`${yn.ICON_ACTION_CLASS} manage `+We.asClassName(wVt),oy.HideManageExtensionClass=`${oy.Class} hide`,oy);C4e=PP=D([_(0,we),_(1,fs),_(2,Le)],C4e);let ECe=class extends yn{constructor(e,t){super(e.id,e.label),this.action=e,this.extensionsWorkbenchService=t}get enabled(){return this.action.enabled}set enabled(e){this.action.enabled=e}update(){this.extension&&(this.action.id===HFt?this.checked=!this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension):this.action.id===CCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension):this.action.id===SCe.ID?this.checked=this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension.publisher):this.checked=this.action.checked)}async run(){if(this.extension){const e=this.extension.local?DM(this.extension.local.manifest.publisher,this.extension.local.manifest.name):this.extension.gallery?DM(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)}}};ECe=D([_(1,Xo)],ECe);var Xv;let S4e=(Xv=class extends yn{constructor(e){super(u0.ID,u0.LABEL,u0.DisabledClass),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=u0.DisabledClass,this.extension&&(this.extension.isBuiltin||this.extension.state===Qo.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=u0.EnabledClass,this.extension.preRelease?(this.label=g(7926,"Switch to Release Version"),this.tooltip=g(7927,"This will switch and enable updates to release versions")):(this.label=g(7928,"Switch to Pre-Release Version"),this.tooltip=g(7929,"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))}},u0=Xv,Xv.ID="workbench.extensions.action.togglePreRlease",Xv.LABEL=g(7925,"Pre-Release"),Xv.EnabledClass=`${yn.LABEL_ACTION_CLASS} pre-release`,Xv.DisabledClass=`${Xv.EnabledClass} hide`,Xv);S4e=u0=D([_(0,Xo)],S4e);var ek;let p9=(ek=class extends yn{constructor(e,t,i,n,o,r,a,c){super(bQ.ID,bQ.LABEL,yn.LABEL_ACTION_CLASS),this.whenInstalled=t,this.extensionsWorkbenchService=i,this.extensionManagementService=n,this.extensionGalleryService=o,this.quickInputService=r,this.instantiationService=a,this.dialogService=c,this.extension=e,this.update()}update(){this.enabled=!!this.extension&&!this.extension.isBuiltin&&!!this.extension.identifier.uuid&&!this.extension.deprecationInfo,this.enabled&&this.whenInstalled&&(this.enabled=!!this.extension?.local&&!!this.extension.server&&this.extension.state===Qo.Installed)}async run(){if(!this.enabled||!this.extension)return;const e=this.extension.server?await this.extension.server.extensionManagementService.getTargetPlatform():await this.extensionManagementService.getTargetPlatform(),t=await this.extensionGalleryService.getAllCompatibleVersions(this.extension.identifier,this.extension.local?.preRelease??this.extension.gallery?.properties.isPreReleaseVersion??!1,e);if(!t.length){await this.dialogService.info(g(7931,"This extension has no other versions."));return}const i=t.map((o,r)=>({id:o.version,label:o.version,description:`${eNe(new Date(Date.parse(o.date)),!0)}${o.isPreReleaseVersion?` (${g(7932,"pre-release")})`:""}${o.version===this.extension?.local?.manifest.version?` (${g(7933,"current")})`:""}`,ariaLabel:`${o.isPreReleaseVersion?"Pre-Release version":"Release version"} ${o.version}`,isPreReleaseVersion:o.isPreReleaseVersion})),n=await this.quickInputService.pick(i,{placeHolder:g(7934,"Select Version to Install"),matchOnDetail:!0});if(n){if(this.extension.local?.manifest.version===n.id)return;try{await this.extensionsWorkbenchService.install(this.extension,{installPreReleaseVersion:n.isPreReleaseVersion,version:n.id})}catch(o){this.instantiationService.createInstance(WW,this.extension,n.id,IA.Install,o).run()}}return null}},bQ=ek,ek.ID="workbench.extensions.action.install.anotherVersion",ek.LABEL=g(7930,"Install Specific Version..."),ek);p9=bQ=D([_(2,Xo),_(3,L6),_(4,bI),_(5,In),_(6,we),_(7,to)],p9);var tk;let fZ=(tk=class extends yn{constructor(e,t){super(wQ.ID,wQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(7936,"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===Qo.Installed&&!this.extensionEnablementService.isEnabled(this.extension.local)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.EnabledWorkspace)}},wQ=tk,tk.ID="extensions.enableForWorkspace",tk.LABEL=g(7935,"Enable (Workspace)"),tk);fZ=wQ=D([_(0,Xo),_(1,Ml)],fZ);var ik;let pZ=(ik=class extends yn{constructor(e,t){super(yQ.ID,yQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.tooltip=g(7938,"Enable this extension"),this.update()}update(){this.enabled=!1,this.extension&&this.extension.local&&!this.extension.isWorkspaceScoped&&(this.enabled=this.extension.state===Qo.Installed&&this.extensionEnablementService.isDisabledGlobally(this.extension.local)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.EnabledGlobally)}},yQ=ik,ik.ID="extensions.enableGlobally",ik.LABEL=g(7937,"Enable"),ik);pZ=yQ=D([_(0,Xo),_(1,Ml)],pZ);var nk;let mZ=(nk=class extends yn{constructor(e,t,i,n){super(CQ.ID,CQ.LABEL,yn.LABEL_ACTION_CLASS),this.workspaceContextService=e,this.extensionsWorkbenchService=t,this.extensionEnablementService=i,this.extensionService=n,this.tooltip=g(7940,"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=>Ra({id:e.identifier.value,uuid:e.uuid},this.extension.identifier)&&this.workspaceContextService.getWorkbenchState()!==qi.EMPTY)&&(this.enabled=this.extension.state===Qo.Installed&&(this.extension.enablementState===Gr.EnabledGlobally||this.extension.enablementState===Gr.EnabledWorkspace)&&this.extensionEnablementService.canChangeWorkspaceEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.DisabledWorkspace)}},CQ=nk,nk.ID="extensions.disableForWorkspace",nk.LABEL=g(7939,"Disable (Workspace)"),nk);mZ=CQ=D([_(0,yi),_(1,Xo),_(2,Ml),_(3,fs)],mZ);var sk;let _Z=(sk=class extends yn{constructor(e,t,i){super(SQ.ID,SQ.LABEL,yn.LABEL_ACTION_CLASS),this.extensionsWorkbenchService=e,this.extensionEnablementService=t,this.extensionService=i,this.tooltip=g(7942,"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=>Ra({id:e.identifier.value,uuid:e.uuid},this.extension.identifier))&&(this.enabled=this.extension.state===Qo.Installed&&(this.extension.enablementState===Gr.EnabledGlobally||this.extension.enablementState===Gr.EnabledWorkspace)&&this.extensionEnablementService.canChangeEnablement(this.extension.local))}async run(){if(this.extension)return this.extensionsWorkbenchService.setEnablement(this.extension,Gr.DisabledGlobally)}},SQ=sk,sk.ID="extensions.disableGlobally",sk.LABEL=g(7941,"Disable"),sk);_Z=SQ=D([_(0,Xo),_(1,Ml),_(2,fs)],_Z);let A4e=class extends dNe{constructor(e){super("extensions.enable",yn.LABEL_ACTION_CLASS,[[e.createInstance(pZ),e.createInstance(fZ)]])}};A4e=D([_(0,we)],A4e);let E4e=class extends dNe{constructor(e){super("extensions.disable",yn.LABEL_ACTION_CLASS,[[e.createInstance(_Z),e.createInstance(mZ)]])}};E4e=D([_(0,we)],E4e);var VS;let x4e=(VS=class extends yn{constructor(e,t,i,n,o,r){super("extensions.runtimeState","",yV.DisabledClass,!1),this.hostService=e,this.extensionsWorkbenchService=t,this.updateService=i,this.extensionService=n,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=yV.DisabledClass,!this.extension)return;const e=this.extension.state;if(e===Qo.Installing||e===Qo.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=yV.EnabledClass,this.tooltip=t.reason,this.label=t.action===Um.ReloadWindow?g(7943,"Reload Window"):t.action===Um.RestartExtensions?g(7944,"Restart Extensions"):t.action===Um.QuitAndInstall?g(7945,"Restart to Update"):t.action===Um.ApplyUpdate||t.action===Um.DownloadUpdate?g(7946,"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===Um.ReloadWindow)return this.hostService.reload();if(e?.action===Um.RestartExtensions)return this.extensionsWorkbenchService.updateRunningExtensions();if(e?.action===Um.DownloadUpdate)return this.updateService.downloadUpdate();if(e?.action===Um.ApplyUpdate)return this.updateService.applyUpdate();if(e?.action===Um.QuitAndInstall)return this.updateService.quitAndInstall()}}},yV=VS,VS.EnabledClass=`${yn.LABEL_ACTION_CLASS} reload`,VS.DisabledClass=`${VS.EnabledClass} disabled`,VS);x4e=yV=D([_(0,xc),_(1,Xo),_(2,aJe),_(3,fs),_(4,Er),_(5,Yi)],x4e);function Ny(s,e){return!!(e&&s.extensionData&&Sn.equals(s.extensionData.extensionId,e.identifier.id))}function hNe(s,e,t,i){const n=[];for(const o of s)Ny(o,t)&&!(i&&o===e)&&n.push({label:o.label,id:o.id});return i&&(n.push({type:"separator",label:g(7933,"current")}),n.push({label:e.label,id:e.id})),n}var Zv;let xCe=(Zv=class extends yn{constructor(e,t,i,n){super(g0.ID,g0.TITLE.value,g0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.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?g0.EnabledClass:g0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Ny(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 n=this.workbenchThemeService.getColorTheme(),o=new Lh(100),r=hNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7948,"Select Color Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setColorTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setColorTheme(a?a.id:n.id,"auto")}},g0=Zv,Zv.ID="workbench.extensions.action.setColorTheme",Zv.TITLE=Fe(7947,"Set Color Theme"),Zv.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,Zv.DisabledClass=`${Zv.EnabledClass} disabled`,Zv);xCe=g0=D([_(0,fs),_(1,eG),_(2,In),_(3,Ml)],xCe);var eb;let DCe=(eb=class extends yn{constructor(e,t,i,n){super(f0.ID,f0.TITLE.value,f0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.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?f0.EnabledClass:f0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Ny(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 n=this.workbenchThemeService.getFileIconTheme(),o=new Lh(100),r=hNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7950,"Select File Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setFileIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setFileIconTheme(a?a.id:n.id,"auto")}},f0=eb,eb.ID="workbench.extensions.action.setFileIconTheme",eb.TITLE=Fe(7949,"Set File Icon Theme"),eb.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,eb.DisabledClass=`${eb.EnabledClass} disabled`,eb);DCe=f0=D([_(0,fs),_(1,eG),_(2,In),_(3,Ml)],DCe);var tb;let kCe=(tb=class extends yn{constructor(e,t,i,n){super(p0.ID,p0.TITLE.value,p0.DisabledClass,!1),this.workbenchThemeService=t,this.quickInputService=i,this.extensionEnablementService=n,this._register(M.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?p0.EnabledClass:p0.DisabledClass})}computeEnablement(e){return!!this.extension&&this.extension.state===Qo.Installed&&this.extensionEnablementService.isEnabledEnablementState(this.extension.enablementState)&&e.some(t=>Ny(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 n=this.workbenchThemeService.getProductIconTheme(),o=new Lh(100),r=hNe(i,n,this.extension,e),a=await this.quickInputService.pick(r,{placeHolder:g(7952,"Select Product Icon Theme"),onDidFocus:c=>o.trigger(()=>this.workbenchThemeService.setProductIconTheme(c.id,void 0)),ignoreFocusLost:t});return this.workbenchThemeService.setProductIconTheme(a?a.id:n.id,"auto")}},p0=tb,tb.ID="workbench.extensions.action.setProductIconTheme",tb.TITLE=Fe(7951,"Set Product Icon Theme"),tb.EnabledClass=`${yn.LABEL_ACTION_CLASS} theme`,tb.DisabledClass=`${tb.EnabledClass} disabled`,tb);kCe=p0=D([_(0,fs),_(1,eG),_(2,In),_(3,Ml)],kCe);var ib;let D4e=(ib=class extends yn{constructor(e){super(m0.ID,m0.TITLE.value,m0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.update()}update(){this.enabled=!1,this.class=m0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Kl===yce(this.extension.gallery)||(this.enabled=!0,this.class=m0.EnabledClass))}async run(){return this.extension&&this.extensionsWorkbenchService.setLanguage(this.extension)}},m0=ib,ib.ID="workbench.extensions.action.setDisplayLanguage",ib.TITLE=Fe(7953,"Set Display Language"),ib.EnabledClass=`${yn.LABEL_ACTION_CLASS} language`,ib.DisabledClass=`${ib.EnabledClass} disabled`,ib);D4e=m0=D([_(0,Xo)],D4e);var nb;let k4e=(nb=class extends yn{constructor(e,t){super(_0.ID,_0.TITLE.value,_0.DisabledClass,!1),this.extensionsWorkbenchService=e,this.localeService=t,this.update()}update(){this.enabled=!1,this.class=_0.DisabledClass,this.extension&&this.extensionsWorkbenchService.canSetLanguage(this.extension)&&(this.extension.gallery&&Kl!==yce(this.extension.gallery)||(this.enabled=!0,this.class=_0.EnabledClass))}async run(){return this.extension&&this.localeService.clearLocalePreference()}},_0=nb,nb.ID="workbench.extensions.action.clearLanguage",nb.TITLE=Fe(7954,"Clear Display Language"),nb.EnabledClass=`${yn.LABEL_ACTION_CLASS} language`,nb.DisabledClass=`${nb.EnabledClass} disabled`,nb);k4e=_0=D([_(0,Xo),_(1,tXe)],k4e);var ok;let I4e=(ok=class extends rn{constructor(e,t,i){super(AQ.ID,AQ.LABEL,void 0,!1),this.paneCompositeService=t,this.extensionWorkbenchService=i,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(HU,ir.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},He.None);return i?this.extensionWorkbenchService.open(i):null}},AQ=ok,ok.ID="workbench.extensions.action.showRecommendedExtension",ok.LABEL=g(7955,"Show Recommended Extension"),ok);I4e=AQ=D([_(1,Dm),_(2,Xo)],I4e);var rk;let T4e=(rk=class extends rn{constructor(e,t,i,n){super(EQ.ID,EQ.LABEL,void 0,!1),this.paneCompositeService=t,this.instantiationService=i,this.extensionWorkbenchService=n,this.extensionId=e}async run(){const t=(await this.paneCompositeService.openPaneComposite(HU,ir.Sidebar,!0))?.getViewPaneContainer();t.search(`@id:${this.extensionId}`),t.focus();const[i]=await this.extensionWorkbenchService.getExtensions([{id:this.extensionId}],{source:"install-recommendation"},He.None);if(i){await this.extensionWorkbenchService.open(i);try{await this.extensionWorkbenchService.install(i)}catch(n){this.instantiationService.createInstance(WW,i,i.latestVersion,IA.Install,n).run()}}}},EQ=rk,rk.ID="workbench.extensions.action.installRecommendedExtension",rk.LABEL=g(7956,"Install Recommended Extension"),rk);T4e=EQ=D([_(1,Dm),_(2,we),_(3,Xo)],T4e);var ak;let L4e=(ak=class extends rn{constructor(e,t){super(xQ.ID,"Ignore Recommendation"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=xQ.Class,this.tooltip=g(7957,"Do not recommend this extension again"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!0),Promise.resolve()}},xQ=ak,ak.ID="extensions.ignore",ak.Class=`${yn.LABEL_ACTION_CLASS} ignore`,ak);L4e=xQ=D([_(1,Gae)],L4e);var ck;let R4e=(ck=class extends rn{constructor(e,t){super(DQ.ID,"Undo"),this.extension=e,this.extensionRecommendationsManagementService=t,this.class=DQ.Class,this.tooltip=g(7958,"Undo"),this.enabled=!0}run(){return this.extensionRecommendationsManagementService.toggleGlobalIgnoredRecommendation(this.extension.identifier.id,!1),Promise.resolve()}},DQ=ck,ck.ID="extensions.ignore",ck.Class=`${yn.LABEL_ACTION_CLASS} undo-ignore`,ck);R4e=DQ=D([_(1,Gae)],R4e);let vZ=class extends rn{constructor(e,t){super("extensions.searchExtensions",g(7959,"Search Extensions"),void 0,!0),this.searchValue=e,this.paneCompositeService=t}async run(){const e=(await this.paneCompositeService.openPaneComposite(HU,ir.Sidebar,!0))?.getViewPaneContainer();e.search(this.searchValue),e.focus()}};vZ=D([_(1,Dm)],vZ);let bZ=class extends rn{constructor(e,t,i,n,o,r,a,c){super(e,t),this.contextService=i,this.fileService=n,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(n=>this.editorService.openEditor({resource:e,options:{pinned:t,selection:n}})),t=>Promise.reject(new Error(g(7960,"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=ef(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 n=wLe(e),o=zme(n,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,u4e).then(()=>({created:!0,extensionsFileResource:e,content:u4e})))}};bZ=D([_(2,yi),_(3,Jt),_(4,Fo),_(5,ei),_(6,yI),_(7,fn)],bZ);var oR;let M4e=(oR=class extends bZ{constructor(e,t,i,n,o,r,a,c){super(e,t,o,i,n,r,a,c),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.update(),this)),this.update()}update(){this.enabled=this.contextService.getWorkbenchState()!==qi.EMPTY}run(){switch(this.contextService.getWorkbenchState()){case qi.FOLDER:return this.openExtensionsFile(this.contextService.getWorkspace().folders[0].toResource(_F));case qi.WORKSPACE:return this.openWorkspaceConfigurationFile(this.contextService.getWorkspace().configuration)}return Promise.resolve()}},oR.ID="workbench.extensions.action.configureWorkspaceRecommendedExtensions",oR.LABEL=g(7961,"Configure Recommended Extensions (Workspace)"),oR);M4e=D([_(2,Jt),_(3,Fo),_(4,yi),_(5,ei),_(6,yI),_(7,fn)],M4e);var rR;let N4e=(rR=class extends bZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,o,i,n,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(Ett);return Promise.resolve(t).then(i=>i?this.openExtensionsFile(i.toResource(_F)):null)}},rR.ID="workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions",rR.LABEL=g(7962,"Configure Recommended Extensions (Workspace Folder)"),rR);N4e=D([_(2,Jt),_(3,Fo),_(4,yi),_(5,ei),_(6,yI),_(7,fn),_(8,vi)],N4e);var zS;let P4e=(zS=class extends rn{get extension(){return this._extension}set extension(e){this._extension&&e&&Ra(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","",CV.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?CV.ENABLED_CLASS:CV.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 n=()=>{const r=this.extensionService.extensions.filter(a=>Ra({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(aD(this.extension.local)):!1},o=()=>this.extension.local?this.extensionService.extensions.every(r=>!(Ra({id:r.identifier.value,uuid:r.uuid},this.extension.identifier)&&this.extension.server===this.extensionManagementServerService.getExtensionManagementServer(Xae(r))))?!0:this.extensionService.canRemoveExtension(aD(this.extension.local)):!1;if(e!==null){if(e===Qo.Installing&&this.status===Qo.Installed)return n()?this.initialStatus===Qo.Installed&&this.version!==t?g(7963,"Updated"):g(7964,"Installed"):null;if(e===Qo.Uninstalling&&this.status===Qo.Uninstalled)return this.initialStatus=this.status,o()?g(7965,"Uninstalled"):null}if(i!==null){const r=this.extensionEnablementService.isEnabledEnablementState(i),a=this.extensionEnablementService.isEnabledEnablementState(this.enablementState);if(!r&&a)return n()?g(7966,"Enabled"):null;if(r&&!a)return o()?g(7967,"Disabled"):null}return null}run(){return Promise.resolve()}},CV=zS,zS.ENABLED_CLASS=`${yn.TEXT_ACTION_CLASS} extension-status-label`,zS.DISABLED_CLASS=`${zS.ENABLED_CLASS} hide`,zS);P4e=CV=D([_(0,fs),_(1,av),_(2,Ml)],P4e);var $S;let F4e=($S=class extends gZ{constructor(e,t,i,n){super("extensions.sync","",SV.SYNC_CLASS,!1,n),this.configurationService=e,this.extensionsWorkbenchService=t,this.userDataSyncEnablementService=i,this._register(M.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===Qo.Installed,this.extension){const e=this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension);this.class=e?SV.IGNORED_SYNC_CLASS:SV.SYNC_CLASS,this.tooltip=e?g(7968,"This extension is ignored during sync"):g(7969,"This extension is synced")}}async run(){return super.run({actionGroups:[[new rn("extensions.syncignore",this.extensionsWorkbenchService.isExtensionIgnoredToSync(this.extension)?g(7970,"Sync this extension"):g(7971,"Do not sync this extension"),void 0,!0,()=>this.extensionsWorkbenchService.toggleExtensionIgnoredToSync(this.extension))]],disposeActionsOnHide:!0})}},SV=$S,$S.IGNORED_SYNC_CLASS=`${yn.ICON_ACTION_CLASS} extension-sync ${We.asClassName(CVt)}`,$S.SYNC_CLASS=`${$S.ICON_ACTION_CLASS} extension-sync ${We.asClassName(yVt)}`,$S);F4e=SV=D([_(0,Te),_(1,Xo),_(2,cJe),_(3,we)],F4e);var aR;let O4e=(aR=class extends yn{get status(){return this._status}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super("extensions.status","",`${yE.CLASS} hide`,!1),this.extensionManagementServerService=e,this.labelService=t,this.commandService=i,this.workspaceTrustEnablementService=n,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._status=[],this._onDidChangeStatus=this._register(new I),this.onDidChangeStatus=this._onDidChangeStatus.event,this.updateThrottler=new G7,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:ch,message:new Mt(g(7972,"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}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.extension.id]))}`)})`;this.updateStatus({icon:ch,message:new Mt(g(7973,"This extension is deprecated. Use the {0} extension instead.",o))},!0)}else if(this.extension.deprecationInfo.settings){const o=`[${g(7974,"settings")}](${N.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify([this.extension.deprecationInfo.settings.map(r=>`@id:${r}`).join(" ")]))}`)})`;this.updateStatus({icon:ch,message:new Mt(g(7975,"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 Mt(g(7976,"This extension is deprecated as it is no longer being maintained."));this.extension.deprecationInfo.additionalInfo&&o.appendMarkdown(` ${this.extension.deprecationInfo.additionalInfo}`),this.updateStatus({icon:ch,message:o},!0)}return}if(this.extensionsWorkbenchService.canSetLanguage(this.extension))return;if(this.extension.outdated&&this.extensionsWorkbenchService.isAutoUpdateEnabledFor(this.extension)){const o=await this.extensionsWorkbenchService.shouldRequireConsentToUpdate(this.extension);if(o){const r=new Mt;r.appendMarkdown(`${o} `),r.appendMarkdown(g(7977,"Please [review the extension]({0}) and update it manually.",this.extension.hasChangelog()?N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,X3.Changelog]))}`).toString():this.extension.repository?this.extension.repository:N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id]))}`).toString())),this.updateStatus({icon:ch,message:r},!0)}}if(this.extension.gallery&&this.extension.state===Qo.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 Mt(`${g(7978,"The '{0}' extension is not available in {1} for {2}.",this.extension.displayName||this.extension.identifier.id,this.productService.nameLong,_Lt(o))} [${g(7979,"Learn More")}](https://aka.ms/vscode-platform-specific-extensions)`);this.updateStatus({icon:ch,message:r},!0);return}if(this.extensionManagementServerService.webExtensionManagementServer){const o=g(7874,"{0} for the Web",this.productService.nameLong),r=new Mt(`${g(7980,"The '{0}' extension is not available in {1}.",this.extension.displayName||this.extension.identifier.id,o)} [${g(7981,"Learn Why")}](https://aka.ms/vscode-web-extensions-guide)`);this.updateStatus({icon:ch,message:r},!0);return}}if(!this.extension.local||!this.extension.server||this.extension.state!==Qo.Installed)return;if(this.extension.enablementState===Gr.DisabledByEnvironment){this.updateStatus({message:new Mt(g(7982,"This extension is disabled by the environment."))},!0);return}if(this.extension.enablementState===Gr.EnabledByEnvironment){this.updateStatus({message:new Mt(g(7983,"This extension is enabled because it is required in the current environment."))},!0);return}if(this.extension.enablementState===Gr.DisabledByVirtualWorkspace){const o=aK(this.extension.local.manifest.capabilities?.virtualWorkspaces);this.updateStatus({icon:Jm,message:new Mt(o?iV(o):g(7984,"This extension has been disabled because it does not support virtual workspaces."))},!0);return}if(ktt(this.contextService.getWorkspace())){const o=this.extensionManifestPropertiesService.getExtensionVirtualWorkspaceSupportType(this.extension.local.manifest),r=aK(this.extension.local.manifest.capabilities?.virtualWorkspaces);if(o==="limited"||r){this.updateStatus({icon:ch,message:new Mt(r?iV(r):g(7985,"This extension has limited features because the current workspace is virtual."))},!0);return}}if(this.extension.enablementState===Gr.DisabledByTrustRequirement||this.extension.enablementState===Gr.DisabledByExtensionDependency&&this.workbenchExtensionEnablementService.getDependenciesEnablementStates(this.extension.local).every(([,o])=>this.workbenchExtensionEnablementService.isEnabledEnablementState(o)||o===Gr.DisabledByTrustRequirement)){this.enabled=!0;const o=aK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);this.updateStatus({icon:BI,message:new Mt(o?iV(o):g(7986,"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=aK(this.extension.local.manifest.capabilities?.untrustedWorkspaces);if(o==="limited"||r){this.enabled=!0,this.updateStatus({icon:BI,message:new Mt(r?iV(r):g(7987,"This extension has limited features because the current workspace is not trusted."))},!0);return}}if(this.extension.enablementState===Gr.DisabledByExtensionKind&&!this.extensionsWorkbenchService.installed.some(o=>Ra(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 Mt(`${g(7988,"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(7979,"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 Mt(`${g(7989,"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(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`):Wn&&(o=new Mt(`${g(7990,"This extension is disabled because it is defined to run only in {0} for the Desktop.",this.productService.nameLong)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`))):this.extensionManagementServerService.webExtensionManagementServer===this.extension.server&&(o=new Mt(`${g(7991,"This extension is disabled because it is not supported in {0} for the Web.",this.productService.nameLong)} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)),o&&this.updateStatus({icon:ch,message:o},!0);return}const e=new Sn(this.extension.identifier.id),t=Qe.as(Q_.ExtensionFeaturesRegistry).getExtensionFeatures();for(const o of t){const r=this.extensionFeaturesManagementService.getAccessData(e,o.id)?.current?.status,a=`[${g(7992,"Manage Access")}](${N.parse(`command:extension.open?${encodeURIComponent(JSON.stringify([this.extension.identifier.id,X3.Features,!1,o.id]))}`)})`;if(r?.severity===Xe.Error){this.updateStatus({icon:QC,message:new Mt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}if(r?.severity===Xe.Warning){this.updateStatus({icon:ch,message:new Mt().appendText(r.message).appendMarkdown(` ${a}`)},!0);return}}if(this.extensionManagementServerService.remoteExtensionManagementServer){if(bRe(this.extension.local.manifest)){if(!this.extensionsWorkbenchService.installed.some(a=>Ra(a.identifier,this.extension.identifier)&&a.server!==this.extension.server)){const a=this.extension.server===this.extensionManagementServerService.localExtensionManagementServer?new Mt(g(7993,"Install the language pack extension on '{0}' to enable it there also.",this.extensionManagementServerService.remoteExtensionManagementServer.label)):new Mt(g(7994,"Install the language pack extension locally to enable it there also."));this.updateStatus({icon:Jm,message:a},!0)}return}const o=this.extensionService.extensions.filter(a=>Ra({id:a.identifier.value,uuid:a.uuid},this.extension.identifier))[0],r=o?this.extensionManagementServerService.getExtensionManagementServer(Xae(o)):null;if(this.extension.server===this.extensionManagementServerService.localExtensionManagementServer&&r===this.extensionManagementServerService.remoteExtensionManagementServer){this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)&&this.updateStatus({icon:Jm,message:new Mt(`${g(7995,"This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${g(7979,"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:Jm,message:new Mt(`${g(7996,"This extension is enabled in the Local Extension Host because it prefers to run there.")} [${g(7979,"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:Jm,message:new Mt(`${g(7997,"This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${g(7979,"Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`)},!0);return}}if(this.extension.enablementState===Gr.DisabledByExtensionDependency){this.updateStatus({icon:ch,message:new Mt(g(7998,"This extension has been disabled because it depends on an extension that is disabled."))},!0);return}const i=this.workbenchExtensionEnablementService.isEnabled(this.extension.local),n=this.extensionService.extensions.some(o=>Ra({id:o.identifier.value,uuid:o.uuid},this.extension.identifier));if(!this.extension.isWorkspaceScoped&&i&&n){if(this.extension.enablementState===Gr.EnabledWorkspace){this.updateStatus({message:new Mt(g(7999,"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 Mt(g(8e3,"Extension is enabled on '{0}'",this.extension.server.label))},!0);return}if(this.extension.enablementState===Gr.EnabledGlobally)return}if(!i&&!n){if(this.extension.enablementState===Gr.DisabledGlobally){this.updateStatus({message:new Mt(g(8001,"This extension is disabled globally by the user."))},!0);return}if(this.extension.enablementState===Gr.DisabledWorkspace){this.updateStatus({message:new Mt(g(8002,"This extension is disabled for this workspace by the user."))},!0);return}}if(i&&!n&&!this.extension.local.isValid){const o=this.extension.local.validations.filter(([r])=>r===Xe.Error).map(([,r])=>r);this.updateStatus({icon:QC,message:new Mt(o.join(" ").trim())},!0)}}updateStatus(e,t){if(e){if(this._status.some(i=>i.message.value===e.message.value&&i.icon?.id===e.icon?.id))return}else{if(this._status.length===0)return;this._status=[]}e&&(this._status.push(e),this._status.sort((i,n)=>n.icon===BI?-1:i.icon===BI?1:n.icon===QC?-1:i.icon===QC?1:n.icon===ch?-1:i.icon===ch?1:n.icon===Jm?-1:i.icon===Jm?1:0)),t&&(e?.icon===QC?this.class=`${yE.CLASS} extension-status-error ${We.asClassName(QC)}`:e?.icon===ch?this.class=`${yE.CLASS} extension-status-warning ${We.asClassName(ch)}`:e?.icon===Jm?this.class=`${yE.CLASS} extension-status-info ${We.asClassName(Jm)}`:e?.icon===BI?this.class=`${yE.CLASS} ${We.asClassName(BI)}`:this.class=`${yE.CLASS} hide`),this._onDidChangeStatus.fire()}async run(){if(this._status[0]?.icon===BI)return this.commandService.executeCommand("workbench.trust.manage")}},yE=aR,aR.CLASS=`${yn.ICON_ACTION_CLASS} extension-status`,aR);O4e=yE=D([_(0,av),_(1,Fs),_(2,vi),_(3,gae),_(4,cC),_(5,Xo),_(6,fs),_(7,xm),_(8,yi),_(9,Er),_(10,Ml),_(11,XJe)],O4e);var lk;let B4e=(lk=class extends rn{constructor(e=kQ.ID,t=kQ.LABEL,i,n,o,r,a,c,l){super(e,t),this.extensionsWorkbenchService=i,this.extensionManagementServerService=n,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(8004,"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(vZ,"@installed ").run().then(()=>this.extensionsWorkbenchService.reinstall(e).then(t=>{const i=!(t.local&&this.extensionService.canAddExtension(aD(t.local))),n=i?g(8005,"Please reload Visual Studio Code to complete reinstalling the extension {0}.",t.identifier.id):g(8006,"Reinstalling the extension {0} is completed.",t.identifier.id),o=i?[{label:g(8007,"Reload Now"),run:()=>this.hostService.reload()}]:[];this.notificationService.prompt(Xe.Info,n,o,{sticky:!0})},t=>this.notificationService.error(t)))}},kQ=lk,lk.ID="workbench.extensions.action.reinstall",lk.LABEL=g(8003,"Reinstall Extension..."),lk);B4e=kQ=D([_(2,Xo),_(3,av),_(4,In),_(5,bi),_(6,xc),_(7,we),_(8,fs)],B4e);var dk;let W4e=(dk=class extends rn{constructor(e=IQ.ID,t=IQ.LABEL,i,n,o,r){super(e,t),this.extensionsWorkbenchService=i,this.quickInputService=n,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(8009,"Select Extension"),matchOnDetail:!0});e&&e.extension&&(await this.instantiationService.createInstance(p9,e.extension,!0).run(),await this.instantiationService.createInstance(vZ,e.extension.identifier.id).run())}isEnabled(e){return this.instantiationService.createInstance(p9,e,!0).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,n)=>i.extension.displayName.localeCompare(n.extension.displayName))}},IQ=dk,dk.ID="workbench.extensions.action.install.specificVersion",dk.LABEL=g(8008,"Install Specific Version of Extension..."),dk);W4e=IQ=D([_(2,Xo),_(3,In),_(4,we),_(5,Ml)],W4e);let wZ=class extends rn{constructor(e,t,i,n,o){super(e),this.extensionsWorkbenchService=t,this.quickInputService=i,this.notificationService=n,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(8010,"Select extensions to install"),e.canSelectMany=!0,i.sort((n,o)=>n.displayName.localeCompare(o.displayName)),e.items=i.map(n=>({extension:n,label:n.displayName,description:n.version}))):(e.hide(),e.dispose(),this.notificationService.notify({severity:Xe.Info,message:g(8011,"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:dd.Notification,title:g(8012,"Installing Extensions...")},()=>this.installExtensions(t)),this.notificationService.info(g(8013,"Successfully installed extensions.")))}}};wZ=D([_(1,Xo),_(2,In),_(3,bi),_(4,og)],wZ);let H4e=class extends wZ{constructor(e,t,i,n,o,r,a,c,l){super("workbench.extensions.actions.installLocalExtensionsInRemote",e,t,n,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(8014,"Install Local Extensions in '{0}'...",this.extensionManagementServerService.remoteExtensionManagementServer.label):""}getQuickPickTitle(){return g(8015,"Install Local Extensions in '{0}'",this.extensionManagementServerService.remoteExtensionManagementServer.label)}getExtensionsToInstall(e){return e.filter(t=>{const i=this.instantiationService.createInstance(wCe,!0);return i.extension=t,i.enabled})}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.getTargetPlatform();await Zs.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:n,compatible:!0},He.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await Zs.settled(t.map(o=>this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await Zs.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)}}}};H4e=D([_(0,Xo),_(1,In),_(2,og),_(3,bi),_(4,av),_(5,bI),_(6,we),_(7,Jt),_(8,Ge)],H4e);let U4e=class extends wZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,i,o,n),this.extensionManagementServerService=r,this.extensionGalleryService=a,this.fileService=c,this.logService=l}get label(){return g(8016,"Install Remote Extensions Locally...")}getQuickPickTitle(){return g(8017,"Install Remote Extensions Locally")}getExtensionsToInstall(e){return e.filter(t=>t.type===br.User&&t.server!==this.extensionManagementServerService.localExtensionManagementServer&&!this.extensionsWorkbenchService.installed.some(i=>i.server===this.extensionManagementServerService.localExtensionManagementServer&&Ra(i.identifier,t.identifier)))}async installExtensions(e){const t=[],i=[],n=await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.getTargetPlatform();await Zs.settled(e.map(async o=>{if(this.extensionGalleryService.isEnabled()){const a=(await this.extensionGalleryService.getExtensions([{...o.identifier,preRelease:!!o.local?.preRelease}],{targetPlatform:n,compatible:!0},He.None))[0];if(a){t.push(a);return}}const r=await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.zip(o.local);i.push(r)})),await Zs.settled(t.map(o=>this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(o)));try{await Zs.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)}}}};U4e=D([_(1,Xo),_(2,In),_(3,og),_(4,bi),_(5,av),_(6,bI),_(7,Jt),_(8,Ge)],U4e);_t.registerCommand("workbench.extensions.action.showExtensionsForLanguage",function(s,e){return s.get(Dm).openPaneComposite(HU,ir.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{i.search(`ext:${e.replace(/^\./,"")}`),i.focus()})});const ICe="workbench.extensions.action.showExtensionsWithIds";_t.registerCommand(ICe,function(s,e){return s.get(Dm).openPaneComposite(HU,ir.Sidebar,!0).then(i=>i?.getViewPaneContainer()).then(i=>{const n=e.map(o=>`@id:${o}`).join(" ");i.search(n),i.focus()})});W("extensionButton.background",{dark:fy,light:fy,hcDark:null,hcLight:null},g(8018,"Button background color for extension actions."));W("extensionButton.foreground",{dark:pM,light:pM,hcDark:null,hcLight:null},g(8019,"Button foreground color for extension actions."));W("extensionButton.hoverBackground",{dark:U8,light:U8,hcDark:null,hcLight:null},g(8020,"Button background hover color for extension actions."));W("extensionButton.separator",XKe,g(8021,"Button separator color for extension actions"));W("extensionButton.prominentBackground",{dark:fy,light:fy,hcDark:null,hcLight:null},g(8022,"Button background color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentForeground",{dark:pM,light:pM,hcDark:null,hcLight:null},g(8023,"Button foreground color for extension actions that stand out (e.g. install button)."));W("extensionButton.prominentHoverBackground",{dark:U8,light:U8,hcDark:null,hcLight:null},g(8024,"Button background hover color for extension actions that stand out (e.g. install button)."));bp((s,e)=>{const t=s.getColor(xN);t&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(QC)} { color: ${t}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(QC)} { color: ${t}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(QC)} { color: ${t}; }`));const i=s.getColor(um);i&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(ch)} { color: ${i}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(ch)} { color: ${i}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(ch)} { color: ${i}; }`));const n=s.getColor(gm);n&&(e.addRule(`.extension-editor .header .actions-status-container > .status ${We.asCSSSelector(Jm)} { color: ${n}; }`),e.addRule(`.extension-editor .body .subcontent .runtime-status ${We.asCSSSelector(Jm)} { color: ${n}; }`),e.addRule(`.monaco-hover.extension-hover .markdown-hover .hover-contents ${We.asCSSSelector(Jm)} { color: ${n}; }`))});let yZ=class extends V{constructor(e,t,i){super(),this.chatAgentService=e,this.extensionService=t,this.chatAgentNameService=i,this._onDidChangeContents=this._register(new I),this.onDidChangeContents=this._onDidChangeContents.event;const n=Bt(".chat-agent-hover@root",[Bt(".chat-agent-hover-header",[Bt(".chat-agent-hover-icon@icon"),Bt(".chat-agent-hover-details",[Bt(".chat-agent-hover-name@name"),Bt(".chat-agent-hover-extension",[Bt(".chat-agent-hover-extension-name@extensionName"),Bt(".chat-agent-hover-separator@separator"),Bt(".chat-agent-hover-publisher@publisher")])])]),Bt(".chat-agent-hover-warning@warning"),Bt("span.chat-agent-hover-description@description")]);this.domNode=n.root,this.icon=n.icon,this.name=n.name,this.extensionName=n.extensionName,this.description=n.description,n.separator.textContent="|";const o=fe("span.extension-verified-publisher",void 0,qy(SVt));this.publisherName=fe("span.chat-agent-hover-publisher-name"),re(n.publisher,o,this.publisherName),n.warning.appendChild(qy(ve.warning)),n.warning.appendChild(fe("span",void 0,g(10556,"This chat extension is using a reserved name.")))}setAgent(e){const t=this.chatAgentService.getAgent(e);if(t.metadata.icon instanceof N){const o=fe("img.icon");o.src=Jg.uriToBrowserUri(t.metadata.icon).toString(!0),this.icon.replaceChildren(fe(".avatar",void 0,o))}else if(t.metadata.themeIcon){const o=fe(We.asCSSSelector(t.metadata.themeIcon));this.icon.replaceChildren(fe(".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}`:wce(t),this.extensionName.textContent=t.extensionDisplayName,this.publisherName.textContent=t.publisherDisplayName??t.extensionPublisherId;let n=t.description??"";if(n&&(n.match(/[\.\?\!] *$/)||(n+=".")),this.description.textContent=n,this.domNode.classList.toggle("allowedName",i),this.domNode.classList.toggle("verifiedPublisher",!1),!t.isDynamic){const o=this._register(new ci);this.extensionService.getExtensions([{id:t.extensionId.value}],o.token).then(r=>{o.dispose(),r[0]?.publisherDomain?.verified&&(this.domNode.classList.toggle("verifiedPublisher",!0),this._onDidChangeContents.fire())})}}};yZ=D([_(0,ff),_(1,Xo),_(2,Wae)],yZ);function Itt(s,e){return{actions:[{commandId:ICe,label:g(10557,"View Extension"),run:()=>{const t=s();t&&e.executeCommand(ICe,[t.extensionId.value])}}]}}let TCe=class extends V{constructor(e,t=[],i=fe(".chat-attached-context"),n,o){super(),this.variables=e,this.contentReferences=t,this.domNode=i,this.instantiationService=n,this.openerService=o,this.attachedContextDisposables=this._register(new Z),this._onDidChangeVisibility=this._register(new I),this._contextResourceLabels=this.instantiationService.createInstance(WA,{onDidChangeVisibility:this._onDidChangeVisibility.event}),this.initAttachedContext(i)}initAttachedContext(e){Ms(e),this.attachedContextDisposables.clear(),eTe(!!this.variables.length,this.domNode),this.variables.forEach(t=>{const i=re(e,fe(".chat-attached-context-attachment.show-file-icons")),n=this._contextResourceLabels.create(i,{supportIcons:!0}),o=N.isUri(t.value)?t.value:t.value&&typeof t.value=="object"&&"uri"in t.value&&N.isUri(t.value.uri)?t.value.uri:void 0,r=t.value&&typeof t.value=="object"&&"range"in t.value&&F.isIRange(t.value.range)?t.value.range:void 0,a=this.contentReferences.find(h=>"variableName"in h.reference&&h.reference.variableName===t.name),c=a?.options?.status?.kind===NW.Omitted,l=c||a?.options?.status?.kind===NW.Partial;if(o){const h=Ko(o.path),u=bb(o.path),f=`${h} ${u}`;let p;c?p=r?g(10558,"Omitted: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10559,"Omitted: {0}.",f):l?p=r?g(10560,"Partially attached: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10561,"Partially attached: {0}.",f):p=r?g(10562,"Attached: {0}, line {1} to line {2}.",f,r.startLineNumber,r.endLineNumber):g(10563,"Attached: {0}.",f),n.setFile(o,{fileKind:ba.FILE,hidePath:!0,range:r,title:a?.options?.status?.description}),i.ariaLabel=p,i.tabIndex=0,i.style.cursor="pointer",this.attachedContextDisposables.add(ue(i,ke.CLICK,async m=>{en.stop(m,!0),o&&this.openerService.open(o,{fromUserGesture:!0,editorOptions:{selection:r}})}))}else{const h=t.fullName??t.name,u=t.icon?.id?`$(${t.icon.id}) ${h}`:h;n.setLabel(u,a?.options?.status?.description),i.ariaLabel=g(10564,"Attached context: {0}.",t.name),i.tabIndex=0}l&&i.classList.add("warning");const d=a?.options?.status?.description;if(l){i.ariaLabel=`${i.ariaLabel}${d?` ${d}`:""}`;for(const h of[".monaco-icon-suffix-container",".monaco-icon-name-container"]){const u=n.element.querySelector(h);u&&u.classList.add("warning")}}})}};TCe=D([_(3,we),_(4,Ao)],TCe);let LCe=class extends V{constructor(e,t,i,n){super(),this.editorService=i,this.telemetryService=n;const o=vtt(e.citations),r=Bt(".chat-code-citation-message@root",[Bt("span.chat-code-citation-label@label"),Bt(".chat-code-citation-button-container@button")]);r.label.textContent=o+" - ";const a=this._register(new jd(r.button,{buttonBackground:void 0,buttonBorder:void 0,buttonForeground:void 0,buttonHoverBackground:void 0,buttonSecondaryBackground:void 0,buttonSecondaryForeground:void 0,buttonSecondaryHoverBackground:void 0,buttonSeparator:void 0}));a.label=g(10566,"View matches"),this._register(a.onDidClick(()=>{const c=`# Code Citations `+e.citations.map(l=>`## License: ${l.license} ${l.value.toString()} @@ -824,25 +824,25 @@ ${l.snippet} \`\`\` `).join(` -`);this.editorService.openEditor({resource:void 0,contents:c,languageId:"markdown"}),this.telemetryService.publicLog2("openedChatCodeCitations")})),this.domNode=r.root}hasSameContent(e,t,i){return e.kind==="codeCitations"}};OCe=D([_(2,ei),_(3,Yi)],OCe);const FVt=fe;let BCe=class extends V{constructor(e,t,i){super(),this.commandService=i,this.domNode=FVt(".chat-command-button");const n=!vs(t.element)||!t.element.isStale,o=n?e.command.tooltip:g(10565,"Button not available in restored chat"),r=this._register(new Jd(this.domNode,{...y6,supportIcons:!0,title:o}));r.label=e.command.title,r.enabled=n,this._register(r.onDidClick(()=>this.commandService.executeCommand(e.command.id,...e.command.arguments??[])))}hasSameContent(e){return e.kind==="command"}};BCe=D([_(2,vi)],BCe);var OVt=".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}";ut(OVt,{});let WCe=class extends V{get onDidClick(){return this._onDidClick.event}get domNode(){return this._domNode}setShowButtons(e){this.domNode.classList.toggle("hideButtons",!e)}constructor(e,t,i,n){super(),this.instantiationService=n,this._onDidClick=this._register(new I);const o=Bt(".chat-confirmation-widget@root",[Bt(".chat-confirmation-widget-title@title"),Bt(".chat-confirmation-widget-message@message"),Bt(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=o.root;const r=this._register(this.instantiationService.createInstance(Y_,{})),a=this._register(r.render(new Mt(e)));o.title.appendChild(a.element);const c=this._register(r.render(new Mt(t)));o.message.appendChild(c.element),i.forEach(l=>{const d=new Jd(o.buttonsContainer,{...y6,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};WCe=D([_(3,we)],WCe);let HCe=class extends V{constructor(e,t,i,n){super(),this.instantiationService=i,this.chatService=n,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const o=t.element,r=e.buttons?e.buttons.map(c=>({label:c,data:e.data})):[{label:g(10567,"Accept"),data:e.data},{label:g(10568,"Dismiss"),data:e.data,isSecondary:!0}],a=this._register(this.instantiationService.createInstance(WCe,e.title,e.message,r));a.setShowButtons(!e.isUsed),this._register(a.onDidClick(async c=>{if(vs(o)){const l=`${c.label}: "${e.title}"`,d=c.isSecondary?{rejectedConfirmationData:[c.data]}:{acceptedConfirmationData:[c.data]};d.agentId=o.agent?.id,d.slashCommand=o.slashCommand?.name,await this.chatService.sendRequest(o.sessionId,l,d)&&(e.isUsed=!0,a.setShowButtons(!1),this._onDidChangeHeight.fire())}})),this.domNode=a.domNode}hasSameContent(e){return e.kind==="confirmation"}addDisposable(e){this._register(e)}};HCe=D([_(2,we),_(3,km)],HCe);class xce extends V{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)}}W("chat.requestBorder",{dark:new me(new dn(255,255,255,.1)),light:new me(new dn(0,0,0,.1)),hcDark:wt,hcLight:wt},g(7156,"The border color of a chat request."));const BVt=W("chat.requestBackground",{dark:st(Hc,.62),light:st(Hc,.62),hcDark:xh,hcLight:null},g(7157,"The background color of a chat request.")),eVe=W("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:me.white,hcLight:yT},g(7158,"The background color of a chat slash command.")),tVe=W("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:me.black,hcLight:$re},g(7159,"The foreground color of a chat slash command."));W("chat.avatarBackground",{dark:"#1f1f1f",light:"#f2f2f2",hcDark:me.black,hcLight:me.white},g(7160,"The background color of a chat avatar."));W("chat.avatarForeground",zi,g(7161,"The foreground color of a chat avatar."));const gue="http://_vscodedecoration_",RQ="http://_chatagent_",WVt="http://_chatslash_";function HVt(s,e,t){const i=t.get(zae),n=t.get(_f),o=i.getAgentNameRestriction(s);let r=`${o?s.name:Ace(s)}`;o&&n.agentHasDupeName(s.id)&&(r+=` (${s.publisherDisplayName})`);const c={agentId:s.id,name:r,isClickable:e};return`[${s.name}](${RQ}?${encodeURIComponent(JSON.stringify(c))})`}let AZ=class{constructor(e,t,i,n,o,r,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=n,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 cb)t+=i.text;else if(i instanceof $g)t+=this.instantiationService.invokeFunction(n=>HVt(i.agent,!1,n));else{const n=i instanceof OW&&i.data instanceof N?i.data:void 0,o=n?encodeURIComponent(this.labelService.getUriLabel(n,{relative:!0})):i instanceof $g?i.agent.id:"",r=i.text;t+=`[${r}](${gue}?${o})`}return t}walkTreeAndAnnotateReferenceLinks(e){const t=new Z;return e.querySelectorAll("a").forEach(i=>{const n=i.getAttribute("data-href");if(n)if(n.startsWith(RQ)){let o;try{o=JSON.parse(decodeURIComponent(n.slice(RQ.length+1)))}catch(r){this.logService.error("Invalid chat widget render data JSON",Nr(r))}o&&i.parentElement.replaceChild(this.renderAgentWidget(o,t),i)}else if(n.startsWith(WVt)){let o;try{o=JSON.parse(decodeURIComponent(n.slice(RQ.length+1)))}catch(r){this.logService.error("Invalid chat slash command render data JSON",Nr(r))}o&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,o,t),i)}else if(n.startsWith(gue)){const o=decodeURIComponent(n.slice(gue.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,o),i)}else n.startsWith(Dtt)?this.renderFileWidget(n,i):n.startsWith("command:")&&this.injectKeybindingHint(i,n,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${QU}${e.name}`;let n;if(e.isClickable){n=fe("span.chat-agent-widget");const a=t.add(new Jd(n,{buttonBackground:ze(eVe),buttonForeground:ze(tVe),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 n=this.renderResourceWidget(i,void 0);const o=this.chatAgentService.getAgent(e.agentId),r=new ya(()=>t.add(this.instantiationService.createInstance(SZ)));return t.add(this.hoverService.setupManagedHover(Pr("element"),n,()=>(r.value.setAgent(e.agentId),r.value.domNode),o&&Ott(()=>o,this.commandService))),n}renderSlashCommandWidget(e,t,i){const n=fe("span.chat-agent-widget.chat-command-widget"),o=this.chatAgentService.getAgent(t.agentId),r=i.add(new Jd(n,{buttonBackground:ze(eVe),buttonForeground:ze(tVe),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})})),n}renderFileWidget(e,t){const i=N.parse(e);let n;try{n=Mo(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Nr(a));return}if(!n.uri||!N.isUri(n.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const o=n.range?`${n.range.startLineNumber}-${n.range.endLineNumber}`:"";t.setAttribute("data-href",n.uri.with({fragment:o}).toString());const r=this.labelService.getUriLabel(n.uri,{relative:!0});t.title=n.range?`${r}#${n.range.startLineNumber}-${n.range.endLineNumber}`:r}renderResourceWidget(e,t){const i=fe("span.chat-resource-widget"),n=fe("span",void 0,e);return t&&(n.title=t),i.appendChild(n),i}injectKeybindingHint(e,t,i){const n=t.match(/command:([^\)]+)/)?.[1];if(n){const o=i.lookupKeybinding(n);if(o){const r=o.getLabel();r&&(e.textContent=`${e.textContent} (${r})`)}}}};AZ=D([_(0,Ut),_(1,Fs),_(2,Ge),_(3,_f),_(4,we),_(5,ec),_(6,km),_(7,UN),_(8,vi)],AZ);const iVe=fe;let EZ=class extends V{constructor(e,t,i,n=!1,o=0,r,a,c,l,d,h,u){super(),this.markdown=e,this.editorPool=i,this.codeBlockModelCollection=c,this.textModelService=h,this.allRefs=[],this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this.codeblocks=[];const f=t.element,p=u.createInstance(AZ),m=[];let v=o;const b=this._register(r.render(e,{fillInIncompleteTokens:n,codeBlockRendererSync:(w,y)=>{const C=v++;let A,L,k;if(ua(w,yVt))try{const G=CVt(y);L=G.range&&F.lift(G.range),A=this.textModelService.createModelReference(G.uri).then(Y=>Y.object)}catch{return iVe("div")}else{if(!Uu(f)&&!vs(f))return console.error("Trying to render code block in welcome",f.id,C),iVe("div");const G=vs(f)||Uu(f)?f.sessionId:"",Y=this.codeBlockModelCollection.getOrCreate(G,f,C);k=Y.vulns,A=Y.model}const P=vs(f)&&f.errorDetails?.responseIsFiltered,R=this.renderCodeBlock({languageId:w,textModel:A,codeBlockIndex:C,element:f,range:L,hideToolbar:P,parentContextKeyService:d,vulns:k},y,a,l.editableCodeBlock);this.allRefs.push(R),this._register(R.object.onDidChangeContentHeight(()=>this._onDidChangeHeight.fire()));const z={codeBlockIndex:C,element:f,focus(){R.object.focus()},uri:R.object.uri};return this.codeblocks.push(z),m.push(R),R.object.element},asyncRenderCallback:()=>this._onDidChangeHeight.fire()}));this._register(p.walkTreeAndAnnotateReferenceLinks(b.element)),m.reverse().forEach(w=>this._register(w)),this.domNode=b.element}renderCodeBlock(e,t,i,n){const o=this.editorPool.get(),r=o.object;return vs(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),r.render(e,i,n),o}hasSameContent(e){return e.kind==="markdownContent"&&e.content.value===this.markdown.value}layout(e){this.allRefs.forEach(t=>t.object.layout(e))}addDisposable(e){this._register(e)}};EZ=D([_(9,Le),_(10,fn),_(11,we)],EZ);let UCe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new xce(()=>n.createInstance(lCe,e,_e.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)}}}};UCe=D([_(3,we)],UCe);class Btt extends V{constructor(e,t,i,n,o){super();const r=i.content.slice(i.index+1);if(this.showSpinner=n??nVe(r,i.element),o!==!0&&r.some(h=>h.kind!=="progressMessage")){this.domNode=fe("");return}this.showSpinner&&Mr(e.content.value);const c=this.showSpinner?We.modify(ve.loading,"spin").id:ve.check.id,l=new Mt(`$(${c}) ${e.content.value}`,{supportThemeIcons:!0}),d=this._register(t.render(l));d.element.classList.add("progress-step"),this.domNode=d.element}hasSameContent(e,t,i){const n=nVe(t,i);return e.kind==="progressMessage"&&this.showSpinner===n}}function nVe(s,e){return vs(e)&&!e.isComplete&&s.length===0}var VCe;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_LIGHT="hcLight",s.HIGH_CONTRAST_DARK="hcDark"})(VCe||(VCe={}));var xV;const UVt="workbench.view.explorer",Bb="workbench.explorer.fileView";new Q("explorerViewletVisible",!0,{type:"boolean",description:g(5364,"True when the EXPLORER viewlet is visible.")});const ANe=new Q("foldersViewVisible",!0,{type:"boolean",description:g(5365,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),VVt=new Q("explorerResourceIsFolder",!1,{type:"boolean",description:g(5366,"True when the focused item in the EXPLORER is a folder.")}),Wtt=new Q("explorerResourceReadonly",!1,{type:"boolean",description:g(5367,"True when the focused item in the EXPLORER is read-only.")}),Htt=Wtt.toNegated(),zVt=new Q("explorerResourceAvailableEditorIds",""),$Vt=new Q("explorerResourceIsRoot",!1,{type:"boolean",description:g(5368,"True when the focused item in the EXPLORER is a root folder.")}),GVt=new Q("explorerResourceCut",!1,{type:"boolean",description:g(5369,"True when an item in the EXPLORER has been cut for cut and paste.")}),KVt=new Q("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(5370,"True when the focused item in the EXPLORER can be moved to trash.")}),Utt=new Q("filesExplorerFocus",!0,{type:"boolean",description:g(5371,"True when the focus is inside the EXPLORER view.")});new Q("openEditorsFocus",!0,{type:"boolean",description:g(5372,"True when the focus is inside the OPEN EDITORS view.")});const Vtt=new Q("explorerViewletFocus",!0,{type:"boolean",description:g(5373,"True when the focus is inside the EXPLORER viewlet.")}),qVt=new Q("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(5374,"True when the focused item in the EXPLORER view is a compact item.")}),QVt=new Q("explorerViewletCompressedFirstFocus",!0,{type:"boolean",description:g(5375,"True when the focus is inside a compact item's first part in the EXPLORER view.")}),jVt=new Q("explorerViewletCompressedLastFocus",!0,{type:"boolean",description:g(5376,"True when the focus is inside a compact item's last part in the EXPLORER view.")}),YVt=new Q("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(5377,"True when a workspace in the EXPLORER view has some collapsible root child.")});he.and(ANe,Utt,he.not(yae));he.and(ANe,Vtt,he.not(yae));const ztt="workbench.editors.files.textFileEditor",$tt="workbench.editors.files.fileEditorInput",JVt="workbench.editors.files.binaryFileEditor";var zCe;(function(s){s.Default="default",s.Mixed="mixed",s.FilesFirst="filesFirst",s.Type="type",s.Modified="modified",s.FoldersNestsFiles="foldersNestsFiles"})(zCe||(zCe={}));var RT;(function(s){s.Verbose="verbose",s.Default="default",s.Light="light"})(RT||(RT={}));var sVe;(function(s){s.Default="default",s.Upper="upper",s.Lower="lower",s.Unicode="unicode"})(sVe||(sVe={}));let oVe=xV=class extends V{constructor(e,t,i,n){super(),this.textFileService=e,this.fileService=t,this.languageService=i,this.modelService=n,this.fileWatcherDisposable=this._register(new wn)}static async open(e,t,i,n,o){await n.openEditor({original:{resource:xV.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=xV.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const n=new Z;this.fileWatcherDisposable.value=n,n.add(this.fileService.onDidFilesChange(o=>{o.contains(t,To.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&n.add(M.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=xV.textFileToResource(e),n=await this.textFileService.readStream(i);let o=this.modelService.getModel(e);if(o)this.modelService.updateModel(o,n.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(n.value,a,e)}return o}};oVe=xV=D([_(0,Fo),_(1,Jt),_(2,xi),_(3,gi)],oVe);const koe=class koe{constructor(e,t){this._editor=e,this._group=t,this.id=koe.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 Na.getOriginalUri(this.editor,{supportSideBySide:Hs.PRIMARY})}};koe.COUNTER=0;let xZ=koe;var rVe;(function(s){s[s.Confirmation=1]="Confirmation",s[s.Prompt=2]="Prompt",s[s.Input=3]="Input"})(rVe||(rVe={}));var Gh;(function(s){s[s.SAVE=0]="SAVE",s[s.DONT_SAVE=1]="DONT_SAVE",s[s.CANCEL=2]="CANCEL"})(Gh||(Gh={}));const LK=10;function Gtt(s){const e=[];return e.push(...s.slice(0,LK).map(t=>typeof t=="string"?t:_i(t))),s.length>LK&&(s.length-LK===1?e.push(g(5690,"...1 additional file not shown")):e.push(g(5691,"...{0} additional files not shown",s.length-LK))),e.push(""),e.join(` -`)}var XVt=".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)}";ut(XVt,{});const DZ=0,aVe=[DZ,[]];function cVe(s,e,t,i){if(!s||!e)return aVe;const n=s.length,o=e.length;if(n0,v=s[u],b=e[u];for(let w=0;w0,C=f+w,A=C-1,L=p+w-1,k=y?a[A]:0,P=m&&y?a[L]:0,R=m&&y?c[L]:0;let z;!P&&m?z=0:z=e5t(v,b,i,n,w,R),z&&P+z>=k&&(r||m||n.startsWith(e,w))?(c[C]=R+1,a[C]=P+z):(c[C]=DZ,a[C]=k)}}const l=[];let d=t-1,h=o-1;for(;d>=0&&h>=0;){const u=d*o+h;c[u]===DZ||(l.push(h),d--),h--}return[a[t*o-1],l.reverse()]}function e5t(s,e,t,i,n,o){let r=0;if(!t5t(e,i[n]))return r;if(r+=1,o>0&&(r+=o*5),s===t[n]&&(r+=1),n===0)r+=8;else{const a=i5t(t.charCodeAt(n-1));a?r+=a:g6(t.charCodeAt(n))&&o===0&&(r+=2)}return r}function t5t(s,e){return s===e?!0:s==="/"||s==="\\"?e==="/"||e==="\\":!1}function i5t(s){switch(s){case B.Slash:case B.Backslash:return 5;case B.Underline:case B.Dash:case B.Period:case B.Space:case B.SingleQuote:case B.DoubleQuote:case B.Colon:return 4;default:return 0}}const Ktt=[void 0,[]];function fue(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?n5t(s,n.values,t,i):qtt(s,e,t,i)}function n5t(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,c]=qtt(s,r,t,i);if(typeof a!="number")return Ktt;n+=a,o.push(...c)}return[n,qCe(o)]}function qtt(s,e,t,i){const n=Uk(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],xU(n)]:Ktt}const kZ=Object.freeze({score:0}),MQ=1<<18,$Ce=1<<17,GCe=65536;function s5t(s,e,t,i){const n=i.values?i.values:[i];return Wc({[i.normalized]:{values:n.map(r=>({value:r.normalized,expectContiguousMatch:r.expectContiguousMatch})),label:s,description:e,allowNonContiguousMatches:t}})}function KCe(s,e,t,i,n){if(!s||!e.normalized)return kZ;const o=i.getItemLabel(s);if(!o)return kZ;const r=i.getItemDescription(s),a=s5t(o,r,t,e),c=n[a];if(c)return c;const l=o5t(o,r,i.getItemPath(s),e);return n[a]=l,l}function o5t(s,e,t,i,n){const o=!t||!i.containsPathSeparator;return t&&(pr?i.pathNormalized===t:ua(i.pathNormalized,t))?{score:MQ,labelMatch:[{start:0,end:s.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?r5t(s,e,t,i.values,o):Qtt(s,e,t,i,o)}function r5t(s,e,t,i,n,o){let r=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=Qtt(s,e,t,l,n);if(d===DZ)return kZ;r+=d,h&&a.push(...h),u&&c.push(...u)}return{score:r,labelMatch:qCe(a),descriptionMatch:qCe(c)}}function Qtt(s,e,t,i,n,o){if(n||!e){const[r,a]=cVe(s,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(r){const c=CM(i.normalized,s);let l;if(c){l=$Ce;const d=Math.round(i.normalized.length/s.length*100);l+=d}else l=GCe;return{score:l+r,labelMatch:c||lVe(a)}}}if(e){let r=e;t&&(r=`${e}${ou}`);const a=r.length,c=`${r}${s}`,[l,d]=cVe(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=lVe(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 kZ}function lVe(s){const e=[];if(!s)return e;let t;for(const i of s)t&&t.end===i?t.end+=1:(t={start:i,end:i+1},e.push(t));return e}function qCe(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!a5t(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function a5t(s,e){return!(s.endGCe||l>GCe){if(c!==l)return c>l?-1:1;if(c<$Ce&&l<$Ce){const v=l5t(r.labelMatch,a.labelMatch);if(v!==0)return v}const p=n.getItemLabel(s)||"",m=n.getItemLabel(e)||"";if(p.length!==m.length)return p.length-m.length}if(c!==l)return c>l?-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=dVe(s,r,n),f=dVe(e,a,n);return u&&f&&u!==f?f>u?-1:1:d5t(s,e,t,n)}function dVe(s,e,t){let i=-1,n=-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(n=e.labelMatch[e.labelMatch.length-1].end,e.descriptionMatch&&e.descriptionMatch.length){const o=t.getItemDescription(s);o&&(n+=o.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(n=e.descriptionMatch[e.descriptionMatch.length-1].end);return n-i}function l5t(s,e){if(!s&&!e||(!s||!s.length)&&(!e||!e.length))return 0;if(!e||!e.length)return-1;if(!s||!s.length)return 1;const t=s[0].start,n=s[s.length-1].end-t,o=e[0].start,a=e[e.length-1].end-o;return n===a?0:a=0,r=hVe(s);let a;const c=s.split(jtt);if(c.length>1)for(const l of c){const d=hVe(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=uVe(l);u&&(a||(a=[]),a.push({original:l,originalLowercase:l.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function uVe(s){let e;Qn?e=s.replace(/\//g,ou):e=s.replace(/\\/g,ou);const t=dat(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function gVe(s){return Array.isArray(s)?b9(s.map(e=>e.original).join(jtt)):b9(s.original)}var QCe,jCe,YCe;let w9=class extends mNe{constructor(e,t,i,n,o){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(9601,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=n,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=b9(e),i=this.doGetEditorPickItems().filter(o=>{if(!t.normalized)return!0;const r=KCe(o,t,!0,j2e,this.pickState.scorerCache);return r.score?(o.highlights={label:r.labelMatch,description:r.descriptionMatch},!0):!1});if(t.normalized){const o=this.editorGroupService.getGroups(hu.GRID_APPEARANCE).map(r=>r.id);i.sort((r,a)=>r.groupId!==a.groupId?o.indexOf(r.groupId)-o.indexOf(a.groupId):c5t(r,a,t,!0,j2e,this.pickState.scorerCache))}const n=[];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&&n.push({type:"separator",label:a.label}),o=r.groupId}n.push(r)}}else n.push(...i);return n}doGetEditorPickItems(){const e=this.doGetEditors(),t=new Map;for(const{groupId:i}of e)if(!t.has(i)){const n=this.editorGroupService.getGroup(i);n&&t.set(i,n.ariaLabel)}return this.doGetEditors().map(({editor:i,groupId:n})=>{const o=Na.getOriginalUri(i,{supportSideBySide:Hs.PRIMARY}),r=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:n,resource:o,label:i.getName(),ariaLabel:t.size>1?r?g(9602,"{0}, unsaved changes, {1}",c,t.get(n)):g(9603,"{0}, {1}",c,t.get(n)):r?g(9604,"{0}, unsaved changes",c):c,description:a,iconClasses:Mx(this.modelService,this.languageService,o,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(n)?.isPinned(i),buttons:[{iconClass:r?"dirty-editor "+We.asClassName(ve.closeDirty):We.asClassName(ve.close),tooltip:g(9605,"Close Editor"),alwaysVisible:r}],trigger:async()=>{const l=this.editorGroupService.getGroup(n);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?IS.REMOVE_ITEM:IS.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(n)?.openEditor(i,{preserveFocus:d.inBackground})}})}};w9=D([_(1,Po),_(2,ei),_(3,gi),_(4,xi)],w9);var uR;let fVe=(uR=class extends w9{constructor(e,t,i,n){super(QCe.PREFIX,e,t,i,n)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(Zh.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},QCe=uR,uR.PREFIX="edt active ",uR);fVe=QCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],fVe);var gR;let pVe=(gR=class extends w9{constructor(e,t,i,n){super(jCe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(hu.GRID_APPEARANCE))for(const i of t.getEditors(Zh.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},jCe=gR,gR.PREFIX="edt ",gR);pVe=jCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],pVe);var fR;let mVe=(fR=class extends w9{constructor(e,t,i,n){super(YCe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(Zh.MOST_RECENTLY_ACTIVE))e.push(t);return e}},YCe=fR,fR.PREFIX="edt mru ",fR);mVe=YCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],mVe);var h5t=".side-by-side-editor-container{height:100%;width:100%}";ut(h5t,{});var WP,pR;let op=(pR=class extends Ob{get typeId(){return WP.ID}get capabilities(){let e=this.primary.capabilities;return e&=~Ei.CanSplitInGroup,this.secondary.hasCapability(Ei.RequiresTrust)&&(e|=Ei.RequiresTrust),this.secondary.hasCapability(Ei.Singleton)&&(e|=Ei.Singleton),e|=Ei.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,n,o){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=n,this.editorService=o,this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}registerListeners(){this._register(M.once(M.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(6231,"{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 Ob)return new WP(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!E_(e)&&!L5(e)&&!kS(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(wa(i.editor))return{editor:new WP(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:YO(this,e,this.editorService)}};if(Qv(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:YO(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&&!E_(t)&&!E_(i)&&!L5(t)&&!L5(i)&&!kS(t)&&!kS(i)&&!wb(t)&&!wb(i)){const n={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(n.options={viewState:YO(this,e.preserveViewState,this.editorService)}),n}}matches(e){return this===e?!0:sJe(e)||E_(e)?!1:e instanceof WP?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):kS(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},WP=pR,pR.ID="workbench.editorinputs.sidebysideEditorInput",pR);op=WP=D([_(4,ei)],op);const jc=class jc{constructor(e,t){this.storageService=t,this.id=jc.COMMON_PREFIX+e}getMemento(e,t){switch(e){case Ie.WORKSPACE:{let i=jc.workspaceMementos.get(this.id);return i||(i=new pue(this.id,e,t,this.storageService),jc.workspaceMementos.set(this.id,i)),i.getMemento()}case Ie.PROFILE:{let i=jc.profileMementos.get(this.id);return i||(i=new pue(this.id,e,t,this.storageService),jc.profileMementos.set(this.id,i)),i.getMemento()}case Ie.APPLICATION:{let i=jc.applicationMementos.get(this.id);return i||(i=new pue(this.id,e,t,this.storageService),jc.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){jc.workspaceMementos.get(this.id)?.save(),jc.profileMementos.get(this.id)?.save(),jc.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case Ie.APPLICATION:t=jc.applicationMementos.get(this.id);break;case Ie.PROFILE:t=jc.profileMementos.get(this.id);break;case Ie.WORKSPACE:t=jc.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case Ie.WORKSPACE:jc.workspaceMementos.clear();break;case Ie.PROFILE:jc.profileMementos.clear();break;case Ie.APPLICATION:jc.applicationMementos.clear();break}}};jc.applicationMementos=new Map,jc.profileMementos=new Map,jc.workspaceMementos=new Map,jc.COMMON_PREFIX="memento/";let sI=jc;class pue{constructor(e,t,i,n){this.id=e,this.scope=t,this.target=i,this.storageService=n,this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){vt(`[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(){CA(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class Ytt extends jTe{constructor(e,t,i){super(t),this.id=e,this.memento=new sI(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 u5t extends Ytt{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=qn(this.getContainer()),t=this._register(Ac(e)),i=this._onDidFocus=this._register(new I);this._register(t.onDidFocus(()=>{this._hasFocus=!0,i.fire()}));const n=this._onDidBlur=this._register(new I);return this._register(t.onDidBlur(()=>{this._hasFocus=!1,n.fire()})),{onDidFocus:i,onDidBlur:n}}constructor(e,t,i,n){super(e,i,n),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 $_)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const rO=class rO extends u5t{get minimumWidth(){return Rx.width}get maximumWidth(){return BJ.width}get minimumHeight(){return Rx.height}get maximumHeight(){return BJ.height}get input(){return this._input}get options(){return this._options}get window(){return Hj(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,n,o){super(e,i,n,o),this.group=t,this.onDidChangeSizeConstraints=M.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,n){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,n=10){const o=`${this.getId()}${i}`;let r=rO.EDITOR_MEMENTOS.get(o);return r||(r=this._register(new JCe(this.getId(),i,this.getMemento(Ie.WORKSPACE,an.MACHINE),n,e,t)),rO.EDITOR_MEMENTOS.set(o,r)),r}getViewState(){}saveState(){for(const[,e]of rO.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};rO.EDITOR_MEMENTOS=new Map;let IZ=rO;const aO=class aO extends V{constructor(e,t,i,n,o,r){super(),this.id=e,this.key=t,this.memento=i,this.limit=n,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 n=this.doGetResource(t);if(!n||!e)return;const o=this.doLoad();let r=o.get(n.toString());r||(r=Object.create(null),o.set(n.toString(),r)),r[e.id]=i,this.shareEditorState&&(r[aO.SHARED_EDITOR_STATE]=i),wa(t)&&this.clearEditorStateOnDispose(n,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[aO.SHARED_EDITOR_STATE]}}clearEditorState(e,t){wa(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const n=this.doLoad();if(t){const o=n.get(i.toString());o&&(delete o[t.id],CA(o)&&n.delete(i.toString()))}else n.delete(i.toString())}}clearEditorStateOnDispose(e,t){this.editorDisposables||(this.editorDisposables=new Map),this.editorDisposables.has(t)||this.editorDisposables.set(t,M.once(t.onWillDispose)(()=>{this.clearEditorState(e),this.editorDisposables?.delete(t)}))}moveEditorState(e,t,i){const n=this.doLoad(),o=[...n.keys()];for(const r of o){const a=N.parse(r);if(!i.isEqualOrParent(a,e))continue;let c;if(ji(e,a))c=t;else{const d=SGe(a.path,e.path);c=Pt(t,a.path.substr(d+e.path.length+1))}const l=n.get(r,Gl.None);l&&(n.delete(r),n.set(c.toString(),l))}}doGetResource(e){return wa(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new um(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,n]of t)for(const o of Object.keys(n)){const r=Number(o);r===aO.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(r)||(delete n[r],CA(n)&&e.delete(i))}}};aO.SHARED_EDITOR_STATE=-1;let JCe=aO,TZ=class extends IZ{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,n,c,r),this.instantiationService=o,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new wn),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,M.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(Na.getOriginalUri(e,{supportSideBySide:Hs.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}};TZ=D([_(3,Yi),_(4,we),_(5,$i),_(6,Ec),_(7,pn),_(8,ei),_(9,Po)],TZ);var y0;function g5t(s){const e=s;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var KS;let XCe=(KS=class extends TZ{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,n,o,r,a,c,l){super(y0.ID,e,y0.VIEW_STATE_PREFERENCE_KEY,t,i,o,a,n,c,l),this.configurationService=r,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new Xge),this.onDidChangeSizeConstraints=M.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(y0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?fi.VERTICAL:fi.HORIZONTAL,this.dimension=new bn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(y0.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(y0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?fi.VERTICAL:fi.HORIZONTAL,this.splitview&&this.recreateSplitview())}recreateSplitview(){const e=qn(this.getContainer()),t=this.getSplitViewRatio();this.splitview&&(this.splitview.el.remove(),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 n=this.splitview.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height;e=t/n}}return e}createEditor(e){e.classList.add("side-by-side-editor"),this.secondaryEditorContainer=fe(".side-by-side-editor-container.editor-instance"),this.primaryEditorContainer=fe(".side-by-side-editor-container.editor-instance"),this.createSplitView(e)}createSplitView(e,t){this.splitview=this.splitviewDisposables.add(new C3(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===fi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=Kk.Distribute,n=Kk.Distribute;if(t){const a=this.splitview.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),n=a-i,this.splitview.layout(this.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height)}const o=qn(this.secondaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===fi.HORIZONTAL?Rx.width:Rx.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},i);const r=qn(this.primaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===fi.HORIZONTAL?Rx.width:Rx.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},n),this.updateStyles()}getTitle(){return this.input?this.input.getName():g(8675,"Side by Side Editor")}async setInput(e,t,i,n){const o=this.input;await super.setInput(e,t,i,n),(!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===fi.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,n),this.primaryEditorPane?.setInput(e.primary,r,i,n)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const n=g5t(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let o=Object.create(null),r;return t?.target===Hs.SECONDARY?r={...t}:o={...t},o.viewState=n?.primary,n?.secondary&&(r?r.viewState=n?.secondary:r={viewState:n.secondary}),{primary:o,secondary:r,viewState:n}}createEditors(e){this.secondaryEditorPane=this.doCreateEditor(e.secondary,qn(this.secondaryEditorContainer)),this.primaryEditorPane=this.doCreateEditor(e.primary,qn(this.primaryEditorContainer)),this.layout(this.dimension),this._onDidChangeSizeConstraints.input=M.any(M.map(this.secondaryEditorPane.onDidChangeSizeConstraints,()=>{}),M.map(this.primaryEditorPane.onDidChangeSizeConstraints,()=>{})),this.onDidCreateEditors.fire(void 0),this.editorDisposables.add(this.primaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Hs.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Hs.SECONDARY)))}doCreateEditor(e,t){const i=Qe.as(tC.EditorPane).getEditorPane(e);if(!i)throw new Error("No editor pane descriptor for editor found");const n=i.instantiate(this.instantiationService,this.group);return n.create(t),n.setVisible(this.isVisible()),VWe(n)&&this.editorDisposables.add(n.onDidChangeSelection(o=>this._onDidChangeSelection.fire(o))),this.editorDisposables.add(n),n}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(VWe(e)){const t=e.getSelection();if(t)return new ENe(t,e===this.primaryEditorPane?Hs.PRIMARY:Hs.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===Hs.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,qn(this.splitview).layout(this.orientation===fi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===fi.HORIZONTAL?new bn(t,this.dimension.height):new bn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof op}computeEditorViewState(e){if(!this.input||!ji(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 op&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return N.from({scheme:"sideBySide",path:`${T8(i.toString())}${T8(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===fi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(lTt)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(cTt)??"",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&&Ms(this.secondaryEditorContainer),this.primaryEditorContainer&&Ms(this.primaryEditorContainer)}},y0=KS,KS.ID=V0t,KS.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",KS.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",KS);XCe=y0=D([_(1,Yi),_(2,we),_(3,pn),_(4,$i),_(5,Te),_(6,Ec),_(7,ei),_(8,Po)],XCe);class ENe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof ENe)||this.side!==e.side?Lx.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const xw=class xw{static didInstantiateEditorPane(e){return xw.instantiatedEditorPanes.has(e)}static create(e,t,i){return new xw(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){xw._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return xw.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};xw.instantiatedEditorPanes=new Set,xw._onWillInstantiateEditorPane=new I,xw.onWillInstantiateEditorPane=xw._onWillInstantiateEditorPane.event;let _Ve=xw;class f5t{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 n of this.mapEditorPanesToEditors.keys()){const o=this.mapEditorPanesToEditors.get(n)||[];for(const r of o){const a=r.ctor;if(!t&&e.constructor===a){i.push(n);break}else if(t&&e instanceof a){i.push(n);break}}}return!t&&i.length===0?this.findEditorPaneDescriptors(e,!0):i}getEditorPaneByType(e){return hi.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(n=>n.ctor))}return e}}Qe.add(tC.EditorPane,new f5t);function p5t(s,e){const t=s.get(ei),i=s.get(ks),n=s.get(Rm);return new Promise(o=>{let r=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===cA.MOVE)return;let l=Na.getOriginalUri(c.editor,{supportSideBySide:Hs.PRIMARY}),d=Na.getOriginalUri(c.editor,{supportSideBySide:Hs.SECONDARY});if(c.context===cA.REPLACE){const h=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY}),u=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.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!==cA.REPLACE&&(l?.scheme===pe.untitled&&i.extUri.isEqual(h,l.with({scheme:h.scheme}))||d?.scheme===pe.untitled&&i.extUri.isEqual(h,d.with({scheme:h.scheme}))))),r.length===0){const h=e.filter(u=>n.isDirty(u));return h.length>0&&await Zs.settled(h.map(async u=>await new Promise(f=>{if(!n.isDirty(u))return f();const p=n.onDidChangeDirty(m=>{if(!m.isDirty()&&i.extUri.isEqual(u,m.resource))return p.dispose(),f()})}))),a.dispose(),o()}})})}function m5t(s,e,t,i){let n=s.getAriaLabel();return t&&!t.isPinned(s)&&(n=g(4580,"{0}, preview",n)),t?.isSticky(s)&&(n=g(4581,"{0}, pinned",n)),t&&typeof i=="number"&&i>1&&(n=`${n}, ${t.ariaLabel}`),n}var ZCe,mR;let eSe=(mR=class extends TZ{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,ZCe.VIEW_STATE_PREFERENCE_KEY,i,n,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 wn),this._register(this.textResourceConfigurationService.onDidChangeConfiguration(h=>this.handleConfigurationChangeEvent(h))),this._register(M.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=kn(e.editor)?xs(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?m5t(this.input,void 0,this.group,this.editorGroupService.count):g(11473,"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:Y0.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case Db.PROGRAMMATIC:return Y0.PROGRAMMATIC;case Db.NAVIGATION:return Y0.NAVIGATION;case Db.JUMP:return Y0.JUMP;default:return Y0.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new tSe(t)}}async setInput(e,t,i,n){await super.setInput(e,t,i,n),this.inputListener.value=e.onDidChangeCapabilities(()=>this.onDidChangeInputCapabilities(e)),this.updateEditorConfiguration(),qn(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 n=i;this.lastAppliedEditorOptions&&(n=o8(this.lastAppliedEditorOptions,n)),Object.keys(n).length>0&&(this.lastAppliedEditorOptions=i,this.updateEditorControlOptions(n))}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()}},ZCe=mR,mR.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",mR);eSe=ZCe=D([_(2,Yi),_(3,we),_(4,$i),_(5,Ec),_(6,pn),_(7,ei),_(8,Po),_(9,Jt)],eSe);const Yz=class Yz{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof Yz))return Lx.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?Lx.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!==vVe&&(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()??Ca))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,vVe);const i=this.languageService.getLanguageName(e);this.accessibilityService.alert(g(9795,"Language {0} was automatically detected and set as the language mode.",i??e))}}createTextEditorModel(e,t,i){const n=this.getFirstLineText(e),o=this.getOrCreateLanguage(t,this.languageService,i,n);return this.doCreateTextEditorModel(e,o,t)}doCreateTextEditorModel(e,t,i){let n=i&&this.modelService.getModel(i);return n?this.updateTextEditorModel(e,t.languageId):(n=this.modelService.createModel(e,t,i),this.createdEditorModel=!0,this.registerModelDisposeListener(n)),this.textEditorModelHandle=n.uri,n}getFirstLineText(e){const t=e;return typeof t.getFirstLineText=="function"?t.getFirstLineText(Yj.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,Yj.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,n){return!i||i===Ca?t.createByFilepathOrFirstLine(e??null,n):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Ca&&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()}},iSe=_R,_R.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,_R);oI=iSe=D([_(0,gi),_(1,xi),_(2,O6),_(3,mr)],oI);class Jtt extends RI{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 Xtt extends Jtt{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 NQ,vR;let qg=(vR=class extends op{get typeId(){return NQ.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|=Ei.ForceDescription),e}constructor(e,t,i,n,o,r){super(e,t,i,n,r),this.original=i,this.modified=n,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(8674,"{0} ↔ {1}",d,h),t=d===h}let i,n,o;if(this.preferredDescription)i=this.preferredDescription,n=this.preferredDescription,o=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Ls.SHORT),this.modified.getDescription(Ls.SHORT)),o=this.computeLabel(this.original.getDescription(Ls.LONG),this.modified.getDescription(Ls.LONG));const d=this.original.getDescription(Ls.MEDIUM),h=this.modified.getDescription(Ls.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=NMt([d,h]);n=this.computeLabel(u,f)}}let r=this.computeLabel(this.original.getTitle(Ls.SHORT)??this.original.getName(),this.modified.getTitle(Ls.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Ls.MEDIUM)??this.original.getName(),this.modified.getTitle(Ls.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Ls.LONG)??this.original.getName(),this.modified.getTitle(Ls.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(r=`${l} (${r})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:n,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=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.labels.shortDescription;case Ls.LONG:return this.labels.longDescription;case Ls.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Ls.SHORT:return this.labels.shortTitle;case Ls.LONG:return this.labels.longTitle;default:case Ls.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===z0t):e.find(t=>t.typeId===iJe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof oI&&e instanceof oI?new Xtt(e,t):new Jtt(Q2e(e)?e:void 0,Q2e(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 NQ?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:E_(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},NQ=vR,vR.ID="workbench.editors.diffEditorInput",vR);qg=NQ=D([_(5,ei)],qg);var nSe,bR;let bVe=(bR=class extends eSe{get scopedContextKeyService(){if(!this.diffEditorControl)return;const e=this.diffEditorControl.getOriginalEditor(),t=this.diffEditorControl.getModifiedEditor();return(e.hasTextFocus()?e:t).invokeWithinContext(i=>i.get(Le))}constructor(e,t,i,n,o,r,a,c,l,d){super(nSe.ID,e,t,i,n,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(9537,"Text Diff Editor")}createEditorControl(e,t){this.diffEditorControl=this._register(this.instantiationService.createInstance(vp,e,t,{}))}updateEditorControlOptions(e){this.diffEditorControl?.updateOptions(e)}getMainControl(){return this.diffEditorControl?.getModifiedEditor()}async setInput(e,t,i,n){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),this.inputLifecycleStopWatch=void 0,await super.setInput(e,t,i,n);try{const o=await e.resolve();if(n.isCancellationRequested)return;if(!(o instanceof Xtt)){this.openAsBinary(e,t);return}const r=qn(this.diffEditorControl),a=o,c=a.textDiffEditorModel?r.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),r.setModel(c);let l=!1;ORe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,r));let d=!1;t&&(d=LZ(t,r,mt.Immediate)),!d&&!l&&r.revealFirstDiff(),r.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),r.handleInitialized(),this.inputLifecycleStopWatch=new js(!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===Qi.FILE_TOO_LARGE){let n;throw e instanceof Pq?n=g(9538,"At least one file is not displayed in the text compare editor because it is very large ({0}).",Nc.formatSize(e.size)):n=g(9539,"At least one file is not displayed in the text compare editor because it is very large."),Q0t(this.group,t,i,n,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,n){const o=this.loadEditorViewState(e,i);return o?(t?.selection&&o.modified&&(o.modified.cursorState=[]),n.restoreViewState(o),t?.revealIfVisible&&n.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,n=e.modified,o=this.instantiationService.createInstance(qg,e.getName(),e.getDescription(),i,n,!0),r=Qe.as(tC.EditorFactory).getFileEditorFactory();r.isFileEditor(i)&&i.setForceOpenAsBinary(),r.isFileEditor(n)&&n.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:o,options:{...t,activation:Gk.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&LZ(e,qn(this.diffEditorControl),mt.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(kn(e.diffEditor)){const n=xs(e.diffEditor);n.diffCodeLens=n.codeLens,delete n.codeLens,n.diffWordWrap=n.wordWrap,delete n.wordWrap,Object.assign(t,n)}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 qg&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof qg?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===EW.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 vp&&(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 qg}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&&ji(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof qg?(t=e.original.resource,i=e.modified.resource):wa(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return N.from({scheme:"diff",path:`${T8(t.toString())}${T8(i.toString())}`})}},nSe=bR,bR.ID=iJe,bR);bVe=nSe=D([_(1,Yi),_(2,we),_(3,$i),_(4,Ec),_(5,ei),_(6,pn),_(7,Po),_(8,Jt),_(9,B6)],bVe);function RZ(s,e,t=hA){if(t===hA||t===ev)return t;let i=s.getGroups(hu.GRID_APPEARANCE)[t];if(!i&&t<9){for(let n=0;n<=t;n++){const o=s.getGroups(hu.GRID_APPEARANCE);o[n]||s.addGroup(o[n-1],UW(e))}i=s.getGroups(hu.GRID_APPEARANCE)[t]}return i?.id??ev}function rI(s,e){const t=typeof e=="number"?s.getGroup(e):e;return s.getGroups(hu.GRID_APPEARANCE).indexOf(t??s.activeGroup)}function v5t(s,e,t,i){const n=b5t(s,e,t,i),o=n.length&&n[0].preserveFocus||!1,r={groupedEditors:[],preserveFocus:o};for(const a of n){const c=C5t(a,t);if(!c)continue;const{group:l,editor:d}=c;let h;for(const u of r.groupedEditors)if(u.group.id===l.id){h=u;break}h||(h={group:l,editors:[]},r.groupedEditors.push(h)),d&&h.editors.push(d)}return r}function b5t(s,e,t,i){const n=i.lastFocusedList;let o=n instanceof Xa&&n.getHTMLElement()===Bc(),r=y5t(s,o,e,t,i);if(!r){const c=t.activeGroup,l=c.activeEditor;r={groupId:c.id,editorIndex:l?c.getIndexOfEditor(l):void 0},o=!1}const a=Ztt(r,o,e,t,i);return w5t(r,a)}function w5t(s,e){if(e.length<=1)return e;const t=e.findIndex(i=>i.groupId===s.groupId&&i.editorIndex===s.editorIndex);if(t!==-1)e.splice(t,1),e.unshift(s);else if(s.editorIndex===void 0)e.unshift(s);else throw new Error("Editor context not found in multi editor context");return e}function y5t(s,e,t,i,n){const o=s.filter(r=>zWe(r)||N.isUri(r));for(const r of o)if(zWe(r))return r;for(const r of o){const a=t.findEditors(r);if(a.length){const c=a[0],l=i.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?.getIndexOfEditor(c.editor)}}}if(e){const r=n.lastFocusedList;for(const a of r.getFocusedElements())if(eit(a))return sSe(a,void 0,i)}}function Ztt(s,e,t,i,n){if(e){const r=n.lastFocusedList.getSelectedElements().filter(eit);if(r.length>1)return r.map(a=>sSe(a,s.preserveFocus,i));if(r.length===0)return Ztt(s,!1,t,i,n)}else{const o=i.getGroup(s.groupId),r=s.editorIndex!==void 0?o?.getEditorByIndex(s.editorIndex):o?.activeEditor;if(o&&r&&o.isSelected(r))return o.selectedEditors.map(a=>sSe({editor:a,groupId:o.id},s.preserveFocus,i))}return[s]}function sSe(s,e,t){if(bNe(s))return{groupId:s.id,editorIndex:void 0,preserveFocus:e};const i=t.getGroup(s.groupId);return{groupId:s.groupId,editorIndex:i?i.getIndexOfEditor(s.editor):-1,preserveFocus:e}}function eit(s){return bNe(s)||xve(s)}function C5t(s,e){const t=e.getGroup(s.groupId);if(!t)return;if(s.editorIndex===void 0)return{group:t,editor:void 0};const i=t.getEditorByIndex(s.editorIndex);return{group:t,editor:i}}const S5t="workbench.action.closeEditorsAndGroup";class A5t{constructor(e){this.root=new MZ;for(const[t,i]of e)for(const n of i)this.root.add(t,n)}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 MZ;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 n=(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=>n(d,a))},o=new Map;for(const r of e){let a=n(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 MZ{constructor(){this.value=new xNe,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],n=e.slice(1);let o=this.map.get(i);o||this.map.set(i,o=new MZ),o.add(n,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const n=e[0],o=e.slice(1),r=this.map.get(n);return r&&i.push(...r.get(o,t)),i}toString(e=""){const t=[];return this.value.hasItems&&t.push(`* => +`);this.editorService.openEditor({resource:void 0,contents:c,languageId:"markdown"}),this.telemetryService.publicLog2("openedChatCodeCitations")})),this.domNode=r.root}hasSameContent(e,t,i){return e.kind==="codeCitations"}};LCe=D([_(2,ei),_(3,Yi)],LCe);const EVt=fe;let RCe=class extends V{constructor(e,t,i){super(),this.commandService=i,this.domNode=EVt(".chat-command-button");const n=!vs(t.element)||!t.element.isStale,o=n?e.command.tooltip:g(10565,"Button not available in restored chat"),r=this._register(new jd(this.domNode,{..._6,supportIcons:!0,title:o}));r.label=e.command.title,r.enabled=n,this._register(r.onDidClick(()=>this.commandService.executeCommand(e.command.id,...e.command.arguments??[])))}hasSameContent(e){return e.kind==="command"}};RCe=D([_(2,vi)],RCe);var xVt=".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}";ut(xVt,{});let MCe=class extends V{get onDidClick(){return this._onDidClick.event}get domNode(){return this._domNode}setShowButtons(e){this.domNode.classList.toggle("hideButtons",!e)}constructor(e,t,i,n){super(),this.instantiationService=n,this._onDidClick=this._register(new I);const o=Bt(".chat-confirmation-widget@root",[Bt(".chat-confirmation-widget-title@title"),Bt(".chat-confirmation-widget-message@message"),Bt(".chat-confirmation-buttons-container@buttonsContainer")]);this._domNode=o.root;const r=this._register(this.instantiationService.createInstance(q_,{})),a=this._register(r.render(new Mt(e)));o.title.appendChild(a.element);const c=this._register(r.render(new Mt(t)));o.message.appendChild(c.element),i.forEach(l=>{const d=new jd(o.buttonsContainer,{..._6,secondary:l.isSecondary});d.label=l.label,this._register(d.onDidClick(()=>this._onDidClick.fire(l)))})}};MCe=D([_(3,we)],MCe);let NCe=class extends V{constructor(e,t,i,n){super(),this.instantiationService=i,this.chatService=n,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const o=t.element,r=e.buttons?e.buttons.map(c=>({label:c,data:e.data})):[{label:g(10567,"Accept"),data:e.data},{label:g(10568,"Dismiss"),data:e.data,isSecondary:!0}],a=this._register(this.instantiationService.createInstance(MCe,e.title,e.message,r));a.setShowButtons(!e.isUsed),this._register(a.onDidClick(async c=>{if(vs(o)){const l=`${c.label}: "${e.title}"`,d=c.isSecondary?{rejectedConfirmationData:[c.data]}:{acceptedConfirmationData:[c.data]};d.agentId=o.agent?.id,d.slashCommand=o.slashCommand?.name,await this.chatService.sendRequest(o.sessionId,l,d)&&(e.isUsed=!0,a.setShowButtons(!1),this._onDidChangeHeight.fire())}})),this.domNode=a.domNode}hasSameContent(e){return e.kind==="confirmation"}addDisposable(e){this._register(e)}};NCe=D([_(2,we),_(3,Em)],NCe);class Cce extends V{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)}}W("chat.requestBorder",{dark:new me(new dn(255,255,255,.1)),light:new me(new dn(0,0,0,.1)),hcDark:wt,hcLight:wt},g(7156,"The border color of a chat request."));const DVt=W("chat.requestBackground",{dark:st(Hc,.62),light:st(Hc,.62),hcDark:Ah,hcLight:null},g(7157,"The background color of a chat request.")),V4e=W("chat.slashCommandBackground",{dark:"#34414b8f",light:"#d2ecff99",hcDark:me.white,hcLight:_T},g(7158,"The background color of a chat slash command.")),z4e=W("chat.slashCommandForeground",{dark:"#40A6FF",light:"#306CA2",hcDark:me.black,hcLight:Hre},g(7159,"The foreground color of a chat slash command."));W("chat.avatarBackground",{dark:"#1f1f1f",light:"#f2f2f2",hcDark:me.black,hcLight:me.white},g(7160,"The background color of a chat avatar."));W("chat.avatarForeground",zi,g(7161,"The foreground color of a chat avatar."));const rue="http://_vscodedecoration_",TQ="http://_chatagent_",kVt="http://_chatslash_";function IVt(s,e,t){const i=t.get(Wae),n=t.get(ff),o=i.getAgentNameRestriction(s);let r=`${o?s.name:wce(s)}`;o&&n.agentHasDupeName(s.id)&&(r+=` (${s.publisherDisplayName})`);const c={agentId:s.id,name:r,isClickable:e};return`[${s.name}](${TQ}?${encodeURIComponent(JSON.stringify(c))})`}let CZ=class{constructor(e,t,i,n,o,r,a,c,l){this.keybindingService=e,this.labelService=t,this.logService=i,this.chatAgentService=n,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 ob)t+=i.text;else if(i instanceof Ug)t+=this.instantiationService.invokeFunction(n=>IVt(i.agent,!1,n));else{const n=i instanceof MW&&i.data instanceof N?i.data:void 0,o=n?encodeURIComponent(this.labelService.getUriLabel(n,{relative:!0})):i instanceof Ug?i.agent.id:"",r=i.text;t+=`[${r}](${rue}?${o})`}return t}walkTreeAndAnnotateReferenceLinks(e){const t=new Z;return e.querySelectorAll("a").forEach(i=>{const n=i.getAttribute("data-href");if(n)if(n.startsWith(TQ)){let o;try{o=JSON.parse(decodeURIComponent(n.slice(TQ.length+1)))}catch(r){this.logService.error("Invalid chat widget render data JSON",Nr(r))}o&&i.parentElement.replaceChild(this.renderAgentWidget(o,t),i)}else if(n.startsWith(kVt)){let o;try{o=JSON.parse(decodeURIComponent(n.slice(TQ.length+1)))}catch(r){this.logService.error("Invalid chat slash command render data JSON",Nr(r))}o&&i.parentElement.replaceChild(this.renderSlashCommandWidget(i.textContent,o,t),i)}else if(n.startsWith(rue)){const o=decodeURIComponent(n.slice(rue.length+1));i.parentElement.replaceChild(this.renderResourceWidget(i.textContent,o),i)}else n.startsWith(btt)?this.renderFileWidget(n,i):n.startsWith("command:")&&this.injectKeybindingHint(i,n,this.keybindingService)}),t}renderAgentWidget(e,t){const i=`${zU}${e.name}`;let n;if(e.isClickable){n=fe("span.chat-agent-widget");const a=t.add(new jd(n,{buttonBackground:ze(V4e),buttonForeground:ze(z4e),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 n=this.renderResourceWidget(i,void 0);const o=this.chatAgentService.getAgent(e.agentId),r=new ya(()=>t.add(this.instantiationService.createInstance(yZ)));return t.add(this.hoverService.setupManagedHover(Pr("element"),n,()=>(r.value.setAgent(e.agentId),r.value.domNode),o&&Itt(()=>o,this.commandService))),n}renderSlashCommandWidget(e,t,i){const n=fe("span.chat-agent-widget.chat-command-widget"),o=this.chatAgentService.getAgent(t.agentId),r=i.add(new jd(n,{buttonBackground:ze(V4e),buttonForeground:ze(z4e),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})})),n}renderFileWidget(e,t){const i=N.parse(e);let n;try{n=Mo(JSON.parse(i.fragment))}catch(a){this.logService.error("Invalid chat widget render data JSON",Nr(a));return}if(!n.uri||!N.isUri(n.uri)){this.logService.error(`Invalid chat widget render data: ${i.fragment}`);return}const o=n.range?`${n.range.startLineNumber}-${n.range.endLineNumber}`:"";t.setAttribute("data-href",n.uri.with({fragment:o}).toString());const r=this.labelService.getUriLabel(n.uri,{relative:!0});t.title=n.range?`${r}#${n.range.startLineNumber}-${n.range.endLineNumber}`:r}renderResourceWidget(e,t){const i=fe("span.chat-resource-widget"),n=fe("span",void 0,e);return t&&(n.title=t),i.appendChild(n),i}injectKeybindingHint(e,t,i){const n=t.match(/command:([^\)]+)/)?.[1];if(n){const o=i.lookupKeybinding(n);if(o){const r=o.getLabel();r&&(e.textContent=`${e.textContent} (${r})`)}}}};CZ=D([_(0,Ut),_(1,Fs),_(2,Ge),_(3,ff),_(4,we),_(5,ec),_(6,Em),_(7,ON),_(8,vi)],CZ);const $4e=fe;let SZ=class extends V{constructor(e,t,i,n=!1,o=0,r,a,c,l,d,h,u){super(),this.markdown=e,this.editorPool=i,this.codeBlockModelCollection=c,this.textModelService=h,this.allRefs=[],this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event,this.codeblocks=[];const f=t.element,p=u.createInstance(CZ),m=[];let v=o;const b=this._register(r.render(e,{fillInIncompleteTokens:n,codeBlockRendererSync:(w,y)=>{const C=v++;let A,L,k;if(ua(w,dVt))try{const G=hVt(y);L=G.range&&F.lift(G.range),A=this.textModelService.createModelReference(G.uri).then(j=>j.object)}catch{return $4e("div")}else{if(!Wu(f)&&!vs(f))return console.error("Trying to render code block in welcome",f.id,C),$4e("div");const G=vs(f)||Wu(f)?f.sessionId:"",j=this.codeBlockModelCollection.getOrCreate(G,f,C);k=j.vulns,A=j.model}const P=vs(f)&&f.errorDetails?.responseIsFiltered,R=this.renderCodeBlock({languageId:w,textModel:A,codeBlockIndex:C,element:f,range:L,hideToolbar:P,parentContextKeyService:d,vulns:k},y,a,l.editableCodeBlock);this.allRefs.push(R),this._register(R.object.onDidChangeContentHeight(()=>this._onDidChangeHeight.fire()));const z={codeBlockIndex:C,element:f,focus(){R.object.focus()},uri:R.object.uri};return this.codeblocks.push(z),m.push(R),R.object.element},asyncRenderCallback:()=>this._onDidChangeHeight.fire()}));this._register(p.walkTreeAndAnnotateReferenceLinks(b.element)),m.reverse().forEach(w=>this._register(w)),this.domNode=b.element}renderCodeBlock(e,t,i,n){const o=this.editorPool.get(),r=o.object;return vs(e.element)&&this.codeBlockModelCollection.update(e.element.sessionId,e.element,e.codeBlockIndex,{text:t,languageId:e.languageId}),r.render(e,i,n),o}hasSameContent(e){return e.kind==="markdownContent"&&e.content.value===this.markdown.value}layout(e){this.allRefs.forEach(t=>t.object.layout(e))}addDisposable(e){this._register(e)}};SZ=D([_(9,Le),_(10,fn),_(11,we)],SZ);let PCe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new Cce(()=>n.createInstance(nCe,e,_e.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)}}}};PCe=D([_(3,we)],PCe);class Ttt extends V{constructor(e,t,i,n,o){super();const r=i.content.slice(i.index+1);if(this.showSpinner=n??G4e(r,i.element),o!==!0&&r.some(h=>h.kind!=="progressMessage")){this.domNode=fe("");return}this.showSpinner&&Mr(e.content.value);const c=this.showSpinner?We.modify(ve.loading,"spin").id:ve.check.id,l=new Mt(`$(${c}) ${e.content.value}`,{supportThemeIcons:!0}),d=this._register(t.render(l));d.element.classList.add("progress-step"),this.domNode=d.element}hasSameContent(e,t,i){const n=G4e(t,i);return e.kind==="progressMessage"&&this.showSpinner===n}}function G4e(s,e){return vs(e)&&!e.isComplete&&s.length===0}var FCe;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_LIGHT="hcLight",s.HIGH_CONTRAST_DARK="hcDark"})(FCe||(FCe={}));var AV;const TVt="workbench.view.explorer",Pb="workbench.explorer.fileView";new Y("explorerViewletVisible",!0,{type:"boolean",description:g(5364,"True when the EXPLORER viewlet is visible.")});const uNe=new Y("foldersViewVisible",!0,{type:"boolean",description:g(5365,"True when the FOLDERS view (the file tree within the explorer view container) is visible.")}),LVt=new Y("explorerResourceIsFolder",!1,{type:"boolean",description:g(5366,"True when the focused item in the EXPLORER is a folder.")}),Ltt=new Y("explorerResourceReadonly",!1,{type:"boolean",description:g(5367,"True when the focused item in the EXPLORER is read-only.")}),Rtt=Ltt.toNegated(),RVt=new Y("explorerResourceAvailableEditorIds",""),MVt=new Y("explorerResourceIsRoot",!1,{type:"boolean",description:g(5368,"True when the focused item in the EXPLORER is a root folder.")}),NVt=new Y("explorerResourceCut",!1,{type:"boolean",description:g(5369,"True when an item in the EXPLORER has been cut for cut and paste.")}),PVt=new Y("explorerResourceMoveableToTrash",!1,{type:"boolean",description:g(5370,"True when the focused item in the EXPLORER can be moved to trash.")}),Mtt=new Y("filesExplorerFocus",!0,{type:"boolean",description:g(5371,"True when the focus is inside the EXPLORER view.")});new Y("openEditorsFocus",!0,{type:"boolean",description:g(5372,"True when the focus is inside the OPEN EDITORS view.")});const Ntt=new Y("explorerViewletFocus",!0,{type:"boolean",description:g(5373,"True when the focus is inside the EXPLORER viewlet.")}),FVt=new Y("explorerViewletCompressedFocus",!0,{type:"boolean",description:g(5374,"True when the focused item in the EXPLORER view is a compact item.")}),OVt=new Y("explorerViewletCompressedFirstFocus",!0,{type:"boolean",description:g(5375,"True when the focus is inside a compact item's first part in the EXPLORER view.")}),BVt=new Y("explorerViewletCompressedLastFocus",!0,{type:"boolean",description:g(5376,"True when the focus is inside a compact item's last part in the EXPLORER view.")}),WVt=new Y("viewHasSomeCollapsibleItem",!1,{type:"boolean",description:g(5377,"True when a workspace in the EXPLORER view has some collapsible root child.")});he.and(uNe,Mtt,he.not(_ae));he.and(uNe,Ntt,he.not(_ae));const Ptt="workbench.editors.files.textFileEditor",Ftt="workbench.editors.files.fileEditorInput",HVt="workbench.editors.files.binaryFileEditor";var OCe;(function(s){s.Default="default",s.Mixed="mixed",s.FilesFirst="filesFirst",s.Type="type",s.Modified="modified",s.FoldersNestsFiles="foldersNestsFiles"})(OCe||(OCe={}));var kT;(function(s){s.Verbose="verbose",s.Default="default",s.Light="light"})(kT||(kT={}));var K4e;(function(s){s.Default="default",s.Upper="upper",s.Lower="lower",s.Unicode="unicode"})(K4e||(K4e={}));let q4e=AV=class extends V{constructor(e,t,i,n){super(),this.textFileService=e,this.fileService=t,this.languageService=i,this.modelService=n,this.fileWatcherDisposable=this._register(new wn)}static async open(e,t,i,n,o){await n.openEditor({original:{resource:AV.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=AV.textFileToResource(e),i=await this.resolveEditorModel(e);if(!this.fileWatcherDisposable.value){const n=new Z;this.fileWatcherDisposable.value=n,n.add(this.fileService.onDidFilesChange(o=>{o.contains(t,To.UPDATED)&&this.resolveEditorModel(e,!1)})),i&&n.add(M.once(i.onWillDispose)(()=>this.fileWatcherDisposable.clear()))}return i}async resolveEditorModel(e,t=!0){const i=AV.textFileToResource(e),n=await this.textFileService.readStream(i);let o=this.modelService.getModel(e);if(o)this.modelService.updateModel(o,n.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(n.value,a,e)}return o}};q4e=AV=D([_(0,Fo),_(1,Jt),_(2,xi),_(3,gi)],q4e);const Aoe=class Aoe{constructor(e,t){this._editor=e,this._group=t,this.id=Aoe.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 Na.getOriginalUri(this.editor,{supportSideBySide:Hs.PRIMARY})}};Aoe.COUNTER=0;let AZ=Aoe;var Q4e;(function(s){s[s.Confirmation=1]="Confirmation",s[s.Prompt=2]="Prompt",s[s.Input=3]="Input"})(Q4e||(Q4e={}));var $h;(function(s){s[s.SAVE=0]="SAVE",s[s.DONT_SAVE=1]="DONT_SAVE",s[s.CANCEL=2]="CANCEL"})($h||($h={}));const kK=10;function Ott(s){const e=[];return e.push(...s.slice(0,kK).map(t=>typeof t=="string"?t:_i(t))),s.length>kK&&(s.length-kK===1?e.push(g(5690,"...1 additional file not shown")):e.push(g(5691,"...{0} additional files not shown",s.length-kK))),e.push(""),e.join(` +`)}var UVt=".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)}";ut(UVt,{});const EZ=0,j4e=[EZ,[]];function Y4e(s,e,t,i){if(!s||!e)return j4e;const n=s.length,o=e.length;if(n0,v=s[u],b=e[u];for(let w=0;w0,C=f+w,A=C-1,L=p+w-1,k=y?a[A]:0,P=m&&y?a[L]:0,R=m&&y?c[L]:0;let z;!P&&m?z=0:z=zVt(v,b,i,n,w,R),z&&P+z>=k&&(r||m||n.startsWith(e,w))?(c[C]=R+1,a[C]=P+z):(c[C]=EZ,a[C]=k)}}const l=[];let d=t-1,h=o-1;for(;d>=0&&h>=0;){const u=d*o+h;c[u]===EZ||(l.push(h),d--),h--}return[a[t*o-1],l.reverse()]}function zVt(s,e,t,i,n,o){let r=0;if(!$Vt(e,i[n]))return r;if(r+=1,o>0&&(r+=o*5),s===t[n]&&(r+=1),n===0)r+=8;else{const a=GVt(t.charCodeAt(n-1));a?r+=a:l6(t.charCodeAt(n))&&o===0&&(r+=2)}return r}function $Vt(s,e){return s===e?!0:s==="/"||s==="\\"?e==="/"||e==="\\":!1}function GVt(s){switch(s){case B.Slash:case B.Backslash:return 5;case B.Underline:case B.Dash:case B.Period:case B.Space:case B.SingleQuote:case B.DoubleQuote:case B.Colon:return 4;default:return 0}}const Btt=[void 0,[]];function aue(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?KVt(s,n.values,t,i):Wtt(s,e,t,i)}function KVt(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,c]=Wtt(s,r,t,i);if(typeof a!="number")return Btt;n+=a,o.push(...c)}return[n,UCe(o)]}function Wtt(s,e,t,i){const n=Fk(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],yU(n)]:Btt}const xZ=Object.freeze({score:0}),LQ=1<<18,BCe=1<<17,WCe=65536;function qVt(s,e,t,i){const n=i.values?i.values:[i];return Wc({[i.normalized]:{values:n.map(r=>({value:r.normalized,expectContiguousMatch:r.expectContiguousMatch})),label:s,description:e,allowNonContiguousMatches:t}})}function HCe(s,e,t,i,n){if(!s||!e.normalized)return xZ;const o=i.getItemLabel(s);if(!o)return xZ;const r=i.getItemDescription(s),a=qVt(o,r,t,e),c=n[a];if(c)return c;const l=QVt(o,r,i.getItemPath(s),e);return n[a]=l,l}function QVt(s,e,t,i,n){const o=!t||!i.containsPathSeparator;return t&&(pr?i.pathNormalized===t:ua(i.pathNormalized,t))?{score:LQ,labelMatch:[{start:0,end:s.length}],descriptionMatch:e?[{start:0,end:e.length}]:void 0}:i.values&&i.values.length>1?jVt(s,e,t,i.values,o):Htt(s,e,t,i,o)}function jVt(s,e,t,i,n,o){let r=0;const a=[],c=[];for(const l of i){const{score:d,labelMatch:h,descriptionMatch:u}=Htt(s,e,t,l,n);if(d===EZ)return xZ;r+=d,h&&a.push(...h),u&&c.push(...u)}return{score:r,labelMatch:UCe(a),descriptionMatch:UCe(c)}}function Htt(s,e,t,i,n,o){if(n||!e){const[r,a]=Y4e(s,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(r){const c=vM(i.normalized,s);let l;if(c){l=BCe;const d=Math.round(i.normalized.length/s.length*100);l+=d}else l=WCe;return{score:l+r,labelMatch:c||J4e(a)}}}if(e){let r=e;t&&(r=`${e}${su}`);const a=r.length,c=`${r}${s}`,[l,d]=Y4e(c,i.normalized,i.normalizedLowercase,!i.expectContiguousMatch);if(l){const h=J4e(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 xZ}function J4e(s){const e=[];if(!s)return e;let t;for(const i of s)t&&t.end===i?t.end+=1:(t={start:i,end:i+1},e.push(t));return e}function UCe(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!YVt(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function YVt(s,e){return!(s.endWCe||l>WCe){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=X4e(s,r,n),f=X4e(e,a,n);return u&&f&&u!==f?f>u?-1:1:ZVt(s,e,t,n)}function X4e(s,e,t){let i=-1,n=-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(n=e.labelMatch[e.labelMatch.length-1].end,e.descriptionMatch&&e.descriptionMatch.length){const o=t.getItemDescription(s);o&&(n+=o.length)}}else e.descriptionMatch&&e.descriptionMatch.length&&(n=e.descriptionMatch[e.descriptionMatch.length-1].end);return n-i}function XVt(s,e){if(!s&&!e||(!s||!s.length)&&(!e||!e.length))return 0;if(!e||!e.length)return-1;if(!s||!s.length)return 1;const t=s[0].start,n=s[s.length-1].end-t,o=e[0].start,a=e[e.length-1].end-o;return n===a?0:a=0,r=Z4e(s);let a;const c=s.split(Utt);if(c.length>1)for(const l of c){const d=Z4e(l),{pathNormalized:h,normalized:u,normalizedLowercase:f}=eVe(l);u&&(a||(a=[]),a.push({original:l,originalLowercase:l.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function eVe(s){let e;Qn?e=s.replace(/\//g,su):e=s.replace(/\\/g,su);const t=Zrt(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function tVe(s){return Array.isArray(s)?m9(s.map(e=>e.original).join(Utt)):m9(s.original)}var VCe,zCe,$Ce;let _9=class extends sNe{constructor(e,t,i,n,o){super(e,{canAcceptInBackground:!0,noResultsPick:{label:g(9601,"No matching editors"),groupId:-1}}),this.editorGroupService=t,this.editorService=i,this.modelService=n,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=m9(e),i=this.doGetEditorPickItems().filter(o=>{if(!t.normalized)return!0;const r=HCe(o,t,!0,O2e,this.pickState.scorerCache);return r.score?(o.highlights={label:r.labelMatch,description:r.descriptionMatch},!0):!1});if(t.normalized){const o=this.editorGroupService.getGroups(du.GRID_APPEARANCE).map(r=>r.id);i.sort((r,a)=>r.groupId!==a.groupId?o.indexOf(r.groupId)-o.indexOf(a.groupId):JVt(r,a,t,!0,O2e,this.pickState.scorerCache))}const n=[];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&&n.push({type:"separator",label:a.label}),o=r.groupId}n.push(r)}}else n.push(...i);return n}doGetEditorPickItems(){const e=this.doGetEditors(),t=new Map;for(const{groupId:i}of e)if(!t.has(i)){const n=this.editorGroupService.getGroup(i);n&&t.set(i,n.ariaLabel)}return this.doGetEditors().map(({editor:i,groupId:n})=>{const o=Na.getOriginalUri(i,{supportSideBySide:Hs.PRIMARY}),r=i.isDirty()&&!i.isSaving(),a=i.getDescription(),c=a?`${i.getName()} ${a}`:i.getName();return{groupId:n,resource:o,label:i.getName(),ariaLabel:t.size>1?r?g(9602,"{0}, unsaved changes, {1}",c,t.get(n)):g(9603,"{0}, {1}",c,t.get(n)):r?g(9604,"{0}, unsaved changes",c):c,description:a,iconClasses:Tx(this.modelService,this.languageService,o,void 0,i.getIcon()).concat(i.getLabelExtraClasses()),italic:!this.editorGroupService.getGroup(n)?.isPinned(i),buttons:[{iconClass:r?"dirty-editor "+We.asClassName(ve.closeDirty):We.asClassName(ve.close),tooltip:g(9605,"Close Editor"),alwaysVisible:r}],trigger:async()=>{const l=this.editorGroupService.getGroup(n);return l&&(await l.closeEditor(i,{preserveFocus:!0}),!l.contains(i))?kS.REMOVE_ITEM:kS.NO_ACTION},accept:(l,d)=>this.editorGroupService.getGroup(n)?.openEditor(i,{preserveFocus:d.inBackground})}})}};_9=D([_(1,Po),_(2,ei),_(3,gi),_(4,xi)],_9);var cR;let iVe=(cR=class extends _9{constructor(e,t,i,n){super(VCe.PREFIX,e,t,i,n)}doGetEditors(){const e=this.editorGroupService.activeGroup;return e.getEditors(Xh.MOST_RECENTLY_ACTIVE).map(t=>({editor:t,groupId:e.id}))}},VCe=cR,cR.PREFIX="edt active ",cR);iVe=VCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],iVe);var lR;let nVe=(lR=class extends _9{constructor(e,t,i,n){super(zCe.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorGroupService.getGroups(du.GRID_APPEARANCE))for(const i of t.getEditors(Xh.SEQUENTIAL))e.push({editor:i,groupId:t.id});return e}},zCe=lR,lR.PREFIX="edt ",lR);nVe=zCe=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],nVe);var dR;let sVe=(dR=class extends _9{constructor(e,t,i,n){super($Ce.PREFIX,e,t,i,n)}doGetEditors(){const e=[];for(const t of this.editorService.getEditors(Xh.MOST_RECENTLY_ACTIVE))e.push(t);return e}},$Ce=dR,dR.PREFIX="edt mru ",dR);sVe=$Ce=D([_(0,Po),_(1,ei),_(2,gi),_(3,xi)],sVe);var e5t=".side-by-side-editor-container{height:100%;width:100%}";ut(e5t,{});var FP,hR;let ip=(hR=class extends Nb{get typeId(){return FP.ID}get capabilities(){let e=this.primary.capabilities;return e&=~Ei.CanSplitInGroup,this.secondary.hasCapability(Ei.RequiresTrust)&&(e|=Ei.RequiresTrust),this.secondary.hasCapability(Ei.Singleton)&&(e|=Ei.Singleton),e|=Ei.MultipleEditors,e}get resource(){if(this.hasIdenticalSides)return this.primary.resource}constructor(e,t,i,n,o){super(),this.preferredName=e,this.preferredDescription=t,this.secondary=i,this.primary=n,this.editorService=o,this.hasIdenticalSides=this.primary.matches(this.secondary),this.registerListeners()}registerListeners(){this._register(M.once(M.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(6231,"{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 Nb)return new FP(this.preferredName,this.preferredDescription,e,e,this.editorService);if(!C_(e)&&!k5(e)&&!DS(e)&&!_b(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(wa(i.editor))return{editor:new FP(this.preferredName,this.preferredDescription,i.editor,i.editor,this.editorService),options:{...i.options,viewState:KO(this,e,this.editorService)}};if(Gv(i.editor))return{editor:{label:this.preferredName,description:this.preferredDescription,primary:i.editor,secondary:i.editor,options:{...i.options,viewState:KO(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&&!C_(t)&&!C_(i)&&!k5(t)&&!k5(i)&&!DS(t)&&!DS(i)&&!_b(t)&&!_b(i)){const n={label:this.preferredName,description:this.preferredDescription,primary:t,secondary:i};return typeof e?.preserveViewState=="number"&&(n.options={viewState:KO(this,e.preserveViewState,this.editorService)}),n}}matches(e){return this===e?!0:YYe(e)||C_(e)?!1:e instanceof FP?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):DS(e)?this.primary.matches(e.primary)&&this.secondary.matches(e.secondary):!1}},FP=hR,hR.ID="workbench.editorinputs.sidebysideEditorInput",hR);ip=FP=D([_(4,ei)],ip);const Qc=class Qc{constructor(e,t){this.storageService=t,this.id=Qc.COMMON_PREFIX+e}getMemento(e,t){switch(e){case Ie.WORKSPACE:{let i=Qc.workspaceMementos.get(this.id);return i||(i=new cue(this.id,e,t,this.storageService),Qc.workspaceMementos.set(this.id,i)),i.getMemento()}case Ie.PROFILE:{let i=Qc.profileMementos.get(this.id);return i||(i=new cue(this.id,e,t,this.storageService),Qc.profileMementos.set(this.id,i)),i.getMemento()}case Ie.APPLICATION:{let i=Qc.applicationMementos.get(this.id);return i||(i=new cue(this.id,e,t,this.storageService),Qc.applicationMementos.set(this.id,i)),i.getMemento()}}}onDidChangeValue(e,t){return this.storageService.onDidChangeValue(e,this.id,t)}saveMemento(){Qc.workspaceMementos.get(this.id)?.save(),Qc.profileMementos.get(this.id)?.save(),Qc.applicationMementos.get(this.id)?.save()}reloadMemento(e){let t;switch(e){case Ie.APPLICATION:t=Qc.applicationMementos.get(this.id);break;case Ie.PROFILE:t=Qc.profileMementos.get(this.id);break;case Ie.WORKSPACE:t=Qc.workspaceMementos.get(this.id);break}t?.reload()}static clear(e){switch(e){case Ie.WORKSPACE:Qc.workspaceMementos.clear();break;case Ie.PROFILE:Qc.profileMementos.clear();break;case Ie.APPLICATION:Qc.applicationMementos.clear();break}}};Qc.applicationMementos=new Map,Qc.profileMementos=new Map,Qc.workspaceMementos=new Map,Qc.COMMON_PREFIX="memento/";let Zk=Qc;class cue{constructor(e,t,i,n){this.id=e,this.scope=t,this.target=i,this.storageService=n,this.mementoObj=this.doLoad()}doLoad(){try{return this.storageService.getObject(this.id,this.scope,{})}catch(e){vt(`[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(){wA(this.mementoObj)?this.storageService.remove(this.id,this.scope):this.storageService.store(this.id,this.mementoObj,this.scope,this.target)}}class Vtt extends OTe{constructor(e,t,i){super(t),this.id=e,this.memento=new Zk(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 t5t extends Vtt{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=qn(this.getContainer()),t=this._register(Ac(e)),i=this._onDidFocus=this._register(new I);this._register(t.onDidFocus(()=>{this._hasFocus=!0,i.fire()}));const n=this._onDidBlur=this._register(new I);return this._register(t.onDidBlur(()=>{this._hasFocus=!1,n.fire()})),{onDidFocus:i,onDidBlur:n}}constructor(e,t,i,n){super(e,i,n),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 U_)),this.actionRunner}updateTitleArea(){this._onTitleAreaUpdate.fire()}isVisible(){return this.visible}getControl(){}}const iO=class iO extends t5t{get minimumWidth(){return Ix.width}get maximumWidth(){return FJ.width}get minimumHeight(){return Ix.height}get maximumHeight(){return FJ.height}get input(){return this._input}get options(){return this._options}get window(){return Bj(this.group.windowId,!0).window}get scopedContextKeyService(){}constructor(e,t,i,n,o){super(e,i,n,o),this.group=t,this.onDidChangeSizeConstraints=M.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,n){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,n=10){const o=`${this.getId()}${i}`;let r=iO.EDITOR_MEMENTOS.get(o);return r||(r=this._register(new GCe(this.getId(),i,this.getMemento(Ie.WORKSPACE,an.MACHINE),n,e,t)),iO.EDITOR_MEMENTOS.set(o,r)),r}getViewState(){}saveState(){for(const[,e]of iO.EDITOR_MEMENTOS)e.id===this.getId()&&e.saveState();super.saveState()}dispose(){this._input=void 0,this._options=void 0,super.dispose()}};iO.EDITOR_MEMENTOS=new Map;let DZ=iO;const nO=class nO extends V{constructor(e,t,i,n,o,r){super(),this.id=e,this.key=t,this.memento=i,this.limit=n,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 n=this.doGetResource(t);if(!n||!e)return;const o=this.doLoad();let r=o.get(n.toString());r||(r=Object.create(null),o.set(n.toString(),r)),r[e.id]=i,this.shareEditorState&&(r[nO.SHARED_EDITOR_STATE]=i),wa(t)&&this.clearEditorStateOnDispose(n,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[nO.SHARED_EDITOR_STATE]}}clearEditorState(e,t){wa(e)&&this.editorDisposables?.delete(e);const i=this.doGetResource(e);if(i){const n=this.doLoad();if(t){const o=n.get(i.toString());o&&(delete o[t.id],wA(o)&&n.delete(i.toString()))}else n.delete(i.toString())}}clearEditorStateOnDispose(e,t){this.editorDisposables||(this.editorDisposables=new Map),this.editorDisposables.has(t)||this.editorDisposables.set(t,M.once(t.onWillDispose)(()=>{this.clearEditorState(e),this.editorDisposables?.delete(t)}))}moveEditorState(e,t,i){const n=this.doLoad(),o=[...n.keys()];for(const r of o){const a=N.parse(r);if(!i.isEqualOrParent(a,e))continue;let c;if(ji(e,a))c=t;else{const d=pGe(a.path,e.path);c=Pt(t,a.path.substr(d+e.path.length+1))}const l=n.get(r,$l.None);l&&(n.delete(r),n.set(c.toString(),l))}}doGetResource(e){return wa(e)?e.resource:e}doLoad(){if(!this.cache){this.cache=new lm(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,n]of t)for(const o of Object.keys(n)){const r=Number(o);r===nO.SHARED_EDITOR_STATE&&this.shareEditorState||this.editorGroupService.getGroup(r)||(delete n[r],wA(n)&&e.delete(i))}}};nO.SHARED_EDITOR_STATE=-1;let GCe=nO,kZ=class extends DZ{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,n,c,r),this.instantiationService=o,this.textResourceConfigurationService=a,this.editorService=l,this.editorGroupService=d,this.groupListener=this._register(new wn),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,M.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(Na.getOriginalUri(e,{supportSideBySide:Hs.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}};kZ=D([_(3,Yi),_(4,we),_(5,$i),_(6,Ec),_(7,pn),_(8,ei),_(9,Po)],kZ);var v0;function i5t(s){const e=s;return typeof e?.primary=="object"&&typeof e.secondary=="object"}var GS;let KCe=(GS=class extends kZ{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,n,o,r,a,c,l){super(v0.ID,e,v0.VIEW_STATE_PREFERENCE_KEY,t,i,o,a,n,c,l),this.configurationService=r,this.onDidCreateEditors=this._register(new I),this._onDidChangeSizeConstraints=this._register(new Kge),this.onDidChangeSizeConstraints=M.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(v0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?fi.VERTICAL:fi.HORIZONTAL,this.dimension=new bn(0,0),this.lastFocusedSide=void 0,this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.onConfigurationUpdated(e)))}onConfigurationUpdated(e){e.affectsConfiguration(v0.SIDE_BY_SIDE_LAYOUT_SETTING)&&(this.orientation=this.configurationService.getValue(v0.SIDE_BY_SIDE_LAYOUT_SETTING)==="vertical"?fi.VERTICAL:fi.HORIZONTAL,this.splitview&&this.recreateSplitview())}recreateSplitview(){const e=qn(this.getContainer()),t=this.getSplitViewRatio();this.splitview&&(this.splitview.el.remove(),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 n=this.splitview.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height;e=t/n}}return e}createEditor(e){e.classList.add("side-by-side-editor"),this.secondaryEditorContainer=fe(".side-by-side-editor-container.editor-instance"),this.primaryEditorContainer=fe(".side-by-side-editor-container.editor-instance"),this.createSplitView(e)}createSplitView(e,t){this.splitview=this.splitviewDisposables.add(new b3(e,{orientation:this.orientation})),this.splitviewDisposables.add(this.splitview.onDidSashReset(()=>this.splitview?.distributeViewSizes())),this.orientation===fi.HORIZONTAL?this.splitview.orthogonalEndSash=this._boundarySashes?.bottom:(this.splitview.orthogonalStartSash=this._boundarySashes?.left,this.splitview.orthogonalEndSash=this._boundarySashes?.right);let i=Uk.Distribute,n=Uk.Distribute;if(t){const a=this.splitview.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height;i=Math.round(a*t),n=a-i,this.splitview.layout(this.orientation===fi.HORIZONTAL?this.dimension.width:this.dimension.height)}const o=qn(this.secondaryEditorContainer);this.splitview.addView({element:o,layout:a=>this.layoutPane(this.secondaryEditorPane,a),minimumSize:this.orientation===fi.HORIZONTAL?Ix.width:Ix.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},i);const r=qn(this.primaryEditorContainer);this.splitview.addView({element:r,layout:a=>this.layoutPane(this.primaryEditorPane,a),minimumSize:this.orientation===fi.HORIZONTAL?Ix.width:Ix.height,maximumSize:Number.POSITIVE_INFINITY,onDidChange:M.None},n),this.updateStyles()}getTitle(){return this.input?this.input.getName():g(8675,"Side by Side Editor")}async setInput(e,t,i,n){const o=this.input;await super.setInput(e,t,i,n),(!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===fi.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,n),this.primaryEditorPane?.setInput(e.primary,r,i,n)]),typeof t?.target=="number"&&(this.lastFocusedSide=t.target)}loadViewState(e,t,i){const n=i5t(t?.viewState)?t?.viewState:this.loadEditorViewState(e,i);let o=Object.create(null),r;return t?.target===Hs.SECONDARY?r={...t}:o={...t},o.viewState=n?.primary,n?.secondary&&(r?r.viewState=n?.secondary:r={viewState:n.secondary}),{primary:o,secondary:r,viewState:n}}createEditors(e){this.secondaryEditorPane=this.doCreateEditor(e.secondary,qn(this.secondaryEditorContainer)),this.primaryEditorPane=this.doCreateEditor(e.primary,qn(this.primaryEditorContainer)),this.layout(this.dimension),this._onDidChangeSizeConstraints.input=M.any(M.map(this.secondaryEditorPane.onDidChangeSizeConstraints,()=>{}),M.map(this.primaryEditorPane.onDidChangeSizeConstraints,()=>{})),this.onDidCreateEditors.fire(void 0),this.editorDisposables.add(this.primaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Hs.PRIMARY))),this.editorDisposables.add(this.secondaryEditorPane.onDidFocus(()=>this.onDidFocusChange(Hs.SECONDARY)))}doCreateEditor(e,t){const i=Qe.as(Xy.EditorPane).getEditorPane(e);if(!i)throw new Error("No editor pane descriptor for editor found");const n=i.instantiate(this.instantiationService,this.group);return n.create(t),n.setVisible(this.isVisible()),TWe(n)&&this.editorDisposables.add(n.onDidChangeSelection(o=>this._onDidChangeSelection.fire(o))),this.editorDisposables.add(n),n}onDidFocusChange(e){this.lastFocusedSide=e,this._onDidChangeControl.fire()}getSelection(){const e=this.getLastFocusedEditorPane();if(TWe(e)){const t=e.getSelection();if(t)return new gNe(t,e===this.primaryEditorPane?Hs.PRIMARY:Hs.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===Hs.SECONDARY?this.secondaryEditorPane:this.primaryEditorPane}layout(e){this.dimension=e,qn(this.splitview).layout(this.orientation===fi.HORIZONTAL?e.width:e.height)}setBoundarySashes(e){this._boundarySashes=e,this.splitview&&(this.splitview.orthogonalEndSash=e.bottom)}layoutPane(e,t){e?.layout(this.orientation===fi.HORIZONTAL?new bn(t,this.dimension.height):new bn(this.dimension.width,t))}getControl(){return this.getLastFocusedEditorPane()?.getControl()}getPrimaryEditorPane(){return this.primaryEditorPane}getSecondaryEditorPane(){return this.secondaryEditorPane}tracksEditorViewState(e){return e instanceof ip}computeEditorViewState(e){if(!this.input||!ji(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 ip&&(t=e.primary.resource,i=e.secondary.resource),!(!i||!t))return N.from({scheme:"sideBySide",path:`${D8(i.toString())}${D8(t.toString())}`})}updateStyles(){super.updateStyles(),this.primaryEditorContainer&&(this.orientation===fi.HORIZONTAL?(this.primaryEditorContainer.style.borderLeftWidth="1px",this.primaryEditorContainer.style.borderLeftStyle="solid",this.primaryEditorContainer.style.borderLeftColor=this.getColor(X1t)??"",this.primaryEditorContainer.style.borderTopWidth="0"):(this.primaryEditorContainer.style.borderTopWidth="1px",this.primaryEditorContainer.style.borderTopStyle="solid",this.primaryEditorContainer.style.borderTopColor=this.getColor(J1t)??"",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&&Ms(this.secondaryEditorContainer),this.primaryEditorContainer&&Ms(this.primaryEditorContainer)}},v0=GS,GS.ID=L0t,GS.SIDE_BY_SIDE_LAYOUT_SETTING="workbench.editor.splitInGroupLayout",GS.VIEW_STATE_PREFERENCE_KEY="sideBySideEditorViewState",GS);KCe=v0=D([_(1,Yi),_(2,we),_(3,pn),_(4,$i),_(5,Te),_(6,Ec),_(7,ei),_(8,Po)],KCe);class gNe{constructor(e,t){this.selection=e,this.side=t}compare(e){return!(e instanceof gNe)||this.side!==e.side?kx.DIFFERENT:this.selection.compare(e.selection)}restore(e){const t={...e,target:this.side};return this.selection.restore(t)}}const Sw=class Sw{static didInstantiateEditorPane(e){return Sw.instantiatedEditorPanes.has(e)}static create(e,t,i){return new Sw(e,t,i)}constructor(e,t,i){this.ctor=e,this.typeId=t,this.name=i}instantiate(e,t){Sw._onWillInstantiateEditorPane.fire({typeId:this.typeId});const i=e.createInstance(this.ctor,t);return Sw.instantiatedEditorPanes.add(this.typeId),i}describes(e){return e.getId()===this.typeId}};Sw.instantiatedEditorPanes=new Set,Sw._onWillInstantiateEditorPane=new I,Sw.onWillInstantiateEditorPane=Sw._onWillInstantiateEditorPane.event;let oVe=Sw;class n5t{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 n of this.mapEditorPanesToEditors.keys()){const o=this.mapEditorPanesToEditors.get(n)||[];for(const r of o){const a=r.ctor;if(!t&&e.constructor===a){i.push(n);break}else if(t&&e instanceof a){i.push(n);break}}}return!t&&i.length===0?this.findEditorPaneDescriptors(e,!0):i}getEditorPaneByType(e){return hi.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(n=>n.ctor))}return e}}Qe.add(Xy.EditorPane,new n5t);function s5t(s,e){const t=s.get(ei),i=s.get(ks),n=s.get(Im);return new Promise(o=>{let r=[...e];const a=t.onDidCloseEditor(async c=>{if(c.context===aA.MOVE)return;let l=Na.getOriginalUri(c.editor,{supportSideBySide:Hs.PRIMARY}),d=Na.getOriginalUri(c.editor,{supportSideBySide:Hs.SECONDARY});if(c.context===aA.REPLACE){const h=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY}),u=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.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!==aA.REPLACE&&(l?.scheme===pe.untitled&&i.extUri.isEqual(h,l.with({scheme:h.scheme}))||d?.scheme===pe.untitled&&i.extUri.isEqual(h,d.with({scheme:h.scheme}))))),r.length===0){const h=e.filter(u=>n.isDirty(u));return h.length>0&&await Zs.settled(h.map(async u=>await new Promise(f=>{if(!n.isDirty(u))return f();const p=n.onDidChangeDirty(m=>{if(!m.isDirty()&&i.extUri.isEqual(u,m.resource))return p.dispose(),f()})}))),a.dispose(),o()}})})}function o5t(s,e,t,i){let n=s.getAriaLabel();return t&&!t.isPinned(s)&&(n=g(4580,"{0}, preview",n)),t?.isSticky(s)&&(n=g(4581,"{0}, pinned",n)),t&&typeof i=="number"&&i>1&&(n=`${n}, ${t.ariaLabel}`),n}var qCe,uR;let QCe=(uR=class extends kZ{constructor(e,t,i,n,o,r,a,c,l,d){super(e,t,qCe.VIEW_STATE_PREFERENCE_KEY,i,n,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 wn),this._register(this.textResourceConfigurationService.onDidChangeConfiguration(h=>this.handleConfigurationChangeEvent(h))),this._register(M.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=kn(e.editor)?xs(e.editor):Object.create(null);return Object.assign(t,this.getConfigurationOverrides(e)),t.ariaLabel=this.computeAriaLabel(),t}computeAriaLabel(){return this.input?o5t(this.input,void 0,this.group,this.editorGroupService.count):g(11473,"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:K0.EDIT}))),this._register(e.onDidScrollChange(()=>this._onDidChangeScroll.fire())))}toEditorPaneSelectionChangeReason(e){switch(e.source){case Ab.PROGRAMMATIC:return K0.PROGRAMMATIC;case Ab.NAVIGATION:return K0.NAVIGATION;case Ab.JUMP:return K0.JUMP;default:return K0.USER}}getSelection(){const e=this.getMainControl();if(e){const t=e.getSelection();if(t)return new jCe(t)}}async setInput(e,t,i,n){await super.setInput(e,t,i,n),this.inputListener.value=e.onDidChangeCapabilities(()=>this.onDidChangeInputCapabilities(e)),this.updateEditorConfiguration(),qn(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 n=i;this.lastAppliedEditorOptions&&(n=i8(this.lastAppliedEditorOptions,n)),Object.keys(n).length>0&&(this.lastAppliedEditorOptions=i,this.updateEditorControlOptions(n))}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()}},qCe=uR,uR.VIEW_STATE_PREFERENCE_KEY="textEditorViewState",uR);QCe=qCe=D([_(2,Yi),_(3,we),_(4,$i),_(5,Ec),_(6,pn),_(7,ei),_(8,Po),_(9,Jt)],QCe);const qz=class qz{constructor(e){this.textSelection=e}compare(e){if(!(e instanceof qz))return kx.DIFFERENT;const t=Math.min(this.textSelection.selectionStartLineNumber,this.textSelection.positionLineNumber),i=Math.min(e.textSelection.selectionStartLineNumber,e.textSelection.positionLineNumber);return t===i?kx.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!==rVe&&(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()??Ca))return;const e=await this.languageDetectionService.detectLanguage(this.textEditorModelHandle),t=this.getLanguageId();if(e&&e!==t&&!this.isDisposed()){this.setLanguageIdInternal(e,rVe);const i=this.languageService.getLanguageName(e);this.accessibilityService.alert(g(9795,"Language {0} was automatically detected and set as the language mode.",i??e))}}createTextEditorModel(e,t,i){const n=this.getFirstLineText(e),o=this.getOrCreateLanguage(t,this.languageService,i,n);return this.doCreateTextEditorModel(e,o,t)}doCreateTextEditorModel(e,t,i){let n=i&&this.modelService.getModel(i);return n?this.updateTextEditorModel(e,t.languageId):(n=this.modelService.createModel(e,t,i),this.createdEditorModel=!0,this.registerModelDisposeListener(n)),this.textEditorModelHandle=n.uri,n}getFirstLineText(e){const t=e;return typeof t.getFirstLineText=="function"?t.getFirstLineText(Qj.FIRST_LINE_DETECTION_LENGTH_LIMIT):e.getLineContent(1).substr(0,Qj.FIRST_LINE_DETECTION_LENGTH_LIMIT)}getOrCreateLanguage(e,t,i,n){return!i||i===Ca?t.createByFilepathOrFirstLine(e??null,n):t.createById(i)}updateTextEditorModel(e,t){this.isResolved()&&(e&&this.modelService.updateModel(this.textEditorModel,e),t&&t!==Ca&&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()}},YCe=gR,gR.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY=600,gR);eI=YCe=D([_(0,gi),_(1,xi),_(2,M6),_(3,mr)],eI);class ztt extends xI{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 $tt extends ztt{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 RQ,fR;let $g=(fR=class extends ip{get typeId(){return RQ.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|=Ei.ForceDescription),e}constructor(e,t,i,n,o,r){super(e,t,i,n,r),this.original=i,this.modified=n,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(8674,"{0} ↔ {1}",d,h),t=d===h}let i,n,o;if(this.preferredDescription)i=this.preferredDescription,n=this.preferredDescription,o=this.preferredDescription;else{i=this.computeLabel(this.original.getDescription(Ls.SHORT),this.modified.getDescription(Ls.SHORT)),o=this.computeLabel(this.original.getDescription(Ls.LONG),this.modified.getDescription(Ls.LONG));const d=this.original.getDescription(Ls.MEDIUM),h=this.modified.getDescription(Ls.MEDIUM);if(typeof d=="string"&&typeof h=="string"&&(d||h)){const[u,f]=SMt([d,h]);n=this.computeLabel(u,f)}}let r=this.computeLabel(this.original.getTitle(Ls.SHORT)??this.original.getName(),this.modified.getTitle(Ls.SHORT)??this.modified.getName()," ↔ "),a=this.computeLabel(this.original.getTitle(Ls.MEDIUM)??this.original.getName(),this.modified.getTitle(Ls.MEDIUM)??this.modified.getName()," ↔ "),c=this.computeLabel(this.original.getTitle(Ls.LONG)??this.original.getName(),this.modified.getTitle(Ls.LONG)??this.modified.getName()," ↔ ");const l=this.getPreferredTitle();return l&&(r=`${l} (${r})`,a=`${l} (${a})`,c=`${l} (${c})`),{name:e,shortDescription:i,mediumDescription:n,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=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.labels.shortDescription;case Ls.LONG:return this.labels.longDescription;case Ls.MEDIUM:default:return this.labels.mediumDescription}}getTitle(e){switch(e){case Ls.SHORT:return this.labels.shortTitle;case Ls.LONG:return this.labels.longTitle;default:case Ls.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===R0t):e.find(t=>t.typeId===QYe)}async createModel(){const[e,t]=await Promise.all([this.original.resolve(),this.modified.resolve()]);return t instanceof eI&&e instanceof eI?new $tt(e,t):new ztt(F2e(e)?e:void 0,F2e(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 RQ?this.modified.matches(e.modified)&&this.original.matches(e.original)&&e.forceOpenAsBinary===this.forceOpenAsBinary:C_(e)?this.modified.matches(e.modified)&&this.original.matches(e.original):!1}dispose(){this.cachedModel&&(this.cachedModel.dispose(),this.cachedModel=void 0),super.dispose()}},RQ=fR,fR.ID="workbench.editors.diffEditorInput",fR);$g=RQ=D([_(5,ei)],$g);var JCe,pR;let aVe=(pR=class extends QCe{get scopedContextKeyService(){if(!this.diffEditorControl)return;const e=this.diffEditorControl.getOriginalEditor(),t=this.diffEditorControl.getModifiedEditor();return(e.hasTextFocus()?e:t).invokeWithinContext(i=>i.get(Le))}constructor(e,t,i,n,o,r,a,c,l,d){super(JCe.ID,e,t,i,n,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(9537,"Text Diff Editor")}createEditorControl(e,t){this.diffEditorControl=this._register(this.instantiationService.createInstance(pp,e,t,{}))}updateEditorControlOptions(e){this.diffEditorControl?.updateOptions(e)}getMainControl(){return this.diffEditorControl?.getModifiedEditor()}async setInput(e,t,i,n){this._previousViewModel&&(this._previousViewModel.dispose(),this._previousViewModel=null),this.inputLifecycleStopWatch=void 0,await super.setInput(e,t,i,n);try{const o=await e.resolve();if(n.isCancellationRequested)return;if(!(o instanceof $tt)){this.openAsBinary(e,t);return}const r=qn(this.diffEditorControl),a=o,c=a.textDiffEditorModel?r.createViewModel(a.textDiffEditorModel):null;this._previousViewModel=c,await c?.waitForDiff(),r.setModel(c);let l=!1;ERe(t?.viewState)||(l=this.restoreTextDiffEditorViewState(e,t,i,r));let d=!1;t&&(d=IZ(t,r,mt.Immediate)),!d&&!l&&r.revealFirstDiff(),r.updateOptions({...this.getReadonlyConfiguration(a.modifiedModel?.isReadonly()),originalEditable:!a.originalModel?.isReadonly()}),r.handleInitialized(),this.inputLifecycleStopWatch=new js(!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===Qi.FILE_TOO_LARGE){let n;throw e instanceof Mq?n=g(9538,"At least one file is not displayed in the text compare editor because it is very large ({0}).",Nc.formatSize(e.size)):n=g(9539,"At least one file is not displayed in the text compare editor because it is very large."),O0t(this.group,t,i,n,this.preferencesService)}throw e}restoreTextDiffEditorViewState(e,t,i,n){const o=this.loadEditorViewState(e,i);return o?(t?.selection&&o.modified&&(o.modified.cursorState=[]),n.restoreViewState(o),t?.revealIfVisible&&n.revealFirstDiff(),!0):!1}openAsBinary(e,t){const i=e.original,n=e.modified,o=this.instantiationService.createInstance($g,e.getName(),e.getDescription(),i,n,!0),r=Qe.as(Xy.EditorFactory).getFileEditorFactory();r.isFileEditor(i)&&i.setForceOpenAsBinary(),r.isFileEditor(n)&&n.setForceOpenAsBinary(),this.group.replaceEditors([{editor:e,replacement:o,options:{...t,activation:Hk.PRESERVE,pinned:this.group.isPinned(e),sticky:this.group.isSticky(e)}}])}setOptions(e){super.setOptions(e),e&&IZ(e,qn(this.diffEditorControl),mt.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(kn(e.diffEditor)){const n=xs(e.diffEditor);n.diffCodeLens=n.codeLens,delete n.codeLens,n.diffWordWrap=n.wordWrap,delete n.wordWrap,Object.assign(t,n)}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 $g&&!this.input.original.isReadonly(),lineDecorationsWidth:"2ch"}}updateReadonly(e){e instanceof $g?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===yW.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 pp&&(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 $g}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&&ji(i,e))return this.diffEditorControl.saveViewState()??void 0}toEditorViewStateResource(e){let t,i;if(e instanceof $g?(t=e.original.resource,i=e.modified.resource):wa(e)||(t=e.original.uri,i=e.modified.uri),!(!t||!i))return N.from({scheme:"diff",path:`${D8(t.toString())}${D8(i.toString())}`})}},JCe=pR,pR.ID=QYe,pR);aVe=JCe=D([_(1,Yi),_(2,we),_(3,$i),_(4,Ec),_(5,ei),_(6,pn),_(7,Po),_(8,Jt),_(9,N6)],aVe);function TZ(s,e,t=dA){if(t===dA||t===J_)return t;let i=s.getGroups(du.GRID_APPEARANCE)[t];if(!i&&t<9){for(let n=0;n<=t;n++){const o=s.getGroups(du.GRID_APPEARANCE);o[n]||s.addGroup(o[n-1],OW(e))}i=s.getGroups(du.GRID_APPEARANCE)[t]}return i?.id??J_}function tI(s,e){const t=typeof e=="number"?s.getGroup(e):e;return s.getGroups(du.GRID_APPEARANCE).indexOf(t??s.activeGroup)}function a5t(s,e,t,i){const n=c5t(s,e,t,i),o=n.length&&n[0].preserveFocus||!1,r={groupedEditors:[],preserveFocus:o};for(const a of n){const c=h5t(a,t);if(!c)continue;const{group:l,editor:d}=c;let h;for(const u of r.groupedEditors)if(u.group.id===l.id){h=u;break}h||(h={group:l,editors:[]},r.groupedEditors.push(h)),d&&h.editors.push(d)}return r}function c5t(s,e,t,i){const n=i.lastFocusedList;let o=n instanceof Xa&&n.getHTMLElement()===Bc(),r=d5t(s,o,e,t,i);if(!r){const c=t.activeGroup,l=c.activeEditor;r={groupId:c.id,editorIndex:l?c.getIndexOfEditor(l):void 0},o=!1}const a=Gtt(r,o,e,t,i);return l5t(r,a)}function l5t(s,e){if(e.length<=1)return e;const t=e.findIndex(i=>i.groupId===s.groupId&&i.editorIndex===s.editorIndex);if(t!==-1)e.splice(t,1),e.unshift(s);else if(s.editorIndex===void 0)e.unshift(s);else throw new Error("Editor context not found in multi editor context");return e}function d5t(s,e,t,i,n){const o=s.filter(r=>LWe(r)||N.isUri(r));for(const r of o)if(LWe(r))return r;for(const r of o){const a=t.findEditors(r);if(a.length){const c=a[0],l=i.getGroup(c.groupId);return{groupId:c.groupId,editorIndex:l?.getIndexOfEditor(c.editor)}}}if(e){const r=n.lastFocusedList;for(const a of r.getFocusedElements())if(Ktt(a))return XCe(a,void 0,i)}}function Gtt(s,e,t,i,n){if(e){const r=n.lastFocusedList.getSelectedElements().filter(Ktt);if(r.length>1)return r.map(a=>XCe(a,s.preserveFocus,i));if(r.length===0)return Gtt(s,!1,t,i,n)}else{const o=i.getGroup(s.groupId),r=s.editorIndex!==void 0?o?.getEditorByIndex(s.editorIndex):o?.activeEditor;if(o&&r&&o.isSelected(r))return o.selectedEditors.map(a=>XCe({editor:a,groupId:o.id},s.preserveFocus,i))}return[s]}function XCe(s,e,t){if(aNe(s))return{groupId:s.id,editorIndex:void 0,preserveFocus:e};const i=t.getGroup(s.groupId);return{groupId:s.groupId,editorIndex:i?i.getIndexOfEditor(s.editor):-1,preserveFocus:e}}function Ktt(s){return aNe(s)||wve(s)}function h5t(s,e){const t=e.getGroup(s.groupId);if(!t)return;if(s.editorIndex===void 0)return{group:t,editor:void 0};const i=t.getEditorByIndex(s.editorIndex);return{group:t,editor:i}}const u5t="workbench.action.closeEditorsAndGroup";class g5t{constructor(e){this.root=new LZ;for(const[t,i]of e)for(const n of i)this.root.add(t,n)}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 LZ;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 n=(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=>n(d,a))},o=new Map;for(const r of e){let a=n(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 LZ{constructor(){this.value=new fNe,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],n=e.slice(1);let o=this.map.get(i);o||this.map.set(i,o=new LZ),o.add(n,t)}}get(e,t){const i=[];i.push(...this.value.get(e,t));const n=e[0],o=e.slice(1),r=this.map.get(n);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 xNe{constructor(){this.star=[],this.epsilon=[],this.map=new Map,this.hasItems=!1}add(e,t){if(this.hasItems=!0,e==="*")this.star.push(new yVe(t));else if(e==="")this.epsilon.push(new yVe(t));else{const i=e[e.length-1],n=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 xNe),o.add(n,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 n=e[e.length-1],o=e.slice(0,e.length-1),r=this.map.get(n);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 fw;(function(s){s.capture="capture",s.basename="basename",s.dirname="dirname",s.extname="extname"})(fw||(fw={}));const wVe=/\$[({](capture|basename|dirname|extname)[)}]/g;class yVe{constructor(e){this.tokens=[],wVe.lastIndex=0;let t,i=0;for(;t=wVe.exec(e);){const n=e.slice(i,t.index);this.tokens.push(n);const o=t[1];switch(o){case fw.basename:case fw.dirname:case fw.extname:case fw.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 n=e.slice(i,e.length);this.tokens.push(n)}}substitute(e,t){return this.tokens.map(i=>{if(typeof i=="string")return i;switch(i.capture){case fw.basename:return e.basename;case fw.dirname:return e.dirname;case fw.extname:return e.extname;case fw.capture:return t||""}}).join("")}}class Gd{constructor(e,t,i,n,o,r,a,c,l,d=EA(e),h,u=!1){this.resource=e,this.fileService=t,this.configService=i,this.filesConfigService=n,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,n,o,r){const a=new Gd(n.resource,e,t,i,o,n.isDirectory,n.isSymbolicLink,n.readonly,n.locked,n.name,n.mtime,!n.isFile&&!n.isDirectory);if(a.isDirectory&&(a._isDirectoryResolved=!!n.children||!!r&&r.some(c=>qy(c,a.resource)),n.children))for(let c=0,l=n.children.length;c{n.set(o.resource,o)}),t.children.clear(),e.children.forEach(o=>{const r=n.get(o.resource);r?(Gd.mergeLocalWithDisk(o,r),t.addChild(r),n.delete(o.resource)):t.addChild(o)}),n.forEach(o=>{o instanceof Dce&&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 n=e===zCe.Modified;this.error=void 0;try{const o=await this.fileService.resolve(this.resource,{resolveSingleChildDescendants:!0,resolveMetadata:n}),r=Gd.create(this.fileService,this.configService,this.filesConfigService,o,this);Gd.mergeLocalWithDisk(r,this)}catch(o){throw this.error=o,o}this._isDirectoryResolved=!0}const i=[];if(t.enabled){const n=[],o=[];for(const a of this.children.entries())a[1].nestedParent=void 0,a[1].isDirectory?o.push(a):n.push(a);const r=this.fileNester.nest(n.map(([a])=>a),this.getPlatformAwareName(this.name));for(const[a,c]of n){const l=r.get(a);if(l!==void 0){c.nestedChildren=[];for(const d of l.keys()){const h=qn(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(n=>{i.push(n)});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,n])=>[this.getPlatformAwareName(i.trim()),n.split(",").map(o=>this.getPlatformAwareName(o.trim().replace(/\u200b/g,"").trim())).filter(o=>o!=="")]);this.root._fileNester=new A5t(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,Vn.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=Pt(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,Vn.PathCaseSensitive);return e&&this.resource.scheme===e.scheme&&ua(this.resource.authority,e.authority)&&(t?W7(e.path,this.resource.path):e.path.startsWith(this.resource.path))?this.findByPath(zy(e.path,Vi.sep),this.resource.path.length,t):null}findByPath(e,t,i){if(Slt(zy(this.resource.path,Vi.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:Bb,delay:500},()=>n),n}toTransfer(e){if(Fdt(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:n=>n(i)})});return t}async doUpload(e,t,i,n){const o=t.items,r=[];for(const h of o)r.push(h.webkitGetAsEntry());const a=[],c={startTime:Date.now(),progressScheduler:new TGe(h=>{i.report(h[h.length-1])},1e3),filesTotal:r.length,filesUploaded:0,totalBytesUploaded:0},l=new dpe(PQ.MAX_PARALLEL_UPLOADS);await Zs.settled(r.map(h=>l.queue(async()=>{if(n.isCancellationRequested)return;if(e&&h.name&&e.getChild(h.name)){const{confirmed:f}=await this.dialogService.confirm(DNe(h.name));if(!f||(await this.explorerService.applyBulkEdit([new cp(Pt(e.resource,h.name),void 0,{recursive:!0,folder:e.getChild(h.name)?.isDirectory})],{undoLabel:g(10020,"Overwrite {0}",h.name),progressLabel:g(10021,"Overwriting {0}",h.name)}),n.isCancellationRequested))return}const u=await this.doUploadEntry(h,e.resource,e,i,c,n);u&&a.push(u)}))),c.progressScheduler.dispose();const d=a[0];!n.isCancellationRequested&&d?.isFile&&await this.editorService.openEditor({resource:d.resource,options:{pinned:!0}})}async doUploadEntry(e,t,i,n,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>Nc.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 b=await new Promise((w,y)=>d.readEntries(w,y));b.length>0?h.push(...b):u=!0}while(!u&&!r.isCancellationRequested);o.filesTotal+=h.length;const f=i&&i.getChild(e.name)||void 0,p=[],m=[];for(const b of h)b.isFile?p.push(b):b.isDirectory&&m.push(b);const v=new dpe(PQ.MAX_PARALLEL_UPLOADS);await Zs.settled(p.map(b=>v.queue(()=>this.doUploadEntry(b,l,f,n,o,r))));for(const b of m)await this.doUploadEntry(b,l,f,n,o,r);return{isFile:!1,resource:l}}}async doUploadFileBuffered(e,t,i,n){const o=lKe({highWaterMark:10}),r=this.fileService.writeFile(e,o);try{const a=t.stream().getReader();let c=await a.read();for(;!c.done&&!n.isCancellationRequested;){const l=$e.wrap(c.value);if(await o.write(l),n.isCancellationRequested)break;i(t.size,l.byteLength),c=await a.read()}o.end(void 0)}catch(a){o.error(a),o.end()}n.isCancellationRequested||await r}doUploadFileUnbuffered(e,t,i){return new Promise((n,o)=>{const r=new FileReader;r.onload=async a=>{try{if(a.target?.result instanceof ArrayBuffer){const c=$e.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.");n()}catch(c){o(c)}},r.readAsArrayBuffer(t)})}},PQ=wR,wR.MAX_PARALLEL_UPLOADS=20,wR);NZ=PQ=D([_(0,cg),_(1,to),_(2,vf),_(3,ei),_(4,Jt)],NZ);let oSe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this.fileService=e,this.hostService=t,this.contextService=i,this.configurationService=n,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 n=new ci,o=this.progressService.withProgress({location:ud.Window,delay:800,cancellable:!0,title:g(10024,"Copying...")},async()=>await this.doImport(e,t,i,n.token),()=>n.dispose(!0));return this.progressService.withProgress({location:Bb,delay:500},()=>o),o}async doImport(e,t,i,n){const o=Fi((await this.instantiationService.invokeFunction(l=>oZe(l,t))).map(l=>l.resource));await Promise.all(o.map(l=>this.fileService.activateProvider(l.scheme)));const r=Fi(o.filter(l=>this.fileService.hasProvider(l))),a=await this.fileService.resolveAll(r.map(l=>({resource:l})));if(n.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(10025,"&&Copy Folders"):g(10026,"&&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(10027,"&&Add Folders to Workspace"):g(10028,"&&Add Folder to Workspace"),run:()=>l.Add}),h=c.length>1?g(10029,"Do you want to copy the folders or add the folders to the workspace?"):g(10030,"Do you want to copy '{0}' or add '{0}' as a folder to the workspace?",_i(c[0].uri))):h=c.length>1?g(10031,"Are you sure to want to copy folders?"):g(10032,"Are you sure to want to copy '{0}'?",_i(c[0].uri));const{result:f}=await this.dialogService.prompt({type:Xe.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,n)}else if(e instanceof Gd)return this.importResources(e,r,n)}async importResources(e,t,i){if(t&&t.length>0){const n=await this.fileService.resolve(e.resource);if(i.isCancellationRequested)return;const o=new Set,r=this.fileService.hasCapability(e.resource,Vn.PathCaseSensitive);n.children&&n.children.forEach(u=>{o.add(r?u.name:u.name.toLowerCase())});let a=0;const c=Fi(await Zs.settled(t.map(async u=>{if(!await this.fileService.exists(u)){a++;return}if(!(o.has(r?_i(u):_i(u).toLowerCase())&&!(await this.dialogService.confirm(DNe(_i(u)))).confirmed))return u})));a>0&&this.notificationService.error(a>1?g(10033,"Some or all of the dropped files could not be accessed for import."):g(10034,"The dropped file could not be accessed for import."));const l=c.map(u=>{const f=_i(u),p=Pt(e.resource,f);return new cp(u,p,{overwrite:!0,copy:!0})}),d=this.configurationService.getValue().explorer.confirmUndo;if(await this.explorerService.applyBulkEdit(l,{undoLabel:c.length===1?g(10035,"Import {0}",_i(c[0])):g(10036,"Import {0} resources",c.length),progressLabel:c.length===1?g(10037,"Copying {0}",_i(c[0])):g(10038,"Copying {0} resources",c.length),progressLocation:ud.Window,confirmBeforeUndo:d===RT.Verbose||d===RT.Default}),this.configurationService.getValue().explorer.autoOpenDroppedFile&&l.length===1){const u=this.explorerService.findClosest(l[0].newResource);u&&!u.isDirectory&&this.editorService.openEditor({resource:u.resource,options:{pinned:!0}})}}}};oSe=D([_(0,Jt),_(1,xc),_(2,yi),_(3,Te),_(4,to),_(5,iC),_(6,vf),_(7,ei),_(8,cg),_(9,bi),_(10,we)],oSe);var yR;let rSe=(yR=class{constructor(e,t,i,n,o,r){this.fileService=e,this.explorerService=t,this.progressService=i,this.logService=n,this.fileDialogService=o,this.storageService=r}download(e){const t=new ci,i=this.progressService.withProgress({location:ud.Window,delay:800,cancellable:Wn,title:g(10039,"Downloading")},async n=>this.doDownload(e,n,t),()=>t.dispose(!0));return this.progressService.withProgress({location:Bb,delay:500},()=>i),i}async doDownload(e,t,i){for(const n of e){if(i.token.isCancellationRequested)return;Wn?await this.doDownloadBrowser(n.resource,t,i):await this.doDownloadNative(n,t,i)}}async doDownloadBrowser(e,t,i){const n=await this.fileService.resolve(e,{resolveMetadata:!0});if(i.token.isCancellationRequested)return;const o=32*Nc.MB,r=n.isDirectory||n.size>o,a=ky();if(r&&Yp.supported(a))try{const c=await a.showDirectoryPicker(),l={startTime:Date.now(),progressScheduler:new TGe(d=>{t.report(d[d.length-1])},1e3),filesTotal:n.isDirectory?0:1,filesDownloaded:0,totalBytesDownloaded:0,fileBytesDownloaded:0};if(n.isDirectory){const d=await c.getDirectoryHandle(n.name,{create:!0});await this.downloadFolderBrowser(n,d,l,i.token)}else await this.downloadFileBrowser(c,n,l,i.token);l.progressScheduler.dispose()}catch(c){this.logService.warn(c),i.cancel()}else if(n.isFile){let c;try{c=(await this.fileService.readFile(n.resource,{limits:{size:o}},i.token)).value.buffer}catch{c=ef.uriToBrowserUri(n.resource)}i.token.isCancellationRequested||Vdt(c,n.name)}}async downloadFileBufferedBrowser(e,t,i,n){const o=await this.fileService.readFileStream(e,void 0,n);if(n.isCancellationRequested){t.close();return}return new Promise((r,a)=>{const c=o.value,l=new Z;l.add(Ee(()=>t.close())),l.add(hm(n.onCancellationRequested)(()=>{l.dispose(),a(xy())})),kN(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()}},n)})}async downloadFileUnbufferedBrowser(e,t,i,n){const o=await this.fileService.readFile(e,void 0,n);n.isCancellationRequested||(t.write(o.value.buffer),this.reportProgress(o.name,o.size,o.value.byteLength,i)),t.close()}async downloadFileBrowser(e,t,i,n){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>Nc.MB?this.downloadFileBufferedBrowser(t.resource,r,i,n):this.downloadFileUnbufferedBrowser(t.resource,r,i,n)}async downloadFolderBrowser(e,t,i,n){if(e.children){i.filesTotal+=e.children.map(o=>o.isFile).length;for(const o of e.children){if(n.isCancellationRequested)return;if(o.isFile)await this.downloadFileBrowser(t,o,i,n);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,n)}}}}reportProgress(e,t,i,n){n.fileBytesDownloaded+=i,n.totalBytesDownloaded+=i;const o=n.totalBytesDownloaded/((Date.now()-n.startTime)/1e3);let r;t1?{message:g(10049,"The following {0} files and/or folders already exist in the destination folder. Do you want to replace them?",s.length),detail:Gtt(s)+` -`+g(10047,"This action is irreversible!"),primaryButton:g(10048,"&&Replace"),type:"warning"}:DNe(_i(s[0]))}const kNe="explorer.newFile";Pe(5429,"New File...");const tit="explorer.newFolder";Pe(5430,"New Folder...");g(5431,"Rename...");g(5432,"Delete");g(5433,"Copy");g(5434,"Paste");const x5t=new Q("fileCopied",!1),D5t="explorer.download";g(5435,"Download...");const k5t="explorer.upload";g(5436,"Upload...");function I5t(s,e){e.message==="string"&&(e=e.message),s.error(Nr(e,!1))}async function T5t(s,e){s&&(s.indexOf("/")>=0||s.indexOf("\\")>=0)&&await e.refresh()}async function L5t(s,e,t,i,n,o){let r=typeof n.resource=="string"?n.resource:EA(n.resource),a=Pt(i.resource,r);if(!(o==="disabled"&&!await M5t(e,t,a))){for(;!n.allowOverwrite&&s.findClosest(a);)o!=="disabled"&&(r=R5t(r,!!n.isDirectory,o)),a=Pt(i.resource,r);return a}}function R5t(s,e,t){if(t==="simple"){let h=s,u="";e||(u=Gy(s),h=Ko(s,u));const f=/^(.+ copy)( \d+)?$/;return f.test(h)?h.replace(f,(p,m,v)=>{const b=v?parseInt(v):1;return b===0?`${m}`:b{const m=parseInt(f);return m{const m=parseInt(u);return m{const p=parseInt(u);return p=0)return`${s.substr(0,c)}.1${s.substr(c)}`;const l=RegExp("(\\d+)$");if(!e&&c===-1&&s.match(l))return s.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){I5t(this.notificationService,t)}}};aSe=D([_(2,vi),_(3,bi),_(4,Rm)],aSe);const Toe=class Toe extends aSe{get class(){return"explorer-action "+We.asClassName(ve.saveAll)}doRun(e){return this.commandService.executeCommand(JZe,{},e)}};Toe.ID="workbench.files.action.saveAllInGroup",Toe.LABEL=g(5477,"Save All in Group");let AVe=Toe;var CR;let EVe=(CR=class extends rn{constructor(e,t,i){super(e,t,We.asClassName(ve.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(S5t,{},e)}},CR.ID="workbench.files.action.closeGroup",CR.LABEL=g(5478,"Close Group"),CR);EVe=D([_(2,vi)],EVe);const lO=class lO extends li{constructor(){super({id:lO.ID,title:lO.LABEL,f1:!0,category:ca.File,metadata:{description:Pe(5480,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Tm).openPaneComposite(UVt,ir.Sidebar,!0)}};lO.ID="workbench.files.action.focusFilesExplorer",lO.LABEL=Pe(5479,"Focus on Files Explorer");let xVe=lO;const dO=class dO extends li{constructor(){super({id:dO.ID,title:dO.LABEL,f1:!0,category:ca.File,metadata:{description:Pe(5482,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(vi),i=e.get(ei),n=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY});n&&t.executeCommand(bFt,n)}};dO.ID="workbench.files.action.showActiveFileInExplorer",dO.LABEL=Pe(5481,"Reveal Active File in Explorer View");let DVe=dO;const hO=class hO extends li{constructor(){super({id:hO.ID,title:hO.LABEL,f1:!0,category:ca.File,precondition:rJe,metadata:{description:Pe(5484,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(ei),i=e.get(xc),n=e.get(to),o=e.get(Jt),r=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY});r&&(o.hasProvider(r)?i.openWindow([{fileUri:r}],{forceNewWindow:!0}):n.error(g(5485,"The active editor must contain an openable resource.")))}};hO.ID="workbench.action.files.showOpenedFileInNewWindow",hO.LABEL=Pe(5483,"Open Active File in New Empty Workspace");let kVe=hO;function N5t(s,e,t,i){if(t=F5t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(5486,"A file or folder name must be provided."),severity:Xe.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(5487,"A file or folder name cannot start with a slash."),severity:Xe.Error};const n=Fi(t.split(/[\\/]/)),o=e.parent;if(t!==e.name){const r=o?.getChild(t);if(r&&r!==e)return{content:g(5488,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:Xe.Error}}if(n.some(r=>!s.hasValidBasename(e.resource,i,r))){const r=t.replace(/\*/g,"\\*");return{content:g(5489,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",P5t(r)),severity:Xe.Error}}return n.some(r=>/^\s|\s$/.test(r))?{content:g(5490,"Leading or trailing whitespace detected in file or folder name."),severity:Xe.Warning}:null}function P5t(s){return s?.length>255?`${s.substr(0,255)}...`:s}function F5t(s){return s&&(s=Y1e(s," "),s=zy(s,"/"),s=zy(s,"\\"),s)}const uO=class uO extends li{constructor(){super({id:uO.ID,title:uO.LABEL,f1:!0,category:ca.File,metadata:{description:Pe(5492,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(ei).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};uO.ID="workbench.files.action.compareNewUntitledTextFiles",uO.LABEL=Pe(5491,"Compare New Untitled Text Files");let IVe=uO;const QE=class QE extends li{constructor(){super({id:QE.ID,title:QE.LABEL,f1:!0,category:ca.File,keybinding:{primary:rr(U.CtrlCmd|S.KeyK,S.KeyC),weight:Ae.WorkbenchContrib},metadata:{description:Pe(5494,"Opens a new diff editor to compare the active file with the contents of the clipboard.")}})}async run(e){const t=e.get(ei),i=e.get(we),n=e.get(fn),o=e.get(Jt),r=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY}),a=`clipboardCompare${QE.SCHEME_COUNTER++}`;if(r&&(o.hasProvider(r)||r.scheme===pe.untitled)){if(!this.registrationDisposal){const d=i.createInstance(cSe);this.registrationDisposal=n.registerTextModelContentProvider(a,d)}const c=_i(r),l=g(5495,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:r.with({scheme:a})},modified:{resource:r},label:l,options:{pinned:!0}}).finally(()=>{bt(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){bt(this.registrationDisposal),this.registrationDisposal=void 0}};QE.ID="workbench.files.action.compareWithClipboard",QE.LABEL=Pe(5493,"Compare Active File with Clipboard"),QE.SCHEME_COUNTER=0;let TVe=QE,cSe=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)}};cSe=D([_(0,dg),_(1,xi),_(2,gi)],cSe);function O5t(s,e,t){s.prompt(Xe.Error,Nr(e,!1),[{label:g(5496,"Retry"),run:()=>t()}])}async function iit(s,e){const t=s.get(vf),i=s.get(Jt),n=s.get(Te),o=s.get(_d),r=s.get(ei),a=s.get(Lm),c=s.get(bi),l=s.get(hg),d=s.get(vi),h=s.get(bf),u=!a.isViewVisible(Bb),f=await a.openView(Bb,!0);if(u&&await Sr(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(xFt)}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 b=new Dce(i,n,o,v,e);v.addChild(b);const w=async C=>{try{const A=Pt(v.resource,C);C.endsWith("/")&&(e=!0),await t.applyBulkEdit([new cp(void 0,A,{folder:e})],{undoLabel:g(5497,"Create {0}",C),progressLabel:g(5498,"Creating {0}",C),confirmBeforeUndo:!0}),await T5t(C,t),e?await t.select(A,!0):await r.openEditor({resource:A,options:{pinned:!0}})}catch(A){O5t(c,A,()=>w(C))}},y=(await l.getEnvironment())?.os??po;await t.setEditable(b,{validationMessage:C=>N5t(h,b,C,y),onFinish:async(C,A)=>{v.removeChild(b),await t.setEditable(b,null),A&&w(C)}})}_t.registerCommand({id:kNe,handler:async s=>{await iit(s,!1)}});_t.registerCommand({id:tit,handler:async s=>{await iit(s,!0)}});const B5t=async s=>{const e=s.get(vf),t=s.get(bi),i=s.get(we),n=e.getContext(!0),o=n.length?n:e.roots,r=i.createInstance(rSe);try{await r.download(o)}catch(a){throw t.error(a),a}};_t.registerCommand({id:D5t,handler:B5t});const W5t=async s=>{const e=s.get(vf),t=s.get(bi),i=s.get(we),n=e.getContext(!1),o=n.length?n[0]:e.roots[0];try{const r=await zdt();r&&await i.createInstance(NZ).upload(o,r)}catch(r){throw t.error(r),r}};_t.registerCommand({id:k5t,handler:W5t});class kce extends li{constructor(e,t,i){super({id:e,title:t,f1:!0,category:ca.File,precondition:c1t}),this.newReadonlyState=i}async run(e){const t=e.get(ei),i=e.get(_d),n=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY});n&&await i.updateReadonly(n,this.newReadonlyState)}}const gO=class gO extends kce{constructor(){super(gO.ID,gO.LABEL,!0)}};gO.ID="workbench.action.files.setActiveEditorReadonlyInSession",gO.LABEL=Pe(5514,"Set Active Editor Read-only in Session");let LVe=gO;const fO=class fO extends kce{constructor(){super(fO.ID,fO.LABEL,!1)}};fO.ID="workbench.action.files.setActiveEditorWriteableInSession",fO.LABEL=Pe(5515,"Set Active Editor Writeable in Session");let RVe=fO;const pO=class pO extends kce{constructor(){super(pO.ID,pO.LABEL,"toggle")}};pO.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",pO.LABEL=Pe(5516,"Toggle Active Editor Read-only in Session");let MVe=pO;const mO=class mO extends kce{constructor(){super(mO.ID,mO.LABEL,"reset")}};mO.ID="workbench.action.files.resetActiveEditorReadonlyInSession",mO.LABEL=Pe(5517,"Reset Active Editor Read-only in Session");let NVe=mO;class INe extends V{constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in si)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.",su(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))};si.addEventListener("storage",e),this._register(Ee(()=>si.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let PVe=class{constructor(e,t,i,n,o,r,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=n,this.workspaceEditingService=o,this.hostService=r,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,n,o){const r=await this.instantiationService.invokeFunction(l=>oZe(l,e));if(!r.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Fi(r.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===pe.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Fi(r.filter(l=>l.isExternal&&l.resource?.scheme===pe.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}),n?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async n=>{if(mae(n)){t.push({workspaceUri:n});return}try{const o=await this.fileService.stat(n);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):Py(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};PVe=D([_(1,Jt),_(2,xI),_(3,ei),_(4,iC),_(5,xc),_(6,yi),_(7,we)],PVe);function nit(s,e,t,i){if(e.length===0||!t.dataTransfer)return;const n=s.get(Fo),o=s.get(ei),r=s.get(Jt),a=s.get(Fs),c=Fi(e.map(f=>N.isUri(f)?{resource:f}:xve(f)?N.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>r.hasProvider(f));{const f=Qn?`\r +`)}}class fNe{constructor(){this.star=[],this.epsilon=[],this.map=new Map,this.hasItems=!1}add(e,t){if(this.hasItems=!0,e==="*")this.star.push(new lVe(t));else if(e==="")this.epsilon.push(new lVe(t));else{const i=e[e.length-1],n=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 fNe),o.add(n,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 n=e[e.length-1],o=e.slice(0,e.length-1),r=this.map.get(n);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 hw;(function(s){s.capture="capture",s.basename="basename",s.dirname="dirname",s.extname="extname"})(hw||(hw={}));const cVe=/\$[({](capture|basename|dirname|extname)[)}]/g;class lVe{constructor(e){this.tokens=[],cVe.lastIndex=0;let t,i=0;for(;t=cVe.exec(e);){const n=e.slice(i,t.index);this.tokens.push(n);const o=t[1];switch(o){case hw.basename:case hw.dirname:case hw.extname:case hw.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 n=e.slice(i,e.length);this.tokens.push(n)}}substitute(e,t){return this.tokens.map(i=>{if(typeof i=="string")return i;switch(i.capture){case hw.basename:return e.basename;case hw.dirname:return e.dirname;case hw.extname:return e.extname;case hw.capture:return t||""}}).join("")}}class zd{constructor(e,t,i,n,o,r,a,c,l,d=SA(e),h,u=!1){this.resource=e,this.fileService=t,this.configService=i,this.filesConfigService=n,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,n,o,r){const a=new zd(n.resource,e,t,i,o,n.isDirectory,n.isSymbolicLink,n.readonly,n.locked,n.name,n.mtime,!n.isFile&&!n.isDirectory);if(a.isDirectory&&(a._isDirectoryResolved=!!n.children||!!r&&r.some(c=>$y(c,a.resource)),n.children))for(let c=0,l=n.children.length;c{n.set(o.resource,o)}),t.children.clear(),e.children.forEach(o=>{const r=n.get(o.resource);r?(zd.mergeLocalWithDisk(o,r),t.addChild(r),n.delete(o.resource)):t.addChild(o)}),n.forEach(o=>{o instanceof Sce&&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 n=e===OCe.Modified;this.error=void 0;try{const o=await this.fileService.resolve(this.resource,{resolveSingleChildDescendants:!0,resolveMetadata:n}),r=zd.create(this.fileService,this.configService,this.filesConfigService,o,this);zd.mergeLocalWithDisk(r,this)}catch(o){throw this.error=o,o}this._isDirectoryResolved=!0}const i=[];if(t.enabled){const n=[],o=[];for(const a of this.children.entries())a[1].nestedParent=void 0,a[1].isDirectory?o.push(a):n.push(a);const r=this.fileNester.nest(n.map(([a])=>a),this.getPlatformAwareName(this.name));for(const[a,c]of n){const l=r.get(a);if(l!==void 0){c.nestedChildren=[];for(const d of l.keys()){const h=qn(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(n=>{i.push(n)});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,n])=>[this.getPlatformAwareName(i.trim()),n.split(",").map(o=>this.getPlatformAwareName(o.trim().replace(/\u200b/g,"").trim())).filter(o=>o!=="")]);this.root._fileNester=new g5t(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,Vn.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=Pt(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,Vn.PathCaseSensitive);return e&&this.resource.scheme===e.scheme&&ua(this.resource.authority,e.authority)&&(t?P7(e.path,this.resource.path):e.path.startsWith(this.resource.path))?this.findByPath(Hy(e.path,Vi.sep),this.resource.path.length,t):null}findByPath(e,t,i){if(ult(Hy(this.resource.path,Vi.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:Pb,delay:500},()=>n),n}toTransfer(e){if(Edt(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:n=>n(i)})});return t}async doUpload(e,t,i,n){const o=t.items,r=[];for(const h of o)r.push(h.webkitGetAsEntry());const a=[],c={startTime:Date.now(),progressScheduler:new CGe(h=>{i.report(h[h.length-1])},1e3),filesTotal:r.length,filesUploaded:0,totalBytesUploaded:0},l=new spe(MQ.MAX_PARALLEL_UPLOADS);await Zs.settled(r.map(h=>l.queue(async()=>{if(n.isCancellationRequested)return;if(e&&h.name&&e.getChild(h.name)){const{confirmed:f}=await this.dialogService.confirm(pNe(h.name));if(!f||(await this.explorerService.applyBulkEdit([new op(Pt(e.resource,h.name),void 0,{recursive:!0,folder:e.getChild(h.name)?.isDirectory})],{undoLabel:g(10020,"Overwrite {0}",h.name),progressLabel:g(10021,"Overwriting {0}",h.name)}),n.isCancellationRequested))return}const u=await this.doUploadEntry(h,e.resource,e,i,c,n);u&&a.push(u)}))),c.progressScheduler.dispose();const d=a[0];!n.isCancellationRequested&&d?.isFile&&await this.editorService.openEditor({resource:d.resource,options:{pinned:!0}})}async doUploadEntry(e,t,i,n,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>Nc.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 b=await new Promise((w,y)=>d.readEntries(w,y));b.length>0?h.push(...b):u=!0}while(!u&&!r.isCancellationRequested);o.filesTotal+=h.length;const f=i&&i.getChild(e.name)||void 0,p=[],m=[];for(const b of h)b.isFile?p.push(b):b.isDirectory&&m.push(b);const v=new spe(MQ.MAX_PARALLEL_UPLOADS);await Zs.settled(p.map(b=>v.queue(()=>this.doUploadEntry(b,l,f,n,o,r))));for(const b of m)await this.doUploadEntry(b,l,f,n,o,r);return{isFile:!1,resource:l}}}async doUploadFileBuffered(e,t,i,n){const o=tKe({highWaterMark:10}),r=this.fileService.writeFile(e,o);try{const a=t.stream().getReader();let c=await a.read();for(;!c.done&&!n.isCancellationRequested;){const l=$e.wrap(c.value);if(await o.write(l),n.isCancellationRequested)break;i(t.size,l.byteLength),c=await a.read()}o.end(void 0)}catch(a){o.error(a),o.end()}n.isCancellationRequested||await r}doUploadFileUnbuffered(e,t,i){return new Promise((n,o)=>{const r=new FileReader;r.onload=async a=>{try{if(a.target?.result instanceof ArrayBuffer){const c=$e.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.");n()}catch(c){o(c)}},r.readAsArrayBuffer(t)})}},MQ=mR,mR.MAX_PARALLEL_UPLOADS=20,mR);RZ=MQ=D([_(0,og),_(1,to),_(2,pf),_(3,ei),_(4,Jt)],RZ);let ZCe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this.fileService=e,this.hostService=t,this.contextService=i,this.configurationService=n,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 n=new ci,o=this.progressService.withProgress({location:dd.Window,delay:800,cancellable:!0,title:g(10024,"Copying...")},async()=>await this.doImport(e,t,i,n.token),()=>n.dispose(!0));return this.progressService.withProgress({location:Pb,delay:500},()=>o),o}async doImport(e,t,i,n){const o=Fi((await this.instantiationService.invokeFunction(l=>JXe(l,t))).map(l=>l.resource));await Promise.all(o.map(l=>this.fileService.activateProvider(l.scheme)));const r=Fi(o.filter(l=>this.fileService.hasProvider(l))),a=await this.fileService.resolveAll(r.map(l=>({resource:l})));if(n.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(10025,"&&Copy Folders"):g(10026,"&&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(10027,"&&Add Folders to Workspace"):g(10028,"&&Add Folder to Workspace"),run:()=>l.Add}),h=c.length>1?g(10029,"Do you want to copy the folders or add the folders to the workspace?"):g(10030,"Do you want to copy '{0}' or add '{0}' as a folder to the workspace?",_i(c[0].uri))):h=c.length>1?g(10031,"Are you sure to want to copy folders?"):g(10032,"Are you sure to want to copy '{0}'?",_i(c[0].uri));const{result:f}=await this.dialogService.prompt({type:Xe.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,n)}else if(e instanceof zd)return this.importResources(e,r,n)}async importResources(e,t,i){if(t&&t.length>0){const n=await this.fileService.resolve(e.resource);if(i.isCancellationRequested)return;const o=new Set,r=this.fileService.hasCapability(e.resource,Vn.PathCaseSensitive);n.children&&n.children.forEach(u=>{o.add(r?u.name:u.name.toLowerCase())});let a=0;const c=Fi(await Zs.settled(t.map(async u=>{if(!await this.fileService.exists(u)){a++;return}if(!(o.has(r?_i(u):_i(u).toLowerCase())&&!(await this.dialogService.confirm(pNe(_i(u)))).confirmed))return u})));a>0&&this.notificationService.error(a>1?g(10033,"Some or all of the dropped files could not be accessed for import."):g(10034,"The dropped file could not be accessed for import."));const l=c.map(u=>{const f=_i(u),p=Pt(e.resource,f);return new op(u,p,{overwrite:!0,copy:!0})}),d=this.configurationService.getValue().explorer.confirmUndo;if(await this.explorerService.applyBulkEdit(l,{undoLabel:c.length===1?g(10035,"Import {0}",_i(c[0])):g(10036,"Import {0} resources",c.length),progressLabel:c.length===1?g(10037,"Copying {0}",_i(c[0])):g(10038,"Copying {0} resources",c.length),progressLocation:dd.Window,confirmBeforeUndo:d===kT.Verbose||d===kT.Default}),this.configurationService.getValue().explorer.autoOpenDroppedFile&&l.length===1){const u=this.explorerService.findClosest(l[0].newResource);u&&!u.isDirectory&&this.editorService.openEditor({resource:u.resource,options:{pinned:!0}})}}}};ZCe=D([_(0,Jt),_(1,xc),_(2,yi),_(3,Te),_(4,to),_(5,Zy),_(6,pf),_(7,ei),_(8,og),_(9,bi),_(10,we)],ZCe);var _R;let eSe=(_R=class{constructor(e,t,i,n,o,r){this.fileService=e,this.explorerService=t,this.progressService=i,this.logService=n,this.fileDialogService=o,this.storageService=r}download(e){const t=new ci,i=this.progressService.withProgress({location:dd.Window,delay:800,cancellable:Wn,title:g(10039,"Downloading")},async n=>this.doDownload(e,n,t),()=>t.dispose(!0));return this.progressService.withProgress({location:Pb,delay:500},()=>i),i}async doDownload(e,t,i){for(const n of e){if(i.token.isCancellationRequested)return;Wn?await this.doDownloadBrowser(n.resource,t,i):await this.doDownloadNative(n,t,i)}}async doDownloadBrowser(e,t,i){const n=await this.fileService.resolve(e,{resolveMetadata:!0});if(i.token.isCancellationRequested)return;const o=32*Nc.MB,r=n.isDirectory||n.size>o,a=Ey();if(r&&qp.supported(a))try{const c=await a.showDirectoryPicker(),l={startTime:Date.now(),progressScheduler:new CGe(d=>{t.report(d[d.length-1])},1e3),filesTotal:n.isDirectory?0:1,filesDownloaded:0,totalBytesDownloaded:0,fileBytesDownloaded:0};if(n.isDirectory){const d=await c.getDirectoryHandle(n.name,{create:!0});await this.downloadFolderBrowser(n,d,l,i.token)}else await this.downloadFileBrowser(c,n,l,i.token);l.progressScheduler.dispose()}catch(c){this.logService.warn(c),i.cancel()}else if(n.isFile){let c;try{c=(await this.fileService.readFile(n.resource,{limits:{size:o}},i.token)).value.buffer}catch{c=Jg.uriToBrowserUri(n.resource)}i.token.isCancellationRequested||Ldt(c,n.name)}}async downloadFileBufferedBrowser(e,t,i,n){const o=await this.fileService.readFileStream(e,void 0,n);if(n.isCancellationRequested){t.close();return}return new Promise((r,a)=>{const c=o.value,l=new Z;l.add(Ee(()=>t.close())),l.add(cm(n.onCancellationRequested)(()=>{l.dispose(),a(Sy())})),AN(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()}},n)})}async downloadFileUnbufferedBrowser(e,t,i,n){const o=await this.fileService.readFile(e,void 0,n);n.isCancellationRequested||(t.write(o.value.buffer),this.reportProgress(o.name,o.size,o.value.byteLength,i)),t.close()}async downloadFileBrowser(e,t,i,n){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>Nc.MB?this.downloadFileBufferedBrowser(t.resource,r,i,n):this.downloadFileUnbufferedBrowser(t.resource,r,i,n)}async downloadFolderBrowser(e,t,i,n){if(e.children){i.filesTotal+=e.children.map(o=>o.isFile).length;for(const o of e.children){if(n.isCancellationRequested)return;if(o.isFile)await this.downloadFileBrowser(t,o,i,n);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,n)}}}}reportProgress(e,t,i,n){n.fileBytesDownloaded+=i,n.totalBytesDownloaded+=i;const o=n.totalBytesDownloaded/((Date.now()-n.startTime)/1e3);let r;t1?{message:g(10049,"The following {0} files and/or folders already exist in the destination folder. Do you want to replace them?",s.length),detail:Ott(s)+` +`+g(10047,"This action is irreversible!"),primaryButton:g(10048,"&&Replace"),type:"warning"}:pNe(_i(s[0]))}const mNe="explorer.newFile";Fe(5429,"New File...");const qtt="explorer.newFolder";Fe(5430,"New Folder...");g(5431,"Rename...");g(5432,"Delete");g(5433,"Copy");g(5434,"Paste");const p5t=new Y("fileCopied",!1),m5t="explorer.download";g(5435,"Download...");const _5t="explorer.upload";g(5436,"Upload...");function v5t(s,e){e.message==="string"&&(e=e.message),s.error(Nr(e,!1))}async function b5t(s,e){s&&(s.indexOf("/")>=0||s.indexOf("\\")>=0)&&await e.refresh()}async function w5t(s,e,t,i,n,o){let r=typeof n.resource=="string"?n.resource:SA(n.resource),a=Pt(i.resource,r);if(!(o==="disabled"&&!await C5t(e,t,a))){for(;!n.allowOverwrite&&s.findClosest(a);)o!=="disabled"&&(r=y5t(r,!!n.isDirectory,o)),a=Pt(i.resource,r);return a}}function y5t(s,e,t){if(t==="simple"){let h=s,u="";e||(u=Vy(s),h=Ko(s,u));const f=/^(.+ copy)( \d+)?$/;return f.test(h)?h.replace(f,(p,m,v)=>{const b=v?parseInt(v):1;return b===0?`${m}`:b{const m=parseInt(f);return m{const m=parseInt(u);return m{const p=parseInt(u);return p=0)return`${s.substr(0,c)}.1${s.substr(c)}`;const l=RegExp("(\\d+)$");if(!e&&c===-1&&s.match(l))return s.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){v5t(this.notificationService,t)}}};tSe=D([_(2,vi),_(3,bi),_(4,Im)],tSe);const xoe=class xoe extends tSe{get class(){return"explorer-action "+We.asClassName(ve.saveAll)}doRun(e){return this.commandService.executeCommand(zZe,{},e)}};xoe.ID="workbench.files.action.saveAllInGroup",xoe.LABEL=g(5477,"Save All in Group");let uVe=xoe;var vR;let gVe=(vR=class extends rn{constructor(e,t,i){super(e,t,We.asClassName(ve.closeAll)),this.commandService=i}run(e){return this.commandService.executeCommand(u5t,{},e)}},vR.ID="workbench.files.action.closeGroup",vR.LABEL=g(5478,"Close Group"),vR);gVe=D([_(2,vi)],gVe);const oO=class oO extends li{constructor(){super({id:oO.ID,title:oO.LABEL,f1:!0,category:ca.File,metadata:{description:Fe(5480,"Moves focus to the file explorer view container.")}})}async run(e){await e.get(Dm).openPaneComposite(TVt,ir.Sidebar,!0)}};oO.ID="workbench.files.action.focusFilesExplorer",oO.LABEL=Fe(5479,"Focus on Files Explorer");let fVe=oO;const rO=class rO extends li{constructor(){super({id:rO.ID,title:rO.LABEL,f1:!0,category:ca.File,metadata:{description:Fe(5482,"Reveals and selects the active file within the explorer view.")}})}async run(e){const t=e.get(vi),i=e.get(ei),n=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY});n&&t.executeCommand(cFt,n)}};rO.ID="workbench.files.action.showActiveFileInExplorer",rO.LABEL=Fe(5481,"Reveal Active File in Explorer View");let pVe=rO;const aO=class aO extends li{constructor(){super({id:aO.ID,title:aO.LABEL,f1:!0,category:ca.File,precondition:XYe,metadata:{description:Fe(5484,"Opens the active file in a new window with no folders open.")}})}async run(e){const t=e.get(ei),i=e.get(xc),n=e.get(to),o=e.get(Jt),r=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY});r&&(o.hasProvider(r)?i.openWindow([{fileUri:r}],{forceNewWindow:!0}):n.error(g(5485,"The active editor must contain an openable resource.")))}};aO.ID="workbench.action.files.showOpenedFileInNewWindow",aO.LABEL=Fe(5483,"Open Active File in New Empty Workspace");let mVe=aO;function S5t(s,e,t,i){if(t=E5t(t),!t||t.length===0||/^\s+$/.test(t))return{content:g(5486,"A file or folder name must be provided."),severity:Xe.Error};if(t[0]==="/"||t[0]==="\\")return{content:g(5487,"A file or folder name cannot start with a slash."),severity:Xe.Error};const n=Fi(t.split(/[\\/]/)),o=e.parent;if(t!==e.name){const r=o?.getChild(t);if(r&&r!==e)return{content:g(5488,"A file or folder **{0}** already exists at this location. Please choose a different name.",t),severity:Xe.Error}}if(n.some(r=>!s.hasValidBasename(e.resource,i,r))){const r=t.replace(/\*/g,"\\*");return{content:g(5489,"The name **{0}** is not valid as a file or folder name. Please choose a different name.",A5t(r)),severity:Xe.Error}}return n.some(r=>/^\s|\s$/.test(r))?{content:g(5490,"Leading or trailing whitespace detected in file or folder name."),severity:Xe.Warning}:null}function A5t(s){return s?.length>255?`${s.substr(0,255)}...`:s}function E5t(s){return s&&(s=B1e(s," "),s=Hy(s,"/"),s=Hy(s,"\\"),s)}const cO=class cO extends li{constructor(){super({id:cO.ID,title:cO.LABEL,f1:!0,category:ca.File,metadata:{description:Fe(5492,"Opens a new diff editor with two untitled files.")}})}async run(e){await e.get(ei).openEditor({original:{resource:void 0},modified:{resource:void 0},options:{pinned:!0}})}};cO.ID="workbench.files.action.compareNewUntitledTextFiles",cO.LABEL=Fe(5491,"Compare New Untitled Text Files");let _Ve=cO;const GE=class GE extends li{constructor(){super({id:GE.ID,title:GE.LABEL,f1:!0,category:ca.File,keybinding:{primary:rr(U.CtrlCmd|S.KeyK,S.KeyC),weight:Ae.WorkbenchContrib},metadata:{description:Fe(5494,"Opens a new diff editor to compare the active file with the contents of the clipboard.")}})}async run(e){const t=e.get(ei),i=e.get(we),n=e.get(fn),o=e.get(Jt),r=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY}),a=`clipboardCompare${GE.SCHEME_COUNTER++}`;if(r&&(o.hasProvider(r)||r.scheme===pe.untitled)){if(!this.registrationDisposal){const d=i.createInstance(iSe);this.registrationDisposal=n.registerTextModelContentProvider(a,d)}const c=_i(r),l=g(5495,"Clipboard ↔ {0}",c);await t.openEditor({original:{resource:r.with({scheme:a})},modified:{resource:r},label:l,options:{pinned:!0}}).finally(()=>{bt(this.registrationDisposal),this.registrationDisposal=void 0})}}dispose(){bt(this.registrationDisposal),this.registrationDisposal=void 0}};GE.ID="workbench.files.action.compareWithClipboard",GE.LABEL=Fe(5493,"Compare Active File with Clipboard"),GE.SCHEME_COUNTER=0;let vVe=GE,iSe=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)}};iSe=D([_(0,ag),_(1,xi),_(2,gi)],iSe);function x5t(s,e,t){s.prompt(Xe.Error,Nr(e,!1),[{label:g(5496,"Retry"),run:()=>t()}])}async function Qtt(s,e){const t=s.get(pf),i=s.get(Jt),n=s.get(Te),o=s.get(pd),r=s.get(ei),a=s.get(km),c=s.get(bi),l=s.get(cg),d=s.get(vi),h=s.get(mf),u=!a.isViewVisible(Pb),f=await a.openView(Pb,!0);if(u&&await Sr(500),!f){if(e)throw new Error("Open a folder or workspace first.");return d.executeCommand(pFt)}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 b=new Sce(i,n,o,v,e);v.addChild(b);const w=async C=>{try{const A=Pt(v.resource,C);C.endsWith("/")&&(e=!0),await t.applyBulkEdit([new op(void 0,A,{folder:e})],{undoLabel:g(5497,"Create {0}",C),progressLabel:g(5498,"Creating {0}",C),confirmBeforeUndo:!0}),await b5t(C,t),e?await t.select(A,!0):await r.openEditor({resource:A,options:{pinned:!0}})}catch(A){x5t(c,A,()=>w(C))}},y=(await l.getEnvironment())?.os??po;await t.setEditable(b,{validationMessage:C=>S5t(h,b,C,y),onFinish:async(C,A)=>{v.removeChild(b),await t.setEditable(b,null),A&&w(C)}})}_t.registerCommand({id:mNe,handler:async s=>{await Qtt(s,!1)}});_t.registerCommand({id:qtt,handler:async s=>{await Qtt(s,!0)}});const D5t=async s=>{const e=s.get(pf),t=s.get(bi),i=s.get(we),n=e.getContext(!0),o=n.length?n:e.roots,r=i.createInstance(eSe);try{await r.download(o)}catch(a){throw t.error(a),a}};_t.registerCommand({id:m5t,handler:D5t});const k5t=async s=>{const e=s.get(pf),t=s.get(bi),i=s.get(we),n=e.getContext(!1),o=n.length?n[0]:e.roots[0];try{const r=await Rdt();r&&await i.createInstance(RZ).upload(o,r)}catch(r){throw t.error(r),r}};_t.registerCommand({id:_5t,handler:k5t});class Ace extends li{constructor(e,t,i){super({id:e,title:t,f1:!0,category:ca.File,precondition:J0t}),this.newReadonlyState=i}async run(e){const t=e.get(ei),i=e.get(pd),n=Na.getOriginalUri(t.activeEditor,{supportSideBySide:Hs.PRIMARY});n&&await i.updateReadonly(n,this.newReadonlyState)}}const lO=class lO extends Ace{constructor(){super(lO.ID,lO.LABEL,!0)}};lO.ID="workbench.action.files.setActiveEditorReadonlyInSession",lO.LABEL=Fe(5514,"Set Active Editor Read-only in Session");let bVe=lO;const dO=class dO extends Ace{constructor(){super(dO.ID,dO.LABEL,!1)}};dO.ID="workbench.action.files.setActiveEditorWriteableInSession",dO.LABEL=Fe(5515,"Set Active Editor Writeable in Session");let wVe=dO;const hO=class hO extends Ace{constructor(){super(hO.ID,hO.LABEL,"toggle")}};hO.ID="workbench.action.files.toggleActiveEditorReadonlyInSession",hO.LABEL=Fe(5516,"Toggle Active Editor Read-only in Session");let yVe=hO;const uO=class uO extends Ace{constructor(){super(uO.ID,uO.LABEL,"reset")}};uO.ID="workbench.action.files.resetActiveEditorReadonlyInSession",uO.LABEL=Fe(5517,"Reset Active Editor Read-only in Session");let CVe=uO;class _Ne extends V{constructor(e){if(super(),this.channelName=e,this._onDidReceiveData=this._register(new I),this.onDidReceiveData=this._onDidReceiveData.event,"BroadcastChannel"in si)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.",nu(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))};si.addEventListener("storage",e),this._register(Ee(()=>si.removeEventListener("storage",e)))}postData(e){this.broadcastChannel?this.broadcastChannel.postMessage(e):(localStorage.removeItem(this.channelName),localStorage.setItem(this.channelName,JSON.stringify(e)))}}let SVe=class{constructor(e,t,i,n,o,r,a,c){this.options=e,this.fileService=t,this.workspacesService=i,this.editorService=n,this.workspaceEditingService=o,this.hostService=r,this.contextService=a,this.instantiationService=c}async handleDrop(e,t,i,n,o){const r=await this.instantiationService.invokeFunction(l=>JXe(l,e));if(!r.length)return;if(await this.hostService.focus(t),this.options.allowWorkspaceOpen){const l=Fi(r.filter(d=>d.allowWorkspaceOpen&&d.resource?.scheme===pe.file).map(d=>d.resource));if(l.length>0&&await this.handleWorkspaceDrop(l))return}const a=Fi(r.filter(l=>l.isExternal&&l.resource?.scheme===pe.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}),n?.(c)}async handleWorkspaceDrop(e){const t=[],i=[];return await Promise.all(e.map(async n=>{if(uae(n)){t.push({workspaceUri:n});return}try{const o=await this.fileService.stat(n);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):Ry(this.contextService.getWorkspace())?await this.workspaceEditingService.addFolders(i):await this.workspaceEditingService.createAndEnterWorkspace(i),!0)}};SVe=D([_(1,Jt),_(2,wI),_(3,ei),_(4,Zy),_(5,xc),_(6,yi),_(7,we)],SVe);function jtt(s,e,t,i){if(e.length===0||!t.dataTransfer)return;const n=s.get(Fo),o=s.get(ei),r=s.get(Jt),a=s.get(Fs),c=Fi(e.map(f=>N.isUri(f)?{resource:f}:wve(f)?N.isUri(f.editor.resource)?{resource:f.editor.resource}:void 0:f)),l=c.filter(({resource:f})=>r.hasProvider(f));{const f=Qn?`\r `:` -`;t.dataTransfer.setData(sp.TEXT,l.map(({resource:m})=>a.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=ef.uriToFileUri(p.resource);m.scheme===pe.file&&t.dataTransfer.setData(sp.DOWNLOAD_URL,[Us.binary,_i(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(sp.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=Qe.as(AMe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(xve(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:Na.getCanonicalUri(m)})}else if(N.isUri(f)){const{selection:m,uri:v}=KLe(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=n.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 b of o.visibleEditorPanes)if(ji(b.input.resource,m)){const w=b.getViewState();if(w)return w}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(PM.EDITORS,eje(u));const f=[];for(const p of u)p.resource?f.push(p.resource):E_(p)?p.modified.resource&&f.push(p.modified.resource):kS(p)?p.primary.resource&&f.push(p.primary.resource):wb(p)&&f.push(p.result.resource);t.dataTransfer.setData(Us.uriList,Zk.create(f.slice(0,1))),t.dataTransfer.setData(sp.INTERNAL_URI_LIST,Zk.create(f))}}class H5t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class A4{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class E4{constructor(e){this.viewId=e}get id(){return this.viewId}}class gS extends V{static get INSTANCE(){return gS.instance||(gS.instance=new gS,A2(gS.instance)),gS.instance}constructor(){super(),this.transferData=fX.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"?E4.prototype:A4.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?E4.prototype:A4.prototype)){const t=this.transferData.getData(e==="view"?E4.prototype:A4.prototype);if(t&&t[0])return new H5t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new E4(e):new A4(e)],t==="view"?E4.prototype:A4.prototype)}registerTarget(e,t){const i=new Z;return i.add(new $j(e,{onDragEnter:n=>{if(n.preventDefault(),t.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");o&&t.onDragEnter({eventData:n,dragAndDropData:o})}},onDragLeave:n=>{const o=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&o&&t.onDragLeave({eventData:n,dragAndDropData:o})},onDrop:n=>{if(t.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDrop({eventData:n,dragAndDropData:o}),this.onDragEnd.fire({eventData:n,dragAndDropData:o})}},onDragOver:n=>{if(n.preventDefault(),t.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDragOver({eventData:n,dragAndDropData:o})}}})),t.onDragStart&&this.onDragStart.event(n=>{t.onDragStart(n)},this,i),t.onDragEnd&&this.onDragEnd.event(n=>{t.onDragEnd(n)},this,i),this._register(i)}registerDraggable(e,t,i){e.draggable=!0;const n=new Z;return n.add(new $j(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,n),i.onDragEnd&&this.onDragEnd.event(o=>{i.onDragEnd(o)},this,n),this._register(n)}}function FVe(s,e,t){s&&(s.dropEffect=t?e:"none")}let OVe=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=Fi(e.map(this.toResource));return t.length===1?_i(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const n of e.elements){const o=this.toResource(n);o&&i.push(o)}i.length&&this.instantiationService.invokeFunction(n=>nit(n,i,t))}onDragOver(e,t,i,n,o){return!1}drop(e,t,i,n,o){}dispose(){}};OVe=D([_(1,we)],OVe);const Loe=class Loe extends V{constructor(){super(),this.broadcaster=this._register(new INe(Loe.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(M.runAndSubscribe(tm,({window:e,disposables:t})=>{t.add(ue(e,ke.DRAG_OVER,()=>this.markDraggedOver(!1),!0)),t.add(ue(e,ke.DRAG_LEAVE,()=>this.clearDraggedOver(!1),!0))},{window:si,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))}};Loe.CHANNEL_NAME="monaco-workbench-global-dragged-over";let lSe=Loe;new lSe;class U5t{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 n=!1,o="";for(let r=0;rthis.gitignoreLineToGlob(r,t)),o=Object.create(null);for(const r of n)o[r]=!0;return j_(o,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const n=e.split(` -`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),o=n.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=n.filter(m=>!m.includes("!")),h=this.gitignoreLinesToExpression(d,t,!0),u=n.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 dSe;(function(s){s.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(dSe||(dSe={}));class V5t{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(n=>{const o=n.create(e,t);return i.add(o),o})}}const hSe=new V5t;Qe.add(dSe.FileContributionRegistry,hSe);var uSe,Cv;const Roe=class Roe{getHeight(e){return Roe.ITEM_HEIGHT}getTemplateId(e){return OZ.ID}};Roe.ITEM_HEIGHT=22;let PZ=Roe;const gSe=new I;let fSe=class{constructor(e,t,i,n,o,r,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=n,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,qs.Visible))}getChildren(e){if(Array.isArray(e))return e;const t=e.error,i=this.explorerService.sortOrderConfiguration.sortOrder,n=e.fetchChildren(i);if(Array.isArray(n))return n;const o=n.then(r=>(e instanceof Gd&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==qi.FOLDER&&gSe.fire(e.resource),r),r=>{if(e instanceof Gd&&e.isRoot)if(this.contextService.getWorkbenchState()===qi.FOLDER){const a=new Gd(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=r,[a]}else gSe.fire(e.resource);else this.notificationService.error(r);return[]});return this.progressService.withProgress({location:ud.Explorer,delay:this.layoutService.isRestored()?800:1500},r=>o),o}};fSe=D([_(1,cg),_(2,Te),_(3,bi),_(4,kI),_(5,Jt),_(6,vf),_(7,yi),_(8,_d)],fSe);const dFe=class dFe{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,n,o){this.id=e,this.items=t,this.depth=n,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(11260,"Files Explorer")}get templateId(){return uSe.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 n=hSe.create(this.instantiationService,e,t);t.add(hSe.onDidRegisterDescriptor(r=>{const a=r.create(this.instantiationService,e);n.push(t.add(a)),a.setResource(o.currentContext?.resource)}));const o={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:n};return o}renderElement(e,t,i){const n=e.element;i.currentContext=n;const o=this.explorerService.getEditableData(n);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,n,o))):(i.label.element.style.display="flex",this.renderStat(n,n.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,n){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_${FZ.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(o,l,c,e.filterData,i);const d=new FZ(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(ue(i.container,"mousedown",u=>{const f=BZ(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,n,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?ba.ROOT_FOLDER:e.isDirectory?ba.FOLDER:ba.FILE,extraClasses:d?[...r,"align-nest-icon-with-parent-icon"]:r,fileDecorations:this.config.explorer.decorations,matches:xU(n),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const n=this.labels.create(e),o=["explorer-item","explorer-item-edited"],r=t.isRoot?ba.ROOT_FOLDER:t.isDirectory?ba.FOLDER:ba.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?Lr(t.resource):t.resource,u=t.name||"";n.setFile(Pt(h,u||" "),d),n.element.firstElementChild.style.display="none";const f=new eYe(n.element,this.contextViewService,{validationOptions:{validation:y=>{const C=i.validationMessage(y);return!C||C.severity!==Xe.Error?null:{content:C.content,formatContent:!0,type:Xl.ERROR}}},ariaLabel:g(11261,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:EM}),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=hm((y,C)=>{n.element.style.display="none";const A=f.value;bt(w),n.element.remove(),C&&i.onFinish(A,y)}),b=()=>{if(f.isInputValid()){const y=i.validationMessage(f.value);y?f.showMessage({content:y.content,formatContent:!0,type:y.severity===Xe.Info?Xl.INFO:y.severity===Xe.Warning?Xl.WARNING:Xl.ERROR}):f.hideMessage()}};b();const w=[f,f.onDidChange(y=>{n.setFile(Pt(h,y||" "),d)}),Ro(f.inputElement,ke.KEY_DOWN,y=>{if(y.equals(S.F2)){const C=f.value.lastIndexOf(".");if(t.isDirectory||C===-1)return;m==="prefix"?(m="all",f.select({start:0,end:f.value.length})):m==="all"?(m="suffix",f.select({start:C+1,end:f.value.length})):(m="prefix",f.select({start:0,end:C}))}else y.equals(S.Enter)?f.validate()||v(!0,!0):y.equals(S.Escape)&&v(!1,!0)}),Ro(f.inputElement,ke.KEY_UP,y=>{b()}),ue(f.inputElement,ke.BLUR,async()=>{for(;;){await Sr(0);const y=f.inputElement.ownerDocument;if(!y.hasFocus())break;if(av(f.inputElement))return;if(Yr(y.activeElement)&&pq(y.activeElement,"context-view"))await M.toPromise(this.contextMenuService.onDidHideContextMenu);else break}v(f.isInputValid(),!0)}),n];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()===qi.WORKSPACE&&(t=t+1),t}getActiveDescendantId(e){return this.compressedNavigationControllers.get(e)?.[0]?.currentId??void 0}dispose(){this.configListener.dispose()}},uSe=SR,SR.ID="file",SR);OZ=uSe=D([_(3,mf),_(4,pn),_(5,Te),_(6,vf),_(7,Fs),_(8,yi),_(9,lr),_(10,we)],OZ);let pSe=class{constructor(e,t,i,n,o,r){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=n,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,To.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,To.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(Lr(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 n=this.configurationService.getValue({resource:i.uri}),o=n?.files?.exclude||Object.create(null),r=n.explorer.excludeGitIgnore;if(r&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new Dk),this.ignoreTreesPerRoot.set(i.uri.toString(),Dh.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||!Ys(c.original,o)}const a=xs(o);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:j_(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const n=Lr(t),o=this.ignoreTreesPerRoot.get(e);if(!o||!i&&o.has(n))return;const r=await this.fileService.readFile(t);if(i)o.get(n)?.updateContents(r.value.toString());else{const a=o.findSubstr(n),c=new U5t(r.value.toString(),n.path,a);o.set(n,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===qs.Hidden)return e.isExcluded=!0,!1;if(this.explorerService.getEditableData(e))return!0;const n=this.hiddenExpressionPerRoot.get(e.root.resource.toString())?.parsed(k2(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),r=(n?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((r===void 0?!1:!r)||n||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(){bt(this.toDispose)}};pSe=D([_(0,yi),_(1,Te),_(2,vf),_(3,ei),_(4,ks),_(5,Jt)],pSe);let mSe=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,n=this.explorerService.sortOrderConfiguration.lexicographicOptions;let o,r;switch(n){case"upper":o=GDt,r=jDt;break;case"lower":o=KDt,r=YDt;break;case"unicode":o=qDt,r=JDt;break;default:o=$Dt,r=QDt}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,n,o){if(!this.dropEnabled)return!1;if(t){const r=Cv.getCompressedStatFromDragEvent(t,o);if(r){const a=BZ(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,n,o)}handleDragOver(e,t,i,n,o){const r=o&&(o.ctrlKey&&!Qt||o.altKey&&Qt),a=e instanceof t_e,l={type:a||r?T1.Copy:T1.Move,position:by.Over};if(a){if(!rZe(o,sp.FILES,PM.FILES,sp.RESOURCES))return!1}else{if(e instanceof yje)return!1;{const d=Cv.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:T1.Move,position:by.After}}:{accept:!0,bubble:M1.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(Lr(u.resource),t.resource)||this.uriIdentityService.extUri.isEqualOrParent(t.resource,u.resource))))return!1;if(h){if(!t.isRoot)return!1;let u;switch(n){case IC.TOP:case IC.CENTER_TOP:u=by.Before;break;case IC.CENTER_BOTTOM:case IC.BOTTOM:u=by.After;break}return{accept:!0,effect:{type:T1.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:M1.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:M1.Up,effect:l}}else return{accept:!0,bubble:M1.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?Cv.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=Cv.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(o=>nit(o,i,t));const n=i.filter(o=>o.resource.scheme===pe.file).map(o=>o.resource.fsPath);n.length&&t.dataTransfer.setData(PM.FILES,JSON.stringify(n))}}async drop(e,t,i,n,o){if(this.compressedDropTargetDisposable.dispose(),t){const a=Cv.getCompressedStatFromDragEvent(t,o);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],n=IC.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const r=t;if(r)try{e instanceof t_e?!Wn||Py(this.contextService.getWorkspace())&&Yp.supported(si)?await this.instantiationService.createInstance(oSe).import(r,o,si):await this.instantiationService.createInstance(NZ).upload(t,o):await this.handleExplorerDrop(e,r,i,n,o)}catch(a){this.dialogService.error(Nr(a))}}async handleExplorerDrop(e,t,i,n,o){const r=Cv.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=Ilt([...a.keys()],u=>u.resource),l=o.ctrlKey&&!Qt||o.altKey&&Qt;if(!l&&this.configurationService.getValue(Cv.CONFIRM_DND_SETTING_KEY)){const u=c.length>1&&c.every(m=>m.isRoot)?g(11262,"Are you sure you want to change the order of multiple root folders in your workspace?"):c.length>1?g(11263,"Are you sure you want to move the following {0} files into '{1}'?",c.length,t.name):c[0].isRoot?g(11264,"Are you sure you want to change the order of root folder '{0}' in your workspace?",c[0].name):g(11265,"Are you sure you want to move '{0}' into '{1}'?",c[0].name,t.name),f=c.length>1&&!c.every(m=>m.isRoot)?Gtt(c.map(m=>m.resource)):void 0,p=await this.dialogService.confirm({message:u,detail:f,checkbox:{label:g(11266,"Do not ask me again")},primaryButton:g(11267,"&&Move")});if(!p.confirmed)return;p.checkboxChecked===!0&&await this.configurationService.updateValue(Cv.CONFIRM_DND_SETTING_KEY,!1)}await this.doHandleRootDrop(c.filter(u=>u.isRoot),t,n);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 n=this.contextService.getWorkspace().folders;let o;const r=[],a=[],c=[];for(let l=0;lh.resource.toString()!==n[l].uri.toString())?a.push(d):c.push(d)}if(o===void 0)o=a.length;else{switch(i){case IC.BOTTOM:case IC.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 cp(r.resource,Pt(t.resource,r.name))),n=BVe(e),o={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===RT.Verbose,undoLabel:g(11270,"Move {0}",n),progressLabel:g(11271,"Moving {0}",n)};try{await this.explorerService.applyBulkEdit(i,o)}catch(r){if(r.fileOperationResult===Qi.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=E5t(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new cp(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=[Cv.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=ct(t).document.elementFromPoint(t.clientX,t.clientY),n=BZ(i);if(n){const{count:o,index:r}=n;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()}},Cv=AR,AR.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",AR);_Se=Cv=D([_(1,vf),_(2,ei),_(3,to),_(4,yi),_(5,Jt),_(6,Te),_(7,we),_(8,iC),_(9,ks)],_Se);function BZ(s){if(!Yr(s))return null;let e=s;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(lc(t)&&lc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function z5t(s){return!!BZ(s)}class $5t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof Dce||!e.parent||e.parent.isRoot}}function BVe(s){return s.length===1?s[0].name:s.every(e=>e.isDirectory)?g(11272,"{0} folders",s.length):s.every(e=>!e.isDirectory)?g(11273,"{0} files",s.length):`${s.length} files and folders`}function G5t(s){if(s.isRoot&&s.error)return{tooltip:g(11256,"Unable to resolve workspace folder ({0})",Nr(s.error)),letter:"!",color:gpt};if(s.isSymbolicLink)return{tooltip:g(11257,"Symbolic Link"),letter:"⤷"};if(s.isUnknown)return{tooltip:g(11258,"Unknown File Type"),letter:"?"};if(s.isExcluded)return{color:vpt}}let vSe=class{constructor(e,t){this.explorerService=e,this.label=g(11259,"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(n=>n.uri))})),this.toDispose.add(gSe.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 G5t(t)}dispose(){this.toDispose.dispose()}};vSe=D([_(0,vf),_(1,yi)],vSe);var K5t=".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}";ut(K5t,{});var q5t=".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}";ut(q5t,{});const Jz=class Jz extends V{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?Jz.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"?fi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(9986,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===fi.HORIZONTAL?200:120,this._maximumBodySize=typeof e.maximumBodySize=="number"?e.maximumBodySize:Number.POSITIVE_INFINITY,this.element=fe(".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"&&ct(this.element).clearTimeout(this.animationTimer),re(this.element,this.body)):this.animationTimer=ct(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===fi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===fi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===fi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===fi.VERTICAL),this.header=fe(".pane-header"),re(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=Ac(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 ii(this.header,"keydown")),n=M.map(i.event,o=>new En(o),t);this._register(M.filter(n,o=>o.keyCode===S.Enter||o.keyCode===S.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(M.filter(n,o=>o.keyCode===S.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(M.filter(n,o=>o.keyCode===S.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(fd.addTarget(this.header)),[ke.CLICK,uo.Tap].forEach(o=>{this._register(ue(this.header,o,r=>{r.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=re(this.element,fe(".pane-body")),!this._bodyRendered&&this.isExpanded()&&(this.renderBody(this.body),this._bodyRendered=!0),this.isExpanded()||this.body.remove()}layout(e){const t=this.headerVisible?Jz.HEADER_SIZE:0,i=this._orientation===fi.VERTICAL?this.orthogonalSize:e,n=this._orientation===fi.VERTICAL?e-t:this.orthogonalSize-t;this.isExpanded()&&(this.body.classList.toggle("wide",i>=600),this.layoutBody(n,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===fi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===fi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};Jz.HEADER_SIZE=22;let bSe=Jz;const Moe=class Moe extends V{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(ue(e.draggableElement,"dragstart",n=>this.onDragStart(n))),this._register(ue(e.dropTargetElement,"dragenter",n=>this.onDragEnter(n))),this._register(ue(e.dropTargetElement,"dragleave",n=>this.onDragLeave(n))),this._register(ue(e.dropTargetElement,"dragend",n=>this.onDragEnd(n))),this._register(ue(e.dropTargetElement,"drop",n=>this.onDrop(n)))}onDragStart(e){if(!this.dnd.canDrag(this.pane)||!e.dataTransfer){e.preventDefault(),e.stopPropagation();return}e.dataTransfer.effectAllowed="move",rf&&e.dataTransfer?.setData(sp.TEXT,this.pane.draggableElement.textContent||"");const t=re(this.pane.element.ownerDocument.body,fe(".monaco-drag-image",{},this.pane.draggableElement.textContent||""));e.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>t.remove(),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&&(en.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??Moe.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Moe.DefaultDragOverBackgroundColor=new me(new dn(128,128,128,.5));let wSe=Moe;class Q5t extends V{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??fi.VERTICAL,this.element=re(e,fe(".monaco-pane-view")),this.splitview=this._register(new C3(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),n=this._register(new ii(this.element,"keydown")),o=M.map(M.filter(n.event,r=>Yr(r.target)&&r.target.classList.contains("pane-header"),i),r=>new En(r),i);this._register(M.filter(o,r=>r.keyCode===S.UpArrow,i)(()=>this.focusPrevious())),this._register(M.filter(o,r=>r.keyCode===S.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const n=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,n);const o={pane:e,disposable:n};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 wSe(e,this.dnd,this.dndContext);n.add(r),n.add(r.onDidDrop(this._onDidDrop.fire,this._onDidDrop))}}removePane(e){const t=this.paneItems.findIndex(n=>n.pane===e);if(t===-1)return;this.splitview.removeView(t,e.isExpanded()?Kk.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(r=>r.pane===e),n=this.paneItems.findIndex(r=>r.pane===t);if(i===-1||n===-1)return;const[o]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,o),this.splitview.moveView(i,n)}resizePane(e,t){const i=this.paneItems.findIndex(n=>n.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===fi.VERTICAL?t:e,this.size=this.orientation===fi.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===fi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===fi.VERTICAL?fi.HORIZONTAL:fi.VERTICAL;const i=this.paneItems.map(r=>this.getPaneSize(r.pane));this.splitview.dispose(),Ms(this.element),this.splitview=this._register(new C3(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const n=this.orientation===fi.VERTICAL?t:e,o=this.orientation===fi.HORIZONTAL?t:e;this.paneItems.forEach((r,a)=>{r.pane.orthogonalSize=n,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=n,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&&ct(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=ct(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 qc;(function(s){let e;(function(n){n[n.None=0]="None",n[n.Done=1]="Done",n[n.Infinite=2]="Infinite",n[n.While=3]="While",n[n.Work=4]="Work"})(e=s.Type||(s.Type={})),s.None={type:e.None},s.Done={type:e.Done},s.Infinite={type:e.Infinite};class t{constructor(o,r,a){this.whilePromise=o,this.whileStart=r,this.whileDelay=a,this.type=e.While}}s.While=t;class i{constructor(o,r){this.total=o,this.worked=r,this.type=e.Work}}s.Work=i})(qc||(qc={}));class j5t extends V{constructor(e,t){super(),this.progressBar=e,this.scope=t,this.progressState=qc.None,this.registerListeners()}registerListeners(){this._register(this.scope.onDidChangeActive(()=>{this.scope.isActive?this.onDidScopeActivate():this.onDidScopeDeactivate()}))}onDidScopeActivate(){if(this.progressState.type!==qc.Done.type)if(this.progressState.type===qc.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===qc.Type.Infinite?this.progressBar.infinite().show():this.progressState.type===qc.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=qc.Infinite:this.progressState=new qc.Work(e,void 0),this.scope.isActive&&(this.progressState.type===qc.Type.Infinite?this.progressBar.infinite().show(t):this.progressState.type===qc.Type.Work&&typeof this.progressState.total=="number"&&this.progressBar.total(this.progressState.total).show(t)),{total:i=>{this.progressState=new qc.Work(i,this.progressState.type===qc.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 qc.Work(this.progressState.type===qc.Type.Work?this.progressState.total:void 0,this.progressState.type===qc.Type.Work&&typeof this.progressState.worked=="number"?this.progressState.worked+i:i),this.scope.isActive&&this.progressBar.worked(i)):(this.progressState=qc.Infinite,this.progressBar.infinite().show())},done:()=>{this.progressState=qc.Done,this.scope.isActive&&this.progressBar.stop().hide()}}}async showWhile(e,t){this.progressState.type===qc.Type.While&&(e=Promise.all([e,this.progressState.whilePromise])),this.progressState=new qc.While(e,t||0,Date.now());try{this.doShowWhile(t),await e}catch{}finally{(this.progressState.type!==qc.Type.While||this.progressState.whilePromise===e)&&(this.progressState=qc.None,this.scope.isActive&&this.progressBar.stop().hide())}}doShowWhile(e){this.scope.isActive&&this.progressBar.infinite().show(e)}}class Y5t extends V{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 J5t extends V{get primaryActions(){return this._primaryActions}get secondaryActions(){return this._secondaryActions}constructor(e,t,i,n){super(),this.options=t,this.menuService=i,this.contextKeyService=n,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,n)),this._register(this.menu.onDidChange(()=>this.updateActions())),this.updateActions()}updateActions(){this.disposables.clear(),this._primaryActions=[],this._secondaryActions=[],fC(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 n of e)if(n instanceof Ty&&!t[n.item.submenu.id]){const o=t[n.item.submenu.id]=i.add(this.menuService.createMenu(n.item.submenu,this.contextKeyService));i.add(o.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(n.actions,t))}return i}}let WZ=class extends V{constructor(e,t,i,n,o){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=n,this.menuService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new J5t(e,this.options,o,n)),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.getMenuActions(this.contextMenuId,this.contextKeyService,this.options);fC(t,{primary:[],secondary:e})}return e}};WZ=D([_(3,Le),_(4,Oa)],WZ);const sit=new _e("menu.view.filter"),Ice=new _e("submenu.view.filter");jn.appendMenuItem(sit,{submenu:Ice,title:g(5623,"More Filters..."),group:"navigation",icon:ve.filter});class X5t extends _3{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 ySe=class extends pd{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,n,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 Mh(400),this._register(Ee(()=>this.delayedFilterUpdate.cancel())),e.focusContextKey&&(this.focusContextKey=new Q(e.focusContextKey,!1).bindTo(n)),this.element=fe(".viewpane-filter"),[this.filterInputBox,this.focusTracker]=this.createInput(this.element),this._register(this.filterInputBox),this._register(this.focusTracker);const r=re(this.element,fe(".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(iX,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>zX(this.keybindingService),inputBoxStyles:EM}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(n=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Ro(t.inputElement,ke.KEY_DOWN,n=>this.onInputKeyDown(n,t))),this._register(Ro(e,ke.KEY_DOWN,this.handleKeyboardEvent)),this._register(Ro(e,ke.KEY_UP,this.handleKeyboardEvent)),this._register(Ro(t.inputElement,ke.CLICK,n=>{n.stopPropagation(),n.preventDefault()}));const i=this._register(Ac(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=re(e,fe(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=ze(yT),t.style.color=ze($re),t.style.border=`1px solid ${ze(wt)}`,t}createToolBar(e){return this.instantiationService.createInstance(bm,e,sit,{hiddenItemStrategy:aA.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof Ty&&t.item.submenu.id===Ice.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(X5t,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(S.Space)||e.equals(S.LeftArrow)||e.equals(S.RightArrow)||e.equals(S.Home)||e.equals(S.End))&&e.stopPropagation()}onInputKeyDown(e,t){let i=!1;e.equals(S.Tab)&&!this.toolbar.isEmpty()&&(this.toolbar.focus(),i=!0),i&&(e.stopPropagation(),e.preventDefault())}};ySe=D([_(1,we),_(2,mf),_(3,Le),_(4,Ut)],ySe);var CSe,j5;(function(s){s[s.Default=0]="Default",s[s.WhenExpanded=1]="WhenExpanded",s[s.Always=2]="Always"})(j5||(j5={}));const WVe=new rn("viewpane.action.filter"),Z5t=oi("view-pane-container-expanded",ve.chevronDown,g(5342,"Icon for an expanded view pane container.")),ezt=oi("view-pane-container-collapsed",ve.chevronRight,g(5343,"Icon for a collapsed view pane container.")),HVe=Qe.as(eI.ViewsRegistry);let SSe=class{get enabled(){return this._enabled}constructor(e,t,i,n,o,r,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=n,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(M.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=re(this.container,fe(".welcome-view"));this.element=fe(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new EU(this.element,{alwaysConsumeMouseWheel:!0,horizontal:Co.Hidden,vertical:Co.Visible}),re(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),M.chain(HVe.onDidChangeViewWelcomeContent,i=>i.filter(n=>n===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=HVe.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 n=t.split(` -`);for(let o of n){if(o=o.trim(),!o)continue;const r=qje(o);if(r.nodes.length===1&&typeof r.nodes[0]!="string"){const a=r.nodes[0],c=re(this.element,fe(".button-container")),l=new Jd(c,{title:a.title,supportIcons:!0,...y6});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());M.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}else{const a=re(this.element,fe("p"));for(const c of r.nodes)if(typeof c=="string")re(a,document.createTextNode(c));else{const l=this.renderDisposables.add(this.instantiationService.createInstance(i9,a,c,{}));if(i&&c.href.startsWith("command:")){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());M.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()}};SSe=D([_(2,we),_(3,Ao),_(4,Yi),_(5,Le),_(6,ig)],SSe);var ER;let HZ=(ER=class extends bSe{get title(){return this._title}get titleDescription(){return this._titleDescription}get singleViewPaneContainerTitle(){return this._singleViewPaneContainerTitle}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super({...e,orientation:r.getViewLocationById(e.id)===ir.Panel?fi.HORIZONTAL:fi.VERTICAL}),this.keybindingService=t,this.contextMenuService=i,this.configurationService=n,this.contextKeyService=o,this.viewDescriptorService=r,this.instantiationService=a,this.openerService=c,this.themeService=l,this.telemetryService=d,this.hoverService=h,this.accessibleViewInformationService=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??j5.Default,this.scopedContextKeyService=this._register(o.createScoped(this.element)),this.scopedContextKeyService.createKey("view",this.id);const f=this.scopedContextKeyService.createKey("viewLocation",PX(r.getViewLocationById(this.id)));this._register(M.filter(r.onDidChangeLocation,m=>m.views.some(v=>v.id===this.id))(()=>f.set(PX(r.getViewLocationById(this.id)))));const p=this._register(this.instantiationService.createChild(new Uc([Le,this.scopedContextKeyService])));this.menuActions=this._register(p.createInstance(WZ,e.titleMenuId??_e.ViewTitle,_e.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=Ac(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=re(e,fe(`.twisty-container${We.asCSSSelector(this.getTwistyIcon(this.isExpanded()))}`)),this.renderHeaderTitle(e,this.title);const t=re(e,fe(".actions"));t.classList.toggle("show-always",this.showActions===j5.Always),t.classList.toggle("show-expanded",this.showActions===j5.WhenExpanded),this.toolbar=this.instantiationService.createInstance(lW,t,{orientation:F_.HORIZONTAL,actionViewItemProvider:(o,r)=>this.getActionViewItem(o,r),ariaLabel:g(5344,"{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(ue(t,ke.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 n=M.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration(CSe.AlwaysShowActionsConfig));this._register(n(this.updateActionsVisibility,this)),this.updateActionsVisibility()}updateHeader(){super.updateHeader(),this.updateTwistyIcon()}updateTwistyIcon(){this.twistiesContainer&&(this.twistiesContainer.classList.remove(...We.asClassNameArray(this.getTwistyIcon(!this._expanded))),this.twistiesContainer.classList.add(...We.asClassNameArray(this.getTwistyIcon(this._expanded))))}getTwistyIcon(e){return e?Z5t:ezt}style(e){super.style(e);const t=this.getIcon();if(this.iconContainer){const i=Iy(e.headerForeground,ze(zi));N.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||iOt}renderHeaderTitle(e,t){this.iconContainer=re(e,fe(".icon",void 0));const i=this.getIcon();let n;if(N.isUri(i)){n=`view-${this.id.replace(/[\.\:]/g,"-")}`;const r=`.pane-header .icon.${n}`;Uf(r,` - mask: ${Zu(i)} no-repeat 50% 50%; +`;t.dataTransfer.setData(tp.TEXT,l.map(({resource:m})=>a.getUriLabel(m,{noPrefix:!0})).join(f));const p=l.find(({isDirectory:m})=>!m);if(p){const m=Jg.uriToFileUri(p.resource);m.scheme===pe.file&&t.dataTransfer.setData(tp.DOWNLOAD_URL,[Us.binary,_i(p.resource),m.toString()].join(":"))}}const d=l.filter(({isDirectory:f})=>!f);d.length&&t.dataTransfer.setData(tp.RESOURCES,JSON.stringify(d.map(({resource:f})=>f.toString())));const h=Qe.as(uMe.DragAndDropContribution).getAll();for(const f of h)f.setData(c,t);const u=[];for(const f of e){let p;if(wve(f)){const m=f.editor.toUntyped({preserveViewState:f.groupId});m&&(p={...m,resource:Na.getCanonicalUri(m)})}else if(N.isUri(f)){const{selection:m,uri:v}=NLe(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=n.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 b of o.visibleEditorPanes)if(ji(b.input.resource,m)){const w=b.getViewState();if(w)return w}})()})}}u.push(p)}}if(u.length){t.dataTransfer.setData(LM.EDITORS,KQe(u));const f=[];for(const p of u)p.resource?f.push(p.resource):C_(p)?p.modified.resource&&f.push(p.modified.resource):DS(p)?p.primary.resource&&f.push(p.primary.resource):_b(p)&&f.push(p.result.resource);t.dataTransfer.setData(Us.uriList,Qk.create(f.slice(0,1))),t.dataTransfer.setData(tp.INTERNAL_URI_LIST,Qk.create(f))}}class I5t{constructor(e,t){this.type=e,this.id=t}update(e){}getData(){return{type:this.type,id:this.id}}}class b4{constructor(e){this.compositeId=e}get id(){return this.compositeId}}class w4{constructor(e){this.viewId=e}get id(){return this.viewId}}class uS extends V{static get INSTANCE(){return uS.instance||(uS.instance=new uS,w2(uS.instance)),uS.instance}constructor(){super(),this.transferData=uX.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"?w4.prototype:b4.prototype)}))}readDragData(e){if(this.transferData.hasData(e==="view"?w4.prototype:b4.prototype)){const t=this.transferData.getData(e==="view"?w4.prototype:b4.prototype);if(t&&t[0])return new I5t(e,t[0].id)}}writeDragData(e,t){this.transferData.setData([t==="view"?new w4(e):new b4(e)],t==="view"?w4.prototype:b4.prototype)}registerTarget(e,t){const i=new Z;return i.add(new Vj(e,{onDragEnter:n=>{if(n.preventDefault(),t.onDragEnter){const o=this.readDragData("composite")||this.readDragData("view");o&&t.onDragEnter({eventData:n,dragAndDropData:o})}},onDragLeave:n=>{const o=this.readDragData("composite")||this.readDragData("view");t.onDragLeave&&o&&t.onDragLeave({eventData:n,dragAndDropData:o})},onDrop:n=>{if(t.onDrop){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDrop({eventData:n,dragAndDropData:o}),this.onDragEnd.fire({eventData:n,dragAndDropData:o})}},onDragOver:n=>{if(n.preventDefault(),t.onDragOver){const o=this.readDragData("composite")||this.readDragData("view");if(!o)return;t.onDragOver({eventData:n,dragAndDropData:o})}}})),t.onDragStart&&this.onDragStart.event(n=>{t.onDragStart(n)},this,i),t.onDragEnd&&this.onDragEnd.event(n=>{t.onDragEnd(n)},this,i),this._register(i)}registerDraggable(e,t,i){e.draggable=!0;const n=new Z;return n.add(new Vj(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,n),i.onDragEnd&&this.onDragEnd.event(o=>{i.onDragEnd(o)},this,n),this._register(n)}}function AVe(s,e,t){s&&(s.dropEffect=t?e:"none")}let EVe=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=Fi(e.map(this.toResource));return t.length===1?_i(t[0]):t.length>1?String(t.length):void 0}onDragStart(e,t){const i=[];for(const n of e.elements){const o=this.toResource(n);o&&i.push(o)}i.length&&this.instantiationService.invokeFunction(n=>jtt(n,i,t))}onDragOver(e,t,i,n,o){return!1}drop(e,t,i,n,o){}dispose(){}};EVe=D([_(1,we)],EVe);const Doe=class Doe extends V{constructor(){super(),this.broadcaster=this._register(new _Ne(Doe.CHANNEL_NAME)),this.draggedOver=!1,this.registerListeners()}registerListeners(){this._register(M.runAndSubscribe(Xp,({window:e,disposables:t})=>{t.add(ue(e,ke.DRAG_OVER,()=>this.markDraggedOver(!1),!0)),t.add(ue(e,ke.DRAG_LEAVE,()=>this.clearDraggedOver(!1),!0))},{window:si,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))}};Doe.CHANNEL_NAME="monaco-workbench-global-dragged-over";let nSe=Doe;new nSe;class T5t{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 n=!1,o="";for(let r=0;rthis.gitignoreLineToGlob(r,t)),o=Object.create(null);for(const r of n)o[r]=!0;return K_(o,{trimForExclusions:i})}parseIgnoreFile(e,t,i){const n=e.split(` +`).map(m=>m.trim()).filter(m=>m&&m[0]!=="#"),o=n.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=n.filter(m=>!m.includes("!")),h=this.gitignoreLinesToExpression(d,t,!0),u=n.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 sSe;(function(s){s.FileContributionRegistry="workbench.registry.explorer.fileContributions"})(sSe||(sSe={}));class L5t{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(n=>{const o=n.create(e,t);return i.add(o),o})}}const oSe=new L5t;Qe.add(sSe.FileContributionRegistry,oSe);var rSe,bv;const koe=class koe{getHeight(e){return koe.ITEM_HEIGHT}getTemplateId(e){return PZ.ID}};koe.ITEM_HEIGHT=22;let MZ=koe;const aSe=new I;let cSe=class{constructor(e,t,i,n,o,r,a,c,l){this.fileFilter=e,this.progressService=t,this.configService=i,this.notificationService=n,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,qs.Visible))}getChildren(e){if(Array.isArray(e))return e;const t=e.error,i=this.explorerService.sortOrderConfiguration.sortOrder,n=e.fetchChildren(i);if(Array.isArray(n))return n;const o=n.then(r=>(e instanceof zd&&e.isRoot&&!e.error&&t&&this.contextService.getWorkbenchState()!==qi.FOLDER&&aSe.fire(e.resource),r),r=>{if(e instanceof zd&&e.isRoot)if(this.contextService.getWorkbenchState()===qi.FOLDER){const a=new zd(e.resource,this.fileService,this.configService,this.filesConfigService,void 0,void 0,!1);return a.error=r,[a]}else aSe.fire(e.resource);else this.notificationService.error(r);return[]});return this.progressService.withProgress({location:dd.Explorer,delay:this.layoutService.isRestored()?800:1500},r=>o),o}};cSe=D([_(1,og),_(2,Te),_(3,bi),_(4,CI),_(5,Jt),_(6,pf),_(7,yi),_(8,pd)],cSe);const XPe=class XPe{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,n,o){this.id=e,this.items=t,this.depth=n,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(11260,"Files Explorer")}get templateId(){return rSe.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 n=oSe.create(this.instantiationService,e,t);t.add(oSe.onDidRegisterDescriptor(r=>{const a=r.create(this.instantiationService,e);n.push(t.add(a)),a.setResource(o.currentContext?.resource)}));const o={templateDisposables:t,elementDisposables:t.add(new Z),label:i,container:e,contribs:n};return o}renderElement(e,t,i){const n=e.element;i.currentContext=n;const o=this.explorerService.getEditableData(n);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,n,o))):(i.label.element.style.display="flex",this.renderStat(n,n.name,void 0,e.filterData,i))}renderCompressedElements(e,t,i,n){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_${NZ.ID++}`,l=e.element.elements.map(u=>u.name);this.renderStat(o,l,c,e.filterData,i);const d=new NZ(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(ue(i.container,"mousedown",u=>{const f=FZ(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,n,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?ba.ROOT_FOLDER:e.isDirectory?ba.FOLDER:ba.FILE,extraClasses:d?[...r,"align-nest-icon-with-parent-icon"]:r,fileDecorations:this.config.explorer.decorations,matches:yU(n),separator:this.labelService.getSeparator(e.resource.scheme,e.resource.authority),domId:i})}renderInputBox(e,t,i){const n=this.labels.create(e),o=["explorer-item","explorer-item-edited"],r=t.isRoot?ba.ROOT_FOLDER:t.isDirectory?ba.FOLDER:ba.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?Lr(t.resource):t.resource,u=t.name||"";n.setFile(Pt(h,u||" "),d),n.element.firstElementChild.style.display="none";const f=new Kje(n.element,this.contextViewService,{validationOptions:{validation:y=>{const C=i.validationMessage(y);return!C||C.severity!==Xe.Error?null:{content:C.content,formatContent:!0,type:Yl.ERROR}}},ariaLabel:g(11261,"Type file name. Press Enter to confirm or Escape to cancel."),inputBoxStyles:yM}),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=cm((y,C)=>{n.element.style.display="none";const A=f.value;bt(w),n.element.remove(),C&&i.onFinish(A,y)}),b=()=>{if(f.isInputValid()){const y=i.validationMessage(f.value);y?f.showMessage({content:y.content,formatContent:!0,type:y.severity===Xe.Info?Yl.INFO:y.severity===Xe.Warning?Yl.WARNING:Yl.ERROR}):f.hideMessage()}};b();const w=[f,f.onDidChange(y=>{n.setFile(Pt(h,y||" "),d)}),Ro(f.inputElement,ke.KEY_DOWN,y=>{if(y.equals(S.F2)){const C=f.value.lastIndexOf(".");if(t.isDirectory||C===-1)return;m==="prefix"?(m="all",f.select({start:0,end:f.value.length})):m==="all"?(m="suffix",f.select({start:C+1,end:f.value.length})):(m="prefix",f.select({start:0,end:C}))}else y.equals(S.Enter)?f.validate()||v(!0,!0):y.equals(S.Escape)&&v(!1,!0)}),Ro(f.inputElement,ke.KEY_UP,y=>{b()}),ue(f.inputElement,ke.BLUR,async()=>{for(;;){await Sr(0);const y=f.inputElement.ownerDocument;if(!y.hasFocus())break;if(sv(f.inputElement))return;if(Yr(y.activeElement)&&gq(y.activeElement,"context-view"))await M.toPromise(this.contextMenuService.onDidHideContextMenu);else break}v(f.isInputValid(),!0)}),n];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()===qi.WORKSPACE&&(t=t+1),t}getActiveDescendantId(e){return this.compressedNavigationControllers.get(e)?.[0]?.currentId??void 0}dispose(){this.configListener.dispose()}},rSe=bR,bR.ID="file",bR);PZ=rSe=D([_(3,gf),_(4,pn),_(5,Te),_(6,pf),_(7,Fs),_(8,yi),_(9,lr),_(10,we)],PZ);let lSe=class{constructor(e,t,i,n,o,r){this.contextService=e,this.configurationService=t,this.explorerService=i,this.editorService=n,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,To.UPDATED)&&await this.processIgnoreFile(c,d,!0),a.contains(d,To.DELETED)&&(this.ignoreTreesPerRoot.get(c)?.delete(Lr(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 n=this.configurationService.getValue({resource:i.uri}),o=n?.files?.exclude||Object.create(null),r=n.explorer.excludeGitIgnore;if(r&&!this.ignoreTreesPerRoot.has(i.uri.toString())&&(t=!0,this.ignoreFileResourcesPerRoot.set(i.uri.toString(),new Ck),this.ignoreTreesPerRoot.set(i.uri.toString(),Eh.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||!Ys(c.original,o)}const a=xs(o);this.hiddenExpressionPerRoot.set(i.uri.toString(),{original:a,parsed:K_(a)})}),(e||t)&&(this.editorsAffectingFilter.clear(),this._onDidChange.fire())}async processIgnoreFile(e,t,i){const n=Lr(t),o=this.ignoreTreesPerRoot.get(e);if(!o||!i&&o.has(n))return;const r=await this.fileService.readFile(t);if(i)o.get(n)?.updateContents(r.value.toString());else{const a=o.findSubstr(n),c=new T5t(r.value.toString(),n.path,a);o.set(n,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===qs.Hidden)return e.isExcluded=!0,!1;if(this.explorerService.getEditableData(e))return!0;const n=this.hiddenExpressionPerRoot.get(e.root.resource.toString())?.parsed(A2(e.root.resource.path,e.resource.path),e.name,c=>!!(e.parent&&e.parent.getChild(c))),r=(n?void 0:this.ignoreTreesPerRoot.get(e.root.resource.toString())?.findSubstr(e.resource))?.isPathIncludedInTraversal(e.resource.path,e.isDirectory);if((r===void 0?!1:!r)||n||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(){bt(this.toDispose)}};lSe=D([_(0,yi),_(1,Te),_(2,pf),_(3,ei),_(4,ks),_(5,Jt)],lSe);let dSe=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,n=this.explorerService.sortOrderConfiguration.lexicographicOptions;let o,r;switch(n){case"upper":o=NDt,r=BDt;break;case"lower":o=PDt,r=WDt;break;case"unicode":o=FDt,r=HDt;break;default:o=MDt,r=ODt}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,n,o){if(!this.dropEnabled)return!1;if(t){const r=bv.getCompressedStatFromDragEvent(t,o);if(r){const a=FZ(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,n,o)}handleDragOver(e,t,i,n,o){const r=o&&(o.ctrlKey&&!Qt||o.altKey&&Qt),a=e instanceof jme,l={type:a||r?x1.Copy:x1.Move,position:my.Over};if(a){if(!XXe(o,tp.FILES,LM.FILES,tp.RESOURCES))return!1}else{if(e instanceof gje)return!1;{const d=bv.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:x1.Move,position:my.After}}:{accept:!0,bubble:I1.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(Lr(u.resource),t.resource)||this.uriIdentityService.extUri.isEqualOrParent(t.resource,u.resource))))return!1;if(h){if(!t.isRoot)return!1;let u;switch(n){case kC.TOP:case kC.CENTER_TOP:u=my.Before;break;case kC.CENTER_BOTTOM:case kC.BOTTOM:u=my.After;break}return{accept:!0,effect:{type:x1.Move,position:u}}}}}if(t){if(t.isDirectory)return t.isReadonly?!1:{accept:!0,bubble:I1.Down,effect:l,autoExpand:!0};if(this.contextService.getWorkspace().folders.every(d=>d.uri.toString()!==t.resource.toString()))return{accept:!0,bubble:I1.Up,effect:l}}else return{accept:!0,bubble:I1.Down,effect:l};return!1}getDragURI(e){return this.explorerService.isEditable(e)?null:e.resource.toString()}getDragLabel(e,t){return e.length===1?bv.getCompressedStatFromDragEvent(e[0],t).name:String(e.length)}onDragStart(e,t){const i=bv.getStatsFromDragAndDropData(e,t);if(i&&i.length&&t.dataTransfer){this.instantiationService.invokeFunction(o=>jtt(o,i,t));const n=i.filter(o=>o.resource.scheme===pe.file).map(o=>o.resource.fsPath);n.length&&t.dataTransfer.setData(LM.FILES,JSON.stringify(n))}}async drop(e,t,i,n,o){if(this.compressedDropTargetDisposable.dispose(),t){const a=bv.getCompressedStatFromDragEvent(t,o);a&&(t=a)}if(t||(t=this.explorerService.roots[this.explorerService.roots.length-1],n=kC.BOTTOM),!t.isDirectory&&t.parent&&(t=t.parent),t.isReadonly)return;const r=t;if(r)try{e instanceof jme?!Wn||Ry(this.contextService.getWorkspace())&&qp.supported(si)?await this.instantiationService.createInstance(ZCe).import(r,o,si):await this.instantiationService.createInstance(RZ).upload(t,o):await this.handleExplorerDrop(e,r,i,n,o)}catch(a){this.dialogService.error(Nr(a))}}async handleExplorerDrop(e,t,i,n,o){const r=bv.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=vlt([...a.keys()],u=>u.resource),l=o.ctrlKey&&!Qt||o.altKey&&Qt;if(!l&&this.configurationService.getValue(bv.CONFIRM_DND_SETTING_KEY)){const u=c.length>1&&c.every(m=>m.isRoot)?g(11262,"Are you sure you want to change the order of multiple root folders in your workspace?"):c.length>1?g(11263,"Are you sure you want to move the following {0} files into '{1}'?",c.length,t.name):c[0].isRoot?g(11264,"Are you sure you want to change the order of root folder '{0}' in your workspace?",c[0].name):g(11265,"Are you sure you want to move '{0}' into '{1}'?",c[0].name,t.name),f=c.length>1&&!c.every(m=>m.isRoot)?Ott(c.map(m=>m.resource)):void 0,p=await this.dialogService.confirm({message:u,detail:f,checkbox:{label:g(11266,"Do not ask me again")},primaryButton:g(11267,"&&Move")});if(!p.confirmed)return;p.checkboxChecked===!0&&await this.configurationService.updateValue(bv.CONFIRM_DND_SETTING_KEY,!1)}await this.doHandleRootDrop(c.filter(u=>u.isRoot),t,n);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 n=this.contextService.getWorkspace().folders;let o;const r=[],a=[],c=[];for(let l=0;lh.resource.toString()!==n[l].uri.toString())?a.push(d):c.push(d)}if(o===void 0)o=a.length;else{switch(i){case kC.BOTTOM:case kC.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 op(r.resource,Pt(t.resource,r.name))),n=xVe(e),o={confirmBeforeUndo:this.configurationService.getValue().explorer.confirmUndo===kT.Verbose,undoLabel:g(11270,"Move {0}",n),progressLabel:g(11271,"Moving {0}",n)};try{await this.explorerService.applyBulkEdit(i,o)}catch(r){if(r.fileOperationResult===Qi.FILE_MOVE_CONFLICT){const a=[];for(const d of i)d.newResource&&await this.fileService.exists(d.newResource)&&a.push(d.newResource);const c=f5t(a),{confirmed:l}=await this.dialogService.confirm(c);l&&await this.explorerService.applyBulkEdit(i.map(d=>new op(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=[bv.getCompressedStatFromDragEvent(e.elements[0],t)],e.context):e.elements}static getCompressedStatFromDragEvent(e,t){const i=ct(t).document.elementFromPoint(t.clientX,t.clientY),n=FZ(i);if(n){const{count:o,index:r}=n;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()}},bv=wR,wR.CONFIRM_DND_SETTING_KEY="explorer.confirmDragAndDrop",wR);hSe=bv=D([_(1,pf),_(2,ei),_(3,to),_(4,yi),_(5,Jt),_(6,Te),_(7,we),_(8,Zy),_(9,ks)],hSe);function FZ(s){if(!Yr(s))return null;let e=s;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(lc(t)&&lc(i))return{element:e,count:t,index:i}}e=e.parentElement}return null}function R5t(s){return!!FZ(s)}class M5t{isIncompressible(e){return e.isRoot||!e.isDirectory||e instanceof Sce||!e.parent||e.parent.isRoot}}function xVe(s){return s.length===1?s[0].name:s.every(e=>e.isDirectory)?g(11272,"{0} folders",s.length):s.every(e=>!e.isDirectory)?g(11273,"{0} files",s.length):`${s.length} files and folders`}function N5t(s){if(s.isRoot&&s.error)return{tooltip:g(11256,"Unable to resolve workspace folder ({0})",Nr(s.error)),letter:"!",color:ipt};if(s.isSymbolicLink)return{tooltip:g(11257,"Symbolic Link"),letter:"⤷"};if(s.isUnknown)return{tooltip:g(11258,"Unknown File Type"),letter:"?"};if(s.isExcluded)return{color:apt}}let uSe=class{constructor(e,t){this.explorerService=e,this.label=g(11259,"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(n=>n.uri))})),this.toDispose.add(aSe.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 N5t(t)}dispose(){this.toDispose.dispose()}};uSe=D([_(0,pf),_(1,yi)],uSe);var P5t=".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}";ut(P5t,{});var F5t=".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}";ut(F5t,{});const Qz=class Qz extends V{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?Qz.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"?fi.VERTICAL:e.orientation,this._ariaHeaderLabel=g(9986,"{0} Section",e.title),this._minimumBodySize=typeof e.minimumBodySize=="number"?e.minimumBodySize:this._orientation===fi.HORIZONTAL?200:120,this._maximumBodySize=typeof e.maximumBodySize=="number"?e.maximumBodySize:Number.POSITIVE_INFINITY,this.element=fe(".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"&&ct(this.element).clearTimeout(this.animationTimer),re(this.element,this.body)):this.animationTimer=ct(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===fi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===fi.VERTICAL)),this.header&&this.updateHeader())}render(){this.element.classList.toggle("expanded",this.isExpanded()),this.element.classList.toggle("horizontal",this.orientation===fi.HORIZONTAL),this.element.classList.toggle("vertical",this.orientation===fi.VERTICAL),this.header=fe(".pane-header"),re(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=Ac(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 ii(this.header,"keydown")),n=M.map(i.event,o=>new En(o),t);this._register(M.filter(n,o=>o.keyCode===S.Enter||o.keyCode===S.Space,t)(()=>this.setExpanded(!this.isExpanded()),null)),this._register(M.filter(n,o=>o.keyCode===S.LeftArrow,t)(()=>this.setExpanded(!1),null)),this._register(M.filter(n,o=>o.keyCode===S.RightArrow,t)(()=>this.setExpanded(!0),null)),this._register(ud.addTarget(this.header)),[ke.CLICK,uo.Tap].forEach(o=>{this._register(ue(this.header,o,r=>{r.defaultPrevented||this.setExpanded(!this.isExpanded())}))}),this.body=re(this.element,fe(".pane-body")),!this._bodyRendered&&this.isExpanded()&&(this.renderBody(this.body),this._bodyRendered=!0),this.isExpanded()||this.body.remove()}layout(e){const t=this.headerVisible?Qz.HEADER_SIZE:0,i=this._orientation===fi.VERTICAL?this.orthogonalSize:e,n=this._orientation===fi.VERTICAL?e-t:this.orthogonalSize-t;this.isExpanded()&&(this.body.classList.toggle("wide",i>=600),this.layoutBody(n,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===fi.VERTICAL?`1px solid ${this.styles.headerBorder}`:"",this.element.style.borderLeft=this.styles.leftBorder&&this.orientation===fi.HORIZONTAL?`1px solid ${this.styles.leftBorder}`:""}};Qz.HEADER_SIZE=22;let gSe=Qz;const Ioe=class Ioe extends V{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(ue(e.draggableElement,"dragstart",n=>this.onDragStart(n))),this._register(ue(e.dropTargetElement,"dragenter",n=>this.onDragEnter(n))),this._register(ue(e.dropTargetElement,"dragleave",n=>this.onDragLeave(n))),this._register(ue(e.dropTargetElement,"dragend",n=>this.onDragEnd(n))),this._register(ue(e.dropTargetElement,"drop",n=>this.onDrop(n)))}onDragStart(e){if(!this.dnd.canDrag(this.pane)||!e.dataTransfer){e.preventDefault(),e.stopPropagation();return}e.dataTransfer.effectAllowed="move",nf&&e.dataTransfer?.setData(tp.TEXT,this.pane.draggableElement.textContent||"");const t=re(this.pane.element.ownerDocument.body,fe(".monaco-drag-image",{},this.pane.draggableElement.textContent||""));e.dataTransfer.setDragImage(t,-10,-10),setTimeout(()=>t.remove(),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&&(en.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??Ioe.DefaultDragOverBackgroundColor.toString()),this.pane.dropTargetElement.style.backgroundColor=e||""}};Ioe.DefaultDragOverBackgroundColor=new me(new dn(128,128,128,.5));let fSe=Ioe;class O5t extends V{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??fi.VERTICAL,this.element=re(e,fe(".monaco-pane-view")),this.splitview=this._register(new b3(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),n=this._register(new ii(this.element,"keydown")),o=M.map(M.filter(n.event,r=>Yr(r.target)&&r.target.classList.contains("pane-header"),i),r=>new En(r),i);this._register(M.filter(o,r=>r.keyCode===S.UpArrow,i)(()=>this.focusPrevious())),this._register(M.filter(o,r=>r.keyCode===S.DownArrow,i)(()=>this.focusNext()))}addPane(e,t,i=this.splitview.length){const n=new Z;e.onDidChangeExpansionState(this.setupAnimation,this,n);const o={pane:e,disposable:n};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 fSe(e,this.dnd,this.dndContext);n.add(r),n.add(r.onDidDrop(this._onDidDrop.fire,this._onDidDrop))}}removePane(e){const t=this.paneItems.findIndex(n=>n.pane===e);if(t===-1)return;this.splitview.removeView(t,e.isExpanded()?Uk.Distribute:void 0),this.paneItems.splice(t,1)[0].disposable.dispose()}movePane(e,t){const i=this.paneItems.findIndex(r=>r.pane===e),n=this.paneItems.findIndex(r=>r.pane===t);if(i===-1||n===-1)return;const[o]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,o),this.splitview.moveView(i,n)}resizePane(e,t){const i=this.paneItems.findIndex(n=>n.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===fi.VERTICAL?t:e,this.size=this.orientation===fi.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===fi.VERTICAL?(this.splitview.orthogonalStartSash=e?.left,this.splitview.orthogonalEndSash=e?.right):this.splitview.orthogonalEndSash=e?.bottom}flipOrientation(e,t){this.orientation=this.orientation===fi.VERTICAL?fi.HORIZONTAL:fi.VERTICAL;const i=this.paneItems.map(r=>this.getPaneSize(r.pane));this.splitview.dispose(),Ms(this.element),this.splitview=this._register(new b3(this.element,{orientation:this.orientation})),this.updateSplitviewOrthogonalSashes(this.boundarySashes);const n=this.orientation===fi.VERTICAL?t:e,o=this.orientation===fi.HORIZONTAL?t:e;this.paneItems.forEach((r,a)=>{r.pane.orthogonalSize=n,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=n,this.splitview.layout(this.size)}setupAnimation(){typeof this.animationTimer=="number"&&ct(this.element).clearTimeout(this.animationTimer),this.element.classList.add("animated"),this.animationTimer=ct(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 Kc;(function(s){let e;(function(n){n[n.None=0]="None",n[n.Done=1]="Done",n[n.Infinite=2]="Infinite",n[n.While=3]="While",n[n.Work=4]="Work"})(e=s.Type||(s.Type={})),s.None={type:e.None},s.Done={type:e.Done},s.Infinite={type:e.Infinite};class t{constructor(o,r,a){this.whilePromise=o,this.whileStart=r,this.whileDelay=a,this.type=e.While}}s.While=t;class i{constructor(o,r){this.total=o,this.worked=r,this.type=e.Work}}s.Work=i})(Kc||(Kc={}));class B5t extends V{constructor(e,t){super(),this.progressBar=e,this.scope=t,this.progressState=Kc.None,this.registerListeners()}registerListeners(){this._register(this.scope.onDidChangeActive(()=>{this.scope.isActive?this.onDidScopeActivate():this.onDidScopeDeactivate()}))}onDidScopeActivate(){if(this.progressState.type!==Kc.Done.type)if(this.progressState.type===Kc.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===Kc.Type.Infinite?this.progressBar.infinite().show():this.progressState.type===Kc.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=Kc.Infinite:this.progressState=new Kc.Work(e,void 0),this.scope.isActive&&(this.progressState.type===Kc.Type.Infinite?this.progressBar.infinite().show(t):this.progressState.type===Kc.Type.Work&&typeof this.progressState.total=="number"&&this.progressBar.total(this.progressState.total).show(t)),{total:i=>{this.progressState=new Kc.Work(i,this.progressState.type===Kc.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 Kc.Work(this.progressState.type===Kc.Type.Work?this.progressState.total:void 0,this.progressState.type===Kc.Type.Work&&typeof this.progressState.worked=="number"?this.progressState.worked+i:i),this.scope.isActive&&this.progressBar.worked(i)):(this.progressState=Kc.Infinite,this.progressBar.infinite().show())},done:()=>{this.progressState=Kc.Done,this.scope.isActive&&this.progressBar.stop().hide()}}}async showWhile(e,t){this.progressState.type===Kc.Type.While&&(e=Promise.all([e,this.progressState.whilePromise])),this.progressState=new Kc.While(e,t||0,Date.now());try{this.doShowWhile(t),await e}catch{}finally{(this.progressState.type!==Kc.Type.While||this.progressState.whilePromise===e)&&(this.progressState=Kc.None,this.scope.isActive&&this.progressBar.stop().hide())}}doShowWhile(e){this.scope.isActive&&this.progressBar.infinite().show(e)}}class W5t extends V{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 H5t extends V{get primaryActions(){return this._primaryActions}get secondaryActions(){return this._secondaryActions}constructor(e,t,i,n){super(),this.options=t,this.menuService=i,this.contextKeyService=n,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,n)),this._register(this.menu.onDidChange(()=>this.updateActions())),this.updateActions()}updateActions(){this.disposables.clear(),this._primaryActions=[],this._secondaryActions=[],dC(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 n of e)if(n instanceof Dy&&!t[n.item.submenu.id]){const o=t[n.item.submenu.id]=i.add(this.menuService.createMenu(n.item.submenu,this.contextKeyService));i.add(o.onDidChange(()=>this.updateActions())),i.add(this.updateSubmenus(n.actions,t))}return i}}let OZ=class extends V{constructor(e,t,i,n,o){super(),this.menuId=e,this.contextMenuId=t,this.options=i,this.contextKeyService=n,this.menuService=o,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.menuActions=this._register(new H5t(e,this.options,o,n)),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.getMenuActions(this.contextMenuId,this.contextKeyService,this.options);dC(t,{primary:[],secondary:e})}return e}};OZ=D([_(3,Le),_(4,Oa)],OZ);const Ytt=new _e("menu.view.filter"),Ece=new _e("submenu.view.filter");jn.appendMenuItem(Ytt,{submenu:Ece,title:g(5623,"More Filters..."),group:"navigation",icon:ve.filter});class U5t extends f3{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 pSe=class extends gd{get onDidFocus(){return this.focusTracker.onDidFocus}get onDidBlur(){return this.focusTracker.onDidBlur}constructor(e,t,i,n,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 Lh(400),this._register(Ee(()=>this.delayedFilterUpdate.cancel())),e.focusContextKey&&(this.focusContextKey=new Y(e.focusContextKey,!1).bindTo(n)),this.element=fe(".viewpane-filter"),[this.filterInputBox,this.focusTracker]=this.createInput(this.element),this._register(this.filterInputBox),this._register(this.focusTracker);const r=re(this.element,fe(".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(eX,e,this.contextViewService,{placeholder:this.options.placeholder,ariaLabel:this.options.ariaLabel,history:this.options.history||[],showHistoryHint:()=>UX(this.keybindingService),inputBoxStyles:yM}));this.options.text&&(t.value=this.options.text),this._register(t.onDidChange(n=>this.delayedFilterUpdate.trigger(()=>this.onDidInputChange(t)))),this._register(Ro(t.inputElement,ke.KEY_DOWN,n=>this.onInputKeyDown(n,t))),this._register(Ro(e,ke.KEY_DOWN,this.handleKeyboardEvent)),this._register(Ro(e,ke.KEY_UP,this.handleKeyboardEvent)),this._register(Ro(t.inputElement,ke.CLICK,n=>{n.stopPropagation(),n.preventDefault()}));const i=this._register(Ac(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=re(e,fe(".viewpane-filter-badge.hidden"));return t.style.backgroundColor=ze(_T),t.style.color=ze(Hre),t.style.border=`1px solid ${ze(wt)}`,t}createToolBar(e){return this.instantiationService.createInstance(mm,e,Ytt,{hiddenItemStrategy:rA.NoHide,actionViewItemProvider:(t,i)=>{if(t instanceof Dy&&t.item.submenu.id===Ece.id)return this.moreFiltersActionViewItem=this.instantiationService.createInstance(U5t,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(S.Space)||e.equals(S.LeftArrow)||e.equals(S.RightArrow)||e.equals(S.Home)||e.equals(S.End))&&e.stopPropagation()}onInputKeyDown(e,t){let i=!1;e.equals(S.Tab)&&!this.toolbar.isEmpty()&&(this.toolbar.focus(),i=!0),i&&(e.stopPropagation(),e.preventDefault())}};pSe=D([_(1,we),_(2,gf),_(3,Le),_(4,Ut)],pSe);var mSe,K5;(function(s){s[s.Default=0]="Default",s[s.WhenExpanded=1]="WhenExpanded",s[s.Always=2]="Always"})(K5||(K5={}));const DVe=new rn("viewpane.action.filter"),V5t=oi("view-pane-container-expanded",ve.chevronDown,g(5342,"Icon for an expanded view pane container.")),z5t=oi("view-pane-container-collapsed",ve.chevronRight,g(5343,"Icon for a collapsed view pane container.")),kVe=Qe.as(jk.ViewsRegistry);let _Se=class{get enabled(){return this._enabled}constructor(e,t,i,n,o,r,a){this.container=e,this.delegate=t,this.instantiationService=i,this.openerService=n,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(M.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=re(this.container,fe(".welcome-view"));this.element=fe(".welcome-view-content",{tabIndex:0}),this.scrollableElement=new wU(this.element,{alwaysConsumeMouseWheel:!0,horizontal:Co.Hidden,vertical:Co.Visible}),re(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),M.chain(kVe.onDidChangeViewWelcomeContent,i=>i.filter(n=>n===this.delegate.id))(this.onDidChangeViewWelcomeContent,this,this.enabledDisposables),this.onDidChangeViewWelcomeContent()}onDidChangeViewWelcomeContent(){const e=kVe.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 n=t.split(` +`);for(let o of n){if(o=o.trim(),!o)continue;const r=Wje(o);if(r.nodes.length===1&&typeof r.nodes[0]!="string"){const a=r.nodes[0],c=re(this.element,fe(".button-container")),l=new jd(c,{title:a.title,supportIcons:!0,..._6});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());M.filter(this.contextKeyService.onDidChangeContext,f=>f.affectsSome(h))(d,null,this.renderDisposables)}}else{const a=re(this.element,fe("p"));for(const c of r.nodes)if(typeof c=="string")re(a,document.createTextNode(c));else{const l=this.renderDisposables.add(this.instantiationService.createInstance(Z3,a,c,{}));if(i&&c.href.startsWith("command:")){const d=()=>l.enabled=this.contextKeyService.contextMatchesRules(i);d();const h=new Set(i.keys());M.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()}};_Se=D([_(2,we),_(3,Ao),_(4,Yi),_(5,Le),_(6,Zu)],_Se);var yR;let BZ=(yR=class extends gSe{get title(){return this._title}get titleDescription(){return this._titleDescription}get singleViewPaneContainerTitle(){return this._singleViewPaneContainerTitle}constructor(e,t,i,n,o,r,a,c,l,d,h,u){super({...e,orientation:r.getViewLocationById(e.id)===ir.Panel?fi.HORIZONTAL:fi.VERTICAL}),this.keybindingService=t,this.contextMenuService=i,this.configurationService=n,this.contextKeyService=o,this.viewDescriptorService=r,this.instantiationService=a,this.openerService=c,this.themeService=l,this.telemetryService=d,this.hoverService=h,this.accessibleViewInformationService=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??K5.Default,this.scopedContextKeyService=this._register(o.createScoped(this.element)),this.scopedContextKeyService.createKey("view",this.id);const f=this.scopedContextKeyService.createKey("viewLocation",MX(r.getViewLocationById(this.id)));this._register(M.filter(r.onDidChangeLocation,m=>m.views.some(v=>v.id===this.id))(()=>f.set(MX(r.getViewLocationById(this.id)))));const p=this._register(this.instantiationService.createChild(new Uc([Le,this.scopedContextKeyService])));this.menuActions=this._register(p.createInstance(OZ,e.titleMenuId??_e.ViewTitle,_e.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=Ac(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=re(e,fe(`.twisty-container${We.asCSSSelector(this.getTwistyIcon(this.isExpanded()))}`)),this.renderHeaderTitle(e,this.title);const t=re(e,fe(".actions"));t.classList.toggle("show-always",this.showActions===K5.Always),t.classList.toggle("show-expanded",this.showActions===K5.WhenExpanded),this.toolbar=this.instantiationService.createInstance(oW,t,{orientation:M_.HORIZONTAL,actionViewItemProvider:(o,r)=>this.getActionViewItem(o,r),ariaLabel:g(5344,"{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(ue(t,ke.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 n=M.filter(this.configurationService.onDidChangeConfiguration,o=>o.affectsConfiguration(mSe.AlwaysShowActionsConfig));this._register(n(this.updateActionsVisibility,this)),this.updateActionsVisibility()}updateHeader(){super.updateHeader(),this.updateTwistyIcon()}updateTwistyIcon(){this.twistiesContainer&&(this.twistiesContainer.classList.remove(...We.asClassNameArray(this.getTwistyIcon(!this._expanded))),this.twistiesContainer.classList.add(...We.asClassNameArray(this.getTwistyIcon(this._expanded))))}getTwistyIcon(e){return e?V5t:z5t}style(e){super.style(e);const t=this.getIcon();if(this.iconContainer){const i=xy(e.headerForeground,ze(zi));N.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||GFt}renderHeaderTitle(e,t){this.iconContainer=re(e,fe(".icon",void 0));const i=this.getIcon();let n;if(N.isUri(i)){n=`view-${this.id.replace(/[\.\:]/g,"-")}`;const r=`.pane-header .icon.${n}`;Bf(r,` + mask: ${Yu(i)} no-repeat 50% 50%; mask-size: 24px; - -webkit-mask: ${Zu(i)} no-repeat 50% 50%; + -webkit-mask: ${Yu(i)} no-repeat 50% 50%; -webkit-mask-size: 16px; - `)}else We.isThemeIcon(i)&&(n=We.asClassName(i));n&&this.iconContainer.classList.add(...n.split(" "));const o=this.calculateTitle(t);this.titleContainer=re(e,fe("h3.title",{},o)),this.titleContainerHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.titleContainer,o)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.iconContainer,o)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(o))}_getAriaLabel(e){const t=this.viewDescriptorService.getViewDescriptorById(this.id)?.accessibilityHelpContent,i=this.accessibleViewInformationService?.hasShownAccessibleView(this.id);return!t||i?e:g(5345,"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=QGe(this.titleContainer,fe("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupManagedHover(Pr("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),n=this.viewDescriptorService.getViewDescriptorById(this.id);return!(this.viewDescriptorService.getDefaultContainerById(this.id)===t)&&n?.containerTitle&&i.title!==n.containerTitle?`${n.containerTitle}: ${e}`:e}renderBody(e){this.viewWelcomeController=this._register(this.instantiationService.createInstance(SSe,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new nJ(this.element,Hje)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new j5t(qn(this.progressBar),new class extends Y5t{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 tzt(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(WVe),this.toolbar.setActions(G2e(e),G2e(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===WVe.id){const i=this;return new class extends zf{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(n){n.classList.add("viewpane-filter-container");const o=i.getFilterWidget();re(n,o.element),o.relayout()}}}return WN(this.instantiationService,e,{...t,menuAsChild:e instanceof Ty})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},CSe=ER,ER.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",ER);HZ=CSe=D([_(1,Ut),_(2,lr),_(3,Te),_(4,Le),_(5,xm),_(6,we),_(7,Ao),_(8,pn),_(9,Yi),_(10,ec)],HZ);let ASe=class extends HZ{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(e,t,i,n,o,r,a,c,l,d,h,u);const f=this._register(a.createChild(new Uc([Le,this.scopedContextKeyService])));this.filterWidget=this._register(f.createInstance(ySe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=re(e,fe(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new bn(t,e);const i=!this.filterContainer?.hasChildNodes(),n=this.shouldShowFilterInHeader();i!==n&&(n&&aa(this.filterContainer),this.updateActions(),n||re(this.filterContainer,this.filterWidget.element)),n||(e=e-44),this.filterWidget.layout(t),this.layoutBodyContent(e,t)}shouldShowFilterInHeader(){return!(this.dimension&&this.dimension.width<600&&this.dimension.height>100)}};ASe=D([_(1,Ut),_(2,lr),_(3,Te),_(4,Le),_(5,xm),_(6,we),_(7,Ao),_(8,pn),_(9,Yi),_(10,ec)],ASe);function tzt(s){let e,t,i,n;switch(s){case ir.Panel:e=bJe,t=fTt,i=pTt,n=mTt;break;case ir.Sidebar:case ir.AuxiliaryBar:default:e=qRe,t=STt,i=ATt,n=ETt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:n}}}class oG extends li{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(Lm).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}var OQ;function izt(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t)){for(const[,i]of t.children.entries())if(s.hasNode(i)&&s.isCollapsible(i)&&!s.isCollapsed(i))return!0}return!1}function nzt(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t))return!0;return!1}const szt={getId:s=>s instanceof Dce?`new:${s.getId()}`:s.getId()};function ozt(s,e,t,i){let n;n=s.length?s[0]:void 0,t&&e.length>1&&(n=void 0);const o=n&&i.getCompressedNavigationController(n),r=o&&o.length?o[0]:void 0;n=r?r.current:n;const a=[];for(const c of e){const l=i.getCompressedNavigationController(c),d=l&&l.length?l[0]:void 0;if(d&&n&&d===r){c===n&&a.push(c);continue}d?a.push(...d.items):a.push(c)}return n?t&&a.indexOf(n)>=0?a:[n]:t?a:[]}var xR;let GW=(xR=class extends HZ{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P){super(e,d,t,u,h,i,n,P,m,v,b),this.contextService=o,this.progressService=r,this.editorService=a,this.editorResolverService=c,this.layoutService=l,this.decorationService=f,this.labelService=p,this.explorerService=w,this.storageService=y,this.clipboardService=C,this.fileService=A,this.uriIdentityService=L,this.commandService=k,this._autoReveal=!1,this.delegate=e.delegate,this.resourceContext=n.createInstance(M3),this._register(this.resourceContext),this.folderContext=VVt.bindTo(h),this.readonlyContext=Wtt.bindTo(h),this.availableEditorIdsContext=zVt.bindTo(h),this.rootContext=$Vt.bindTo(h),this.resourceMoveableToTrash=KVt.bindTo(h),this.compressedFocusContext=qVt.bindTo(h),this.compressedFocusFirstContext=QVt.bindTo(h),this.compressedFocusLastContext=jVt.bindTo(h),this.viewHasSomeCollapsibleRootItem=YVt.bindTo(h),this.viewVisibleContextKey=ANe.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 x5t.bindTo(this.contextKeyService)}get resourceCutContextKey(){return GVt.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new fAt(e,()=>this.setExpanded(!0));const t=e.querySelector(".title"),i=()=>{t.textContent=this.name,this.updateTitle(this.name),this.ariaHeaderLabel=g(10057,"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=re(e,fe(".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(ue(ct(this.container),ke.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()===oW.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return lTe(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===oW.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return ozt(t,this.tree.getSelection(),e,this.renderer)}isItemVisible(e){return this.filter?this.filter.filter(e,qs.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=Na.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:Hs.PRIMARY});if(t){const i=this.tree.getFocus(),n=this.tree.getSelection();return i.length===1&&this.uriIdentityService.extUri.isEqual(i[0].resource,t)&&n.length===1&&this.uriIdentityService.extUri.isEqual(n[0].resource,t)?void 0:this.explorerService.select(t,e)}}}createTree(e){this.filter=this.instantiationService.createInstance(pSe),this._register(this.filter),this._register(this.filter.onDidChange(()=>this.refresh(!0)));const t=this.instantiationService.createInstance(UA,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(OZ,e,t,i),this._register(this.renderer),this._register(TNe(e,this.themeService));const n=()=>this.configurationService.getValue("explorer.compactFolders"),o=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(hJ,"FileExplorer",e,new PZ,new $5t,[this.renderer],this.instantiationService.createInstance(fSe,this.filter),{compressionEnabled:n(),accessibilityProvider:this.renderer,identityProvider:szt,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(mSe),dnd:this.instantiationService.createInstance(_Se,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof Gd&&a.hasNests&&o(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof Gd){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:PZ.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const r=M.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(r(a=>this.tree.updateOptions({compressionEnabled:n()}))),Utt.bindTo(this.tree.contextKeyService),Vtt.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(!(d_(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:v3.USER}},a.sideBySide?ev:hA)}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(kNe)})),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(OQ.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),Ie.WORKSPACE,an.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 n=i?this.editorResolverService.getEditors(i).map(o=>o.id):[];this.availableEditorIdsContext.set(n.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(nA(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Yr(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(d_(e.browserEvent)||z5t(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 n=this.tree.getSelection(),o=this.explorerService.roots;let r;if(t instanceof Gd){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:_e.ExplorerContext,menuActionOptions:{arg:r,shouldForwardArgs:!0},contextKeyService:this.tree.contextKeyService,getAnchor:()=>i,onHide:a=>{a&&this.tree.domFocus()},getActionsContext:()=>t&&n&&n.indexOf(t)>=0?n.map(a=>a.resource):t instanceof Gd?[t.resource]:[]})}onFocusChanged(e){const t=e&&e.length?e[0]:void 0;if(this.setContextKeys(t),t){const n=!!this.configurationService.getValue().files?.enableTrash,o=this.fileService.hasCapability(t.resource,Vn.Trash);this.resourceMoveableToTrash.set(n&&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(n=>{this.updateCompressedNavigationContextKeys(n)})}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 n=t||this.tree.getInput();return this.tree.updateChildren(n,e,!!t)}getOptimalWidth(){const e=this.tree.getHTMLElement(),t=[].slice.call(e.querySelectorAll(".explorer-item .label-name"));return Sdt(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&cs("code/willResolveExplorer");const t=this.explorerService.roots;let i=t[0];(this.contextService.getWorkbenchState()!==qi.FOLDER||t[0].error)&&(i=t);let n;if(this.tree&&this.tree.getInput())n=this.tree.getViewState();else{const a=this.storageService.get(OQ.TREE_VIEW_STATE_STORAGE_KEY,Ie.WORKSPACE);a&&(n=JSON.parse(a))}const o=this.tree.getInput(),r=this.setTreeInputPromise=this.tree.setInput(i,n).then(async()=>{if(Array.isArray(i)){if(!n||o instanceof Gd)for(let a=0;a{}),Array.isArray(o)){const a=new ui;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&&cs("code/didResolveExplorer")});this.progressService.withProgress({location:ud.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>r),await r,this.decorationsProvider||(this.decorationsProvider=new vSe(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 n=this.explorerService.findClosestRoot(e);for(;n&&n.resource.toString()!==e.toString();){try{await this.tree.expand(n)}catch{return this.selectResource(e,t,i+1)}if(!n.children.size)n=null;else for(const o of n.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,o.resource)){n=o;break}n=null}}if(n){if(n===this.tree.getInput()){this.tree.setFocus([]),this.tree.setSelection([]);return}try{n.nestedParent&&await this.tree.expand(n.nestedParent),(t===!0||t==="force")&&this.tree.getRelativeTop(n)===null&&this.tree.reveal(n,.5),this.tree.setFocus([n]),this.tree.setSelection([n])}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(n=>this.tree.rerender(n)),t&&e.forEach(n=>this.tree.rerender(n))}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)&&izt(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(nzt(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},OQ=xR,xR.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",xR);GW.__decorator=D([Zt],GW.prototype,"fileCopiedContextKey",null);GW.__decorator=D([Zt],GW.prototype,"resourceCutContextKey",null);GW=OQ=D([_(1,lr),_(2,xm),_(3,we),_(4,yi),_(5,cg),_(6,ei),_(7,BU),_(8,kI),_(9,Ut),_(10,Le),_(11,Te),_(12,iE),_(13,Fs),_(14,pn),_(15,Yi),_(16,ec),_(17,vf),_(18,$i),_(19,dg),_(20,Jt),_(21,ks),_(22,vi),_(23,Ao)],GW);function TNe(s,e){s.classList.add("file-icon-themable-tree"),s.classList.add("show-file-icons");const t=i=>{s.classList.toggle("align-icons-and-twisties",i.hasFileIcons&&!i.hasFolderIcons),s.classList.toggle("hide-arrows",i.hidesExplorerArrows===!0)};return t(e.getFileIconTheme()),e.onDidFileIconThemeChange(t)}At(class extends li{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(10058,"New File..."),f1:!1,icon:ve.newFile,precondition:Htt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:10}})}run(s){s.get(vi).executeCommand(kNe)}});At(class extends li{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(10059,"New Folder..."),f1:!1,icon:ve.newFolder,precondition:Htt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:20}})}run(s){s.get(vi).executeCommand(tit)}});At(class extends li{constructor(){super({id:"workbench.files.action.refreshFilesExplorer",title:Pe(10060,"Refresh Explorer"),f1:!0,icon:ve.refresh,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:30},metadata:{description:Pe(10061,"Forces a refresh of the Explorer.")}})}async run(s){const e=s.get(Lm),t=s.get(vf);await e.openView(Bb),await t.refresh()}});At(class extends li{constructor(){super({id:"workbench.files.action.collapseExplorerFolders",title:Pe(10062,"Collapse Folders in Explorer"),f1:!0,icon:ve.collapseAll,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Bb),order:40},metadata:{description:Pe(10063,"Folds all folders in the Explorer.")}})}run(s){const t=s.get(Lm).getViewWithId(Bb);t!==null&&t.collapseAll()}});var UVe;(function(s){s.Null="null",s.Enum="enum",s.String="string",s.MultilineString="multiline-string",s.Integer="integer",s.Number="number",s.Boolean="boolean",s.Array="array",s.Exclude="exclude",s.Include="include",s.Complex="complex",s.NullableInteger="nullable-integer",s.NullableNumber="nullable-number",s.Object="object",s.BooleanObject="boolean-object",s.LanguageTag="language-tag",s.ExtensionToggle="extension-toggle"})(UVe||(UVe={}));var VVe;(function(s){s[s.None=0]="None",s[s.LanguageTagSettingMatch=1]="LanguageTagSettingMatch",s[s.RemoteMatch=2]="RemoteMatch",s[s.DescriptionOrValueMatch=4]="DescriptionOrValueMatch",s[s.KeyMatch=8]="KeyMatch"})(VVe||(VVe={}));const rzt="editor.contrib.defineKeybinding",azt="settings";var ESe;const BQ=fe;let UZ=class extends V{constructor(e,t,i,n,o){super(),this.data=e,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const r=t??(e.length>1?g(10569,"Used {0} references",e.length):g(10570,"Used {0} reference",1)),a=BQ(".chat-used-context-icon"),c=v=>v.usedReferencesExpanded?ve.chevronDown:ve.chevronRight;a.classList.add(...We.asClassNameArray(c(i)));const l=BQ(".chat-used-context-label",void 0),d=this._register(new Jd(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}));this.domNode=BQ(".chat-used-context",void 0,l),d.label=r,d.element.prepend(a),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._register(d.onDidClick(()=>{a.classList.remove(...We.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...We.asClassNameArray(c(i))),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._onDidChangeHeight.fire(),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded)}));const u=this._register(n.get()).object;this.domNode.appendChild(u.getHTMLElement().parentElement),this._register(u.onDidOpen(v=>{if(v.element&&"reference"in v.element){const b="variableName"in v.element.reference?v.element.reference.value:v.element.reference,w=N.isUri(b)?b:b?.uri;w&&o.open(w,{fromUserGesture:!0,editorOptions:{...v.editorOptions,selection:b&&"range"in b?b.range:void 0}})}})),this._register(u.onContextMenu(v=>{v.browserEvent.preventDefault(),v.browserEvent.stopPropagation()}));const m=Math.min(e.length,6)*22;u.layout(m),u.getHTMLElement().style.height=`${m}px`,u.splice(0,u.length,e)}hasSameContent(e,t,i){return e.kind==="references"&&e.references.length===this.data.length||e.kind==="codeCitations"&&e.citations.length===this.data.length}updateAriaLabel(e,t,i){e.ariaLabel=i?g(10571,"{0}, expanded",t):g(10572,"{0}, collapsed",t)}addDisposable(e){this._register(e)}};UZ=D([_(4,Ao)],UZ);let xSe=class extends V{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 xce(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(UA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=BQ(".chat-used-context-list");return this._register(TNe(t,this.themeService)),this.instantiationService.createInstance(M_e,"ChatListRenderer",t,new czt,[this.instantiationService.createInstance(VZ,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:n=>{if(n.kind==="warning")return n.content.value;const o=n.reference;return"variableName"in o?o.variableName:N.isUri(o)?Ko(o.path):Ko(o.uri.path)},getWidgetAriaLabel:()=>g(10573,"Collapsible Chat List")},dnd:{getDragURI:n=>{if(n.kind==="warning")return null;const{reference:o}=n;return"variableName"in o?null:N.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)}}}};xSe=D([_(1,we),_(2,pn)],xSe);class czt{getHeight(e){return 22}getTemplateId(e){return VZ.TEMPLATE_ID}}var DR;let VZ=(DR=class{constructor(e,t,i,n){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.productService=n,this.templateId=ESe.TEMPLATE_ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0,supportIcons:!0}));return{templateDisposables:t,label:i}}getReferenceIcon(e){return We.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===VCe.DARK&&e.iconPath?.dark?e.iconPath?.dark:e.iconPath?.light}renderElement(e,t,i,n){if(e.kind==="warning"){i.label.setResource({name:e.content.value},{icon:ve.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=N.isUri(o.value)?o.value:o.value.uri;i.label.setResource({resource:a,name:EA(a),description:`#${o.variableName}`,range:"range"in o.value?o.value.range:void 0},{icon:r,title:e.options?.status?.description??e.title})}else{const a=this.chatVariablesService.getVariable(o.variableName),c=a?.icon?`$(${a.icon.id}) `:"",l=`#${o.variableName}`,d=`${c}${a?.fullName??l}`;i.label.setLabel(d,l,{title:e.options?.status?.description??a?.description})}else{const a="uri"in o?o.uri:o;if(a.scheme==="https"&&R2(a.authority,"github.com")&&a.path.includes("/tree/")){const c=a.path.split("/").slice(1,3).join("/"),l=a.path.split("/").slice(5).join("/");i.label.setResource({resource:a,name:c,description:l},{icon:ve.github,title:e.title})}else if(a.scheme===this.productService.urlProtocol&&R2(a.authority,azt)){const c=a.path.substring(1);i.label.setResource({resource:a,name:c},{icon:ve.settingsGear,title:g(10574,"Open setting '{0}'",c)})}else A8(a,pe.mailto,pe.http,pe.https)?i.label.setResource({resource:a,name:a.toString()},{icon:r??ve.globe,title:e.options?.status?.description??e.title??a.toString()}):i.label.setFile(a,{fileKind:ba.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in o?o.range:void 0,title:e.options?.status?.description??e.title})}for(const a of[".monaco-icon-suffix-container",".monaco-icon-name-container"]){const c=i.label.element.querySelector(a);c&&(e.options?.status?.kind===BW.Omitted||e.options?.status?.kind===BW.Partial?c.classList.add("warning"):c.classList.remove("warning"))}}disposeTemplate(e){e.templateDisposables.dispose()}},ESe=DR,DR.TEMPLATE_ID="chatCollapsibleListRenderer",DR);VZ=ESe=D([_(1,pn),_(2,L6),_(3,Er)],VZ);let DSe=class extends V{constructor(e,t,i,n,o){if(super(),this.task=e,e.progress.length){const r=this._register(o.createInstance(UZ,e.progress,e.content.value,n.element,t));this.domNode=fe(".chat-progress-task"),this.domNode.appendChild(r.domNode),this.onDidChangeHeight=r.onDidChangeHeight}else{const r=e.isSettled?.()??!0,a=this._register(o.createInstance(Btt,e,i,n,!r,!0));this.domNode=a.domNode,this.onDidChangeHeight=M.None}}hasSameContent(e){return e.kind==="progressTask"&&e.progress.length===this.task.progress.length&&e.isSettled()===this.task.isSettled()}addDisposable(e){this._register(e)}};DSe=D([_(4,we)],DSe);const zVe=fe;let kSe=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.textModelService=r,this.modelService=a,this.chatService=c,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const l=t.element;if(i.renderTextEditsAsSummary?.(e.uri))vs(l)&&l.response.value.every(d=>d.kind==="textEditGroup")?this.domNode=zVe(".interactive-edits-summary",void 0,l.isComplete?l.isCanceled?g(10576,"Making changes was aborted."):g(10577,"Made changes."):g(10575,"Making changes...")):this.domNode=zVe("div");else{const d=new ci;let h=!1;this._register(Ee(()=>{h=!0,d.dispose(!0),this.ref?.object.clearModel()})),this.ref=this._register(n.get()),this._register(this.ref.object.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()}));const u={element:l,edit:e,diffData:(async()=>{const f=await this.textModelService.createModelReference(e.uri);if(h){f.dispose();return}this._register(f);const p=f.object.textEditorModel;let m="";if(e.state)m=e.state.sha1;else{const y=new Z2;y.canComputeSHA1(p)&&(m=y.computeSHA1(p),e.state={sha1:m,applied:0})}const v=this.modelService.createModel(u6(p.createSnapshot()),{languageId:p.getLanguageId(),onDidChange:M.None},N.from({scheme:pe.vscodeChatCodeBlock,path:p.uri.path,query:ar()}),!1),b=await this.textModelService.createModelReference(v.uri);this._register(b);const w=[];if(vs(l)){const y=this.chatService.getSession(l.sessionId);for(const C of y.getRequests())if(C.response){for(const A of C.response.response.value)if(!(A.kind!=="textEditGroup"||A.state?.applied||!ji(A.uri,e.uri)))for(const L of A.edits){const k=L.map(nTe.asEditOperation);w.push(k)}if(C.response===l.model)break}}for(const y of w)v.pushEditOperations(null,y,()=>null);return{modified:v,original:p,originalSha1:m}})()};this.ref.object.render(u,o,d.token),this.domNode=this.ref.object.element}}layout(e){this.ref?.object.layout(e)}hasSameContent(e){return e.kind==="textEditGroup"}addDisposable(e){this._register(e)}};kSe=D([_(5,fn),_(6,gi),_(7,km)],kSe);let ISe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new xce(()=>n.createInstance(hCe,e,_e.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)}}}};ISe=D([_(3,we)],ISe);const lzt=fe;let zZ=class extends V{constructor(e,t,i,n,o){super(),this.openerService=o,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const r=this._register(i.get());this.tree=r.object,this.onDidFocus=this.tree.onDidFocus,this._register(this.tree.onDidOpen(a=>{a.element&&!("children"in a.element)&&this.openerService.open(a.element.uri)})),this._register(this.tree.onDidChangeCollapseState(()=>{this._onDidChangeHeight.fire()})),this._register(this.tree.onContextMenu(a=>{a.browserEvent.preventDefault(),a.browserEvent.stopPropagation()})),this.tree.setInput(e).then(()=>{r.isStale()||(this.tree.layout(),this._onDidChangeHeight.fire())}),this.domNode=this.tree.getHTMLElement().parentElement}domFocus(){this.tree.domFocus()}hasSameContent(e){return e.kind==="treeData"}addDisposable(e){this._register(e)}};zZ=D([_(4,Ao)],zZ);let TSe=class extends V{get inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.configService=i,this.themeService=n,this._pool=this._register(new xce(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(UA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=lzt(".interactive-response-progress-tree");return this._register(TNe(t,this.themeService)),this.instantiationService.createInstance(hJ,"ChatListRenderer",t,new LSe,new dzt,[new hzt(e,this.configService.getValue("explorer.decorations"))],new uzt,{collapseByDefault:()=>!1,expandOnlyOnTwistieClick:()=>!1,identityProvider:{getId:n=>n.uri.toString()},accessibilityProvider:{getAriaLabel:n=>n.label,getWidgetAriaLabel:()=>g(10578,"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)}}}};TSe=D([_(1,we),_(2,Te),_(3,pn)],TSe);const Noe=class Noe{getHeight(e){return Noe.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};Noe.ITEM_HEIGHT=22;let LSe=Noe;class dzt{isIncompressible(e){return!e.children}}class hzt{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,n){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?ba.FOLDER:ba.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,n){i.label.element.style.display="flex",!e.children.length&&e.element.type!==sn.Directory?i.label.setFile(e.element.uri,{fileKind:ba.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:ba.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class uzt{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}const $Ve=fe;class GVe extends V{constructor(e,t,i){super(),this.domNode=$Ve(".chat-notification-widget");let n,o;switch(e){case"warning":n=ve.warning,o=".chat-warning-codicon";break;case"error":n=ve.error,o=".chat-error-codicon";break;case"info":n=ve.info,o=".chat-info-codicon";break}this.domNode.appendChild($Ve(o,void 0,Yy(n)));const r=i.render(t);this.domNode.appendChild(r.element)}hasSameContent(e){return e.kind==="warning"}}const gzt=["b","blockquote","br","code","em","h1","h2","h3","h4","h5","h6","hr","i","li","ol","p","pre","strong","sub","sup","table","tbody","td","th","thead","tr","ul","a","img","span","div"];let RSe=class extends Y_{constructor(e,t,i,n){super(e??{},t,i),this.trustedDomainService=n}render(e,t,i){t={...t,remoteImageIsAllowed:o=>this.trustedDomainService.isValid(o),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:gzt}};const n=e&&e.supportHtml?{...e,value:` + `)}else We.isThemeIcon(i)&&(n=We.asClassName(i));n&&this.iconContainer.classList.add(...n.split(" "));const o=this.calculateTitle(t);this.titleContainer=re(e,fe("h3.title",{},o)),this.titleContainerHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.titleContainer,o)),this._titleDescription&&this.setTitleDescription(this._titleDescription),this.iconContainerHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.iconContainer,o)),this.iconContainer.setAttribute("aria-label",this._getAriaLabel(o))}_getAriaLabel(e){const t=this.viewDescriptorService.getViewDescriptorById(this.id)?.accessibilityHelpContent,i=this.accessibleViewInformationService?.hasShownAccessibleView(this.id);return!t||i?e:g(5345,"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=HGe(this.titleContainer,fe("span.description",{},e)),this.titleDescriptionContainerHover=this._register(this.hoverService.setupManagedHover(Pr("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),n=this.viewDescriptorService.getViewDescriptorById(this.id);return!(this.viewDescriptorService.getDefaultContainerById(this.id)===t)&&n?.containerTitle&&i.title!==n.containerTitle?`${n.containerTitle}: ${e}`:e}renderBody(e){this.viewWelcomeController=this._register(this.instantiationService.createInstance(_Se,e,this))}layoutBody(e,t){this.viewWelcomeController.layout(e,t)}onDidScrollRoot(){}getProgressIndicator(){if(this.progressBar===void 0&&(this.progressBar=this._register(new tJ(this.element,Rje)),this.progressBar.hide()),this.progressIndicator===void 0){const e=this;this.progressIndicator=this._register(new B5t(qn(this.progressBar),new class extends W5t{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 $5t(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(DVe),this.toolbar.setActions(M2e(e),M2e(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===DVe.id){const i=this;return new class extends Hf{constructor(){super(null,e)}setFocusable(){}get trapsArrowNavigation(){return!0}render(n){n.classList.add("viewpane-filter-container");const o=i.getFilterWidget();re(n,o.element),o.relayout()}}}return PN(this.instantiationService,e,{...t,menuAsChild:e instanceof Dy})}getActionsContext(){}getActionRunner(){}getOptimalWidth(){return 0}saveState(){}shouldShowWelcome(){return!1}getFilterWidget(){}shouldShowFilterInHeader(){return!1}},mSe=yR,yR.AlwaysShowActionsConfig="workbench.view.alwaysShowHeaderActions",yR);BZ=mSe=D([_(1,Ut),_(2,lr),_(3,Te),_(4,Le),_(5,Sm),_(6,we),_(7,Ao),_(8,pn),_(9,Yi),_(10,ec)],BZ);let vSe=class extends BZ{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(e,t,i,n,o,r,a,c,l,d,h,u);const f=this._register(a.createChild(new Uc([Le,this.scopedContextKeyService])));this.filterWidget=this._register(f.createInstance(pSe,e.filterOptions))}getFilterWidget(){return this.filterWidget}renderBody(e){super.renderBody(e),this.filterContainer=re(e,fe(".viewpane-filter-container"))}layoutBody(e,t){super.layoutBody(e,t),this.dimension=new bn(t,e);const i=!this.filterContainer?.hasChildNodes(),n=this.shouldShowFilterInHeader();i!==n&&(n&&aa(this.filterContainer),this.updateActions(),n||re(this.filterContainer,this.filterWidget.element)),n||(e=e-44),this.filterWidget.layout(t),this.layoutBodyContent(e,t)}shouldShowFilterInHeader(){return!(this.dimension&&this.dimension.width<600&&this.dimension.height>100)}};vSe=D([_(1,Ut),_(2,lr),_(3,Te),_(4,Le),_(5,Sm),_(6,we),_(7,Ao),_(8,pn),_(9,Yi),_(10,ec)],vSe);function $5t(s){let e,t,i,n;switch(s){case ir.Panel:e=hJe,t=nTt,i=sTt,n=oTt;break;case ir.Sidebar:case ir.AuxiliaryBar:default:e=PRe,t=uTt,i=gTt,n=fTt}return{background:e,listOverrideStyles:{listBackground:e,treeStickyScrollBackground:t,treeStickyScrollBorder:i,treeStickyScrollShadow:n}}}class tG extends li{constructor(e){super(e),this.desc=e}run(e,...t){const i=e.get(km).getActiveViewWithId(this.desc.viewId);if(i)return this.runInView(e,i,...t)}}var PQ;function G5t(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t)){for(const[,i]of t.children.entries())if(s.hasNode(i)&&s.isCollapsible(i)&&!s.isCollapsed(i))return!0}return!1}function K5t(s,e){for(const t of e)if(s.hasNode(t)&&!s.isCollapsed(t))return!0;return!1}const q5t={getId:s=>s instanceof Sce?`new:${s.getId()}`:s.getId()};function Q5t(s,e,t,i){let n;n=s.length?s[0]:void 0,t&&e.length>1&&(n=void 0);const o=n&&i.getCompressedNavigationController(n),r=o&&o.length?o[0]:void 0;n=r?r.current:n;const a=[];for(const c of e){const l=i.getCompressedNavigationController(c),d=l&&l.length?l[0]:void 0;if(d&&n&&d===r){c===n&&a.push(c);continue}d?a.push(...d.items):a.push(c)}return n?t&&a.indexOf(n)>=0?a:[n]:t?a:[]}var CR;let UW=(CR=class extends BZ{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P){super(e,d,t,u,h,i,n,P,m,v,b),this.contextService=o,this.progressService=r,this.editorService=a,this.editorResolverService=c,this.layoutService=l,this.decorationService=f,this.labelService=p,this.explorerService=w,this.storageService=y,this.clipboardService=C,this.fileService=A,this.uriIdentityService=L,this.commandService=k,this._autoReveal=!1,this.delegate=e.delegate,this.resourceContext=n.createInstance(T3),this._register(this.resourceContext),this.folderContext=LVt.bindTo(h),this.readonlyContext=Ltt.bindTo(h),this.availableEditorIdsContext=RVt.bindTo(h),this.rootContext=MVt.bindTo(h),this.resourceMoveableToTrash=PVt.bindTo(h),this.compressedFocusContext=FVt.bindTo(h),this.compressedFocusFirstContext=OVt.bindTo(h),this.compressedFocusLastContext=BVt.bindTo(h),this.viewHasSomeCollapsibleRootItem=WVt.bindTo(h),this.viewVisibleContextKey=uNe.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 p5t.bindTo(this.contextKeyService)}get resourceCutContextKey(){return NVt.bindTo(this.contextKeyService)}renderHeader(e){super.renderHeader(e),this.dragHandler=new nAt(e,()=>this.setExpanded(!0));const t=e.querySelector(".title"),i=()=>{t.textContent=this.name,this.updateTitle(this.name),this.ariaHeaderLabel=g(10057,"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=re(e,fe(".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(ue(ct(this.container),ke.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()===tW.Tree){const e=this.tree.getFocus();e.length===1&&this._autoReveal&&this.tree.reveal(e[0],.5)}}hasFocus(){return J1e(this.container)}getFocus(){return this.tree.getFocus()}focusNext(){this.tree.focusNext()}focusLast(){this.tree.focusLast()}getContext(e){const t=this.tree.getFocusedPart()===tW.StickyScroll?this.tree.getStickyScrollFocus():this.tree.getFocus();return Q5t(t,this.tree.getSelection(),e,this.renderer)}isItemVisible(e){return this.filter?this.filter.filter(e,qs.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=Na.getCanonicalUri(this.editorService.activeEditor,{supportSideBySide:Hs.PRIMARY});if(t){const i=this.tree.getFocus(),n=this.tree.getSelection();return i.length===1&&this.uriIdentityService.extUri.isEqual(i[0].resource,t)&&n.length===1&&this.uriIdentityService.extUri.isEqual(n[0].resource,t)?void 0:this.explorerService.select(t,e)}}}createTree(e){this.filter=this.instantiationService.createInstance(lSe),this._register(this.filter),this._register(this.filter.onDidChange(()=>this.refresh(!0)));const t=this.instantiationService.createInstance(WA,{onDidChangeVisibility:this.onDidChangeBodyVisibility});this._register(t);const i=a=>this.tree.updateWidth(a);this.renderer=this.instantiationService.createInstance(PZ,e,t,i),this._register(this.renderer),this._register(vNe(e,this.themeService));const n=()=>this.configurationService.getValue("explorer.compactFolders"),o=a=>this.configurationService.getValue({resource:a?.root.resource}).explorer.fileNesting;this.tree=this.instantiationService.createInstance(lJ,"FileExplorer",e,new MZ,new M5t,[this.renderer],this.instantiationService.createInstance(cSe,this.filter),{compressionEnabled:n(),accessibilityProvider:this.renderer,identityProvider:q5t,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(dSe),dnd:this.instantiationService.createInstance(hSe,a=>this.isItemCollapsed(a)),collapseByDefault:a=>!(a instanceof zd&&a.hasNests&&o(a).expand),autoExpandSingleChildren:!0,expandOnlyOnTwistieClick:a=>{if(a instanceof zd){if(a.hasNests)return!0;if(this.configurationService.getValue("workbench.tree.expandMode")==="doubleClick")return!0}return!1},paddingBottom:MZ.ITEM_HEIGHT,overrideStyles:this.getLocationBasedColors().listOverrideStyles}),this._register(this.tree),this._register(this.themeService.onDidColorThemeChange(()=>this.tree.rerender()));const r=M.filter(this.configurationService.onDidChangeConfiguration,a=>a.affectsConfiguration("explorer.compactFolders"));this._register(r(a=>this.tree.updateOptions({compressionEnabled:n()}))),Mtt.bindTo(this.tree.contextKeyService),Ntt.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(!(a_(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:p3.USER}},a.sideBySide?J_:dA)}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(mNe)})),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(PQ.TREE_VIEW_STATE_STORAGE_KEY,JSON.stringify(this.tree.getViewState()),Ie.WORKSPACE,an.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 n=i?this.editorResolverService.getEditors(i).map(o=>o.id):[];this.availableEditorIdsContext.set(n.join(","))}else this.availableEditorIdsContext.reset()}async onContextMenu(e){if(iA(e.browserEvent.target))return;const t=e.element;let i=e.anchor;if(Yr(i)&&t){const a=this.renderer.getCompressedNavigationController(t);a&&a.length>0&&(a_(e.browserEvent)||R5t(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 n=this.tree.getSelection(),o=this.explorerService.roots;let r;if(t instanceof zd){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:_e.ExplorerContext,menuActionOptions:{arg:r,shouldForwardArgs:!0},contextKeyService:this.tree.contextKeyService,getAnchor:()=>i,onHide:a=>{a&&this.tree.domFocus()},getActionsContext:()=>t&&n&&n.indexOf(t)>=0?n.map(a=>a.resource):t instanceof zd?[t.resource]:[]})}onFocusChanged(e){const t=e&&e.length?e[0]:void 0;if(this.setContextKeys(t),t){const n=!!this.configurationService.getValue().files?.enableTrash,o=this.fileService.hasCapability(t.resource,Vn.Trash);this.resourceMoveableToTrash.set(n&&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(n=>{this.updateCompressedNavigationContextKeys(n)})}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 n=t||this.tree.getInput();return this.tree.updateChildren(n,e,!!t)}getOptimalWidth(){const e=this.tree.getHTMLElement(),t=[].slice.call(e.querySelectorAll(".explorer-item .label-name"));return udt(e,t)}async setTreeInput(){if(!this.isBodyVisible())return Promise.resolve(void 0);this.setTreeInputPromise&&await this.setTreeInputPromise;const e=!this.tree.getInput();e&&cs("code/willResolveExplorer");const t=this.explorerService.roots;let i=t[0];(this.contextService.getWorkbenchState()!==qi.FOLDER||t[0].error)&&(i=t);let n;if(this.tree&&this.tree.getInput())n=this.tree.getViewState();else{const a=this.storageService.get(PQ.TREE_VIEW_STATE_STORAGE_KEY,Ie.WORKSPACE);a&&(n=JSON.parse(a))}const o=this.tree.getInput(),r=this.setTreeInputPromise=this.tree.setInput(i,n).then(async()=>{if(Array.isArray(i)){if(!n||o instanceof zd)for(let a=0;a{}),Array.isArray(o)){const a=new ui;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&&cs("code/didResolveExplorer")});this.progressService.withProgress({location:dd.Explorer,delay:this.layoutService.isRestored()?800:1500},a=>r),await r,this.decorationsProvider||(this.decorationsProvider=new uSe(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 n=this.explorerService.findClosestRoot(e);for(;n&&n.resource.toString()!==e.toString();){try{await this.tree.expand(n)}catch{return this.selectResource(e,t,i+1)}if(!n.children.size)n=null;else for(const o of n.children.values()){if(this.uriIdentityService.extUri.isEqualOrParent(e,o.resource)){n=o;break}n=null}}if(n){if(n===this.tree.getInput()){this.tree.setFocus([]),this.tree.setSelection([]);return}try{n.nestedParent&&await this.tree.expand(n.nestedParent),(t===!0||t==="force")&&this.tree.getRelativeTop(n)===null&&this.tree.reveal(n,.5),this.tree.setFocus([n]),this.tree.setSelection([n])}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(n=>this.tree.rerender(n)),t&&e.forEach(n=>this.tree.rerender(n))}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)&&G5t(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(K5t(this.tree,t)),this.storeTreeViewState()}dispose(){this.dragHandler?.dispose(),super.dispose()}},PQ=CR,CR.TREE_VIEW_STATE_STORAGE_KEY="workbench.explorer.treeViewState",CR);UW.__decorator=D([Zt],UW.prototype,"fileCopiedContextKey",null);UW.__decorator=D([Zt],UW.prototype,"resourceCutContextKey",null);UW=PQ=D([_(1,lr),_(2,Sm),_(3,we),_(4,yi),_(5,og),_(6,ei),_(7,MU),_(8,CI),_(9,Ut),_(10,Le),_(11,Te),_(12,eE),_(13,Fs),_(14,pn),_(15,Yi),_(16,ec),_(17,pf),_(18,$i),_(19,ag),_(20,Jt),_(21,ks),_(22,vi),_(23,Ao)],UW);function vNe(s,e){s.classList.add("file-icon-themable-tree"),s.classList.add("show-file-icons");const t=i=>{s.classList.toggle("align-icons-and-twisties",i.hasFileIcons&&!i.hasFolderIcons),s.classList.toggle("hide-arrows",i.hidesExplorerArrows===!0)};return t(e.getFileIconTheme()),e.onDidFileIconThemeChange(t)}At(class extends li{constructor(){super({id:"workbench.files.action.createFileFromExplorer",title:g(10058,"New File..."),f1:!1,icon:ve.newFile,precondition:Rtt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Pb),order:10}})}run(s){s.get(vi).executeCommand(mNe)}});At(class extends li{constructor(){super({id:"workbench.files.action.createFolderFromExplorer",title:g(10059,"New Folder..."),f1:!1,icon:ve.newFolder,precondition:Rtt,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Pb),order:20}})}run(s){s.get(vi).executeCommand(qtt)}});At(class extends li{constructor(){super({id:"workbench.files.action.refreshFilesExplorer",title:Fe(10060,"Refresh Explorer"),f1:!0,icon:ve.refresh,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Pb),order:30},metadata:{description:Fe(10061,"Forces a refresh of the Explorer.")}})}async run(s){const e=s.get(km),t=s.get(pf);await e.openView(Pb),await t.refresh()}});At(class extends li{constructor(){super({id:"workbench.files.action.collapseExplorerFolders",title:Fe(10062,"Collapse Folders in Explorer"),f1:!0,icon:ve.collapseAll,menu:{id:_e.ViewTitle,group:"navigation",when:he.equals("view",Pb),order:40},metadata:{description:Fe(10063,"Folds all folders in the Explorer.")}})}run(s){const t=s.get(km).getViewWithId(Pb);t!==null&&t.collapseAll()}});var IVe;(function(s){s.Null="null",s.Enum="enum",s.String="string",s.MultilineString="multiline-string",s.Integer="integer",s.Number="number",s.Boolean="boolean",s.Array="array",s.Exclude="exclude",s.Include="include",s.Complex="complex",s.NullableInteger="nullable-integer",s.NullableNumber="nullable-number",s.Object="object",s.BooleanObject="boolean-object",s.LanguageTag="language-tag",s.ExtensionToggle="extension-toggle"})(IVe||(IVe={}));var TVe;(function(s){s[s.None=0]="None",s[s.LanguageTagSettingMatch=1]="LanguageTagSettingMatch",s[s.RemoteMatch=2]="RemoteMatch",s[s.DescriptionOrValueMatch=4]="DescriptionOrValueMatch",s[s.KeyMatch=8]="KeyMatch"})(TVe||(TVe={}));const j5t="editor.contrib.defineKeybinding",Y5t="settings";var bSe;const FQ=fe;let WZ=class extends V{constructor(e,t,i,n,o){super(),this.data=e,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const r=t??(e.length>1?g(10569,"Used {0} references",e.length):g(10570,"Used {0} reference",1)),a=FQ(".chat-used-context-icon"),c=v=>v.usedReferencesExpanded?ve.chevronDown:ve.chevronRight;a.classList.add(...We.asClassNameArray(c(i)));const l=FQ(".chat-used-context-label",void 0),d=this._register(new jd(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}));this.domNode=FQ(".chat-used-context",void 0,l),d.label=r,d.element.prepend(a),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._register(d.onDidClick(()=>{a.classList.remove(...We.asClassNameArray(c(i))),i.usedReferencesExpanded=!i.usedReferencesExpanded,a.classList.add(...We.asClassNameArray(c(i))),this.domNode.classList.toggle("chat-used-context-collapsed",!i.usedReferencesExpanded),this._onDidChangeHeight.fire(),this.updateAriaLabel(d.element,r,i.usedReferencesExpanded)}));const u=this._register(n.get()).object;this.domNode.appendChild(u.getHTMLElement().parentElement),this._register(u.onDidOpen(v=>{if(v.element&&"reference"in v.element){const b="variableName"in v.element.reference?v.element.reference.value:v.element.reference,w=N.isUri(b)?b:b?.uri;w&&o.open(w,{fromUserGesture:!0,editorOptions:{...v.editorOptions,selection:b&&"range"in b?b.range:void 0}})}})),this._register(u.onContextMenu(v=>{v.browserEvent.preventDefault(),v.browserEvent.stopPropagation()}));const m=Math.min(e.length,6)*22;u.layout(m),u.getHTMLElement().style.height=`${m}px`,u.splice(0,u.length,e)}hasSameContent(e,t,i){return e.kind==="references"&&e.references.length===this.data.length||e.kind==="codeCitations"&&e.citations.length===this.data.length}updateAriaLabel(e,t,i){e.ariaLabel=i?g(10571,"{0}, expanded",t):g(10572,"{0}, collapsed",t)}addDisposable(e){this._register(e)}};WZ=D([_(4,Ao)],WZ);let wSe=class extends V{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 Cce(()=>this.listFactory()))}listFactory(){const e=this._register(this.instantiationService.createInstance(WA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=FQ(".chat-used-context-list");return this._register(vNe(t,this.themeService)),this.instantiationService.createInstance(D_e,"ChatListRenderer",t,new J5t,[this.instantiationService.createInstance(HZ,e)],{alwaysConsumeMouseWheel:!1,accessibilityProvider:{getAriaLabel:n=>{if(n.kind==="warning")return n.content.value;const o=n.reference;return"variableName"in o?o.variableName:N.isUri(o)?Ko(o.path):Ko(o.uri.path)},getWidgetAriaLabel:()=>g(10573,"Collapsible Chat List")},dnd:{getDragURI:n=>{if(n.kind==="warning")return null;const{reference:o}=n;return"variableName"in o?null:N.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)}}}};wSe=D([_(1,we),_(2,pn)],wSe);class J5t{getHeight(e){return 22}getTemplateId(e){return HZ.TEMPLATE_ID}}var SR;let HZ=(SR=class{constructor(e,t,i,n){this.labels=e,this.themeService=t,this.chatVariablesService=i,this.productService=n,this.templateId=bSe.TEMPLATE_ID}renderTemplate(e){const t=new Z,i=t.add(this.labels.create(e,{supportHighlights:!0,supportIcons:!0}));return{templateDisposables:t,label:i}}getReferenceIcon(e){return We.isThemeIcon(e.iconPath)?e.iconPath:this.themeService.getColorTheme().type===FCe.DARK&&e.iconPath?.dark?e.iconPath?.dark:e.iconPath?.light}renderElement(e,t,i,n){if(e.kind==="warning"){i.label.setResource({name:e.content.value},{icon:ve.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=N.isUri(o.value)?o.value:o.value.uri;i.label.setResource({resource:a,name:SA(a),description:`#${o.variableName}`,range:"range"in o.value?o.value.range:void 0},{icon:r,title:e.options?.status?.description??e.title})}else{const a=this.chatVariablesService.getVariable(o.variableName),c=a?.icon?`$(${a.icon.id}) `:"",l=`#${o.variableName}`,d=`${c}${a?.fullName??l}`;i.label.setLabel(d,l,{title:e.options?.status?.description??a?.description})}else{const a="uri"in o?o.uri:o;if(a.scheme==="https"&&k2(a.authority,"github.com")&&a.path.includes("/tree/")){const c=a.path.split("/").slice(1,3).join("/"),l=a.path.split("/").slice(5).join("/");i.label.setResource({resource:a,name:c,description:l},{icon:ve.github,title:e.title})}else if(a.scheme===this.productService.urlProtocol&&k2(a.authority,Y5t)){const c=a.path.substring(1);i.label.setResource({resource:a,name:c},{icon:ve.settingsGear,title:g(10574,"Open setting '{0}'",c)})}else y8(a,pe.mailto,pe.http,pe.https)?i.label.setResource({resource:a,name:a.toString()},{icon:r??ve.globe,title:e.options?.status?.description??e.title??a.toString()}):i.label.setFile(a,{fileKind:ba.FILE,fileDecorations:{badges:!1,colors:!1},range:"range"in o?o.range:void 0,title:e.options?.status?.description??e.title})}for(const a of[".monaco-icon-suffix-container",".monaco-icon-name-container"]){const c=i.label.element.querySelector(a);c&&(e.options?.status?.kind===NW.Omitted||e.options?.status?.kind===NW.Partial?c.classList.add("warning"):c.classList.remove("warning"))}}disposeTemplate(e){e.templateDisposables.dispose()}},bSe=SR,SR.TEMPLATE_ID="chatCollapsibleListRenderer",SR);HZ=bSe=D([_(1,pn),_(2,D6),_(3,Er)],HZ);let ySe=class extends V{constructor(e,t,i,n,o){if(super(),this.task=e,e.progress.length){const r=this._register(o.createInstance(WZ,e.progress,e.content.value,n.element,t));this.domNode=fe(".chat-progress-task"),this.domNode.appendChild(r.domNode),this.onDidChangeHeight=r.onDidChangeHeight}else{const r=e.isSettled?.()??!0,a=this._register(o.createInstance(Ttt,e,i,n,!r,!0));this.domNode=a.domNode,this.onDidChangeHeight=M.None}}hasSameContent(e){return e.kind==="progressTask"&&e.progress.length===this.task.progress.length&&e.isSettled()===this.task.isSettled()}addDisposable(e){this._register(e)}};ySe=D([_(4,we)],ySe);const LVe=fe;let CSe=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.textModelService=r,this.modelService=a,this.chatService=c,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const l=t.element;if(i.renderTextEditsAsSummary?.(e.uri))vs(l)&&l.response.value.every(d=>d.kind==="textEditGroup")?this.domNode=LVe(".interactive-edits-summary",void 0,l.isComplete?l.isCanceled?g(10576,"Making changes was aborted."):g(10577,"Made changes."):g(10575,"Making changes...")):this.domNode=LVe("div");else{const d=new ci;let h=!1;this._register(Ee(()=>{h=!0,d.dispose(!0),this.ref?.object.clearModel()})),this.ref=this._register(n.get()),this._register(this.ref.object.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()}));const u={element:l,edit:e,diffData:(async()=>{const f=await this.textModelService.createModelReference(e.uri);if(h){f.dispose();return}this._register(f);const p=f.object.textEditorModel;let m="";if(e.state)m=e.state.sha1;else{const y=new j2;y.canComputeSHA1(p)&&(m=y.computeSHA1(p),e.state={sha1:m,applied:0})}const v=this.modelService.createModel(c6(p.createSnapshot()),{languageId:p.getLanguageId(),onDidChange:M.None},N.from({scheme:pe.vscodeChatCodeBlock,path:p.uri.path,query:ar()}),!1),b=await this.textModelService.createModelReference(v.uri);this._register(b);const w=[];if(vs(l)){const y=this.chatService.getSession(l.sessionId);for(const C of y.getRequests())if(C.response){for(const A of C.response.response.value)if(!(A.kind!=="textEditGroup"||A.state?.applied||!ji(A.uri,e.uri)))for(const L of A.edits){const k=L.map(G1e.asEditOperation);w.push(k)}if(C.response===l.model)break}}for(const y of w)v.pushEditOperations(null,y,()=>null);return{modified:v,original:p,originalSha1:m}})()};this.ref.object.render(u,o,d.token),this.domNode=this.ref.object.element}}layout(e){this.ref?.object.layout(e)}hasSameContent(e){return e.kind==="textEditGroup"}addDisposable(e){this._register(e)}};CSe=D([_(5,fn),_(6,gi),_(7,Em)],CSe);let SSe=class extends V{inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._pool=this._register(new Cce(()=>n.createInstance(oCe,e,_e.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)}}}};SSe=D([_(3,we)],SSe);const X5t=fe;let UZ=class extends V{constructor(e,t,i,n,o){super(),this.openerService=o,this._onDidChangeHeight=this._register(new I),this.onDidChangeHeight=this._onDidChangeHeight.event;const r=this._register(i.get());this.tree=r.object,this.onDidFocus=this.tree.onDidFocus,this._register(this.tree.onDidOpen(a=>{a.element&&!("children"in a.element)&&this.openerService.open(a.element.uri)})),this._register(this.tree.onDidChangeCollapseState(()=>{this._onDidChangeHeight.fire()})),this._register(this.tree.onContextMenu(a=>{a.browserEvent.preventDefault(),a.browserEvent.stopPropagation()})),this.tree.setInput(e).then(()=>{r.isStale()||(this.tree.layout(),this._onDidChangeHeight.fire())}),this.domNode=this.tree.getHTMLElement().parentElement}domFocus(){this.tree.domFocus()}hasSameContent(e){return e.kind==="treeData"}addDisposable(e){this._register(e)}};UZ=D([_(4,Ao)],UZ);let ASe=class extends V{get inUse(){return this._pool.inUse}constructor(e,t,i,n){super(),this._onDidChangeVisibility=e,this.instantiationService=t,this.configService=i,this.themeService=n,this._pool=this._register(new Cce(()=>this.treeFactory()))}treeFactory(){const e=this._register(this.instantiationService.createInstance(WA,{onDidChangeVisibility:this._onDidChangeVisibility})),t=X5t(".interactive-response-progress-tree");return this._register(vNe(t,this.themeService)),this.instantiationService.createInstance(lJ,"ChatListRenderer",t,new ESe,new Z5t,[new ezt(e,this.configService.getValue("explorer.decorations"))],new tzt,{collapseByDefault:()=>!1,expandOnlyOnTwistieClick:()=>!1,identityProvider:{getId:n=>n.uri.toString()},accessibilityProvider:{getAriaLabel:n=>n.label,getWidgetAriaLabel:()=>g(10578,"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)}}}};ASe=D([_(1,we),_(2,Te),_(3,pn)],ASe);const Toe=class Toe{getHeight(e){return Toe.ITEM_HEIGHT}getTemplateId(e){return"chatListTreeTemplate"}};Toe.ITEM_HEIGHT=22;let ESe=Toe;class Z5t{isIncompressible(e){return!e.children}}class ezt{constructor(e,t){this.labels=e,this.decorations=t,this.templateId="chatListTreeTemplate"}renderCompressedElements(e,t,i,n){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?ba.FOLDER:ba.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,n){i.label.element.style.display="flex",!e.children.length&&e.element.type!==sn.Directory?i.label.setFile(e.element.uri,{fileKind:ba.FILE,hidePath:!0,fileDecorations:this.decorations}):i.label.setResource({resource:e.element.uri,name:e.element.label},{title:e.element.label,fileKind:ba.FOLDER,fileDecorations:this.decorations})}disposeTemplate(e){e.templateDisposables.dispose()}}class tzt{hasChildren(e){return!!e.children}async getChildren(e){return e.children??[]}}const RVe=fe;class MVe extends V{constructor(e,t,i){super(),this.domNode=RVe(".chat-notification-widget");let n,o;switch(e){case"warning":n=ve.warning,o=".chat-warning-codicon";break;case"error":n=ve.error,o=".chat-error-codicon";break;case"info":n=ve.info,o=".chat-info-codicon";break}this.domNode.appendChild(RVe(o,void 0,qy(n)));const r=i.render(t);this.domNode.appendChild(r.element)}hasSameContent(e){return e.kind==="warning"}}const izt=["b","blockquote","br","code","em","h1","h2","h3","h4","h5","h6","hr","i","li","ol","p","pre","strong","sub","sup","table","tbody","td","th","thead","tr","ul","a","img","span","div"];let xSe=class extends q_{constructor(e,t,i,n){super(e??{},t,i),this.trustedDomainService=n}render(e,t,i){t={...t,remoteImageIsAllowed:o=>this.trustedDomainService.isValid(o),sanitizerOptions:{replaceWithPlaintext:!0,allowedTags:izt}};const n=e&&e.supportHtml?{...e,value:` -${e.value}`}:e;return super.render(n,t,i)}};RSe=D([_(1,xi),_(2,Ao),_(3,nce)],RSe);var MSe;const Pm=fe;var kR;let $Z=(kR=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.location=t,this.rendererOptions=i,this.delegate=n,this.codeBlockModelCollection=o,this.instantiationService=a,this.logService=l,this.contextKeyService=d,this.themeService=h,this.commandService=u,this.hoverService=f,this.codeBlocksByResponseId=new Map,this.codeBlocksByEditorUri=new ui,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.renderer=this._register(this.instantiationService.createInstance(RSe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(AZ),this._editorPool=this._register(this.instantiationService.createInstance(UCe,e,n,r)),this._diffEditorPool=this._register(this.instantiationService.createInstance(ISe,e,n,r)),this._treePool=this._register(this.instantiationService.createInstance(TSe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(xSe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(dCe))}get templateId(){return MSe.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 n=e.contentUpdateTimings.impliedWordLoadRate;return Ka(n,5,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&&ik.actions.length<=1},actionViewItemProvider:(k,P)=>k instanceof Sc&&(k.item.id==="workbench.action.chat.voteDown"||k.item.id==="workbench.action.chat.voteUp")?b.createInstance(fzt,k,P):WN(b,k,P)}));const y=t.add(this.instantiationService.createInstance(SZ)),C=()=>{if(vs(L.currentElement)&&L.currentElement.agent&&!L.currentElement.agent.isDefault)return y.setAgent(L.currentElement.agent.id),y.domNode},A=Ott(()=>vs(L.currentElement)?L.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupManagedHover(Pr("element"),l,C,A)),t.add(ue(l,ke.KEY_DOWN,k=>{const P=new En(k);if(P.equals(S.Space)||P.equals(S.Enter)){const R=C();R&&this.hoverService.showHover({content:R,target:l,trapFocus:!0,actions:A.actions},!0)}else P.equals(S.Escape)&&this.hoverService.hideHover()}));const L={avatarContainer:d,username:h,detail:f,value:p,rowContainer:i,elementDisposables:m,titleToolbar:w,templateDisposables:t,contextKeyService:v,instantiationService:b,agentHover:y};return L}renderElement(e,t,i){this.renderChatTreeItem(e.element,t,i)}renderChatTreeItem(e,t,i){i.currentElement=e;const n=Uu(e)?"request":vs(e)?"response":"welcome";this.traceLayout("renderElement",`${n}, index=${t}`),wNt.bindTo(i.contextKeyService).set(vs(e)),yNt.bindTo(i.contextKeyService).set(Uu(e)),vNt.bindTo(i.contextKeyService).set(vs(e)&&e.agentOrSlashCommandDetected),vs(e)?(bNt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),iUe.bindTo(i.contextKeyService).set(e.vote===WW.Up?"up":e.vote===WW.Down?"down":"")):iUe.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const o=!!(vs(e)&&e.errorDetails?.responseIsFiltered);if(jXe.bindTo(i.contextKeyService).set(o),i.rowContainer.classList.toggle("interactive-request",Uu(e)),i.rowContainer.classList.toggle("interactive-response",vs(e)),i.rowContainer.classList.toggle("interactive-welcome",tB(e)),i.rowContainer.classList.toggle("filtered-response",o),i.rowContainer.classList.toggle("show-detail-progress",vs(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Ms(i.detail),vs(e)&&this.renderDetail(e,i),vs(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${n}, index=${t}`);const r=i.elementDisposables.add(new X7),a=c=>{try{this.doNextProgressiveRender(e,t,i,!!c)&&r.cancel()}catch(l){r.cancel(),this.logService.error(l)}};r.cancelAndSet(a,50,ct(i.rowContainer)),a(!0)}else vs(e)?this.basicRenderElement(e,t,i):Uu(e)?this.basicRenderElement(e,t,i):this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(ai(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Ms(t.detail),e.agentOrSlashCommandDetected){const i=e.slashCommand?g(7022,"used {0} [[(rerun without)]]",`${nI}${e.slashCommand.name}`):g(7023,"[[(rerun without)]]");aa(t.detail,ALe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:n=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=N4t)}renderAvatar(e,t){const i=vs(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??ve.account;if(i instanceof N){const n=fe("img.icon");n.src=ef.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(fe(".avatar",void 0,n))}else{const n=fe(We.asCSSSelector(i));t.avatarContainer.replaceChildren(fe(".avatar.codicon-avatar",void 0,n))}}getAgentIcon(e){return e?.themeIcon?e.themeIcon:e?.iconDark&&this.themeService.getColorTheme().type===Jg.DARK?e.iconDark:e?.icon?e.icon:ve.copilot}basicRenderElement(e,t,i){let n=[];if(Uu(e)){const c="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);n=[{content:new Mt(c),kind:"markdownContent"}]}else vs(e)&&(e.contentReferences.length&&n.push({kind:"references",references:e.contentReferences}),n.push(...g4e(e.response.value)),e.codeCitations.length&&n.push({kind:"codeCitations",citations:e.codeCitations}));Ms(i.value),vs(e)&&this.renderDetail(e,i);const o=[];if(n.forEach((c,l)=>{const d={element:e,index:l,content:n,preceedingContentParts:o},h=this.renderChatContentPart(c,i,d);h&&(i.value.appendChild(h.domNode),o.push(h))}),i.renderedParts&&bt(i.renderedParts),i.renderedParts=o,Uu(e)&&e.variables.length){const c=this.renderAttachments(e.variables,e.contentReferences,i);c&&(i.value.appendChild(c.domNode),i.elementDisposables.add(c))}if(vs(e)&&e.errorDetails?.message){const c=this.instantiationService.createInstance(GVe,e.errorDetails.responseIsFiltered?"info":"error",new Mt(e.errorDetails.message),this.renderer);i.elementDisposables.add(c),i.value.appendChild(c.domNode)}const r=i.rowContainer.offsetHeight,a=!e.currentRenderedHeight||e.currentRenderedHeight!==r;if(e.currentRenderedHeight=r,a){const c=i.elementDisposables.add(Ll(ct(i.value),()=>{e.currentRenderedHeight=i.rowContainer.offsetHeight,c.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.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){Ms(t.value),e.content.forEach((o,r)=>{if(Array.isArray(o)){const a=t.elementDisposables.add(this.instantiationService.createChild(new Uc([Le,t.contextKeyService])));t.elementDisposables.add(a.createInstance(gZ,t.value,o,this.location,void 0,c=>this._onDidClickFollowup.fire(c)))}else{const a={element:e,index:r,content:[],preceedingContentParts:[]},c=this.renderMarkdown(o,t,a);t.value.appendChild(c.domNode),t.elementDisposables.add(c)}});const i=t.rowContainer.offsetHeight,n=!e.currentRenderedHeight||e.currentRenderedHeight!==i;if(e.currentRenderedHeight=i,n){const o=t.elementDisposables.add(Ll(ct(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,o.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.currentRenderedHeight})}))}}doNextProgressiveRender(e,t,i,n){if(!this._isVisible)return!0;if(e.isCanceled)return this.traceLayout("doNextProgressiveRender",`canceled, index=${t}`),e.renderData=void 0,this.basicRenderElement(e,t,i),!0;let o=!1;this.traceLayout("doNextProgressiveRender",`START progressive render, index=${t}, renderData=${JSON.stringify(e.renderData)}`);const r=this.getNextProgressiveRenderContent(e),a=this.diff(i.renderedParts??[],r,e);if(o=a.every(l=>l===null),o)return e.isComplete?(this.traceLayout("doNextProgressiveRender",`END progressive render, index=${t} and clearing renderData, response is complete`),e.renderData=void 0,this.basicRenderElement(e,t,i),!0):(this.traceLayout("doNextProgressiveRender","caught up with the stream- no new content to render"),!1);this.traceLayout("doNextProgressiveRender",`doing progressive render, ${a.length} parts to render`),this.renderChatContentDiff(a,r,e,i);const c=i.rowContainer.offsetHeight;return e.currentRenderedHeight=c,n||this._onDidChangeItemHeight.fire({element:e,height:i.rowContainer.offsetHeight}),!1}renderChatContentDiff(e,t,i,n){const o=n.renderedParts??[];n.renderedParts=o,e.forEach((r,a)=>{if(!r)return;const c=n.renderedParts?.[a];c&&c.dispose();const l=o.slice(0,a),d={element:i,content:t,preceedingContentParts:l,index:a},h=this.renderChatContentPart(r,n,d);if(h){if(c)try{c.domNode.replaceWith(h.domNode)}catch(u){this.logService.error("ChatListItemRenderer#renderChatContentDiff: error replacing part",u)}else n.value.appendChild(h.domNode);o[a]=h}else c&&c.domNode.remove()})}getNextProgressiveRenderContent(e){const t=this.getDataForProgressiveRender(e),i=g4e(e.response.value);this.traceLayout("getNextProgressiveRenderContent",`Want to render ${t.numWordsToRender} at ${t.rate} words/s, counting...`);let n=t.numWordsToRender;const o=[];e.contentReferences.length&&o.push({kind:"references",references:e.contentReferences});for(let l=0;l0&&a!==e.renderData?.renderedWordCount&&(e.renderData={lastRenderTime:Date.now(),renderedWordCount:a,renderedParts:o}),o}getDataForProgressiveRender(e){const t=e.renderData??{lastRenderTime:0,renderedWordCount:0},i=this.getProgressiveRenderRate(e);return{numWordsToRender:t.lastRenderTime===0?1:t.renderedWordCount+Math.floor((Date.now()-t.lastRenderTime)/1e3*i),rate:i}}diff(e,t,i){const n=[];for(let o=0;oa instanceof zZ).length,r=this.instantiationService.createInstance(zZ,n,i.element,this._treePool,o);if(r.addDisposable(r.onDidChangeHeight(()=>{this.updateItemHeight(t)})),vs(i.element)){const a={treeDataId:n.uri.toString(),treeIndex:o,focus(){r.domFocus()}};r.addDisposable(r.onDidFocus(()=>{this.focusedFileTreesByResponseId.set(i.element.id,a.treeIndex)}));const c=this.fileTreesByResponseId.get(i.element.id)??[];c.push(a),this.fileTreesByResponseId.set(i.element.id,ja(c,l=>l.treeDataId)),r.addDisposable(Ee(()=>this.fileTreesByResponseId.set(i.element.id,c.filter(l=>l.treeDataId!==n.uri.toString()))))}return r}renderContentReferencesListData(e,t,i,n){const o=this.instantiationService.createInstance(UZ,e.references,t,i.element,this._contentReferencesListPool);return o.addDisposable(o.onDidChangeHeight(()=>{this.updateItemHeight(n)})),o}renderCodeCitationsListData(e,t,i){return this.instantiationService.createInstance(OCe,e,t)}renderProgressTask(e,t,i){if(!vs(i.element))return;const n=this.instantiationService.createInstance(DSe,e,this._contentReferencesListPool,this.renderer,i);return n.addDisposable(n.onDidChangeHeight(()=>{this.updateItemHeight(t)})),n}renderConfirmation(e,t,i){const n=this.instantiationService.createInstance(HCe,t,e);return n.addDisposable(n.onDidChangeHeight(()=>this.updateItemHeight(i))),n}renderAttachments(e,t,i){return this.instantiationService.createInstance(FCe,e,t,void 0)}renderTextEdit(e,t,i){const n=this.instantiationService.createInstance(kSe,t,e,this.rendererOptions,this._diffEditorPool,this._currentLayoutWidth);return n.addDisposable(n.onDidChangeHeight(()=>{n.layout(this._currentLayoutWidth),this.updateItemHeight(i)})),n}renderMarkdown(e,t,i){const n=i.element,o=vs(n)&&(!n.isComplete||n.isCanceled||n.errorDetails?.responseIsFiltered||n.errorDetails?.responseIsIncomplete||!!n.renderData),r=i.preceedingContentParts.reduce((l,d)=>l+(d instanceof EZ?d.codeblocks.length:0),0),a=this.instantiationService.createInstance(EZ,e,i,this._editorPool,o,r,this.renderer,this._currentLayoutWidth,this.codeBlockModelCollection,this.rendererOptions);a.addDisposable(a.onDidChangeHeight(()=>{a.layout(this._currentLayoutWidth),this.updateItemHeight(t)}));const c=this.codeBlocksByResponseId.get(n.id)??[];return this.codeBlocksByResponseId.set(n.id,c),a.addDisposable(Ee(()=>{const l=this.codeBlocksByResponseId.get(n.id);l&&a.codeblocks.forEach((d,h)=>delete l[r+h])})),a.codeblocks.forEach((l,d)=>{if(c[r+d]=l,l.uri){const h=l.uri;this.codeBlocksByEditorUri.set(h,l),a.addDisposable(Ee(()=>this.codeBlocksByEditorUri.delete(h)))}}),a}disposeElement(e,t,i){if(this.traceLayout("disposeElement",`Disposing element, index=${t}`),i.renderedParts)try{bt(Fi(i.renderedParts)),i.renderedParts=void 0,Ms(i.value)}catch(n){throw n}i.currentElement=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},MSe=kR,kR.ID="item",kR);$Z=MSe=D([_(6,we),_(7,Te),_(8,Ge),_(9,Le),_(10,pn),_(11,vi),_(12,ec)],$Z);let NSe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=Uu(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return $Z.ID}hasDynamicHeight(e){return!0}};NSe=D([_(1,Ge)],NSe);class fzt extends Lb{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}var WQ,mk;let PSe=(mk=class extends V{get configuration(){return this._config}constructor(e,t,i,n,o,r,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=n,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=>{WQ.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:WQ.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()}},WQ=mk,mk.lineHeightEm=1.4,mk.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"],mk);PSe=WQ=D([_(4,Te),_(5,pn),_(6,xm)],PSe);const pzt=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,mzt=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,_zt=/\/([\w_\-]+)(?=(\s|$|\b))/i;let GZ=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=Ir.Panel,n){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(w=>w instanceof $g)||o.some(w=>w instanceof cb&&w.text.trim()!==""||!(w instanceof $g)))return;const v=o.at(-1)?.range.endExclusive??0;if(t.slice(v,i).trim()==="")return new $g(h,u,p)}tryToParseVariable(e,t,i,n){const o=e.match(mzt);if(!o)return;const[r,a]=o,c=o[2]??"",l=new mi(t,t+r.length),d=new F(i.lineNumber,i.column,i.lineNumber,i.column+r.length),h=n.find(p=>p instanceof $g),u=!h||h.agent.metadata.supportsSlowVariables,f=this.variableService.getVariable(a);if(f&&(!f.isSlow||u))return new m9(l,d,a,c,f.id)}tryToParseSlashCommand(e,t,i,n,o,r){const a=e.match(_zt);if(!a||o.some(f=>f instanceof FW))return;const[c,l]=a,d=new mi(i,i+c.length),h=new F(n.lineNumber,n.column,n.lineNumber,n.column+c.length),u=o.find(f=>f instanceof $g);if(u){if(o.some(b=>b instanceof cb&&b.text.trim()!==""||!(b instanceof $g)&&!(b instanceof cb)))return;const p=o.at(-1)?.range.endExclusive??0;if(t.slice(p,i).trim()!=="")return;const v=u.agent.slashCommands.find(b=>b.name===l);if(v)return new JM(d,h,v)}else{const p=this.slashCommandService.getCommands(r).find(m=>m.command===l);if(p)return new FW(d,h,p);{const v=this.agentService.getDefaultAgent(r)?.slashCommands.find(b=>b.name===l);if(v)return new JM(d,h,v)}}}tryToParseDynamicVariable(e,t,i,n){const o=n.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 mi(t,t+r);return new OW(c,o.range,a,o.id,o.modelDescription,o.data)}}};GZ=D([_(0,_f),_(1,L6),_(2,YRe)],GZ);let FSe=class extends V{constructor(e,t){super(),this.languageService=e,this.textModelService=t,this._models=new ui,this.maxModelCount=100}dispose(){super.dispose(),this.clear()}get(e,t,i){const n=this.getUri(e,t,i),o=this._models.get(n);if(o)return{model:o.model.then(r=>r.object),vulns:o.vulns}}getOrCreate(e,t,i){const n=this.get(e,t,i);if(n)return n;const o=this.getUri(e,t,i),r=this.textModelService.createModelReference(o);for(this._models.set(o,{model:r,vulns:[]});this._models.size>this.maxModelCount;){const a=Array.from(this._models.keys()).at(0);if(!a)break;this.delete(a)}return{model:r.then(a=>a.object),vulns:[]}}delete(e){const t=this._models.get(e);t&&(t.model.then(i=>i.dispose()),this._models.delete(e))}clear(){this._models.forEach(async e=>(await e.model).dispose()),this._models.clear()}async update(e,t,i,n){const o=this.getOrCreate(e,t,i),r=z4t(n.text),a=vzt(r.newText,n.languageId);this.setVulns(e,t,i,r.vulnerabilities);const c=(await o.model).textEditorModel;if(n.languageId){const d=this.languageService.getLanguageIdByLanguageName(n.languageId);d&&d!==c.getLanguageId()&&c.setLanguage(d)}const l=c.getValue(go.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 F(h,u,h,u),text:d}])}else c.setValue(a)}setVulns(e,t,i,n){const o=this.getUri(e,t,i),r=this._models.get(o);r&&(r.vulns=n)}getUri(e,t,i){const n=this.getUriMetaData(t);return N.from({scheme:pe.vscodeChatCodeBlock,authority:e,path:`/${t.id}/${i}`,fragment:n?JSON.stringify(n):void 0})}getUriMetaData(e){if(vs(e))return{references:e.contentReferences.map(t=>{const i="variableName"in t.reference?t.reference.value:t.reference;if(i)return N.isUri(i)?{uri:i.toJSON()}:{uri:i.uri.toJSON(),range:i.range}})}}};FSe=D([_(0,xi),_(1,fn)],FSe);function vzt(s,e){return e==="php"&&!s.trim().startsWith("<")?`e instanceof $g))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}get location(){return this._location.location}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){super(),this.viewContext=t,this.viewOptions=i,this.styles=n,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._onDidChangeAgent=this._register(new I),this.onDidChangeAgent=this._onDidChangeAgent.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._onDidChangeContext=this._register(new I),this.onDidChangeContext=this._onDidChangeContext.event,this._onDidHide=this._register(new I),this.onDidHide=this._onDidHide.event,this._onDidChangeParsedInput=this._register(new I),this.onDidChangeParsedInput=this._onDidChangeParsedInput.event,this._onWillMaybeChangeHeight=new I,this.onWillMaybeChangeHeight=this._onWillMaybeChangeHeight.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),typeof e=="object"?this._location=e:this._location={location:e},ANt.bindTo(r).set(!0),xNt.bindTo(r).set(this._location.location),DNt.bindTo(r).set("resource"in t),this.agentInInput=JXe.bindTo(r),this.requestInProgress=K3.bindTo(r),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance(FSe)),this._register(o.registerCodeEditorOpenHandler(async(v,b,w)=>{let y=v.resource;if(AA(y,pe.vscodeCopilotBackingChatCodeBlock)&&(y=y.with({scheme:pe.vscodeChatCodeBlock})),y.scheme!==pe.vscodeChatCodeBlock)return null;const C=y.path.split("/").at(1);if(!C)return null;const A=this.viewModel?.getItems().find(L=>L.id===C);if(!A)return null;this.reveal(A),await Sr(0);for(const L of this.renderer.editorsInUse()??[])if(xn.isEqual(L.uri,y,!0)){const k=L.editor;return v.options?.selection&&k.setSelection({startLineNumber:v.options.selection.startLineNumber,startColumn:v.options.selection.startColumn,endLineNumber:v.options.selection.endLineNumber??v.options.selection.startLineNumber,endColumn:v.options.selection.endColumn??v.options.selection.startColumn}),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(PSe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,n=this.viewOptions.renderFollowups??!i,o=this.viewOptions.renderStyle;this.container=re(e,mue(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:n,renderStyle:o}),this.listContainer=re(this.container,mue(".interactive-list"))):(this.listContainer=re(this.container,mue(".interactive-list")),this.createInput(this.container,{renderFollowups:n,renderStyle:o})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:o}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),_P(this.tree)),this.contribs=OSe.CONTRIBS.map(r=>{try{return this._register(this.instantiationService.createInstance(r,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Nr(a));return}}).filter(Fc),this.contribs.forEach(r=>{r.onDidChangeInputState&&this._register(r.onDidChangeInputState(()=>{const a=this.collectInputState();this.inputPart.updateState(a)}))})}getContrib(e){return this.contribs.find(t=>t.id===e)}focusInput(){this.inputPart.focus()}hasInputFocus(){return this.inputPart.hasFocus()}getSibling(e,t){if(!vs(e))return;const i=this.viewModel?.getItems();if(!i)return;const n=i.filter(a=>vs(a)),o=n.indexOf(e);if(o===void 0)return;const r=t==="next"?o+1:o-1;if(!(r<0||r>n.length-1))return n[r]}clear(){this._dynamicMessageLayoutData&&(this._dynamicMessageLayoutData.enabled=!0),this._onDidClear.fire()}onDidChangeItems(e){if(this.tree&&this._visible){const t=(this.viewModel?.getItems()??[]).map(n=>({element:n,collapsed:!1,collapsible:!1}));this._onWillMaybeChangeHeight.fire(),this.tree.setChildren(null,t,{diffIdentityProvider:{getId:n=>(vs(n)||Uu(n)?n.dataId:n.id)+(tB(n)&&this.viewModel?`_${Lg[this.viewModel.initState]}`:"")+`${Uu(n)||tB(n)}${vs(n)&&n.renderData?`_${this.visibleChangeCount}`:""}`+(vs(n)?`_${n.contentReferences.length}`:"")+(Uu(n)&&n.contentReferences?`_${n.contentReferences?.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&vs(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&tB(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(jy(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this._register(this.instantiationService.createChild(new Uc([Le,this.contextKeyService])))),n=i.createInstance(NSe,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($Z,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(x3,"Chat",e,n,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(vCe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>Uu(a)?a.message:vs(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([[jXe.key,vs(t)&&!!t.errorDetails?.responseIsFiltered]]);this.contextMenuService.showContextMenu({menuId:_e.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&&Ll(ct(this.listContainer),()=>{_P(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(fZ,this.location,{renderFollowups:t?.renderFollowups??!0,renderStyle:t?.renderStyle==="minimal"?"compact":t?.renderStyle,menus:{executeToolbar:_e.ChatExecute,...this.viewOptions.menus},editorOverflowWidgetsDomNode:this.viewOptions.editorOverflowWidgetsDomNode})),this.inputPart.render(e,"",this),this._register(this.inputPart.onDidLoadInputState(i=>{this.contribs.forEach(n=>{if(n.setInputState){const o=(typeof i=="object"&&i?.[n.id])??{};n.setInputState(o)}})})),this._register(this.inputPart.onDidFocus(()=>this._onDidFocus.fire())),this._register(this.inputPart.onDidChangeContext(i=>this._onDidChangeContext.fire(i))),this._register(this.inputPart.onDidAcceptFollowup(i=>{if(!this.viewModel)return;let n="";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,n=`${QU}${o.name} `,i.followup.subCommand&&(n+=`${nI}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(n=`${nI}${i.followup.subCommand} `);n+=i.followup.message,this.acceptInput(n),i.response&&this.chatService.notifyUserAction({sessionId:this.viewModel.sessionId,requestId:i.response.requestId,agentId:i.response.agent?.id,command:i.response.slashCommand?.name,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(eCe,e,this._codeBlockModelCollection),this.viewModelDisposables.add(M.accumulate(this.viewModel.onDidChange,0)(i=>{this.viewModel&&(this.requestInProgress.set(this.viewModel.requestInProgress),this.onDidChangeItems(),i.some(n=>n?.kind==="addRequest")&&this.visible&&(_P(this.tree),this.focusInput()))})),this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(()=>{this.inputPart.saveState(),this.viewModel=void 0,this.onDidChangeItems()})),this.inputPart.initForNewChatModel(t.inputValue,t.inputState??this.collectInputState()),this.contribs.forEach(i=>{i.setInputState&&t.inputState?.[i.id]&&i.setInputState(t.inputState?.[i.id])}),this.viewModelDisposables.add(e.onDidChange(i=>{i.kind==="setAgent"&&this._onDidChangeAgent.fire({agent:i.agent,slashCommand:i.command})})),this.tree&&(this.onDidChangeItems(),_P(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(n=>n.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,!1)}getInput(){return this.inputPart.inputEditor.getValue()}logInputHistory(){this.inputPart.logInputHistory()}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(),n=e?"query"in e?e.query:`${e.prefix} ${t}`:t,o=!e||"prefix"in e,r=await this.chatService.sendRequest(this.viewModel.sessionId,n,{location:this.location,locationData:this._location.resolveData?.(),parserContext:{selectedAgent:this._lastSelectedAgent},attachedContext:[...this.inputPart.attachedContext.values()]});if(r)return this.inputPart.acceptInput(o),this._onDidSubmitAgent.fire({agent:r.agent,slashCommand:r.slashCommand}),this.inputPart.updateState(this.collectInputState()),this.inputPart.clearContext(),r.responseCompletePromise.then(()=>{const a=this.viewModel?.getItems().filter(vs),c=a?.[a.length-1];this.chatAccessibilityService.acceptResponse(c,i)}),r.responseCreatedPromise}}setContext(e,...t){this.inputPart.attachContext(e,...t)}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 bn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,n=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),n&&_P(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 wn);this._register(this.tree.onDidScroll(n=>{this._dynamicMessageLayoutData?.enabled&&(i.value=Ll(ct(this.listContainer),()=>{if(!n.scrollTopChanged||n.heightChanged||n.scrollHeightChanged)return;const o=n.height,r=n.scrollHeight-o-n.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,n=this.bodyDimension.height,o=this.bodyDimension.width;ta.currentRenderedHeight===void 0),r=o?this._dynamicMessageLayoutData.maxHeight:n.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+r+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(o||!r)&&_P(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},OSe=IR,IR.CONTRIBS=[],IR);y9=OSe=D([_(4,Kt),_(5,Le),_(6,we),_(7,km),_(8,_f),_(9,UN),_(10,lr),_(11,DJe),_(12,Ge),_(13,pn),_(14,YRe)],y9);var HQ;let BSe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=n,this._keybindingService=o,this._accessibilityService=r,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=Bt("div.inline-chat@root",[Bt("div.chat-widget@chatWidget"),Bt("div.accessibleViewer@accessibleViewer"),Bt("div.status@status",[Bt("div.label.info.hidden@infoLabel"),Bt("div.actions.text-style.hidden@toolbar1"),Bt("div.actions.button-style.hidden@toolbar2"),Bt("div.label.status.hidden@statusLabel")])]),this._store=new Z,this._onDidChangeHeight=this._store.add(new I),this.onDidChangeHeight=M.filter(this._onDidChangeHeight.event,C=>!this._isLayouting),this._onDidChangeInput=this._store.add(new I),this.onDidChangeInput=this._onDidChangeInput.event,this._isLayouting=!1,this.scopedContextKeyService=this._store.add(n.createScoped(this._elements.chatWidget));const u=i.createChild(new Uc([Le,this.scopedContextKeyService]),this._store);this._chatWidget=u.createInstance(y9,e,{resource:!0},{defaultElementHeight:32,renderStyle:"minimal",renderInputOnTop:!1,renderFollowups:!0,supportsFileReferences:a.getValue(`chat.experimental.variables.${e.location}`)===!0,filter:C=>!tB(C),...t.chatWidgetViewOptions},{listForeground:lVt,listBackground:iCe,inputEditorBackground:z2,resultEditorBackground:Hc}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(Vre(BVt),ze(iCe)),this._chatWidget.setVisible(!0),this._store.add(this._chatWidget);const f=this._store.add(new Z);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{f.clear();const C=this._chatWidget.viewModel;C&&f.add(C.onDidChange(()=>this._onDidChangeHeight.fire())),this._onDidChangeHeight.fire()})),this._store.add(this.chatWidget.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()})),this._ctxResponseFocused=j4t.bindTo(this._contextKeyService);const p=this._store.add(Ac(this.domNode));this._store.add(p.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(p.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=Q4t.bindTo(n),this._store.add(this._chatWidget.inputEditor.onDidFocusEditorWidget(()=>this._ctxInputEditorFocused.set(!0))),this._store.add(this._chatWidget.inputEditor.onDidBlurEditorWidget(()=>this._ctxInputEditorFocused.set(!1)));const m=t.statusMenuId instanceof _e?t.statusMenuId:t.statusMenuId.menu,v=u.createInstance(bm,this._elements.toolbar1,m,{hiddenItemStrategy:aA.NoHide,telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,actionViewItemProvider:C=>C instanceof Sc?this._instantiationService.createInstance(C6,C,{conversational:!0}):void 0,toolbarOptions:{primaryGroup:"0_main"},menuOptions:{renderShortTitle:!0},label:!0,icon:!1});this._store.add(v.onDidChangeMenuItems(()=>this._onDidChangeHeight.fire())),this._store.add(v);const b=t.statusMenuId instanceof _e?void 0:t.statusMenuId.options,w=u.createInstance(_Ce,this._elements.toolbar2,m,{toolbarOptions:{primaryGroup:"0_main"},telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,menuOptions:{renderShortTitle:!0},...b});this._store.add(w.onDidChange(()=>this._onDidChangeHeight.fire())),this._store.add(w);const y=()=>this._elements.status.classList.toggle("text",this._configurationService.getValue($h.ExpTextButtons));this._store.add(this._configurationService.onDidChangeConfiguration(C=>C.affectsConfiguration($h.ExpTextButtons)&&y())),y(),this._store.add(this._configurationService.onDidChangeConfiguration(C=>{C.affectsConfiguration(vr.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupManagedHover(Pr("element"),this._elements.statusLabel,()=>this._elements.statusLabel.dataset.title)),this._store.add(this._chatService.onDidPerformUserAction(C=>{C.sessionId===this._chatWidget.viewModel?.model.sessionId&&C.action.kind==="vote"&&this.updateStatus("Thank you for your feedback!",{resetAfter:1250})})),this._defaultChatModel=this._store.add(this._instantiationService.createInstance(hZ,void 0,Ir.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(vr.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=bzt;if(this._configurationService.getValue(vr.InlineChat)){const t=this._keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp)?.getLabel();e=t?g(11375,"Inline Chat Input, Use {0} for Inline Chat Accessibility Help.",t):g(11376,"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=fb(this._elements.status);this._elements.root.style.height=`${e.height-t}px`,this._elements.root.style.width=`${e.width}px`,this._chatWidget.layout(e.height-i-t,e.width)}get contentHeight(){const e={chatWidgetContentHeight:this._chatWidget.contentHeight,statusHeight:fb(this._elements.status),extraHeight:this._getExtraHeight()};return e.chatWidgetContentHeight+e.statusHeight+e.extraHeight}get minHeight(){let e=100;for(const i of this._chatWidget.viewModel?.getItems()??[])if(vs(i)&&i.response.value.some(n=>n.kind==="textEditGroup"&&!n.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 10}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 dt(1,t,Number.MAX_SAFE_INTEGER,1))}set placeholder(e){this._chatWidget.setInputPlaceholder(e)}updateToolbar(e){this._elements.root.classList.toggle("toolbar",e),this._elements.toolbar1.classList.toggle("hidden",!e),this._elements.toolbar2.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)return;const i=t.getItems().filter(o=>vs(o));if(!i.length)return;const n=i[i.length-1];return t.codeBlockModelCollection.get(t.sessionId,n,e)?.model}get responseContent(){const e=this._chatWidget.viewModel?.model.getRequests();if(eo(e))return Cg(e)?.response?.response.toString()}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(!0)}updateChatMessage(e,t,i){if(!this._chatWidget.viewModel||this._chatWidget.viewModel.model!==this._defaultChatModel)return;const n=this._defaultChatModel;if(!e?.message.value){for(const r of n.getRequests())n.removeRequest(r.id);return}const o=n.addRequest({parts:[],text:""},{variables:[]},0);if(n.acceptResponseProgress(o,{kind:"markdownContent",content:e.message}),!t){n.completeResponse(o);return}return{cancel:()=>n.cancelRequest(o),complete:()=>n.completeResponse(o),appendContent:r=>{n.acceptResponseProgress(o,{kind:"markdownContent",content:new Mt(r)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=Eb(e);aa(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 n=Eb(e);aa(this._elements.statusLabel,...n),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.setContext(!0),this._chatWidget.saveState(),this.updateChatMessage(void 0),aa(this._elements.statusLabel),this._elements.statusLabel.classList.toggle("hidden",!0),this._elements.toolbar1.classList.add("hidden"),this._elements.toolbar2.classList.add("hidden"),this.updateInfo(""),this.chatWidget.setModel(this._defaultChatModel,{}),this._elements.accessibleViewer.classList.toggle("hidden",!0),this._onDidChangeHeight.fire()}focus(){this._chatWidget.focusInput()}hasFocus(){return this.domNode.contains(Bc())}};BSe=D([_(2,we),_(3,Le),_(4,Ut),_(5,mr),_(6,Te),_(7,Dm),_(8,fn),_(9,km),_(10,ec)],BSe);const bzt=g(11377,"Inline Chat Input");let WSe=class extends BSe{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(e,{...i,chatWidgetViewOptions:{...i.chatWidgetViewOptions,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()}},r,n,o,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new wn)}get contentHeight(){let e=super.contentHeight;return this._accessibleViewer.value&&(e+=this._accessibleViewer.value.height+8),e}_doLayout(e){let t=e.height;this._accessibleViewer.value&&(this._accessibleViewer.value.width=e.width-12,t-=this._accessibleViewer.value.height+8),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(HSe,this._elements.accessibleViewer,e,t,new wzt(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};WSe=D([_(3,Le),_(4,Ut),_(5,we),_(6,mr),_(7,Te),_(8,Dm),_(9,fn),_(10,km),_(11,ec)],WSe);let HSe=HQ=class extends Ix{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,n,o){const r=jt("width",0),a=jt("diff",HQ._asMapping(i)),c=Ze(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=n.getModifiedOptions().get(x.lineHeight)*l;super(e,nd(!0),()=>{},nd(!1),r,nd(d),c,n,o),this.height=d,this._width2=r,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(HQ._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),n=pi.fromRangeInclusive(t[0]),o=pi.fromRangeInclusive(i[0]),r=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(WSe,e,this.editor,{statusMenuId:{menu:cVt,options:{buttonConfigProvider:l=>new Set([oVt,rVt]).has(l.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:l.id===sVt?{isSecondary:!1}:{isSecondary:!0}}},chatWidgetViewOptions:{menus:{executeToolbar:Ltt,telemetrySource:"interactiveEditorWidget-toolbar"},rendererOptions:{renderTextEditsAsSummary:l=>ji(l,t.getModel()?.uri)&&r.getValue($h.Mode)===Fy.Live}}}),this._disposables.add(this.widget);let a;this._disposables.add(this.widget.chatWidget.onWillMaybeChangeHeight(()=>{this.position&&(a=tx.capture(this.editor))})),this._disposables.add(this.widget.onDidChangeHeight(()=>{if(this.position){a??=tx.capture(this.editor);const l=this._computeHeight();this._relayout(l.linesValue),a.restore(this.editor),a=void 0,this._revealTopOfZoneWidget(this.position,l)}})),this.create(),this._disposables.add(ue(this.domNode,"click",l=>{!this.editor.hasWidgetFocus()&&!this.widget.hasFocus()&&this.editor.focus()},!0));const c=()=>{!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(l=>c())),this._disposables.add(this.editor.onDidFocusEditorText(l=>c())),c()}_fillContainer(e){e.appendChild(this.widget.domNode)}_doLayout(e){const t=this.editor.getLayoutInfo();let i=t.contentWidth-(t.glyphMarginWidth+t.decorationsWidth);i=Math.min(640,i),this._dimension=new bn(i,e),this.widget.layout(this._dimension)}_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){Tt(this.container);const t=tx.capture(this.editor),i=this.editor.getLayoutInfo(),n=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${n}px`;const o=this._computeHeight();super.show(e,o.linesValue),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),this._revealTopOfZoneWidget(e,o)}updatePositionAndHeight(e){const t=tx.capture(this.editor),i=this._computeHeight();super.updatePositionAndHeight(e,i.linesValue),t.restore(this.editor),this._revealTopOfZoneWidget(e,i)}_revealTopOfZoneWidget(e,t){const i=e.lineNumber<=1?1:1+e.lineNumber,n=this.editor.getScrollTop(),o=this.editor.getTopForLineNumber(i),r=o-t.pixelsValue,a=this.editor.getLayoutInfo().height,c=this.editor.getBottomForLineNumber(i);let l=r,d=!1;c>=n+a&&(l=c-a,d=!0),(l!1},{listForeground:Rl,listBackground:iCe,inputEditorBackground:z2,resultEditorBackground:Hc}),this._store.add(this._widget),this._widget.render(this._inputContainer),this._widget.setModel(this._defaultChatModel,{}),this._store.add(this._widget.onDidChangeContentHeight(()=>t.layoutContentWidget(this))),this._domNode.tabIndex=-1,this._domNode.className="inline-chat-content-widget interactive-session",this._domNode.appendChild(this._inputContainer),this._toolbarContainer.classList.add("toolbar"),o.getValue($h.ExpTextButtons)&&(this._toolbarContainer.style.display="inherit",this._domNode.style.paddingBottom="4px"),this._domNode.appendChild(this._toolbarContainer);const c=this._store.add(a.createInstance(bm,this._toolbarContainer,aVt,{actionViewItemProvider:h=>h instanceof Sc?i.createInstance(C6,h,{conversational:!0}):void 0,toolbarOptions:{primaryGroup:"0_main"},icon:!1,label:!0}));this._store.add(c.onDidChangeMenuItems(()=>{this._domNode.classList.toggle("contents",c.getItemsLength()>1)}));let l=!1;this._store.add(this._widget.inputEditor.onDidChangeModelContent(()=>{l||=this._widget.inputEditor.getModel()?.getValueLength()!==0})),this._store.add(this._widget.onDidChangeContext(()=>{l||=!0,t.layoutContentWidget(this)}));const d=Ac(this._domNode);this._store.add(d.onDidBlur(()=>{this._visible&&!l&&!r.currentQuickInput&&this._onDidBlur.fire()})),this._store.add(d)}dispose(){this._store.dispose()}getId(){return"inline-chat-content-widget"}getDomNode(){return this._domNode}getPosition(){return this._position?{position:this._position,preference:[es.ABOVE]}:null}beforeRender(){const e=this._widget.input.inputEditor.getOption(x.lineHeight)*5,t=this._widget.contentHeight,i=Math.min(e,t),n=390;return this._widget.layout(i,n),UGe(this._domNode,n,null),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(F.fromPositions(e),mt.Immediate);const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new oe(e.lineNumber,t.startColumn):e,this._editor.addContentWidget(this),this._widget.setContext(!0),this._widget.setVisible(!0)}}hide(){this._visible&&(this._visible=!1,this._editor.removeContentWidget(this),this._widget.inputEditor.setValue(""),this._widget.saveState(),this._widget.setVisible(!1))}setSession(e){this._widget.setModel(e.chatModel,{}),this._widget.setInputPlaceholder(e.agent.description??"")}};VSe=D([_(2,we),_(3,Le),_(4,Te),_(5,In)],VSe);let KZ=class extends Ob{get capabilities(){let e=Ei.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly):e|=Ei.Untitled,e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,n,o,r,a){super(),this.resource=e,this.labelService=i,this.fileService=n,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){ji(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=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.shortDescription;case Ls.LONG:return this.longDescription;case Ls.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Lr(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Lr(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Lr(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 Ls.SHORT:return this.shortTitle;case Ls.LONG:return this.longTitle;default:case Ls.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=JSt(this.resource);let i;const n=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return nut(n)&&(i=n.value*Nc.MB),{size:i??t}}};KZ=D([_(2,Fs),_(3,Jt),_(4,_d),_(5,Ec),_(6,nE)],KZ);let C9=class extends oI{constructor(e,t,i,n,o){super(i,t,n,o,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};C9=D([_(1,xi),_(2,gi),_(3,O6),_(4,mr)],C9);var UQ;let lb=class extends KZ{constructor(e,t,i,n,o,r,a,c,l){super(e,t,o,r,a,c,l),this.editorService=i,this.textFileService=n}save(e,t){return this.resource.scheme!==pe.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 n;if(t?n=await this.textFileService.saveAs(this.resource,void 0,{...e,suggestedTarget:this.preferredResource}):n=await this.textFileService.save(this.resource,e),!!n)return{resource:n}}async revert(e,t){await this.textFileService.revert(this.resource,t)}};lb=D([_(2,ei),_(3,Fo),_(4,Fs),_(5,Jt),_(6,_d),_(7,Ec),_(8,nE)],lb);var TR;let MT=(TR=class extends lb{get typeId(){return UQ.ID}get editorId(){return rm.id}constructor(e,t,i,n,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=n,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,n=i.object;if(!(n instanceof C9))throw i.dispose(),this.modelReference=void 0,new Error(`Unexpected model for TextResourceEditorInput: ${this.resource}`);return this.cachedModel=n,(typeof e=="string"||typeof t=="string")&&n.updateTextEditorModel(typeof e=="string"?oae(e):void 0,t),n}matches(e){return this===e?!0:e instanceof UQ?ji(e.resource,this.resource):Qv(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},UQ=TR,TR.ID="workbench.editors.resourceEditorInput",TR);MT=UQ=D([_(5,fn),_(6,Fo),_(7,ei),_(8,Jt),_(9,Fs),_(10,_d),_(11,Ec),_(12,nE)],MT);const Jr=Za;var VQ,LR;let S9=(LR=class extends lb{get typeId(){return VQ.ID}get editorId(){return rm.id}constructor(e,t,i,n,o,r,a,c,l,d,h){super(e.resource,void 0,n,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){ji(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Ls.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?x8(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=YO(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 VQ?ji(e.resource,this.resource):$0t(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){bt(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},VQ=LR,LR.ID="workbench.editors.untitledEditorInput",LR);S9=VQ=D([_(1,Fo),_(2,Fs),_(3,ei),_(4,Jt),_(5,Jr),_(6,bf),_(7,_d),_(8,fn),_(9,Ec),_(10,nE)],S9);const Poe=class Poe extends Error{constructor(e){super(e),this.name=Poe.code}};Poe.code="InlineChatError";let qZ=Poe,KVe=class{constructor(e,t,i,n,o,r,a,c,l){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=n,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=[]}dispose(){this._store.dispose(),this._sessions.forEach(e=>e.store.dispose()),this._sessions.clear()}async createSession(e,t,i){const n=this._chatAgentService.getDefaultAgent(Ir.Editor);if(!n){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const o=e.getModel(),r=e.getSelection(),a=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${n.extensionId}`);const c=this._chatService.startSession(Ir.Editor,i);if(!c){this._logService.trace("[IE] NO chatModel found");return}a.add(Ee(()=>{this._chatService.clearSession(c.sessionId),c.dispose()}));const l=a.add(new wn);a.add(c.onDidChange(b=>{if(b.kind!=="addRequest"||!b.request.response)return;const{response:w}=b.request;l.value=w.onDidChange(()=>{if(!w.isComplete)return;l.clear();let y;w.isCanceled?y=new sCe(new Ma):w.result?.errorDetails?y=new sCe(new Error(w.result.errorDetails.message)):w.response.value.length===0?y=new Rtt:y=this._instaService.createInstance(VW,m.textModelN.uri,b.request,w),m.addExchange(new fVt(m.lastInput,y)),y instanceof VW&&y.untitledTextModel&&this._textModelService.createModelReference(y.untitledTextModel.resource).then(C=>{a.add(C)})})})),a.add(this._chatAgentService.onDidChangeAgents(b=>{b===void 0&&!this._chatAgentService.getAgent(n.id)&&(this._logService.trace(`[IE] provider GONE for ${e.getId()}, ${n.extensionId}`),this._releaseSession(m,!0))}));const d=ar(),h=o.uri;a.add(await this._textModelService.createModelReference(o.uri));const u=o,f=a.add(this._modelService.createModel(u6(o.createSnapshot()),{languageId:o.getLanguageId(),onDidChange:M.None},h.with({scheme:pe.vscode,authority:"inline-chat",path:"",query:new URLSearchParams({id:d,textModel0:""}).toString()}),!0));h.scheme===pe.untitled&&a.add(this._editorService.onDidCloseEditor(()=>{this._editorService.isOpened({resource:h,typeId:S9.ID,editorId:rm.id})||this._releaseSession(m,!0)}));let p=t.wholeRange;if(p||(p=new F(r.selectionStartLineNumber,r.selectionStartColumn,r.positionLineNumber,r.positionColumn)),i.isCancellationRequested){a.dispose();return}const m=new uVt(t.editMode,h,f,u,n,a.add(new nCe(u,p)),a.add(new rCe(this._editorWorkerService,f,u)),c),v=this._key(e,m.targetUri);if(this._sessions.has(v))throw a.dispose(),new Error(`Session already stored for ${v}`);return this._sessions.set(v,{session:m,editor:e,store:a}),m}moveSession(e,t){const i=this._key(t,e.targetUri),n=this._sessions.get(i);if(n){if(n.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[n,o]=i;this._sessions.delete(n),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 n=this._instaService.createInstance(oCe,t,e,i);return this._onDidStashSession.fire({editor:t,session:e}),this._logService.trace(`[IE] did STASH session for ${t.getId()}, ${e.agent.extensionId}`),n}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}};KVe=D([_(0,Yi),_(1,gi),_(2,fn),_(3,Ml),_(4,Ge),_(5,we),_(6,ei),_(7,km),_(8,_f)],KVe);var $B;let qVe=($B=class{constructor(e,t){this._store=new Z,this._ctxHasProvider=K4t.bindTo(e),this._store.add(t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(Ir.Editor);this._ctxHasProvider.set(i)}))}dispose(){this._ctxHasProvider.reset(),this._store.dispose()}},$B.Id="inlineChat.enabler",$B);qVe=D([_(0,Le),_(1,_f)],qVe);var Dr;(function(s){s.CREATE_SESSION="CREATE_SESSION",s.INIT_UI="INIT_UI",s.WAIT_FOR_INPUT="WAIT_FOR_INPUT",s.SHOW_REQUEST="SHOW_REQUEST",s.SHOW_RESPONSE="SHOW_RESPONSE",s.PAUSE="PAUSE",s.CANCEL="CANCEL",s.ACCEPT="DONE"})(Dr||(Dr={}));var Ul;(function(s){s[s.NONE=0]="NONE",s[s.ACCEPT_SESSION=1]="ACCEPT_SESSION",s[s.CANCEL_SESSION=2]="CANCEL_SESSION",s[s.PAUSE_SESSION=4]="PAUSE_SESSION",s[s.CANCEL_REQUEST=8]="CANCEL_REQUEST",s[s.CANCEL_INPUT=16]="CANCEL_INPUT",s[s.ACCEPT_INPUT=32]="ACCEPT_INPUT"})(Ul||(Ul={}));let QVe=class{static get(e){return e.getContribution(b4e)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,n,o,r,a,c,l,d,h){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=n,this._editorWorkerService=o,this._logService=r,this._configurationService=a,this._dialogService=c,this._chatService=d,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 wn),this._forcedPlaceholder=void 0,this._ctxVisible=q4t.bindTo(l),this._ctxUserDidEdit=X4t.bindTo(l),this._ctxResponseType=nVt.bindTo(l),this._ctxRequestInProgress=iVt.bindTo(l),this._ui=new ya(()=>{const u={location:Ir.Editor,resolveData:()=>(Tt(this._editor.hasModel()),Tt(this._session),{type:Ir.Editor,selection:this._editor.getSelection(),document:this._session.textModelN.uri,wholeRange:this._session?.wholeRange.trackedInitialRange})};for(const m of h.listNotebookEditors())for(const[,v]of m.codeEditors)if(v===this._editor){u.location=Ir.Notebook;break}const f=this._store.add(t.createInstance(VSe,u,this._editor)),p=this._store.add(t.createInstance(USe,u,this._editor));return{content:f,zone:p}}),this._store.add(this._editor.onDidChangeModel(async u=>{if(this._session||!u.newModelUrl)return;const f=this._inlineChatSessionService.getSession(this._editor,u.newModelUrl);f&&(this._log("session RESUMING after model change",u),await this.run({existingSession:f}))})),this._store.add(this._inlineChatSessionService.onDidEndSession(u=>{u.session===this._session&&u.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 u=>{u.editor===this._editor&&(this._log("session RESUMING after move",u),await this.run({existingSession:u.session}))})),this._log("NEW controller")}dispose(){this._currentRun&&this._messages.fire(this._session?.chatModel.hasRequests?Ul.PAUSE_SESSION:Ul.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 b4e}_getMode(){return this._configurationService.getValue($h.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(Dr.CREATE_SESSION,e),await this._currentRun}catch(t){vt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[Dr.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[Dr.CREATE_SESSION](e){Tt(this._session===void 0),Tt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=oe.lift(e.position).delta(-1),delete e.position);const n=this._showWidget(!0,i);let o=g(7081,"Failed to start editor chat");if(!t){const r=new ci,a=M.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===Ul.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateInfo(g(7082,"Getting ready..."))):r.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},r.token)}catch(c){(c instanceof qZ||c?.name===qZ.code)&&(o=c.message)}if(r.dispose(),a.dispose(),r.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),Dr.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Lh.get(this._editor)?.showMessage(o,n),this._log("Failed to start editor chat"),Dr.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case Fy.Preview:this._strategy=this._instaService.createInstance(fCe,t,this._editor,this._ui.value.zone);break;case Fy.Live:default:this._strategy=this._instaService.createInstance(pCe,t,this._editor,this._ui.value.zone);break}return this._session=t,Dr.INIT_UI}async[Dr.INIT_UI](e){Tt(this._session),Tt(this._strategy),fu.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const o=this._strategy?.getWholeRangeDecoration()??[];t.set(o)};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(),this._showWidget(!this._session.chatModel.hasRequests),this._ui.value.zone.widget.updateToolbar(!0),this._sessionStore.add(this._editor.onDidChangeModel(o=>{const r=this._session?.chatModel.hasRequests?Ul.PAUSE_SESSION:Ul.CANCEL_SESSION;this._log("model changed, pause or cancel session",r,o),this._messages.fire(r)}));const n=this._editor.getModel()?.getAlternativeVersionId();return this._sessionStore.add(this._editor.onDidChangeModelContent(o=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(n!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const r=this._session.wholeRange;let a=!1;if(this._configurationService.getValue($h.FinishOnType))for(const{range:c}of o.changes)a=!F.areIntersectingOrTouching(c,r.value);this._session.recordExternalEditOccurred(a),a&&(this._log("text changed outside of whole range, FINISH session"),this.finishExistingSession())})),this._sessionStore.add(this._session.chatModel.onDidChange(async o=>{o.kind==="removeRequest"&&await this._session.undoChangesUntil(o.requestId)})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,Dr.SHOW_RESPONSE):Dr.WAIT_FOR_INPUT}async[Dr.WAIT_FOR_INPUT](e){Tt(this._session),Tt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),Mr(e.message),delete e.message,this._showWidget(!1));let t=Ul.NONE,i;const n=new qd,o=new Z;return o.add(this._session.chatModel.onDidChange(r=>{r.kind==="addRequest"&&(i=r.request,t=Ul.ACCEPT_INPUT,n.open())})),o.add(this._strategy.onDidAccept(()=>this.acceptSession())),o.add(this._strategy.onDidDiscard(()=>this.cancelSession())),o.add(M.once(this._messages.event)(r=>{this._log("state=_waitForInput) message received",r),t=r,n.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await n.wait(),o.dispose(),t&(Ul.CANCEL_INPUT|Ul.CANCEL_SESSION)?Dr.CANCEL:t&Ul.PAUSE_SESSION?Dr.PAUSE:t&Ul.ACCEPT_SESSION?(this._ui.value.zone.widget.selectAll(!1),Dr.ACCEPT):i?.message.text?(this._session.addInput(new gVt(i,this._editor.getModel().getAlternativeVersionId())),Dr.SHOW_REQUEST):Dr.WAIT_FOR_INPUT}async[Dr.SHOW_REQUEST](){Tt(this._session),Tt(this._session.chatModel.requestInProgress),this._ctxRequestInProgress.set(!0);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Tt(t),Tt(t.response),this._showWidget(!1),this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,n=new dc,o=new Z,r=o.add(new ci),a=new aTe,c=js.create(),l=new bI;let d=Dr.SHOW_RESPONSE;o.add(M.once(this._messages.event)(y=>{this._log("state=_makeRequest) message received",y),this._chatService.cancelCurrentRequestForSession(e.sessionId),y&Ul.CANCEL_SESSION?d=Dr.CANCEL:y&Ul.PAUSE_SESSION?d=Dr.PAUSE:y&Ul.ACCEPT_SESSION&&(d=Dr.ACCEPT)})),o.add(e.onDidChange(y=>{y.kind==="removeRequest"&&y.requestId===t.id&&(r.cancel(),n.complete(),y.reason===_9.Resend?d=Dr.SHOW_REQUEST:d=Dr.CANCEL)})),o.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new Z2,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):ar(),applied:0};let v;const b=()=>{if(this._updateCtxResponseType(),v||(v=i.response.value.find(y=>y.kind==="textEditGroup"&&ji(y.uri,this._session?.textModelN.uri))),v){v.state??=m;const y=v.edits,C=y.slice(h);C.length>0&&(h=y.length,a.update(c.elapsed()),c.reset(),l.queue(async()=>{const A=this._session.wholeRange.value.getStartPosition();for(const k of C)await this._makeChanges(k,{duration:a.value,token:r.token},u),u=!1;const L=this._session.wholeRange.value.getStartPosition();(!L.equals(A)||!this._ui.value.zone.position?.equals(L))&&this._showWidget(!1,L.delta(-1))}))}i.isCanceled?(r.cancel(),n.complete()):i.isComplete&&n.complete()};o.add(i.onDidChange(b)),b(),await n.p,await l.whenIdle(),i.isCanceled&&await this._session.undoChangesUntil(i.requestId),o.dispose();const w=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(w?.changes??[]),await this._session.hunkData.recompute(m,w),this._ctxRequestInProgress.set(!1),d}async[Dr.SHOW_RESPONSE](){Tt(this._session),Tt(this._strategy);const{response:e}=this._session.lastExchange;let t;if(e instanceof Rtt){const i=g(7083,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(i,{classes:["warn"]}),Dr.WAIT_FOR_INPUT}else if(e instanceof sCe)e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel());else if(e instanceof VW){this._ui.value.zone.widget.updateStatus("");const i=await this._strategy.renderChanges();if(i){const n=this._editor.getSelection();n?.containsPosition(i)?i.lineNumber-n.startLineNumber>8&&(t=i):t=i}}return this._showWidget(!1,t),Dr.WAIT_FOR_INPUT}async[Dr.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[Dr.ACCEPT](){Tt(this._session),Tt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(7084,"Failed to apply changes.",Nr(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[Dr.CANCEL](){if(this._session){Tt(this._strategy),this._sessionStore.clear();const e=!this._session.isUnstashed&&this._session.chatModel.hasRequests&&this._session.hunkData.size===this._session.hunkData.pending;let t=[];try{t=this._strategy.cancel()}catch(i){this._dialogService.error(g(7085,"Failed to discard changes.",Nr(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){Tt(this._editor.hasModel()),this._ctxVisible.set(!0);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.chatModel.hasRequests)&&(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)),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()}_updateCtxResponseType(){if(!this._session){this._ctxResponseType.set(O1.None);return}const e=i=>i.value.some(n=>n.kind==="textEditGroup"&&ji(n.uri,this._session?.textModelN.uri));let t=O1.None;for(const i of this._session.chatModel.getRequests())if(i.response&&(t=O1.Messages,e(i.response.response))){t=O1.MessagesAndEdits;break}this._ctxResponseType.set(t)}async _makeChanges(e,t,i){Tt(this._session),Tt(this._strategy);const n=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,n),n?.length===0)return;const r=(!t&&n?n:e).map(nTe.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),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?.agent.description??""}showSaveHint(){const e=g(7086,"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 dt(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(Ul.CANCEL_INPUT|Ul.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,n=e?i:i+1;this._editor.setPosition({lineNumber:n,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,n=this._session.chatModel.getRequests();for(const r of n)if(r.response)for(const a of r.response.response.value)a.kind==="textEditGroup"&&ji(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const o=this._strategy.cancel();e&&(Tt(t),t.edits=[o]),await this._instaService.invokeFunction(Czt,this._session?.chatModel),this.cancelSession()}toggleDiff(){this._strategy?.toggleDiff?.()}acceptSession(){const e=this._session?.chatModel.getRequests().at(-1)?.response;e&&this._chatService.notifyUserAction({sessionId:e.session.sessionId,requestId:e.requestId,agentId:e.agent?.id,command:e.slashCommand?.name,result:e.result,action:{kind:"inlineChat",action:"accepted"}}),this._messages.fire(Ul.ACCEPT_SESSION)}acceptHunk(){return this._strategy?.acceptHunk()}discardHunk(){return this._strategy?.discardHunk()}async cancelSession(){const e=this._session?.chatModel.getRequests().at(-1)?.response;e&&this._chatService.notifyUserAction({sessionId:e.session.sessionId,requestId:e.requestId,agentId:e.agent?.id,command:e.slashCommand?.name,result:e.result,action:{kind:"inlineChat",action:"discarded"}}),this._messages.fire(Ul.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===Fy.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}};QVe=D([_(1,we),_(2,ZRe),_(3,RJe),_(4,Ml),_(5,Ge),_(6,Te),_(7,to),_(8,Le),_(9,km),_(10,R6)],QVe);async function Czt(s,e){const t=s.get(Lm),i=s.get(km),n=await M4t(t);if(n&&n.viewModel&&e){for(const o of e.getRequests().slice())await i.adoptRequest(n.viewModel.model.sessionId,o);n.focusLastMessage()}}const Szt="workbench.action.quickchat.toggle";var zSe;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(zSe||(zSe={}));function oit(s){const e=[],t=new Map,i=(n,o)=>{if(!t.has(n)&&(t.set(n,!0),!(n[0]==="_"||n.indexOf("vscode.")===0)&&s.get(n)!==!0)){if(!o){const r=_t.getCommand(n);if(r&&typeof r.metadata=="object"&&eo(r.metadata.args))return}e.push(n)}};for(const n of jn.getMenuItems(_e.CommandPalette))bT(n)&&i(n.command.id,!0);for(const n of ap.getEditorActions())i(n.id,!0);for(const n of _t.getCommands().keys())i(n,!1);return e}var Bm;const _ue="keybinding.entry.template",jVe=g(4636,"System"),YVe=g(4637,"Extension"),JVe=g(4638,"User");function Azt(s,e){const t=e?` +when:${e}`:"";return`@command:${s}${t}`}const Ezt=q2(CM,TE,lae),xzt=/@command:\s*([^\+]+)/i,Dzt=/\+when:\s*(.+)/i,XVe=/@source:\s*(user|default|system|extension)/i,ZVe=/@ext:\s*((".+")|([^\s]+))/i,kzt=/@keybinding:\s*((\".+\")|(\S+))/i;let e5e=Bm=class extends RI{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:p6.modifierLabels[e],aria:hje.modifierLabels[e],user:FLe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const n=xzt.exec(e);if(n&&n[1]){const o=n[1].trim();let r=i.filter(a=>a.command===o);if(r.length){const a=Dzt.exec(e);if(a&&a[1]){const c=a[1].trim();r=this.filterByWhen(r,o,c)}}return r.map(a=>({id:Bm.getId(a),keybindingItem:a,templateId:_ue}))}if(XVe.test(e))i=this.filterBySource(i,e),e=e.replace(XVe,"");else{const o=ZVe.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(ZVe,"")}else{const r=kzt.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:Bm.getId(o),keybindingItem:o,templateId:_ue}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===jVe):/@source:\s*user/i.test(t)?e.filter(i=>i.source===JVe):/@source:\s*extension/i.test(t)?e.filter(i=>!Lt(i.source)||i.source===YVe):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!Lt(i.source)&&(Sn.equals(i.source.identifier,t)||i.source.displayName?.toLowerCase()===t.toLowerCase()))}filterByText(e,t){const i=t.charAt(0)==='"',n=t.charAt(t.length-1)==='"',o=i&&n;i&&(t=t.substring(1)),n&&(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 Izt(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:Bm.getId(l),templateId:_ue,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 n=e.filter(c=>c.when===i);if(n.length)return n;const o=e[0].commandLabel,r=new Dx(void 0,t,null,he.deserialize(i),!1,null,!1),a=new Map([[t,o]]);return[Bm.toKeybindingEntry(t,r,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Fi(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(Bm.toKeybindingEntry(o.command,o,e,t)),i.set(o.command,!0));const n=this.keybindingsService.getDefaultKeybindings().map(o=>o.command);for(const o of oit(i)){const r=new Dx(void 0,o,null,void 0,n.indexOf(o)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(Bm.toKeybindingEntry(o,r,e,t))}return this._keybindingItemsSortedByPrecedence=ja(this._keybindingItemsSortedByPrecedence,o=>Bm.getId(o)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((o,r)=>Bm.compareKeybindingData(o,r)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+(Lt(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new va;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,n){const o=jn.getCommand(e),r=i.get(e);let a=JVe;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:o?.source?.id);a=c?n.get(c)??YVe:jVe}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:Bm.getCommandLabel(o,r),commandDefaultLabel:Bm.getCommandDefaultLabel(o),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!xk.isDefaultVariant()&&e&&e.title&&e.title.original){const t=e.category?e.category.original:void 0,i=e.title.original;return t?g(4639,"{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,n=typeof e.title=="string"?e.title:e.title.value;return i?g(4639,"{0}: {1}",i,n):n}return t||""}};e5e=Bm=D([_(1,Ut),_(2,fs)],e5e);class Izt{constructor(e,t,i,n,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,q2(TE,FY),n),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>TE(a,t.commandLabel,!0),n):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>TE(a,t.commandDefaultLabel,!0),n):null,this.whenMatches=t.when?this.matches(null,t.when,q2(TE,FY),n):null,Lt(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>TE(a,t.source,!0),n):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>TE(a,t.commandLabel,!0),n):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,o,r):null}matches(e,t,i,n){let o=e?Ezt(e,t):null;return o||(o=this.matchesWords(n,t,i)),o&&(o=this.filterAndSort(o)),o}matchesWords(e,t,i){let n=[];for(const o of e){const r=i(o,t);if(r)n=[...n||[],...r];else{n=null;break}}return n}filterAndSort(e){return ja(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,n){const[o,r]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&wS(t,a)===0||c&&wS(t,c)===0||l&&wS(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(871,"No matching commands"),commandId:""})},n,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=IGe(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:We.asClassName(ve.gear),tooltip:g(872,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:Azt(t.commandId,t.commandWhen)}),IS.CLOSE_PICKER)}))}hasAdditionalCommandPicks(e,t){return!(!this.useAiRelatedInfo||t.isCancellationRequested||e===""||!this.aiRelatedInformationService.isEnabled())}async getAdditionalCommandPicks(e,t,i,n){if(!this.hasAdditionalCommandPicks(i,n))return[];let o;try{await Sr(DV.AI_RELATED_INFORMATION_DEBOUNCE,n),o=await this.getRelatedInformationPicks(e,t,i,n)}catch{return[]}(t.length||o.length)&&o.push({type:"separator"});const r=this.chatAgentService.getDefaultAgent(Ir.Panel);return r&&o.push({label:g(873,"Ask {0}: {1}",r.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?Szt:G4t,args:[i]}),o}async getRelatedInformationPicks(e,t,i,n){const o=await this.aiRelatedInformationService.getRelatedInformation(i,[zSe.CommandInformation],n);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,n=this.menuService.getMenuActions(_e.CommandPalette,t).reduce((o,[,r])=>[...o,...r],[]).filter(o=>o instanceof Sc&&o.enabled);for(const o of n){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(874,"{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||GLe(h)?h:{value:h,original:h};e.push({commandId:o.item.id,commandWhen:o.item.precondition?.serialize(),commandAlias:d,label:dae(r),commandDescription:u})}return e}},DV=qS,qS.AI_RELATED_INFORMATION_MAX_PICKS=5,qS.AI_RELATED_INFORMATION_THRESHOLD=.8,qS.AI_RELATED_INFORMATION_DEBOUNCE=200,qS);XM=DV=D([_(0,ei),_(1,Oa),_(2,fs),_(3,we),_(4,Ut),_(5,vi),_(6,Yi),_(7,to),_(8,Te),_(9,Po),_(10,B6),_(11,Er),_(12,nMe),_(13,_f)],XM);const Foe=class Foe extends li{constructor(){super({id:Foe.ID,title:Pe(875,"Show All Commands"),keybinding:{weight:Ae.WorkbenchContrib,when:void 0,primary:rf?void 0:U.CtrlCmd|U.Shift|S.KeyP,secondary:[S.F1]},f1:!0})}async run(e){e.get(In).quickAccess.show(XM.PREFIX)}};Foe.ID="workbench.action.showCommands";let aI=Foe;class Tzt extends li{constructor(){super({id:"workbench.action.clearCommandHistory",title:Pe(876,"Clear Command History"),f1:!0})}async run(e){const t=e.get(Te),i=e.get($i),n=e.get(to);if(p9.getConfiguredCommandHistoryLength(t)>0){const{confirmed:r}=await n.confirm({type:"warning",message:g(877,"Do you want to clear the history of recently used commands?"),detail:g(878,"This action is irreversible!"),primaryButton:g(879,"&&Clear")});if(!r)return;p9.clearHistory(t,i)}}}class rit{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new wn);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Z,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=s6(o);if(a){let c=o.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{c=o.saveViewState()??void 0})),r.restoreViewState=()=>{c&&o===this.activeTextEditorControl&&o.restoreViewState(c)},n.add(hm(t.onCancellationRequested)(()=>r.restoreViewState?.()))}n.add(Ee(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,Db.JUMP),e.revealRangeInCenter(t.range,mt.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Ah(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return im(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.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:$o(Iqe),position:kl.Full}}}],[r,a]=i.deltaDecorations(n,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 Ooe=class Ooe extends rit{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=g(4642,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,V.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new Z;o.add(t.onDidAccept(c=>{const[l]=t.selectedItems;if(l){if(!this.isValidLineNumber(n,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(n,t.value.trim().substr(Ooe.PREFIX.length)),l=this.getPickLabel(n,c.lineNumber,c.column);if(t.items=[{lineNumber:c.lineNumber,column:c.column,label:l}],t.ariaLabel=l,!this.isValidLineNumber(n,c.lineNumber)){this.clearDecorations(n);return}const d=this.toRange(c.lineNumber,c.column);n.revealRangeInCenter(d,mt.Smooth),this.addDecorations(n,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=s6(n);return a&&a.getOptions().get(x.lineNumbers).renderType===wr.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)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?g(4643,"Go to line {0} and character {1}.",t,i):g(4644,"Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?g(4645,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,o):g(4646,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.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 n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};Ooe.PREFIX=":";let QZ=Ooe,jZ=class extends QZ{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)}};jZ=D([_(0,ei),_(1,Po),_(2,Te)],jZ);const Boe=class Boe extends li{constructor(){super({id:Boe.ID,title:Pe(880,"Go to Line/Column..."),f1:!0,keybinding:{weight:Ae.WorkbenchContrib,when:null,primary:U.CtrlCmd|S.KeyG,mac:{primary:U.WinCtrl|S.KeyG}}})}async run(e){e.get(In).quickAccess.show(jZ.PREFIX)}};Boe.ID="workbench.action.gotoLine";let YZ=Boe;At(YZ);Qe.as(RU.Quickaccess).registerQuickAccessProvider({ctor:jZ,prefix:QZ.PREFIX,placeholder:g(881,"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."),helpEntries:[{description:g(882,"Go to Line/Column"),commandId:YZ.ID}]});var zQ,ab;let NT=(ab=class extends rit{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(4647,"To go to a symbol, first open a text editor with symbol information.")),V.None}provideWithTextEditor(e,t,i,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):V.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new Z;return this.provideLabelPick(i,g(4648,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:pt.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new dc,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(Ee(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,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,n);let l;const d=async h=>{l?.dispose(!0),i.busy=!1,l=new ci(n),i.busy=!0;try{const u=b9(i.value.substr(zQ.PREFIX.length).trim()),f=await this.doGetSymbolPicks(c,u,void 0,l.token,t);if(n.isCancellationRequested)return;if(f.length>0){if(i.items=f,h&&u.original.length===0){const p=Ak(f,m=>!!(m.type!=="separator"&&m.range&&F.containsPosition(m.range.decoration,h)));p&&(i.activeItems=[p])}}else u.original.length>0?this.provideLabelPick(i,g(4649,"No matching editor symbols")):this.provideLabelPick(i,g(4650,"No editor symbols"))}finally{n.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,mt.Smooth),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,o){const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(zQ.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=gVe(t.values[0]),d=gVe(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?We.asClassName(ve.splitHorizontal):We.asClassName(ve.splitVertical),tooltip:u==="right"?g(4651,"Open to the Side"):g(4652,"Open to the Bottom")}]);const f=[];for(let v=0;vc){let G=!1;if(l!==t&&([L,k]=fue(y,{...t,values:void 0},c,C),typeof L=="number"&&(G=!0)),typeof L!="number"&&([L,k]=fue(y,l,c,C),typeof L!="number"))continue;if(!G&&d){if(A&&d.original.length>0&&([P,R]=fue(A,d)),typeof P!="number")continue;typeof L=="number"&&(L+=P)}}const z=b.tags&&b.tags.indexOf(y8.Deprecated)>=0;f.push({index:v,kind:b.kind,score:L,label:y,ariaLabel:Zct(b.name,b.kind),description:A,highlights:z?void 0:{label:k,description:R},range:{selection:F.collapseToStart(b.selectionRange),decoration:b.range},uri:o.uri,symbolName:w,strikethrough:z,buttons:h})}const p=f.sort((v,b)=>a?this.compareByKindAndScore(v,b):this.compareByScore(v,b));let m=[];if(a){let y=function(){b&&typeof v=="number"&&w>0&&(b.label=$p(bue[v]||vue,w))},v,b,w=0;for(const C of p)v!==C.kind?(y(),v=C.kind,w=1,b={type:"separator"},m.push(b)):w++,m.push(C);y()}else p.length>0&&(m=[{label:g(4653,"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=bue[e.kind]||vue,n=bue[t.kind]||vue,o=i.localeCompare(n);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()}},zQ=ab,ab.PREFIX="@",ab.SCOPE_PREFIX=":",ab.PREFIX_BY_CATEGORY=`${ab.PREFIX}${ab.SCOPE_PREFIX}`,ab);NT=zQ=D([_(0,it),_(1,iG)],NT);const vue=g(4654,"properties ({0})"),bue={[pt.Method]:g(4655,"methods ({0})"),[pt.Function]:g(4656,"functions ({0})"),[pt.Constructor]:g(4657,"constructors ({0})"),[pt.Variable]:g(4658,"variables ({0})"),[pt.Class]:g(4659,"classes ({0})"),[pt.Struct]:g(4660,"structs ({0})"),[pt.Event]:g(4661,"events ({0})"),[pt.Operator]:g(4662,"operators ({0})"),[pt.Interface]:g(4663,"interfaces ({0})"),[pt.Namespace]:g(4664,"namespaces ({0})"),[pt.Package]:g(4665,"packages ({0})"),[pt.TypeParameter]:g(4666,"type parameters ({0})"),[pt.Module]:g(4667,"modules ({0})"),[pt.Property]:g(4654,"properties ({0})"),[pt.Enum]:g(4668,"enumerations ({0})"),[pt.EnumMember]:g(4669,"enumeration members ({0})"),[pt.String]:g(4670,"strings ({0})"),[pt.File]:g(4671,"files ({0})"),[pt.Array]:g(4672,"arrays ({0})"),[pt.Number]:g(4673,"numbers ({0})"),[pt.Boolean]:g(4674,"booleans ({0})"),[pt.Object]:g(4675,"objects ({0})"),[pt.Key]:g(4676,"keys ({0})"),[pt.Field]:g(4677,"fields ({0})"),[pt.Constant]:g(4678,"constants ({0})")};var $Se;(function(s){s[s.OutlinePane=1]="OutlinePane",s[s.Breadcrumbs=2]="Breadcrumbs",s[s.QuickPick=4]="QuickPick"})($Se||($Se={}));var t5e;(function(s){s.icons="outline.icons",s.collapseItems="outline.collapseItems",s.problemsEnabled="outline.problems.enabled",s.problemsColors="outline.problems.colors",s.problemsBadges="outline.problems.badges"})(t5e||(t5e={}));var i5e;(function(s){s.Collapsed="alwaysCollapse",s.Expanded="alwaysExpand"})(i5e||(i5e={}));var GSe,RR;let JZ=(RR=class extends NT{constructor(e,t,i,n,o,r){super(n,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(!W2(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,n,o){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,n),Sr(GSe.SYMBOL_PICKS_TIMEOUT)])||o.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,o),b9(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 V.None;const i=new ci,n=new Z;return n.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,$Se.QuickPick,i.token).then(o=>{if(!o)return;if(i.token.isCancellationRequested){o.dispose();return}n.add(o);const r=o.captureViewState();n.add(Ee(()=>{e.selectedItems.length===0&&r.dispose()}));const a=o.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:pt.File,index:u,score:0,label:h.label,description:h.description,ariaLabel:h.ariaLabel,iconClasses:h.iconClasses}));n.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(NT.PREFIX.length).trim(),p=lF(u.label),m=Uk(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:Mq(f,p)??void 0},!0):!1});if(h.length===0){const u=g(883,"No matching entries");e.items=[{label:u,index:-1,kind:pt.String}],e.ariaLabel=u}else e.items=h};l(),n.add(e.onDidChangeValue(l));const d=new wn;n.add(d),n.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=o.preview(a[h.index].element):d.clear()}))}).catch(o=>{vt(o),e.hide()}).finally(()=>{e.busy=!1}),n}},GSe=RR,RR.SYMBOL_PICKS_TIMEOUT=8e3,RR);JZ=GSe=D([_(0,ei),_(1,Po),_(2,Te),_(3,it),_(4,hXe),_(5,iG)],JZ);const Woe=class Woe extends li{constructor(){super({id:Woe.ID,title:{...Pe(884,"Go to Symbol in Editor..."),mnemonicTitle:g(885,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:he.and(bp.negate(),NA.negate()),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|U.Shift|S.KeyO},menu:[{id:_e.MenubarGoMenu,group:"4_symbol_nav",order:1}]})}run(e){e.get(In).quickAccess.show(JZ.PREFIX,{itemActivation:Hf.NONE})}};Woe.ID="workbench.action.gotoSymbol";let XZ=Woe;At(XZ);Qe.as(RU.Quickaccess).registerQuickAccessProvider({ctor:JZ,prefix:NT.PREFIX,contextKey:"inFileSymbolsPicker",placeholder:g(886,"Type the name of a symbol to go to."),helpEntries:[{description:g(887,"Go to Symbol in Editor"),prefix:NT.PREFIX,commandId:XZ.ID,commandCenterOrder:40},{description:g(888,"Go to Symbol in Editor by Category"),prefix:NT.PREFIX_BY_CATEGORY}]});const uA={primary:U.CtrlCmd|S.KeyP,secondary:[U.CtrlCmd|S.KeyE],mac:{primary:U.CtrlCmd|S.KeyP,secondary:void 0}};So.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:Ae.WorkbenchContrib,when:_C,primary:S.Escape,secondary:[U.Shift|S.Escape],handler:s=>s.get(In).cancel()});So.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>s.get(In).accept()});So.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>s.get(In).accept({ctrlCmd:!0,alt:!1})});So.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>{s.get(In).focus()}});const n5e="workbench.action.quickOpenNavigateNextInFilePicker";So.registerCommandAndKeybindingRule({id:n5e,weight:Ae.WorkbenchContrib+50,handler:Sce(n5e,!0),when:ytt,primary:uA.primary,secondary:uA.secondary,mac:uA.mac});const s5e="workbench.action.quickOpenNavigatePreviousInFilePicker";So.registerCommandAndKeybindingRule({id:s5e,weight:Ae.WorkbenchContrib+50,handler:Sce(s5e,!1),when:ytt,primary:uA.primary|U.Shift,secondary:[uA.secondary[0]|U.Shift],mac:{primary:uA.mac.primary|U.Shift,secondary:void 0}});So.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:Ae.WorkbenchContrib,when:_C,primary:0,handler:s=>{s.get(In).toggle()}});So.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:Ae.WorkbenchContrib+50,when:_C,primary:0,win:{primary:U.Alt|S.LeftArrow},mac:{primary:U.WinCtrl|S.Minus},linux:{primary:U.CtrlCmd|U.Alt|S.Minus},handler:s=>{s.get(In).back()}});At(class extends li{constructor(){super({id:"workbench.action.quickOpen",title:Pe(889,"Go to File..."),metadata:{description:"Quick access",args:[{name:"prefix",schema:{type:"string"}}]},keybinding:{weight:Ae.WorkbenchContrib,primary:uA.primary,secondary:uA.secondary,mac:uA.mac},f1:!0})}run(e,t){e.get(In).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});At(class extends li{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(890,"Quick Open"),icon:ve.search,menu:{id:_e.CommandCenterCenter,order:100}})}run(e){e.get(In).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});_t.registerCommand("workbench.action.quickOpenPreviousEditor",async s=>{s.get(In).quickAccess.show("",{itemActivation:Hf.SECOND})});class Tce extends li{constructor(e,t,i,n,o){super({id:e,title:t,f1:!0,keybinding:o}),this.id=e,this.next=i,this.quickNavigate=n}async run(e){const t=e.get(Ut),i=e.get(In),n=t.lookupKeybindings(this.id),o=this.quickNavigate?{keybindings:n}:void 0;i.navigate(this.next,o)}}class Lzt extends Tce{constructor(){super("workbench.action.quickOpenNavigateNext",Pe(891,"Navigate Next in Quick Open"),!0,!0)}}class Rzt extends Tce{constructor(){super("workbench.action.quickOpenNavigatePrevious",Pe(892,"Navigate Previous in Quick Open"),!1,!0)}}class Mzt extends Tce{constructor(){super("workbench.action.quickOpenSelectNext",Pe(893,"Select Next in Quick Open"),!0,!1,{weight:Ae.WorkbenchContrib+50,when:_C,primary:0,mac:{primary:U.WinCtrl|S.KeyN}})}}class Nzt extends Tce{constructor(){super("workbench.action.quickOpenSelectPrevious",Pe(894,"Select Previous in Quick Open"),!1,!1,{weight:Ae.WorkbenchContrib+50,when:_C,primary:0,mac:{primary:U.WinCtrl|S.KeyP}})}}At(Mzt);At(Nzt);At(Lzt);At(Rzt);var kV,MR;let Y5=(MR=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Qe.as(RU.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 n=this.registry.getQuickAccessProvider(i.substr(kV.PREFIX.length));n&&n.prefix&&n.prefix!==kV.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==kV.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,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:g(4806,"{0}, {1}",n,t.description),description:t.description}})}},kV=MR,MR.PREFIX="?",MR);Y5=kV=D([_(0,In),_(1,Ut)],Y5);const o5e="workbench.panel.repl.view";new Q("debugType",void 0,{type:"string",description:g(6,"Debug type of the active debug session. For example 'python'.")});new Q("debugConfigurationType",void 0,{type:"string",description:g(7,"Debug type of the selected launch configuration. For example 'python'.")});new Q("debugState","inactive",{type:"string",description:g(8,"State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.")});const Pzt="debugUx";new Q(Pzt,"default",{type:"string",description:g(9,"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 Q("hasDebugged",!1,{type:"boolean",description:g(10,"True when a debug session has been started at least once, false otherwise.")});new Q("inDebugMode",!1,{type:"boolean",description:g(11,"True when debugging, false otherwise.")});new Q("inDebugRepl",!1,{type:"boolean",description:g(12,"True when focus is in the debug console, false otherwise.")});new Q("breakpointWidgetVisible",!1,{type:"boolean",description:g(13,"True when breakpoint editor zone widget is visible, false otherwise.")});new Q("inBreakpointWidget",!1,{type:"boolean",description:g(14,"True when focus is in the breakpoint editor zone widget, false otherwise.")});new Q("breakpointsFocused",!0,{type:"boolean",description:g(15,"True when the BREAKPOINTS view is focused, false otherwise.")});new Q("watchExpressionsFocused",!0,{type:"boolean",description:g(16,"True when the WATCH view is focused, false otherwise.")});new Q("watchExpressionsExist",!1,{type:"boolean",description:g(17,"True when at least one watch expression exists, false otherwise.")});new Q("variablesFocused",!0,{type:"boolean",description:g(18,"True when the VARIABLES views is focused, false otherwise")});new Q("expressionSelected",!1,{type:"boolean",description:g(19,"True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.")});new Q("breakpointInputFocused",!1,{type:"boolean",description:g(20,"True when the input box has focus in the BREAKPOINTS view.")});new Q("callStackItemType",void 0,{type:"string",description:g(21,"Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'")});new Q("callStackSessionIsAttach",!1,{type:"boolean",description:g(22,"True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.")});new Q("callStackItemStopped",!1,{type:"boolean",description:g(23,"True when the focused item in the CALL STACK is stopped. Used internaly for inline menus in the CALL STACK view.")});new Q("callStackSessionHasOneThread",!1,{type:"boolean",description:g(24,"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 Q("watchItemType",void 0,{type:"string",description:g(25,"Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'")});new Q("canViewMemory",void 0,{type:"boolean",description:g(26,"Indicates whether the item in the view has an associated memory refrence.")});new Q("breakpointItemType",void 0,{type:"string",description:g(27,"Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakppint', 'functionBreakpoint', 'dataBreakpoint'")});new Q("breakpointItemBytes",void 0,{type:"boolean",description:g(28,"Whether the breakpoint item is a data breakpoint on a byte range.")});new Q("breakpointHasModes",!1,{type:"boolean",description:g(29,"Whether the breakpoint has multiple modes it can switch to.")});new Q("breakpointSupportsCondition",!1,{type:"boolean",description:g(30,"True when the focused breakpoint supports conditions.")});new Q("loadedScriptsSupported",!1,{type:"boolean",description:g(31,"True when the focused sessions supports the LOADED SCRIPTS view")});new Q("loadedScriptsItemType",void 0,{type:"string",description:g(32,"Represents the item type of the focused element in the LOADED SCRIPTS view.")});new Q("focusedSessionIsAttach",!1,{type:"boolean",description:g(33,"True when the focused session is 'attach'.")});new Q("focusedSessionIsNoDebug",!1,{type:"boolean",description:g(34,"True when the focused session is run without debugging.")});new Q("stepBackSupported",!1,{type:"boolean",description:g(35,"True when the focused session supports 'stepBack' requests.")});new Q("restartFrameSupported",!1,{type:"boolean",description:g(36,"True when the focused session supports 'restartFrame' requests.")});new Q("stackFrameSupportsRestart",!1,{type:"boolean",description:g(37,"True when the focused stack frame supports 'restartFrame'.")});new Q("jumpToCursorSupported",!1,{type:"boolean",description:g(38,"True when the focused session supports 'jumpToCursor' request.")});new Q("stepIntoTargetsSupported",!1,{type:"boolean",description:g(39,"True when the focused session supports 'stepIntoTargets' request.")});new Q("breakpointsExist",!1,{type:"boolean",description:g(40,"True when at least one breakpoint exists.")});new Q("debuggersAvailable",!1,{type:"boolean",description:g(41,"True when there is at least one debug extensions active.")});new Q("debugExtensionAvailable",!0,{type:"boolean",description:g(42,"True when there is at least one debug extension installed and enabled.")});new Q("debugProtocolVariableMenuContext",void 0,{type:"string",description:g(43,"Represents the context the debug adapter sets on the focused variable in the VARIABLES view.")});new Q("debugSetVariableSupported",!1,{type:"boolean",description:g(44,"True when the focused session supports 'setVariable' request.")});new Q("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:g(45,"True when the focused session supports 'getBreakpointInfo' request on an address.")});new Q("debugSetExpressionSupported",!1,{type:"boolean",description:g(46,"True when the focused session supports 'setExpression' request.")});new Q("breakWhenValueChangesSupported",!1,{type:"boolean",description:g(47,"True when the focused session supports to break when value changes.")});new Q("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:g(48,"True when the focused breakpoint supports to break when value is accessed.")});new Q("breakWhenValueIsReadSupported",!1,{type:"boolean",description:g(49,"True when the focused breakpoint supports to break when value is read.")});new Q("terminateDebuggeeSupported",!1,{type:"boolean",description:g(50,"True when the focused session supports the terminate debuggee capability.")});new Q("suspendDebuggeeSupported",!1,{type:"boolean",description:g(51,"True when the focused session supports the suspend debuggee capability.")});new Q("variableEvaluateNamePresent",!1,{type:"boolean",description:g(52,"True when the focused variable has an 'evalauteName' field set.")});new Q("variableIsReadonly",!1,{type:"boolean",description:g(53,"True when the focused variable is read-only.")});new Q("variableValue",!1,{type:"string",description:g(54,"Value of the variable, present for debug visualization clauses.")});new Q("variableType",!1,{type:"string",description:g(55,"Type of the variable, present for debug visualization clauses.")});new Q("variableInterfaces",!1,{type:"array",description:g(56,"Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.")});new Q("variableName",!1,{type:"string",description:g(57,"Name of the variable, present for debug visualization clauses.")});new Q("variableLanguage",!1,{type:"string",description:g(58,"Language of the variable source, present for debug visualization clauses.")});new Q("variableExtensionId",!1,{type:"string",description:g(59,"Extension ID of the variable source, present for debug visualization clauses.")});new Q("exceptionWidgetVisible",!1,{type:"boolean",description:g(60,"True when the exception widget is visible.")});new Q("multiSessionRepl",!1,{type:"boolean",description:g(61,"True when there is more than 1 debug console.")});new Q("multiSessionDebug",!1,{type:"boolean",description:g(62,"True when there is more than 1 active debug session.")});new Q("disassembleRequestSupported",!1,{type:"boolean",description:g(63,"True when the focused sessions supports disassemble request.")});new Q("disassemblyViewFocus",!1,{type:"boolean",description:g(64,"True when the Disassembly View is focused.")});new Q("languageSupportsDisassembleRequest",!1,{type:"boolean",description:g(65,"True when the language in the current editor supports disassemble request.")});new Q("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:g(66,"True when the focused stack frame has instruction pointer reference.")});g(68,"Controls when the internal Debug Console should open.");var r5e;(function(s){s[s.Inactive=0]="Inactive",s[s.Initializing=1]="Initializing",s[s.Stopped=2]="Stopped",s[s.Running=3]="Running"})(r5e||(r5e={}));var a5e;(function(s){s[s.Valid=0]="Valid",s[s.Unreadable=1]="Unreadable",s[s.Error=2]="Error"})(a5e||(a5e={}));var ZZ;(function(s){s[s.Variable=0]="Variable",s[s.Address=1]="Address"})(ZZ||(ZZ={}));var A9;(function(s){s[s.Initial=1]="Initial",s[s.Dynamic=2]="Dynamic"})(A9||(A9={}));var c5e;(function(s){s.UnverifiedBreakpoints="unverifiedBreakpoints"})(c5e||(c5e={}));var l5e;(function(s){s[s.CONDITION=0]="CONDITION",s[s.HIT_COUNT=1]="HIT_COUNT",s[s.LOG_MESSAGE=2]="LOG_MESSAGE",s[s.TRIGGER_POINT=3]="TRIGGER_POINT"})(l5e||(l5e={}));var eee;(function(s){s[s.Command=0]="Command",s[s.Tree=1]="Tree"})(eee||(eee={}));var KSe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(KSe||(KSe={}));var qSe;(function(s){s.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:N.revive(e.iconPath.light),dark:N.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),s.serialize=e=>e})(qSe||(qSe={}));var QSe,NR;let KW=(NR=class extends mNe{constructor(e,t,i,n,o,r,a,c){super(QSe.PREFIX,{noResultsPick:{label:g(4807,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=n,this.terminalGroupService=o,this.debugService=r,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(r=>e?(r.highlights={label:OY(e,r.label,!0)??void 0},r.highlights.label||_at(r.containerLabel,e)):!0),i=new Map;for(const r of t)i.has(r.label)||i.set(r.label,r.containerLabel);const n=[];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,n.push({type:"separator",label:a})}n.push(r)}return n}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(ir.Sidebar,g(4808,"Side Bar")),i(ir.Panel,g(4809,"Panel")),i(ir.AuxiliaryBar,g(4810,"Secondary Side Bar"));const n=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))}};n(ir.Sidebar),n(ir.Panel),n(ir.AuxiliaryBar),this.terminalGroupService.groups.forEach((r,a)=>{r.terminalInstances.forEach((c,l)=>{const d=g(4811,"{0}: {1}",`${a+1}.${l+1}`,c.title);e.push({label:d,containerLabel:g(4812,"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(4813,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,r,{explicit:!0}),this.viewsService.isViewVisible(o5e)||await this.viewsService.openView(o5e,!0)}})});const o=this.outputService.getChannelDescriptors();for(const r of o)e.push({label:r.label,containerLabel:g(4814,"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}},QSe=NR,NR.PREFIX="view ",NR);KW=QSe=D([_(0,xm),_(1,Lm),_(2,Jae),_(3,OU),_(4,iMe),_(5,XRe),_(6,Tm),_(7,Le)],KW);const Hoe=class Hoe extends li{constructor(){super({id:Hoe.ID,title:Pe(4815,"Open View"),category:ca.View,f1:!0})}async run(e){e.get(In).quickAccess.show(KW.PREFIX)}};Hoe.ID="workbench.action.openView";let E9=Hoe;const b1=class b1 extends li{constructor(){super({id:b1.ID,title:Pe(4816,"Quick Open View"),category:ca.View,f1:!1,keybinding:{weight:Ae.WorkbenchContrib,when:void 0,...b1.KEYBINDING}})}async run(e){const t=e.get(Ut),i=e.get(In),n=t.lookupKeybindings(b1.ID);i.quickAccess.show(KW.PREFIX,{quickNavigateConfiguration:{keybindings:n},itemActivation:Hf.FIRST})}};b1.ID="workbench.action.quickOpenView",b1.KEYBINDING={primary:U.CtrlCmd|S.KeyQ,mac:{primary:U.WinCtrl|S.KeyQ},linux:{primary:0}};let tee=b1;const LNe=Qe.as(RU.Quickaccess);LNe.registerQuickAccessProvider({ctor:Y5,prefix:Y5.PREFIX,placeholder:g(895,"Type '{0}' to get help on the actions you can take from here.",Y5.PREFIX),helpEntries:[{description:g(896,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(897,"More")}]});LNe.registerQuickAccessProvider({ctor:KW,prefix:KW.PREFIX,contextKey:"inViewsPicker",placeholder:g(898,"Type the name of a view, output channel or terminal to open."),helpEntries:[{description:g(899,"Open View"),commandId:E9.ID}]});LNe.registerQuickAccessProvider({ctor:XM,prefix:XM.PREFIX,contextKey:"inCommandsPicker",placeholder:g(900,"Type the name of a command to run."),helpEntries:[{description:g(901,"Show and Run Commands"),commandId:aI.ID,commandCenterOrder:20}]});jn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:aI.ID,title:g(902,"&&Command Palette...")},order:1});jn.appendMenuItem(_e.MenubarHelpMenu,{group:"1_welcome",command:{id:aI.ID,title:g(903,"Show All Commands")},order:2});jn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:E9.ID,title:g(904,"&&Open View...")},order:2});jn.appendMenuItem(_e.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(905,"Go to &&Line/Column...")},order:1});jn.appendMenuItem(_e.GlobalActivity,{group:"1_command",command:{id:aI.ID,title:g(906,"Command Palette...")},order:1});jn.appendMenuItem(_e.EditorContext,{group:"z_commands",when:J.editorSimpleInput.toNegated(),command:{id:aI.ID,title:g(906,"Command Palette...")},order:1});At(Tzt);At(aI);At(E9);At(tee);const Fzt="inViewsPicker",ait=he.and(_C,he.has(Fzt)),iB=tee.KEYBINDING,d5e="workbench.action.quickOpenNavigateNextInViewPicker";So.registerCommandAndKeybindingRule({id:d5e,weight:Ae.WorkbenchContrib+50,handler:Sce(d5e,!0),when:ait,primary:iB.primary,linux:iB.linux,mac:iB.mac});const h5e="workbench.action.quickOpenNavigatePreviousInViewPicker";So.registerCommandAndKeybindingRule({id:h5e,weight:Ae.WorkbenchContrib+50,handler:Sce(h5e,!1),when:ait,primary:iB.primary|U.Shift,linux:iB.linux,mac:{primary:iB.mac.primary|U.Shift}});const hv=Za;var GB;let iee=(GB=class extends V{constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},GB.ID="workbench.contrib.externalUriResolver",GB);iee=D([_(0,Ao),_(1,hv)],iee);const cit=N.parse("trustedDomains:/Trusted Domains"),Lce="http.linkProtectionTrustedDomains",jSe="http.linkProtectionTrustedDomainsContent",YSe={id:"workbench.action.manageTrustedDomain",description:{description:Pe(4604,"Manage Trusted Domains"),args:[]},handler:async s=>{s.get(ei).openEditor({resource:cit,languageId:"jsonc",options:{pinned:!0}})}};async function Ozt(s,e,t,i,n,o,r){const a=N.parse(e),c=a.authority.split("."),l=c.slice(c.length-2).join("."),d="*."+l,h=[];if(h.push({type:"item",label:g(4605,"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(4606,"Trust {0} on all ports",p),toTrust:p+":*",id:"trust"})}}else h.push({type:"item",label:g(4607,"Trust {0} and all its subdomains",l),toTrust:d,id:"trust"});h.push({type:"item",label:g(4608,"Trust all domains (disables link protection)"),toTrust:"*",id:"trust"}),h.push({type:"item",label:g(4609,"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:cit.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),s;case"trust":{const p=f.toTrust;if(s.indexOf(p)===-1)return n.remove(jSe,Ie.APPLICATION),n.store(Lce,JSON.stringify([...s,p]),Ie.APPLICATION,an.USER),[...s,p]}}return[]}async function Bzt(s){const{defaultTrustedDomains:e,trustedDomains:t}=nee(s);return{defaultTrustedDomains:e,trustedDomains:t}}function nee(s){const e=s.get($i),t=s.get(Er),i=s.get(hv),n=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let o=[];try{const r=e.get(Lce,Ie.APPLICATION);r&&(o=JSON.parse(r))}catch{}return{defaultTrustedDomains:n,trustedDomains:o}}const Wzt="trustedDomains",Hzt={type:sn.File,ctime:Date.now(),mtime:Date.now(),size:0},lit=`// Links matching one or more entries in the list below can be opened without link protection. +${e.value}`}:e;return super.render(n,t,i)}};xSe=D([_(1,xi),_(2,Ao),_(3,Zae)],xSe);var DSe;const Rm=fe;var AR;let VZ=(AR=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.location=t,this.rendererOptions=i,this.delegate=n,this.codeBlockModelCollection=o,this.instantiationService=a,this.logService=l,this.contextKeyService=d,this.themeService=h,this.commandService=u,this.hoverService=f,this.codeBlocksByResponseId=new Map,this.codeBlocksByEditorUri=new ui,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.renderer=this._register(this.instantiationService.createInstance(xSe,void 0)),this.markdownDecorationsRenderer=this.instantiationService.createInstance(CZ),this._editorPool=this._register(this.instantiationService.createInstance(PCe,e,n,r)),this._diffEditorPool=this._register(this.instantiationService.createInstance(SSe,e,n,r)),this._treePool=this._register(this.instantiationService.createInstance(ASe,this._onDidChangeVisibility.event)),this._contentReferencesListPool=this._register(this.instantiationService.createInstance(wSe,this._onDidChangeVisibility.event)),this._register(this.instantiationService.createInstance(sCe))}get templateId(){return DSe.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 n=e.contentUpdateTimings.impliedWordLoadRate;return Ka(n,5,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&&ik.actions.length<=1},actionViewItemProvider:(k,P)=>k instanceof Sc&&(k.item.id==="workbench.action.chat.voteDown"||k.item.id==="workbench.action.chat.voteUp")?b.createInstance(nzt,k,P):PN(b,k,P)}));const y=t.add(this.instantiationService.createInstance(yZ)),C=()=>{if(vs(L.currentElement)&&L.currentElement.agent&&!L.currentElement.agent.isDefault)return y.setAgent(L.currentElement.agent.id),y.domNode},A=Itt(()=>vs(L.currentElement)?L.currentElement.agent:void 0,this.commandService);t.add(this.hoverService.setupManagedHover(Pr("element"),l,C,A)),t.add(ue(l,ke.KEY_DOWN,k=>{const P=new En(k);if(P.equals(S.Space)||P.equals(S.Enter)){const R=C();R&&this.hoverService.showHover({content:R,target:l,trapFocus:!0,actions:A.actions},!0)}else P.equals(S.Escape)&&this.hoverService.hideHover()}));const L={avatarContainer:d,username:h,detail:f,value:p,rowContainer:i,elementDisposables:m,titleToolbar:w,templateDisposables:t,contextKeyService:v,instantiationService:b,agentHover:y};return L}renderElement(e,t,i){this.renderChatTreeItem(e.element,t,i)}renderChatTreeItem(e,t,i){i.currentElement=e;const n=Wu(e)?"request":vs(e)?"response":"welcome";this.traceLayout("renderElement",`${n}, index=${t}`),lNt.bindTo(i.contextKeyService).set(vs(e)),dNt.bindTo(i.contextKeyService).set(Wu(e)),aNt.bindTo(i.contextKeyService).set(vs(e)&&e.agentOrSlashCommandDetected),vs(e)?(cNt.bindTo(i.contextKeyService).set(!!e.agent?.metadata.supportIssueReporting),$He.bindTo(i.contextKeyService).set(e.vote===PW.Up?"up":e.vote===PW.Down?"down":"")):$He.bindTo(i.contextKeyService).set(""),i.titleToolbar&&(i.titleToolbar.context=e);const o=!!(vs(e)&&e.errorDetails?.responseIsFiltered);if(UXe.bindTo(i.contextKeyService).set(o),i.rowContainer.classList.toggle("interactive-request",Wu(e)),i.rowContainer.classList.toggle("interactive-response",vs(e)),i.rowContainer.classList.toggle("interactive-welcome",JO(e)),i.rowContainer.classList.toggle("filtered-response",o),i.rowContainer.classList.toggle("show-detail-progress",vs(e)&&!e.isComplete&&!e.progressMessages.length),i.username.textContent=e.username,this.rendererOptions.noHeader||this.renderAvatar(e,i),Ms(i.detail),vs(e)&&this.renderDetail(e,i),vs(e)&&t===this.delegate.getListLength()-1&&(!e.isComplete||e.renderData)&&e.response.value.length){this.traceLayout("renderElement",`start progressive render ${n}, index=${t}`);const r=i.elementDisposables.add(new Q7),a=c=>{try{this.doNextProgressiveRender(e,t,i,!!c)&&r.cancel()}catch(l){r.cancel(),this.logService.error(l)}};r.cancelAndSet(a,50,ct(i.rowContainer)),a(!0)}else vs(e)?this.basicRenderElement(e,t,i):Wu(e)?this.basicRenderElement(e,t,i):this.renderWelcomeMessage(e,i)}renderDetail(e,t){t.elementDisposables.add(ai(i=>{this._renderDetail(e,t)}))}_renderDetail(e,t){if(Ms(t.detail),e.agentOrSlashCommandDetected){const i=e.slashCommand?g(7022,"used {0} [[(rerun without)]]",`${Xk}${e.slashCommand.name}`):g(7023,"[[(rerun without)]]");aa(t.detail,uLe(i,{className:"agentOrSlashCommandDetected",inline:!0,actionHandler:{disposables:t.elementDisposables,callback:n=>{this._onDidClickRerunWithAgentOrCommandDetection.fire(e)}}}))}else e.isComplete||(t.detail.textContent=S4t)}renderAvatar(e,t){const i=vs(e)?this.getAgentIcon(e.agent?.metadata):e.avatarIcon??ve.account;if(i instanceof N){const n=fe("img.icon");n.src=Jg.uriToBrowserUri(i).toString(!0),t.avatarContainer.replaceChildren(fe(".avatar",void 0,n))}else{const n=fe(We.asCSSSelector(i));t.avatarContainer.replaceChildren(fe(".avatar.codicon-avatar",void 0,n))}}getAgentIcon(e){return e?.themeIcon?e.themeIcon:e?.iconDark&&this.themeService.getColorTheme().type===Qg.DARK?e.iconDark:e?.icon?e.icon:ve.copilot}basicRenderElement(e,t,i){let n=[];if(Wu(e)){const c="message"in e.message?e.message.message:this.markdownDecorationsRenderer.convertParsedRequestToMarkdown(e.message);n=[{content:new Mt(c),kind:"markdownContent"}]}else vs(e)&&(e.contentReferences.length&&n.push({kind:"references",references:e.contentReferences}),n.push(...t4e(e.response.value)),e.codeCitations.length&&n.push({kind:"codeCitations",citations:e.codeCitations}));Ms(i.value),vs(e)&&this.renderDetail(e,i);const o=[];if(n.forEach((c,l)=>{const d={element:e,index:l,content:n,preceedingContentParts:o},h=this.renderChatContentPart(c,i,d);h&&(i.value.appendChild(h.domNode),o.push(h))}),i.renderedParts&&bt(i.renderedParts),i.renderedParts=o,Wu(e)&&e.variables.length){const c=this.renderAttachments(e.variables,e.contentReferences,i);c&&(i.value.appendChild(c.domNode),i.elementDisposables.add(c))}if(vs(e)&&e.errorDetails?.message){const c=this.instantiationService.createInstance(MVe,e.errorDetails.responseIsFiltered?"info":"error",new Mt(e.errorDetails.message),this.renderer);i.elementDisposables.add(c),i.value.appendChild(c.domNode)}const r=i.rowContainer.offsetHeight,a=!e.currentRenderedHeight||e.currentRenderedHeight!==r;if(e.currentRenderedHeight=r,a){const c=i.elementDisposables.add(Tl(ct(i.value),()=>{e.currentRenderedHeight=i.rowContainer.offsetHeight,c.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.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){Ms(t.value),e.content.forEach((o,r)=>{if(Array.isArray(o)){const a=t.elementDisposables.add(this.instantiationService.createChild(new Uc([Le,t.contextKeyService])));t.elementDisposables.add(a.createInstance(hZ,t.value,o,this.location,void 0,c=>this._onDidClickFollowup.fire(c)))}else{const a={element:e,index:r,content:[],preceedingContentParts:[]},c=this.renderMarkdown(o,t,a);t.value.appendChild(c.domNode),t.elementDisposables.add(c)}});const i=t.rowContainer.offsetHeight,n=!e.currentRenderedHeight||e.currentRenderedHeight!==i;if(e.currentRenderedHeight=i,n){const o=t.elementDisposables.add(Tl(ct(t.value),()=>{e.currentRenderedHeight=t.rowContainer.offsetHeight,o.dispose(),this._onDidChangeItemHeight.fire({element:e,height:e.currentRenderedHeight})}))}}doNextProgressiveRender(e,t,i,n){if(!this._isVisible)return!0;if(e.isCanceled)return this.traceLayout("doNextProgressiveRender",`canceled, index=${t}`),e.renderData=void 0,this.basicRenderElement(e,t,i),!0;let o=!1;this.traceLayout("doNextProgressiveRender",`START progressive render, index=${t}, renderData=${JSON.stringify(e.renderData)}`);const r=this.getNextProgressiveRenderContent(e),a=this.diff(i.renderedParts??[],r,e);if(o=a.every(l=>l===null),o)return e.isComplete?(this.traceLayout("doNextProgressiveRender",`END progressive render, index=${t} and clearing renderData, response is complete`),e.renderData=void 0,this.basicRenderElement(e,t,i),!0):(this.traceLayout("doNextProgressiveRender","caught up with the stream- no new content to render"),!1);this.traceLayout("doNextProgressiveRender",`doing progressive render, ${a.length} parts to render`),this.renderChatContentDiff(a,r,e,i);const c=i.rowContainer.offsetHeight;return e.currentRenderedHeight=c,n||this._onDidChangeItemHeight.fire({element:e,height:i.rowContainer.offsetHeight}),!1}renderChatContentDiff(e,t,i,n){const o=n.renderedParts??[];n.renderedParts=o,e.forEach((r,a)=>{if(!r)return;const c=n.renderedParts?.[a];c&&c.dispose();const l=o.slice(0,a),d={element:i,content:t,preceedingContentParts:l,index:a},h=this.renderChatContentPart(r,n,d);if(h){if(c)try{c.domNode.replaceWith(h.domNode)}catch(u){this.logService.error("ChatListItemRenderer#renderChatContentDiff: error replacing part",u)}else n.value.appendChild(h.domNode);o[a]=h}else c&&c.domNode.remove()})}getNextProgressiveRenderContent(e){const t=this.getDataForProgressiveRender(e),i=t4e(e.response.value);this.traceLayout("getNextProgressiveRenderContent",`Want to render ${t.numWordsToRender} at ${t.rate} words/s, counting...`);let n=t.numWordsToRender;const o=[];e.contentReferences.length&&o.push({kind:"references",references:e.contentReferences});for(let l=0;l0&&a!==e.renderData?.renderedWordCount&&(e.renderData={lastRenderTime:Date.now(),renderedWordCount:a,renderedParts:o}),o}getDataForProgressiveRender(e){const t=e.renderData??{lastRenderTime:0,renderedWordCount:0},i=this.getProgressiveRenderRate(e);return{numWordsToRender:t.lastRenderTime===0?1:t.renderedWordCount+Math.floor((Date.now()-t.lastRenderTime)/1e3*i),rate:i}}diff(e,t,i){const n=[];for(let o=0;oa instanceof UZ).length,r=this.instantiationService.createInstance(UZ,n,i.element,this._treePool,o);if(r.addDisposable(r.onDidChangeHeight(()=>{this.updateItemHeight(t)})),vs(i.element)){const a={treeDataId:n.uri.toString(),treeIndex:o,focus(){r.domFocus()}};r.addDisposable(r.onDidFocus(()=>{this.focusedFileTreesByResponseId.set(i.element.id,a.treeIndex)}));const c=this.fileTreesByResponseId.get(i.element.id)??[];c.push(a),this.fileTreesByResponseId.set(i.element.id,ja(c,l=>l.treeDataId)),r.addDisposable(Ee(()=>this.fileTreesByResponseId.set(i.element.id,c.filter(l=>l.treeDataId!==n.uri.toString()))))}return r}renderContentReferencesListData(e,t,i,n){const o=this.instantiationService.createInstance(WZ,e.references,t,i.element,this._contentReferencesListPool);return o.addDisposable(o.onDidChangeHeight(()=>{this.updateItemHeight(n)})),o}renderCodeCitationsListData(e,t,i){return this.instantiationService.createInstance(LCe,e,t)}renderProgressTask(e,t,i){if(!vs(i.element))return;const n=this.instantiationService.createInstance(ySe,e,this._contentReferencesListPool,this.renderer,i);return n.addDisposable(n.onDidChangeHeight(()=>{this.updateItemHeight(t)})),n}renderConfirmation(e,t,i){const n=this.instantiationService.createInstance(NCe,t,e);return n.addDisposable(n.onDidChangeHeight(()=>this.updateItemHeight(i))),n}renderAttachments(e,t,i){return this.instantiationService.createInstance(TCe,e,t,void 0)}renderTextEdit(e,t,i){const n=this.instantiationService.createInstance(CSe,t,e,this.rendererOptions,this._diffEditorPool,this._currentLayoutWidth);return n.addDisposable(n.onDidChangeHeight(()=>{n.layout(this._currentLayoutWidth),this.updateItemHeight(i)})),n}renderMarkdown(e,t,i){const n=i.element,o=vs(n)&&(!n.isComplete||n.isCanceled||n.errorDetails?.responseIsFiltered||n.errorDetails?.responseIsIncomplete||!!n.renderData),r=i.preceedingContentParts.reduce((l,d)=>l+(d instanceof SZ?d.codeblocks.length:0),0),a=this.instantiationService.createInstance(SZ,e,i,this._editorPool,o,r,this.renderer,this._currentLayoutWidth,this.codeBlockModelCollection,this.rendererOptions);a.addDisposable(a.onDidChangeHeight(()=>{a.layout(this._currentLayoutWidth),this.updateItemHeight(t)}));const c=this.codeBlocksByResponseId.get(n.id)??[];return this.codeBlocksByResponseId.set(n.id,c),a.addDisposable(Ee(()=>{const l=this.codeBlocksByResponseId.get(n.id);l&&a.codeblocks.forEach((d,h)=>delete l[r+h])})),a.codeblocks.forEach((l,d)=>{if(c[r+d]=l,l.uri){const h=l.uri;this.codeBlocksByEditorUri.set(h,l),a.addDisposable(Ee(()=>this.codeBlocksByEditorUri.delete(h)))}}),a}disposeElement(e,t,i){if(this.traceLayout("disposeElement",`Disposing element, index=${t}`),i.renderedParts)try{bt(Fi(i.renderedParts)),i.renderedParts=void 0,Ms(i.value)}catch(n){throw n}i.currentElement=void 0,i.elementDisposables.clear()}disposeTemplate(e){e.templateDisposables.dispose()}},DSe=AR,AR.ID="item",AR);VZ=DSe=D([_(6,we),_(7,Te),_(8,Ge),_(9,Le),_(10,pn),_(11,vi),_(12,ec)],VZ);let kSe=class{constructor(e,t){this.defaultElementHeight=e,this.logService=t}_traceLayout(e,t){this.logService.trace(`ChatListDelegate#${e}: ${t}`)}getHeight(e){const t=Wu(e)?"request":"response",i=("currentRenderedHeight"in e?e.currentRenderedHeight:void 0)??this.defaultElementHeight;return this._traceLayout("getHeight",`${t}, height=${i}`),i}getTemplateId(e){return VZ.ID}hasDynamicHeight(e){return!0}};kSe=D([_(1,Ge)],kSe);class nzt extends kb{render(e){super.render(e),e.classList.toggle("checked",this.action.checked)}}var OQ,hk;let ISe=(hk=class extends V{get configuration(){return this._config}constructor(e,t,i,n,o,r,a){super(),this.foreground=t,this.inputEditorBackgroundColor=i,this.resultEditorBackgroundColor=n,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=>{OQ.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:OQ.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()}},OQ=hk,hk.lineHeightEm=1.4,hk.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"],hk);ISe=OQ=D([_(4,Te),_(5,pn),_(6,Sm)],ISe);const szt=/^@([\w_\-\.]+)(?=(\s|$|\b))/i,ozt=/^#([\w_\-]+)(:\d+)?(?=(\s|$|\b))/i,rzt=/\/([\w_\-]+)(?=(\s|$|\b))/i;let zZ=class{constructor(e,t,i){this.agentService=e,this.variableService=t,this.slashCommandService=i}parseChatRequest(e,t,i=Ir.Panel,n){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(w=>w instanceof Ug)||o.some(w=>w instanceof ob&&w.text.trim()!==""||!(w instanceof Ug)))return;const v=o.at(-1)?.range.endExclusive??0;if(t.slice(v,i).trim()==="")return new Ug(h,u,p)}tryToParseVariable(e,t,i,n){const o=e.match(ozt);if(!o)return;const[r,a]=o,c=o[2]??"",l=new mi(t,t+r.length),d=new F(i.lineNumber,i.column,i.lineNumber,i.column+r.length),h=n.find(p=>p instanceof Ug),u=!h||h.agent.metadata.supportsSlowVariables,f=this.variableService.getVariable(a);if(f&&(!f.isSlow||u))return new g9(l,d,a,c,f.id)}tryToParseSlashCommand(e,t,i,n,o,r){const a=e.match(rzt);if(!a||o.some(f=>f instanceof RW))return;const[c,l]=a,d=new mi(i,i+c.length),h=new F(n.lineNumber,n.column,n.lineNumber,n.column+c.length),u=o.find(f=>f instanceof Ug);if(u){if(o.some(b=>b instanceof ob&&b.text.trim()!==""||!(b instanceof Ug)&&!(b instanceof ob)))return;const p=o.at(-1)?.range.endExclusive??0;if(t.slice(p,i).trim()!=="")return;const v=u.agent.slashCommands.find(b=>b.name===l);if(v)return new qM(d,h,v)}else{const p=this.slashCommandService.getCommands(r).find(m=>m.command===l);if(p)return new RW(d,h,p);{const v=this.agentService.getDefaultAgent(r)?.slashCommands.find(b=>b.name===l);if(v)return new qM(d,h,v)}}}tryToParseDynamicVariable(e,t,i,n){const o=n.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 mi(t,t+r);return new MW(c,o.range,a,o.id,o.modelDescription,o.data)}}};zZ=D([_(0,ff),_(1,D6),_(2,BRe)],zZ);let TSe=class extends V{constructor(e,t){super(),this.languageService=e,this.textModelService=t,this._models=new ui,this.maxModelCount=100}dispose(){super.dispose(),this.clear()}get(e,t,i){const n=this.getUri(e,t,i),o=this._models.get(n);if(o)return{model:o.model.then(r=>r.object),vulns:o.vulns}}getOrCreate(e,t,i){const n=this.get(e,t,i);if(n)return n;const o=this.getUri(e,t,i),r=this.textModelService.createModelReference(o);for(this._models.set(o,{model:r,vulns:[]});this._models.size>this.maxModelCount;){const a=Array.from(this._models.keys()).at(0);if(!a)break;this.delete(a)}return{model:r.then(a=>a.object),vulns:[]}}delete(e){const t=this._models.get(e);t&&(t.model.then(i=>i.dispose()),this._models.delete(e))}clear(){this._models.forEach(async e=>(await e.model).dispose()),this._models.clear()}async update(e,t,i,n){const o=this.getOrCreate(e,t,i),r=R4t(n.text),a=azt(r.newText,n.languageId);this.setVulns(e,t,i,r.vulnerabilities);const c=(await o.model).textEditorModel;if(n.languageId){const d=this.languageService.getLanguageIdByLanguageName(n.languageId);d&&d!==c.getLanguageId()&&c.setLanguage(d)}const l=c.getValue(go.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 F(h,u,h,u),text:d}])}else c.setValue(a)}setVulns(e,t,i,n){const o=this.getUri(e,t,i),r=this._models.get(o);r&&(r.vulns=n)}getUri(e,t,i){const n=this.getUriMetaData(t);return N.from({scheme:pe.vscodeChatCodeBlock,authority:e,path:`/${t.id}/${i}`,fragment:n?JSON.stringify(n):void 0})}getUriMetaData(e){if(vs(e))return{references:e.contentReferences.map(t=>{const i="variableName"in t.reference?t.reference.value:t.reference;if(i)return N.isUri(i)?{uri:i.toJSON()}:{uri:i.uri.toJSON(),range:i.range}})}}};TSe=D([_(0,xi),_(1,fn)],TSe);function azt(s,e){return e==="php"&&!s.trim().startsWith("<")?`e instanceof Ug))),this.parsedChatRequest}get scopedContextKeyService(){return this.contextKeyService}get location(){return this._location.location}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){super(),this.viewContext=t,this.viewOptions=i,this.styles=n,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._onDidChangeAgent=this._register(new I),this.onDidChangeAgent=this._onDidChangeAgent.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._onDidChangeContext=this._register(new I),this.onDidChangeContext=this._onDidChangeContext.event,this._onDidHide=this._register(new I),this.onDidHide=this._onDidHide.event,this._onDidChangeParsedInput=this._register(new I),this.onDidChangeParsedInput=this._onDidChangeParsedInput.event,this._onWillMaybeChangeHeight=new I,this.onWillMaybeChangeHeight=this._onWillMaybeChangeHeight.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),typeof e=="object"?this._location=e:this._location={location:e},gNt.bindTo(r).set(!0),pNt.bindTo(r).set(this._location.location),mNt.bindTo(r).set("resource"in t),this.agentInInput=zXe.bindTo(r),this.requestInProgress=z3.bindTo(r),this._register(d.register(this)),this._codeBlockModelCollection=this._register(a.createInstance(TSe)),this._register(o.registerCodeEditorOpenHandler(async(v,b,w)=>{let y=v.resource;if(CA(y,pe.vscodeCopilotBackingChatCodeBlock)&&(y=y.with({scheme:pe.vscodeChatCodeBlock})),y.scheme!==pe.vscodeChatCodeBlock)return null;const C=y.path.split("/").at(1);if(!C)return null;const A=this.viewModel?.getItems().find(L=>L.id===C);if(!A)return null;this.reveal(A),await Sr(0);for(const L of this.renderer.editorsInUse()??[])if(xn.isEqual(L.uri,y,!0)){const k=L.editor;return v.options?.selection&&k.setSelection({startLineNumber:v.options.selection.startLineNumber,startColumn:v.options.selection.startColumn,endLineNumber:v.options.selection.endLineNumber??v.options.selection.startLineNumber,endColumn:v.options.selection.endColumn??v.options.selection.startColumn}),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(ISe,t,this.styles.listForeground,this.styles.inputEditorBackground,this.styles.resultEditorBackground));const i=this.viewOptions.renderInputOnTop??!1,n=this.viewOptions.renderFollowups??!i,o=this.viewOptions.renderStyle;this.container=re(e,lue(".interactive-session")),i?(this.createInput(this.container,{renderFollowups:n,renderStyle:o}),this.listContainer=re(this.container,lue(".interactive-list"))):(this.listContainer=re(this.container,lue(".interactive-list")),this.createInput(this.container,{renderFollowups:n,renderStyle:o})),this.createList(this.listContainer,{...this.viewOptions.rendererOptions,renderStyle:o}),this._register(this.editorOptions.onDidChange(()=>this.onDidStyleChange())),this.onDidStyleChange(),this.viewModel&&(this.onDidChangeItems(),fP(this.tree)),this.contribs=LSe.CONTRIBS.map(r=>{try{return this._register(this.instantiationService.createInstance(r,this))}catch(a){this.logService.error("Failed to instantiate chat widget contrib",Nr(a));return}}).filter(Fc),this.contribs.forEach(r=>{r.onDidChangeInputState&&this._register(r.onDidChangeInputState(()=>{const a=this.collectInputState();this.inputPart.updateState(a)}))})}getContrib(e){return this.contribs.find(t=>t.id===e)}focusInput(){this.inputPart.focus()}hasInputFocus(){return this.inputPart.hasFocus()}getSibling(e,t){if(!vs(e))return;const i=this.viewModel?.getItems();if(!i)return;const n=i.filter(a=>vs(a)),o=n.indexOf(e);if(o===void 0)return;const r=t==="next"?o+1:o-1;if(!(r<0||r>n.length-1))return n[r]}clear(){this._dynamicMessageLayoutData&&(this._dynamicMessageLayoutData.enabled=!0),this._onDidClear.fire()}onDidChangeItems(e){if(this.tree&&this._visible){const t=(this.viewModel?.getItems()??[]).map(n=>({element:n,collapsed:!1,collapsible:!1}));this._onWillMaybeChangeHeight.fire(),this.tree.setChildren(null,t,{diffIdentityProvider:{getId:n=>(vs(n)||Wu(n)?n.dataId:n.id)+(JO(n)&&this.viewModel?`_${kg[this.viewModel.initState]}`:"")+`${Wu(n)||JO(n)}${vs(n)&&n.renderData?`_${this.visibleChangeCount}`:""}`+(vs(n)?`_${n.contentReferences.length}`:"")+(Wu(n)&&n.contentReferences?`_${n.contentReferences?.length}`:"")}}),!e&&this._dynamicMessageLayoutData&&this.layoutDynamicChatTreeItemMode();const i=t[t.length-1]?.element;i&&vs(i)&&i.isComplete?this.renderFollowups(i.replyFollowups,i):i&&JO(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(Ky(()=>{this._visible&&this.onDidChangeItems(!0)},0)):t&&this._onDidHide.fire()}createList(e,t){const i=this._register(this._register(this.instantiationService.createChild(new Uc([Le,this.contextKeyService])))),n=i.createInstance(kSe,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(VZ,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(S3,"Chat",e,n,[this.renderer],{identityProvider:{getId:a=>a.id},horizontalScrolling:!1,alwaysConsumeMouseWheel:!1,supportDynamicHeights:!0,hideTwistiesOfChildlessElements:!0,accessibilityProvider:this.instantiationService.createInstance(uCe),keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:a=>Wu(a)?a.message:vs(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([[UXe.key,vs(t)&&!!t.errorDetails?.responseIsFiltered]]);this.contextMenuService.showContextMenu({menuId:_e.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&&Tl(ct(this.listContainer),()=>{fP(this.tree)},0),this.previousTreeScrollHeight=this.tree.scrollHeight,this._onDidChangeContentHeight.fire()}createInput(e,t){this.inputPart=this._register(this.instantiationService.createInstance(uZ,this.location,{renderFollowups:t?.renderFollowups??!0,renderStyle:t?.renderStyle==="minimal"?"compact":t?.renderStyle,menus:{executeToolbar:_e.ChatExecute,...this.viewOptions.menus},editorOverflowWidgetsDomNode:this.viewOptions.editorOverflowWidgetsDomNode})),this.inputPart.render(e,"",this),this._register(this.inputPart.onDidLoadInputState(i=>{this.contribs.forEach(n=>{if(n.setInputState){const o=(typeof i=="object"&&i?.[n.id])??{};n.setInputState(o)}})})),this._register(this.inputPart.onDidFocus(()=>this._onDidFocus.fire())),this._register(this.inputPart.onDidChangeContext(i=>this._onDidChangeContext.fire(i))),this._register(this.inputPart.onDidAcceptFollowup(i=>{if(!this.viewModel)return;let n="";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,n=`${zU}${o.name} `,i.followup.subCommand&&(n+=`${Xk}${i.followup.subCommand} `)}else!i.followup.agentId&&i.followup.subCommand&&this.chatSlashCommandService.hasCommand(i.followup.subCommand)&&(n=`${Xk}${i.followup.subCommand} `);n+=i.followup.message,this.acceptInput(n),i.response&&this.chatService.notifyUserAction({sessionId:this.viewModel.sessionId,requestId:i.response.requestId,agentId:i.response.agent?.id,command:i.response.slashCommand?.name,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(Qye,e,this._codeBlockModelCollection),this.viewModelDisposables.add(M.accumulate(this.viewModel.onDidChange,0)(i=>{this.viewModel&&(this.requestInProgress.set(this.viewModel.requestInProgress),this.onDidChangeItems(),i.some(n=>n?.kind==="addRequest")&&this.visible&&(fP(this.tree),this.focusInput()))})),this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(()=>{this.inputPart.saveState(),this.viewModel=void 0,this.onDidChangeItems()})),this.inputPart.initForNewChatModel(t.inputValue,t.inputState??this.collectInputState()),this.contribs.forEach(i=>{i.setInputState&&t.inputState?.[i.id]&&i.setInputState(t.inputState?.[i.id])}),this.viewModelDisposables.add(e.onDidChange(i=>{i.kind==="setAgent"&&this._onDidChangeAgent.fire({agent:i.agent,slashCommand:i.command})})),this.tree&&(this.onDidChangeItems(),fP(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(n=>n.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,!1)}getInput(){return this.inputPart.inputEditor.getValue()}logInputHistory(){this.inputPart.logInputHistory()}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(),n=e?"query"in e?e.query:`${e.prefix} ${t}`:t,o=!e||"prefix"in e,r=await this.chatService.sendRequest(this.viewModel.sessionId,n,{location:this.location,locationData:this._location.resolveData?.(),parserContext:{selectedAgent:this._lastSelectedAgent},attachedContext:[...this.inputPart.attachedContext.values()]});if(r)return this.inputPart.acceptInput(o),this._onDidSubmitAgent.fire({agent:r.agent,slashCommand:r.slashCommand}),this.inputPart.updateState(this.collectInputState()),this.inputPart.clearContext(),r.responseCompletePromise.then(()=>{const a=this.viewModel?.getItems().filter(vs),c=a?.[a.length-1];this.chatAccessibilityService.acceptResponse(c,i)}),r.responseCreatedPromise}}setContext(e,...t){this.inputPart.attachContext(e,...t)}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 bn(t,e),this.inputPart.layout(e,t);const i=this.inputPart.inputPartHeight,n=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),n&&fP(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 wn);this._register(this.tree.onDidScroll(n=>{this._dynamicMessageLayoutData?.enabled&&(i.value=Tl(ct(this.listContainer),()=>{if(!n.scrollTopChanged||n.heightChanged||n.scrollHeightChanged)return;const o=n.height,r=n.scrollHeight-o-n.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,n=this.bodyDimension.height,o=this.bodyDimension.width;ta.currentRenderedHeight===void 0),r=o?this._dynamicMessageLayoutData.maxHeight:n.reduce((a,c)=>a+c.currentRenderedHeight,0);this.layout(Math.min(t+r+(i.length>2?18:0),this._dynamicMessageLayoutData.maxHeight),e),(o||!r)&&fP(this.tree)}saveState(){this.inputPart.saveState()}getViewState(){return this.inputPart.saveState(),{inputValue:this.getInput(),inputState:this.collectInputState()}}},LSe=ER,ER.CONTRIBS=[],ER);v9=LSe=D([_(4,Kt),_(5,Le),_(6,we),_(7,Em),_(8,ff),_(9,ON),_(10,lr),_(11,bJe),_(12,Ge),_(13,pn),_(14,BRe)],v9);var BQ;let RSe=class{constructor(e,t,i,n,o,r,a,c,l,d,h){this._instantiationService=i,this._contextKeyService=n,this._keybindingService=o,this._accessibilityService=r,this._configurationService=a,this._accessibleViewService=c,this._textModelResolverService=l,this._chatService=d,this._hoverService=h,this._elements=Bt("div.inline-chat@root",[Bt("div.chat-widget@chatWidget"),Bt("div.accessibleViewer@accessibleViewer"),Bt("div.status@status",[Bt("div.label.info.hidden@infoLabel"),Bt("div.actions.text-style.hidden@toolbar1"),Bt("div.actions.button-style.hidden@toolbar2"),Bt("div.label.status.hidden@statusLabel")])]),this._store=new Z,this._onDidChangeHeight=this._store.add(new I),this.onDidChangeHeight=M.filter(this._onDidChangeHeight.event,C=>!this._isLayouting),this._onDidChangeInput=this._store.add(new I),this.onDidChangeInput=this._onDidChangeInput.event,this._isLayouting=!1,this.scopedContextKeyService=this._store.add(n.createScoped(this._elements.chatWidget));const u=i.createChild(new Uc([Le,this.scopedContextKeyService]),this._store);this._chatWidget=u.createInstance(v9,e,{resource:!0},{defaultElementHeight:32,renderStyle:"minimal",renderInputOnTop:!1,renderFollowups:!0,supportsFileReferences:a.getValue(`chat.experimental.variables.${e.location}`)===!0,filter:C=>!JO(C),...t.chatWidgetViewOptions},{listForeground:X4t,listBackground:Yye,inputEditorBackground:W2,resultEditorBackground:Hc}),this._chatWidget.render(this._elements.chatWidget),this._elements.chatWidget.style.setProperty(Bre(DVt),ze(Yye)),this._chatWidget.setVisible(!0),this._store.add(this._chatWidget);const f=this._store.add(new Z);this._store.add(this._chatWidget.onDidChangeViewModel(()=>{f.clear();const C=this._chatWidget.viewModel;C&&f.add(C.onDidChange(()=>this._onDidChangeHeight.fire())),this._onDidChangeHeight.fire()})),this._store.add(this.chatWidget.onDidChangeContentHeight(()=>{this._onDidChangeHeight.fire()})),this._ctxResponseFocused=B4t.bindTo(this._contextKeyService);const p=this._store.add(Ac(this.domNode));this._store.add(p.onDidBlur(()=>this._ctxResponseFocused.set(!1))),this._store.add(p.onDidFocus(()=>this._ctxResponseFocused.set(!0))),this._ctxInputEditorFocused=O4t.bindTo(n),this._store.add(this._chatWidget.inputEditor.onDidFocusEditorWidget(()=>this._ctxInputEditorFocused.set(!0))),this._store.add(this._chatWidget.inputEditor.onDidBlurEditorWidget(()=>this._ctxInputEditorFocused.set(!1)));const m=t.statusMenuId instanceof _e?t.statusMenuId:t.statusMenuId.menu,v=u.createInstance(mm,this._elements.toolbar1,m,{hiddenItemStrategy:rA.NoHide,telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,actionViewItemProvider:C=>C instanceof Sc?this._instantiationService.createInstance(v6,C,{conversational:!0}):void 0,toolbarOptions:{primaryGroup:"0_main"},menuOptions:{renderShortTitle:!0},label:!0,icon:!1});this._store.add(v.onDidChangeMenuItems(()=>this._onDidChangeHeight.fire())),this._store.add(v);const b=t.statusMenuId instanceof _e?void 0:t.statusMenuId.options,w=u.createInstance(hCe,this._elements.toolbar2,m,{toolbarOptions:{primaryGroup:"0_main"},telemetrySource:t.chatWidgetViewOptions?.menus?.telemetrySource,menuOptions:{renderShortTitle:!0},...b});this._store.add(w.onDidChange(()=>this._onDidChangeHeight.fire())),this._store.add(w);const y=()=>this._elements.status.classList.toggle("text",this._configurationService.getValue(zh.ExpTextButtons));this._store.add(this._configurationService.onDidChangeConfiguration(C=>C.affectsConfiguration(zh.ExpTextButtons)&&y())),y(),this._store.add(this._configurationService.onDidChangeConfiguration(C=>{C.affectsConfiguration(vr.InlineChat)&&this._updateAriaLabel()})),this._elements.root.tabIndex=0,this._elements.statusLabel.tabIndex=0,this._updateAriaLabel(),this._store.add(this._hoverService.setupManagedHover(Pr("element"),this._elements.statusLabel,()=>this._elements.statusLabel.dataset.title)),this._store.add(this._chatService.onDidPerformUserAction(C=>{C.sessionId===this._chatWidget.viewModel?.model.sessionId&&C.action.kind==="vote"&&this.updateStatus("Thank you for your feedback!",{resetAfter:1250})})),this._defaultChatModel=this._store.add(this._instantiationService.createInstance(lZ,void 0,Ir.Editor)),this._defaultChatModel.startInitialize(),this._defaultChatModel.initialize(void 0),this.setChatModel(this._defaultChatModel)}_updateAriaLabel(){if(this._elements.root.ariaLabel=this._accessibleViewService.getOpenAriaHint(vr.InlineChat),this._accessibilityService.isScreenReaderOptimized()){let e=czt;if(this._configurationService.getValue(vr.InlineChat)){const t=this._keybindingService.lookupKeybinding(Yd.OpenAccessibilityHelp)?.getLabel();e=t?g(11375,"Inline Chat Input, Use {0} for Inline Chat Accessibility Help.",t):g(11376,"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=hb(this._elements.status);this._elements.root.style.height=`${e.height-t}px`,this._elements.root.style.width=`${e.width}px`,this._chatWidget.layout(e.height-i-t,e.width)}get contentHeight(){const e={chatWidgetContentHeight:this._chatWidget.contentHeight,statusHeight:hb(this._elements.status),extraHeight:this._getExtraHeight()};return e.chatWidgetContentHeight+e.statusHeight+e.extraHeight}get minHeight(){let e=100;for(const i of this._chatWidget.viewModel?.getItems()??[])if(vs(i)&&i.response.value.some(n=>n.kind==="textEditGroup"&&!n.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 10}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 dt(1,t,Number.MAX_SAFE_INTEGER,1))}set placeholder(e){this._chatWidget.setInputPlaceholder(e)}updateToolbar(e){this._elements.root.classList.toggle("toolbar",e),this._elements.toolbar1.classList.toggle("hidden",!e),this._elements.toolbar2.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)return;const i=t.getItems().filter(o=>vs(o));if(!i.length)return;const n=i[i.length-1];return t.codeBlockModelCollection.get(t.sessionId,n,e)?.model}get responseContent(){const e=this._chatWidget.viewModel?.model.getRequests();if(eo(e))return bg(e)?.response?.response.toString()}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(!0)}updateChatMessage(e,t,i){if(!this._chatWidget.viewModel||this._chatWidget.viewModel.model!==this._defaultChatModel)return;const n=this._defaultChatModel;if(!e?.message.value){for(const r of n.getRequests())n.removeRequest(r.id);return}const o=n.addRequest({parts:[],text:""},{variables:[]},0);if(n.acceptResponseProgress(o,{kind:"markdownContent",content:e.message}),!t){n.completeResponse(o);return}return{cancel:()=>n.cancelRequest(o),complete:()=>n.completeResponse(o),appendContent:r=>{n.acceptResponseProgress(o,{kind:"markdownContent",content:new Mt(r)})}}}updateInfo(e){this._elements.infoLabel.classList.toggle("hidden",!e);const t=Cb(e);aa(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 n=Cb(e);aa(this._elements.statusLabel,...n),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.setContext(!0),this._chatWidget.saveState(),this.updateChatMessage(void 0),aa(this._elements.statusLabel),this._elements.statusLabel.classList.toggle("hidden",!0),this._elements.toolbar1.classList.add("hidden"),this._elements.toolbar2.classList.add("hidden"),this.updateInfo(""),this.chatWidget.setModel(this._defaultChatModel,{}),this._elements.accessibleViewer.classList.toggle("hidden",!0),this._onDidChangeHeight.fire()}focus(){this._chatWidget.focusInput()}hasFocus(){return this.domNode.contains(Bc())}};RSe=D([_(2,we),_(3,Le),_(4,Ut),_(5,mr),_(6,Te),_(7,Am),_(8,fn),_(9,Em),_(10,ec)],RSe);const czt=g(11377,"Inline Chat Input");let MSe=class extends RSe{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(e,{...i,chatWidgetViewOptions:{...i.chatWidgetViewOptions,editorOverflowWidgetsDomNode:t.getOverflowWidgetsDomNode()}},r,n,o,a,c,l,d,h,u),this._parentEditor=t,this._accessibleViewer=this._store.add(new wn)}get contentHeight(){let e=super.contentHeight;return this._accessibleViewer.value&&(e+=this._accessibleViewer.value.height+8),e}_doLayout(e){let t=e.height;this._accessibleViewer.value&&(this._accessibleViewer.value.width=e.width-12,t-=this._accessibleViewer.value.height+8),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(NSe,this._elements.accessibleViewer,e,t,new lzt(this._parentEditor,e,t)),this._onDidChangeHeight.fire()}};MSe=D([_(3,Le),_(4,Ut),_(5,we),_(6,mr),_(7,Te),_(8,Am),_(9,fn),_(10,Em),_(11,ec)],MSe);let NSe=BQ=class extends xx{set width(e){this._width2.set(e,void 0)}constructor(e,t,i,n,o){const r=jt("width",0),a=jt("diff",BQ._asMapping(i)),c=Ze(h=>[a.read(h)]),l=Math.min(10,8+a.get().changedLineCount),d=n.getModifiedOptions().get(x.lineHeight)*l;super(e,td(!0),()=>{},td(!1),r,td(d),c,n,o),this.height=d,this._width2=r,this._store.add(t.textModelN.onDidChangeContent(()=>{a.set(BQ._asMapping(i),void 0)}))}static _asMapping(e){const t=e.getRanges0(),i=e.getRangesN(),n=pi.fromRangeInclusive(t[0]),o=pi.fromRangeInclusive(i[0]),r=[];for(let a=1;a{this._ctxCursorPosition.reset()})),this.widget=this._instaService.createInstance(MSe,e,this.editor,{statusMenuId:{menu:J4t,options:{buttonConfigProvider:l=>new Set([Q4t,j4t]).has(l.id)?{isSecondary:!0,showIcon:!0,showLabel:!1}:l.id===q4t?{isSecondary:!1}:{isSecondary:!0}}},chatWidgetViewOptions:{menus:{executeToolbar:Stt,telemetrySource:"interactiveEditorWidget-toolbar"},rendererOptions:{renderTextEditsAsSummary:l=>ji(l,t.getModel()?.uri)&&r.getValue(zh.Mode)===My.Live}}}),this._disposables.add(this.widget);let a;this._disposables.add(this.widget.chatWidget.onWillMaybeChangeHeight(()=>{this.position&&(a=XE.capture(this.editor))})),this._disposables.add(this.widget.onDidChangeHeight(()=>{if(this.position){a??=XE.capture(this.editor);const l=this._computeHeight();this._relayout(l.linesValue),a.restore(this.editor),a=void 0,this._revealTopOfZoneWidget(this.position,l)}})),this.create(),this._disposables.add(ue(this.domNode,"click",l=>{!this.editor.hasWidgetFocus()&&!this.widget.hasFocus()&&this.editor.focus()},!0));const c=()=>{!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(l=>c())),this._disposables.add(this.editor.onDidFocusEditorText(l=>c())),c()}_fillContainer(e){e.appendChild(this.widget.domNode)}_doLayout(e){const t=this.editor.getLayoutInfo();let i=t.contentWidth-(t.glyphMarginWidth+t.decorationsWidth);i=Math.min(640,i),this._dimension=new bn(i,e),this.widget.layout(this._dimension)}_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){Tt(this.container);const t=XE.capture(this.editor),i=this.editor.getLayoutInfo(),n=i.glyphMarginWidth+i.decorationsWidth+i.lineNumbersWidth;this.container.style.marginLeft=`${n}px`;const o=this._computeHeight();super.show(e,o.linesValue),this.widget.chatWidget.setVisible(!0),this.widget.focus(),t.restore(this.editor),this._revealTopOfZoneWidget(e,o)}updatePositionAndHeight(e){const t=XE.capture(this.editor),i=this._computeHeight();super.updatePositionAndHeight(e,i.linesValue),t.restore(this.editor),this._revealTopOfZoneWidget(e,i)}_revealTopOfZoneWidget(e,t){const i=e.lineNumber<=1?1:1+e.lineNumber,n=this.editor.getScrollTop(),o=this.editor.getTopForLineNumber(i),r=o-t.pixelsValue,a=this.editor.getLayoutInfo().height,c=this.editor.getBottomForLineNumber(i);let l=r,d=!1;c>=n+a&&(l=c-a,d=!0),(l!1},{listForeground:Ll,listBackground:Yye,inputEditorBackground:W2,resultEditorBackground:Hc}),this._store.add(this._widget),this._widget.render(this._inputContainer),this._widget.setModel(this._defaultChatModel,{}),this._store.add(this._widget.onDidChangeContentHeight(()=>t.layoutContentWidget(this))),this._domNode.tabIndex=-1,this._domNode.className="inline-chat-content-widget interactive-session",this._domNode.appendChild(this._inputContainer),this._toolbarContainer.classList.add("toolbar"),o.getValue(zh.ExpTextButtons)&&(this._toolbarContainer.style.display="inherit",this._domNode.style.paddingBottom="4px"),this._domNode.appendChild(this._toolbarContainer);const c=this._store.add(a.createInstance(mm,this._toolbarContainer,Y4t,{actionViewItemProvider:h=>h instanceof Sc?i.createInstance(v6,h,{conversational:!0}):void 0,toolbarOptions:{primaryGroup:"0_main"},icon:!1,label:!0}));this._store.add(c.onDidChangeMenuItems(()=>{this._domNode.classList.toggle("contents",c.getItemsLength()>1)}));let l=!1;this._store.add(this._widget.inputEditor.onDidChangeModelContent(()=>{l||=this._widget.inputEditor.getModel()?.getValueLength()!==0})),this._store.add(this._widget.onDidChangeContext(()=>{l||=!0,t.layoutContentWidget(this)}));const d=Ac(this._domNode);this._store.add(d.onDidBlur(()=>{this._visible&&!l&&!r.currentQuickInput&&this._onDidBlur.fire()})),this._store.add(d)}dispose(){this._store.dispose()}getId(){return"inline-chat-content-widget"}getDomNode(){return this._domNode}getPosition(){return this._position?{position:this._position,preference:[es.ABOVE]}:null}beforeRender(){const e=this._widget.input.inputEditor.getOption(x.lineHeight)*5,t=this._widget.contentHeight,i=Math.min(e,t),n=390;return this._widget.layout(i,n),MGe(this._domNode,n,null),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(F.fromPositions(e),mt.Immediate);const t=this._editor.getModel()?.getWordAtPosition(e);this._position=t?new oe(e.lineNumber,t.startColumn):e,this._editor.addContentWidget(this),this._widget.setContext(!0),this._widget.setVisible(!0)}}hide(){this._visible&&(this._visible=!1,this._editor.removeContentWidget(this),this._widget.inputEditor.setValue(""),this._widget.saveState(),this._widget.setVisible(!1))}setSession(e){this._widget.setModel(e.chatModel,{}),this._widget.setInputPlaceholder(e.agent.description??"")}};FSe=D([_(2,we),_(3,Le),_(4,Te),_(5,In)],FSe);let $Z=class extends Nb{get capabilities(){let e=Ei.CanSplitInGroup;return this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly):e|=Ei.Untitled,e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}get preferredResource(){return this._preferredResource}constructor(e,t,i,n,o,r,a){super(),this.resource=e,this.labelService=i,this.fileService=n,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){ji(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=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.shortDescription;case Ls.LONG:return this.longDescription;case Ls.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Lr(this._preferredResource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Lr(this._preferredResource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Lr(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 Ls.SHORT:return this.shortTitle;case Ls.LONG:return this.longTitle;default:case Ls.MEDIUM:return this.mediumTitle}}isReadonly(){return this.filesConfigurationService.isReadonly(this.resource)}ensureLimits(e){if(e?.limits)return e.limits;const t=HSt(this.resource);let i;const n=this.textResourceConfigurationService.inspect(this.resource,null,"workbench.editorLargeFileConfirmation");return Kht(n)&&(i=n.value*Nc.MB),{size:i??t}}};$Z=D([_(2,Fs),_(3,Jt),_(4,pd),_(5,Ec),_(6,tE)],$Z);let b9=class extends eI{constructor(e,t,i,n,o){super(i,t,n,o,e)}dispose(){this.textEditorModelHandle&&this.modelService.destroyModel(this.textEditorModelHandle),super.dispose()}};b9=D([_(1,xi),_(2,gi),_(3,M6),_(4,mr)],b9);var WQ;let rb=class extends $Z{constructor(e,t,i,n,o,r,a,c,l){super(e,t,o,r,a,c,l),this.editorService=i,this.textFileService=n}save(e,t){return this.resource.scheme!==pe.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 n;if(t?n=await this.textFileService.saveAs(this.resource,void 0,{...e,suggestedTarget:this.preferredResource}):n=await this.textFileService.save(this.resource,e),!!n)return{resource:n}}async revert(e,t){await this.textFileService.revert(this.resource,t)}};rb=D([_(2,ei),_(3,Fo),_(4,Fs),_(5,Jt),_(6,pd),_(7,Ec),_(8,tE)],rb);var xR;let IT=(xR=class extends rb{get typeId(){return WQ.ID}get editorId(){return nm.id}constructor(e,t,i,n,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=n,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,n=i.object;if(!(n instanceof b9))throw i.dispose(),this.modelReference=void 0,new Error(`Unexpected model for TextResourceEditorInput: ${this.resource}`);return this.cachedModel=n,(typeof e=="string"||typeof t=="string")&&n.updateTextEditorModel(typeof e=="string"?tae(e):void 0,t),n}matches(e){return this===e?!0:e instanceof WQ?ji(e.resource,this.resource):Gv(e)?super.matches(e):!1}dispose(){this.modelReference&&(this.modelReference.then(e=>e.dispose()),this.modelReference=void 0),this.cachedModel=void 0,super.dispose()}},WQ=xR,xR.ID="workbench.editors.resourceEditorInput",xR);IT=WQ=D([_(5,fn),_(6,Fo),_(7,ei),_(8,Jt),_(9,Fs),_(10,pd),_(11,Ec),_(12,tE)],IT);const Jr=Za;var HQ,DR;let w9=(DR=class extends rb{get typeId(){return HQ.ID}get editorId(){return nm.id}constructor(e,t,i,n,o,r,a,c,l,d,h){super(e.resource,void 0,n,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){ji(e.resource,this.model.resource)&&e!==this.model&&(this.model=e,this.registerModelListeners(e))}getName(){return this.model.name}getDescription(e=Ls.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?S8(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=KO(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 HQ?ji(e.resource,this.resource):M0t(e)?super.matches(e):!1}dispose(){this.modelResolve=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){bt(this.cachedUntitledTextEditorModelReference),this.cachedUntitledTextEditorModelReference=void 0}},HQ=DR,DR.ID="workbench.editors.untitledEditorInput",DR);w9=HQ=D([_(1,Fo),_(2,Fs),_(3,ei),_(4,Jt),_(5,Jr),_(6,mf),_(7,pd),_(8,fn),_(9,Ec),_(10,tE)],w9);const Loe=class Loe extends Error{constructor(e){super(e),this.name=Loe.code}};Loe.code="InlineChatError";let GZ=Loe,NVe=class{constructor(e,t,i,n,o,r,a,c,l){this._telemetryService=e,this._modelService=t,this._textModelService=i,this._editorWorkerService=n,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=[]}dispose(){this._store.dispose(),this._sessions.forEach(e=>e.store.dispose()),this._sessions.clear()}async createSession(e,t,i){const n=this._chatAgentService.getDefaultAgent(Ir.Editor);if(!n){this._logService.trace("[IE] NO agent found");return}this._onWillStartSession.fire(e);const o=e.getModel(),r=e.getSelection(),a=new Z;this._logService.trace(`[IE] creating NEW session for ${e.getId()}, ${n.extensionId}`);const c=this._chatService.startSession(Ir.Editor,i);if(!c){this._logService.trace("[IE] NO chatModel found");return}a.add(Ee(()=>{this._chatService.clearSession(c.sessionId),c.dispose()}));const l=a.add(new wn);a.add(c.onDidChange(b=>{if(b.kind!=="addRequest"||!b.request.response)return;const{response:w}=b.request;l.value=w.onDidChange(()=>{if(!w.isComplete)return;l.clear();let y;w.isCanceled?y=new Xye(new Ma):w.result?.errorDetails?y=new Xye(new Error(w.result.errorDetails.message)):w.response.value.length===0?y=new Att:y=this._instaService.createInstance(BW,m.textModelN.uri,b.request,w),m.addExchange(new nVt(m.lastInput,y)),y instanceof BW&&y.untitledTextModel&&this._textModelService.createModelReference(y.untitledTextModel.resource).then(C=>{a.add(C)})})})),a.add(this._chatAgentService.onDidChangeAgents(b=>{b===void 0&&!this._chatAgentService.getAgent(n.id)&&(this._logService.trace(`[IE] provider GONE for ${e.getId()}, ${n.extensionId}`),this._releaseSession(m,!0))}));const d=ar(),h=o.uri;a.add(await this._textModelService.createModelReference(o.uri));const u=o,f=a.add(this._modelService.createModel(c6(o.createSnapshot()),{languageId:o.getLanguageId(),onDidChange:M.None},h.with({scheme:pe.vscode,authority:"inline-chat",path:"",query:new URLSearchParams({id:d,textModel0:""}).toString()}),!0));h.scheme===pe.untitled&&a.add(this._editorService.onDidCloseEditor(()=>{this._editorService.isOpened({resource:h,typeId:w9.ID,editorId:nm.id})||this._releaseSession(m,!0)}));let p=t.wholeRange;if(p||(p=new F(r.selectionStartLineNumber,r.selectionStartColumn,r.positionLineNumber,r.positionColumn)),i.isCancellationRequested){a.dispose();return}const m=new tVt(t.editMode,h,f,u,n,a.add(new Jye(u,p)),a.add(new eCe(this._editorWorkerService,f,u)),c),v=this._key(e,m.targetUri);if(this._sessions.has(v))throw a.dispose(),new Error(`Session already stored for ${v}`);return this._sessions.set(v,{session:m,editor:e,store:a}),m}moveSession(e,t){const i=this._key(t,e.targetUri),n=this._sessions.get(i);if(n){if(n.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[n,o]=i;this._sessions.delete(n),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 n=this._instaService.createInstance(Zye,t,e,i);return this._onDidStashSession.fire({editor:t,session:e}),this._logService.trace(`[IE] did STASH session for ${t.getId()}, ${e.agent.extensionId}`),n}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}};NVe=D([_(0,Yi),_(1,gi),_(2,fn),_(3,Rl),_(4,Ge),_(5,we),_(6,ei),_(7,Em),_(8,ff)],NVe);var HB;let PVe=(HB=class{constructor(e,t){this._store=new Z,this._ctxHasProvider=P4t.bindTo(e),this._store.add(t.onDidChangeAgents(()=>{const i=!!t.getDefaultAgent(Ir.Editor);this._ctxHasProvider.set(i)}))}dispose(){this._ctxHasProvider.reset(),this._store.dispose()}},HB.Id="inlineChat.enabler",HB);PVe=D([_(0,Le),_(1,ff)],PVe);var Dr;(function(s){s.CREATE_SESSION="CREATE_SESSION",s.INIT_UI="INIT_UI",s.WAIT_FOR_INPUT="WAIT_FOR_INPUT",s.SHOW_REQUEST="SHOW_REQUEST",s.SHOW_RESPONSE="SHOW_RESPONSE",s.PAUSE="PAUSE",s.CANCEL="CANCEL",s.ACCEPT="DONE"})(Dr||(Dr={}));var Hl;(function(s){s[s.NONE=0]="NONE",s[s.ACCEPT_SESSION=1]="ACCEPT_SESSION",s[s.CANCEL_SESSION=2]="CANCEL_SESSION",s[s.PAUSE_SESSION=4]="PAUSE_SESSION",s[s.CANCEL_REQUEST=8]="CANCEL_REQUEST",s[s.CANCEL_INPUT=16]="CANCEL_INPUT",s[s.ACCEPT_INPUT=32]="ACCEPT_INPUT"})(Hl||(Hl={}));let FVe=class{static get(e){return e.getContribution(a4e)}get chatWidget(){return this._ui.value.content.isVisible?this._ui.value.content.chatWidget:this._ui.value.zone.widget.chatWidget}constructor(e,t,i,n,o,r,a,c,l,d,h){this._editor=e,this._instaService=t,this._inlineChatSessionService=i,this._inlineChatSavingService=n,this._editorWorkerService=o,this._logService=r,this._configurationService=a,this._dialogService=c,this._chatService=d,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 wn),this._forcedPlaceholder=void 0,this._ctxVisible=F4t.bindTo(l),this._ctxUserDidEdit=U4t.bindTo(l),this._ctxResponseType=K4t.bindTo(l),this._ctxRequestInProgress=G4t.bindTo(l),this._ui=new ya(()=>{const u={location:Ir.Editor,resolveData:()=>(Tt(this._editor.hasModel()),Tt(this._session),{type:Ir.Editor,selection:this._editor.getSelection(),document:this._session.textModelN.uri,wholeRange:this._session?.wholeRange.trackedInitialRange})};for(const m of h.listNotebookEditors())for(const[,v]of m.codeEditors)if(v===this._editor){u.location=Ir.Notebook;break}const f=this._store.add(t.createInstance(FSe,u,this._editor)),p=this._store.add(t.createInstance(PSe,u,this._editor));return{content:f,zone:p}}),this._store.add(this._editor.onDidChangeModel(async u=>{if(this._session||!u.newModelUrl)return;const f=this._inlineChatSessionService.getSession(this._editor,u.newModelUrl);f&&(this._log("session RESUMING after model change",u),await this.run({existingSession:f}))})),this._store.add(this._inlineChatSessionService.onDidEndSession(u=>{u.session===this._session&&u.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 u=>{u.editor===this._editor&&(this._log("session RESUMING after move",u),await this.run({existingSession:u.session}))})),this._log("NEW controller")}dispose(){this._currentRun&&this._messages.fire(this._session?.chatModel.hasRequests?Hl.PAUSE_SESSION:Hl.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 a4e}_getMode(){return this._configurationService.getValue(zh.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(Dr.CREATE_SESSION,e),await this._currentRun}catch(t){vt(t),this._session&&this._inlineChatSessionService.releaseSession(this._session),this[Dr.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[Dr.CREATE_SESSION](e){Tt(this._session===void 0),Tt(this._editor.hasModel());let t=e.existingSession,i;e.position&&(i=oe.lift(e.position).delta(-1),delete e.position);const n=this._showWidget(!0,i);let o=g(7081,"Failed to start editor chat");if(!t){const r=new ci,a=M.once(this._messages.event)(c=>{this._log("state=_createSession) message received",c),c===Hl.ACCEPT_INPUT?(e.autoSend=!0,this._ui.value.zone.widget.updateInfo(g(7082,"Getting ready..."))):r.cancel()});try{t=await this._inlineChatSessionService.createSession(this._editor,{editMode:this._getMode(),wholeRange:e.initialRange},r.token)}catch(c){(c instanceof GZ||c?.name===GZ.code)&&(o=c.message)}if(r.dispose(),a.dispose(),r.token.isCancellationRequested)return t&&this._inlineChatSessionService.releaseSession(t),Dr.CANCEL}if(delete e.initialRange,delete e.existingSession,!t)return Ih.get(this._editor)?.showMessage(o,n),this._log("Failed to start editor chat"),Dr.CANCEL;switch(await t.chatModel.waitForInitialization(),t.editMode){case My.Preview:this._strategy=this._instaService.createInstance(cCe,t,this._editor,this._ui.value.zone);break;case My.Live:default:this._strategy=this._instaService.createInstance(lCe,t,this._editor,this._ui.value.zone);break}return this._session=t,Dr.INIT_UI}async[Dr.INIT_UI](e){Tt(this._session),Tt(this._strategy),gu.get(this._editor)?.hide(),this._sessionStore.clear();const t=this._editor.createDecorationsCollection(),i=()=>{const o=this._strategy?.getWholeRangeDecoration()??[];t.set(o)};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(),this._showWidget(!this._session.chatModel.hasRequests),this._ui.value.zone.widget.updateToolbar(!0),this._sessionStore.add(this._editor.onDidChangeModel(o=>{const r=this._session?.chatModel.hasRequests?Hl.PAUSE_SESSION:Hl.CANCEL_SESSION;this._log("model changed, pause or cancel session",r,o),this._messages.fire(r)}));const n=this._editor.getModel()?.getAlternativeVersionId();return this._sessionStore.add(this._editor.onDidChangeModelContent(o=>{if(this._session?.hunkData.ignoreTextModelNChanges||this._ctxUserDidEdit.set(n!==this._editor.getModel()?.getAlternativeVersionId()),this._session?.hunkData.ignoreTextModelNChanges||this._strategy?.hasFocus())return;const r=this._session.wholeRange;let a=!1;if(this._configurationService.getValue(zh.FinishOnType))for(const{range:c}of o.changes)a=!F.areIntersectingOrTouching(c,r.value);this._session.recordExternalEditOccurred(a),a&&(this._log("text changed outside of whole range, FINISH session"),this.finishExistingSession())})),this._sessionStore.add(this._session.chatModel.onDidChange(async o=>{o.kind==="removeRequest"&&await this._session.undoChangesUntil(o.requestId)})),this._session.chatModel.hasRequests?(e.isUnstashed&&delete e.isUnstashed,Dr.SHOW_RESPONSE):Dr.WAIT_FOR_INPUT}async[Dr.WAIT_FOR_INPUT](e){Tt(this._session),Tt(this._strategy),this._updatePlaceholder(),e.message&&(this.updateInput(e.message),Mr(e.message),delete e.message,this._showWidget(!1));let t=Hl.NONE,i;const n=new Gd,o=new Z;return o.add(this._session.chatModel.onDidChange(r=>{r.kind==="addRequest"&&(i=r.request,t=Hl.ACCEPT_INPUT,n.open())})),o.add(this._strategy.onDidAccept(()=>this.acceptSession())),o.add(this._strategy.onDidDiscard(()=>this.cancelSession())),o.add(M.once(this._messages.event)(r=>{this._log("state=_waitForInput) message received",r),t=r,n.open()})),e.autoSend&&(delete e.autoSend,this._showWidget(!1),this._ui.value.zone.widget.chatWidget.acceptInput()),await n.wait(),o.dispose(),t&(Hl.CANCEL_INPUT|Hl.CANCEL_SESSION)?Dr.CANCEL:t&Hl.PAUSE_SESSION?Dr.PAUSE:t&Hl.ACCEPT_SESSION?(this._ui.value.zone.widget.selectAll(!1),Dr.ACCEPT):i?.message.text?(this._session.addInput(new iVt(i,this._editor.getModel().getAlternativeVersionId())),Dr.SHOW_REQUEST):Dr.WAIT_FOR_INPUT}async[Dr.SHOW_REQUEST](){Tt(this._session),Tt(this._session.chatModel.requestInProgress),this._ctxRequestInProgress.set(!0);const{chatModel:e}=this._session,t=e.getRequests().at(-1);Tt(t),Tt(t.response),this._showWidget(!1),this._ui.value.zone.widget.selectAll(!1),this._ui.value.zone.widget.updateInfo("");const{response:i}=t,n=new dc,o=new Z,r=o.add(new ci),a=new j1e,c=js.create(),l=new gI;let d=Dr.SHOW_RESPONSE;o.add(M.once(this._messages.event)(y=>{this._log("state=_makeRequest) message received",y),this._chatService.cancelCurrentRequestForSession(e.sessionId),y&Hl.CANCEL_SESSION?d=Dr.CANCEL:y&Hl.PAUSE_SESSION?d=Dr.PAUSE:y&Hl.ACCEPT_SESSION&&(d=Dr.ACCEPT)})),o.add(e.onDidChange(y=>{y.kind==="removeRequest"&&y.requestId===t.id&&(r.cancel(),n.complete(),y.reason===f9.Resend?d=Dr.SHOW_REQUEST:d=Dr.CANCEL)})),o.add(this._ui.value.zone.widget.chatWidget.inputEditor.onDidChangeModelContent(()=>{this._chatService.cancelCurrentRequestForSession(e.sessionId)}));let h=0,u=!0;const f=new j2,m={sha1:f.canComputeSHA1(this._session.textModel0)?f.computeSHA1(this._session.textModel0):ar(),applied:0};let v;const b=()=>{if(this._updateCtxResponseType(),v||(v=i.response.value.find(y=>y.kind==="textEditGroup"&&ji(y.uri,this._session?.textModelN.uri))),v){v.state??=m;const y=v.edits,C=y.slice(h);C.length>0&&(h=y.length,a.update(c.elapsed()),c.reset(),l.queue(async()=>{const A=this._session.wholeRange.value.getStartPosition();for(const k of C)await this._makeChanges(k,{duration:a.value,token:r.token},u),u=!1;const L=this._session.wholeRange.value.getStartPosition();(!L.equals(A)||!this._ui.value.zone.position?.equals(L))&&this._showWidget(!1,L.delta(-1))}))}i.isCanceled?(r.cancel(),n.complete()):i.isComplete&&n.complete()};o.add(i.onDidChange(b)),b(),await n.p,await l.whenIdle(),i.isCanceled&&await this._session.undoChangesUntil(i.requestId),o.dispose();const w=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(w?.changes??[]),await this._session.hunkData.recompute(m,w),this._ctxRequestInProgress.set(!1),d}async[Dr.SHOW_RESPONSE](){Tt(this._session),Tt(this._strategy);const{response:e}=this._session.lastExchange;let t;if(e instanceof Att){const i=g(7083,"No results, please refine your input and try again");return this._ui.value.zone.widget.updateStatus(i,{classes:["warn"]}),Dr.WAIT_FOR_INPUT}else if(e instanceof Xye)e.isCancellation||(this._ui.value.zone.widget.updateStatus(e.message,{classes:["error"]}),this._strategy?.cancel());else if(e instanceof BW){this._ui.value.zone.widget.updateStatus("");const i=await this._strategy.renderChanges();if(i){const n=this._editor.getSelection();n?.containsPosition(i)?i.lineNumber-n.startLineNumber>8&&(t=i):t=i}}return this._showWidget(!1,t),Dr.WAIT_FOR_INPUT}async[Dr.PAUSE](){this._resetWidget(),this._strategy?.dispose?.(),this._session=void 0}async[Dr.ACCEPT](){Tt(this._session),Tt(this._strategy),this._sessionStore.clear();try{await this._strategy.apply()}catch(e){this._dialogService.error(g(7084,"Failed to apply changes.",Nr(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[Dr.CANCEL](){if(this._session){Tt(this._strategy),this._sessionStore.clear();const e=!this._session.isUnstashed&&this._session.chatModel.hasRequests&&this._session.hunkData.size===this._session.hunkData.pending;let t=[];try{t=this._strategy.cancel()}catch(i){this._dialogService.error(g(7085,"Failed to discard changes.",Nr(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){Tt(this._editor.hasModel()),this._ctxVisible.set(!0);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.chatModel.hasRequests)&&(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)),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()}_updateCtxResponseType(){if(!this._session){this._ctxResponseType.set(M1.None);return}const e=i=>i.value.some(n=>n.kind==="textEditGroup"&&ji(n.uri,this._session?.textModelN.uri));let t=M1.None;for(const i of this._session.chatModel.getRequests())if(i.response&&(t=M1.Messages,e(i.response.response))){t=M1.MessagesAndEdits;break}this._ctxResponseType.set(t)}async _makeChanges(e,t,i){Tt(this._session),Tt(this._strategy);const n=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,n),n?.length===0)return;const r=(!t&&n?n:e).map(G1e.asEditOperation),a={start:()=>this._session.hunkData.ignoreTextModelNChanges=!0,stop:()=>this._session.hunkData.ignoreTextModelNChanges=!1};this._inlineChatSavingService.markChanged(this._session),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?.agent.description??""}showSaveHint(){const e=g(7086,"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 dt(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(Hl.CANCEL_INPUT|Hl.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,n=e?i:i+1;this._editor.setPosition({lineNumber:n,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,n=this._session.chatModel.getRequests();for(const r of n)if(r.response)for(const a of r.response.response.value)a.kind==="textEditGroup"&&ji(a.uri,i)&&(e=e||!!a.state?.applied,t=a);const o=this._strategy.cancel();e&&(Tt(t),t.edits=[o]),await this._instaService.invokeFunction(hzt,this._session?.chatModel),this.cancelSession()}toggleDiff(){this._strategy?.toggleDiff?.()}acceptSession(){const e=this._session?.chatModel.getRequests().at(-1)?.response;e&&this._chatService.notifyUserAction({sessionId:e.session.sessionId,requestId:e.requestId,agentId:e.agent?.id,command:e.slashCommand?.name,result:e.result,action:{kind:"inlineChat",action:"accepted"}}),this._messages.fire(Hl.ACCEPT_SESSION)}acceptHunk(){return this._strategy?.acceptHunk()}discardHunk(){return this._strategy?.discardHunk()}async cancelSession(){const e=this._session?.chatModel.getRequests().at(-1)?.response;e&&this._chatService.notifyUserAction({sessionId:e.session.sessionId,requestId:e.requestId,agentId:e.agent?.id,command:e.slashCommand?.name,result:e.result,action:{kind:"inlineChat",action:"discarded"}}),this._messages.fire(Hl.CANCEL_SESSION)}finishExistingSession(){this._session&&(this._session.editMode===My.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}};FVe=D([_(1,we),_(2,URe),_(3,AJe),_(4,Rl),_(5,Ge),_(6,Te),_(7,to),_(8,Le),_(9,Em),_(10,k6)],FVe);async function hzt(s,e){const t=s.get(km),i=s.get(Em),n=await C4t(t);if(n&&n.viewModel&&e){for(const o of e.getRequests().slice())await i.adoptRequest(n.viewModel.model.sessionId,o);n.focusLastMessage()}}const uzt="workbench.action.quickchat.toggle";var OSe;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(OSe||(OSe={}));function Jtt(s){const e=[],t=new Map,i=(n,o)=>{if(!t.has(n)&&(t.set(n,!0),!(n[0]==="_"||n.indexOf("vscode.")===0)&&s.get(n)!==!0)){if(!o){const r=_t.getCommand(n);if(r&&typeof r.metadata=="object"&&eo(r.metadata.args))return}e.push(n)}};for(const n of jn.getMenuItems(_e.CommandPalette))pT(n)&&i(n.command.id,!0);for(const n of sp.getEditorActions())i(n.id,!0);for(const n of _t.getCommands().keys())i(n,!1);return e}var Pm;const due="keybinding.entry.template",OVe=g(4636,"System"),BVe=g(4637,"Extension"),WVe=g(4638,"User");function gzt(s,e){const t=e?` +when:${e}`:"";return`@command:${s}${t}`}const fzt=z2(vM,DE,oae),pzt=/@command:\s*([^\+]+)/i,mzt=/\+when:\s*(.+)/i,HVe=/@source:\s*(user|default|system|extension)/i,UVe=/@ext:\s*((".+")|([^\s]+))/i,_zt=/@keybinding:\s*((\".+\")|(\S+))/i;let VVe=Pm=class extends xI{constructor(e,t,i){super(),this.keybindingsService=t,this.extensionService=i,this._keybindingItems=[],this._keybindingItemsSortedByPrecedence=[],this.modifierLabels={ui:h6.modifierLabels[e],aria:nje.modifierLabels[e],user:ALe.modifierLabels[e]}}fetch(e,t=!1){let i=t?this._keybindingItemsSortedByPrecedence:this._keybindingItems;const n=pzt.exec(e);if(n&&n[1]){const o=n[1].trim();let r=i.filter(a=>a.command===o);if(r.length){const a=mzt.exec(e);if(a&&a[1]){const c=a[1].trim();r=this.filterByWhen(r,o,c)}}return r.map(a=>({id:Pm.getId(a),keybindingItem:a,templateId:due}))}if(HVe.test(e))i=this.filterBySource(i,e),e=e.replace(HVe,"");else{const o=UVe.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(UVe,"")}else{const r=_zt.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:Pm.getId(o),keybindingItem:o,templateId:due}))}filterBySource(e,t){return/@source:\s*default/i.test(t)||/@source:\s*system/i.test(t)?e.filter(i=>i.source===OVe):/@source:\s*user/i.test(t)?e.filter(i=>i.source===WVe):/@source:\s*extension/i.test(t)?e.filter(i=>!Lt(i.source)||i.source===BVe):e}filterByExtension(e,t){return t=t.toLowerCase().trim(),e.filter(i=>!Lt(i.source)&&(Sn.equals(i.source.identifier,t)||i.source.displayName?.toLowerCase()===t.toLowerCase()))}filterByText(e,t){const i=t.charAt(0)==='"',n=t.charAt(t.length-1)==='"',o=i&&n;i&&(t=t.substring(1)),n&&(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 vzt(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:Pm.getId(l),templateId:due,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 n=e.filter(c=>c.when===i);if(n.length)return n;const o=e[0].commandLabel,r=new Ax(void 0,t,null,he.deserialize(i),!1,null,!1),a=new Map([[t,o]]);return[Pm.toKeybindingEntry(t,r,a,this.getExtensionsMapping())]}splitKeybindingWords(e){const t=[];for(const i of e)t.push(...Fi(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(Pm.toKeybindingEntry(o.command,o,e,t)),i.set(o.command,!0));const n=this.keybindingsService.getDefaultKeybindings().map(o=>o.command);for(const o of Jtt(i)){const r=new Ax(void 0,o,null,void 0,n.indexOf(o)===-1,null,!1);this._keybindingItemsSortedByPrecedence.push(Pm.toKeybindingEntry(o,r,e,t))}return this._keybindingItemsSortedByPrecedence=ja(this._keybindingItemsSortedByPrecedence,o=>Pm.getId(o)),this._keybindingItems=this._keybindingItemsSortedByPrecedence.slice(0).sort((o,r)=>Pm.compareKeybindingData(o,r)),super.resolve()}static getId(e){return e.command+(e?.keybinding?.getAriaLabel()??"")+e.when+(Lt(e.source)?e.source:e.source.identifier.value)}getExtensionsMapping(){const e=new va;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,n){const o=jn.getCommand(e),r=i.get(e);let a=WVe;if(t.isDefault){const c=t.extensionId??(t.resolvedKeybinding?void 0:o?.source?.id);a=c?n.get(c)??BVe:OVe}return{keybinding:t.resolvedKeybinding,keybindingItem:t,command:e,commandLabel:Pm.getCommandLabel(o,r),commandDefaultLabel:Pm.getCommandDefaultLabel(o),when:t.when?t.when.serialize():"",source:a}}static getCommandDefaultLabel(e){if(!yk.isDefaultVariant()&&e&&e.title&&e.title.original){const t=e.category?e.category.original:void 0,i=e.title.original;return t?g(4639,"{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,n=typeof e.title=="string"?e.title:e.title.value;return i?g(4639,"{0}: {1}",i,n):n}return t||""}};VVe=Pm=D([_(1,Ut),_(2,fs)],VVe);class vzt{constructor(e,t,i,n,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,z2(DE,NY),n),this.commandLabelMatches=t.commandLabel?this.matches(i,t.commandLabel,(a,c)=>DE(a,t.commandLabel,!0),n):null,this.commandDefaultLabelMatches=t.commandDefaultLabel?this.matches(i,t.commandDefaultLabel,(a,c)=>DE(a,t.commandDefaultLabel,!0),n):null,this.whenMatches=t.when?this.matches(null,t.when,z2(DE,NY),n):null,Lt(t.source)?this.sourceMatches=this.matches(i,t.source,(a,c)=>DE(a,t.source,!0),n):this.extensionLabelMatches=t.source.displayName?this.matches(i,t.source.displayName,(a,c)=>DE(a,t.commandLabel,!0),n):null),this.keybindingMatches=t.keybinding?this.matchesKeybinding(t.keybinding,i,o,r):null}matches(e,t,i,n){let o=e?fzt(e,t):null;return o||(o=this.matchesWords(n,t,i)),o&&(o=this.filterAndSort(o)),o}matchesWords(e,t,i){let n=[];for(const o of e){const r=i(o,t);if(r)n=[...n||[],...r];else{n=null;break}}return n}filterAndSort(e){return ja(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,n){const[o,r]=e.getChords(),a=e.getUserSettingsLabel(),c=e.getAriaLabel(),l=e.getLabel();if(a&&bS(t,a)===0||c&&bS(t,c)===0||l&&bS(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(871,"No matching commands"),commandId:""})},n,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=yGe(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:We.asClassName(ve.gear),tooltip:g(872,"Configure Keybinding")}],trigger:()=>(this.preferencesService.openGlobalKeybindingSettings(!1,{query:gzt(t.commandId,t.commandWhen)}),kS.CLOSE_PICKER)}))}hasAdditionalCommandPicks(e,t){return!(!this.useAiRelatedInfo||t.isCancellationRequested||e===""||!this.aiRelatedInformationService.isEnabled())}async getAdditionalCommandPicks(e,t,i,n){if(!this.hasAdditionalCommandPicks(i,n))return[];let o;try{await Sr(EV.AI_RELATED_INFORMATION_DEBOUNCE,n),o=await this.getRelatedInformationPicks(e,t,i,n)}catch{return[]}(t.length||o.length)&&o.push({type:"separator"});const r=this.chatAgentService.getDefaultAgent(Ir.Panel);return r&&o.push({label:g(873,"Ask {0}: {1}",r.fullName,i),commandId:this.configuration.experimental.askChatLocation==="quickChat"?uzt:N4t,args:[i]}),o}async getRelatedInformationPicks(e,t,i,n){const o=await this.aiRelatedInformationService.getRelatedInformation(i,[OSe.CommandInformation],n);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,n=this.menuService.getMenuActions(_e.CommandPalette,t).reduce((o,[,r])=>[...o,...r],[]).filter(o=>o instanceof Sc&&o.enabled);for(const o of n){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(874,"{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||MLe(h)?h:{value:h,original:h};e.push({commandId:o.item.id,commandWhen:o.item.precondition?.serialize(),commandAlias:d,label:rae(r),commandDescription:u})}return e}},EV=KS,KS.AI_RELATED_INFORMATION_MAX_PICKS=5,KS.AI_RELATED_INFORMATION_THRESHOLD=.8,KS.AI_RELATED_INFORMATION_DEBOUNCE=200,KS);QM=EV=D([_(0,ei),_(1,Oa),_(2,fs),_(3,we),_(4,Ut),_(5,vi),_(6,Yi),_(7,to),_(8,Te),_(9,Po),_(10,N6),_(11,Er),_(12,GRe),_(13,ff)],QM);const Roe=class Roe extends li{constructor(){super({id:Roe.ID,title:Fe(875,"Show All Commands"),keybinding:{weight:Ae.WorkbenchContrib,when:void 0,primary:nf?void 0:U.CtrlCmd|U.Shift|S.KeyP,secondary:[S.F1]},f1:!0})}async run(e){e.get(In).quickAccess.show(QM.PREFIX)}};Roe.ID="workbench.action.showCommands";let iI=Roe;class bzt extends li{constructor(){super({id:"workbench.action.clearCommandHistory",title:Fe(876,"Clear Command History"),f1:!0})}async run(e){const t=e.get(Te),i=e.get($i),n=e.get(to);if(u9.getConfiguredCommandHistoryLength(t)>0){const{confirmed:r}=await n.confirm({type:"warning",message:g(877,"Do you want to clear the history of recently used commands?"),detail:g(878,"This action is irreversible!"),primaryButton:g(879,"&&Clear")});if(!r)return;u9.clearHistory(t,i)}}}class Xtt{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new Z;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new wn);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Z,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=e6(o);if(a){let c=o.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{c=o.saveViewState()??void 0})),r.restoreViewState=()=>{c&&o===this.activeTextEditorControl&&o.restoreViewState(c)},n.add(cm(t.onCancellationRequested)(()=>r.restoreViewState?.()))}n.add(Ee(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,Ab.JUMP),e.revealRangeInCenter(t.range,mt.Smooth),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Ch(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return Zp(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.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:$o(yqe),position:Dl.Full}}}],[r,a]=i.deltaDecorations(n,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 Moe=class Moe extends Xtt{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=g(4642,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,V.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new Z;o.add(t.onDidAccept(c=>{const[l]=t.selectedItems;if(l){if(!this.isValidLineNumber(n,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(n,t.value.trim().substr(Moe.PREFIX.length)),l=this.getPickLabel(n,c.lineNumber,c.column);if(t.items=[{lineNumber:c.lineNumber,column:c.column,label:l}],t.ariaLabel=l,!this.isValidLineNumber(n,c.lineNumber)){this.clearDecorations(n);return}const d=this.toRange(c.lineNumber,c.column);n.revealRangeInCenter(d,mt.Smooth),this.addDecorations(n,d)};r(),o.add(t.onDidChangeValue(()=>r()));const a=e6(n);return a&&a.getOptions().get(x.lineNumbers).renderType===wr.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)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?g(4643,"Go to line {0} and character {1}.",t,i):g(4644,"Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?g(4645,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,o):g(4646,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.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 n=this.getModel(e);if(!n)return!1;const o={lineNumber:t,column:i};return n.validatePosition(o).equals(o)}lineCount(e){return this.getModel(e)?.getLineCount()??0}};Moe.PREFIX=":";let KZ=Moe,qZ=class extends KZ{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)}};qZ=D([_(0,ei),_(1,Po),_(2,Te)],qZ);const Noe=class Noe extends li{constructor(){super({id:Noe.ID,title:Fe(880,"Go to Line/Column..."),f1:!0,keybinding:{weight:Ae.WorkbenchContrib,when:null,primary:U.CtrlCmd|S.KeyG,mac:{primary:U.WinCtrl|S.KeyG}}})}async run(e){e.get(In).quickAccess.show(qZ.PREFIX)}};Noe.ID="workbench.action.gotoLine";let QZ=Noe;At(QZ);Qe.as(DU.Quickaccess).registerQuickAccessProvider({ctor:qZ,prefix:KZ.PREFIX,placeholder:g(881,"Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."),helpEntries:[{description:g(882,"Go to Line/Column"),commandId:QZ.ID}]});var UQ,sb;let TT=(sb=class extends Xtt{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(4647,"To go to a symbol, first open a text editor with symbol information.")),V.None}provideWithTextEditor(e,t,i,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):V.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new Z;return this.provideLabelPick(i,g(4648,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:pt.String}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new dc,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(Ee(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,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,n);let l;const d=async h=>{l?.dispose(!0),i.busy=!1,l=new ci(n),i.busy=!0;try{const u=m9(i.value.substr(UQ.PREFIX.length).trim()),f=await this.doGetSymbolPicks(c,u,void 0,l.token,t);if(n.isCancellationRequested)return;if(f.length>0){if(i.items=f,h&&u.original.length===0){const p=bk(f,m=>!!(m.type!=="separator"&&m.range&&F.containsPosition(m.range.decoration,h)));p&&(i.activeItems=[p])}}else u.original.length>0?this.provideLabelPick(i,g(4649,"No matching editor symbols")):this.provideLabelPick(i,g(4650,"No editor symbols"))}finally{n.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,mt.Smooth),this.addDecorations(r,h.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,o){const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(UQ.SCOPE_PREFIX)===0,c=a?1:0;let l,d;t.values&&t.values.length>1?(l=tVe(t.values[0]),d=tVe(t.values.slice(1))):l=t;let h;const u=this.options?.openSideBySideDirection?.();u&&(h=[{iconClass:u==="right"?We.asClassName(ve.splitHorizontal):We.asClassName(ve.splitVertical),tooltip:u==="right"?g(4651,"Open to the Side"):g(4652,"Open to the Bottom")}]);const f=[];for(let v=0;vc){let G=!1;if(l!==t&&([L,k]=aue(y,{...t,values:void 0},c,C),typeof L=="number"&&(G=!0)),typeof L!="number"&&([L,k]=aue(y,l,c,C),typeof L!="number"))continue;if(!G&&d){if(A&&d.original.length>0&&([P,R]=aue(A,d)),typeof P!="number")continue;typeof L=="number"&&(L+=P)}}const z=b.tags&&b.tags.indexOf(v8.Deprecated)>=0;f.push({index:v,kind:b.kind,score:L,label:y,ariaLabel:Vct(b.name,b.kind),description:A,highlights:z?void 0:{label:k,description:R},range:{selection:F.collapseToStart(b.selectionRange),decoration:b.range},uri:o.uri,symbolName:w,strikethrough:z,buttons:h})}const p=f.sort((v,b)=>a?this.compareByKindAndScore(v,b):this.compareByScore(v,b));let m=[];if(a){let y=function(){b&&typeof v=="number"&&w>0&&(b.label=Up(uue[v]||hue,w))},v,b,w=0;for(const C of p)v!==C.kind?(y(),v=C.kind,w=1,b={type:"separator"},m.push(b)):w++,m.push(C);y()}else p.length>0&&(m=[{label:g(4653,"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=uue[e.kind]||hue,n=uue[t.kind]||hue,o=i.localeCompare(n);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()}},UQ=sb,sb.PREFIX="@",sb.SCOPE_PREFIX=":",sb.PREFIX_BY_CATEGORY=`${sb.PREFIX}${sb.SCOPE_PREFIX}`,sb);TT=UQ=D([_(0,it),_(1,X6)],TT);const hue=g(4654,"properties ({0})"),uue={[pt.Method]:g(4655,"methods ({0})"),[pt.Function]:g(4656,"functions ({0})"),[pt.Constructor]:g(4657,"constructors ({0})"),[pt.Variable]:g(4658,"variables ({0})"),[pt.Class]:g(4659,"classes ({0})"),[pt.Struct]:g(4660,"structs ({0})"),[pt.Event]:g(4661,"events ({0})"),[pt.Operator]:g(4662,"operators ({0})"),[pt.Interface]:g(4663,"interfaces ({0})"),[pt.Namespace]:g(4664,"namespaces ({0})"),[pt.Package]:g(4665,"packages ({0})"),[pt.TypeParameter]:g(4666,"type parameters ({0})"),[pt.Module]:g(4667,"modules ({0})"),[pt.Property]:g(4654,"properties ({0})"),[pt.Enum]:g(4668,"enumerations ({0})"),[pt.EnumMember]:g(4669,"enumeration members ({0})"),[pt.String]:g(4670,"strings ({0})"),[pt.File]:g(4671,"files ({0})"),[pt.Array]:g(4672,"arrays ({0})"),[pt.Number]:g(4673,"numbers ({0})"),[pt.Boolean]:g(4674,"booleans ({0})"),[pt.Object]:g(4675,"objects ({0})"),[pt.Key]:g(4676,"keys ({0})"),[pt.Field]:g(4677,"fields ({0})"),[pt.Constant]:g(4678,"constants ({0})")};var BSe;(function(s){s[s.OutlinePane=1]="OutlinePane",s[s.Breadcrumbs=2]="Breadcrumbs",s[s.QuickPick=4]="QuickPick"})(BSe||(BSe={}));var zVe;(function(s){s.icons="outline.icons",s.collapseItems="outline.collapseItems",s.problemsEnabled="outline.problems.enabled",s.problemsColors="outline.problems.colors",s.problemsBadges="outline.problems.badges"})(zVe||(zVe={}));var $Ve;(function(s){s.Collapsed="alwaysCollapse",s.Expanded="alwaysExpand"})($Ve||($Ve={}));var WSe,kR;let jZ=(kR=class extends TT{constructor(e,t,i,n,o,r){super(n,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(!P2(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,n,o){return!await Promise.race([this.waitForLanguageSymbolRegistry(e,n),Sr(WSe.SYMBOL_PICKS_TIMEOUT)])||o.isCancellationRequested?[]:this.doGetSymbolPicks(this.getDocumentSymbols(e,o),m9(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 V.None;const i=new ci,n=new Z;return n.add(Ee(()=>i.dispose(!0))),e.busy=!0,this.outlineService.createOutline(t,BSe.QuickPick,i.token).then(o=>{if(!o)return;if(i.token.isCancellationRequested){o.dispose();return}n.add(o);const r=o.captureViewState();n.add(Ee(()=>{e.selectedItems.length===0&&r.dispose()}));const a=o.config.quickPickDataSource.getQuickPickElements(),c=a.map((h,u)=>({kind:pt.File,index:u,score:0,label:h.label,description:h.description,ariaLabel:h.ariaLabel,iconClasses:h.iconClasses}));n.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(TT.PREFIX.length).trim(),p=oF(u.label),m=Fk(f,f.toLowerCase(),0,p.text,p.text.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return m?(u.score=m[1],u.highlights={label:Lq(f,p)??void 0},!0):!1});if(h.length===0){const u=g(883,"No matching entries");e.items=[{label:u,index:-1,kind:pt.String}],e.ariaLabel=u}else e.items=h};l(),n.add(e.onDidChangeValue(l));const d=new wn;n.add(d),n.add(e.onDidChangeActive(()=>{const[h]=e.activeItems;h&&a[h.index]?d.value=o.preview(a[h.index].element):d.clear()}))}).catch(o=>{vt(o),e.hide()}).finally(()=>{e.busy=!1}),n}},WSe=kR,kR.SYMBOL_PICKS_TIMEOUT=8e3,kR);jZ=WSe=D([_(0,ei),_(1,Po),_(2,Te),_(3,it),_(4,nXe),_(5,X6)],jZ);const Poe=class Poe extends li{constructor(){super({id:Poe.ID,title:{...Fe(884,"Go to Symbol in Editor..."),mnemonicTitle:g(885,"Go to &&Symbol in Editor...")},f1:!0,keybinding:{when:he.and(mp.negate(),RA.negate()),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|U.Shift|S.KeyO},menu:[{id:_e.MenubarGoMenu,group:"4_symbol_nav",order:1}]})}run(e){e.get(In).quickAccess.show(jZ.PREFIX,{itemActivation:Of.NONE})}};Poe.ID="workbench.action.gotoSymbol";let YZ=Poe;At(YZ);Qe.as(DU.Quickaccess).registerQuickAccessProvider({ctor:jZ,prefix:TT.PREFIX,contextKey:"inFileSymbolsPicker",placeholder:g(886,"Type the name of a symbol to go to."),helpEntries:[{description:g(887,"Go to Symbol in Editor"),prefix:TT.PREFIX,commandId:YZ.ID,commandCenterOrder:40},{description:g(888,"Go to Symbol in Editor by Category"),prefix:TT.PREFIX_BY_CATEGORY}]});const hA={primary:U.CtrlCmd|S.KeyP,secondary:[U.CtrlCmd|S.KeyE],mac:{primary:U.CtrlCmd|S.KeyP,secondary:void 0}};So.registerCommandAndKeybindingRule({id:"workbench.action.closeQuickOpen",weight:Ae.WorkbenchContrib,when:gC,primary:S.Escape,secondary:[U.Shift|S.Escape],handler:s=>s.get(In).cancel()});So.registerCommandAndKeybindingRule({id:"workbench.action.acceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:gC,primary:0,handler:s=>s.get(In).accept()});So.registerCommandAndKeybindingRule({id:"workbench.action.alternativeAcceptSelectedQuickOpenItem",weight:Ae.WorkbenchContrib,when:gC,primary:0,handler:s=>s.get(In).accept({ctrlCmd:!0,alt:!1})});So.registerCommandAndKeybindingRule({id:"workbench.action.focusQuickOpen",weight:Ae.WorkbenchContrib,when:gC,primary:0,handler:s=>{s.get(In).focus()}});const GVe="workbench.action.quickOpenNavigateNextInFilePicker";So.registerCommandAndKeybindingRule({id:GVe,weight:Ae.WorkbenchContrib+50,handler:bce(GVe,!0),when:gtt,primary:hA.primary,secondary:hA.secondary,mac:hA.mac});const KVe="workbench.action.quickOpenNavigatePreviousInFilePicker";So.registerCommandAndKeybindingRule({id:KVe,weight:Ae.WorkbenchContrib+50,handler:bce(KVe,!1),when:gtt,primary:hA.primary|U.Shift,secondary:[hA.secondary[0]|U.Shift],mac:{primary:hA.mac.primary|U.Shift,secondary:void 0}});So.registerCommandAndKeybindingRule({id:"workbench.action.quickPickManyToggle",weight:Ae.WorkbenchContrib,when:gC,primary:0,handler:s=>{s.get(In).toggle()}});So.registerCommandAndKeybindingRule({id:"workbench.action.quickInputBack",weight:Ae.WorkbenchContrib+50,when:gC,primary:0,win:{primary:U.Alt|S.LeftArrow},mac:{primary:U.WinCtrl|S.Minus},linux:{primary:U.CtrlCmd|U.Alt|S.Minus},handler:s=>{s.get(In).back()}});At(class extends li{constructor(){super({id:"workbench.action.quickOpen",title:Fe(889,"Go to File..."),metadata:{description:"Quick access",args:[{name:"prefix",schema:{type:"string"}}]},keybinding:{weight:Ae.WorkbenchContrib,primary:hA.primary,secondary:hA.secondary,mac:hA.mac},f1:!0})}run(e,t){e.get(In).quickAccess.show(typeof t=="string"?t:void 0,{preserveValue:typeof t=="string"})}});At(class extends li{constructor(){super({id:"workbench.action.quickOpenWithModes",title:g(890,"Quick Open"),icon:ve.search,menu:{id:_e.CommandCenterCenter,order:100}})}run(e){e.get(In).quickAccess.show(void 0,{preserveValue:!0,providerOptions:{includeHelp:!0,from:"commandCenter"}})}});_t.registerCommand("workbench.action.quickOpenPreviousEditor",async s=>{s.get(In).quickAccess.show("",{itemActivation:Of.SECOND})});class xce extends li{constructor(e,t,i,n,o){super({id:e,title:t,f1:!0,keybinding:o}),this.id=e,this.next=i,this.quickNavigate=n}async run(e){const t=e.get(Ut),i=e.get(In),n=t.lookupKeybindings(this.id),o=this.quickNavigate?{keybindings:n}:void 0;i.navigate(this.next,o)}}class wzt extends xce{constructor(){super("workbench.action.quickOpenNavigateNext",Fe(891,"Navigate Next in Quick Open"),!0,!0)}}class yzt extends xce{constructor(){super("workbench.action.quickOpenNavigatePrevious",Fe(892,"Navigate Previous in Quick Open"),!1,!0)}}class Czt extends xce{constructor(){super("workbench.action.quickOpenSelectNext",Fe(893,"Select Next in Quick Open"),!0,!1,{weight:Ae.WorkbenchContrib+50,when:gC,primary:0,mac:{primary:U.WinCtrl|S.KeyN}})}}class Szt extends xce{constructor(){super("workbench.action.quickOpenSelectPrevious",Fe(894,"Select Previous in Quick Open"),!1,!1,{weight:Ae.WorkbenchContrib+50,when:gC,primary:0,mac:{primary:U.WinCtrl|S.KeyP}})}}At(Czt);At(Szt);At(wzt);At(yzt);var xV,IR;let q5=(IR=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Qe.as(DU.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 n=this.registry.getQuickAccessProvider(i.substr(xV.PREFIX.length));n&&n.prefix&&n.prefix!==xV.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==xV.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,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:g(4806,"{0}, {1}",n,t.description),description:t.description}})}},xV=IR,IR.PREFIX="?",IR);q5=xV=D([_(0,In),_(1,Ut)],q5);const qVe="workbench.panel.repl.view";new Y("debugType",void 0,{type:"string",description:g(6,"Debug type of the active debug session. For example 'python'.")});new Y("debugConfigurationType",void 0,{type:"string",description:g(7,"Debug type of the selected launch configuration. For example 'python'.")});new Y("debugState","inactive",{type:"string",description:g(8,"State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.")});const Azt="debugUx";new Y(Azt,"default",{type:"string",description:g(9,"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(10,"True when a debug session has been started at least once, false otherwise.")});new Y("inDebugMode",!1,{type:"boolean",description:g(11,"True when debugging, false otherwise.")});new Y("inDebugRepl",!1,{type:"boolean",description:g(12,"True when focus is in the debug console, false otherwise.")});new Y("breakpointWidgetVisible",!1,{type:"boolean",description:g(13,"True when breakpoint editor zone widget is visible, false otherwise.")});new Y("inBreakpointWidget",!1,{type:"boolean",description:g(14,"True when focus is in the breakpoint editor zone widget, false otherwise.")});new Y("breakpointsFocused",!0,{type:"boolean",description:g(15,"True when the BREAKPOINTS view is focused, false otherwise.")});new Y("watchExpressionsFocused",!0,{type:"boolean",description:g(16,"True when the WATCH view is focused, false otherwise.")});new Y("watchExpressionsExist",!1,{type:"boolean",description:g(17,"True when at least one watch expression exists, false otherwise.")});new Y("variablesFocused",!0,{type:"boolean",description:g(18,"True when the VARIABLES views is focused, false otherwise")});new Y("expressionSelected",!1,{type:"boolean",description:g(19,"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(20,"True when the input box has focus in the BREAKPOINTS view.")});new Y("callStackItemType",void 0,{type:"string",description:g(21,"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(22,"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(23,"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(24,"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(25,"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(26,"Indicates whether the item in the view has an associated memory refrence.")});new Y("breakpointItemType",void 0,{type:"string",description:g(27,"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(28,"Whether the breakpoint item is a data breakpoint on a byte range.")});new Y("breakpointHasModes",!1,{type:"boolean",description:g(29,"Whether the breakpoint has multiple modes it can switch to.")});new Y("breakpointSupportsCondition",!1,{type:"boolean",description:g(30,"True when the focused breakpoint supports conditions.")});new Y("loadedScriptsSupported",!1,{type:"boolean",description:g(31,"True when the focused sessions supports the LOADED SCRIPTS view")});new Y("loadedScriptsItemType",void 0,{type:"string",description:g(32,"Represents the item type of the focused element in the LOADED SCRIPTS view.")});new Y("focusedSessionIsAttach",!1,{type:"boolean",description:g(33,"True when the focused session is 'attach'.")});new Y("focusedSessionIsNoDebug",!1,{type:"boolean",description:g(34,"True when the focused session is run without debugging.")});new Y("stepBackSupported",!1,{type:"boolean",description:g(35,"True when the focused session supports 'stepBack' requests.")});new Y("restartFrameSupported",!1,{type:"boolean",description:g(36,"True when the focused session supports 'restartFrame' requests.")});new Y("stackFrameSupportsRestart",!1,{type:"boolean",description:g(37,"True when the focused stack frame supports 'restartFrame'.")});new Y("jumpToCursorSupported",!1,{type:"boolean",description:g(38,"True when the focused session supports 'jumpToCursor' request.")});new Y("stepIntoTargetsSupported",!1,{type:"boolean",description:g(39,"True when the focused session supports 'stepIntoTargets' request.")});new Y("breakpointsExist",!1,{type:"boolean",description:g(40,"True when at least one breakpoint exists.")});new Y("debuggersAvailable",!1,{type:"boolean",description:g(41,"True when there is at least one debug extensions active.")});new Y("debugExtensionAvailable",!0,{type:"boolean",description:g(42,"True when there is at least one debug extension installed and enabled.")});new Y("debugProtocolVariableMenuContext",void 0,{type:"string",description:g(43,"Represents the context the debug adapter sets on the focused variable in the VARIABLES view.")});new Y("debugSetVariableSupported",!1,{type:"boolean",description:g(44,"True when the focused session supports 'setVariable' request.")});new Y("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:g(45,"True when the focused session supports 'getBreakpointInfo' request on an address.")});new Y("debugSetExpressionSupported",!1,{type:"boolean",description:g(46,"True when the focused session supports 'setExpression' request.")});new Y("breakWhenValueChangesSupported",!1,{type:"boolean",description:g(47,"True when the focused session supports to break when value changes.")});new Y("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:g(48,"True when the focused breakpoint supports to break when value is accessed.")});new Y("breakWhenValueIsReadSupported",!1,{type:"boolean",description:g(49,"True when the focused breakpoint supports to break when value is read.")});new Y("terminateDebuggeeSupported",!1,{type:"boolean",description:g(50,"True when the focused session supports the terminate debuggee capability.")});new Y("suspendDebuggeeSupported",!1,{type:"boolean",description:g(51,"True when the focused session supports the suspend debuggee capability.")});new Y("variableEvaluateNamePresent",!1,{type:"boolean",description:g(52,"True when the focused variable has an 'evalauteName' field set.")});new Y("variableIsReadonly",!1,{type:"boolean",description:g(53,"True when the focused variable is read-only.")});new Y("variableValue",!1,{type:"string",description:g(54,"Value of the variable, present for debug visualization clauses.")});new Y("variableType",!1,{type:"string",description:g(55,"Type of the variable, present for debug visualization clauses.")});new Y("variableInterfaces",!1,{type:"array",description:g(56,"Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.")});new Y("variableName",!1,{type:"string",description:g(57,"Name of the variable, present for debug visualization clauses.")});new Y("variableLanguage",!1,{type:"string",description:g(58,"Language of the variable source, present for debug visualization clauses.")});new Y("variableExtensionId",!1,{type:"string",description:g(59,"Extension ID of the variable source, present for debug visualization clauses.")});new Y("exceptionWidgetVisible",!1,{type:"boolean",description:g(60,"True when the exception widget is visible.")});new Y("multiSessionRepl",!1,{type:"boolean",description:g(61,"True when there is more than 1 debug console.")});new Y("multiSessionDebug",!1,{type:"boolean",description:g(62,"True when there is more than 1 active debug session.")});new Y("disassembleRequestSupported",!1,{type:"boolean",description:g(63,"True when the focused sessions supports disassemble request.")});new Y("disassemblyViewFocus",!1,{type:"boolean",description:g(64,"True when the Disassembly View is focused.")});new Y("languageSupportsDisassembleRequest",!1,{type:"boolean",description:g(65,"True when the language in the current editor supports disassemble request.")});new Y("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:g(66,"True when the focused stack frame has instruction pointer reference.")});g(68,"Controls when the internal Debug Console should open.");var QVe;(function(s){s[s.Inactive=0]="Inactive",s[s.Initializing=1]="Initializing",s[s.Stopped=2]="Stopped",s[s.Running=3]="Running"})(QVe||(QVe={}));var jVe;(function(s){s[s.Valid=0]="Valid",s[s.Unreadable=1]="Unreadable",s[s.Error=2]="Error"})(jVe||(jVe={}));var JZ;(function(s){s[s.Variable=0]="Variable",s[s.Address=1]="Address"})(JZ||(JZ={}));var y9;(function(s){s[s.Initial=1]="Initial",s[s.Dynamic=2]="Dynamic"})(y9||(y9={}));var YVe;(function(s){s.UnverifiedBreakpoints="unverifiedBreakpoints"})(YVe||(YVe={}));var JVe;(function(s){s[s.CONDITION=0]="CONDITION",s[s.HIT_COUNT=1]="HIT_COUNT",s[s.LOG_MESSAGE=2]="LOG_MESSAGE",s[s.TRIGGER_POINT=3]="TRIGGER_POINT"})(JVe||(JVe={}));var XZ;(function(s){s[s.Command=0]="Command",s[s.Tree=1]="Tree"})(XZ||(XZ={}));var HSe;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(HSe||(HSe={}));var USe;(function(s){s.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:N.revive(e.iconPath.light),dark:N.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),s.serialize=e=>e})(USe||(USe={}));var VSe,TR;let VW=(TR=class extends sNe{constructor(e,t,i,n,o,r,a,c){super(VSe.PREFIX,{noResultsPick:{label:g(4807,"No matching views"),containerLabel:""}}),this.viewDescriptorService=e,this.viewsService=t,this.outputService=i,this.terminalService=n,this.terminalGroupService=o,this.debugService=r,this.paneCompositeService=a,this.contextKeyService=c}_getPicks(e){const t=this.doGetViewPickItems().filter(r=>e?(r.highlights={label:PY(e,r.label,!0)??void 0},r.highlights.label||rat(r.containerLabel,e)):!0),i=new Map;for(const r of t)i.has(r.label)||i.set(r.label,r.containerLabel);const n=[];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,n.push({type:"separator",label:a})}n.push(r)}return n}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(ir.Sidebar,g(4808,"Side Bar")),i(ir.Panel,g(4809,"Panel")),i(ir.AuxiliaryBar,g(4810,"Secondary Side Bar"));const n=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))}};n(ir.Sidebar),n(ir.Panel),n(ir.AuxiliaryBar),this.terminalGroupService.groups.forEach((r,a)=>{r.terminalInstances.forEach((c,l)=>{const d=g(4811,"{0}: {1}",`${a+1}.${l+1}`,c.title);e.push({label:d,containerLabel:g(4812,"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(4813,"Debug Console"),accept:async()=>{await this.debugService.focusStackFrame(void 0,void 0,r,{explicit:!0}),this.viewsService.isViewVisible(qVe)||await this.viewsService.openView(qVe,!0)}})});const o=this.outputService.getChannelDescriptors();for(const r of o)e.push({label:r.label,containerLabel:g(4814,"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}},VSe=TR,TR.PREFIX="view ",TR);VW=VSe=D([_(0,Sm),_(1,km),_(2,qae),_(3,RU),_(4,$Re),_(5,HRe),_(6,Dm),_(7,Le)],VW);const Foe=class Foe extends li{constructor(){super({id:Foe.ID,title:Fe(4815,"Open View"),category:ca.View,f1:!0})}async run(e){e.get(In).quickAccess.show(VW.PREFIX)}};Foe.ID="workbench.action.openView";let C9=Foe;const p1=class p1 extends li{constructor(){super({id:p1.ID,title:Fe(4816,"Quick Open View"),category:ca.View,f1:!1,keybinding:{weight:Ae.WorkbenchContrib,when:void 0,...p1.KEYBINDING}})}async run(e){const t=e.get(Ut),i=e.get(In),n=t.lookupKeybindings(p1.ID);i.quickAccess.show(VW.PREFIX,{quickNavigateConfiguration:{keybindings:n},itemActivation:Of.FIRST})}};p1.ID="workbench.action.quickOpenView",p1.KEYBINDING={primary:U.CtrlCmd|S.KeyQ,mac:{primary:U.WinCtrl|S.KeyQ},linux:{primary:0}};let ZZ=p1;const bNe=Qe.as(DU.Quickaccess);bNe.registerQuickAccessProvider({ctor:q5,prefix:q5.PREFIX,placeholder:g(895,"Type '{0}' to get help on the actions you can take from here.",q5.PREFIX),helpEntries:[{description:g(896,"Show all Quick Access Providers"),commandCenterOrder:70,commandCenterLabel:g(897,"More")}]});bNe.registerQuickAccessProvider({ctor:VW,prefix:VW.PREFIX,contextKey:"inViewsPicker",placeholder:g(898,"Type the name of a view, output channel or terminal to open."),helpEntries:[{description:g(899,"Open View"),commandId:C9.ID}]});bNe.registerQuickAccessProvider({ctor:QM,prefix:QM.PREFIX,contextKey:"inCommandsPicker",placeholder:g(900,"Type the name of a command to run."),helpEntries:[{description:g(901,"Show and Run Commands"),commandId:iI.ID,commandCenterOrder:20}]});jn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:iI.ID,title:g(902,"&&Command Palette...")},order:1});jn.appendMenuItem(_e.MenubarHelpMenu,{group:"1_welcome",command:{id:iI.ID,title:g(903,"Show All Commands")},order:2});jn.appendMenuItem(_e.MenubarViewMenu,{group:"1_open",command:{id:C9.ID,title:g(904,"&&Open View...")},order:2});jn.appendMenuItem(_e.MenubarGoMenu,{group:"5_infile_nav",command:{id:"workbench.action.gotoLine",title:g(905,"Go to &&Line/Column...")},order:1});jn.appendMenuItem(_e.GlobalActivity,{group:"1_command",command:{id:iI.ID,title:g(906,"Command Palette...")},order:1});jn.appendMenuItem(_e.EditorContext,{group:"z_commands",when:J.editorSimpleInput.toNegated(),command:{id:iI.ID,title:g(906,"Command Palette...")},order:1});At(bzt);At(iI);At(C9);At(ZZ);const Ezt="inViewsPicker",Ztt=he.and(gC,he.has(Ezt)),XO=ZZ.KEYBINDING,XVe="workbench.action.quickOpenNavigateNextInViewPicker";So.registerCommandAndKeybindingRule({id:XVe,weight:Ae.WorkbenchContrib+50,handler:bce(XVe,!0),when:Ztt,primary:XO.primary,linux:XO.linux,mac:XO.mac});const ZVe="workbench.action.quickOpenNavigatePreviousInViewPicker";So.registerCommandAndKeybindingRule({id:ZVe,weight:Ae.WorkbenchContrib+50,handler:bce(ZVe,!1),when:Ztt,primary:XO.primary|U.Shift,linux:XO.linux,mac:{primary:XO.mac.primary|U.Shift}});const cv=Za;var UB;let eee=(UB=class extends V{constructor(e,t){super(),t.options?.resolveExternalUri&&this._register(e.registerExternalUriResolver({resolveExternalUri:async i=>({resolved:await t.options.resolveExternalUri(i),dispose:()=>{}})}))}},UB.ID="workbench.contrib.externalUriResolver",UB);eee=D([_(0,Ao),_(1,cv)],eee);const eit=N.parse("trustedDomains:/Trusted Domains"),Dce="http.linkProtectionTrustedDomains",zSe="http.linkProtectionTrustedDomainsContent",$Se={id:"workbench.action.manageTrustedDomain",description:{description:Fe(4604,"Manage Trusted Domains"),args:[]},handler:async s=>{s.get(ei).openEditor({resource:eit,languageId:"jsonc",options:{pinned:!0}})}};async function xzt(s,e,t,i,n,o,r){const a=N.parse(e),c=a.authority.split("."),l=c.slice(c.length-2).join("."),d="*."+l,h=[];if(h.push({type:"item",label:g(4605,"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(4606,"Trust {0} on all ports",p),toTrust:p+":*",id:"trust"})}}else h.push({type:"item",label:g(4607,"Trust {0} and all its subdomains",l),toTrust:d,id:"trust"});h.push({type:"item",label:g(4608,"Trust all domains (disables link protection)"),toTrust:"*",id:"trust"}),h.push({type:"item",label:g(4609,"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:eit.with({fragment:t.toString()}),languageId:"jsonc",options:{pinned:!0}}),s;case"trust":{const p=f.toTrust;if(s.indexOf(p)===-1)return n.remove(zSe,Ie.APPLICATION),n.store(Dce,JSON.stringify([...s,p]),Ie.APPLICATION,an.USER),[...s,p]}}return[]}async function Dzt(s){const{defaultTrustedDomains:e,trustedDomains:t}=tee(s);return{defaultTrustedDomains:e,trustedDomains:t}}function tee(s){const e=s.get($i),t=s.get(Er),i=s.get(cv),n=[...t.linkProtectionTrustedDomains??[],...i.options?.additionalTrustedDomains??[]];let o=[];try{const r=e.get(Dce,Ie.APPLICATION);r&&(o=JSON.parse(r))}catch{}return{defaultTrustedDomains:n,trustedDomains:o}}const kzt="trustedDomains",Izt={type:sn.File,ctime:Date.now(),mtime:Date.now(),size:0},tit=`// 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 @@ -856,118 +856,118 @@ ${s}`:s}var OSe;const mue=fe;function _P(s){s.scrollTop=s.scrollHeight-s.renderH // - "http://192.168.0.*: Matches all IP's with this prefix using http // - "*": Match all domains using either http or https // -`,dit=`// +`,iit=`// // You can use the "Manage Trusted Domains" command to open this file. // Save this file to apply the trusted domains rules. -`,Uzt=`[ +`,Tzt=`[ // "https://microsoft.com" -]`;function Vzt(s,e,t){let i=lit;return s.length>0?(i+=`// By default, VS Code trusts "localhost" as well as the following domains: +]`;function Lzt(s,e,t){let i=tit;return s.length>0?(i+=`// By default, VS Code trusts "localhost" as well as the following domains: `,s.forEach(n=>{i+=`// - "${n}" `})):i+=`// By default, VS Code trusts "localhost". -`,i+=dit,i+=t?` +`,i+=iit,i+=t?` // Currently configuring trust for ${t} -`:"",e.length===0?i+=Uzt:i+=JSON.stringify(e,null,2),i}var KB;let see=(KB=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=Vn.FileReadWrite,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.fileService.registerProvider(Wzt,this)}stat(e){return Promise.resolve(Hzt)}async readFile(e){let t=this.storageService.get(jSe,Ie.APPLICATION);const i=e.fragment,{defaultTrustedDomains:n,trustedDomains:o}=await this.instantiationService.invokeFunction(Bzt);return(!t||t.indexOf(lit)===-1||t.indexOf(dit)===-1||t.indexOf(i??"")===-1||[...n,...o].some(a=>!qn(t).includes(a)))&&(t=Vzt(n,o,i)),$e.fromString(t).buffer}writeFile(e,t,i){try{const n=$e.wrap(t).toString(),o=sf(n);this.storageService.store(jSe,n,Ie.APPLICATION,an.USER),this.storageService.store(Lce,JSON.stringify(o)||"",Ie.APPLICATION,an.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)}},KB.ID="workbench.contrib.trustedDomainsFileSystemProvider",KB);see=D([_(0,Jt),_(1,$i),_(2,we)],see);const zzt=(s,e)=>{let t=s.with({query:null,fragment:null}).toString(!0);const i=r=>r.replace(/\/+$/,"");e=i(e),t=i(t);const n=Array.from({length:t.length+1}).map(()=>Array.from({length:e.length+1}).map(()=>{}));if(/^[^./:]*:\/\//.test(e))return pw(n,t,e,0,0);const o=/^(https?):\/\//.exec(t)?.[1];return o?pw(n,t,`${o}://${e}`,0,0):!1},pw=(s,e,t,i,n)=>{if(s[i]?.[n]!==void 0)return s[i][n];const o=[];if(i===e.length)return n===t.length;if(n===t.length)return e.slice(i)[0]==="/";if(e[i]===t[n]&&o.push(pw(s,e,t,i+1,n+1)),t[n]+t[n+1]==="*."&&(["/",":"].includes(e[i])||o.push(pw(s,e,t,i+1,n)),o.push(pw(s,e,t,i,n+2))),t[n]==="*"&&(i+1===e.length?o.push(pw(s,e,t,i+1,n+1)):o.push(pw(s,e,t,i+1,n)),o.push(pw(s,e,t,i,n+1))),t[n]+t[n+1]===":*")if(e[i]===":"){let r=i+1;do r++;while(/[0-9]/.test(e[r]));o.push(pw(s,e,t,r,n+2))}else o.push(pw(s,e,t,i,n+2));return s[i][n]=o.some(r=>r===!0)};let JSe=class extends V{constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new XV(si,()=>{const{defaultTrustedDomains:n,trustedDomains:o}=this._instantiationService.invokeFunction(nee);return[...n,...o]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(Ie.APPLICATION,Lce,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(nee),n=[...t,...i];return hit(e,n)}};JSe=D([_(0,we),_(1,$i)],JSe);const $zt=/^localhost(:\d+)?$/i,Gzt=/^127.0.0.1(:\d+)?$/;function Kzt(s){return $zt.test(s)||Gzt.test(s)}function u5e(s){const e=["github.com"];try{const t=typeof s=="string"?N.parse(s,!0):s;return e.includes(t.authority)?t.with({path:t.path.toLowerCase()}).toString(!0):t.toString(!0)}catch{return s.toString()}}function hit(s,e){if(s=N.parse(u5e(s)),e=e.map(u5e),Kzt(s.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!AA(e,pe.http)&&!AA(e,pe.https)||t?.fromWorkspace&&this._workspaceTrustService.isWorkspaceTrusted()&&!this._configurationService.getValue("workbench.trustedDomains.promptInTrustedWorkspace"))return!0;const i=e;let n;if(typeof e=="string"?n=N.parse(e):n=e,await this._trustedDomainService.isValid(n))return!0;{const{scheme:o,authority:r,path:a,query:c,fragment:l}=n;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:Xe.Info,message:g(4817,"Do you want {0} to open the external website?",this._productService.nameShort),detail:typeof i=="string"?i:d,buttons:[{label:g(4818,"&&Open"),run:()=>!0},{label:g(4819,"&&Copy"),run:()=>(this._clipboardService.writeText(typeof i=="string"?i:n.toString(!0)),!1)},{label:g(4820,"Configure &&Trusted Domains"),run:async()=>{const{trustedDomains:m}=this._instantiationService.invokeFunction(nee),v=`${o}://${r}`,b=await Ozt(m,v,n,this._quickInputService,this._storageService,this._editorService);return!!(b.indexOf("*")!==-1||hit(n,b))}}],cancelButton:{run:()=>!1}});return p}}};XSe=D([_(0,Ao),_(1,$i),_(2,to),_(3,Er),_(4,In),_(5,ei),_(6,dg),_(7,Yi),_(8,we),_(9,Te),_(10,uC),_(11,nce)],XSe);class qzt extends li{constructor(){super({id:"workbench.action.url.openUrl",title:Pe(907,"Open URL"),category:ca.Developer,f1:!0})}async run(e){const t=e.get(In),i=e.get(Uae);return t.input({prompt:g(908,"URL to open")}).then(n=>{if(n){const o=N.parse(n);i.open(o,{originalUrl:n})}})}}At(qzt);_t.registerCommand(YSe);jn.appendMenuItem(_e.CommandPalette,{command:{id:YSe.id,title:YSe.description.description}});Qe.as(cf.Workbench).registerWorkbenchContribution(XSe,Rs.Restored);Qu(see.ID,see,yc.BlockRestore);Qu(iee.ID,iee,yc.BlockRestore);const Qzt=Qe.as(Nn.Configuration);Qzt.registerConfiguration({...V6,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:at.APPLICATION,type:"boolean",default:!1,description:g(909,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var $v;(function(s){s.TITLEBAR_PART="workbench.parts.titlebar",s.BANNER_PART="workbench.parts.banner",s.ACTIVITYBAR_PART="workbench.parts.activitybar",s.SIDEBAR_PART="workbench.parts.sidebar",s.PANEL_PART="workbench.parts.panel",s.AUXILIARYBAR_PART="workbench.parts.auxiliarybar",s.EDITOR_PART="workbench.parts.editor",s.STATUSBAR_PART="workbench.parts.statusbar"})($v||($v={}));var g5e;(function(s){s.SHOW_TABS="zenMode.showTabs",s.HIDE_LINENUMBERS="zenMode.hideLineNumbers",s.HIDE_STATUSBAR="zenMode.hideStatusBar",s.HIDE_ACTIVITYBAR="zenMode.hideActivityBar",s.CENTER_LAYOUT="zenMode.centerLayout",s.FULLSCREEN="zenMode.fullScreen",s.RESTORE="zenMode.restore",s.SILENT_NOTIFICATIONS="zenMode.silentNotifications"})(g5e||(g5e={}));var Jp;(function(s){s.ACTIVITY_BAR_LOCATION="workbench.activityBar.location",s.EDITOR_TABS_MODE="workbench.editor.showTabs",s.EDITOR_ACTIONS_LOCATION="workbench.editor.editorActionsLocation",s.COMMAND_CENTER="window.commandCenter",s.LAYOUT_ACTIONS="workbench.layoutControl.enabled"})(Jp||(Jp={}));var oee;(function(s){s.DEFAULT="default",s.TOP="top",s.BOTTOM="bottom",s.HIDDEN="hidden"})(oee||(oee={}));var PT;(function(s){s.MULTIPLE="multiple",s.SINGLE="single",s.NONE="none"})(PT||(PT={}));var J5;(function(s){s.DEFAULT="default",s.TITLEBAR="titleBar",s.HIDDEN="hidden"})(J5||(J5={}));var Ru;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BOTTOM=2]="BOTTOM",s[s.TOP=3]="TOP"})(Ru||(Ru={}));function jzt(s){return s===Ru.BOTTOM||s===Ru.TOP}var jv;(function(s){s[s.ALWAYS=0]="ALWAYS",s[s.NEVER=1]="NEVER",s[s.REMEMBER_LAST=2]="REMEMBER_LAST"})(jv||(jv={}));function B1(s){switch(s){case Ru.LEFT:return"left";case Ru.RIGHT:return"right";case Ru.BOTTOM:return"bottom";case Ru.TOP:return"top";default:return"bottom"}}const Yzt={[B1(Ru.LEFT)]:Ru.LEFT,[B1(Ru.RIGHT)]:Ru.RIGHT,[B1(Ru.BOTTOM)]:Ru.BOTTOM,[B1(Ru.TOP)]:Ru.TOP};function RK(s){return Yzt[s]}function wue(s){switch(s){case jv.ALWAYS:return"always";case jv.NEVER:return"never";case jv.REMEMBER_LAST:return"preserve";default:return"preserve"}}wue(jv.ALWAYS)+"",jv.ALWAYS,wue(jv.NEVER)+"",jv.NEVER,wue(jv.REMEMBER_LAST)+"",jv.REMEMBER_LAST;var Op;(function(s){s[s.SHORT=0]="SHORT",s[s.MEDIUM=1]="MEDIUM",s[s.LONG=2]="LONG"})(Op||(Op={}));var EE,mw;(function(s){s.titleSeparator="window.titleSeparator",s.title="window.title"})(mw||(mw={}));const uit=(()=>{if(Qt&&ad)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const s="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Wn?s+"${separator}${remoteName}":s})(),git=Qt?" — ":" - ";var QS;let f5e=(QS=class extends V{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(Ls.SHORT);return`${e?.isDirty()&&!e.isSaving()?EE.TITLE_DIRTY:""}${t}`}constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=n,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 cn(()=>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(mw.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(mw.title)||e.affectsConfiguration(mw.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(mw.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=[];Qr(t)?i.push(t):im(t)&&i.push(t.getOriginalEditor(),t.getModifiedEditor());for(const n of i)this.activeEditorListeners.add(n.onDidBlurEditorText(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(n.onDidFocusEditorText(()=>this.titleUpdater.schedule()))}}doUpdateTitle(){const e=this.getFullWindowTitle();if(e!==this.title){let t=e;Y1e(t)||(t=this.productService.nameLong);const i=Hj(this.windowId,!0).window;!i.document.title&&Qt&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${EE.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?`${EE.NLS_EXTENSION_HOST} - ${e}`:EE.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=EE.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,n=typeof e.prefix=="string"?e.prefix:this.properties.prefix;(t!==this.properties.isAdmin||i!==this.properties.isPure||n!==this.properties.prefix)&&(this.properties.isAdmin=t,this.properties.isPure=i,this.properties.prefix=n,this.titleUpdater.schedule())}registerVariables(e){let t=!1;for(const{name:i,contextKey:n}of e)this.variables.has(n)||(this.variables.set(n,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 n=Na.getOriginalUri(e,{supportSideBySide:Hs.PRIMARY});let o=n?Lr(n):void 0;o?.path==="."&&(o=void 0);let r;this.contextService.getWorkbenchState()===qi.FOLDER?r=t.folders[0]:n&&(r=this.contextService.getWorkspaceFolder(n)??void 0);let a;if(this.environmentService.remoteAuthority&&!Wn)a=this.labelService.getHostLabel(pe.vscodeRemote,this.environmentService.remoteAuthority);else{const z=yNe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Ls.SHORT):"",l=e?e.getTitle(Ls.MEDIUM):c,d=e?e.getTitle(Ls.LONG):l,h=o?_i(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:Op.SHORT}),v=i?this.labelService.getUriLabel(i):"",b=r?r.name:"",w=r?this.labelService.getUriLabel(r.uri):"",y=e?.isDirty()&&!e.isSaving()?EE.TITLE_DIRTY:"",C=this.productService.nameLong,A=this.userDataProfileService.currentProfile.isDefault?"":this.userDataProfileService.currentProfile.name,L=this.viewsService.getFocusedViewName(),k={};for(const[z,G]of this.variables)k[G]=this.contextKeyService.getContextKeyValue(z)??"";let P=this.configurationService.getValue(mw.title);typeof P!="string"&&(P=uit);let R=this.configurationService.getValue(mw.titleSeparator);return typeof R!="string"&&(R=git),PMt(P,{...k,activeEditorShort:c,activeEditorLong:d,activeEditorMedium:l,activeFolderShort:h,activeFolderMedium:u,activeFolderLong:f,rootName:p,rootPath:v,rootNameShort:m,folderName:b,folderPath:w,dirty:y,appName:C,remoteName:a,profileName:A,focusedView:L,separator:{label:R}})}isCustomTitleFormat(){const e=this.configurationService.inspect(mw.title),t=this.configurationService.inspect(mw.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},EE=QS,QS.NLS_USER_IS_ADMIN=Qn?g(4821,"[Administrator]"):g(4822,"[Superuser]"),QS.NLS_EXTENSION_HOST=g(4823,"[Extension Development Host]"),QS.TITLE_DIRTY="● ",QS);f5e=EE=D([_(2,Te),_(3,Le),_(4,ei),_(5,hv),_(6,yi),_(7,Fs),_(8,ug),_(9,Er),_(10,Lm)],f5e);var HP,_k;let ree=(_k=class extends V{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 Nrt(1e3),this._templateRegexValidation=/[a-zA-Z0-9]/,this._parsedTemplateExpression=/\$\{(dirname|filename|extname|extname\((?[-+]?\d+)\)|dirname\((?[-+]?\d+)\))\}/g,this._filenameCaptureExpression=/(?^\.*[^.]*)/,this.storeEnablementState(),this.storeCustomPatterns(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(HP.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(HP.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(HP.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(HP.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const n=pM(t),o=j_(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:n,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 n=this.applyPatterns(e);return this.cache.set(t,n??null),n}applyPatterns(e){const t=this.workspaceContextService.getWorkspaceFolder(e);let i;for(const n of this.patterns){let o;if(t&&!n.isAbsolutePath?(i||(i=DN(Lr(t.uri),e)??e.path),o=i):o=e.path,n.parsedPattern(o))return this.applyTemplate(n.template,e,o)}}applyTemplate(e,t,i){let n;return e.replace(this._parsedTemplateExpression,(o,r,...a)=>{n=n??Wct(t.path);const{dirnameN:c="0",extnameN:l="0"}=a.pop();if(r==="filename"){const{filename:d}=this._filenameCaptureExpression.exec(n.base)?.groups??{};if(d)return d}else if(r==="extname"){const d=this.getExtnames(n.base);if(d)return d}else if(r.startsWith("extname")){const d=parseInt(l),h=this.getNthExtname(n.base,d);if(h)return h}else if(r.startsWith("dirname")){const d=parseInt(c),h=this.getNthDirname(Cb(i),d);if(h)return h}return o})}removeLeadingDot(e){let t=e;for(;t.startsWith(".");)t=t.slice(1);return t}getNthDirname(e,t){e=e.startsWith("/")?e.slice(1):e;const i=e.split("/");return this.getNthFragment(i,t)}getExtnames(e){return this.removeLeadingDot(e).split(".").slice(1).join(".")}getNthExtname(e,t){const i=this.removeLeadingDot(e).split(".");return i.shift(),this.getNthFragment(i,t)}getNthFragment(e,t){const i=e.length;let n;t<0?n=Math.abs(t)-1:n=i-t-1;const o=e[n];if(!(o===void 0||o===""))return o}},HP=_k,_k.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",_k.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",_k);ree=HP=D([_(0,Te),_(1,yi)],ree);const MK=Qe.as(Nn.Configuration);(function(){Qu(jJ.ID,jJ,yc.Eventually),Qu(YJ.ID,YJ,yc.AfterRestored),MK.registerConfiguration({...V6,properties:{"workbench.externalBrowser":{type:"string",markdownDescription:g(910,"Configure the browser to use for opening http or https links externally. This can either be the name of the browser (`edge`, `chrome`, `firefox`) or an absolute path to the browser's executable. Will use the system default if not set."),included:ad,restricted:!0},"workbench.editor.titleScrollbarSizing":{type:"string",enum:["default","large"],enumDescriptions:[g(911,"The default size."),g(912,"Increases the size, so it can be grabbed more easily with the mouse.")],description:g(913,"Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),default:"default"},[Jp.EDITOR_TABS_MODE]:{type:"string",enum:[PT.MULTIPLE,PT.SINGLE,PT.NONE],enumDescriptions:[g(914,"Each editor is displayed as a tab in the editor title area."),g(915,"The active editor is displayed as a single large tab in the editor title area."),g(916,"The editor title area is not displayed.")],description:g(917,"Controls whether opened editors should show as individual tabs, one single large tab or if the title area should not be shown."),default:"multiple"},[Jp.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[J5.DEFAULT,J5.TITLEBAR,J5.HIDDEN],markdownEnumDescriptions:[g(918,"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(919,"Show editor actions in the window title bar. If {0} is set to {1}, editor actions are hidden.","`#window.customTitleBarVisibility#`","`never`"),g(920,"Editor actions are not shown.")],markdownDescription:g(921,"Controls where the editor actions are shown."),default:"default"},"workbench.editor.alwaysShowEditorActions":{type:"boolean",markdownDescription:g(922,"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(923,"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(924,"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(925,"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(926,"Controls whether editor file decorations should use badges."),default:!0},"workbench.editor.decorations.colors":{type:"boolean",markdownDescription:g(927,"Controls whether editor file decorations should use colors."),default:!0},[ree.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(928,"Controls whether the custom workbench editor labels should be applied."),default:!0},[ree.SETTING_ID_PATTERNS]:{type:"object",markdownDescription:(()=>{let t=g(929,"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+=Tzt:i+=JSON.stringify(e,null,2),i}var VB;let iee=(VB=class{constructor(e,t,i){this.fileService=e,this.storageService=t,this.instantiationService=i,this.capabilities=Vn.FileReadWrite,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None,this.fileService.registerProvider(kzt,this)}stat(e){return Promise.resolve(Izt)}async readFile(e){let t=this.storageService.get(zSe,Ie.APPLICATION);const i=e.fragment,{defaultTrustedDomains:n,trustedDomains:o}=await this.instantiationService.invokeFunction(Dzt);return(!t||t.indexOf(tit)===-1||t.indexOf(iit)===-1||t.indexOf(i??"")===-1||[...n,...o].some(a=>!qn(t).includes(a)))&&(t=Lzt(n,o,i)),$e.fromString(t).buffer}writeFile(e,t,i){try{const n=$e.wrap(t).toString(),o=ef(n);this.storageService.store(zSe,n,Ie.APPLICATION,an.USER),this.storageService.store(Dce,JSON.stringify(o)||"",Ie.APPLICATION,an.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)}},VB.ID="workbench.contrib.trustedDomainsFileSystemProvider",VB);iee=D([_(0,Jt),_(1,$i),_(2,we)],iee);const Rzt=(s,e)=>{let t=s.with({query:null,fragment:null}).toString(!0);const i=r=>r.replace(/\/+$/,"");e=i(e),t=i(t);const n=Array.from({length:t.length+1}).map(()=>Array.from({length:e.length+1}).map(()=>{}));if(/^[^./:]*:\/\//.test(e))return uw(n,t,e,0,0);const o=/^(https?):\/\//.exec(t)?.[1];return o?uw(n,t,`${o}://${e}`,0,0):!1},uw=(s,e,t,i,n)=>{if(s[i]?.[n]!==void 0)return s[i][n];const o=[];if(i===e.length)return n===t.length;if(n===t.length)return e.slice(i)[0]==="/";if(e[i]===t[n]&&o.push(uw(s,e,t,i+1,n+1)),t[n]+t[n+1]==="*."&&(["/",":"].includes(e[i])||o.push(uw(s,e,t,i+1,n)),o.push(uw(s,e,t,i,n+2))),t[n]==="*"&&(i+1===e.length?o.push(uw(s,e,t,i+1,n+1)):o.push(uw(s,e,t,i+1,n)),o.push(uw(s,e,t,i,n+1))),t[n]+t[n+1]===":*")if(e[i]===":"){let r=i+1;do r++;while(/[0-9]/.test(e[r]));o.push(uw(s,e,t,r,n+2))}else o.push(uw(s,e,t,i,n+2));return s[i][n]=o.some(r=>r===!0)};let GSe=class extends V{constructor(e,t){super(),this._instantiationService=e,this._storageService=t;const i=()=>new jV(si,()=>{const{defaultTrustedDomains:n,trustedDomains:o}=this._instantiationService.invokeFunction(tee);return[...n,...o]});this._staticTrustedDomainsResult=i(),this._register(this._storageService.onDidChangeValue(Ie.APPLICATION,Dce,this._register(new Z))(()=>{this._staticTrustedDomainsResult?.dispose(),this._staticTrustedDomainsResult=i()}))}isValid(e){const{defaultTrustedDomains:t,trustedDomains:i}=this._instantiationService.invokeFunction(tee),n=[...t,...i];return nit(e,n)}};GSe=D([_(0,we),_(1,$i)],GSe);const Mzt=/^localhost(:\d+)?$/i,Nzt=/^127.0.0.1(:\d+)?$/;function Pzt(s){return Mzt.test(s)||Nzt.test(s)}function e5e(s){const e=["github.com"];try{const t=typeof s=="string"?N.parse(s,!0):s;return e.includes(t.authority)?t.with({path:t.path.toLowerCase()}).toString(!0):t.toString(!0)}catch{return s.toString()}}function nit(s,e){if(s=N.parse(e5e(s)),e=e.map(e5e),Pzt(s.authority))return!0;for(let t=0;tthis.validateLink(f,p)})}async validateLink(e,t){if(!CA(e,pe.http)&&!CA(e,pe.https)||t?.fromWorkspace&&this._workspaceTrustService.isWorkspaceTrusted()&&!this._configurationService.getValue("workbench.trustedDomains.promptInTrustedWorkspace"))return!0;const i=e;let n;if(typeof e=="string"?n=N.parse(e):n=e,await this._trustedDomainService.isValid(n))return!0;{const{scheme:o,authority:r,path:a,query:c,fragment:l}=n;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:Xe.Info,message:g(4817,"Do you want {0} to open the external website?",this._productService.nameShort),detail:typeof i=="string"?i:d,buttons:[{label:g(4818,"&&Open"),run:()=>!0},{label:g(4819,"&&Copy"),run:()=>(this._clipboardService.writeText(typeof i=="string"?i:n.toString(!0)),!1)},{label:g(4820,"Configure &&Trusted Domains"),run:async()=>{const{trustedDomains:m}=this._instantiationService.invokeFunction(tee),v=`${o}://${r}`,b=await xzt(m,v,n,this._quickInputService,this._storageService,this._editorService);return!!(b.indexOf("*")!==-1||nit(n,b))}}],cancelButton:{run:()=>!1}});return p}}};KSe=D([_(0,Ao),_(1,$i),_(2,to),_(3,Er),_(4,In),_(5,ei),_(6,ag),_(7,Yi),_(8,we),_(9,Te),_(10,cC),_(11,Zae)],KSe);class Fzt extends li{constructor(){super({id:"workbench.action.url.openUrl",title:Fe(907,"Open URL"),category:ca.Developer,f1:!0})}async run(e){const t=e.get(In),i=e.get(Oae);return t.input({prompt:g(908,"URL to open")}).then(n=>{if(n){const o=N.parse(n);i.open(o,{originalUrl:n})}})}}At(Fzt);_t.registerCommand($Se);jn.appendMenuItem(_e.CommandPalette,{command:{id:$Se.id,title:$Se.description.description}});Qe.as(of.Workbench).registerWorkbenchContribution(KSe,Rs.Restored);Ku(iee.ID,iee,yc.BlockRestore);Ku(eee.ID,eee,yc.BlockRestore);const Ozt=Qe.as(Nn.Configuration);Ozt.registerConfiguration({...B6,properties:{"workbench.trustedDomains.promptInTrustedWorkspace":{scope:at.APPLICATION,type:"boolean",default:!1,description:g(909,"When enabled, trusted domain prompts will appear when opening links in trusted workspaces.")}}});var Uv;(function(s){s.TITLEBAR_PART="workbench.parts.titlebar",s.BANNER_PART="workbench.parts.banner",s.ACTIVITYBAR_PART="workbench.parts.activitybar",s.SIDEBAR_PART="workbench.parts.sidebar",s.PANEL_PART="workbench.parts.panel",s.AUXILIARYBAR_PART="workbench.parts.auxiliarybar",s.EDITOR_PART="workbench.parts.editor",s.STATUSBAR_PART="workbench.parts.statusbar"})(Uv||(Uv={}));var t5e;(function(s){s.SHOW_TABS="zenMode.showTabs",s.HIDE_LINENUMBERS="zenMode.hideLineNumbers",s.HIDE_STATUSBAR="zenMode.hideStatusBar",s.HIDE_ACTIVITYBAR="zenMode.hideActivityBar",s.CENTER_LAYOUT="zenMode.centerLayout",s.FULLSCREEN="zenMode.fullScreen",s.RESTORE="zenMode.restore",s.SILENT_NOTIFICATIONS="zenMode.silentNotifications"})(t5e||(t5e={}));var Qp;(function(s){s.ACTIVITY_BAR_LOCATION="workbench.activityBar.location",s.EDITOR_TABS_MODE="workbench.editor.showTabs",s.EDITOR_ACTIONS_LOCATION="workbench.editor.editorActionsLocation",s.COMMAND_CENTER="window.commandCenter",s.LAYOUT_ACTIONS="workbench.layoutControl.enabled"})(Qp||(Qp={}));var nee;(function(s){s.DEFAULT="default",s.TOP="top",s.BOTTOM="bottom",s.HIDDEN="hidden"})(nee||(nee={}));var LT;(function(s){s.MULTIPLE="multiple",s.SINGLE="single",s.NONE="none"})(LT||(LT={}));var Q5;(function(s){s.DEFAULT="default",s.TITLEBAR="titleBar",s.HIDDEN="hidden"})(Q5||(Q5={}));var Tu;(function(s){s[s.LEFT=0]="LEFT",s[s.RIGHT=1]="RIGHT",s[s.BOTTOM=2]="BOTTOM",s[s.TOP=3]="TOP"})(Tu||(Tu={}));function Bzt(s){return s===Tu.BOTTOM||s===Tu.TOP}var Kv;(function(s){s[s.ALWAYS=0]="ALWAYS",s[s.NEVER=1]="NEVER",s[s.REMEMBER_LAST=2]="REMEMBER_LAST"})(Kv||(Kv={}));function N1(s){switch(s){case Tu.LEFT:return"left";case Tu.RIGHT:return"right";case Tu.BOTTOM:return"bottom";case Tu.TOP:return"top";default:return"bottom"}}const Wzt={[N1(Tu.LEFT)]:Tu.LEFT,[N1(Tu.RIGHT)]:Tu.RIGHT,[N1(Tu.BOTTOM)]:Tu.BOTTOM,[N1(Tu.TOP)]:Tu.TOP};function IK(s){return Wzt[s]}function gue(s){switch(s){case Kv.ALWAYS:return"always";case Kv.NEVER:return"never";case Kv.REMEMBER_LAST:return"preserve";default:return"preserve"}}gue(Kv.ALWAYS)+"",Kv.ALWAYS,gue(Kv.NEVER)+"",Kv.NEVER,gue(Kv.REMEMBER_LAST)+"",Kv.REMEMBER_LAST;var Np;(function(s){s[s.SHORT=0]="SHORT",s[s.MEDIUM=1]="MEDIUM",s[s.LONG=2]="LONG"})(Np||(Np={}));var CE,gw;(function(s){s.titleSeparator="window.titleSeparator",s.title="window.title"})(gw||(gw={}));const sit=(()=>{if(Qt&&od)return"${activeEditorShort}${separator}${rootName}${separator}${profileName}";const s="${dirty}${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}${appName}";return Wn?s+"${separator}${remoteName}":s})(),oit=Qt?" — ":" - ";var qS;let i5e=(qS=class extends V{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(Ls.SHORT);return`${e?.isDirty()&&!e.isSaving()?CE.TITLE_DIRTY:""}${t}`}constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.configurationService=i,this.contextKeyService=n,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 cn(()=>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(gw.title)&&this.updateTitleIncludesFocusedView(),(e.affectsConfiguration(gw.title)||e.affectsConfiguration(gw.titleSeparator))&&this.titleUpdater.schedule()}updateTitleIncludesFocusedView(){const e=this.configurationService.getValue(gw.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=[];Qr(t)?i.push(t):Zp(t)&&i.push(t.getOriginalEditor(),t.getModifiedEditor());for(const n of i)this.activeEditorListeners.add(n.onDidBlurEditorText(()=>this.titleUpdater.schedule())),this.activeEditorListeners.add(n.onDidFocusEditorText(()=>this.titleUpdater.schedule()))}}doUpdateTitle(){const e=this.getFullWindowTitle();if(e!==this.title){let t=e;B1e(t)||(t=this.productService.nameLong);const i=Bj(this.windowId,!0).window;!i.document.title&&Qt&&t===this.productService.nameLong&&(i.document.title=`${this.productService.nameLong} ${CE.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?`${CE.NLS_EXTENSION_HOST} - ${e}`:CE.NLS_EXTENSION_HOST),this.properties.isAdmin&&(t=CE.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,n=typeof e.prefix=="string"?e.prefix:this.properties.prefix;(t!==this.properties.isAdmin||i!==this.properties.isPure||n!==this.properties.prefix)&&(this.properties.isAdmin=t,this.properties.isPure=i,this.properties.prefix=n,this.titleUpdater.schedule())}registerVariables(e){let t=!1;for(const{name:i,contextKey:n}of e)this.variables.has(n)||(this.variables.set(n,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 n=Na.getOriginalUri(e,{supportSideBySide:Hs.PRIMARY});let o=n?Lr(n):void 0;o?.path==="."&&(o=void 0);let r;this.contextService.getWorkbenchState()===qi.FOLDER?r=t.folders[0]:n&&(r=this.contextService.getWorkspaceFolder(n)??void 0);let a;if(this.environmentService.remoteAuthority&&!Wn)a=this.labelService.getHostLabel(pe.vscodeRemote,this.environmentService.remoteAuthority);else{const z=lNe(t);z&&(a=this.labelService.getHostLabel(z.scheme,z.authority))}const c=e?e.getTitle(Ls.SHORT):"",l=e?e.getTitle(Ls.MEDIUM):c,d=e?e.getTitle(Ls.LONG):l,h=o?_i(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:Np.SHORT}),v=i?this.labelService.getUriLabel(i):"",b=r?r.name:"",w=r?this.labelService.getUriLabel(r.uri):"",y=e?.isDirty()&&!e.isSaving()?CE.TITLE_DIRTY:"",C=this.productService.nameLong,A=this.userDataProfileService.currentProfile.isDefault?"":this.userDataProfileService.currentProfile.name,L=this.viewsService.getFocusedViewName(),k={};for(const[z,G]of this.variables)k[G]=this.contextKeyService.getContextKeyValue(z)??"";let P=this.configurationService.getValue(gw.title);typeof P!="string"&&(P=sit);let R=this.configurationService.getValue(gw.titleSeparator);return typeof R!="string"&&(R=oit),AMt(P,{...k,activeEditorShort:c,activeEditorLong:d,activeEditorMedium:l,activeFolderShort:h,activeFolderMedium:u,activeFolderLong:f,rootName:p,rootPath:v,rootNameShort:m,folderName:b,folderPath:w,dirty:y,appName:C,remoteName:a,profileName:A,focusedView:L,separator:{label:R}})}isCustomTitleFormat(){const e=this.configurationService.inspect(gw.title),t=this.configurationService.inspect(gw.titleSeparator);return e.value!==e.defaultValue||t.value!==t.defaultValue}},CE=qS,qS.NLS_USER_IS_ADMIN=Qn?g(4821,"[Administrator]"):g(4822,"[Superuser]"),qS.NLS_EXTENSION_HOST=g(4823,"[Extension Development Host]"),qS.TITLE_DIRTY="● ",qS);i5e=CE=D([_(2,Te),_(3,Le),_(4,ei),_(5,cv),_(6,yi),_(7,Fs),_(8,lg),_(9,Er),_(10,km)],i5e);var OP,uk;let see=(uk=class extends V{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 Srt(1e3),this._templateRegexValidation=/[a-zA-Z0-9]/,this._parsedTemplateExpression=/\$\{(dirname|filename|extname|extname\((?[-+]?\d+)\)|dirname\((?[-+]?\d+)\))\}/g,this._filenameCaptureExpression=/(?^\.*[^.]*)/,this.storeEnablementState(),this.storeCustomPatterns(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(OP.SETTING_ID_ENABLED)){const t=this.enabled;this.storeEnablementState(),t!==this.enabled&&this.patterns.length>0&&this._onDidChange.fire()}else e.affectsConfiguration(OP.SETTING_ID_PATTERNS)&&(this.cache.clear(),this.storeCustomPatterns(),this._onDidChange.fire())}))}storeEnablementState(){this.enabled=this.configurationService.getValue(OP.SETTING_ID_ENABLED)}storeCustomPatterns(){this.patterns=[];const e=this.configurationService.getValue(OP.SETTING_ID_PATTERNS);for(const t in e){const i=e[t];if(!this._templateRegexValidation.test(i))continue;const n=hM(t),o=K_(t);this.patterns.push({pattern:t,template:i,isAbsolutePath:n,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 n=this.applyPatterns(e);return this.cache.set(t,n??null),n}applyPatterns(e){const t=this.workspaceContextService.getWorkspaceFolder(e);let i;for(const n of this.patterns){let o;if(t&&!n.isAbsolutePath?(i||(i=SN(Lr(t.uri),e)??e.path),o=i):o=e.path,n.parsedPattern(o))return this.applyTemplate(n.template,e,o)}}applyTemplate(e,t,i){let n;return e.replace(this._parsedTemplateExpression,(o,r,...a)=>{n=n??kct(t.path);const{dirnameN:c="0",extnameN:l="0"}=a.pop();if(r==="filename"){const{filename:d}=this._filenameCaptureExpression.exec(n.base)?.groups??{};if(d)return d}else if(r==="extname"){const d=this.getExtnames(n.base);if(d)return d}else if(r.startsWith("extname")){const d=parseInt(l),h=this.getNthExtname(n.base,d);if(h)return h}else if(r.startsWith("dirname")){const d=parseInt(c),h=this.getNthDirname(bb(i),d);if(h)return h}return o})}removeLeadingDot(e){let t=e;for(;t.startsWith(".");)t=t.slice(1);return t}getNthDirname(e,t){e=e.startsWith("/")?e.slice(1):e;const i=e.split("/");return this.getNthFragment(i,t)}getExtnames(e){return this.removeLeadingDot(e).split(".").slice(1).join(".")}getNthExtname(e,t){const i=this.removeLeadingDot(e).split(".");return i.shift(),this.getNthFragment(i,t)}getNthFragment(e,t){const i=e.length;let n;t<0?n=Math.abs(t)-1:n=i-t-1;const o=e[n];if(!(o===void 0||o===""))return o}},OP=uk,uk.SETTING_ID_PATTERNS="workbench.editor.customLabels.patterns",uk.SETTING_ID_ENABLED="workbench.editor.customLabels.enabled",uk);see=OP=D([_(0,Te),_(1,yi)],see);const TK=Qe.as(Nn.Configuration);(function(){Ku(qJ.ID,qJ,yc.Eventually),Ku(QJ.ID,QJ,yc.AfterRestored),TK.registerConfiguration({...B6,properties:{"workbench.externalBrowser":{type:"string",markdownDescription:g(910,"Configure the browser to use for opening http or https links externally. This can either be the name of the browser (`edge`, `chrome`, `firefox`) or an absolute path to the browser's executable. Will use the system default if not set."),included:od,restricted:!0},"workbench.editor.titleScrollbarSizing":{type:"string",enum:["default","large"],enumDescriptions:[g(911,"The default size."),g(912,"Increases the size, so it can be grabbed more easily with the mouse.")],description:g(913,"Controls the height of the scrollbars used for tabs and breadcrumbs in the editor title area."),default:"default"},[Qp.EDITOR_TABS_MODE]:{type:"string",enum:[LT.MULTIPLE,LT.SINGLE,LT.NONE],enumDescriptions:[g(914,"Each editor is displayed as a tab in the editor title area."),g(915,"The active editor is displayed as a single large tab in the editor title area."),g(916,"The editor title area is not displayed.")],description:g(917,"Controls whether opened editors should show as individual tabs, one single large tab or if the title area should not be shown."),default:"multiple"},[Qp.EDITOR_ACTIONS_LOCATION]:{type:"string",enum:[Q5.DEFAULT,Q5.TITLEBAR,Q5.HIDDEN],markdownEnumDescriptions:[g(918,"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(919,"Show editor actions in the window title bar. If {0} is set to {1}, editor actions are hidden.","`#window.customTitleBarVisibility#`","`never`"),g(920,"Editor actions are not shown.")],markdownDescription:g(921,"Controls where the editor actions are shown."),default:"default"},"workbench.editor.alwaysShowEditorActions":{type:"boolean",markdownDescription:g(922,"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(923,"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(924,"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(925,"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(926,"Controls whether editor file decorations should use badges."),default:!0},"workbench.editor.decorations.colors":{type:"boolean",markdownDescription:g(927,"Controls whether editor file decorations should use colors."),default:!0},[see.SETTING_ID_ENABLED]:{type:"boolean",markdownDescription:g(928,"Controls whether the custom workbench editor labels should be applied."),default:!0},[see.SETTING_ID_PATTERNS]:{type:"object",markdownDescription:(()=>{let t=g(929,"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(930,"`${dirname}`: name of the folder in which the file is located (e.g. `WORKSPACE_FOLDER/folder/file.txt -> folder`)."),g(931,"`${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 absolute path, otherwise it corresponds to the workspace folder."),g(932,"`${filename}`: name of the file without the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> file`)."),g(933,"`${extname}`: the file extension (e.g. `WORKSPACE_FOLDER/folder/file.txt -> txt`)."),g(934,"`${extname(N)}`: the nth extension of the file separated by '.' (e.g. `N=2: WORKSPACE_FOLDER/folder/file.ext1.ext2.ext3 -> ext1`). Extension can be picked from the start of the extension by using negative numbers (e.g. `N=-1: WORKSPACE_FOLDER/folder/file.ext1.ext2.ext3 -> ext2`).")].join(` - `),t+=` -`+g(935,'Example: `"**/static/**/*.html": "${filename} - ${dirname} (${extname})"` will render a file `WORKSPACE_FOLDER/static/folder/file.html` as `file - folder (html)`.'),t})(),additionalProperties:{type:["string","null"],markdownDescription:g(936,"The template which should be rendered when the pattern matches. 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(937,"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(938,"Show the name of the file followed by its directory name."),g(939,"Show the name of the file followed by its path relative to the workspace folder."),g(940,"Show the name of the file followed by its absolute path.")],default:"default",description:g(941,"Controls the format of the label for an editor.")},"workbench.editor.untitled.labelFormat":{type:"string",enum:["content","name"],enumDescriptions:[g(942,"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(943,"The name of the untitled file is not derived from the contents of the file.")],default:"content",description:g(944,"Controls the format of the label for an untitled editor.")},"workbench.editor.empty.hint":{type:"string",enum:["text","hidden"],default:"text",markdownDescription:g(945,"Controls if the empty editor text hint should be visible in the editor.")},"workbench.editor.languageDetection":{type:"boolean",default:!0,description:g(946,"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:at.LANGUAGE_OVERRIDABLE},"workbench.editor.historyBasedLanguageDetection":{type:"boolean",default:!0,tags:["experimental"],description:g(947,"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(948,"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(949,"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(950,"Show in untitled text editors")},notebookEditors:{type:"boolean",description:g(951,"Show in notebook editors")}}},"workbench.editor.tabActionLocation":{type:"string",enum:["left","right"],default:"right",markdownDescription:g(952,"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(953,"Controls the visibility of the tab close action button.")},"workbench.editor.tabActionUnpinVisibility":{type:"boolean",default:!0,description:g(954,"Controls the visibility of the tab unpin action button.")},"workbench.editor.tabSizing":{type:"string",enum:["fit","shrink","fixed"],default:"fit",enumDescriptions:[g(955,"Always keep tabs large enough to show the full editor label."),g(956,"Allow tabs to get smaller when the available space is not enough to show all tabs at once."),g(957,"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(958,"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(959,"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(960,"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(961,"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(962,"A pinned tab inherits the look of non pinned tabs."),g(963,"A pinned tab will show in a compact form with only icon or first letter of the editor name."),g(964,"A pinned tab shrinks to a compact fixed size showing parts of the editor name.")],markdownDescription:g(965,"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(966,"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(967,"Always prevent closing the pinned editor when using mouse middle click or keyboard."),g(968,"Prevent closing the pinned editor when using the keyboard."),g(969,"Prevent closing the pinned editor when using mouse middle click."),g(970,"Never prevent closing a pinned editor.")],description:g(971,"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(972,"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(973,"Splits all the editor groups to equal parts."),g(974,"Splits the active editor group to equal parts.")],description:g(975,"Controls the size of editor groups when splitting them.")},"workbench.editor.splitOnDragAndDrop":{type:"boolean",default:!0,description:g(976,"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(977,"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(978,"Controls whether editors are closed in most recently used order or from left to right."),default:!0},"workbench.editor.showIcons":{type:"boolean",description:g(979,"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(980,"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(981,"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(982,"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(983,"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(984,"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(985,"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(986,"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(987,"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(988,"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(989,"Controls the scope of history navigation in editors for commands such as 'Go Back' and 'Go Forward'."),enumDescriptions:[g(990,"Navigate across all opened editors and editor groups."),g(991,"Navigate only in editors of the active editor group."),g(992,"Navigate only in the active editor.")]},"workbench.editor.restoreViewState":{type:"boolean",markdownDescription:g(993,"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:at.LANGUAGE_OVERRIDABLE},"workbench.editor.sharedViewState":{type:"boolean",description:g(994,"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(995,"Controls the layout for when an editor is split in an editor group to be either vertical or horizontal."),enumDescriptions:[g(996,"Editors are positioned from top to bottom."),g(997,"Editors are positioned from left to right.")]},"workbench.editor.centeredLayoutAutoResize":{type:"boolean",default:!0,description:g(998,"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(999,"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(1e3,"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(1001,"All other editor groups are hidden and the current editor group is maximized to take up the entire editor area."),g(1002,"The editor group takes as much space as possible by making all other editor groups as small as possible."),g(1003,"No editor group is resized when double clicking on a tab.")]},"workbench.editor.limit.enabled":{type:"boolean",default:!1,description:g(1004,"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(1005,"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(1006,"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(1007,"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(1008,"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:at.RESOURCE},"workbench.localHistory.maxFileSize":{type:"number",default:256,minimum:1,description:g(1009,"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:at.RESOURCE},"workbench.localHistory.maxFileEntries":{type:"number",default:50,minimum:0,description:g(1010,"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:at.RESOURCE},"workbench.localHistory.exclude":{type:"object",patternProperties:{".*":{type:"boolean"}},markdownDescription:g(1011,"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:at.RESOURCE},"workbench.localHistory.mergeWindow":{type:"number",default:10,minimum:1,markdownDescription:g(1012,"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:at.RESOURCE},"workbench.commandPalette.history":{type:"number",description:g(1013,"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(1014,"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(1015,"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(1016,"Controls where the command palette should ask chat questions."),default:"chatView",enum:["chatView","quickChat"],enumDescriptions:[g(1017,"Ask chat questions in the Chat view."),g(1018,"Ask chat questions in Quick Chat.")]},"workbench.commandPalette.experimental.enableNaturalLanguageSearch":{type:"boolean",tags:["experimental"],description:g(1019,"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(1020,"Controls whether Quick Open should close automatically once it loses focus."),default:!0},"workbench.quickOpen.preserveInput":{type:"boolean",description:g(1021,"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(1022,"Controls whether opening settings also opens an editor showing all default settings."),default:!1},"workbench.settings.useSplitJSON":{type:"boolean",markdownDescription:g(1023,"Controls whether to use the split JSON editor when editing settings as JSON."),default:!1},"workbench.settings.openDefaultKeybindings":{type:"boolean",description:g(1024,"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(1025,"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","top","right"],default:"bottom",description:g(1026,"Controls the default location of the panel (Terminal, Debug Console, Output, Problems) in a new workspace. It can either show at the bottom, top, right, or left of the editor area.")},"workbench.panel.opensMaximized":{type:"string",enum:["always","never","preserve"],default:"preserve",description:g(1027,"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(1028,"Always maximize the panel when opening it."),g(1029,"Never maximize the panel when opening it. The panel will open un-maximized."),g(1030,"Open the panel to the state that it was in, before it was closed.")]},"workbench.statusBar.visible":{type:"boolean",default:!0,description:g(1031,"Controls the visibility of the status bar at the bottom of the workbench.")},[Jp.ACTIVITY_BAR_LOCATION]:{type:"string",enum:["default","top","bottom","hidden"],default:"default",markdownDescription:g(1032,"Controls the location of the Activity Bar relative to the Primary and Secondary Side Bars."),enumDescriptions:[g(1033,"Show the Activity Bar on the side of the Primary Side Bar and on top of the Secondary Side Bar."),g(1034,"Show the Activity Bar on top of the Primary and Secondary Side Bars."),g(1035,"Show the Activity Bar at the bottom of the Primary and Secondary Side Bars."),g(1036,"Hide the Activity Bar in the Primary and Secondary Side Bars.")]},"workbench.activityBar.iconClickBehavior":{type:"string",enum:["toggle","focus"],default:"toggle",markdownDescription:g(1037,"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(1038,"Hide the Primary Side Bar if the clicked item is already visible."),g(1039,"Focus the Primary Side Bar if the clicked item is already visible.")]},"workbench.view.alwaysShowHeaderActions":{type:"boolean",default:!1,description:g(1040,"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(1041,"Controls font aliasing method in the workbench."),enumDescriptions:[g(1042,"Sub-pixel font smoothing. On most non-retina displays this will give the sharpest text."),g(1043,"Smooth the font on the level of the pixel, as opposed to the subpixel. Can make the font appear lighter overall."),g(1044,"Disables font smoothing. Text will show with jagged sharp edges."),g(1045,"Applies `default` or `antialiased` automatically based on the DPI of displays.")],included:Qt},"workbench.settings.editor":{type:"string",enum:["ui","json"],enumDescriptions:[g(1046,"Use the settings UI editor."),g(1047,"Use the JSON file editor.")],description:g(1048,"Determines which settings editor to use by default."),default:"ui",scope:at.WINDOW},"workbench.hover.delay":{type:"number",description:g(1049,"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:Qt?1500:500,minimum:0},"workbench.reduceMotion":{type:"string",description:g(1050,"Controls whether the workbench should render with fewer animations."),enumDescriptions:[g(1051,"Always render with reduced motion."),g(1052,"Do not render with reduced motion"),g(1053,"Render with reduced motion based on OS configuration.")],default:"auto",tags:["accessibility"],enum:["on","off","auto"]},[Jp.LAYOUT_ACTIONS]:{type:"boolean",default:!0,markdownDescription:Wn?g(1054,"Controls whether the layout control in the title bar is shown."):g(1055,"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(1056,"Shows a single button with a dropdown of layout options."),g(1057,"Shows several buttons for toggling the visibility of the panels and side bar."),g(1058,"Shows both the dropdown and toggle buttons.")],default:"both",description:g(1059,"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(1060,"When enabled, will show the watermark tips when no editor is open.")}}});let e=g(1061,"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(935,'Example: `"**/static/**/*.html": "${filename} - ${dirname} (${extname})"` will render a file `WORKSPACE_FOLDER/static/folder/file.html` as `file - folder (html)`.'),t})(),additionalProperties:{type:["string","null"],markdownDescription:g(936,"The template which should be rendered when the pattern matches. 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(937,"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(938,"Show the name of the file followed by its directory name."),g(939,"Show the name of the file followed by its path relative to the workspace folder."),g(940,"Show the name of the file followed by its absolute path.")],default:"default",description:g(941,"Controls the format of the label for an editor.")},"workbench.editor.untitled.labelFormat":{type:"string",enum:["content","name"],enumDescriptions:[g(942,"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(943,"The name of the untitled file is not derived from the contents of the file.")],default:"content",description:g(944,"Controls the format of the label for an untitled editor.")},"workbench.editor.empty.hint":{type:"string",enum:["text","hidden"],default:"text",markdownDescription:g(945,"Controls if the empty editor text hint should be visible in the editor.")},"workbench.editor.languageDetection":{type:"boolean",default:!0,description:g(946,"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:at.LANGUAGE_OVERRIDABLE},"workbench.editor.historyBasedLanguageDetection":{type:"boolean",default:!0,tags:["experimental"],description:g(947,"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(948,"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(949,"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(950,"Show in untitled text editors")},notebookEditors:{type:"boolean",description:g(951,"Show in notebook editors")}}},"workbench.editor.tabActionLocation":{type:"string",enum:["left","right"],default:"right",markdownDescription:g(952,"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(953,"Controls the visibility of the tab close action button.")},"workbench.editor.tabActionUnpinVisibility":{type:"boolean",default:!0,description:g(954,"Controls the visibility of the tab unpin action button.")},"workbench.editor.tabSizing":{type:"string",enum:["fit","shrink","fixed"],default:"fit",enumDescriptions:[g(955,"Always keep tabs large enough to show the full editor label."),g(956,"Allow tabs to get smaller when the available space is not enough to show all tabs at once."),g(957,"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(958,"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(959,"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(960,"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(961,"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(962,"A pinned tab inherits the look of non pinned tabs."),g(963,"A pinned tab will show in a compact form with only icon or first letter of the editor name."),g(964,"A pinned tab shrinks to a compact fixed size showing parts of the editor name.")],markdownDescription:g(965,"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(966,"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(967,"Always prevent closing the pinned editor when using mouse middle click or keyboard."),g(968,"Prevent closing the pinned editor when using the keyboard."),g(969,"Prevent closing the pinned editor when using mouse middle click."),g(970,"Never prevent closing a pinned editor.")],description:g(971,"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(972,"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(973,"Splits all the editor groups to equal parts."),g(974,"Splits the active editor group to equal parts.")],description:g(975,"Controls the size of editor groups when splitting them.")},"workbench.editor.splitOnDragAndDrop":{type:"boolean",default:!0,description:g(976,"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(977,"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(978,"Controls whether editors are closed in most recently used order or from left to right."),default:!0},"workbench.editor.showIcons":{type:"boolean",description:g(979,"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(980,"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(981,"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(982,"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(983,"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(984,"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(985,"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(986,"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(987,"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(988,"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(989,"Controls the scope of history navigation in editors for commands such as 'Go Back' and 'Go Forward'."),enumDescriptions:[g(990,"Navigate across all opened editors and editor groups."),g(991,"Navigate only in editors of the active editor group."),g(992,"Navigate only in the active editor.")]},"workbench.editor.restoreViewState":{type:"boolean",markdownDescription:g(993,"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:at.LANGUAGE_OVERRIDABLE},"workbench.editor.sharedViewState":{type:"boolean",description:g(994,"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(995,"Controls the layout for when an editor is split in an editor group to be either vertical or horizontal."),enumDescriptions:[g(996,"Editors are positioned from top to bottom."),g(997,"Editors are positioned from left to right.")]},"workbench.editor.centeredLayoutAutoResize":{type:"boolean",default:!0,description:g(998,"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(999,"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(1e3,"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(1001,"All other editor groups are hidden and the current editor group is maximized to take up the entire editor area."),g(1002,"The editor group takes as much space as possible by making all other editor groups as small as possible."),g(1003,"No editor group is resized when double clicking on a tab.")]},"workbench.editor.limit.enabled":{type:"boolean",default:!1,description:g(1004,"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(1005,"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(1006,"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(1007,"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(1008,"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:at.RESOURCE},"workbench.localHistory.maxFileSize":{type:"number",default:256,minimum:1,description:g(1009,"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:at.RESOURCE},"workbench.localHistory.maxFileEntries":{type:"number",default:50,minimum:0,description:g(1010,"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:at.RESOURCE},"workbench.localHistory.exclude":{type:"object",patternProperties:{".*":{type:"boolean"}},markdownDescription:g(1011,"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:at.RESOURCE},"workbench.localHistory.mergeWindow":{type:"number",default:10,minimum:1,markdownDescription:g(1012,"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:at.RESOURCE},"workbench.commandPalette.history":{type:"number",description:g(1013,"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(1014,"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(1015,"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(1016,"Controls where the command palette should ask chat questions."),default:"chatView",enum:["chatView","quickChat"],enumDescriptions:[g(1017,"Ask chat questions in the Chat view."),g(1018,"Ask chat questions in Quick Chat.")]},"workbench.commandPalette.experimental.enableNaturalLanguageSearch":{type:"boolean",tags:["experimental"],description:g(1019,"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(1020,"Controls whether Quick Open should close automatically once it loses focus."),default:!0},"workbench.quickOpen.preserveInput":{type:"boolean",description:g(1021,"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(1022,"Controls whether opening settings also opens an editor showing all default settings."),default:!1},"workbench.settings.useSplitJSON":{type:"boolean",markdownDescription:g(1023,"Controls whether to use the split JSON editor when editing settings as JSON."),default:!1},"workbench.settings.openDefaultKeybindings":{type:"boolean",description:g(1024,"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(1025,"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","top","right"],default:"bottom",description:g(1026,"Controls the default location of the panel (Terminal, Debug Console, Output, Problems) in a new workspace. It can either show at the bottom, top, right, or left of the editor area.")},"workbench.panel.opensMaximized":{type:"string",enum:["always","never","preserve"],default:"preserve",description:g(1027,"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(1028,"Always maximize the panel when opening it."),g(1029,"Never maximize the panel when opening it. The panel will open un-maximized."),g(1030,"Open the panel to the state that it was in, before it was closed.")]},"workbench.statusBar.visible":{type:"boolean",default:!0,description:g(1031,"Controls the visibility of the status bar at the bottom of the workbench.")},[Qp.ACTIVITY_BAR_LOCATION]:{type:"string",enum:["default","top","bottom","hidden"],default:"default",markdownDescription:g(1032,"Controls the location of the Activity Bar relative to the Primary and Secondary Side Bars."),enumDescriptions:[g(1033,"Show the Activity Bar on the side of the Primary Side Bar and on top of the Secondary Side Bar."),g(1034,"Show the Activity Bar on top of the Primary and Secondary Side Bars."),g(1035,"Show the Activity Bar at the bottom of the Primary and Secondary Side Bars."),g(1036,"Hide the Activity Bar in the Primary and Secondary Side Bars.")]},"workbench.activityBar.iconClickBehavior":{type:"string",enum:["toggle","focus"],default:"toggle",markdownDescription:g(1037,"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(1038,"Hide the Primary Side Bar if the clicked item is already visible."),g(1039,"Focus the Primary Side Bar if the clicked item is already visible.")]},"workbench.view.alwaysShowHeaderActions":{type:"boolean",default:!1,description:g(1040,"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(1041,"Controls font aliasing method in the workbench."),enumDescriptions:[g(1042,"Sub-pixel font smoothing. On most non-retina displays this will give the sharpest text."),g(1043,"Smooth the font on the level of the pixel, as opposed to the subpixel. Can make the font appear lighter overall."),g(1044,"Disables font smoothing. Text will show with jagged sharp edges."),g(1045,"Applies `default` or `antialiased` automatically based on the DPI of displays.")],included:Qt},"workbench.settings.editor":{type:"string",enum:["ui","json"],enumDescriptions:[g(1046,"Use the settings UI editor."),g(1047,"Use the JSON file editor.")],description:g(1048,"Determines which settings editor to use by default."),default:"ui",scope:at.WINDOW},"workbench.hover.delay":{type:"number",description:g(1049,"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:Qt?1500:500,minimum:0},"workbench.reduceMotion":{type:"string",description:g(1050,"Controls whether the workbench should render with fewer animations."),enumDescriptions:[g(1051,"Always render with reduced motion."),g(1052,"Do not render with reduced motion"),g(1053,"Render with reduced motion based on OS configuration.")],default:"auto",tags:["accessibility"],enum:["on","off","auto"]},[Qp.LAYOUT_ACTIONS]:{type:"boolean",default:!0,markdownDescription:Wn?g(1054,"Controls whether the layout control in the title bar is shown."):g(1055,"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(1056,"Shows a single button with a dropdown of layout options."),g(1057,"Shows several buttons for toggling the visibility of the panels and side bar."),g(1058,"Shows both the dropdown and toggle buttons.")],default:"both",description:g(1059,"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(1060,"When enabled, will show the watermark tips when no editor is open.")}}});let e=g(1061,"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(1062,"`${activeEditorShort}`: the file name (e.g. myFile.txt)."),g(1063,"`${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt)."),g(1064,"`${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt)."),g(1065,"`${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder)."),g(1066,"`${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder)."),g(1067,"`${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder)."),g(1068,"`${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder)."),g(1069,"`${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)."),g(1070,"`${rootName}`: name of the workspace with optional remote name and workspace indicator if applicable (e.g. myFolder, myRemoteFolder [SSH] or myWorkspace (Workspace))."),g(1071,"`${rootNameShort}`: shortened name of the workspace without suffixes (e.g. myFolder, myRemoteFolder or myWorkspace)."),g(1072,"`${rootPath}`: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace)."),g(1073,"`${profileName}`: name of the profile in which the workspace is opened (e.g. Data Science (Profile)). Ignored if default profile is used."),g(1074,"`${appName}`: e.g. VS Code."),g(1075,"`${remoteName}`: e.g. SSH"),g(1076,"`${dirty}`: an indicator for when the active editor has unsaved changes."),g(1077,"`${focusedView}`: the name of the view that is currently focused."),g(1078,"`${activeRepositoryName}`: the name of the active repository (e.g. vscode)."),g(1079,"`${activeRepositoryBranchName}`: the name of the active branch in the active repository (e.g. main)."),g(1080,'`${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.')].join(` -- `),MK.registerConfiguration({...DXe,properties:{"window.title":{type:"string",default:uit,markdownDescription:e},"window.titleSeparator":{type:"string",default:git,markdownDescription:g(1081,"Separator used by {0}.","`#window.title#`")},[Jp.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Wn?g(1082,"Show command launcher together with the window title."):g(1083,"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(1084,"Menu is displayed at the top of the window and only hidden in full screen mode."),g(1085,"Menu is always visible at the top of the window even in full screen mode."),Qt?g(1086,"Menu is hidden but can be displayed at the top of the window by executing the `Focus Application Menu` command."):g(1087,"Menu is hidden but can be displayed at the top of the window via the Alt key."),g(1088,"Menu is always hidden."),Wn?g(1089,"Menu is displayed as a compact button in the side bar."):g(1090,"Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1}.","`#window.titleBarStyle#`","`native`")],default:Wn?"compact":"classic",scope:at.APPLICATION,markdownDescription:Qt?g(1091,"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(1092,"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:Qn||pr||Wn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:at.APPLICATION,description:g(1093,"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:Qn||pr},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:at.APPLICATION,markdownDescription:g(1094,"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:Qn||pr},"window.openFilesInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(1095,"Files will open in a new window."),g(1096,"Files will open in the window with the files' folder open or the last active window."),Qt?g(1097,"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(1098,"Files will open in a new window unless picked from within the application (e.g. via the File menu).")],default:"off",scope:at.APPLICATION,markdownDescription:g(Qt?1099:1100,"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(1101,"Folders will open in a new window."),g(1102,"Folders will replace the last active window."),g(1103,"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:at.APPLICATION,markdownDescription:g(1104,"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:[Wn?g(1105,"Always try to ask for confirmation. Note that browsers may still decide to close a tab or window without confirmation."):g(1106,"Always ask for confirmation."),Wn?g(1107,"Only ask for confirmation if a keybinding was used to close the window. Note that detection may not be possible in some cases."):g(1108,"Only ask for confirmation if a keybinding was used."),Wn?g(1109,"Never explicitly ask for confirmation unless data loss is imminent."):g(1110,"Never explicitly ask for confirmation.")],default:Wn&&!wGe()?"keyboardOnly":"never",markdownDescription:Wn?g(1111,"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(1112,"Controls whether to show a confirmation dialog before closing a window or quitting the application."),scope:at.APPLICATION}}}),Qu(JJ.ID,JJ,yc.Eventually),MK.registerConfiguration({...FRt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(1113,"Controls whether the problems are visible throughout the editor and workbench.")}}}),MK.registerConfiguration({id:"zenMode",order:9,title:g(1114,"Zen Mode"),type:"object",properties:{"zenMode.fullScreen":{type:"boolean",default:!0,description:g(1115,"Controls whether turning on Zen Mode also puts the workbench into full screen mode.")},"zenMode.centerLayout":{type:"boolean",default:!0,description:g(1116,"Controls whether turning on Zen Mode also centers the layout.")},"zenMode.showTabs":{type:"string",enum:["multiple","single","none"],description:g(1117,"Controls whether turning on Zen Mode should show multiple editor tabs, a single editor tab, or hide the editor title area completely."),enumDescriptions:[g(1118,"Each editor is displayed as a tab in the editor title area."),g(1119,"The active editor is displayed as a single large tab in the editor title area."),g(1120,"The editor title area is not displayed.")],default:"multiple"},"zenMode.hideStatusBar":{type:"boolean",default:!0,description:g(1121,"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(1122,"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(1123,"Controls whether turning on Zen Mode also hides the editor line numbers.")},"zenMode.restore":{type:"boolean",default:!0,description:g(1124,"Controls whether a window should restore to Zen Mode if it was exited in Zen Mode.")},"zenMode.silentNotifications":{type:"boolean",default:!0,description:g(1125,"Controls whether notifications do not disturb mode should be enabled while in Zen Mode. If true, only error notifications will pop out.")}}})})();Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.activityBar.visible",migrateFn:s=>{const e=[];return s!==void 0&&e.push(["workbench.activityBar.visible",{value:void 0}]),s===!1&&e.push([Jp.ACTIVITY_BAR_LOCATION,{value:oee.HIDDEN}]),e}}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:Jp.ACTIVITY_BAR_LOCATION,migrateFn:s=>{const e=[];return s==="side"&&e.push([Jp.ACTIVITY_BAR_LOCATION,{value:oee.DEFAULT}]),e}}]);Qe.as(Mm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.editor.doubleClickTabToToggleEditorGroupSizes",migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?"expand":"off",e.push(["workbench.editor.doubleClickTabToToggleEditorGroupSizes",{value:s}])),e}},{key:Jp.EDITOR_TABS_MODE,migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?PT.MULTIPLE:PT.SINGLE,e.push([Jp.EDITOR_TABS_MODE,{value:s}])),e}},{key:"workbench.editor.tabCloseButton",migrateFn:s=>{const e=[];return s==="left"||s==="right"?e.push(["workbench.editor.tabActionLocation",{value:s}]):s==="off"&&e.push(["workbench.editor.tabActionCloseVisibility",{value:!1}]),e}},{key:"zenMode.hideTabs",migrateFn:s=>{const e=[["zenMode.hideTabs",{value:void 0}]];return s===!0&&e.push(["zenMode.showTabs",{value:"single"}]),e}}]);let fit=()=>!1,pit=(s,e)=>!1;const Jzt=XM.prototype.getCommandPicks;XM.prototype.getCommandPicks=async function(s){let e=await Jzt.call(this,s);return fit()||(e=e.map(t=>({...t,buttons:void 0}))),e};let ZSe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(Qye)}get activeService(){const e=Dt.get(Kt).getFocusedCodeEditor();return e==null||pit(e,e instanceof Yk)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(k3)),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=He.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()}};ZSe=D([_(0,we)],ZSe);function Xzt({isKeybindingConfigurationVisible:s,shouldUseGlobalPicker:e}={}){return s!=null&&(fit=s),e!=null&&(pit=e),{[In.toString()]:new wi(ZSe,[],!0)}}async function Zzt(s,e,t,i,n,o){let r;try{await e8t(s,e,t,i,n,o)}catch(a){r=a}finally{r&&n.errorTransformer&&(r=n.errorTransformer(r)),typeof r<"u"&&t.error(r),t.end()}}async function e8t(s,e,t,i,n,o){yue(o);const r=await s.open(e,{create:!1});try{yue(o);let a=0,c=0,l=n&&typeof n.length=="number"?n.length:void 0,d=$e.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),h=n&&typeof n.position=="number"?n.position:0,u=0;do c=await s.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=$e.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&yue(o)&&t8t(a,n));if(u>0){let f=u;typeof l=="number"&&(f=Math.min(u,l)),t.write(i(d.slice(0,f)))}}catch(a){throw s0(a)}finally{await s.close(r)}}function yue(s){if(s.isCancellationRequested)throw xy();return!0}function t8t(s,e){if(typeof e?.limits?.size=="number"&&s>e.limits.size)throw us(g(4398,"File is too large to open"),ot.FileTooLarge);return!0}var eAe;function mit(s){return s.scheme===pe.file?s.fsPath:s.toString(!0)}async function _it(s,e,t){const i=[];for(;!s.isEqual(t,s.dirname(t));)try{if(!((await e.stat(t)).type&sn.Directory))throw new Error(g(581,"Unable to create folder '{0}' that already exists but is not a directory",mit(t)));break}catch(n){if(Vk(n)!==ot.FileNotFound)throw n;i.push(s.basename(t)),t=s.dirname(t)}for(let n=i.length-1;n>=0;n--){t=s.joinPath(t,i[n]);try{await e.mkdir(t)}catch(o){if(Vk(o)!==ot.FileExists)throw o}}}var PR;let tAe=(PR=class extends V{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 sTe)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);cs(`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(n=>{const o=new zY(n,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(o),o.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(o)})),typeof t.onDidWatchError=="function"&&i.add(t.onDidWatchError(n=>this._onDidWatchError.fire(new Error(n)))),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),bt(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 Zs.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 hi.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!DGe(e))throw new Td(g(582,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),Qi.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new La;throw i.message=g(583,"ENOPRO: No file system provider found for resource '{0}'",e.toString()),i}return t}async withReadProvider(e){const t=await this.withProvider(e);if(hE(t)||zm(t)||Nq(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(hE(t)||zm(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 Vk(i)===ot.FileNotFound?new Td(g(584,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),Qi.FILE_NOT_FOUND):s0(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),n=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=Dh.forUris(()=>!n),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,n,o,r){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&sn.File)!==0,isDirectory:(i.type&sn.Directory)!==0,isSymbolicLink:(i.type&sn.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&lp.Readonly)||!!(e.capabilities&Vn.Readonly),locked:!!((i.permissions??0)&lp.Locked),etag:$Y({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&r(c,n)){try{const l=await e.readdir(t),d=await Zs.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=Fi(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return Zs.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 Td(g(585,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),Qi.FILE_MODIFIED_SINCE,t)}async createFile(e,t=$e.fromString(""),i){await this.doValidateCreateFile(e,i);const n=await this.writeFile(e,t);return this._onDidRunOperation.fire(new uP(e,Ai.CREATE,n)),n}async writeFile(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:o}=this.getExtUri(n);let r=i;if(D2e(n)&&!r?.atomic){const a=n.enforceAtomicWriteFile?.(e);a&&(r={...i,atomic:a})}try{await this.validateWriteFile(n,e,r)||await this.mkdirp(n,o.dirname(e));let c;if(zm(n)&&!(t instanceof $e))if(bq(t)){const l=await kht(t,3);l.ended?c=$e.concat(l.buffer):c=l}else c=Dht(t,l=>$e.concat(l),3);else c=t;!hE(n)||zm(n)&&c instanceof $e||zm(n)&&D2e(n)&&r?.atomic?await this.doWriteUnbuffered(n,e,r,c):await this.doWriteBuffered(n,e,r,c instanceof $e?cKe(c):c),this._onDidRunOperation.fire(new uP(e,Ai.WRITE))}catch(a){throw new Td(g(586,"Unable to write file '{0}' ({1})",this.resourceForError(e),s0(a).toString()),$w(a),r)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const n=!!i?.unlock;if(n&&!(e.capabilities&Vn.FileWriteUnlock))throw new Error(g(587,"Unable to unlock file '{0}' because provider does not support it.",this.resourceForError(t)));if(!!i?.atomic){if(!(e.capabilities&Vn.FileAtomicWrite))throw new Error(g(588,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&Vn.FileReadWrite))throw new Error(g(589,"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",this.resourceForError(t)));if(n)throw new Error(g(590,"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&sn.Directory)throw new Td(g(591,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),Qi.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,r),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==S_&&typeof r.mtime=="number"&&typeof r.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,n);o(a)}catch(a){r(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,n){const o=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},n);return{...o,value:await eD(o.value)}}async readFileStream(e,t,i){const n=await this.withReadProvider(e);return this.doReadFileStream(n,e,t,i)}async doReadFileStream(e,t,i,n){const o=new ci(n);let r=i;yhe(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!==S_&&await a,r?.atomic&&yhe(e)||!(hE(e)||Nq(e))||zm(e)&&r?.preferUnbuffered?c=this.readFileUnbuffered(e,t,r):Nq(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 pTe(c),this.restoreReadError(l,t,r)}}restoreReadError(e,t,i){const n=g(593,"Unable to read file '{0}' ({1})",this.resourceForError(t),s0(e).toString());return e instanceof C5?new C5(n,e.stat,i):e instanceof Pq?new Pq(n,e.fileOperationResult,e.size,e.options):new Td(n,$w(e),i)}readFileStreamed(e,t,i,n=Object.create(null)){const o=e.readFileStream(t,n,i);return Lht(o,{data:r=>r instanceof $e?r:$e.wrap(r),error:r=>this.restoreReadError(r,t,n)},r=>$e.concat(r))}readFileBuffered(e,t,i,n=Object.create(null)){const o=lKe();return Zzt(e,t,o,r=>r,{...n,bufferSize:this.BUFFER_SIZE,errorTransformer:r=>this.restoreReadError(r,t,n)},i),o}readFileUnbuffered(e,t,i){const n=jA(o=>$e.concat(o));return(async()=>{try{let o;i?.atomic&&yhe(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),n.end($e.wrap(o))}catch(o){n.error(o),n.end()}})(),n}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new Td(g(594,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),Qi.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==S_&&t.etag===i.etag)throw new C5(g(595,"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 Pq(g(596,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),Qi.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,n){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,n)}catch(o){return o}return!0}async move(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(n,e,o,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uP(e,r==="move"?Ai.MOVE:Ai.COPY,a)),a}async copy(e,t,i){const n=await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(n,e,o,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new uP(e,r==="copy"?Ai.COPY:Ai.MOVE,a)),a}async doMoveCopy(e,t,i,n,o,r){if(t.toString()===n.toString())return o;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,n,o,r);if(a&&!c&&r&&await this.del(n,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(n)),o==="copy"){if(e===i&&x2e(e))await e.copy(t,n,{overwrite:r});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,n):await this.doCopyFile(e,t,i,n)}return o}else return e===i?(await e.rename(t,n,{overwrite:r}),o):(await this.doMoveCopy(e,t,i,n,"copy",r),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,n){if(hE(e)&&hE(i))return this.doPipeBuffered(e,t,i,n);if(hE(e)&&zm(i))return this.doPipeBufferedToUnbuffered(e,t,i,n);if(zm(e)&&hE(i))return this.doPipeUnbufferedToBuffered(e,t,i,n);if(zm(e)&&zm(i))return this.doPipeUnbuffered(e,t,i,n)}async doCopyFolder(e,t,i,n){await i.mkdir(n),Array.isArray(t.children)&&await Zs.settled(t.children.map(async o=>{const r=this.getExtUri(i).providerExtUri.joinPath(n,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,n,o,r){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,n)),a&&o==="copy")throw new Error(g(597,"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(n)));if(!a&&l.isEqualOrParent(n,t))throw new Error(g(598,"Unable to move/copy when source '{0}' is parent of target '{1}'.",this.resourceForError(t),this.resourceForError(n)))}const c=await this.exists(n);if(c&&!a){if(!r)throw new Td(g(599,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(n)),Qi.FILE_MOVE_CONFLICT);if(e===i){const{providerExtUri:l}=this.getExtUri(e);if(l.isEqualOrParent(t,n))throw new Error(g(600,"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",this.resourceForError(t),this.resourceForError(n)))}}return{exists:c,isSameResourceWithDifferentPathCase:a}}getExtUri(e){const t=this.isPathCaseSensitive(e);return{providerExtUri:t?xn:Rre,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&Vn.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 uP(e,Ai.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return _it(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),n=!!t?.useTrash;if(n&&!(i.capabilities&Vn.Trash))throw new Error(g(601,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const o=t?.atomic;if(o&&!(i.capabilities&Vn.FileAtomicDelete))throw new Error(g(602,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(n&&o)throw new Error(g(603,"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 Td(g(604,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),Qi.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(605,"Unable to delete non-empty folder '{0}'.",this.resourceForError(e)))}return i}async del(e,t){const i=await this.doValidateDelete(e,t);let n=t;if(qSt(i)&&!n?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(n={...t,atomic:c})}const o=!!n?.useTrash,r=!!n?.recursive,a=n?.atomic??!1;await i.delete(e,{recursive:r,useTrash:o,atomic:a}),this._onDidRunOperation.fire(new uP(e,Ai.DELETE))}async cloneFile(e,t){const i=await this.withProvider(e),n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);if(!(i===n&&this.getExtUri(i).providerExtUri.isEqual(e,t)))return i===n&&KSt(i)?i.cloneFile(e,t):(await this.mkdirp(n,this.getExtUri(n).providerExtUri.dirname(t)),i===n&&x2e(i)?this.writeQueue.queueFor(e,()=>i.copy(e,t,{overwrite:!0}),this.getExtUri(i).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(i,e,n,t),this.getExtUri(i).providerExtUri))}createWatcher(e,t){return this.watch(e,{...t,correlationId:eAe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let n=!1,o=()=>{n=!0};i.add(Ee(()=>o())),(async()=>{try{const a=await this.doWatch(e,t);n?bt(a):o=()=>bt(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),n=Wc([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let o=this.activeWatchers.get(n);return o||(o={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(n,o)),o.count+=1,Ee(()=>{o&&(o.count--,o.count===0&&(bt(o.disposable),this.activeWatchers.delete(n)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)bt(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,n){return this.writeQueue.queueFor(t,async()=>{const o=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{bq(n)||Ide(n)?await this.doWriteStreamBufferedQueued(e,o,n):await this.doWriteReadableBufferedQueued(e,o,n)}catch(r){throw s0(r)}finally{await e.close(o)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let n=0,o;if(Ide(i)){if(i.buffer.length>0){const r=$e.concat(i.buffer);await this.doWriteBuffer(e,t,r,r.byteLength,n,0),n+=r.byteLength}if(i.ended)return;o=i.stream}else o=i;return new Promise((r,a)=>{kN(o,{onData:async c=>{o.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,n,0)}catch(l){return a(l)}n+=c.byteLength,setTimeout(()=>o.resume())},onError:c=>a(c),onEnd:()=>r()})})}async doWriteReadableBufferedQueued(e,t,i){let n=0,o;for(;(o=i.read())!==null;)await this.doWriteBuffer(e,t,o,o.byteLength,n,0),n+=o.byteLength}async doWriteBuffer(e,t,i,n,o,r){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,n),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,n){let o;n instanceof $e?o=n:bq(n)?o=await eD(n):Ide(n)?o=await Wht(n):o=Bht(n),await e.writeFile(t,o.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1})}async doPipeBuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeBufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeBufferedQueued(e,t,i,n){let o,r;try{o=await e.open(t,{create:!1}),r=await i.open(n,{create:!0,unlock:!1});const a=$e.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 s0(a)}finally{await Zs.settled([typeof o=="number"?e.close(o):Promise.resolve(),typeof r=="number"?i.close(r):Promise.resolve()])}}async doPipeUnbuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeUnbufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedQueued(e,t,i,n){return i.writeFile(n,await e.readFile(t),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeUnbufferedToBufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,t,i,n){const o=await i.open(n,{create:!0,unlock:!1});try{const r=await e.readFile(t);await this.doWriteBuffer(i,o,$e.wrap(r),r.byteLength,0,0)}catch(r){throw s0(r)}finally{await i.close(o)}}async doPipeBufferedToUnbuffered(e,t,i,n){const o=await eD(this.readFileBuffered(e,t,He.None));await this.doWriteUnbuffered(i,n,void 0,o)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&Vn.Readonly)throw new Td(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(t)),Qi.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&lp.Readonly)throw new Td(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(e)),Qi.FILE_PERMISSION_DENIED)}resourceForError(e){return mit(e)}},eAe=PR,PR.WATCHER_CORRELATION_IDS=0,PR);tAe=eAe=D([_(0,Ge)],tAe);class p5e{constructor(e){this.type=sn.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class x4{constructor(e){this.type=sn.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class aee extends V{constructor(){super(...arguments),this.memoryFdCounter=0,this.fdMemory=new Map,this._onDidChangeCapabilities=this._register(new I),this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this._capabilities=Vn.FileReadWrite|Vn.PathCaseSensitive,this.root=new x4(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&Vn.Readonly);e!==t&&(this._capabilities=e?Vn.Readonly|Vn.PathCaseSensitive|Vn.FileReadWrite:Vn.FileReadWrite|Vn.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((n,o)=>i.push([o,n.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw us("file not found",ot.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=jA(n=>$e.concat(n.map(o=>$e.wrap(o))).buffer);return i.end(t),i}async writeFile(e,t,i){const n=_i(e),o=this._lookupParentDirectory(e);let r=o.entries.get(n);if(r instanceof x4)throw us("file is directory",ot.FileIsADirectory);if(!r&&!i.create)throw us("file not found",ot.FileNotFound);if(r&&i.create&&!i.overwrite)throw us("file exists already",ot.FileExists);r||(r=new p5e(n),o.entries.set(n,r),this._fireSoon({type:To.ADDED,resource:e})),r.mtime=Date.now(),r.size=t.byteLength,r.data=t,this._fireSoon({type:To.UPDATED,resource:e})}open(e,t){const i=this._lookupAsFile(e,!1).data;if(i){const n=this.memoryFdCounter++;return this.fdMemory.set(n,i),Promise.resolve(n)}throw us("file not found",ot.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,n,o){const r=this.fdMemory.get(e);if(!r)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(r).slice(t,t+o);return i.set(a.buffer,n),Promise.resolve(a.byteLength)}write(e,t,i,n,o){const r=this.fdMemory.get(e);if(!r)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(i).slice(n,n+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw us("file exists already",ot.FileExists);const n=this._lookup(e,!1),o=this._lookupParentDirectory(e),r=this._lookupParentDirectory(t),a=_i(t);o.entries.delete(n.name),n.name=a,r.entries.set(a,n),this._fireSoon({type:To.DELETED,resource:e},{type:To.ADDED,resource:t})}async delete(e,t){const i=Lr(e),n=_i(e),o=this._lookupAsDirectory(i,!1);o.entries.has(n)&&(o.entries.delete(n),o.mtime=Date.now(),o.size-=1,this._fireSoon({type:To.UPDATED,resource:i},{resource:e,type:To.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw us("file exists already",ot.FileExists);const t=_i(e),i=Lr(e),n=this._lookupAsDirectory(i,!1),o=new x4(t);n.entries.set(o.name,o),n.mtime=Date.now(),n.size+=1,this._fireSoon({type:To.UPDATED,resource:i},{type:To.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let n=this.root;for(const o of i){if(!o)continue;let r;if(n instanceof x4&&(r=n.entries.get(o)),!r){if(t)return;throw us("file not found",ot.FileNotFound)}n=r}return n}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof x4)return i;throw us("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof p5e)return i;throw us("file is a directory",ot.FileIsADirectory)}_lookupParentDirectory(e){const t=Lr(e);return this._lookupAsDirectory(t,!1)}watch(e,t){return V.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 m5e extends Error{constructor(e){super("Missing stores"),this.db=e}}class iAe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class Z0{static async create(e,t,i){const n=await Z0.openDatabase(e,t,i);return new Z0(n,e)}static async openDatabase(e,t,i){cs(`code/willOpenDatabase/${e}`);try{return await Z0.doOpenDatabase(e,t,i)}catch(n){if(n instanceof m5e){console.info("Attempting to recreate the IndexedDB once.",e);try{await Z0.deleteDatabase(n.db)}catch(o){throw console.error("Error while deleting the IndexedDB",su(o)),o}return await Z0.doOpenDatabase(e,t,i)}throw n}finally{cs(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((n,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 m5e(a));return}n(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 n=indexedDB.deleteDatabase(e.name);n.onerror=o=>i(n.error),n.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 iAe(this.name);const n=this.database.transaction(e,t);return this.pendingTransactions.push(n),new Promise((o,r)=>{n.oncomplete=()=>{Array.isArray(a)?o(a.map(c=>c.result)):o(a.result)},n.onerror=()=>r(n.error?La.fromError(n.error):new La("unknown error")),n.onabort=()=>r(n.error?La.fromError(n.error):new La("unknown error"));const a=i(n.objectStore(e))}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(n),1))}async getKeyValues(e,t){if(!this.database)throw new iAe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(n=>{const o=new Map,a=i.objectStore(e).openCursor();if(!a)return n(o);a.onsuccess=()=>{a.result?(t(a.result.value)&&o.set(a.result.key.toString(),a.result.value),a.result.continue()):n(o)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Nr(l,!0)}`),n(o)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const Cue=us(g(609,"File does not exist"),ot.FileNotFound),i8t=us(g(610,"File is Directory"),ot.FileIsADirectory),_5e=us(g(611,"File is not a directory"),ot.FileNotADirectory),n8t=us(g(612,"Directory is not empty"),ot.Unknown),s8t=us(g(613,"File exceeds available storage quota"),ot.FileExceedsStorageQuota),Sv=s=>us(g(614,"Internal error occurred in IndexedDB File System Provider. ({0})",s),ot.Unknown);class X5{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!==sn.Directory)throw Sv("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!==sn.Directory)throw Sv("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 Sv(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==sn.Directory)throw Sv("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 Sv("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 Sv(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==sn.Directory)throw Sv(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const n=e[0],o=this.entry.children.get(n);if(t.type==="dir"){if(o?.entry.type===sn.File)throw Sv(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,o??new X5({type:sn.Directory,path:this.entry.path+"/"+n,children:new Map}))}else{if(o?.entry.type===sn.Directory)throw Sv(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,new X5({type:sn.File,path:this.entry.path+"/"+n,size:t.size}))}}else if(e.length>1){const n=e[0];let o=this.entry.children.get(n);if(!o)o=new X5({children:new Map,path:this.entry.path+"/"+n,type:sn.Directory}),this.entry.children.set(n,o);else if(o.type===sn.File)throw Sv(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);o.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===sn.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class o8t extends V{constructor(e,t,i,n){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=Vn.FileReadWrite|Vn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.extUri=new xN(()=>!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 j7,n&&(this.changesBroadcastChannel=this._register(new INe(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(o=>{this._onDidChangeFile.fire(o.map(r=>({type:r.type,resource:N.revive(r.resource)})))})))}watch(e,t){return V.None}async mkdir(e){try{if((await this.stat(e)).type===sn.File)throw _5e}catch{}(await this.getFiletree()).add(e.path,{type:"dir"})}async stat(e){const t=(await this.getFiletree()).read(e.path);if(t?.type===sn.File)return{type:sn.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===sn.Directory)return{type:sn.Directory,ctime:0,mtime:0,size:0};throw Cue}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==sn.Directory)throw _5e;return[...t.children.entries()].map(([i,n])=>[i,n.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 Cue;const i=t instanceof Uint8Array?t:Lt(t)?$e.fromString(t).buffer:void 0;if(i===void 0)throw Sv(`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===sn.Directory)throw i8t;await this.bulkWrite([[e,t]])}catch(n){throw this.reportError("writeFile",n),n}}async rename(e,t,i){const n=await this.getFiletree(),o=n.read(e.path);if(!o)throw Cue;const r=n.read(t.path);if(r){if(!i.overwrite)throw us("file exists already",ot.FileExists);if(r.type!==o.type)throw us("Cannot rename files with different types",ot.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]===sn.File?l.push(d):d[1]===sn.Directory&&n.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===sn.Directory&&(await this.readdir(e)).length)throw n8t;n=[e.path]}await this.deleteKeys(n),(await this.getFiletree()).delete(e.path),n.forEach(o=>this.mtimes.delete(o)),this.triggerChanges(n.map(o=>({resource:e.with({path:o}),type:To.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===sn.Directory){const n=await this.readdir(e);for(const[o,r]of n){const a=this.extUri.joinPath(e,o);if(i.push([a.path,r]),r===sn.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 X5({children:new Map,path:"",type:sn.Directory});return(await this.indexedDB.runInTransaction(this.store,"readonly",n=>n.getAllKeys())).map(n=>n.toString()).forEach(n=>e.add(n,{type:"file"})),e})()),this.cachedFiletree}async bulkWrite(e){e.forEach(([i,n])=>this.fileWriteBatch.push({content:n,resource:i})),await this.writeManyThrottler.queue(()=>this.writeMany());const t=await this.getFiletree();for(const[i,n]of e)t.add(i.path,{type:"file",size:n.byteLength}),this.mtimes.set(i.toString(),Date.now());this.triggerChanges(e.map(([i])=>({resource:i,type:To.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"?s8t: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 xA||t instanceof iAe?t.code:"unknown"})}}class r8t extends rae{constructor(e=bLe){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)LY(e,t,i);this.buffer=[]}log(e,t){this._logger?LY(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 aC;(function(s){s[s.None=0]="None",s[s.Untitled=2]="Untitled",s[s.Scratchpad=4]="Scratchpad"})(aC||(aC={}));const RNe="",a8t="modulepreload",c8t=function(s,e){return new URL(s,e).href},v5e={},FT=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){const r=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(t.map(l=>{if(l=c8t(l,i),l in v5e)return;v5e[l]=!0;const d=l.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let p=r.length-1;p>=0;p--){const m=r[p];if(m.href===l&&(!d||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":a8t,d||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return n.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},Wd="utf8",fS="utf8bom",ZM="utf16be",eN="utf16le",$Q=[254,255],nAe=[255,254],IV=[239,187,191],l8t=512,d8t=512,h8t=512*8,u8t=512*128;var cee;(function(s){s[s.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(cee||(cee={}));class g8t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class MNe{static async create(e){let t;if(e!==Wd)t=(await FT(()=>import("./iconv-lite-umd-BtsN0cjD.js").then(n=>n.i),[],import.meta.url).then(n=>n.default??n)).getDecoder(NNe(e));else{const i=new TextDecoder;t={write(n){return i.decode(n,{stream:!0})},end(){return i.decode()}}}return new MNe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function f8t(s,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?h8t:d8t;return new Promise((i,n)=>{const o=jA(h=>h.join("")),r=[];let a=0,c;const l=new ci,d=async()=>{try{const h=await A8t({buffer:$e.concat(r),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(h.seemsBinary&&e.acceptTextOnly)throw new g8t("Stream is binary but only text is accepted for decoding",cee.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await MNe.create(h.encoding);const u=c.write($e.concat(r).buffer);o.write(u),r.length=0,a=0,i({stream:o,detected:h})}catch(h){l.cancel(),o.destroy(),n(h)}};kN(s,{onData:async h=>{c?o.write(c.write(h.buffer)):(r.push(h),a+=h.byteLength,a>=t&&(s.pause(),await d(),setTimeout(()=>s.resume())))},onError:h=>o.error(h),onEnd:async()=>{c||await d(),o.end(c?.end())}},l.token)})}async function p8t(s,e,t){const n=(await FT(()=>import("./iconv-lite-umd-BtsN0cjD.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(NNe(e),t);let o=!1,r=!1;return{read(){if(r)return null;const a=s.read();if(typeof a!="string"){if(r=!0,!o&&t?.addBOM)switch(e){case Wd:case fS:return $e.wrap(Uint8Array.from(IV));case ZM:return $e.wrap(Uint8Array.from($Q));case eN:return $e.wrap(Uint8Array.from(nAe))}const c=n.end();return c&&c.length>0?(o=!0,$e.wrap(c)):null}return o=!0,$e.wrap(n.write(a))}}}async function m8t(s){return(await FT(()=>import("./iconv-lite-umd-BtsN0cjD.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(NNe(s))}function NNe(s){return s===fS||s===null?Wd:s}function _8t(s,e){if(!s||e<$Q.length)return null;const t=s.readUInt8(0),i=s.readUInt8(1);if(t===$Q[0]&&i===$Q[1])return ZM;if(t===nAe[0]&&i===nAe[1])return eN;if(eimport("./index-D528k8VQ.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a),i=s.slice(0,u8t),n=S8t(i.buffer);e&&(e=Fi(e.map(a=>C8t(a))),e.length===0&&(e=void 0));const o=t.detect(n,e?{detectEncodings:e}:void 0);if(!o||!o.encoding)return null;const r=o.encoding.toLowerCase();return 0<=v8t.indexOf(r)?null:y8t(o.encoding)}const w8t={ibm866:"cp866",big5:"cp950"};function vit(s){return s.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function y8t(s){const e=vit(s);return w8t[e]||e}function C8t(s){const e=vit(s);return GQ[e].guessableName}function S8t(s){let e="";for(let t=0;t({seemsBinary:!1,encoding:r})):{seemsBinary:o,encoding:n}}const sx={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom",guessableName:"UTF-8"},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,guessableName:"UTF-16LE"},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4,guessableName:"UTF-16BE"},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5,guessableName:"windows-1252"},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,guessableName:"windows-1250"},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17,guessableName:"ISO-8859-2"},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19,guessableName:"windows-1251"},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20,guessableName:"IBM866"},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:21,guessableName:"ISO-8859-5"},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:22,guessableName:"KOI8-R"},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,guessableName:"windows-1253"},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:26,guessableName:"ISO-8859-7"},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:27,guessableName:"windows-1255"},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:28,guessableName:"ISO-8859-8"},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,guessableName:"Big5"},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:37},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:38,guessableName:"SHIFT_JIS"},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:39,guessableName:"EUC-JP"},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:40,guessableName:"EUC-KR"},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,guessableName:"GB2312"},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:46},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:47}},GQ=(()=>{const s={};for(const e in sx)sx[e].guessableName&&(s[e]=sx[e]);return s})();var UP,ly;let lee=(ly=class extends oI{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,n,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=n,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=RNe,this.capabilities=aC.Untitled,this.configuredLabelFormat="content",this.cachedModelFirstLineWords=void 0,this.dirty=this.hasAssociatedFilePath||!!this.initialValue,this.ignoreDirtyOnModelContentChange=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),n&&this.setLanguageId(n),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===UP.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(oae(""))}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:Wd}):typeof this.initialValue=="string"&&(t=cKe($e.fromString(this.initialValue))),{content:t}}async resolve(){let e=!1,t=!1;if(this.textEditorModel)this.updateTextEditorModel(void 0,this.preferredLanguageId);else{let n;const o=await this.workingCopyBackupService.resolve(this);o?(n=o.value,t=!0):n=t6($e.fromString(this.initialValue||""));const r=await dLe(await this.textFileService.getDecodedStream(this.resource,n,{encoding:Wd}));this.createTextEditorModel(r,this.resource,this.preferredLanguageId),e=!0}const i=qn(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<=UP.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:UP.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,Q6e(i,UP.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&O7().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},UP=ly,ly.FIRST_LINE_NAME_MAX_LENGTH=40,ly.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=ly.FIRST_LINE_NAME_MAX_LENGTH*10,ly.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",ly);lee=UP=D([_(5,xi),_(6,gi),_(7,H6),_(8,Ec),_(9,Rm),_(10,Fo),_(11,Fs),_(12,ei),_(13,O6),_(14,mr)],lee);var TV,vk;let dee=(vk=class extends oI{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(o,n,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.progressService=b,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=RNe,this.capabilities=aC.None,this.name=Ko(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!xn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new RGe,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,To.ADDED)&&(i=!1,t=!0):e.contains(this.resource,To.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let n=!1;i&&(await Sr(100,He.None),this.isDisposed()?n=!0:n=!await this.fileService.exists(this.resource)),this.inOrphanMode!==n&&!this.isDisposed()&&this.setOrphaned(n)}}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:Wd});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!==Qi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),cs("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),cs("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,n,o,r;try{const c=await this.fileService.stat(this.resource);i=c.mtime,n=c.ctime,o=c.size,r=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),n=Date.now(),o=0,r=S_,this.setOrphaned(c.fileOperationResult===Qi.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:n,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=Wd;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:S_,value:await dLe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Wd})),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 n;t?n=S_:this.lastResolvedFileStat&&(n=this.lastResolvedFileStat.etag);const o=this.versionId;try{const r=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:n,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===Qi.FILE_NOT_FOUND),this.isResolved()&&a===Qi.FILE_NOT_MODIFIED_SINCE){r instanceof C5&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&a===Qi.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 n=this.contentEncoding;this.contentEncoding=e.encoding,this.preferredEncoding?this.updatePreferredEncoding(this.contentEncoding):n!==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??X3.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===Ca)&&!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,n=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=n,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(gh.CONFLICT)||this.hasState(gh.ERROR))&&(e.reason===Cn.AUTO||e.reason===Cn.FOCUS_CHANGE||e.reason===Cn.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(gh.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Cn.EXPLICIT);const 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 ci;return this.progressService.withProgress({title:g(5736,"Saving '{0}'",this.name),location:ud.Window,cancellable:!0,delay:this.isDirty()?3e3:5e3},n=>this.doSaveSequential(t,e,n,i),()=>{i.cancel()}).finally(()=>{i.dispose()})}doSaveSequential(e,t,i,n){return this.saveSequentializer.run(e,(async()=>{if(this.isResolved()&&!t.skipSaveParticipants)try{if(t.reason===Cn.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastModelContentChangeFromUndoRedo;a{try{const a=await this.textFileService.write(o.resource,r.createSnapshot(),{mtime:o.mtime,encoding:this.getEncoding(),etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(o.resource,r.getLanguageId())?S_:o.etag,unlock:t.writeUnlock,writeElevated:t.writeElevated});this.handleSaveSuccess(a,e,t)}catch(a){this.handleSaveError(a,e,t)}})())})(),()=>n.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===Qi.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 gh.CONFLICT:return this.inConflictMode;case gh.DIRTY:return this.dirty;case gh.ERROR:return this.inErrorMode;case gh.ORPHAN:return this.inOrphanMode;case gh.PENDING_SAVE:return this.saveSequentializer.isRunning();case gh.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===fS||this.contentEncoding===ZM||this.contentEncoding===eN){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,Z3.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===Z3.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:TV.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()}},TV=vk,vk.TEXTFILE_SAVE_ENCODING_SOURCE=PJ.registerSource("textFileEncoding.source",g(5735,"File Encoding Changed")),vk.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,vk);dee=TV=D([_(3,xi),_(4,gi),_(5,Jt),_(6,Fo),_(7,H6),_(8,Ge),_(9,Rm),_(10,_d),_(11,Fs),_(12,O6),_(13,mr),_(14,bf),_(15,fs),_(16,cg)],dee);let sAe=class extends V{constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=B1e(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.textEditorModel?.pushStackElement();for(const o of this.saveParticipants){if(n.isCancellationRequested||!e.textEditorModel)break;try{const r=o.participate(e,t,i,n);await U_(r,n)}catch(r){this.logService.error(r)}}e.textEditorModel?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};sAe=D([_(0,Ge)],sAe);let oAe=class extends V{get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,n,o){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=n,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 ui,this.mapResourceToModelListeners=new ui,this.mapResourceToDisposeListener=new ui,this.mapResourceToPendingModelResolvers=new ui,this.modelResolveQueue=this._register(new sTe),this.saveErrorHandler=(()=>{const r=this.notificationService;return{onSaveError(a,c){r.error(g(9794,"Failed to save '{0}': {1}",c.name,Nr(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(sAe)),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,To.UPDATED,To.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){vt(i)}})}onWillRunWorkingCopyFileOperation(e){if(e.operation===Ai.MOVE||e.operation===Ai.COPY){const t=[];for(const{source:i,target:n}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,n))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=n:c=Pt(n,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===Ai.MOVE||e.operation===Ai.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 Ai.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Ai.MOVE:case Ai.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await Zs.settled(t.map(async i=>{const n=this.uriIdentityService.asCanonicalUri(i.target),o=await this.resolve(n,{reload:{async:!1},contents:i.snapshot?u6(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Ca&&o.getLanguageId()===Ca&&vU(n)!==EKe&&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,n;N.isUri(e)?(n=e,i=this.get(n)):(n=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){vt(a)}})()):o=i.resolve(t):o=Promise.resolve();else{r=!0;const a=i=this.instantiationService.createInstance(dee,n,t?t.encoding:void 0,t?t.languageId:void 0);o=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(n,o),this.add(n,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(n)}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&&(bt(i),this.mapResourceToDisposeListener.delete(e));const n=this.mapResourceToModelListeners.get(e);n&&(bt(n),this.mapResourceToModelListeners.delete(e)),t&&this._onDidRemove.fire(e)}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i,n){return this.saveParticipants.participate(e,t,i,n)}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 M.toPromise(e.onDidChangeDirty),this.canDispose(e)):!0}dispose(){super.dispose(),this.mapResourceToModel.clear(),this.mapResourceToPendingModelResolvers.clear(),bt(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),bt(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};oAe=D([_(0,we),_(1,Jt),_(2,bi),_(3,zb),_(4,ks)],oAe);var KQ,bk;let rAe=(bk=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(),this.fileService=e,this.untitledTextEditorService=t,this.lifecycleService=i,this.instantiationService=n,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=b,this.decorationsService=w,this.files=this._register(this.instantiationService.createInstance(oAe)),this.untitled=this.untitledTextEditorService,this.provideDecorations()}provideDecorations(){const e=this._register(new class extends V{constructor(t){super(),this.files=t,this.label=g(4401,"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(gh.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 n=i.isReadonly(),o=i.hasState(gh.ORPHAN);if(n&&o)return{color:jOe,letter:ve.lockSmall,strikethrough:!0,tooltip:g(4402,"Deleted, Read-only")};if(n)return{letter:ve.lockSmall,tooltip:g(4403,"Read-only")};if(o)return{color:jOe,strikethrough:!0,tooltip:g(4404,"Deleted")}}}(this.files));this._register(this.decorationsService.registerDecorationsProvider(e))}get encoding(){return this._encoding||(this._encoding=this._register(this.instantiationService.createInstance(aAe))),this._encoding}async read(e,t){const[i,n]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:n.detected.encoding||Wd,value:await pTe(n.stream,o=>o.join(""))}}async readStream(e,t){const[i,n]=await this.doRead(e,t);return{...i,encoding:n.detected.encoding||Wd,value:await dLe(n.stream)}}async doRead(e,t){const i=new ci;let n;if(t?.preferUnbuffered){const o=await this.fileService.readFile(e,t,i.token);n={...o,value:t6(o.value)}}else n=await this.fileService.readFileStream(e,t,i.token);try{const o=await this.doGetDecodedStream(e,n.value,t);return[n,o]}catch(o){throw i.dispose(!0),o.decodeStreamErrorKind===cee.STREAM_IS_BINARY?new LFt(g(4405,"File seems to be binary and cannot be opened as text"),EW.FILE_IS_BINARY,t):o}}async create(e,t){const i=await Promise.all(e.map(async n=>{const o=await this.getEncodedReadable(n.resource,n.value);return{resource:n.resource,contents:o,overwrite:n.options?.overwrite}}));return this.workingCopyFileService.create(i,He.None,t)}async write(e,t,i){const n=await this.getEncodedReadable(e,t,i);return i?.writeElevated&&this.elevatedFileService.isSupported(e)?this.elevatedFileService.writeFileElevated(e,n,i):this.fileService.writeFile(e,n,i)}async getEncodedReadable(e,t,i){const{encoding:n,addBOM:o}=await this.encoding.getWriteEncoding(e,i);if(n===Wd&&!o)return typeof t>"u"?void 0:NFt(t);t=t||"";const r=typeof t=="string"?MFt(t):t;return p8t(r,n,{addBOM:o})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return f8t(t,{acceptTextOnly:i?.acceptTextOnly??!1,guessEncoding:i?.autoGuessEncoding||this.textResourceConfigurationService.getValue(e,"files.autoGuessEncoding"),candidateGuessEncodings:i?.candidateGuessEncodings||this.textResourceConfigurationService.getValue(e,"files.candidateGuessEncodings"),overwriteEncoding:async n=>{const{encoding:o}=await this.encoding.getPreferredReadEncoding(e,i,n??void 0);return o}})}async save(e,t){if(e.scheme===pe.untitled){const i=this.untitled.get(e);if(i){let n;if(i.hasAssociatedFilePath?n=await this.suggestSavePath(e):n=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(e),t?.availableFileSystems),n)return this.saveAs(e,n,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 ji(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}}],He.None),await this.save(e,i)||await this.save(t,i),t):this.doSaveAs(e,t,i)}}async doSaveAs(e,t,i){let n=!1;const o=this.files.get(e);if(o?.isResolved())n=await this.doSaveAsTextFile(o,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),n=!0;else{const r=this.modelService.getModel(e);r&&(n=await this.doSaveAsTextFile(r,e,t,i))}if(n){try{await this.revert(e)}catch(r){this.logService.error(r)}return t}}async doSaveAsTextFile(e,t,i,n){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===EW.FILE_IS_BINARY||u.fileOperationResult===Qi.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,n);throw u}}let l;if(e instanceof lee&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,x8(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof oI?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,u6(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Ca&&f===Ca&&h.setLanguage(u);const p=this.codeEditorService.getTransientModelProperties(d);if(p)for(const[m,v]of p)this.codeEditorService.setTransientModelProperty(h,m,v)}return n?.source||(n={...n,source:a?KQ.TEXTFILE_SAVE_REPLACE_SOURCE:KQ.TEXTFILE_SAVE_CREATE_SOURCE}),c.save({...n,from:t})}async confirmOverwrite(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(4406,"'{0}' already exists. Do you want to replace it?",_i(e)),detail:g(4407,"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",_i(e),_i(Lr(e))),primaryButton:g(4408,"&&Replace")});return t}async confirmMakeWriteable(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(4409,"'{0}' is marked as read-only. Do you want to save anyway?",_i(e)),detail:g(4410,"Paths can be configured as read-only via settings."),primaryButton:g(4411,"&&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 n;if(e.scheme===pe.untitled){const o=this.untitled.get(e);if(o){if(o.hasAssociatedFilePath)return x8(e,t,this.pathService.defaultUriScheme);let r;await this.pathService.hasValidBasename(Pt(i,o.name),o.name)?r=o.name:r=_i(e);const a=o.getLanguageId();a&&a!==Ca?n=this.suggestFilename(a,r):n=r}}return n||(n=_i(e)),Pt(i,n)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const n=Gy(t),o=this.languageService.getExtensions(e);if(o.includes(n))return t;const r=lm(o);if(r)return n?`${t.substring(0,t.indexOf(n))}${r}`:`${t}${r}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:lm(a)??t}async revert(e,t){if(e.scheme===pe.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===pe.untitled?this.untitled.get(e):this.files.get(e);return t?t.isDirty():!1}},KQ=bk,bk.TEXTFILE_SAVE_CREATE_SOURCE=PJ.registerSource("textFileCreate.source",g(4399,"File Created")),bk.TEXTFILE_SAVE_REPLACE_SOURCE=PJ.registerSource("textFileOverwrite.source",g(4400,"File Replaced")),bk);rAe=KQ=D([_(0,Jt),_(1,W6),_(2,ig),_(3,we),_(4,gi),_(5,Jr),_(6,to),_(7,ag),_(8,Ec),_(9,_d),_(10,Kt),_(11,bf),_(12,zb),_(13,ks),_(14,xi),_(15,Ge),_(16,F6),_(17,iE)],rAe);let aAe=class extends V{get encodingOverrides(){return this._encodingOverrides}set encodingOverrides(e){this._encodingOverrides=e}constructor(e,t,i,n){super(),this.textResourceConfigurationService=e,this.environmentService=t,this.contextService=i,this.uriIdentityService=n,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:Wd}),e.push({extension:xb,encoding:Wd}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Wd}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:Pt(t.uri,".vscode"),encoding:Wd})}),e}async getWriteEncoding(e,t){const{encoding:i,hasBOM:n}=await this.getPreferredWriteEncoding(e,t?t.encoding:void 0);return{encoding:i,addBOM:n}}async getPreferredWriteEncoding(e,t){const i=await this.getEncodingForResource(e,t);return{encoding:i,hasBOM:i===ZM||i===eN||i===fS}}async getPreferredReadEncoding(e,t,i){let n;t?.encoding?i===fS&&t.encoding===Wd?n=fS:n=t.encoding:typeof i=="string"?n=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===fS&&(n=Wd);const o=await this.getEncodingForResource(e,n);return{encoding:o,hasBOM:o===ZM||o===eN||o===fS}}async getEncodingForResource(e,t){let i;const n=this.getEncodingOverride(e);return n?i=n:t?i=t:i=this.textResourceConfigurationService.getValue(e,"files.encoding"),i!==Wd&&(!i||!await m8t(i))&&(i=Wd),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&&vU(e)===`.${t.extension}`)return t.encoding}}};aAe=D([_(0,Ec),_(1,Jr),_(2,yi),_(3,ks)],aAe);let cAe=class extends rAe{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,b,v,w),this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>e.veto(this.onBeforeShutdown(),"veto.textFiles")))}onBeforeShutdown(){return!!this.files.models.some(e=>e.hasState(gh.PENDING_SAVE))}};cAe=D([_(0,Jt),_(1,W6),_(2,ig),_(3,we),_(4,gi),_(5,Jr),_(6,to),_(7,ag),_(8,Ec),_(9,_d),_(10,Kt),_(11,bf),_(12,zb),_(13,ks),_(14,xi),_(15,F6),_(16,Ge),_(17,iE)],cAe);var iw,FR;let lAe=(FR=class extends V{constructor(e,t,i,n){super(),this.getExpression=e,this.shouldUpdate=t,this.contextService=i,this.configurationService=n,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||!Ys(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,j_(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new Dk(this.contextService.getWorkspace().folders.map(r=>r.uri));for(const[r]of this.mapFolderToConfiguredExpression)r!==iw.NO_FOLDER&&(i.has(N.parse(r))||(this.mapFolderToParsedExpression.delete(r),this.mapFolderToConfiguredExpression.delete(r),t=!0));const n=this.doGetExpression(void 0),o=this.mapFolderToConfiguredExpression.get(iw.NO_FOLDER);n?(!o||!Ys(o.expression,n.expression))&&(t=!0,this.mapFolderToParsedExpression.set(iw.NO_FOLDER,j_(n.expression)),this.mapFolderToConfiguredExpression.set(iw.NO_FOLDER,n)):o&&(t=!0,this.mapFolderToParsedExpression.delete(iw.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(iw.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 n=!1;const o=Object.create(null);for(const r of i){n||(n=pM(r));let a=r;const c=Alt(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}o[a]=t[r]}return{expression:o,hasAbsolutePath:n}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let n,o;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(n=this.mapFolderToParsedExpression.get(i.uri.toString()),o=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(n=this.mapFolderToParsedExpression.get(iw.NO_FOLDER),o=this.mapFolderToConfiguredExpression.get(iw.NO_FOLDER)),!n)return!1;let r;return i?r=DN(i.uri,e):r=this.uriToPath(e),typeof r=="string"&&n(r,void 0,t)?!0:r!==this.uriToPath(e)&&o?.hasAbsolutePath?!!n(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===pe.file?e.fsPath:e.path}},iw=FR,FR.NO_FOLDER=null,FR);lAe=iw=D([_(2,yi),_(3,Te)],lAe);var Av;const E8t=new Q("autoSaveAfterShortDelayContext",!1,!0);var rc;(function(s){s[s.OFF=0]="OFF",s[s.AFTER_SHORT_DELAY=1]="AFTER_SHORT_DELAY",s[s.AFTER_LONG_DELAY=2]="AFTER_LONG_DELAY",s[s.ON_FOCUS_CHANGE=3]="ON_FOCUS_CHANGE",s[s.ON_WINDOW_CHANGE=4]="ON_WINDOW_CHANGE"})(rc||(rc={}));var Bg;(function(s){s[s.SETTINGS=1]="SETTINGS",s[s.OUT_OF_WORKSPACE=2]="OUT_OF_WORKSPACE",s[s.ERRORS=3]="ERRORS",s[s.DISABLED=4]="DISABLED"})(Bg||(Bg={}));var jS;let dAe=(jS=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=n,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 um(1e3),this.autoSaveDisabledOverrides=new ui,this.autoSaveAfterShortDelayContext=E8t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new hpe(()=>this.createReadonlyMatcher(oje))),this.readonlyExcludeMatcher=this._register(new hpe(()=>this.createReadonlyMatcher(rje))),this.sessionReadonlyOverrides=new ui(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||Eu.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new lAe(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&&QSt(i))return i.readOnlyMessage??Av.READONLY_MESSAGES.providerReadonly;const n=this.sessionReadonlyOverrides.get(e);return typeof n=="boolean"?n===!0?Av.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:Av.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?Av.READONLY_MESSAGES.fileLocked:t?.readonly?Av.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===rc.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Ys(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const n=e?.files?.hotExit;n===Eu.OFF||n===Eu.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=n:this.currentHotExitConfiguration=Eu.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,n,o,r,a,c;switch(t?.autoSave??Av.DEFAULT_AUTO_SAVE_MODE){case tl.AFTER_DELAY:{i="afterDelay",n=typeof t?.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:Av.DEFAULT_AUTO_SAVE_DELAY,c=n<=Av.DEFAULT_AUTO_SAVE_DELAY;break}case tl.ON_FOCUS_CHANGE:i="onFocusChange";break;case tl.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:n,autoSaveWorkspaceFilesOnly:o,autoSaveWhenNoErrors:r,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof Ob?Na.getOriginalUri(e,{supportSideBySide:Hs.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:rc.OFF,reason:Bg.DISABLED};const n=this.getAutoSaveConfiguration(i);if(typeof n.autoSave>"u")return{mode:rc.OFF,reason:Bg.SETTINGS};if(typeof t=="number"&&(n.autoSave==="afterDelay"&&t!==Cn.AUTO||n.autoSave==="onFocusChange"&&t!==Cn.FOCUS_CHANGE&&t!==Cn.WINDOW_CHANGE||n.autoSave==="onWindowChange"&&t!==Cn.WINDOW_CHANGE))return{mode:rc.OFF,reason:Bg.SETTINGS};if(i){if(n.autoSaveWorkspaceFilesOnly&&n.isOutOfWorkspace)return{mode:rc.OFF,reason:Bg.OUT_OF_WORKSPACE};if(n.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Ws.Error}).length>0)return{mode:rc.OFF,reason:Bg.ERRORS}}switch(n.autoSave){case"afterDelay":return typeof n.autoSaveDelay=="number"&&n.autoSaveDelay<=Av.DEFAULT_AUTO_SAVE_DELAY?{mode:n.autoSaveWhenNoErrors?rc.AFTER_LONG_DELAY:rc.AFTER_SHORT_DELAY}:{mode:rc.AFTER_LONG_DELAY};case"onFocusChange":return{mode:rc.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:rc.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[tl.AFTER_DELAY,tl.ON_FOCUS_CHANGE,tl.ON_WINDOW_CHANGE].some(i=>i===e)?t=tl.OFF:t=tl.AFTER_DELAY,this.configurationService.updateValue("files.autoSave",t)}disableAutoSave(e){const t=this.toResource(e);if(!t)return V.None;const i=this.autoSaveDisabledOverrides.get(t)??0;return this.autoSaveDisabledOverrides.set(t,i+1),i===0&&this._onDidChangeAutoSaveDisabled.fire(t),Ee(()=>{const n=this.autoSaveDisabledOverrides.get(t)??0;n<=1?(this.autoSaveDisabledOverrides.delete(t),this._onDidChangeAutoSaveDisabled.fire(t)):this.autoSaveDisabledOverrides.set(t,n-1)})}get isHotExitEnabled(){return this.contextService.getWorkspace().transient?!1:this.currentHotExitConfiguration!==Eu.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},Av=jS,jS.DEFAULT_AUTO_SAVE_MODE=Wn?tl.AFTER_DELAY:tl.OFF,jS.DEFAULT_AUTO_SAVE_DELAY=1e3,jS.READONLY_MESSAGES={providerReadonly:{value:g(615,"Editor is read-only because the file system of the file is read-only."),isTrusted:!0},sessionReadonly:{value:g(616,"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(617,"Editor is read-only because the file was set read-only via settings. [Click here](command:{0}) to configure or [toggle for this session](command:{1}).",`workbench.action.openSettings?${encodeURIComponent('["files.readonly"]')}`,"workbench.action.files.toggleActiveEditorReadonlyInSession"),isTrusted:!0},fileLocked:{value:g(618,"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(619,"Editor is read-only because the file is read-only."),isTrusted:!0}},jS);dAe=Av=D([_(0,Le),_(1,Te),_(2,yi),_(3,Za),_(4,ks),_(5,Jt),_(6,Am),_(7,Ec)],dAe);class x8t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const PNe=Qe.as(Nn.Configuration),D8t=ad?{type:"string",scope:at.APPLICATION,enum:[Eu.OFF,Eu.ON_EXIT,Eu.ON_EXIT_AND_WINDOW_CLOSE],default:Eu.ON_EXIT,markdownEnumDescriptions:[g(620,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(621,"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(622,"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(623,"[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.",Eu.ON_EXIT,Eu.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:at.APPLICATION,enum:[Eu.OFF,Eu.ON_EXIT_AND_WINDOW_CLOSE],default:Eu.ON_EXIT_AND_WINDOW_CLOSE,markdownEnumDescriptions:[g(620,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(624,"Hot exit will be triggered when the browser quits or the window or tab is closed.")],markdownDescription:g(623,"[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.",Eu.ON_EXIT,Eu.ON_EXIT_AND_WINDOW_CLOSE)};PNe.registerConfiguration({id:"files",order:9,title:g(625,"Files"),type:"object",properties:{[jSt]:{type:"object",markdownDescription:g(626,"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,...Wn?{"**/*.crswap":!0}:void 0},scope:at.RESOURCE,additionalProperties:{anyOf:[{type:"boolean",enum:[!0,!1],enumDescriptions:[g(627,"Enable the pattern."),g(628,"Disable the pattern.")],description:g(629,"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(630,"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.")}}}]}},[NLe]:{type:"object",markdownDescription:g(631,'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(sx),default:"utf8",description:g(632,"The default character set encoding to use when reading and writing files. This setting can also be configured per language."),scope:at.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(sx).map(s=>sx[s].labelLong),enumItemLabels:Object.keys(sx).map(s=>sx[s].labelLong)},"files.autoGuessEncoding":{type:"boolean",default:!1,markdownDescription:g(633,"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:at.LANGUAGE_OVERRIDABLE},"files.candidateGuessEncodings":{type:"array",items:{type:"string",enum:Object.keys(GQ),enumDescriptions:Object.keys(GQ).map(s=>GQ[s].labelLong)},default:[],markdownDescription:g(634,"List of character set encodings that the editor should attempt to guess in the order they are listed. In case it cannot be determined, {0} is respected","`#files.encoding#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` +- `),TK.registerConfiguration({...bXe,properties:{"window.title":{type:"string",default:sit,markdownDescription:e},"window.titleSeparator":{type:"string",default:oit,markdownDescription:g(1081,"Separator used by {0}.","`#window.title#`")},[Qp.COMMAND_CENTER]:{type:"boolean",default:!0,markdownDescription:Wn?g(1082,"Show command launcher together with the window title."):g(1083,"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(1084,"Menu is displayed at the top of the window and only hidden in full screen mode."),g(1085,"Menu is always visible at the top of the window even in full screen mode."),Qt?g(1086,"Menu is hidden but can be displayed at the top of the window by executing the `Focus Application Menu` command."):g(1087,"Menu is hidden but can be displayed at the top of the window via the Alt key."),g(1088,"Menu is always hidden."),Wn?g(1089,"Menu is displayed as a compact button in the side bar."):g(1090,"Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1}.","`#window.titleBarStyle#`","`native`")],default:Wn?"compact":"classic",scope:at.APPLICATION,markdownDescription:Qt?g(1091,"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(1092,"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:Qn||pr||Wn},"window.enableMenuBarMnemonics":{type:"boolean",default:!0,scope:at.APPLICATION,description:g(1093,"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:Qn||pr},"window.customMenuBarAltFocus":{type:"boolean",default:!0,scope:at.APPLICATION,markdownDescription:g(1094,"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:Qn||pr},"window.openFilesInNewWindow":{type:"string",enum:["on","off","default"],enumDescriptions:[g(1095,"Files will open in a new window."),g(1096,"Files will open in the window with the files' folder open or the last active window."),Qt?g(1097,"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(1098,"Files will open in a new window unless picked from within the application (e.g. via the File menu).")],default:"off",scope:at.APPLICATION,markdownDescription:g(Qt?1099:1100,"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(1101,"Folders will open in a new window."),g(1102,"Folders will replace the last active window."),g(1103,"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:at.APPLICATION,markdownDescription:g(1104,"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:[Wn?g(1105,"Always try to ask for confirmation. Note that browsers may still decide to close a tab or window without confirmation."):g(1106,"Always ask for confirmation."),Wn?g(1107,"Only ask for confirmation if a keybinding was used to close the window. Note that detection may not be possible in some cases."):g(1108,"Only ask for confirmation if a keybinding was used."),Wn?g(1109,"Never explicitly ask for confirmation unless data loss is imminent."):g(1110,"Never explicitly ask for confirmation.")],default:Wn&&!uGe()?"keyboardOnly":"never",markdownDescription:Wn?g(1111,"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(1112,"Controls whether to show a confirmation dialog before closing a window or quitting the application."),scope:at.APPLICATION}}}),Ku(jJ.ID,jJ,yc.Eventually),TK.registerConfiguration({...ERt,properties:{"problems.visibility":{type:"boolean",default:!0,description:g(1113,"Controls whether the problems are visible throughout the editor and workbench.")}}}),TK.registerConfiguration({id:"zenMode",order:9,title:g(1114,"Zen Mode"),type:"object",properties:{"zenMode.fullScreen":{type:"boolean",default:!0,description:g(1115,"Controls whether turning on Zen Mode also puts the workbench into full screen mode.")},"zenMode.centerLayout":{type:"boolean",default:!0,description:g(1116,"Controls whether turning on Zen Mode also centers the layout.")},"zenMode.showTabs":{type:"string",enum:["multiple","single","none"],description:g(1117,"Controls whether turning on Zen Mode should show multiple editor tabs, a single editor tab, or hide the editor title area completely."),enumDescriptions:[g(1118,"Each editor is displayed as a tab in the editor title area."),g(1119,"The active editor is displayed as a single large tab in the editor title area."),g(1120,"The editor title area is not displayed.")],default:"multiple"},"zenMode.hideStatusBar":{type:"boolean",default:!0,description:g(1121,"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(1122,"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(1123,"Controls whether turning on Zen Mode also hides the editor line numbers.")},"zenMode.restore":{type:"boolean",default:!0,description:g(1124,"Controls whether a window should restore to Zen Mode if it was exited in Zen Mode.")},"zenMode.silentNotifications":{type:"boolean",default:!0,description:g(1125,"Controls whether notifications do not disturb mode should be enabled while in Zen Mode. If true, only error notifications will pop out.")}}})})();Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.activityBar.visible",migrateFn:s=>{const e=[];return s!==void 0&&e.push(["workbench.activityBar.visible",{value:void 0}]),s===!1&&e.push([Qp.ACTIVITY_BAR_LOCATION,{value:nee.HIDDEN}]),e}}]);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:Qp.ACTIVITY_BAR_LOCATION,migrateFn:s=>{const e=[];return s==="side"&&e.push([Qp.ACTIVITY_BAR_LOCATION,{value:nee.DEFAULT}]),e}}]);Qe.as(Tm.ConfigurationMigration).registerConfigurationMigrations([{key:"workbench.editor.doubleClickTabToToggleEditorGroupSizes",migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?"expand":"off",e.push(["workbench.editor.doubleClickTabToToggleEditorGroupSizes",{value:s}])),e}},{key:Qp.EDITOR_TABS_MODE,migrateFn:s=>{const e=[];return typeof s=="boolean"&&(s=s?LT.MULTIPLE:LT.SINGLE,e.push([Qp.EDITOR_TABS_MODE,{value:s}])),e}},{key:"workbench.editor.tabCloseButton",migrateFn:s=>{const e=[];return s==="left"||s==="right"?e.push(["workbench.editor.tabActionLocation",{value:s}]):s==="off"&&e.push(["workbench.editor.tabActionCloseVisibility",{value:!1}]),e}},{key:"zenMode.hideTabs",migrateFn:s=>{const e=[["zenMode.hideTabs",{value:void 0}]];return s===!0&&e.push(["zenMode.showTabs",{value:"single"}]),e}}]);let rit=()=>!1,ait=(s,e)=>!1;const Hzt=QM.prototype.getCommandPicks;QM.prototype.getCommandPicks=async function(s){let e=await Hzt.call(this,s);return rit()||(e=e.map(t=>({...t,buttons:void 0}))),e};let qSe=class{constructor(e){this.instantiationService=e,this.workbenchQuickInputService=e.createInstance(Vye)}get activeService(){const e=Dt.get(Kt).getFocusedCodeEditor();return e==null||ait(e,e instanceof Gk)?this.workbenchQuickInputService:(this.standaloneQuickInputService??(this.standaloneQuickInputService=this.instantiationService.createInstance(E3)),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=He.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()}};qSe=D([_(0,we)],qSe);function Uzt({isKeybindingConfigurationVisible:s,shouldUseGlobalPicker:e}={}){return s!=null&&(rit=s),e!=null&&(ait=e),{[In.toString()]:new wi(qSe,[],!0)}}async function Vzt(s,e,t,i,n,o){let r;try{await zzt(s,e,t,i,n,o)}catch(a){r=a}finally{r&&n.errorTransformer&&(r=n.errorTransformer(r)),typeof r<"u"&&t.error(r),t.end()}}async function zzt(s,e,t,i,n,o){fue(o);const r=await s.open(e,{create:!1});try{fue(o);let a=0,c=0,l=n&&typeof n.length=="number"?n.length:void 0,d=$e.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),h=n&&typeof n.position=="number"?n.position:0,u=0;do c=await s.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=$e.alloc(Math.min(n.bufferSize,typeof l=="number"?l:n.bufferSize)),u=0);while(c>0&&(typeof l!="number"||l>0)&&fue(o)&&$zt(a,n));if(u>0){let f=u;typeof l=="number"&&(f=Math.min(u,l)),t.write(i(d.slice(0,f)))}}catch(a){throw t0(a)}finally{await s.close(r)}}function fue(s){if(s.isCancellationRequested)throw Sy();return!0}function $zt(s,e){if(typeof e?.limits?.size=="number"&&s>e.limits.size)throw us(g(4398,"File is too large to open"),ot.FileTooLarge);return!0}var QSe;function cit(s){return s.scheme===pe.file?s.fsPath:s.toString(!0)}async function lit(s,e,t){const i=[];for(;!s.isEqual(t,s.dirname(t));)try{if(!((await e.stat(t)).type&sn.Directory))throw new Error(g(581,"Unable to create folder '{0}' that already exists but is not a directory",cit(t)));break}catch(n){if(Ok(n)!==ot.FileNotFound)throw n;i.push(s.basename(t)),t=s.dirname(t)}for(let n=i.length-1;n>=0;n--){t=s.joinPath(t,i[n]);try{await e.mkdir(t)}catch(o){if(Ok(o)!==ot.FileExists)throw o}}}var LR;let jSe=(LR=class extends V{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 K1e)}registerProvider(e,t){if(this.provider.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);cs(`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(n=>{const o=new UY(n,!this.isPathCaseSensitive(t));this.internalOnDidFilesChange.fire(o),o.hasCorrelation()||this._onDidUncorrelatedFilesChange.fire(o)})),typeof t.onDidWatchError=="function"&&i.add(t.onDidWatchError(n=>this._onDidWatchError.fire(new Error(n)))),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),bt(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 Zs.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 hi.map(this.provider,([e,t])=>({scheme:e,capabilities:t.capabilities}))}async withProvider(e){if(!bGe(e))throw new kd(g(582,"Unable to resolve filesystem provider with relative file path '{0}'",this.resourceForError(e)),Qi.FILE_INVALID_PATH);await this.activateProvider(e.scheme);const t=this.provider.get(e.scheme);if(!t){const i=new La;throw i.message=g(583,"ENOPRO: No file system provider found for resource '{0}'",e.toString()),i}return t}async withReadProvider(e){const t=await this.withProvider(e);if(cE(t)||Hm(t)||Rq(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(cE(t)||Hm(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 Ok(i)===ot.FileNotFound?new kd(g(584,"Unable to resolve nonexistent file '{0}'",this.resourceForError(e)),Qi.FILE_NOT_FOUND):t0(i)}}async doResolveFile(e,t){const i=await this.withProvider(e),n=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=Eh.forUris(()=>!n),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,n,o,r){const{providerExtUri:a}=this.getExtUri(e),c={resource:t,name:a.basename(t),isFile:(i.type&sn.File)!==0,isDirectory:(i.type&sn.Directory)!==0,isSymbolicLink:(i.type&sn.SymbolicLink)!==0,mtime:i.mtime,ctime:i.ctime,size:i.size,readonly:!!((i.permissions??0)&rp.Readonly)||!!(e.capabilities&Vn.Readonly),locked:!!((i.permissions??0)&rp.Locked),etag:VY({mtime:i.mtime,size:i.size}),children:void 0};if(c.isDirectory&&r(c,n)){try{const l=await e.readdir(t),d=await Zs.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=Fi(d)}catch(l){this.logService.trace(l),c.children=[]}return c}return c}async resolveAll(e){return Zs.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 kd(g(585,"Unable to create file '{0}' that already exists when overwrite flag is not set",this.resourceForError(e)),Qi.FILE_MODIFIED_SINCE,t)}async createFile(e,t=$e.fromString(""),i){await this.doValidateCreateFile(e,i);const n=await this.writeFile(e,t);return this._onDidRunOperation.fire(new lP(e,Ai.CREATE,n)),n}async writeFile(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),{providerExtUri:o}=this.getExtUri(n);let r=i;if(p2e(n)&&!r?.atomic){const a=n.enforceAtomicWriteFile?.(e);a&&(r={...i,atomic:a})}try{await this.validateWriteFile(n,e,r)||await this.mkdirp(n,o.dirname(e));let c;if(Hm(n)&&!(t instanceof $e))if(_q(t)){const l=await _ht(t,3);l.ended?c=$e.concat(l.buffer):c=l}else c=mht(t,l=>$e.concat(l),3);else c=t;!cE(n)||Hm(n)&&c instanceof $e||Hm(n)&&p2e(n)&&r?.atomic?await this.doWriteUnbuffered(n,e,r,c):await this.doWriteBuffered(n,e,r,c instanceof $e?eKe(c):c),this._onDidRunOperation.fire(new lP(e,Ai.WRITE))}catch(a){throw new kd(g(586,"Unable to write file '{0}' ({1})",this.resourceForError(e),t0(a).toString()),Uw(a),r)}return this.resolve(e,{resolveMetadata:!0})}async validateWriteFile(e,t,i){const n=!!i?.unlock;if(n&&!(e.capabilities&Vn.FileWriteUnlock))throw new Error(g(587,"Unable to unlock file '{0}' because provider does not support it.",this.resourceForError(t)));if(!!i?.atomic){if(!(e.capabilities&Vn.FileAtomicWrite))throw new Error(g(588,"Unable to atomically write file '{0}' because provider does not support it.",this.resourceForError(t)));if(!(e.capabilities&Vn.FileReadWrite))throw new Error(g(589,"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",this.resourceForError(t)));if(n)throw new Error(g(590,"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&sn.Directory)throw new kd(g(591,"Unable to write file '{0}' that is actually a directory",this.resourceForError(t)),Qi.FILE_IS_DIRECTORY,i);if(this.throwIfFileIsReadonly(t,r),typeof i?.mtime=="number"&&typeof i.etag=="string"&&i.etag!==w_&&typeof r.mtime=="number"&&typeof r.size=="number"&&i.mtime{this.writeQueue.queueFor(t,async()=>{try{const a=await this.doReadFile(e,t,i,n);o(a)}catch(a){r(a)}},this.getExtUri(e).providerExtUri)})}async doReadFile(e,t,i,n){const o=await this.doReadFileStream(e,t,{...i,preferUnbuffered:!0},n);return{...o,value:await Jx(o.value)}}async readFileStream(e,t,i){const n=await this.withReadProvider(e);return this.doReadFileStream(n,e,t,i)}async doReadFileStream(e,t,i,n){const o=new ci(n);let r=i;fhe(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!==w_&&await a,r?.atomic&&fhe(e)||!(cE(e)||Rq(e))||Hm(e)&&r?.preferUnbuffered?c=this.readFileUnbuffered(e,t,r):Rq(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 nTe(c),this.restoreReadError(l,t,r)}}restoreReadError(e,t,i){const n=g(593,"Unable to read file '{0}' ({1})",this.resourceForError(t),t0(e).toString());return e instanceof b5?new b5(n,e.stat,i):e instanceof Mq?new Mq(n,e.fileOperationResult,e.size,e.options):new kd(n,Uw(e),i)}readFileStreamed(e,t,i,n=Object.create(null)){const o=e.readFileStream(t,n,i);return wht(o,{data:r=>r instanceof $e?r:$e.wrap(r),error:r=>this.restoreReadError(r,t,n)},r=>$e.concat(r))}readFileBuffered(e,t,i,n=Object.create(null)){const o=tKe();return Vzt(e,t,o,r=>r,{...n,bufferSize:this.BUFFER_SIZE,errorTransformer:r=>this.restoreReadError(r,t,n)},i),o}readFileUnbuffered(e,t,i){const n=qA(o=>$e.concat(o));return(async()=>{try{let o;i?.atomic&&fhe(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),n.end($e.wrap(o))}catch(o){n.error(o),n.end()}})(),n}async validateReadFile(e,t){const i=await this.resolve(e,{resolveMetadata:!0});if(i.isDirectory)throw new kd(g(594,"Unable to read file '{0}' that is actually a directory",this.resourceForError(e)),Qi.FILE_IS_DIRECTORY,t);if(typeof t?.etag=="string"&&t.etag!==w_&&t.etag===i.etag)throw new b5(g(595,"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 Mq(g(596,"Unable to read file '{0}' that is too large to open",this.resourceForError(e)),Qi.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,n){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,n)}catch(o){return o}return!0}async move(e,t,i){const n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(e),e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(n,e,o,t,"move",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new lP(e,r==="move"?Ai.MOVE:Ai.COPY,a)),a}async copy(e,t,i){const n=await this.withReadProvider(e),o=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),r=await this.doMoveCopy(n,e,o,t,"copy",!!i),a=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new lP(e,r==="copy"?Ai.COPY:Ai.MOVE,a)),a}async doMoveCopy(e,t,i,n,o,r){if(t.toString()===n.toString())return o;const{exists:a,isSameResourceWithDifferentPathCase:c}=await this.doValidateMoveCopy(e,t,i,n,o,r);if(a&&!c&&r&&await this.del(n,{recursive:!0}),await this.mkdirp(i,this.getExtUri(i).providerExtUri.dirname(n)),o==="copy"){if(e===i&&f2e(e))await e.copy(t,n,{overwrite:r});else{const l=await this.resolve(t);l.isDirectory?await this.doCopyFolder(e,l,i,n):await this.doCopyFile(e,t,i,n)}return o}else return e===i?(await e.rename(t,n,{overwrite:r}),o):(await this.doMoveCopy(e,t,i,n,"copy",r),await this.del(t,{recursive:!0}),"copy")}async doCopyFile(e,t,i,n){if(cE(e)&&cE(i))return this.doPipeBuffered(e,t,i,n);if(cE(e)&&Hm(i))return this.doPipeBufferedToUnbuffered(e,t,i,n);if(Hm(e)&&cE(i))return this.doPipeUnbufferedToBuffered(e,t,i,n);if(Hm(e)&&Hm(i))return this.doPipeUnbuffered(e,t,i,n)}async doCopyFolder(e,t,i,n){await i.mkdir(n),Array.isArray(t.children)&&await Zs.settled(t.children.map(async o=>{const r=this.getExtUri(i).providerExtUri.joinPath(n,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,n,o,r){let a=!1;if(e===i){const{providerExtUri:l,isPathCaseSensitive:d}=this.getExtUri(e);if(d||(a=l.isEqual(t,n)),a&&o==="copy")throw new Error(g(597,"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(n)));if(!a&&l.isEqualOrParent(n,t))throw new Error(g(598,"Unable to move/copy when source '{0}' is parent of target '{1}'.",this.resourceForError(t),this.resourceForError(n)))}const c=await this.exists(n);if(c&&!a){if(!r)throw new kd(g(599,"Unable to move/copy '{0}' because target '{1}' already exists at destination.",this.resourceForError(t),this.resourceForError(n)),Qi.FILE_MOVE_CONFLICT);if(e===i){const{providerExtUri:l}=this.getExtUri(e);if(l.isEqualOrParent(t,n))throw new Error(g(600,"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",this.resourceForError(t),this.resourceForError(n)))}}return{exists:c,isSameResourceWithDifferentPathCase:a}}getExtUri(e){const t=this.isPathCaseSensitive(e);return{providerExtUri:t?xn:kre,isPathCaseSensitive:t}}isPathCaseSensitive(e){return!!(e.capabilities&Vn.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 lP(e,Ai.CREATE,i)),i}async mkdirp(e,t){const{providerExtUri:i}=this.getExtUri(e);return lit(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),n=!!t?.useTrash;if(n&&!(i.capabilities&Vn.Trash))throw new Error(g(601,"Unable to delete file '{0}' via trash because provider does not support it.",this.resourceForError(e)));const o=t?.atomic;if(o&&!(i.capabilities&Vn.FileAtomicDelete))throw new Error(g(602,"Unable to delete file '{0}' atomically because provider does not support it.",this.resourceForError(e)));if(n&&o)throw new Error(g(603,"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 kd(g(604,"Unable to delete nonexistent file '{0}'",this.resourceForError(e)),Qi.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(605,"Unable to delete non-empty folder '{0}'.",this.resourceForError(e)))}return i}async del(e,t){const i=await this.doValidateDelete(e,t);let n=t;if(FSt(i)&&!n?.atomic){const c=i.enforceAtomicDelete?.(e);c&&(n={...t,atomic:c})}const o=!!n?.useTrash,r=!!n?.recursive,a=n?.atomic??!1;await i.delete(e,{recursive:r,useTrash:o,atomic:a}),this._onDidRunOperation.fire(new lP(e,Ai.DELETE))}async cloneFile(e,t){const i=await this.withProvider(e),n=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t);if(!(i===n&&this.getExtUri(i).providerExtUri.isEqual(e,t)))return i===n&&PSt(i)?i.cloneFile(e,t):(await this.mkdirp(n,this.getExtUri(n).providerExtUri.dirname(t)),i===n&&f2e(i)?this.writeQueue.queueFor(e,()=>i.copy(e,t,{overwrite:!0}),this.getExtUri(i).providerExtUri):this.writeQueue.queueFor(e,()=>this.doCopyFile(i,e,n,t),this.getExtUri(i).providerExtUri))}createWatcher(e,t){return this.watch(e,{...t,correlationId:QSe.WATCHER_CORRELATION_IDS++})}watch(e,t={recursive:!1,excludes:[]}){const i=new Z;let n=!1,o=()=>{n=!0};i.add(Ee(()=>o())),(async()=>{try{const a=await this.doWatch(e,t);n?bt(a):o=()=>bt(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),n=Wc([this.getExtUri(i).providerExtUri.getComparisonKey(e),t]);let o=this.activeWatchers.get(n);return o||(o={count:0,disposable:i.watch(e,t)},this.activeWatchers.set(n,o)),o.count+=1,Ee(()=>{o&&(o.count--,o.count===0&&(bt(o.disposable),this.activeWatchers.delete(n)))})}dispose(){super.dispose();for(const[,e]of this.activeWatchers)bt(e.disposable);this.activeWatchers.clear()}async doWriteBuffered(e,t,i,n){return this.writeQueue.queueFor(t,async()=>{const o=await e.open(t,{create:!0,unlock:i?.unlock??!1});try{_q(n)||Cde(n)?await this.doWriteStreamBufferedQueued(e,o,n):await this.doWriteReadableBufferedQueued(e,o,n)}catch(r){throw t0(r)}finally{await e.close(o)}},this.getExtUri(e).providerExtUri)}async doWriteStreamBufferedQueued(e,t,i){let n=0,o;if(Cde(i)){if(i.buffer.length>0){const r=$e.concat(i.buffer);await this.doWriteBuffer(e,t,r,r.byteLength,n,0),n+=r.byteLength}if(i.ended)return;o=i.stream}else o=i;return new Promise((r,a)=>{AN(o,{onData:async c=>{o.pause();try{await this.doWriteBuffer(e,t,c,c.byteLength,n,0)}catch(l){return a(l)}n+=c.byteLength,setTimeout(()=>o.resume())},onError:c=>a(c),onEnd:()=>r()})})}async doWriteReadableBufferedQueued(e,t,i){let n=0,o;for(;(o=i.read())!==null;)await this.doWriteBuffer(e,t,o,o.byteLength,n,0),n+=o.byteLength}async doWriteBuffer(e,t,i,n,o,r){let a=0;for(;athis.doWriteUnbufferedQueued(e,t,i,n),this.getExtUri(e).providerExtUri)}async doWriteUnbufferedQueued(e,t,i,n){let o;n instanceof $e?o=n:_q(n)?o=await Jx(n):Cde(n)?o=await kht(n):o=Dht(n),await e.writeFile(t,o.buffer,{create:!0,overwrite:!0,unlock:i?.unlock??!1,atomic:i?.atomic??!1})}async doPipeBuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeBufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeBufferedQueued(e,t,i,n){let o,r;try{o=await e.open(t,{create:!1}),r=await i.open(n,{create:!0,unlock:!1});const a=$e.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 t0(a)}finally{await Zs.settled([typeof o=="number"?e.close(o):Promise.resolve(),typeof r=="number"?i.close(r):Promise.resolve()])}}async doPipeUnbuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeUnbufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedQueued(e,t,i,n){return i.writeFile(n,await e.readFile(t),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(e,t,i,n){return this.writeQueue.queueFor(n,()=>this.doPipeUnbufferedToBufferedQueued(e,t,i,n),this.getExtUri(i).providerExtUri)}async doPipeUnbufferedToBufferedQueued(e,t,i,n){const o=await i.open(n,{create:!0,unlock:!1});try{const r=await e.readFile(t);await this.doWriteBuffer(i,o,$e.wrap(r),r.byteLength,0,0)}catch(r){throw t0(r)}finally{await i.close(o)}}async doPipeBufferedToUnbuffered(e,t,i,n){const o=await Jx(this.readFileBuffered(e,t,He.None));await this.doWriteUnbuffered(i,n,void 0,o)}throwIfFileSystemIsReadonly(e,t){if(e.capabilities&Vn.Readonly)throw new kd(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(t)),Qi.FILE_PERMISSION_DENIED);return e}throwIfFileIsReadonly(e,t){if((t.permissions??0)&rp.Readonly)throw new kd(g(606,"Unable to modify read-only file '{0}'",this.resourceForError(e)),Qi.FILE_PERMISSION_DENIED)}resourceForError(e){return cit(e)}},QSe=LR,LR.WATCHER_CORRELATION_IDS=0,LR);jSe=QSe=D([_(0,Ge)],jSe);class n5e{constructor(e){this.type=sn.File,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e}}class y4{constructor(e){this.type=sn.Directory,this.ctime=Date.now(),this.mtime=Date.now(),this.size=0,this.name=e,this.entries=new Map}}class oee extends V{constructor(){super(...arguments),this.memoryFdCounter=0,this.fdMemory=new Map,this._onDidChangeCapabilities=this._register(new I),this.onDidChangeCapabilities=this._onDidChangeCapabilities.event,this._capabilities=Vn.FileReadWrite|Vn.PathCaseSensitive,this.root=new y4(""),this._onDidChangeFile=this._register(new I),this.onDidChangeFile=this._onDidChangeFile.event,this._bufferedChanges=[]}get capabilities(){return this._capabilities}setReadOnly(e){const t=!!(this._capabilities&Vn.Readonly);e!==t&&(this._capabilities=e?Vn.Readonly|Vn.PathCaseSensitive|Vn.FileReadWrite:Vn.FileReadWrite|Vn.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((n,o)=>i.push([o,n.type])),i}async readFile(e){const t=this._lookupAsFile(e,!1).data;if(t)return t;throw us("file not found",ot.FileNotFound)}readFileStream(e){const t=this._lookupAsFile(e,!1).data,i=qA(n=>$e.concat(n.map(o=>$e.wrap(o))).buffer);return i.end(t),i}async writeFile(e,t,i){const n=_i(e),o=this._lookupParentDirectory(e);let r=o.entries.get(n);if(r instanceof y4)throw us("file is directory",ot.FileIsADirectory);if(!r&&!i.create)throw us("file not found",ot.FileNotFound);if(r&&i.create&&!i.overwrite)throw us("file exists already",ot.FileExists);r||(r=new n5e(n),o.entries.set(n,r),this._fireSoon({type:To.ADDED,resource:e})),r.mtime=Date.now(),r.size=t.byteLength,r.data=t,this._fireSoon({type:To.UPDATED,resource:e})}open(e,t){const i=this._lookupAsFile(e,!1).data;if(i){const n=this.memoryFdCounter++;return this.fdMemory.set(n,i),Promise.resolve(n)}throw us("file not found",ot.FileNotFound)}close(e){return this.fdMemory.delete(e),Promise.resolve()}read(e,t,i,n,o){const r=this.fdMemory.get(e);if(!r)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(r).slice(t,t+o);return i.set(a.buffer,n),Promise.resolve(a.byteLength)}write(e,t,i,n,o){const r=this.fdMemory.get(e);if(!r)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(i).slice(n,n+o);return r.set(a.buffer,t),Promise.resolve(a.byteLength)}async rename(e,t,i){if(!i.overwrite&&this._lookup(t,!0))throw us("file exists already",ot.FileExists);const n=this._lookup(e,!1),o=this._lookupParentDirectory(e),r=this._lookupParentDirectory(t),a=_i(t);o.entries.delete(n.name),n.name=a,r.entries.set(a,n),this._fireSoon({type:To.DELETED,resource:e},{type:To.ADDED,resource:t})}async delete(e,t){const i=Lr(e),n=_i(e),o=this._lookupAsDirectory(i,!1);o.entries.has(n)&&(o.entries.delete(n),o.mtime=Date.now(),o.size-=1,this._fireSoon({type:To.UPDATED,resource:i},{resource:e,type:To.DELETED}))}async mkdir(e){if(this._lookup(e,!0))throw us("file exists already",ot.FileExists);const t=_i(e),i=Lr(e),n=this._lookupAsDirectory(i,!1),o=new y4(t);n.entries.set(o.name,o),n.mtime=Date.now(),n.size+=1,this._fireSoon({type:To.UPDATED,resource:i},{type:To.ADDED,resource:e})}_lookup(e,t){const i=e.path.split("/");let n=this.root;for(const o of i){if(!o)continue;let r;if(n instanceof y4&&(r=n.entries.get(o)),!r){if(t)return;throw us("file not found",ot.FileNotFound)}n=r}return n}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof y4)return i;throw us("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i instanceof n5e)return i;throw us("file is a directory",ot.FileIsADirectory)}_lookupParentDirectory(e){const t=Lr(e);return this._lookupAsDirectory(t,!1)}watch(e,t){return V.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 s5e extends Error{constructor(e){super("Missing stores"),this.db=e}}class YSe extends Error{constructor(e){super(`IndexedDB database '${e}' is closed.`),this.code="DBClosed"}}class j0{static async create(e,t,i){const n=await j0.openDatabase(e,t,i);return new j0(n,e)}static async openDatabase(e,t,i){cs(`code/willOpenDatabase/${e}`);try{return await j0.doOpenDatabase(e,t,i)}catch(n){if(n instanceof s5e){console.info("Attempting to recreate the IndexedDB once.",e);try{await j0.deleteDatabase(n.db)}catch(o){throw console.error("Error while deleting the IndexedDB",nu(o)),o}return await j0.doOpenDatabase(e,t,i)}throw n}finally{cs(`code/didOpenDatabase/${e}`)}}static doOpenDatabase(e,t,i){return new Promise((n,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 s5e(a));return}n(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 n=indexedDB.deleteDatabase(e.name);n.onerror=o=>i(n.error),n.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 YSe(this.name);const n=this.database.transaction(e,t);return this.pendingTransactions.push(n),new Promise((o,r)=>{n.oncomplete=()=>{Array.isArray(a)?o(a.map(c=>c.result)):o(a.result)},n.onerror=()=>r(n.error?La.fromError(n.error):new La("unknown error")),n.onabort=()=>r(n.error?La.fromError(n.error):new La("unknown error"));const a=i(n.objectStore(e))}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(n),1))}async getKeyValues(e,t){if(!this.database)throw new YSe(this.name);const i=this.database.transaction(e,"readonly");return this.pendingTransactions.push(i),new Promise(n=>{const o=new Map,a=i.objectStore(e).openCursor();if(!a)return n(o);a.onsuccess=()=>{a.result?(t(a.result.value)&&o.set(a.result.key.toString(),a.result.value),a.result.continue()):n(o)};const c=l=>{console.error(`IndexedDB getKeyValues(): ${Nr(l,!0)}`),n(o)};a.onerror=()=>c(a.error),i.onerror=()=>c(i.error)}).finally(()=>this.pendingTransactions.splice(this.pendingTransactions.indexOf(i),1))}}const pue=us(g(609,"File does not exist"),ot.FileNotFound),Gzt=us(g(610,"File is Directory"),ot.FileIsADirectory),o5e=us(g(611,"File is not a directory"),ot.FileNotADirectory),Kzt=us(g(612,"Directory is not empty"),ot.Unknown),qzt=us(g(613,"File exceeds available storage quota"),ot.FileExceedsStorageQuota),wv=s=>us(g(614,"Internal error occurred in IndexedDB File System Provider. ({0})",s),ot.Unknown);class j5{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!==sn.Directory)throw wv("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!==sn.Directory)throw wv("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 wv(`Internal error deleting from IndexedDBFSNode -- got no deletion path parts (encountered while deleting ${t})`);if(this.entry.type!==sn.Directory)throw wv("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 wv("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 wv(`Internal error creating IndexedDBFSNode -- adding empty path (encountered while adding ${i})`);if(this.entry.type!==sn.Directory)throw wv(`Internal error creating IndexedDBFSNode -- parent is not a directory (encountered while adding ${i})`);if(e.length===1){const n=e[0],o=this.entry.children.get(n);if(t.type==="dir"){if(o?.entry.type===sn.File)throw wv(`Internal error creating IndexedDBFSNode -- overwriting file with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,o??new j5({type:sn.Directory,path:this.entry.path+"/"+n,children:new Map}))}else{if(o?.entry.type===sn.Directory)throw wv(`Internal error creating IndexedDBFSNode -- overwriting directory with file: ${this.entry.path}/${n} (encountered while adding ${i})`);this.entry.children.set(n,new j5({type:sn.File,path:this.entry.path+"/"+n,size:t.size}))}}else if(e.length>1){const n=e[0];let o=this.entry.children.get(n);if(!o)o=new j5({children:new Map,path:this.entry.path+"/"+n,type:sn.Directory}),this.entry.children.set(n,o);else if(o.type===sn.File)throw wv(`Internal error creating IndexedDBFSNode -- overwriting file entry with directory: ${this.entry.path}/${n} (encountered while adding ${i})`);o.doAdd(e.slice(1),t,i)}}print(e=""){console.log(e+this.entry.path),this.entry.type===sn.Directory&&this.entry.children.forEach(t=>t.print(e+" "))}}class Qzt extends V{constructor(e,t,i,n){super(),this.scheme=e,this.indexedDB=t,this.store=i,this.capabilities=Vn.FileReadWrite|Vn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.extUri=new CN(()=>!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 G7,n&&(this.changesBroadcastChannel=this._register(new _Ne(`vscode.indexedDB.${e}.changes`)),this._register(this.changesBroadcastChannel.onDidReceiveData(o=>{this._onDidChangeFile.fire(o.map(r=>({type:r.type,resource:N.revive(r.resource)})))})))}watch(e,t){return V.None}async mkdir(e){try{if((await this.stat(e)).type===sn.File)throw o5e}catch{}(await this.getFiletree()).add(e.path,{type:"dir"})}async stat(e){const t=(await this.getFiletree()).read(e.path);if(t?.type===sn.File)return{type:sn.File,ctime:0,mtime:this.mtimes.get(e.toString())||0,size:t.size??(await this.readFile(e)).byteLength};if(t?.type===sn.Directory)return{type:sn.Directory,ctime:0,mtime:0,size:0};throw pue}async readdir(e){try{const t=(await this.getFiletree()).read(e.path);if(!t)return[];if(t.type!==sn.Directory)throw o5e;return[...t.children.entries()].map(([i,n])=>[i,n.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 pue;const i=t instanceof Uint8Array?t:Lt(t)?$e.fromString(t).buffer:void 0;if(i===void 0)throw wv(`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===sn.Directory)throw Gzt;await this.bulkWrite([[e,t]])}catch(n){throw this.reportError("writeFile",n),n}}async rename(e,t,i){const n=await this.getFiletree(),o=n.read(e.path);if(!o)throw pue;const r=n.read(t.path);if(r){if(!i.overwrite)throw us("file exists already",ot.FileExists);if(r.type!==o.type)throw us("Cannot rename files with different types",ot.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]===sn.File?l.push(d):d[1]===sn.Directory&&n.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===sn.Directory&&(await this.readdir(e)).length)throw Kzt;n=[e.path]}await this.deleteKeys(n),(await this.getFiletree()).delete(e.path),n.forEach(o=>this.mtimes.delete(o)),this.triggerChanges(n.map(o=>({resource:e.with({path:o}),type:To.DELETED})))}async tree(e){const t=await this.stat(e),i=[[e.path,t.type]];if(t.type===sn.Directory){const n=await this.readdir(e);for(const[o,r]of n){const a=this.extUri.joinPath(e,o);if(i.push([a.path,r]),r===sn.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 j5({children:new Map,path:"",type:sn.Directory});return(await this.indexedDB.runInTransaction(this.store,"readonly",n=>n.getAllKeys())).map(n=>n.toString()).forEach(n=>e.add(n,{type:"file"})),e})()),this.cachedFiletree}async bulkWrite(e){e.forEach(([i,n])=>this.fileWriteBatch.push({content:n,resource:i})),await this.writeManyThrottler.queue(()=>this.writeMany());const t=await this.getFiletree();for(const[i,n]of e)t.add(i.path,{type:"file",size:n.byteLength}),this.mtimes.set(i.toString(),Date.now());this.triggerChanges(e.map(([i])=>({resource:i,type:To.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"?qzt: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 AA||t instanceof YSe?t.code:"unknown"})}}class jzt extends iae{constructor(e=aLe){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)IY(e,t,i);this.buffer=[]}log(e,t){this._logger?IY(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 sC;(function(s){s[s.None=0]="None",s[s.Untitled=2]="Untitled",s[s.Scratchpad=4]="Scratchpad"})(sC||(sC={}));const wNe="",Yzt="modulepreload",Jzt=function(s,e){return new URL(s,e).href},r5e={},RT=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){const r=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(t.map(l=>{if(l=Jzt(l,i),l in r5e)return;r5e[l]=!0;const d=l.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let p=r.length-1;p>=0;p--){const m=r[p];if(m.href===l&&(!d||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Yzt,d||(f.as="script"),f.crossOrigin="",f.href=l,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return n.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},Od="utf8",gS="utf8bom",jM="utf16be",YM="utf16le",VQ=[254,255],JSe=[255,254],DV=[239,187,191],Xzt=512,Zzt=512,e8t=512*8,t8t=512*128;var ree;(function(s){s[s.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(ree||(ree={}));class i8t extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class yNe{static async create(e){let t;if(e!==Od)t=(await RT(()=>import("./iconv-lite-umd-UFFDo-d5.js").then(n=>n.i),[],import.meta.url).then(n=>n.default??n)).getDecoder(CNe(e));else{const i=new TextDecoder;t={write(n){return i.decode(n,{stream:!0})},end(){return i.decode()}}}return new yNe(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function n8t(s,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?e8t:Zzt;return new Promise((i,n)=>{const o=qA(h=>h.join("")),r=[];let a=0,c;const l=new ci,d=async()=>{try{const h=await g8t({buffer:$e.concat(r),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(h.seemsBinary&&e.acceptTextOnly)throw new i8t("Stream is binary but only text is accepted for decoding",ree.STREAM_IS_BINARY);h.encoding=await e.overwriteEncoding(h.encoding),c=await yNe.create(h.encoding);const u=c.write($e.concat(r).buffer);o.write(u),r.length=0,a=0,i({stream:o,detected:h})}catch(h){l.cancel(),o.destroy(),n(h)}};AN(s,{onData:async h=>{c?o.write(c.write(h.buffer)):(r.push(h),a+=h.byteLength,a>=t&&(s.pause(),await d(),setTimeout(()=>s.resume())))},onError:h=>o.error(h),onEnd:async()=>{c||await d(),o.end(c?.end())}},l.token)})}async function s8t(s,e,t){const n=(await RT(()=>import("./iconv-lite-umd-UFFDo-d5.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a)).getEncoder(CNe(e),t);let o=!1,r=!1;return{read(){if(r)return null;const a=s.read();if(typeof a!="string"){if(r=!0,!o&&t?.addBOM)switch(e){case Od:case gS:return $e.wrap(Uint8Array.from(DV));case jM:return $e.wrap(Uint8Array.from(VQ));case YM:return $e.wrap(Uint8Array.from(JSe))}const c=n.end();return c&&c.length>0?(o=!0,$e.wrap(c)):null}return o=!0,$e.wrap(n.write(a))}}}async function o8t(s){return(await RT(()=>import("./iconv-lite-umd-UFFDo-d5.js").then(t=>t.i),[],import.meta.url).then(t=>t.default??t)).encodingExists(CNe(s))}function CNe(s){return s===gS||s===null?Od:s}function r8t(s,e){if(!s||eimport("./index-Fv_728R0.js").then(a=>a.i),[],import.meta.url).then(a=>a.default??a),i=s.slice(0,t8t),n=u8t(i.buffer);e&&(e=Fi(e.map(a=>h8t(a))),e.length===0&&(e=void 0));const o=t.detect(n,e?{detectEncodings:e}:void 0);if(!o||!o.encoding)return null;const r=o.encoding.toLowerCase();return 0<=a8t.indexOf(r)?null:d8t(o.encoding)}const l8t={ibm866:"cp866",big5:"cp950"};function dit(s){return s.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function d8t(s){const e=dit(s);return l8t[e]||e}function h8t(s){const e=dit(s);return zQ[e].guessableName}function u8t(s){let e="";for(let t=0;t({seemsBinary:!1,encoding:r})):{seemsBinary:o,encoding:n}}const tx={utf8:{labelLong:"UTF-8",labelShort:"UTF-8",order:1,alias:"utf8bom",guessableName:"UTF-8"},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,guessableName:"UTF-16LE"},utf16be:{labelLong:"UTF-16 BE",labelShort:"UTF-16 BE",order:4,guessableName:"UTF-16BE"},windows1252:{labelLong:"Western (Windows 1252)",labelShort:"Windows 1252",order:5,guessableName:"windows-1252"},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,guessableName:"windows-1250"},iso88592:{labelLong:"Central European (ISO 8859-2)",labelShort:"ISO 8859-2",order:17,guessableName:"ISO-8859-2"},cp852:{labelLong:"Central European (CP 852)",labelShort:"CP 852",order:18},windows1251:{labelLong:"Cyrillic (Windows 1251)",labelShort:"Windows 1251",order:19,guessableName:"windows-1251"},cp866:{labelLong:"Cyrillic (CP 866)",labelShort:"CP 866",order:20,guessableName:"IBM866"},iso88595:{labelLong:"Cyrillic (ISO 8859-5)",labelShort:"ISO 8859-5",order:21,guessableName:"ISO-8859-5"},koi8r:{labelLong:"Cyrillic (KOI8-R)",labelShort:"KOI8-R",order:22,guessableName:"KOI8-R"},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,guessableName:"windows-1253"},iso88597:{labelLong:"Greek (ISO 8859-7)",labelShort:"ISO 8859-7",order:26,guessableName:"ISO-8859-7"},windows1255:{labelLong:"Hebrew (Windows 1255)",labelShort:"Windows 1255",order:27,guessableName:"windows-1255"},iso88598:{labelLong:"Hebrew (ISO 8859-8)",labelShort:"ISO 8859-8",order:28,guessableName:"ISO-8859-8"},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,guessableName:"Big5"},big5hkscs:{labelLong:"Traditional Chinese (Big5-HKSCS)",labelShort:"Big5-HKSCS",order:37},shiftjis:{labelLong:"Japanese (Shift JIS)",labelShort:"Shift JIS",order:38,guessableName:"SHIFT_JIS"},eucjp:{labelLong:"Japanese (EUC-JP)",labelShort:"EUC-JP",order:39,guessableName:"EUC-JP"},euckr:{labelLong:"Korean (EUC-KR)",labelShort:"EUC-KR",order:40,guessableName:"EUC-KR"},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,guessableName:"GB2312"},cp865:{labelLong:"Nordic DOS (CP 865)",labelShort:"CP 865",order:46},cp850:{labelLong:"Western European DOS (CP 850)",labelShort:"CP 850",order:47}},zQ=(()=>{const s={};for(const e in tx)tx[e].guessableName&&(s[e]=tx[e]);return s})();var BP,ry;let aee=(ry=class extends eI{get name(){return this.configuredLabelFormat==="content"&&!this.hasAssociatedFilePath&&this.cachedModelFirstLineWords?this.cachedModelFirstLineWords:this.labelService.getUriBasenameLabel(this.resource)}constructor(e,t,i,n,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=n,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=wNe,this.capabilities=sC.Untitled,this.configuredLabelFormat="content",this.cachedModelFirstLineWords=void 0,this.dirty=this.hasAssociatedFilePath||!!this.initialValue,this.ignoreDirtyOnModelContentChange=!1,this._register(this.workingCopyService.registerWorkingCopy(this)),n&&this.setLanguageId(n),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===BP.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(tae(""))}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:Od}):typeof this.initialValue=="string"&&(t=eKe($e.fromString(this.initialValue))),{content:t}}async resolve(){let e=!1,t=!1;if(this.textEditorModel)this.updateTextEditorModel(void 0,this.preferredLanguageId);else{let n;const o=await this.workingCopyBackupService.resolve(this);o?(n=o.value,t=!0):n=J7($e.fromString(this.initialValue||""));const r=await XTe(await this.textFileService.getDecodedStream(this.resource,n,{encoding:Od}));this.createTextEditorModel(r,this.resource,this.preferredLanguageId),e=!0}const i=qn(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<=BP.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:BP.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH+1}).trim().replace(/\s+/g," ").replace(/\u202E/g,"");i=i.substr(0,H6e(i,BP.FIRST_LINE_NAME_MAX_LENGTH)[0]),i&&M7().exec(i)&&(t=i),t!==this.cachedModelFirstLineWords&&(this.cachedModelFirstLineWords=t,this._onDidChangeName.fire())}isReadonly(){return!1}},BP=ry,ry.FIRST_LINE_NAME_MAX_LENGTH=40,ry.FIRST_LINE_NAME_CANDIDATE_MAX_LENGTH=ry.FIRST_LINE_NAME_MAX_LENGTH*10,ry.ACTIVE_EDITOR_LANGUAGE_ID="${activeEditorLanguage}",ry);aee=BP=D([_(5,xi),_(6,gi),_(7,F6),_(8,Ec),_(9,Im),_(10,Fo),_(11,Fs),_(12,ei),_(13,M6),_(14,mr)],aee);var kV,gk;let cee=(gk=class extends eI{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(o,n,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.progressService=b,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=wNe,this.capabilities=sC.None,this.name=Ko(this.labelService.getUriLabel(this.resource)),this.resourceHasExtension=!!xn.extname(this.resource),this.versionId=0,this.ignoreDirtyOnModelContentChange=!1,this.ignoreSaveFromSaveParticipants=!1,this.lastModelContentChangeFromUndoRedo=void 0,this.saveSequentializer=new AGe,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,To.ADDED)&&(i=!1,t=!0):e.contains(this.resource,To.DELETED)&&(i=!0,t=!0),t&&this.inOrphanMode!==i){let n=!1;i&&(await Sr(100,He.None),this.isDisposed()?n=!0:n=!await this.fileService.exists(this.resource)),this.inOrphanMode!==n&&!this.isDisposed()&&this.setOrphaned(n)}}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:Od});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!==Qi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}async resolve(e){if(this.trace("resolve() - enter"),cs("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),cs("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,n,o,r;try{const c=await this.fileService.stat(this.resource);i=c.mtime,n=c.ctime,o=c.size,r=c.etag,this.setOrphaned(!1)}catch(c){i=Date.now(),n=Date.now(),o=0,r=w_,this.setOrphaned(c.fileOperationResult===Qi.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:n,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=Od;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:w_,value:await XTe(await this.textFileService.getDecodedStream(this.resource,e.value,{encoding:Od})),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 n;t?n=w_:this.lastResolvedFileStat&&(n=this.lastResolvedFileStat.etag);const o=this.versionId;try{const r=await this.textFileService.readStream(this.resource,{acceptTextOnly:!i,etag:n,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===Qi.FILE_NOT_FOUND),this.isResolved()&&a===Qi.FILE_NOT_MODIFIED_SINCE){r instanceof b5&&this.updateLastResolvedFileStat(r.stat);return}if(this.isResolved()&&a===Qi.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 n=this.contentEncoding;this.contentEncoding=e.encoding,this.preferredEncoding?this.updatePreferredEncoding(this.contentEncoding):n!==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??j3.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===Ca)&&!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,n=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=n,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(hh.CONFLICT)||this.hasState(hh.ERROR))&&(e.reason===Cn.AUTO||e.reason===Cn.FOCUS_CHANGE||e.reason===Cn.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(hh.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Cn.EXPLICIT);const 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 ci;return this.progressService.withProgress({title:g(5736,"Saving '{0}'",this.name),location:dd.Window,cancellable:!0,delay:this.isDirty()?3e3:5e3},n=>this.doSaveSequential(t,e,n,i),()=>{i.cancel()}).finally(()=>{i.dispose()})}doSaveSequential(e,t,i,n){return this.saveSequentializer.run(e,(async()=>{if(this.isResolved()&&!t.skipSaveParticipants)try{if(t.reason===Cn.AUTO&&typeof this.lastModelContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastModelContentChangeFromUndoRedo;a{try{const a=await this.textFileService.write(o.resource,r.createSnapshot(),{mtime:o.mtime,encoding:this.getEncoding(),etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(o.resource,r.getLanguageId())?w_:o.etag,unlock:t.writeUnlock,writeElevated:t.writeElevated});this.handleSaveSuccess(a,e,t)}catch(a){this.handleSaveError(a,e,t)}})())})(),()=>n.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===Qi.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 hh.CONFLICT:return this.inConflictMode;case hh.DIRTY:return this.dirty;case hh.ERROR:return this.inErrorMode;case hh.ORPHAN:return this.inOrphanMode;case hh.PENDING_SAVE:return this.saveSequentializer.isRunning();case hh.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===gS||this.contentEncoding===jM||this.contentEncoding===YM){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,Y3.Decode)}setEncoding(e,t){return this.hasEncodingSetExplicitly=!0,this.setEncodingInternal(e,t)}async setEncodingInternal(e,t){if(t===Y3.Encode)this.updatePreferredEncoding(e),this.isDirty()||(this.versionId++,this.setDirty(!0)),this.inConflictMode||await this.save({source:kV.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()}},kV=gk,gk.TEXTFILE_SAVE_ENCODING_SOURCE=MJ.registerSource("textFileEncoding.source",g(5735,"File Encoding Changed")),gk.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,gk);cee=kV=D([_(3,xi),_(4,gi),_(5,Jt),_(6,Fo),_(7,F6),_(8,Ge),_(9,Im),_(10,pd),_(11,Fs),_(12,M6),_(13,mr),_(14,mf),_(15,fs),_(16,og)],cee);let XSe=class extends V{constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=x1e(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.textEditorModel?.pushStackElement();for(const o of this.saveParticipants){if(n.isCancellationRequested||!e.textEditorModel)break;try{const r=o.participate(e,t,i,n);await B_(r,n)}catch(r){this.logService.error(r)}}e.textEditorModel?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};XSe=D([_(0,Ge)],XSe);let ZSe=class extends V{get models(){return[...this.mapResourceToModel.values()]}constructor(e,t,i,n,o){super(),this.instantiationService=e,this.fileService=t,this.notificationService=i,this.workingCopyFileService=n,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 ui,this.mapResourceToModelListeners=new ui,this.mapResourceToDisposeListener=new ui,this.mapResourceToPendingModelResolvers=new ui,this.modelResolveQueue=this._register(new K1e),this.saveErrorHandler=(()=>{const r=this.notificationService;return{onSaveError(a,c){r.error(g(9794,"Failed to save '{0}': {1}",c.name,Nr(a,!1)))}}})(),this.mapCorrelationIdToModelsToRestore=new Map,this.saveParticipants=this._register(this.instantiationService.createInstance(XSe)),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,To.UPDATED,To.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){vt(i)}})}onWillRunWorkingCopyFileOperation(e){if(e.operation===Ai.MOVE||e.operation===Ai.COPY){const t=[];for(const{source:i,target:n}of e.files)if(i){if(this.uriIdentityService.extUri.isEqual(i,n))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=n:c=Pt(n,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===Ai.MOVE||e.operation===Ai.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 Ai.CREATE:e.waitUntil((async()=>{for(const{target:t}of e.files){const i=this.get(t);i&&!i.isDisposed()&&await i.revert()}})());break;case Ai.MOVE:case Ai.COPY:e.waitUntil((async()=>{const t=this.mapCorrelationIdToModelsToRestore.get(e.correlationId);t&&(this.mapCorrelationIdToModelsToRestore.delete(e.correlationId),await Zs.settled(t.map(async i=>{const n=this.uriIdentityService.asCanonicalUri(i.target),o=await this.resolve(n,{reload:{async:!1},contents:i.snapshot?c6(i.snapshot):void 0,encoding:i.encoding});i.languageId&&i.languageId!==Ca&&o.getLanguageId()===Ca&&gU(n)!==_Ke&&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,n;N.isUri(e)?(n=e,i=this.get(n)):(n=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){vt(a)}})()):o=i.resolve(t):o=Promise.resolve();else{r=!0;const a=i=this.instantiationService.createInstance(cee,n,t?t.encoding:void 0,t?t.languageId:void 0);o=i.resolve(t),this.registerModel(a)}this.mapResourceToPendingModelResolvers.set(n,o),this.add(n,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(n)}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&&(bt(i),this.mapResourceToDisposeListener.delete(e));const n=this.mapResourceToModelListeners.get(e);n&&(bt(n),this.mapResourceToModelListeners.delete(e)),t&&this._onDidRemove.fire(e)}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i,n){return this.saveParticipants.participate(e,t,i,n)}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 M.toPromise(e.onDidChangeDirty),this.canDispose(e)):!0}dispose(){super.dispose(),this.mapResourceToModel.clear(),this.mapResourceToPendingModelResolvers.clear(),bt(this.mapResourceToDisposeListener.values()),this.mapResourceToDisposeListener.clear(),bt(this.mapResourceToModelListeners.values()),this.mapResourceToModelListeners.clear()}};ZSe=D([_(0,we),_(1,Jt),_(2,bi),_(3,Hb),_(4,ks)],ZSe);var $Q,fk;let eAe=(fk=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(),this.fileService=e,this.untitledTextEditorService=t,this.lifecycleService=i,this.instantiationService=n,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=b,this.decorationsService=w,this.files=this._register(this.instantiationService.createInstance(ZSe)),this.untitled=this.untitledTextEditorService,this.provideDecorations()}provideDecorations(){const e=this._register(new class extends V{constructor(t){super(),this.files=t,this.label=g(4401,"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(hh.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 n=i.isReadonly(),o=i.hasState(hh.ORPHAN);if(n&&o)return{color:OOe,letter:ve.lockSmall,strikethrough:!0,tooltip:g(4402,"Deleted, Read-only")};if(n)return{letter:ve.lockSmall,tooltip:g(4403,"Read-only")};if(o)return{color:OOe,strikethrough:!0,tooltip:g(4404,"Deleted")}}}(this.files));this._register(this.decorationsService.registerDecorationsProvider(e))}get encoding(){return this._encoding||(this._encoding=this._register(this.instantiationService.createInstance(tAe))),this._encoding}async read(e,t){const[i,n]=await this.doRead(e,{...t,preferUnbuffered:!0});return{...i,encoding:n.detected.encoding||Od,value:await nTe(n.stream,o=>o.join(""))}}async readStream(e,t){const[i,n]=await this.doRead(e,t);return{...i,encoding:n.detected.encoding||Od,value:await XTe(n.stream)}}async doRead(e,t){const i=new ci;let n;if(t?.preferUnbuffered){const o=await this.fileService.readFile(e,t,i.token);n={...o,value:J7(o.value)}}else n=await this.fileService.readFileStream(e,t,i.token);try{const o=await this.doGetDecodedStream(e,n.value,t);return[n,o]}catch(o){throw i.dispose(!0),o.decodeStreamErrorKind===ree.STREAM_IS_BINARY?new wFt(g(4405,"File seems to be binary and cannot be opened as text"),yW.FILE_IS_BINARY,t):o}}async create(e,t){const i=await Promise.all(e.map(async n=>{const o=await this.getEncodedReadable(n.resource,n.value);return{resource:n.resource,contents:o,overwrite:n.options?.overwrite}}));return this.workingCopyFileService.create(i,He.None,t)}async write(e,t,i){const n=await this.getEncodedReadable(e,t,i);return i?.writeElevated&&this.elevatedFileService.isSupported(e)?this.elevatedFileService.writeFileElevated(e,n,i):this.fileService.writeFile(e,n,i)}async getEncodedReadable(e,t,i){const{encoding:n,addBOM:o}=await this.encoding.getWriteEncoding(e,i);if(n===Od&&!o)return typeof t>"u"?void 0:SFt(t);t=t||"";const r=typeof t=="string"?CFt(t):t;return s8t(r,n,{addBOM:o})}async getDecodedStream(e,t,i){return(await this.doGetDecodedStream(e,t,i)).stream}doGetDecodedStream(e,t,i){return n8t(t,{acceptTextOnly:i?.acceptTextOnly??!1,guessEncoding:i?.autoGuessEncoding||this.textResourceConfigurationService.getValue(e,"files.autoGuessEncoding"),candidateGuessEncodings:i?.candidateGuessEncodings||this.textResourceConfigurationService.getValue(e,"files.candidateGuessEncodings"),overwriteEncoding:async n=>{const{encoding:o}=await this.encoding.getPreferredReadEncoding(e,i,n??void 0);return o}})}async save(e,t){if(e.scheme===pe.untitled){const i=this.untitled.get(e);if(i){let n;if(i.hasAssociatedFilePath?n=await this.suggestSavePath(e):n=await this.fileDialogService.pickFileToSave(await this.suggestSavePath(e),t?.availableFileSystems),n)return this.saveAs(e,n,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 ji(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}}],He.None),await this.save(e,i)||await this.save(t,i),t):this.doSaveAs(e,t,i)}}async doSaveAs(e,t,i){let n=!1;const o=this.files.get(e);if(o?.isResolved())n=await this.doSaveAsTextFile(o,e,t,i);else if(this.fileService.hasProvider(e))await this.fileService.copy(e,t,!0),n=!0;else{const r=this.modelService.getModel(e);r&&(n=await this.doSaveAsTextFile(r,e,t,i))}if(n){try{await this.revert(e)}catch(r){this.logService.error(r)}return t}}async doSaveAsTextFile(e,t,i,n){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===yW.FILE_IS_BINARY||u.fileOperationResult===Qi.FILE_TOO_LARGE))return await this.fileService.del(i),this.doSaveAsTextFile(e,t,i,n);throw u}}let l;if(e instanceof aee&&e.hasAssociatedFilePath&&a&&this.uriIdentityService.extUri.isEqual(i,S8(e.resource,this.environmentService.remoteAuthority,this.pathService.defaultUriScheme))?l=await this.confirmOverwrite(i):l=!0,!l)return!1;let d;e instanceof eI?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,c6(d.createSnapshot()));const u=d.getLanguageId(),f=h.getLanguageId();u!==Ca&&f===Ca&&h.setLanguage(u);const p=this.codeEditorService.getTransientModelProperties(d);if(p)for(const[m,v]of p)this.codeEditorService.setTransientModelProperty(h,m,v)}return n?.source||(n={...n,source:a?$Q.TEXTFILE_SAVE_REPLACE_SOURCE:$Q.TEXTFILE_SAVE_CREATE_SOURCE}),c.save({...n,from:t})}async confirmOverwrite(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(4406,"'{0}' already exists. Do you want to replace it?",_i(e)),detail:g(4407,"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",_i(e),_i(Lr(e))),primaryButton:g(4408,"&&Replace")});return t}async confirmMakeWriteable(e){const{confirmed:t}=await this.dialogService.confirm({type:"warning",message:g(4409,"'{0}' is marked as read-only. Do you want to save anyway?",_i(e)),detail:g(4410,"Paths can be configured as read-only via settings."),primaryButton:g(4411,"&&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 n;if(e.scheme===pe.untitled){const o=this.untitled.get(e);if(o){if(o.hasAssociatedFilePath)return S8(e,t,this.pathService.defaultUriScheme);let r;await this.pathService.hasValidBasename(Pt(i,o.name),o.name)?r=o.name:r=_i(e);const a=o.getLanguageId();a&&a!==Ca?n=this.suggestFilename(a,r):n=r}}return n||(n=_i(e)),Pt(i,n)}suggestFilename(e,t){if(!this.languageService.getLanguageName(e))return t;const n=Vy(t),o=this.languageService.getExtensions(e);if(o.includes(n))return t;const r=rm(o);if(r)return n?`${t.substring(0,t.indexOf(n))}${r}`:`${t}${r}`;const a=this.languageService.getFilenames(e);return a.includes(t)?t:rm(a)??t}async revert(e,t){if(e.scheme===pe.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===pe.untitled?this.untitled.get(e):this.files.get(e);return t?t.isDirty():!1}},$Q=fk,fk.TEXTFILE_SAVE_CREATE_SOURCE=MJ.registerSource("textFileCreate.source",g(4399,"File Created")),fk.TEXTFILE_SAVE_REPLACE_SOURCE=MJ.registerSource("textFileOverwrite.source",g(4400,"File Replaced")),fk);eAe=$Q=D([_(0,Jt),_(1,P6),_(2,Zu),_(3,we),_(4,gi),_(5,Jr),_(6,to),_(7,sg),_(8,Ec),_(9,pd),_(10,Kt),_(11,mf),_(12,Hb),_(13,ks),_(14,xi),_(15,Ge),_(16,R6),_(17,eE)],eAe);let tAe=class extends V{get encodingOverrides(){return this._encodingOverrides}set encodingOverrides(e){this._encodingOverrides=e}constructor(e,t,i,n){super(),this.textResourceConfigurationService=e,this.environmentService=t,this.contextService=i,this.uriIdentityService=n,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:Od}),e.push({extension:Sb,encoding:Od}),e.push({parent:this.environmentService.untitledWorkspacesHome,encoding:Od}),this.contextService.getWorkspace().folders.forEach(t=>{e.push({parent:Pt(t.uri,".vscode"),encoding:Od})}),e}async getWriteEncoding(e,t){const{encoding:i,hasBOM:n}=await this.getPreferredWriteEncoding(e,t?t.encoding:void 0);return{encoding:i,addBOM:n}}async getPreferredWriteEncoding(e,t){const i=await this.getEncodingForResource(e,t);return{encoding:i,hasBOM:i===jM||i===YM||i===gS}}async getPreferredReadEncoding(e,t,i){let n;t?.encoding?i===gS&&t.encoding===Od?n=gS:n=t.encoding:typeof i=="string"?n=i:this.textResourceConfigurationService.getValue(e,"files.encoding")===gS&&(n=Od);const o=await this.getEncodingForResource(e,n);return{encoding:o,hasBOM:o===jM||o===YM||o===gS}}async getEncodingForResource(e,t){let i;const n=this.getEncodingOverride(e);return n?i=n:t?i=t:i=this.textResourceConfigurationService.getValue(e,"files.encoding"),i!==Od&&(!i||!await o8t(i))&&(i=Od),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&&gU(e)===`.${t.extension}`)return t.encoding}}};tAe=D([_(0,Ec),_(1,Jr),_(2,yi),_(3,ks)],tAe);let iAe=class extends eAe{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,b,v,w),this.registerListeners()}registerListeners(){this._register(this.lifecycleService.onBeforeShutdown(e=>e.veto(this.onBeforeShutdown(),"veto.textFiles")))}onBeforeShutdown(){return!!this.files.models.some(e=>e.hasState(hh.PENDING_SAVE))}};iAe=D([_(0,Jt),_(1,P6),_(2,Zu),_(3,we),_(4,gi),_(5,Jr),_(6,to),_(7,sg),_(8,Ec),_(9,pd),_(10,Kt),_(11,mf),_(12,Hb),_(13,ks),_(14,xi),_(15,R6),_(16,Ge),_(17,eE)],iAe);var Zb,RR;let nAe=(RR=class extends V{constructor(e,t,i,n){super(),this.getExpression=e,this.shouldUpdate=t,this.contextService=i,this.configurationService=n,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||!Ys(l.expression,c.expression))&&(t=!0,this.mapFolderToParsedExpression.set(a,K_(c.expression)),this.mapFolderToConfiguredExpression.set(a,c)):l&&(t=!0,this.mapFolderToParsedExpression.delete(a),this.mapFolderToConfiguredExpression.delete(a))}const i=new Ck(this.contextService.getWorkspace().folders.map(r=>r.uri));for(const[r]of this.mapFolderToConfiguredExpression)r!==Zb.NO_FOLDER&&(i.has(N.parse(r))||(this.mapFolderToParsedExpression.delete(r),this.mapFolderToConfiguredExpression.delete(r),t=!0));const n=this.doGetExpression(void 0),o=this.mapFolderToConfiguredExpression.get(Zb.NO_FOLDER);n?(!o||!Ys(o.expression,n.expression))&&(t=!0,this.mapFolderToParsedExpression.set(Zb.NO_FOLDER,K_(n.expression)),this.mapFolderToConfiguredExpression.set(Zb.NO_FOLDER,n)):o&&(t=!0,this.mapFolderToParsedExpression.delete(Zb.NO_FOLDER),this.mapFolderToConfiguredExpression.delete(Zb.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 n=!1;const o=Object.create(null);for(const r of i){n||(n=hM(r));let a=r;const c=glt(a,!0);if(c){const l=c.toLowerCase();c!==c.toLowerCase()&&(a=`${l}${a.substring(1)}`)}o[a]=t[r]}return{expression:o,hasAbsolutePath:n}}matches(e,t){if(this.mapFolderToParsedExpression.size===0)return!1;const i=this.contextService.getWorkspaceFolder(e);let n,o;if(i&&this.mapFolderToParsedExpression.has(i.uri.toString())?(n=this.mapFolderToParsedExpression.get(i.uri.toString()),o=this.mapFolderToConfiguredExpression.get(i.uri.toString())):(n=this.mapFolderToParsedExpression.get(Zb.NO_FOLDER),o=this.mapFolderToConfiguredExpression.get(Zb.NO_FOLDER)),!n)return!1;let r;return i?r=SN(i.uri,e):r=this.uriToPath(e),typeof r=="string"&&n(r,void 0,t)?!0:r!==this.uriToPath(e)&&o?.hasAbsolutePath?!!n(this.uriToPath(e),void 0,t):!1}uriToPath(e){return e.scheme===pe.file?e.fsPath:e.path}},Zb=RR,RR.NO_FOLDER=null,RR);nAe=Zb=D([_(2,yi),_(3,Te)],nAe);var yv;const f8t=new Y("autoSaveAfterShortDelayContext",!1,!0);var rc;(function(s){s[s.OFF=0]="OFF",s[s.AFTER_SHORT_DELAY=1]="AFTER_SHORT_DELAY",s[s.AFTER_LONG_DELAY=2]="AFTER_LONG_DELAY",s[s.ON_FOCUS_CHANGE=3]="ON_FOCUS_CHANGE",s[s.ON_WINDOW_CHANGE=4]="ON_WINDOW_CHANGE"})(rc||(rc={}));var Pg;(function(s){s[s.SETTINGS=1]="SETTINGS",s[s.OUT_OF_WORKSPACE=2]="OUT_OF_WORKSPACE",s[s.ERRORS=3]="ERRORS",s[s.DISABLED=4]="DISABLED"})(Pg||(Pg={}));var QS;let sAe=(QS=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.contextKeyService=e,this.configurationService=t,this.contextService=i,this.environmentService=n,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 lm(1e3),this.autoSaveDisabledOverrides=new ui,this.autoSaveAfterShortDelayContext=f8t.bindTo(this.contextKeyService),this.readonlyIncludeMatcher=this._register(new ope(()=>this.createReadonlyMatcher(JQe))),this.readonlyExcludeMatcher=this._register(new ope(()=>this.createReadonlyMatcher(XQe))),this.sessionReadonlyOverrides=new ui(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||Au.ON_EXIT,this.onFilesConfigurationChange(l,!1),this.registerListeners()}createReadonlyMatcher(e){const t=this._register(new nAe(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&&OSt(i))return i.readOnlyMessage??yv.READONLY_MESSAGES.providerReadonly;const n=this.sessionReadonlyOverrides.get(e);return typeof n=="boolean"?n===!0?yv.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:yv.READONLY_MESSAGES.configuredReadonly:this.configuredReadonlyFromPermissions&&t?.locked?yv.READONLY_MESSAGES.fileLocked:t?.readonly?yv.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===rc.AFTER_SHORT_DELAY),t&&this._onDidChangeAutoSaveConfiguration.fire();const i=e?.files?.associations;Ys(this.currentFilesAssociationConfiguration,i)||(this.currentFilesAssociationConfiguration=i,t&&this._onDidChangeFilesAssociation.fire());const n=e?.files?.hotExit;n===Au.OFF||n===Au.ON_EXIT_AND_WINDOW_CLOSE?this.currentHotExitConfiguration=n:this.currentHotExitConfiguration=Au.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,n,o,r,a,c;switch(t?.autoSave??yv.DEFAULT_AUTO_SAVE_MODE){case el.AFTER_DELAY:{i="afterDelay",n=typeof t?.autoSaveDelay=="number"&&t.autoSaveDelay>=0?t.autoSaveDelay:yv.DEFAULT_AUTO_SAVE_DELAY,c=n<=yv.DEFAULT_AUTO_SAVE_DELAY;break}case el.ON_FOCUS_CHANGE:i="onFocusChange";break;case el.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:n,autoSaveWorkspaceFilesOnly:o,autoSaveWhenNoErrors:r,isOutOfWorkspace:a,isShortAutoSaveDelay:c}}toResource(e){return e instanceof Nb?Na.getOriginalUri(e,{supportSideBySide:Hs.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:rc.OFF,reason:Pg.DISABLED};const n=this.getAutoSaveConfiguration(i);if(typeof n.autoSave>"u")return{mode:rc.OFF,reason:Pg.SETTINGS};if(typeof t=="number"&&(n.autoSave==="afterDelay"&&t!==Cn.AUTO||n.autoSave==="onFocusChange"&&t!==Cn.FOCUS_CHANGE&&t!==Cn.WINDOW_CHANGE||n.autoSave==="onWindowChange"&&t!==Cn.WINDOW_CHANGE))return{mode:rc.OFF,reason:Pg.SETTINGS};if(i){if(n.autoSaveWorkspaceFilesOnly&&n.isOutOfWorkspace)return{mode:rc.OFF,reason:Pg.OUT_OF_WORKSPACE};if(n.autoSaveWhenNoErrors&&this.markerService.read({resource:i,take:1,severities:Ws.Error}).length>0)return{mode:rc.OFF,reason:Pg.ERRORS}}switch(n.autoSave){case"afterDelay":return typeof n.autoSaveDelay=="number"&&n.autoSaveDelay<=yv.DEFAULT_AUTO_SAVE_DELAY?{mode:n.autoSaveWhenNoErrors?rc.AFTER_LONG_DELAY:rc.AFTER_SHORT_DELAY}:{mode:rc.AFTER_LONG_DELAY};case"onFocusChange":return{mode:rc.ON_FOCUS_CHANGE};case"onWindowChange":return{mode:rc.ON_WINDOW_CHANGE}}}async toggleAutoSave(){const e=this.configurationService.getValue("files.autoSave");let t;return[el.AFTER_DELAY,el.ON_FOCUS_CHANGE,el.ON_WINDOW_CHANGE].some(i=>i===e)?t=el.OFF:t=el.AFTER_DELAY,this.configurationService.updateValue("files.autoSave",t)}disableAutoSave(e){const t=this.toResource(e);if(!t)return V.None;const i=this.autoSaveDisabledOverrides.get(t)??0;return this.autoSaveDisabledOverrides.set(t,i+1),i===0&&this._onDidChangeAutoSaveDisabled.fire(t),Ee(()=>{const n=this.autoSaveDisabledOverrides.get(t)??0;n<=1?(this.autoSaveDisabledOverrides.delete(t),this._onDidChangeAutoSaveDisabled.fire(t)):this.autoSaveDisabledOverrides.set(t,n-1)})}get isHotExitEnabled(){return this.contextService.getWorkspace().transient?!1:this.currentHotExitConfiguration!==Au.OFF}get hotExitConfiguration(){return this.currentHotExitConfiguration}preventSaveConflicts(e,t){return this.configurationService.getValue("files.saveConflictResolution",{resource:e,overrideIdentifier:t})!=="overwriteFileOnDisk"}},yv=QS,QS.DEFAULT_AUTO_SAVE_MODE=Wn?el.AFTER_DELAY:el.OFF,QS.DEFAULT_AUTO_SAVE_DELAY=1e3,QS.READONLY_MESSAGES={providerReadonly:{value:g(615,"Editor is read-only because the file system of the file is read-only."),isTrusted:!0},sessionReadonly:{value:g(616,"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(617,"Editor is read-only because the file was set read-only via settings. [Click here](command:{0}) to configure or [toggle for this session](command:{1}).",`workbench.action.openSettings?${encodeURIComponent('["files.readonly"]')}`,"workbench.action.files.toggleActiveEditorReadonlyInSession"),isTrusted:!0},fileLocked:{value:g(618,"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(619,"Editor is read-only because the file is read-only."),isTrusted:!0}},QS);sAe=yv=D([_(0,Le),_(1,Te),_(2,yi),_(3,Za),_(4,ks),_(5,Jt),_(6,ym),_(7,Ec)],sAe);class p8t{isSupported(e){return!1}async writeFileElevated(e,t,i){throw new Error("Unsupported")}}const SNe=Qe.as(Nn.Configuration),m8t=od?{type:"string",scope:at.APPLICATION,enum:[Au.OFF,Au.ON_EXIT,Au.ON_EXIT_AND_WINDOW_CLOSE],default:Au.ON_EXIT,markdownEnumDescriptions:[g(620,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(621,"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(622,"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(623,"[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.",Au.ON_EXIT,Au.ON_EXIT_AND_WINDOW_CLOSE)}:{type:"string",scope:at.APPLICATION,enum:[Au.OFF,Au.ON_EXIT_AND_WINDOW_CLOSE],default:Au.ON_EXIT_AND_WINDOW_CLOSE,markdownEnumDescriptions:[g(620,"Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes."),g(624,"Hot exit will be triggered when the browser quits or the window or tab is closed.")],markdownDescription:g(623,"[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.",Au.ON_EXIT,Au.ON_EXIT_AND_WINDOW_CLOSE)};SNe.registerConfiguration({id:"files",order:9,title:g(625,"Files"),type:"object",properties:{[BSt]:{type:"object",markdownDescription:g(626,"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,...Wn?{"**/*.crswap":!0}:void 0},scope:at.RESOURCE,additionalProperties:{anyOf:[{type:"boolean",enum:[!0,!1],enumDescriptions:[g(627,"Enable the pattern."),g(628,"Disable the pattern.")],description:g(629,"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(630,"Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.")}}}]}},[CLe]:{type:"object",markdownDescription:g(631,'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(tx),default:"utf8",description:g(632,"The default character set encoding to use when reading and writing files. This setting can also be configured per language."),scope:at.LANGUAGE_OVERRIDABLE,enumDescriptions:Object.keys(tx).map(s=>tx[s].labelLong),enumItemLabels:Object.keys(tx).map(s=>tx[s].labelLong)},"files.autoGuessEncoding":{type:"boolean",default:!1,markdownDescription:g(633,"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:at.LANGUAGE_OVERRIDABLE},"files.candidateGuessEncodings":{type:"array",items:{type:"string",enum:Object.keys(zQ),enumDescriptions:Object.keys(zQ).map(s=>zQ[s].labelLong)},default:[],markdownDescription:g(634,"List of character set encodings that the editor should attempt to guess in the order they are listed. In case it cannot be determined, {0} is respected","`#files.encoding#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.eol":{type:"string",enum:[` `,`\r -`,"auto"],enumDescriptions:[g(635,"LF"),g(636,"CRLF"),g(637,"Uses operating system specific end of line character.")],default:"auto",description:g(638,"The default end of line character."),scope:at.LANGUAGE_OVERRIDABLE},"files.enableTrash":{type:"boolean",default:!0,description:g(639,"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(640,"When enabled, will trim trailing whitespace when saving a file."),scope:at.LANGUAGE_OVERRIDABLE},"files.trimTrailingWhitespaceInRegexAndStrings":{type:"boolean",default:!0,description:g(641,"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:at.LANGUAGE_OVERRIDABLE},"files.insertFinalNewline":{type:"boolean",default:!1,description:g(642,"When enabled, insert a final new line at the end of the file when saving it."),scope:at.LANGUAGE_OVERRIDABLE},"files.trimFinalNewlines":{type:"boolean",default:!1,description:g(643,"When enabled, will trim all new lines after the final new line at the end of the file when saving it."),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[tl.OFF,tl.AFTER_DELAY,tl.ON_FOCUS_CHANGE,tl.ON_WINDOW_CHANGE],markdownEnumDescriptions:[g(644,"An editor with changes is never automatically saved."),g(645,"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."),g(646,"An editor with changes is automatically saved when the editor loses focus."),g(647,"An editor with changes is automatically saved when the window loses focus.")],default:Wn?tl.AFTER_DELAY:tl.OFF,markdownDescription:g(648,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",tl.OFF,tl.AFTER_DELAY,tl.ON_FOCUS_CHANGE,tl.ON_WINDOW_CHANGE,tl.AFTER_DELAY),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveDelay":{type:"number",default:1e3,minimum:0,markdownDescription:g(649,"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",tl.AFTER_DELAY),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveWorkspaceFilesOnly":{type:"boolean",default:!1,markdownDescription:g(650,"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 {0} is enabled.","`#files.autoSave#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveWhenNoErrors":{type:"boolean",default:!1,markdownDescription:g(651,"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 {0} is enabled.","`#files.autoSave#`"),scope:at.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(652,"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:at.RESOURCE},"files.watcherInclude":{type:"array",items:{type:"string"},default:[],description:g(653,"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:at.RESOURCE},"files.hotExit":D8t,"files.defaultLanguage":{type:"string",markdownDescription:g(654,"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.")},[oje]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(655,"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:at.RESOURCE},[rje]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(656,"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:at.RESOURCE},[YSt]:{type:"boolean",markdownDescription:g(657,"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(658,"Restore the undo stack when a file is reopened."),default:!0},"files.saveConflictResolution":{type:"string",enum:["askUser","overwriteFileOnDisk"],enumDescriptions:[g(659,"Will refuse to save and ask for resolving the save conflict manually."),g(660,"Will resolve the save conflict by overwriting the file on disk with the changes in the editor.")],description:g(661,"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:at.LANGUAGE_OVERRIDABLE},"files.dialog.defaultPath":{type:"string",pattern:"^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$",patternErrorMessage:g(662,"Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."),description:g(663,"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:at.MACHINE},"files.simpleDialog.enable":{type:"boolean",description:g(664,"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(665,"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants.")}}});PNe.registerConfiguration({...Vb,properties:{"editor.formatOnSave":{type:"boolean",description:g(666,"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:at.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(667,"Format the whole file."),g(668,"Format modifications (requires source control)."),g(669,"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(670,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:at.LANGUAGE_OVERRIDABLE}}});PNe.registerConfiguration({...Vb,properties:{"editor.formatOnSave":{type:"boolean",description:g(666,"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:at.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(667,"Format the whole file."),g(668,"Format modifications (requires source control)."),g(669,"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(670,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:at.LANGUAGE_OVERRIDABLE}}});class D4{constructor(){this.type=sn.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=sn.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:sn.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 bit{constructor(e,t){this.uri=e,this.readonly=t,this.type=sn.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:sn.File,permissions:this.readonly?lp.Readonly:void 0}}async delete(){if(this.readonly)throw us("Not allowed",ot.FileWriteLocked);this._onDidDelete.fire()}}const k8t=new TextEncoder;function I8t(s){return s instanceof Uint8Array?s:k8t.encode(s)}class T8t extends bit{constructor(e,t){super(e,!1),this.content=I8t(t)}async getSize(){return this.content.length}async read(){return this.content}async write(e){this.content=e,this._onDidChange.fire()}}class wit extends V{constructor(e){super(),this.memoryFdCounter=0,this.fdMemory=new Map,this.onDidChangeCapabilities=M.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,n,o){const r=this.fdMemory.get(e);if(r==null)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(r).slice(t,t+o);return i.set(a.buffer,n),a.byteLength}write(e,t,i,n,o){const r=this.fdMemory.get(e);if(r==null)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(i).slice(n,n+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 D4,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 D4&&(a=o.getChildren(r)),a==null){if(t)return;throw us("file not found",ot.FileNotFound)}o=a}return o}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof D4)return i;throw us("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===sn.File)return i;throw us("file is a directory",ot.FileIsADirectory)}registerFile(e){const t=e.uri.path.split("/");let i=this._lookupRoot(e.uri.authority),n=e.uri.with({path:"/"});for(const a of t.slice(0,-1)){if(a==="")continue;n=xn.joinPath(n,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(n)),!(c instanceof D4))throw new Error(`file '${n.toString()}' is not a directory`);i=c}const o=t[t.length-1];if(i.getChildren(o)!=null)throw new Error(`file '${xn.joinPath(n,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 n=this._lookupAsFile(e,!1),o=jA(r=>$e.concat(r.map(a=>$e.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(n.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let r=await n.read();(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),o.end(r)}else{const r=(await n.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(us(r,ot.Unknown)),o.end()}})(),o}watch(){return V.None}async writeFile(e,t,i){const n=this._lookup(e,!0);if(n!=null&&!(n instanceof bit))throw us("file is directory",ot.FileIsADirectory);if(n==null)throw us("file not found",ot.FileNotFound);if(!i.overwrite)throw us("file exists already",ot.FileExists);await n.write(t)}async rename(){throw us("Not allowed",ot.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw us("file exists already",ot.FileExists);const t=_i(e),i=Lr(e),n=this._lookupAsDirectory(i,!1),o=new D4,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})})),n.addChild(t,o),this._fireSoon({type:1,resource:e}),o}async mkdir(){throw us("Can' create a directory",ot.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw us("Not found",ot.FileNotFound);if(t.type===sn.Directory)throw us("Can't delete a directory",ot.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 b5e(s){return s.status==="fulfilled"}class yit{constructor(){this.providers=[],this.onDidChangeCapabilities=M.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 n=new Z;return n.add(t.onDidChangeFile(o=>{this._onDidChangeFile.fire(o)})),n.add({dispose:()=>{const o=this.providers.indexOf(i);o>=0&&(this.providers.splice(o,1),this._onDidChangeOverlays.fire())}}),this._onDidChangeOverlays.fire(),n}get delegates(){return this.providers.map(({provider:e})=>e)}async readFromDelegates(e,t){if(this.delegates.length===0)throw us("No delegate",ot.Unavailable);let i;for(const n of this.delegates){if(t!=null&&t.isCancellationRequested)throw new Error("Cancelled");try{return await e(n)}catch(o){if(i??(i=o),o instanceof xA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(o.code))continue;throw o}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw us("No delegate",ot.Unavailable);for(const t of this.delegates)if(!((t.capabilities&2048)>0))try{return await e(t)}catch(i){if(i instanceof xA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(i.code))continue;throw i}throw us("Not allowed",ot.NoPermissions)}async stat(e){return this.readFromDelegates(async t=>{const i=await t.stat(e),n=(t.capabilities&2048)>0;return{...i,permissions:i.permissions??(n?lp.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const n=jA(o=>$e.concat(o.map(r=>$e.wrap(r))).buffer);return this.readFromDelegates(async o=>{if(Nq(o)){const r=o.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;kN(r,{onData(d){l=!0,n.write(d)},onEnd(){n.end(),a()},onError(d){l?n.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)),n.end(r)}},i).catch(o=>{n.error(o)}),n}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(b5e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(b5e).map(i=>i.value).flat()))}watch(e,t){const i=new Z;for(const n of this.delegates)i.add(n.watch(e,t));return i}async writeFile(e,t,i){await this.writeToDelegates(async n=>{let o;try{o=await n.stat(e)}catch{}if(o!=null&&((o.permissions??0)&lp.Readonly)>0)throw us("Not allowed",ot.NoPermissions);return n.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(n=>n.rename(e,t,i))}}class L8t extends aee{async writeFile(e,t,i){return await _it(xn,this,xn.dirname(e)),super.writeFile(e,t,i)}}const Cit=new yit;Cit.register(0,new L8t);const R8t=new wit(!0),Sit=new aee;Sit.mkdir(N.from({scheme:pe.vscodeUserData,path:"/User/"}));var hee;(function(s){s.extensionFile="extension-file"})(hee||(hee={}));const Ait={[hee.extensionFile]:R8t,[ltt.scheme]:new aee,[pe.vscodeUserData]:Sit,[pe.tmp]:new aee,[pe.file]:Cit};let hAe=class extends tAe{constructor(e,t){super(e);for(const[i,n]of Object.entries(Ait)){let o=this.registerProvider(i,n);n instanceof yit&&n.onDidChangeOverlays(()=>{o.dispose(),o=this.registerProvider(i,n)}),n instanceof o8t&&this._register(n.onReportError(r=>t.publicLog2("indexedDBFileSystemProviderError",r)))}}};hAe=D([_(1,Yi)],hAe);const Eit=new r8t;pNe(async s=>{Eit.logger=s.get(Ge)});function Rce(){return{[Jt.toString()]:new wi(hAe,[Eit],!0),[Fo.toString()]:new wi(cAe,[],!0),[_d.toString()]:new wi(dAe,[],!0),[F6.toString()]:new wi(x8t,[],!0)}}function M8t(s,e){btt(),Ait[s]=e}function N8t(s,e){if(s.length===0)return Promise.resolve(!1);const t=[];let i=!1;for(const n of s){if(n===!0)return Promise.resolve(!0);Qy(n)&&t.push(n.then(o=>{o&&(i=!0)},o=>{e(o),i=!0}))}return Zs.settled(t).then(()=>i)}var qW;(function(s){s[s.WebSocket=0]="WebSocket",s[s.Managed=1]="Managed"})(qW||(qW={}));class xit{constructor(e){this.id=e,this.type=qW.Managed}toString(){return`Managed(${this.id})`}}class Dit{constructor(e,t){this.host=e,this.port=t,this.type=qW.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var ed;(function(s){s.Unknown="Unknown",s.NotAvailable="NotAvailable",s.TemporarilyNotAvailable="TemporarilyNotAvailable",s.NoResolverFound="NoResolverFound",s.InvalidAuthority="InvalidAuthority"})(ed||(ed={}));let fD=class C0 extends La{static isNotAvailable(e){return e instanceof C0&&e._code===ed.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof C0&&e._code===ed.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof C0&&e._code===ed.NoResolverFound}static isInvalidAuthority(e){return e instanceof C0&&e._code===ed.InvalidAuthority}static isHandled(e){return e instanceof C0&&e.isHandled}constructor(e,t=ed.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===ed.NotAvailable&&i===!0,Object.setPrototypeOf(this,C0.prototype)}};function uee(s){const e=s.indexOf("+");return e===-1?s:s.substring(0,e)}class P8t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class pD{static isHostExtension(e,t,i){if(t.getExtensionDescription(e))return!1;const n=i.getExtensionDescription(e);return n?!!((n.main||n.browser)&&n.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(U8t),this._extensionsMap=new va,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=w5e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=pD._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=w5e(this._extensionDescriptions,i.map(n=>n.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new P8t(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=>n.add(a));const o=t.getNodes().filter(a=>!n.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 F8t(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 F8t{constructor(e,t){this.versionId=e,this.extensions=t}}class O8t{constructor(e){this._lock=new H8t,this._actual=new pD(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new B8t(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 B8t extends V{constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class W8t{constructor(e){this.name=e;const t=M2();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class H8t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new W8t(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),n=()=>{t&&(clearTimeout(i),t=!1,this._isLocked=!1,this._advance())};e.resolve(Ee(n))}}var FE;(function(s){s[s.Builtin=0]="Builtin",s[s.User=1]="User",s[s.Dev=2]="Dev"})(FE||(FE={}));function U8t(s,e){const t=s.isBuiltin?FE.Builtin:s.isUnderDevelopment?FE.Dev:FE.User,i=e.isBuiltin?FE.Builtin:e.isUnderDevelopment?FE.Dev:FE.User;if(t!==i)return t-i;const n=Vi.basename(s.extensionLocation.path),o=Vi.basename(e.extensionLocation.path);return no?1:0}function w5e(s,e){const t=new A_(e);return s.filter(i=>!t.has(i.identifier))}function FNe(s){const e=s.isExtensionDevelopment;let t=!0;const i=s.extensionDevelopmentLocationURI;if(i)for(const a of i)a.scheme!==pe.file&&(t=!1);const n=t&&typeof s.debugExtensionHost.port=="number",o=t&&!!s.debugExtensionHost.break,r=e&&!!s.extensionTestsLocationURI&&!s.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:n,isExtensionDevDebugBrk:o,isExtensionDevTestFromCli:r}}var lo;(function(s){s[s.LocalProcess=1]="LocalProcess",s[s.LocalWebWorker=2]="LocalWebWorker",s[s.Remote=3]="Remote"})(lo||(lo={}));function pS(s){if(s===null)return"None";switch(s){case lo.LocalProcess:return"LocalProcess";case lo.LocalWebWorker:return"LocalWebWorker";case lo.Remote:return"Remote"}}var Qg;(function(s){s[s.None=0]="None",s[s.Local=1]="Local",s[s.Remote=2]="Remote"})(Qg||(Qg={}));function V8t(s){switch(s){case Qg.None:return"None";case Qg.Local:return"Local";case Qg.Remote:return"Remote"}}function z8t(s,e,t,i){const n=y5e(s,t),o=y5e(e,t),r=new Map,a=l=>{if(r.has(l.key))return;const d=n.get(l.key)||null,h=o.get(l.key)||null,u=new G8t(d,h);r.set(u.key,u)};n.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=Qg.None;u&&!f?p=Qg.Local:f&&!u&&(p=Qg.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function y5e(s,e){const t=new Map;return s.forEach(i=>{const n=new $8t(i,e(i));t.set(n.key,n)}),t}class $8t{constructor(e,t){this.desc=e,this.kind=t}get key(){return Sn.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class G8t{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 Gi(s){return function(e){QW.INSTANCE.registerNamedCustomer(s,e)}}function QN(s){QW.INSTANCE.registerCustomer(s)}var gee;(function(s){function e(){return QW.INSTANCE.getNamedCustomers()}s.getNamedCustomers=e;function t(){return QW.INSTANCE.getCustomers()}s.getCustomers=t})(gee||(gee={}));const Uoe=class Uoe{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}};Uoe.INSTANCE=new Uoe;let QW=Uoe;function kit(s,e,t,i){if(!s||i>200)return null;if(typeof s=="object"){if(s.$mid===ws.Uri)return t?N.revive(e.transformIncoming(s)):e.transformIncoming(s);if(s instanceof $e)return null;for(const n in s)if(Object.hasOwnProperty.call(s,n)){const o=kit(s[n],e,t,i+1);o!==null&&(s[n]=o)}}return null}function k4(s,e){const t=kit(s,e,!1,0);return t===null?s:t}class Iit{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):vt(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 K8t extends Iit{constructor(){super(),this._hasErr=!0,this._err=new Ma}}const Voe=class Voe{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++Voe.count}};Voe.count=0;let fee=Voe;const Tit=[];function je(s){const e=new fee(s);return Tit[e.nid]=e,e}function NK(s){return Tit[s].sid}class jd{constructor(e){this.value=e}}var C5e;function uAe(s,e){try{return JSON.stringify(s,e)}catch{return"null"}}const ONe="$$ref$$",q8t={[ONe]:-1};function S5e(s,e=null,t=!1){const i=[];return{jsonString:(t?uAe:JSON.stringify)(s,(o,r)=>{if(typeof r>"u")return q8t;if(typeof r=="object"){if(r instanceof $e){const a=i.push(r)-1;return{[ONe]:a}}if(e)return e(o,r)}return r}),referencedBuffers:i}}function Lit(s,e,t){return JSON.parse(s,(i,n)=>{if(n){const o=n[ONe];if(typeof o=="number")return e[o];if(t&&n.$mid===ws.Uri)return t.transformIncoming(n)}return n})}function A5e(s,e){return JSON.stringify(s,e)}function Q8t(s){return s?(e,t)=>t&&t.$mid===ws.Uri?s.transformOutgoing(t):t:null}var Rg;(function(s){s[s.LocalSide=0]="LocalSide",s[s.OtherSide=1]="OtherSide"})(Rg||(Rg={}));var OT;(function(s){s[s.Responsive=0]="Responsive",s[s.Unresponsive=1]="Unresponsive"})(OT||(OT={}));const j8t=()=>{},Y8t=Symbol.for("rpcProtocol"),J8t=Symbol.for("rpcProxy"),Xz=class Xz extends V{constructor(e,t=null,i=null){super(),this[C5e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=Q8t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let n=0,o=fee.count;nthis._checkUnresponsive(),1e3)),this._register(this._protocol.onMessage(n=>this._receiveOneMessage(n)))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{const t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(xy())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+Xz.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+Xz.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(OT.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(OT.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?k4(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:(n,o)=>(typeof o=="string"&&!n[o]&&o.charCodeAt(0)===B.DollarSign&&(n[o]=(...r)=>this._remoteCall(e,o,r)),o===J8t?t:n[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,n,o),l=j8t;this._cancelInvokedHandlers[a]=l;const d=Ep.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,Rg.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=Ep.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,Rg.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=Ep.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,Rg.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,Rg.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,Rg.LocalSide,"receiveReply:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const o=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n],o.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,Rg.LocalSide,"receiveReplyErr:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const o=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n];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(n){return Promise.reject(n)}}_doInvokeHandler(e,t,i){const n=this._locals[e];if(!n)throw new Error("Unknown actor "+NK(e));const o=n[t];if(typeof o!="function")throw new Error("Unknown method "+t+" on actor "+NK(e));return o.apply(n,i)}_remoteCall(e,t,i){if(this._isDisposed)return new K8t;let n=null;if(i.length>0&&He.isCancellationToken(i[i.length-1])&&(n=i.pop()),n&&n.isCancellationRequested)return Promise.reject(xy());const o=Ep.serializeRequestArguments(i,this._uriReplacer),r=++this._lastMessageId,a=String(r),c=new Iit,l=new Z;n&&l.add(n.onCancellationRequested(()=>{const h=Ep.serializeCancel(r);this._logger?.logOutgoing(h.byteLength,r,Rg.LocalSide,"cancel"),this._protocol.send(Ep.serializeCancel(r))})),this._pendingRPCReplies[a]=new X8t(c,l),this._onWillSendRequest(r);const d=Ep.serializeRequest(r,e,t,o,!!n);return this._logger?.logOutgoing(d.byteLength,r,Rg.LocalSide,`request: ${NK(e)}.${t}(`,i),this._protocol.send(d),c}};C5e=Y8t,Xz.UNRESPONSIVE_TIME=3*1e3;let pee=Xz;class X8t{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 wk;let Tc=(wk=class{static alloc(e,t,i){const n=new wk($e.alloc(i+1+4),0);return n.writeUInt8(e),n.writeUInt32(t),n}static read(e,t){return new wk(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,n=e.length;i"u")return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){const i=[];for(let n=0,o=e.length;n"u")i[n]={type:wl.Undefined};else if(r instanceof jd){const{jsonString:a,referencedBuffers:c}=S5e(r.value,t);i[n]={type:wl.SerializedObjectWithBuffers,value:$e.fromString(a),buffers:c}}else i[n]={type:wl.String,value:$e.fromString(A5e(r,t))}}return{type:CF.Mixed,args:i}}return{type:CF.Simple,args:A5e(e,t)}}static serializeRequest(e,t,i,n,o){switch(n.type){case CF.Simple:return this._requestJSONArgs(e,t,i,n.args,o);case CF.Mixed:return this._requestMixedArgs(e,t,i,n.args,o)}}static _requestJSONArgs(e,t,i,n,o){const r=$e.fromString(i),a=$e.fromString(n);let c=0;c+=Tc.sizeUInt8(),c+=Tc.sizeShortString(r),c+=Tc.sizeLongString(a);const l=Tc.alloc(o?ga.RequestJSONArgsWithCancellation:ga.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(),n=e.readLongString();return{rpcId:t,method:i,args:JSON.parse(n)}}static _requestMixedArgs(e,t,i,n,o){const r=$e.fromString(i);let a=0;a+=Tc.sizeUInt8(),a+=Tc.sizeShortString(r),a+=Tc.sizeMixedArray(n);const c=Tc.alloc(o?ga.RequestMixedArgsWithCancellation:ga.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(r),c.writeMixedArray(n),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),n=e.readMixedArray(),o=new Array(n.length);for(let r=0,a=n.length;r"u")return this._serializeReplyOKEmpty(e);if(t instanceof $e)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof jd){const{jsonString:n,referencedBuffers:o}=S5e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,n,o)}else return this._serializeReplyOKJSON(e,uAe(t,i))}static _serializeReplyOKEmpty(e){return Tc.alloc(ga.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=Tc.sizeVSBuffer(t);const n=Tc.alloc(ga.ReplyOKVSBuffer,e,i);return n.writeVSBuffer(t),n.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=$e.fromString(t);let n=0;n+=Tc.sizeLongString(i);const o=Tc.alloc(ga.ReplyOKJSON,e,n);return o.writeLongString(i),o.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const n=$e.fromString(t);let o=0;o+=Tc.sizeUInt32,o+=Tc.sizeLongString(n);for(const a of i)o+=Tc.sizeVSBuffer(a);const r=Tc.alloc(ga.ReplyOKJSONWithBuffers,e,o);r.writeUInt32(i.length),r.writeLongString(n);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(),n=e.readLongString(),o=[];for(let r=0;r{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:pS(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${pS(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:pS(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,Nb.Normal)),this._register(i3t({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 n=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=>{n=l},_setAllMainProxyIdentifiers:l=>{o=l}},a=gee.getNamedCustomers();for(let l=0,d=a.length;l`[${pS(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${uee(e)},${t})][${i.elapsed()}ms] `,o=l=>this._logService.info(`${n()}${l}`),r=(l,d=void 0)=>this._logService.error(`${n()}${l}`,d);o("obtaining proxy...");const a=await this._proxy;if(!a)return r("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:ed.Unknown,detail:void 0}};o("invoking...");const c=new J7;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:ed.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 n=await this._proxy;if(!n)return;const o=this._extensionHost.extensions.set(e,t,i);return n.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)}};mee=qQ=D([_(3,we),_(4,Jr),_(5,Yi),_(6,Ge)],mee);function Rit(s,e){return e?`${pS(s)} pid: ${e}`:`${pS(s)}`}const Z8t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function E5e(s){if(Array.isArray(s))return s;if(s&&typeof s=="object"&&typeof s.toString=="function"){const e=s.toString();if(e!=="[object Object]")return e}return s}function e3t(s){return Array.isArray(s)?s.map(E5e):E5e(s)}class t3t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,n,o,r,a){a=e3t(a);const c=Z8t[o],l=c[n%c.length];let d=[`%c[${pS(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(n).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,n,o){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,n,o)}logOutgoing(e,t,i,n,o){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,n,o)}}let _ee=class{static isEnabled(){return Math.trunc(Math.random()*1e3)<.5}constructor(e){this._telemetryService=e,this._pendingRequests=new Map}logIncoming(e,t,i,n){if(i===Rg.LocalSide&&/^receiveReply(Err)?:/.test(n)){const o=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n} ${o}`,length:e})}i===Rg.OtherSide&&/^receiveRequest /.test(n)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n}`,length:e})}logOutgoing(e,t,i,n){i===Rg.LocalSide&&n.startsWith("request: ")&&(this._pendingRequests.set(t,n),this._telemetryService.publicLog2("extensionhost.outgoing",{type:n,length:e}))}};_ee=D([_(0,Yi)],_ee);const LV=[];function i3t(s){return LV.push(s),{dispose:()=>{for(let e=0;en.measure()));t.openEditor({resource:void 0,contents:i.map(QQ._print).join(` +`,"auto"],enumDescriptions:[g(635,"LF"),g(636,"CRLF"),g(637,"Uses operating system specific end of line character.")],default:"auto",description:g(638,"The default end of line character."),scope:at.LANGUAGE_OVERRIDABLE},"files.enableTrash":{type:"boolean",default:!0,description:g(639,"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(640,"When enabled, will trim trailing whitespace when saving a file."),scope:at.LANGUAGE_OVERRIDABLE},"files.trimTrailingWhitespaceInRegexAndStrings":{type:"boolean",default:!0,description:g(641,"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:at.LANGUAGE_OVERRIDABLE},"files.insertFinalNewline":{type:"boolean",default:!1,description:g(642,"When enabled, insert a final new line at the end of the file when saving it."),scope:at.LANGUAGE_OVERRIDABLE},"files.trimFinalNewlines":{type:"boolean",default:!1,description:g(643,"When enabled, will trim all new lines after the final new line at the end of the file when saving it."),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSave":{type:"string",enum:[el.OFF,el.AFTER_DELAY,el.ON_FOCUS_CHANGE,el.ON_WINDOW_CHANGE],markdownEnumDescriptions:[g(644,"An editor with changes is never automatically saved."),g(645,"An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."),g(646,"An editor with changes is automatically saved when the editor loses focus."),g(647,"An editor with changes is automatically saved when the window loses focus.")],default:Wn?el.AFTER_DELAY:el.OFF,markdownDescription:g(648,"Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.",el.OFF,el.AFTER_DELAY,el.ON_FOCUS_CHANGE,el.ON_WINDOW_CHANGE,el.AFTER_DELAY),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveDelay":{type:"number",default:1e3,minimum:0,markdownDescription:g(649,"Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.",el.AFTER_DELAY),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveWorkspaceFilesOnly":{type:"boolean",default:!1,markdownDescription:g(650,"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 {0} is enabled.","`#files.autoSave#`"),scope:at.LANGUAGE_OVERRIDABLE},"files.autoSaveWhenNoErrors":{type:"boolean",default:!1,markdownDescription:g(651,"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 {0} is enabled.","`#files.autoSave#`"),scope:at.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(652,"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:at.RESOURCE},"files.watcherInclude":{type:"array",items:{type:"string"},default:[],description:g(653,"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:at.RESOURCE},"files.hotExit":m8t,"files.defaultLanguage":{type:"string",markdownDescription:g(654,"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.")},[JQe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(655,"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:at.RESOURCE},[XQe]:{type:"object",patternProperties:{".*":{type:"boolean"}},default:{},markdownDescription:g(656,"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:at.RESOURCE},[WSt]:{type:"boolean",markdownDescription:g(657,"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(658,"Restore the undo stack when a file is reopened."),default:!0},"files.saveConflictResolution":{type:"string",enum:["askUser","overwriteFileOnDisk"],enumDescriptions:[g(659,"Will refuse to save and ask for resolving the save conflict manually."),g(660,"Will resolve the save conflict by overwriting the file on disk with the changes in the editor.")],description:g(661,"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:at.LANGUAGE_OVERRIDABLE},"files.dialog.defaultPath":{type:"string",pattern:"^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$",patternErrorMessage:g(662,"Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."),description:g(663,"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:at.MACHINE},"files.simpleDialog.enable":{type:"boolean",description:g(664,"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(665,"Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants.")}}});SNe.registerConfiguration({...Wb,properties:{"editor.formatOnSave":{type:"boolean",description:g(666,"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:at.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(667,"Format the whole file."),g(668,"Format modifications (requires source control)."),g(669,"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(670,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:at.LANGUAGE_OVERRIDABLE}}});SNe.registerConfiguration({...Wb,properties:{"editor.formatOnSave":{type:"boolean",description:g(666,"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:at.LANGUAGE_OVERRIDABLE},"editor.formatOnSaveMode":{type:"string",default:"file",enum:["file","modifications","modificationsIfAvailable"],enumDescriptions:[g(667,"Format the whole file."),g(668,"Format modifications (requires source control)."),g(669,"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(670,"Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."),scope:at.LANGUAGE_OVERRIDABLE}}});class C4{constructor(){this.type=sn.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=sn.Directory,this.entries=new Map}async stats(){return{ctime:this.ctime,mtime:this.mtime,size:0,type:sn.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 hit{constructor(e,t){this.uri=e,this.readonly=t,this.type=sn.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:sn.File,permissions:this.readonly?rp.Readonly:void 0}}async delete(){if(this.readonly)throw us("Not allowed",ot.FileWriteLocked);this._onDidDelete.fire()}}const _8t=new TextEncoder;function v8t(s){return s instanceof Uint8Array?s:_8t.encode(s)}class b8t extends hit{constructor(e,t){super(e,!1),this.content=v8t(t)}async getSize(){return this.content.length}async read(){return this.content}async write(e){this.content=e,this._onDidChange.fire()}}class uit extends V{constructor(e){super(),this.memoryFdCounter=0,this.fdMemory=new Map,this.onDidChangeCapabilities=M.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,n,o){const r=this.fdMemory.get(e);if(r==null)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(r).slice(t,t+o);return i.set(a.buffer,n),a.byteLength}write(e,t,i,n,o){const r=this.fdMemory.get(e);if(r==null)throw us("No file with that descriptor open",ot.Unavailable);const a=$e.wrap(i).slice(n,n+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 C4,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 C4&&(a=o.getChildren(r)),a==null){if(t)return;throw us("file not found",ot.FileNotFound)}o=a}return o}_lookupAsDirectory(e,t){const i=this._lookup(e,t);if(i instanceof C4)return i;throw us("file not a directory",ot.FileNotADirectory)}_lookupAsFile(e,t){const i=this._lookup(e,t);if(i!=null&&i.type===sn.File)return i;throw us("file is a directory",ot.FileIsADirectory)}registerFile(e){const t=e.uri.path.split("/");let i=this._lookupRoot(e.uri.authority),n=e.uri.with({path:"/"});for(const a of t.slice(0,-1)){if(a==="")continue;n=xn.joinPath(n,a);let c=i.getChildren(a);if(c==null&&(c=this.mkdirSync(n)),!(c instanceof C4))throw new Error(`file '${n.toString()}' is not a directory`);i=c}const o=t[t.length-1];if(i.getChildren(o)!=null)throw new Error(`file '${xn.joinPath(n,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 n=this._lookupAsFile(e,!1),o=qA(r=>$e.concat(r.map(a=>$e.wrap(a))).buffer,{highWaterMark:10});return(async()=>{try{if(n.readStream==null||typeof t.length=="number"||typeof t.position=="number"){let r=await n.read();(typeof t.position=="number"||typeof t.length=="number")&&(r=r.slice(t.position??0,t.length)),o.end(r)}else{const r=(await n.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(us(r,ot.Unknown)),o.end()}})(),o}watch(){return V.None}async writeFile(e,t,i){const n=this._lookup(e,!0);if(n!=null&&!(n instanceof hit))throw us("file is directory",ot.FileIsADirectory);if(n==null)throw us("file not found",ot.FileNotFound);if(!i.overwrite)throw us("file exists already",ot.FileExists);await n.write(t)}async rename(){throw us("Not allowed",ot.NoPermissions)}mkdirSync(e){if(this._lookup(e,!0)!=null)throw us("file exists already",ot.FileExists);const t=_i(e),i=Lr(e),n=this._lookupAsDirectory(i,!1),o=new C4,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})})),n.addChild(t,o),this._fireSoon({type:1,resource:e}),o}async mkdir(){throw us("Can' create a directory",ot.NoPermissions)}deleteSync(e){const t=this._lookup(e,!0);if(t==null)throw us("Not found",ot.FileNotFound);if(t.type===sn.Directory)throw us("Can't delete a directory",ot.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 a5e(s){return s.status==="fulfilled"}class git{constructor(){this.providers=[],this.onDidChangeCapabilities=M.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 n=new Z;return n.add(t.onDidChangeFile(o=>{this._onDidChangeFile.fire(o)})),n.add({dispose:()=>{const o=this.providers.indexOf(i);o>=0&&(this.providers.splice(o,1),this._onDidChangeOverlays.fire())}}),this._onDidChangeOverlays.fire(),n}get delegates(){return this.providers.map(({provider:e})=>e)}async readFromDelegates(e,t){if(this.delegates.length===0)throw us("No delegate",ot.Unavailable);let i;for(const n of this.delegates){if(t!=null&&t.isCancellationRequested)throw new Error("Cancelled");try{return await e(n)}catch(o){if(i??(i=o),o instanceof AA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(o.code))continue;throw o}}throw i}async writeToDelegates(e){if(this.delegates.length===0)throw us("No delegate",ot.Unavailable);for(const t of this.delegates)if(!((t.capabilities&2048)>0))try{return await e(t)}catch(i){if(i instanceof AA&&[ot.NoPermissions,ot.FileNotFound,ot.Unavailable].includes(i.code))continue;throw i}throw us("Not allowed",ot.NoPermissions)}async stat(e){return this.readFromDelegates(async t=>{const i=await t.stat(e),n=(t.capabilities&2048)>0;return{...i,permissions:i.permissions??(n?rp.Readonly:void 0)}})}async readFile(e){return this.readFromDelegates(t=>t.readFile(e))}readFileStream(e,t,i){const n=qA(o=>$e.concat(o.map(r=>$e.wrap(r))).buffer);return this.readFromDelegates(async o=>{if(Rq(o)){const r=o.readFileStream(e,t,i);await new Promise((a,c)=>{let l=!1;AN(r,{onData(d){l=!0,n.write(d)},onEnd(){n.end(),a()},onError(d){l?n.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)),n.end(r)}},i).catch(o=>{n.error(o)}),n}async readdir(e){const t=await Promise.allSettled(this.delegates.map(async i=>i.readdir(e)));if(!t.some(a5e))throw t[0].reason;return Object.entries(Object.fromEntries(t.filter(a5e).map(i=>i.value).flat()))}watch(e,t){const i=new Z;for(const n of this.delegates)i.add(n.watch(e,t));return i}async writeFile(e,t,i){await this.writeToDelegates(async n=>{let o;try{o=await n.stat(e)}catch{}if(o!=null&&((o.permissions??0)&rp.Readonly)>0)throw us("Not allowed",ot.NoPermissions);return n.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(n=>n.rename(e,t,i))}}class w8t extends oee{async writeFile(e,t,i){return await lit(xn,this,xn.dirname(e)),super.writeFile(e,t,i)}}const fit=new git;fit.register(0,new w8t);const y8t=new uit(!0),pit=new oee;pit.mkdir(N.from({scheme:pe.vscodeUserData,path:"/User/"}));var lee;(function(s){s.extensionFile="extension-file"})(lee||(lee={}));const mit={[lee.extensionFile]:y8t,[ttt.scheme]:new oee,[pe.vscodeUserData]:pit,[pe.tmp]:new oee,[pe.file]:fit};let oAe=class extends jSe{constructor(e,t){super(e);for(const[i,n]of Object.entries(mit)){let o=this.registerProvider(i,n);n instanceof git&&n.onDidChangeOverlays(()=>{o.dispose(),o=this.registerProvider(i,n)}),n instanceof Qzt&&this._register(n.onReportError(r=>t.publicLog2("indexedDBFileSystemProviderError",r)))}}};oAe=D([_(1,Yi)],oAe);const _it=new jzt;nNe(async s=>{_it.logger=s.get(Ge)});function kce(){return{[Jt.toString()]:new wi(oAe,[_it],!0),[Fo.toString()]:new wi(iAe,[],!0),[pd.toString()]:new wi(sAe,[],!0),[R6.toString()]:new wi(p8t,[],!0)}}function C8t(s,e){htt(),mit[s]=e}function S8t(s,e){if(s.length===0)return Promise.resolve(!1);const t=[];let i=!1;for(const n of s){if(n===!0)return Promise.resolve(!0);Gy(n)&&t.push(n.then(o=>{o&&(i=!0)},o=>{e(o),i=!0}))}return Zs.settled(t).then(()=>i)}var zW;(function(s){s[s.WebSocket=0]="WebSocket",s[s.Managed=1]="Managed"})(zW||(zW={}));class vit{constructor(e){this.id=e,this.type=zW.Managed}toString(){return`Managed(${this.id})`}}class bit{constructor(e,t){this.host=e,this.port=t,this.type=zW.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var Xl;(function(s){s.Unknown="Unknown",s.NotAvailable="NotAvailable",s.TemporarilyNotAvailable="TemporarilyNotAvailable",s.NoResolverFound="NoResolverFound",s.InvalidAuthority="InvalidAuthority"})(Xl||(Xl={}));let hD=class b0 extends La{static isNotAvailable(e){return e instanceof b0&&e._code===Xl.NotAvailable}static isTemporarilyNotAvailable(e){return e instanceof b0&&e._code===Xl.TemporarilyNotAvailable}static isNoResolverFound(e){return e instanceof b0&&e._code===Xl.NoResolverFound}static isInvalidAuthority(e){return e instanceof b0&&e._code===Xl.InvalidAuthority}static isHandled(e){return e instanceof b0&&e.isHandled}constructor(e,t=Xl.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,this.isHandled=t===Xl.NotAvailable&&i===!0,Object.setPrototypeOf(this,b0.prototype)}};function dee(s){const e=s.indexOf("+");return e===-1?s:s.substring(0,e)}class A8t{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class uD{static isHostExtension(e,t,i){if(t.getExtensionDescription(e))return!1;const n=i.getExtensionDescription(e);return n?!!((n.main||n.browser)&&n.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(T8t),this._extensionsMap=new va,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=c5e(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=uD._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=c5e(this._extensionDescriptions,i.map(n=>n.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new A8t(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=>n.add(a));const o=t.getNodes().filter(a=>!n.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 E8t(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 E8t{constructor(e,t){this.versionId=e,this.extensions=t}}class x8t{constructor(e){this._lock=new I8t,this._actual=new uD(e,[])}async acquireLock(e){const t=await this._lock.acquire(e);return new D8t(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 D8t extends V{constructor(e,t){super(),this._registry=e,this._isDisposed=!1,this._register(t)}isAcquiredFor(e){return!this._isDisposed&&this._registry===e}}class k8t{constructor(e){this.name=e;const t=I2();this.promise=t.promise,this._resolve=t.resolve}resolve(e){this._resolve(e)}}class I8t{constructor(){this._pendingCustomers=[],this._isLocked=!1}async acquire(e){const t=new k8t(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),n=()=>{t&&(clearTimeout(i),t=!1,this._isLocked=!1,this._advance())};e.resolve(Ee(n))}}var ME;(function(s){s[s.Builtin=0]="Builtin",s[s.User=1]="User",s[s.Dev=2]="Dev"})(ME||(ME={}));function T8t(s,e){const t=s.isBuiltin?ME.Builtin:s.isUnderDevelopment?ME.Dev:ME.User,i=e.isBuiltin?ME.Builtin:e.isUnderDevelopment?ME.Dev:ME.User;if(t!==i)return t-i;const n=Vi.basename(s.extensionLocation.path),o=Vi.basename(e.extensionLocation.path);return no?1:0}function c5e(s,e){const t=new y_(e);return s.filter(i=>!t.has(i.identifier))}function ANe(s){const e=s.isExtensionDevelopment;let t=!0;const i=s.extensionDevelopmentLocationURI;if(i)for(const a of i)a.scheme!==pe.file&&(t=!1);const n=t&&typeof s.debugExtensionHost.port=="number",o=t&&!!s.debugExtensionHost.break,r=e&&!!s.extensionTestsLocationURI&&!s.debugExtensionHost.debugId;return{isExtensionDevHost:e,isExtensionDevDebug:n,isExtensionDevDebugBrk:o,isExtensionDevTestFromCli:r}}var lo;(function(s){s[s.LocalProcess=1]="LocalProcess",s[s.LocalWebWorker=2]="LocalWebWorker",s[s.Remote=3]="Remote"})(lo||(lo={}));function fS(s){if(s===null)return"None";switch(s){case lo.LocalProcess:return"LocalProcess";case lo.LocalWebWorker:return"LocalWebWorker";case lo.Remote:return"Remote"}}var Gg;(function(s){s[s.None=0]="None",s[s.Local=1]="Local",s[s.Remote=2]="Remote"})(Gg||(Gg={}));function L8t(s){switch(s){case Gg.None:return"None";case Gg.Local:return"Local";case Gg.Remote:return"Remote"}}function R8t(s,e,t,i){const n=l5e(s,t),o=l5e(e,t),r=new Map,a=l=>{if(r.has(l.key))return;const d=n.get(l.key)||null,h=o.get(l.key)||null,u=new N8t(d,h);r.set(u.key,u)};n.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=Gg.None;u&&!f?p=Gg.Local:f&&!u&&(p=Gg.Remote),c.set(l.key,i(l.identifier,l.kind,d,h,p))}),c}function l5e(s,e){const t=new Map;return s.forEach(i=>{const n=new M8t(i,e(i));t.set(n.key,n)}),t}class M8t{constructor(e,t){this.desc=e,this.kind=t}get key(){return Sn.toKey(this.desc.identifier)}get isUnderDevelopment(){return this.desc.isUnderDevelopment}}class N8t{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 Gi(s){return function(e){$W.INSTANCE.registerNamedCustomer(s,e)}}function $N(s){$W.INSTANCE.registerCustomer(s)}var hee;(function(s){function e(){return $W.INSTANCE.getNamedCustomers()}s.getNamedCustomers=e;function t(){return $W.INSTANCE.getCustomers()}s.getCustomers=t})(hee||(hee={}));const Ooe=class Ooe{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}};Ooe.INSTANCE=new Ooe;let $W=Ooe;function wit(s,e,t,i){if(!s||i>200)return null;if(typeof s=="object"){if(s.$mid===ws.Uri)return t?N.revive(e.transformIncoming(s)):e.transformIncoming(s);if(s instanceof $e)return null;for(const n in s)if(Object.hasOwnProperty.call(s,n)){const o=wit(s[n],e,t,i+1);o!==null&&(s[n]=o)}}return null}function S4(s,e){const t=wit(s,e,!1,0);return t===null?s:t}class yit{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):vt(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 P8t extends yit{constructor(){super(),this._hasErr=!0,this._err=new Ma}}const Boe=class Boe{constructor(e){this._proxyIdentifierBrand=void 0,this.sid=e,this.nid=++Boe.count}};Boe.count=0;let uee=Boe;const Cit=[];function je(s){const e=new uee(s);return Cit[e.nid]=e,e}function LK(s){return Cit[s].sid}class qd{constructor(e){this.value=e}}var d5e;function rAe(s,e){try{return JSON.stringify(s,e)}catch{return"null"}}const ENe="$$ref$$",F8t={[ENe]:-1};function h5e(s,e=null,t=!1){const i=[];return{jsonString:(t?rAe:JSON.stringify)(s,(o,r)=>{if(typeof r>"u")return F8t;if(typeof r=="object"){if(r instanceof $e){const a=i.push(r)-1;return{[ENe]:a}}if(e)return e(o,r)}return r}),referencedBuffers:i}}function Sit(s,e,t){return JSON.parse(s,(i,n)=>{if(n){const o=n[ENe];if(typeof o=="number")return e[o];if(t&&n.$mid===ws.Uri)return t.transformIncoming(n)}return n})}function u5e(s,e){return JSON.stringify(s,e)}function O8t(s){return s?(e,t)=>t&&t.$mid===ws.Uri?s.transformOutgoing(t):t:null}var Ig;(function(s){s[s.LocalSide=0]="LocalSide",s[s.OtherSide=1]="OtherSide"})(Ig||(Ig={}));var MT;(function(s){s[s.Responsive=0]="Responsive",s[s.Unresponsive=1]="Unresponsive"})(MT||(MT={}));const B8t=()=>{},W8t=Symbol.for("rpcProtocol"),H8t=Symbol.for("rpcProxy"),jz=class jz extends V{constructor(e,t=null,i=null){super(),this[d5e]=!0,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=i,this._uriReplacer=O8t(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let n=0,o=uee.count;nthis._checkUnresponsive(),1e3)),this._register(this._protocol.onMessage(n=>this._receiveOneMessage(n)))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{const t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(Sy())}),super.dispose()}drain(){return typeof this._protocol.drain=="function"?this._protocol.drain():Promise.resolve()}_onWillSendRequest(e){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+jz.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(e){this._unresponsiveTime=Date.now()+jz.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(MT.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(MT.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?S4(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:(n,o)=>(typeof o=="string"&&!n[o]&&o.charCodeAt(0)===B.DollarSign&&(n[o]=(...r)=>this._remoteCall(e,o,r)),o===H8t?t:n[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,n,o),l=B8t;this._cancelInvokedHandlers[a]=l;const d=Cp.serializeAcknowledged(t);this._logger?.logOutgoing(d.byteLength,t,Ig.OtherSide,"ack"),this._protocol.send(d),c.then(h=>{delete this._cancelInvokedHandlers[a];const u=Cp.serializeReplyOK(t,h,this._uriReplacer);this._logger?.logOutgoing(u.byteLength,t,Ig.OtherSide,"reply:",h),this._protocol.send(u)},h=>{delete this._cancelInvokedHandlers[a];const u=Cp.serializeReplyErr(t,h);this._logger?.logOutgoing(u.byteLength,t,Ig.OtherSide,"replyErr:",h),this._protocol.send(u)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,Ig.OtherSide,"receiveCancel");const i=String(t);this._cancelInvokedHandlers[i]?.()}_receiveReply(e,t,i){this._logger?.logIncoming(e,t,Ig.LocalSide,"receiveReply:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const o=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n],o.resolveOk(i)}_receiveReplyErr(e,t,i){this._logger?.logIncoming(e,t,Ig.LocalSide,"receiveReplyErr:",i);const n=String(t);if(!this._pendingRPCReplies.hasOwnProperty(n))return;const o=this._pendingRPCReplies[n];delete this._pendingRPCReplies[n];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(n){return Promise.reject(n)}}_doInvokeHandler(e,t,i){const n=this._locals[e];if(!n)throw new Error("Unknown actor "+LK(e));const o=n[t];if(typeof o!="function")throw new Error("Unknown method "+t+" on actor "+LK(e));return o.apply(n,i)}_remoteCall(e,t,i){if(this._isDisposed)return new P8t;let n=null;if(i.length>0&&He.isCancellationToken(i[i.length-1])&&(n=i.pop()),n&&n.isCancellationRequested)return Promise.reject(Sy());const o=Cp.serializeRequestArguments(i,this._uriReplacer),r=++this._lastMessageId,a=String(r),c=new yit,l=new Z;n&&l.add(n.onCancellationRequested(()=>{const h=Cp.serializeCancel(r);this._logger?.logOutgoing(h.byteLength,r,Ig.LocalSide,"cancel"),this._protocol.send(Cp.serializeCancel(r))})),this._pendingRPCReplies[a]=new U8t(c,l),this._onWillSendRequest(r);const d=Cp.serializeRequest(r,e,t,o,!!n);return this._logger?.logOutgoing(d.byteLength,r,Ig.LocalSide,`request: ${LK(e)}.${t}(`,i),this._protocol.send(d),c}};d5e=W8t,jz.UNRESPONSIVE_TIME=3*1e3;let gee=jz;class U8t{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 pk;let Tc=(pk=class{static alloc(e,t,i){const n=new pk($e.alloc(i+1+4),0);return n.writeUInt8(e),n.writeUInt32(t),n}static read(e,t){return new pk(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,n=e.length;i"u")return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){const i=[];for(let n=0,o=e.length;n"u")i[n]={type:bl.Undefined};else if(r instanceof qd){const{jsonString:a,referencedBuffers:c}=h5e(r.value,t);i[n]={type:bl.SerializedObjectWithBuffers,value:$e.fromString(a),buffers:c}}else i[n]={type:bl.String,value:$e.fromString(u5e(r,t))}}return{type:vF.Mixed,args:i}}return{type:vF.Simple,args:u5e(e,t)}}static serializeRequest(e,t,i,n,o){switch(n.type){case vF.Simple:return this._requestJSONArgs(e,t,i,n.args,o);case vF.Mixed:return this._requestMixedArgs(e,t,i,n.args,o)}}static _requestJSONArgs(e,t,i,n,o){const r=$e.fromString(i),a=$e.fromString(n);let c=0;c+=Tc.sizeUInt8(),c+=Tc.sizeShortString(r),c+=Tc.sizeLongString(a);const l=Tc.alloc(o?ga.RequestJSONArgsWithCancellation:ga.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(),n=e.readLongString();return{rpcId:t,method:i,args:JSON.parse(n)}}static _requestMixedArgs(e,t,i,n,o){const r=$e.fromString(i);let a=0;a+=Tc.sizeUInt8(),a+=Tc.sizeShortString(r),a+=Tc.sizeMixedArray(n);const c=Tc.alloc(o?ga.RequestMixedArgsWithCancellation:ga.RequestMixedArgs,e,a);return c.writeUInt8(t),c.writeShortString(r),c.writeMixedArray(n),c.buffer}static deserializeRequestMixedArgs(e){const t=e.readUInt8(),i=e.readShortString(),n=e.readMixedArray(),o=new Array(n.length);for(let r=0,a=n.length;r"u")return this._serializeReplyOKEmpty(e);if(t instanceof $e)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof qd){const{jsonString:n,referencedBuffers:o}=h5e(t.value,i,!0);return this._serializeReplyOKJSONWithBuffers(e,n,o)}else return this._serializeReplyOKJSON(e,rAe(t,i))}static _serializeReplyOKEmpty(e){return Tc.alloc(ga.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let i=0;i+=Tc.sizeVSBuffer(t);const n=Tc.alloc(ga.ReplyOKVSBuffer,e,i);return n.writeVSBuffer(t),n.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){const i=$e.fromString(t);let n=0;n+=Tc.sizeLongString(i);const o=Tc.alloc(ga.ReplyOKJSON,e,n);return o.writeLongString(i),o.buffer}static _serializeReplyOKJSONWithBuffers(e,t,i){const n=$e.fromString(t);let o=0;o+=Tc.sizeUInt32,o+=Tc.sizeLongString(n);for(const a of i)o+=Tc.sizeVSBuffer(a);const r=Tc.alloc(ga.ReplyOKJSONWithBuffers,e,o);r.writeUInt32(i.length),r.writeLongString(n);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(),n=e.readLongString(),o=[];for(let r=0;r{this._hasStarted=!0;const d={time:Date.now(),action:"success",kind:fS(this.kind)};return this._telemetryService.publicLog2("extensionHostStartup",d),this._createExtensionHostCustomers(this.kind,l)},l=>{this._logService.error(`Error received from starting extension host (kind: ${fS(this.kind)})`),this._logService.error(l);const d={time:Date.now(),action:"error",kind:fS(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,Lb.Normal)),this._register(G8t({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 n=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=>{n=l},_setAllMainProxyIdentifiers:l=>{o=l}},a=hee.getNamedCustomers();for(let l=0,d=a.length;l`[${fS(this._extensionHost.runningLocation.kind)}${this._extensionHost.runningLocation.affinity}][resolveAuthority(${dee(e)},${t})][${i.elapsed()}ms] `,o=l=>this._logService.info(`${n()}${l}`),r=(l,d=void 0)=>this._logService.error(`${n()}${l}`,d);o("obtaining proxy...");const a=await this._proxy;if(!a)return r("no proxy"),{type:"error",error:{message:"Cannot resolve authority",code:Xl.Unknown,detail:void 0}};o("invoking...");const c=new q7;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:Xl.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 n=await this._proxy;if(!n)return;const o=this._extensionHost.extensions.set(e,t,i);return n.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)}};fee=GQ=D([_(3,we),_(4,Jr),_(5,Yi),_(6,Ge)],fee);function Ait(s,e){return e?`${fS(s)} pid: ${e}`:`${fS(s)}`}const V8t=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function g5e(s){if(Array.isArray(s))return s;if(s&&typeof s=="object"&&typeof s.toString=="function"){const e=s.toString();if(e!=="[object Object]")return e}return s}function z8t(s){return Array.isArray(s)?s.map(g5e):g5e(s)}class $8t{constructor(e){this._kind=e,this._totalIncoming=0,this._totalOutgoing=0}_log(e,t,i,n,o,r,a){a=z8t(a);const c=V8t[o],l=c[n%c.length];let d=[`%c[${fS(this._kind)}][${e}]%c[${String(t).padStart(7)}]%c[len: ${String(i).padStart(5)}]%c${String(n).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,n,o){this._totalIncoming+=e,this._log("Ext → Win",this._totalIncoming,e,t,i,n,o)}logOutgoing(e,t,i,n,o){this._totalOutgoing+=e,this._log("Win → Ext",this._totalOutgoing,e,t,i,n,o)}}let pee=class{static isEnabled(){return Math.trunc(Math.random()*1e3)<.5}constructor(e){this._telemetryService=e,this._pendingRequests=new Map}logIncoming(e,t,i,n){if(i===Ig.LocalSide&&/^receiveReply(Err)?:/.test(n)){const o=this._pendingRequests.get(t)??"unknown_reply";this._pendingRequests.delete(t),this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n} ${o}`,length:e})}i===Ig.OtherSide&&/^receiveRequest /.test(n)&&this._telemetryService.publicLog2("extensionhost.incoming",{type:`${n}`,length:e})}logOutgoing(e,t,i,n){i===Ig.LocalSide&&n.startsWith("request: ")&&(this._pendingRequests.set(t,n),this._telemetryService.publicLog2("extensionhost.outgoing",{type:n,length:e}))}};pee=D([_(0,Yi)],pee);const IV=[];function G8t(s){return IV.push(s),{dispose:()=>{for(let e=0;en.measure()));t.openEditor({resource:void 0,contents:i.map(KQ._print).join(` `),options:{pinned:!0}})}static _print(e){return e?`${e.remoteAuthority?`Authority: ${e.remoteAuthority} `:""}Roundtrip latency: ${e.latency.toFixed(3)}ms -Up: ${QQ._printSpeed(e.up)} -Down: ${QQ._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 vee{constructor(e){this.affinity=e,this.kind=lo.LocalProcess}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalProcess":`LocalProcess${this.affinity}`}}class gAe{constructor(e){this.affinity=e,this.kind=lo.LocalWebWorker}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalWebWorker":`LocalWebWorker${this.affinity}`}}class bee{constructor(){this.kind=lo.Remote,this.affinity=0}equals(e){return this.kind===e.kind}asString(){return"Remote"}}let fAe=class{get maxLocalProcessAffinity(){return this._maxLocalProcessAffinity}get maxLocalWebWorkerAffinity(){return this._maxLocalWebWorkerAffinity}constructor(e,t,i,n,o,r){this._registry=e,this._extensionHostKindPicker=t,this._environmentService=i,this._configurationService=n,this._logService=o,this._extensionManifestPropertiesService=r,this._runningLocation=new va,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 jQ(e,this._runningLocation,i=>t.equals(i))}filterByExtensionHostKind(e,t){return jQ(e,this._runningLocation,i=>i.kind===t)}filterByExtensionHostManager(e,t){return jQ(e,this._runningLocation,i=>t.representsRunningLocation(i))}_computeAffinity(e,t,i){const n=new va;for(const h of e)(h.main||h.browser)&&n.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&&n.set(h.identifier,h)}const o=new va;let r=0;for(const[h,u]of n)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 n){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 n){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 b=c.get(v);if(b){f.set(m,b);continue}const w=f.get(m);if(w){c.set(v,w);continue}if(!i){this._logService.info(`Ignoring configured affinity for '${p}' because extension host(s) are already running. Reload window.`);continue}const y=++l;f.set(m,y),c.set(v,y)}}const d=new va;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,n){t=t.filter(p=>!e.has(p.identifier)),i=i.filter(p=>!e.has(p.identifier));const o=z8t(t,i,p=>this.readExtensionKinds(p),(p,m,v,b,w)=>this._extensionHostKindPicker.pickExtensionHostKind(p,m,v,b,w)),r=new va;for(const p of t)r.set(p.identifier,p);for(const p of i)r.set(p.identifier,p);const a=new va,c=[],l=[];for(const[p,m]of o){let v=null;if(m===lo.LocalProcess){const b=r.get(p);b&&c.push(b)}else if(m===lo.LocalWebWorker){const b=r.get(p);b&&l.push(b)}else m===lo.Remote&&(v=new bee);a.set(p,v)}const{affinities:d,maxAffinity:h}=this._computeAffinity(c,lo.LocalProcess,n);for(const p of c){const m=d.get(p.identifier)||0;a.set(p.identifier,new vee(m))}const{affinities:u,maxAffinity:f}=this._computeAffinity(l,lo.LocalWebWorker,n);for(const p of l){const m=u.get(p.identifier)||0;a.set(p.identifier,new gAe(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:n,maxLocalWebWorkerAffinity:o}=this._doComputeRunningLocation(this._runningLocation,e,t,!0);this._runningLocation=i,this._maxLocalProcessAffinity=n,this._maxLocalWebWorkerAffinity=o}deltaExtensions(e,t){const i=new va;for(const n of t){const o=n;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===pe.vscodeRemote,l=this._extensionHostKindPicker.pickExtensionHostKind(r.identifier,a,!c,c,Qg.None);let d=null;l===lo.LocalProcess?t.push(r):l===lo.LocalWebWorker?i.push(r):l===lo.Remote&&(d=new bee),this._runningLocation.set(r.identifier,d)}const{affinities:n}=this._computeAffinity(t,lo.LocalProcess,!1);for(const r of t){const a=n.get(r.identifier)||0;this._runningLocation.set(r.identifier,new vee(a))}const{affinities:o}=this._computeAffinity(i,lo.LocalWebWorker,!1);for(const r of i){const a=o.get(r.identifier)||0;this._runningLocation.set(r.identifier,new gAe(a))}}};fAe=D([_(2,Jr),_(3,Te),_(4,Ge),_(5,Im)],fAe);function jQ(s,e,t){return s.filter(i=>{const n=e.get(i.identifier);return n&&t(n)})}function s3t(s,e,t){return s.filter(i=>{const n=e.get(i);return n&&t(n)})}let pAe=class extends V{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 Rit(this.kind,this.pid)}constructor(e,t,i,n){super(),this._internalExtensionService=t,this._instantiationService=i,this._logService=n,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._extensionHost=e,this.onDidExit=e.onExit,this._startCalled=new qd,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(mee,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===Nb.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:ed.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 Jq(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)}};pAe=D([_(2,we),_(3,Ge)],pAe);var wee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(wee||(wee={}));let BNe=class{constructor(e,t,i){this.uri=e,this.ranges=t,this.previewText=i}},WNe=class{constructor(e,t,i){this.uri=e,this.text=t,this.lineNumber=i}};var Rw;(function(s){s[s.none=1]="none",s[s.filesExclude=2]="filesExclude",s[s.searchAndFilesExclude=3]="searchAndFilesExclude"})(Rw||(Rw={}));var yee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(yee||(yee={}));function o3t(s){return"uri"in s&&"ranges"in s&&"preview"in s}function r3t(s){if(o3t(s)){const e=H_(s.ranges).map(t=>({sourceRange:t,previewRange:t}));return new BNe(s.uri,e,s.preview.text)}else return new WNe(s.uri,s.text,s.lineNumber)}const a3t=2e4,Mit="⟪ ",Nit=" characters skipped ⟫",c3t=(Mit.length+Nit.length+5)*2;var Z5;(function(s){s[s.file=0]="file",s[s.text=1]="text",s[s.aiText=2]="aiText"})(Z5||(Z5={}));var cI;(function(s){s[s.File=1]="File",s[s.Text=2]="Text",s[s.aiText=3]="aiText"})(cI||(cI={}));function l3t(s){return!!s.preview}var x5e;(function(s){s[s.Normal=0]="Normal",s[s.NewSearchStarted=1]="NewSearchStarted"})(x5e||(x5e={}));class d3t{constructor(e,t,i,n){this.ranges=t,this.webviewIndex=n;const o=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&h3t(o)){e=vat(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+c3t){const p=Mit+(u-c)+Nit;r+=p+e.slice(u,f),a+=u-(c+p.length)}else r+=e.slice(c,f);d.push(new u3t(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:n8(t,a=>new Pit(a.startLineNumber-r,a.startColumn,a.endLineNumber-r,a.endColumn))}}}}function h3t(s){const e=s[0].startLineNumber;for(const t of s)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class Pit{constructor(e,t,i,n){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n}}class u3t extends Pit{constructor(e,t,i){super(e,t,e,i)}}var D5e;(function(s){s.List="list",s.Tree="tree"})(D5e||(D5e={}));var k5e;(function(s){s.Default="default",s.FileNames="fileNames",s.Type="type",s.Modified="modified",s.CountDescending="countDescending",s.CountAscending="countAscending"})(k5e||(k5e={}));function g3t(s,e=!0){const t=s&&s.files&&s.files.exclude,i=e&&s&&s.search&&s.search.exclude;if(!t&&!i)return;if(!t||!i)return t||i||void 0;let n=Object.create(null);return n=gp(n,xs(t)),n=gp(n,xs(i),!0),n}function I5e(s,e){return s.excludePattern&&zO(s.excludePattern,e)?!1:s.includePattern||s.usingSearchPaths?s.includePattern&&zO(s.includePattern,e)?!0:s.usingSearchPaths?!!s.folderQueries&&s.folderQueries.some(t=>{const i=t.folder.fsPath;if(Wj(e,i)){const n=k2(i,e);return!t.includePattern||!!zO(t.includePattern,n)}else return!1}):!1:!0}var T5e;(function(s){s[s.unknownEncoding=1]="unknownEncoding",s[s.regexParseError=2]="regexParseError",s[s.globParseError=3]="globParseError",s[s.invalidLiteral=4]="invalidLiteral",s[s.rgProcessError=5]="rgProcessError",s[s.other=6]="other",s[s.canceled=7]="canceled"})(T5e||(T5e={}));function Cee(s,e){const t={...s||{},...e||{}};return Object.keys(t).filter(i=>{const n=t[i];return typeof n=="boolean"&&n})}class Fit{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression={...e.excludePattern||{},...t.excludePattern||{}},this._parsedExcludeExpression=j_(this._excludeExpression);let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=j_(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 n=this._parsedExcludeExpression(e,t,i),o=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return Qy(n)?n.then(r=>r?!1:o()):o()}hasSiblingExcludeClauses(){return f3t(this._excludeExpression)}}function f3t(s){for(const e in s)if(typeof s[e]!="boolean")return!0;return!1}function p3t(s){if(!s)return;let e;return t=>(e||(e=(s()||Promise.resolve([])).then(i=>i?Oit(i):{})),e.then(i=>!!i[t]))}function m3t(s){if(!s)return;let e;return t=>{if(!e){const i=s();e=i?Oit(i):{}}return!!e[t]}}function Oit(s){const e={};for(const t of s)e[t]=!0;return e}let See=class{constructor(e,t,i,n,o){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=i,this.logService=n,this.pathService=o}text(e,t,i={}){e=this.getContentPattern(e,i);const n=this.configurationService.getValue(),o=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map(KY),i),type:cI.Text,contentPattern:e,previewOptions:i.previewOptions,maxFileSize:i.maxFileSize,usePCRE2:n.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 n={...e,wordSeparators:i.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(n.isCaseSensitive=!0),this.isMultiline(e)&&(n.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),n}file(e,t={}){return{...this.commonQuery(e,t),type:cI.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(YQ):YQ(e),t?this.parseSearchPaths(e):{pattern:Sue(...Array.isArray(e)?e:[e])}):{}}commonQuery(e=[],t={}){const i=this.handleIncludeExclude(t.includePattern,t.expandPatterns),n=this.handleIncludeExclude(t.excludePattern,t.expandPatterns),o=e.length>1,r=(i.searchPaths&&i.searchPaths.length?i.searchPaths.map(l=>this.getFolderQueryForSearchPath(l,t,n)):e.map(l=>this.getFolderQueryForRoot(l,t,n,o))).filter(l=>!!l),a={_reason:t._reason,folderQueries:r,usingSearchPaths:!!(i.searchPaths&&i.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:n.pattern,includePattern:i.pattern,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults};if(t.onlyOpenEditors){const l=Fi(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=>I5e(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=>I5e(a,l.fsPath));return a.extraFileResources=c&&c.length?c:void 0,a}commonQueryFromFileList(e){const t=[],i=new ui,n={};let o=!1;return e.forEach(r=>{if(r.scheme===pe.walkThrough)return;if(DGe(r)){const c=this.workspaceContextService.getWorkspaceFolder(r)?.uri??r.with({path:Cb(r.fsPath)});let l=i.get(c);l||(o=!0,l={folder:c,includePattern:{}},t.push(l),i.set(c,l));const d=k2(c.fsPath,r.fsPath);qn(l.includePattern)[d.replace(/\\/g,"/")]=!0}else r.fsPath&&(o=!0,n[r.fsPath]=!0)}),{folderQueries:t,includePattern:n,usingSearchPaths:!0,excludePattern:o?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(tfe(e.pattern,!0))return!0}else if(tfe(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&RKe(e.pattern)||e.pattern.indexOf(` -`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){const t=h=>pM(h)||/^\.\.?([\/\\]|$)/.test(h),n=(Array.isArray(e)?e:v3t(e)).map(h=>{const u=this.pathService.resolvedUserHome;return u?MMt(h,u.scheme===pe.file?u.fsPath:u.path):h}),o=P6e(n,h=>t(h)?"searchPaths":"exprSegments"),r=(o.exprSegments||[]).map(h=>zy(h,"/")).map(h=>zy(h,"\\")).map(h=>(h[0]==="."&&(h="*"+h),b3t(h))),a={},c=this.expandSearchPathPatterns(o.searchPaths||[]);c&&c.length&&(a.searchPaths=c);const l=r.flat(),d=Sue(...l);return d&&(a.pattern=d),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:g3t(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];const t=e.flatMap(n=>{let{pathPortion:o,globPortion:r}=_3t(n);return r&&(r=Aue(r)),this.expandOneSearchPath(o).flatMap(c=>this.resolveOneSearchPathPattern(c,r))}),i=new Map;return t.forEach(n=>{const o=n.searchPath.toString(),r=i.get(o);r?n.pattern&&(r.pattern=r.pattern||{},r.pattern[n.pattern]=!0):i.set(o,{searchPath:n.searchPath,pattern:n.pattern?Sue(n.pattern):void 0})}),Array.from(i.values())}expandOneSearchPath(e){if(pM(e)){const t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==pe.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:N.file(Rk(e))}]}if(this.workspaceContextService.getWorkbenchState()===qi.FOLDER){const t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=YQ(e),e.startsWith("../")||e===".."){const n=Vi.resolve(t.path,e);return[{searchPath:t.with({path:n})}]}const i=Aue(e);return[{searchPath:t,pattern:i}]}else{if(e==="./"||e===".\\")return[];{const t=e.replace(/^\.[\/\\]/,""),n=this.workspaceContextService.getWorkspace().folders.map(o=>{const r=t.match(new RegExp(`^${Rh(o.name)}(?:/(.*)|$)`));return r?{match:r,folder:o}:null}).filter(Fc);if(n.length)return n.map(o=>{const r=o.match[1];return{searchPath:o.folder.uri,pattern:r&&Aue(r)}});{const o=e.match(/\.[\/\\](.+)[\/\\]?/),r=o?o[1]:e,a=g(4397,"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,n=[{searchPath:e.searchPath,pattern:i}];return i&&!i.endsWith("**")&&n.push({searchPath:e.searchPath,pattern:i+"/**"}),n}getFolderQueryForSearchPath(e,t,i){const n=this.getFolderQueryForRoot(KY(e.searchPath),t,i,!1);return n?{...n,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,i,n){let o;const r=N.isUri(e)?e:e.uri;if(i.searchPaths){const h=i.searchPaths.filter(u=>ji(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=N.isUri(e)?_i(e):e.name;return{folder:r,folderName:n?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}}};See=D([_(0,Te),_(1,yi),_(2,Po),_(3,Ge),_(4,bf)],See);function _3t(s){const e=s.match(/[\*\{\}\(\)\[\]\?]/);if(e){const t=e.index,i=s.substr(0,t).match(/[/|\\][^/\\]*$/);if(i){let n=s.substr(0,i.index);return n.match(/[/\\]/)||(n+="/"),{pathPortion:n,globPortion:s.substr((i.index||0)+1)}}}return{pathPortion:s}}function Sue(...s){return s.length?s.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function v3t(s){return Pme(s,",").map(e=>e.trim()).filter(e=>!!e.length)}function b3t(s){return[`**/${s}/**`,`**/${s}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function YQ(s){return s.replace(/\\/g,"/")}function Aue(s){return YQ(s).replace(/^\.\//,"").replace(/\/+$/g,"")}const w3t=7e3;function Bit(s,e){const t=e.activationEvents;if(!t)return Promise.resolve(void 0);const i=[],n=[];for(const d of t)if(/^workspaceContains:/.test(d)){const h=d.substr(18);h.indexOf("*")>=0||h.indexOf("?")>=0||s.forceUsingSearch?n.push(h):i.push(h)}if(i.length===0&&n.length===0)return Promise.resolve(void 0);const{promise:o,resolve:r}=M2(),a=d=>r({activationEvent:d}),c=Promise.all(i.map(d=>y3t(s,d,a))).then(()=>{}),l=C3t(s,e.identifier,n,a);return Promise.all([c,l]).then(()=>{r(void 0)}),o}async function y3t(s,e,t){for(const i of s.folders)if(await s.exists(Pt(N.revive(i),e))){t(`workspaceContains:${e}`);return}}async function C3t(s,e,t,i){if(t.length===0)return Promise.resolve(void 0);const n=new ci,o=s.checkExists(s.folders,t,n.token),r=setTimeout(async()=>{n.cancel(),s.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},w3t);let a=!1;try{a=await o}catch(c){Fr(c)||vt(c)}n.dispose(),clearTimeout(r),a&&i(`workspaceContains:${t.join(",")}`)}function Wit(s,e,t,i){const n=s.get(we),o=s.get(Zae),a=n.createInstance(See).file(e.map(c=>KY(N.revive(c))),{_reason:"checkExists",includePattern:t,exists:!0});return o.fileSearch(a,i).then(c=>!!c.limitHit,c=>Fr(c)?!1:Promise.reject(c))}var mAe;const Eue=Object.hasOwnProperty,S3t=Promise.resolve(void 0);let _Ae=mAe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C){super(),this._extensionsProposedApi=e,this._extensionHostFactory=t,this._extensionHostKindPicker=i,this._instantiationService=n,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=b,this._lifecycleService=w,this._remoteAuthorityResolverService=y,this._dialogService=C,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 T3t,this._registry=new O8t(this._activationEventReader),this._installedExtensionsReady=new qd,this._extensionStatus=new va,this._allRequestedActivateEvents=new Set,this._remoteCrashTracker=new bAe,this._deltaExtensionsQueue=[],this._inHandleDeltaExtensions=!1,this._extensionHostManagers=this._register(new A3t),this._resolveAuthorityAttempt=0,this._register(this._fileService.onWillActivateFileSystemProvider(A=>{A.scheme!==pe.vscodeRemote&&A.join(this.activateByEvent(`onFileSystem:${A.scheme}`))})),this._runningLocations=new fAe(this._registry,this._extensionHostKindPicker,this._environmentService,this._configurationService,this._logService,this._extensionManifestPropertiesService),this._register(this._extensionEnablementService.onEnablementChanged(A=>{const L=[],k=[];for(const P of A)this._safeInvokeIsEnabled(P)?L.push(P):k.push(P);Wh&&this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${A.map(P=>P.identifier.id).join(", ")}`),this._handleDeltaExtensions(new S0(L,k))})),this._register(this._extensionManagementService.onDidChangeProfile(({added:A,removed:L})=>{(A.length||L.length)&&(Wh&&this._logService.info("AbstractExtensionService.onDidChangeProfile fired"),this._handleDeltaExtensions(new S0(A,L)))})),this._register(this._extensionManagementService.onDidEnableExtensions(A=>{A.length&&(Wh&&this._logService.info("AbstractExtensionService.onDidEnableExtensions fired"),this._handleDeltaExtensions(new S0(A,[])))})),this._register(this._extensionManagementService.onDidInstallExtensions(A=>{const L=[];for(const{local:k,operation:P}of A)k&&k.isValid&&P!==LA.Migrate&&this._safeInvokeIsEnabled(k)&&L.push(k);L.length&&(Wh&&this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${L.map(k=>k.identifier.id).join(", ")}`),this._handleDeltaExtensions(new S0(L,[])))})),this._register(this._extensionManagementService.onDidUninstallExtension(A=>{A.error||(Wh&&this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${A.identifier.id}`),this._handleDeltaExtensions(new S0([],[A.identifier.id])))})),this._register(this._lifecycleService.onWillShutdown(A=>{this._remoteAgentService.getConnection()&&A.join(()=>this._remoteAgentService.endConnection(),{id:"join.disconnectRemote",label:g(1126,"Disconnect Remote Agent"),order:Mve.Last})})),this._register(this._lifecycleService.onDidShutdown(()=>{this._remoteAgentService.getConnection()?.dispose(),this._doStopExtensionHosts()}))}_getExtensionHostManagers(e){return this._extensionHostManagers.getByKind(e)}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){Wh&&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 n=[];for(let a=0,c=i.length;aa.identifier));this._onDidChangeExtensions.fire({added:o,removed:n}),n=n.concat(r.removedDueToLooping),r.removedDueToLooping.length>0&&this._notificationService.notify({severity:Xe.Error,message:g(1127,"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(n)),await this._updateExtensionsOnExtHosts(r.versionId,o,n.map(a=>a.identifier));for(let a=0;athis._updateExtensionsOnExtHost(r,e,t,i,n));await Promise.all(o)}async _updateExtensionsOnExtHost(e,t,i,n,o){const r=this._runningLocations.filterByExtensionHostManager(i,e),a=s3t(n,o,l=>e.representsRunningLocation(l)),c=JO.createActivationEventsMap(i);if(Wh){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(n)}], toAdd: [${l(i)}], myToRemove: [${d(a)}], myToAdd: [${l(r)}],`)}await e.deltaExtensions({versionId:t,toRemove:n,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=>Sn.equals(e.identifier,c.identifier)))return!1;const n=this._runningLocations.readExtensionKinds(e),o=e.extensionLocation.scheme===pe.vscodeRemote;return this._extensionHostKindPicker.pickExtensionHostKind(e.identifier,n,!o,o,Qg.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,n=!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)&&(n=!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(n){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=>Wit(f,d,h,u))},l=await Bit(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(){cs("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 n of this._extensionHostManagers)if(n.startup!==RA.EagerAutoStart){const o=this._runningLocations.filterByExtensionHostManager(i.extensions,n);n.start(i.versionId,i.extensions,o.map(r=>r.identifier))}}finally{e.dispose()}this._releaseBarrier(),cs("code/didLoadExtensions"),await this._handleExtensionTests()}_processExtensions(e,t){const{allowRemoteExtensionsInLocalWebWorker:i,hasLocalProcess:n}=t,o=vAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.local,!1);let r=vAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.remote,!1);this._runningLocations.initializeRunningLocation(o,r),this._startExtensionHostsIfNecessary(!0,[]);const a=i?this._runningLocations.filterByExtensionHostKind(r,lo.LocalWebWorker):[],c=n?this._runningLocations.filterByExtensionHostKind(o,lo.LocalProcess):[],l=this._runningLocations.filterByExtensionHostKind(o,lo.LocalWebWorker);r=this._runningLocations.filterByExtensionHostKind(r,lo.Remote);for(const u of a)k3t(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:Xe.Error,message:g(1127,"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(1128,"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(),Wh&&this._logService.info(`Extension host test runner exit code: ${t}`)}catch(i){Wh&&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(qy(e,i.extensionLocation)){t=this._runningLocations.getRunningLocation(i.identifier);break}return t===null&&(e.scheme===pe.vscodeRemote?t=new bee:t=new vee(0)),t!==null?this._extensionHostManagers.getByRunningLocation(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(n){if(fD.isNoResolverFound(n)||fD.isNotAvailable(n)||i>=5)throw n}}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=uee(e),i=js.create(!1);this._logService.info(`Invoking resolveAuthority(${t})...`);try{cs(`code/willResolveAuthority/${t}`);const n=await this._resolveAuthority(e);return cs(`code/didResolveAuthorityOK/${t}`),this._logService.info(`resolveAuthority(${t}) returned '${n.authority.connectTo}' after ${i.elapsed()} ms`),n}catch(n){throw cs(`code/didResolveAuthorityError/${t}`),this._logService.error(`resolveAuthority(${t}) returned an error after ${i.elapsed()} ms`,n),n}}async _resolveAuthorityOnExtensionHosts(e,t){const i=this._getExtensionHostManagers(e);if(i.length===0)throw new Error("Cannot resolve authority");this._resolveAuthorityAttempt++;const n=await Promise.all(i.map(r=>r.resolveAuthority(t,this._resolveAuthorityAttempt)));let o=null;for(const r of n){if(r.type==="ok")return r.value;if(!o){o=r;continue}const a=o.error.code===ed.Unknown,c=r.error.code===ed.Unknown;a&&!c&&(o=r)}throw new fD(o.error.message,o.error.code,o.error.detail)}stopExtensionHosts(e,t){return this._doStopExtensionHostsWithVeto(e,t)}_doStopExtensionHosts(){const e=[];for(const t of this._extensionStatus.values())t.activationStarted&&e.push(t.id);this._extensionHostManagers.disposeAllInReverse();for(const t of this._extensionStatus.values())t.clearRuntimeStatus();e.length>0&&this._onDidChangeExtensionsStatus.fire(e)}async _doStopExtensionHostsWithVeto(e,t){const i=[],n=new Set;this._onWillStop.fire({reason:e,veto(r,a){i.push(r),typeof r=="boolean"?r===!0&&n.add(a):r.then(c=>{c&&n.add(a)}).catch(c=>{n.add(g(1129,"{0} (Error: {1})",a,Nr(c)))})}});const o=await N8t(i,r=>this._logService.error(r));if(!o)this._doStopExtensionHosts();else if(!t){const r=Array.from(n);this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${e}, veto reason: ${r.join(", ")})`),await this._dialogService.warn(g(1130,"The following operation was blocked: {0}",e),r.length===1?g(1131,"The reason for blocking the operation: {0}",r[0]):g(1132,`The reasons for blocking the operation: +Up: ${KQ._printSpeed(e.up)} +Down: ${KQ._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 mee{constructor(e){this.affinity=e,this.kind=lo.LocalProcess}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalProcess":`LocalProcess${this.affinity}`}}class aAe{constructor(e){this.affinity=e,this.kind=lo.LocalWebWorker}equals(e){return this.kind===e.kind&&this.affinity===e.affinity}asString(){return this.affinity===0?"LocalWebWorker":`LocalWebWorker${this.affinity}`}}class _ee{constructor(){this.kind=lo.Remote,this.affinity=0}equals(e){return this.kind===e.kind}asString(){return"Remote"}}let cAe=class{get maxLocalProcessAffinity(){return this._maxLocalProcessAffinity}get maxLocalWebWorkerAffinity(){return this._maxLocalWebWorkerAffinity}constructor(e,t,i,n,o,r){this._registry=e,this._extensionHostKindPicker=t,this._environmentService=i,this._configurationService=n,this._logService=o,this._extensionManifestPropertiesService=r,this._runningLocation=new va,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 qQ(e,this._runningLocation,i=>t.equals(i))}filterByExtensionHostKind(e,t){return qQ(e,this._runningLocation,i=>i.kind===t)}filterByExtensionHostManager(e,t){return qQ(e,this._runningLocation,i=>t.representsRunningLocation(i))}_computeAffinity(e,t,i){const n=new va;for(const h of e)(h.main||h.browser)&&n.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&&n.set(h.identifier,h)}const o=new va;let r=0;for(const[h,u]of n)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 n){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 n){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 b=c.get(v);if(b){f.set(m,b);continue}const w=f.get(m);if(w){c.set(v,w);continue}if(!i){this._logService.info(`Ignoring configured affinity for '${p}' because extension host(s) are already running. Reload window.`);continue}const y=++l;f.set(m,y),c.set(v,y)}}const d=new va;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,n){t=t.filter(p=>!e.has(p.identifier)),i=i.filter(p=>!e.has(p.identifier));const o=R8t(t,i,p=>this.readExtensionKinds(p),(p,m,v,b,w)=>this._extensionHostKindPicker.pickExtensionHostKind(p,m,v,b,w)),r=new va;for(const p of t)r.set(p.identifier,p);for(const p of i)r.set(p.identifier,p);const a=new va,c=[],l=[];for(const[p,m]of o){let v=null;if(m===lo.LocalProcess){const b=r.get(p);b&&c.push(b)}else if(m===lo.LocalWebWorker){const b=r.get(p);b&&l.push(b)}else m===lo.Remote&&(v=new _ee);a.set(p,v)}const{affinities:d,maxAffinity:h}=this._computeAffinity(c,lo.LocalProcess,n);for(const p of c){const m=d.get(p.identifier)||0;a.set(p.identifier,new mee(m))}const{affinities:u,maxAffinity:f}=this._computeAffinity(l,lo.LocalWebWorker,n);for(const p of l){const m=u.get(p.identifier)||0;a.set(p.identifier,new aAe(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:n,maxLocalWebWorkerAffinity:o}=this._doComputeRunningLocation(this._runningLocation,e,t,!0);this._runningLocation=i,this._maxLocalProcessAffinity=n,this._maxLocalWebWorkerAffinity=o}deltaExtensions(e,t){const i=new va;for(const n of t){const o=n;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===pe.vscodeRemote,l=this._extensionHostKindPicker.pickExtensionHostKind(r.identifier,a,!c,c,Gg.None);let d=null;l===lo.LocalProcess?t.push(r):l===lo.LocalWebWorker?i.push(r):l===lo.Remote&&(d=new _ee),this._runningLocation.set(r.identifier,d)}const{affinities:n}=this._computeAffinity(t,lo.LocalProcess,!1);for(const r of t){const a=n.get(r.identifier)||0;this._runningLocation.set(r.identifier,new mee(a))}const{affinities:o}=this._computeAffinity(i,lo.LocalWebWorker,!1);for(const r of i){const a=o.get(r.identifier)||0;this._runningLocation.set(r.identifier,new aAe(a))}}};cAe=D([_(2,Jr),_(3,Te),_(4,Ge),_(5,xm)],cAe);function qQ(s,e,t){return s.filter(i=>{const n=e.get(i.identifier);return n&&t(n)})}function q8t(s,e,t){return s.filter(i=>{const n=e.get(i);return n&&t(n)})}let lAe=class extends V{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 Ait(this.kind,this.pid)}constructor(e,t,i,n){super(),this._internalExtensionService=t,this._instantiationService=i,this._logService=n,this._onDidChangeResponsiveState=this._register(new I),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._extensionHost=e,this.onDidExit=e.onExit,this._startCalled=new Gd,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(fee,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===Lb.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:Xl.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 jq(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)}};lAe=D([_(2,we),_(3,Ge)],lAe);var vee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(vee||(vee={}));let xNe=class{constructor(e,t,i){this.uri=e,this.ranges=t,this.previewText=i}},DNe=class{constructor(e,t,i){this.uri=e,this.text=t,this.lineNumber=i}};var Iw;(function(s){s[s.none=1]="none",s[s.filesExclude=2]="filesExclude",s[s.searchAndFilesExclude=3]="searchAndFilesExclude"})(Iw||(Iw={}));var bee;(function(s){s[s.Information=1]="Information",s[s.Warning=2]="Warning"})(bee||(bee={}));function Q8t(s){return"uri"in s&&"ranges"in s&&"preview"in s}function j8t(s){if(Q8t(s)){const e=O_(s.ranges).map(t=>({sourceRange:t,previewRange:t}));return new xNe(s.uri,e,s.preview.text)}else return new DNe(s.uri,s.text,s.lineNumber)}const Y8t=2e4,Eit="⟪ ",xit=" characters skipped ⟫",J8t=(Eit.length+xit.length+5)*2;var Y5;(function(s){s[s.file=0]="file",s[s.text=1]="text",s[s.aiText=2]="aiText"})(Y5||(Y5={}));var nI;(function(s){s[s.File=1]="File",s[s.Text=2]="Text",s[s.aiText=3]="aiText"})(nI||(nI={}));function X8t(s){return!!s.preview}var f5e;(function(s){s[s.Normal=0]="Normal",s[s.NewSearchStarted=1]="NewSearchStarted"})(f5e||(f5e={}));class Z8t{constructor(e,t,i,n){this.ranges=t,this.webviewIndex=n;const o=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&e3t(o)){e=aat(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+J8t){const p=Eit+(u-c)+xit;r+=p+e.slice(u,f),a+=u-(c+p.length)}else r+=e.slice(c,f);d.push(new t3t(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:e8(t,a=>new Dit(a.startLineNumber-r,a.startColumn,a.endLineNumber-r,a.endColumn))}}}}function e3t(s){const e=s[0].startLineNumber;for(const t of s)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class Dit{constructor(e,t,i,n){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n}}class t3t extends Dit{constructor(e,t,i){super(e,t,e,i)}}var p5e;(function(s){s.List="list",s.Tree="tree"})(p5e||(p5e={}));var m5e;(function(s){s.Default="default",s.FileNames="fileNames",s.Type="type",s.Modified="modified",s.CountDescending="countDescending",s.CountAscending="countAscending"})(m5e||(m5e={}));function i3t(s,e=!0){const t=s&&s.files&&s.files.exclude,i=e&&s&&s.search&&s.search.exclude;if(!t&&!i)return;if(!t||!i)return t||i||void 0;let n=Object.create(null);return n=dp(n,xs(t)),n=dp(n,xs(i),!0),n}function _5e(s,e){return s.excludePattern&&WO(s.excludePattern,e)?!1:s.includePattern||s.usingSearchPaths?s.includePattern&&WO(s.includePattern,e)?!0:s.usingSearchPaths?!!s.folderQueries&&s.folderQueries.some(t=>{const i=t.folder.fsPath;if(Oj(e,i)){const n=A2(i,e);return!t.includePattern||!!WO(t.includePattern,n)}else return!1}):!1:!0}var v5e;(function(s){s[s.unknownEncoding=1]="unknownEncoding",s[s.regexParseError=2]="regexParseError",s[s.globParseError=3]="globParseError",s[s.invalidLiteral=4]="invalidLiteral",s[s.rgProcessError=5]="rgProcessError",s[s.other=6]="other",s[s.canceled=7]="canceled"})(v5e||(v5e={}));function wee(s,e){const t={...s||{},...e||{}};return Object.keys(t).filter(i=>{const n=t[i];return typeof n=="boolean"&&n})}class kit{constructor(e,t){this._parsedIncludeExpression=null,this._excludeExpression={...e.excludePattern||{},...t.excludePattern||{}},this._parsedExcludeExpression=K_(this._excludeExpression);let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=K_(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 n=this._parsedExcludeExpression(e,t,i),o=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,i):!0;return Gy(n)?n.then(r=>r?!1:o()):o()}hasSiblingExcludeClauses(){return n3t(this._excludeExpression)}}function n3t(s){for(const e in s)if(typeof s[e]!="boolean")return!0;return!1}function s3t(s){if(!s)return;let e;return t=>(e||(e=(s()||Promise.resolve([])).then(i=>i?Iit(i):{})),e.then(i=>!!i[t]))}function o3t(s){if(!s)return;let e;return t=>{if(!e){const i=s();e=i?Iit(i):{}}return!!e[t]}}function Iit(s){const e={};for(const t of s)e[t]=!0;return e}let yee=class{constructor(e,t,i,n,o){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=i,this.logService=n,this.pathService=o}text(e,t,i={}){e=this.getContentPattern(e,i);const n=this.configurationService.getValue(),o=t&&t.some(a=>!this.configurationService.getValue({resource:a}).search.useRipgrep);return{...this.commonQuery(t?.map($Y),i),type:nI.Text,contentPattern:e,previewOptions:i.previewOptions,maxFileSize:i.maxFileSize,usePCRE2:n.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 n={...e,wordSeparators:i.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(n.isCaseSensitive=!0),this.isMultiline(e)&&(n.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(n.notebookInfo||(n.notebookInfo={}),n.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),n}file(e,t={}){return{...this.commonQuery(e,t),type:nI.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(QQ):QQ(e),t?this.parseSearchPaths(e):{pattern:mue(...Array.isArray(e)?e:[e])}):{}}commonQuery(e=[],t={}){const i=this.handleIncludeExclude(t.includePattern,t.expandPatterns),n=this.handleIncludeExclude(t.excludePattern,t.expandPatterns),o=e.length>1,r=(i.searchPaths&&i.searchPaths.length?i.searchPaths.map(l=>this.getFolderQueryForSearchPath(l,t,n)):e.map(l=>this.getFolderQueryForRoot(l,t,n,o))).filter(l=>!!l),a={_reason:t._reason,folderQueries:r,usingSearchPaths:!!(i.searchPaths&&i.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:n.pattern,includePattern:i.pattern,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults};if(t.onlyOpenEditors){const l=Fi(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=>_5e(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=>_5e(a,l.fsPath));return a.extraFileResources=c&&c.length?c:void 0,a}commonQueryFromFileList(e){const t=[],i=new ui,n={};let o=!1;return e.forEach(r=>{if(r.scheme===pe.walkThrough)return;if(bGe(r)){const c=this.workspaceContextService.getWorkspaceFolder(r)?.uri??r.with({path:bb(r.fsPath)});let l=i.get(c);l||(o=!0,l={folder:c,includePattern:{}},t.push(l),i.set(c,l));const d=A2(c.fsPath,r.fsPath);qn(l.includePattern)[d.replace(/\\/g,"/")]=!0}else r.fsPath&&(o=!0,n[r.fsPath]=!0)}),{folderQueries:t,includePattern:n,usingSearchPaths:!0,excludePattern:o?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(jge(e.pattern,!0))return!0}else if(jge(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&AKe(e.pattern)||e.pattern.indexOf(` +`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){const t=h=>hM(h)||/^\.\.?([\/\\]|$)/.test(h),n=(Array.isArray(e)?e:a3t(e)).map(h=>{const u=this.pathService.resolvedUserHome;return u?CMt(h,u.scheme===pe.file?u.fsPath:u.path):h}),o=D6e(n,h=>t(h)?"searchPaths":"exprSegments"),r=(o.exprSegments||[]).map(h=>Hy(h,"/")).map(h=>Hy(h,"\\")).map(h=>(h[0]==="."&&(h="*"+h),c3t(h))),a={},c=this.expandSearchPathPatterns(o.searchPaths||[]);c&&c.length&&(a.searchPaths=c);const l=r.flat(),d=mue(...l);return d&&(a.pattern=d),a}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:i3t(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];const t=e.flatMap(n=>{let{pathPortion:o,globPortion:r}=r3t(n);return r&&(r=_ue(r)),this.expandOneSearchPath(o).flatMap(c=>this.resolveOneSearchPathPattern(c,r))}),i=new Map;return t.forEach(n=>{const o=n.searchPath.toString(),r=i.get(o);r?n.pattern&&(r.pattern=r.pattern||{},r.pattern[n.pattern]=!0):i.set(o,{searchPath:n.searchPath,pattern:n.pattern?mue(n.pattern):void 0})}),Array.from(i.values())}expandOneSearchPath(e){if(hM(e)){const t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==pe.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:N.file(Dk(e))}]}if(this.workspaceContextService.getWorkbenchState()===qi.FOLDER){const t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=QQ(e),e.startsWith("../")||e===".."){const n=Vi.resolve(t.path,e);return[{searchPath:t.with({path:n})}]}const i=_ue(e);return[{searchPath:t,pattern:i}]}else{if(e==="./"||e===".\\")return[];{const t=e.replace(/^\.[\/\\]/,""),n=this.workspaceContextService.getWorkspace().folders.map(o=>{const r=t.match(new RegExp(`^${Th(o.name)}(?:/(.*)|$)`));return r?{match:r,folder:o}:null}).filter(Fc);if(n.length)return n.map(o=>{const r=o.match[1];return{searchPath:o.folder.uri,pattern:r&&_ue(r)}});{const o=e.match(/\.[\/\\](.+)[\/\\]?/),r=o?o[1]:e,a=g(4397,"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,n=[{searchPath:e.searchPath,pattern:i}];return i&&!i.endsWith("**")&&n.push({searchPath:e.searchPath,pattern:i+"/**"}),n}getFolderQueryForSearchPath(e,t,i){const n=this.getFolderQueryForRoot($Y(e.searchPath),t,i,!1);return n?{...n,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,i,n){let o;const r=N.isUri(e)?e:e.uri;if(i.searchPaths){const h=i.searchPaths.filter(u=>ji(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=N.isUri(e)?_i(e):e.name;return{folder:r,folderName:n?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}}};yee=D([_(0,Te),_(1,yi),_(2,Po),_(3,Ge),_(4,mf)],yee);function r3t(s){const e=s.match(/[\*\{\}\(\)\[\]\?]/);if(e){const t=e.index,i=s.substr(0,t).match(/[/|\\][^/\\]*$/);if(i){let n=s.substr(0,i.index);return n.match(/[/\\]/)||(n+="/"),{pathPortion:n,globPortion:s.substr((i.index||0)+1)}}}return{pathPortion:s}}function mue(...s){return s.length?s.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function a3t(s){return Ime(s,",").map(e=>e.trim()).filter(e=>!!e.length)}function c3t(s){return[`**/${s}/**`,`**/${s}`].map(t=>t.replace(/\*\*\/\*\*/g,"**"))}function QQ(s){return s.replace(/\\/g,"/")}function _ue(s){return QQ(s).replace(/^\.\//,"").replace(/\/+$/g,"")}const l3t=7e3;function Tit(s,e){const t=e.activationEvents;if(!t)return Promise.resolve(void 0);const i=[],n=[];for(const d of t)if(/^workspaceContains:/.test(d)){const h=d.substr(18);h.indexOf("*")>=0||h.indexOf("?")>=0||s.forceUsingSearch?n.push(h):i.push(h)}if(i.length===0&&n.length===0)return Promise.resolve(void 0);const{promise:o,resolve:r}=I2(),a=d=>r({activationEvent:d}),c=Promise.all(i.map(d=>d3t(s,d,a))).then(()=>{}),l=h3t(s,e.identifier,n,a);return Promise.all([c,l]).then(()=>{r(void 0)}),o}async function d3t(s,e,t){for(const i of s.folders)if(await s.exists(Pt(N.revive(i),e))){t(`workspaceContains:${e}`);return}}async function h3t(s,e,t,i){if(t.length===0)return Promise.resolve(void 0);const n=new ci,o=s.checkExists(s.folders,t,n.token),r=setTimeout(async()=>{n.cancel(),s.logService.info(`Not activating extension '${e.value}': Timed out while searching for 'workspaceContains' pattern ${t.join(",")}`)},l3t);let a=!1;try{a=await o}catch(c){Fr(c)||vt(c)}n.dispose(),clearTimeout(r),a&&i(`workspaceContains:${t.join(",")}`)}function Lit(s,e,t,i){const n=s.get(we),o=s.get(jae),a=n.createInstance(yee).file(e.map(c=>$Y(N.revive(c))),{_reason:"checkExists",includePattern:t,exists:!0});return o.fileSearch(a,i).then(c=>!!c.limitHit,c=>Fr(c)?!1:Promise.reject(c))}var dAe;const vue=Object.hasOwnProperty,u3t=Promise.resolve(void 0);let hAe=dAe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C){super(),this._extensionsProposedApi=e,this._extensionHostFactory=t,this._extensionHostKindPicker=i,this._instantiationService=n,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=b,this._lifecycleService=w,this._remoteAuthorityResolverService=y,this._dialogService=C,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 b3t,this._registry=new x8t(this._activationEventReader),this._installedExtensionsReady=new Gd,this._extensionStatus=new va,this._allRequestedActivateEvents=new Set,this._remoteCrashTracker=new gAe,this._deltaExtensionsQueue=[],this._inHandleDeltaExtensions=!1,this._extensionHostManagers=this._register(new g3t),this._resolveAuthorityAttempt=0,this._register(this._fileService.onWillActivateFileSystemProvider(A=>{A.scheme!==pe.vscodeRemote&&A.join(this.activateByEvent(`onFileSystem:${A.scheme}`))})),this._runningLocations=new cAe(this._registry,this._extensionHostKindPicker,this._environmentService,this._configurationService,this._logService,this._extensionManifestPropertiesService),this._register(this._extensionEnablementService.onEnablementChanged(A=>{const L=[],k=[];for(const P of A)this._safeInvokeIsEnabled(P)?L.push(P):k.push(P);Bh&&this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${A.map(P=>P.identifier.id).join(", ")}`),this._handleDeltaExtensions(new w0(L,k))})),this._register(this._extensionManagementService.onDidChangeProfile(({added:A,removed:L})=>{(A.length||L.length)&&(Bh&&this._logService.info("AbstractExtensionService.onDidChangeProfile fired"),this._handleDeltaExtensions(new w0(A,L)))})),this._register(this._extensionManagementService.onDidEnableExtensions(A=>{A.length&&(Bh&&this._logService.info("AbstractExtensionService.onDidEnableExtensions fired"),this._handleDeltaExtensions(new w0(A,[])))})),this._register(this._extensionManagementService.onDidInstallExtensions(A=>{const L=[];for(const{local:k,operation:P}of A)k&&k.isValid&&P!==IA.Migrate&&this._safeInvokeIsEnabled(k)&&L.push(k);L.length&&(Bh&&this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${L.map(k=>k.identifier.id).join(", ")}`),this._handleDeltaExtensions(new w0(L,[])))})),this._register(this._extensionManagementService.onDidUninstallExtension(A=>{A.error||(Bh&&this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${A.identifier.id}`),this._handleDeltaExtensions(new w0([],[A.identifier.id])))})),this._register(this._lifecycleService.onWillShutdown(A=>{this._remoteAgentService.getConnection()&&A.join(()=>this._remoteAgentService.endConnection(),{id:"join.disconnectRemote",label:g(1126,"Disconnect Remote Agent"),order:Dve.Last})})),this._register(this._lifecycleService.onDidShutdown(()=>{this._remoteAgentService.getConnection()?.dispose(),this._doStopExtensionHosts()}))}_getExtensionHostManagers(e){return this._extensionHostManagers.getByKind(e)}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){Bh&&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 n=[];for(let a=0,c=i.length;aa.identifier));this._onDidChangeExtensions.fire({added:o,removed:n}),n=n.concat(r.removedDueToLooping),r.removedDueToLooping.length>0&&this._notificationService.notify({severity:Xe.Error,message:g(1127,"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(n)),await this._updateExtensionsOnExtHosts(r.versionId,o,n.map(a=>a.identifier));for(let a=0;athis._updateExtensionsOnExtHost(r,e,t,i,n));await Promise.all(o)}async _updateExtensionsOnExtHost(e,t,i,n,o){const r=this._runningLocations.filterByExtensionHostManager(i,e),a=q8t(n,o,l=>e.representsRunningLocation(l)),c=qO.createActivationEventsMap(i);if(Bh){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(n)}], toAdd: [${l(i)}], myToRemove: [${d(a)}], myToAdd: [${l(r)}],`)}await e.deltaExtensions({versionId:t,toRemove:n,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=>Sn.equals(e.identifier,c.identifier)))return!1;const n=this._runningLocations.readExtensionKinds(e),o=e.extensionLocation.scheme===pe.vscodeRemote;return this._extensionHostKindPicker.pickExtensionHostKind(e.identifier,n,!o,o,Gg.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,n=!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)&&(n=!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(n){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=>Lit(f,d,h,u))},l=await Tit(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(){cs("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 n of this._extensionHostManagers)if(n.startup!==TA.EagerAutoStart){const o=this._runningLocations.filterByExtensionHostManager(i.extensions,n);n.start(i.versionId,i.extensions,o.map(r=>r.identifier))}}finally{e.dispose()}this._releaseBarrier(),cs("code/didLoadExtensions"),await this._handleExtensionTests()}_processExtensions(e,t){const{allowRemoteExtensionsInLocalWebWorker:i,hasLocalProcess:n}=t,o=uAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.local,!1);let r=uAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,t.remote,!1);this._runningLocations.initializeRunningLocation(o,r),this._startExtensionHostsIfNecessary(!0,[]);const a=i?this._runningLocations.filterByExtensionHostKind(r,lo.LocalWebWorker):[],c=n?this._runningLocations.filterByExtensionHostKind(o,lo.LocalProcess):[],l=this._runningLocations.filterByExtensionHostKind(o,lo.LocalWebWorker);r=this._runningLocations.filterByExtensionHostKind(r,lo.Remote);for(const u of a)_3t(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:Xe.Error,message:g(1127,"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(1128,"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(),Bh&&this._logService.info(`Extension host test runner exit code: ${t}`)}catch(i){Bh&&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($y(e,i.extensionLocation)){t=this._runningLocations.getRunningLocation(i.identifier);break}return t===null&&(e.scheme===pe.vscodeRemote?t=new _ee:t=new mee(0)),t!==null?this._extensionHostManagers.getByRunningLocation(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(n){if(hD.isNoResolverFound(n)||hD.isNotAvailable(n)||i>=5)throw n}}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=dee(e),i=js.create(!1);this._logService.info(`Invoking resolveAuthority(${t})...`);try{cs(`code/willResolveAuthority/${t}`);const n=await this._resolveAuthority(e);return cs(`code/didResolveAuthorityOK/${t}`),this._logService.info(`resolveAuthority(${t}) returned '${n.authority.connectTo}' after ${i.elapsed()} ms`),n}catch(n){throw cs(`code/didResolveAuthorityError/${t}`),this._logService.error(`resolveAuthority(${t}) returned an error after ${i.elapsed()} ms`,n),n}}async _resolveAuthorityOnExtensionHosts(e,t){const i=this._getExtensionHostManagers(e);if(i.length===0)throw new Error("Cannot resolve authority");this._resolveAuthorityAttempt++;const n=await Promise.all(i.map(r=>r.resolveAuthority(t,this._resolveAuthorityAttempt)));let o=null;for(const r of n){if(r.type==="ok")return r.value;if(!o){o=r;continue}const a=o.error.code===Xl.Unknown,c=r.error.code===Xl.Unknown;a&&!c&&(o=r)}throw new hD(o.error.message,o.error.code,o.error.detail)}stopExtensionHosts(e,t){return this._doStopExtensionHostsWithVeto(e,t)}_doStopExtensionHosts(){const e=[];for(const t of this._extensionStatus.values())t.activationStarted&&e.push(t.id);this._extensionHostManagers.disposeAllInReverse();for(const t of this._extensionStatus.values())t.clearRuntimeStatus();e.length>0&&this._onDidChangeExtensionsStatus.fire(e)}async _doStopExtensionHostsWithVeto(e,t){const i=[],n=new Set;this._onWillStop.fire({reason:e,veto(r,a){i.push(r),typeof r=="boolean"?r===!0&&n.add(a):r.then(c=>{c&&n.add(a)}).catch(c=>{n.add(g(1129,"{0} (Error: {1})",a,Nr(c)))})}});const o=await S8t(i,r=>this._logService.error(r));if(!o)this._doStopExtensionHosts();else if(!t){const r=Array.from(n);this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${e}, veto reason: ${r.join(", ")})`),await this._dialogService.warn(g(1130,"The following operation was blocked: {0}",e),r.length===1?g(1131,"The reason for blocking the operation: {0}",r[0]):g(1132,`The reasons for blocking the operation: - {0}`,r.join(` - -`)))}return!o}_startExtensionHostsIfNecessary(e,t){const i=[];for(let n=0;n<=this._runningLocations.maxLocalProcessAffinity;n++)i.push(new vee(n));for(let n=0;n<=this._runningLocations.maxLocalWebWorkerAffinity;n++)i.push(new gAe(n));i.push(new bee);for(const n of i){if(this._extensionHostManagers.getByRunningLocation(n))continue;const o=this._createExtensionHostManager(n,e,t);if(o){const[r,a]=o;this._extensionHostManagers.add(r,a)}}}_createExtensionHostManager(e,t,i){const n=this._extensionHostFactory.createExtensionHost(this._runningLocations,e,t);if(!n)return null;const o=this._doCreateExtensionHostManager(n,i),r=new Z;return r.add(o.onDidExit(([a,c])=>this._onExtensionHostCrashOrExit(o,a,c))),r.add(o.onDidChangeResponsiveState(a=>{this._logService.info(`Extension host (${o.friendyName}) is ${a===OT.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:o.kind,isResponsive:a===OT.Responsive,getInspectListener:c=>o.getInspectPort(c)})})),[o,r]}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===RA.Lazy&&t.length===0?this._instantiationService.createInstance(pAe,e,i):this._instantiationService.createInstance(mee,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!FNe(this._environmentService).isExtensionDevHost){this._onExtensionHostCrashed(e,t,i);return}this._onExtensionHostExit(t)}_onExtensionHostCrashed(e,t,i){console.error(`Extension host (${e.friendyName}) terminated unexpectedly. Code: ${t}, Signal: ${i}`),e.kind===lo.LocalProcess?this._doStopExtensionHosts():e.kind===lo.Remote&&(i&&this._onRemoteExtensionHostCrashed(e,i),this._extensionHostManagers.disposeOne(e))}_getExtensionHostExitInfoWithTimeout(e){return new Promise((t,i)=>{const n=setTimeout(()=>{i(new Error("getExtensionHostExitInfo timed out"))},2e3);this._remoteAgentService.getExtensionHostExitInfo(e).then(o=>{clearTimeout(n),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(1133,"The remote extension host terminated unexpectedly. Restarting..."),{hideAfter:5e3}),this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))):this._notificationService.prompt(Xe.Error,g(1134,"Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."),[{label:g(1135,"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 S0(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(lo.LocalProcess);await Promise.all(i.map(n=>n.ready()))}finally{t.dispose()}}activateByEvent(e,t=Nb.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):S3t):(this._allRequestedActivateEvents.add(e),t===Nb.Immediate?this._activateByEvent(e,t):this._installedExtensionsReady.wait().then(()=>this._activateByEvent(e,t)))}_activateByEvent(e,t){const i=Promise.all(this._extensionHostManagers.map(n=>n.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 n of t)n.contributes&&Eue.call(n.contributes,e.name)&&i.push(new OLt(n,n.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 n=this._extensionStatus.get(i.identifier);e[i.identifier.value]={id:i.identifier,messages:n?.messages??[],activationStarted:n?.activationStarted??!1,activationTimes:n?.activationTimes??void 0,runtimeErrors:n?.runtimeErrors??[],runningLocation:this._runningLocations.getRunningLocation(i.identifier)}}}return e}async getInspectPorts(e,t){return(await Promise.all(this._getExtensionHostManagers(e).map(n=>n.getInspectPort(t)))).filter(Fc)}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)Eue.call(r.contributes,a)&&(t[a]=!0);const i=r=>this._handleExtensionPointMessage(r),n=this._registry.getAllExtensionDescriptions(),o=eh.getExtensionPoints();cs("code/willHandleExtensionPoints");for(const r of o)t[r.name]&&(cs(`code/willHandleExtensionPoint/${r.name}`),mAe._handleExtensionPoint(r,n,i),cs(`code/didHandleExtensionPoint/${r.name}`));cs("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new I3t(e)),this._extensionStatus.get(e)}_handleExtensionPointMessage(e){this._getOrCreateExtensionStatus(e.extensionId).addMessage(e);const i=this._registry.getExtensionDescription(e.extensionId),n=`[${e.extensionId.value}]: ${e.message}`;if(e.type===Xe.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Xe.Error,message:n}),this._logService.error(n)):e.type===Xe.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Xe.Warning,message:n}),this._logService.warn(n)):this._logService.info(n),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 n=[];for(const o of t)o.contributes&&Eue.call(o.contributes,e.name)&&n.push({description:o,value:o.contributes[e.name],collector:new iRt(i,o,e.name)});e.acceptUsers(n)}_acquireInternalAPI(e){return{_activateById:(t,i)=>this._activateById(t,i),_onWillActivateExtension:t=>this._onWillActivateExtension(t,e.runningLocation),_onDidActivateExtension:(t,i,n,o,r)=>this._onDidActivateExtension(t,i,n,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,n,o){this._getOrCreateExtensionStatus(e).setActivationTimes(new FLt(t,i,n,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])}};_Ae=mAe=D([_(3,we),_(4,bi),_(5,Jr),_(6,Yi),_(7,Nl),_(8,Jt),_(9,Er),_(10,P6),_(11,yi),_(12,Te),_(13,Im),_(14,Ge),_(15,hg),_(16,Bae),_(17,ig),_(18,pC),_(19,to)],_Ae);class A3t extends V{constructor(){super(...arguments),this._extensionHostManagers=[]}dispose(){this.disposeAllInReverse(),super.dispose()}add(e,t){this._extensionHostManagers.push(new E3t(e,t))}disposeAllInReverse(){for(let e=this._extensionHostManagers.length-1;e>=0;e--)this._extensionHostManagers[e].dispose();this._extensionHostManagers=[]}disposeOne(e){const t=this._extensionHostManagers.findIndex(i=>i.extensionHost===e);t>=0&&(this._extensionHostManagers.splice(t,1),e.dispose())}getByKind(e){return this.filter(t=>t.kind===e)}getByRunningLocation(e){for(const t of this._extensionHostManagers)if(t.extensionHost.representsRunningLocation(e))return t.extensionHost;return null}*[Symbol.iterator](){for(const e of this._extensionHostManagers)yield e.extensionHost}map(e){return this._extensionHostManagers.map(t=>e(t.extensionHost))}every(e){return this._extensionHostManagers.every(t=>e(t.extensionHost))}filter(e){return this._extensionHostManagers.filter(t=>e(t.extensionHost)).map(t=>t.extensionHost)}}class E3t{constructor(e,t){this.extensionHost=e,this.disposableStore=t}dispose(){this.disposableStore.dispose(),this.extensionHost.dispose()}}class x3t{constructor(e,t,i,n){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=n}}class S0{constructor(e,t){this.toAdd=e,this.toRemove=t}}function vAe(s,e,t,i,n){return t.updateEnabledApiProposals(i),D3t(s,e,i,n)}function D3t(s,e,t,i){const n=[],o=[],r=[];for(const c of t)c.isUnderDevelopment?n.push(c):(o.push(c),r.push(ice(c)));const a=e.getEnablementStates(r,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestamp{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"activationEvents",label:g(1136,"Activation Events"),access:{canToggle:!1},renderer:new wi(L3t)});var Bp;(function(s){s[s.Open=1]="Open",s[s.OpenInNewWindow=2]="OpenInNewWindow",s[s.Cancel=3]="Cancel"})(Bp||(Bp={}));const R3t="security.workspace.trust.enabled",L5e="security.workspace.trust.untrustedFiles",M3t="security.workspace.trust.emptyWindow",N3t="extensions.supportUntrustedWorkspaces",P3t="content.trust.model.key";class F3t{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 R5e=class extends V{constructor(e,t){super(),this.configurationService=e,this.environmentService=t}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(R3t)}};R5e=D([_(0,Te),_(1,Jr)],R5e);let M5e=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.configurationService=e,this.remoteAuthorityResolverService=t,this.storageService=i,this.uriIdentityService=n,this.environmentService=o,this.workspaceService=r,this.workspaceTrustEnablementService=a,this.fileService=c,this.storageKey=P3t,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}=M2(),{promise:this._workspaceTrustInitializedPromise,resolve:this._workspaceTrustInitializedPromiseResolve}=M2(),this._storedTrustState=new B3t(Wn&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new O3t),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(pe.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(Ie.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===pe.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 n=this.workspaceService.getWorkspace().configuration;n&&Jme(n,this.environmentService)&&(n=await this.getCanonicalUri(n)),this._canonicalWorkspace=new F3t(this.workspaceService.getWorkspace(),i,n)}loadTrustInfo(){const e=this.storageService.get(this.storageKey,Ie.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:N.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),Ie.APPLICATION,an.MACHINE),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const e=this._canonicalWorkspace.folders.map(i=>i.uri),t=this._canonicalWorkspace.configuration;return t&&Jme(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(M3t):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:n}=this.doGetUriTrustInfo(i);if(!n)return t=n,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,n=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,n=o.uri)}return{trusted:t,uri:n}}async doSetUrisTrust(e,t){let i=!1;for(const n of e)if(t){if(this.isTrustedVirtualResource(n)||this.isTrustedByRemote(n))continue;this._trustStateInfo.uriTrustInfo.find(r=>this.uriIdentityService.extUri.isEqual(r.uri,n))||(this._trustStateInfo.uriTrustInfo.push({uri:n,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,n)),o!==this._trustStateInfo.uriTrustInfo.length&&(i=!0)}i&&await this.saveTrustInfo()}isEmptyWorkspace(){if(this.workspaceService.getWorkbenchState()===qi.EMPTY)return!0;const e=this.workspaceService.getWorkspace();return e?Py(this.workspaceService.getWorkspace())&&e.folders.length===0:!1}isTrustedVirtualResource(e){return ECe(e)&&e.scheme!=="vscode-vfs"}isTrustedByRemote(e){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:R2(KYe(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=GO(this._canonicalWorkspace);if(!P_(e)||e.uri.scheme!==pe.file&&e.uri.scheme!==pe.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=GO(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(n=>!this.isTrustedVirtualResource(n)).length===0)return!1;if(!this.isWorkspaceTrusted())return!0;const t=GO(this._canonicalWorkspace);if(!P_(t)||t.uri.scheme!==pe.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 n=this.uriIdentityService.extUri.dirname(t.uri);if(this.doGetUriTrustInfo(n).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),n=this.uriIdentityService.extUri.removeTrailingPathSeparator(i);let o=!1;for(const r of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(r.uri,n)){o=!0;break}o||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:n})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(e){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(e)}};M5e=D([_(0,Te),_(1,pC),_(2,$i),_(3,ks),_(4,Jr),_(5,yi),_(6,_ae),_(7,Jt)],M5e);let N5e=class extends V{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(L5e)}set untrustedFilesSetting(e){this.configurationService.updateValue(L5e,e)}async completeOpenFilesTrustRequest(e,t){this._openFilesTrustRequestResolver&&(e===Bp.Open&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),t&&(e===Bp.Open&&(this.untrustedFilesSetting="open"),e===Bp.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 Bp.Open;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return Bp.OpenInNewWindow;if(this.untrustedFilesSetting==="open")return Bp.Open}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return Bp.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}M.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()}};N5e=D([_(0,Te),_(1,uC)],N5e);class O3t extends V{constructor(){super(...arguments),this.participants=new hl}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 B3t{constructor(e){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",e?(this._memento=new sI("workspaceTrust",e),this._mementoObject=this._memento.getMemento(Ie.WORKSPACE,an.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 wAe=class extends V{constructor(e,t,i,n){super(),this.productService=e,this.configurationService=t,this.workspaceTrustEnablementService=i,this.logService=n,this._extensionPointExtensionKindsMap=null,this._productExtensionKindsMap=null,this._configuredExtensionKindsMap=null,this._productVirtualWorkspaceSupportMap=null,this._configuredVirtualWorkspaceSupportMap=null,this._configuredExtensionWorkspaceTrustRequestMap=new va;const o=t.inspect(N3t).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 n=[];for(const o of i)o!=="-web"&&n.push(o);return i.includes("-web")&&!n.length&&(n.push("ui"),n.push("workspace")),Wn&&!i.includes("-web")&&!i.includes("web")&&t.includes("web")&&n.push("web"),n}return t}getUserConfiguredExtensionKind(e){if(this._configuredExtensionKindsMap===null){const i=new va,n=this.configurationService.getValue("remote.extensionKind")||{};for(const o of Object.keys(n))i.set(o,n[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 n=e.capabilities?.virtualWorkspaces;if(s8(n))return n;if(n){const o=n.supported;if(s8(o)||o==="limited")return o}return i?.default!==void 0?i.default:!0}deduceExtensionKind(e){if(e.main)return e.browser?Wn?["workspace","web"]:["workspace"]:["workspace"];if(e.browser)return["web"];let t=[...jIt];if((eo(e.extensionPack)||eo(e.extensionDependencies))&&(t=Wn?["workspace","web"]:["workspace"]),e.contributes)for(const i of Object.keys(e.contributes)){const n=this.getSupportedExtensionKindsForExtensionPoint(i);n.length&&(t=t.filter(o=>n.includes(o)))}return t.length||this.logService.warn("Cannot deduce extensionKind for extension",Iw(e.publisher,e.name)),t}getSupportedExtensionKindsForExtensionPoint(e){if(this._extensionPointExtensionKindsMap===null){const i=new Map;eh.getExtensionPoints().forEach(n=>i.set(n.name,n.defaultExtensionKind||[])),this._extensionPointExtensionKindsMap=i}let t=this._extensionPointExtensionKindsMap.get(e);return t||(t=this.productService.extensionPointExtensionKind?this.productService.extensionPointExtensionKind[e]:void 0,t)?t:Wn?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(e){const t={id:Iw(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(n=>["ui","workspace"].includes(n))):null))}getProductExtensionKind(e){if(this._productExtensionKindsMap===null){const i=new va;if(this.productService.extensionKind)for(const n of Object.keys(this.productService.extensionKind))i.set(n,this.productService.extensionKind[n]);this._productExtensionKindsMap=i}const t=Iw(e.publisher,e.name);return this._productExtensionKindsMap.get(t)}getProductVirtualWorkspaceSupport(e){if(this._productVirtualWorkspaceSupportMap===null){const i=new va;if(this.productService.extensionVirtualWorkspacesSupport)for(const n of Object.keys(this.productService.extensionVirtualWorkspacesSupport))i.set(n,this.productService.extensionVirtualWorkspacesSupport[n]);this._productVirtualWorkspaceSupportMap=i}const t=Iw(e.publisher,e.name);return this._productVirtualWorkspaceSupportMap.get(t)}getConfiguredVirtualWorkspaceSupport(e){if(this._configuredVirtualWorkspaceSupportMap===null){const i=new va,n=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const o of Object.keys(n))n[o]!==void 0&&i.set(o,n[o]);this._configuredVirtualWorkspaceSupportMap=i}const t=Iw(e.publisher,e.name);return this._configuredVirtualWorkspaceSupportMap.get(t)}getConfiguredExtensionWorkspaceTrustRequest(e){const t=Iw(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=Iw(e.publisher,e.name);return this._productExtensionWorkspaceTrustRequestMap.get(t)}toArray(e){return Array.isArray(e)?e:e==="ui"?["ui","workspace"]:[e]}};wAe=D([_(0,Er),_(1,Te),_(2,_ae),_(3,Ge)],wAe);let yAe=class{constructor(e,t,i){if(this._logService=e,this._environmentService=t,this._envEnabledExtensions=new Set((t.extensionEnabledProposedApi??[]).map(n=>Sn.toKey(n))),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[n,o]of Object.entries(i.extensionEnabledApiProposals)){const r=Sn.toKey(n),a=o.filter(c=>RM[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=Sn.toKey(e.identifier);if(eo(e.enabledApiProposals)&&(e.enabledApiProposals=e.enabledApiProposals.filter(i=>{const n=!!RM[i];return n||this._logService.error(`Extension '${t}' wants API proposal '${i}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),n})),this._productEnabledExtensions.has(t)){const i=this._productEnabledExtensions.get(t),n=new Set(i),o=new Set(e.enabledApiProposals),r=new Set([...o].filter(a=>!n.has(a)));r.size>0&&(this._logService.error(`Extension '${t}' appears in product.json but enables LESS API proposals than the extension wants. + -`)))}return!o}_startExtensionHostsIfNecessary(e,t){const i=[];for(let n=0;n<=this._runningLocations.maxLocalProcessAffinity;n++)i.push(new mee(n));for(let n=0;n<=this._runningLocations.maxLocalWebWorkerAffinity;n++)i.push(new aAe(n));i.push(new _ee);for(const n of i){if(this._extensionHostManagers.getByRunningLocation(n))continue;const o=this._createExtensionHostManager(n,e,t);if(o){const[r,a]=o;this._extensionHostManagers.add(r,a)}}}_createExtensionHostManager(e,t,i){const n=this._extensionHostFactory.createExtensionHost(this._runningLocations,e,t);if(!n)return null;const o=this._doCreateExtensionHostManager(n,i),r=new Z;return r.add(o.onDidExit(([a,c])=>this._onExtensionHostCrashOrExit(o,a,c))),r.add(o.onDidChangeResponsiveState(a=>{this._logService.info(`Extension host (${o.friendyName}) is ${a===MT.Responsive?"responsive":"unresponsive"}.`),this._onDidChangeResponsiveChange.fire({extensionHostKind:o.kind,isResponsive:a===MT.Responsive,getInspectListener:c=>o.getInspectPort(c)})})),[o,r]}_doCreateExtensionHostManager(e,t){const i=this._acquireInternalAPI(e);return e.startup===TA.Lazy&&t.length===0?this._instantiationService.createInstance(lAe,e,i):this._instantiationService.createInstance(fee,e,t,i)}_onExtensionHostCrashOrExit(e,t,i){if(!ANe(this._environmentService).isExtensionDevHost){this._onExtensionHostCrashed(e,t,i);return}this._onExtensionHostExit(t)}_onExtensionHostCrashed(e,t,i){console.error(`Extension host (${e.friendyName}) terminated unexpectedly. Code: ${t}, Signal: ${i}`),e.kind===lo.LocalProcess?this._doStopExtensionHosts():e.kind===lo.Remote&&(i&&this._onRemoteExtensionHostCrashed(e,i),this._extensionHostManagers.disposeOne(e))}_getExtensionHostExitInfoWithTimeout(e){return new Promise((t,i)=>{const n=setTimeout(()=>{i(new Error("getExtensionHostExitInfo timed out"))},2e3);this._remoteAgentService.getExtensionHostExitInfo(e).then(o=>{clearTimeout(n),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(1133,"The remote extension host terminated unexpectedly. Restarting..."),{hideAfter:5e3}),this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()))):this._notificationService.prompt(Xe.Error,g(1134,"Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."),[{label:g(1135,"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 w0(e.toAdd,e.toRemove));const t=await this._registry.acquireLock("startExtensionHosts");try{this._startExtensionHostsIfNecessary(!1,Array.from(this._allRequestedActivateEvents.keys()));const i=this._getExtensionHostManagers(lo.LocalProcess);await Promise.all(i.map(n=>n.ready()))}finally{t.dispose()}}activateByEvent(e,t=Lb.Normal){return this._installedExtensionsReady.isOpen()?(this._allRequestedActivateEvents.add(e),this._registry.containsActivationEvent(e)?this._activateByEvent(e,t):u3t):(this._allRequestedActivateEvents.add(e),t===Lb.Immediate?this._activateByEvent(e,t):this._installedExtensionsReady.wait().then(()=>this._activateByEvent(e,t)))}_activateByEvent(e,t){const i=Promise.all(this._extensionHostManagers.map(n=>n.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 n of t)n.contributes&&vue.call(n.contributes,e.name)&&i.push(new xLt(n,n.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 n=this._extensionStatus.get(i.identifier);e[i.identifier.value]={id:i.identifier,messages:n?.messages??[],activationStarted:n?.activationStarted??!1,activationTimes:n?.activationTimes??void 0,runtimeErrors:n?.runtimeErrors??[],runningLocation:this._runningLocations.getRunningLocation(i.identifier)}}}return e}async getInspectPorts(e,t){return(await Promise.all(this._getExtensionHostManagers(e).map(n=>n.getInspectPort(t)))).filter(Fc)}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)vue.call(r.contributes,a)&&(t[a]=!0);const i=r=>this._handleExtensionPointMessage(r),n=this._registry.getAllExtensionDescriptions(),o=Xd.getExtensionPoints();cs("code/willHandleExtensionPoints");for(const r of o)t[r.name]&&(cs(`code/willHandleExtensionPoint/${r.name}`),dAe._handleExtensionPoint(r,n,i),cs(`code/didHandleExtensionPoint/${r.name}`));cs("code/didHandleExtensionPoints")}_getOrCreateExtensionStatus(e){return this._extensionStatus.has(e)||this._extensionStatus.set(e,new v3t(e)),this._extensionStatus.get(e)}_handleExtensionPointMessage(e){this._getOrCreateExtensionStatus(e.extensionId).addMessage(e);const i=this._registry.getExtensionDescription(e.extensionId),n=`[${e.extensionId.value}]: ${e.message}`;if(e.type===Xe.Error?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Xe.Error,message:n}),this._logService.error(n)):e.type===Xe.Warning?(i&&i.isUnderDevelopment&&this._notificationService.notify({severity:Xe.Warning,message:n}),this._logService.warn(n)):this._logService.info(n),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 n=[];for(const o of t)o.contributes&&vue.call(o.contributes,e.name)&&n.push({description:o,value:o.contributes[e.name],collector:new GLt(i,o,e.name)});e.acceptUsers(n)}_acquireInternalAPI(e){return{_activateById:(t,i)=>this._activateById(t,i),_onWillActivateExtension:t=>this._onWillActivateExtension(t,e.runningLocation),_onDidActivateExtension:(t,i,n,o,r)=>this._onDidActivateExtension(t,i,n,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,n,o){this._getOrCreateExtensionStatus(e).setActivationTimes(new ELt(t,i,n,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])}};hAe=dAe=D([_(3,we),_(4,bi),_(5,Jr),_(6,Yi),_(7,Ml),_(8,Jt),_(9,Er),_(10,L6),_(11,yi),_(12,Te),_(13,xm),_(14,Ge),_(15,cg),_(16,Nae),_(17,Zu),_(18,hC),_(19,to)],hAe);class g3t extends V{constructor(){super(...arguments),this._extensionHostManagers=[]}dispose(){this.disposeAllInReverse(),super.dispose()}add(e,t){this._extensionHostManagers.push(new f3t(e,t))}disposeAllInReverse(){for(let e=this._extensionHostManagers.length-1;e>=0;e--)this._extensionHostManagers[e].dispose();this._extensionHostManagers=[]}disposeOne(e){const t=this._extensionHostManagers.findIndex(i=>i.extensionHost===e);t>=0&&(this._extensionHostManagers.splice(t,1),e.dispose())}getByKind(e){return this.filter(t=>t.kind===e)}getByRunningLocation(e){for(const t of this._extensionHostManagers)if(t.extensionHost.representsRunningLocation(e))return t.extensionHost;return null}*[Symbol.iterator](){for(const e of this._extensionHostManagers)yield e.extensionHost}map(e){return this._extensionHostManagers.map(t=>e(t.extensionHost))}every(e){return this._extensionHostManagers.every(t=>e(t.extensionHost))}filter(e){return this._extensionHostManagers.filter(t=>e(t.extensionHost)).map(t=>t.extensionHost)}}class f3t{constructor(e,t){this.extensionHost=e,this.disposableStore=t}dispose(){this.disposableStore.dispose(),this.extensionHost.dispose()}}class p3t{constructor(e,t,i,n){this.local=e,this.remote=t,this.hasLocalProcess=i,this.allowRemoteExtensionsInLocalWebWorker=n}}class w0{constructor(e,t){this.toAdd=e,this.toRemove=t}}function uAe(s,e,t,i,n){return t.updateEnabledApiProposals(i),m3t(s,e,i,n)}function m3t(s,e,t,i){const n=[],o=[],r=[];for(const c of t)c.isUnderDevelopment?n.push(c):(o.push(c),r.push(Xae(c)));const a=e.getEnablementStates(r,i?{trusted:!0}:void 0);for(let c=0;c0&&this._recentCrashes[0].timestamp{}}}}Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"activationEvents",label:g(1136,"Activation Events"),access:{canToggle:!1},renderer:new wi(w3t)});var Pp;(function(s){s[s.Open=1]="Open",s[s.OpenInNewWindow=2]="OpenInNewWindow",s[s.Cancel=3]="Cancel"})(Pp||(Pp={}));const y3t="security.workspace.trust.enabled",b5e="security.workspace.trust.untrustedFiles",C3t="security.workspace.trust.emptyWindow",S3t="extensions.supportUntrustedWorkspaces",A3t="content.trust.model.key";class E3t{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 w5e=class extends V{constructor(e,t){super(),this.configurationService=e,this.environmentService=t}isWorkspaceTrustEnabled(){return this.environmentService.disableWorkspaceTrust?!1:!!this.configurationService.getValue(y3t)}};w5e=D([_(0,Te),_(1,Jr)],w5e);let y5e=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.configurationService=e,this.remoteAuthorityResolverService=t,this.storageService=i,this.uriIdentityService=n,this.environmentService=o,this.workspaceService=r,this.workspaceTrustEnablementService=a,this.fileService=c,this.storageKey=A3t,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}=I2(),{promise:this._workspaceTrustInitializedPromise,resolve:this._workspaceTrustInitializedPromiseResolve}=I2(),this._storedTrustState=new D3t(Wn&&this.isEmptyWorkspace()?void 0:this.storageService),this._trustTransitionManager=this._register(new x3t),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(pe.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(Ie.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===pe.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 n=this.workspaceService.getWorkspace().configuration;n&&Gme(n,this.environmentService)&&(n=await this.getCanonicalUri(n)),this._canonicalWorkspace=new E3t(this.workspaceService.getWorkspace(),i,n)}loadTrustInfo(){const e=this.storageService.get(this.storageKey,Ie.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:N.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),Ie.APPLICATION,an.MACHINE),this._onDidChangeTrustedFolders.fire(),await this.updateWorkspaceTrust()}getWorkspaceUris(){const e=this._canonicalWorkspace.folders.map(i=>i.uri),t=this._canonicalWorkspace.configuration;return t&&Gme(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(C3t):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:n}=this.doGetUriTrustInfo(i);if(!n)return t=n,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,n=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,n=o.uri)}return{trusted:t,uri:n}}async doSetUrisTrust(e,t){let i=!1;for(const n of e)if(t){if(this.isTrustedVirtualResource(n)||this.isTrustedByRemote(n))continue;this._trustStateInfo.uriTrustInfo.find(r=>this.uriIdentityService.extUri.isEqual(r.uri,n))||(this._trustStateInfo.uriTrustInfo.push({uri:n,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,n)),o!==this._trustStateInfo.uriTrustInfo.length&&(i=!0)}i&&await this.saveTrustInfo()}isEmptyWorkspace(){if(this.workspaceService.getWorkbenchState()===qi.EMPTY)return!0;const e=this.workspaceService.getWorkspace();return e?Ry(this.workspaceService.getWorkspace())&&e.folders.length===0:!1}isTrustedVirtualResource(e){return bCe(e)&&e.scheme!=="vscode-vfs"}isTrustedByRemote(e){return!this.environmentService.remoteAuthority||!this._remoteAuthority?!1:k2(BYe(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=UO(this._canonicalWorkspace);if(!R_(e)||e.uri.scheme!==pe.file&&e.uri.scheme!==pe.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=UO(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(n=>!this.isTrustedVirtualResource(n)).length===0)return!1;if(!this.isWorkspaceTrusted())return!0;const t=UO(this._canonicalWorkspace);if(!R_(t)||t.uri.scheme!==pe.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 n=this.uriIdentityService.extUri.dirname(t.uri);if(this.doGetUriTrustInfo(n).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),n=this.uriIdentityService.extUri.removeTrailingPathSeparator(i);let o=!1;for(const r of this._trustStateInfo.uriTrustInfo)if(this.uriIdentityService.extUri.isEqual(r.uri,n)){o=!0;break}o||this._trustStateInfo.uriTrustInfo.push({trusted:!0,uri:n})}await this.saveTrustInfo()}addWorkspaceTrustTransitionParticipant(e){return this._trustTransitionManager.addWorkspaceTrustTransitionParticipant(e)}};y5e=D([_(0,Te),_(1,hC),_(2,$i),_(3,ks),_(4,Jr),_(5,yi),_(6,gae),_(7,Jt)],y5e);let C5e=class extends V{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(b5e)}set untrustedFilesSetting(e){this.configurationService.updateValue(b5e,e)}async completeOpenFilesTrustRequest(e,t){this._openFilesTrustRequestResolver&&(e===Pp.Open&&(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles=!0),t&&(e===Pp.Open&&(this.untrustedFilesSetting="open"),e===Pp.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 Pp.Open;if(this.untrustedFilesSetting!=="prompt"){if(this.untrustedFilesSetting==="newWindow")return Pp.OpenInNewWindow;if(this.untrustedFilesSetting==="open")return Pp.Open}if(this.workspaceTrustManagementService.acceptsOutOfWorkspaceFiles)return Pp.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}M.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()}};C5e=D([_(0,Te),_(1,cC)],C5e);class x3t extends V{constructor(){super(...arguments),this.participants=new dl}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 D3t{constructor(e){this._acceptsOutOfWorkspaceFilesKey="acceptsOutOfWorkspaceFiles",this._isEmptyWorkspaceTrustedKey="isEmptyWorkspaceTrusted",e?(this._memento=new Zk("workspaceTrust",e),this._mementoObject=this._memento.getMemento(Ie.WORKSPACE,an.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 fAe=class extends V{constructor(e,t,i,n){super(),this.productService=e,this.configurationService=t,this.workspaceTrustEnablementService=i,this.logService=n,this._extensionPointExtensionKindsMap=null,this._productExtensionKindsMap=null,this._configuredExtensionKindsMap=null,this._productVirtualWorkspaceSupportMap=null,this._configuredVirtualWorkspaceSupportMap=null,this._configuredExtensionWorkspaceTrustRequestMap=new va;const o=t.inspect(S3t).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 n=[];for(const o of i)o!=="-web"&&n.push(o);return i.includes("-web")&&!n.length&&(n.push("ui"),n.push("workspace")),Wn&&!i.includes("-web")&&!i.includes("web")&&t.includes("web")&&n.push("web"),n}return t}getUserConfiguredExtensionKind(e){if(this._configuredExtensionKindsMap===null){const i=new va,n=this.configurationService.getValue("remote.extensionKind")||{};for(const o of Object.keys(n))i.set(o,n[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 n=e.capabilities?.virtualWorkspaces;if(t8(n))return n;if(n){const o=n.supported;if(t8(o)||o==="limited")return o}return i?.default!==void 0?i.default:!0}deduceExtensionKind(e){if(e.main)return e.browser?Wn?["workspace","web"]:["workspace"]:["workspace"];if(e.browser)return["web"];let t=[...BIt];if((eo(e.extensionPack)||eo(e.extensionDependencies))&&(t=Wn?["workspace","web"]:["workspace"]),e.contributes)for(const i of Object.keys(e.contributes)){const n=this.getSupportedExtensionKindsForExtensionPoint(i);n.length&&(t=t.filter(o=>n.includes(o)))}return t.length||this.logService.warn("Cannot deduce extensionKind for extension",xw(e.publisher,e.name)),t}getSupportedExtensionKindsForExtensionPoint(e){if(this._extensionPointExtensionKindsMap===null){const i=new Map;Xd.getExtensionPoints().forEach(n=>i.set(n.name,n.defaultExtensionKind||[])),this._extensionPointExtensionKindsMap=i}let t=this._extensionPointExtensionKindsMap.get(e);return t||(t=this.productService.extensionPointExtensionKind?this.productService.extensionPointExtensionKind[e]:void 0,t)?t:Wn?["workspace","web"]:["workspace"]}getConfiguredExtensionKind(e){const t={id:xw(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(n=>["ui","workspace"].includes(n))):null))}getProductExtensionKind(e){if(this._productExtensionKindsMap===null){const i=new va;if(this.productService.extensionKind)for(const n of Object.keys(this.productService.extensionKind))i.set(n,this.productService.extensionKind[n]);this._productExtensionKindsMap=i}const t=xw(e.publisher,e.name);return this._productExtensionKindsMap.get(t)}getProductVirtualWorkspaceSupport(e){if(this._productVirtualWorkspaceSupportMap===null){const i=new va;if(this.productService.extensionVirtualWorkspacesSupport)for(const n of Object.keys(this.productService.extensionVirtualWorkspacesSupport))i.set(n,this.productService.extensionVirtualWorkspacesSupport[n]);this._productVirtualWorkspaceSupportMap=i}const t=xw(e.publisher,e.name);return this._productVirtualWorkspaceSupportMap.get(t)}getConfiguredVirtualWorkspaceSupport(e){if(this._configuredVirtualWorkspaceSupportMap===null){const i=new va,n=this.configurationService.getValue("extensions.supportVirtualWorkspaces")||{};for(const o of Object.keys(n))n[o]!==void 0&&i.set(o,n[o]);this._configuredVirtualWorkspaceSupportMap=i}const t=xw(e.publisher,e.name);return this._configuredVirtualWorkspaceSupportMap.get(t)}getConfiguredExtensionWorkspaceTrustRequest(e){const t=xw(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=xw(e.publisher,e.name);return this._productExtensionWorkspaceTrustRequestMap.get(t)}toArray(e){return Array.isArray(e)?e:e==="ui"?["ui","workspace"]:[e]}};fAe=D([_(0,Er),_(1,Te),_(2,gae),_(3,Ge)],fAe);let pAe=class{constructor(e,t,i){if(this._logService=e,this._environmentService=t,this._envEnabledExtensions=new Set((t.extensionEnabledProposedApi??[]).map(n=>Sn.toKey(n))),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[n,o]of Object.entries(i.extensionEnabledApiProposals)){const r=Sn.toKey(n),a=o.filter(c=>kM[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=Sn.toKey(e.identifier);if(eo(e.enabledApiProposals)&&(e.enabledApiProposals=e.enabledApiProposals.filter(i=>{const n=!!kM[i];return n||this._logService.error(`Extension '${t}' wants API proposal '${i}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`),n})),this._productEnabledExtensions.has(t)){const i=this._productEnabledExtensions.get(t),n=new Set(i),o=new Set(e.enabledApiProposals),r=new Set([...o].filter(a=>!n.has(a)));r.size>0&&(this._logService.error(`Extension '${t}' appears in product.json but enables LESS API proposals than the extension wants. package.json (LOSES): ${[...o].join(", ")} -product.json (WINS): ${[...n].join(", ")}`),this._environmentService.isExtensionDevelopment&&(this._logService.error(`Proceeding with EXTRA proposals (${[...r].join(", ")}) because extension is in development mode. Still, this EXTENSION WILL BE BROKEN unless product.json is updated.`),i.push(...r))),e.enabledApiProposals=i;return}this._envEnablesProposedApiForAll||this._envEnabledExtensions.has(t)||!e.isBuiltin&&eo(e.enabledApiProposals)&&(this._logService.error(`Extension '${e.identifier.value} CANNOT USE these API proposals '${e.enabledApiProposals?.join(", ")||"*"}'. You MUST start in extension development mode or use the --enable-proposed-api command line flag`),e.enabledApiProposals=[])}};yAe=D([_(0,Ge),_(1,Jr),_(2,Er)],yAe);class W3t extends V{constructor(){super(...arguments),this.type="markdown"}shouldRender(e){return!!e.originalEnabledApiProposals?.length||!!e.enabledApiProposals?.length}render(e){const t=e.originalEnabledApiProposals??e.enabledApiProposals??[],i=new Mt;if(t.length)for(const n of t)i.appendMarkdown(`- \`${n}\` -`);return{data:i,dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"enabledApiProposals",label:g(1137,"API Proposals"),access:{canToggle:!1},renderer:new wi(W3t)});async function H3t(s,e){const t=[];return await Hit(s,t,e.logsHome,e.logsHome),t}async function Hit(s,e,t,i){const n=await s.resolve(t);for(const{resource:o,isDirectory:r}of n.children||[])if(r)await Hit(s,e,o,i);else{const a=(await s.readFile(o)).value.toString();if(a){const c=DN(i,o);c&&e.push({relativePath:c,contents:a})}}}var Ff;(function(s){s[s.Promise=100]="Promise",s[s.PromiseCancel=101]="PromiseCancel",s[s.EventListen=102]="EventListen",s[s.EventDispose=103]="EventDispose"})(Ff||(Ff={}));function P5e(s){switch(s){case Ff.Promise:return"req";case Ff.PromiseCancel:return"cancel";case Ff.EventListen:return"subscribe";case Ff.EventDispose:return"unsubscribe"}}var Du;(function(s){s[s.Initialize=200]="Initialize",s[s.PromiseSuccess=201]="PromiseSuccess",s[s.PromiseError=202]="PromiseError",s[s.PromiseErrorObj=203]="PromiseErrorObj",s[s.EventFire=204]="EventFire"})(Du||(Du={}));function F5e(s){switch(s){case Du.Initialize:return"init";case Du.PromiseSuccess:return"reply:";case Du.PromiseError:case Du.PromiseErrorObj:return"replyErr:";case Du.EventFire:return"event:"}}var SF;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Idle=1]="Idle"})(SF||(SF={}));function vP(s){let e=0;for(let t=0;;t+=7){const i=s.read(1);if(e|=(i.buffer[0]&127)<>>7)t++;const i=$e.alloc(t);for(let n=0;e!==0;n++)i.buffer[n]=e&127,e=e>>>7,e>0&&(i.buffer[n]|=128);s.write(i)}class V3t{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 z3t{constructor(){this.buffers=[]}get buffer(){return $e.concat(this.buffers)}write(e){this.buffers.push(e)}}var Fu;(function(s){s[s.Undefined=0]="Undefined",s[s.String=1]="String",s[s.Buffer=2]="Buffer",s[s.VSBuffer=3]="VSBuffer",s[s.Array=4]="Array",s[s.Object=5]="Object",s[s.Int=6]="Int"})(Fu||(Fu={}));function xE(s){const e=$e.alloc(1);return e.writeUInt8(s,0),e}const GI={Undefined:xE(Fu.Undefined),String:xE(Fu.String),Buffer:xE(Fu.Buffer),VSBuffer:xE(Fu.VSBuffer),Array:xE(Fu.Array),Object:xE(Fu.Object),Uint:xE(Fu.Int)},$3t=typeof Buffer<"u";function CAe(s,e){if(typeof e>"u")s.write(GI.Undefined);else if(typeof e=="string"){const t=$e.fromString(e);s.write(GI.String),bP(s,t.byteLength),s.write(t)}else if($3t&&Buffer.isBuffer(e)){const t=$e.wrap(e);s.write(GI.Buffer),bP(s,t.byteLength),s.write(t)}else if(e instanceof $e)s.write(GI.VSBuffer),bP(s,e.byteLength),s.write(e);else if(Array.isArray(e)){s.write(GI.Array),bP(s,e.length);for(const t of e)CAe(s,t)}else if(typeof e=="number"&&(e|0)===e)s.write(GI.Uint),bP(s,e);else{const t=$e.fromString(JSON.stringify(e));s.write(GI.Object),bP(s,t.byteLength),s.write(t)}}function SAe(s){switch(s.read(1).readUInt8(0)){case Fu.Undefined:return;case Fu.String:return s.read(vP(s)).toString();case Fu.Buffer:return s.read(vP(s)).buffer;case Fu.VSBuffer:return s.read(vP(s));case Fu.Array:{const t=vP(s),i=[];for(let n=0;nthis.onBuffer(i)),this.logger=t}getChannel(e){const t=this;return{call(i,n,o){return t.isDisposed?Promise.reject(new Ma):t.requestPromise(e,i,n,o)},listen(i,n){return t.isDisposed?M.None:t.requestEvent(e,i,n)}}}requestPromise(e,t,i,n=He.None){const o=this.lastRequestId++,r=Ff.Promise,a={id:o,type:r,channelName:e,name:t,arg:i};if(n.isCancellationRequested)return Promise.reject(new Ma);let c;return new Promise((d,h)=>{if(n.isCancellationRequested)return h(new Ma);const u=()=>{const v=b=>{switch(b.type){case Du.PromiseSuccess:this.handlers.delete(o),d(b.data);break;case Du.PromiseError:{this.handlers.delete(o);const w=new Error(b.data.message);w.stack=Array.isArray(b.data.stack)?b.data.stack.join(` -`):b.data.stack,w.name=b.data.name,h(w);break}case Du.PromiseErrorObj:this.handlers.delete(o),h(b.data);break}};this.handlers.set(o,v),this.sendRequest(a)};let f=null;this.state===SF.Idle?u():(f=Rr(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:o,type:Ff.PromiseCancel}),h(new Ma)},m=n.onCancellationRequested(p);c=jr(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const n=this.lastRequestId++,o=Ff.EventListen,r={id:n,type:o,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=Rr(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:n,type:Ff.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(n,l),c.event}sendRequest(e){switch(e.type){case Ff.Promise:case Ff.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,AF.LocalSide,`${P5e(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case Ff.PromiseCancel:case Ff.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,AF.LocalSide,P5e(e.type));return}}}send(e,t=void 0){const i=new z3t;return CAe(i,e),CAe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new V3t(e),i=SAe(t),n=SAe(t),o=i[0];switch(o){case Du.Initialize:return this.logger?.logIncoming(e.byteLength,0,AF.LocalSide,F5e(o)),this.onResponse({type:i[0]});case Du.PromiseSuccess:case Du.PromiseError:case Du.EventFire:case Du.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],AF.LocalSide,F5e(o),n),this.onResponse({type:i[0],id:i[1],data:n})}}onResponse(e){if(e.type===Du.Initialize){this.state=SF.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return M.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===SF.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),bt(this.activeRequests.values()),this.activeRequests.clear()}}O5e.__decorator=D([Zt],O5e.prototype,"onDidInitializePromise",null);var BT;(function(s){s.Created="created",s.Read="read",s.Write="write",s.Open="open",s.Error="error",s.Close="close",s.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",s.NodeEndReceived="nodeEndReceived",s.NodeEndSent="nodeEndSent",s.NodeDrainBegin="nodeDrainBegin",s.NodeDrainEnd="nodeDrainEnd",s.zlibInflateError="zlibInflateError",s.zlibInflateData="zlibInflateData",s.zlibInflateInitialWrite="zlibInflateInitialWrite",s.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",s.zlibInflateWrite="zlibInflateWrite",s.zlibInflateFlushFired="zlibInflateFlushFired",s.zlibDeflateError="zlibDeflateError",s.zlibDeflateData="zlibDeflateData",s.zlibDeflateWrite="zlibDeflateWrite",s.zlibDeflateFlushFired="zlibDeflateFlushFired",s.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",s.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",s.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",s.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",s.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",s.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",s.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",s.ProtocolHeaderRead="protocolHeaderRead",s.ProtocolMessageRead="protocolMessageRead",s.ProtocolHeaderWrite="protocolHeaderWrite",s.ProtocolMessageWrite="protocolMessageWrite",s.ProtocolWrite="protocolWrite"})(BT||(BT={}));var AAe;(function(s){s.enableDiagnostics=!1,s.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 n(o,r,a,c){if(!s.enableDiagnostics)return;const l=i(o);if(c instanceof $e||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=$e.alloc(c.byteLength);d.set(c),s.records.push({timestamp:Date.now(),id:l,label:r,type:a,buff:d})}else s.records.push({timestamp:Date.now(),id:l,label:r,type:a,data:c})}s.traceSocketEvent=n})(AAe||(AAe={}));var Aee;(function(s){s[s.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",s[s.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(Aee||(Aee={}));let xue=null;function DE(){return xue||(xue=$e.alloc(0)),xue}class G3t{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 DE();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=$e.alloc(e);let n=0,o=0;for(;e>0;){const r=this._chunks[o];if(r.byteLength>e){const a=r.slice(0,e);i.set(a,n),n+=e,t&&(this._chunks[o]=r.slice(e),this._totalLength-=e),e-=e}else i.set(r,n),n+=r.byteLength,t?(this._chunks.shift(),this._totalLength-=r.byteLength):o++,e-=r.byteLength}return i}}var Vr;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Control=2]="Control",s[s.Ack=3]="Ack",s[s.Disconnect=5]="Disconnect",s[s.ReplayRequest=6]="ReplayRequest",s[s.Pause=7]="Pause",s[s.Resume=8]="Resume",s[s.KeepAlive=9]="KeepAlive"})(Vr||(Vr={}));function Uit(s){switch(s){case Vr.None:return"None";case Vr.Regular:return"Regular";case Vr.Control:return"Control";case Vr.Ack:return"Ack";case Vr.Disconnect:return"Disconnect";case Vr.ReplayRequest:return"ReplayRequest";case Vr.Pause:return"PauseWriting";case Vr.Resume:return"ResumeWriting";case Vr.KeepAlive:return"KeepAlive"}}var Rf;(function(s){s[s.HeaderLength=13]="HeaderLength",s[s.AcknowledgeTime=2e3]="AcknowledgeTime",s[s.TimeoutTime=2e4]="TimeoutTime",s[s.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",s[s.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",s[s.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(Rf||(Rf={}));class nw{constructor(e,t,i,n){this.type=e,this.id=t,this.ack=i,this.data=n,this.writtenTime=0}get size(){return this.data.byteLength}}class B5e extends V{constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:Rf.HeaderLength,messageType:Vr.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new G3t,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(BT.ProtocolHeaderRead,{messageType:Uit(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const i=this._state.messageType,n=this._state.id,o=this._state.ack;if(this._state.readHead=!0,this._state.readLen=Rf.HeaderLength,this._state.messageType=Vr.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent(BT.ProtocolMessageRead,t),this._onMessage.fire(new nw(i,n,o,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class W5e{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=$e.alloc(Rf.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(BT.ProtocolHeaderWrite,{messageType:Uit(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent(BT.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=$e.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(BT.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class e1{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 K3t{constructor(e){this.data=e,this.next=null}}class q3t{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 K3t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const Lp=class Lp{static getInstance(){return Lp._INSTANCE||(Lp._INSTANCE=new Lp),Lp._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=Lp._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+Lp._HISTORY_LENGTH)*1e3;let i=0;for(let n=0;n=.5}};Lp._HISTORY_LENGTH=10,Lp._INSTANCE=null;let EAe=Lp;class Q3t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new e1,this.onControlMessage=this._onControlMessage.event,this._onMessage=new e1,this.onMessage=this._onMessage.event,this._onDidDispose=new e1,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new e1,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new e1,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??EAe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new q3t,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 W5e(this._socket)),this._socketReader=this._socketDisposables.add(new B5e(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()},Rf.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(){if(!this._didSendDisconnect){this._didSendDisconnect=!0;const e=new nw(Vr.Disconnect,0,0,DE());this._socketWriter.write(e),this._socketWriter.flush()}}sendPause(){const e=new nw(Vr.Pause,0,0,DE());this._socketWriter.write(e)}sendResume(){const e=new nw(Vr.Resume,0,0,DE());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 W5e(this._socket)),this._socketReader=this._socketDisposables.add(new B5e(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 nw(Vr.Ack,0,this._incomingAckId,DE());this._socketWriter.write(e);const t=this._outgoingUnackMsg.toArray();for(let i=0,n=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 Vr.None:break;case Vr.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 nw(Vr.ReplayRequest,0,0,DE())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case Vr.Control:{this._onControlMessage.fire(e.data);break}case Vr.Ack:break;case Vr.Disconnect:{this._onDidDispose.fire();break}case Vr.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,n=t.length;i=Rf.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},Rf.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,n=Date.now()-this._lastSocketTimeoutTime;if(t>=Rf.TimeoutTime&&i>=Rf.TimeoutTime&&n>=Rf.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const o=Math.max(Rf.TimeoutTime-t,Rf.TimeoutTime-i,Rf.TimeoutTime-n,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},o)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new nw(Vr.Ack,0,this._incomingAckId,DE());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new nw(Vr.KeepAlive,0,this._incomingAckId,DE());this._socketWriter.write(e)}}const j3t=30*1e3;var WT;(function(s){s[s.Management=1]="Management",s[s.ExtensionHost=2]="ExtensionHost",s[s.Tunnel=3]="Tunnel"})(WT||(WT={}));function xAe(s){switch(s){case WT.Management:return"Management";case WT.ExtensionHost:return"ExtensionHost";case WT.Tunnel:return"Tunnel"}}function Vit(s){const e=new ci;return setTimeout(()=>e.cancel(),s),e.token}function Y3t(s,e){if(s.isCancellationRequested||e.isCancellationRequested)return He.Cancelled;const t=new ci;return s.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Mce{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=M2(),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 J3t(s,e){const t=new Mce(e);return t.registerDisposable(s.onControlMessage(i=>{const n=JSON.parse(i.toString()),o=Git(n);o?t.reject(o):t.resolve(n)})),t.promise}function X3t(s,e,t,i,n,o,r,a){const c=new Mce(a),l=js.create(!1);return s.info(`Creating a socket (${r})...`),cs(`code/willCreateSocket/${o}`),e.connect(t,i,n,r).then(d=>{c.didTimeout?(cs(`code/didCreateSocketError/${o}`),s.info(`Creating a socket (${r}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(cs(`code/didCreateSocketOK/${o}`),s.info(`Creating a socket (${r}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{cs(`code/didCreateSocketError/${o}`),s.info(`Creating a socket (${r}) returned an error after ${l.elapsed()} ms.`),s.error(d),c.reject(d)}),c.promise}function Due(s,e){const t=new Mce(e);return s.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function Z3t(s,e,t,i){const n=Kit(s,e);s.logService.trace(`${n} 1/6. invoking socketFactory.connect().`);let o;try{o=await X3t(s.logService,s.remoteSocketFactoryService,s.connectTo,E8.getServerRootPath(),`reconnectionToken=${s.reconnectionToken}&reconnection=${s.reconnectionProtocol?"true":"false"}`,xAe(e),`renderer-${xAe(e)}-${s.reconnectionToken}`,i)}catch(d){throw s.logService.error(`${n} socketFactory.connect() failed or timed out. Error:`),s.logService.error(d),d}s.logService.trace(`${n} 2/6. socketFactory.connect() was successful.`);let r,a;s.reconnectionProtocol?(s.reconnectionProtocol.beginAcceptReconnection(o,null),r=s.reconnectionProtocol,a=!1):(r=new Q3t({socket:o}),a=!0),s.logService.trace(`${n} 3/6. sending AuthRequest control message.`);const c=await Due(s.signService.createNewMessage(ar()),i),l={type:"auth",auth:s.connectionToken||"00000000000000000000",data:c.data};r.sendControl($e.fromString(JSON.stringify(l)));try{const d=await J3t(r,Y3t(i,Vit(1e4)));if(d.type!=="sign"||typeof d.data!="string"){const p=new Error("Unexpected handshake message");throw p.code="VSCODE_CONNECTION_ERROR",p}if(s.logService.trace(`${n} 4/6. received SignRequest control message.`),!await Due(s.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 Due(s.signService.sign(d.data),i),f={type:"connectionType",commit:s.commit,signedData:u,desiredConnectionType:e};return t&&(f.args=t),s.logService.trace(`${n} 5/6. sending ConnectionTypeRequest control message.`),r.sendControl($e.fromString(JSON.stringify(f))),{protocol:r,ownsProtocol:a}}catch(d){throw d&&d.code==="ETIMEDOUT"&&(s.logService.error(`${n} the handshake timed out. Error:`),s.logService.error(d)),d&&d.code==="VSCODE_CONNECTION_ERROR"&&(s.logService.error(`${n} received error control message when negotiating connection. Error:`),s.logService.error(d)),a&&HNe(r),d}}async function e9t(s,e,t,i){const n=Date.now(),o=Kit(s,e),{protocol:r,ownsProtocol:a}=await Z3t(s,e,t,i),c=new Mce(i);return c.registerDisposable(r.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=Git(d);h?(s.logService.error(`${o} received error control message when negotiating connection. Error:`),s.logService.error(h),a&&HNe(r),c.reject(h)):(s.reconnectionProtocol?.endAcceptReconnection(),s.logService.trace(`${o} 6/6. handshake finished, connection is up and running after ${h9t(n)}!`),c.resolve({protocol:r,firstMessage:d}))})),c.promise}async function zit(s,e,t){const{protocol:i,firstMessage:n}=await e9t(s,WT.ExtensionHost,e,t),o=n&&n.debugPort;return{protocol:i,debugPort:o}}async function $it(s,e,t){const{connectTo:i,connectionToken:n}=await s.addressProvider.getAddress();return{commit:s.commit,quality:s.quality,connectTo:i,connectionToken:n,reconnectionToken:e,reconnectionProtocol:t,remoteSocketFactoryService:s.remoteSocketFactoryService,signService:s.signService,logService:s.logService}}async function t9t(s,e){return i9t(s,async t=>{const{protocol:i,debugPort:n}=await zit(t,e,He.None);return new c9t(s,e,t.reconnectionToken,i,n)})}async function i9t(s,e){for(let i=1;;i++)try{const n=ar(),o=await $it(s,n,null);return await e(o)}catch(n){if(i<5)s.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! Will retry... Error:`),s.logService.error(n);else throw s.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! It will be treated as a permanent error. Error:`),s.logService.error(n),Eee.triggerPermanentFailure(0,0,fD.isHandled(n)),n}}function n9t(s){return Rr(e=>new Promise((t,i)=>{const n=setTimeout(t,s*1e3);e.onCancellationRequested(()=>{clearTimeout(n),t()})}))}var lI;(function(s){s[s.ConnectionLost=0]="ConnectionLost",s[s.ReconnectionWait=1]="ReconnectionWait",s[s.ReconnectionRunning=2]="ReconnectionRunning",s[s.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",s[s.ConnectionGain=4]="ConnectionGain"})(lI||(lI={}));class s9t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=lI.ConnectionLost}}class o9t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=n,this.type=lI.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class r9t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=lI.ReconnectionRunning}}class H5e{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=lI.ConnectionGain}}class a9t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=n,this.type=lI.ReconnectionPermanentFailure}}const Eg=class Eg extends V{static triggerPermanentFailure(e,t,i){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=t,this._permanentFailureHandled=i,this._instances.forEach(n=>n._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||Eg._permanentFailure}constructor(e,t,i,n,o){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=n,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 H5e(this.reconnectionToken,0,0)),this._register(n.onSocketClose(r=>{const a=JQ(this._connectionType,this.reconnectionToken,!0);r?r.type===Aee.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(n.onSocketTimeout(r=>{const a=JQ(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()})),Eg._instances.push(this),this._register(Ee(()=>{const r=Eg._instances.indexOf(this);r>=0&&Eg._instances.splice(r,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Eg._permanentFailureMillisSinceLastIncomingData,Eg._permanentFailureAttempt,Eg._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=JQ(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 s9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const t=[0,5,5,10,10,10,10,10,30];let i=-1;do{i++;const n=i0){const r=n9t(n);this._onDidStateChange.fire(new o9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),n,r)),this._options.logService.info(`${e} waiting for ${n} 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 r9t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const o=await $it(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${o.connectTo}...`),await this._reconnect(o,Vit(j3t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new H5e(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(fD.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(Fr(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 fD){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,fD.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?Eg.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new a9t(this.reconnectionToken,e,t,i)),HNe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};Eg._permanentFailure=!1,Eg._permanentFailureMillisSinceLastIncomingData=0,Eg._permanentFailureAttempt=0,Eg._permanentFailureHandled=!1,Eg._instances=[];let Eee=Eg;class c9t extends Eee{constructor(e,t,i,n,o){super(WT.ExtensionHost,e,i,n,!1),this._startArguments=t,this.debugPort=o}async _reconnect(e,t){await zit(e,this._startArguments,t)}}function HNe(s){try{s.acceptDisconnect();const e=s.getSocket();s.dispose(),e.dispose()}catch(e){vt(e)}}function Git(s){if(s&&s.type==="error"){const e=new Error(`Connection error: ${s.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function l9t(s,e){for(;s.length"u"&&(l=ar(),this._storageService.store(c,l,Ie.WORKSPACE,an.MACHINE));const d=await plt(si.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",si.origin),u.searchParams.set("salt",l),u.toString()}}return`${ef.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 n=ar();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${n}`);const o=new qd;let r,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,vt(a),clearTimeout(l),this._onDidExit.fire([ez.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(ue(si,"message",p=>{if(p.source!==i.contentWindow||p.data.vscodeWebWorkerExtHostId!==n)return;if(p.data.error){const{name:v,message:b,stack:w}=p.data.error,y=new Error;return y.message=b,y.name=v,y.stack=w,d(ez.UnexpectedError,y)}if(p.data.type==="vscode.bootstrap.nls"){const v="vs/base/worker/workerMain.js",b=require.toUrl(v).slice(0,-v.length);i.contentWindow.postMessage({type:p.data.type,data:{baseUrl:b,workerUrl:require.toUrl(v),nls:{messages:globalThis._VSCODE_NLS_MESSAGES,language:globalThis._VSCODE_NLS_LANGUAGE}}},"*");return}const{data:m}=p.data;if(o.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(ez.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($e.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 M.toPromise(M.filter(e.onMessage,t=>xee(t,up.Ready))),this._isTerminating||(e.send($e.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await M.toPromise(M.filter(e.onMessage,t=>xee(t,up.Initialized))),this._isTerminating))throw xy();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(qit(up.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 n;return i&&this._productService.commit&&!xk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,xk.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??(Wn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:ql,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:VRe(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()===qi.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:n,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===RA.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Wn?tv.Web:tv.Desktop}}};Dee=D([_(3,Yi),_(4,yi),_(5,Fs),_(6,Ge),_(7,uf),_(8,hv),_(9,Em),_(10,Er),_(11,pu),_(12,$i)],Dee);class u9t{constructor(){this.capabilities=Vn.Readonly+Vn.FileReadWrite+Vn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None}async readFile(e){try{const t=await fetch(e.toString(!0));if(t.status===200)return new Uint8Array(await t.arrayBuffer());throw us(t.statusText,ot.Unknown)}catch(t){throw us(t,ot.Unknown)}}async stat(e){return{type:sn.File,size:0,mtime:0,ctime:0}}watch(){return V.None}writeFile(e,t,i){throw new rS}readdir(e){throw new rS}mkdir(e){throw new rS}delete(e,t){throw new rS}rename(e,t,i){throw new rS}}var DAe={exports:{}},kue={};(function(s,e){e=s.exports=Fn;var t;typeof process=="object"&&kue&&kue.NODE_DEBUG&&/\bsemver\b/i.test(kue.NODE_DEBUG)?t=function(){var K=Array.prototype.slice.call(arguments,0);K.unshift("SEMVER"),console.log.apply(console,K)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,n=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 b=c++;a[b]="(?:-?("+a[m]+"(?:\\."+a[m]+")*))";var w=c++;a[w]="[0-9A-Za-z-]+";var y=c++;a[y]="(?:\\+("+a[w]+"(?:\\."+a[w]+")*))";var C=c++,A="v?"+a[u]+a[v]+"?"+a[y]+"?";a[C]="^"+A+"$";var L="[v=\\s]*"+a[f]+a[b]+"?"+a[y]+"?",k=c++;a[k]="^"+L+"$";var P=c++;a[P]="((?:<|>)?=?)";var R=c++;a[R]=a[d]+"|x|X|\\*";var z=c++;a[z]=a[l]+"|x|X|\\*";var G=c++;a[G]="[v=\\s]*("+a[z]+")(?:\\.("+a[z]+")(?:\\.("+a[z]+")(?:"+a[v]+")?"+a[y]+"?)?)?";var Y=c++;a[Y]="[v=\\s]*("+a[R]+")(?:\\.("+a[R]+")(?:\\.("+a[R]+")(?:"+a[b]+")?"+a[y]+"?)?)?";var j=c++;a[j]="^"+a[P]+"\\s*"+a[G]+"$";var ne=c++;a[ne]="^"+a[P]+"\\s*"+a[Y]+"$";var ge=c++;a[ge]="(?:^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])";var De=c++;a[De]="(?:~>?)";var Oe=c++;a[Oe]="(\\s*)"+a[De]+"\\s+",r[Oe]=new RegExp(a[Oe],"g");var yt="$1~",Ne=c++;a[Ne]="^"+a[De]+a[G]+"$";var lt=c++;a[lt]="^"+a[De]+a[Y]+"$";var xt=c++;a[xt]="(?:\\^)";var Ji=c++;a[Ji]="(\\s*)"+a[xt]+"\\s+",r[Ji]=new RegExp(a[Ji],"g");var Ii="$1^",ns=c++;a[ns]="^"+a[xt]+a[G]+"$";var zs=c++;a[zs]="^"+a[xt]+a[Y]+"$";var Pn=c++;a[Pn]="^"+a[P]+"\\s*("+L+")$|^$";var Xr=c++;a[Xr]="^"+a[P]+"\\s*("+A+")$|^$";var ds=c++;a[ds]="(\\s*)"+a[P]+"\\s*("+L+"|"+a[G]+")",r[ds]=new RegExp(a[ds],"g");var Zo="$1$2$3",Zr=c++;a[Zr]="^\\s*("+a[G]+")\\s+-\\s+("+a[G]+")\\s*$";var Di=c++;a[Di]="^\\s*("+a[Y]+")\\s+-\\s+("+a[Y]+")\\s*$";var ss=c++;a[ss]="(<|>)?=?\\s*\\*";for(var Oo=0;Ooi)return null;var T=de?r[k]:r[C];if(!T.test(K))return null;try{return new Fn(K,de)}catch{return null}}e.valid=Ba;function Ba(K,de){var T=Tn(K,de);return T?T.version:null}e.clean=vd;function vd(K,de){var T=Tn(K.trim().replace(/^[=v]+/,""),de);return T?T.version:null}e.SemVer=Fn;function Fn(K,de){if(K instanceof Fn){if(K.loose===de)return K;K=K.version}else if(typeof K!="string")throw new TypeError("Invalid Version: "+K);if(K.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Fn))return new Fn(K,de);t("SemVer",K,de),this.loose=de;var T=K.trim().match(de?r[k]:r[C]);if(!T)throw new TypeError("Invalid Version: "+K);if(this.raw=K,this.major=+T[1],this.minor=+T[2],this.patch=+T[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");T[4]?this.prerelease=T[4].split(".").map(function(ie){if(/^[0-9]+$/.test(ie)){var ye=+ie;if(ye>=0&&ye=0;)typeof this.prerelease[T]=="number"&&(this.prerelease[T]++,T=-2);T===-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: "+K)}return this.format(),this.raw=this.version,this},e.inc=th;function th(K,de,T,ie){typeof T=="string"&&(ie=T,T=void 0);try{return new Fn(K,T).inc(de,ie).version}catch{return null}}e.diff=pc;function pc(K,de){if(ml(K,de))return null;var T=Tn(K),ie=Tn(de);if(T.prerelease.length||ie.prerelease.length){for(var ye in T)if((ye==="major"||ye==="minor"||ye==="patch")&&T[ye]!==ie[ye])return"pre"+ye;return"prerelease"}for(var ye in T)if((ye==="major"||ye==="minor"||ye==="patch")&&T[ye]!==ie[ye])return ye}e.compareIdentifiers=$s;var zc=/^[0-9]+$/;function $s(K,de){var T=zc.test(K),ie=zc.test(de);return T&&ie&&(K=+K,de=+de),T&&!ie?-1:ie&&!T?1:Kde?1:0}e.rcompareIdentifiers=tc;function tc(K,de){return $s(de,K)}e.major=fl;function fl(K,de){return new Fn(K,de).major}e.minor=ih;function ih(K,de){return new Fn(K,de).minor}e.patch=gg;function gg(K,de){return new Fn(K,de).patch}e.compare=mc;function mc(K,de,T){return new Fn(K,T).compare(new Fn(de,T))}e.compareLoose=$c;function $c(K,de){return mc(K,de,!0)}e.rcompare=nh;function nh(K,de,T){return mc(de,K,T)}e.sort=Dc;function Dc(K,de){return K.sort(function(T,ie){return e.compare(T,ie,de)})}e.rsort=pl;function pl(K,de){return K.sort(function(T,ie){return e.rcompare(T,ie,de)})}e.gt=ic;function ic(K,de,T){return mc(K,de,T)>0}e.lt=Or;function Or(K,de,T){return mc(K,de,T)<0}e.eq=ml;function ml(K,de,T){return mc(K,de,T)===0}e.neq=sh;function sh(K,de,T){return mc(K,de,T)!==0}e.gte=oh;function oh(K,de,T){return mc(K,de,T)>=0}e.lte=Gc;function Gc(K,de,T){return mc(K,de,T)<=0}e.cmp=Kc;function Kc(K,de,T,ie){var ye;switch(de){case"===":typeof K=="object"&&(K=K.version),typeof T=="object"&&(T=T.version),ye=K===T;break;case"!==":typeof K=="object"&&(K=K.version),typeof T=="object"&&(T=T.version),ye=K!==T;break;case"":case"=":case"==":ye=ml(K,T,ie);break;case"!=":ye=sh(K,T,ie);break;case">":ye=ic(K,T,ie);break;case">=":ye=oh(K,T,ie);break;case"<":ye=Or(K,T,ie);break;case"<=":ye=Gc(K,T,ie);break;default:throw new TypeError("Invalid operator: "+de)}return ye}e.Comparator=Wa;function Wa(K,de){if(K instanceof Wa){if(K.loose===de)return K;K=K.value}if(!(this instanceof Wa))return new Wa(K,de);t("comparator",K,de),this.loose=de,this.parse(K),this.semver===Bo?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var Bo={};Wa.prototype.parse=function(K){var de=this.loose?r[Pn]:r[Xr],T=K.match(de);if(!T)throw new TypeError("Invalid comparator: "+K);this.operator=T[1],this.operator==="="&&(this.operator=""),T[2]?this.semver=new Fn(T[2],this.loose):this.semver=Bo},Wa.prototype.toString=function(){return this.value},Wa.prototype.test=function(K){return t("Comparator.test",K,this.loose),this.semver===Bo?!0:(typeof K=="string"&&(K=new Fn(K,this.loose)),Kc(K,this.operator,this.semver,this.loose))},Wa.prototype.intersects=function(K,de){if(!(K instanceof Wa))throw new TypeError("a Comparator is required");var T;if(this.operator==="")return T=new Is(K.value,de),Ph(this.value,T,de);if(K.operator==="")return T=new Is(this.value,de),Ph(K.semver,T,de);var ie=(this.operator===">="||this.operator===">")&&(K.operator===">="||K.operator===">"),ye=(this.operator==="<="||this.operator==="<")&&(K.operator==="<="||K.operator==="<"),O=this.semver.version===K.semver.version,$=(this.operator===">="||this.operator==="<=")&&(K.operator===">="||K.operator==="<="),se=Kc(this.semver,"<",K.semver,de)&&(this.operator===">="||this.operator===">")&&(K.operator==="<="||K.operator==="<"),Ke=Kc(this.semver,">",K.semver,de)&&(this.operator==="<="||this.operator==="<")&&(K.operator===">="||K.operator===">");return ie||ye||O&&$||se||Ke},e.Range=Is;function Is(K,de){if(K instanceof Is)return K.loose===de?K:new Is(K.raw,de);if(K instanceof Wa)return new Is(K.value,de);if(!(this instanceof Is))return new Is(K,de);if(this.loose=de,this.raw=K,this.set=K.split(/\s*\|\|\s*/).map(function(T){return this.parseRange(T.trim())},this).filter(function(T){return T.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+K);this.format()}Is.prototype.format=function(){return this.range=this.set.map(function(K){return K.join(" ").trim()}).join("||").trim(),this.range},Is.prototype.toString=function(){return this.range},Is.prototype.parseRange=function(K){var de=this.loose;K=K.trim(),t("range",K,de);var T=de?r[Di]:r[Zr];K=K.replace(T,Ha),t("hyphen replace",K),K=K.replace(r[ds],Zo),t("comparator trim",K,r[ds]),K=K.replace(r[Oe],yt),K=K.replace(r[Ji],Ii),K=K.split(/\s+/).join(" ");var ie=de?r[Pn]:r[Xr],ye=K.split(" ").map(function(O){return Nh(O,de)}).join(" ").split(/\s+/);return this.loose&&(ye=ye.filter(function(O){return!!O.match(ie)})),ye=ye.map(function(O){return new Wa(O,de)}),ye},Is.prototype.intersects=function(K,de){if(!(K instanceof Is))throw new TypeError("a Range is required");return this.set.some(function(T){return T.every(function(ie){return K.set.some(function(ye){return ye.every(function(O){return ie.intersects(O,de)})})})})},e.toComparators=kc;function kc(K,de){return new Is(K,de).set.map(function(T){return T.map(function(ie){return ie.value}).join(" ").trim().split(" ")})}function Nh(K,de){return t("comp",K),K=xe(K,de),t("caret",K),K=Aa(K,de),t("tildes",K),K=zn(K,de),t("xrange",K),K=Wo(K,de),t("stars",K),K}function be(K){return!K||K.toLowerCase()==="x"||K==="*"}function Aa(K,de){return K.trim().split(/\s+/).map(function(T){return ee(T,de)}).join(" ")}function ee(K,de){var T=de?r[lt]:r[Ne];return K.replace(T,function(ie,ye,O,$,se){t("tilde",K,ie,ye,O,$,se);var Ke;return be(ye)?Ke="":be(O)?Ke=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?Ke=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":se?(t("replaceTilde pr",se),se.charAt(0)!=="-"&&(se="-"+se),Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0"):Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0",t("tilde return",Ke),Ke})}function xe(K,de){return K.trim().split(/\s+/).map(function(T){return gt(T,de)}).join(" ")}function gt(K,de){t("caret",K,de);var T=de?r[zs]:r[ns];return K.replace(T,function(ie,ye,O,$,se){t("caret",K,ie,ye,O,$,se);var Ke;return be(ye)?Ke="":be(O)?Ke=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?ye==="0"?Ke=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+".0 <"+(+ye+1)+".0.0":se?(t("replaceCaret pr",se),se.charAt(0)!=="-"&&(se="-"+se),ye==="0"?O==="0"?Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+O+"."+(+$+1):Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+"."+$+se+" <"+(+ye+1)+".0.0"):(t("no pr"),ye==="0"?O==="0"?Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+O+"."+(+$+1):Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+"."+$+" <"+(+ye+1)+".0.0"),t("caret return",Ke),Ke})}function zn(K,de){return t("replaceXRanges",K,de),K.split(/\s+/).map(function(T){return Cs(T,de)}).join(" ")}function Cs(K,de){K=K.trim();var T=de?r[ne]:r[j];return K.replace(T,function(ie,ye,O,$,se,Ke){t("xRange",K,ie,ye,O,$,se,Ke);var Bi=be(O),Wi=Bi||be($),ta=Wi||be(se),Pl=ta;return ye==="="&&Pl&&(ye=""),Bi?ye===">"||ye==="<"?ie="<0.0.0":ie="*":ye&&Pl?(Wi&&($=0),ta&&(se=0),ye===">"?(ye=">=",Wi?(O=+O+1,$=0,se=0):ta&&($=+$+1,se=0)):ye==="<="&&(ye="<",Wi?O=+O+1:$=+$+1),ie=ye+O+"."+$+"."+se):Wi?ie=">="+O+".0.0 <"+(+O+1)+".0.0":ta&&(ie=">="+O+"."+$+".0 <"+O+"."+(+$+1)+".0"),t("xRange return",ie),ie})}function Wo(K,de){return t("replaceStars",K,de),K.trim().replace(r[ss],"")}function Ha(K,de,T,ie,ye,O,$,se,Ke,Bi,Wi,ta,Pl){return be(T)?de="":be(ie)?de=">="+T+".0.0":be(ye)?de=">="+T+"."+ie+".0":de=">="+de,be(Ke)?se="":be(Bi)?se="<"+(+Ke+1)+".0.0":be(Wi)?se="<"+Ke+"."+(+Bi+1)+".0":ta?se="<="+Ke+"."+Bi+"."+Wi+"-"+ta:se="<="+se,(de+" "+se).trim()}Is.prototype.test=function(K){if(!K)return!1;typeof K=="string"&&(K=new Fn(K,this.loose));for(var de=0;de0){var ie=K[T].semver;if(ie.major===de.major&&ie.minor===de.minor&&ie.patch===de.patch)return!0}return!1}return!0}e.satisfies=Ph;function Ph(K,de,T){try{de=new Is(de,T)}catch{return!1}return de.test(K)}e.maxSatisfying=le;function le(K,de,T){var ie=null,ye=null;try{var O=new Is(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===-1)&&(ie=$,ye=new Fn(ie,T))}),ie}e.minSatisfying=dr;function dr(K,de,T){var ie=null,ye=null;try{var O=new Is(de,T)}catch{return null}return K.forEach(function($){O.test($)&&(!ie||ye.compare($)===1)&&(ie=$,ye=new Fn(ie,T))}),ie}e.validRange=io;function io(K,de){try{return new Is(K,de).range||"*"}catch{return null}}e.ltr=un;function un(K,de,T){return rt(K,de,"<",T)}e.gtr=Se;function Se(K,de,T){return rt(K,de,">",T)}e.outside=rt;function rt(K,de,T,ie){K=new Fn(K,ie),de=new Is(de,ie);var ye,O,$,se,Ke;switch(T){case">":ye=ic,O=Gc,$=Or,se=">",Ke=">=";break;case"<":ye=Or,O=oh,$=ic,se="<",Ke="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ph(K,de,ie))return!1;for(var Bi=0;Bi=0.0.0")),ta=ta||fg,Pl=Pl||fg,ye(fg.semver,ta.semver,ie)?ta=fg:$(fg.semver,Pl.semver,ie)&&(Pl=fg)}),ta.operator===se||ta.operator===Ke||(!Pl.operator||Pl.operator===se)&&O(K,Pl.semver))return!1;if(Pl.operator===Ke&&$(K,Pl.semver))return!1}return!0}e.prerelease=Ft;function Ft(K,de){var T=Tn(K,de);return T&&T.prerelease.length?T.prerelease:null}e.intersects=Ci;function Ci(K,de,T){return K=new Is(K,T),de=new Is(de,T),K.intersects(de)}e.coerce=Ot;function Ot(K){if(K instanceof Fn)return K;if(typeof K!="string")return null;var de=K.match(r[ge]);return de==null?null:Tn((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(DAe,DAe.exports);var jW=DAe.exports;function g9t(s,e,t,i,n){const o=new va;return s.forEach(r=>{const a=o.get(r.identifier);a&&n.warn(g(4825,"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(jW.gte(a.version,r.version)){n.warn(`Skipping extension ${r.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}r.isBuiltin=!0}else n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath));else if(r.isBuiltin){n.warn(`Skipping obsolete builtin extension ${r.extensionLocation.path}`);return}o.set(r.identifier,r)}),t.forEach(r=>{const a=o.get(r.identifier);a&&n.warn(g(4826,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),i.forEach(r=>{n.info(g(4827,"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 kAe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=n,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=RA.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=FNe(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:ql,debugId:this._environmentService.debugExtensionHost.debugId,break:this._environmentService.debugExtensionHost.break,port:this._environmentService.debugExtensionHost.port,env:{...this._environmentService.debugExtensionHost.env,...t.options?.extensionHostEnv}},n=this._environmentService.extensionDevelopmentLocationURI;let o=!0;return n&&n.length>0&&n[0].scheme===pe.file&&(o=!1),o||(i.break=!1),t9t(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(xee(m,up.Ready)){this._createExtHostInitData(d).then(v=>{a.send($e.fromString(JSON.stringify(v)))});return}if(xee(m,up.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:VRe(this._productService,this._environmentService),appLanguage:ql,extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:t.globalStorageHome,workspaceStorageHome:t.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===qi.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===RA.EagerAutoStart,uiKind:Wn?tv.Web:tv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(qit(up.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};kAe=D([_(2,URe),_(3,yi),_(4,Jr),_(5,Yi),_(6,Ge),_(7,uf),_(8,Fs),_(9,pC),_(10,lJe),_(11,Er),_(12,fJe)],kAe);var IAe;let TAe=class extends _Ae{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P,R){super(e,t,i,n,o,r,a,c,l,d,h,u,f,p,v,b,w,y,C,R),this._browserEnvironmentService=r,this._webExtensionsScannerService=m,this._userDataInitializationService=A,this._userDataProfileService=L,this._workspaceTrustManagementService=k,this._remoteExplorerService=P,y.when(Rs.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}_initFetchFileSystem(){const e=new u9t;this._register(this._fileService.registerProvider(pe.http,e)),this._register(this._fileService.registerProvider(pe.https,e))}async _scanWebExtensions(){const e=[],t=[],i=[];try{await Promise.all([this._webExtensionsScannerService.scanSystemExtensions().then(n=>e.push(...n.map(o=>dD(o)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(n=>t.push(...n.map(o=>dD(o)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(n=>i.push(...n.map(o=>dD(o,!0))))])}catch(n){this._logService.error(n)}return g9t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new x3t(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(n){return fD.isHandled(n)&&console.log("Error handled: Not showing a notification for the error"),this._remoteAuthorityResolverService._setResolvedAuthorityError(e,n),this._resolveExtensionsDefault()}this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options),this._remoteExplorerService.setTunnelInformation(t.tunnelInformation);const i=this._remoteAgentService.getConnection();return i&&(i.onDidStateChange(async n=>{n.type===lI.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=si;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await H3t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(lo.LocalWebWorker,e)}};TAe=D([_(3,we),_(4,bi),_(5,hv),_(6,Yi),_(7,Nl),_(8,Jt),_(9,Er),_(10,P6),_(11,yi),_(12,Te),_(13,Im),_(14,rMe),_(15,Ge),_(16,hg),_(17,Bae),_(18,ig),_(19,pC),_(20,tce),_(21,ug),_(22,uC),_(23,Xae),_(24,to)],TAe);let LAe=class{constructor(e,t,i,n,o,r,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=n,this._remoteAgentService=o,this._remoteAuthorityResolverService=r,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case lo.LocalProcess:return null;case lo.LocalWebWorker:{const n=i?RA.EagerManualStart:RA.EagerAutoStart;return this._instantiationService.createInstance(Dee,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case lo.Remote:{const n=this._remoteAgentService.getConnection();return n?this._instantiationService.createInstance(kAe,t,this._createRemoteExtensionHostDataProvider(e,n.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const n=vAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),o=e.computeRunningLocation(n,[],!1),r=jQ(n,o,c=>t.equals(c));return{extensions:new Jq(0,n,r.map(c=>c.identifier))}}else{const n=await this._getExtensionRegistrySnapshotWhenReady(),o=e.filterByRunningLocation(n.extensions,t);return{extensions:new Jq(n.versionId,n.extensions,o.map(a=>a.identifier))}}}}}_createRemoteExtensionHostDataProvider(e,t){return{remoteAuthority:t,getInitData:async()=>{const i=await this._getExtensionRegistrySnapshotWhenReady(),n=await this._remoteAgentService.getEnvironment();if(!n)throw new Error("Cannot provide init data for remote extension host!");const o=e.filterByExtensionHostKind(i.extensions,lo.Remote),r=new Jq(i.versionId,i.extensions,o.map(a=>a.identifier));return{connectionData:this._remoteAuthorityResolverService.getConnectionData(t),pid:n.pid,appRoot:n.appRoot,extensionHostLogsPath:n.extensionHostLogsPath,globalStorageHome:n.globalStorageHome,workspaceStorageHome:n.workspaceStorageHome,extensions:r}}}}};LAe=D([_(3,we),_(4,hg),_(5,pC),_(6,Nl),_(7,Ge)],LAe);let RAe=IAe=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,n,o){const r=IAe.pickRunningLocation(t,i,n,o);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${n}, preference: ${V8t(o)} => ${pS(r)}`),r}static pickRunningLocation(e,t,i,n){const o=[];let r=!1;for(const a of e){if(a==="ui"&&i){if(n===Qg.Remote)return lo.Remote;r=!0}if(a==="workspace"&&i){if(n===Qg.None||n===Qg.Remote)return lo.Remote;o.push(lo.Remote)}if(a==="web"&&(t||i)){if(n===Qg.None||n===Qg.Local)return lo.LocalWebWorker;o.push(lo.LocalWebWorker)}}return r&&o.push(lo.Remote),o.length>0?o[0]:null}};RAe=IAe=D([_(0,Ge)],RAe);async function f9t(s,e,t){let i=t&&t.get("storage.serviceMachineId",Ie.APPLICATION)||null;if(i)return i;try{const o=(await e.readFile(s.serviceMachineIdResource)).value.toString();i=CEt(o)?o:null}catch{i=null}if(!i){i=ar();try{await e.writeFile(s.serviceMachineIdResource,$e.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,Ie.APPLICATION,an.MACHINE),i}const p9t="/web-extension-resource/";class m9t{constructor(e,t,i,n,o){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=n,this._configurationService=o,i.extensionsGallery&&(this._extensionGalleryResourceUrlTemplate=i.extensionsGallery.resourceUrlTemplate,this._extensionGalleryAuthority=this._extensionGalleryResourceUrlTemplate?this._getExtensionGalleryAuthority(N.parse(this._extensionGalleryResourceUrlTemplate)):void 0)}get supportsExtensionGalleryResources(){return this._extensionGalleryResourceUrlTemplate!==void 0}getExtensionGalleryResourceURL({publisher:e,name:t,version:i,targetPlatform:n},o){if(this._extensionGalleryResourceUrlTemplate){const r=N.parse(efe(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:n!==void 0&&n!==Es.UNDEFINED&&n!==Es.UNKNOWN&&n!==Es.UNIVERSAL?`${i}+${n}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(r)?r.with({scheme:E8.getPreferredWebSchema()}):r}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Wn?"-web":""}`,"X-Client-Version":this._productService.version};return Yq(this._productService,this._environmentService)&&H1t(this._configurationService)===Kg.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=f9t(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=E8.getServerRootPath();return t.startsWith(i)&&t.startsWith(p9t,i.length)}}let MAe=class extends m9t{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._logService=r}async readExtensionResource(e){if(e=ef.uriToBrowserUri(e),e.scheme!==pe.http&&e.scheme!==pe.https&&e.scheme!==pe.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()}};MAe=D([_(0,Jt),_(1,$i),_(2,Er),_(3,Za),_(4,Te),_(5,Ge)],MAe);var VP,NAe;class tz{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new tz(t.extensions,t.low,t.high,t.mid)}catch{return}}constructor(e,t,i,n=(t+i)/2|0){this.extensions=e,this.low=t,this.high=i,this.mid=n}}var OR;let PAe=(OR=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const n=t.get(VP._storageKey,Ie.APPLICATION);if(this._state=tz.fromJSON(n),this._state){const{mid:o,high:r}=this._state;for(let a=0;a=o&&aRa({id:t},e.identifier))}async start(e){if(this._state)throw new Error("invalid state");const t=e.map(n=>n.identifier.id),i=new tz(t,0,t.length,0);this._storageService.store(VP._storageKey,JSON.stringify(i),Ie.APPLICATION,an.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 tz(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(VP._storageKey,JSON.stringify(t),Ie.APPLICATION,an.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(VP._storageKey,Ie.APPLICATION),await this._storageService.flush()}},VP=OR,OR._storageKey="extensionBisectState",OR);PAe=VP=D([_(0,Ge),_(1,$i),_(2,Jr)],PAe);var BR;let YW=(BR=class{constructor(e,t,i,n){this._extensionBisectService=t,this._notificationService=i,this._commandService=n,t.isActive&&(NAe.ctxIsBisectActive.bindTo(e).set(!0),this._showBisectPrompt())}_showBisectPrompt(){const e={label:g(1138,"I can't reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!1)},t={label:g(1139,"I can reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!0)},i={label:"Stop Bisect",run:()=>this._commandService.executeCommand("extension.bisect.stop")},n=this._extensionBisectService.disabledCount===1?g(1140,"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(1141,"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(Xe.Info,n,[e,t,i],{sticky:!0,priority:K2.URGENT})}},NAe=BR,BR.ctxIsBisectActive=new Q("isExtensionBisectActive",!1),BR);YW=NAe=D([_(0,Le),_(1,WU),_(2,bi),_(3,vi)],YW);Qe.as(cf.Workbench).registerWorkbenchContribution(YW,Rs.Restored);At(class extends li{constructor(){super({id:"extension.bisect.start",title:Pe(1142,"Start Extension Bisect"),category:ca.Help,f1:!0,precondition:YW.ctxIsBisectActive.negate(),menu:{id:_e.ViewContainerTitle,when:he.equals("viewContainer","workbench.view.extensions"),group:"2_enablement",order:4}})}async run(s){const e=s.get(to),t=s.get(xc),i=s.get(k6),n=s.get(Nl),o=s.get(WU),r=(await i.getInstalled(br.User)).filter(c=>n.isEnabled(c));(await e.confirm({message:g(1143,"Extension Bisect"),detail:g(1144,"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(1145,"&&Start Extension Bisect")})).confirmed&&(await o.start(r),t.reload())}});At(class extends li{constructor(){super({id:"extension.bisect.next",title:Pe(1146,"Continue Extension Bisect"),category:ca.Help,f1:!0,precondition:YW.ctxIsBisectActive})}async run(s,e){const t=s.get(to),i=s.get(xc),n=s.get(WU),o=s.get(Er),r=s.get(dJe),a=s.get(vi);if(!n.isActive)return;if(e===void 0){const l=await this._checkForBad(t,n);if(l===null)return;e=l}if(e===void 0){await n.reset(),i.reload();return}const c=await n.next(e);if(!c){i.reload();return}if(c.bad)await t.info(g(1147,"Extension Bisect"),g(1148,"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:Xe.Info,message:g(1147,"Extension Bisect"),primaryButton:g(1149,"&&Report Issue & Continue"),cancelButton:g(1150,"Continue"),detail:g(1151,"Extension Bisect is done and has identified {0} as the extension causing the problem.",c.id),checkbox:{label:g(1152,"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 n.reset(),i.reload()}async _checkForBad(s,e){const{result:t}=await s.prompt({type:Xe.Info,message:g(1153,"Extension Bisect"),detail:g(1154,"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(1155,"I ca&&n't reproduce"),run:()=>!1},{label:g(1156,"I can &&reproduce"),run:()=>!0},{label:g(1157,"&&Stop Bisect"),run:()=>{}}],cancelButton:{label:g(1158,"&&Cancel Bisect"),run:()=>null}});return t}});At(class extends li{constructor(){super({id:"extension.bisect.stop",title:Pe(1159,"Stop Extension Bisect"),category:ca.Help,f1:!0,precondition:YW.ctxIsBisectActive})}async run(s){const e=s.get(WU),t=s.get(xc);await e.reset(),t.reload()}});function _9t(s,e){return s}function v9t(s){for(const[e,t]of Object.entries(s))ef.registerAppResourcePathUrl(e,t)}function kee(s){switch(s){case Ho.InvalidSymbol:return g(1162,"Invalid symbol");case Ho.InvalidNumberFormat:return g(1163,"Invalid number format");case Ho.PropertyNameExpected:return g(1164,"Property name expected");case Ho.ValueExpected:return g(1165,"Value expected");case Ho.ColonExpected:return g(1166,"Colon expected");case Ho.CommaExpected:return g(1167,"Comma expected");case Ho.CloseBraceExpected:return g(1168,"Closing brace expected");case Ho.CloseBracketExpected:return g(1169,"Closing bracket expected");case Ho.EndOfFileExpected:return g(1170,"End of file expected");default:return""}}const Qit=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,b9t=/^-(\d{4})(\d{2})(\d{2})$/;function w9t(s){return s=s.trim(),s==="*"||Qit.test(s)}function x9(s){if(!w9t(s))return null;if(s=s.trim(),s==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=s.match(Qit);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 D9(s){if(!s)return null;const e=s.majorBase,t=s.majorMustEqual,i=s.minorBase;let n=s.minorMustEqual;const o=s.patchBase;let r=s.patchMustEqual;s.hasCaret&&(e===0||(n=!1),r=!1);let a=0;if(s.preRelease){const c=b9t.exec(s.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:n,patchBase:o,patchMustEqual:r,isMinimum:s.hasGreaterEquals,notBefore:a}}function y9t(s,e,t){let i;typeof s=="string"?i=D9(x9(s)):i=s;let n;e instanceof Date?n=e.getTime():typeof e=="string"&&(n=new Date(e).getTime());let o;if(typeof t=="string"?o=D9(x9(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:!(n&&n"u"&&typeof i.browser>"u")return r.push([Xe.Error,g(1178,"property `{0}` should be omitted if the extension doesn't have a `{1}` or `{2}` property.","activationEvents","main","browser")]),r}if(typeof i.extensionKind<"u"&&typeof i.main>"u"&&r.push([Xe.Warning,g(1179,"property `{0}` can be defined only if property `main` is also defined.","extensionKind")]),typeof i.main<"u"){if(typeof i.main!="string")return r.push([Xe.Error,g(1180,"property `{0}` can be omitted or must be of type `string`","main")]),r;{const l=Pt(t,i.main);qy(l,t)||r.push([Xe.Warning,g(1181,"Expected `main` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",l.path,t.path)])}}if(typeof i.browser<"u"){if(typeof i.browser!="string")return r.push([Xe.Error,g(1182,"property `{0}` can be omitted or must be of type `string`","browser")]),r;{const l=Pt(t,i.browser);qy(l,t)||r.push([Xe.Warning,g(1183,"Expected `browser` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",l.path,t.path)])}}if(!jW.valid(i.version))return r.push([Xe.Error,g(1184,"Extension version is not semver compatible.")]),r;const a=[];if(!S9t(s,e,i,n,a))for(const l of a)r.push([Xe.Error,l]);if(o&&i.enabledApiProposals?.length){const l=[];if(!A9t([...i.enabledApiProposals],l))for(const d of l)r.push([Xe.Error,d])}return r}function S9t(s,e,t,i,n){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:E9t(s,e,t.engines.vscode,n)}function A9t(s,e){if(s.length===0)return!0;const t=Array.isArray(e)?e:void 0,i=(t?void 0:e)??RM,n=[],o=XIt(s);for(const{proposalName:r,version:a}of o){const c=i[r];c&&a&&c.version!==a&&n.push(g(1185,"Extension is using an API proposal '{0}' that is not compatible with the current version of VS Code.",r))}return t?.push(...n),n.length===0}function E9t(s,e,t,i=[]){const n=D9(x9(t));if(!n)return i.push(g(1186,"Could not parse `engines.vscode` value {0}. Please use, for example: ^1.22.0, ^1.22.x, etc.",t)),!1;if(n.majorBase===0){if(!n.majorMustEqual||!n.minorMustEqual)return i.push(g(1187,"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(!n.majorMustEqual)return i.push(g(1188,"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 y9t(s,e,n)?!0:(i.push(g(1189,"Extension is not compatible with Code {0}. Extension requires: {1}.",s,t)),!1)}function U5e(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{const a=[];if(i)a.push(...r);else for(const c of r)e.some(([l])=>Ra(l.identifier,c.identifier)&&l.manifest.version!==c.version)?n.push(c):a.push(c);for(const[c,l]of e){const d=a.findIndex(u=>Ra(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}),n.length&&this._onRemoveExtensions.fire({extensions:n,profileLocation:t}),a}),o.length&&this._onDidAddExtensions.fire({extensions:o,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,profileLocation:t}),o}catch(r){throw o.length&&this._onDidAddExtensions.fire({extensions:o,error:r,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,error:r,profileLocation:t}),r}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,n=>{const o=[];for(const r of n){const a=e.find(([c])=>Ra(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,n=>{const o=[];for(const r of n)Ra(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(n){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:n,profileLocation:t}),n}}async withProfileExtensions(e,t,i){return this.getResourceAccessQueue(e).queue(async()=>{let n=[],o;try{const r=await this.fileService.readFile(e);o=JSON.parse(r.value.toString().trim()||"[]")}catch(r){if($w(r)!==Qi.FILE_NOT_FOUND)throw r;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(o=await this.migrateFromOldDefaultProfileExtensionsLocation()),!o&&i?.bailOutWhenFileNotFound)throw new Iee(su(r),JW.ERROR_PROFILE_NOT_FOUND)}if(o){Array.isArray(o)||this.reportAndThrowInvalidConentError(e);let r=!1;for(const a of o){z5e(a)||this.reportAndThrowInvalidConentError(e);let c;if(Lt(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(Lt(a.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{c=N.revive(a.location);const l=this.toRelativePath(c);l&&(r=!0,a.relativeLocation=l)}Ya(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(r=!0,a.metadata.hasPreReleaseVersion=!0),n.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}r&&await this.fileService.writeFile(e,$e.fromString(JSON.stringify(o)))}if(t){n=t(n);const r=n.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,$e.fromString(JSON.stringify(r)))}return n})}reportAndThrowInvalidConentError(e){const t=new Iee(`Invalid extensions content in ${e.toString()}`,JW.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($w(o)===Qi.FILE_NOT_FOUND)return;throw o}this.logService.info("Migrating extensions from old default profile location",e.toString());let n;try{const o=JSON.parse(i);Array.isArray(o)&&o.every(r=>z5e(r))?n=o:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",o)}catch(o){this.logService.error(o)}if(n)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,$e.fromString(JSON.stringify(n)),{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($w(o)===Qi.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){$w(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(o)}try{await this.fileService.del(t)}catch(o){$w(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(o)}return n})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new bI,this.resourcesAccessQueueMap.set(e,t)),t}};V5e=D([_(1,Jt),_(2,Em),_(3,ks),_(4,Yi),_(5,Ge)],V5e);function z5e(s){return kn(s)&&TLt(s.identifier)&&(x9t(s.location)||Lt(s.location)&&s.location)&&(Ya(s.relativeLocation)||Lt(s.relativeLocation))&&s.version&&Lt(s.version)}function x9t(s){return s?Lt(s.path)&&Lt(s.scheme):!1}function D9t(s,e,t,i){try{k9t(s,e,t,i)}catch(n){s.error(n?.message??n)}return e}function k9t(s,e,t,i){const n=(o,r,a)=>{const c=o[r];if(Lt(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||s.warn(`[${e.name}]: ${g(1190,"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(kn(c))for(const l in c)c.hasOwnProperty(l)&&(l==="commands"?n(c,l,!0):n(c,l,a));else if(Array.isArray(c))for(let l=0;lthis._onDidChangeCache.fire(br.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(br.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=NLt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[n,o]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),r=i?await this.scanExtensionsUnderDevelopment(e,[...n,...o]):[];return this.dedupExtensions(n,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,n]=await Promise.all(t);return this.applyScanOptions([...i,...n],br.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,n=await this.createExtensionScannerInput(t,!!e.profileLocation,br.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),o=e.useCache&&!n.devMode&&n.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let r;try{r=await o.scanExtensions(n)}catch(a){if(a instanceof Iee&&a.code===JW.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),r=await o.scanExtensions(n);else throw a}return r=await this.applyScanOptions(r,br.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(n=>n.scheme===pe.file).map(async n=>{const o=await this.createExtensionScannerInput(n,!1,br.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(o)).map(a=>(a.type=t.find(c=>Ra(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 n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanExtension(n);return!o||!i.includeInvalid&&!o.isValid?null:o}async scanOneOrMultipleExtensions(e,t,i){const n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanOneOrMultipleExtensions(n);return this.applyScanOptions(o,t,i,!0)}async scanMultipleExtensions(e,t,i){const n=[];return await Promise.all(e.map(async o=>{const r=await this.scanOneOrMultipleExtensions(o,t,i);n.push(...r)})),this.applyScanOptions(n,t,i,!0)}async scanMetadata(e){const t=Pt(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=Pt(e,"package.json"),n=(await this.fileService.readFile(i)).value.toString(),o=JSON.parse(n);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,o.__metadata={...o.__metadata,...t},await this.fileService.writeFile(Pt(e,"package.json"),$e.fromString(JSON.stringify(o,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Iee&&e.code===JW.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,$e.fromString(JSON.stringify([])))}catch(t){$w(t)!==Qi.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),su(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,n){return i.includeAllVersions||(e=this.dedupExtensions(t===br.System?e:void 0,t===br.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),n)),i.includeInvalid||(e=e.filter(o=>o.isValid)),e.sort((o,r)=>{const a=Ko(o.location.fsPath),c=Ko(r.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,n,o){const r=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(o&&jW.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(jW.eq(c.manifest.version,l.manifest.version)){if(c.type===br.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===n)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 va;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===br.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,br.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 n=t?await this.getBuiltInExtensionControl():{},o=[],r=N.file(Rk(cfe(ef.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=n[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":o.push(Pt(r,c.name));break;default:o.push(N.file(l));break}}const a=await Promise.all(o.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,br.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Fi(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,n,o,r,a,c){const l=await this.getTranslations(o??ql),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 iz(e,d,h,u,t,a,i,n,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}}};$5e=D([_(4,Em),_(5,Pae),_(6,Jt),_(7,Ge),_(8,Za),_(9,Er),_(10,ks),_(11,we)],$5e);class iz{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=n,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 ji(e.location,t.location)&&e.mtime===t.mtime&&ji(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Ys(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&&FAe.equals(e.translations,t.translations)}}let OAe=class extends V{constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const n=Pt(e,"package.nls.json"),o=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",l?.path,kee(h.error))))})},r=l=>{this.logService.error(this.formatMessage(e,g(445,"Invalid format {0}: JSON object expected.",l?.path)))},a=`${t.publisher}.${t.name}`,c=i.translations[a];if(c)try{const l=N.parse(c),d=(await this.fileService.readFile(l)).value.toString(),h=[],u=sf(d,h);return h.length>0?(o(l,h),{values:void 0,default:n}):sD(u)!=="object"?(r(l),{values:void 0,default:n}):{values:u.contents?u.contents.package:void 0,default:n}}catch{return{values:void 0,default:n}}else{if(!await this.fileService.exists(n))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=sf(h,u);return u.length>0?(o(d.localized,u),{values:void 0,default:d.original}):sD(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 n=await this.getLocalizedMessages(e,t,i);if(n)try{const o=[],r=await this.resolveOriginalMessageBundle(n.default,o);if(o.length>0)return o.forEach(c=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",n.default?.path,kee(c.error))))}),t;if(sD(n)!=="object")return this.logService.error(this.formatMessage(e,g(445,"Invalid format {0}: JSON object expected.",n.default?.path))),t;const a=n.values||Object.create(null);return D9t(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 sf(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,n)=>{const o=r=>{const a=Pt(e,`package.nls.${r}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:Pt(e,"package.nls.json")});const l=r.lastIndexOf("-");l===-1?i({localized:Pt(e,"package.nls.json"),original:null}):(r=r.substring(0,l),o(r))})};if(t.devMode||t.pseudo||!t.language)return i({localized:Pt(e,"package.nls.json"),original:null});o(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};OAe=D([_(0,Jt),_(1,Ge)],OAe);let Tee=class extends OAe{constructor(e,t,i,n,o,r,a){super(n,a),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i,this.environmentService=r,this.extensionsEnabledWithApiProposalVersion=o.extensionsEnabledWithApiProposalVersion?.map(c=>c.toLowerCase())??[]}async scanExtensions(e){const t=e.profile?await this.scanExtensionsFromProfile(e):await this.scanExtensionsFromLocation(e);let i={};if(e.excludeObsolete&&e.type===br.User)try{const n=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(n)}catch{}return CA(i)?t:t.filter(n=>!i[N5.create(n).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 n=>{if(!n.isDirectory||e.type===br.User&&_i(n.resource).indexOf(".")===0)return null;const o=new iz(n.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 Fi(i).sort((n,o)=>n.location.path!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){t=t.filter(n=>!n.metadata?.isApplicationScoped);const i=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,n=>!!n.metadata?.isBuiltin||!!n.metadata?.isApplicationScoped,e);t.push(...i)}return t}async scanExtensionsFromProfileResource(e,t,i){const n=await this.extensionsProfileScannerService.scanProfileExtensions(e,i.profileScanOptions);if(!n.length)return[];const o=await Promise.all(n.map(async r=>{if(t(r)){const a=new iz(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 Fi(o)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(Pt(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}:`,su(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=qYe),t=t??i.__metadata,delete i.__metadata;const n=Iw(i.publisher,i.name),o=t?.id?{id:n,uuid:t.id}:{id:n},r=t?.isSystem?br.System:e.type,a=r===br.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,iz.createNlsConfiguration(e));let c={type:r,identifier:o,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??Es.UNDEFINED,publisherDisplayName:t?.publisherDisplayName,metadata:t,isValid:!0,validations:[]};return e.validate&&(c=this.validate(c,e)),i.enabledApiProposals&&(!this.environmentService.isBuilt||this.extensionsEnabledWithApiProposalVersion.includes(n.toLowerCase()))&&(i.originalEnabledApiProposals=i.enabledApiProposals,i.enabledApiProposals=ZIt([...i.enabledApiProposals])),c}}catch(i){e.type!==br.System&&this.logService.error(i)}return null}validate(e,t){let i=!0;const n=this.environmentService.isBuilt&&this.extensionsEnabledWithApiProposalVersion.includes(e.identifier.id.toLowerCase()),o=C9t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin,n);for(const[r,a]of o)r===Xe.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,a)));return e.isValid=i,e.validations=o,e}async scanExtensionManifest(e){const t=Pt(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(o){return $w(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(446,"Cannot read file {0}: {1}.",t.path,o.message))),null}let n;try{n=JSON.parse(i)}catch{const r=[];sf(i,r);for(const a of r)this.logService.error(this.formatMessage(e,g(447,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,kee(a.error))));return null}return sD(n)!=="object"?(this.logService.error(this.formatMessage(e,g(448,"Invalid manifest file {0}: Not a JSON object.",t.path))),null):n}};Tee=D([_(1,Pae),_(2,ks),_(3,Jt),_(4,Er),_(5,Za),_(6,Ge)],Tee);let Lee=class extends Tee{constructor(e,t,i,n,o,r,a,c,l){super(t,n,o,r,a,c,l),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new Y7(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&&iz.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.type===br.System?"system":"user",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(o=>(o.location=N.revive(o.location),o));const n=await super.scanExtensions(e);return await this.writeExtensionCache(t,{input:e,result:n}),n}async readExtensionCache(e){try{const t=await this.fileService.readFile(e),i=JSON.parse(t.value.toString());return{result:i.result,input:Mo(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,su(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,$e.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,su(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,n=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Ys(n,i))try{this.logService.info("Invalidating Cache",i,n),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===br.System?QIt:qIt)}getProfile(e){return e.type===br.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}};Lee=D([_(2,Em),_(3,Pae),_(4,ks),_(5,Jt),_(6,Er),_(7,Za),_(8,Ge)],Lee);const BAe=["W","X","Y","Z","a","b","c","d","e","f"],I9t=new RegExp(`^[${BAe.join("")}]+`),jit=7;function T9t(s){if(s.scheme!==pe.vscodeNotebookCell)return;const e=s.fragment.indexOf("s");if(e<0)return;const t=parseInt(s.fragment.substring(0,e).replace(I9t,""),jit),i=dKe(s.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:s.with({scheme:i,fragment:null})}}function L9t(s,e){const t=e.toString(jit),n=`${t.length$e.wrap(r))),o=V9t(n);return i=i||o.byteLength!==n.byteLength,{data:o,didCompression:i}}const XQ="\x1B[A",Iue=XQ.split("").map(s=>s.charCodeAt(0)),F9t=10;function O9t(s){let e=!1;return s.forEach((t,i)=>{if(i===0||t.length-1;){const e=s.match(/^(.*)\r+/m)[1];let t=s.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),s=s.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return s}const H9t=8,U9t=13;function V9t(s){return!s.buffer.includes(H9t)&&!s.buffer.includes(U9t)?s:$e.fromString(W9t(B9t(N9t.decode(s.buffer))))}var UAe,A0,AC,VAe,E0,kE,x0,zAe,$Ae,ZQ,RV,GAe,sw,ow,KAe,yg,qAe;function ki(s){return Object.assign(s,{apply:function(...t){if(t.length===0)return Reflect.construct(s,[]);{const i=t.length===1?[]:t[1];return Reflect.construct(s,i,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(s,[]);{const[i,...n]=t;return Reflect.construct(s,n,i.constructor)}}})}var Nee;(function(s){s[s.Top=0]="Top",s[s.Bottom=1]="Bottom"})(Nee||(Nee={}));var K1,f6e;let Qs=UAe=(f6e=class{constructor(e){Wt(this,K1);Ct(this,K1,e)}static from(...e){let t=e;return new UAe(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof Ce(this,K1)=="function"&&(Ce(this,K1).call(this),Ct(this,K1,void 0))}},K1=new WeakMap,f6e);Qs=UAe=D([ki],Qs);let bs=A0=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 Pi();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 A0(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Pi();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 A0(i,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};bs=A0=D([ki],bs);let Jn=AC=class{static isRange(e){return e instanceof AC?!0:e?bs.isPosition(e.start)&&bs.isPosition(e.end):!1}static of(e){if(e instanceof AC)return e;if(this.isRange(e))return new AC(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,n){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(o=new bs(e,t),r=new bs(i,n)):bs.isPosition(e)&&bs.isPosition(t)&&(o=bs.of(e),r=bs.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 AC.isRange(e)?this.contains(e.start)&&this.contains(e.end):bs.isPosition(e)?!(bs.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=bs.Max(e.start,this._start),i=bs.Min(e.end,this._end);if(!t.isAfter(i))return new AC(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=bs.Min(e.start,this._start),i=bs.Max(e.end,this.end);return new AC(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 Pi();let i;return e?bs.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 AC(i,t)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return Jit(this)}};Jn=AC=D([ki],Jn);let cC=VAe=class extends Jn{static isSelection(e){return e instanceof VAe?!0:e?Jn.isRange(e)&&bs.isPosition(e.anchor)&&bs.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,n){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(o=new bs(e,t),r=new bs(i,n)):bs.isPosition(e)&&bs.isPosition(t)&&(o=bs.of(e),r=bs.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}}[Symbol.for("debug.description")](){return z9t(this)}};cC=VAe=D([ki],cC);function Jit(s){return s.isEmpty?`[${s.start.line}:${s.start.character})`:`[${s.start.line}:${s.start.character} -> ${s.end.line}:${s.end.character})`}function z9t(s){let e=Jit(s);return s.isEmpty||(s.active.isEqual(s.start)?e=`|${e}`:e=`${e}|`),e}const Xit=s=>{if(typeof s!="string"||s.length===0||!/^[0-9A-Za-z_\-]+$/.test(s))throw Pi("connectionToken")};let Zit=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 Pi("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Pi("port");typeof i<"u"&&Xit(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},sz=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"&&Xit(t)}},t1=class ej extends Error{static NotAvailable(e,t){return new ej(e,ed.NotAvailable,t)}static TemporarilyNotAvailable(e){return new ej(e,ed.TemporarilyNotAvailable)}constructor(e,t=ed.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,ej.prototype)}};var D_;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(D_||(D_={}));var HT;(function(s){s[s.Replace=1]="Replace",s[s.Append=2]="Append",s[s.Prepend=3]="Prepend"})(HT||(HT={}));let VA=E0=class{static isTextEdit(e){return e instanceof E0?!0:e?Jn.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new E0(e,t)}static insert(e,t){return E0.replace(new Jn(e,e),t)}static delete(e){return E0.replace(e,"")}static setEndOfLine(e){const t=new E0(new Jn(new bs(0,0),new bs(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!Jn.isRange(e))throw Pi("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Pi("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Pi("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};VA=E0=D([ki],VA);let k9=kE=class{static isNotebookCellEdit(e){return e instanceof kE?!0:e?Sy.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new kE(e,t)}static insertCells(e,t){return new kE(new Sy(e,e),t)}static deleteCells(e){return new kE(e,[])}static updateCellMetadata(e,t){const i=new kE(new Sy(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new kE(new Sy(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};k9=kE=D([ki],k9);let Nce=class tj{static isSnippetTextEdit(e){return e instanceof tj?!0:e?Jn.isRange(e.range)&&uI.isSnippetString(e.snippet):!1}static replace(e,t){return new tj(e,t)}static insert(e,t){return tj.replace(new Jn(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var vc;(function(s){s[s.File=1]="File",s[s.Text=2]="Text",s[s.Cell=3]="Cell",s[s.CellReplace=5]="CellReplace",s[s.Snippet=6]="Snippet"})(vc||(vc={}));let hI=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,n){this._edits.push({_type:vc.File,from:e,to:t,options:i,metadata:n})}createFile(e,t,i){this._edits.push({_type:vc.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:vc.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:vc.Cell,metadata:i,uri:e,edit:{editType:dI.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,n){const o=t.start,r=t.end;(o!==r||i.length>0)&&this._edits.push({_type:vc.CellReplace,uri:e,index:o,count:r-o,cells:i,metadata:n})}replaceNotebookCellMetadata(e,t,i,n){this._edits.push({_type:vc.Cell,metadata:n,uri:e,edit:{editType:dI.Metadata,index:t,metadata:i}})}replace(e,t,i,n){this._edits.push({_type:vc.Text,uri:e,edit:new VA(t,i),metadata:n})}insert(e,t,i,n){this.replace(e,new Jn(t,t),i,n)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===vc.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let n,o;Array.isArray(i)?(n=i[0],o=i[1]):n=i,k9.isNotebookCellEdit(n)?n.newCellMetadata?this.replaceNotebookCellMetadata(e,n.range.start,n.newCellMetadata,o):n.newNotebookMetadata?this.replaceNotebookMetadata(e,n.newNotebookMetadata,o):this.replaceNotebookCells(e,n.range,n.newCells,o):Nce.isSnippetTextEdit(n)?this._edits.push({_type:vc.Snippet,uri:e,range:n.range,edit:n.snippet,metadata:o}):this._edits.push({_type:vc.Text,uri:e,edit:n,metadata:o})}else{for(let i=0;in.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 x0;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}};uI=x0=D([ki],uI);var Bx;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(Bx||(Bx={}));var Bd;(function(s){s[s.Hint=3]="Hint",s[s.Information=2]="Information",s[s.Warning=1]="Warning",s[s.Error=0]="Error"})(Bd||(Bd={}));let yp=zAe=class{static isLocation(e){return e instanceof zAe?!0:e?Jn.isRange(e.range)&&N.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(Jn.isRange(t))this.range=Jn.of(t);else if(bs.isPosition(t))this.range=new Jn(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};yp=zAe=D([ki],yp);let XW=class{static is(e){return e?typeof e.message=="string"&&e.location&&Jn.isRange(e.location.range)&&N.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()}};XW=D([ki],XW);let I9=class{constructor(e,t,i=Bd.Error){if(!Jn.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:Bd[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)&&is(e.tags,t.tags)&&is(e.relatedInformation,t.relatedInformation,XW.isEqual)}};I9=D([ki],I9);let T9=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}};T9=D([ki],T9);let L9=class extends T9{constructor(e,t,i,n){super(e,t),this.canIncreaseVerbosity=i,this.canDecreaseVerbosity=n}};L9=D([ki],L9);var Pee;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Pee||(Pee={}));var ZW;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(ZW||(ZW={}));let R9=class{constructor(e,t=ZW.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:ZW[this.kind]}}};R9=D([ki],R9);let M9=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};M9=D([ki],M9);var _r;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(_r||(_r={}));var eH;(function(s){s[s.Deprecated=1]="Deprecated"})(eH||(eH={}));let tH=$Ae=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,n,o){this.name=e,this.kind=t,this.containerName=o,typeof i=="string"&&(this.containerName=i),n instanceof yp?this.location=n:i instanceof Jn&&(this.location=new yp(n,i)),$Ae.validate(this)}toJSON(){return{name:this.name,kind:_r[this.kind],location:this.location,containerName:this.containerName}}};tH=$Ae=D([ki],tH);let iH=ZQ=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(ZQ.validate)}constructor(e,t,i,n,o){this.name=e,this.detail=t,this.kind=i,this.range=n,this.selectionRange=o,this.children=[],ZQ.validate(this)}};iH=ZQ=D([ki],iH);var nH;(function(s){s[s.Invoke=1]="Invoke",s[s.Automatic=2]="Automatic"})(nH||(nH={}));let N9=class{constructor(e,t){this.title=e,this.kind=t}};N9=D([ki],N9);var WR;let Sa=(WR=class{constructor(e){this.value=e}append(e){return new RV(this.value?this.value+RV.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+RV.sep)}},RV=WR,WR.sep=".",WR);Sa=RV=D([ki],Sa);Sa.Empty=new Sa("");Sa.QuickFix=Sa.Empty.append("quickfix");Sa.Refactor=Sa.Empty.append("refactor");Sa.RefactorExtract=Sa.Refactor.append("extract");Sa.RefactorInline=Sa.Refactor.append("inline");Sa.RefactorMove=Sa.Refactor.append("move");Sa.RefactorRewrite=Sa.Refactor.append("rewrite");Sa.Source=Sa.Empty.append("source");Sa.SourceOrganizeImports=Sa.Source.append("organizeImports");Sa.SourceFixAll=Sa.Source.append("fixAll");Sa.Notebook=Sa.Empty.append("notebook");let sH=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")}};sH=D([ki],sH);let Pce=class{constructor(e,t,i,n,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=o,this.selectionRange=r}},UNe=class{constructor(e,t){this.fromRanges=t,this.from=e}},VNe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var UT;(function(s){s[s.Information=0]="Information",s[s.Warning=1]="Warning",s[s.Error=2]="Error"})(UT||(UT={}));let P9=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};P9=D([ki],P9);var Bh,p6e;let df=GAe=(p6e=class{constructor(e,t=!1){Wt(this,Bh);Ct(this,Bh,new Mt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof GAe?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return Ce(this,Bh).value}set value(e){Ce(this,Bh).value=e}get isTrusted(){return Ce(this,Bh).isTrusted}set isTrusted(e){Ce(this,Bh).isTrusted=e}get supportThemeIcons(){return Ce(this,Bh).supportThemeIcons}set supportThemeIcons(e){Ce(this,Bh).supportThemeIcons=e}get supportHtml(){return Ce(this,Bh).supportHtml}set supportHtml(e){Ce(this,Bh).supportHtml=e}get baseUri(){return Ce(this,Bh).baseUri}set baseUri(e){Ce(this,Bh).baseUri=e}appendText(e){return Ce(this,Bh).appendText(e),this}appendMarkdown(e){return Ce(this,Bh).appendMarkdown(e),this}appendCodeblock(e,t){return Ce(this,Bh).appendCodeblock(t??"",e),this}},Bh=new WeakMap,p6e);df=GAe=D([ki],df);let Fee=class{constructor(e,t){this.label=e,this.documentation=t}};Fee=D([ki],Fee);let Oee=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};Oee=D([ki],Oee);let Bee=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};Bee=D([ki],Bee);var Wee;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Wee||(Wee={}));var Hee;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Hee||(Hee={}));let F9=class{constructor(e){this.value=e}};F9=D([ki],F9);let O9=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};O9=D([ki],O9);var VT;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(VT||(VT={}));var Zi;(function(s){s[s.Text=0]="Text",s[s.Method=1]="Method",s[s.Function=2]="Function",s[s.Constructor=3]="Constructor",s[s.Field=4]="Field",s[s.Variable=5]="Variable",s[s.Class=6]="Class",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Unit=10]="Unit",s[s.Value=11]="Value",s[s.Enum=12]="Enum",s[s.Keyword=13]="Keyword",s[s.Snippet=14]="Snippet",s[s.Color=15]="Color",s[s.File=16]="File",s[s.Reference=17]="Reference",s[s.Folder=18]="Folder",s[s.EnumMember=19]="EnumMember",s[s.Constant=20]="Constant",s[s.Struct=21]="Struct",s[s.Event=22]="Event",s[s.Operator=23]="Operator",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue"})(Zi||(Zi={}));var oH;(function(s){s[s.Deprecated=1]="Deprecated"})(oH||(oH={}));let B9=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&Zi[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};B9=D([ki],B9);let tN=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};tN=D([ki],tN);let Uee=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};Uee=D([ki],Uee);let Vee=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};Vee=D([ki],Vee);var Wx;(function(s){s[s.Unknown=0]="Unknown",s[s.Word=1]="Word",s[s.Line=2]="Line",s[s.Suggest=3]="Suggest"})(Wx||(Wx={}));var rH;(function(s){s[s.Active=-1]="Active",s[s.Beside=-2]="Beside",s[s.One=1]="One",s[s.Two=2]="Two",s[s.Three=3]="Three",s[s.Four=4]="Four",s[s.Five=5]="Five",s[s.Six=6]="Six",s[s.Seven=7]="Seven",s[s.Eight=8]="Eight",s[s.Nine=9]="Nine"})(rH||(rH={}));var TS;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(TS||(TS={}));function $9t(s,e){return`${Sn.toKey(s)}.${e}`}var o_;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval"})(o_||(o_={}));var zT;(function(s){s[s.Manual=1]="Manual",s[s.AfterDelay=2]="AfterDelay",s[s.FocusOut=3]="FocusOut"})(zT||(zT={}));var W9;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(W9||(W9={}));var iN;(function(s){s[s.Keyboard=1]="Keyboard",s[s.Mouse=2]="Mouse",s[s.Command=3]="Command"})(iN||(iN={}));var aH;(function(s){s[s.Undo=1]="Undo",s[s.Redo=2]="Redo"})(aH||(aH={}));var Hx;(function(s){s[s.OpenOpen=0]="OpenOpen",s[s.ClosedClosed=1]="ClosedClosed",s[s.OpenClosed=2]="OpenClosed",s[s.ClosedOpen=3]="ClosedOpen"})(Hx||(Hx={}));(function(s){function e(t){switch(t){case"keyboard":return s.Keyboard;case"mouse":return s.Mouse;case"api":return s.Command}}s.fromValue=e})(iN||(iN={}));var nN;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(nN||(nN={}));(function(s){function e(t){switch(t){case s.Other:return"other";case s.Comment:return"comment";case s.String:return"string";case s.RegEx:return"regex"}return"other"}s.toString=e})(nN||(nN={}));let H9=class{constructor(e,t){if(t&&!N.isUri(t))throw Pi("target");if(!Jn.isRange(e)||e.isEmpty)throw Pi("range");this.range=e,this.target=t}};H9=D([ki],H9);let sN=class{constructor(e,t,i,n){this.red=e,this.green=t,this.blue=i,this.alpha=n}};sN=D([ki],sN);let U9=class{constructor(e,t){if(t&&!(t instanceof sN))throw Pi("color");if(!Jn.isRange(e)||e.isEmpty)throw Pi("range");this.range=e,this.color=t}};U9=D([ki],U9);let V9=class{constructor(e){if(!e||typeof e!="string")throw Pi("label");this.label=e}};V9=D([ki],V9);var zee;(function(s){s[s.Error=0]="Error",s[s.Warning=1]="Warning",s[s.Information=2]="Information"})(zee||(zee={}));var $ee;(function(s){s[s.Unknown=0]="Unknown",s[s.Shutdown=1]="Shutdown",s[s.Process=2]="Process",s[s.User=3]="User",s[s.Extension=4]="Extension"})($ee||($ee={}));var mD;(function(s){s[s.Low=0]="Low",s[s.Medium=1]="Medium",s[s.High=2]="High"})(mD||(mD={}));let ent=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Pi("startIndex");if(typeof t!="number"||t<1)throw Pi("length");if(i!==void 0&&typeof i!="string")throw Pi("tooltip")}},tnt=class{constructor(e){this.uri=e}};class int{constructor(e){this.terminalCommand=e}}var Gee;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(Gee||(Gee={}));let nnt=class{constructor(e){if(this.options=e,typeof e!="object")throw Pi("options")}};var Kee;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(Kee||(Kee={}));var qee;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(qee||(qee={}));var dy;let cH=(dy=class{static from(e){switch(e){case"clean":return sw.Clean;case"build":return sw.Build;case"rebuild":return sw.Rebuild;case"test":return sw.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Pi("name");this._id=e}get id(){return this._id}},sw=dy,dy.Clean=new sw("clean","Clean"),dy.Build=new sw("build","Build"),dy.Rebuild=new sw("rebuild","Rebuild"),dy.Test=new sw("test","Test"),dy);cH=sw=D([ki],cH);function snt(s){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return snt(e)}};oN=D([ki],oN);let gI=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Pi("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Pi("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Pi("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Pi("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Pi("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 snt(e)}};gI=D([ki],gI);var Qee;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(Qee||(Qee={}));var fI;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace"})(fI||(fI={}));let Fce=class{constructor(e){this._callback=e}computeId(){return"customExecution"+ar()}set callback(e){this._callback=e}get callback(){return this._callback}};var hy;let z9=(hy=class{constructor(e,t,i,n,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=n,a=o,this.__deprecated=!0):t===fI.Global||t===fI.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=o,a=r):(this.target=t,this._name=this.name=i,this._source=this.source=n,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 oN?this._definition={type:ow.ProcessType,id:this._execution.computeId()}:this._execution instanceof gI?this._definition={type:ow.ShellType,id:this._execution.computeId()}:this._execution instanceof Fce?this._definition={type:ow.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:ow.EmptyType,id:ar()}}get definition(){return this._definition}set definition(e){if(e==null)throw Pi("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 Pi("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;(ow.EmptyType===t||ow.ProcessType===t||ow.ShellType===t||ow.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 Pi("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}},ow=hy,hy.ExtensionCallbackType="customExecution",hy.ProcessType="process",hy.ShellType="shell",hy.EmptyType="$empty",hy);z9=ow=D([ki],z9);var _D;(function(s){s[s.SourceControl=1]="SourceControl",s[s.Window=10]="Window",s[s.Notification=15]="Notification"})(_D||(_D={}));var QAe;(function(s){function e(t){const i=t;return lc(i.value)?i.tooltip&&!Lt(i.tooltip)?(console.log("INVALID view badge, invalid tooltip",i.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",i.value),!1)}s.isViewBadge=e})(QAe||(QAe={}));let $9=KAe=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const n=lc(i.checkboxState)?i.checkboxState:kn(i.checkboxState)&&lc(i.checkboxState.state)?i.checkboxState.state:void 0,o=!lc(i.checkboxState)&&kn(i.checkboxState)?i.checkboxState.tooltip:void 0;if(n===void 0||n!==db.Checked&&n!==db.Unchecked||o!==void 0&&!Lt(o))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof KAe)return!0;if(i.label!==void 0&&!Lt(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!Lt(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!Lt(i.iconPath)&&!N.isUri(i.iconPath)&&(!i.iconPath||!Lt(i.iconPath.id))){const n=i.iconPath;if(!n||!Lt(n.light)&&!N.isUri(n.light)&&!Lt(n.dark)&&!N.isUri(n.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!Lt(i.description)&&typeof i.description!="boolean"?(console.log("INVALID tree item, invalid description",i.description),!1):i.resourceUri!==void 0&&!N.isUri(i.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",i.resourceUri),!1):i.tooltip!==void 0&&!Lt(i.tooltip)&&!(i.tooltip instanceof df)?(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.collapsibleStatevD.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!Lt(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=vD.None){this.collapsibleState=t,N.isUri(e)?this.resourceUri=e:this.label=e}};$9=KAe=D([ki],$9);var vD;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(vD||(vD={}));var db;(function(s){s[s.Unchecked=0]="Unchecked",s[s.Checked=1]="Checked"})(db||(db={}));let G9=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};G9=D([ki],G9);class jee extends G9{}var f7;class G9t extends jee{constructor(t){super("");Wt(this,f7);Ct(this,f7,t)}asFile(){return Ce(this,f7)}}f7=new WeakMap;class K9t{constructor(e,t,i,n){this.name=e,this.uri=t,this._itemId=i,this._getData=n}data(){return this._getData()}}var ZC,q1,MV,m6e;let lH=(m6e=class{constructor(e){Wt(this,q1);Wt(this,ZC,new Map);for(const[t,i]of e??[]){const n=Ce(this,ZC).get(ZU(this,q1,MV).call(this,t));n?n.push(i):Ce(this,ZC).set(ZU(this,q1,MV).call(this,t),[i])}}get(e){return Ce(this,ZC).get(ZU(this,q1,MV).call(this,e))?.[0]}set(e,t){Ce(this,ZC).set(ZU(this,q1,MV).call(this,e),[t])}forEach(e,t){for(const[i,n]of Ce(this,ZC))for(const o of n)e.call(t,o,i,this)}*[Symbol.iterator](){for(const[e,t]of Ce(this,ZC))for(const i of t)yield[e,i]}},ZC=new WeakMap,q1=new WeakSet,MV=function(e){return e.toLowerCase()},m6e);lH=D([ki],lH);let Yee=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};Yee=D([ki],Yee);var Jee;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(Jee||(Jee={}));var YS;let K9=(YS=class{constructor(e){this.value=e}append(...e){return new YS((this.value?[this.value,...e]:e).join(YS.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+YS.sep)}},YS.sep=".",YS);K9.Empty=new K9("");let ont=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},uu=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}};uu=D([ki],uu);uu.File=new uu("file");uu.Folder=new uu("folder");let dH=class{constructor(e){this.id=e}};dH=D([ki],dH);var $T;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.WorkspaceFolder=3]="WorkspaceFolder"})($T||($T={}));let GT=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=N.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||!N.isUri(e)&&!N.isUri(e.uri)))throw Pi("base");if(typeof t!="string")throw Pi("pattern");typeof e=="string"?this.baseUri=N.file(e):N.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};GT=D([ki],GT);const rnt=new WeakMap;function q9t(s,e){rnt.set(s,e)}let rN=class{constructor(e,t,i,n,o){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof i=="string"&&(this.hitCondition=i),typeof n=="string"&&(this.logMessage=n),typeof o=="string"&&(this.mode=o)}get id(){return this._id||(this._id=rnt.get(this)??ar()),this._id}};rN=D([ki],rN);let Ux=class extends rN{constructor(e,t,i,n,o,r){if(super(t,i,n,o,r),e===null)throw Pi("location");this.location=e}};Ux=D([ki],Ux);let Vx=class extends rN{constructor(e,t,i,n,o,r){super(t,i,n,o,r),this.functionName=e}};Vx=D([ki],Vx);let Xee=class extends rN{constructor(e,t,i,n,o,r,a,c){if(super(n,o,r,a,c),!t)throw Pi("dataId");this.label=e,this.dataId=t,this.canPersist=i}};Xee=D([ki],Xee);let q9=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};q9=D([ki],q9);let hH=class{constructor(e,t){this.port=e,this.host=t}};hH=D([ki],hH);let Q9=class{constructor(e){this.path=e}};Q9=D([ki],Q9);let j9=class{constructor(e){this.implementation=e}};j9=D([ki],j9);let zNe=class{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}},$Ne=class{constructor(e,t){this.session=e,this.threadId=t}},Y9=class{constructor(e,t){this.range=e,this.expression=t}};Y9=D([ki],Y9);var uH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(uH||(uH={}));let J9=class{constructor(e,t){this.range=e,this.text=t}};J9=D([ki],J9);let X9=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};X9=D([ki],X9);let Z9=class{constructor(e,t){this.range=e,this.expression=t}};Z9=D([ki],Z9);let jAe=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};jAe=D([ki],jAe);var Zee;(function(s){s[s.AIGenerated=1]="AIGenerated"})(Zee||(Zee={}));var gH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(gH||(gH={}));let ant=class{constructor(e,t){this.newSymbolName=e,this.tags=t}};var KT;(function(s){s[s.Changed=1]="Changed",s[s.Created=2]="Created",s[s.Deleted=3]="Deleted"})(KT||(KT={}));let Jc=yg=class extends Error{static FileExists(e){return new yg(e,ot.FileExists,yg.FileExists)}static FileNotFound(e){return new yg(e,ot.FileNotFound,yg.FileNotFound)}static FileNotADirectory(e){return new yg(e,ot.FileNotADirectory,yg.FileNotADirectory)}static FileIsADirectory(e){return new yg(e,ot.FileIsADirectory,yg.FileIsADirectory)}static NoPermissions(e){return new yg(e,ot.NoPermissions,yg.NoPermissions)}static Unavailable(e){return new yg(e,ot.Unavailable,yg.Unavailable)}constructor(e,t=ot.Unknown,i){super(N.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",sje(this,t),Object.setPrototypeOf(this,yg.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Jc=yg=D([ki],Jc);let ete=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};ete=D([ki],ete);var Uw;(function(s){s[s.Comment=1]="Comment",s[s.Imports=2]="Imports",s[s.Region=3]="Region"})(Uw||(Uw={}));var fH;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(fH||(fH={}));var tte;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(tte||(tte={}));var ite;(function(s){s[s.Published=0]="Published",s[s.Draft=1]="Draft"})(ite||(ite={}));var pH;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(pH||(pH={}));var mH;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(mH||(mH={}));var _H;(function(s){s[s.Reply=1]="Reply",s[s.Comment=2]="Comment"})(_H||(_H={}));let nte=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function Q9t(s){return typeof s>"u"||A6e(s)}let cnt=class lnt{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,n,o);if(Jn.isRange(e)&&typeof t=="string"&&Q9t(i))return this._push(e,t,i);throw Pi()}_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 n=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(n,o,r,a,c)}_pushEncoded(e,t,i,n,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++]=n,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 n=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&&!uu.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}},ote=class{constructor(e){this.kind=e}};ote=D([ki],ote);var mS;(function(s){s[s.Light=1]="Light",s[s.Dark=2]="Dark",s[s.HighContrast=3]="HighContrast",s[s.HighContrastLight=4]="HighContrastLight"})(mS||(mS={}));let Sy=class YAe{static isNotebookRange(e){return e instanceof YAe?!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 Pi("start must be positive");if(t<0)throw Pi("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 YAe(t,i)}},rG=class JAe{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=>JAe.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,n,o,r,a){this.kind=e,this.value=t,this.languageId=i,this.mime=n,this.outputs=o??[],this.metadata=r,this.executionSummary=a,JAe.validate(this)}},KNe=class{constructor(e){this.cells=e}};var Bf,zoe;let qNe=(Bf=class{static isNotebookCellOutputItem(e){return e instanceof Bf?!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 Bf.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Bf.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Bf.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Bf(e,t)}static text(e,t=Us.text){const i=Ce(Bf,zoe).encode(String(e));return new Bf(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Bf.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=mKe(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},zoe=new WeakMap,Wt(Bf,zoe,new TextEncoder),Bf),i$=class XAe{static isNotebookCellOutput(e){return e instanceof XAe?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){const i=new Set,n=new Set;for(let o=0;o!n.has(r))}constructor(e,t,i){this.items=XAe.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=ar(),this.metadata=t??i)}};var zx;(function(s){s[s.Markup=1]="Markup",s[s.Code=2]="Code"})(zx||(zx={}));var cN;(function(s){s[s.Idle=1]="Idle",s[s.Pending=2]="Pending",s[s.Executing=3]="Executing"})(cN||(cN={}));var n$;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(n$||(n$={}));var s$;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(s$||(s$={}));let hnt=class{constructor(e,t){this.text=e,this.alignment=t}};var rte;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred"})(rte||(rte={}));var o$;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred",s[s.Hidden=-1]="Hidden"})(o$||(o$={}));let QNe=class{constructor(e,t=[]){this.uri=e,this.provides=H_(t)}},unt=class{constructor(e){this.label=e}};var wH;(function(s){s[s.Named=1]="Named",s[s.Indexed=2]="Indexed"})(wH||(wH={}));let ate=class{constructor(e,t){this.label=e,this.timestamp=t}};ate=D([ki],ate);var QT;(function(s){s[s.Production=1]="Production",s[s.Development=2]="Development",s[s.Test=3]="Test"})(QT||(QT={}));var r$;(function(s){s[s.Node=1]="Node",s[s.Webworker=2]="Webworker"})(r$||(r$={}));var LS;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(LS||(LS={}));let gnt=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},fnt=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var cte;(function(s){s[s.Queued=1]="Queued",s[s.Running=2]="Running",s[s.Passed=3]="Passed",s[s.Failed=4]="Failed",s[s.Skipped=5]="Skipped",s[s.Errored=6]="Errored"})(cte||(cte={}));var jT;(function(s){s[s.Run=1]="Run",s[s.Debug=2]="Debug",s[s.Coverage=3]="Coverage"})(jT||(jT={}));let a$=class{constructor(e=void 0,t=void 0,i=void 0,n=!1,o=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=n,this.preserveFocus=o}};a$=D([ki],a$);let lN=qAe=class{static diff(e,t,i){const n=new qAe(e);return n.expectedOutput=t,n.actualOutput=i,n}constructor(e){this.message=e}};lN=qAe=D([ki],lN);let yH=class{constructor(e){this.id=e}};yH=D([ki],yH);let pnt=class{constructor(e,t,i){this.label=e,this.file=t,this.position=i}},rz=class{constructor(e,t){this.covered=e,this.total=t,ij(this)}};function ij(s){if(s){if(s.covered>s.total)throw new Error(`The total number of covered items (${s.covered}) cannot be greater than the total (${s.total})`);if(s.total<0)throw new Error(`The number of covered items (${s.total}) cannot be negative`)}}let dN=class mnt{static fromDetails(e,t){const i=new rz(0,0),n=new rz(0,0),o=new rz(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)n.total+=1,n.covered+=c.executed?1:0}else o.total+=1,o.covered+=a.executed?1:0;const r=new mnt(e,i,n.total>0?n:void 0,o.total>0?o:void 0);return r.detailedCoverage=t,r}constructor(e,t,i,n,o=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=n,this.fromTests=o}},_nt=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}},vnt=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}},bnt=class{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 lte;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(lte||(lte={}));var ZAe;(function(s){s[s.Untrusted=0]="Untrusted",s[s.Trusted=1]="Trusted",s[s.Unspecified=2]="Unspecified"})(ZAe||(ZAe={}));var dte;(function(s){s[s.Notify=1]="Notify",s[s.OpenBrowser=2]="OpenBrowser",s[s.OpenPreview=3]="OpenPreview",s[s.Silent=4]="Silent",s[s.Ignore=5]="Ignore",s[s.OpenBrowserOnce=6]="OpenBrowserOnce"})(dte||(dte={}));let Oce=class{constructor(e,t,i,n,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=o,this.selectionRange=r}};class Bce{constructor(e){this.uri=e}}class c${constructor(e,t){this.original=e,this.modified=t}}class jNe{constructor(e,t,i,n){this.base=e,this.input1=t,this.input2=i,this.result=n}}class Wce{constructor(e,t){this.uri=e,this.viewType=t}}class YNe{constructor(e){this.viewType=e}}class Hce{constructor(e,t){this.uri=e,this.notebookType=t}}class Uce{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class JNe{constructor(){}}class XNe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class ZNe{constructor(){}}class ePe{constructor(e){this.textDiffs=e}}var eEe;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(eEe||(eEe={}));var hte;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(hte||(hte={}));var ute;(function(s){s[s.Short=1]="Short",s[s.Medium=2]="Medium",s[s.Full=3]="Full"})(ute||(ute={}));let wnt=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var tEe;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful",s[s.Undone=2]="Undone",s[s.Accepted=3]="Accepted",s[s.Bug=4]="Bug"})(tEe||(tEe={}));var CH;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful"})(CH||(CH={}));let aG=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 df(e):e}},SH=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 df(e):e,this.vulnerabilities=t}},AH=class{constructor(e,t){this.participant=e,this.command=t}},l$=class{constructor(e,t,i,n){this.title=e,this.message=t,this.data=i,this.buttons=n}},cG=class{constructor(e,t){this.value=e,this.baseUri=t}},lG=class{constructor(e,t){this.value=e,this.title=t}},EH=class{constructor(e){this.value=e}},tPe=class{constructor(e,t){this.value=e,this.task=t}},xH=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 df(e):e}},dG=class{constructor(e){this.value=e}},kb=class{constructor(e,t,i){this.value=e,this.iconPath=t,this.options=i}},d$=class{constructor(e,t,i){this.value=e,this.license=t,this.snippet=i}},DH=class{constructor(e,t){this.uri=e,this.edits=Array.isArray(t)?t:[t]}},iPe=class{constructor(e,t,i,n){this.prompt=e,this.command=t,this.references=i,this.participant=n}},nPe=class{constructor(e,t,i,n){this.response=e,this.result=t,this.participant=i,this.command=n}};var r_;(function(s){s[s.Panel=1]="Panel",s[s.Terminal=2]="Terminal",s[s.Notebook=3]="Notebook",s[s.Editor=4]="Editor"})(r_||(r_={}));var gte;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(gte||(gte={}));let sPe=class{constructor(e,t,i){this.document=e,this.selection=t,this.wholeRange=i}},oPe=class{constructor(e){this.cell=e}};var Kp;(function(s){s[s.User=1]="User",s[s.Assistant=2]="Assistant",s[s.System=3]="System"})(Kp||(Kp={}));class h${constructor(e,t,i){this.name=e,this.content=t,this.isError=i??!1}}let rPe=class iEe{static User(e,t){const i=new iEe(Kp.User,typeof e=="string"?e:"",t);return i.content2=e,i}static Assistant(e,t){return new iEe(Kp.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.content2=t,this.name=i}};class Vce{constructor(e,t){this.name=e,this.parameters=t}}class kH{constructor(e){this.value=e}}let Mw=class D0 extends Error{static NotFound(e){return new D0(e,D0.NotFound.name)}static NoPermissions(e){return new D0(e,D0.NoPermissions.name)}static Blocked(e){return new D0(e,D0.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}};var fte;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(fte||(fte={}));var pte;(function(s){s[s.Started=1]="Started",s[s.Recognizing=2]="Recognizing",s[s.Recognized=3]="Recognized",s[s.Stopped=4]="Stopped",s[s.Error=5]="Error"})(pte||(pte={}));var mte;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(mte||(mte={}));var _te;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped"})(_te||(_te={}));let ynt=class{constructor(e,t){this.text=e,this.range=t}};var IH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(IH||(IH={}));var xF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(xF||(xF={}));var ha;(function(s){s[s.UnknownInput=0]="UnknownInput",s[s.TextInput=1]="TextInput",s[s.TextDiffInput=2]="TextDiffInput",s[s.TextMergeInput=3]="TextMergeInput",s[s.NotebookInput=4]="NotebookInput",s[s.NotebookDiffInput=5]="NotebookDiffInput",s[s.CustomEditorInput=6]="CustomEditorInput",s[s.WebviewEditorInput=7]="WebviewEditorInput",s[s.TerminalEditorInput=8]="TerminalEditorInput",s[s.InteractiveEditorInput=9]="InteractiveEditorInput",s[s.ChatEditorInput=10]="ChatEditorInput",s[s.MultiDiffEditorInput=11]="MultiDiffEditorInput"})(ha||(ha={}));var fh;(function(s){s[s.TAB_OPEN=0]="TAB_OPEN",s[s.TAB_CLOSE=1]="TAB_CLOSE",s[s.TAB_UPDATE=2]="TAB_UPDATE",s[s.TAB_MOVE=3]="TAB_MOVE"})(fh||(fh={}));var bc;(function(s){s[s.Int8Array=1]="Int8Array",s[s.Uint8Array=2]="Uint8Array",s[s.Uint8ClampedArray=3]="Uint8ClampedArray",s[s.Int16Array=4]="Int16Array",s[s.Uint16Array=5]="Uint16Array",s[s.Int32Array=6]="Int32Array",s[s.Uint32Array=7]="Uint32Array",s[s.Float32Array=8]="Float32Array",s[s.Float64Array=9]="Float64Array",s[s.BigInt64Array=10]="BigInt64Array",s[s.BigUint64Array=11]="BigUint64Array"})(bc||(bc={}));var DF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(DF||(DF={}));var YT;(function(s){s[s.None=0]="None",s[s.Process=1]="Process",s[s.Output=2]="Output",s[s.Hybrid=3]="Hybrid"})(YT||(YT={}));var Li;(function(s){s.label="a",s.kind="b",s.detail="c",s.documentation="d",s.sortText="e",s.filterText="f",s.preselect="g",s.insertText="h",s.insertTextRules="i",s.range="j",s.commitCharacters="k",s.additionalTextEdits="l",s.kindModifier="m",s.commandIdent="n",s.commandId="o",s.commandArguments="p"})(Li||(Li={}));var Ay;(function(s){s.defaultRanges="a",s.completions="b",s.isIncomplete="c",s.duration="d"})(Ay||(Ay={}));const Be={MainThreadAuthentication:je("MainThreadAuthentication"),MainThreadBulkEdits:je("MainThreadBulkEdits"),MainThreadLanguageModels:je("MainThreadLanguageModels"),MainThreadEmbeddings:je("MainThreadEmbeddings"),MainThreadChatAgents2:je("MainThreadChatAgents2"),MainThreadChatVariables:je("MainThreadChatVariables"),MainThreadLanguageModelTools:je("MainThreadChatSkills"),MainThreadClipboard:je("MainThreadClipboard"),MainThreadCommands:je("MainThreadCommands"),MainThreadComments:je("MainThreadComments"),MainThreadConfiguration:je("MainThreadConfiguration"),MainThreadConsole:je("MainThreadConsole"),MainThreadDebugService:je("MainThreadDebugService"),MainThreadDecorations:je("MainThreadDecorations"),MainThreadDiagnostics:je("MainThreadDiagnostics"),MainThreadDialogs:je("MainThreadDiaglogs"),MainThreadDocuments:je("MainThreadDocuments"),MainThreadDocumentContentProviders:je("MainThreadDocumentContentProviders"),MainThreadTextEditors:je("MainThreadTextEditors"),MainThreadEditorInsets:je("MainThreadEditorInsets"),MainThreadEditorTabs:je("MainThreadEditorTabs"),MainThreadErrors:je("MainThreadErrors"),MainThreadTreeViews:je("MainThreadTreeViews"),MainThreadDownloadService:je("MainThreadDownloadService"),MainThreadLanguageFeatures:je("MainThreadLanguageFeatures"),MainThreadLanguages:je("MainThreadLanguages"),MainThreadLogger:je("MainThreadLogger"),MainThreadMessageService:je("MainThreadMessageService"),MainThreadOutputService:je("MainThreadOutputService"),MainThreadProgress:je("MainThreadProgress"),MainThreadQuickDiff:je("MainThreadQuickDiff"),MainThreadQuickOpen:je("MainThreadQuickOpen"),MainThreadStatusBar:je("MainThreadStatusBar"),MainThreadSecretState:je("MainThreadSecretState"),MainThreadStorage:je("MainThreadStorage"),MainThreadSpeech:je("MainThreadSpeechProvider"),MainThreadTelemetry:je("MainThreadTelemetry"),MainThreadTerminalService:je("MainThreadTerminalService"),MainThreadTerminalShellIntegration:je("MainThreadTerminalShellIntegration"),MainThreadWebviews:je("MainThreadWebviews"),MainThreadWebviewPanels:je("MainThreadWebviewPanels"),MainThreadWebviewViews:je("MainThreadWebviewViews"),MainThreadCustomEditors:je("MainThreadCustomEditors"),MainThreadUrls:je("MainThreadUrls"),MainThreadUriOpeners:je("MainThreadUriOpeners"),MainThreadProfileContentHandlers:je("MainThreadProfileContentHandlers"),MainThreadWorkspace:je("MainThreadWorkspace"),MainThreadFileSystem:je("MainThreadFileSystem"),MainThreadFileSystemEventService:je("MainThreadFileSystemEventService"),MainThreadExtensionService:je("MainThreadExtensionService"),MainThreadSCM:je("MainThreadSCM"),MainThreadSearch:je("MainThreadSearch"),MainThreadShare:je("MainThreadShare"),MainThreadTask:je("MainThreadTask"),MainThreadWindow:je("MainThreadWindow"),MainThreadLabelService:je("MainThreadLabelService"),MainThreadNotebook:je("MainThreadNotebook"),MainThreadNotebookDocuments:je("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:je("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:je("MainThreadNotebookKernels"),MainThreadNotebookRenderers:je("MainThreadNotebookRenderers"),MainThreadInteractive:je("MainThreadInteractive"),MainThreadTheming:je("MainThreadTheming"),MainThreadTunnelService:je("MainThreadTunnelService"),MainThreadManagedSockets:je("MainThreadManagedSockets"),MainThreadTimeline:je("MainThreadTimeline"),MainThreadTesting:je("MainThreadTesting"),MainThreadLocalization:je("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:je("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:je("MainThreadAiEmbeddingVector")},Ye={ExtHostCommands:je("ExtHostCommands"),ExtHostConfiguration:je("ExtHostConfiguration"),ExtHostDiagnostics:je("ExtHostDiagnostics"),ExtHostDebugService:je("ExtHostDebugService"),ExtHostDecorations:je("ExtHostDecorations"),ExtHostDocumentsAndEditors:je("ExtHostDocumentsAndEditors"),ExtHostDocuments:je("ExtHostDocuments"),ExtHostDocumentContentProviders:je("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:je("ExtHostDocumentSaveParticipant"),ExtHostEditors:je("ExtHostEditors"),ExtHostTreeViews:je("ExtHostTreeViews"),ExtHostFileSystem:je("ExtHostFileSystem"),ExtHostFileSystemInfo:je("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:je("ExtHostFileSystemEventService"),ExtHostLanguages:je("ExtHostLanguages"),ExtHostLanguageFeatures:je("ExtHostLanguageFeatures"),ExtHostQuickOpen:je("ExtHostQuickOpen"),ExtHostQuickDiff:je("ExtHostQuickDiff"),ExtHostStatusBar:je("ExtHostStatusBar"),ExtHostShare:je("ExtHostShare"),ExtHostExtensionService:je("ExtHostExtensionService"),ExtHostLogLevelServiceShape:je("ExtHostLogLevelServiceShape"),ExtHostTerminalService:je("ExtHostTerminalService"),ExtHostTerminalShellIntegration:je("ExtHostTerminalShellIntegration"),ExtHostSCM:je("ExtHostSCM"),ExtHostSearch:je("ExtHostSearch"),ExtHostTask:je("ExtHostTask"),ExtHostWorkspace:je("ExtHostWorkspace"),ExtHostWindow:je("ExtHostWindow"),ExtHostWebviews:je("ExtHostWebviews"),ExtHostWebviewPanels:je("ExtHostWebviewPanels"),ExtHostCustomEditors:je("ExtHostCustomEditors"),ExtHostWebviewViews:je("ExtHostWebviewViews"),ExtHostEditorInsets:je("ExtHostEditorInsets"),ExtHostEditorTabs:je("ExtHostEditorTabs"),ExtHostProgress:je("ExtHostProgress"),ExtHostComments:je("ExtHostComments"),ExtHostSecretState:je("ExtHostSecretState"),ExtHostStorage:je("ExtHostStorage"),ExtHostUrls:je("ExtHostUrls"),ExtHostUriOpeners:je("ExtHostUriOpeners"),ExtHostProfileContentHandlers:je("ExtHostProfileContentHandlers"),ExtHostOutputService:je("ExtHostOutputService"),ExtHostLabelService:je("ExtHostLabelService"),ExtHostNotebook:je("ExtHostNotebook"),ExtHostNotebookDocuments:je("ExtHostNotebookDocuments"),ExtHostNotebookEditors:je("ExtHostNotebookEditors"),ExtHostNotebookKernels:je("ExtHostNotebookKernels"),ExtHostNotebookRenderers:je("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:je("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:je("ExtHostInteractive"),ExtHostChatAgents2:je("ExtHostChatAgents"),ExtHostChatVariables:je("ExtHostChatVariables"),ExtHostLanguageModelTools:je("ExtHostChatSkills"),ExtHostChatProvider:je("ExtHostChatProvider"),ExtHostSpeech:je("ExtHostSpeech"),ExtHostEmbeddings:je("ExtHostEmbeddings"),ExtHostAiRelatedInformation:je("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:je("ExtHostAiEmbeddingVector"),ExtHostTheming:je("ExtHostTheming"),ExtHostTunnelService:je("ExtHostTunnelService"),ExtHostManagedSockets:je("ExtHostManagedSockets"),ExtHostAuthentication:je("ExtHostAuthentication"),ExtHostTimeline:je("ExtHostTimeline"),ExtHostTesting:je("ExtHostTesting"),ExtHostTelemetry:je("ExtHostTelemetry"),ExtHostLocalization:je("ExtHostLocalization")};var vte;(function(s){s[s.Complete=100]="Complete",s[s.Partial=50]="Partial",s[s.None=0]="None"})(vte||(vte={}));let nEe;function Cnt(s){nEe=s}function yd(s){return new Proxy({},{get(e,t){if(nEe==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return nEe[s][t]}})}const j9t={version:"1.92.2",tasks:yd("tasks"),notebooks:yd("notebooks"),scm:yd("scm"),comments:yd("comments"),authentication:yd("authentication"),tests:yd("tests"),extensions:yd("extensions"),debug:yd("debug"),env:yd("env"),commands:yd("commands"),window:yd("window"),workspace:yd("workspace"),languages:yd("languages"),l10n:yd("l10n"),interactive:yd("interactive"),ai:yd("ai"),chat:yd("chat"),speech:yd("speech"),lm:yd("lm"),Breakpoint:rN,TerminalOutputAnchor:Nee,ChatResultFeedbackKind:CH,ChatVariableLevel:ute,ChatCompletionItem:wnt,CallHierarchyIncomingCall:UNe,CallHierarchyItem:Pce,CallHierarchyOutgoingCall:VNe,CancellationError:Ma,CancellationTokenSource:ci,CandidatePortSource:YT,CodeAction:N9,CodeActionKind:Sa,CodeActionTriggerKind:nH,CodeLens:P9,Color:sN,ColorInformation:U9,ColorPresentation:V9,ColorThemeKind:mS,CommentMode:tte,CommentState:ite,CommentThreadCollapsibleState:fH,CommentThreadState:pH,CommentThreadApplicability:mH,CommentThreadFocus:_H,CompletionItem:B9,CompletionItemKind:Zi,CompletionItemTag:oH,CompletionList:tN,CompletionTriggerKind:VT,ConfigurationTarget:$T,CustomExecution:Fce,DebugAdapterExecutable:q9,DebugAdapterInlineImplementation:j9,DebugAdapterNamedPipeServer:Q9,DebugAdapterServer:hH,DebugConfigurationProviderTriggerKind:A9,DebugConsoleMode:e$,DebugVisualization:dnt,DecorationRangeBehavior:Hx,Diagnostic:I9,DiagnosticRelatedInformation:XW,DiagnosticSeverity:Bd,DiagnosticTag:Bx,Disposable:Qs,DocumentHighlight:R9,DocumentHighlightKind:ZW,MultiDocumentHighlight:M9,DocumentLink:H9,DocumentSymbol:iH,EndOfLine:D_,EnvironmentVariableMutatorType:HT,EvaluatableExpression:Y9,InlineValueText:J9,InlineValueVariableLookup:X9,InlineValueEvaluatableExpression:Z9,InlineCompletionTriggerKind:uH,EventEmitter:I,ExtensionKind:bD,ExtensionMode:QT,ExternalUriOpenerPriority:lte,FileChangeType:KT,FileDecoration:t$,FileDecoration2:t$,FileSystemError:Jc,FileType:sn,FilePermission:lp,FoldingRange:ete,FoldingRangeKind:Uw,FunctionBreakpoint:Vx,InlineCompletionItem:Uee,InlineCompletionList:Vee,Hover:T9,VerboseHover:L9,HoverVerbosityAction:Pee,IndentAction:yr,Location:yp,MarkdownString:df,OverviewRulerLane:kl,ParameterInformation:Fee,PortAutoForwardAction:dte,Position:bs,ProcessExecution:oN,ProgressLocation:_D,QuickInputButtonLocation:ste,QuickInputButtons:vH,Range:Jn,RelativePattern:GT,Selection:cC,SelectionRange:sH,SemanticTokens:aN,SemanticTokensBuilder:cnt,SemanticTokensEdit:GNe,SemanticTokensEdits:oz,SemanticTokensLegend:nte,ShellExecution:gI,ShellQuoting:Qee,SignatureHelp:Bee,SignatureHelpTriggerKind:Wee,SignatureInformation:Oee,SnippetString:uI,SourceBreakpoint:Ux,StandardTokenType:LS,StatusBarAlignment:TS,SymbolInformation:tH,SymbolKind:_r,SymbolTag:eH,Task:z9,TaskGroup:cH,TaskPanelKind:qee,TaskRevealKind:Kee,TaskScope:fI,TerminalLink:ent,TerminalQuickFixTerminalCommand:int,TerminalQuickFixOpener:tnt,TerminalLocation:Gee,TerminalProfile:nnt,TerminalExitReason:$ee,TerminalShellExecutionCommandLineConfidence:mD,TextDocumentSaveReason:zT,TextEdit:VA,SnippetTextEdit:Nce,TextEditorCursorStyle:qr,TextEditorLineNumbersStyle:o_,TextEditorRevealType:W9,TextEditorSelectionChangeKind:iN,SyntaxTokenType:nN,TextDocumentChangeReason:aH,ThemeColor:dH,ThemeIcon:uu,TreeItem:$9,TreeItemCheckboxState:db,TreeItemCollapsibleState:vD,TypeHierarchyItem:Oce,UIKind:tv,Uri:N,ViewColumn:rH,WorkspaceEdit:hI,DocumentPasteTriggerKind:Jee,DocumentDropEdit:Yee,DocumentDropOrPasteEditKind:K9,DocumentPasteEdit:ont,InlayHint:O9,InlayHintLabelPart:F9,InlayHintKind:Hee,RemoteAuthorityResolverError:t1,ResolvedAuthority:Zit,ManagedResolvedAuthority:sz,SourceControlInputBoxValidationType:zee,ExtensionRuntime:r$,TimelineItem:ate,NotebookRange:Sy,NotebookCellKind:zx,NotebookCellExecutionState:cN,NotebookCellData:rG,NotebookData:KNe,NotebookRendererScript:QNe,NotebookCellStatusBarAlignment:n$,NotebookEditorRevealType:s$,NotebookCellOutput:i$,NotebookCellOutputItem:qNe,NotebookCellStatusBarItem:hnt,NotebookControllerAffinity:rte,NotebookControllerAffinity2:o$,NotebookEdit:k9,NotebookKernelSourceAction:unt,NotebookVariablesRequestKind:wH,PortAttributes:fnt,LinkedEditingRanges:gnt,TestResultState:cte,TestRunRequest:a$,TestMessage:lN,TestMessage2:lN,TestMessageStackFrame:pnt,TestTag:yH,TestRunProfileKind:jT,TextSearchCompleteMessageType:wee,DataTransfer:lH,DataTransferItem:G9,TestCoverageCount:rz,FileCoverage:dN,FileCoverage2:dN,StatementCoverage:_nt,BranchCoverage:vnt,DeclarationCoverage:bnt,LanguageStatusSeverity:UT,QuickPickItemKind:bH,InputBoxValidationSeverity:qT,TabInputText:Bce,TabInputTextDiff:c$,TabInputTextMerge:jNe,TabInputCustom:Wce,TabInputNotebook:Hce,TabInputNotebookDiff:Uce,TabInputWebview:YNe,TabInputTerminal:JNe,TabInputInteractiveWindow:XNe,TabInputChat:ZNe,TabInputTextMultiDiff:ePe,TelemetryTrustedValue:Wae,LogLevel:Gn,EditSessionIdentityMatch:vte,ChatCopyKind:hte,DebugStackFrame:zNe,DebugThread:$Ne,RelatedInformationType:fte,SpeechToTextStatus:pte,TextToSpeechStatus:mte,PartialAcceptTriggerKind:Wx,KeywordRecognitionStatus:_te,ChatResponseMarkdownPart:aG,ChatResponseFileTreePart:cG,ChatResponseAnchorPart:lG,ChatResponseProgressPart:EH,ChatResponseProgressPart2:tPe,ChatResponseReferencePart:kb,ChatResponseReferencePart2:kb,ChatResponseCodeCitationPart:d$,ChatResponseWarningPart:xH,ChatResponseTextEditPart:DH,ChatResponseMarkdownWithVulnerabilitiesPart:SH,ChatResponseCommandButtonPart:dG,ChatResponseDetectedParticipantPart:AH,ChatResponseConfirmationPart:l$,ChatResponseReferencePartStatusKind:gte,ChatRequestTurn:iPe,ChatResponseTurn:nPe,ChatLocation:r_,ChatRequestEditorData:sPe,ChatRequestNotebookData:oPe,LanguageModelChatMessageRole:Kp,LanguageModelChatMessage:rPe,LanguageModelChatMessageFunctionResultPart:h$,LanguageModelChatResponseTextPart:kH,LanguageModelChatResponseFunctionUsePart:Vce,LanguageModelError:Mw,NewSymbolName:ant,NewSymbolNameTag:Zee,NewSymbolNameTriggerKind:gH,InlineEdit:ynt,InlineEditTriggerKind:IH,ExcludeSettingOptions:Rw,TextSearchContextNew:WNe,TextSearchMatchNew:BNe,TextSearchCompleteMessageTypeNew:yee},{version:Y9t,tasks:J9t,notebooks:X9t,scm:Z9t,comments:e$t,authentication:t$t,tests:i$t,extensions:n$t,debug:s$t,env:o$t,commands:r$t,window:a$t,workspace:c$t,languages:l$t,l10n:d$t,interactive:h$t,ai:u$t,chat:g$t,speech:f$t,lm:p$t,Breakpoint:m$t,TerminalOutputAnchor:_$t,ChatResultFeedbackKind:v$t,ChatVariableLevel:b$t,ChatCompletionItem:w$t,CallHierarchyIncomingCall:y$t,CallHierarchyItem:C$t,CallHierarchyOutgoingCall:S$t,CancellationError:A$t,CancellationTokenSource:E$t,CandidatePortSource:x$t,CodeAction:D$t,CodeActionKind:k$t,CodeActionTriggerKind:I$t,CodeLens:T$t,Color:L$t,ColorInformation:R$t,ColorPresentation:M$t,ColorThemeKind:N$t,CommentMode:P$t,CommentState:F$t,CommentThreadCollapsibleState:O$t,CommentThreadState:B$t,CommentThreadApplicability:W$t,CommentThreadFocus:H$t,CompletionItem:U$t,CompletionItemKind:V$t,CompletionItemTag:z$t,CompletionList:$$t,CompletionTriggerKind:G$t,ConfigurationTarget:K$t,CustomExecution:q$t,DebugAdapterExecutable:Q$t,DebugAdapterInlineImplementation:j$t,DebugAdapterNamedPipeServer:Y$t,DebugAdapterServer:J$t,DebugConfigurationProviderTriggerKind:X$t,DebugConsoleMode:Z$t,DebugVisualization:e7t,DecorationRangeBehavior:t7t,Diagnostic:i7t,DiagnosticRelatedInformation:n7t,DiagnosticSeverity:s7t,DiagnosticTag:o7t,Disposable:r7t,DocumentHighlight:a7t,DocumentHighlightKind:c7t,MultiDocumentHighlight:l7t,DocumentLink:d7t,DocumentSymbol:h7t,EndOfLine:u7t,EnvironmentVariableMutatorType:g7t,EvaluatableExpression:f7t,InlineValueText:p7t,InlineValueVariableLookup:m7t,InlineValueEvaluatableExpression:_7t,InlineCompletionTriggerKind:v7t,EventEmitter:b7t,ExtensionKind:w7t,ExtensionMode:y7t,ExternalUriOpenerPriority:C7t,FileChangeType:S7t,FileDecoration:A7t,FileDecoration2:E7t,FileSystemError:x7t,FileType:D7t,FilePermission:k7t,FoldingRange:I7t,FoldingRangeKind:T7t,FunctionBreakpoint:L7t,InlineCompletionItem:R7t,InlineCompletionList:M7t,Hover:N7t,VerboseHover:P7t,HoverVerbosityAction:F7t,IndentAction:O7t,Location:B7t,MarkdownString:W7t,OverviewRulerLane:H7t,ParameterInformation:U7t,PortAutoForwardAction:V7t,Position:z7t,ProcessExecution:$7t,ProgressLocation:G7t,QuickInputButtonLocation:K7t,QuickInputButtons:q7t,Range:Q7t,RelativePattern:j7t,Selection:Y7t,SelectionRange:J7t,SemanticTokens:X7t,SemanticTokensBuilder:Z7t,SemanticTokensEdit:e6t,SemanticTokensEdits:t6t,SemanticTokensLegend:i6t,ShellExecution:n6t,ShellQuoting:s6t,SignatureHelp:o6t,SignatureHelpTriggerKind:r6t,SignatureInformation:a6t,SnippetString:c6t,SourceBreakpoint:l6t,StandardTokenType:d6t,StatusBarAlignment:h6t,SymbolInformation:u6t,SymbolKind:g6t,SymbolTag:f6t,Task:p6t,TaskGroup:m6t,TaskPanelKind:_6t,TaskRevealKind:v6t,TaskScope:b6t,TerminalLink:w6t,TerminalQuickFixTerminalCommand:y6t,TerminalQuickFixOpener:C6t,TerminalLocation:S6t,TerminalProfile:A6t,TerminalExitReason:E6t,TerminalShellExecutionCommandLineConfidence:x6t,TextDocumentSaveReason:D6t,TextEdit:k6t,SnippetTextEdit:I6t,TextEditorCursorStyle:T6t,TextEditorLineNumbersStyle:L6t,TextEditorRevealType:R6t,TextEditorSelectionChangeKind:M6t,SyntaxTokenType:N6t,TextDocumentChangeReason:P6t,ThemeColor:F6t,ThemeIcon:O6t,TreeItem:B6t,TreeItemCheckboxState:W6t,TreeItemCollapsibleState:H6t,TypeHierarchyItem:U6t,UIKind:V6t,Uri:z6t,ViewColumn:$6t,WorkspaceEdit:G6t,DocumentPasteTriggerKind:K6t,DocumentDropEdit:q6t,DocumentDropOrPasteEditKind:Q6t,DocumentPasteEdit:j6t,InlayHint:Y6t,InlayHintLabelPart:J6t,InlayHintKind:X6t,RemoteAuthorityResolverError:Z6t,ResolvedAuthority:eGt,ManagedResolvedAuthority:tGt,SourceControlInputBoxValidationType:iGt,ExtensionRuntime:nGt,TimelineItem:sGt,NotebookRange:oGt,NotebookCellKind:rGt,NotebookCellExecutionState:aGt,NotebookCellData:cGt,NotebookData:lGt,NotebookRendererScript:dGt,NotebookCellStatusBarAlignment:hGt,NotebookEditorRevealType:uGt,NotebookCellOutput:gGt,NotebookCellOutputItem:fGt,NotebookCellStatusBarItem:pGt,NotebookControllerAffinity:mGt,NotebookControllerAffinity2:_Gt,NotebookEdit:vGt,NotebookKernelSourceAction:bGt,NotebookVariablesRequestKind:wGt,PortAttributes:yGt,LinkedEditingRanges:CGt,TestResultState:SGt,TestRunRequest:AGt,TestMessage:EGt,TestMessage2:xGt,TestMessageStackFrame:DGt,TestTag:kGt,TestRunProfileKind:IGt,TextSearchCompleteMessageType:TGt,DataTransfer:LGt,DataTransferItem:RGt,TestCoverageCount:MGt,FileCoverage:NGt,FileCoverage2:PGt,StatementCoverage:FGt,BranchCoverage:OGt,DeclarationCoverage:BGt,LanguageStatusSeverity:WGt,QuickPickItemKind:HGt,InputBoxValidationSeverity:UGt,TabInputText:VGt,TabInputTextDiff:zGt,TabInputTextMerge:$Gt,TabInputCustom:GGt,TabInputNotebook:KGt,TabInputNotebookDiff:qGt,TabInputWebview:QGt,TabInputTerminal:jGt,TabInputInteractiveWindow:YGt,TabInputChat:JGt,TabInputTextMultiDiff:XGt,TelemetryTrustedValue:ZGt,LogLevel:eKt,EditSessionIdentityMatch:tKt,ChatCopyKind:iKt,DebugStackFrame:nKt,DebugThread:sKt,RelatedInformationType:oKt,SpeechToTextStatus:rKt,TextToSpeechStatus:aKt,PartialAcceptTriggerKind:cKt,KeywordRecognitionStatus:lKt,ChatResponseMarkdownPart:dKt,ChatResponseFileTreePart:hKt,ChatResponseAnchorPart:uKt,ChatResponseProgressPart:gKt,ChatResponseProgressPart2:fKt,ChatResponseReferencePart:pKt,ChatResponseReferencePart2:mKt,ChatResponseCodeCitationPart:_Kt,ChatResponseWarningPart:vKt,ChatResponseTextEditPart:bKt,ChatResponseMarkdownWithVulnerabilitiesPart:wKt,ChatResponseCommandButtonPart:yKt,ChatResponseDetectedParticipantPart:CKt,ChatResponseConfirmationPart:SKt,ChatResponseReferencePartStatusKind:AKt,ChatRequestTurn:EKt,ChatResponseTurn:xKt,ChatLocation:DKt,ChatRequestEditorData:kKt,ChatRequestNotebookData:IKt,LanguageModelChatMessageRole:TKt,LanguageModelChatMessage:LKt,LanguageModelChatMessageFunctionResultPart:RKt,LanguageModelChatResponseTextPart:MKt,LanguageModelChatResponseFunctionUsePart:NKt,LanguageModelError:PKt,NewSymbolName:FKt,NewSymbolNameTag:OKt,NewSymbolNameTriggerKind:BKt,InlineEdit:WKt,InlineEditTriggerKind:HKt,ExcludeSettingOptions:UKt,TextSearchContextNew:VKt,TextSearchMatchNew:zKt,TextSearchCompleteMessageTypeNew:$Kt}=j9t,GKt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:OGt,Breakpoint:m$t,CallHierarchyIncomingCall:y$t,CallHierarchyItem:C$t,CallHierarchyOutgoingCall:S$t,CancellationError:A$t,CancellationTokenSource:E$t,CandidatePortSource:x$t,ChatCompletionItem:w$t,ChatCopyKind:iKt,ChatLocation:DKt,ChatRequestEditorData:kKt,ChatRequestNotebookData:IKt,ChatRequestTurn:EKt,ChatResponseAnchorPart:uKt,ChatResponseCodeCitationPart:_Kt,ChatResponseCommandButtonPart:yKt,ChatResponseConfirmationPart:SKt,ChatResponseDetectedParticipantPart:CKt,ChatResponseFileTreePart:hKt,ChatResponseMarkdownPart:dKt,ChatResponseMarkdownWithVulnerabilitiesPart:wKt,ChatResponseProgressPart:gKt,ChatResponseProgressPart2:fKt,ChatResponseReferencePart:pKt,ChatResponseReferencePart2:mKt,ChatResponseReferencePartStatusKind:AKt,ChatResponseTextEditPart:bKt,ChatResponseTurn:xKt,ChatResponseWarningPart:vKt,ChatResultFeedbackKind:v$t,ChatVariableLevel:b$t,CodeAction:D$t,CodeActionKind:k$t,CodeActionTriggerKind:I$t,CodeLens:T$t,Color:L$t,ColorInformation:R$t,ColorPresentation:M$t,ColorThemeKind:N$t,CommentMode:P$t,CommentState:F$t,CommentThreadApplicability:W$t,CommentThreadCollapsibleState:O$t,CommentThreadFocus:H$t,CommentThreadState:B$t,CompletionItem:U$t,CompletionItemKind:V$t,CompletionItemTag:z$t,CompletionList:$$t,CompletionTriggerKind:G$t,ConfigurationTarget:K$t,CustomExecution:q$t,DataTransfer:LGt,DataTransferItem:RGt,DebugAdapterExecutable:Q$t,DebugAdapterInlineImplementation:j$t,DebugAdapterNamedPipeServer:Y$t,DebugAdapterServer:J$t,DebugConfigurationProviderTriggerKind:X$t,DebugConsoleMode:Z$t,DebugStackFrame:nKt,DebugThread:sKt,DebugVisualization:e7t,DeclarationCoverage:BGt,DecorationRangeBehavior:t7t,Diagnostic:i7t,DiagnosticRelatedInformation:n7t,DiagnosticSeverity:s7t,DiagnosticTag:o7t,Disposable:r7t,DocumentDropEdit:q6t,DocumentDropOrPasteEditKind:Q6t,DocumentHighlight:a7t,DocumentHighlightKind:c7t,DocumentLink:d7t,DocumentPasteEdit:j6t,DocumentPasteTriggerKind:K6t,DocumentSymbol:h7t,EditSessionIdentityMatch:tKt,EndOfLine:u7t,EnvironmentVariableMutatorType:g7t,EvaluatableExpression:f7t,EventEmitter:b7t,ExcludeSettingOptions:UKt,ExtensionKind:w7t,ExtensionMode:y7t,ExtensionRuntime:nGt,ExternalUriOpenerPriority:C7t,FileChangeType:S7t,FileCoverage:NGt,FileCoverage2:PGt,FileDecoration:A7t,FileDecoration2:E7t,FilePermission:k7t,FileSystemError:x7t,FileType:D7t,FoldingRange:I7t,FoldingRangeKind:T7t,FunctionBreakpoint:L7t,Hover:N7t,HoverVerbosityAction:F7t,IndentAction:O7t,InlayHint:Y6t,InlayHintKind:X6t,InlayHintLabelPart:J6t,InlineCompletionItem:R7t,InlineCompletionList:M7t,InlineCompletionTriggerKind:v7t,InlineEdit:WKt,InlineEditTriggerKind:HKt,InlineValueEvaluatableExpression:_7t,InlineValueText:p7t,InlineValueVariableLookup:m7t,InputBoxValidationSeverity:UGt,KeywordRecognitionStatus:lKt,LanguageModelChatMessage:LKt,LanguageModelChatMessageFunctionResultPart:RKt,LanguageModelChatMessageRole:TKt,LanguageModelChatResponseFunctionUsePart:NKt,LanguageModelChatResponseTextPart:MKt,LanguageModelError:PKt,LanguageStatusSeverity:WGt,LinkedEditingRanges:CGt,Location:B7t,LogLevel:eKt,ManagedResolvedAuthority:tGt,MarkdownString:W7t,MultiDocumentHighlight:l7t,NewSymbolName:FKt,NewSymbolNameTag:OKt,NewSymbolNameTriggerKind:BKt,NotebookCellData:cGt,NotebookCellExecutionState:aGt,NotebookCellKind:rGt,NotebookCellOutput:gGt,NotebookCellOutputItem:fGt,NotebookCellStatusBarAlignment:hGt,NotebookCellStatusBarItem:pGt,NotebookControllerAffinity:mGt,NotebookControllerAffinity2:_Gt,NotebookData:lGt,NotebookEdit:vGt,NotebookEditorRevealType:uGt,NotebookKernelSourceAction:bGt,NotebookRange:oGt,NotebookRendererScript:dGt,NotebookVariablesRequestKind:wGt,OverviewRulerLane:H7t,ParameterInformation:U7t,PartialAcceptTriggerKind:cKt,PortAttributes:yGt,PortAutoForwardAction:V7t,Position:z7t,ProcessExecution:$7t,ProgressLocation:G7t,QuickInputButtonLocation:K7t,QuickInputButtons:q7t,QuickPickItemKind:HGt,Range:Q7t,RelatedInformationType:oKt,RelativePattern:j7t,RemoteAuthorityResolverError:Z6t,ResolvedAuthority:eGt,Selection:Y7t,SelectionRange:J7t,SemanticTokens:X7t,SemanticTokensBuilder:Z7t,SemanticTokensEdit:e6t,SemanticTokensEdits:t6t,SemanticTokensLegend:i6t,ShellExecution:n6t,ShellQuoting:s6t,SignatureHelp:o6t,SignatureHelpTriggerKind:r6t,SignatureInformation:a6t,SnippetString:c6t,SnippetTextEdit:I6t,SourceBreakpoint:l6t,SourceControlInputBoxValidationType:iGt,SpeechToTextStatus:rKt,StandardTokenType:d6t,StatementCoverage:FGt,StatusBarAlignment:h6t,SymbolInformation:u6t,SymbolKind:g6t,SymbolTag:f6t,SyntaxTokenType:N6t,TabInputChat:JGt,TabInputCustom:GGt,TabInputInteractiveWindow:YGt,TabInputNotebook:KGt,TabInputNotebookDiff:qGt,TabInputTerminal:jGt,TabInputText:VGt,TabInputTextDiff:zGt,TabInputTextMerge:$Gt,TabInputTextMultiDiff:XGt,TabInputWebview:QGt,Task:p6t,TaskGroup:m6t,TaskPanelKind:_6t,TaskRevealKind:v6t,TaskScope:b6t,TelemetryTrustedValue:ZGt,TerminalExitReason:E6t,TerminalLink:w6t,TerminalLocation:S6t,TerminalOutputAnchor:_$t,TerminalProfile:A6t,TerminalQuickFixOpener:C6t,TerminalQuickFixTerminalCommand:y6t,TerminalShellExecutionCommandLineConfidence:x6t,TestCoverageCount:MGt,TestMessage:EGt,TestMessage2:xGt,TestMessageStackFrame:DGt,TestResultState:SGt,TestRunProfileKind:IGt,TestRunRequest:AGt,TestTag:kGt,TextDocumentChangeReason:P6t,TextDocumentSaveReason:D6t,TextEdit:k6t,TextEditorCursorStyle:T6t,TextEditorLineNumbersStyle:L6t,TextEditorRevealType:R6t,TextEditorSelectionChangeKind:M6t,TextSearchCompleteMessageType:TGt,TextSearchCompleteMessageTypeNew:$Kt,TextSearchContextNew:VKt,TextSearchMatchNew:zKt,TextToSpeechStatus:aKt,ThemeColor:F6t,ThemeIcon:O6t,TimelineItem:sGt,TreeItem:B6t,TreeItemCheckboxState:W6t,TreeItemCollapsibleState:H6t,TypeHierarchyItem:U6t,UIKind:V6t,Uri:z6t,VerboseHover:P7t,ViewColumn:$6t,WorkspaceEdit:G6t,ai:u$t,authentication:t$t,chat:g$t,commands:r$t,comments:e$t,debug:s$t,env:o$t,extensions:n$t,interactive:h$t,l10n:d$t,languages:l$t,lm:p$t,notebooks:X9t,scm:Z9t,setDefaultApi:Cnt,speech:f$t,tasks:J9t,tests:i$t,version:Y9t,window:a$t,workspace:c$t},Symbol.toStringTag,{value:"Module"}));zLt(async({toAdd:s,toRemove:e})=>{await vtt(),await Dt.get(fs).deltaExtensions(s,e)},(s,e)=>({toAdd:[...s.toAdd,...e.toAdd],toRemove:[...s.toRemove,...e.toRemove]}),0);const KKt=new Map;function qKt(s){return KKt.get(s)}let J5e=class extends V{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(N.revive(e))).value.toString()}};J5e=D([Gi(Be.MainThreadLocalization),_(1,Jt),_(2,hJe)],J5e);class hG{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var NV,HR;let JT=(HR=class extends KZ{static getOrCreate(e,t,i,n,o={}){const r=e.createInstance(NV,t,i,n,o);return i&&r.setPreferredResource(i),r}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=n,this._notebookService=o,this._notebookModelResolverService=r,this._fileDialogService=a,this.editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!n.startDirty,this._sideLoadedListener=o.onDidAddNotebookDocument(m=>{m.viewType===this.viewType&&m.uri.toString()===this.resource.toString()&&this.resolve().catch(vt)}),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(7872,"Notebook '{0}' could not be saved.",this.resource.path))}))}dispose(){this._sideLoadedListener.dispose(),this.editorModelReference?.dispose(),this.editorModelReference=null,super.dispose()}get typeId(){return NV.ID}get editorId(){return this.viewType}get capabilities(){let e=Ei.None;return this.resource.scheme===pe.untitled&&(e|=Ei.Untitled),this.editorModelReference?this.editorModelReference.object.isReadonly()&&(e|=Ei.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly),e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}getDescription(e=Ls.MEDIUM){if(!this.hasCapability(Ei.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(Ei.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this.editorModelReference)return this.hasCapability(Ei.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 n=this.hasCapability(Ei.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this.editorModelReference.object.resource;let o;if(this.editorModelReference.object.hasAssociatedFilePath())o=n;else if(o=await this._fileDialogService.pickFileToSave(n,t?.availableFileSystems),!o)return;if(!i.matches(o)){const r=i.selectors.map(a=>typeof a=="string"?a:CQe(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}. +product.json (WINS): ${[...n].join(", ")}`),this._environmentService.isExtensionDevelopment&&(this._logService.error(`Proceeding with EXTRA proposals (${[...r].join(", ")}) because extension is in development mode. Still, this EXTENSION WILL BE BROKEN unless product.json is updated.`),i.push(...r))),e.enabledApiProposals=i;return}this._envEnablesProposedApiForAll||this._envEnabledExtensions.has(t)||!e.isBuiltin&&eo(e.enabledApiProposals)&&(this._logService.error(`Extension '${e.identifier.value} CANNOT USE these API proposals '${e.enabledApiProposals?.join(", ")||"*"}'. You MUST start in extension development mode or use the --enable-proposed-api command line flag`),e.enabledApiProposals=[])}};pAe=D([_(0,Ge),_(1,Jr),_(2,Er)],pAe);class k3t extends V{constructor(){super(...arguments),this.type="markdown"}shouldRender(e){return!!e.originalEnabledApiProposals?.length||!!e.enabledApiProposals?.length}render(e){const t=e.originalEnabledApiProposals??e.enabledApiProposals??[],i=new Mt;if(t.length)for(const n of t)i.appendMarkdown(`- \`${n}\` +`);return{data:i,dispose:()=>{}}}}Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"enabledApiProposals",label:g(1137,"API Proposals"),access:{canToggle:!1},renderer:new wi(k3t)});async function I3t(s,e){const t=[];return await Rit(s,t,e.logsHome,e.logsHome),t}async function Rit(s,e,t,i){const n=await s.resolve(t);for(const{resource:o,isDirectory:r}of n.children||[])if(r)await Rit(s,e,o,i);else{const a=(await s.readFile(o)).value.toString();if(a){const c=SN(i,o);c&&e.push({relativePath:c,contents:a})}}}var Mf;(function(s){s[s.Promise=100]="Promise",s[s.PromiseCancel=101]="PromiseCancel",s[s.EventListen=102]="EventListen",s[s.EventDispose=103]="EventDispose"})(Mf||(Mf={}));function S5e(s){switch(s){case Mf.Promise:return"req";case Mf.PromiseCancel:return"cancel";case Mf.EventListen:return"subscribe";case Mf.EventDispose:return"unsubscribe"}}var Eu;(function(s){s[s.Initialize=200]="Initialize",s[s.PromiseSuccess=201]="PromiseSuccess",s[s.PromiseError=202]="PromiseError",s[s.PromiseErrorObj=203]="PromiseErrorObj",s[s.EventFire=204]="EventFire"})(Eu||(Eu={}));function A5e(s){switch(s){case Eu.Initialize:return"init";case Eu.PromiseSuccess:return"reply:";case Eu.PromiseError:case Eu.PromiseErrorObj:return"replyErr:";case Eu.EventFire:return"event:"}}var bF;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Idle=1]="Idle"})(bF||(bF={}));function pP(s){let e=0;for(let t=0;;t+=7){const i=s.read(1);if(e|=(i.buffer[0]&127)<>>7)t++;const i=$e.alloc(t);for(let n=0;e!==0;n++)i.buffer[n]=e&127,e=e>>>7,e>0&&(i.buffer[n]|=128);s.write(i)}class L3t{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 R3t{constructor(){this.buffers=[]}get buffer(){return $e.concat(this.buffers)}write(e){this.buffers.push(e)}}var Nu;(function(s){s[s.Undefined=0]="Undefined",s[s.String=1]="String",s[s.Buffer=2]="Buffer",s[s.VSBuffer=3]="VSBuffer",s[s.Array=4]="Array",s[s.Object=5]="Object",s[s.Int=6]="Int"})(Nu||(Nu={}));function SE(s){const e=$e.alloc(1);return e.writeUInt8(s,0),e}const WI={Undefined:SE(Nu.Undefined),String:SE(Nu.String),Buffer:SE(Nu.Buffer),VSBuffer:SE(Nu.VSBuffer),Array:SE(Nu.Array),Object:SE(Nu.Object),Uint:SE(Nu.Int)},M3t=typeof Buffer<"u";function mAe(s,e){if(typeof e>"u")s.write(WI.Undefined);else if(typeof e=="string"){const t=$e.fromString(e);s.write(WI.String),mP(s,t.byteLength),s.write(t)}else if(M3t&&Buffer.isBuffer(e)){const t=$e.wrap(e);s.write(WI.Buffer),mP(s,t.byteLength),s.write(t)}else if(e instanceof $e)s.write(WI.VSBuffer),mP(s,e.byteLength),s.write(e);else if(Array.isArray(e)){s.write(WI.Array),mP(s,e.length);for(const t of e)mAe(s,t)}else if(typeof e=="number"&&(e|0)===e)s.write(WI.Uint),mP(s,e);else{const t=$e.fromString(JSON.stringify(e));s.write(WI.Object),mP(s,t.byteLength),s.write(t)}}function _Ae(s){switch(s.read(1).readUInt8(0)){case Nu.Undefined:return;case Nu.String:return s.read(pP(s)).toString();case Nu.Buffer:return s.read(pP(s)).buffer;case Nu.VSBuffer:return s.read(pP(s));case Nu.Array:{const t=pP(s),i=[];for(let n=0;nthis.onBuffer(i)),this.logger=t}getChannel(e){const t=this;return{call(i,n,o){return t.isDisposed?Promise.reject(new Ma):t.requestPromise(e,i,n,o)},listen(i,n){return t.isDisposed?M.None:t.requestEvent(e,i,n)}}}requestPromise(e,t,i,n=He.None){const o=this.lastRequestId++,r=Mf.Promise,a={id:o,type:r,channelName:e,name:t,arg:i};if(n.isCancellationRequested)return Promise.reject(new Ma);let c;return new Promise((d,h)=>{if(n.isCancellationRequested)return h(new Ma);const u=()=>{const v=b=>{switch(b.type){case Eu.PromiseSuccess:this.handlers.delete(o),d(b.data);break;case Eu.PromiseError:{this.handlers.delete(o);const w=new Error(b.data.message);w.stack=Array.isArray(b.data.stack)?b.data.stack.join(` +`):b.data.stack,w.name=b.data.name,h(w);break}case Eu.PromiseErrorObj:this.handlers.delete(o),h(b.data);break}};this.handlers.set(o,v),this.sendRequest(a)};let f=null;this.state===bF.Idle?u():(f=Rr(v=>this.whenInitialized()),f.then(()=>{f=null,u()}));const p=()=>{f?(f.cancel(),f=null):this.sendRequest({id:o,type:Mf.PromiseCancel}),h(new Ma)},m=n.onCancellationRequested(p);c=jr(Ee(p),m),this.activeRequests.add(c)}).finally(()=>{c.dispose(),this.activeRequests.delete(c)})}requestEvent(e,t,i){const n=this.lastRequestId++,o=Mf.EventListen,r={id:n,type:o,channelName:e,name:t,arg:i};let a=null;const c=new I({onWillAddFirstListener:()=>{a=Rr(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:n,type:Mf.EventDispose}))}}),l=d=>c.fire(d.data);return this.handlers.set(n,l),c.event}sendRequest(e){switch(e.type){case Mf.Promise:case Mf.EventListen:{const t=this.send([e.type,e.id,e.channelName,e.name],e.arg);this.logger?.logOutgoing(t,e.id,wF.LocalSide,`${S5e(e.type)}: ${e.channelName}.${e.name}`,e.arg);return}case Mf.PromiseCancel:case Mf.EventDispose:{const t=this.send([e.type,e.id]);this.logger?.logOutgoing(t,e.id,wF.LocalSide,S5e(e.type));return}}}send(e,t=void 0){const i=new R3t;return mAe(i,e),mAe(i,t),this.sendBuffer(i.buffer)}sendBuffer(e){try{return this.protocol.send(e),e.byteLength}catch{return 0}}onBuffer(e){const t=new L3t(e),i=_Ae(t),n=_Ae(t),o=i[0];switch(o){case Eu.Initialize:return this.logger?.logIncoming(e.byteLength,0,wF.LocalSide,A5e(o)),this.onResponse({type:i[0]});case Eu.PromiseSuccess:case Eu.PromiseError:case Eu.EventFire:case Eu.PromiseErrorObj:return this.logger?.logIncoming(e.byteLength,i[1],wF.LocalSide,A5e(o),n),this.onResponse({type:i[0],id:i[1],data:n})}}onResponse(e){if(e.type===Eu.Initialize){this.state=bF.Idle,this._onDidInitialize.fire();return}this.handlers.get(e.id)?.(e)}get onDidInitializePromise(){return M.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===bF.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),bt(this.activeRequests.values()),this.activeRequests.clear()}}E5e.__decorator=D([Zt],E5e.prototype,"onDidInitializePromise",null);var NT;(function(s){s.Created="created",s.Read="read",s.Write="write",s.Open="open",s.Error="error",s.Close="close",s.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",s.NodeEndReceived="nodeEndReceived",s.NodeEndSent="nodeEndSent",s.NodeDrainBegin="nodeDrainBegin",s.NodeDrainEnd="nodeDrainEnd",s.zlibInflateError="zlibInflateError",s.zlibInflateData="zlibInflateData",s.zlibInflateInitialWrite="zlibInflateInitialWrite",s.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",s.zlibInflateWrite="zlibInflateWrite",s.zlibInflateFlushFired="zlibInflateFlushFired",s.zlibDeflateError="zlibDeflateError",s.zlibDeflateData="zlibDeflateData",s.zlibDeflateWrite="zlibDeflateWrite",s.zlibDeflateFlushFired="zlibDeflateFlushFired",s.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",s.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",s.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",s.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",s.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",s.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",s.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",s.ProtocolHeaderRead="protocolHeaderRead",s.ProtocolMessageRead="protocolMessageRead",s.ProtocolHeaderWrite="protocolHeaderWrite",s.ProtocolMessageWrite="protocolMessageWrite",s.ProtocolWrite="protocolWrite"})(NT||(NT={}));var vAe;(function(s){s.enableDiagnostics=!1,s.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 n(o,r,a,c){if(!s.enableDiagnostics)return;const l=i(o);if(c instanceof $e||c instanceof Uint8Array||c instanceof ArrayBuffer||ArrayBuffer.isView(c)){const d=$e.alloc(c.byteLength);d.set(c),s.records.push({timestamp:Date.now(),id:l,label:r,type:a,buff:d})}else s.records.push({timestamp:Date.now(),id:l,label:r,type:a,data:c})}s.traceSocketEvent=n})(vAe||(vAe={}));var Cee;(function(s){s[s.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",s[s.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(Cee||(Cee={}));let bue=null;function AE(){return bue||(bue=$e.alloc(0)),bue}class N3t{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 AE();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=$e.alloc(e);let n=0,o=0;for(;e>0;){const r=this._chunks[o];if(r.byteLength>e){const a=r.slice(0,e);i.set(a,n),n+=e,t&&(this._chunks[o]=r.slice(e),this._totalLength-=e),e-=e}else i.set(r,n),n+=r.byteLength,t?(this._chunks.shift(),this._totalLength-=r.byteLength):o++,e-=r.byteLength}return i}}var Vr;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Control=2]="Control",s[s.Ack=3]="Ack",s[s.Disconnect=5]="Disconnect",s[s.ReplayRequest=6]="ReplayRequest",s[s.Pause=7]="Pause",s[s.Resume=8]="Resume",s[s.KeepAlive=9]="KeepAlive"})(Vr||(Vr={}));function Mit(s){switch(s){case Vr.None:return"None";case Vr.Regular:return"Regular";case Vr.Control:return"Control";case Vr.Ack:return"Ack";case Vr.Disconnect:return"Disconnect";case Vr.ReplayRequest:return"ReplayRequest";case Vr.Pause:return"PauseWriting";case Vr.Resume:return"ResumeWriting";case Vr.KeepAlive:return"KeepAlive"}}var If;(function(s){s[s.HeaderLength=13]="HeaderLength",s[s.AcknowledgeTime=2e3]="AcknowledgeTime",s[s.TimeoutTime=2e4]="TimeoutTime",s[s.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",s[s.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",s[s.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(If||(If={}));class ew{constructor(e,t,i,n){this.type=e,this.id=t,this.ack=i,this.data=n,this.writtenTime=0}get size(){return this.data.byteLength}}class x5e extends V{constructor(e){super(),this._onMessage=this._register(new I),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:If.HeaderLength,messageType:Vr.None,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new N3t,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(NT.ProtocolHeaderRead,{messageType:Mit(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const i=this._state.messageType,n=this._state.id,o=this._state.ack;if(this._state.readHead=!0,this._state.readLen=If.HeaderLength,this._state.messageType=Vr.None,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent(NT.ProtocolMessageRead,t),this._onMessage.fire(new ew(i,n,o,t)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class D5e{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=$e.alloc(If.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(NT.ProtocolHeaderWrite,{messageType:Mit(e.type),id:e.id,ack:e.ack,messageSize:e.data.byteLength}),this._socket.traceSocketEvent(NT.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=$e.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(NT.ProtocolWrite,{byteLength:e.byteLength}),this._socket.write(e)}}class Y0{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 P3t{constructor(e){this.data=e,this.next=null}}class F3t{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 P3t(e);if(!this._first){this._first=t,this._last=t;return}this._last.next=t,this._last=t}}const kp=class kp{static getInstance(){return kp._INSTANCE||(kp._INSTANCE=new kp),kp._INSTANCE}constructor(){this.lastRuns=[];const e=Date.now();for(let t=0;t{for(let t=kp._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+kp._HISTORY_LENGTH)*1e3;let i=0;for(let n=0;n=.5}};kp._HISTORY_LENGTH=10,kp._INSTANCE=null;let bAe=kp;class O3t{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(e){this._onControlMessage=new Y0,this.onControlMessage=this._onControlMessage.event,this._onMessage=new Y0,this.onMessage=this._onMessage.event,this._onDidDispose=new Y0,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new Y0,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new Y0,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=e.loadEstimator??bAe.getInstance(),this._shouldSendKeepAlive=e.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new F3t,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 D5e(this._socket)),this._socketReader=this._socketDisposables.add(new x5e(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()},If.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(){if(!this._didSendDisconnect){this._didSendDisconnect=!0;const e=new ew(Vr.Disconnect,0,0,AE());this._socketWriter.write(e),this._socketWriter.flush()}}sendPause(){const e=new ew(Vr.Pause,0,0,AE());this._socketWriter.write(e)}sendResume(){const e=new ew(Vr.Resume,0,0,AE());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 D5e(this._socket)),this._socketReader=this._socketDisposables.add(new x5e(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 ew(Vr.Ack,0,this._incomingAckId,AE());this._socketWriter.write(e);const t=this._outgoingUnackMsg.toArray();for(let i=0,n=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 Vr.None:break;case Vr.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 ew(Vr.ReplayRequest,0,0,AE())))}else this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data);break}case Vr.Control:{this._onControlMessage.fire(e.data);break}case Vr.Ack:break;case Vr.Disconnect:{this._onDidDispose.fire();break}case Vr.ReplayRequest:{const t=this._outgoingUnackMsg.toArray();for(let i=0,n=t.length;i=If.AcknowledgeTime){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},If.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,n=Date.now()-this._lastSocketTimeoutTime;if(t>=If.TimeoutTime&&i>=If.TimeoutTime&&n>=If.TimeoutTime&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:t,timeSinceLastReceivedSomeData:i});return}const o=Math.max(If.TimeoutTime-t,If.TimeoutTime-i,If.TimeoutTime-n,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},o)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new ew(Vr.Ack,0,this._incomingAckId,AE());this._socketWriter.write(e)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const e=new ew(Vr.KeepAlive,0,this._incomingAckId,AE());this._socketWriter.write(e)}}const B3t=30*1e3;var PT;(function(s){s[s.Management=1]="Management",s[s.ExtensionHost=2]="ExtensionHost",s[s.Tunnel=3]="Tunnel"})(PT||(PT={}));function wAe(s){switch(s){case PT.Management:return"Management";case PT.ExtensionHost:return"ExtensionHost";case PT.Tunnel:return"Tunnel"}}function Nit(s){const e=new ci;return setTimeout(()=>e.cancel(),s),e.token}function W3t(s,e){if(s.isCancellationRequested||e.isCancellationRequested)return He.Cancelled;const t=new ci;return s.onCancellationRequested(()=>t.cancel()),e.onCancellationRequested(()=>t.cancel()),t.token}class Ice{get didTimeout(){return this._state==="timedout"}constructor(e){this._state="pending",this._disposables=new Z,{promise:this.promise,resolve:this._resolvePromise,reject:this._rejectPromise}=I2(),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 H3t(s,e){const t=new Ice(e);return t.registerDisposable(s.onControlMessage(i=>{const n=JSON.parse(i.toString()),o=Oit(n);o?t.reject(o):t.resolve(n)})),t.promise}function U3t(s,e,t,i,n,o,r,a){const c=new Ice(a),l=js.create(!1);return s.info(`Creating a socket (${r})...`),cs(`code/willCreateSocket/${o}`),e.connect(t,i,n,r).then(d=>{c.didTimeout?(cs(`code/didCreateSocketError/${o}`),s.info(`Creating a socket (${r}) finished after ${l.elapsed()} ms, but this is too late and has timed out already.`),d?.dispose()):(cs(`code/didCreateSocketOK/${o}`),s.info(`Creating a socket (${r}) was successful after ${l.elapsed()} ms.`),c.resolve(d))},d=>{cs(`code/didCreateSocketError/${o}`),s.info(`Creating a socket (${r}) returned an error after ${l.elapsed()} ms.`),s.error(d),c.reject(d)}),c.promise}function wue(s,e){const t=new Ice(e);return s.then(i=>{t.didTimeout||t.resolve(i)},i=>{t.didTimeout||t.reject(i)}),t.promise}async function V3t(s,e,t,i){const n=Bit(s,e);s.logService.trace(`${n} 1/6. invoking socketFactory.connect().`);let o;try{o=await U3t(s.logService,s.remoteSocketFactoryService,s.connectTo,C8.getServerRootPath(),`reconnectionToken=${s.reconnectionToken}&reconnection=${s.reconnectionProtocol?"true":"false"}`,wAe(e),`renderer-${wAe(e)}-${s.reconnectionToken}`,i)}catch(d){throw s.logService.error(`${n} socketFactory.connect() failed or timed out. Error:`),s.logService.error(d),d}s.logService.trace(`${n} 2/6. socketFactory.connect() was successful.`);let r,a;s.reconnectionProtocol?(s.reconnectionProtocol.beginAcceptReconnection(o,null),r=s.reconnectionProtocol,a=!1):(r=new O3t({socket:o}),a=!0),s.logService.trace(`${n} 3/6. sending AuthRequest control message.`);const c=await wue(s.signService.createNewMessage(ar()),i),l={type:"auth",auth:s.connectionToken||"00000000000000000000",data:c.data};r.sendControl($e.fromString(JSON.stringify(l)));try{const d=await H3t(r,W3t(i,Nit(1e4)));if(d.type!=="sign"||typeof d.data!="string"){const p=new Error("Unexpected handshake message");throw p.code="VSCODE_CONNECTION_ERROR",p}if(s.logService.trace(`${n} 4/6. received SignRequest control message.`),!await wue(s.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 wue(s.signService.sign(d.data),i),f={type:"connectionType",commit:s.commit,signedData:u,desiredConnectionType:e};return t&&(f.args=t),s.logService.trace(`${n} 5/6. sending ConnectionTypeRequest control message.`),r.sendControl($e.fromString(JSON.stringify(f))),{protocol:r,ownsProtocol:a}}catch(d){throw d&&d.code==="ETIMEDOUT"&&(s.logService.error(`${n} the handshake timed out. Error:`),s.logService.error(d)),d&&d.code==="VSCODE_CONNECTION_ERROR"&&(s.logService.error(`${n} received error control message when negotiating connection. Error:`),s.logService.error(d)),a&&kNe(r),d}}async function z3t(s,e,t,i){const n=Date.now(),o=Bit(s,e),{protocol:r,ownsProtocol:a}=await V3t(s,e,t,i),c=new Ice(i);return c.registerDisposable(r.onControlMessage(l=>{const d=JSON.parse(l.toString()),h=Oit(d);h?(s.logService.error(`${o} received error control message when negotiating connection. Error:`),s.logService.error(h),a&&kNe(r),c.reject(h)):(s.reconnectionProtocol?.endAcceptReconnection(),s.logService.trace(`${o} 6/6. handshake finished, connection is up and running after ${e9t(n)}!`),c.resolve({protocol:r,firstMessage:d}))})),c.promise}async function Pit(s,e,t){const{protocol:i,firstMessage:n}=await z3t(s,PT.ExtensionHost,e,t),o=n&&n.debugPort;return{protocol:i,debugPort:o}}async function Fit(s,e,t){const{connectTo:i,connectionToken:n}=await s.addressProvider.getAddress();return{commit:s.commit,quality:s.quality,connectTo:i,connectionToken:n,reconnectionToken:e,reconnectionProtocol:t,remoteSocketFactoryService:s.remoteSocketFactoryService,signService:s.signService,logService:s.logService}}async function $3t(s,e){return G3t(s,async t=>{const{protocol:i,debugPort:n}=await Pit(t,e,He.None);return new J3t(s,e,t.reconnectionToken,i,n)})}async function G3t(s,e){for(let i=1;;i++)try{const n=ar(),o=await Fit(s,n,null);return await e(o)}catch(n){if(i<5)s.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! Will retry... Error:`),s.logService.error(n);else throw s.logService.error(`[remote-connection][attempt ${i}] An error occurred in initial connection! It will be treated as a permanent error. Error:`),s.logService.error(n),See.triggerPermanentFailure(0,0,hD.isHandled(n)),n}}function K3t(s){return Rr(e=>new Promise((t,i)=>{const n=setTimeout(t,s*1e3);e.onCancellationRequested(()=>{clearTimeout(n),t()})}))}var sI;(function(s){s[s.ConnectionLost=0]="ConnectionLost",s[s.ReconnectionWait=1]="ReconnectionWait",s[s.ReconnectionRunning=2]="ReconnectionRunning",s[s.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",s[s.ConnectionGain=4]="ConnectionGain"})(sI||(sI={}));class q3t{constructor(e,t){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.type=sI.ConnectionLost}}class Q3t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.durationSeconds=i,this.cancellableTimer=n,this.type=sI.ReconnectionWait}skipWait(){this.cancellableTimer.cancel()}}class j3t{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=sI.ReconnectionRunning}}class k5e{constructor(e,t,i){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.type=sI.ConnectionGain}}class Y3t{constructor(e,t,i,n){this.reconnectionToken=e,this.millisSinceLastIncomingData=t,this.attempt=i,this.handled=n,this.type=sI.ReconnectionPermanentFailure}}const Cg=class Cg extends V{static triggerPermanentFailure(e,t,i){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=e,this._permanentFailureAttempt=t,this._permanentFailureHandled=i,this._instances.forEach(n=>n._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||Cg._permanentFailure}constructor(e,t,i,n,o){super(),this._connectionType=e,this._options=t,this.reconnectionToken=i,this.protocol=n,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 k5e(this.reconnectionToken,0,0)),this._register(n.onSocketClose(r=>{const a=jQ(this._connectionType,this.reconnectionToken,!0);r?r.type===Cee.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(n.onSocketTimeout(r=>{const a=jQ(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()})),Cg._instances.push(this),this._register(Ee(()=>{const r=Cg._instances.indexOf(this);r>=0&&Cg._instances.splice(r,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Cg._permanentFailureMillisSinceLastIncomingData,Cg._permanentFailureAttempt,Cg._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=jQ(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 q3t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const t=[0,5,5,10,10,10,10,10,30];let i=-1;do{i++;const n=i0){const r=K3t(n);this._onDidStateChange.fire(new Q3t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),n,r)),this._options.logService.info(`${e} waiting for ${n} 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 j3t(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),i+1)),this._options.logService.info(`${e} resolving connection...`);const o=await Fit(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${e} connecting to ${o.connectTo}...`),await this._reconnect(o,Nit(B3t)),this._options.logService.info(`${e} reconnected!`),this._onDidStateChange.fire(new k5e(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(hD.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(Fr(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 hD){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,hD.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?Cg.triggerPermanentFailure(e,t,i):this._gotoPermanentFailure(e,t,i)}_gotoPermanentFailure(e,t,i){this._onDidStateChange.fire(new Y3t(this.reconnectionToken,e,t,i)),kNe(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}};Cg._permanentFailure=!1,Cg._permanentFailureMillisSinceLastIncomingData=0,Cg._permanentFailureAttempt=0,Cg._permanentFailureHandled=!1,Cg._instances=[];let See=Cg;class J3t extends See{constructor(e,t,i,n,o){super(PT.ExtensionHost,e,i,n,!1),this._startArguments=t,this.debugPort=o}async _reconnect(e,t){await Pit(e,this._startArguments,t)}}function kNe(s){try{s.acceptDisconnect();const e=s.getSocket();s.dispose(),e.dispose()}catch(e){vt(e)}}function Oit(s){if(s&&s.type==="error"){const e=new Error(`Connection error: ${s.reason}`);return e.code="VSCODE_CONNECTION_ERROR",e}return null}function X3t(s,e){for(;s.length"u"&&(l=ar(),this._storageService.store(c,l,Ie.WORKSPACE,an.MACHINE));const d=await slt(si.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",si.origin),u.searchParams.set("salt",l),u.toString()}}return`${Jg.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 n=ar();i.setAttribute("src",`${e}&vscodeWebWorkerExtHostId=${n}`);const o=new Gd;let r,a=null,c=!1,l=null;const d=(p,m)=>{a=m,c=!0,vt(a),clearTimeout(l),this._onDidExit.fire([J5.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(ue(si,"message",p=>{if(p.source!==i.contentWindow||p.data.vscodeWebWorkerExtHostId!==n)return;if(p.data.error){const{name:v,message:b,stack:w}=p.data.error,y=new Error;return y.message=b,y.name=v,y.stack=w,d(J5.UnexpectedError,y)}if(p.data.type==="vscode.bootstrap.nls"){const v="vs/base/worker/workerMain.js",b=require.toUrl(v).slice(0,-v.length);i.contentWindow.postMessage({type:p.data.type,data:{baseUrl:b,workerUrl:require.toUrl(v),nls:{messages:globalThis._VSCODE_NLS_MESSAGES,language:globalThis._VSCODE_NLS_LANGUAGE}}},"*");return}const{data:m}=p.data;if(o.isOpen()||!(m instanceof MessagePort)){console.warn("UNEXPECTED message",p);const v=new Error("UNEXPECTED message");return d(J5.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($e.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 M.toPromise(M.filter(e.onMessage,t=>Aee(t,lp.Ready))),this._isTerminating||(e.send($e.fromString(JSON.stringify(await this._createExtHostInitData()))),this._isTerminating)||(await M.toPromise(M.filter(e.onMessage,t=>Aee(t,lp.Initialized))),this._isTerminating))throw Sy();return e}dispose(){this._isTerminating||(this._isTerminating=!0,this._protocol?.send(Wit(lp.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 n;return i&&this._productService.commit&&!yk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,yk.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??(Wn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Kl,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:TRe(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()===qi.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:n,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===TA.EagerAutoStart,remote:{authority:this._environmentService.remoteAuthority,connectionData:null,isRemote:!1},uiKind:Wn?X_.Web:X_.Desktop}}};Eee=D([_(3,Yi),_(4,yi),_(5,Fs),_(6,Ge),_(7,lf),_(8,cv),_(9,Cm),_(10,Er),_(11,fu),_(12,$i)],Eee);class t9t{constructor(){this.capabilities=Vn.Readonly+Vn.FileReadWrite+Vn.PathCaseSensitive,this.onDidChangeCapabilities=M.None,this.onDidChangeFile=M.None}async readFile(e){try{const t=await fetch(e.toString(!0));if(t.status===200)return new Uint8Array(await t.arrayBuffer());throw us(t.statusText,ot.Unknown)}catch(t){throw us(t,ot.Unknown)}}async stat(e){return{type:sn.File,size:0,mtime:0,ctime:0}}watch(){return V.None}writeFile(e,t,i){throw new oS}readdir(e){throw new oS}mkdir(e){throw new oS}delete(e,t){throw new oS}rename(e,t,i){throw new oS}}var yAe={exports:{}},yue={};(function(s,e){e=s.exports=Fn;var t;typeof process=="object"&&yue&&yue.NODE_DEBUG&&/\bsemver\b/i.test(yue.NODE_DEBUG)?t=function(){var q=Array.prototype.slice.call(arguments,0);q.unshift("SEMVER"),console.log.apply(console,q)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,n=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 b=c++;a[b]="(?:-?("+a[m]+"(?:\\."+a[m]+")*))";var w=c++;a[w]="[0-9A-Za-z-]+";var y=c++;a[y]="(?:\\+("+a[w]+"(?:\\."+a[w]+")*))";var C=c++,A="v?"+a[u]+a[v]+"?"+a[y]+"?";a[C]="^"+A+"$";var L="[v=\\s]*"+a[f]+a[b]+"?"+a[y]+"?",k=c++;a[k]="^"+L+"$";var P=c++;a[P]="((?:<|>)?=?)";var R=c++;a[R]=a[d]+"|x|X|\\*";var z=c++;a[z]=a[l]+"|x|X|\\*";var G=c++;a[G]="[v=\\s]*("+a[z]+")(?:\\.("+a[z]+")(?:\\.("+a[z]+")(?:"+a[v]+")?"+a[y]+"?)?)?";var j=c++;a[j]="[v=\\s]*("+a[R]+")(?:\\.("+a[R]+")(?:\\.("+a[R]+")(?:"+a[b]+")?"+a[y]+"?)?)?";var K=c++;a[K]="^"+a[P]+"\\s*"+a[G]+"$";var ie=c++;a[ie]="^"+a[P]+"\\s*"+a[j]+"$";var ge=c++;a[ge]="(?:^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])";var xe=c++;a[xe]="(?:~>?)";var Re=c++;a[Re]="(\\s*)"+a[xe]+"\\s+",r[Re]=new RegExp(a[Re],"g");var yt="$1~",Pe=c++;a[Pe]="^"+a[xe]+a[G]+"$";var lt=c++;a[lt]="^"+a[xe]+a[j]+"$";var xt=c++;a[xt]="(?:\\^)";var Ji=c++;a[Ji]="(\\s*)"+a[xt]+"\\s+",r[Ji]=new RegExp(a[Ji],"g");var Ii="$1^",ns=c++;a[ns]="^"+a[xt]+a[G]+"$";var zs=c++;a[zs]="^"+a[xt]+a[j]+"$";var Pn=c++;a[Pn]="^"+a[P]+"\\s*("+L+")$|^$";var Xr=c++;a[Xr]="^"+a[P]+"\\s*("+A+")$|^$";var ds=c++;a[ds]="(\\s*)"+a[P]+"\\s*("+L+"|"+a[G]+")",r[ds]=new RegExp(a[ds],"g");var Zo="$1$2$3",Zr=c++;a[Zr]="^\\s*("+a[G]+")\\s+-\\s+("+a[G]+")\\s*$";var Di=c++;a[Di]="^\\s*("+a[j]+")\\s+-\\s+("+a[j]+")\\s*$";var ss=c++;a[ss]="(<|>)?=?\\s*\\*";for(var Oo=0;Ooi)return null;var T=de?r[k]:r[C];if(!T.test(q))return null;try{return new Fn(q,de)}catch{return null}}e.valid=Ba;function Ba(q,de){var T=Tn(q,de);return T?T.version:null}e.clean=md;function md(q,de){var T=Tn(q.trim().replace(/^[=v]+/,""),de);return T?T.version:null}e.SemVer=Fn;function Fn(q,de){if(q instanceof Fn){if(q.loose===de)return q;q=q.version}else if(typeof q!="string")throw new TypeError("Invalid Version: "+q);if(q.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Fn))return new Fn(q,de);t("SemVer",q,de),this.loose=de;var T=q.trim().match(de?r[k]:r[C]);if(!T)throw new TypeError("Invalid Version: "+q);if(this.raw=q,this.major=+T[1],this.minor=+T[2],this.patch=+T[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");T[4]?this.prerelease=T[4].split(".").map(function(ne){if(/^[0-9]+$/.test(ne)){var ye=+ne;if(ye>=0&&ye=0;)typeof this.prerelease[T]=="number"&&(this.prerelease[T]++,T=-2);T===-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: "+q)}return this.format(),this.raw=this.version,this},e.inc=Zd;function Zd(q,de,T,ne){typeof T=="string"&&(ne=T,T=void 0);try{return new Fn(q,T).inc(de,ne).version}catch{return null}}e.diff=pc;function pc(q,de){if(pl(q,de))return null;var T=Tn(q),ne=Tn(de);if(T.prerelease.length||ne.prerelease.length){for(var ye in T)if((ye==="major"||ye==="minor"||ye==="patch")&&T[ye]!==ne[ye])return"pre"+ye;return"prerelease"}for(var ye in T)if((ye==="major"||ye==="minor"||ye==="patch")&&T[ye]!==ne[ye])return ye}e.compareIdentifiers=$s;var Vc=/^[0-9]+$/;function $s(q,de){var T=Vc.test(q),ne=Vc.test(de);return T&&ne&&(q=+q,de=+de),T&&!ne?-1:ne&&!T?1:qde?1:0}e.rcompareIdentifiers=tc;function tc(q,de){return $s(de,q)}e.major=gl;function gl(q,de){return new Fn(q,de).major}e.minor=eh;function eh(q,de){return new Fn(q,de).minor}e.patch=dg;function dg(q,de){return new Fn(q,de).patch}e.compare=mc;function mc(q,de,T){return new Fn(q,T).compare(new Fn(de,T))}e.compareLoose=zc;function zc(q,de){return mc(q,de,!0)}e.rcompare=th;function th(q,de,T){return mc(de,q,T)}e.sort=Dc;function Dc(q,de){return q.sort(function(T,ne){return e.compare(T,ne,de)})}e.rsort=fl;function fl(q,de){return q.sort(function(T,ne){return e.rcompare(T,ne,de)})}e.gt=ic;function ic(q,de,T){return mc(q,de,T)>0}e.lt=Or;function Or(q,de,T){return mc(q,de,T)<0}e.eq=pl;function pl(q,de,T){return mc(q,de,T)===0}e.neq=ih;function ih(q,de,T){return mc(q,de,T)!==0}e.gte=nh;function nh(q,de,T){return mc(q,de,T)>=0}e.lte=$c;function $c(q,de,T){return mc(q,de,T)<=0}e.cmp=Gc;function Gc(q,de,T,ne){var ye;switch(de){case"===":typeof q=="object"&&(q=q.version),typeof T=="object"&&(T=T.version),ye=q===T;break;case"!==":typeof q=="object"&&(q=q.version),typeof T=="object"&&(T=T.version),ye=q!==T;break;case"":case"=":case"==":ye=pl(q,T,ne);break;case"!=":ye=ih(q,T,ne);break;case">":ye=ic(q,T,ne);break;case">=":ye=nh(q,T,ne);break;case"<":ye=Or(q,T,ne);break;case"<=":ye=$c(q,T,ne);break;default:throw new TypeError("Invalid operator: "+de)}return ye}e.Comparator=Wa;function Wa(q,de){if(q instanceof Wa){if(q.loose===de)return q;q=q.value}if(!(this instanceof Wa))return new Wa(q,de);t("comparator",q,de),this.loose=de,this.parse(q),this.semver===Bo?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var Bo={};Wa.prototype.parse=function(q){var de=this.loose?r[Pn]:r[Xr],T=q.match(de);if(!T)throw new TypeError("Invalid comparator: "+q);this.operator=T[1],this.operator==="="&&(this.operator=""),T[2]?this.semver=new Fn(T[2],this.loose):this.semver=Bo},Wa.prototype.toString=function(){return this.value},Wa.prototype.test=function(q){return t("Comparator.test",q,this.loose),this.semver===Bo?!0:(typeof q=="string"&&(q=new Fn(q,this.loose)),Gc(q,this.operator,this.semver,this.loose))},Wa.prototype.intersects=function(q,de){if(!(q instanceof Wa))throw new TypeError("a Comparator is required");var T;if(this.operator==="")return T=new Is(q.value,de),Mh(this.value,T,de);if(q.operator==="")return T=new Is(this.value,de),Mh(q.semver,T,de);var ne=(this.operator===">="||this.operator===">")&&(q.operator===">="||q.operator===">"),ye=(this.operator==="<="||this.operator==="<")&&(q.operator==="<="||q.operator==="<"),O=this.semver.version===q.semver.version,$=(this.operator===">="||this.operator==="<=")&&(q.operator===">="||q.operator==="<="),se=Gc(this.semver,"<",q.semver,de)&&(this.operator===">="||this.operator===">")&&(q.operator==="<="||q.operator==="<"),Ke=Gc(this.semver,">",q.semver,de)&&(this.operator==="<="||this.operator==="<")&&(q.operator===">="||q.operator===">");return ne||ye||O&&$||se||Ke},e.Range=Is;function Is(q,de){if(q instanceof Is)return q.loose===de?q:new Is(q.raw,de);if(q instanceof Wa)return new Is(q.value,de);if(!(this instanceof Is))return new Is(q,de);if(this.loose=de,this.raw=q,this.set=q.split(/\s*\|\|\s*/).map(function(T){return this.parseRange(T.trim())},this).filter(function(T){return T.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+q);this.format()}Is.prototype.format=function(){return this.range=this.set.map(function(q){return q.join(" ").trim()}).join("||").trim(),this.range},Is.prototype.toString=function(){return this.range},Is.prototype.parseRange=function(q){var de=this.loose;q=q.trim(),t("range",q,de);var T=de?r[Di]:r[Zr];q=q.replace(T,Ha),t("hyphen replace",q),q=q.replace(r[ds],Zo),t("comparator trim",q,r[ds]),q=q.replace(r[Re],yt),q=q.replace(r[Ji],Ii),q=q.split(/\s+/).join(" ");var ne=de?r[Pn]:r[Xr],ye=q.split(" ").map(function(O){return Rh(O,de)}).join(" ").split(/\s+/);return this.loose&&(ye=ye.filter(function(O){return!!O.match(ne)})),ye=ye.map(function(O){return new Wa(O,de)}),ye},Is.prototype.intersects=function(q,de){if(!(q instanceof Is))throw new TypeError("a Range is required");return this.set.some(function(T){return T.every(function(ne){return q.set.some(function(ye){return ye.every(function(O){return ne.intersects(O,de)})})})})},e.toComparators=kc;function kc(q,de){return new Is(q,de).set.map(function(T){return T.map(function(ne){return ne.value}).join(" ").trim().split(" ")})}function Rh(q,de){return t("comp",q),q=De(q,de),t("caret",q),q=Aa(q,de),t("tildes",q),q=zn(q,de),t("xrange",q),q=Wo(q,de),t("stars",q),q}function be(q){return!q||q.toLowerCase()==="x"||q==="*"}function Aa(q,de){return q.trim().split(/\s+/).map(function(T){return ee(T,de)}).join(" ")}function ee(q,de){var T=de?r[lt]:r[Pe];return q.replace(T,function(ne,ye,O,$,se){t("tilde",q,ne,ye,O,$,se);var Ke;return be(ye)?Ke="":be(O)?Ke=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?Ke=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":se?(t("replaceTilde pr",se),se.charAt(0)!=="-"&&(se="-"+se),Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0"):Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0",t("tilde return",Ke),Ke})}function De(q,de){return q.trim().split(/\s+/).map(function(T){return gt(T,de)}).join(" ")}function gt(q,de){t("caret",q,de);var T=de?r[zs]:r[ns];return q.replace(T,function(ne,ye,O,$,se){t("caret",q,ne,ye,O,$,se);var Ke;return be(ye)?Ke="":be(O)?Ke=">="+ye+".0.0 <"+(+ye+1)+".0.0":be($)?ye==="0"?Ke=">="+ye+"."+O+".0 <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+".0 <"+(+ye+1)+".0.0":se?(t("replaceCaret pr",se),se.charAt(0)!=="-"&&(se="-"+se),ye==="0"?O==="0"?Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+O+"."+(+$+1):Ke=">="+ye+"."+O+"."+$+se+" <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+"."+$+se+" <"+(+ye+1)+".0.0"):(t("no pr"),ye==="0"?O==="0"?Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+O+"."+(+$+1):Ke=">="+ye+"."+O+"."+$+" <"+ye+"."+(+O+1)+".0":Ke=">="+ye+"."+O+"."+$+" <"+(+ye+1)+".0.0"),t("caret return",Ke),Ke})}function zn(q,de){return t("replaceXRanges",q,de),q.split(/\s+/).map(function(T){return Cs(T,de)}).join(" ")}function Cs(q,de){q=q.trim();var T=de?r[ie]:r[K];return q.replace(T,function(ne,ye,O,$,se,Ke){t("xRange",q,ne,ye,O,$,se,Ke);var Bi=be(O),Wi=Bi||be($),ta=Wi||be(se),Nl=ta;return ye==="="&&Nl&&(ye=""),Bi?ye===">"||ye==="<"?ne="<0.0.0":ne="*":ye&&Nl?(Wi&&($=0),ta&&(se=0),ye===">"?(ye=">=",Wi?(O=+O+1,$=0,se=0):ta&&($=+$+1,se=0)):ye==="<="&&(ye="<",Wi?O=+O+1:$=+$+1),ne=ye+O+"."+$+"."+se):Wi?ne=">="+O+".0.0 <"+(+O+1)+".0.0":ta&&(ne=">="+O+"."+$+".0 <"+O+"."+(+$+1)+".0"),t("xRange return",ne),ne})}function Wo(q,de){return t("replaceStars",q,de),q.trim().replace(r[ss],"")}function Ha(q,de,T,ne,ye,O,$,se,Ke,Bi,Wi,ta,Nl){return be(T)?de="":be(ne)?de=">="+T+".0.0":be(ye)?de=">="+T+"."+ne+".0":de=">="+de,be(Ke)?se="":be(Bi)?se="<"+(+Ke+1)+".0.0":be(Wi)?se="<"+Ke+"."+(+Bi+1)+".0":ta?se="<="+Ke+"."+Bi+"."+Wi+"-"+ta:se="<="+se,(de+" "+se).trim()}Is.prototype.test=function(q){if(!q)return!1;typeof q=="string"&&(q=new Fn(q,this.loose));for(var de=0;de0){var ne=q[T].semver;if(ne.major===de.major&&ne.minor===de.minor&&ne.patch===de.patch)return!0}return!1}return!0}e.satisfies=Mh;function Mh(q,de,T){try{de=new Is(de,T)}catch{return!1}return de.test(q)}e.maxSatisfying=le;function le(q,de,T){var ne=null,ye=null;try{var O=new Is(de,T)}catch{return null}return q.forEach(function($){O.test($)&&(!ne||ye.compare($)===-1)&&(ne=$,ye=new Fn(ne,T))}),ne}e.minSatisfying=dr;function dr(q,de,T){var ne=null,ye=null;try{var O=new Is(de,T)}catch{return null}return q.forEach(function($){O.test($)&&(!ne||ye.compare($)===1)&&(ne=$,ye=new Fn(ne,T))}),ne}e.validRange=io;function io(q,de){try{return new Is(q,de).range||"*"}catch{return null}}e.ltr=un;function un(q,de,T){return rt(q,de,"<",T)}e.gtr=Se;function Se(q,de,T){return rt(q,de,">",T)}e.outside=rt;function rt(q,de,T,ne){q=new Fn(q,ne),de=new Is(de,ne);var ye,O,$,se,Ke;switch(T){case">":ye=ic,O=$c,$=Or,se=">",Ke=">=";break;case"<":ye=Or,O=nh,$=ic,se="<",Ke="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mh(q,de,ne))return!1;for(var Bi=0;Bi=0.0.0")),ta=ta||hg,Nl=Nl||hg,ye(hg.semver,ta.semver,ne)?ta=hg:$(hg.semver,Nl.semver,ne)&&(Nl=hg)}),ta.operator===se||ta.operator===Ke||(!Nl.operator||Nl.operator===se)&&O(q,Nl.semver))return!1;if(Nl.operator===Ke&&$(q,Nl.semver))return!1}return!0}e.prerelease=Ft;function Ft(q,de){var T=Tn(q,de);return T&&T.prerelease.length?T.prerelease:null}e.intersects=Ci;function Ci(q,de,T){return q=new Is(q,T),de=new Is(de,T),q.intersects(de)}e.coerce=Ot;function Ot(q){if(q instanceof Fn)return q;if(typeof q!="string")return null;var de=q.match(r[ge]);return de==null?null:Tn((de[1]||"0")+"."+(de[2]||"0")+"."+(de[3]||"0"))}})(yAe,yAe.exports);var GW=yAe.exports;function i9t(s,e,t,i,n){const o=new va;return s.forEach(r=>{const a=o.get(r.identifier);a&&n.warn(g(4825,"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(GW.gte(a.version,r.version)){n.warn(`Skipping extension ${r.extensionLocation.path} in favour of the builtin extension ${a.extensionLocation.path}.`);return}r.isBuiltin=!0}else n.warn(g(4825,"Overwriting extension {0} with {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath));else if(r.isBuiltin){n.warn(`Skipping obsolete builtin extension ${r.extensionLocation.path}`);return}o.set(r.identifier,r)}),t.forEach(r=>{const a=o.get(r.identifier);a&&n.warn(g(4826,"Overwriting {0} with Workspace Extension {1}.",a.extensionLocation.fsPath,r.extensionLocation.fsPath)),o.set(r.identifier,r)}),i.forEach(r=>{n.info(g(4827,"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 CAe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(),this.runningLocation=e,this._initDataProvider=t,this.remoteSocketFactoryService=i,this._contextService=n,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=TA.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=ANe(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:Kl,debugId:this._environmentService.debugExtensionHost.debugId,break:this._environmentService.debugExtensionHost.break,port:this._environmentService.debugExtensionHost.port,env:{...this._environmentService.debugExtensionHost.env,...t.options?.extensionHostEnv}},n=this._environmentService.extensionDevelopmentLocationURI;let o=!0;return n&&n.length>0&&n[0].scheme===pe.file&&(o=!1),o||(i.break=!1),$3t(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(Aee(m,lp.Ready)){this._createExtHostInitData(d).then(v=>{a.send($e.fromString(JSON.stringify(v)))});return}if(Aee(m,lp.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:TRe(this._productService,this._environmentService),appLanguage:Kl,extensionDevelopmentLocationURI:this._environmentService.extensionDevelopmentLocationURI,extensionTestsLocationURI:this._environmentService.extensionTestsLocationURI,globalStorageHome:t.globalStorageHome,workspaceStorageHome:t.workspaceStorageHome,extensionLogLevel:this._environmentService.extensionLogLevel},workspace:this._contextService.getWorkbenchState()===qi.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===TA.EagerAutoStart,uiKind:Wn?X_.Web:X_.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){if(super.dispose(),this._terminating=!0,this._protocol){const e=this._protocol.getSocket();this._protocol.send(Wit(lp.Terminate)),this._protocol.sendDisconnect(),this._protocol.dispose(),e.end(),this._protocol=null}}};CAe=D([_(2,IRe),_(3,yi),_(4,Jr),_(5,Yi),_(6,Ge),_(7,lf),_(8,Fs),_(9,hC),_(10,tJe),_(11,Er),_(12,rJe)],CAe);var SAe;let AAe=class extends hAe{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k,P,R){super(e,t,i,n,o,r,a,c,l,d,h,u,f,p,v,b,w,y,C,R),this._browserEnvironmentService=r,this._webExtensionsScannerService=m,this._userDataInitializationService=A,this._userDataProfileService=L,this._workspaceTrustManagementService=k,this._remoteExplorerService=P,y.when(Rs.Ready).then(async()=>{await this._userDataInitializationService.initializeInstalledExtensions(this._instantiationService),this._initialize()}),this._initFetchFileSystem()}_initFetchFileSystem(){const e=new t9t;this._register(this._fileService.registerProvider(pe.http,e)),this._register(this._fileService.registerProvider(pe.https,e))}async _scanWebExtensions(){const e=[],t=[],i=[];try{await Promise.all([this._webExtensionsScannerService.scanSystemExtensions().then(n=>e.push(...n.map(o=>aD(o)))),this._webExtensionsScannerService.scanUserExtensions(this._userDataProfileService.currentProfile.extensionsResource,{skipInvalidExtensions:!0}).then(n=>t.push(...n.map(o=>aD(o)))),this._webExtensionsScannerService.scanExtensionsUnderDevelopment().then(n=>i.push(...n.map(o=>aD(o,!0))))])}catch(n){this._logService.error(n)}return i9t(e,t,[],i,this._logService)}async _resolveExtensionsDefault(){const[e,t]=await Promise.all([this._scanWebExtensions(),this._remoteExtensionsScannerService.scanExtensions()]);return new p3t(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(n){return hD.isHandled(n)&&console.log("Error handled: Not showing a notification for the error"),this._remoteAuthorityResolverService._setResolvedAuthorityError(e,n),this._resolveExtensionsDefault()}this._remoteAuthorityResolverService._setResolvedAuthority(t.authority,t.options),this._remoteExplorerService.setTunnelInformation(t.tunnelInformation);const i=this._remoteAgentService.getConnection();return i&&(i.onDidStateChange(async n=>{n.type===sI.ConnectionLost&&this._remoteAuthorityResolverService._clearResolvedAuthority(e)}),i.onReconnecting(()=>this._resolveAuthorityAgain())),this._resolveExtensionsDefault()}async _onExtensionHostExit(e){this._doStopExtensionHosts();const t=si;typeof t.codeAutomationExit=="function"&&t.codeAutomationExit(e,await I3t(this._fileService,this._environmentService))}async _resolveAuthority(e){return this._resolveAuthorityOnExtensionHosts(lo.LocalWebWorker,e)}};AAe=D([_(3,we),_(4,bi),_(5,cv),_(6,Yi),_(7,Ml),_(8,Jt),_(9,Er),_(10,L6),_(11,yi),_(12,Te),_(13,xm),_(14,QRe),_(15,Ge),_(16,cg),_(17,Nae),_(18,Zu),_(19,hC),_(20,Jae),_(21,lg),_(22,cC),_(23,Qae),_(24,to)],AAe);let EAe=class{constructor(e,t,i,n,o,r,a,c){this._extensionsProposedApi=e,this._scanWebExtensions=t,this._getExtensionRegistrySnapshotWhenReady=i,this._instantiationService=n,this._remoteAgentService=o,this._remoteAuthorityResolverService=r,this._extensionEnablementService=a,this._logService=c}createExtensionHost(e,t,i){switch(t.kind){case lo.LocalProcess:return null;case lo.LocalWebWorker:{const n=i?TA.EagerManualStart:TA.EagerAutoStart;return this._instantiationService.createInstance(Eee,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case lo.Remote:{const n=this._remoteAgentService.getConnection();return n?this._instantiationService.createInstance(CAe,t,this._createRemoteExtensionHostDataProvider(e,n.remoteAuthority)):null}}}_createLocalExtensionHostDataProvider(e,t,i){return{getInitData:async()=>{if(i){const n=uAe(this._logService,this._extensionEnablementService,this._extensionsProposedApi,await this._scanWebExtensions(),!0),o=e.computeRunningLocation(n,[],!1),r=qQ(n,o,c=>t.equals(c));return{extensions:new jq(0,n,r.map(c=>c.identifier))}}else{const n=await this._getExtensionRegistrySnapshotWhenReady(),o=e.filterByRunningLocation(n.extensions,t);return{extensions:new jq(n.versionId,n.extensions,o.map(a=>a.identifier))}}}}}_createRemoteExtensionHostDataProvider(e,t){return{remoteAuthority:t,getInitData:async()=>{const i=await this._getExtensionRegistrySnapshotWhenReady(),n=await this._remoteAgentService.getEnvironment();if(!n)throw new Error("Cannot provide init data for remote extension host!");const o=e.filterByExtensionHostKind(i.extensions,lo.Remote),r=new jq(i.versionId,i.extensions,o.map(a=>a.identifier));return{connectionData:this._remoteAuthorityResolverService.getConnectionData(t),pid:n.pid,appRoot:n.appRoot,extensionHostLogsPath:n.extensionHostLogsPath,globalStorageHome:n.globalStorageHome,workspaceStorageHome:n.workspaceStorageHome,extensions:r}}}}};EAe=D([_(3,we),_(4,cg),_(5,hC),_(6,Ml),_(7,Ge)],EAe);let xAe=SAe=class{constructor(e){this._logService=e}pickExtensionHostKind(e,t,i,n,o){const r=SAe.pickRunningLocation(t,i,n,o);return this._logService.trace(`pickRunningLocation for ${e.value}, extension kinds: [${t.join(", ")}], isInstalledLocally: ${i}, isInstalledRemotely: ${n}, preference: ${L8t(o)} => ${fS(r)}`),r}static pickRunningLocation(e,t,i,n){const o=[];let r=!1;for(const a of e){if(a==="ui"&&i){if(n===Gg.Remote)return lo.Remote;r=!0}if(a==="workspace"&&i){if(n===Gg.None||n===Gg.Remote)return lo.Remote;o.push(lo.Remote)}if(a==="web"&&(t||i)){if(n===Gg.None||n===Gg.Local)return lo.LocalWebWorker;o.push(lo.LocalWebWorker)}}return r&&o.push(lo.Remote),o.length>0?o[0]:null}};xAe=SAe=D([_(0,Ge)],xAe);async function n9t(s,e,t){let i=t&&t.get("storage.serviceMachineId",Ie.APPLICATION)||null;if(i)return i;try{const o=(await e.readFile(s.serviceMachineIdResource)).value.toString();i=hEt(o)?o:null}catch{i=null}if(!i){i=ar();try{await e.writeFile(s.serviceMachineIdResource,$e.fromString(i))}catch{}}return t?.store("storage.serviceMachineId",i,Ie.APPLICATION,an.MACHINE),i}const s9t="/web-extension-resource/";class o9t{constructor(e,t,i,n,o){this._fileService=e,this._storageService=t,this._productService=i,this._environmentService=n,this._configurationService=o,i.extensionsGallery&&(this._extensionGalleryResourceUrlTemplate=i.extensionsGallery.resourceUrlTemplate,this._extensionGalleryAuthority=this._extensionGalleryResourceUrlTemplate?this._getExtensionGalleryAuthority(N.parse(this._extensionGalleryResourceUrlTemplate)):void 0)}get supportsExtensionGalleryResources(){return this._extensionGalleryResourceUrlTemplate!==void 0}getExtensionGalleryResourceURL({publisher:e,name:t,version:i,targetPlatform:n},o){if(this._extensionGalleryResourceUrlTemplate){const r=N.parse(Qge(this._extensionGalleryResourceUrlTemplate,{publisher:e,name:t,version:n!==void 0&&n!==Es.UNDEFINED&&n!==Es.UNKNOWN&&n!==Es.UNIVERSAL?`${i}+${n}`:i,path:"extension"}));return this._isWebExtensionResourceEndPoint(r)?r.with({scheme:C8.getPreferredWebSchema()}):r}}isExtensionGalleryResource(e){return!!this._extensionGalleryAuthority&&this._extensionGalleryAuthority===this._getExtensionGalleryAuthority(e)}async getExtensionGalleryRequestHeaders(){const e={"X-Client-Name":`${this._productService.applicationName}${Wn?"-web":""}`,"X-Client-Version":this._productService.version};return Qq(this._productService,this._environmentService)&&I1t(this._configurationService)===zg.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=n9t(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=C8.getServerRootPath();return t.startsWith(i)&&t.startsWith(s9t,i.length)}}let DAe=class extends o9t{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._logService=r}async readExtensionResource(e){if(e=Jg.uriToBrowserUri(e),e.scheme!==pe.http&&e.scheme!==pe.https&&e.scheme!==pe.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()}};DAe=D([_(0,Jt),_(1,$i),_(2,Er),_(3,Za),_(4,Te),_(5,Ge)],DAe);var WP,kAe;class X5{static fromJSON(e){if(e)try{const t=JSON.parse(e);return new X5(t.extensions,t.low,t.high,t.mid)}catch{return}}constructor(e,t,i,n=(t+i)/2|0){this.extensions=e,this.low=t,this.high=i,this.mid=n}}var MR;let IAe=(MR=class{constructor(e,t,i){this._storageService=t,this._envService=i,this._disabled=new Map;const n=t.get(WP._storageKey,Ie.APPLICATION);if(this._state=X5.fromJSON(n),this._state){const{mid:o,high:r}=this._state;for(let a=0;a=o&&aRa({id:t},e.identifier))}async start(e){if(this._state)throw new Error("invalid state");const t=e.map(n=>n.identifier.id),i=new X5(t,0,t.length,0);this._storageService.store(WP._storageKey,JSON.stringify(i),Ie.APPLICATION,an.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 X5(this._state.extensions,e?this._state.low:this._state.mid,e?this._state.mid:this._state.high);this._storageService.store(WP._storageKey,JSON.stringify(t),Ie.APPLICATION,an.MACHINE),await this._storageService.flush()}async reset(){this._storageService.remove(WP._storageKey,Ie.APPLICATION),await this._storageService.flush()}},WP=MR,MR._storageKey="extensionBisectState",MR);IAe=WP=D([_(0,Ge),_(1,$i),_(2,Jr)],IAe);var NR;let KW=(NR=class{constructor(e,t,i,n){this._extensionBisectService=t,this._notificationService=i,this._commandService=n,t.isActive&&(kAe.ctxIsBisectActive.bindTo(e).set(!0),this._showBisectPrompt())}_showBisectPrompt(){const e={label:g(1138,"I can't reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!1)},t={label:g(1139,"I can reproduce"),run:()=>this._commandService.executeCommand("extension.bisect.next",!0)},i={label:"Stop Bisect",run:()=>this._commandService.executeCommand("extension.bisect.stop")},n=this._extensionBisectService.disabledCount===1?g(1140,"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(1141,"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(Xe.Info,n,[e,t,i],{sticky:!0,priority:V2.URGENT})}},kAe=NR,NR.ctxIsBisectActive=new Y("isExtensionBisectActive",!1),NR);KW=kAe=D([_(0,Le),_(1,NU),_(2,bi),_(3,vi)],KW);Qe.as(of.Workbench).registerWorkbenchContribution(KW,Rs.Restored);At(class extends li{constructor(){super({id:"extension.bisect.start",title:Fe(1142,"Start Extension Bisect"),category:ca.Help,f1:!0,precondition:KW.ctxIsBisectActive.negate(),menu:{id:_e.ViewContainerTitle,when:he.equals("viewContainer","workbench.view.extensions"),group:"2_enablement",order:4}})}async run(s){const e=s.get(to),t=s.get(xc),i=s.get(A6),n=s.get(Ml),o=s.get(NU),r=(await i.getInstalled(br.User)).filter(c=>n.isEnabled(c));(await e.confirm({message:g(1143,"Extension Bisect"),detail:g(1144,"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(1145,"&&Start Extension Bisect")})).confirmed&&(await o.start(r),t.reload())}});At(class extends li{constructor(){super({id:"extension.bisect.next",title:Fe(1146,"Continue Extension Bisect"),category:ca.Help,f1:!0,precondition:KW.ctxIsBisectActive})}async run(s,e){const t=s.get(to),i=s.get(xc),n=s.get(NU),o=s.get(Er),r=s.get(iJe),a=s.get(vi);if(!n.isActive)return;if(e===void 0){const l=await this._checkForBad(t,n);if(l===null)return;e=l}if(e===void 0){await n.reset(),i.reload();return}const c=await n.next(e);if(!c){i.reload();return}if(c.bad)await t.info(g(1147,"Extension Bisect"),g(1148,"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:Xe.Info,message:g(1147,"Extension Bisect"),primaryButton:g(1149,"&&Report Issue & Continue"),cancelButton:g(1150,"Continue"),detail:g(1151,"Extension Bisect is done and has identified {0} as the extension causing the problem.",c.id),checkbox:{label:g(1152,"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 n.reset(),i.reload()}async _checkForBad(s,e){const{result:t}=await s.prompt({type:Xe.Info,message:g(1153,"Extension Bisect"),detail:g(1154,"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(1155,"I ca&&n't reproduce"),run:()=>!1},{label:g(1156,"I can &&reproduce"),run:()=>!0},{label:g(1157,"&&Stop Bisect"),run:()=>{}}],cancelButton:{label:g(1158,"&&Cancel Bisect"),run:()=>null}});return t}});At(class extends li{constructor(){super({id:"extension.bisect.stop",title:Fe(1159,"Stop Extension Bisect"),category:ca.Help,f1:!0,precondition:KW.ctxIsBisectActive})}async run(s){const e=s.get(NU),t=s.get(xc);await e.reset(),t.reload()}});function r9t(s,e){return s}function a9t(s){for(const[e,t]of Object.entries(s))Jg.registerAppResourcePathUrl(e,t)}function xee(s){switch(s){case Ho.InvalidSymbol:return g(1162,"Invalid symbol");case Ho.InvalidNumberFormat:return g(1163,"Invalid number format");case Ho.PropertyNameExpected:return g(1164,"Property name expected");case Ho.ValueExpected:return g(1165,"Value expected");case Ho.ColonExpected:return g(1166,"Colon expected");case Ho.CommaExpected:return g(1167,"Comma expected");case Ho.CloseBraceExpected:return g(1168,"Closing brace expected");case Ho.CloseBracketExpected:return g(1169,"Closing bracket expected");case Ho.EndOfFileExpected:return g(1170,"End of file expected");default:return""}}const Hit=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,c9t=/^-(\d{4})(\d{2})(\d{2})$/;function l9t(s){return s=s.trim(),s==="*"||Hit.test(s)}function S9(s){if(!l9t(s))return null;if(s=s.trim(),s==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=s.match(Hit);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 A9(s){if(!s)return null;const e=s.majorBase,t=s.majorMustEqual,i=s.minorBase;let n=s.minorMustEqual;const o=s.patchBase;let r=s.patchMustEqual;s.hasCaret&&(e===0||(n=!1),r=!1);let a=0;if(s.preRelease){const c=c9t.exec(s.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:n,patchBase:o,patchMustEqual:r,isMinimum:s.hasGreaterEquals,notBefore:a}}function d9t(s,e,t){let i;typeof s=="string"?i=A9(S9(s)):i=s;let n;e instanceof Date?n=e.getTime():typeof e=="string"&&(n=new Date(e).getTime());let o;if(typeof t=="string"?o=A9(S9(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:!(n&&n"u"&&typeof i.browser>"u")return r.push([Xe.Error,g(1178,"property `{0}` should be omitted if the extension doesn't have a `{1}` or `{2}` property.","activationEvents","main","browser")]),r}if(typeof i.extensionKind<"u"&&typeof i.main>"u"&&r.push([Xe.Warning,g(1179,"property `{0}` can be defined only if property `main` is also defined.","extensionKind")]),typeof i.main<"u"){if(typeof i.main!="string")return r.push([Xe.Error,g(1180,"property `{0}` can be omitted or must be of type `string`","main")]),r;{const l=Pt(t,i.main);$y(l,t)||r.push([Xe.Warning,g(1181,"Expected `main` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",l.path,t.path)])}}if(typeof i.browser<"u"){if(typeof i.browser!="string")return r.push([Xe.Error,g(1182,"property `{0}` can be omitted or must be of type `string`","browser")]),r;{const l=Pt(t,i.browser);$y(l,t)||r.push([Xe.Warning,g(1183,"Expected `browser` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.",l.path,t.path)])}}if(!GW.valid(i.version))return r.push([Xe.Error,g(1184,"Extension version is not semver compatible.")]),r;const a=[];if(!u9t(s,e,i,n,a))for(const l of a)r.push([Xe.Error,l]);if(o&&i.enabledApiProposals?.length){const l=[];if(!g9t([...i.enabledApiProposals],l))for(const d of l)r.push([Xe.Error,d])}return r}function u9t(s,e,t,i,n){return i||typeof t.main>"u"&&typeof t.browser>"u"?!0:f9t(s,e,t.engines.vscode,n)}function g9t(s,e){if(s.length===0)return!0;const t=Array.isArray(e)?e:void 0,i=(t?void 0:e)??kM,n=[],o=UIt(s);for(const{proposalName:r,version:a}of o){const c=i[r];c&&a&&c.version!==a&&n.push(g(1185,"Extension is using an API proposal '{0}' that is not compatible with the current version of VS Code.",r))}return t?.push(...n),n.length===0}function f9t(s,e,t,i=[]){const n=A9(S9(t));if(!n)return i.push(g(1186,"Could not parse `engines.vscode` value {0}. Please use, for example: ^1.22.0, ^1.22.x, etc.",t)),!1;if(n.majorBase===0){if(!n.majorMustEqual||!n.minorMustEqual)return i.push(g(1187,"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(!n.majorMustEqual)return i.push(g(1188,"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 d9t(s,e,n)?!0:(i.push(g(1189,"Extension is not compatible with Code {0}. Extension requires: {1}.",s,t)),!1)}function I5e(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{const a=[];if(i)a.push(...r);else for(const c of r)e.some(([l])=>Ra(l.identifier,c.identifier)&&l.manifest.version!==c.version)?n.push(c):a.push(c);for(const[c,l]of e){const d=a.findIndex(u=>Ra(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}),n.length&&this._onRemoveExtensions.fire({extensions:n,profileLocation:t}),a}),o.length&&this._onDidAddExtensions.fire({extensions:o,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,profileLocation:t}),o}catch(r){throw o.length&&this._onDidAddExtensions.fire({extensions:o,error:r,profileLocation:t}),n.length&&this._onDidRemoveExtensions.fire({extensions:n,error:r,profileLocation:t}),r}}async updateMetadata(e,t){const i=[];return await this.withProfileExtensions(t,n=>{const o=[];for(const r of n){const a=e.find(([c])=>Ra(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,n=>{const o=[];for(const r of n)Ra(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(n){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:n,profileLocation:t}),n}}async withProfileExtensions(e,t,i){return this.getResourceAccessQueue(e).queue(async()=>{let n=[],o;try{const r=await this.fileService.readFile(e);o=JSON.parse(r.value.toString().trim()||"[]")}catch(r){if(Uw(r)!==Qi.FILE_NOT_FOUND)throw r;if(this.uriIdentityService.extUri.isEqual(e,this.userDataProfilesService.defaultProfile.extensionsResource)&&(o=await this.migrateFromOldDefaultProfileExtensionsLocation()),!o&&i?.bailOutWhenFileNotFound)throw new Dee(nu(r),qW.ERROR_PROFILE_NOT_FOUND)}if(o){Array.isArray(o)||this.reportAndThrowInvalidConentError(e);let r=!1;for(const a of o){L5e(a)||this.reportAndThrowInvalidConentError(e);let c;if(Lt(a.relativeLocation)&&a.relativeLocation)c=this.resolveExtensionLocation(a.relativeLocation);else if(Lt(a.location)){this.logService.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{c=N.revive(a.location);const l=this.toRelativePath(c);l&&(r=!0,a.relativeLocation=l)}Ya(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(r=!0,a.metadata.hasPreReleaseVersion=!0),n.push({identifier:a.identifier,location:c,version:a.version,metadata:a.metadata})}r&&await this.fileService.writeFile(e,$e.fromString(JSON.stringify(o)))}if(t){n=t(n);const r=n.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,$e.fromString(JSON.stringify(r)))}return n})}reportAndThrowInvalidConentError(e){const t=new Dee(`Invalid extensions content in ${e.toString()}`,qW.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(Uw(o)===Qi.FILE_NOT_FOUND)return;throw o}this.logService.info("Migrating extensions from old default profile location",e.toString());let n;try{const o=JSON.parse(i);Array.isArray(o)&&o.every(r=>L5e(r))?n=o:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",o)}catch(o){this.logService.error(o)}if(n)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,$e.fromString(JSON.stringify(n)),{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(Uw(o)===Qi.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){Uw(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(o)}try{await this.fileService.del(t)}catch(o){Uw(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(o)}return n})()),this._migrationPromise}getResourceAccessQueue(e){let t=this.resourcesAccessQueueMap.get(e);return t||(t=new gI,this.resourcesAccessQueueMap.set(e,t)),t}};T5e=D([_(1,Jt),_(2,Cm),_(3,ks),_(4,Yi),_(5,Ge)],T5e);function L5e(s){return kn(s)&&bLt(s.identifier)&&(p9t(s.location)||Lt(s.location)&&s.location)&&(Ya(s.relativeLocation)||Lt(s.relativeLocation))&&s.version&&Lt(s.version)}function p9t(s){return s?Lt(s.path)&&Lt(s.scheme):!1}function m9t(s,e,t,i){try{_9t(s,e,t,i)}catch(n){s.error(n?.message??n)}return e}function _9t(s,e,t,i){const n=(o,r,a)=>{const c=o[r];if(Lt(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||s.warn(`[${e.name}]: ${g(1190,"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(kn(c))for(const l in c)c.hasOwnProperty(l)&&(l==="commands"?n(c,l,!0):n(c,l,a));else if(Array.isArray(c))for(let l=0;lthis._onDidChangeCache.fire(br.System))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(br.User)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=SLt(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(e,t,i){const[n,o]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(t)]),r=i?await this.scanExtensionsUnderDevelopment(e,[...n,...o]):[];return this.dedupExtensions(n,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,n]=await Promise.all(t);return this.applyScanOptions([...i,...n],br.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,n=await this.createExtensionScannerInput(t,!!e.profileLocation,br.User,!e.includeUninstalled,e.language,!0,i,e.productVersion??this.getProductVersion()),o=e.useCache&&!n.devMode&&n.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let r;try{r=await o.scanExtensions(n)}catch(a){if(a instanceof Dee&&a.code===qW.ERROR_PROFILE_NOT_FOUND)await this.doInitializeDefaultProfileExtensions(),r=await o.scanExtensions(n);else throw a}return r=await this.applyScanOptions(r,br.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(n=>n.scheme===pe.file).map(async n=>{const o=await this.createExtensionScannerInput(n,!1,br.User,!0,e.language,!1,void 0,e.productVersion??this.getProductVersion());return(await this.extensionsScanner.scanOneOrMultipleExtensions(o)).map(a=>(a.type=t.find(c=>Ra(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 n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanExtension(n);return!o||!i.includeInvalid&&!o.isValid?null:o}async scanOneOrMultipleExtensions(e,t,i){const n=await this.createExtensionScannerInput(e,!1,t,!0,i.language,!0,void 0,i.productVersion??this.getProductVersion()),o=await this.extensionsScanner.scanOneOrMultipleExtensions(n);return this.applyScanOptions(o,t,i,!0)}async scanMultipleExtensions(e,t,i){const n=[];return await Promise.all(e.map(async o=>{const r=await this.scanOneOrMultipleExtensions(o,t,i);n.push(...r)})),this.applyScanOptions(n,t,i,!0)}async scanMetadata(e){const t=Pt(e,"package.json"),i=(await this.fileService.readFile(t)).value.toString();return JSON.parse(i).__metadata}async updateMetadata(e,t){const i=Pt(e,"package.json"),n=(await this.fileService.readFile(i)).value.toString(),o=JSON.parse(n);t.isMachineScoped===!1&&delete t.isMachineScoped,t.isBuiltin===!1&&delete t.isBuiltin,o.__metadata={...o.__metadata,...t},await this.fileService.writeFile(Pt(e,"package.json"),$e.fromString(JSON.stringify(o,null," ")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Dee&&e.code===qW.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,$e.fromString(JSON.stringify([])))}catch(t){Uw(t)!==Qi.FILE_NOT_FOUND&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),nu(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,n){return i.includeAllVersions||(e=this.dedupExtensions(t===br.System?e:void 0,t===br.User?e:void 0,t==="development"?e:void 0,await this.getTargetPlatform(),n)),i.includeInvalid||(e=e.filter(o=>o.isValid)),e.sort((o,r)=>{const a=Ko(o.location.fsPath),c=Ko(r.location.fsPath);return ac?1:0})}dedupExtensions(e,t,i,n,o){const r=(c,l,d)=>{if(c.isValid&&!l.isValid)return!1;if(c.isValid===l.isValid){if(o&&GW.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(GW.eq(c.manifest.version,l.manifest.version)){if(c.type===br.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===n)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 va;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===br.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,br.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 n=t?await this.getBuiltInExtensionControl():{},o=[],r=N.file(Dk(ife(Jg.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const c of i){const l=n[c.name]||"marketplace";switch(l){case"disabled":break;case"marketplace":o.push(Pt(r,c.name));break;default:o.push(N.file(l));break}}const a=await Promise.all(o.map(async c=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(c,!1,br.System,!0,e,!0,void 0,this.getProductVersion()))));return this.logService.trace("Scanned dev system extensions:",a.length),Fi(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,n,o,r,a,c){const l=await this.getTranslations(o??Kl),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 Z5(e,d,h,u,t,a,i,n,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}}};R5e=D([_(4,Cm),_(5,Lae),_(6,Jt),_(7,Ge),_(8,Za),_(9,Er),_(10,ks),_(11,we)],R5e);class Z5{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this.location=e,this.mtime=t,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=n,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 ji(e.location,t.location)&&e.mtime===t.mtime&&ji(e.applicationExtensionslocation,t.applicationExtensionslocation)&&e.applicationExtensionslocationMtime===t.applicationExtensionslocationMtime&&e.profile===t.profile&&Ys(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&&TAe.equals(e.translations,t.translations)}}let LAe=class extends V{constructor(e,t){super(),this.fileService=e,this.logService=t}async getLocalizedMessages(e,t,i){const n=Pt(e,"package.nls.json"),o=(l,d)=>{d.forEach(h=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",l?.path,xee(h.error))))})},r=l=>{this.logService.error(this.formatMessage(e,g(445,"Invalid format {0}: JSON object expected.",l?.path)))},a=`${t.publisher}.${t.name}`,c=i.translations[a];if(c)try{const l=N.parse(c),d=(await this.fileService.readFile(l)).value.toString(),h=[],u=ef(d,h);return h.length>0?(o(l,h),{values:void 0,default:n}):tD(u)!=="object"?(r(l),{values:void 0,default:n}):{values:u.contents?u.contents.package:void 0,default:n}}catch{return{values:void 0,default:n}}else{if(!await this.fileService.exists(n))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=ef(h,u);return u.length>0?(o(d.localized,u),{values:void 0,default:d.original}):tD(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 n=await this.getLocalizedMessages(e,t,i);if(n)try{const o=[],r=await this.resolveOriginalMessageBundle(n.default,o);if(o.length>0)return o.forEach(c=>{this.logService.error(this.formatMessage(e,g(444,"Failed to parse {0}: {1}.",n.default?.path,xee(c.error))))}),t;if(tD(n)!=="object")return this.logService.error(this.formatMessage(e,g(445,"Invalid format {0}: JSON object expected.",n.default?.path))),t;const a=n.values||Object.create(null);return m9t(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 ef(i,t)}catch{}}findMessageBundles(e,t){return new Promise((i,n)=>{const o=r=>{const a=Pt(e,`package.nls.${r}.json`);this.fileService.exists(a).then(c=>{c&&i({localized:a,original:Pt(e,"package.nls.json")});const l=r.lastIndexOf("-");l===-1?i({localized:Pt(e,"package.nls.json"),original:null}):(r=r.substring(0,l),o(r))})};if(t.devMode||t.pseudo||!t.language)return i({localized:Pt(e,"package.nls.json"),original:null});o(t.language)})}formatMessage(e,t){return`[${e.path}]: ${t}`}};LAe=D([_(0,Jt),_(1,Ge)],LAe);let kee=class extends LAe{constructor(e,t,i,n,o,r,a){super(n,a),this.obsoleteFile=e,this.extensionsProfileScannerService=t,this.uriIdentityService=i,this.environmentService=r,this.extensionsEnabledWithApiProposalVersion=o.extensionsEnabledWithApiProposalVersion?.map(c=>c.toLowerCase())??[]}async scanExtensions(e){const t=e.profile?await this.scanExtensionsFromProfile(e):await this.scanExtensionsFromLocation(e);let i={};if(e.excludeObsolete&&e.type===br.User)try{const n=(await this.fileService.readFile(this.obsoleteFile)).value.toString();i=JSON.parse(n)}catch{}return wA(i)?t:t.filter(n=>!i[L5.create(n).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 n=>{if(!n.isDirectory||e.type===br.User&&_i(n.resource).indexOf(".")===0)return null;const o=new Z5(n.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 Fi(i).sort((n,o)=>n.location.path!0,e);if(e.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(e.location,e.applicationExtensionslocation)){t=t.filter(n=>!n.metadata?.isApplicationScoped);const i=await this.scanExtensionsFromProfileResource(e.applicationExtensionslocation,n=>!!n.metadata?.isBuiltin||!!n.metadata?.isApplicationScoped,e);t.push(...i)}return t}async scanExtensionsFromProfileResource(e,t,i){const n=await this.extensionsProfileScannerService.scanProfileExtensions(e,i.profileScanOptions);if(!n.length)return[];const o=await Promise.all(n.map(async r=>{if(t(r)){const a=new Z5(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 Fi(o)}async scanOneOrMultipleExtensions(e){try{if(await this.fileService.exists(Pt(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}:`,nu(t)),[]}}async scanExtension(e,t){try{let i=await this.scanExtensionManifest(e.location);if(i){i.publisher||(i.publisher=WYe),t=t??i.__metadata,delete i.__metadata;const n=xw(i.publisher,i.name),o=t?.id?{id:n,uuid:t.id}:{id:n},r=t?.isSystem?br.System:e.type,a=r===br.System||!!t?.isBuiltin;i=await this.translateManifest(e.location,i,Z5.createNlsConfiguration(e));let c={type:r,identifier:o,manifest:i,location:e.location,isBuiltin:a,targetPlatform:t?.targetPlatform??Es.UNDEFINED,publisherDisplayName:t?.publisherDisplayName,metadata:t,isValid:!0,validations:[]};return e.validate&&(c=this.validate(c,e)),i.enabledApiProposals&&(!this.environmentService.isBuilt||this.extensionsEnabledWithApiProposalVersion.includes(n.toLowerCase()))&&(i.originalEnabledApiProposals=i.enabledApiProposals,i.enabledApiProposals=VIt([...i.enabledApiProposals])),c}}catch(i){e.type!==br.System&&this.logService.error(i)}return null}validate(e,t){let i=!0;const n=this.environmentService.isBuilt&&this.extensionsEnabledWithApiProposalVersion.includes(e.identifier.id.toLowerCase()),o=h9t(t.productVersion,t.productDate,t.location,e.manifest,e.isBuiltin,n);for(const[r,a]of o)r===Xe.Error&&(i=!1,this.logService.error(this.formatMessage(t.location,a)));return e.isValid=i,e.validations=o,e}async scanExtensionManifest(e){const t=Pt(e,"package.json");let i;try{i=(await this.fileService.readFile(t)).value.toString()}catch(o){return Uw(o)!==Qi.FILE_NOT_FOUND&&this.logService.error(this.formatMessage(e,g(446,"Cannot read file {0}: {1}.",t.path,o.message))),null}let n;try{n=JSON.parse(i)}catch{const r=[];ef(i,r);for(const a of r)this.logService.error(this.formatMessage(e,g(447,"Failed to parse {0}: [{1}, {2}] {3}.",t.path,a.offset,a.length,xee(a.error))));return null}return tD(n)!=="object"?(this.logService.error(this.formatMessage(e,g(448,"Invalid manifest file {0}: Not a JSON object.",t.path))),null):n}};kee=D([_(1,Lae),_(2,ks),_(3,Jt),_(4,Er),_(5,Za),_(6,Ge)],kee);let Iee=class extends kee{constructor(e,t,i,n,o,r,a,c,l){super(t,n,o,r,a,c,l),this.currentProfile=e,this.userDataProfilesService=i,this.cacheValidatorThrottler=this._register(new K7(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&&Z5.equals(i.input,this.input))return this.logService.debug("Using cached extensions scan result",e.type===br.System?"system":"user",e.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),i.result.map(o=>(o.location=N.revive(o.location),o));const n=await super.scanExtensions(e);return await this.writeExtensionCache(t,{input:e,result:n}),n}async readExtensionCache(e){try{const t=await this.fileService.readFile(e),i=JSON.parse(t.value.toString());return{result:i.result,input:Mo(i.input)}}catch(t){this.logService.debug("Error while reading the extension cache file:",e.path,nu(t))}return null}async writeExtensionCache(e,t){try{await this.fileService.writeFile(e,$e.fromString(JSON.stringify(t)))}catch(i){this.logService.debug("Error while writing the extension cache file:",e.path,nu(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,n=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!Ys(n,i))try{this.logService.info("Invalidating Cache",i,n),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===br.System?OIt:FIt)}getProfile(e){return e.type===br.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}};Iee=D([_(2,Cm),_(3,Lae),_(4,ks),_(5,Jt),_(6,Er),_(7,Za),_(8,Ge)],Iee);const RAe=["W","X","Y","Z","a","b","c","d","e","f"],v9t=new RegExp(`^[${RAe.join("")}]+`),Uit=7;function b9t(s){if(s.scheme!==pe.vscodeNotebookCell)return;const e=s.fragment.indexOf("s");if(e<0)return;const t=parseInt(s.fragment.substring(0,e).replace(v9t,""),Uit),i=iKe(s.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:s.with({scheme:i,fragment:null})}}function w9t(s,e){const t=e.toString(Uit),n=`${t.length$e.wrap(r))),o=L9t(n);return i=i||o.byteLength!==n.byteLength,{data:o,didCompression:i}}const YQ="\x1B[A",Cue=YQ.split("").map(s=>s.charCodeAt(0)),E9t=10;function x9t(s){let e=!1;return s.forEach((t,i)=>{if(i===0||t.length-1;){const e=s.match(/^(.*)\r+/m)[1];let t=s.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),s=s.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return s}const I9t=8,T9t=13;function L9t(s){return!s.buffer.includes(I9t)&&!s.buffer.includes(T9t)?s:$e.fromString(k9t(D9t(S9t.decode(s.buffer))))}var PAe,y0,SC,FAe,C0,EE,S0,OAe,BAe,JQ,TV,WAe,tw,iw,HAe,vg,UAe;function ki(s){return Object.assign(s,{apply:function(...t){if(t.length===0)return Reflect.construct(s,[]);{const i=t.length===1?[]:t[1];return Reflect.construct(s,i,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(s,[]);{const[i,...n]=t;return Reflect.construct(s,n,i.constructor)}}})}var Ree;(function(s){s[s.Top=0]="Top",s[s.Bottom=1]="Bottom"})(Ree||(Ree={}));var V1,r6e;let Qs=PAe=(r6e=class{constructor(e){Wt(this,V1);Ct(this,V1,e)}static from(...e){let t=e;return new PAe(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}dispose(){typeof Ce(this,V1)=="function"&&(Ce(this,V1).call(this),Ct(this,V1,void 0))}},V1=new WeakMap,r6e);Qs=PAe=D([ki],Qs);let bs=y0=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 Pi();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 y0(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Pi();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 y0(i,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};bs=y0=D([ki],bs);let Jn=SC=class{static isRange(e){return e instanceof SC?!0:e?bs.isPosition(e.start)&&bs.isPosition(e.end):!1}static of(e){if(e instanceof SC)return e;if(this.isRange(e))return new SC(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,n){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(o=new bs(e,t),r=new bs(i,n)):bs.isPosition(e)&&bs.isPosition(t)&&(o=bs.of(e),r=bs.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 SC.isRange(e)?this.contains(e.start)&&this.contains(e.end):bs.isPosition(e)?!(bs.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=bs.Max(e.start,this._start),i=bs.Min(e.end,this._end);if(!t.isAfter(i))return new SC(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=bs.Min(e.start,this._start),i=bs.Max(e.end,this.end);return new SC(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 Pi();let i;return e?bs.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 SC(i,t)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return zit(this)}};Jn=SC=D([ki],Jn);let oC=FAe=class extends Jn{static isSelection(e){return e instanceof FAe?!0:e?Jn.isRange(e)&&bs.isPosition(e.anchor)&&bs.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,n){let o,r;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof n=="number"?(o=new bs(e,t),r=new bs(i,n)):bs.isPosition(e)&&bs.isPosition(t)&&(o=bs.of(e),r=bs.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}}[Symbol.for("debug.description")](){return R9t(this)}};oC=FAe=D([ki],oC);function zit(s){return s.isEmpty?`[${s.start.line}:${s.start.character})`:`[${s.start.line}:${s.start.character} -> ${s.end.line}:${s.end.character})`}function R9t(s){let e=zit(s);return s.isEmpty||(s.active.isEqual(s.start)?e=`|${e}`:e=`${e}|`),e}const $it=s=>{if(typeof s!="string"||s.length===0||!/^[0-9A-Za-z_\-]+$/.test(s))throw Pi("connectionToken")};let Git=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 Pi("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Pi("port");typeof i<"u"&&$it(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}},tz=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"&&$it(t)}},J0=class XQ extends Error{static NotAvailable(e,t){return new XQ(e,Xl.NotAvailable,t)}static TemporarilyNotAvailable(e){return new XQ(e,Xl.TemporarilyNotAvailable)}constructor(e,t=Xl.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,XQ.prototype)}};var A_;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(A_||(A_={}));var FT;(function(s){s[s.Replace=1]="Replace",s[s.Append=2]="Append",s[s.Prepend=3]="Prepend"})(FT||(FT={}));let HA=C0=class{static isTextEdit(e){return e instanceof C0?!0:e?Jn.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new C0(e,t)}static insert(e,t){return C0.replace(new Jn(e,e),t)}static delete(e){return C0.replace(e,"")}static setEndOfLine(e){const t=new C0(new Jn(new bs(0,0),new bs(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!Jn.isRange(e))throw Pi("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Pi("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Pi("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};HA=C0=D([ki],HA);let E9=EE=class{static isNotebookCellEdit(e){return e instanceof EE?!0:e?wy.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new EE(e,t)}static insertCells(e,t){return new EE(new wy(e,e),t)}static deleteCells(e){return new EE(e,[])}static updateCellMetadata(e,t){const i=new EE(new wy(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new EE(new wy(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};E9=EE=D([ki],E9);let Tce=class ZQ{static isSnippetTextEdit(e){return e instanceof ZQ?!0:e?Jn.isRange(e.range)&&aI.isSnippetString(e.snippet):!1}static replace(e,t){return new ZQ(e,t)}static insert(e,t){return ZQ.replace(new Jn(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}};var vc;(function(s){s[s.File=1]="File",s[s.Text=2]="Text",s[s.Cell=3]="Cell",s[s.CellReplace=5]="CellReplace",s[s.Snippet=6]="Snippet"})(vc||(vc={}));let rI=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,n){this._edits.push({_type:vc.File,from:e,to:t,options:i,metadata:n})}createFile(e,t,i){this._edits.push({_type:vc.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:vc.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:vc.Cell,metadata:i,uri:e,edit:{editType:oI.DocumentMetadata,metadata:t},notebookMetadata:t})}replaceNotebookCells(e,t,i,n){const o=t.start,r=t.end;(o!==r||i.length>0)&&this._edits.push({_type:vc.CellReplace,uri:e,index:o,count:r-o,cells:i,metadata:n})}replaceNotebookCellMetadata(e,t,i,n){this._edits.push({_type:vc.Cell,metadata:n,uri:e,edit:{editType:oI.Metadata,index:t,metadata:i}})}replace(e,t,i,n){this._edits.push({_type:vc.Text,uri:e,edit:new HA(t,i),metadata:n})}insert(e,t,i,n){this.replace(e,new Jn(t,t),i,n)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===vc.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let n,o;Array.isArray(i)?(n=i[0],o=i[1]):n=i,E9.isNotebookCellEdit(n)?n.newCellMetadata?this.replaceNotebookCellMetadata(e,n.range.start,n.newCellMetadata,o):n.newNotebookMetadata?this.replaceNotebookMetadata(e,n.newNotebookMetadata,o):this.replaceNotebookCells(e,n.range,n.newCells,o):Tce.isSnippetTextEdit(n)?this._edits.push({_type:vc.Snippet,uri:e,range:n.range,edit:n.snippet,metadata:o}):this._edits.push({_type:vc.Text,uri:e,edit:n,metadata:o})}else{for(let i=0;in.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 S0;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}};aI=S0=D([ki],aI);var Px;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(Px||(Px={}));var Fd;(function(s){s[s.Hint=3]="Hint",s[s.Information=2]="Information",s[s.Warning=1]="Warning",s[s.Error=0]="Error"})(Fd||(Fd={}));let vp=OAe=class{static isLocation(e){return e instanceof OAe?!0:e?Jn.isRange(e.range)&&N.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(Jn.isRange(t))this.range=Jn.of(t);else if(bs.isPosition(t))this.range=new Jn(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};vp=OAe=D([ki],vp);let QW=class{static is(e){return e?typeof e.message=="string"&&e.location&&Jn.isRange(e.location.range)&&N.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()}};QW=D([ki],QW);let x9=class{constructor(e,t,i=Fd.Error){if(!Jn.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:Fd[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)&&is(e.tags,t.tags)&&is(e.relatedInformation,t.relatedInformation,QW.isEqual)}};x9=D([ki],x9);let D9=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}};D9=D([ki],D9);let k9=class extends D9{constructor(e,t,i,n){super(e,t),this.canIncreaseVerbosity=i,this.canDecreaseVerbosity=n}};k9=D([ki],k9);var Mee;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(Mee||(Mee={}));var jW;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(jW||(jW={}));let I9=class{constructor(e,t=jW.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:jW[this.kind]}}};I9=D([ki],I9);let T9=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};T9=D([ki],T9);var _r;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(_r||(_r={}));var YW;(function(s){s[s.Deprecated=1]="Deprecated"})(YW||(YW={}));let JW=BAe=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,n,o){this.name=e,this.kind=t,this.containerName=o,typeof i=="string"&&(this.containerName=i),n instanceof vp?this.location=n:i instanceof Jn&&(this.location=new vp(n,i)),BAe.validate(this)}toJSON(){return{name:this.name,kind:_r[this.kind],location:this.location,containerName:this.containerName}}};JW=BAe=D([ki],JW);let XW=JQ=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(JQ.validate)}constructor(e,t,i,n,o){this.name=e,this.detail=t,this.kind=i,this.range=n,this.selectionRange=o,this.children=[],JQ.validate(this)}};XW=JQ=D([ki],XW);var ZW;(function(s){s[s.Invoke=1]="Invoke",s[s.Automatic=2]="Automatic"})(ZW||(ZW={}));let L9=class{constructor(e,t){this.title=e,this.kind=t}};L9=D([ki],L9);var PR;let Sa=(PR=class{constructor(e){this.value=e}append(e){return new TV(this.value?this.value+TV.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+TV.sep)}},TV=PR,PR.sep=".",PR);Sa=TV=D([ki],Sa);Sa.Empty=new Sa("");Sa.QuickFix=Sa.Empty.append("quickfix");Sa.Refactor=Sa.Empty.append("refactor");Sa.RefactorExtract=Sa.Refactor.append("extract");Sa.RefactorInline=Sa.Refactor.append("inline");Sa.RefactorMove=Sa.Refactor.append("move");Sa.RefactorRewrite=Sa.Refactor.append("rewrite");Sa.Source=Sa.Empty.append("source");Sa.SourceOrganizeImports=Sa.Source.append("organizeImports");Sa.SourceFixAll=Sa.Source.append("fixAll");Sa.Notebook=Sa.Empty.append("notebook");let eH=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")}};eH=D([ki],eH);let Lce=class{constructor(e,t,i,n,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=o,this.selectionRange=r}},INe=class{constructor(e,t){this.fromRanges=t,this.from=e}},TNe=class{constructor(e,t){this.fromRanges=t,this.to=e}};var OT;(function(s){s[s.Information=0]="Information",s[s.Warning=1]="Warning",s[s.Error=2]="Error"})(OT||(OT={}));let R9=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};R9=D([ki],R9);var Oh,a6e;let af=WAe=(a6e=class{constructor(e,t=!1){Wt(this,Oh);Ct(this,Oh,new Mt(e,{supportThemeIcons:t}))}static isMarkdownString(e){return e instanceof WAe?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}get value(){return Ce(this,Oh).value}set value(e){Ce(this,Oh).value=e}get isTrusted(){return Ce(this,Oh).isTrusted}set isTrusted(e){Ce(this,Oh).isTrusted=e}get supportThemeIcons(){return Ce(this,Oh).supportThemeIcons}set supportThemeIcons(e){Ce(this,Oh).supportThemeIcons=e}get supportHtml(){return Ce(this,Oh).supportHtml}set supportHtml(e){Ce(this,Oh).supportHtml=e}get baseUri(){return Ce(this,Oh).baseUri}set baseUri(e){Ce(this,Oh).baseUri=e}appendText(e){return Ce(this,Oh).appendText(e),this}appendMarkdown(e){return Ce(this,Oh).appendMarkdown(e),this}appendCodeblock(e,t){return Ce(this,Oh).appendCodeblock(t??"",e),this}},Oh=new WeakMap,a6e);af=WAe=D([ki],af);let Nee=class{constructor(e,t){this.label=e,this.documentation=t}};Nee=D([ki],Nee);let Pee=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};Pee=D([ki],Pee);let Fee=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};Fee=D([ki],Fee);var Oee;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(Oee||(Oee={}));var Bee;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Bee||(Bee={}));let M9=class{constructor(e){this.value=e}};M9=D([ki],M9);let N9=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};N9=D([ki],N9);var BT;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(BT||(BT={}));var Zi;(function(s){s[s.Text=0]="Text",s[s.Method=1]="Method",s[s.Function=2]="Function",s[s.Constructor=3]="Constructor",s[s.Field=4]="Field",s[s.Variable=5]="Variable",s[s.Class=6]="Class",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Unit=10]="Unit",s[s.Value=11]="Value",s[s.Enum=12]="Enum",s[s.Keyword=13]="Keyword",s[s.Snippet=14]="Snippet",s[s.Color=15]="Color",s[s.File=16]="File",s[s.Reference=17]="Reference",s[s.Folder=18]="Folder",s[s.EnumMember=19]="EnumMember",s[s.Constant=20]="Constant",s[s.Struct=21]="Struct",s[s.Event=22]="Event",s[s.Operator=23]="Operator",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue"})(Zi||(Zi={}));var tH;(function(s){s[s.Deprecated=1]="Deprecated"})(tH||(tH={}));let P9=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&Zi[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};P9=D([ki],P9);let JM=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};JM=D([ki],JM);let Wee=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};Wee=D([ki],Wee);let Hee=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};Hee=D([ki],Hee);var Fx;(function(s){s[s.Unknown=0]="Unknown",s[s.Word=1]="Word",s[s.Line=2]="Line",s[s.Suggest=3]="Suggest"})(Fx||(Fx={}));var iH;(function(s){s[s.Active=-1]="Active",s[s.Beside=-2]="Beside",s[s.One=1]="One",s[s.Two=2]="Two",s[s.Three=3]="Three",s[s.Four=4]="Four",s[s.Five=5]="Five",s[s.Six=6]="Six",s[s.Seven=7]="Seven",s[s.Eight=8]="Eight",s[s.Nine=9]="Nine"})(iH||(iH={}));var IS;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(IS||(IS={}));function M9t(s,e){return`${Sn.toKey(s)}.${e}`}var i_;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval"})(i_||(i_={}));var WT;(function(s){s[s.Manual=1]="Manual",s[s.AfterDelay=2]="AfterDelay",s[s.FocusOut=3]="FocusOut"})(WT||(WT={}));var F9;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(F9||(F9={}));var XM;(function(s){s[s.Keyboard=1]="Keyboard",s[s.Mouse=2]="Mouse",s[s.Command=3]="Command"})(XM||(XM={}));var nH;(function(s){s[s.Undo=1]="Undo",s[s.Redo=2]="Redo"})(nH||(nH={}));var Ox;(function(s){s[s.OpenOpen=0]="OpenOpen",s[s.ClosedClosed=1]="ClosedClosed",s[s.OpenClosed=2]="OpenClosed",s[s.ClosedOpen=3]="ClosedOpen"})(Ox||(Ox={}));(function(s){function e(t){switch(t){case"keyboard":return s.Keyboard;case"mouse":return s.Mouse;case"api":return s.Command}}s.fromValue=e})(XM||(XM={}));var ZM;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(ZM||(ZM={}));(function(s){function e(t){switch(t){case s.Other:return"other";case s.Comment:return"comment";case s.String:return"string";case s.RegEx:return"regex"}return"other"}s.toString=e})(ZM||(ZM={}));let O9=class{constructor(e,t){if(t&&!N.isUri(t))throw Pi("target");if(!Jn.isRange(e)||e.isEmpty)throw Pi("range");this.range=e,this.target=t}};O9=D([ki],O9);let eN=class{constructor(e,t,i,n){this.red=e,this.green=t,this.blue=i,this.alpha=n}};eN=D([ki],eN);let B9=class{constructor(e,t){if(t&&!(t instanceof eN))throw Pi("color");if(!Jn.isRange(e)||e.isEmpty)throw Pi("range");this.range=e,this.color=t}};B9=D([ki],B9);let W9=class{constructor(e){if(!e||typeof e!="string")throw Pi("label");this.label=e}};W9=D([ki],W9);var Uee;(function(s){s[s.Error=0]="Error",s[s.Warning=1]="Warning",s[s.Information=2]="Information"})(Uee||(Uee={}));var Vee;(function(s){s[s.Unknown=0]="Unknown",s[s.Shutdown=1]="Shutdown",s[s.Process=2]="Process",s[s.User=3]="User",s[s.Extension=4]="Extension"})(Vee||(Vee={}));var gD;(function(s){s[s.Low=0]="Low",s[s.Medium=1]="Medium",s[s.High=2]="High"})(gD||(gD={}));let Kit=class{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Pi("startIndex");if(typeof t!="number"||t<1)throw Pi("length");if(i!==void 0&&typeof i!="string")throw Pi("tooltip")}},qit=class{constructor(e){this.uri=e}};class Qit{constructor(e){this.terminalCommand=e}}var zee;(function(s){s[s.Panel=1]="Panel",s[s.Editor=2]="Editor"})(zee||(zee={}));let jit=class{constructor(e){if(this.options=e,typeof e!="object")throw Pi("options")}};var $ee;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})($ee||($ee={}));var Gee;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(Gee||(Gee={}));var ay;let sH=(ay=class{static from(e){switch(e){case"clean":return tw.Clean;case"build":return tw.Build;case"rebuild":return tw.Rebuild;case"test":return tw.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Pi("name");this._id=e}get id(){return this._id}},tw=ay,ay.Clean=new tw("clean","Clean"),ay.Build=new tw("build","Build"),ay.Rebuild=new tw("rebuild","Rebuild"),ay.Test=new tw("test","Test"),ay);sH=tw=D([ki],sH);function Yit(s){let e="";for(let t=0;t0)for(const t of this._args)e.push(t);return Yit(e)}};tN=D([ki],tN);let cI=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Pi("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Pi("command");this._command=e,this._args=t,this._options=i}else{if(typeof e!="string")throw Pi("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Pi("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Pi("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 Yit(e)}};cI=D([ki],cI);var Kee;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(Kee||(Kee={}));var lI;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace"})(lI||(lI={}));let Rce=class{constructor(e){this._callback=e}computeId(){return"customExecution"+ar()}set callback(e){this._callback=e}get callback(){return this._callback}};var cy;let H9=(cy=class{constructor(e,t,i,n,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=n,a=o,this.__deprecated=!0):t===lI.Global||t===lI.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=n,this.execution=o,a=r):(this.target=t,this._name=this.name=i,this._source=this.source=n,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 tN?this._definition={type:iw.ProcessType,id:this._execution.computeId()}:this._execution instanceof cI?this._definition={type:iw.ShellType,id:this._execution.computeId()}:this._execution instanceof Rce?this._definition={type:iw.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:iw.EmptyType,id:ar()}}get definition(){return this._definition}set definition(e){if(e==null)throw Pi("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 Pi("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;(iw.EmptyType===t||iw.ProcessType===t||iw.ShellType===t||iw.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 Pi("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}},iw=cy,cy.ExtensionCallbackType="customExecution",cy.ProcessType="process",cy.ShellType="shell",cy.EmptyType="$empty",cy);H9=iw=D([ki],H9);var fD;(function(s){s[s.SourceControl=1]="SourceControl",s[s.Window=10]="Window",s[s.Notification=15]="Notification"})(fD||(fD={}));var VAe;(function(s){function e(t){const i=t;return lc(i.value)?i.tooltip&&!Lt(i.tooltip)?(console.log("INVALID view badge, invalid tooltip",i.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",i.value),!1)}s.isViewBadge=e})(VAe||(VAe={}));let U9=HAe=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const n=lc(i.checkboxState)?i.checkboxState:kn(i.checkboxState)&&lc(i.checkboxState.state)?i.checkboxState.state:void 0,o=!lc(i.checkboxState)&&kn(i.checkboxState)?i.checkboxState.tooltip:void 0;if(n===void 0||n!==ab.Checked&&n!==ab.Unchecked||o!==void 0&&!Lt(o))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof HAe)return!0;if(i.label!==void 0&&!Lt(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!Lt(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!Lt(i.iconPath)&&!N.isUri(i.iconPath)&&(!i.iconPath||!Lt(i.iconPath.id))){const n=i.iconPath;if(!n||!Lt(n.light)&&!N.isUri(n.light)&&!Lt(n.dark)&&!N.isUri(n.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!Lt(i.description)&&typeof i.description!="boolean"?(console.log("INVALID tree item, invalid description",i.description),!1):i.resourceUri!==void 0&&!N.isUri(i.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",i.resourceUri),!1):i.tooltip!==void 0&&!Lt(i.tooltip)&&!(i.tooltip instanceof af)?(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.collapsibleStatepD.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!Lt(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=pD.None){this.collapsibleState=t,N.isUri(e)?this.resourceUri=e:this.label=e}};U9=HAe=D([ki],U9);var pD;(function(s){s[s.None=0]="None",s[s.Collapsed=1]="Collapsed",s[s.Expanded=2]="Expanded"})(pD||(pD={}));var ab;(function(s){s[s.Unchecked=0]="Unchecked",s[s.Checked=1]="Checked"})(ab||(ab={}));let V9=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};V9=D([ki],V9);class qee extends V9{}var d7;class N9t extends qee{constructor(t){super("");Wt(this,d7);Ct(this,d7,t)}asFile(){return Ce(this,d7)}}d7=new WeakMap;class P9t{constructor(e,t,i,n){this.name=e,this.uri=t,this._itemId=i,this._getData=n}data(){return this._getData()}}var XC,z1,LV,c6e;let oH=(c6e=class{constructor(e){Wt(this,z1);Wt(this,XC,new Map);for(const[t,i]of e??[]){const n=Ce(this,XC).get(QU(this,z1,LV).call(this,t));n?n.push(i):Ce(this,XC).set(QU(this,z1,LV).call(this,t),[i])}}get(e){return Ce(this,XC).get(QU(this,z1,LV).call(this,e))?.[0]}set(e,t){Ce(this,XC).set(QU(this,z1,LV).call(this,e),[t])}forEach(e,t){for(const[i,n]of Ce(this,XC))for(const o of n)e.call(t,o,i,this)}*[Symbol.iterator](){for(const[e,t]of Ce(this,XC))for(const i of t)yield[e,i]}},XC=new WeakMap,z1=new WeakSet,LV=function(e){return e.toLowerCase()},c6e);oH=D([ki],oH);let Qee=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};Qee=D([ki],Qee);var jee;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(jee||(jee={}));var jS;let z9=(jS=class{constructor(e){this.value=e}append(...e){return new jS((this.value?[this.value,...e]:e).join(jS.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+jS.sep)}},jS.sep=".",jS);z9.Empty=new z9("");let Jit=class{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}},hu=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}};hu=D([ki],hu);hu.File=new hu("file");hu.Folder=new hu("folder");let rH=class{constructor(e){this.id=e}};rH=D([ki],rH);var HT;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.WorkspaceFolder=3]="WorkspaceFolder"})(HT||(HT={}));let UT=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=N.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||!N.isUri(e)&&!N.isUri(e.uri)))throw Pi("base");if(typeof t!="string")throw Pi("pattern");typeof e=="string"?this.baseUri=N.file(e):N.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};UT=D([ki],UT);const Xit=new WeakMap;function F9t(s,e){Xit.set(s,e)}let iN=class{constructor(e,t,i,n,o){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof i=="string"&&(this.hitCondition=i),typeof n=="string"&&(this.logMessage=n),typeof o=="string"&&(this.mode=o)}get id(){return this._id||(this._id=Xit.get(this)??ar()),this._id}};iN=D([ki],iN);let Bx=class extends iN{constructor(e,t,i,n,o,r){if(super(t,i,n,o,r),e===null)throw Pi("location");this.location=e}};Bx=D([ki],Bx);let Wx=class extends iN{constructor(e,t,i,n,o,r){super(t,i,n,o,r),this.functionName=e}};Wx=D([ki],Wx);let Yee=class extends iN{constructor(e,t,i,n,o,r,a,c){if(super(n,o,r,a,c),!t)throw Pi("dataId");this.label=e,this.dataId=t,this.canPersist=i}};Yee=D([ki],Yee);let $9=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};$9=D([ki],$9);let aH=class{constructor(e,t){this.port=e,this.host=t}};aH=D([ki],aH);let G9=class{constructor(e){this.path=e}};G9=D([ki],G9);let K9=class{constructor(e){this.implementation=e}};K9=D([ki],K9);let LNe=class{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}},RNe=class{constructor(e,t){this.session=e,this.threadId=t}},q9=class{constructor(e,t){this.range=e,this.expression=t}};q9=D([ki],q9);var cH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(cH||(cH={}));let Q9=class{constructor(e,t){this.range=e,this.text=t}};Q9=D([ki],Q9);let j9=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};j9=D([ki],j9);let Y9=class{constructor(e,t){this.range=e,this.expression=t}};Y9=D([ki],Y9);let zAe=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};zAe=D([ki],zAe);var Jee;(function(s){s[s.AIGenerated=1]="AIGenerated"})(Jee||(Jee={}));var lH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(lH||(lH={}));let Zit=class{constructor(e,t){this.newSymbolName=e,this.tags=t}};var VT;(function(s){s[s.Changed=1]="Changed",s[s.Created=2]="Created",s[s.Deleted=3]="Deleted"})(VT||(VT={}));let Yc=vg=class extends Error{static FileExists(e){return new vg(e,ot.FileExists,vg.FileExists)}static FileNotFound(e){return new vg(e,ot.FileNotFound,vg.FileNotFound)}static FileNotADirectory(e){return new vg(e,ot.FileNotADirectory,vg.FileNotADirectory)}static FileIsADirectory(e){return new vg(e,ot.FileIsADirectory,vg.FileIsADirectory)}static NoPermissions(e){return new vg(e,ot.NoPermissions,vg.NoPermissions)}static Unavailable(e){return new vg(e,ot.Unavailable,vg.Unavailable)}constructor(e,t=ot.Unknown,i){super(N.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",YQe(this,t),Object.setPrototypeOf(this,vg.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};Yc=vg=D([ki],Yc);let Xee=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};Xee=D([ki],Xee);var Bw;(function(s){s[s.Comment=1]="Comment",s[s.Imports=2]="Imports",s[s.Region=3]="Region"})(Bw||(Bw={}));var dH;(function(s){s[s.Collapsed=0]="Collapsed",s[s.Expanded=1]="Expanded"})(dH||(dH={}));var Zee;(function(s){s[s.Editing=0]="Editing",s[s.Preview=1]="Preview"})(Zee||(Zee={}));var ete;(function(s){s[s.Published=0]="Published",s[s.Draft=1]="Draft"})(ete||(ete={}));var hH;(function(s){s[s.Unresolved=0]="Unresolved",s[s.Resolved=1]="Resolved"})(hH||(hH={}));var uH;(function(s){s[s.Current=0]="Current",s[s.Outdated=1]="Outdated"})(uH||(uH={}));var gH;(function(s){s[s.Reply=1]="Reply",s[s.Comment=2]="Comment"})(gH||(gH={}));let tte=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function O9t(s){return typeof s>"u"||m6e(s)}let ent=class tnt{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,n,o);if(Jn.isRange(e)&&typeof t=="string"&&O9t(i))return this._push(e,t,i);throw Pi()}_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 n=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(n,o,r,a,c)}_pushEncoded(e,t,i,n,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++]=n,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 n=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&&!hu.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}},nte=class{constructor(e){this.kind=e}};nte=D([ki],nte);var pS;(function(s){s[s.Light=1]="Light",s[s.Dark=2]="Dark",s[s.HighContrast=3]="HighContrast",s[s.HighContrastLight=4]="HighContrastLight"})(pS||(pS={}));let wy=class $Ae{static isNotebookRange(e){return e instanceof $Ae?!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 Pi("start must be positive");if(t<0)throw Pi("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 $Ae(t,i)}},iG=class GAe{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=>GAe.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,n,o,r,a){this.kind=e,this.value=t,this.languageId=i,this.mime=n,this.outputs=o??[],this.metadata=r,this.executionSummary=a,GAe.validate(this)}},NNe=class{constructor(e){this.cells=e}};var Pf,Woe;let PNe=(Pf=class{static isNotebookCellOutputItem(e){return e instanceof Pf?!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 Pf.json(t,"application/vnd.code.notebook.error")}static stdout(e){return Pf.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return Pf.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new Pf(e,t)}static text(e,t=Us.text){const i=Ce(Pf,Woe).encode(String(e));return new Pf(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return Pf.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=cKe(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},Woe=new WeakMap,Wt(Pf,Woe,new TextEncoder),Pf),Z9=class KAe{static isNotebookCellOutput(e){return e instanceof KAe?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){const i=new Set,n=new Set;for(let o=0;o!n.has(r))}constructor(e,t,i){this.items=KAe.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=ar(),this.metadata=t??i)}};var Hx;(function(s){s[s.Markup=1]="Markup",s[s.Code=2]="Code"})(Hx||(Hx={}));var sN;(function(s){s[s.Idle=1]="Idle",s[s.Pending=2]="Pending",s[s.Executing=3]="Executing"})(sN||(sN={}));var e$;(function(s){s[s.Left=1]="Left",s[s.Right=2]="Right"})(e$||(e$={}));var t$;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(t$||(t$={}));let nnt=class{constructor(e,t){this.text=e,this.alignment=t}};var ste;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred"})(ste||(ste={}));var i$;(function(s){s[s.Default=1]="Default",s[s.Preferred=2]="Preferred",s[s.Hidden=-1]="Hidden"})(i$||(i$={}));let FNe=class{constructor(e,t=[]){this.uri=e,this.provides=O_(t)}},snt=class{constructor(e){this.label=e}};var mH;(function(s){s[s.Named=1]="Named",s[s.Indexed=2]="Indexed"})(mH||(mH={}));let ote=class{constructor(e,t){this.label=e,this.timestamp=t}};ote=D([ki],ote);var $T;(function(s){s[s.Production=1]="Production",s[s.Development=2]="Development",s[s.Test=3]="Test"})($T||($T={}));var n$;(function(s){s[s.Node=1]="Node",s[s.Webworker=2]="Webworker"})(n$||(n$={}));var TS;(function(s){s[s.Other=0]="Other",s[s.Comment=1]="Comment",s[s.String=2]="String",s[s.RegEx=3]="RegEx"})(TS||(TS={}));let ont=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},rnt=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}};var rte;(function(s){s[s.Queued=1]="Queued",s[s.Running=2]="Running",s[s.Passed=3]="Passed",s[s.Failed=4]="Failed",s[s.Skipped=5]="Skipped",s[s.Errored=6]="Errored"})(rte||(rte={}));var GT;(function(s){s[s.Run=1]="Run",s[s.Debug=2]="Debug",s[s.Coverage=3]="Coverage"})(GT||(GT={}));let s$=class{constructor(e=void 0,t=void 0,i=void 0,n=!1,o=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=n,this.preserveFocus=o}};s$=D([ki],s$);let oN=UAe=class{static diff(e,t,i){const n=new UAe(e);return n.expectedOutput=t,n.actualOutput=i,n}constructor(e){this.message=e}};oN=UAe=D([ki],oN);let _H=class{constructor(e){this.id=e}};_H=D([ki],_H);let ant=class{constructor(e,t,i){this.label=e,this.file=t,this.position=i}},nz=class{constructor(e,t){this.covered=e,this.total=t,ej(this)}};function ej(s){if(s){if(s.covered>s.total)throw new Error(`The total number of covered items (${s.covered}) cannot be greater than the total (${s.total})`);if(s.total<0)throw new Error(`The number of covered items (${s.total}) cannot be negative`)}}let rN=class cnt{static fromDetails(e,t){const i=new nz(0,0),n=new nz(0,0),o=new nz(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)n.total+=1,n.covered+=c.executed?1:0}else o.total+=1,o.covered+=a.executed?1:0;const r=new cnt(e,i,n.total>0?n:void 0,o.total>0?o:void 0);return r.detailedCoverage=t,r}constructor(e,t,i,n,o=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=n,this.fromTests=o}},lnt=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}},dnt=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}},hnt=class{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 ate;(function(s){s[s.None=0]="None",s[s.Option=1]="Option",s[s.Default=2]="Default",s[s.Preferred=3]="Preferred"})(ate||(ate={}));var qAe;(function(s){s[s.Untrusted=0]="Untrusted",s[s.Trusted=1]="Trusted",s[s.Unspecified=2]="Unspecified"})(qAe||(qAe={}));var cte;(function(s){s[s.Notify=1]="Notify",s[s.OpenBrowser=2]="OpenBrowser",s[s.OpenPreview=3]="OpenPreview",s[s.Silent=4]="Silent",s[s.Ignore=5]="Ignore",s[s.OpenBrowserOnce=6]="OpenBrowserOnce"})(cte||(cte={}));let Mce=class{constructor(e,t,i,n,o,r){this.kind=e,this.name=t,this.detail=i,this.uri=n,this.range=o,this.selectionRange=r}};class Nce{constructor(e){this.uri=e}}class o${constructor(e,t){this.original=e,this.modified=t}}class ONe{constructor(e,t,i,n){this.base=e,this.input1=t,this.input2=i,this.result=n}}class Pce{constructor(e,t){this.uri=e,this.viewType=t}}class BNe{constructor(e){this.viewType=e}}class Fce{constructor(e,t){this.uri=e,this.notebookType=t}}class Oce{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class WNe{constructor(){}}class HNe{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class UNe{constructor(){}}class VNe{constructor(e){this.textDiffs=e}}var QAe;(function(s){s[s.Down=0]="Down",s[s.Up=1]="Up"})(QAe||(QAe={}));var lte;(function(s){s[s.Action=1]="Action",s[s.Toolbar=2]="Toolbar"})(lte||(lte={}));var dte;(function(s){s[s.Short=1]="Short",s[s.Medium=2]="Medium",s[s.Full=3]="Full"})(dte||(dte={}));let unt=class{constructor(e,t,i){this.id=e,this.label=t,this.values=i}};var jAe;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful",s[s.Undone=2]="Undone",s[s.Accepted=3]="Accepted",s[s.Bug=4]="Bug"})(jAe||(jAe={}));var vH;(function(s){s[s.Unhelpful=0]="Unhelpful",s[s.Helpful=1]="Helpful"})(vH||(vH={}));let nG=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 af(e):e}},bH=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 af(e):e,this.vulnerabilities=t}},wH=class{constructor(e,t){this.participant=e,this.command=t}},r$=class{constructor(e,t,i,n){this.title=e,this.message=t,this.data=i,this.buttons=n}},sG=class{constructor(e,t){this.value=e,this.baseUri=t}},oG=class{constructor(e,t){this.value=e,this.title=t}},yH=class{constructor(e){this.value=e}},zNe=class{constructor(e,t){this.value=e,this.task=t}},CH=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 af(e):e}},rG=class{constructor(e){this.value=e}},Eb=class{constructor(e,t,i){this.value=e,this.iconPath=t,this.options=i}},a$=class{constructor(e,t,i){this.value=e,this.license=t,this.snippet=i}},SH=class{constructor(e,t){this.uri=e,this.edits=Array.isArray(t)?t:[t]}},$Ne=class{constructor(e,t,i,n){this.prompt=e,this.command=t,this.references=i,this.participant=n}},GNe=class{constructor(e,t,i,n){this.response=e,this.result=t,this.participant=i,this.command=n}};var n_;(function(s){s[s.Panel=1]="Panel",s[s.Terminal=2]="Terminal",s[s.Notebook=3]="Notebook",s[s.Editor=4]="Editor"})(n_||(n_={}));var hte;(function(s){s[s.Complete=1]="Complete",s[s.Partial=2]="Partial",s[s.Omitted=3]="Omitted"})(hte||(hte={}));let KNe=class{constructor(e,t,i){this.document=e,this.selection=t,this.wholeRange=i}},qNe=class{constructor(e){this.cell=e}};var zp;(function(s){s[s.User=1]="User",s[s.Assistant=2]="Assistant",s[s.System=3]="System"})(zp||(zp={}));class c${constructor(e,t,i){this.name=e,this.content=t,this.isError=i??!1}}let QNe=class YAe{static User(e,t){const i=new YAe(zp.User,typeof e=="string"?e:"",t);return i.content2=e,i}static Assistant(e,t){return new YAe(zp.Assistant,e,t)}constructor(e,t,i){this.role=e,this.content=t,this.content2=t,this.name=i}};class Bce{constructor(e,t){this.name=e,this.parameters=t}}class AH{constructor(e){this.value=e}}let Tw=class A0 extends Error{static NotFound(e){return new A0(e,A0.NotFound.name)}static NoPermissions(e){return new A0(e,A0.NoPermissions.name)}static Blocked(e){return new A0(e,A0.Blocked.name)}constructor(e,t,i){super(e,{cause:i}),this.name="LanguageModelError",this.code=t??""}};var ute;(function(s){s[s.SymbolInformation=1]="SymbolInformation",s[s.CommandInformation=2]="CommandInformation",s[s.SearchInformation=3]="SearchInformation",s[s.SettingInformation=4]="SettingInformation"})(ute||(ute={}));var gte;(function(s){s[s.Started=1]="Started",s[s.Recognizing=2]="Recognizing",s[s.Recognized=3]="Recognized",s[s.Stopped=4]="Stopped",s[s.Error=5]="Error"})(gte||(gte={}));var fte;(function(s){s[s.Started=1]="Started",s[s.Stopped=2]="Stopped",s[s.Error=3]="Error"})(fte||(fte={}));var pte;(function(s){s[s.Recognized=1]="Recognized",s[s.Stopped=2]="Stopped"})(pte||(pte={}));let gnt=class{constructor(e,t){this.text=e,this.range=t}};var EH;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(EH||(EH={}));var CF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(CF||(CF={}));var ha;(function(s){s[s.UnknownInput=0]="UnknownInput",s[s.TextInput=1]="TextInput",s[s.TextDiffInput=2]="TextDiffInput",s[s.TextMergeInput=3]="TextMergeInput",s[s.NotebookInput=4]="NotebookInput",s[s.NotebookDiffInput=5]="NotebookDiffInput",s[s.CustomEditorInput=6]="CustomEditorInput",s[s.WebviewEditorInput=7]="WebviewEditorInput",s[s.TerminalEditorInput=8]="TerminalEditorInput",s[s.InteractiveEditorInput=9]="InteractiveEditorInput",s[s.ChatEditorInput=10]="ChatEditorInput",s[s.MultiDiffEditorInput=11]="MultiDiffEditorInput"})(ha||(ha={}));var uh;(function(s){s[s.TAB_OPEN=0]="TAB_OPEN",s[s.TAB_CLOSE=1]="TAB_CLOSE",s[s.TAB_UPDATE=2]="TAB_UPDATE",s[s.TAB_MOVE=3]="TAB_MOVE"})(uh||(uh={}));var bc;(function(s){s[s.Int8Array=1]="Int8Array",s[s.Uint8Array=2]="Uint8Array",s[s.Uint8ClampedArray=3]="Uint8ClampedArray",s[s.Int16Array=4]="Int16Array",s[s.Uint16Array=5]="Uint16Array",s[s.Int32Array=6]="Int32Array",s[s.Uint32Array=7]="Uint32Array",s[s.Float32Array=8]="Float32Array",s[s.Float64Array=9]="Float64Array",s[s.BigInt64Array=10]="BigInt64Array",s[s.BigUint64Array=11]="BigUint64Array"})(bc||(bc={}));var SF;(function(s){s[s.Default=0]="Default",s[s.InCenter=1]="InCenter",s[s.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",s[s.AtTop=3]="AtTop"})(SF||(SF={}));var KT;(function(s){s[s.None=0]="None",s[s.Process=1]="Process",s[s.Output=2]="Output",s[s.Hybrid=3]="Hybrid"})(KT||(KT={}));var Li;(function(s){s.label="a",s.kind="b",s.detail="c",s.documentation="d",s.sortText="e",s.filterText="f",s.preselect="g",s.insertText="h",s.insertTextRules="i",s.range="j",s.commitCharacters="k",s.additionalTextEdits="l",s.kindModifier="m",s.commandIdent="n",s.commandId="o",s.commandArguments="p"})(Li||(Li={}));var yy;(function(s){s.defaultRanges="a",s.completions="b",s.isIncomplete="c",s.duration="d"})(yy||(yy={}));const Be={MainThreadAuthentication:je("MainThreadAuthentication"),MainThreadBulkEdits:je("MainThreadBulkEdits"),MainThreadLanguageModels:je("MainThreadLanguageModels"),MainThreadEmbeddings:je("MainThreadEmbeddings"),MainThreadChatAgents2:je("MainThreadChatAgents2"),MainThreadChatVariables:je("MainThreadChatVariables"),MainThreadLanguageModelTools:je("MainThreadChatSkills"),MainThreadClipboard:je("MainThreadClipboard"),MainThreadCommands:je("MainThreadCommands"),MainThreadComments:je("MainThreadComments"),MainThreadConfiguration:je("MainThreadConfiguration"),MainThreadConsole:je("MainThreadConsole"),MainThreadDebugService:je("MainThreadDebugService"),MainThreadDecorations:je("MainThreadDecorations"),MainThreadDiagnostics:je("MainThreadDiagnostics"),MainThreadDialogs:je("MainThreadDiaglogs"),MainThreadDocuments:je("MainThreadDocuments"),MainThreadDocumentContentProviders:je("MainThreadDocumentContentProviders"),MainThreadTextEditors:je("MainThreadTextEditors"),MainThreadEditorInsets:je("MainThreadEditorInsets"),MainThreadEditorTabs:je("MainThreadEditorTabs"),MainThreadErrors:je("MainThreadErrors"),MainThreadTreeViews:je("MainThreadTreeViews"),MainThreadDownloadService:je("MainThreadDownloadService"),MainThreadLanguageFeatures:je("MainThreadLanguageFeatures"),MainThreadLanguages:je("MainThreadLanguages"),MainThreadLogger:je("MainThreadLogger"),MainThreadMessageService:je("MainThreadMessageService"),MainThreadOutputService:je("MainThreadOutputService"),MainThreadProgress:je("MainThreadProgress"),MainThreadQuickDiff:je("MainThreadQuickDiff"),MainThreadQuickOpen:je("MainThreadQuickOpen"),MainThreadStatusBar:je("MainThreadStatusBar"),MainThreadSecretState:je("MainThreadSecretState"),MainThreadStorage:je("MainThreadStorage"),MainThreadSpeech:je("MainThreadSpeechProvider"),MainThreadTelemetry:je("MainThreadTelemetry"),MainThreadTerminalService:je("MainThreadTerminalService"),MainThreadTerminalShellIntegration:je("MainThreadTerminalShellIntegration"),MainThreadWebviews:je("MainThreadWebviews"),MainThreadWebviewPanels:je("MainThreadWebviewPanels"),MainThreadWebviewViews:je("MainThreadWebviewViews"),MainThreadCustomEditors:je("MainThreadCustomEditors"),MainThreadUrls:je("MainThreadUrls"),MainThreadUriOpeners:je("MainThreadUriOpeners"),MainThreadProfileContentHandlers:je("MainThreadProfileContentHandlers"),MainThreadWorkspace:je("MainThreadWorkspace"),MainThreadFileSystem:je("MainThreadFileSystem"),MainThreadFileSystemEventService:je("MainThreadFileSystemEventService"),MainThreadExtensionService:je("MainThreadExtensionService"),MainThreadSCM:je("MainThreadSCM"),MainThreadSearch:je("MainThreadSearch"),MainThreadShare:je("MainThreadShare"),MainThreadTask:je("MainThreadTask"),MainThreadWindow:je("MainThreadWindow"),MainThreadLabelService:je("MainThreadLabelService"),MainThreadNotebook:je("MainThreadNotebook"),MainThreadNotebookDocuments:je("MainThreadNotebookDocumentsShape"),MainThreadNotebookEditors:je("MainThreadNotebookEditorsShape"),MainThreadNotebookKernels:je("MainThreadNotebookKernels"),MainThreadNotebookRenderers:je("MainThreadNotebookRenderers"),MainThreadInteractive:je("MainThreadInteractive"),MainThreadTheming:je("MainThreadTheming"),MainThreadTunnelService:je("MainThreadTunnelService"),MainThreadManagedSockets:je("MainThreadManagedSockets"),MainThreadTimeline:je("MainThreadTimeline"),MainThreadTesting:je("MainThreadTesting"),MainThreadLocalization:je("MainThreadLocalizationShape"),MainThreadAiRelatedInformation:je("MainThreadAiRelatedInformation"),MainThreadAiEmbeddingVector:je("MainThreadAiEmbeddingVector")},Ye={ExtHostCommands:je("ExtHostCommands"),ExtHostConfiguration:je("ExtHostConfiguration"),ExtHostDiagnostics:je("ExtHostDiagnostics"),ExtHostDebugService:je("ExtHostDebugService"),ExtHostDecorations:je("ExtHostDecorations"),ExtHostDocumentsAndEditors:je("ExtHostDocumentsAndEditors"),ExtHostDocuments:je("ExtHostDocuments"),ExtHostDocumentContentProviders:je("ExtHostDocumentContentProviders"),ExtHostDocumentSaveParticipant:je("ExtHostDocumentSaveParticipant"),ExtHostEditors:je("ExtHostEditors"),ExtHostTreeViews:je("ExtHostTreeViews"),ExtHostFileSystem:je("ExtHostFileSystem"),ExtHostFileSystemInfo:je("ExtHostFileSystemInfo"),ExtHostFileSystemEventService:je("ExtHostFileSystemEventService"),ExtHostLanguages:je("ExtHostLanguages"),ExtHostLanguageFeatures:je("ExtHostLanguageFeatures"),ExtHostQuickOpen:je("ExtHostQuickOpen"),ExtHostQuickDiff:je("ExtHostQuickDiff"),ExtHostStatusBar:je("ExtHostStatusBar"),ExtHostShare:je("ExtHostShare"),ExtHostExtensionService:je("ExtHostExtensionService"),ExtHostLogLevelServiceShape:je("ExtHostLogLevelServiceShape"),ExtHostTerminalService:je("ExtHostTerminalService"),ExtHostTerminalShellIntegration:je("ExtHostTerminalShellIntegration"),ExtHostSCM:je("ExtHostSCM"),ExtHostSearch:je("ExtHostSearch"),ExtHostTask:je("ExtHostTask"),ExtHostWorkspace:je("ExtHostWorkspace"),ExtHostWindow:je("ExtHostWindow"),ExtHostWebviews:je("ExtHostWebviews"),ExtHostWebviewPanels:je("ExtHostWebviewPanels"),ExtHostCustomEditors:je("ExtHostCustomEditors"),ExtHostWebviewViews:je("ExtHostWebviewViews"),ExtHostEditorInsets:je("ExtHostEditorInsets"),ExtHostEditorTabs:je("ExtHostEditorTabs"),ExtHostProgress:je("ExtHostProgress"),ExtHostComments:je("ExtHostComments"),ExtHostSecretState:je("ExtHostSecretState"),ExtHostStorage:je("ExtHostStorage"),ExtHostUrls:je("ExtHostUrls"),ExtHostUriOpeners:je("ExtHostUriOpeners"),ExtHostProfileContentHandlers:je("ExtHostProfileContentHandlers"),ExtHostOutputService:je("ExtHostOutputService"),ExtHostLabelService:je("ExtHostLabelService"),ExtHostNotebook:je("ExtHostNotebook"),ExtHostNotebookDocuments:je("ExtHostNotebookDocuments"),ExtHostNotebookEditors:je("ExtHostNotebookEditors"),ExtHostNotebookKernels:je("ExtHostNotebookKernels"),ExtHostNotebookRenderers:je("ExtHostNotebookRenderers"),ExtHostNotebookDocumentSaveParticipant:je("ExtHostNotebookDocumentSaveParticipant"),ExtHostInteractive:je("ExtHostInteractive"),ExtHostChatAgents2:je("ExtHostChatAgents"),ExtHostChatVariables:je("ExtHostChatVariables"),ExtHostLanguageModelTools:je("ExtHostChatSkills"),ExtHostChatProvider:je("ExtHostChatProvider"),ExtHostSpeech:je("ExtHostSpeech"),ExtHostEmbeddings:je("ExtHostEmbeddings"),ExtHostAiRelatedInformation:je("ExtHostAiRelatedInformation"),ExtHostAiEmbeddingVector:je("ExtHostAiEmbeddingVector"),ExtHostTheming:je("ExtHostTheming"),ExtHostTunnelService:je("ExtHostTunnelService"),ExtHostManagedSockets:je("ExtHostManagedSockets"),ExtHostAuthentication:je("ExtHostAuthentication"),ExtHostTimeline:je("ExtHostTimeline"),ExtHostTesting:je("ExtHostTesting"),ExtHostTelemetry:je("ExtHostTelemetry"),ExtHostLocalization:je("ExtHostLocalization")};var mte;(function(s){s[s.Complete=100]="Complete",s[s.Partial=50]="Partial",s[s.None=0]="None"})(mte||(mte={}));let JAe;function fnt(s){JAe=s}function bd(s){return new Proxy({},{get(e,t){if(JAe==null)throw new Error("Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization");return JAe[s][t]}})}const B9t={version:"1.92.2",tasks:bd("tasks"),notebooks:bd("notebooks"),scm:bd("scm"),comments:bd("comments"),authentication:bd("authentication"),tests:bd("tests"),extensions:bd("extensions"),debug:bd("debug"),env:bd("env"),commands:bd("commands"),window:bd("window"),workspace:bd("workspace"),languages:bd("languages"),l10n:bd("l10n"),interactive:bd("interactive"),ai:bd("ai"),chat:bd("chat"),speech:bd("speech"),lm:bd("lm"),Breakpoint:iN,TerminalOutputAnchor:Ree,ChatResultFeedbackKind:vH,ChatVariableLevel:dte,ChatCompletionItem:unt,CallHierarchyIncomingCall:INe,CallHierarchyItem:Lce,CallHierarchyOutgoingCall:TNe,CancellationError:Ma,CancellationTokenSource:ci,CandidatePortSource:KT,CodeAction:L9,CodeActionKind:Sa,CodeActionTriggerKind:ZW,CodeLens:R9,Color:eN,ColorInformation:B9,ColorPresentation:W9,ColorThemeKind:pS,CommentMode:Zee,CommentState:ete,CommentThreadCollapsibleState:dH,CommentThreadState:hH,CommentThreadApplicability:uH,CommentThreadFocus:gH,CompletionItem:P9,CompletionItemKind:Zi,CompletionItemTag:tH,CompletionList:JM,CompletionTriggerKind:BT,ConfigurationTarget:HT,CustomExecution:Rce,DebugAdapterExecutable:$9,DebugAdapterInlineImplementation:K9,DebugAdapterNamedPipeServer:G9,DebugAdapterServer:aH,DebugConfigurationProviderTriggerKind:y9,DebugConsoleMode:J9,DebugVisualization:int,DecorationRangeBehavior:Ox,Diagnostic:x9,DiagnosticRelatedInformation:QW,DiagnosticSeverity:Fd,DiagnosticTag:Px,Disposable:Qs,DocumentHighlight:I9,DocumentHighlightKind:jW,MultiDocumentHighlight:T9,DocumentLink:O9,DocumentSymbol:XW,EndOfLine:A_,EnvironmentVariableMutatorType:FT,EvaluatableExpression:q9,InlineValueText:Q9,InlineValueVariableLookup:j9,InlineValueEvaluatableExpression:Y9,InlineCompletionTriggerKind:cH,EventEmitter:I,ExtensionKind:mD,ExtensionMode:$T,ExternalUriOpenerPriority:ate,FileChangeType:VT,FileDecoration:X9,FileDecoration2:X9,FileSystemError:Yc,FileType:sn,FilePermission:rp,FoldingRange:Xee,FoldingRangeKind:Bw,FunctionBreakpoint:Wx,InlineCompletionItem:Wee,InlineCompletionList:Hee,Hover:D9,VerboseHover:k9,HoverVerbosityAction:Mee,IndentAction:yr,Location:vp,MarkdownString:af,OverviewRulerLane:Dl,ParameterInformation:Nee,PortAutoForwardAction:cte,Position:bs,ProcessExecution:tN,ProgressLocation:fD,QuickInputButtonLocation:ite,QuickInputButtons:fH,Range:Jn,RelativePattern:UT,Selection:oC,SelectionRange:eH,SemanticTokens:nN,SemanticTokensBuilder:ent,SemanticTokensEdit:MNe,SemanticTokensEdits:iz,SemanticTokensLegend:tte,ShellExecution:cI,ShellQuoting:Kee,SignatureHelp:Fee,SignatureHelpTriggerKind:Oee,SignatureInformation:Pee,SnippetString:aI,SourceBreakpoint:Bx,StandardTokenType:TS,StatusBarAlignment:IS,SymbolInformation:JW,SymbolKind:_r,SymbolTag:YW,Task:H9,TaskGroup:sH,TaskPanelKind:Gee,TaskRevealKind:$ee,TaskScope:lI,TerminalLink:Kit,TerminalQuickFixTerminalCommand:Qit,TerminalQuickFixOpener:qit,TerminalLocation:zee,TerminalProfile:jit,TerminalExitReason:Vee,TerminalShellExecutionCommandLineConfidence:gD,TextDocumentSaveReason:WT,TextEdit:HA,SnippetTextEdit:Tce,TextEditorCursorStyle:qr,TextEditorLineNumbersStyle:i_,TextEditorRevealType:F9,TextEditorSelectionChangeKind:XM,SyntaxTokenType:ZM,TextDocumentChangeReason:nH,ThemeColor:rH,ThemeIcon:hu,TreeItem:U9,TreeItemCheckboxState:ab,TreeItemCollapsibleState:pD,TypeHierarchyItem:Mce,UIKind:X_,Uri:N,ViewColumn:iH,WorkspaceEdit:rI,DocumentPasteTriggerKind:jee,DocumentDropEdit:Qee,DocumentDropOrPasteEditKind:z9,DocumentPasteEdit:Jit,InlayHint:N9,InlayHintLabelPart:M9,InlayHintKind:Bee,RemoteAuthorityResolverError:J0,ResolvedAuthority:Git,ManagedResolvedAuthority:tz,SourceControlInputBoxValidationType:Uee,ExtensionRuntime:n$,TimelineItem:ote,NotebookRange:wy,NotebookCellKind:Hx,NotebookCellExecutionState:sN,NotebookCellData:iG,NotebookData:NNe,NotebookRendererScript:FNe,NotebookCellStatusBarAlignment:e$,NotebookEditorRevealType:t$,NotebookCellOutput:Z9,NotebookCellOutputItem:PNe,NotebookCellStatusBarItem:nnt,NotebookControllerAffinity:ste,NotebookControllerAffinity2:i$,NotebookEdit:E9,NotebookKernelSourceAction:snt,NotebookVariablesRequestKind:mH,PortAttributes:rnt,LinkedEditingRanges:ont,TestResultState:rte,TestRunRequest:s$,TestMessage:oN,TestMessage2:oN,TestMessageStackFrame:ant,TestTag:_H,TestRunProfileKind:GT,TextSearchCompleteMessageType:vee,DataTransfer:oH,DataTransferItem:V9,TestCoverageCount:nz,FileCoverage:rN,FileCoverage2:rN,StatementCoverage:lnt,BranchCoverage:dnt,DeclarationCoverage:hnt,LanguageStatusSeverity:OT,QuickPickItemKind:pH,InputBoxValidationSeverity:zT,TabInputText:Nce,TabInputTextDiff:o$,TabInputTextMerge:ONe,TabInputCustom:Pce,TabInputNotebook:Fce,TabInputNotebookDiff:Oce,TabInputWebview:BNe,TabInputTerminal:WNe,TabInputInteractiveWindow:HNe,TabInputChat:UNe,TabInputTextMultiDiff:VNe,TelemetryTrustedValue:Pae,LogLevel:Gn,EditSessionIdentityMatch:mte,ChatCopyKind:lte,DebugStackFrame:LNe,DebugThread:RNe,RelatedInformationType:ute,SpeechToTextStatus:gte,TextToSpeechStatus:fte,PartialAcceptTriggerKind:Fx,KeywordRecognitionStatus:pte,ChatResponseMarkdownPart:nG,ChatResponseFileTreePart:sG,ChatResponseAnchorPart:oG,ChatResponseProgressPart:yH,ChatResponseProgressPart2:zNe,ChatResponseReferencePart:Eb,ChatResponseReferencePart2:Eb,ChatResponseCodeCitationPart:a$,ChatResponseWarningPart:CH,ChatResponseTextEditPart:SH,ChatResponseMarkdownWithVulnerabilitiesPart:bH,ChatResponseCommandButtonPart:rG,ChatResponseDetectedParticipantPart:wH,ChatResponseConfirmationPart:r$,ChatResponseReferencePartStatusKind:hte,ChatRequestTurn:$Ne,ChatResponseTurn:GNe,ChatLocation:n_,ChatRequestEditorData:KNe,ChatRequestNotebookData:qNe,LanguageModelChatMessageRole:zp,LanguageModelChatMessage:QNe,LanguageModelChatMessageFunctionResultPart:c$,LanguageModelChatResponseTextPart:AH,LanguageModelChatResponseFunctionUsePart:Bce,LanguageModelError:Tw,NewSymbolName:Zit,NewSymbolNameTag:Jee,NewSymbolNameTriggerKind:lH,InlineEdit:gnt,InlineEditTriggerKind:EH,ExcludeSettingOptions:Iw,TextSearchContextNew:DNe,TextSearchMatchNew:xNe,TextSearchCompleteMessageTypeNew:bee},{version:W9t,tasks:H9t,notebooks:U9t,scm:V9t,comments:z9t,authentication:$9t,tests:G9t,extensions:K9t,debug:q9t,env:Q9t,commands:j9t,window:Y9t,workspace:J9t,languages:X9t,l10n:Z9t,interactive:e$t,ai:t$t,chat:i$t,speech:n$t,lm:s$t,Breakpoint:o$t,TerminalOutputAnchor:r$t,ChatResultFeedbackKind:a$t,ChatVariableLevel:c$t,ChatCompletionItem:l$t,CallHierarchyIncomingCall:d$t,CallHierarchyItem:h$t,CallHierarchyOutgoingCall:u$t,CancellationError:g$t,CancellationTokenSource:f$t,CandidatePortSource:p$t,CodeAction:m$t,CodeActionKind:_$t,CodeActionTriggerKind:v$t,CodeLens:b$t,Color:w$t,ColorInformation:y$t,ColorPresentation:C$t,ColorThemeKind:S$t,CommentMode:A$t,CommentState:E$t,CommentThreadCollapsibleState:x$t,CommentThreadState:D$t,CommentThreadApplicability:k$t,CommentThreadFocus:I$t,CompletionItem:T$t,CompletionItemKind:L$t,CompletionItemTag:R$t,CompletionList:M$t,CompletionTriggerKind:N$t,ConfigurationTarget:P$t,CustomExecution:F$t,DebugAdapterExecutable:O$t,DebugAdapterInlineImplementation:B$t,DebugAdapterNamedPipeServer:W$t,DebugAdapterServer:H$t,DebugConfigurationProviderTriggerKind:U$t,DebugConsoleMode:V$t,DebugVisualization:z$t,DecorationRangeBehavior:$$t,Diagnostic:G$t,DiagnosticRelatedInformation:K$t,DiagnosticSeverity:q$t,DiagnosticTag:Q$t,Disposable:j$t,DocumentHighlight:Y$t,DocumentHighlightKind:J$t,MultiDocumentHighlight:X$t,DocumentLink:Z$t,DocumentSymbol:e7t,EndOfLine:t7t,EnvironmentVariableMutatorType:i7t,EvaluatableExpression:n7t,InlineValueText:s7t,InlineValueVariableLookup:o7t,InlineValueEvaluatableExpression:r7t,InlineCompletionTriggerKind:a7t,EventEmitter:c7t,ExtensionKind:l7t,ExtensionMode:d7t,ExternalUriOpenerPriority:h7t,FileChangeType:u7t,FileDecoration:g7t,FileDecoration2:f7t,FileSystemError:p7t,FileType:m7t,FilePermission:_7t,FoldingRange:v7t,FoldingRangeKind:b7t,FunctionBreakpoint:w7t,InlineCompletionItem:y7t,InlineCompletionList:C7t,Hover:S7t,VerboseHover:A7t,HoverVerbosityAction:E7t,IndentAction:x7t,Location:D7t,MarkdownString:k7t,OverviewRulerLane:I7t,ParameterInformation:T7t,PortAutoForwardAction:L7t,Position:R7t,ProcessExecution:M7t,ProgressLocation:N7t,QuickInputButtonLocation:P7t,QuickInputButtons:F7t,Range:O7t,RelativePattern:B7t,Selection:W7t,SelectionRange:H7t,SemanticTokens:U7t,SemanticTokensBuilder:V7t,SemanticTokensEdit:z7t,SemanticTokensEdits:$7t,SemanticTokensLegend:G7t,ShellExecution:K7t,ShellQuoting:q7t,SignatureHelp:Q7t,SignatureHelpTriggerKind:j7t,SignatureInformation:Y7t,SnippetString:J7t,SourceBreakpoint:X7t,StandardTokenType:Z7t,StatusBarAlignment:e6t,SymbolInformation:t6t,SymbolKind:i6t,SymbolTag:n6t,Task:s6t,TaskGroup:o6t,TaskPanelKind:r6t,TaskRevealKind:a6t,TaskScope:c6t,TerminalLink:l6t,TerminalQuickFixTerminalCommand:d6t,TerminalQuickFixOpener:h6t,TerminalLocation:u6t,TerminalProfile:g6t,TerminalExitReason:f6t,TerminalShellExecutionCommandLineConfidence:p6t,TextDocumentSaveReason:m6t,TextEdit:_6t,SnippetTextEdit:v6t,TextEditorCursorStyle:b6t,TextEditorLineNumbersStyle:w6t,TextEditorRevealType:y6t,TextEditorSelectionChangeKind:C6t,SyntaxTokenType:S6t,TextDocumentChangeReason:A6t,ThemeColor:E6t,ThemeIcon:x6t,TreeItem:D6t,TreeItemCheckboxState:k6t,TreeItemCollapsibleState:I6t,TypeHierarchyItem:T6t,UIKind:L6t,Uri:R6t,ViewColumn:M6t,WorkspaceEdit:N6t,DocumentPasteTriggerKind:P6t,DocumentDropEdit:F6t,DocumentDropOrPasteEditKind:O6t,DocumentPasteEdit:B6t,InlayHint:W6t,InlayHintLabelPart:H6t,InlayHintKind:U6t,RemoteAuthorityResolverError:V6t,ResolvedAuthority:z6t,ManagedResolvedAuthority:$6t,SourceControlInputBoxValidationType:G6t,ExtensionRuntime:K6t,TimelineItem:q6t,NotebookRange:Q6t,NotebookCellKind:j6t,NotebookCellExecutionState:Y6t,NotebookCellData:J6t,NotebookData:X6t,NotebookRendererScript:Z6t,NotebookCellStatusBarAlignment:eGt,NotebookEditorRevealType:tGt,NotebookCellOutput:iGt,NotebookCellOutputItem:nGt,NotebookCellStatusBarItem:sGt,NotebookControllerAffinity:oGt,NotebookControllerAffinity2:rGt,NotebookEdit:aGt,NotebookKernelSourceAction:cGt,NotebookVariablesRequestKind:lGt,PortAttributes:dGt,LinkedEditingRanges:hGt,TestResultState:uGt,TestRunRequest:gGt,TestMessage:fGt,TestMessage2:pGt,TestMessageStackFrame:mGt,TestTag:_Gt,TestRunProfileKind:vGt,TextSearchCompleteMessageType:bGt,DataTransfer:wGt,DataTransferItem:yGt,TestCoverageCount:CGt,FileCoverage:SGt,FileCoverage2:AGt,StatementCoverage:EGt,BranchCoverage:xGt,DeclarationCoverage:DGt,LanguageStatusSeverity:kGt,QuickPickItemKind:IGt,InputBoxValidationSeverity:TGt,TabInputText:LGt,TabInputTextDiff:RGt,TabInputTextMerge:MGt,TabInputCustom:NGt,TabInputNotebook:PGt,TabInputNotebookDiff:FGt,TabInputWebview:OGt,TabInputTerminal:BGt,TabInputInteractiveWindow:WGt,TabInputChat:HGt,TabInputTextMultiDiff:UGt,TelemetryTrustedValue:VGt,LogLevel:zGt,EditSessionIdentityMatch:$Gt,ChatCopyKind:GGt,DebugStackFrame:KGt,DebugThread:qGt,RelatedInformationType:QGt,SpeechToTextStatus:jGt,TextToSpeechStatus:YGt,PartialAcceptTriggerKind:JGt,KeywordRecognitionStatus:XGt,ChatResponseMarkdownPart:ZGt,ChatResponseFileTreePart:eKt,ChatResponseAnchorPart:tKt,ChatResponseProgressPart:iKt,ChatResponseProgressPart2:nKt,ChatResponseReferencePart:sKt,ChatResponseReferencePart2:oKt,ChatResponseCodeCitationPart:rKt,ChatResponseWarningPart:aKt,ChatResponseTextEditPart:cKt,ChatResponseMarkdownWithVulnerabilitiesPart:lKt,ChatResponseCommandButtonPart:dKt,ChatResponseDetectedParticipantPart:hKt,ChatResponseConfirmationPart:uKt,ChatResponseReferencePartStatusKind:gKt,ChatRequestTurn:fKt,ChatResponseTurn:pKt,ChatLocation:mKt,ChatRequestEditorData:_Kt,ChatRequestNotebookData:vKt,LanguageModelChatMessageRole:bKt,LanguageModelChatMessage:wKt,LanguageModelChatMessageFunctionResultPart:yKt,LanguageModelChatResponseTextPart:CKt,LanguageModelChatResponseFunctionUsePart:SKt,LanguageModelError:AKt,NewSymbolName:EKt,NewSymbolNameTag:xKt,NewSymbolNameTriggerKind:DKt,InlineEdit:kKt,InlineEditTriggerKind:IKt,ExcludeSettingOptions:TKt,TextSearchContextNew:LKt,TextSearchMatchNew:RKt,TextSearchCompleteMessageTypeNew:MKt}=B9t,NKt=Object.freeze(Object.defineProperty({__proto__:null,BranchCoverage:xGt,Breakpoint:o$t,CallHierarchyIncomingCall:d$t,CallHierarchyItem:h$t,CallHierarchyOutgoingCall:u$t,CancellationError:g$t,CancellationTokenSource:f$t,CandidatePortSource:p$t,ChatCompletionItem:l$t,ChatCopyKind:GGt,ChatLocation:mKt,ChatRequestEditorData:_Kt,ChatRequestNotebookData:vKt,ChatRequestTurn:fKt,ChatResponseAnchorPart:tKt,ChatResponseCodeCitationPart:rKt,ChatResponseCommandButtonPart:dKt,ChatResponseConfirmationPart:uKt,ChatResponseDetectedParticipantPart:hKt,ChatResponseFileTreePart:eKt,ChatResponseMarkdownPart:ZGt,ChatResponseMarkdownWithVulnerabilitiesPart:lKt,ChatResponseProgressPart:iKt,ChatResponseProgressPart2:nKt,ChatResponseReferencePart:sKt,ChatResponseReferencePart2:oKt,ChatResponseReferencePartStatusKind:gKt,ChatResponseTextEditPart:cKt,ChatResponseTurn:pKt,ChatResponseWarningPart:aKt,ChatResultFeedbackKind:a$t,ChatVariableLevel:c$t,CodeAction:m$t,CodeActionKind:_$t,CodeActionTriggerKind:v$t,CodeLens:b$t,Color:w$t,ColorInformation:y$t,ColorPresentation:C$t,ColorThemeKind:S$t,CommentMode:A$t,CommentState:E$t,CommentThreadApplicability:k$t,CommentThreadCollapsibleState:x$t,CommentThreadFocus:I$t,CommentThreadState:D$t,CompletionItem:T$t,CompletionItemKind:L$t,CompletionItemTag:R$t,CompletionList:M$t,CompletionTriggerKind:N$t,ConfigurationTarget:P$t,CustomExecution:F$t,DataTransfer:wGt,DataTransferItem:yGt,DebugAdapterExecutable:O$t,DebugAdapterInlineImplementation:B$t,DebugAdapterNamedPipeServer:W$t,DebugAdapterServer:H$t,DebugConfigurationProviderTriggerKind:U$t,DebugConsoleMode:V$t,DebugStackFrame:KGt,DebugThread:qGt,DebugVisualization:z$t,DeclarationCoverage:DGt,DecorationRangeBehavior:$$t,Diagnostic:G$t,DiagnosticRelatedInformation:K$t,DiagnosticSeverity:q$t,DiagnosticTag:Q$t,Disposable:j$t,DocumentDropEdit:F6t,DocumentDropOrPasteEditKind:O6t,DocumentHighlight:Y$t,DocumentHighlightKind:J$t,DocumentLink:Z$t,DocumentPasteEdit:B6t,DocumentPasteTriggerKind:P6t,DocumentSymbol:e7t,EditSessionIdentityMatch:$Gt,EndOfLine:t7t,EnvironmentVariableMutatorType:i7t,EvaluatableExpression:n7t,EventEmitter:c7t,ExcludeSettingOptions:TKt,ExtensionKind:l7t,ExtensionMode:d7t,ExtensionRuntime:K6t,ExternalUriOpenerPriority:h7t,FileChangeType:u7t,FileCoverage:SGt,FileCoverage2:AGt,FileDecoration:g7t,FileDecoration2:f7t,FilePermission:_7t,FileSystemError:p7t,FileType:m7t,FoldingRange:v7t,FoldingRangeKind:b7t,FunctionBreakpoint:w7t,Hover:S7t,HoverVerbosityAction:E7t,IndentAction:x7t,InlayHint:W6t,InlayHintKind:U6t,InlayHintLabelPart:H6t,InlineCompletionItem:y7t,InlineCompletionList:C7t,InlineCompletionTriggerKind:a7t,InlineEdit:kKt,InlineEditTriggerKind:IKt,InlineValueEvaluatableExpression:r7t,InlineValueText:s7t,InlineValueVariableLookup:o7t,InputBoxValidationSeverity:TGt,KeywordRecognitionStatus:XGt,LanguageModelChatMessage:wKt,LanguageModelChatMessageFunctionResultPart:yKt,LanguageModelChatMessageRole:bKt,LanguageModelChatResponseFunctionUsePart:SKt,LanguageModelChatResponseTextPart:CKt,LanguageModelError:AKt,LanguageStatusSeverity:kGt,LinkedEditingRanges:hGt,Location:D7t,LogLevel:zGt,ManagedResolvedAuthority:$6t,MarkdownString:k7t,MultiDocumentHighlight:X$t,NewSymbolName:EKt,NewSymbolNameTag:xKt,NewSymbolNameTriggerKind:DKt,NotebookCellData:J6t,NotebookCellExecutionState:Y6t,NotebookCellKind:j6t,NotebookCellOutput:iGt,NotebookCellOutputItem:nGt,NotebookCellStatusBarAlignment:eGt,NotebookCellStatusBarItem:sGt,NotebookControllerAffinity:oGt,NotebookControllerAffinity2:rGt,NotebookData:X6t,NotebookEdit:aGt,NotebookEditorRevealType:tGt,NotebookKernelSourceAction:cGt,NotebookRange:Q6t,NotebookRendererScript:Z6t,NotebookVariablesRequestKind:lGt,OverviewRulerLane:I7t,ParameterInformation:T7t,PartialAcceptTriggerKind:JGt,PortAttributes:dGt,PortAutoForwardAction:L7t,Position:R7t,ProcessExecution:M7t,ProgressLocation:N7t,QuickInputButtonLocation:P7t,QuickInputButtons:F7t,QuickPickItemKind:IGt,Range:O7t,RelatedInformationType:QGt,RelativePattern:B7t,RemoteAuthorityResolverError:V6t,ResolvedAuthority:z6t,Selection:W7t,SelectionRange:H7t,SemanticTokens:U7t,SemanticTokensBuilder:V7t,SemanticTokensEdit:z7t,SemanticTokensEdits:$7t,SemanticTokensLegend:G7t,ShellExecution:K7t,ShellQuoting:q7t,SignatureHelp:Q7t,SignatureHelpTriggerKind:j7t,SignatureInformation:Y7t,SnippetString:J7t,SnippetTextEdit:v6t,SourceBreakpoint:X7t,SourceControlInputBoxValidationType:G6t,SpeechToTextStatus:jGt,StandardTokenType:Z7t,StatementCoverage:EGt,StatusBarAlignment:e6t,SymbolInformation:t6t,SymbolKind:i6t,SymbolTag:n6t,SyntaxTokenType:S6t,TabInputChat:HGt,TabInputCustom:NGt,TabInputInteractiveWindow:WGt,TabInputNotebook:PGt,TabInputNotebookDiff:FGt,TabInputTerminal:BGt,TabInputText:LGt,TabInputTextDiff:RGt,TabInputTextMerge:MGt,TabInputTextMultiDiff:UGt,TabInputWebview:OGt,Task:s6t,TaskGroup:o6t,TaskPanelKind:r6t,TaskRevealKind:a6t,TaskScope:c6t,TelemetryTrustedValue:VGt,TerminalExitReason:f6t,TerminalLink:l6t,TerminalLocation:u6t,TerminalOutputAnchor:r$t,TerminalProfile:g6t,TerminalQuickFixOpener:h6t,TerminalQuickFixTerminalCommand:d6t,TerminalShellExecutionCommandLineConfidence:p6t,TestCoverageCount:CGt,TestMessage:fGt,TestMessage2:pGt,TestMessageStackFrame:mGt,TestResultState:uGt,TestRunProfileKind:vGt,TestRunRequest:gGt,TestTag:_Gt,TextDocumentChangeReason:A6t,TextDocumentSaveReason:m6t,TextEdit:_6t,TextEditorCursorStyle:b6t,TextEditorLineNumbersStyle:w6t,TextEditorRevealType:y6t,TextEditorSelectionChangeKind:C6t,TextSearchCompleteMessageType:bGt,TextSearchCompleteMessageTypeNew:MKt,TextSearchContextNew:LKt,TextSearchMatchNew:RKt,TextToSpeechStatus:YGt,ThemeColor:E6t,ThemeIcon:x6t,TimelineItem:q6t,TreeItem:D6t,TreeItemCheckboxState:k6t,TreeItemCollapsibleState:I6t,TypeHierarchyItem:T6t,UIKind:L6t,Uri:R6t,VerboseHover:A7t,ViewColumn:M6t,WorkspaceEdit:N6t,ai:t$t,authentication:$9t,chat:i$t,commands:j9t,comments:z9t,debug:q9t,env:Q9t,extensions:K9t,interactive:e$t,l10n:Z9t,languages:X9t,lm:s$t,notebooks:U9t,scm:V9t,setDefaultApi:fnt,speech:n$t,tasks:H9t,tests:G9t,version:W9t,window:Y9t,workspace:J9t},Symbol.toStringTag,{value:"Module"}));RLt(async({toAdd:s,toRemove:e})=>{await dtt(),await Dt.get(fs).deltaExtensions(s,e)},(s,e)=>({toAdd:[...s.toAdd,...e.toAdd],toRemove:[...s.toRemove,...e.toRemove]}),0);const PKt=new Map;function FKt(s){return PKt.get(s)}let W5e=class extends V{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(N.revive(e))).value.toString()}};W5e=D([Gi(Be.MainThreadLocalization),_(1,Jt),_(2,nJe)],W5e);class aG{constructor(e,t,i){this.viewType=e,this.serializer=t,this.extensionData=i}}var RV,FR;let qT=(FR=class extends $Z{static getOrCreate(e,t,i,n,o={}){const r=e.createInstance(RV,t,i,n,o);return i&&r.setPreferredResource(i),r}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super(e,t,c,l,d,f,p),this.viewType=i,this.options=n,this._notebookService=o,this._notebookModelResolverService=r,this._fileDialogService=a,this.editorModelReference=null,this._defaultDirtyState=!1,this._defaultDirtyState=!!n.startDirty,this._sideLoadedListener=o.onDidAddNotebookDocument(m=>{m.viewType===this.viewType&&m.uri.toString()===this.resource.toString()&&this.resolve().catch(vt)}),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(7872,"Notebook '{0}' could not be saved.",this.resource.path))}))}dispose(){this._sideLoadedListener.dispose(),this.editorModelReference?.dispose(),this.editorModelReference=null,super.dispose()}get typeId(){return RV.ID}get editorId(){return this.viewType}get capabilities(){let e=Ei.None;return this.resource.scheme===pe.untitled&&(e|=Ei.Untitled),this.editorModelReference?this.editorModelReference.object.isReadonly()&&(e|=Ei.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly),e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}getDescription(e=Ls.MEDIUM){if(!this.hasCapability(Ei.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(Ei.Untitled)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)}async save(e,t){if(this.editorModelReference)return this.hasCapability(Ei.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 n=this.hasCapability(Ei.Untitled)?await this._suggestName(i,this.labelService.getUriBasenameLabel(this.resource)):this.editorModelReference.object.resource;let o;if(this.editorModelReference.object.hasAssociatedFilePath())o=n;else if(o=await this._fileDialogService.pickFileToSave(n,t?.availableFileSystems),!o)return;if(!i.matches(o)){const r=i.selectors.map(a=>typeof a=="string"?a:fQe(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 n=i&&typeof i=="string"?i:void 0;if(!n&&i){const o=i.include;typeof o=="string"&&(n=o)}if(n){const o=/^\*\.([A-Za-z_-]*)$/.exec(n);if(o&&o.length>1){const r=o[1];if(!t.endsWith(r))return Pt(await this._fileDialogService.defaultFilePath(),t+"."+r)}}return Pt(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=!!(this.capabilities&Ei.Scratchpad),n=await this._notebookModelResolverService.resolve(this.resource,this.viewType,{limits:this.ensureLimits(e),scratchpad:i});if(this.editorModelReference)return n.dispose(),this.editorModelReference.object;if(this.editorModelReference=n,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 hG))throw new Error("CANNOT open file notebook with this provider");const n=await i.serializer.dataToNotebook($e.fromString(JSON.stringify({__webview_backup:this.options._backupId})));this.editorModelReference.object.notebook.applyEdits([{editType:dI.Replace,index:0,count:this.editorModelReference.object.notebook.length,cells:n.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 NV?this.viewType===e.viewType&&ji(this.resource,e.resource):!1}},NV=HR,HR.ID="workbench.input.notebook",HR);JT=NV=D([_(4,tE),_(5,$ae),_(6,ag),_(7,Fs),_(8,Jt),_(9,_d),_(10,fs),_(11,ei),_(12,Ec),_(13,nE)],JT);function QKt(s){return!!s&&typeof s=="object"&&Array.isArray(s.editorInputs)&&s.editorInputs.every(e=>e instanceof JT)}const Snt="jupyter-notebook",jKt="ms-toolsai.jupyter",Ant=new Map;Ant.set(Snt,new Map);Ant.get(Snt)?.set("python",{extensionIds:["ms-python.python",jKt],displayName:"Python + Jupyter"});var X5e;(function(s){s[s.Html=0]="Html",s[s.Extension=1]="Extension"})(X5e||(X5e={}));var Z5e;(function(s){s[s.fullCell=0]="fullCell",s[s.firstLine=1]="firstLine"})(Z5e||(Z5e={}));var eze;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Estimated=1]="Estimated",s[s.FromCache=2]="FromCache",s[s.Measured=3]="Measured"})(eze||(eze={}));var tze;(function(s){s[s.Fold=0]="Fold"})(tze||(tze={}));var ize;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(ize||(ize={}));var nze;(function(s){s[s.Default=1]="Default",s[s.Top=2]="Top",s[s.Center=3]="Center",s[s.CenterIfOutsideViewport=4]="CenterIfOutsideViewport",s[s.NearTopIfOutsideViewport=5]="NearTopIfOutsideViewport",s[s.FirstLineIfOutsideViewport=6]="FirstLineIfOutsideViewport"})(nze||(nze={}));var sze;(function(s){s[s.Default=1]="Default",s[s.Center=2]="Center",s[s.CenterIfOutsideViewport=3]="CenterIfOutsideViewport"})(sze||(sze={}));var oze;(function(s){s[s.Preview=0]="Preview",s[s.Editing=1]="Editing"})(oze||(oze={}));var rze;(function(s){s[s.Container=0]="Container",s[s.Editor=1]="Editor",s[s.Output=2]="Output",s[s.ChatInput=3]="ChatInput"})(rze||(rze={}));var aze;(function(s){s[s.None=0]="None",s[s.Top=1]="Top",s[s.Bottom=2]="Bottom",s[s.Both=3]="Both"})(aze||(aze={}));var cze;(function(s){s[s.None=0]="None",s[s.Start=1]="Start",s[s.End=2]="End",s[s.Both=3]="Both"})(cze||(cze={}));function nB(s){if(!s)return;if(s.getId()===R9t)return s.getControl();const e=s.input;if(e&&QKt(e)||s.getId()===M9t)return s.getControl()?.notebookEditor}var lze;(function(s){s[s.None=0]="None",s[s.Expanded=1]="Expanded",s[s.Collapsed=2]="Collapsed"})(lze||(lze={}));class sB extends gae{static is(e){return e instanceof sB?!0:N.isUri(e.resource)&&kn(e.cellEdit)}static lift(e){return e instanceof sB?e:new sB(e.resource,e.cellEdit,e.notebookVersionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.cellEdit=t,this.notebookVersionId=i}}let dze=class{constructor(e,t,i,n,o,r,a){this._undoRedoGroup=e,this._progress=i,this._token=n,this._edits=o,this._editorService=r,this._notebookModelService=a,this._edits=this._edits.map(c=>{if(c.resource.scheme===Ree.scheme){const l=Ree.parse(c.resource)?.notebook;if(!l)throw new Error(`Invalid notebook URI: ${c.resource}`);return new sB(l,c.cellEdit,c.notebookVersionId,c.metadata)}else return c})}async apply(){const e=[],t=i8(this._edits,(i,n)=>gm(i.resource.toString(),n.resource.toString()));for(const i of t){if(this._token.isCancellationRequested)break;const[n]=i,o=await this._notebookModelService.resolve(n.resource);if(typeof n.notebookVersionId=="number"&&o.object.notebook.versionId!==n.notebookVersionId)throw o.dispose(),new Error(`Notebook '${n.resource}' has changed in the meantime`);const r=i.map(d=>d.cellEdit),a=!o.object.isReadonly(),c=nB(this._editorService.activeEditorPane),l=c?.textModel?.uri.toString()===o.object.notebook.uri.toString()?{kind:WAe.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(n.resource)}return e}};dze=D([_(5,ei),_(6,$ae)],dze);let hze=class{constructor(e,t,i,n){this._bulkEditService=t,this._logService=i,this._uriIdentService=n}dispose(){}$tryApplyWorkspaceEdit(e,t,i){const n=By(e.value,this._uriIdentService);return this._bulkEditService.apply(n,{undoRedoGroupId:t,respectAutoSaveConfig:i}).then(o=>o.isApplied,o=>(this._logService.warn(`IGNORING workspace edit: ${o}`),!1))}};hze=D([Gi(Be.MainThreadBulkEdits),_(1,PN),_(2,Ge),_(3,ks)],hze);function By(s,e,t){if(!s||!s.edits)return s;const i=Mo(s);for(const n of i.edits){if(tA.is(n)&&(n.resource=e.asCanonicalUri(n.resource)),cp.is(n)){if(n.options){const o=n.options?.contents;if(o)if(o.type==="base64")n.options.contents=Promise.resolve(dKe(o.value));else if(t)n.options.contents=t(o.id);else throw new Error("Could not revive data transfer file")}n.newResource=n.newResource&&e.asCanonicalUri(n.newResource),n.oldResource=n.oldResource&&e.asCanonicalUri(n.oldResource)}if(sB.is(n)){n.resource=e.asCanonicalUri(n.resource);const o=n.cellEdit;o.editType===dI.Replace&&(n.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 s}const zce="__";let uze=class{constructor(e,t,i,n,o,r,a){this._chatProviderService=t,this._languageModelStatsService=i,this._logService=n,this._authenticationService=o,this._authenticationAccessService=r,this._extensionService=a,this._store=new Z,this._providerRegistrations=new mo,this._pendingProgress=new Map,this._proxy=e.getProxy(Ye.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 n=new Z;n.add(this._chatProviderService.registerLanguageModelChat(t,{metadata:i,sendChatRequest:async(o,r,a,c)=>{const l=Math.random()*1e6|0,d=new dc,h=new P2;try{this._pendingProgress.set(l,{defer:d,stream:h}),await this._proxy.$startChatRequest(e,l,r,o,a,c)}catch(u){throw this._pendingProgress.delete(l),u}return{result:d.p,stream:h.asyncIterable}},provideTokenCount:(o,r)=>this._proxy.$provideTokenLength(e,o,r)})),i.auth&&n.add(this._registerAuthenticationProvider(i.extension,i.auth)),this._providerRegistrations.set(e,n)}async $reportResponsePart(e,t){const i=this._pendingProgress.get(e);this._logService.trace("[LM] report response PART",!!i,e,t),i&&i.stream.emitOne(t)}async $reportResponseDone(e,t){const i=this._pendingProgress.get(e);if(this._logService.trace("[LM] report response DONE",!!i,e,t),i)if(this._pendingProgress.delete(e),t){const n=l8(t);i.stream.reject(n),i.defer.error(n)}else i.stream.resolve(),i.defer.complete(void 0)}$unregisterProvider(e){this._providerRegistrations.deleteAndDispose(e)}$selectChatModels(e){return this._chatProviderService.selectLanguageModels(e)}$whenLanguageModelChatRequestMade(e,t,i,n){this._languageModelStatsService.update(e,t,i,n)}async $tryStartChatRequest(e,t,i,n,o,r){this._logService.trace("[CHAT] request STARTED",e.value,i);const a=await this._chatProviderService.sendChatRequest(t,e,n,o,r),c=(async()=>{try{for await(const l of a.stream)this._logService.trace("[CHAT] request PART",e.value,i,l),await this._proxy.$acceptResponsePart(i,l);this._logService.trace("[CHAT] request DONE",e.value,i)}catch(l){this._logService.error("[CHAT] extension request ERRORED in STREAM",l,e.value,i),this._proxy.$acceptResponseDone(i,SA(l))}})();Promise.allSettled([a.result,c]).then(()=>{this._logService.debug("[CHAT] extension request DONE",e.value,i),this._proxy.$acceptResponseDone(i,void 0)},l=>{this._logService.error("[CHAT] extension request ERRORED",l,e.value,i),this._proxy.$acceptResponseDone(i,SA(l))})}$countTokens(e,t,i){return this._chatProviderService.computeTokenLength(e,t,i)}_registerAuthenticationProvider(e,t){const i=zce+e.value;if(this._authenticationService.getProviderIds().includes(i))return V.None;const n=t.accountLabel??g(4828,"Language Models"),o=new Z;return this._authenticationService.registerAuthenticationProvider(i,new YKt(i,t.providerLabel,n)),o.add(Ee(()=>{this._authenticationService.unregisterAuthenticationProvider(i)})),o.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async r=>{const a=this._authenticationAccessService.readAllowedExtensions(i,n),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}};uze=D([Gi(Be.MainThreadLanguageModels),_(1,IJe),_(2,_Xe),_(3,Ge),_(4,sMe),_(5,Qae),_(6,fs)],uze);class YKt{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){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 sEe;const JKt="chat-dynamic-variable";var UR;let u$=(UR=class extends V{get variables(){return[...this._variables]}get id(){return sEe.ID}constructor(e,t){super(),this.widget=e,this.labelService=t,this._variables=[],this._onDidChangeInputState=this._register(new I),this.onDidChangeInputState=this._onDidChangeInputState.event,this._register(e.inputEditor.onDidChangeModelContent(i=>{i.changes.forEach(n=>{let o=!1;this._variables=Fi(this._variables.map(r=>{const a=F.intersectRanges(r.range,n.range);if(a&&!a.isEmpty()){if(!F.containsRange(n.range,r.range)){const c=new F(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn-1);this.widget.inputEditor.executeEdits(this.id,[{range:c,text:""}])}return o=!0,null}else if(F.compareRangesUsingStarts(r.range,n.range)>0){const c=n.text.length-n.rangeLength;return o=!0,{...r,range:{startLineNumber:r.range.startLineNumber,startColumn:r.range.startColumn+c,endLineNumber:r.range.endLineNumber,endColumn:r.range.endColumn+c}}}return r})),o&&this._onDidChangeInputState.fire()}),this.updateDecorations()}))}getInputState(){return this.variables}setInputState(e){Array.isArray(e)||(e=[]),this._variables=e,this.updateDecorations()}addReference(e){this._variables.push(e),this.updateDecorations(),this._onDidChangeInputState.fire()}updateDecorations(){this.widget.inputEditor.setDecorationsByType("chat",JKt,this._variables.map(e=>({range:e.range,hoverMessage:this.getHoverForReference(e)})))}getHoverForReference(e){const t=e.data;return N.isUri(t)?new Mt(this.labelService.getUriLabel(t,{relative:!0})):t.toString()}},sEe=UR,UR.ID="chatDynamicVariableModel",UR);u$=sEe=D([_(1,Fs)],u$);y9.CONTRIBS.push(u$);function XKt(s){return"widget"in s&&"range"in s}const Dw=class Dw extends li{constructor(){super({id:Dw.ID,title:""})}async run(e,...t){const i=e.get(fn),n=e.get(Ge),o=e.get(In),r=e.get(L6),a=t[0];if(!XKt(a))return;const c=()=>{a.widget.inputEditor.executeEdits("chatInsertFile",[{range:a.range,text:""}])};let l;r.hasVariable(Dw.Name)&&(l={providerOptions:{additionPicks:[Dw.Item,{type:"separator"}]}});const d=await o.quickAccess.pick("",l);if(!d?.length){n.trace("SelectAndInsertFileAction: no file selected"),c();return}const h=a.widget.inputEditor,u=a.range;if(d[0]===Dw.Item){const b=`#${Dw.Name}`;h.executeEdits("chatInsertFile",[{range:u,text:b+" "}])||(n.trace(`SelectAndInsertFileAction: failed to insert "${b}"`),c());return}const f=d[0].resource;if(!i.canHandleResource(f)){n.trace("SelectAndInsertFileAction: non-text resource selected"),c();return}const m=`#file:${_i(f)}`;if(!h.executeEdits("chatInsertFile",[{range:u,text:m+" "}])){n.trace(`SelectAndInsertFileAction: failed to insert "${m}"`),c();return}a.widget.getContrib(u$.ID)?.addReference({id:"vscode.file",range:{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+m.length},data:f})}};Dw.Name="files",Dw.Item={label:g(7003,"All Files"),description:g(7004,"Search for relevant files in the workspace and provide context from them")},Dw.ID="workbench.action.chat.selectAndInsertFile";let oEe=Dw;At(oEe);function ZKt(s){return"widget"in s&&"range"in s&&"variableData"in s}const $oe=class $oe extends li{constructor(){super({id:$oe.ID,title:""})}async run(e,...t){const i=t[0];if(!ZKt(i))return;let n=i.range;const o=i.variableData,r=()=>{i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:i.range,text:""}])};if(i.command){const c=await e.get(vi).executeCommand(i.command.id,...i.command.arguments??[]);if(!c){r();return}const l=":"+c,d=new F(n.startLineNumber,n.endColumn,n.endLineNumber,n.endColumn+l.length);if(n=new F(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+l.length),!i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:d,text:l+" "}])){r();return}}i.widget.getContrib(u$.ID)?.addReference({id:i.id,range:n,data:o})}};$oe.ID="workbench.action.chat.addDynamicVariable";let bte=$oe;At(bte);class eqt{get onDidAddProgress(){return this._onDidAddProgress.event}constructor(e){this.content=e,this.kind="progressTask",this.deferred=new dc,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 gze=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this._chatAgentService=t,this._chatService=i,this._languageFeaturesService=n,this._chatWidgetService=o,this._instantiationService=r,this._logService=a,this._extensionService=c,this._agents=this._register(new mo),this._agentCompletionProviders=this._register(new mo),this._agentIdsToCompletionProviders=this._register(new mo),this._pendingProgress=new Map,this._responsePartHandlePool=0,this._activeTasks=new Map,this._proxy=e.getProxy(Ye.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 n=t?.inputEditor.getValue()??"";this._chatService.transferChatSession({sessionId:i,inputValue:n},N.revive(e))}$registerAgent(e,t,i,n,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=>Sn.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:Mo(n),slashCommands:[],locations:[Ir.Panel]},a)}else c=this._chatAgentService.registerAgentImplementation(i,a);this._agents.set(e,{id:i,extensionId:t,dispose:c.dispose,hasFollowups:n.hasFollowups})}$updateAgent(e,t){const i=this._agents.get(e);if(!i){this._logService.error(`MainThreadChatAgents2#$updateAgent: No agent with handle ${e} registered`);return}i.hasFollowups=t.hasFollowups,this._chatAgentService.updateAgent(i.id,Mo(t))}async $handleProgressChunk(e,t,i){const n=Mo(t);if(n.kind==="progressTask"){const o=++this._responsePartHandlePool,r=`${e}_${o}`,a=new eqt(n.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(n.kind){case"progressTaskResult":return r&&n.content?(r.complete(n.content.value),this._activeTasks.delete(o)):r?.complete(void 0),i;case"warning":case"reference":r?.add(n);return}}this._pendingProgress.get(e)?.(n)}$registerAgentCompletionsProvider(e,t,i){const n=async(o,r)=>(await this._proxy.$invokeCompletionProvider(e,o,r)).map(c=>({...c,icon:c.icon?We.fromId(c.icon):void 0}));this._agentIdsToCompletionProviders.set(t,this._chatAgentService.registerAgentCompletionProvider(t,n)),this._agentCompletionProviders.set(e,this._languageFeaturesService.completionProvider.register({scheme:fZ.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(y=>Rh(y)).join(""),h=new RegExp(`[${d}]\\S*`,"g"),u=Ik(r.column,h,o.getLineContent(r.lineNumber),0)?.word??"";if(u&&!i.some(y=>u.startsWith(y)))return;const p=this._instantiationService.createInstance(GZ).parseChatRequest(l.viewModel.sessionId,o.getValue()).parts.find(y=>y instanceof $g),m=this._agents.get(e)?.id;if(p?.agent.id!==m)return;const v=tqt(o,r,h);return v?{suggestions:(await n(u,c)).map(y=>{const C=y.insertText??(typeof y.label=="string"?y.label:y.label.label),A=new F(v.insert.startLineNumber,v.insert.startColumn,v.insert.endLineNumber,v.insert.startColumn+C.length);return{label:y.label,range:v,insertText:C+" ",kind:Me.Text,detail:y.detail,documentation:y.documentation,command:{id:bte.ID,title:"",arguments:[{id:y.id,widget:l,range:A,variableData:Mo(y.value),command:y.command}]}}})}:null}}))}$unregisterAgentCompletionsProvider(e,t){this._agentCompletionProviders.deleteAndDispose(e),this._agentIdsToCompletionProviders.deleteAndDispose(t)}};gze=D([Gi(Be.MainThreadChatAgents2),_(1,_f),_(2,km),_(3,it),_(4,UN),_(5,we),_(6,Ge),_(7,fs)],gze);function tqt(s,e,t){const i=Ik(e.column,t,s.getLineContent(e.lineNumber),0);if(!i&&s.getWordUntilPosition(e).word)return;let n,o;return i?(n=new F(e.lineNumber,i.startColumn,e.lineNumber,e.column),o=new F(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn)):n=o=F.fromPositions(e),{insert:n,replace:o}}let fze=class{constructor(e,t){this._chatVariablesService=t,this._variables=new mo,this._pendingProgress=new Map,this._proxy=e.getProxy(Ye.ExtHostChatVariables)}dispose(){this._variables.clearAndDisposeAll()}$registerVariable(e,t){const i=this._chatVariablesService.registerVariable(t,async(n,o,r,a,c)=>{const l=`${r.sessionId}-${e}`;this._pendingProgress.set(l,a);const d=Mo(await this._proxy.$resolveVariable(e,l,n,c));return this._pendingProgress.delete(l),d});this._variables.set(e,i)}async $handleProgressChunk(e,t){const i=Mo(t);this._pendingProgress.get(e)?.(i)}$unregisterVariable(e){this._variables.deleteAndDispose(e)}};fze=D([Gi(Be.MainThreadChatVariables),_(1,L6)],fze);let pze=class extends V{constructor(e,t){super(),this._languageModelToolsService=t,this._tools=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostLanguageModelTools),this._register(this._languageModelToolsService.onDidChangeTools(i=>this._proxy.$acceptToolDelta(i)))}async $getTools(){return Array.from(this._languageModelToolsService.getTools())}$invokeTool(e,t,i){return this._languageModelToolsService.invokeTool(e,t,i)}$registerTool(e){const t=this._languageModelToolsService.registerToolImplementation(e,{invoke:async(i,n)=>await this._proxy.$invokeTool(e,i,n)});this._tools.set(e,t)}$unregisterTool(e){this._tools.deleteAndDispose(e)}};pze=D([Gi(Be.MainThreadLanguageModelTools),_(1,vXe)],pze);const Ent=ae("embeddingsService");class iqt{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 n=this.providers.get(e);return n?n.provideEmbeddings(t,i):Promise.reject(new Error(`No embeddings provider registered with id: ${e}`))}}ce(Ent,iqt,qt.Delayed);let mze=class{constructor(e,t){this.embeddingsService=t,this._store=new Z,this._providers=this._store.add(new mo),this._proxy=e.getProxy(Ye.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:(n,o)=>this._proxy.$provideEmbeddings(e,n,o)});this._providers.set(e,i)}$unregisterEmbeddingProvider(e){this._providers.deleteAndDispose(e)}$computeEmbeddings(e,t,i){return this.embeddingsService.computeEmbeddings(e,t,i)}};mze=D([Gi(Be.MainThreadEmbeddings),_(1,Ent)],mze);class nqt{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function xnt(s,e){if(e.serializeBuffersForPostMessage){const t=new nqt,n=JSON.stringify(s,(r,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const c=sqt(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 $e.wrap(a)});return{message:n,buffers:o}}else return{message:JSON.stringify(s),buffers:[]}}function sqt(s){switch(s.constructor.name){case"Int8Array":return bc.Int8Array;case"Uint8Array":return bc.Uint8Array;case"Uint8ClampedArray":return bc.Uint8ClampedArray;case"Int16Array":return bc.Int16Array;case"Uint16Array":return bc.Uint16Array;case"Int32Array":return bc.Int32Array;case"Uint32Array":return bc.Uint32Array;case"Float32Array":return bc.Float32Array;case"Float64Array":return bc.Float64Array;case"BigInt64Array":return bc.BigInt64Array;case"BigUint64Array":return bc.BigUint64Array}}function Dnt(s,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 bc.Int8Array:return new Int8Array(l,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case bc.Uint8Array:return new Uint8Array(l,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case bc.Uint8ClampedArray:return new Uint8ClampedArray(l,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case bc.Int16Array:return new Int16Array(l,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case bc.Uint16Array:return new Uint16Array(l,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case bc.Int32Array:return new Int32Array(l,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case bc.Uint32Array:return new Uint32Array(l,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case bc.Float32Array:return new Float32Array(l,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case bc.Float64Array:return new Float64Array(l,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case bc.BigInt64Array:return new BigInt64Array(l,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case bc.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(s,i),arrayBuffers:t}}var rEe,VR;let aEe=(VR=class extends V{constructor(e,t,i){super(),this._openerService=t,this._productService=i,this._webviews=new Map,this._proxy=e.getProxy(Ye.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=yte(t))}async $postMessage(e,t,...i){const n=this.tryGetWebview(e);if(!n)return!1;const{message:o,arrayBuffers:r}=Dnt(t,i);return n.postMessage(o,r)}hookupWebviewEventDelegate(e,t,i){const n=new Z;n.add(t.onDidClickLink(o=>this.onDidClickLink(e,o))),n.add(t.onMessage(o=>{const r=xnt(o.message,i);this._proxy.$onMessage(e,r.message,new jd(r.buffers))})),n.add(t.onMissingCsp(o=>this._proxy.$onMissingCsp(e,o.value))),n.add(t.onDidDispose(()=>{n.dispose(),this._webviews.delete(e)}))}onDidClickLink(e,t){const i=this.getWebview(e);this.isSupportedLink(i,N.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 rEe.standardSupportedLinkSchemes.has(t.scheme)||!Wn&&this._productService.urlProtocol===t.scheme?!0:t.scheme===pe.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 n=i&&typeof i=="string"?i:void 0;if(!n&&i){const o=i.include;typeof o=="string"&&(n=o)}if(n){const o=/^\*\.([A-Za-z_-]*)$/.exec(n);if(o&&o.length>1){const r=o[1];if(!t.endsWith(r))return Pt(await this._fileDialogService.defaultFilePath(),t+"."+r)}}return Pt(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=!!(this.capabilities&Ei.Scratchpad),n=await this._notebookModelResolverService.resolve(this.resource,this.viewType,{limits:this.ensureLimits(e),scratchpad:i});if(this.editorModelReference)return n.dispose(),this.editorModelReference.object;if(this.editorModelReference=n,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 aG))throw new Error("CANNOT open file notebook with this provider");const n=await i.serializer.dataToNotebook($e.fromString(JSON.stringify({__webview_backup:this.options._backupId})));this.editorModelReference.object.notebook.applyEdits([{editType:oI.Replace,index:0,count:this.editorModelReference.object.notebook.length,cells:n.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 RV?this.viewType===e.viewType&&ji(this.resource,e.resource):!1}},RV=FR,FR.ID="workbench.input.notebook",FR);qT=RV=D([_(4,ZA),_(5,Hae),_(6,sg),_(7,Fs),_(8,Jt),_(9,pd),_(10,fs),_(11,ei),_(12,Ec),_(13,tE)],qT);function OKt(s){return!!s&&typeof s=="object"&&Array.isArray(s.editorInputs)&&s.editorInputs.every(e=>e instanceof qT)}const pnt="jupyter-notebook",BKt="ms-toolsai.jupyter",mnt=new Map;mnt.set(pnt,new Map);mnt.get(pnt)?.set("python",{extensionIds:["ms-python.python",BKt],displayName:"Python + Jupyter"});var H5e;(function(s){s[s.Html=0]="Html",s[s.Extension=1]="Extension"})(H5e||(H5e={}));var U5e;(function(s){s[s.fullCell=0]="fullCell",s[s.firstLine=1]="firstLine"})(U5e||(U5e={}));var V5e;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Estimated=1]="Estimated",s[s.FromCache=2]="FromCache",s[s.Measured=3]="Measured"})(V5e||(V5e={}));var z5e;(function(s){s[s.Fold=0]="Fold"})(z5e||(z5e={}));var $5e;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})($5e||($5e={}));var G5e;(function(s){s[s.Default=1]="Default",s[s.Top=2]="Top",s[s.Center=3]="Center",s[s.CenterIfOutsideViewport=4]="CenterIfOutsideViewport",s[s.NearTopIfOutsideViewport=5]="NearTopIfOutsideViewport",s[s.FirstLineIfOutsideViewport=6]="FirstLineIfOutsideViewport"})(G5e||(G5e={}));var K5e;(function(s){s[s.Default=1]="Default",s[s.Center=2]="Center",s[s.CenterIfOutsideViewport=3]="CenterIfOutsideViewport"})(K5e||(K5e={}));var q5e;(function(s){s[s.Preview=0]="Preview",s[s.Editing=1]="Editing"})(q5e||(q5e={}));var Q5e;(function(s){s[s.Container=0]="Container",s[s.Editor=1]="Editor",s[s.Output=2]="Output",s[s.ChatInput=3]="ChatInput"})(Q5e||(Q5e={}));var j5e;(function(s){s[s.None=0]="None",s[s.Top=1]="Top",s[s.Bottom=2]="Bottom",s[s.Both=3]="Both"})(j5e||(j5e={}));var Y5e;(function(s){s[s.None=0]="None",s[s.Start=1]="Start",s[s.End=2]="End",s[s.Both=3]="Both"})(Y5e||(Y5e={}));function ZO(s){if(!s)return;if(s.getId()===y9t)return s.getControl();const e=s.input;if(e&&OKt(e)||s.getId()===C9t)return s.getControl()?.notebookEditor}var J5e;(function(s){s[s.None=0]="None",s[s.Expanded=1]="Expanded",s[s.Collapsed=2]="Collapsed"})(J5e||(J5e={}));class eB extends lae{static is(e){return e instanceof eB?!0:N.isUri(e.resource)&&kn(e.cellEdit)}static lift(e){return e instanceof eB?e:new eB(e.resource,e.cellEdit,e.notebookVersionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.cellEdit=t,this.notebookVersionId=i}}let X5e=class{constructor(e,t,i,n,o,r,a){this._undoRedoGroup=e,this._progress=i,this._token=n,this._edits=o,this._editorService=r,this._notebookModelService=a,this._edits=this._edits.map(c=>{if(c.resource.scheme===Tee.scheme){const l=Tee.parse(c.resource)?.notebook;if(!l)throw new Error(`Invalid notebook URI: ${c.resource}`);return new eB(l,c.cellEdit,c.notebookVersionId,c.metadata)}else return c})}async apply(){const e=[],t=Zz(this._edits,(i,n)=>dm(i.resource.toString(),n.resource.toString()));for(const i of t){if(this._token.isCancellationRequested)break;const[n]=i,o=await this._notebookModelService.resolve(n.resource);if(typeof n.notebookVersionId=="number"&&o.object.notebook.versionId!==n.notebookVersionId)throw o.dispose(),new Error(`Notebook '${n.resource}' has changed in the meantime`);const r=i.map(d=>d.cellEdit),a=!o.object.isReadonly(),c=ZO(this._editorService.activeEditorPane),l=c?.textModel?.uri.toString()===o.object.notebook.uri.toString()?{kind:MAe.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(n.resource)}return e}};X5e=D([_(5,ei),_(6,Hae)],X5e);let Z5e=class{constructor(e,t,i,n){this._bulkEditService=t,this._logService=i,this._uriIdentService=n}dispose(){}$tryApplyWorkspaceEdit(e,t,i){const n=Py(e.value,this._uriIdentService);return this._bulkEditService.apply(n,{undoRedoGroupId:t,respectAutoSaveConfig:i}).then(o=>o.isApplied,o=>(this._logService.warn(`IGNORING workspace edit: ${o}`),!1))}};Z5e=D([Gi(Be.MainThreadBulkEdits),_(1,LN),_(2,Ge),_(3,ks)],Z5e);function Py(s,e,t){if(!s||!s.edits)return s;const i=Mo(s);for(const n of i.edits){if(eA.is(n)&&(n.resource=e.asCanonicalUri(n.resource)),op.is(n)){if(n.options){const o=n.options?.contents;if(o)if(o.type==="base64")n.options.contents=Promise.resolve(iKe(o.value));else if(t)n.options.contents=t(o.id);else throw new Error("Could not revive data transfer file")}n.newResource=n.newResource&&e.asCanonicalUri(n.newResource),n.oldResource=n.oldResource&&e.asCanonicalUri(n.oldResource)}if(eB.is(n)){n.resource=e.asCanonicalUri(n.resource);const o=n.cellEdit;o.editType===oI.Replace&&(n.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 s}const Wce="__";let eze=class{constructor(e,t,i,n,o,r,a){this._chatProviderService=t,this._languageModelStatsService=i,this._logService=n,this._authenticationService=o,this._authenticationAccessService=r,this._extensionService=a,this._store=new Z,this._providerRegistrations=new mo,this._pendingProgress=new Map,this._proxy=e.getProxy(Ye.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 n=new Z;n.add(this._chatProviderService.registerLanguageModelChat(t,{metadata:i,sendChatRequest:async(o,r,a,c)=>{const l=Math.random()*1e6|0,d=new dc,h=new L2;try{this._pendingProgress.set(l,{defer:d,stream:h}),await this._proxy.$startChatRequest(e,l,r,o,a,c)}catch(u){throw this._pendingProgress.delete(l),u}return{result:d.p,stream:h.asyncIterable}},provideTokenCount:(o,r)=>this._proxy.$provideTokenLength(e,o,r)})),i.auth&&n.add(this._registerAuthenticationProvider(i.extension,i.auth)),this._providerRegistrations.set(e,n)}async $reportResponsePart(e,t){const i=this._pendingProgress.get(e);this._logService.trace("[LM] report response PART",!!i,e,t),i&&i.stream.emitOne(t)}async $reportResponseDone(e,t){const i=this._pendingProgress.get(e);if(this._logService.trace("[LM] report response DONE",!!i,e,t),i)if(this._pendingProgress.delete(e),t){const n=r8(t);i.stream.reject(n),i.defer.error(n)}else i.stream.resolve(),i.defer.complete(void 0)}$unregisterProvider(e){this._providerRegistrations.deleteAndDispose(e)}$selectChatModels(e){return this._chatProviderService.selectLanguageModels(e)}$whenLanguageModelChatRequestMade(e,t,i,n){this._languageModelStatsService.update(e,t,i,n)}async $tryStartChatRequest(e,t,i,n,o,r){this._logService.trace("[CHAT] request STARTED",e.value,i);const a=await this._chatProviderService.sendChatRequest(t,e,n,o,r),c=(async()=>{try{for await(const l of a.stream)this._logService.trace("[CHAT] request PART",e.value,i,l),await this._proxy.$acceptResponsePart(i,l);this._logService.trace("[CHAT] request DONE",e.value,i)}catch(l){this._logService.error("[CHAT] extension request ERRORED in STREAM",l,e.value,i),this._proxy.$acceptResponseDone(i,yA(l))}})();Promise.allSettled([a.result,c]).then(()=>{this._logService.debug("[CHAT] extension request DONE",e.value,i),this._proxy.$acceptResponseDone(i,void 0)},l=>{this._logService.error("[CHAT] extension request ERRORED",l,e.value,i),this._proxy.$acceptResponseDone(i,yA(l))})}$countTokens(e,t,i){return this._chatProviderService.computeTokenLength(e,t,i)}_registerAuthenticationProvider(e,t){const i=Wce+e.value;if(this._authenticationService.getProviderIds().includes(i))return V.None;const n=t.accountLabel??g(4828,"Language Models"),o=new Z;return this._authenticationService.registerAuthenticationProvider(i,new WKt(i,t.providerLabel,n)),o.add(Ee(()=>{this._authenticationService.unregisterAuthenticationProvider(i)})),o.add(this._authenticationAccessService.onDidChangeExtensionSessionAccess(async r=>{const a=this._authenticationAccessService.readAllowedExtensions(i,n),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}};eze=D([Gi(Be.MainThreadLanguageModels),_(1,yJe),_(2,lXe),_(3,Ge),_(4,KRe),_(5,$ae),_(6,fs)],eze);class WKt{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){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 XAe;const HKt="chat-dynamic-variable";var OR;let l$=(OR=class extends V{get variables(){return[...this._variables]}get id(){return XAe.ID}constructor(e,t){super(),this.widget=e,this.labelService=t,this._variables=[],this._onDidChangeInputState=this._register(new I),this.onDidChangeInputState=this._onDidChangeInputState.event,this._register(e.inputEditor.onDidChangeModelContent(i=>{i.changes.forEach(n=>{let o=!1;this._variables=Fi(this._variables.map(r=>{const a=F.intersectRanges(r.range,n.range);if(a&&!a.isEmpty()){if(!F.containsRange(n.range,r.range)){const c=new F(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn-1);this.widget.inputEditor.executeEdits(this.id,[{range:c,text:""}])}return o=!0,null}else if(F.compareRangesUsingStarts(r.range,n.range)>0){const c=n.text.length-n.rangeLength;return o=!0,{...r,range:{startLineNumber:r.range.startLineNumber,startColumn:r.range.startColumn+c,endLineNumber:r.range.endLineNumber,endColumn:r.range.endColumn+c}}}return r})),o&&this._onDidChangeInputState.fire()}),this.updateDecorations()}))}getInputState(){return this.variables}setInputState(e){Array.isArray(e)||(e=[]),this._variables=e,this.updateDecorations()}addReference(e){this._variables.push(e),this.updateDecorations(),this._onDidChangeInputState.fire()}updateDecorations(){this.widget.inputEditor.setDecorationsByType("chat",HKt,this._variables.map(e=>({range:e.range,hoverMessage:this.getHoverForReference(e)})))}getHoverForReference(e){const t=e.data;return N.isUri(t)?new Mt(this.labelService.getUriLabel(t,{relative:!0})):t.toString()}},XAe=OR,OR.ID="chatDynamicVariableModel",OR);l$=XAe=D([_(1,Fs)],l$);v9.CONTRIBS.push(l$);function UKt(s){return"widget"in s&&"range"in s}const Aw=class Aw extends li{constructor(){super({id:Aw.ID,title:""})}async run(e,...t){const i=e.get(fn),n=e.get(Ge),o=e.get(In),r=e.get(D6),a=t[0];if(!UKt(a))return;const c=()=>{a.widget.inputEditor.executeEdits("chatInsertFile",[{range:a.range,text:""}])};let l;r.hasVariable(Aw.Name)&&(l={providerOptions:{additionPicks:[Aw.Item,{type:"separator"}]}});const d=await o.quickAccess.pick("",l);if(!d?.length){n.trace("SelectAndInsertFileAction: no file selected"),c();return}const h=a.widget.inputEditor,u=a.range;if(d[0]===Aw.Item){const b=`#${Aw.Name}`;h.executeEdits("chatInsertFile",[{range:u,text:b+" "}])||(n.trace(`SelectAndInsertFileAction: failed to insert "${b}"`),c());return}const f=d[0].resource;if(!i.canHandleResource(f)){n.trace("SelectAndInsertFileAction: non-text resource selected"),c();return}const m=`#file:${_i(f)}`;if(!h.executeEdits("chatInsertFile",[{range:u,text:m+" "}])){n.trace(`SelectAndInsertFileAction: failed to insert "${m}"`),c();return}a.widget.getContrib(l$.ID)?.addReference({id:"vscode.file",range:{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+m.length},data:f})}};Aw.Name="files",Aw.Item={label:g(7003,"All Files"),description:g(7004,"Search for relevant files in the workspace and provide context from them")},Aw.ID="workbench.action.chat.selectAndInsertFile";let ZAe=Aw;At(ZAe);function VKt(s){return"widget"in s&&"range"in s&&"variableData"in s}const Hoe=class Hoe extends li{constructor(){super({id:Hoe.ID,title:""})}async run(e,...t){const i=t[0];if(!VKt(i))return;let n=i.range;const o=i.variableData,r=()=>{i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:i.range,text:""}])};if(i.command){const c=await e.get(vi).executeCommand(i.command.id,...i.command.arguments??[]);if(!c){r();return}const l=":"+c,d=new F(n.startLineNumber,n.endColumn,n.endLineNumber,n.endColumn+l.length);if(n=new F(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+l.length),!i.widget.inputEditor.executeEdits("chatInsertDynamicVariableWithArguments",[{range:d,text:l+" "}])){r();return}}i.widget.getContrib(l$.ID)?.addReference({id:i.id,range:n,data:o})}};Hoe.ID="workbench.action.chat.addDynamicVariable";let _te=Hoe;At(_te);class zKt{get onDidAddProgress(){return this._onDidAddProgress.event}constructor(e){this.content=e,this.kind="progressTask",this.deferred=new dc,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 tze=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this._chatAgentService=t,this._chatService=i,this._languageFeaturesService=n,this._chatWidgetService=o,this._instantiationService=r,this._logService=a,this._extensionService=c,this._agents=this._register(new mo),this._agentCompletionProviders=this._register(new mo),this._agentIdsToCompletionProviders=this._register(new mo),this._pendingProgress=new Map,this._responsePartHandlePool=0,this._activeTasks=new Map,this._proxy=e.getProxy(Ye.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 n=t?.inputEditor.getValue()??"";this._chatService.transferChatSession({sessionId:i,inputValue:n},N.revive(e))}$registerAgent(e,t,i,n,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=>Sn.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:Mo(n),slashCommands:[],locations:[Ir.Panel]},a)}else c=this._chatAgentService.registerAgentImplementation(i,a);this._agents.set(e,{id:i,extensionId:t,dispose:c.dispose,hasFollowups:n.hasFollowups})}$updateAgent(e,t){const i=this._agents.get(e);if(!i){this._logService.error(`MainThreadChatAgents2#$updateAgent: No agent with handle ${e} registered`);return}i.hasFollowups=t.hasFollowups,this._chatAgentService.updateAgent(i.id,Mo(t))}async $handleProgressChunk(e,t,i){const n=Mo(t);if(n.kind==="progressTask"){const o=++this._responsePartHandlePool,r=`${e}_${o}`,a=new zKt(n.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(n.kind){case"progressTaskResult":return r&&n.content?(r.complete(n.content.value),this._activeTasks.delete(o)):r?.complete(void 0),i;case"warning":case"reference":r?.add(n);return}}this._pendingProgress.get(e)?.(n)}$registerAgentCompletionsProvider(e,t,i){const n=async(o,r)=>(await this._proxy.$invokeCompletionProvider(e,o,r)).map(c=>({...c,icon:c.icon?We.fromId(c.icon):void 0}));this._agentIdsToCompletionProviders.set(t,this._chatAgentService.registerAgentCompletionProvider(t,n)),this._agentCompletionProviders.set(e,this._languageFeaturesService.completionProvider.register({scheme:uZ.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(y=>Th(y)).join(""),h=new RegExp(`[${d}]\\S*`,"g"),u=Ak(r.column,h,o.getLineContent(r.lineNumber),0)?.word??"";if(u&&!i.some(y=>u.startsWith(y)))return;const p=this._instantiationService.createInstance(zZ).parseChatRequest(l.viewModel.sessionId,o.getValue()).parts.find(y=>y instanceof Ug),m=this._agents.get(e)?.id;if(p?.agent.id!==m)return;const v=$Kt(o,r,h);return v?{suggestions:(await n(u,c)).map(y=>{const C=y.insertText??(typeof y.label=="string"?y.label:y.label.label),A=new F(v.insert.startLineNumber,v.insert.startColumn,v.insert.endLineNumber,v.insert.startColumn+C.length);return{label:y.label,range:v,insertText:C+" ",kind:Ne.Text,detail:y.detail,documentation:y.documentation,command:{id:_te.ID,title:"",arguments:[{id:y.id,widget:l,range:A,variableData:Mo(y.value),command:y.command}]}}})}:null}}))}$unregisterAgentCompletionsProvider(e,t){this._agentCompletionProviders.deleteAndDispose(e),this._agentIdsToCompletionProviders.deleteAndDispose(t)}};tze=D([Gi(Be.MainThreadChatAgents2),_(1,ff),_(2,Em),_(3,it),_(4,ON),_(5,we),_(6,Ge),_(7,fs)],tze);function $Kt(s,e,t){const i=Ak(e.column,t,s.getLineContent(e.lineNumber),0);if(!i&&s.getWordUntilPosition(e).word)return;let n,o;return i?(n=new F(e.lineNumber,i.startColumn,e.lineNumber,e.column),o=new F(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn)):n=o=F.fromPositions(e),{insert:n,replace:o}}let ize=class{constructor(e,t){this._chatVariablesService=t,this._variables=new mo,this._pendingProgress=new Map,this._proxy=e.getProxy(Ye.ExtHostChatVariables)}dispose(){this._variables.clearAndDisposeAll()}$registerVariable(e,t){const i=this._chatVariablesService.registerVariable(t,async(n,o,r,a,c)=>{const l=`${r.sessionId}-${e}`;this._pendingProgress.set(l,a);const d=Mo(await this._proxy.$resolveVariable(e,l,n,c));return this._pendingProgress.delete(l),d});this._variables.set(e,i)}async $handleProgressChunk(e,t){const i=Mo(t);this._pendingProgress.get(e)?.(i)}$unregisterVariable(e){this._variables.deleteAndDispose(e)}};ize=D([Gi(Be.MainThreadChatVariables),_(1,D6)],ize);let nze=class extends V{constructor(e,t){super(),this._languageModelToolsService=t,this._tools=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostLanguageModelTools),this._register(this._languageModelToolsService.onDidChangeTools(i=>this._proxy.$acceptToolDelta(i)))}async $getTools(){return Array.from(this._languageModelToolsService.getTools())}$invokeTool(e,t,i){return this._languageModelToolsService.invokeTool(e,t,i)}$registerTool(e){const t=this._languageModelToolsService.registerToolImplementation(e,{invoke:async(i,n)=>await this._proxy.$invokeTool(e,i,n)});this._tools.set(e,t)}$unregisterTool(e){this._tools.deleteAndDispose(e)}};nze=D([Gi(Be.MainThreadLanguageModelTools),_(1,dXe)],nze);const _nt=ae("embeddingsService");class GKt{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 n=this.providers.get(e);return n?n.provideEmbeddings(t,i):Promise.reject(new Error(`No embeddings provider registered with id: ${e}`))}}ce(_nt,GKt,qt.Delayed);let sze=class{constructor(e,t){this.embeddingsService=t,this._store=new Z,this._providers=this._store.add(new mo),this._proxy=e.getProxy(Ye.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:(n,o)=>this._proxy.$provideEmbeddings(e,n,o)});this._providers.set(e,i)}$unregisterEmbeddingProvider(e){this._providers.deleteAndDispose(e)}$computeEmbeddings(e,t,i){return this.embeddingsService.computeEmbeddings(e,t,i)}};sze=D([Gi(Be.MainThreadEmbeddings),_(1,_nt)],sze);class KKt{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function vnt(s,e){if(e.serializeBuffersForPostMessage){const t=new KKt,n=JSON.stringify(s,(r,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const c=qKt(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 $e.wrap(a)});return{message:n,buffers:o}}else return{message:JSON.stringify(s),buffers:[]}}function qKt(s){switch(s.constructor.name){case"Int8Array":return bc.Int8Array;case"Uint8Array":return bc.Uint8Array;case"Uint8ClampedArray":return bc.Uint8ClampedArray;case"Int16Array":return bc.Int16Array;case"Uint16Array":return bc.Uint16Array;case"Int32Array":return bc.Int32Array;case"Uint32Array":return bc.Uint32Array;case"Float32Array":return bc.Float32Array;case"Float64Array":return bc.Float64Array;case"BigInt64Array":return bc.BigInt64Array;case"BigUint64Array":return bc.BigUint64Array}}function bnt(s,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 bc.Int8Array:return new Int8Array(l,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case bc.Uint8Array:return new Uint8Array(l,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case bc.Uint8ClampedArray:return new Uint8ClampedArray(l,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case bc.Int16Array:return new Int16Array(l,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case bc.Uint16Array:return new Uint16Array(l,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case bc.Int32Array:return new Int32Array(l,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case bc.Uint32Array:return new Uint32Array(l,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case bc.Float32Array:return new Float32Array(l,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case bc.Float64Array:return new Float64Array(l,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case bc.BigInt64Array:return new BigInt64Array(l,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case bc.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(s,i),arrayBuffers:t}}var eEe,BR;let tEe=(BR=class extends V{constructor(e,t,i){super(),this._openerService=t,this._productService=i,this._webviews=new Map,this._proxy=e.getProxy(Ye.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=bte(t))}async $postMessage(e,t,...i){const n=this.tryGetWebview(e);if(!n)return!1;const{message:o,arrayBuffers:r}=bnt(t,i);return n.postMessage(o,r)}hookupWebviewEventDelegate(e,t,i){const n=new Z;n.add(t.onDidClickLink(o=>this.onDidClickLink(e,o))),n.add(t.onMessage(o=>{const r=vnt(o.message,i);this._proxy.$onMessage(e,r.message,new qd(r.buffers))})),n.add(t.onMissingCsp(o=>this._proxy.$onMissingCsp(e,o.value))),n.add(t.onDidDispose(()=>{n.dispose(),this._webviews.delete(e)}))}onDidClickLink(e,t){const i=this.getWebview(e);this.isSupportedLink(i,N.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 eEe.standardSupportedLinkSchemes.has(t.scheme)||!Wn&&this._productService.urlProtocol===t.scheme?!0:t.scheme===pe.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(9799,"An error occurred while loading view: {0}",fT(e))} - `}},rEe=VR,VR.standardSupportedLinkSchemes=new Set([pe.http,pe.https,pe.mailto,pe.vscode,"vscode-insider"]),VR);aEe=rEe=D([_(1,Ao),_(2,Er)],aEe);function wte(s){return{id:s.id,location:N.revive(s.location)}}function yte(s){return{allowScripts:s.enableScripts,allowForms:s.enableForms,enableCommandUris:s.enableCommandUris,localResourceRoots:Array.isArray(s.localResourceRoots)?s.localResourceRoots.map(e=>N.revive(e)):void 0,portMapping:s.portMapping}}class oqt{constructor(e,t,i,n){this.editor=e,this.line=t,this.height=i,this.webview=n,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)),n.mountTo(this.domNode,ct(e.getDomNode()))}dispose(){this.editor.changeViewZones(e=>this._id&&e.removeZone(this._id))}}let _ze=class{constructor(e,t,i){this._editorService=t,this._webviewService=i,this._disposables=new Z,this._insets=new Map,this._proxy=e.getProxy(Ye.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,n,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()&&ji(p.getModel().uri,N.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:yte(r),extension:{id:a,location:N.revive(c)}}),u=new oqt(l,n,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=yte(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}};_ze=D([Gi(Be.MainThreadEditorInsets),_(1,Kt),_(2,qae)],_ze);const rqt=s=>g(9800,"Extension '{0}' not found.",s),vze=g(9801,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let cEe=class{constructor(e,t,i){this.logger=e,this.extensionManagementService=t,this.extensionGalleryService=i}get location(){}async listExtensions(e,t,i){let n=await this.extensionManagementService.getInstalled(br.User,i);const o=QYe.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}n=n.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(9802,"Extensions installed on {0}:",this.location)),n=n.sort((a,c)=>a.identifier.id.localeCompare(c.identifier.id));let r;for(const a of n)r!==a.identifier.id&&(r=a.identifier.id,this.logger.info(e?`${r}@${a.manifest.version}`:r))}async installExtensions(e,t,i,n){const o=[];try{e.length&&this.logger.info(this.location?g(9803,"Installing extensions on {0}...",this.location):g(9804,"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 N)r.push({vsix:d,installOptions:i});else{const[h,u]=_He(d);c(h,u,!1)}for(const d of t)if(d instanceof N)r.push({vsix:d,installOptions:{...i,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[h,u]=_He(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,n,l)}catch(u){this.logger.error(u),o.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,n);o.push(...d)}}catch(r){throw this.logger.error(g(9805,"Error while installing extensions: {0}",su(r))),r}if(o.length)throw new Error(g(9806,"Failed Installing Extensions: {0}",o.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(br.User,e),i=[];for(const a of t)a.identifier.uuid&&i.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(g(9807,"Fetching latest versions for {0} extensions",i.length));const n=await this.extensionGalleryService.getExtensions(i,{compatible:!0},He.None),o=[];for(const a of n)for(const c of t)Ra(c.identifier,a.identifier)&&jW.gt(a.version,c.manifest.version)&&o.push({extension:a,options:{operation:LA.Update,installPreReleaseVersion:c.preRelease,profileLocation:e,isApplicationScoped:c.isApplicationScoped}});if(!o.length){this.logger.info(g(9808,"No extension to update"));return}this.logger.info(g(9809,"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(9810,"Error while updating extension {0}: {1}",a.identifier.id,su(a.error))):this.logger.info(g(9811,"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=>Ra(d.identifier,{id:a}));if(l){if(!i&&(!c||c==="prerelease"&&l.preRelease))return this.logger.info(g(9812,"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(9813,"Extension '{0}' is already installed.",`${a}@${c}`)),!1}return!0}),!e.length)return[];const n=[],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(`${rqt(c?`${a}@${c}`:a)} -${vze}`),n.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,He.None);if(u&&!this.validateExtensionKind(u))return}catch(u){this.logger.error(u.message||u.stack||u),n.push(a);return}const h=t.find(u=>Ra(u.identifier,d.identifier));if(h){if(d.version===h.manifest.version){this.logger.info(g(9813,"Extension '{0}' is already installed.",c?`${a}@${c}`:a));return}this.logger.info(g(9814,"Updating the extension '{0}' to the version {1}",a,d.version))}l.isBuiltin?this.logger.info(c?g(9815,"Installing builtin extension '{0}' v{1}...",a,c):g(9816,"Installing builtin extension '{0}'...",a)):this.logger.info(c?g(9817,"Installing extension '{0}' v{1}...",a,c):g(9818,"Installing extension '{0}'...",a)),o.push({extension:d,options:{...l,installGivenVersion:!!c,isApplicationScoped:l.isApplicationScoped||h?.isApplicationScoped}})})),o.length){const a=await this.extensionManagementService.installGalleryExtensions(o);for(const c of a)c.error?(this.logger.error(g(9819,"Error while installing extension {0}: {1}",c.identifier.id,su(c.error))),n.push(c.identifier.id)):this.logger.info(g(9820,"Extension '{0}' v{1} was successfully installed.",c.identifier.id,c.local?.manifest.version))}return n}async installVSIX(e,t,i,n){const o=await this.extensionManagementService.getManifest(e);if(!o)throw new Error("Invalid vsix");if(await this.validateVSIX(o,i,t.profileLocation,n))try{await this.extensionManagementService.install(e,{...t,installGivenVersion:!0}),this.logger.info(g(9821,"Extension '{0}' was successfully installed.",_i(e)))}catch(a){if(Fr(a))this.logger.info(g(9822,"Cancelled installing extension '{0}'.",_i(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(r=>r.installOptions.installPreReleaseVersion),n=await this.extensionManagementService.getTargetPlatform(),o=[];for(const r of e)DLt.test(r.id)&&o.push({...r,preRelease:i});if(o.length){const r=await this.extensionGalleryService.getExtensions(o,{targetPlatform:n},He.None);for(const a of r)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,n){if(!t){const o={id:Iw(e.publisher,e.name)},r=n.find(a=>Ra(o,a.identifier)&&jW.gt(a.manifest.version,e.version));if(r)return this.logger.info(g(9823,"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 n=async o=>{if(o instanceof N){const r=await this.extensionManagementService.getManifest(o);return LM(r.publisher,r.name)}return o};for(const o of e){const r=await n(o),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>Ra(l.identifier,{id:r}));if(!c.length)throw new Error(`${this.notInstalled(r)} -${vze}`);if(c.some(l=>l.type===br.System)){this.logger.info(g(9824,"Extension '{0}' is a Built-in extension and cannot be uninstalled",r));return}if(!t&&c.some(l=>l.isBuiltin)){this.logger.info(g(9825,"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",r));return}this.logger.info(g(9826,"Uninstalling {0}...",r));for(const l of c)await this.extensionManagementService.uninstall(l,{profileLocation:i});this.location?this.logger.info(g(9827,"Extension '{0}' was successfully uninstalled from {1}!",r,this.location)):this.logger.info(g(9828,"Extension '{0}' was successfully uninstalled!",r))}}async locateExtension(e){const t=await this.extensionManagementService.getInstalled();e.forEach(i=>{t.forEach(n=>{if(n.identifier.id===i&&n.location.scheme===pe.file){this.logger.info(n.location.fsPath);return}})})}notInstalled(e){return this.location?g(9829,"Extension '{0}' is not installed on {1}.",e,this.location):g(9830,"Extension '{0}' is not installed.",e)}};cEe=D([_(1,k6),_(2,EI)],cEe);_t.registerCommand("_remoteCLI.openExternal",function(s,e){return s.get(Ao).open(Lt(e)?e:N.revive(e),{openExternal:!0,allowTunneling:!0})});_t.registerCommand("_remoteCLI.windowOpen",function(s,e,t){const i=s.get(vi);return e.length?i.executeCommand("_files.windowOpen",e,t):i.executeCommand("_files.newWindow",t)});_t.registerCommand("_remoteCLI.getSystemStatus",function(s){return s.get(vi).executeCommand("_issues.getSystemStatus")});_t.registerCommand("_remoteCLI.manageExtensions",async function(s,e){const t=s.get(we),n=s.get(dv).remoteExtensionManagementServer?.extensionManagementService;if(!n)return;const o=[],r=new class extends rae{log(c,l){o.push(l)}},a=t.createChild(new Uc([k6,n])).createInstance(lEe,r);if(e.list)await a.listExtensions(!!e.list.showVersions,e.list.category,void 0);else{const c=l=>l.map(d=>Lt(d)?d:N.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 lEe=class extends cEe{constructor(e,t,i,n,o,r){super(e,t,i),this._extensionManifestPropertiesService=r;const a=o.remoteAuthority;this._location=a?n.getHostLabel(pe.vscodeRemote,a):void 0}get location(){return this._location}validateExtensionKind(e){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(e)&&!(Wn&&this._extensionManifestPropertiesService.canExecuteOnWeb(e))?(this.logger.info(g(4829,"Cannot install the '{0}' extension because it is declared to not run in this setup.",LM(e.publisher,e.name))),!1):!0}};lEe=D([_(1,k6),_(2,EI),_(3,Fs),_(4,Jr),_(5,Im)],lEe);let bze=class{constructor(e,t){this._clipboardService=t}dispose(){}$readText(){return this._clipboardService.readText()}$writeText(e){return this._clipboardService.writeText(e)}};bze=D([Gi(Be.MainThreadClipboard),_(1,dg)],bze);let wze=class{constructor(e,t,i){this._commandService=t,this._extensionService=i,this._commandRegistrations=new mo,this._proxy=e.getProxy(Ye.ExtHostCommands),this._generateCommandsDocumentationRegistration=_t.registerCommand("_generateCommandsDocumentation",()=>this._generateCommandsDocumentation())}dispose(){this._commandRegistrations.dispose(),this._generateCommandsDocumentationRegistration.dispose()}async _generateCommandsDocumentation(){const e=await this._proxy.$getContributedCommandMetadata(),t=_t.getCommands();for(const[n,o]of t)o.metadata&&(e[n]=o.metadata);const i=[];for(const n in e)i.push("`"+n+"` - "+aqt(e[n]));console.log(i.join(` -`))}$registerCommand(e){this._commandRegistrations.set(e,_t.registerCommand(e,(t,...i)=>this._proxy.$executeContributedCommand(e,...i).then(n=>Mo(n))))}$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 jd&&(t=t.value);for(let n=0;n0&&!_t.getCommand(e))throw await this._extensionService.activateByEvent(`onCommand:${e}`),new Error("$executeCommand:retry");return this._commandService.executeCommand(e,...t)}$getCommands(){return Promise.resolve([..._t.getCommands().keys()])}};wze=D([Gi(Be.MainThreadCommands),_(1,vi),_(2,fs)],wze);function aqt(s){if(typeof s=="string")return s;{const t=[Lt(s.description)?s.description:s.description.original];if(t.push(` + ${g(9799,"An error occurred while loading view: {0}",dT(e))} + `}},eEe=BR,BR.standardSupportedLinkSchemes=new Set([pe.http,pe.https,pe.mailto,pe.vscode,"vscode-insider"]),BR);tEe=eEe=D([_(1,Ao),_(2,Er)],tEe);function vte(s){return{id:s.id,location:N.revive(s.location)}}function bte(s){return{allowScripts:s.enableScripts,allowForms:s.enableForms,enableCommandUris:s.enableCommandUris,localResourceRoots:Array.isArray(s.localResourceRoots)?s.localResourceRoots.map(e=>N.revive(e)):void 0,portMapping:s.portMapping}}class QKt{constructor(e,t,i,n){this.editor=e,this.line=t,this.height=i,this.webview=n,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)),n.mountTo(this.domNode,ct(e.getDomNode()))}dispose(){this.editor.changeViewZones(e=>this._id&&e.removeZone(this._id))}}let oze=class{constructor(e,t,i){this._editorService=t,this._webviewService=i,this._disposables=new Z,this._insets=new Map,this._proxy=e.getProxy(Ye.ExtHostEditorInsets)}dispose(){this._disposables.dispose()}async $createEditorInset(e,t,i,n,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()&&ji(p.getModel().uri,N.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:bte(r),extension:{id:a,location:N.revive(c)}}),u=new QKt(l,n,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=bte(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}};oze=D([Gi(Be.MainThreadEditorInsets),_(1,Kt),_(2,zae)],oze);const jKt=s=>g(9800,"Extension '{0}' not found.",s),rze=g(9801,"Make sure you use the full extension ID, including the publisher, e.g.: {0}","ms-dotnettools.csharp");let iEe=class{constructor(e,t,i){this.logger=e,this.extensionManagementService=t,this.extensionGalleryService=i}get location(){}async listExtensions(e,t,i){let n=await this.extensionManagementService.getInstalled(br.User,i);const o=HYe.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}n=n.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(9802,"Extensions installed on {0}:",this.location)),n=n.sort((a,c)=>a.identifier.id.localeCompare(c.identifier.id));let r;for(const a of n)r!==a.identifier.id&&(r=a.identifier.id,this.logger.info(e?`${r}@${a.manifest.version}`:r))}async installExtensions(e,t,i,n){const o=[];try{e.length&&this.logger.info(this.location?g(9803,"Installing extensions on {0}...",this.location):g(9804,"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 N)r.push({vsix:d,installOptions:i});else{const[h,u]=oHe(d);c(h,u,!1)}for(const d of t)if(d instanceof N)r.push({vsix:d,installOptions:{...i,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[h,u]=oHe(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,n,l)}catch(u){this.logger.error(u),o.push(d.toString())}})),a.length){const d=await this.installGalleryExtensions(a,l,n);o.push(...d)}}catch(r){throw this.logger.error(g(9805,"Error while installing extensions: {0}",nu(r))),r}if(o.length)throw new Error(g(9806,"Failed Installing Extensions: {0}",o.join(", ")))}async updateExtensions(e){const t=await this.extensionManagementService.getInstalled(br.User,e),i=[];for(const a of t)a.identifier.uuid&&i.push({...a.identifier,preRelease:a.preRelease});this.logger.trace(g(9807,"Fetching latest versions for {0} extensions",i.length));const n=await this.extensionGalleryService.getExtensions(i,{compatible:!0},He.None),o=[];for(const a of n)for(const c of t)Ra(c.identifier,a.identifier)&&GW.gt(a.version,c.manifest.version)&&o.push({extension:a,options:{operation:IA.Update,installPreReleaseVersion:c.preRelease,profileLocation:e,isApplicationScoped:c.isApplicationScoped}});if(!o.length){this.logger.info(g(9808,"No extension to update"));return}this.logger.info(g(9809,"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(9810,"Error while updating extension {0}: {1}",a.identifier.id,nu(a.error))):this.logger.info(g(9811,"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=>Ra(d.identifier,{id:a}));if(l){if(!i&&(!c||c==="prerelease"&&l.preRelease))return this.logger.info(g(9812,"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(9813,"Extension '{0}' is already installed.",`${a}@${c}`)),!1}return!0}),!e.length)return[];const n=[],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(`${jKt(c?`${a}@${c}`:a)} +${rze}`),n.push(a);return}try{const u=await this.extensionGalleryService.getManifest(d,He.None);if(u&&!this.validateExtensionKind(u))return}catch(u){this.logger.error(u.message||u.stack||u),n.push(a);return}const h=t.find(u=>Ra(u.identifier,d.identifier));if(h){if(d.version===h.manifest.version){this.logger.info(g(9813,"Extension '{0}' is already installed.",c?`${a}@${c}`:a));return}this.logger.info(g(9814,"Updating the extension '{0}' to the version {1}",a,d.version))}l.isBuiltin?this.logger.info(c?g(9815,"Installing builtin extension '{0}' v{1}...",a,c):g(9816,"Installing builtin extension '{0}'...",a)):this.logger.info(c?g(9817,"Installing extension '{0}' v{1}...",a,c):g(9818,"Installing extension '{0}'...",a)),o.push({extension:d,options:{...l,installGivenVersion:!!c,isApplicationScoped:l.isApplicationScoped||h?.isApplicationScoped}})})),o.length){const a=await this.extensionManagementService.installGalleryExtensions(o);for(const c of a)c.error?(this.logger.error(g(9819,"Error while installing extension {0}: {1}",c.identifier.id,nu(c.error))),n.push(c.identifier.id)):this.logger.info(g(9820,"Extension '{0}' v{1} was successfully installed.",c.identifier.id,c.local?.manifest.version))}return n}async installVSIX(e,t,i,n){const o=await this.extensionManagementService.getManifest(e);if(!o)throw new Error("Invalid vsix");if(await this.validateVSIX(o,i,t.profileLocation,n))try{await this.extensionManagementService.install(e,{...t,installGivenVersion:!0}),this.logger.info(g(9821,"Extension '{0}' was successfully installed.",_i(e)))}catch(a){if(Fr(a))this.logger.info(g(9822,"Cancelled installing extension '{0}'.",_i(e)));else throw a}}async getGalleryExtensions(e){const t=new Map,i=e.some(r=>r.installOptions.installPreReleaseVersion),n=await this.extensionManagementService.getTargetPlatform(),o=[];for(const r of e)mLt.test(r.id)&&o.push({...r,preRelease:i});if(o.length){const r=await this.extensionGalleryService.getExtensions(o,{targetPlatform:n},He.None);for(const a of r)t.set(a.identifier.id.toLowerCase(),a)}return t}validateExtensionKind(e){return!0}async validateVSIX(e,t,i,n){if(!t){const o={id:xw(e.publisher,e.name)},r=n.find(a=>Ra(o,a.identifier)&&GW.gt(a.manifest.version,e.version));if(r)return this.logger.info(g(9823,"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 n=async o=>{if(o instanceof N){const r=await this.extensionManagementService.getManifest(o);return DM(r.publisher,r.name)}return o};for(const o of e){const r=await n(o),c=(await this.extensionManagementService.getInstalled(void 0,i)).filter(l=>Ra(l.identifier,{id:r}));if(!c.length)throw new Error(`${this.notInstalled(r)} +${rze}`);if(c.some(l=>l.type===br.System)){this.logger.info(g(9824,"Extension '{0}' is a Built-in extension and cannot be uninstalled",r));return}if(!t&&c.some(l=>l.isBuiltin)){this.logger.info(g(9825,"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",r));return}this.logger.info(g(9826,"Uninstalling {0}...",r));for(const l of c)await this.extensionManagementService.uninstall(l,{profileLocation:i});this.location?this.logger.info(g(9827,"Extension '{0}' was successfully uninstalled from {1}!",r,this.location)):this.logger.info(g(9828,"Extension '{0}' was successfully uninstalled!",r))}}async locateExtension(e){const t=await this.extensionManagementService.getInstalled();e.forEach(i=>{t.forEach(n=>{if(n.identifier.id===i&&n.location.scheme===pe.file){this.logger.info(n.location.fsPath);return}})})}notInstalled(e){return this.location?g(9829,"Extension '{0}' is not installed on {1}.",e,this.location):g(9830,"Extension '{0}' is not installed.",e)}};iEe=D([_(1,A6),_(2,bI)],iEe);_t.registerCommand("_remoteCLI.openExternal",function(s,e){return s.get(Ao).open(Lt(e)?e:N.revive(e),{openExternal:!0,allowTunneling:!0})});_t.registerCommand("_remoteCLI.windowOpen",function(s,e,t){const i=s.get(vi);return e.length?i.executeCommand("_files.windowOpen",e,t):i.executeCommand("_files.newWindow",t)});_t.registerCommand("_remoteCLI.getSystemStatus",function(s){return s.get(vi).executeCommand("_issues.getSystemStatus")});_t.registerCommand("_remoteCLI.manageExtensions",async function(s,e){const t=s.get(we),n=s.get(av).remoteExtensionManagementServer?.extensionManagementService;if(!n)return;const o=[],r=new class extends iae{log(c,l){o.push(l)}},a=t.createChild(new Uc([A6,n])).createInstance(nEe,r);if(e.list)await a.listExtensions(!!e.list.showVersions,e.list.category,void 0);else{const c=l=>l.map(d=>Lt(d)?d:N.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 nEe=class extends iEe{constructor(e,t,i,n,o,r){super(e,t,i),this._extensionManifestPropertiesService=r;const a=o.remoteAuthority;this._location=a?n.getHostLabel(pe.vscodeRemote,a):void 0}get location(){return this._location}validateExtensionKind(e){return!this._extensionManifestPropertiesService.canExecuteOnWorkspace(e)&&!(Wn&&this._extensionManifestPropertiesService.canExecuteOnWeb(e))?(this.logger.info(g(4829,"Cannot install the '{0}' extension because it is declared to not run in this setup.",DM(e.publisher,e.name))),!1):!0}};nEe=D([_(1,A6),_(2,bI),_(3,Fs),_(4,Jr),_(5,xm)],nEe);let aze=class{constructor(e,t){this._clipboardService=t}dispose(){}$readText(){return this._clipboardService.readText()}$writeText(e){return this._clipboardService.writeText(e)}};aze=D([Gi(Be.MainThreadClipboard),_(1,ag)],aze);let cze=class{constructor(e,t,i){this._commandService=t,this._extensionService=i,this._commandRegistrations=new mo,this._proxy=e.getProxy(Ye.ExtHostCommands),this._generateCommandsDocumentationRegistration=_t.registerCommand("_generateCommandsDocumentation",()=>this._generateCommandsDocumentation())}dispose(){this._commandRegistrations.dispose(),this._generateCommandsDocumentationRegistration.dispose()}async _generateCommandsDocumentation(){const e=await this._proxy.$getContributedCommandMetadata(),t=_t.getCommands();for(const[n,o]of t)o.metadata&&(e[n]=o.metadata);const i=[];for(const n in e)i.push("`"+n+"` - "+YKt(e[n]));console.log(i.join(` +`))}$registerCommand(e){this._commandRegistrations.set(e,_t.registerCommand(e,(t,...i)=>this._proxy.$executeContributedCommand(e,...i).then(n=>Mo(n))))}$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 qd&&(t=t.value);for(let n=0;n0&&!_t.getCommand(e))throw await this._extensionService.activateByEvent(`onCommand:${e}`),new Error("$executeCommand:retry");return this._commandService.executeCommand(e,...t)}$getCommands(){return Promise.resolve([..._t.getCommands().keys()])}};cze=D([Gi(Be.MainThreadCommands),_(1,vi),_(2,fs)],cze);function YKt(s){if(typeof s=="string")return s;{const t=[Lt(s.description)?s.description:s.description.original];if(t.push(` `),s.args)for(const i of s.args)t.push(`* _${i.name}_ - ${i.description||""} `);return s.returns&&t.push(`* _(returns)_ - ${s.returns}`),t.push(` -`),t.join("")}}let yze=class{constructor(e,t,i,n){this._workspaceContextService=t,this.configurationService=i,this._environmentService=n;const o=e.getProxy(Ye.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=uut()),e}dispose(){this._configurationListener.dispose()}$updateConfigurationOption(e,t,i,n,o){return n={resource:n?.resource?N.revive(n.resource):void 0,overrideIdentifier:n?.overrideIdentifier},this.writeConfiguration(e,t,i,n,o)}$removeConfigurationOption(e,t,i,n){return i={resource:i?.resource?N.revive(i.resource):void 0,overrideIdentifier:i?.overrideIdentifier},this.writeConfiguration(e,t,void 0,i,n)}writeConfiguration(e,t,i,n,o){e=e??this.deriveConfigurationTarget(t,n);const r=this.configurationService.inspect(t,n);switch(e){case St.MEMORY:return this._updateValue(t,i,e,r?.memory?.override,n,o);case St.WORKSPACE_FOLDER:return this._updateValue(t,i,e,r?.workspaceFolder?.override,n,o);case St.WORKSPACE:return this._updateValue(t,i,e,r?.workspace?.override,n,o);case St.USER_REMOTE:return this._updateValue(t,i,e,r?.userRemote?.override,n,o);default:return this._updateValue(t,i,e,r?.userLocal?.override,n,o)}}_updateValue(e,t,i,n,o,r){return o=r===!0?o:r===!1?{resource:o.resource}:o.overrideIdentifier&&n!==void 0?o:{resource:o.resource},this.configurationService.updateValue(e,t,o,i,{donotNotifyError:!0})}deriveConfigurationTarget(e,t){if(t.resource&&this._workspaceContextService.getWorkbenchState()===qi.WORKSPACE){const i=Qe.as(Nn.Configuration).getConfigurationProperties();if(i[e]&&(i[e].scope===at.RESOURCE||i[e].scope===at.LANGUAGE_OVERRIDABLE))return St.WORKSPACE_FOLDER}return St.WORKSPACE}};yze=D([Gi(Be.MainThreadConfiguration),_(1,yi),_(2,Te),_(3,Za)],yze);function aPe(s){const e=[];let t;try{const i=JSON.parse(s.arguments),n=i[i.length-1];n&&n.__$stack&&(i.pop(),t=n.__$stack),e.push(...i)}catch{e.push("Unable to log remote console arguments",s.arguments)}return{args:e,stack:t}}function cqt(s){if(!s)return s;const e=s.indexOf(` -`);return e===-1?s:s.substring(0,e)}function lqt(s,e){const{args:t,stack:i}=aPe(s),n=typeof t[0]=="string"&&t.length===1;let o=cqt(i);o&&(o=`(${o.trim()})`);let r=[];if(typeof t[0]=="string"?o&&n?r=[`%c[${e}] %c${t[0]} %c${o}`,wP("blue"),wP(""),wP("grey")]:r=[`%c[${e}] %c${t[0]}`,wP("blue"),wP(""),...t.slice(1)]:r=[`%c[${e}]%`,wP("blue"),...t],o&&!n&&r.push(o),typeof console[s.severity]!="function")throw new Error("Unknown console method");console[s.severity].apply(console,r)}function wP(s){return`color: ${s}`}function dqt(s,e,t=null){const i=aPe(e).args;let n=i.shift();if(typeof n=="string")switch(e.severity||(e.severity="info"),t&&(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),n=t+n),e.severity){case"log":case"info":s.info(n,...i);break;case"warn":s.warn(n,...i);break;case"error":s.error(n,...i);break}}function hqt(s,e,t){const i=aPe(e).args,n=i.shift();typeof n!="string"||e.severity!=="error"||(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),s.error(t+n,...i))}let Cze=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const n=FNe(this._environmentService);this._isExtensionDevTestFromCli=n.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?dqt(this._logService,e):(hqt(this._logService,e,"Extension Host"),lqt(e,"Extension Host"))}};Cze=D([Gi(Be.MainThreadConsole),_(1,Za),_(2,Ge)],Cze);class knt{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,n){const o={command:e};if(t&&Object.keys(t).length>0&&(o.arguments=t),this.internalSend("request",o),typeof n=="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(3793,"Timeout after {0} ms for '{1}'",n,e)};a(c)}},n)}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 Sr(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 Sr(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 Int(s){return s.configuration.request==="attach"&&!Tnt(s)&&(!s.parentSession||Int(s.parentSession))}function Tnt(s){let e=s.configuration.type;if(e)return e==="vslsShare"&&(e=s.configuration.adapterProxy.configuration.type),ua(e,"extensionhost")||ua(e,"pwa-extensionhost")?s:s.parentSession?Tnt(s.parentSession):void 0}function uqt(s){return s.type&&(s.label||s.program||s.runtime)}const gqt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function fqt(s){return!!(s&&s.match(gqt))}function Lnt(s){if(typeof s.path=="string"&&!(typeof s.sourceReference=="number"&&s.sourceReference>0)){if(fqt(s.path))return N.parse(s.path);if(pM(s.path))return N.file(s.path)}return s.path}function Rnt(s){if(typeof s.path=="object"){const e=N.revive(s.path);if(e)return e.scheme===pe.file?e.fsPath:e.toString()}return s.path}function Mnt(s,e){const t=e?Lnt:Rnt,i=xs(s);return Pnt(i,(n,o)=>{n&&o&&(o.path=t(o))}),i}function Nnt(s,e){const t=e?Lnt:Rnt,i=xs(s);return Pnt(i,(n,o)=>{!n&&o&&(o.path=t(o))}),i}function Pnt(s,e){switch(s.type){case"event":{const t=s;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=s;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=s;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(n=>e(!1,n.location));break}break}}}let Sze=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(Ye.ExtHostDebugService);const n=new mo;this._toDispose.add(n),this._toDispose.add(t.onDidNewSession(r=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(r)),n.get(r).add(r.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(r),c)}))})),this._toDispose.add(t.onWillNewSession(r=>{let a=n.get(r);a||(a=new Z,n.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||n.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(M.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,n)=>this._proxy.$editVisualizerTreeItem(i,n):void 0})}$unregisterDebugVisualizerTree(e){this._visualizerTreeHandles.get(e)?.dispose(),this._visualizerTreeHandles.delete(e)}$registerDebugVisualizer(e,t){const i=this.visualizerService.register({extensionId:new Sn(e),id:t,disposeDebugVisualizers:n=>this._proxy.$disposeDebugVisualizers(n),executeDebugVisualizerCommand:n=>this._proxy.$executeDebugVisualizerCommand(n),provideDebugVisualizers:(n,o)=>this._proxy.$provideDebugVisualizers(e,t,n,o).then(r=>r.map(qSe.deserialize)),resolveDebugVisualizer:(n,o)=>this._proxy.$resolveDebugVisualizer(n.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(n=>{if(n&&!n.sessionOnly){const o={};n.added&&(o.added=this.convertToDto(n.added)),n.removed&&(o.removed=n.removed.map(r=>r.getId())),n.changed&&(o.changed=this.convertToDto(n.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 pqt(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(n=>({id:n.id,enabled:n.enabled,lineNumber:n.line+1,column:n.character>0?n.character+1:void 0,condition:n.condition,hitCondition:n.hitCondition,logMessage:n.logMessage,mode:n.mode}));this.debugService.addBreakpoints(N.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:ZZ.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(n=>this.debugService.removeBreakpoints(n)),t.forEach(n=>this.debugService.removeFunctionBreakpoints(n)),i.forEach(n=>this.debugService.removeDataBreakpoints(n)),Promise.resolve()}$registerDebugConfigurationProvider(e,t,i,n,o,r){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(r,c,l)),n&&(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:n=>Promise.resolve(this._proxy.$provideDebugAdapter(t,this.getSessionDto(n)))};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 n=e?N.revive(e):void 0,o=this.debugService.getConfigurationManager().getLaunch(n),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,testRun:i.testRun,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(o,t,c,a)}catch(l){throw new La(l&&l.message?l.message:"cannot start debugging")}}$setDebugSessionName(e,t){this.debugService.getModel().getSession(e)?.setName(t)}$customDebugAdapterRequest(e,t,i){const n=this.debugService.getModel().getSession(e,!0);return n?n.customRequest(t,i).then(o=>o&&o.success?o.body:Promise.reject(new La(o?o.message:"custom request failed"))):Promise.reject(new La("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 La("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,Int(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new La("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:Xe.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(Nnt(t,!1))}$acceptDAError(e,t,i,n){this._debugAdapters.get(e)?.fireError(e,new Error(`${t}: ${i} -${n}`))}$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===ZZ.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(Fc)}};Sze=D([Gi(Be.MainThreadDebugService),_(1,XRe),_(2,TJe)],Sze);class pqt extends knt{constructor(e,t,i,n){super(),this._ds=e,this._handle=t,this._proxy=i,this.session=n}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,Mnt(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class mqt{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,n=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 n.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()],He.None).then(i=>{for(const[n,o]of t)o(i[n])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let Aze=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(Ye.ExtHostDecorations)}dispose(){this._provider.forEach(e=>bt(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,n=new mqt(this._proxy,e),o=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(r,a)=>{const c=await n.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[n]=i;n.fire(t&&t.map(o=>N.revive(o)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(bt(t),this._provider.delete(e))}};Aze=D([Gi(Be.MainThreadDecorations),_(1,iE)],Aze);let Eze=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(Ye.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 n=this._markerService.read({resource:i});if(n.length===0)t.push([i,[]]);else{const o=n.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[n,o]=i;if(o)for(const r of o){if(r.relatedInformation)for(const a of r.relatedInformation)a.resource=N.revive(a.resource);r.code&&typeof r.code!="string"&&(r.code.target=N.revive(r.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(N.revive(n)),o)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};Eze=D([Gi(Be.MainThreadDiagnostics),_(1,Am),_(2,ks)],Eze);var nj;let xze=nj=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=nj._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=nj._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?N.revive(e.defaultUri):void 0,title:e?.title||void 0,availableFileSystems:e?.allowUIResources?[pe.vscodeRemote,pe.file]:[]};if(e?.filters){t.filters=[];for(const[i,n]of Object.entries(e.filters))t.filters.push({name:i,extensions:n})}return t}static _convertSaveOptions(e){const t={defaultUri:e?.defaultUri?N.revive(e.defaultUri):void 0,saveLabel:e?.saveLabel||void 0,title:e?.title||void 0};if(e?.filters){t.filters=[];for(const[i,n]of Object.entries(e.filters))t.filters.push({name:i,extensions:n})}return t}};xze=nj=D([Gi(Be.MainThreadDialogs),_(1,ag)],xze);let Dze=class{constructor(e,t,i,n,o){this._textModelResolverService=t,this._languageService=i,this._modelService=n,this._editorWorkerService=o,this._resourceContentProvider=new mo,this._pendingUpdate=new Map,this._proxy=e.getProxy(Ye.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),bt(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:n=>this._proxy.$provideTextDocumentContent(e,n).then(o=>{if(typeof o=="string"){const r=o.substr(0,1+o.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(n,r);return this._modelService.createModel(o,a,n)}return null})});this._resourceContentProvider.set(e,i)}$unregisterTextContentProvider(e){this._resourceContentProvider.deleteAndDispose(e)}async $onVirtualDocumentChange(e,t){const i=this._modelService.getModel(N.revive(e));if(!i)return;this._pendingUpdate.get(i.id)?.cancel();const o=new ci;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=>Zn.replace(F.lift(a.range),a.text)))}catch(r){vt(r)}}};Dze=D([Gi(Be.MainThreadDocumentContentProviders),_(1,fn),_(2,xi),_(3,gi),_(4,Ml)],Dze);class Fnt{constructor(e,t=1e3*60*3,i=1024*1024*80,n=50){this._extUri=e,this._maxAge=t,this._maxLength=i,this._maxSize=n,this._data=new Array,this._length=0}dispose(){this._data=bt(this._data)}remove(e){for(const t of[...this._data])this._extUri.isEqualOrParent(t.uri,e)&&t.dispose()}add(e,t,i=0){const n=()=>{const a=this._data.indexOf(r);a>=0&&(this._length-=i,t.dispose(),clearTimeout(o),this._data.splice(a,1))},o=setTimeout(n,this._maxAge),r={uri:e,length:i,dispose:n};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&&bt(this._data.slice(0,e-this._maxSize))}}class _qt extends V{constructor(e,t,i,n){super(),this._model=e,this._onIsCaughtUpWithContentChanges=t,this._proxy=i,this._textFileService=n,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 dEe=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=n,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 ui,this._modelReferenceCollection=this._store.add(new Fnt(a.extUri)),this._proxy=e.getProxy(Ye.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===Ai.MOVE;if(h||d.operation===Ai.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){bt(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&&Ly(t)}handleModelAdded(e){Ly(e)&&this._modelTrackers.set(e.uri,new _qt(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(N.revive(e))}async $tryOpenDocument(e){const t=N.revive(e);if(!t.scheme||!(t.fsPath||t.authority))throw new La("Invalid uri. Scheme and authority or path must be set.");const i=this._uriIdentityService.asCanonicalUri(t);let n;switch(i.scheme){case pe.untitled:n=this._handleUntitledScheme(i);break;case pe.file:default:n=this._handleAsResourceInput(i);break}let o;try{o=await n}catch(r){throw new La(`cannot open ${i.toString()}. Detail: ${Nr(r)}`)}if(o)if(xn.isEqual(o,i)){if(this._modelTrackers.has(i))return i;throw new La(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new La(`cannot open ${i.toString()}. Detail: Actual document opened as ${o.toString()}`);else throw new La(`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=x8(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 n=this._textFileService.untitled.create({associatedResource:e,languageId:t,initialValue:i}),o=n.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()),M.once(n.onDidRevert)(()=>this._modelReferenceCollection.remove(o)),this._proxy.$acceptDirtyStateChanged(o,!0),o}};dEe=D([_(1,gi),_(2,Fo),_(3,Jt),_(4,fn),_(5,Jr),_(6,ks),_(7,zb),_(8,bf)],dEe);class Nw{static readFromEditor(e,t,i){const n=Nw._readSelectionsFromCodeEditor(e,i),o=Nw._readOptionsFromCodeEditor(e,t,i),r=Nw._readVisibleRangesFromCodeEditor(e,i);return new Nw(n,o,r)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new dt(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 n,o;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);n=a.get(x.cursorStyle),o=c.renderType}else e?(n=e.options.cursorStyle,o=e.options.lineNumbers):(n=qr.Line,o=wr.On);const r=t.getOptions();return{insertSpaces:r.insertSpaces,tabSize:r.tabSize,indentSize:r.indentSize,originalIndentSize:r.originalIndentSize,cursorStyle:n,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||!Nw._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!Nw._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!Nw._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return is(e,t,(i,n)=>i.equalsSelection(n))}static _rangesEqual(e,t){return is(e,t,(i,n)=>i.equalsRange(n))}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 vqt{constructor(e,t,i,n,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=n,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(Nw.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,n=o=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(o)):t=o};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(o=>{i()&&n(o.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(o=>{i()&&n(null)})),this._codeEditorListeners.add(this._codeEditor.onDidLayoutChange(()=>{i()&&n(null)})),this._codeEditorListeners.add(this._codeEditor.onDidScrollChange(()=>{i()&&n(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(dt.liftSelection);this._setProperties(new Nw(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 n=t.insertSpaces,o=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(n=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(o=e.tabSize),this._model.detectIndentation(n,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=Vat(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case wr.On:t="on";break;case wr.Relative:t="relative";break;case wr.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 n=0,o=Math.floor(t.length/4);n({range:F.lift(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return i.undoStopBefore&&this._codeEditor.pushUndoStop(),this._codeEditor.executeEdits("MainThreadTextEditor",n),i.undoStopAfter&&this._codeEditor.pushUndoStop(),!0}async insertSnippet(e,t,i,n){if(!this._codeEditor||!this._codeEditor.hasModel())return!1;let o;if(X_.guessNeedsClipboard(t)){const l=new Tae(this._codeEditor,jo.Value|jo.Position);if(o=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=fc.get(this._codeEditor);if(!a)return!1;this._codeEditor.focus();const c=i.map(l=>({range:F.lift(l),template:t}));return a.apply(c,{overwriteBefore:0,overwriteAfter:0,undoStopBefore:n.undoStopBefore,undoStopAfter:n.undoStopAfter,clipboardText:o}),!0}}var hEe,zR;let uEe=(zR=class{constructor(e,t,i,n,o,r){this._editorLocator=e,this._codeEditorService=i,this._editorService=n,this._editorGroupService=o,this._configurationService=r,this._toDispose=new Z,this._instanceId=String(++hEe.INSTANCE_COUNT),this._proxy=t.getProxy(Ye.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=>{bt(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(n=>{this._proxy.$acceptEditorPropertiesChanged(t,n)})),this._textEditorsListenersMap[t]=i}handleTextEditorRemoved(e){bt(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Ys(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]=rI(this._editorGroupService,t.group))}return e}async $tryShowTextDocument(e,t){const i=N.revive(e),n={preserveFocus:t.preserveFocus,pinned:t.pinned,selection:t.selection,activation:t.preserveFocus?Gk.RESTORE:void 0,override:__e.EXCLUSIVE_ONLY},o={resource:i,options:n},r=await this._editorService.openEditor(o,RZ(this._editorGroupService,this._configurationService,t.position));if(!r)return;const a=r.getControl(),c=s6(a);return c?this._editorLocator.getIdOfCodeEditor(c):void 0}async $tryShowEditor(e,t){const i=this._editorLocator.getEditor(e);if(i){const n=i.getModel();await this._editorService.openEditor({resource:n.uri,options:{preserveFocus:!1}},RZ(this._editorGroupService,this._configurationService,t));return}}async $tryHideEditor(e){const t=this._editorLocator.getEditor(e);if(t){const i=this._editorService.visibleEditorPanes;for(const n of i)if(t.matches(n)){await n.group.closeEditor(n.input);return}}}$trySetSelections(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setSelections(t),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$trySetDecorations(e,t,i){t=`${this._instanceId}-${t}`;const n=this._editorLocator.getEditor(e);return n?(n.setDecorations(t,i),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$trySetDecorationsFast(e,t,i){t=`${this._instanceId}-${t}`;const n=this._editorLocator.getEditor(e);return n?(n.setDecorationsFast(t,i),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const n=this._editorLocator.getEditor(e);return n?(n.revealRange(t,i),Promise.resolve()):Promise.reject(Pi(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,n){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.applyEdits(t,i,n)):Promise.reject(Pi(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,n,o){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.insertSnippet(t,i,n,o)):Promise.reject(Pi(`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 n=i.getId(),o=this._codeEditorService.listDiffEditors(),[r]=o.filter(c=>c.getOriginalEditor().getId()===n||c.getModifiedEditor().getId()===n);if(r)return Promise.resolve(r.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},hEe=zR,zR.INSTANCE_COUNT=0,zR);uEe=hEe=D([_(2,Kt),_(3,ei),_(4,Po),_(5,Te)],uEe);_t.registerCommand("_workbench.revertAllDirty",async function(s){if(!s.get(Za).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=s.get(Rm);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let kze=class{};class bqt{static[Symbol.hasInstance](e){return kze!=null&&e instanceof kze}}class wqt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class gEe{constructor(e,t,i,n,o,r){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=n,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 lze=class{constructor(e,t,i,n){this._workspaceContextService=t,this.configurationService=i,this._environmentService=n;const o=e.getProxy(Ye.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=tut()),e}dispose(){this._configurationListener.dispose()}$updateConfigurationOption(e,t,i,n,o){return n={resource:n?.resource?N.revive(n.resource):void 0,overrideIdentifier:n?.overrideIdentifier},this.writeConfiguration(e,t,i,n,o)}$removeConfigurationOption(e,t,i,n){return i={resource:i?.resource?N.revive(i.resource):void 0,overrideIdentifier:i?.overrideIdentifier},this.writeConfiguration(e,t,void 0,i,n)}writeConfiguration(e,t,i,n,o){e=e??this.deriveConfigurationTarget(t,n);const r=this.configurationService.inspect(t,n);switch(e){case St.MEMORY:return this._updateValue(t,i,e,r?.memory?.override,n,o);case St.WORKSPACE_FOLDER:return this._updateValue(t,i,e,r?.workspaceFolder?.override,n,o);case St.WORKSPACE:return this._updateValue(t,i,e,r?.workspace?.override,n,o);case St.USER_REMOTE:return this._updateValue(t,i,e,r?.userRemote?.override,n,o);default:return this._updateValue(t,i,e,r?.userLocal?.override,n,o)}}_updateValue(e,t,i,n,o,r){return o=r===!0?o:r===!1?{resource:o.resource}:o.overrideIdentifier&&n!==void 0?o:{resource:o.resource},this.configurationService.updateValue(e,t,o,i,{donotNotifyError:!0})}deriveConfigurationTarget(e,t){if(t.resource&&this._workspaceContextService.getWorkbenchState()===qi.WORKSPACE){const i=Qe.as(Nn.Configuration).getConfigurationProperties();if(i[e]&&(i[e].scope===at.RESOURCE||i[e].scope===at.LANGUAGE_OVERRIDABLE))return St.WORKSPACE_FOLDER}return St.WORKSPACE}};lze=D([Gi(Be.MainThreadConfiguration),_(1,yi),_(2,Te),_(3,Za)],lze);function jNe(s){const e=[];let t;try{const i=JSON.parse(s.arguments),n=i[i.length-1];n&&n.__$stack&&(i.pop(),t=n.__$stack),e.push(...i)}catch{e.push("Unable to log remote console arguments",s.arguments)}return{args:e,stack:t}}function JKt(s){if(!s)return s;const e=s.indexOf(` +`);return e===-1?s:s.substring(0,e)}function XKt(s,e){const{args:t,stack:i}=jNe(s),n=typeof t[0]=="string"&&t.length===1;let o=JKt(i);o&&(o=`(${o.trim()})`);let r=[];if(typeof t[0]=="string"?o&&n?r=[`%c[${e}] %c${t[0]} %c${o}`,_P("blue"),_P(""),_P("grey")]:r=[`%c[${e}] %c${t[0]}`,_P("blue"),_P(""),...t.slice(1)]:r=[`%c[${e}]%`,_P("blue"),...t],o&&!n&&r.push(o),typeof console[s.severity]!="function")throw new Error("Unknown console method");console[s.severity].apply(console,r)}function _P(s){return`color: ${s}`}function ZKt(s,e,t=null){const i=jNe(e).args;let n=i.shift();if(typeof n=="string")switch(e.severity||(e.severity="info"),t&&(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),n=t+n),e.severity){case"log":case"info":s.info(n,...i);break;case"warn":s.warn(n,...i);break;case"error":s.error(n,...i);break}}function eqt(s,e,t){const i=jNe(e).args,n=i.shift();typeof n!="string"||e.severity!=="error"||(/^\[/.test(t)||(t=`[${t}]`),/ $/.test(t)||(t=`${t} `),s.error(t+n,...i))}let dze=class{constructor(e,t,i){this._environmentService=t,this._logService=i;const n=ANe(this._environmentService);this._isExtensionDevTestFromCli=n.isExtensionDevTestFromCli}dispose(){}$logExtensionHostMessage(e){this._isExtensionDevTestFromCli?ZKt(this._logService,e):(eqt(this._logService,e,"Extension Host"),XKt(e,"Extension Host"))}};dze=D([Gi(Be.MainThreadConsole),_(1,Za),_(2,Ge)],dze);class wnt{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,n){const o={command:e};if(t&&Object.keys(t).length>0&&(o.arguments=t),this.internalSend("request",o),typeof n=="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(3793,"Timeout after {0} ms for '{1}'",n,e)};a(c)}},n)}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 Sr(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 Sr(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 ynt(s){return s.configuration.request==="attach"&&!Cnt(s)&&(!s.parentSession||ynt(s.parentSession))}function Cnt(s){let e=s.configuration.type;if(e)return e==="vslsShare"&&(e=s.configuration.adapterProxy.configuration.type),ua(e,"extensionhost")||ua(e,"pwa-extensionhost")?s:s.parentSession?Cnt(s.parentSession):void 0}function tqt(s){return s.type&&(s.label||s.program||s.runtime)}const iqt=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function nqt(s){return!!(s&&s.match(iqt))}function Snt(s){if(typeof s.path=="string"&&!(typeof s.sourceReference=="number"&&s.sourceReference>0)){if(nqt(s.path))return N.parse(s.path);if(hM(s.path))return N.file(s.path)}return s.path}function Ant(s){if(typeof s.path=="object"){const e=N.revive(s.path);if(e)return e.scheme===pe.file?e.fsPath:e.toString()}return s.path}function Ent(s,e){const t=e?Snt:Ant,i=xs(s);return Dnt(i,(n,o)=>{n&&o&&(o.path=t(o))}),i}function xnt(s,e){const t=e?Snt:Ant,i=xs(s);return Dnt(i,(n,o)=>{!n&&o&&(o.path=t(o))}),i}function Dnt(s,e){switch(s.type){case"event":{const t=s;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=s;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=s;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(n=>e(!1,n.location));break}break}}}let hze=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(Ye.ExtHostDebugService);const n=new mo;this._toDispose.add(n),this._toDispose.add(t.onDidNewSession(r=>{this._proxy.$acceptDebugSessionStarted(this.getSessionDto(r)),n.get(r).add(r.onDidChangeName(c=>{this._proxy.$acceptDebugSessionNameChanged(this.getSessionDto(r),c)}))})),this._toDispose.add(t.onWillNewSession(r=>{let a=n.get(r);a||(a=new Z,n.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||n.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(M.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,n)=>this._proxy.$editVisualizerTreeItem(i,n):void 0})}$unregisterDebugVisualizerTree(e){this._visualizerTreeHandles.get(e)?.dispose(),this._visualizerTreeHandles.delete(e)}$registerDebugVisualizer(e,t){const i=this.visualizerService.register({extensionId:new Sn(e),id:t,disposeDebugVisualizers:n=>this._proxy.$disposeDebugVisualizers(n),executeDebugVisualizerCommand:n=>this._proxy.$executeDebugVisualizerCommand(n),provideDebugVisualizers:(n,o)=>this._proxy.$provideDebugVisualizers(e,t,n,o).then(r=>r.map(USe.deserialize)),resolveDebugVisualizer:(n,o)=>this._proxy.$resolveDebugVisualizer(n.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(n=>{if(n&&!n.sessionOnly){const o={};n.added&&(o.added=this.convertToDto(n.added)),n.removed&&(o.removed=n.removed.map(r=>r.getId())),n.changed&&(o.changed=this.convertToDto(n.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 sqt(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(n=>({id:n.id,enabled:n.enabled,lineNumber:n.line+1,column:n.character>0?n.character+1:void 0,condition:n.condition,hitCondition:n.hitCondition,logMessage:n.logMessage,mode:n.mode}));this.debugService.addBreakpoints(N.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:JZ.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(n=>this.debugService.removeBreakpoints(n)),t.forEach(n=>this.debugService.removeFunctionBreakpoints(n)),i.forEach(n=>this.debugService.removeDataBreakpoints(n)),Promise.resolve()}$registerDebugConfigurationProvider(e,t,i,n,o,r){const a={type:e,triggerKind:t};return i&&(a.provideDebugConfigurations=(c,l)=>this._proxy.$provideDebugConfigurations(r,c,l)),n&&(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:n=>Promise.resolve(this._proxy.$provideDebugAdapter(t,this.getSessionDto(n)))};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 n=e?N.revive(e):void 0,o=this.debugService.getConfigurationManager().getLaunch(n),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,testRun:i.testRun,suppressDebugStatusbar:i.suppressDebugStatusbar,suppressDebugToolbar:i.suppressDebugToolbar,suppressDebugView:i.suppressDebugView};try{return this.debugService.startDebugging(o,t,c,a)}catch(l){throw new La(l&&l.message?l.message:"cannot start debugging")}}$setDebugSessionName(e,t){this.debugService.getModel().getSession(e)?.setName(t)}$customDebugAdapterRequest(e,t,i){const n=this.debugService.getModel().getSession(e,!0);return n?n.customRequest(t,i).then(o=>o&&o.success?o.body:Promise.reject(new La(o?o.message:"custom request failed"))):Promise.reject(new La("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 La("debug session not found"))}$stopDebugging(e){if(e){const t=this.debugService.getModel().getSession(e,!0);if(t)return this.debugService.stopSession(t,ynt(t))}else return this.debugService.stopSession(void 0);return Promise.reject(new La("debug session not found"))}$appendDebugConsole(e){this.debugService.getViewModel().focusedSession?.appendToRepl({output:e,sev:Xe.Warning})}$acceptDAMessage(e,t){this.getDebugAdapter(e).acceptMessage(xnt(t,!1))}$acceptDAError(e,t,i,n){this._debugAdapters.get(e)?.fireError(e,new Error(`${t}: ${i} +${n}`))}$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===JZ.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(Fc)}};hze=D([Gi(Be.MainThreadDebugService),_(1,HRe),_(2,CJe)],hze);class sqt extends wnt{constructor(e,t,i,n){super(),this._ds=e,this._handle=t,this._proxy=i,this.session=n}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,Ent(e,!0))}async stopSession(){return await this.cancelPendingRequests(),Promise.resolve(this._proxy.$stopDASession(this._handle))}}class oqt{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,n=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 n.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()],He.None).then(i=>{for(const[n,o]of t)o(i[n])}),this._requests=new Map,this._resolver=new Map,this._timer=void 0},0))}}let uze=class{constructor(e,t){this._decorationsService=t,this._provider=new Map,this._proxy=e.getProxy(Ye.ExtHostDecorations)}dispose(){this._provider.forEach(e=>bt(e)),this._provider.clear()}$registerDecorationProvider(e,t){const i=new I,n=new oqt(this._proxy,e),o=this._decorationsService.registerDecorationsProvider({label:t,onDidChange:i.event,provideDecorations:async(r,a)=>{const c=await n.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[n]=i;n.fire(t&&t.map(o=>N.revive(o)))}}$unregisterDecorationProvider(e){const t=this._provider.get(e);t&&(bt(t),this._provider.delete(e))}};uze=D([Gi(Be.MainThreadDecorations),_(1,eE)],uze);let gze=class{constructor(e,t,i){this._markerService=t,this._uriIdentService=i,this._activeOwners=new Set,this._proxy=e.getProxy(Ye.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 n=this._markerService.read({resource:i});if(n.length===0)t.push([i,[]]);else{const o=n.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[n,o]=i;if(o)for(const r of o){if(r.relatedInformation)for(const a of r.relatedInformation)a.resource=N.revive(a.resource);r.code&&typeof r.code!="string"&&(r.code.target=N.revive(r.code.target))}this._markerService.changeOne(e,this._uriIdentService.asCanonicalUri(N.revive(n)),o)}this._activeOwners.add(e)}$clear(e){this._markerService.changeAll(e,[]),this._activeOwners.delete(e)}};gze=D([Gi(Be.MainThreadDiagnostics),_(1,ym),_(2,ks)],gze);var tj;let fze=tj=class{constructor(e,t){this._fileDialogService=t}dispose(){}async $showOpenDialog(e){const t=tj._convertOpenOptions(e);return t.defaultUri||(t.defaultUri=await this._fileDialogService.defaultFilePath()),Promise.resolve(this._fileDialogService.showOpenDialog(t))}async $showSaveDialog(e){const t=tj._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?N.revive(e.defaultUri):void 0,title:e?.title||void 0,availableFileSystems:e?.allowUIResources?[pe.vscodeRemote,pe.file]:[]};if(e?.filters){t.filters=[];for(const[i,n]of Object.entries(e.filters))t.filters.push({name:i,extensions:n})}return t}static _convertSaveOptions(e){const t={defaultUri:e?.defaultUri?N.revive(e.defaultUri):void 0,saveLabel:e?.saveLabel||void 0,title:e?.title||void 0};if(e?.filters){t.filters=[];for(const[i,n]of Object.entries(e.filters))t.filters.push({name:i,extensions:n})}return t}};fze=tj=D([Gi(Be.MainThreadDialogs),_(1,sg)],fze);let pze=class{constructor(e,t,i,n,o){this._textModelResolverService=t,this._languageService=i,this._modelService=n,this._editorWorkerService=o,this._resourceContentProvider=new mo,this._pendingUpdate=new Map,this._proxy=e.getProxy(Ye.ExtHostDocumentContentProviders)}dispose(){this._resourceContentProvider.dispose(),bt(this._pendingUpdate.values())}$registerTextContentProvider(e,t){const i=this._textModelResolverService.registerTextModelContentProvider(t,{provideTextContent:n=>this._proxy.$provideTextDocumentContent(e,n).then(o=>{if(typeof o=="string"){const r=o.substr(0,1+o.search(/\r?\n/)),a=this._languageService.createByFilepathOrFirstLine(n,r);return this._modelService.createModel(o,a,n)}return null})});this._resourceContentProvider.set(e,i)}$unregisterTextContentProvider(e){this._resourceContentProvider.deleteAndDispose(e)}async $onVirtualDocumentChange(e,t){const i=this._modelService.getModel(N.revive(e));if(!i)return;this._pendingUpdate.get(i.id)?.cancel();const o=new ci;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=>Zn.replace(F.lift(a.range),a.text)))}catch(r){vt(r)}}};pze=D([Gi(Be.MainThreadDocumentContentProviders),_(1,fn),_(2,xi),_(3,gi),_(4,Rl)],pze);class knt{constructor(e,t=1e3*60*3,i=1024*1024*80,n=50){this._extUri=e,this._maxAge=t,this._maxLength=i,this._maxSize=n,this._data=new Array,this._length=0}dispose(){this._data=bt(this._data)}remove(e){for(const t of[...this._data])this._extUri.isEqualOrParent(t.uri,e)&&t.dispose()}add(e,t,i=0){const n=()=>{const a=this._data.indexOf(r);a>=0&&(this._length-=i,t.dispose(),clearTimeout(o),this._data.splice(a,1))},o=setTimeout(n,this._maxAge),r={uri:e,length:i,dispose:n};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&&bt(this._data.slice(0,e-this._maxSize))}}class rqt extends V{constructor(e,t,i,n){super(),this._model=e,this._onIsCaughtUpWithContentChanges=t,this._proxy=i,this._textFileService=n,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 sEe=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._modelService=t,this._textFileService=i,this._fileService=n,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 ui,this._modelReferenceCollection=this._store.add(new knt(a.extUri)),this._proxy=e.getProxy(Ye.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===Ai.MOVE;if(h||d.operation===Ai.DELETE)for(const u of d.files){const f=h?u.source:u.target;f&&this._modelReferenceCollection.remove(f)}}))}dispose(){bt(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&&ky(t)}handleModelAdded(e){ky(e)&&this._modelTrackers.set(e.uri,new rqt(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(N.revive(e))}async $tryOpenDocument(e){const t=N.revive(e);if(!t.scheme||!(t.fsPath||t.authority))throw new La("Invalid uri. Scheme and authority or path must be set.");const i=this._uriIdentityService.asCanonicalUri(t);let n;switch(i.scheme){case pe.untitled:n=this._handleUntitledScheme(i);break;case pe.file:default:n=this._handleAsResourceInput(i);break}let o;try{o=await n}catch(r){throw new La(`cannot open ${i.toString()}. Detail: ${Nr(r)}`)}if(o)if(xn.isEqual(o,i)){if(this._modelTrackers.has(i))return i;throw new La(`cannot open ${i.toString()}. Detail: Files above 50MB cannot be synchronized with extensions.`)}else throw new La(`cannot open ${i.toString()}. Detail: Actual document opened as ${o.toString()}`);else throw new La(`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=S8(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 n=this._textFileService.untitled.create({associatedResource:e,languageId:t,initialValue:i}),o=n.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()),M.once(n.onDidRevert)(()=>this._modelReferenceCollection.remove(o)),this._proxy.$acceptDirtyStateChanged(o,!0),o}};sEe=D([_(1,gi),_(2,Fo),_(3,Jt),_(4,fn),_(5,Jr),_(6,ks),_(7,Hb),_(8,mf)],sEe);class Lw{static readFromEditor(e,t,i){const n=Lw._readSelectionsFromCodeEditor(e,i),o=Lw._readOptionsFromCodeEditor(e,t,i),r=Lw._readVisibleRangesFromCodeEditor(e,i);return new Lw(n,o,r)}static _readSelectionsFromCodeEditor(e,t){let i=null;return t&&(i=t.getSelections()),!i&&e&&(i=e.selections),i||(i=[new dt(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 n,o;if(i){const a=i.getOptions(),c=a.get(x.lineNumbers);n=a.get(x.cursorStyle),o=c.renderType}else e?(n=e.options.cursorStyle,o=e.options.lineNumbers):(n=qr.Line,o=wr.On);const r=t.getOptions();return{insertSpaces:r.insertSpaces,tabSize:r.tabSize,indentSize:r.indentSize,originalIndentSize:r.originalIndentSize,cursorStyle:n,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||!Lw._selectionsEqual(e.selections,this.selections))&&(i.selections={selections:this.selections,source:t??void 0}),(!e||!Lw._optionsEqual(e.options,this.options))&&(i.options=this.options),(!e||!Lw._rangesEqual(e.visibleRanges,this.visibleRanges))&&(i.visibleRanges=this.visibleRanges),i.selections||i.options||i.visibleRanges?i:null}static _selectionsEqual(e,t){return is(e,t,(i,n)=>i.equalsSelection(n))}static _rangesEqual(e,t){return is(e,t,(i,n)=>i.equalsRange(n))}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 aqt{constructor(e,t,i,n,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=n,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(Lw.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,n=o=>{this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)?(t=null,this._updatePropertiesNow(o)):t=o};this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(o=>{i()&&n(o.source)})),this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(o=>{i()&&n(null)})),this._codeEditorListeners.add(this._codeEditor.onDidLayoutChange(()=>{i()&&n(null)})),this._codeEditorListeners.add(this._codeEditor.onDidScrollChange(()=>{i()&&n(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(dt.liftSelection);this._setProperties(new Lw(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 n=t.insertSpaces,o=t.tabSize;e.insertSpaces!=="auto"&&typeof e.insertSpaces<"u"&&(n=e.insertSpaces),e.tabSize!=="auto"&&typeof e.tabSize<"u"&&(o=e.tabSize),this._model.detectIndentation(n,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=Lat(e.cursorStyle);this._codeEditor.updateOptions({cursorStyle:t})}if(typeof e.lineNumbers<"u"){let t;switch(e.lineNumbers){case wr.On:t="on";break;case wr.Relative:t="relative";break;case wr.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 n=0,o=Math.floor(t.length/4);n({range:F.lift(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return i.undoStopBefore&&this._codeEditor.pushUndoStop(),this._codeEditor.executeEdits("MainThreadTextEditor",n),i.undoStopAfter&&this._codeEditor.pushUndoStop(),!0}async insertSnippet(e,t,i,n){if(!this._codeEditor||!this._codeEditor.hasModel())return!1;let o;if(j_.guessNeedsClipboard(t)){const l=new xae(this._codeEditor,jo.Value|jo.Position);if(o=await this._clipboardService.readText(),!l.validate(this._codeEditor))return!1}if(this._codeEditor.getModel().getVersionId()!==e)return!1;const a=fc.get(this._codeEditor);if(!a)return!1;this._codeEditor.focus();const c=i.map(l=>({range:F.lift(l),template:t}));return a.apply(c,{overwriteBefore:0,overwriteAfter:0,undoStopBefore:n.undoStopBefore,undoStopAfter:n.undoStopAfter,clipboardText:o}),!0}}var oEe,WR;let rEe=(WR=class{constructor(e,t,i,n,o,r){this._editorLocator=e,this._codeEditorService=i,this._editorService=n,this._editorGroupService=o,this._configurationService=r,this._toDispose=new Z,this._instanceId=String(++oEe.INSTANCE_COUNT),this._proxy=t.getProxy(Ye.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=>{bt(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(n=>{this._proxy.$acceptEditorPropertiesChanged(t,n)})),this._textEditorsListenersMap[t]=i}handleTextEditorRemoved(e){bt(this._textEditorsListenersMap[e]),delete this._textEditorsListenersMap[e]}_updateActiveAndVisibleTextEditors(){const e=this._getTextEditorPositionData();Ys(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]=tI(this._editorGroupService,t.group))}return e}async $tryShowTextDocument(e,t){const i=N.revive(e),n={preserveFocus:t.preserveFocus,pinned:t.pinned,selection:t.selection,activation:t.preserveFocus?Hk.RESTORE:void 0,override:h_e.EXCLUSIVE_ONLY},o={resource:i,options:n},r=await this._editorService.openEditor(o,TZ(this._editorGroupService,this._configurationService,t.position));if(!r)return;const a=r.getControl(),c=e6(a);return c?this._editorLocator.getIdOfCodeEditor(c):void 0}async $tryShowEditor(e,t){const i=this._editorLocator.getEditor(e);if(i){const n=i.getModel();await this._editorService.openEditor({resource:n.uri,options:{preserveFocus:!1}},TZ(this._editorGroupService,this._configurationService,t));return}}async $tryHideEditor(e){const t=this._editorLocator.getEditor(e);if(t){const i=this._editorService.visibleEditorPanes;for(const n of i)if(t.matches(n)){await n.group.closeEditor(n.input);return}}}$trySetSelections(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setSelections(t),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$trySetDecorations(e,t,i){t=`${this._instanceId}-${t}`;const n=this._editorLocator.getEditor(e);return n?(n.setDecorations(t,i),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$trySetDecorationsFast(e,t,i){t=`${this._instanceId}-${t}`;const n=this._editorLocator.getEditor(e);return n?(n.setDecorationsFast(t,i),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$tryRevealRange(e,t,i){const n=this._editorLocator.getEditor(e);return n?(n.revealRange(t,i),Promise.resolve()):Promise.reject(Pi(`TextEditor(${e})`))}$trySetOptions(e,t){const i=this._editorLocator.getEditor(e);return i?(i.setConfiguration(t),Promise.resolve(void 0)):Promise.reject(Pi(`TextEditor(${e})`))}$tryApplyEdits(e,t,i,n){const o=this._editorLocator.getEditor(e);return o?Promise.resolve(o.applyEdits(t,i,n)):Promise.reject(Pi(`TextEditor(${e})`))}$tryInsertSnippet(e,t,i,n,o){const r=this._editorLocator.getEditor(e);return r?Promise.resolve(r.insertSnippet(t,i,n,o)):Promise.reject(Pi(`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 n=i.getId(),o=this._codeEditorService.listDiffEditors(),[r]=o.filter(c=>c.getOriginalEditor().getId()===n||c.getModifiedEditor().getId()===n);if(r)return Promise.resolve(r.getLineChanges()||[]);const a=i.getContribution("editor.contrib.dirtydiff");return a?Promise.resolve(a.getChanges()):Promise.resolve([])}},oEe=WR,WR.INSTANCE_COUNT=0,WR);rEe=oEe=D([_(2,Kt),_(3,ei),_(4,Po),_(5,Te)],rEe);_t.registerCommand("_workbench.revertAllDirty",async function(s){if(!s.get(Za).extensionTestsLocationURI)throw new Error("Command is only available when running extension tests.");const t=s.get(Im);for(const i of t.dirtyWorkingCopies)await i.revert({soft:!0})});let mze=class{};class cqt{static[Symbol.hasInstance](e){return mze!=null&&e instanceof mze}}class lqt{constructor(e){this.editor=e,this.id=`${e.getId()},${e.getModel().id}`}}class aEe{constructor(e,t,i,n,o,r){this.removedDocuments=e,this.addedDocuments=t,this.removedEditors=i,this.addedEditors=n,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 Tue{static compute(e,t){if(!e)return new gEe([],[...t.documents.values()],[],[...t.textEditors.values()],void 0,t.activeEditor);const i=Sre(e.documents,t.documents),n=Qge(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?e.activeEditor:void 0,r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0;return new gEe(i.removed,i.added,n.removed,n.added,o,r)}constructor(e,t,i){this.documents=e,this.textEditors=t,this.activeEditor=i}}var i1;(function(s){s[s.Editor=0]="Editor",s[s.Panel=1]="Panel"})(i1||(i1={}));let fEe=class{constructor(e,t,i,n,o){this._onDidChangeState=e,this._modelService=t,this._codeEditorService=i,this._editorService=n,this._paneCompositeService=o,this._toDispose=new Z,this._toDisposeOnEditorRemove=new mo,this._activeEditorOrder=i1.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),M.filter(this._paneCompositeService.onDidPaneCompositeOpen,r=>r.viewContainerLocation===ir.Panel)(r=>this._activeEditorOrder=i1.Panel,void 0,this._toDispose),M.filter(this._paneCompositeService.onDidPaneCompositeClose,r=>r.viewContainerLocation===ir.Panel)(r=>this._activeEditorOrder=i1.Editor,void 0,this._toDispose),this._editorService.onDidVisibleEditorsChange(r=>this._activeEditorOrder=i1.Editor,void 0,this._toDispose),this._updateState()}dispose(){this._toDispose.dispose(),this._toDisposeOnEditorRemove.dispose()}_onDidAddEditor(e){this._toDisposeOnEditorRemove.set(e.getId(),jr(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(Ly(e)){if(!this._currentState){this._updateState();return}this._currentState=new Tue(this._currentState.documents.add(e),this._currentState.textEditors,this._currentState.activeEditor),this._onDidChangeState(new gEe([],[e],[],[],void 0,void 0))}}_updateState(e){const t=new Set;for(const a of this._modelService.getModels())Ly(a)&&t.add(a);const i=new Map;let n=null;for(const a of this._codeEditorService.listCodeEditors()){if(a.isSimpleWidget)continue;const c=a.getModel();if(a.hasModel()&&c&&Ly(c)&&!c.isDisposed()&&this._modelService.getModel(c.uri)){const l=new wqt(a);i.set(l.id,l),(a.hasTextFocus()||e===a&&a.hasWidgetFocus())&&(n=l.id)}}if(!n){let a;if(this._activeEditorOrder===i1.Editor?a=this._getActiveEditorFromEditorPart()||this._getActiveEditorFromPanel():a=this._getActiveEditorFromPanel()||this._getActiveEditorFromEditorPart(),a)for(const c of i.values())a===c.editor&&(n=c.id)}const o=new Tue(t,i,n),r=Tue.compute(this._currentState,o);r.isEmpty||(this._currentState=o,this._onDidChangeState(r))}_getActiveEditorFromPanel(){const e=this._paneCompositeService.getActivePaneComposite(ir.Panel);if(e instanceof bqt){const t=e.getControl();if(Qr(t))return t}}_getActiveEditorFromEditorPart(){let e=this._editorService.activeTextEditorControl;return im(e)&&(e=e.getModifiedEditor()),e}};fEe=D([_(1,gi),_(2,Kt),_(3,ei),_(4,Tm)],fEe);let Ize=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this._modelService=t,this._textFileService=i,this._editorService=n,this._editorGroupService=c,this._clipboardService=f,this._toDispose=new Z,this._textEditors=new Map,this._proxy=e.getProxy(Ye.ExtHostDocumentsAndEditors),this._mainThreadDocuments=this._toDispose.add(new dEe(e,this._modelService,this._textFileService,r,a,d,u,h,p)),e.set(Be.MainThreadDocuments,this._mainThreadDocuments),this._mainThreadEditors=this._toDispose.add(new uEe(this,e,o,this._editorService,this._editorGroupService,m)),e.set(Be.MainThreadTextEditors,this._mainThreadEditors),this._toDispose.add(new fEe(v=>this._onDelta(v),t,o,this._editorService,l))}dispose(){this._toDispose.dispose()}_onDelta(e){const t=[],i=[],n=e.removedDocuments.map(a=>a.uri);for(const a of e.addedEditors){const c=new vqt(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),n.length>0&&(r=!1,o.removedDocuments=n),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),n.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 rI(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)}};Ize=D([QN,_(1,gi),_(2,Fo),_(3,ei),_(4,Kt),_(5,Jt),_(6,fn),_(7,Po),_(8,Tm),_(9,Jr),_(10,zb),_(11,ks),_(12,dg),_(13,bf),_(14,Te)],Ize);var k0;const Lue={LEFT:"left",RIGHT:"right",FIRST:"first",LAST:"last"};function yqt(s){const e=s;return!!(e&&typeof e=="object"&&Array.isArray(e.editors)&&Array.isArray(e.mru))}function Cqt(s){const e=s;return e.kind===Do.EDITOR_MOVE&&e.editorIndex!==void 0&&e.oldEditorIndex!==void 0}var $R;let Tze=($R=class extends V{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,yqt(e)?this._id=this.deserialize(e):this._id=k0.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===Zh.MOST_RECENTLY_ACTIVE?this.mru.slice(0):this.editors.slice(0);return t?.excludeSticky?e===Zh.MOST_RECENTLY_ACTIVE?i.filter(n=>!this.isSticky(n)):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),n=t?.pinned||t?.sticky,o=!!t?.transient,r=t?.active||!this.activeEditor||!n&&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)),n&&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===Lue.FIRST?(d=0,!i&&this.isSticky(d)&&(d=this.sticky+1)):this.editorOpenPositioning===Lue.LAST?d=this.editors.length:(this.editorOpenPositioning===Lue.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)),(n||!this.preview)&&this.splice(d,!1,c),o&&this.doSetTransient(c,d,!0),!n){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:Do.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(M.once(e.onWillDispose)(()=>{const i=this.editors.indexOf(e);if(i>=0){const n={kind:Do.EDITOR_WILL_DISPOSE,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}})),t.add(e.onDidChangeDirty(()=>{const i={kind:Do.EDITOR_DIRTY,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeLabel(()=>{const i={kind:Do.EDITOR_LABEL,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeCapabilities(()=>{const i={kind:Do.EDITOR_CAPABILITIES,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(this.onDidModelChange(i=>{i.kind===Do.EDITOR_CLOSE&&i.editor?.matches(e)&&(bt(t),this.editorListeners.delete(t))}))}replaceEditor(e,t,i,n=!0){const o=this.doCloseEditor(e,cA.REPLACE,n);if(this.splice(i,!1,t),o){const r={kind:Do.EDITOR_CLOSE,...o};this._onDidModelChange.fire(r)}}closeEditor(e,t=cA.UNKNOWN,i=!0){const n=this.doCloseEditor(e,t,i);if(n){const o={kind:Do.EDITOR_CLOSE,...n};return this._onDidModelChange.fire(o),n}}doCloseEditor(e,t,i){const n=this.indexOf(e);if(n===-1)return;const o=this.editors[n],r=this.isSticky(n),a=this.active===o;if(i&&a)if(this.mru.length>1){let c;this.focusRecentEditorAfterClose?c=this.mru[1]:n===this.editors.length-1?c=this.editors[n-1]:c=this.editors[n+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(n,!0),{editor:o,sticky:r,editorIndex:n,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 n=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,n);const r={kind:Do.EDITOR_MOVE,editor:n,oldEditorIndex:i,editorIndex:t};if(this._onDidModelChange.fire(r),o!==this.sticky){const a={kind:Do.EDITOR_STICKY,editor:n,editorIndex:t};this._onDidModelChange.fire(a)}return n}setActive(e){let t;return e?t=this.setEditorActive(e):this.setGroupActive(),t}setGroupActive(){this._onDidModelChange.fire({kind:Do.GROUP_ACTIVE})}setEditorActive(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doSetSelection(i,n,[]),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[n,o]=i,r=new Set;for(const a of t){const c=this.findEditor(a);if(!c)return;const[l]=c;l!==n&&r.add(l)}this.doSetSelection(n,o,Array.from(r))}doSetSelection(e,t,i){const n=this.activeEditor,o=this.selection;let r;e?r=[e,...i]:r=[],this.selection=r;const a=e&&typeof t=="number"&&n!==e;if(a){const c=this.indexOf(e,this.mru);this.mru.splice(c,1),this.mru.unshift(e);const l={kind:Do.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:Do.EDITORS_SELECTION};this._onDidModelChange.fire(c)}}setIndex(e){this._onDidModelChange.fire({kind:Do.GROUP_INDEX})}setLabel(e){this._onDidModelChange.fire({kind:Do.GROUP_LABEL})}pin(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doPin(i,n),i}doPin(e,t){if(this.isPinned(e))return;this.setTransient(e,!1),this.preview=null;const i={kind:Do.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(i)}unpin(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doUnpin(i,n),i}doUnpin(e,t){if(!this.isPinned(e))return;const i=this.preview;this.preview=e;const n={kind:Do.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(n),i&&this.closeEditor(i,cA.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,n]=t;return this.doStick(i,n),i}doStick(e,t){if(this.isSticky(t))return;this.pin(e);const i=this.sticky+1;this.moveEditor(e,i),this.sticky++;const n={kind:Do.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}unstick(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doUnstick(i,n),i}doUnstick(e,t){if(!this.isSticky(t))return;const i=this.sticky;this.moveEditor(e,i),this.sticky--;const n={kind:Do.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}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[n,o]=i;return this.doSetTransient(n,o,t),n}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 n={kind:Do.EDITOR_TRANSIENT,editor:e,editorIndex:t};this._onDidModelChange.fire(n)}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 n=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(n,this.mru);t&&!i?this.mru.splice(o,1):t&&i&&this.mru.splice(o,1,i)}}indexOf(e,t=this.editors,i){let n=-1;if(!e)return n;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:n,sticky:o>=0?o:void 0}}deserialize(e){const t=Qe.as(tC.EditorFactory);return typeof e.id=="number"?(this._id=e.id,k0.IDS=Math.max(e.id+1,k0.IDS)):this._id=k0.IDS++,e.locked&&(this.locked=!0),this.editors=Fi(e.editors.map((i,n)=>{let o;const r=t.getEditorSerializer(i.id);if(r){const a=r.deserialize(this.instantiationService,i.value);a instanceof Ob&&(o=a,this.registerEditorListeners(o))}return!o&&typeof e.sticky=="number"&&n<=e.sticky&&e.sticky--,o})),this.mru=Fi(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(){bt(Array.from(this.editorListeners)),this.editorListeners.clear(),this.transient.clear(),super.dispose()}},k0=$R,$R.IDS=0,$R);Tze=k0=D([_(1,we),_(2,Te)],Tze);class Sqt extends V{constructor(e,t){super(),this._register(ue(e,ke.DRAG_START,()=>{t()?.windowDidDragStart()}));const i=()=>{t()?.windowDidDragEnd()};this._register(ue(e,ke.DRAG_END,i)),this._register(ue(e,ke.MOUSE_MOVE,n=>{n.buttons===0&&i()}))}}const Goe=class Goe extends Ob{get typeId(){return Goe.typeId}get editorId(){return this.viewType}get capabilities(){return Ei.Readonly|Ei.Singleton|Ei.CanDropIntoEditor}get resource(){return N.from({scheme:pe.webviewPanel,path:`webview-panel/webview-${this._resourceId}`})}constructor(e,t,i){super(),this._iconManager=i,this._resourceId=ar(),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)}};Goe.typeId="workbench.editors.webviewInput";let Ou=Goe;var pEe;const Aqt=new Q("activeWebviewPanelId","",{type:"string",description:g(9520,"The viewType of the currently active webview panel.")});var GR;let Lze=(GR=class extends IZ{get onDidFocus(){return this._onDidFocusWebview.event}constructor(e,t,i,n,o,r,a,c,l){super(pEe.ID,e,t,i,n),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 wn),this._onDidFocusWebview=this._register(new I),this._scopedContextKeyService=this._register(new wn);const d=o.getPart(e);this._register(M.any(d.onDidScroll,d.onDidAddGroup,d.onDidRemoveGroup,d.onDidMoveGroup)(()=>{this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview)}))}get webview(){return this.input instanceof Ou?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-${ar()}`,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&&!Wn&&(this._onFocusWindowHandler.value=this._hostService.onDidChangeFocus(e=>{e&&this._editorService.activeEditorPane===this&&this._workbenchLayoutService.hasFocus($v.EDITOR_PART)&&this.focus()})),this.webview?.focus()}setEditorVisible(e){this._visible=e,this.input instanceof Ou&&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,n){if(this.input&&e.matches(this.input))return;const o=e instanceof Ou&&e.webview===this.webview;this.webview&&!o&&this.webview.release(this),await super.setInput(e,t,i,n),await e.resolve(),!(n.isCancellationRequested||this._isDisposed)&&e instanceof Ou&&(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),Adt(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 Sqt(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,$v.EDITOR_PART);e.layoutWebviewOverElement(this._element.parentElement,t,i)}trackFocus(e){const t=new Z,i=Ac(e.container);return t.add(i),t.add(i.onDidFocus(()=>this._onDidFocusWebview.fire())),t.add(e.onDidFocus(()=>this._onDidFocusWebview.fire())),t}},pEe=GR,GR.ID="WebviewEditor",GR);Lze=pEe=D([_(1,Yi),_(2,pn),_(3,$i),_(4,Po),_(5,ei),_(6,kI),_(7,xc),_(8,Le)],Lze);let mEe=class extends V{constructor(e,t){super(),this._lifecycleService=e,this._configService=t,this._icons=new Map,this._register(this._configService.onDidChangeConfiguration(i=>{i.affectsConfiguration("workbench.iconTheme")&&this.updateStyleSheet()}))}dispose(){super.dispose(),this._styleElement=void 0}get styleElement(){return this._styleElement||(this._styleElement=gl(void 0,void 0,this._store),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(Rs.Starting);const e=[];if(this._configService.getValue("workbench.iconTheme")!==null)for(const[t,i]of this._icons){const n=`.show-file-icons .webview-${t}-name-file-icon::before`;try{e.push(`.monaco-workbench.vs ${n}, .monaco-workbench.hc-light ${n} { content: ""; background-image: ${Zu(i.light)}; }`,`.monaco-workbench.vs-dark ${n}, .monaco-workbench.hc-black ${n} { content: ""; background-image: ${Zu(i.dark)}; }`)}catch{}}this.styleElement.textContent=e.join(` -`)}};mEe=D([_(0,ig),_(1,Te)],mEe);function Cte(s,e){return s.canResolve(e)}let hN=class extends Ou{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=Rr(e=>this._webviewWorkbenchService.resolveWebview(this,e));try{await this._resolvePromise}catch(e){if(!Fr(e))throw e}}return super.resolve()}transfer(e){if(super.transfer(e))return e._resolved=this._resolved,e}};hN.__decorator=D([Zt],hN.prototype,"resolve",null);hN=D([_(2,N6)],hN);class Eqt{constructor(){this._awaitingRevival=[]}enqueueForRestoration(e,t){const i=new dc,n=()=>{const r=this._awaitingRevival.findIndex(a=>e===a.input);r>=0&&this._awaitingRevival.splice(r,1)},o=jr(e.webview.onDidDispose(n),t.onCancellationRequested(()=>{n(),i.cancel()}));return this._awaitingRevival.push({input:e,promise:i,disposable:o}),i.p}reviveFor(e,t){const i=this._awaitingRevival.filter(({input:n})=>Cte(e,n));this._awaitingRevival=this._awaitingRevival.filter(({input:n})=>!Cte(e,n));for(const{input:n,promise:o,disposable:r}of i)e.resolveWebview(n,t).then(a=>o.complete(a),a=>o.error(a)).finally(()=>{r.dispose()})}}let Rze=class extends V{constructor(e,t,i,n){super(),this._editorService=t,this._instantiationService=i,this._webviewService=n,this._revivers=new Set,this._revivalPool=new Eqt,this._onDidChangeActiveWebviewEditor=this._register(new I),this.onDidChangeActiveWebviewEditor=this._onDidChangeActiveWebviewEditor.event,this._iconManager=this._register(this._instantiationService.createInstance(mEe)),this._register(e.registerContextKeyProvider({contextKey:Aqt,getGroupContextKeyValue:o=>this.getWebviewId(o.activeEditor)})),this._register(t.onDidActiveEditorChange(()=>{this.updateActiveWebview()})),this._register(n.onDidChangeActiveWebview(()=>{this.updateActiveWebview()})),this.updateActiveWebview()}get iconManager(){return this._iconManager}getWebviewId(e){let t;return e instanceof Ou?t=e:e instanceof qg&&(e.primary instanceof Ou?t=e.primary:e.secondary instanceof Ou&&(t=e.secondary)),t?.webview.providedViewType??""}updateActiveWebview(){const e=this._editorService.activeEditor;let t;e instanceof Ou?t=e:e instanceof qg&&(e.primary instanceof Ou&&e.primary.webview===this._webviewService.activeWebview?t=e.primary:e.secondary instanceof Ou&&e.secondary.webview===this._webviewService.activeWebview&&(t=e.secondary)),t!==this._activeWebview&&(this._activeWebview=t,this._onDidChangeActiveWebviewEditor.fire(t))}openWebview(e,t,i,n){const o=this._webviewService.createWebviewOverlay(e),r=this._instantiationService.createInstance(Ou,{viewType:t,name:i,providedId:e.providedViewType},o,this.iconManager);return this._editorService.openEditor(r,{pinned:!0,preserveFocus:n.preserveFocus,activation:n.preserveFocus?Gk.RESTORE:void 0},n.group),r}revealWebview(e,t,i){const n=this.findTopLevelEditorForWebview(e);this._editorService.openEditor(n,{preserveFocus:i,activation:i?Gk.RESTORE:void 0},t)}findTopLevelEditorForWebview(e){for(const t of this._editorService.editors)if(t===e||t instanceof qg&&(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(hN,{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 ci;return this._revivalPool.reviveFor(e,t.token),Ee(()=>{this._revivers.delete(e),t.dispose(!0)})}shouldPersist(e){return e instanceof hN?!0:hi.some(this._revivers.values(),t=>Cte(t,e))}async tryRevive(e,t){for(const i of this._revivers.values())if(Cte(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)}};Rze=D([_(0,Po),_(1,ei),_(2,we),_(3,qae)],Rze);var zP,KR;let oB=(KR=class extends hN{static create(e,t,i,n,o){return e.invokeFunction(r=>{const a=r.get(W6).getValue(t),c=a?$e.fromString(a):void 0,l=r.get(qae).createWebviewOverlay({providedViewType:i,title:void 0,options:{customClasses:o?.customClasses},contentOptions:{},extension:void 0}),d=e.createInstance(zP,{resource:t,viewType:i},l,{untitledDocumentData:c,oldResource:o?.oldResource});return typeof n<"u"&&d.updateGroup(n),d})}get resource(){return this._editorResource}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super({providedId:e.viewType,viewType:e.viewType,name:""},t,n),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 zP.typeId}get editorId(){return this.viewType}get capabilities(){let e=Ei.None;return e|=Ei.CanDropIntoEditor,this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument||(e|=Ei.Singleton),this._modelRef?this._modelRef.object.isReadonly()&&(e|=Ei.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly),this.resource.scheme===pe.untitled&&(e|=Ei.Untitled),e}getName(){return typeof this._editorName!="string"&&(this._editorName=this.customEditorLabelService.getName(this.resource)??Ko(this.labelService.getUriLabel(this.resource))),this._editorName}getDescription(e=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.shortDescription;case Ls.LONG:return this.longDescription;case Ls.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Lr(this.resource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Lr(this.resource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Lr(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 Ls.SHORT:return this.shortTitle;case Ls.LONG:return this.longTitle;default:case Ls.MEDIUM:return this.mediumTitle}}matches(e){return super.matches(e)?!0:this===e||e instanceof zP&&this.viewType===e.viewType&&ji(this.resource,e.resource)}copy(){return zP.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 ji(i,this.resource)?this:{resource:i}}async saveAs(e,t){if(!this._modelRef)return;const i=this._editorResource,n=await this.fileDialogService.pickFileToSave(i,t?.availableFileSystems);if(n&&await this._modelRef.object.saveCustomEditorAs(this._editorResource,n,t))return(await this.rename(e,n))?.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(qn(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 qn(this._modelRef),this.undoRedoService.undo(this.resource)}redo(){return qn(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 oJe(g(9516,"Unable to open the editor in this window, it contains modifications that can only be saved in the original window."),[rl({id:"openInOriginalWindow",label:g(9517,"Open in Original Window"),run:async()=>{const n=this.editorGroupsService.getPart(this.layoutService.getContainer(ct(this.webview.container).window));this.editorGroupsService.getPart(this.layoutService.getContainer(t.window)).activeGroup.moveEditor(this,n.activeGroup)}})],{forceMessage:!0});return super.claim(e,t,i)}canMove(e,t){const i=this.editorGroupsService.getGroup(t);if(i){const n=this.doCanMove(i.windowId);if(typeof n=="string")return n}return super.canMove(e,t)}doCanMove(e){return this.isModified()&&this._modelRef?.object.canHotExit===!1&&ct(this.webview.container).vscodeWindowId!==e?g(9518,"Unable to move '{0}': The editor contains changes that can only be saved in its current window.",this.getName()):!0}},zP=KR,KR.typeId="workbench.editors.webviewEditor",KR);oB=zP=D([_(3,N6),_(4,we),_(5,Fs),_(6,JRe),_(7,ag),_(8,JA),_(9,Jt),_(10,_d),_(11,Po),_(12,kI),_(13,nE)],oB);var $P,yk;let _Ee=(yk=class extends Ob{static create(e,t,i,n,o){return e.createInstance($P,t,i,n,o)}static setName(e,t){t&&(this.windowNames[e.path]=t)}get editorId(){return"interactive"}get typeId(){return $P.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,n,o,r,a,c,l,d,h){const u=JT.getOrCreate(o,e,void 0,"interactive",{});super(),this._notebookService=l,this._fileDialogService=d,this.isScratchpad=h.getValue(HAe.InteractiveWindowPromptToSave)!==!0,this._notebookEditorInput=u,this._register(this._notebookEditorInput),this.name=i??$P.windowNames[e.path]??Ko(e.path,Gy(e.path)),this._initLanguage=n,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=M.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?Ei.Scratchpad:0;return Ei.Untitled|Ei.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??Ca;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(Ei.Untitled)?this.saveAs(e,t):(await this._editorModelReference.save(t),this)}async saveAs(e,t){if(!this._editorModelReference||!this._notebookService.getContributedNotebookType("interactive"))return;const n=this.getName()+".ipynb",o=Pt(await this._fileDialogService.defaultFilePath(),n),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 $P?ji(this.resource,e.resource)&&ji(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}},$P=yk,yk.windowNames={},yk.ID="workbench.input.interactive",yk);_Ee=$P=D([_(4,we),_(5,fn),_(6,eMe),_(7,MJe),_(8,tE),_(9,ag),_(10,Te)],_Ee);const $C=class $C{static join(e){if(e.length===0)return;let t=Number.MAX_SAFE_INTEGER,i=0;for(const n of e)t=Math.min(t,n.startLineNumber),i=Math.max(i,n.startLineNumber+n.lineCount);return new $C(t,i-t)}static fromLineNumbers(e,t){return new $C(e,t-e)}constructor(e,t){if(this.startLineNumber=e,this.lineCount=t,t<0)throw new Ni}join(e){return new $C(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 $C(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,nu);let jg=$C;const xqt={start:"<<<<<<<",end:">>>>>>>"};function*Dqt(s,e,t){const i=new Uy(e);for(const n of s){i.takeWhile(r=>Ek.isGreaterThan(t(n,r)));const o=i.takeWhile(r=>Ek.isNeitherLessOrGreaterThan(t(n,r)));yield{left:n,rights:o||[]}}}function Ont(...s){return[].concat(...s)}let Mze=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,Ie.PROFILE);if(e!==void 0)try{this.value=JSON.parse(e)}catch(t){vt(t)}this.hasValue=!0}return this.value}set(e){this.value=e,this.storageService.store(this.key,JSON.stringify(this.value),Ie.PROFILE,an.USER)}};Mze=D([_(1,$i)],Mze);class g${constructor(e,t){this.range=e,this.newLines=t}equals(e){return this.range.equals(e.range)&&is(this.newLines,e.newLines)}toEdits(e){return new Iqt([this]).toEdits(e)}}class kqt{constructor(e,t){this.range=e,this.newText=t}equals(e){return F.equalsRange(this.range,e.range)&&this.newText===e.newText}}class Iqt{constructor(e){this.edits=e}toEdits(e){return this.edits.map(t=>t.range.endLineNumberExclusive<=e?{range:new F(t.range.startLineNumber,1,t.range.endLineNumberExclusive,1),text:t.newLines.map(i=>i+` +`,e}}class Sue{static compute(e,t){if(!e)return new aEe([],[...t.documents.values()],[],[...t.textEditors.values()],void 0,t.activeEditor);const i=bre(e.documents,t.documents),n=Vge(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?e.activeEditor:void 0,r=e.activeEditor!==t.activeEditor?t.activeEditor:void 0;return new aEe(i.removed,i.added,n.removed,n.added,o,r)}constructor(e,t,i){this.documents=e,this.textEditors=t,this.activeEditor=i}}var X0;(function(s){s[s.Editor=0]="Editor",s[s.Panel=1]="Panel"})(X0||(X0={}));let cEe=class{constructor(e,t,i,n,o){this._onDidChangeState=e,this._modelService=t,this._codeEditorService=i,this._editorService=n,this._paneCompositeService=o,this._toDispose=new Z,this._toDisposeOnEditorRemove=new mo,this._activeEditorOrder=X0.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),M.filter(this._paneCompositeService.onDidPaneCompositeOpen,r=>r.viewContainerLocation===ir.Panel)(r=>this._activeEditorOrder=X0.Panel,void 0,this._toDispose),M.filter(this._paneCompositeService.onDidPaneCompositeClose,r=>r.viewContainerLocation===ir.Panel)(r=>this._activeEditorOrder=X0.Editor,void 0,this._toDispose),this._editorService.onDidVisibleEditorsChange(r=>this._activeEditorOrder=X0.Editor,void 0,this._toDispose),this._updateState()}dispose(){this._toDispose.dispose(),this._toDisposeOnEditorRemove.dispose()}_onDidAddEditor(e){this._toDisposeOnEditorRemove.set(e.getId(),jr(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(ky(e)){if(!this._currentState){this._updateState();return}this._currentState=new Sue(this._currentState.documents.add(e),this._currentState.textEditors,this._currentState.activeEditor),this._onDidChangeState(new aEe([],[e],[],[],void 0,void 0))}}_updateState(e){const t=new Set;for(const a of this._modelService.getModels())ky(a)&&t.add(a);const i=new Map;let n=null;for(const a of this._codeEditorService.listCodeEditors()){if(a.isSimpleWidget)continue;const c=a.getModel();if(a.hasModel()&&c&&ky(c)&&!c.isDisposed()&&this._modelService.getModel(c.uri)){const l=new lqt(a);i.set(l.id,l),(a.hasTextFocus()||e===a&&a.hasWidgetFocus())&&(n=l.id)}}if(!n){let a;if(this._activeEditorOrder===X0.Editor?a=this._getActiveEditorFromEditorPart()||this._getActiveEditorFromPanel():a=this._getActiveEditorFromPanel()||this._getActiveEditorFromEditorPart(),a)for(const c of i.values())a===c.editor&&(n=c.id)}const o=new Sue(t,i,n),r=Sue.compute(this._currentState,o);r.isEmpty||(this._currentState=o,this._onDidChangeState(r))}_getActiveEditorFromPanel(){const e=this._paneCompositeService.getActivePaneComposite(ir.Panel);if(e instanceof cqt){const t=e.getControl();if(Qr(t))return t}}_getActiveEditorFromEditorPart(){let e=this._editorService.activeTextEditorControl;return Zp(e)&&(e=e.getModifiedEditor()),e}};cEe=D([_(1,gi),_(2,Kt),_(3,ei),_(4,Dm)],cEe);let _ze=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this._modelService=t,this._textFileService=i,this._editorService=n,this._editorGroupService=c,this._clipboardService=f,this._toDispose=new Z,this._textEditors=new Map,this._proxy=e.getProxy(Ye.ExtHostDocumentsAndEditors),this._mainThreadDocuments=this._toDispose.add(new sEe(e,this._modelService,this._textFileService,r,a,d,u,h,p)),e.set(Be.MainThreadDocuments,this._mainThreadDocuments),this._mainThreadEditors=this._toDispose.add(new rEe(this,e,o,this._editorService,this._editorGroupService,m)),e.set(Be.MainThreadTextEditors,this._mainThreadEditors),this._toDispose.add(new cEe(v=>this._onDelta(v),t,o,this._editorService,l))}dispose(){this._toDispose.dispose()}_onDelta(e){const t=[],i=[],n=e.removedDocuments.map(a=>a.uri);for(const a of e.addedEditors){const c=new aqt(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),n.length>0&&(r=!1,o.removedDocuments=n),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),n.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 tI(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)}};_ze=D([$N,_(1,gi),_(2,Fo),_(3,ei),_(4,Kt),_(5,Jt),_(6,fn),_(7,Po),_(8,Dm),_(9,Jr),_(10,Hb),_(11,ks),_(12,ag),_(13,mf),_(14,Te)],_ze);var E0;const Aue={LEFT:"left",RIGHT:"right",FIRST:"first",LAST:"last"};function dqt(s){const e=s;return!!(e&&typeof e=="object"&&Array.isArray(e.editors)&&Array.isArray(e.mru))}function hqt(s){const e=s;return e.kind===Do.EDITOR_MOVE&&e.editorIndex!==void 0&&e.oldEditorIndex!==void 0}var HR;let vze=(HR=class extends V{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,dqt(e)?this._id=this.deserialize(e):this._id=E0.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===Xh.MOST_RECENTLY_ACTIVE?this.mru.slice(0):this.editors.slice(0);return t?.excludeSticky?e===Xh.MOST_RECENTLY_ACTIVE?i.filter(n=>!this.isSticky(n)):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),n=t?.pinned||t?.sticky,o=!!t?.transient,r=t?.active||!this.activeEditor||!n&&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)),n&&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===Aue.FIRST?(d=0,!i&&this.isSticky(d)&&(d=this.sticky+1)):this.editorOpenPositioning===Aue.LAST?d=this.editors.length:(this.editorOpenPositioning===Aue.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)),(n||!this.preview)&&this.splice(d,!1,c),o&&this.doSetTransient(c,d,!0),!n){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:Do.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(M.once(e.onWillDispose)(()=>{const i=this.editors.indexOf(e);if(i>=0){const n={kind:Do.EDITOR_WILL_DISPOSE,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}})),t.add(e.onDidChangeDirty(()=>{const i={kind:Do.EDITOR_DIRTY,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeLabel(()=>{const i={kind:Do.EDITOR_LABEL,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(e.onDidChangeCapabilities(()=>{const i={kind:Do.EDITOR_CAPABILITIES,editor:e,editorIndex:this.editors.indexOf(e)};this._onDidModelChange.fire(i)})),t.add(this.onDidModelChange(i=>{i.kind===Do.EDITOR_CLOSE&&i.editor?.matches(e)&&(bt(t),this.editorListeners.delete(t))}))}replaceEditor(e,t,i,n=!0){const o=this.doCloseEditor(e,aA.REPLACE,n);if(this.splice(i,!1,t),o){const r={kind:Do.EDITOR_CLOSE,...o};this._onDidModelChange.fire(r)}}closeEditor(e,t=aA.UNKNOWN,i=!0){const n=this.doCloseEditor(e,t,i);if(n){const o={kind:Do.EDITOR_CLOSE,...n};return this._onDidModelChange.fire(o),n}}doCloseEditor(e,t,i){const n=this.indexOf(e);if(n===-1)return;const o=this.editors[n],r=this.isSticky(n),a=this.active===o;if(i&&a)if(this.mru.length>1){let c;this.focusRecentEditorAfterClose?c=this.mru[1]:n===this.editors.length-1?c=this.editors[n-1]:c=this.editors[n+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(n,!0),{editor:o,sticky:r,editorIndex:n,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 n=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,n);const r={kind:Do.EDITOR_MOVE,editor:n,oldEditorIndex:i,editorIndex:t};if(this._onDidModelChange.fire(r),o!==this.sticky){const a={kind:Do.EDITOR_STICKY,editor:n,editorIndex:t};this._onDidModelChange.fire(a)}return n}setActive(e){let t;return e?t=this.setEditorActive(e):this.setGroupActive(),t}setGroupActive(){this._onDidModelChange.fire({kind:Do.GROUP_ACTIVE})}setEditorActive(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doSetSelection(i,n,[]),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[n,o]=i,r=new Set;for(const a of t){const c=this.findEditor(a);if(!c)return;const[l]=c;l!==n&&r.add(l)}this.doSetSelection(n,o,Array.from(r))}doSetSelection(e,t,i){const n=this.activeEditor,o=this.selection;let r;e?r=[e,...i]:r=[],this.selection=r;const a=e&&typeof t=="number"&&n!==e;if(a){const c=this.indexOf(e,this.mru);this.mru.splice(c,1),this.mru.unshift(e);const l={kind:Do.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:Do.EDITORS_SELECTION};this._onDidModelChange.fire(c)}}setIndex(e){this._onDidModelChange.fire({kind:Do.GROUP_INDEX})}setLabel(e){this._onDidModelChange.fire({kind:Do.GROUP_LABEL})}pin(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doPin(i,n),i}doPin(e,t){if(this.isPinned(e))return;this.setTransient(e,!1),this.preview=null;const i={kind:Do.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(i)}unpin(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doUnpin(i,n),i}doUnpin(e,t){if(!this.isPinned(e))return;const i=this.preview;this.preview=e;const n={kind:Do.EDITOR_PIN,editor:e,editorIndex:t};this._onDidModelChange.fire(n),i&&this.closeEditor(i,aA.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,n]=t;return this.doStick(i,n),i}doStick(e,t){if(this.isSticky(t))return;this.pin(e);const i=this.sticky+1;this.moveEditor(e,i),this.sticky++;const n={kind:Do.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}unstick(e){const t=this.findEditor(e);if(!t)return;const[i,n]=t;return this.doUnstick(i,n),i}doUnstick(e,t){if(!this.isSticky(t))return;const i=this.sticky;this.moveEditor(e,i),this.sticky--;const n={kind:Do.EDITOR_STICKY,editor:e,editorIndex:i};this._onDidModelChange.fire(n)}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[n,o]=i;return this.doSetTransient(n,o,t),n}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 n={kind:Do.EDITOR_TRANSIENT,editor:e,editorIndex:t};this._onDidModelChange.fire(n)}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 n=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(n,this.mru);t&&!i?this.mru.splice(o,1):t&&i&&this.mru.splice(o,1,i)}}indexOf(e,t=this.editors,i){let n=-1;if(!e)return n;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:n,sticky:o>=0?o:void 0}}deserialize(e){const t=Qe.as(Xy.EditorFactory);return typeof e.id=="number"?(this._id=e.id,E0.IDS=Math.max(e.id+1,E0.IDS)):this._id=E0.IDS++,e.locked&&(this.locked=!0),this.editors=Fi(e.editors.map((i,n)=>{let o;const r=t.getEditorSerializer(i.id);if(r){const a=r.deserialize(this.instantiationService,i.value);a instanceof Nb&&(o=a,this.registerEditorListeners(o))}return!o&&typeof e.sticky=="number"&&n<=e.sticky&&e.sticky--,o})),this.mru=Fi(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(){bt(Array.from(this.editorListeners)),this.editorListeners.clear(),this.transient.clear(),super.dispose()}},E0=HR,HR.IDS=0,HR);vze=E0=D([_(1,we),_(2,Te)],vze);class uqt extends V{constructor(e,t){super(),this._register(ue(e,ke.DRAG_START,()=>{t()?.windowDidDragStart()}));const i=()=>{t()?.windowDidDragEnd()};this._register(ue(e,ke.DRAG_END,i)),this._register(ue(e,ke.MOUSE_MOVE,n=>{n.buttons===0&&i()}))}}const Uoe=class Uoe extends Nb{get typeId(){return Uoe.typeId}get editorId(){return this.viewType}get capabilities(){return Ei.Readonly|Ei.Singleton|Ei.CanDropIntoEditor}get resource(){return N.from({scheme:pe.webviewPanel,path:`webview-panel/webview-${this._resourceId}`})}constructor(e,t,i){super(),this._iconManager=i,this._resourceId=ar(),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)}};Uoe.typeId="workbench.editors.webviewInput";let Pu=Uoe;var lEe;const gqt=new Y("activeWebviewPanelId","",{type:"string",description:g(9520,"The viewType of the currently active webview panel.")});var UR;let bze=(UR=class extends DZ{get onDidFocus(){return this._onDidFocusWebview.event}constructor(e,t,i,n,o,r,a,c,l){super(lEe.ID,e,t,i,n),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 wn),this._onDidFocusWebview=this._register(new I),this._scopedContextKeyService=this._register(new wn);const d=o.getPart(e);this._register(M.any(d.onDidScroll,d.onDidAddGroup,d.onDidRemoveGroup,d.onDidMoveGroup)(()=>{this.webview&&this._visible&&this.synchronizeWebviewContainerDimensions(this.webview)}))}get webview(){return this.input instanceof Pu?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-${ar()}`,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&&!Wn&&(this._onFocusWindowHandler.value=this._hostService.onDidChangeFocus(e=>{e&&this._editorService.activeEditorPane===this&&this._workbenchLayoutService.hasFocus(Uv.EDITOR_PART)&&this.focus()})),this.webview?.focus()}setEditorVisible(e){this._visible=e,this.input instanceof Pu&&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,n){if(this.input&&e.matches(this.input))return;const o=e instanceof Pu&&e.webview===this.webview;this.webview&&!o&&this.webview.release(this),await super.setInput(e,t,i,n),await e.resolve(),!(n.isCancellationRequested||this._isDisposed)&&e instanceof Pu&&(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),gdt(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 uqt(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,Uv.EDITOR_PART);e.layoutWebviewOverElement(this._element.parentElement,t,i)}trackFocus(e){const t=new Z,i=Ac(e.container);return t.add(i),t.add(i.onDidFocus(()=>this._onDidFocusWebview.fire())),t.add(e.onDidFocus(()=>this._onDidFocusWebview.fire())),t}},lEe=UR,UR.ID="WebviewEditor",UR);bze=lEe=D([_(1,Yi),_(2,pn),_(3,$i),_(4,Po),_(5,ei),_(6,CI),_(7,xc),_(8,Le)],bze);let dEe=class extends V{constructor(e,t){super(),this._lifecycleService=e,this._configService=t,this._icons=new Map,this._register(this._configService.onDidChangeConfiguration(i=>{i.affectsConfiguration("workbench.iconTheme")&&this.updateStyleSheet()}))}dispose(){super.dispose(),this._styleElement=void 0}get styleElement(){return this._styleElement||(this._styleElement=ul(void 0,void 0,this._store),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(Rs.Starting);const e=[];if(this._configService.getValue("workbench.iconTheme")!==null)for(const[t,i]of this._icons){const n=`.show-file-icons .webview-${t}-name-file-icon::before`;try{e.push(`.monaco-workbench.vs ${n}, .monaco-workbench.hc-light ${n} { content: ""; background-image: ${Yu(i.light)}; }`,`.monaco-workbench.vs-dark ${n}, .monaco-workbench.hc-black ${n} { content: ""; background-image: ${Yu(i.dark)}; }`)}catch{}}this.styleElement.textContent=e.join(` +`)}};dEe=D([_(0,Zu),_(1,Te)],dEe);function wte(s,e){return s.canResolve(e)}let aN=class extends Pu{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=Rr(e=>this._webviewWorkbenchService.resolveWebview(this,e));try{await this._resolvePromise}catch(e){if(!Fr(e))throw e}}return super.resolve()}transfer(e){if(super.transfer(e))return e._resolved=this._resolved,e}};aN.__decorator=D([Zt],aN.prototype,"resolve",null);aN=D([_(2,T6)],aN);class fqt{constructor(){this._awaitingRevival=[]}enqueueForRestoration(e,t){const i=new dc,n=()=>{const r=this._awaitingRevival.findIndex(a=>e===a.input);r>=0&&this._awaitingRevival.splice(r,1)},o=jr(e.webview.onDidDispose(n),t.onCancellationRequested(()=>{n(),i.cancel()}));return this._awaitingRevival.push({input:e,promise:i,disposable:o}),i.p}reviveFor(e,t){const i=this._awaitingRevival.filter(({input:n})=>wte(e,n));this._awaitingRevival=this._awaitingRevival.filter(({input:n})=>!wte(e,n));for(const{input:n,promise:o,disposable:r}of i)e.resolveWebview(n,t).then(a=>o.complete(a),a=>o.error(a)).finally(()=>{r.dispose()})}}let wze=class extends V{constructor(e,t,i,n){super(),this._editorService=t,this._instantiationService=i,this._webviewService=n,this._revivers=new Set,this._revivalPool=new fqt,this._onDidChangeActiveWebviewEditor=this._register(new I),this.onDidChangeActiveWebviewEditor=this._onDidChangeActiveWebviewEditor.event,this._iconManager=this._register(this._instantiationService.createInstance(dEe)),this._register(e.registerContextKeyProvider({contextKey:gqt,getGroupContextKeyValue:o=>this.getWebviewId(o.activeEditor)})),this._register(t.onDidActiveEditorChange(()=>{this.updateActiveWebview()})),this._register(n.onDidChangeActiveWebview(()=>{this.updateActiveWebview()})),this.updateActiveWebview()}get iconManager(){return this._iconManager}getWebviewId(e){let t;return e instanceof Pu?t=e:e instanceof $g&&(e.primary instanceof Pu?t=e.primary:e.secondary instanceof Pu&&(t=e.secondary)),t?.webview.providedViewType??""}updateActiveWebview(){const e=this._editorService.activeEditor;let t;e instanceof Pu?t=e:e instanceof $g&&(e.primary instanceof Pu&&e.primary.webview===this._webviewService.activeWebview?t=e.primary:e.secondary instanceof Pu&&e.secondary.webview===this._webviewService.activeWebview&&(t=e.secondary)),t!==this._activeWebview&&(this._activeWebview=t,this._onDidChangeActiveWebviewEditor.fire(t))}openWebview(e,t,i,n){const o=this._webviewService.createWebviewOverlay(e),r=this._instantiationService.createInstance(Pu,{viewType:t,name:i,providedId:e.providedViewType},o,this.iconManager);return this._editorService.openEditor(r,{pinned:!0,preserveFocus:n.preserveFocus,activation:n.preserveFocus?Hk.RESTORE:void 0},n.group),r}revealWebview(e,t,i){const n=this.findTopLevelEditorForWebview(e);this._editorService.openEditor(n,{preserveFocus:i,activation:i?Hk.RESTORE:void 0},t)}findTopLevelEditorForWebview(e){for(const t of this._editorService.editors)if(t===e||t instanceof $g&&(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(aN,{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 ci;return this._revivalPool.reviveFor(e,t.token),Ee(()=>{this._revivers.delete(e),t.dispose(!0)})}shouldPersist(e){return e instanceof aN?!0:hi.some(this._revivers.values(),t=>wte(t,e))}async tryRevive(e,t){for(const i of this._revivers.values())if(wte(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)}};wze=D([_(0,Po),_(1,ei),_(2,we),_(3,zae)],wze);var HP,VR;let tB=(VR=class extends aN{static create(e,t,i,n,o){return e.invokeFunction(r=>{const a=r.get(P6).getValue(t),c=a?$e.fromString(a):void 0,l=r.get(zae).createWebviewOverlay({providedViewType:i,title:void 0,options:{customClasses:o?.customClasses},contentOptions:{},extension:void 0}),d=e.createInstance(HP,{resource:t,viewType:i},l,{untitledDocumentData:c,oldResource:o?.oldResource});return typeof n<"u"&&d.updateGroup(n),d})}get resource(){return this._editorResource}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super({providedId:e.viewType,viewType:e.viewType,name:""},t,n),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 HP.typeId}get editorId(){return this.viewType}get capabilities(){let e=Ei.None;return e|=Ei.CanDropIntoEditor,this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument||(e|=Ei.Singleton),this._modelRef?this._modelRef.object.isReadonly()&&(e|=Ei.Readonly):this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly),this.resource.scheme===pe.untitled&&(e|=Ei.Untitled),e}getName(){return typeof this._editorName!="string"&&(this._editorName=this.customEditorLabelService.getName(this.resource)??Ko(this.labelService.getUriLabel(this.resource))),this._editorName}getDescription(e=Ls.MEDIUM){switch(e){case Ls.SHORT:return this.shortDescription;case Ls.LONG:return this.longDescription;case Ls.MEDIUM:default:return this.mediumDescription}}get shortDescription(){return typeof this._shortDescription!="string"&&(this._shortDescription=this.labelService.getUriBasenameLabel(Lr(this.resource))),this._shortDescription}get mediumDescription(){return typeof this._mediumDescription!="string"&&(this._mediumDescription=this.labelService.getUriLabel(Lr(this.resource),{relative:!0})),this._mediumDescription}get longDescription(){return typeof this._longDescription!="string"&&(this._longDescription=this.labelService.getUriLabel(Lr(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 Ls.SHORT:return this.shortTitle;case Ls.LONG:return this.longTitle;default:case Ls.MEDIUM:return this.mediumTitle}}matches(e){return super.matches(e)?!0:this===e||e instanceof HP&&this.viewType===e.viewType&&ji(this.resource,e.resource)}copy(){return HP.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 ji(i,this.resource)?this:{resource:i}}async saveAs(e,t){if(!this._modelRef)return;const i=this._editorResource,n=await this.fileDialogService.pickFileToSave(i,t?.availableFileSystems);if(n&&await this._modelRef.object.saveCustomEditorAs(this._editorResource,n,t))return(await this.rename(e,n))?.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(qn(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 qn(this._modelRef),this.undoRedoService.undo(this.resource)}redo(){return qn(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 JYe(g(9516,"Unable to open the editor in this window, it contains modifications that can only be saved in the original window."),[ol({id:"openInOriginalWindow",label:g(9517,"Open in Original Window"),run:async()=>{const n=this.editorGroupsService.getPart(this.layoutService.getContainer(ct(this.webview.container).window));this.editorGroupsService.getPart(this.layoutService.getContainer(t.window)).activeGroup.moveEditor(this,n.activeGroup)}})],{forceMessage:!0});return super.claim(e,t,i)}canMove(e,t){const i=this.editorGroupsService.getGroup(t);if(i){const n=this.doCanMove(i.windowId);if(typeof n=="string")return n}return super.canMove(e,t)}doCanMove(e){return this.isModified()&&this._modelRef?.object.canHotExit===!1&&ct(this.webview.container).vscodeWindowId!==e?g(9518,"Unable to move '{0}': The editor contains changes that can only be saved in its current window.",this.getName()):!0}},HP=VR,VR.typeId="workbench.editors.webviewEditor",VR);tB=HP=D([_(3,T6),_(4,we),_(5,Fs),_(6,WRe),_(7,sg),_(8,jA),_(9,Jt),_(10,pd),_(11,Po),_(12,CI),_(13,tE)],tB);var UP,mk;let hEe=(mk=class extends Nb{static create(e,t,i,n,o){return e.createInstance(UP,t,i,n,o)}static setName(e,t){t&&(this.windowNames[e.path]=t)}get editorId(){return"interactive"}get typeId(){return UP.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,n,o,r,a,c,l,d,h){const u=qT.getOrCreate(o,e,void 0,"interactive",{});super(),this._notebookService=l,this._fileDialogService=d,this.isScratchpad=h.getValue(NAe.InteractiveWindowPromptToSave)!==!0,this._notebookEditorInput=u,this._register(this._notebookEditorInput),this.name=i??UP.windowNames[e.path]??Ko(e.path,Vy(e.path)),this._initLanguage=n,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=M.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?Ei.Scratchpad:0;return Ei.Untitled|Ei.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??Ca;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(Ei.Untitled)?this.saveAs(e,t):(await this._editorModelReference.save(t),this)}async saveAs(e,t){if(!this._editorModelReference||!this._notebookService.getContributedNotebookType("interactive"))return;const n=this.getName()+".ipynb",o=Pt(await this._fileDialogService.defaultFilePath(),n),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 UP?ji(this.resource,e.resource)&&ji(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}},UP=mk,mk.windowNames={},mk.ID="workbench.input.interactive",mk);hEe=UP=D([_(4,we),_(5,fn),_(6,VRe),_(7,EJe),_(8,ZA),_(9,sg),_(10,Te)],hEe);const zC=class zC{static join(e){if(e.length===0)return;let t=Number.MAX_SAFE_INTEGER,i=0;for(const n of e)t=Math.min(t,n.startLineNumber),i=Math.max(i,n.startLineNumber+n.lineCount);return new zC(t,i-t)}static fromLineNumbers(e,t){return new zC(e,t-e)}constructor(e,t){if(this.startLineNumber=e,this.lineCount=t,t<0)throw new Ni}join(e){return new zC(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 zC(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,iu);let Kg=zC;const pqt={start:"<<<<<<<",end:">>>>>>>"};function*mqt(s,e,t){const i=new By(e);for(const n of s){i.takeWhile(r=>wk.isGreaterThan(t(n,r)));const o=i.takeWhile(r=>wk.isNeitherLessOrGreaterThan(t(n,r)));yield{left:n,rights:o||[]}}}function Int(...s){return[].concat(...s)}let yze=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,Ie.PROFILE);if(e!==void 0)try{this.value=JSON.parse(e)}catch(t){vt(t)}this.hasValue=!0}return this.value}set(e){this.value=e,this.storageService.store(this.key,JSON.stringify(this.value),Ie.PROFILE,an.USER)}};yze=D([_(1,$i)],yze);class d${constructor(e,t){this.range=e,this.newLines=t}equals(e){return this.range.equals(e.range)&&is(this.newLines,e.newLines)}toEdits(e){return new vqt([this]).toEdits(e)}}class _qt{constructor(e,t){this.range=e,this.newText=t}equals(e){return F.equalsRange(this.range,e.range)&&this.newText===e.newText}}class vqt{constructor(e){this.edits=e}toEdits(e){return this.edits.map(t=>t.range.endLineNumberExclusive<=e?{range:new F(t.range.startLineNumber,1,t.range.endLineNumberExclusive,1),text:t.newLines.map(i=>i+` `).join("")}:t.range.startLineNumber===1?{range:new F(1,1,e,Number.MAX_SAFE_INTEGER),text:t.newLines.join(` `)}:{range:new F(t.range.startLineNumber-1,Number.MAX_SAFE_INTEGER,e,Number.MAX_SAFE_INTEGER),text:t.newLines.map(i=>` -`+i).join("")})}}function Tqt(s,e){return!(e.lineNumbers.endLineNumber||e.lineNumber===s.startLineNumber&&e.column=s.endColumn)}function Lqt(s,e){return s.lineNumber===e.lineNumber?new eg(0,e.column-s.column):new eg(e.lineNumber-s.lineNumber,e.column-1)}function Rqt(s,e){return e.lineCount===0?new oe(s.lineNumber,s.column+e.columnCount):new oe(s.lineNumber+e.lineCount,e.columnCount+1)}function Nze(s,e){return s.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 Ni;const t=e.startLineNumber-this.inputRange.startLineNumber,i=e.endLineNumberExclusive-this.inputRange.endLineNumberExclusive;return new $u(e,new jg(this.outputRange.startLineNumber+t,this.outputRange.lineCount-t+i))}join(e){return new $u(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 $u(this.inputRange,this.outputRange.delta(e))}addInputLineDelta(e){return new $u(this.inputRange.delta(e),this.outputRange)}reverse(){return new $u(this.outputRange,this.inputRange)}}class W1{static betweenOutputs(e,t,i){const o=$ce.compute(e,t).map(r=>new $u(r.output1Range,r.output2Range));return new W1(o,i)}constructor(e,t){this.lineRangeMappings=e,this.inputLineCount=t,G_(()=>bU(e,(i,n)=>i.inputRange.isBefore(n.inputRange)&&i.outputRange.isBefore(n.outputRange)&&n.inputRange.startLineNumber-i.inputRange.endLineNumberExclusive===n.outputRange.startLineNumber-i.outputRange.endLineNumberExclusive))}project(e){const t=Ak(this.lineRangeMappings,o=>o.inputRange.startLineNumber<=e);if(!t)return new $u(new jg(e,1),new jg(e,1));if(t.inputRange.contains(e))return t;const i=new jg(e,1),n=new jg(e+t.outputRange.endLineNumberExclusive-t.inputRange.endLineNumberExclusive,1);return new $u(i,n)}get outputLineCount(){const e=b6e(this.lineRangeMappings),t=e?e.outputRange.endLineNumberExclusive-e.inputRange.endLineNumberExclusive:0;return this.inputLineCount+t}reverse(){return new W1(this.lineRangeMappings.map(e=>e.reverse()),this.outputLineCount)}}class $ce{static compute(e,t){const i=Cc(d=>d.inputRange.startLineNumber,nu),n=Ont(e.map(d=>({source:0,diff:d})),t.map(d=>({source:1,diff:d}))).sort(Cc(d=>d.diff,i)),o=[new Array,new Array],r=[0,0],a=new Array;function c(d){const h=$u.join(o[0])||new $u(d,d.delta(r[0])),u=$u.join(o[1])||new $u(d,d.delta(r[1]));a.push(new $ce(l,h.extendInputRange(l).outputRange,o[0],u.extendInputRange(l).outputRange,o[1])),o[0]=[],o[1]=[]}let l;for(const d of n){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,n,o){this.inputRange=e,this.output1Range=t,this.output1LineMappings=i,this.output2Range=n,this.output2LineMappings=o}toString(){return`${this.output1Range} <- ${this.inputRange} -> ${this.output2Range}`}}class wD extends $u{static join(e){return e.reduce((t,i)=>t?t.join(i):i,void 0)}constructor(e,t,i,n,o){super(e,i),this.inputTextModel=t,this.outputTextModel=n,this.rangeMappings=o||[new gA(this.inputRange.toRange(),this.outputRange.toRange())]}addOutputLineDelta(e){return new wD(this.inputRange,this.inputTextModel,this.outputRange.delta(e),this.outputTextModel,this.rangeMappings.map(t=>t.addOutputLineDelta(e)))}addInputLineDelta(e){return new wD(this.inputRange.delta(e),this.inputTextModel,this.outputRange,this.outputTextModel,this.rangeMappings.map(t=>t.addInputLineDelta(e)))}join(e){return new wD(this.inputRange.join(e.inputRange),this.inputTextModel,this.outputRange.join(e.outputRange),this.outputTextModel)}getLineEdit(){return new g$(this.inputRange,this.getOutputLines())}getReverseLineEdit(){return new g$(this.outputRange,this.getInputLines())}getOutputLines(){return this.outputRange.getLines(this.outputTextModel)}getInputLines(){return this.inputRange.getLines(this.inputTextModel)}}class gA{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 gA(this.inputRange,new F(this.outputRange.startLineNumber+e,this.outputRange.startColumn,this.outputRange.endLineNumber+e,this.outputRange.endColumn))}addInputLineDelta(e){return new gA(new F(this.inputRange.startLineNumber+e,this.inputRange.startColumn,this.inputRange.endLineNumber+e,this.inputRange.endColumn),this.outputRange)}reverse(){return new gA(this.outputRange,this.inputRange)}}class kF{constructor(e,t){this.rangeMappings=e,this.inputLineCount=t,G_(()=>bU(e,(i,n)=>Nze(i.inputRange,n.inputRange)&&Nze(i.outputRange,n.outputRange)))}project(e){const t=Ak(this.rangeMappings,o=>o.inputRange.getStartPosition().isBeforeOrEqual(e));if(!t)return new gA(F.fromPositions(e,e),F.fromPositions(e,e));if(Tqt(t.inputRange,e))return t;const i=Lqt(t.inputRange.getEndPosition(),e),n=Rqt(t.outputRange.getEndPosition(),i);return new gA(F.fromPositions(e),F.fromPositions(n))}projectRange(e){const t=this.project(e.getStartPosition()),i=this.project(e.getEndPosition());return new gA(t.inputRange.plusRange(i.inputRange),t.outputRange.plusRange(i.outputRange))}get outputLineCount(){const e=b6e(this.rangeMappings),t=e?e.outputRange.endLineNumber-e.inputRange.endLineNumber:0;return this.inputLineCount+t}reverse(){return new kF(this.rangeMappings.map(e=>e.reverse()),this.outputLineCount)}}let Ste=class{constructor(e,t){this.editorWorkerService=e,this.configurationService=t,this.mergeAlgorithm=yRe("mergeEditor.diffAlgorithm","advanced",this.configurationService).map(i=>i==="smart"?"legacy":i==="experimental"?"advanced":i)}async computeDiff(e,t,i){const n=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},n);if(!a)throw new Error("Diff computation failed");if(e.isDisposed()||t.isDisposed())return{diffs:null};const c=a.changes.map(h=>new wD(Pze(h.original),e,Pze(h.modified),t,h.innerChanges?.map(u=>Mqt(u)))),l=e.getVersionId(),d=t.getVersionId();return o!==l||r!==d?{diffs:null}:(G_(()=>{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 b=u.startLineNumber-1<=v.inputRange.startLineNumber&&v.inputRange.endLineNumber<=u.endLineNumberExclusive;b&&v.inputRange.startLineNumber===u.startLineNumber-1&&(b=v.inputRange.endColumn>=p.getLineMaxColumn(v.inputRange.startLineNumber)),b&&v.inputRange.endLineNumber===u.endLineNumberExclusive&&(b=v.inputRange.endColumn===1);let w=f.startLineNumber-1<=v.outputRange.startLineNumber&&v.outputRange.endLineNumber<=f.endLineNumberExclusive;if(w&&v.outputRange.startLineNumber===f.startLineNumber-1&&(w=v.outputRange.endColumn>=m.getLineMaxColumn(v.outputRange.endLineNumber)),w&&v.outputRange.endLineNumber===f.endLineNumberExclusive&&(w=v.outputRange.endColumn===1),!b||!w)return!1}}return c.length===0||c[0].inputRange.startLineNumber===c[0].outputRange.startLineNumber&&bU(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 Rue extends V{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=jt(this,zp.initializing),this._diffs=jt(this,[]),this._barrier=new Nqt,this._isDisposed=!1,this._isInitializing=!0;const n=gC("recompute");this._register(ai(o=>{n.read(o),this._recompute(o)})),this._register(e.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{n.trigger(void 0)}))),this._register(t.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{n.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()===zp.initializing&&(this._isInitializing=!0),ts(n=>{this._state.set(this._isInitializing?zp.initializing:zp.updating,n,YC.other)}),this.diffComputer.computeDiff(this.baseTextModel,this.textModel,e).then(n=>{this._isDisposed||t===this._recomputeCount&&ts(o=>{n.diffs?(this._state.set(zp.upToDate,o,YC.textChange),this._diffs.set(n.diffs,o,YC.textChange)):this._state.set(zp.error,o,YC.textChange),this._isInitializing=!1})})}ensureUpToDate(){if(this.state.get()!==zp.upToDate)throw new Ni("Cannot remove diffs when the model is not up to date")}removeDiffs(e,t,i){this.ensureUpToDate(),e.sort(Cc(o=>o.inputRange.startLineNumber,nu)),e.reverse();let n=this._diffs.get();for(const o of e){const r=n.length;if(n=n.filter(a=>a!==o),r===n.length)throw new Ni;this._barrier.runExclusivelyOrThrow(()=>{const a=o.getReverseLineEdit().toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,a,()=>null,i)}),n=n.map(a=>a.outputRange.isAfter(o.outputRange)?a.addOutputLineDelta(o.inputRange.lineCount-o.outputRange.lineCount):a)}this._diffs.set(n,t,YC.other)}applyEditRelativeToOriginal(e,t,i){this.ensureUpToDate();const n=new wD(e.range,this.baseTextModel,new jg(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 Ni("Edit must be conflict free.");c.inputRange.isAfter(e.range)?(o||(o=!0,a.push(n.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(n.addOutputLineDelta(r))),this._barrier.runExclusivelyOrThrow(()=>{const c=new g$(e.range.delta(r),e.newLines).toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,c,()=>null,i)}),this._diffs.set(a,t,YC.other)}findTouchingDiffs(e){return this.diffs.get().filter(t=>t.inputRange.touches(e))}getResultLine(e,t){let i=0;const n=t?this.diffs.read(t):this.diffs.get();for(const o of n){if(o.inputRange.contains(e)||o.inputRange.endLineNumberExclusive===e)return o;if(o.inputRange.endLineNumberExclusivenew cPe(a.inputRange,i,a.output1Range,n,a.output1LineMappings,a.output2Range,o,a.output2LineMappings))}constructor(e,t,i,n,o,r,a,c){if(this.baseRange=e,this.baseTextModel=t,this.input1Range=i,this.input1TextModel=n,this.input1Diffs=o,this.input2Range=r,this.input2TextModel=a,this.input2Diffs=c,this.input1CombinedDiff=wD.join(this.input1Diffs),this.input2CombinedDiff=wD.join(this.input2Diffs),this.isEqualChange=is(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 Ni("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:Id.base};if(t.length===1)return{edit:t[0].diff.getLineEdit(),effectiveState:Id.base.withInputValue(t[0].inputNumber,!0,!1)};if(e.kind!==Uo.both)throw new Ni;const i=e.smartCombination?this.smartCombineInputs(e.firstInput):this.dumbCombineInputs(e.firstInput);return i?{edit:i,effectiveState:e}:{edit:t[vEe(e.firstInput)-1].diff.getLineEdit(),effectiveState:Id.base.withInputValue(vEe(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=Ont(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(C6e(Cc(o=>o.diff.inputRange,F.compareRangesUsingStarts),Cc(o=>o.input===e?1:2,nu))).map(o=>{const r=o.input===1?this.input1TextModel:this.input2TextModel;return new kqt(o.diff.inputRange,r.getValueInRange(o.diff.outputRange))}),n=Pqt(this.baseRange,i,this.baseTextModel);return e===1?this.smartInput1LineRangeEdit=n:this.smartInput2LineRangeEdit=n,n}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 n=new g$(this.baseRange,t.concat(i));return e===1?this.dumbInput1LineRangeEdit=n:this.dumbInput2LineRangeEdit=n,n}}function Pqt(s,e,t){let i="";const n=s.startLineNumber>1;let o=n?new oe(s.startLineNumber-1,t.getLineMaxColumn(s.startLineNumber-1)):new oe(s.startLineNumber,1);for(const d of e){const h=d.range.getStartPosition();if(!o.isBeforeOrEqual(h))return;let u=t.getValueInRange(F.fromPositions(o,h));h.lineNumber>t.getLineCount()&&(u+=` -`),i+=u,i+=d.newText,o=d.range.getEndPosition()}const r=s.endLineNumberExclusive<=t.getLineCount(),a=r?new oe(s.endLineNumberExclusive,1):new oe(s.endLineNumberExclusive-1,Un.MAX_SAFE_SMALL_INTEGER),c=t.getValueInRange(F.fromPositions(o,a));i+=c;const l=ov(i);if(n){if(l[0]!=="")return;l.shift()}if(r){if(l[l.length-1]!=="")return;l.pop()}return new g$(s,l)}var Uo;(function(s){s[s.base=0]="base",s[s.input1=1]="input1",s[s.input2=2]="input2",s[s.both=3]="both",s[s.unrecognized=4]="unrecognized"})(Uo||(Uo={}));function vEe(s){return s===1?2:1}class uG{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)?TH.first:TH.excluded}}class lPe extends uG{get kind(){return Uo.base}toString(){return"base"}swap(){return this}withInputValue(e,t,i=!1){return e===1?t?new Gce:this:t?new uN:this}equals(e){return e.kind===Uo.base}}class Gce extends uG{get kind(){return Uo.input1}get includesInput1(){return!0}toString(){return"1✓"}swap(){return new uN}withInputValue(e,t,i=!1){return e===1?t?this:new lPe:t?new Kce(1,i):new uN}equals(e){return e.kind===Uo.input1}}class uN extends uG{get kind(){return Uo.input2}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new Gce}withInputValue(e,t,i=!1){return e===2?t?this:new lPe:t?new Kce(2,i):new uN}equals(e){return e.kind===Uo.input2}}class Kce extends uG{constructor(e,t){super(),this.firstInput=e,this.smartCombination=t}get kind(){return Uo.both}get includesInput1(){return!0}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new Kce(vEe(this.firstInput),this.smartCombination)}withInputValue(e,t,i=!1){return t?this:e===1?new uN:new Gce}equals(e){return e.kind===Uo.both&&this.firstInput===e.firstInput&&this.smartCombination===e.smartCombination}getInput(e){return e===this.firstInput?TH.first:TH.second}}class Fqt extends uG{get kind(){return Uo.unrecognized}toString(){return"unrecognized"}swap(){return this}withInputValue(e,t,i=!1){return t?e===1?new Gce:new uN:this}equals(e){return e.kind===Uo.unrecognized}}var Id;(function(s){s.base=new lPe,s.unrecognized=new Fqt})(Id||(Id={}));var TH;(function(s){s[s.excluded=0]="excluded",s[s.first=1]="first",s[s.second=2]="second",s[s.unrecognized=3]="unrecognized"})(TH||(TH={}));let Ate=class extends RI{constructor(e,t,i,n,o,r,a,c,l){super(),this.base=e,this.input1=t,this.input2=i,this.resultTextModel=n,this.diffComputer=o,this.options=r,this.telemetry=a,this.languageService=c,this.undoRedoService=l,this.input1TextModelDiffs=this._register(new Rue(this.base,this.input1.textModel,this.diffComputer)),this.input2TextModelDiffs=this._register(new Rue(this.base,this.input2.textModel,this.diffComputer)),this.resultTextModelDiffs=this._register(new Rue(this.base,this.resultTextModel,this.diffComputer)),this.modifiedBaseRanges=Ze(this,h=>{const u=this.input1TextModelDiffs.diffs.read(h),f=this.input2TextModelDiffs.diffs.read(h);return cPe.fromDiffs(u,f,this.base,this.input1.textModel,this.input2.textModel)}),this.modifiedBaseRangeResultStates=Ze(this,h=>new Map(this.modifiedBaseRanges.read(h).map(f=>[f,new Fze(f)]))),this.resultSnapshot=this.resultTextModel.createSnapshot(),this.baseInput1Diffs=this.input1TextModelDiffs.diffs,this.baseInput2Diffs=this.input2TextModelDiffs.diffs,this.baseResultDiffs=this.resultTextModelDiffs.diffs,this.input1ResultMapping=Ze(this,h=>this.getInputResultMapping(this.baseInput1Diffs.read(h),this.baseResultDiffs.read(h),this.input1.textModel.getLineCount())),this.resultInput1Mapping=Ze(this,h=>this.input1ResultMapping.read(h).reverse()),this.input2ResultMapping=Ze(this,h=>this.getInputResultMapping(this.baseInput2Diffs.read(h),this.baseResultDiffs.read(h),this.input2.textModel.getLineCount())),this.resultInput2Mapping=Ze(this,h=>this.input2ResultMapping.read(h).reverse()),this.baseResultMapping=Ze(this,h=>{const u=new W1(this.baseResultDiffs.read(h),-1);return new W1(u.lineRangeMappings.map(f=>f.inputRange.isEmpty||f.outputRange.isEmpty?new $u(f.inputRange.deltaStart(-1),f.outputRange.deltaStart(-1)):f),u.inputLineCount)}),this.resultBaseMapping=Ze(this,h=>this.baseResultMapping.read(h).reverse()),this.diffComputingState=Ze(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs,this.resultTextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===zp.initializing)?Gm.initializing:u.some(f=>f===zp.updating)?Gm.updating:Gm.upToDate}),this.inputDiffComputingState=Ze(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===zp.initializing)?Gm.initializing:u.some(f=>f===zp.updating)?Gm.updating:Gm.upToDate}),this.isUpToDate=Ze(this,h=>this.diffComputingState.read(h)===Gm.upToDate),this.onInitialized=T5(this.diffComputingState,h=>h===Gm.upToDate).then(()=>{}),this.firstRun=!0,this.unhandledConflictsCount=Ze(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(Oq(this.modifiedBaseRangeResultStates)),this._register(Oq(this.input1ResultMapping)),this._register(Oq(this.input2ResultMapping));const d=this.initialize();this.onInitialized=this.onInitialized.then(async()=>{await d}),d.then(()=>{let h=!0;this._register(LU({handleChange:u=>(u.didChange(this.modifiedBaseRangeResultStates)&&(h=!0),u.didChange(this.resultTextModelDiffs.diffs)?u.change===YC.textChange:!0)},u=>{const f=this.modifiedBaseRangeResultStates.read(u);if(!this.isUpToDate.read(u))return;const p=this.resultTextModelDiffs.diffs.read(u);ts(m=>{if(this.updateBaseRangeAcceptedState(p,f,m),h){h=!1;for(const[v,b]of f){const w=b.accepted.get(),y=!(w.kind===Uo.base||w.kind===Uo.unrecognized);b.handledInput1.set(y,m),b.handledInput2.set(y,m)}}})}))})}async initialize(){this.options.resetResult&&await this.reset()}async reset(){await T5(this.inputDiffComputingState,t=>t===Gm.upToDate);const e=this.modifiedBaseRangeResultStates.get();ts(t=>{for(const[i,n]of e){let o,r=!1;i.input1Diffs.length===0?(o=Id.base.withInputValue(2,!0),r=!0):i.input2Diffs.length===0||i.isEqualChange?(o=Id.base.withInputValue(1,!0),r=!0):(o=Id.base,r=!1),n.accepted.set(o,t),n.computedFromDiffing=!1,n.previousNonDiffingState=void 0,n.handledInput1.set(r,t),n.handledInput2.set(r,t)}this.resultTextModel.pushEditOperations(null,[{range:new F(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(),n=this.input2.textModel.getLinesContent(),o=[];function r(c,l){for(let d=l.startLineNumber;do.inputRange.isEmpty||o.outputRange.isEmpty?new $u(o.inputRange.deltaStart(-1),o.outputRange.deltaStart(-1)):o),n.inputLineCount)}translateInputRangeToBase(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new kF(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 kF(i.flatMap(o=>o.rangeMappings),0).projectRange(t).outputRange}getLineRangeInResult(e,t){return this.resultTextModelDiffs.getResultLineRange(e,t)}translateResultRangeToBase(e){return new kF(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).reverse().projectRange(e).outputRange}translateBaseRangeToResult(e){return new kF(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 n=Dqt(t,e,(o,r)=>o[0].baseRange.touches(r.inputRange)?Ek.neitherLessOrGreaterThan:jg.compareByStart(o[0].baseRange,r.inputRange));for(const o of n){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 Id.base;const i=t.map(r=>r.getLineEdit());function n(r){return is(i,r.map(a=>a.getLineEdit()),(a,c)=>a.equals(c))}if(n(e.input1Diffs))return Id.base.withInputValue(1,!0);if(n(e.input2Diffs))return Id.base.withInputValue(2,!0);const o=[Id.base.withInputValue(1,!0).withInputValue(2,!0,!0),Id.base.withInputValue(2,!0).withInputValue(1,!0,!0),Id.base.withInputValue(1,!0).withInputValue(2,!0,!1),Id.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(is(a.newLines,l,(d,h)=>d===h))return r}}return Id.unrecognized}getState(e){const t=this.modifiedBaseRangeResultStates.get().get(e);if(!t)throw new Ni("object must be from this instance");return t.accepted}setState(e,t,i,n,o=!1){if(!this.isUpToDate.get())throw new Ni("Cannot set state while updating");const r=this.modifiedBaseRangeResultStates.get().get(e);if(!r)throw new Ni("object must be from this instance");const a=this.resultTextModelDiffs.findTouchingDiffs(e.baseRange),c=new bY;a&&this.resultTextModelDiffs.removeDiffs(a,n,c);const{edit:l,effectiveState:d}=e.getEditForBase(t);r.accepted.set(d,n),r.previousNonDiffingState=void 0,r.computedFromDiffing=!1;const h=r.handledInput1.get(),u=r.handledInput2.get();(!h||!u)&&this.undoRedoService.pushElement(new Oqt(this.resultTextModel.uri,new WeakRef(this),new WeakRef(r),h,u),c),l&&(this.resultTextModel.pushStackElement(),this.resultTextModelDiffs.applyEditRelativeToOriginal(l,n,c),this.resultTextModel.pushStackElement()),r.handledInput1.set(!0,n),r.handledInput2.set(!0,n)}resetDirtyConflictsToBase(){ts(e=>{this.resultTextModel.pushStackElement();for(const t of this.modifiedBaseRanges.get())this.getState(t).get().kind===Uo.unrecognized&&this.setState(t,Id.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,n){const o=this.modifiedBaseRangeResultStates.get().get(e);if(o.handled.get()===i)return;const r=new WeakRef(Fze),a=new WeakRef(this);this.undoRedoService.pushElement({type:Al.Resource,resource:this.resultTextModel.uri,code:"setInputHandled",label:g(11380,"Set Input Handled"),redo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&ts(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&&ts(d=>{t===1?o.handledInput1.set(!i,d):o.handledInput2.set(!i,d)})}}),t===1?o.handledInput1.set(i,n):o.handledInput2.set(i,n)}setHandled(e,t,i){const n=this.modifiedBaseRangeResultStates.get().get(e);n.handled.get()!==t&&(n.handledInput1.set(t,i),n.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 T5(this.diffComputingState,c=>c===Gm.upToDate),this.unhandledConflictsCount.get()===0)return this.resultTextModel.getValue();const e=this.resultTextModel.getLinesContent(),t=this.input1.textModel.getLinesContent(),i=this.input2.textModel.getLinesContent(),n=this.modifiedBaseRangeResultStates.get(),o=[];function r(c,l){for(let d=l.startLineNumber;d>>>>>>")}return r(e,jg.fromLineNumbers(a,e.length+1)),o.join(` -`)}get conflictCount(){return _g(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return _g(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.base)}get conflictsResolvedWithInput1(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.input1)}get conflictsResolvedWithInput2(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.input2)}get conflictsResolvedWithSmartCombination(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.input1})}get manuallySolvedConflictCountThatEqualInput2(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return _g(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.both&&t.previousNonDiffingState?.smartCombination})}};Ate=D([_(7,xi),_(8,JA)],Ate);function _g(s,e){let t=0;for(const i of s)e(i)&&t++;return t}class Fze{constructor(e){this.baseRange=e,this.accepted=jt(`BaseRangeState${this.baseRange.baseRange}`,Id.base),this.handledInput1=jt(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=jt(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=Ze(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var Gm;(function(s){s[s.initializing=1]="initializing",s[s.upToDate=2]="upToDate",s[s.updating=3]="updating"})(Gm||(Gm={}));class Oqt{constructor(e,t,i,n,o){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=n,this.input2Handled=o,this.code="undoMarkAsHandled",this.label=g(11381,"Undo Mark As Handled"),this.type=Al.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&ts(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&&ts(i=>{t.handledInput1.set(this.input1Handled,i),t.handledInput2.set(this.input2Handled,i)})}}new Q("isMergeEditor",!1,{type:"boolean",description:g(10824,"The editor is a merge editor")});new Q("isMergeResultEditor",!1,{type:"boolean",description:g(10825,"The editor is a the result editor of a merge editor.")});new Q("mergeEditorLayout","mixed",{type:"string",description:g(10826,"The layout mode of a merge editor")});new Q("mergeEditorShowBase",!1,{type:"boolean",description:g(10827,"If the merge editor shows the base version")});new Q("mergeEditorShowBaseAtTop",!1,{type:"boolean",description:g(10828,"If base should be shown at the top")});new Q("mergeEditorShowNonConflictingChanges",!1,{type:"boolean",description:g(10829,"If the merge editor shows non-conflicting changes")});new Q("mergeEditorBaseUri","",{type:"string",description:g(10830,"The uri of the baser of a merge editor")});new Q("mergeEditorResultUri","",{type:"string",description:g(10831,"The uri of the result of a merge editor")});const Oze="mergeEditorCloseWithConflicts";var bEe;let wEe=class{constructor(e,t,i,n){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this._modelService=n}async createInputModel(e){const t=new Z,[i,n,o,r]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Ete(e.input1,this._textModelService,t),Ete(e.input2,this._textModelService,t)]);t.add(i),t.add(n);const a=n.object.textEditorModel.uri.with({scheme:"merge-result"}),c=this._modelService.createModel("",{languageId:n.object.textEditorModel.getLanguageId(),onDidChange:M.None},a);t.add(c);const l=this._instantiationService.createInstance(Ste),d=this._instantiationService.createInstance(Ate,i.object.textEditorModel,o,r,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(yEe,d,t,n.object,e.result)}};wEe=D([_(1,we),_(2,fn),_(3,gi)],wEe);let yEe=class extends RI{constructor(e,t,i,n,o,r,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=n,this.textFileService=o,this.dialogService=r,this.editorService=a,this.savedAltVersionId=jt(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=Kn(this,c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=Ze(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){G_(()=>e.some(n=>n===this));const t=e.some(n=>n.isDirty.get());let i;if(t){const n=e.length>1,o=n?g(10663,"Do you want keep the merge result of {0} files?",e.length):g(10664,"Do you want keep the merge result of {0}?",_i(e[0].model.resultTextModel.uri)),r=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:r?g(10665,"&&Save With Conflicts"):g(10666,"&&Save"),run:()=>Gh.SAVE},{label:g(10667,"Do&&n't Save"),run:()=>Gh.DONT_SAVE}];i=(await this.dialogService.prompt({type:Xe.Info,message:o,detail:r?n?g(10668,"The files contain unhandled conflicts. The merge results will be lost if you don't save them."):g(10669,"The file contains unhandled conflicts. The merge result will be lost if you don't save it."):n?g(10670,"The merge results will be lost if you don't save them."):g(10671,"The merge result will be lost if you don't save it."),buttons:a,cancelButton:{run:()=>Gh.CANCEL}})).result}else i=Gh.DONT_SAVE;return i===Gh.SAVE?await Promise.all(e.map(n=>n.accept())):i===Gh.DONT_SAVE&&await Promise.all(e.map(n=>n._discard())),i}async save(e){this.finished||(async()=>{const{confirmed:t}=await this.dialogService.confirm({message:g(10672,"Do you want to accept the merge result?"),detail:g(10673,"This will write the merge result to the original file and close the merge editor."),primaryButton:g(10674,"&&Accept Merge")});if(t){await this.accept();const i=this.editorService.findEditors(this.resultUri).filter(n=>n.editor.typeId==="mergeEditor.Input");await this.editorService.closeEditors(i)}})()}async revert(e){}};yEe=D([_(4,Fo),_(5,to),_(6,ei)],yEe);var qR;let CEe=(qR=class{constructor(e,t,i,n){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this.textFileService=n}async createInputModel(e){const t=new Z;let i;const n=t.add(new Z),o=m=>{ji(e.result,m.resource)&&(n.clear(),i=m)};n.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),Ete(e.input1,this._textModelService,t),Ete(e.input2,this._textModelService,t)]);if(t.add(r),t.add(a),!i)throw new Ni;await i.save({source:bEe.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(xqt.start)),f=this._instantiationService.createInstance(Ste),p=this._instantiationService.createInstance(Ate,r.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(SEe,p,t,i,this._mergeEditorTelemetry)}},bEe=qR,qR.FILE_SAVED_SOURCE=PJ.registerSource("merge-editor.source",g(10675,"Before Resolving Conflicts In Merge Editor")),qR);CEe=bEe=D([_(1,we),_(2,fn),_(3,Fo)],CEe);let SEe=class extends RI{constructor(e,t,i,n,o,r){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=n,this._dialogService=o,this._storageService=r,this.isDirty=Kn(this,M.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()),n=e.some(o=>o.model.hasUnhandledConflicts.get());if(i){const o=t?g(10676,"Do you want to save the changes you made to {0} files?",e.length):g(10677,"Do you want to save the changes you made to {0}?",_i(e[0].resultUri)),{result:r}=await this._dialogService.prompt({type:Xe.Info,message:o,detail:n?t?g(10678,"The files contain unhandled conflicts. Your changes will be lost if you don't save them."):g(10679,"The file contains unhandled conflicts. Your changes will be lost if you don't save them."):g(t?10680:10681,"Your changes will be lost if you don't save them."),buttons:[{label:n?g(10682,"&&Save with Conflicts"):g(10683,"&&Save"),run:()=>Gh.SAVE},{label:g(10684,"Do&&n't Save"),run:()=>Gh.DONT_SAVE}],cancelButton:{run:()=>Gh.CANCEL}});return r}else if(n&&!this._storageService.getBoolean(Oze,Ie.PROFILE,!1)){const{confirmed:o,checkboxChecked:r}=await this._dialogService.confirm({message:t?g(10685,"Do you want to close {0} merge editors?",e.length):g(10686,"Do you want to close the merge editor for {0}?",_i(e[0].resultUri)),detail:n?t?g(10687,"The files contain unhandled conflicts."):g(10688,"The file contains unhandled conflicts."):void 0,primaryButton:n?g(10689,"&&Close with Conflicts"):g(10690,"&&Close"),checkbox:{label:g(10691,"Do not ask me again")}});return r&&this._storageService.store(Oze,!0,Ie.PROFILE,an.USER),o?Gh.SAVE:Gh.CANCEL}else return Gh.SAVE}};SEe=D([_(4,to),_(5,$i)],SEe);async function Ete(s,e,t){const i=await e.createModelReference(s.uri);return t.add(i),{textModel:i.object.textEditorModel,title:s.title,description:s.description,detail:s.detail}}let AEe=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",{})}};AEe=D([_(0,Yi)],AEe);var PV,QR;let EEe=(QR=class extends lb{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(n,void 0,r,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=n,this._instaService=o,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{G_(()=>p.every(v=>v.editor instanceof PV));const m=p.map(v=>v.editor._inputModel).filter(Fc);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?wEe:CEe,this._instaService.createInstance(AEe))}dispose(){super.dispose()}get typeId(){return PV.ID}get editorId(){return rm.id}get capabilities(){let e=super.capabilities|Ei.MultipleEditors;return this.useWorkingCopy&&(e|=Ei.Untitled),e}getName(){return g(7873,"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(ai(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 PV?ji(this.base,e.base)&&ji(this.input1.uri,e.input1.uri)&&ji(this.input2.uri,e.input2.uri)&&ji(this.result,e.result):wb(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&ji(this.base,e.base.resource)&&ji(this.input1.uri,e.input1.resource)&&ji(this.input2.uri,e.input2.resource)&&ji(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)}},PV=QR,QR.ID="mergeEditor.Input",QR);EEe=PV=D([_(4,we),_(5,ei),_(6,Fo),_(7,Fs),_(8,Jt),_(9,Te),_(10,_d),_(11,Ec),_(12,nE)],EEe);const Bqt=oi("multi-diff-editor-label-icon",ve.diffMultiple,g(10264,"Icon of the multi diff editor label."));class Bze{constructor(e,t,i){if(this.originalUri=e,this.modifiedUri=t,this.goToFileUri=i,!e&&!t)throw new Ni("Invalid arguments")}getKey(){return JSON.stringify([this.modifiedUri?.toString(),this.originalUri?.toString()])}}const Wqt=Qe.as(Nn.Configuration),Hqt={...V6,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:g(5659,'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"}}}};Wqt.registerConfiguration(Hqt);var f$;(function(s){s.builtin="builtin",s.option="option",s.exclusive="exclusive",s.default="default"})(f$||(f$={}));var az;(function(s){s[s.ABORT=1]="ABORT",s[s.NONE=2]="NONE"})(az||(az={}));function Uqt(s,e){if(new Set([pe.extension,pe.webviewPanel,pe.vscodeWorkspaceTrust,pe.vscodeSettings]).has(e.scheme))return!1;const n=typeof s=="string"&&s.indexOf(Vi.sep)>=0?`${e.scheme}:${e.path}`:_i(e);return zO(typeof s=="string"?s.toLowerCase():s,n.toLowerCase())}var GP,jR;let rB=(jR=class extends Ob{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new Ni("MultiDiffEditorInput requires either multiDiffSource or resources");const i=e.multiDiffSource??N.parse(`multi-diff-editor:${new Date().getMilliseconds().toString()+Math.random().toString()}`);return t.createInstance(GP,i,e.label,e.resources?.map(n=>new Bze(n.original.resource,n.modified.resource,n.goToFileResource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(GP,N.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new Bze(i.originalUri?N.parse(i.originalUri):void 0,i.modifiedUri?N.parse(i.modifiedUri):void 0,i.goToFileUri?N.parse(i.goToFileUri):void 0)),!1)}get resource(){return this.multiDiffSource}get capabilities(){return Ei.Readonly}get typeId(){return GP.ID}getName(){return this._name}get editorId(){return rm.id}getIcon(){return Bqt}constructor(e,t,i,n=!1,o,r,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=n,this._textModelService=o,this._textResourceConfigurationService=r,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new Nlt(async()=>{const d=await this._createModel();this._register(d);const h=new $Ye(d,this._instantiationService);return this._register(h),await IGe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new CIt(async()=>{const d=this.initialResources?{resources:H6e.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?Ije(this,d.resources):nd([])}}),this.resources=Ze(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=YY(this,this.resources.map(d=>d??[]),d=>{const h=d.modifiedUri?Wze(this._textFileService,d.modifiedUri):nd(!1),u=d.originalUri?Wze(this._textFileService,d.originalUri):nd(!1);return Ze(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=Ze(this,d=>this._isDirtyObservables.read(d).some(h=>h.read(d))).keepObserved(this._store),this.onDidChangeDirty=M.fromObservableLight(this._isDirtyObservable),this.closeHandler={async confirm(){return Gh.DONT_SAVE},showConfirm(){return!1}},this._register(ai(d=>{const h=this.resources.read(d),u=this.label??g(6140,"Multi Diff Editor");h?this._name=u+g(6141," ({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.originalUri?.toString(),modifiedUri:e.modifiedUri?.toString(),goToFileUri:e.goToFileUri?.toString()}))}}setLanguageId(e,t){const n=this._viewModel.requireValue().activeDiffItem.get()?.documentDiffItem;if(!n)return;const o=n.modified??n.original;o&&o.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=YY(this,e.resources,async(c,l)=>{let d,h;const u=new Z;try{[d,h]=await Promise.all([c.originalUri?this._textModelService.createModelReference(c.originalUri):void 0,c.modifiedUri?this._textModelService.createModelReference(c.modifiedUri):void 0]),d&&u.add(d),h&&u.add(h)}catch(m){console.error(m),vt(m);return}const f=c.modifiedUri??c.originalUri,p={multiDiffEditorItem:c,original:d?.object.textEditorModel,modified:h?.object.textEditorModel,get options(){return{...Vqt(h?.object.isReadonly()??!0),...zqt(t.getValue(f))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(f,"editor")||v.affectsConfiguration(f,"diffEditor"))&&m()})};return l.add(aW.createOfNonDisposable(p,u,this))},c=>JSON.stringify([c.modifiedUri?.toString(),c.originalUri?.toString()])),n=jt("documents",[]),o=Ze(async c=>{const l=i.read(c),h=(await Promise.all(l)).filter(Fc);n.set(h,void 0)}),r=FN(o);return await o.get(),{dispose:()=>r.dispose(),documents:new $Le(n),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof GP?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 n=this._viewModel.currentValue?.items.get();n&&await Promise.all(n.map(async o=>{const r=o.diffEditorViewModel.model,a=r.original.uri.scheme!==pe.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)])}))}},GP=jR,jR.ID="workbench.input.multiDiffEditor",jR);rB=GP=D([_(4,fn),_(5,Ec),_(6,we),_(7,NJe),_(8,Fo)],rB);function Wze(s,e){return Kn(M.filter(s.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>s.isDirty(e))}function Vqt(s){return{readOnly:!!s,readOnlyMessage:typeof s!="boolean"?s:void 0}}function zqt(s){const e=xs(s.editor);if(kn(s.diffEditor)){const t=xs(s.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var QB;let Hze=(QB=class extends V{constructor(e,t){super(),this._register(e.registerEditor("*",{id:rm.id,label:rm.displayName,detail:rm.providerDisplayName,priority:f$.builtin},{},{createMultiDiffEditorInput:i=>({editor:rB.fromResourceMultiDiffEditorInput(i,t)})}))}},QB.ID="workbench.contrib.multiDiffEditorResolver",QB);Hze=D([_(0,BU),_(1,we)],Hze);var Uze;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down"})(Uze||(Uze={}));var Vze;(function(s){s[s.Connecting=0]="Connecting",s[s.Connected=1]="Connected"})(Vze||(Vze={}));const zze="terminalEditor";var $ze;(function(s){s[s.SearchHighlightLimit=1e3]="SearchHighlightLimit"})($ze||($ze={}));var Gze;(function(s){s[s.Unknown=1]="Unknown",s[s.Fedora=2]="Fedora",s[s.Ubuntu=3]="Ubuntu"})(Gze||(Gze={}));var Kze;(function(s){s.Terminals="Terminals"})(Kze||(Kze={}));W("terminal.background",null,g(9046,"The background color of the terminal, this allows coloring the terminal differently to the panel."));W("terminal.foreground",{light:"#333333",dark:"#CCCCCC",hcDark:"#FFFFFF",hcLight:"#292929"},g(9047,"The foreground color of the terminal."));W("terminalCursor.foreground",null,g(9048,"The foreground color of the terminal cursor."));W("terminalCursor.background",null,g(9049,"The background color of the terminal cursor. Allows customizing the color of a character overlapped by a block cursor."));const PK=W("terminal.selectionBackground",AS,g(9050,"The selection background color of the terminal."));W("terminal.inactiveSelectionBackground",{light:st(PK,.5),dark:st(PK,.5),hcDark:st(PK,.7),hcLight:st(PK,.5)},g(9051,"The selection background color of the terminal when it does not have focus."));W("terminal.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:"#ffffff"},g(9052,"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."));W("terminalCommandDecoration.defaultBackground",{light:"#00000040",dark:"#ffffff40",hcDark:"#ffffff80",hcLight:"#00000040"},g(9053,"The default terminal command decoration background color."));W("terminalCommandDecoration.successBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#007100"},g(9054,"The terminal command decoration background color for successful commands."));W("terminalCommandDecoration.errorBackground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F14C4C",hcLight:"#B5200D"},g(9055,"The terminal command decoration background color for error commands."));W("terminalOverviewRuler.cursorForeground","#A0A0A0CC",g(9056,"The overview ruler cursor color."));W("terminal.border",KRe,g(9057,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));W("terminalOverviewRuler.border",kqe,g(9058,"The overview ruler left-side border color."));W("terminal.findMatchBackground",{dark:zOe,light:zOe,hcDark:null,hcLight:"#0F4A85"},g(9059,"Color of the current search match in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);W("terminal.hoverHighlightBackground",st(gft,.5),g(9060,"Border color of the other search matches in the terminal."));W("terminal.findMatchBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(9061,"Border color of the current search match in the terminal."));W("terminal.findMatchHighlightBackground",{dark:_b,light:_b,hcDark:null,hcLight:null},g(9062,"Color of the other search matches in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);W("terminal.findMatchHighlightBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(9060,"Border color of the other search matches in the terminal."));W("terminalOverviewRuler.findMatchForeground",{dark:s5,light:s5,hcDark:"#f38518",hcLight:"#0F4A85"},g(9063,"Overview ruler marker color for find matches in the terminal."));W("terminal.dropBackground",GRe,g(9064,"Background color when dragging on top of terminals. The color should have transparency so that the terminal contents can still shine through."),!0);W("terminal.tab.activeBorder",Ive,g(9065,"Border on the side of the terminal tab in the panel. This defaults to tab.activeBorder."));W("terminal.initialHintForeground",{dark:"#ffffff56",light:"#0007",hcDark:null,hcLight:null},g(9066,"Foreground color of the terminal initial hint."));function $qt(s){let e;if(typeof s=="string"?e=s:s.color?e=s.color.replace(/\./g,"_"):We.isThemeIcon(s.icon)&&s.icon.color&&(e=s.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function Gqt(s,e,t){const i=s.icon;if(!i)return;const n=[];let o;if(i instanceof N?o=i:i instanceof Object&&"light"in i&&"dark"in i&&(o=e===Jg.LIGHT?i.light:i.dark),o instanceof N){const a=`terminal-uri-icon-${Wc(o.path).toString(36)}`;n.push(a),n.push("terminal-uri-icon")}return n}var xEe;(function(s){s.FocusAccessibleBuffer="workbench.action.terminal.focusAccessibleBuffer",s.AccessibleBufferGoToNextCommand="workbench.action.terminal.accessibleBufferGoToNextCommand",s.AccessibleBufferGoToPreviousCommand="workbench.action.terminal.accessibleBufferGoToPreviousCommand",s.ScrollToBottomAccessibleView="workbench.action.terminal.scrollToBottomAccessibleView",s.ScrollToTopAccessibleView="workbench.action.terminal.scrollToTopAccessibleView"})(xEe||(xEe={}));const Kqt=[xEe.FocusAccessibleBuffer];var _w;(function(s){s.FindFocus="workbench.action.terminal.focusFind",s.FindHide="workbench.action.terminal.hideFind",s.FindNext="workbench.action.terminal.findNext",s.FindPrevious="workbench.action.terminal.findPrevious",s.ToggleFindRegex="workbench.action.terminal.toggleFindRegex",s.ToggleFindWholeWord="workbench.action.terminal.toggleFindWholeWord",s.ToggleFindCaseSensitive="workbench.action.terminal.toggleFindCaseSensitive",s.SearchWorkspace="workbench.action.terminal.searchWorkspace"})(_w||(_w={}));const qqt=[_w.FindFocus,_w.FindHide,_w.FindNext,_w.FindPrevious,_w.ToggleFindRegex,_w.ToggleFindWholeWord,_w.ToggleFindCaseSensitive,_w.SearchWorkspace];var vw;(function(s){s.SelectPrevSuggestion="workbench.action.terminal.selectPrevSuggestion",s.SelectPrevPageSuggestion="workbench.action.terminal.selectPrevPageSuggestion",s.SelectNextSuggestion="workbench.action.terminal.selectNextSuggestion",s.SelectNextPageSuggestion="workbench.action.terminal.selectNextPageSuggestion",s.AcceptSelectedSuggestion="workbench.action.terminal.acceptSelectedSuggestion",s.AcceptSelectedSuggestionEnter="workbench.action.terminal.acceptSelectedSuggestionEnter",s.HideSuggestWidget="workbench.action.terminal.hideSuggestWidget",s.ClearSuggestCache="workbench.action.terminal.clearSuggestCache"})(vw||(vw={}));const Qqt=[vw.SelectPrevSuggestion,vw.SelectPrevPageSuggestion,vw.SelectNextSuggestion,vw.SelectNextPageSuggestion,vw.AcceptSelectedSuggestion,vw.AcceptSelectedSuggestionEnter,vw.HideSuggestWidget,vw.ClearSuggestCache],jqt="terminal";var qze;(function(s){s[s.Uninitialized=1]="Uninitialized",s[s.Launching=2]="Launching",s[s.Running=3]="Running",s[s.KilledDuringLaunch=4]="KilledDuringLaunch",s[s.KilledByUser=5]="KilledByUser",s[s.KilledByProcess=6]="KilledByProcess"})(qze||(qze={}));var mn;(function(s){s.Toggle="workbench.action.terminal.toggleTerminal",s.Kill="workbench.action.terminal.kill",s.KillViewOrEditor="workbench.action.terminal.killViewOrEditor",s.KillEditor="workbench.action.terminal.killEditor",s.KillActiveTab="workbench.action.terminal.killActiveTab",s.KillAll="workbench.action.terminal.killAll",s.QuickKill="workbench.action.terminal.quickKill",s.ConfigureTerminalSettings="workbench.action.terminal.openSettings",s.ShellIntegrationLearnMore="workbench.action.terminal.learnMore",s.RunRecentCommand="workbench.action.terminal.runRecentCommand",s.CopyLastCommand="workbench.action.terminal.copyLastCommand",s.CopyLastCommandOutput="workbench.action.terminal.copyLastCommandOutput",s.CopyLastCommandAndLastCommandOutput="workbench.action.terminal.copyLastCommandAndLastCommandOutput",s.GoToRecentDirectory="workbench.action.terminal.goToRecentDirectory",s.CopyAndClearSelection="workbench.action.terminal.copyAndClearSelection",s.CopySelection="workbench.action.terminal.copySelection",s.CopySelectionAsHtml="workbench.action.terminal.copySelectionAsHtml",s.SelectAll="workbench.action.terminal.selectAll",s.DeleteWordLeft="workbench.action.terminal.deleteWordLeft",s.DeleteWordRight="workbench.action.terminal.deleteWordRight",s.DeleteToLineStart="workbench.action.terminal.deleteToLineStart",s.MoveToLineStart="workbench.action.terminal.moveToLineStart",s.MoveToLineEnd="workbench.action.terminal.moveToLineEnd",s.New="workbench.action.terminal.new",s.NewWithCwd="workbench.action.terminal.newWithCwd",s.NewLocal="workbench.action.terminal.newLocal",s.NewInActiveWorkspace="workbench.action.terminal.newInActiveWorkspace",s.NewWithProfile="workbench.action.terminal.newWithProfile",s.Split="workbench.action.terminal.split",s.SplitActiveTab="workbench.action.terminal.splitActiveTab",s.SplitInActiveWorkspace="workbench.action.terminal.splitInActiveWorkspace",s.Unsplit="workbench.action.terminal.unsplit",s.JoinActiveTab="workbench.action.terminal.joinActiveTab",s.Join="workbench.action.terminal.join",s.Relaunch="workbench.action.terminal.relaunch",s.FocusPreviousPane="workbench.action.terminal.focusPreviousPane",s.CreateTerminalEditor="workbench.action.createTerminalEditor",s.CreateTerminalEditorSameGroup="workbench.action.createTerminalEditorSameGroup",s.CreateTerminalEditorSide="workbench.action.createTerminalEditorSide",s.FocusTabs="workbench.action.terminal.focusTabs",s.FocusNextPane="workbench.action.terminal.focusNextPane",s.ResizePaneLeft="workbench.action.terminal.resizePaneLeft",s.ResizePaneRight="workbench.action.terminal.resizePaneRight",s.ResizePaneUp="workbench.action.terminal.resizePaneUp",s.SizeToContentWidth="workbench.action.terminal.sizeToContentWidth",s.SizeToContentWidthActiveTab="workbench.action.terminal.sizeToContentWidthActiveTab",s.ResizePaneDown="workbench.action.terminal.resizePaneDown",s.Focus="workbench.action.terminal.focus",s.FocusNext="workbench.action.terminal.focusNext",s.FocusPrevious="workbench.action.terminal.focusPrevious",s.Paste="workbench.action.terminal.paste",s.PasteSelection="workbench.action.terminal.pasteSelection",s.SelectDefaultProfile="workbench.action.terminal.selectDefaultShell",s.RunSelectedText="workbench.action.terminal.runSelectedText",s.RunActiveFile="workbench.action.terminal.runActiveFile",s.SwitchTerminal="workbench.action.terminal.switchTerminal",s.ScrollDownLine="workbench.action.terminal.scrollDown",s.ScrollDownPage="workbench.action.terminal.scrollDownPage",s.ScrollToBottom="workbench.action.terminal.scrollToBottom",s.ScrollUpLine="workbench.action.terminal.scrollUp",s.ScrollUpPage="workbench.action.terminal.scrollUpPage",s.ScrollToTop="workbench.action.terminal.scrollToTop",s.Clear="workbench.action.terminal.clear",s.ClearSelection="workbench.action.terminal.clearSelection",s.ChangeIcon="workbench.action.terminal.changeIcon",s.ChangeIconActiveTab="workbench.action.terminal.changeIconActiveTab",s.ChangeColor="workbench.action.terminal.changeColor",s.ChangeColorActiveTab="workbench.action.terminal.changeColorActiveTab",s.Rename="workbench.action.terminal.rename",s.RenameActiveTab="workbench.action.terminal.renameActiveTab",s.RenameWithArgs="workbench.action.terminal.renameWithArg",s.QuickOpenTerm="workbench.action.quickOpenTerm",s.ScrollToPreviousCommand="workbench.action.terminal.scrollToPreviousCommand",s.ScrollToNextCommand="workbench.action.terminal.scrollToNextCommand",s.SelectToPreviousCommand="workbench.action.terminal.selectToPreviousCommand",s.SelectToNextCommand="workbench.action.terminal.selectToNextCommand",s.SelectToPreviousLine="workbench.action.terminal.selectToPreviousLine",s.SelectToNextLine="workbench.action.terminal.selectToNextLine",s.SendSequence="workbench.action.terminal.sendSequence",s.AttachToSession="workbench.action.terminal.attachToSession",s.DetachSession="workbench.action.terminal.detachSession",s.MoveToEditor="workbench.action.terminal.moveToEditor",s.MoveToTerminalPanel="workbench.action.terminal.moveToTerminalPanel",s.MoveIntoNewWindow="workbench.action.terminal.moveIntoNewWindow",s.SetDimensions="workbench.action.terminal.setDimensions",s.ClearPreviousSessionHistory="workbench.action.terminal.clearPreviousSessionHistory",s.FocusHover="workbench.action.terminal.focusHover",s.ShowEnvironmentContributions="workbench.action.terminal.showEnvironmentContributions",s.StartVoice="workbench.action.terminal.startVoice",s.StopVoice="workbench.action.terminal.stopVoice"})(mn||(mn={}));[mn.ClearSelection,mn.Clear,mn.CopyAndClearSelection,mn.CopySelection,mn.CopySelectionAsHtml,mn.CopyLastCommand,mn.CopyLastCommandOutput,mn.CopyLastCommandAndLastCommandOutput,mn.DeleteToLineStart,mn.DeleteWordLeft,mn.DeleteWordRight,mn.GoToRecentDirectory,mn.FocusNextPane,mn.FocusNext,mn.FocusPreviousPane,mn.FocusPrevious,mn.Focus,mn.SizeToContentWidth,mn.Kill,mn.KillEditor,mn.MoveToEditor,mn.MoveToLineEnd,mn.MoveToLineStart,mn.MoveToTerminalPanel,mn.NewInActiveWorkspace,mn.New,mn.Paste,mn.PasteSelection,mn.ResizePaneDown,mn.ResizePaneLeft,mn.ResizePaneRight,mn.ResizePaneUp,mn.RunActiveFile,mn.RunSelectedText,mn.RunRecentCommand,mn.ScrollDownLine,mn.ScrollDownPage,mn.ScrollToBottom,mn.ScrollToNextCommand,mn.ScrollToPreviousCommand,mn.ScrollToTop,mn.ScrollUpLine,mn.ScrollUpPage,mn.SendSequence,mn.SelectAll,mn.SelectToNextCommand,mn.SelectToNextLine,mn.SelectToPreviousCommand,mn.SelectToPreviousLine,mn.SplitInActiveWorkspace,mn.Split,mn.Toggle,mn.FocusHover,Xd.OpenAccessibilityHelp,...Kqt,...qqt,...Qqt];g(8944,"Contributes terminal functionality."),g(8945,"Defines additional terminal profiles that the user can create."),g(8946,"The ID of the terminal profile provider."),g(8947,"Title for this terminal profile."),g(8948,"A codicon, URI, or light and dark URIs to associate with this terminal type."),g(8949,"Icon path when a light theme is used"),g(8950,"Icon path when a dark theme is used");var gr;(function(s){s.IsOpen="terminalIsOpen",s.Count="terminalCount",s.GroupCount="terminalGroupCount",s.TabsNarrow="isTerminalTabsNarrow",s.HasFixedWidth="terminalHasFixedWidth",s.ProcessSupported="terminalProcessSupported",s.Focus="terminalFocus",s.FocusInAny="terminalFocusInAny",s.AccessibleBufferFocus="terminalAccessibleBufferFocus",s.AccessibleBufferOnLastLine="terminalAccessibleBufferOnLastLine",s.EditorFocus="terminalEditorFocus",s.TabsFocus="terminalTabsFocus",s.WebExtensionContributedProfile="terminalWebExtensionContributedProfile",s.TerminalHasBeenCreated="terminalHasBeenCreated",s.TerminalEditorActive="terminalEditorActive",s.TabsMouse="terminalTabsMouse",s.AltBufferActive="terminalAltBufferActive",s.SuggestWidgetVisible="terminalSuggestWidgetVisible",s.A11yTreeFocus="terminalA11yTreeFocus",s.ViewShowing="terminalViewShowing",s.TextSelected="terminalTextSelected",s.TextSelectedInFocused="terminalTextSelectedInFocused",s.FindVisible="terminalFindVisible",s.FindInputFocused="terminalFindInputFocused",s.FindFocused="terminalFindFocused",s.TabsSingularSelection="terminalTabsSingularSelection",s.SplitTerminal="terminalSplitTerminal",s.ShellType="terminalShellType",s.InTerminalRunCommandPicker="inTerminalRunCommandPicker",s.TerminalShellIntegrationEnabled="terminalShellIntegrationEnabled"})(gr||(gr={}));var DEe;(function(s){s.isOpen=new Q(gr.IsOpen,!1,!0),s.focus=new Q(gr.Focus,!1,g(8951,"Whether the terminal is focused.")),s.focusInAny=new Q(gr.FocusInAny,!1,g(8952,"Whether any terminal is focused, including detached terminals used in other UI.")),s.editorFocus=new Q(gr.EditorFocus,!1,g(8953,"Whether a terminal in the editor area is focused.")),s.count=new Q(gr.Count,0,g(8954,"The current number of terminals.")),s.groupCount=new Q(gr.GroupCount,0,!0),s.tabsNarrow=new Q(gr.TabsNarrow,!1,!0),s.terminalHasFixedWidth=new Q(gr.HasFixedWidth,!1,!0),s.tabsFocus=new Q(gr.TabsFocus,!1,g(8955,"Whether the terminal tabs widget is focused.")),s.webExtensionContributedProfile=new Q(gr.WebExtensionContributedProfile,!1,!0),s.terminalHasBeenCreated=new Q(gr.TerminalHasBeenCreated,!1,!0),s.terminalEditorActive=new Q(gr.TerminalEditorActive,!1,!0),s.tabsMouse=new Q(gr.TabsMouse,!1,!0),s.shellType=new Q(gr.ShellType,void 0,{type:"string",description:g(8956,"The shell type of the active terminal, this is set if the type can be detected.")}),s.altBufferActive=new Q(gr.AltBufferActive,!1,g(8957,"Whether the terminal's alt buffer is active.")),s.suggestWidgetVisible=new Q(gr.SuggestWidgetVisible,!1,g(8958,"Whether the terminal's suggest widget is visible.")),s.notFocus=s.focus.toNegated(),s.viewShowing=new Q(gr.ViewShowing,!1,g(8959,"Whether the terminal view is showing")),s.textSelected=new Q(gr.TextSelected,!1,g(8960,"Whether text is selected in the active terminal.")),s.textSelectedInFocused=new Q(gr.TextSelectedInFocused,!1,g(8961,"Whether text is selected in a focused terminal.")),s.notTextSelected=s.textSelected.toNegated(),s.findVisible=new Q(gr.FindVisible,!1,!0),s.notFindVisible=s.findVisible.toNegated(),s.findInputFocus=new Q(gr.FindInputFocused,!1,!0),s.findFocus=new Q(gr.FindFocused,!1,!0),s.notFindFocus=s.findInputFocus.toNegated(),s.processSupported=new Q(gr.ProcessSupported,!1,g(8962,"Whether terminal processes can be launched in the current workspace.")),s.tabsSingularSelection=new Q(gr.TabsSingularSelection,!1,g(8963,"Whether one terminal is selected in the terminal tabs list.")),s.splitTerminal=new Q(gr.SplitTerminal,!1,g(8964,"Whether the focused tab's terminal is a split terminal.")),s.inTerminalRunCommandPicker=new Q(gr.InTerminalRunCommandPicker,!1,g(8965,"Whether the terminal run command picker is currently open.")),s.terminalShellIntegrationEnabled=new Q(gr.TerminalShellIntegrationEnabled,!1,g(8966,"Whether shell integration is enabled in the active terminal")),s.shouldShowViewInlineActions=he.and(he.equals("view",jqt),he.notEquals(`config.${Ww.TabsHideCondition}`,"never"),he.or(he.not(`config.${Ww.TabsEnabled}`),he.and(he.equals(`config.${Ww.TabsShowActions}`,"singleTerminal"),he.equals(gr.GroupCount,1)),he.and(he.equals(`config.${Ww.TabsShowActions}`,"singleTerminalOrNarrow"),he.or(he.equals(gr.GroupCount,1),he.has(gr.TabsNarrow))),he.and(he.equals(`config.${Ww.TabsShowActions}`,"singleGroup"),he.equals(gr.GroupCount,1)),he.equals(`config.${Ww.TabsShowActions}`,"always")))})(DEe||(DEe={}));var sj,YR;let kEe=(YR=class extends Ob{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return sj.ID}get editorId(){return zze}get capabilities(){return Ei.Readonly|Ei.Singleton|Ei.CanDropIntoEditor|Ei.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||{},fW.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(sj,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(Ww.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:Xe.Warning,message:g(8929,"Do you want to terminate running processes?"),primaryButton:g(8930,"&&Terminate"),detail:e.length>1?e.map(i=>i.editor.getName()).join(` +`+i).join("")})}}function bqt(s,e){return!(e.lineNumbers.endLineNumber||e.lineNumber===s.startLineNumber&&e.column=s.endColumn)}function wqt(s,e){return s.lineNumber===e.lineNumber?new Ju(0,e.column-s.column):new Ju(e.lineNumber-s.lineNumber,e.column-1)}function yqt(s,e){return e.lineCount===0?new oe(s.lineNumber,s.column+e.columnCount):new oe(s.lineNumber+e.lineCount,e.columnCount+1)}function Cze(s,e){return s.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 Ni;const t=e.startLineNumber-this.inputRange.startLineNumber,i=e.endLineNumberExclusive-this.inputRange.endLineNumberExclusive;return new Vu(e,new Kg(this.outputRange.startLineNumber+t,this.outputRange.lineCount-t+i))}join(e){return new Vu(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 Vu(this.inputRange,this.outputRange.delta(e))}addInputLineDelta(e){return new Vu(this.inputRange.delta(e),this.outputRange)}reverse(){return new Vu(this.outputRange,this.inputRange)}}class P1{static betweenOutputs(e,t,i){const o=Hce.compute(e,t).map(r=>new Vu(r.output1Range,r.output2Range));return new P1(o,i)}constructor(e,t){this.lineRangeMappings=e,this.inputLineCount=t,V_(()=>fU(e,(i,n)=>i.inputRange.isBefore(n.inputRange)&&i.outputRange.isBefore(n.outputRange)&&n.inputRange.startLineNumber-i.inputRange.endLineNumberExclusive===n.outputRange.startLineNumber-i.outputRange.endLineNumberExclusive))}project(e){const t=bk(this.lineRangeMappings,o=>o.inputRange.startLineNumber<=e);if(!t)return new Vu(new Kg(e,1),new Kg(e,1));if(t.inputRange.contains(e))return t;const i=new Kg(e,1),n=new Kg(e+t.outputRange.endLineNumberExclusive-t.inputRange.endLineNumberExclusive,1);return new Vu(i,n)}get outputLineCount(){const e=h6e(this.lineRangeMappings),t=e?e.outputRange.endLineNumberExclusive-e.inputRange.endLineNumberExclusive:0;return this.inputLineCount+t}reverse(){return new P1(this.lineRangeMappings.map(e=>e.reverse()),this.outputLineCount)}}class Hce{static compute(e,t){const i=Cc(d=>d.inputRange.startLineNumber,iu),n=Int(e.map(d=>({source:0,diff:d})),t.map(d=>({source:1,diff:d}))).sort(Cc(d=>d.diff,i)),o=[new Array,new Array],r=[0,0],a=new Array;function c(d){const h=Vu.join(o[0])||new Vu(d,d.delta(r[0])),u=Vu.join(o[1])||new Vu(d,d.delta(r[1]));a.push(new Hce(l,h.extendInputRange(l).outputRange,o[0],u.extendInputRange(l).outputRange,o[1])),o[0]=[],o[1]=[]}let l;for(const d of n){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,n,o){this.inputRange=e,this.output1Range=t,this.output1LineMappings=i,this.output2Range=n,this.output2LineMappings=o}toString(){return`${this.output1Range} <- ${this.inputRange} -> ${this.output2Range}`}}class _D extends Vu{static join(e){return e.reduce((t,i)=>t?t.join(i):i,void 0)}constructor(e,t,i,n,o){super(e,i),this.inputTextModel=t,this.outputTextModel=n,this.rangeMappings=o||[new uA(this.inputRange.toRange(),this.outputRange.toRange())]}addOutputLineDelta(e){return new _D(this.inputRange,this.inputTextModel,this.outputRange.delta(e),this.outputTextModel,this.rangeMappings.map(t=>t.addOutputLineDelta(e)))}addInputLineDelta(e){return new _D(this.inputRange.delta(e),this.inputTextModel,this.outputRange,this.outputTextModel,this.rangeMappings.map(t=>t.addInputLineDelta(e)))}join(e){return new _D(this.inputRange.join(e.inputRange),this.inputTextModel,this.outputRange.join(e.outputRange),this.outputTextModel)}getLineEdit(){return new d$(this.inputRange,this.getOutputLines())}getReverseLineEdit(){return new d$(this.outputRange,this.getInputLines())}getOutputLines(){return this.outputRange.getLines(this.outputTextModel)}getInputLines(){return this.inputRange.getLines(this.inputTextModel)}}class uA{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 uA(this.inputRange,new F(this.outputRange.startLineNumber+e,this.outputRange.startColumn,this.outputRange.endLineNumber+e,this.outputRange.endColumn))}addInputLineDelta(e){return new uA(new F(this.inputRange.startLineNumber+e,this.inputRange.startColumn,this.inputRange.endLineNumber+e,this.inputRange.endColumn),this.outputRange)}reverse(){return new uA(this.outputRange,this.inputRange)}}class AF{constructor(e,t){this.rangeMappings=e,this.inputLineCount=t,V_(()=>fU(e,(i,n)=>Cze(i.inputRange,n.inputRange)&&Cze(i.outputRange,n.outputRange)))}project(e){const t=bk(this.rangeMappings,o=>o.inputRange.getStartPosition().isBeforeOrEqual(e));if(!t)return new uA(F.fromPositions(e,e),F.fromPositions(e,e));if(bqt(t.inputRange,e))return t;const i=wqt(t.inputRange.getEndPosition(),e),n=yqt(t.outputRange.getEndPosition(),i);return new uA(F.fromPositions(e),F.fromPositions(n))}projectRange(e){const t=this.project(e.getStartPosition()),i=this.project(e.getEndPosition());return new uA(t.inputRange.plusRange(i.inputRange),t.outputRange.plusRange(i.outputRange))}get outputLineCount(){const e=h6e(this.rangeMappings),t=e?e.outputRange.endLineNumber-e.inputRange.endLineNumber:0;return this.inputLineCount+t}reverse(){return new AF(this.rangeMappings.map(e=>e.reverse()),this.outputLineCount)}}let yte=class{constructor(e,t){this.editorWorkerService=e,this.configurationService=t,this.mergeAlgorithm=lRe("mergeEditor.diffAlgorithm","advanced",this.configurationService).map(i=>i==="smart"?"legacy":i==="experimental"?"advanced":i)}async computeDiff(e,t,i){const n=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},n);if(!a)throw new Error("Diff computation failed");if(e.isDisposed()||t.isDisposed())return{diffs:null};const c=a.changes.map(h=>new _D(Sze(h.original),e,Sze(h.modified),t,h.innerChanges?.map(u=>Cqt(u)))),l=e.getVersionId(),d=t.getVersionId();return o!==l||r!==d?{diffs:null}:(V_(()=>{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 b=u.startLineNumber-1<=v.inputRange.startLineNumber&&v.inputRange.endLineNumber<=u.endLineNumberExclusive;b&&v.inputRange.startLineNumber===u.startLineNumber-1&&(b=v.inputRange.endColumn>=p.getLineMaxColumn(v.inputRange.startLineNumber)),b&&v.inputRange.endLineNumber===u.endLineNumberExclusive&&(b=v.inputRange.endColumn===1);let w=f.startLineNumber-1<=v.outputRange.startLineNumber&&v.outputRange.endLineNumber<=f.endLineNumberExclusive;if(w&&v.outputRange.startLineNumber===f.startLineNumber-1&&(w=v.outputRange.endColumn>=m.getLineMaxColumn(v.outputRange.endLineNumber)),w&&v.outputRange.endLineNumber===f.endLineNumberExclusive&&(w=v.outputRange.endColumn===1),!b||!w)return!1}}return c.length===0||c[0].inputRange.startLineNumber===c[0].outputRange.startLineNumber&&fU(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 Eue extends V{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=jt(this,Hp.initializing),this._diffs=jt(this,[]),this._barrier=new Sqt,this._isDisposed=!1,this._isInitializing=!0;const n=lC("recompute");this._register(ai(o=>{n.read(o),this._recompute(o)})),this._register(e.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{n.trigger(void 0)}))),this._register(t.onDidChangeContent(this._barrier.makeExclusiveOrSkip(()=>{n.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()===Hp.initializing&&(this._isInitializing=!0),ts(n=>{this._state.set(this._isInitializing?Hp.initializing:Hp.updating,n,jC.other)}),this.diffComputer.computeDiff(this.baseTextModel,this.textModel,e).then(n=>{this._isDisposed||t===this._recomputeCount&&ts(o=>{n.diffs?(this._state.set(Hp.upToDate,o,jC.textChange),this._diffs.set(n.diffs,o,jC.textChange)):this._state.set(Hp.error,o,jC.textChange),this._isInitializing=!1})})}ensureUpToDate(){if(this.state.get()!==Hp.upToDate)throw new Ni("Cannot remove diffs when the model is not up to date")}removeDiffs(e,t,i){this.ensureUpToDate(),e.sort(Cc(o=>o.inputRange.startLineNumber,iu)),e.reverse();let n=this._diffs.get();for(const o of e){const r=n.length;if(n=n.filter(a=>a!==o),r===n.length)throw new Ni;this._barrier.runExclusivelyOrThrow(()=>{const a=o.getReverseLineEdit().toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,a,()=>null,i)}),n=n.map(a=>a.outputRange.isAfter(o.outputRange)?a.addOutputLineDelta(o.inputRange.lineCount-o.outputRange.lineCount):a)}this._diffs.set(n,t,jC.other)}applyEditRelativeToOriginal(e,t,i){this.ensureUpToDate();const n=new _D(e.range,this.baseTextModel,new Kg(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 Ni("Edit must be conflict free.");c.inputRange.isAfter(e.range)?(o||(o=!0,a.push(n.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(n.addOutputLineDelta(r))),this._barrier.runExclusivelyOrThrow(()=>{const c=new d$(e.range.delta(r),e.newLines).toEdits(this.textModel.getLineCount());this.textModel.pushEditOperations(null,c,()=>null,i)}),this._diffs.set(a,t,jC.other)}findTouchingDiffs(e){return this.diffs.get().filter(t=>t.inputRange.touches(e))}getResultLine(e,t){let i=0;const n=t?this.diffs.read(t):this.diffs.get();for(const o of n){if(o.inputRange.contains(e)||o.inputRange.endLineNumberExclusive===e)return o;if(o.inputRange.endLineNumberExclusivenew YNe(a.inputRange,i,a.output1Range,n,a.output1LineMappings,a.output2Range,o,a.output2LineMappings))}constructor(e,t,i,n,o,r,a,c){if(this.baseRange=e,this.baseTextModel=t,this.input1Range=i,this.input1TextModel=n,this.input1Diffs=o,this.input2Range=r,this.input2TextModel=a,this.input2Diffs=c,this.input1CombinedDiff=_D.join(this.input1Diffs),this.input2CombinedDiff=_D.join(this.input2Diffs),this.isEqualChange=is(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 Ni("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:Dd.base};if(t.length===1)return{edit:t[0].diff.getLineEdit(),effectiveState:Dd.base.withInputValue(t[0].inputNumber,!0,!1)};if(e.kind!==Uo.both)throw new Ni;const i=e.smartCombination?this.smartCombineInputs(e.firstInput):this.dumbCombineInputs(e.firstInput);return i?{edit:i,effectiveState:e}:{edit:t[uEe(e.firstInput)-1].diff.getLineEdit(),effectiveState:Dd.base.withInputValue(uEe(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=Int(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(f6e(Cc(o=>o.diff.inputRange,F.compareRangesUsingStarts),Cc(o=>o.input===e?1:2,iu))).map(o=>{const r=o.input===1?this.input1TextModel:this.input2TextModel;return new _qt(o.diff.inputRange,r.getValueInRange(o.diff.outputRange))}),n=Aqt(this.baseRange,i,this.baseTextModel);return e===1?this.smartInput1LineRangeEdit=n:this.smartInput2LineRangeEdit=n,n}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 n=new d$(this.baseRange,t.concat(i));return e===1?this.dumbInput1LineRangeEdit=n:this.dumbInput2LineRangeEdit=n,n}}function Aqt(s,e,t){let i="";const n=s.startLineNumber>1;let o=n?new oe(s.startLineNumber-1,t.getLineMaxColumn(s.startLineNumber-1)):new oe(s.startLineNumber,1);for(const d of e){const h=d.range.getStartPosition();if(!o.isBeforeOrEqual(h))return;let u=t.getValueInRange(F.fromPositions(o,h));h.lineNumber>t.getLineCount()&&(u+=` +`),i+=u,i+=d.newText,o=d.range.getEndPosition()}const r=s.endLineNumberExclusive<=t.getLineCount(),a=r?new oe(s.endLineNumberExclusive,1):new oe(s.endLineNumberExclusive-1,Un.MAX_SAFE_SMALL_INTEGER),c=t.getValueInRange(F.fromPositions(o,a));i+=c;const l=iv(i);if(n){if(l[0]!=="")return;l.shift()}if(r){if(l[l.length-1]!=="")return;l.pop()}return new d$(s,l)}var Uo;(function(s){s[s.base=0]="base",s[s.input1=1]="input1",s[s.input2=2]="input2",s[s.both=3]="both",s[s.unrecognized=4]="unrecognized"})(Uo||(Uo={}));function uEe(s){return s===1?2:1}class cG{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)?xH.first:xH.excluded}}class JNe extends cG{get kind(){return Uo.base}toString(){return"base"}swap(){return this}withInputValue(e,t,i=!1){return e===1?t?new Uce:this:t?new cN:this}equals(e){return e.kind===Uo.base}}class Uce extends cG{get kind(){return Uo.input1}get includesInput1(){return!0}toString(){return"1✓"}swap(){return new cN}withInputValue(e,t,i=!1){return e===1?t?this:new JNe:t?new Vce(1,i):new cN}equals(e){return e.kind===Uo.input1}}class cN extends cG{get kind(){return Uo.input2}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new Uce}withInputValue(e,t,i=!1){return e===2?t?this:new JNe:t?new Vce(2,i):new cN}equals(e){return e.kind===Uo.input2}}class Vce extends cG{constructor(e,t){super(),this.firstInput=e,this.smartCombination=t}get kind(){return Uo.both}get includesInput1(){return!0}get includesInput2(){return!0}toString(){return"2✓"}swap(){return new Vce(uEe(this.firstInput),this.smartCombination)}withInputValue(e,t,i=!1){return t?this:e===1?new cN:new Uce}equals(e){return e.kind===Uo.both&&this.firstInput===e.firstInput&&this.smartCombination===e.smartCombination}getInput(e){return e===this.firstInput?xH.first:xH.second}}class Eqt extends cG{get kind(){return Uo.unrecognized}toString(){return"unrecognized"}swap(){return this}withInputValue(e,t,i=!1){return t?e===1?new Uce:new cN:this}equals(e){return e.kind===Uo.unrecognized}}var Dd;(function(s){s.base=new JNe,s.unrecognized=new Eqt})(Dd||(Dd={}));var xH;(function(s){s[s.excluded=0]="excluded",s[s.first=1]="first",s[s.second=2]="second",s[s.unrecognized=3]="unrecognized"})(xH||(xH={}));let Cte=class extends xI{constructor(e,t,i,n,o,r,a,c,l){super(),this.base=e,this.input1=t,this.input2=i,this.resultTextModel=n,this.diffComputer=o,this.options=r,this.telemetry=a,this.languageService=c,this.undoRedoService=l,this.input1TextModelDiffs=this._register(new Eue(this.base,this.input1.textModel,this.diffComputer)),this.input2TextModelDiffs=this._register(new Eue(this.base,this.input2.textModel,this.diffComputer)),this.resultTextModelDiffs=this._register(new Eue(this.base,this.resultTextModel,this.diffComputer)),this.modifiedBaseRanges=Ze(this,h=>{const u=this.input1TextModelDiffs.diffs.read(h),f=this.input2TextModelDiffs.diffs.read(h);return YNe.fromDiffs(u,f,this.base,this.input1.textModel,this.input2.textModel)}),this.modifiedBaseRangeResultStates=Ze(this,h=>new Map(this.modifiedBaseRanges.read(h).map(f=>[f,new Aze(f)]))),this.resultSnapshot=this.resultTextModel.createSnapshot(),this.baseInput1Diffs=this.input1TextModelDiffs.diffs,this.baseInput2Diffs=this.input2TextModelDiffs.diffs,this.baseResultDiffs=this.resultTextModelDiffs.diffs,this.input1ResultMapping=Ze(this,h=>this.getInputResultMapping(this.baseInput1Diffs.read(h),this.baseResultDiffs.read(h),this.input1.textModel.getLineCount())),this.resultInput1Mapping=Ze(this,h=>this.input1ResultMapping.read(h).reverse()),this.input2ResultMapping=Ze(this,h=>this.getInputResultMapping(this.baseInput2Diffs.read(h),this.baseResultDiffs.read(h),this.input2.textModel.getLineCount())),this.resultInput2Mapping=Ze(this,h=>this.input2ResultMapping.read(h).reverse()),this.baseResultMapping=Ze(this,h=>{const u=new P1(this.baseResultDiffs.read(h),-1);return new P1(u.lineRangeMappings.map(f=>f.inputRange.isEmpty||f.outputRange.isEmpty?new Vu(f.inputRange.deltaStart(-1),f.outputRange.deltaStart(-1)):f),u.inputLineCount)}),this.resultBaseMapping=Ze(this,h=>this.baseResultMapping.read(h).reverse()),this.diffComputingState=Ze(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs,this.resultTextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===Hp.initializing)?Vm.initializing:u.some(f=>f===Hp.updating)?Vm.updating:Vm.upToDate}),this.inputDiffComputingState=Ze(this,h=>{const u=[this.input1TextModelDiffs,this.input2TextModelDiffs].map(f=>f.state.read(h));return u.some(f=>f===Hp.initializing)?Vm.initializing:u.some(f=>f===Hp.updating)?Vm.updating:Vm.upToDate}),this.isUpToDate=Ze(this,h=>this.diffComputingState.read(h)===Vm.upToDate),this.onInitialized=D5(this.diffComputingState,h=>h===Vm.upToDate).then(()=>{}),this.firstRun=!0,this.unhandledConflictsCount=Ze(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(Pq(this.modifiedBaseRangeResultStates)),this._register(Pq(this.input1ResultMapping)),this._register(Pq(this.input2ResultMapping));const d=this.initialize();this.onInitialized=this.onInitialized.then(async()=>{await d}),d.then(()=>{let h=!0;this._register(xU({handleChange:u=>(u.didChange(this.modifiedBaseRangeResultStates)&&(h=!0),u.didChange(this.resultTextModelDiffs.diffs)?u.change===jC.textChange:!0)},u=>{const f=this.modifiedBaseRangeResultStates.read(u);if(!this.isUpToDate.read(u))return;const p=this.resultTextModelDiffs.diffs.read(u);ts(m=>{if(this.updateBaseRangeAcceptedState(p,f,m),h){h=!1;for(const[v,b]of f){const w=b.accepted.get(),y=!(w.kind===Uo.base||w.kind===Uo.unrecognized);b.handledInput1.set(y,m),b.handledInput2.set(y,m)}}})}))})}async initialize(){this.options.resetResult&&await this.reset()}async reset(){await D5(this.inputDiffComputingState,t=>t===Vm.upToDate);const e=this.modifiedBaseRangeResultStates.get();ts(t=>{for(const[i,n]of e){let o,r=!1;i.input1Diffs.length===0?(o=Dd.base.withInputValue(2,!0),r=!0):i.input2Diffs.length===0||i.isEqualChange?(o=Dd.base.withInputValue(1,!0),r=!0):(o=Dd.base,r=!1),n.accepted.set(o,t),n.computedFromDiffing=!1,n.previousNonDiffingState=void 0,n.handledInput1.set(r,t),n.handledInput2.set(r,t)}this.resultTextModel.pushEditOperations(null,[{range:new F(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(),n=this.input2.textModel.getLinesContent(),o=[];function r(c,l){for(let d=l.startLineNumber;do.inputRange.isEmpty||o.outputRange.isEmpty?new Vu(o.inputRange.deltaStart(-1),o.outputRange.deltaStart(-1)):o),n.inputLineCount)}translateInputRangeToBase(e,t){const i=e===1?this.baseInput1Diffs.get():this.baseInput2Diffs.get();return new AF(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 AF(i.flatMap(o=>o.rangeMappings),0).projectRange(t).outputRange}getLineRangeInResult(e,t){return this.resultTextModelDiffs.getResultLineRange(e,t)}translateResultRangeToBase(e){return new AF(this.baseResultDiffs.get().flatMap(i=>i.rangeMappings),0).reverse().projectRange(e).outputRange}translateBaseRangeToResult(e){return new AF(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 n=mqt(t,e,(o,r)=>o[0].baseRange.touches(r.inputRange)?wk.neitherLessOrGreaterThan:Kg.compareByStart(o[0].baseRange,r.inputRange));for(const o of n){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 Dd.base;const i=t.map(r=>r.getLineEdit());function n(r){return is(i,r.map(a=>a.getLineEdit()),(a,c)=>a.equals(c))}if(n(e.input1Diffs))return Dd.base.withInputValue(1,!0);if(n(e.input2Diffs))return Dd.base.withInputValue(2,!0);const o=[Dd.base.withInputValue(1,!0).withInputValue(2,!0,!0),Dd.base.withInputValue(2,!0).withInputValue(1,!0,!0),Dd.base.withInputValue(1,!0).withInputValue(2,!0,!1),Dd.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(is(a.newLines,l,(d,h)=>d===h))return r}}return Dd.unrecognized}getState(e){const t=this.modifiedBaseRangeResultStates.get().get(e);if(!t)throw new Ni("object must be from this instance");return t.accepted}setState(e,t,i,n,o=!1){if(!this.isUpToDate.get())throw new Ni("Cannot set state while updating");const r=this.modifiedBaseRangeResultStates.get().get(e);if(!r)throw new Ni("object must be from this instance");const a=this.resultTextModelDiffs.findTouchingDiffs(e.baseRange),c=new _Y;a&&this.resultTextModelDiffs.removeDiffs(a,n,c);const{edit:l,effectiveState:d}=e.getEditForBase(t);r.accepted.set(d,n),r.previousNonDiffingState=void 0,r.computedFromDiffing=!1;const h=r.handledInput1.get(),u=r.handledInput2.get();(!h||!u)&&this.undoRedoService.pushElement(new xqt(this.resultTextModel.uri,new WeakRef(this),new WeakRef(r),h,u),c),l&&(this.resultTextModel.pushStackElement(),this.resultTextModelDiffs.applyEditRelativeToOriginal(l,n,c),this.resultTextModel.pushStackElement()),r.handledInput1.set(!0,n),r.handledInput2.set(!0,n)}resetDirtyConflictsToBase(){ts(e=>{this.resultTextModel.pushStackElement();for(const t of this.modifiedBaseRanges.get())this.getState(t).get().kind===Uo.unrecognized&&this.setState(t,Dd.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,n){const o=this.modifiedBaseRangeResultStates.get().get(e);if(o.handled.get()===i)return;const r=new WeakRef(Aze),a=new WeakRef(this);this.undoRedoService.pushElement({type:Sl.Resource,resource:this.resultTextModel.uri,code:"setInputHandled",label:g(11380,"Set Input Handled"),redo(){const c=a.deref(),l=r.deref();c&&!c.isDisposed()&&l&&ts(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&&ts(d=>{t===1?o.handledInput1.set(!i,d):o.handledInput2.set(!i,d)})}}),t===1?o.handledInput1.set(i,n):o.handledInput2.set(i,n)}setHandled(e,t,i){const n=this.modifiedBaseRangeResultStates.get().get(e);n.handled.get()!==t&&(n.handledInput1.set(t,i),n.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 D5(this.diffComputingState,c=>c===Vm.upToDate),this.unhandledConflictsCount.get()===0)return this.resultTextModel.getValue();const e=this.resultTextModel.getLinesContent(),t=this.input1.textModel.getLinesContent(),i=this.input2.textModel.getLinesContent(),n=this.modifiedBaseRangeResultStates.get(),o=[];function r(c,l){for(let d=l.startLineNumber;d>>>>>>")}return r(e,Kg.fromLineNumbers(a,e.length+1)),o.join(` +`)}get conflictCount(){return fg(this.modifiedBaseRanges.get(),e=>e.isConflicting)}get combinableConflictCount(){return fg(this.modifiedBaseRanges.get(),e=>e.isConflicting&&e.canBeCombined)}get conflictsResolvedWithBase(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.base)}get conflictsResolvedWithInput1(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.input1)}get conflictsResolvedWithInput2(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.input2)}get conflictsResolvedWithSmartCombination(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualNone(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>e.isConflicting&&t.accepted.get().kind===Uo.unrecognized)}get manuallySolvedConflictCountThatEqualSmartCombine(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.both&&i.smartCombination})}get manuallySolvedConflictCountThatEqualInput1(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.input1})}get manuallySolvedConflictCountThatEqualInput2(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&t.computedFromDiffing&&i.kind===Uo.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBase(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.base})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput1(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.input1})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithInput2(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.input2})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothNonSmart(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.both&&!t.previousNonDiffingState?.smartCombination})}get manuallySolvedConflictCountThatEqualNoneAndStartedWithBothSmart(){return fg(this.modifiedBaseRangeResultStates.get().entries(),([e,t])=>{const i=t.accepted.get();return e.isConflicting&&i.kind===Uo.unrecognized&&t.previousNonDiffingState?.kind===Uo.both&&t.previousNonDiffingState?.smartCombination})}};Cte=D([_(7,xi),_(8,jA)],Cte);function fg(s,e){let t=0;for(const i of s)e(i)&&t++;return t}class Aze{constructor(e){this.baseRange=e,this.accepted=jt(`BaseRangeState${this.baseRange.baseRange}`,Dd.base),this.handledInput1=jt(`BaseRangeHandledState${this.baseRange.baseRange}.Input1`,!1),this.handledInput2=jt(`BaseRangeHandledState${this.baseRange.baseRange}.Input2`,!1),this.computedFromDiffing=!1,this.previousNonDiffingState=void 0,this.handled=Ze(this,t=>this.handledInput1.read(t)&&this.handledInput2.read(t))}}var Vm;(function(s){s[s.initializing=1]="initializing",s[s.upToDate=2]="upToDate",s[s.updating=3]="updating"})(Vm||(Vm={}));class xqt{constructor(e,t,i,n,o){this.resource=e,this.mergeEditorModelRef=t,this.stateRef=i,this.input1Handled=n,this.input2Handled=o,this.code="undoMarkAsHandled",this.label=g(11381,"Undo Mark As Handled"),this.type=Sl.Resource}redo(){const e=this.mergeEditorModelRef.deref();if(!e||e.isDisposed())return;const t=this.stateRef.deref();t&&ts(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&&ts(i=>{t.handledInput1.set(this.input1Handled,i),t.handledInput2.set(this.input2Handled,i)})}}new Y("isMergeEditor",!1,{type:"boolean",description:g(10824,"The editor is a merge editor")});new Y("isMergeResultEditor",!1,{type:"boolean",description:g(10825,"The editor is a the result editor of a merge editor.")});new Y("mergeEditorLayout","mixed",{type:"string",description:g(10826,"The layout mode of a merge editor")});new Y("mergeEditorShowBase",!1,{type:"boolean",description:g(10827,"If the merge editor shows the base version")});new Y("mergeEditorShowBaseAtTop",!1,{type:"boolean",description:g(10828,"If base should be shown at the top")});new Y("mergeEditorShowNonConflictingChanges",!1,{type:"boolean",description:g(10829,"If the merge editor shows non-conflicting changes")});new Y("mergeEditorBaseUri","",{type:"string",description:g(10830,"The uri of the baser of a merge editor")});new Y("mergeEditorResultUri","",{type:"string",description:g(10831,"The uri of the result of a merge editor")});const Eze="mergeEditorCloseWithConflicts";var gEe;let fEe=class{constructor(e,t,i,n){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this._modelService=n}async createInputModel(e){const t=new Z,[i,n,o,r]=await Promise.all([this._textModelService.createModelReference(e.base),this._textModelService.createModelReference(e.result),Ste(e.input1,this._textModelService,t),Ste(e.input2,this._textModelService,t)]);t.add(i),t.add(n);const a=n.object.textEditorModel.uri.with({scheme:"merge-result"}),c=this._modelService.createModel("",{languageId:n.object.textEditorModel.getLanguageId(),onDidChange:M.None},a);t.add(c);const l=this._instantiationService.createInstance(yte),d=this._instantiationService.createInstance(Cte,i.object.textEditorModel,o,r,c,l,{resetResult:!0},this._mergeEditorTelemetry);return t.add(d),await d.onInitialized,this._instantiationService.createInstance(pEe,d,t,n.object,e.result)}};fEe=D([_(1,we),_(2,fn),_(3,gi)],fEe);let pEe=class extends xI{constructor(e,t,i,n,o,r,a){super(),this.model=e,this.disposable=t,this.result=i,this.resultUri=n,this.textFileService=o,this.dialogService=r,this.editorService=a,this.savedAltVersionId=jt(this,this.model.resultTextModel.getAlternativeVersionId()),this.altVersionId=Kn(this,c=>this.model.resultTextModel.onDidChangeContent(c),()=>this.model.resultTextModel.getAlternativeVersionId()),this.isDirty=Ze(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){V_(()=>e.some(n=>n===this));const t=e.some(n=>n.isDirty.get());let i;if(t){const n=e.length>1,o=n?g(10663,"Do you want keep the merge result of {0} files?",e.length):g(10664,"Do you want keep the merge result of {0}?",_i(e[0].model.resultTextModel.uri)),r=e.some(c=>c.model.hasUnhandledConflicts.get()),a=[{label:r?g(10665,"&&Save With Conflicts"):g(10666,"&&Save"),run:()=>$h.SAVE},{label:g(10667,"Do&&n't Save"),run:()=>$h.DONT_SAVE}];i=(await this.dialogService.prompt({type:Xe.Info,message:o,detail:r?n?g(10668,"The files contain unhandled conflicts. The merge results will be lost if you don't save them."):g(10669,"The file contains unhandled conflicts. The merge result will be lost if you don't save it."):n?g(10670,"The merge results will be lost if you don't save them."):g(10671,"The merge result will be lost if you don't save it."),buttons:a,cancelButton:{run:()=>$h.CANCEL}})).result}else i=$h.DONT_SAVE;return i===$h.SAVE?await Promise.all(e.map(n=>n.accept())):i===$h.DONT_SAVE&&await Promise.all(e.map(n=>n._discard())),i}async save(e){this.finished||(async()=>{const{confirmed:t}=await this.dialogService.confirm({message:g(10672,"Do you want to accept the merge result?"),detail:g(10673,"This will write the merge result to the original file and close the merge editor."),primaryButton:g(10674,"&&Accept Merge")});if(t){await this.accept();const i=this.editorService.findEditors(this.resultUri).filter(n=>n.editor.typeId==="mergeEditor.Input");await this.editorService.closeEditors(i)}})()}async revert(e){}};pEe=D([_(4,Fo),_(5,to),_(6,ei)],pEe);var zR;let mEe=(zR=class{constructor(e,t,i,n){this._mergeEditorTelemetry=e,this._instantiationService=t,this._textModelService=i,this.textFileService=n}async createInputModel(e){const t=new Z;let i;const n=t.add(new Z),o=m=>{ji(e.result,m.resource)&&(n.clear(),i=m)};n.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),Ste(e.input1,this._textModelService,t),Ste(e.input2,this._textModelService,t)]);if(t.add(r),t.add(a),!i)throw new Ni;await i.save({source:gEe.FILE_SAVED_SOURCE});const u=i.textEditorModel.getLinesContent().some(m=>m.startsWith(pqt.start)),f=this._instantiationService.createInstance(yte),p=this._instantiationService.createInstance(Cte,r.object.textEditorModel,c,l,a.object.textEditorModel,f,{resetResult:u},this._mergeEditorTelemetry);return t.add(p),await p.onInitialized,this._instantiationService.createInstance(_Ee,p,t,i,this._mergeEditorTelemetry)}},gEe=zR,zR.FILE_SAVED_SOURCE=MJ.registerSource("merge-editor.source",g(10675,"Before Resolving Conflicts In Merge Editor")),zR);mEe=gEe=D([_(1,we),_(2,fn),_(3,Fo)],mEe);let _Ee=class extends xI{constructor(e,t,i,n,o,r){super(),this.model=e,this.disposableStore=t,this.resultTextFileModel=i,this.telemetry=n,this._dialogService=o,this._storageService=r,this.isDirty=Kn(this,M.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()),n=e.some(o=>o.model.hasUnhandledConflicts.get());if(i){const o=t?g(10676,"Do you want to save the changes you made to {0} files?",e.length):g(10677,"Do you want to save the changes you made to {0}?",_i(e[0].resultUri)),{result:r}=await this._dialogService.prompt({type:Xe.Info,message:o,detail:n?t?g(10678,"The files contain unhandled conflicts. Your changes will be lost if you don't save them."):g(10679,"The file contains unhandled conflicts. Your changes will be lost if you don't save them."):g(t?10680:10681,"Your changes will be lost if you don't save them."),buttons:[{label:n?g(10682,"&&Save with Conflicts"):g(10683,"&&Save"),run:()=>$h.SAVE},{label:g(10684,"Do&&n't Save"),run:()=>$h.DONT_SAVE}],cancelButton:{run:()=>$h.CANCEL}});return r}else if(n&&!this._storageService.getBoolean(Eze,Ie.PROFILE,!1)){const{confirmed:o,checkboxChecked:r}=await this._dialogService.confirm({message:t?g(10685,"Do you want to close {0} merge editors?",e.length):g(10686,"Do you want to close the merge editor for {0}?",_i(e[0].resultUri)),detail:n?t?g(10687,"The files contain unhandled conflicts."):g(10688,"The file contains unhandled conflicts."):void 0,primaryButton:n?g(10689,"&&Close with Conflicts"):g(10690,"&&Close"),checkbox:{label:g(10691,"Do not ask me again")}});return r&&this._storageService.store(Eze,!0,Ie.PROFILE,an.USER),o?$h.SAVE:$h.CANCEL}else return $h.SAVE}};_Ee=D([_(4,to),_(5,$i)],_Ee);async function Ste(s,e,t){const i=await e.createModelReference(s.uri);return t.add(i),{textModel:i.object.textEditorModel,title:s.title,description:s.description,detail:s.detail}}let vEe=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",{})}};vEe=D([_(0,Yi)],vEe);var MV,$R;let bEe=($R=class extends rb{get useWorkingCopy(){return this.configurationService.getValue("mergeEditor.useWorkingCopy")??!1}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(n,void 0,r,a,c,l,h,u,f),this.base=e,this.input1=t,this.input2=i,this.result=n,this._instaService=o,this.configurationService=d,this.closeHandler={showConfirm:()=>this._inputModel?.shouldConfirmClose()??!1,confirm:async p=>{V_(()=>p.every(v=>v.editor instanceof MV));const m=p.map(v=>v.editor._inputModel).filter(Fc);return await this._inputModel.confirmClose(m)}},this.mergeEditorModeFactory=this._instaService.createInstance(this.useWorkingCopy?fEe:mEe,this._instaService.createInstance(vEe))}dispose(){super.dispose()}get typeId(){return MV.ID}get editorId(){return nm.id}get capabilities(){let e=super.capabilities|Ei.MultipleEditors;return this.useWorkingCopy&&(e|=Ei.Untitled),e}getName(){return g(7873,"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(ai(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 MV?ji(this.base,e.base)&&ji(this.input1.uri,e.input1.uri)&&ji(this.input2.uri,e.input2.uri)&&ji(this.result,e.result):_b(e)?(this.editorId===e.options?.override||e.options?.override===void 0)&&ji(this.base,e.base.resource)&&ji(this.input1.uri,e.input1.resource)&&ji(this.input2.uri,e.input2.resource)&&ji(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)}},MV=$R,$R.ID="mergeEditor.Input",$R);bEe=MV=D([_(4,we),_(5,ei),_(6,Fo),_(7,Fs),_(8,Jt),_(9,Te),_(10,pd),_(11,Ec),_(12,tE)],bEe);const Dqt=oi("multi-diff-editor-label-icon",ve.diffMultiple,g(10264,"Icon of the multi diff editor label."));class xze{constructor(e,t,i){if(this.originalUri=e,this.modifiedUri=t,this.goToFileUri=i,!e&&!t)throw new Ni("Invalid arguments")}getKey(){return JSON.stringify([this.modifiedUri?.toString(),this.originalUri?.toString()])}}const kqt=Qe.as(Nn.Configuration),Iqt={...B6,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:g(5659,'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"}}}};kqt.registerConfiguration(Iqt);var h$;(function(s){s.builtin="builtin",s.option="option",s.exclusive="exclusive",s.default="default"})(h$||(h$={}));var sz;(function(s){s[s.ABORT=1]="ABORT",s[s.NONE=2]="NONE"})(sz||(sz={}));function Tqt(s,e){if(new Set([pe.extension,pe.webviewPanel,pe.vscodeWorkspaceTrust,pe.vscodeSettings]).has(e.scheme))return!1;const n=typeof s=="string"&&s.indexOf(Vi.sep)>=0?`${e.scheme}:${e.path}`:_i(e);return WO(typeof s=="string"?s.toLowerCase():s,n.toLowerCase())}var VP,GR;let iB=(GR=class extends Nb{static fromResourceMultiDiffEditorInput(e,t){if(!e.multiDiffSource&&!e.resources)throw new Ni("MultiDiffEditorInput requires either multiDiffSource or resources");const i=e.multiDiffSource??N.parse(`multi-diff-editor:${new Date().getMilliseconds().toString()+Math.random().toString()}`);return t.createInstance(VP,i,e.label,e.resources?.map(n=>new xze(n.original.resource,n.modified.resource,n.goToFileResource)),e.isTransient??!1)}static fromSerialized(e,t){return t.createInstance(VP,N.parse(e.multiDiffSourceUri),e.label,e.resources?.map(i=>new xze(i.originalUri?N.parse(i.originalUri):void 0,i.modifiedUri?N.parse(i.modifiedUri):void 0,i.goToFileUri?N.parse(i.goToFileUri):void 0)),!1)}get resource(){return this.multiDiffSource}get capabilities(){return Ei.Readonly}get typeId(){return VP.ID}getName(){return this._name}get editorId(){return nm.id}getIcon(){return Dqt}constructor(e,t,i,n=!1,o,r,a,c,l){super(),this.multiDiffSource=e,this.label=t,this.initialResources=i,this.isTransient=n,this._textModelService=o,this._textResourceConfigurationService=r,this._instantiationService=a,this._multiDiffSourceResolverService=c,this._textFileService=l,this._name="",this._viewModel=new Slt(async()=>{const d=await this._createModel();this._register(d);const h=new FYe(d,this._instantiationService);return this._register(h),await yGe(h.waitForDiffs(),1e3),h}),this._resolvedSource=new hIt(async()=>{const d=this.initialResources?{resources:R6e.const(this.initialResources)}:await this._multiDiffSourceResolverService.resolve(this.multiDiffSource);return{source:d,resources:d?yje(this,d.resources):td([])}}),this.resources=Ze(this,d=>this._resolvedSource.cachedPromiseResult.read(d)?.data?.resources.read(d)),this._isDirtyObservables=QY(this,this.resources.map(d=>d??[]),d=>{const h=d.modifiedUri?Dze(this._textFileService,d.modifiedUri):td(!1),u=d.originalUri?Dze(this._textFileService,d.originalUri):td(!1);return Ze(f=>h.read(f)||u.read(f))},d=>d.getKey()),this._isDirtyObservable=Ze(this,d=>this._isDirtyObservables.read(d).some(h=>h.read(d))).keepObserved(this._store),this.onDidChangeDirty=M.fromObservableLight(this._isDirtyObservable),this.closeHandler={async confirm(){return $h.DONT_SAVE},showConfirm(){return!1}},this._register(ai(d=>{const h=this.resources.read(d),u=this.label??g(6140,"Multi Diff Editor");h?this._name=u+g(6141," ({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.originalUri?.toString(),modifiedUri:e.modifiedUri?.toString(),goToFileUri:e.goToFileUri?.toString()}))}}setLanguageId(e,t){const n=this._viewModel.requireValue().activeDiffItem.get()?.documentDiffItem;if(!n)return;const o=n.modified??n.original;o&&o.setLanguage(e,t)}async getViewModel(){return this._viewModel.getPromise()}async _createModel(){const e=await this._resolvedSource.getPromise(),t=this._textResourceConfigurationService,i=QY(this,e.resources,async(c,l)=>{let d,h;const u=new Z;try{[d,h]=await Promise.all([c.originalUri?this._textModelService.createModelReference(c.originalUri):void 0,c.modifiedUri?this._textModelService.createModelReference(c.modifiedUri):void 0]),d&&u.add(d),h&&u.add(h)}catch(m){console.error(m),vt(m);return}const f=c.modifiedUri??c.originalUri,p={multiDiffEditorItem:c,original:d?.object.textEditorModel,modified:h?.object.textEditorModel,get options(){return{...Lqt(h?.object.isReadonly()??!0),...Rqt(t.getValue(f))}},onOptionsDidChange:m=>this._textResourceConfigurationService.onDidChangeConfiguration(v=>{(v.affectsConfiguration(f,"editor")||v.affectsConfiguration(f,"diffEditor"))&&m()})};return l.add(nW.createOfNonDisposable(p,u,this))},c=>JSON.stringify([c.modifiedUri?.toString(),c.originalUri?.toString()])),n=jt("documents",[]),o=Ze(async c=>{const l=i.read(c),h=(await Promise.all(l)).filter(Fc);n.set(h,void 0)}),r=RN(o);return await o.get(),{dispose:()=>r.dispose(),documents:new RLe(n),contextKeys:e.source?.contextKeys}}matches(e){return super.matches(e)?!0:e instanceof VP?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 n=this._viewModel.currentValue?.items.get();n&&await Promise.all(n.map(async o=>{const r=o.diffEditorViewModel.model,a=r.original.uri.scheme!==pe.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)])}))}},VP=GR,GR.ID="workbench.input.multiDiffEditor",GR);iB=VP=D([_(4,fn),_(5,Ec),_(6,we),_(7,xJe),_(8,Fo)],iB);function Dze(s,e){return Kn(M.filter(s.files.onDidChangeDirty,t=>t.resource.toString()===e.toString()),()=>s.isDirty(e))}function Lqt(s){return{readOnly:!!s,readOnlyMessage:typeof s!="boolean"?s:void 0}}function Rqt(s){const e=xs(s.editor);if(kn(s.diffEditor)){const t=xs(s.diffEditor);t.diffCodeLens=t.codeLens,delete t.codeLens,t.diffWordWrap=t.wordWrap,delete t.wordWrap,Object.assign(e,t)}return e}var $B;let kze=($B=class extends V{constructor(e,t){super(),this._register(e.registerEditor("*",{id:nm.id,label:nm.displayName,detail:nm.providerDisplayName,priority:h$.builtin},{},{createMultiDiffEditorInput:i=>({editor:iB.fromResourceMultiDiffEditorInput(i,t)})}))}},$B.ID="workbench.contrib.multiDiffEditorResolver",$B);kze=D([_(0,MU),_(1,we)],kze);var Ize;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down"})(Ize||(Ize={}));var Tze;(function(s){s[s.Connecting=0]="Connecting",s[s.Connected=1]="Connected"})(Tze||(Tze={}));const Lze="terminalEditor";var Rze;(function(s){s[s.SearchHighlightLimit=1e3]="SearchHighlightLimit"})(Rze||(Rze={}));var Mze;(function(s){s[s.Unknown=1]="Unknown",s[s.Fedora=2]="Fedora",s[s.Ubuntu=3]="Ubuntu"})(Mze||(Mze={}));var Nze;(function(s){s.Terminals="Terminals"})(Nze||(Nze={}));W("terminal.background",null,g(9046,"The background color of the terminal, this allows coloring the terminal differently to the panel."));W("terminal.foreground",{light:"#333333",dark:"#CCCCCC",hcDark:"#FFFFFF",hcLight:"#292929"},g(9047,"The foreground color of the terminal."));W("terminalCursor.foreground",null,g(9048,"The foreground color of the terminal cursor."));W("terminalCursor.background",null,g(9049,"The background color of the terminal cursor. Allows customizing the color of a character overlapped by a block cursor."));const RK=W("terminal.selectionBackground",SS,g(9050,"The selection background color of the terminal."));W("terminal.inactiveSelectionBackground",{light:st(RK,.5),dark:st(RK,.5),hcDark:st(RK,.7),hcLight:st(RK,.5)},g(9051,"The selection background color of the terminal when it does not have focus."));W("terminal.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:"#ffffff"},g(9052,"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."));W("terminalCommandDecoration.defaultBackground",{light:"#00000040",dark:"#ffffff40",hcDark:"#ffffff80",hcLight:"#00000040"},g(9053,"The default terminal command decoration background color."));W("terminalCommandDecoration.successBackground",{dark:"#1B81A8",light:"#2090D3",hcDark:"#1B81A8",hcLight:"#007100"},g(9054,"The terminal command decoration background color for successful commands."));W("terminalCommandDecoration.errorBackground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F14C4C",hcLight:"#B5200D"},g(9055,"The terminal command decoration background color for error commands."));W("terminalOverviewRuler.cursorForeground","#A0A0A0CC",g(9056,"The overview ruler cursor color."));W("terminal.border",NRe,g(9057,"The color of the border that separates split panes within the terminal. This defaults to panel.border."));W("terminalOverviewRuler.border",wqe,g(9058,"The overview ruler left-side border color."));W("terminal.findMatchBackground",{dark:LOe,light:LOe,hcDark:null,hcLight:"#0F4A85"},g(9059,"Color of the current search match in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);W("terminal.hoverHighlightBackground",st(ift,.5),g(9060,"Border color of the other search matches in the terminal."));W("terminal.findMatchBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(9061,"Border color of the current search match in the terminal."));W("terminal.findMatchHighlightBackground",{dark:fb,light:fb,hcDark:null,hcLight:null},g(9062,"Color of the other search matches in the terminal. The color must not be opaque so as not to hide underlying terminal content."),!0);W("terminal.findMatchHighlightBorder",{dark:null,light:null,hcDark:"#f38518",hcLight:"#0F4A85"},g(9060,"Border color of the other search matches in the terminal."));W("terminalOverviewRuler.findMatchForeground",{dark:t5,light:t5,hcDark:"#f38518",hcLight:"#0F4A85"},g(9063,"Overview ruler marker color for find matches in the terminal."));W("terminal.dropBackground",MRe,g(9064,"Background color when dragging on top of terminals. The color should have transparency so that the terminal contents can still shine through."),!0);W("terminal.tab.activeBorder",Sve,g(9065,"Border on the side of the terminal tab in the panel. This defaults to tab.activeBorder."));W("terminal.initialHintForeground",{dark:"#ffffff56",light:"#0007",hcDark:null,hcLight:null},g(9066,"Foreground color of the terminal initial hint."));function Mqt(s){let e;if(typeof s=="string"?e=s:s.color?e=s.color.replace(/\./g,"_"):We.isThemeIcon(s.icon)&&s.icon.color&&(e=s.icon.color.id.replace(/\./g,"_")),e)return`terminal-icon-${e.replace(/\./g,"_")}`}function Nqt(s,e,t){const i=s.icon;if(!i)return;const n=[];let o;if(i instanceof N?o=i:i instanceof Object&&"light"in i&&"dark"in i&&(o=e===Qg.LIGHT?i.light:i.dark),o instanceof N){const a=`terminal-uri-icon-${Wc(o.path).toString(36)}`;n.push(a),n.push("terminal-uri-icon")}return n}var wEe;(function(s){s.FocusAccessibleBuffer="workbench.action.terminal.focusAccessibleBuffer",s.AccessibleBufferGoToNextCommand="workbench.action.terminal.accessibleBufferGoToNextCommand",s.AccessibleBufferGoToPreviousCommand="workbench.action.terminal.accessibleBufferGoToPreviousCommand",s.ScrollToBottomAccessibleView="workbench.action.terminal.scrollToBottomAccessibleView",s.ScrollToTopAccessibleView="workbench.action.terminal.scrollToTopAccessibleView"})(wEe||(wEe={}));const Pqt=[wEe.FocusAccessibleBuffer];var fw;(function(s){s.FindFocus="workbench.action.terminal.focusFind",s.FindHide="workbench.action.terminal.hideFind",s.FindNext="workbench.action.terminal.findNext",s.FindPrevious="workbench.action.terminal.findPrevious",s.ToggleFindRegex="workbench.action.terminal.toggleFindRegex",s.ToggleFindWholeWord="workbench.action.terminal.toggleFindWholeWord",s.ToggleFindCaseSensitive="workbench.action.terminal.toggleFindCaseSensitive",s.SearchWorkspace="workbench.action.terminal.searchWorkspace"})(fw||(fw={}));const Fqt=[fw.FindFocus,fw.FindHide,fw.FindNext,fw.FindPrevious,fw.ToggleFindRegex,fw.ToggleFindWholeWord,fw.ToggleFindCaseSensitive,fw.SearchWorkspace];var pw;(function(s){s.SelectPrevSuggestion="workbench.action.terminal.selectPrevSuggestion",s.SelectPrevPageSuggestion="workbench.action.terminal.selectPrevPageSuggestion",s.SelectNextSuggestion="workbench.action.terminal.selectNextSuggestion",s.SelectNextPageSuggestion="workbench.action.terminal.selectNextPageSuggestion",s.AcceptSelectedSuggestion="workbench.action.terminal.acceptSelectedSuggestion",s.AcceptSelectedSuggestionEnter="workbench.action.terminal.acceptSelectedSuggestionEnter",s.HideSuggestWidget="workbench.action.terminal.hideSuggestWidget",s.ClearSuggestCache="workbench.action.terminal.clearSuggestCache"})(pw||(pw={}));const Oqt=[pw.SelectPrevSuggestion,pw.SelectPrevPageSuggestion,pw.SelectNextSuggestion,pw.SelectNextPageSuggestion,pw.AcceptSelectedSuggestion,pw.AcceptSelectedSuggestionEnter,pw.HideSuggestWidget,pw.ClearSuggestCache],Bqt="terminal";var Pze;(function(s){s[s.Uninitialized=1]="Uninitialized",s[s.Launching=2]="Launching",s[s.Running=3]="Running",s[s.KilledDuringLaunch=4]="KilledDuringLaunch",s[s.KilledByUser=5]="KilledByUser",s[s.KilledByProcess=6]="KilledByProcess"})(Pze||(Pze={}));var mn;(function(s){s.Toggle="workbench.action.terminal.toggleTerminal",s.Kill="workbench.action.terminal.kill",s.KillViewOrEditor="workbench.action.terminal.killViewOrEditor",s.KillEditor="workbench.action.terminal.killEditor",s.KillActiveTab="workbench.action.terminal.killActiveTab",s.KillAll="workbench.action.terminal.killAll",s.QuickKill="workbench.action.terminal.quickKill",s.ConfigureTerminalSettings="workbench.action.terminal.openSettings",s.ShellIntegrationLearnMore="workbench.action.terminal.learnMore",s.RunRecentCommand="workbench.action.terminal.runRecentCommand",s.CopyLastCommand="workbench.action.terminal.copyLastCommand",s.CopyLastCommandOutput="workbench.action.terminal.copyLastCommandOutput",s.CopyLastCommandAndLastCommandOutput="workbench.action.terminal.copyLastCommandAndLastCommandOutput",s.GoToRecentDirectory="workbench.action.terminal.goToRecentDirectory",s.CopyAndClearSelection="workbench.action.terminal.copyAndClearSelection",s.CopySelection="workbench.action.terminal.copySelection",s.CopySelectionAsHtml="workbench.action.terminal.copySelectionAsHtml",s.SelectAll="workbench.action.terminal.selectAll",s.DeleteWordLeft="workbench.action.terminal.deleteWordLeft",s.DeleteWordRight="workbench.action.terminal.deleteWordRight",s.DeleteToLineStart="workbench.action.terminal.deleteToLineStart",s.MoveToLineStart="workbench.action.terminal.moveToLineStart",s.MoveToLineEnd="workbench.action.terminal.moveToLineEnd",s.New="workbench.action.terminal.new",s.NewWithCwd="workbench.action.terminal.newWithCwd",s.NewLocal="workbench.action.terminal.newLocal",s.NewInActiveWorkspace="workbench.action.terminal.newInActiveWorkspace",s.NewWithProfile="workbench.action.terminal.newWithProfile",s.Split="workbench.action.terminal.split",s.SplitActiveTab="workbench.action.terminal.splitActiveTab",s.SplitInActiveWorkspace="workbench.action.terminal.splitInActiveWorkspace",s.Unsplit="workbench.action.terminal.unsplit",s.JoinActiveTab="workbench.action.terminal.joinActiveTab",s.Join="workbench.action.terminal.join",s.Relaunch="workbench.action.terminal.relaunch",s.FocusPreviousPane="workbench.action.terminal.focusPreviousPane",s.CreateTerminalEditor="workbench.action.createTerminalEditor",s.CreateTerminalEditorSameGroup="workbench.action.createTerminalEditorSameGroup",s.CreateTerminalEditorSide="workbench.action.createTerminalEditorSide",s.FocusTabs="workbench.action.terminal.focusTabs",s.FocusNextPane="workbench.action.terminal.focusNextPane",s.ResizePaneLeft="workbench.action.terminal.resizePaneLeft",s.ResizePaneRight="workbench.action.terminal.resizePaneRight",s.ResizePaneUp="workbench.action.terminal.resizePaneUp",s.SizeToContentWidth="workbench.action.terminal.sizeToContentWidth",s.SizeToContentWidthActiveTab="workbench.action.terminal.sizeToContentWidthActiveTab",s.ResizePaneDown="workbench.action.terminal.resizePaneDown",s.Focus="workbench.action.terminal.focus",s.FocusNext="workbench.action.terminal.focusNext",s.FocusPrevious="workbench.action.terminal.focusPrevious",s.Paste="workbench.action.terminal.paste",s.PasteSelection="workbench.action.terminal.pasteSelection",s.SelectDefaultProfile="workbench.action.terminal.selectDefaultShell",s.RunSelectedText="workbench.action.terminal.runSelectedText",s.RunActiveFile="workbench.action.terminal.runActiveFile",s.SwitchTerminal="workbench.action.terminal.switchTerminal",s.ScrollDownLine="workbench.action.terminal.scrollDown",s.ScrollDownPage="workbench.action.terminal.scrollDownPage",s.ScrollToBottom="workbench.action.terminal.scrollToBottom",s.ScrollUpLine="workbench.action.terminal.scrollUp",s.ScrollUpPage="workbench.action.terminal.scrollUpPage",s.ScrollToTop="workbench.action.terminal.scrollToTop",s.Clear="workbench.action.terminal.clear",s.ClearSelection="workbench.action.terminal.clearSelection",s.ChangeIcon="workbench.action.terminal.changeIcon",s.ChangeIconActiveTab="workbench.action.terminal.changeIconActiveTab",s.ChangeColor="workbench.action.terminal.changeColor",s.ChangeColorActiveTab="workbench.action.terminal.changeColorActiveTab",s.Rename="workbench.action.terminal.rename",s.RenameActiveTab="workbench.action.terminal.renameActiveTab",s.RenameWithArgs="workbench.action.terminal.renameWithArg",s.QuickOpenTerm="workbench.action.quickOpenTerm",s.ScrollToPreviousCommand="workbench.action.terminal.scrollToPreviousCommand",s.ScrollToNextCommand="workbench.action.terminal.scrollToNextCommand",s.SelectToPreviousCommand="workbench.action.terminal.selectToPreviousCommand",s.SelectToNextCommand="workbench.action.terminal.selectToNextCommand",s.SelectToPreviousLine="workbench.action.terminal.selectToPreviousLine",s.SelectToNextLine="workbench.action.terminal.selectToNextLine",s.SendSequence="workbench.action.terminal.sendSequence",s.AttachToSession="workbench.action.terminal.attachToSession",s.DetachSession="workbench.action.terminal.detachSession",s.MoveToEditor="workbench.action.terminal.moveToEditor",s.MoveToTerminalPanel="workbench.action.terminal.moveToTerminalPanel",s.MoveIntoNewWindow="workbench.action.terminal.moveIntoNewWindow",s.SetDimensions="workbench.action.terminal.setDimensions",s.ClearPreviousSessionHistory="workbench.action.terminal.clearPreviousSessionHistory",s.FocusHover="workbench.action.terminal.focusHover",s.ShowEnvironmentContributions="workbench.action.terminal.showEnvironmentContributions",s.StartVoice="workbench.action.terminal.startVoice",s.StopVoice="workbench.action.terminal.stopVoice"})(mn||(mn={}));[mn.ClearSelection,mn.Clear,mn.CopyAndClearSelection,mn.CopySelection,mn.CopySelectionAsHtml,mn.CopyLastCommand,mn.CopyLastCommandOutput,mn.CopyLastCommandAndLastCommandOutput,mn.DeleteToLineStart,mn.DeleteWordLeft,mn.DeleteWordRight,mn.GoToRecentDirectory,mn.FocusNextPane,mn.FocusNext,mn.FocusPreviousPane,mn.FocusPrevious,mn.Focus,mn.SizeToContentWidth,mn.Kill,mn.KillEditor,mn.MoveToEditor,mn.MoveToLineEnd,mn.MoveToLineStart,mn.MoveToTerminalPanel,mn.NewInActiveWorkspace,mn.New,mn.Paste,mn.PasteSelection,mn.ResizePaneDown,mn.ResizePaneLeft,mn.ResizePaneRight,mn.ResizePaneUp,mn.RunActiveFile,mn.RunSelectedText,mn.RunRecentCommand,mn.ScrollDownLine,mn.ScrollDownPage,mn.ScrollToBottom,mn.ScrollToNextCommand,mn.ScrollToPreviousCommand,mn.ScrollToTop,mn.ScrollUpLine,mn.ScrollUpPage,mn.SendSequence,mn.SelectAll,mn.SelectToNextCommand,mn.SelectToNextLine,mn.SelectToPreviousCommand,mn.SelectToPreviousLine,mn.SplitInActiveWorkspace,mn.Split,mn.Toggle,mn.FocusHover,Yd.OpenAccessibilityHelp,...Pqt,...Fqt,...Oqt];g(8944,"Contributes terminal functionality."),g(8945,"Defines additional terminal profiles that the user can create."),g(8946,"The ID of the terminal profile provider."),g(8947,"Title for this terminal profile."),g(8948,"A codicon, URI, or light and dark URIs to associate with this terminal type."),g(8949,"Icon path when a light theme is used"),g(8950,"Icon path when a dark theme is used");var gr;(function(s){s.IsOpen="terminalIsOpen",s.Count="terminalCount",s.GroupCount="terminalGroupCount",s.TabsNarrow="isTerminalTabsNarrow",s.HasFixedWidth="terminalHasFixedWidth",s.ProcessSupported="terminalProcessSupported",s.Focus="terminalFocus",s.FocusInAny="terminalFocusInAny",s.AccessibleBufferFocus="terminalAccessibleBufferFocus",s.AccessibleBufferOnLastLine="terminalAccessibleBufferOnLastLine",s.EditorFocus="terminalEditorFocus",s.TabsFocus="terminalTabsFocus",s.WebExtensionContributedProfile="terminalWebExtensionContributedProfile",s.TerminalHasBeenCreated="terminalHasBeenCreated",s.TerminalEditorActive="terminalEditorActive",s.TabsMouse="terminalTabsMouse",s.AltBufferActive="terminalAltBufferActive",s.SuggestWidgetVisible="terminalSuggestWidgetVisible",s.A11yTreeFocus="terminalA11yTreeFocus",s.ViewShowing="terminalViewShowing",s.TextSelected="terminalTextSelected",s.TextSelectedInFocused="terminalTextSelectedInFocused",s.FindVisible="terminalFindVisible",s.FindInputFocused="terminalFindInputFocused",s.FindFocused="terminalFindFocused",s.TabsSingularSelection="terminalTabsSingularSelection",s.SplitTerminal="terminalSplitTerminal",s.ShellType="terminalShellType",s.InTerminalRunCommandPicker="inTerminalRunCommandPicker",s.TerminalShellIntegrationEnabled="terminalShellIntegrationEnabled"})(gr||(gr={}));var yEe;(function(s){s.isOpen=new Y(gr.IsOpen,!1,!0),s.focus=new Y(gr.Focus,!1,g(8951,"Whether the terminal is focused.")),s.focusInAny=new Y(gr.FocusInAny,!1,g(8952,"Whether any terminal is focused, including detached terminals used in other UI.")),s.editorFocus=new Y(gr.EditorFocus,!1,g(8953,"Whether a terminal in the editor area is focused.")),s.count=new Y(gr.Count,0,g(8954,"The current number of terminals.")),s.groupCount=new Y(gr.GroupCount,0,!0),s.tabsNarrow=new Y(gr.TabsNarrow,!1,!0),s.terminalHasFixedWidth=new Y(gr.HasFixedWidth,!1,!0),s.tabsFocus=new Y(gr.TabsFocus,!1,g(8955,"Whether the terminal tabs widget is focused.")),s.webExtensionContributedProfile=new Y(gr.WebExtensionContributedProfile,!1,!0),s.terminalHasBeenCreated=new Y(gr.TerminalHasBeenCreated,!1,!0),s.terminalEditorActive=new Y(gr.TerminalEditorActive,!1,!0),s.tabsMouse=new Y(gr.TabsMouse,!1,!0),s.shellType=new Y(gr.ShellType,void 0,{type:"string",description:g(8956,"The shell type of the active terminal, this is set if the type can be detected.")}),s.altBufferActive=new Y(gr.AltBufferActive,!1,g(8957,"Whether the terminal's alt buffer is active.")),s.suggestWidgetVisible=new Y(gr.SuggestWidgetVisible,!1,g(8958,"Whether the terminal's suggest widget is visible.")),s.notFocus=s.focus.toNegated(),s.viewShowing=new Y(gr.ViewShowing,!1,g(8959,"Whether the terminal view is showing")),s.textSelected=new Y(gr.TextSelected,!1,g(8960,"Whether text is selected in the active terminal.")),s.textSelectedInFocused=new Y(gr.TextSelectedInFocused,!1,g(8961,"Whether text is selected in a focused terminal.")),s.notTextSelected=s.textSelected.toNegated(),s.findVisible=new Y(gr.FindVisible,!1,!0),s.notFindVisible=s.findVisible.toNegated(),s.findInputFocus=new Y(gr.FindInputFocused,!1,!0),s.findFocus=new Y(gr.FindFocused,!1,!0),s.notFindFocus=s.findInputFocus.toNegated(),s.processSupported=new Y(gr.ProcessSupported,!1,g(8962,"Whether terminal processes can be launched in the current workspace.")),s.tabsSingularSelection=new Y(gr.TabsSingularSelection,!1,g(8963,"Whether one terminal is selected in the terminal tabs list.")),s.splitTerminal=new Y(gr.SplitTerminal,!1,g(8964,"Whether the focused tab's terminal is a split terminal.")),s.inTerminalRunCommandPicker=new Y(gr.InTerminalRunCommandPicker,!1,g(8965,"Whether the terminal run command picker is currently open.")),s.terminalShellIntegrationEnabled=new Y(gr.TerminalShellIntegrationEnabled,!1,g(8966,"Whether shell integration is enabled in the active terminal")),s.shouldShowViewInlineActions=he.and(he.equals("view",Bqt),he.notEquals(`config.${Fw.TabsHideCondition}`,"never"),he.or(he.not(`config.${Fw.TabsEnabled}`),he.and(he.equals(`config.${Fw.TabsShowActions}`,"singleTerminal"),he.equals(gr.GroupCount,1)),he.and(he.equals(`config.${Fw.TabsShowActions}`,"singleTerminalOrNarrow"),he.or(he.equals(gr.GroupCount,1),he.has(gr.TabsNarrow))),he.and(he.equals(`config.${Fw.TabsShowActions}`,"singleGroup"),he.equals(gr.GroupCount,1)),he.equals(`config.${Fw.TabsShowActions}`,"always")))})(yEe||(yEe={}));var ij,KR;let CEe=(KR=class extends Nb{setGroup(e){this._group=e,e?.scopedContextKeyService&&this._terminalInstance?.setParentContextKeyService(e.scopedContextKeyService)}get group(){return this._group}get typeId(){return ij.ID}get editorId(){return Lze}get capabilities(){return Ei.Readonly|Ei.Singleton|Ei.CanDropIntoEditor|Ei.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||{},dW.Editor);return e.focusWhenReady(),this._copyLaunchConfig=void 0,this._instantiationService.createInstance(ij,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(Fw.ConfirmOnKill);return(e==="editor"||e==="always")&&this._terminalInstance?.hasChildProcesses||!1}async confirm(e){const{confirmed:t}=await this._dialogService.confirm({type:Xe.Warning,message:g(8929,"Do you want to terminate running processes?"),primaryButton:g(8930,"&&Terminate"),detail:e.length>1?e.map(i=>i.editor.getName()).join(` `)+` -`+g(8931,"Closing will terminate the running processes in the terminals."):g(8932,"Closing will terminate the running processes in this terminal.")});return t?Gh.DONT_SAVE:Gh.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,n,o,r,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=n,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=DEe.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(kT.User),bt([t,i])}));const n=[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,bt(n),this._configurationService.getValue(Ww.EnablePersistentSessions)&&o.reason===lD.RELOAD?e.detachProcessAndDispose(kT.Shutdown):e.dispose(kT.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!We.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=$qt(this._terminalInstance);t&&e.push(t);const i=Gqt(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:zze,pinned:!0,forceReload:!0}}}},sj=YR,YR.ID="workbench.editors.terminal",YR);kEe=sj=D([_(2,pn),_(3,zJe),_(4,we),_(5,Te),_(6,ig),_(7,Le),_(8,to)],kEe);let Qze=class{constructor(e,t,i,n,o){this._editorGroupsService=t,this._configurationService=i,this._logService=n,this._dispoables=new Z,this._tabGroupModel=[],this._groupLookup=new Map,this._tabInfoLookup=new Map,this._multiDiffEditorInputListeners=new mo,this._proxy=e.getProxy(Ye.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 n=t.editorId;return{id:this._generateTabId(t,e.id),label:t.getName(),editorId:n,input:this._editorInputToDto(t),isPinned:e.isSticky(i),isPreview:!e.isPinned(i),isActive:e.isActive(t),isDirty:t.isDirty()}}_editorInputToDto(e){if(e instanceof EEe)return{kind:ha.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof lb)return{kind:ha.TextInput,uri:e.resource};if(e instanceof op&&!(e instanceof qg)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof lb&&e.secondary instanceof lb&&ji(t,i)&&t&&i?{kind:ha.TextInput,uri:t}:{kind:ha.UnknownInput}}if(e instanceof JT)return{kind:ha.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof oB)return{kind:ha.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Ou)return{kind:ha.WebviewEditorInput,viewType:e.viewType};if(e instanceof kEe)return{kind:ha.TerminalEditorInput};if(e instanceof qg){if(e.modified instanceof lb&&e.original instanceof lb)return{kind:ha.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof JT&&e.original instanceof JT)return{kind:ha.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof _Ee)return{kind:ha.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof Yye)return{kind:ha.ChatEditorInput};if(e instanceof rB){const t=[];for(const i of e?.resources.get()??[])i.originalUri&&i.modifiedUri&&t.push({kind:ha.TextDiffInput,original:i.originalUri,modified:i.modifiedUri});return{kind:ha.MultiDiffEditorInput,diffEditors:t}}return{kind:ha.UnknownInput}}_generateTabId(e,t){let i;const n=Na.getCanonicalUri(e,{supportSideBySide:Hs.BOTH});return n instanceof N?i=n.toString():i=`${n?.primary?.toString()}-${n?.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 n=this._generateTabId(t,e),o=this._tabInfoLookup.get(n);o?(o.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:o.tab,kind:fh.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const n=this._editorGroupsService.getGroup(e),o=this._groupLookup.get(e)!==void 0;if(!n||!o){this._createTabsModel();return}const r=this._groupLookup.get(e)?.tabs;if(!r)return;const a=this._buildTabObject(n,t,i);r.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:n,editorInput:t,tab:a}),t instanceof rB&&this._multiDiffEditorInputListeners.set(t,M.fromObservableLight(t.resources)(()=>{const l=this._tabInfoLookup.get(c);l&&(l.tab=this._buildTabObject(n,t,i),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:l.tab,kind:fh.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:fh.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),n=this._groupLookup.get(e)?.tabs;if(!i||!n){this._createTabsModel();return}const o=n.splice(t,1);o.length!==0&&(this._tabInfoLookup.delete(o[0]?.id??""),o[0]?.input instanceof rB&&this._multiDiffEditorInputListeners.deleteAndDispose(o[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o[0],kind:fh.TAB_CLOSE}))}_onDidTabActiveChange(e,t){const i=this._groupLookup.get(e)?.tabs;if(!i)return;const n=i[t];n.isActive=!0,this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:n,kind:fh.TAB_UPDATE})}_onDidTabDirty(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n);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:fh.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n),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:fh.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n),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:fh.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,n){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:fh.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:rI(this._editorGroupsService,t),tabs:[]};t.editors.forEach((n,o)=>{const r=this._buildTabObject(t,n,o);e.push(r),this._tabInfoLookup.set(this._generateTabId(n,t.id),{group:t,tab:r,editorInput:n})}),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 Do.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case Do.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case Do.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case Do.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case Do.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case Do.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case Do.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case Do.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case Do.EDITOR_TRANSIENT:break;case Do.EDITOR_MOVE:if(Cqt(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,n){const o=RZ(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=HW.RIGHT;i===ev&&(h=UW(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:n})}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 n=[];for(const[o,r]of i)n.push(await o.closeEditors(r,{preserveFocus:t}));return n.every(o=>o)}async $closeGroup(e,t){const i=[];for(const n of e){const o=this._editorGroupsService.getGroup(n);o&&(i.push(await o.closeAllEditors()),o.count===0&&this._editorGroupsService.getGroup(o.id)&&this._editorGroupsService.removeGroup(o))}return i.every(n=>n)}};Qze=D([Gi(Be.MainThreadEditorTabs),_(1,Po),_(2,Te),_(3,Ge),_(4,ei)],Qze);let jze=class{dispose(){}$onUnexpectedError(e){e&&e.$isError&&(e=l8(e)),vt(e)}};jze=D([Gi(Be.MainThreadErrors)],jze);let Yze=class{constructor(e,t,i,n,o,r,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=n,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 Yqt(e.getProxy(Ye.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(Be).map(h=>Be[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,n,o){this._internalExtensionService._onDidActivateExtension(e,t,i,n,o)}$onExtensionRuntimeError(e,t){const i=l8(t);this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const n=l8(t);if(this._internalExtensionService._onDidActivateExtensionError(e,n),i){const r=await this._extensionService.getExtension(e.value);if(r){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>Ra(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(n);return}console.error(n.message)}async _handleMissingInstalledDependency(e,t){const i=e.displayName||e.name;if(this._extensionEnablementService.isEnabled(t))this._notificationService.notify({severity:Xe.Error,message:g(4830,"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 rn("reload",g(4831,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const n=this._extensionEnablementService.getEnablementState(t);n===Gr.DisabledByVirtualWorkspace?this._notificationService.notify({severity:Xe.Error,message:g(4832,"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)}):n===Gr.DisabledByTrustRequirement?this._notificationService.notify({severity:Xe.Error,message:g(4833,"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 rn("manageWorkspaceTrust",g(4834,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:Xe.Error,message:g(4835,"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 rn("enable",g(4836,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],n===Gr.DisabledGlobally?Gr.EnabledGlobally:Gr.EnabledWorkspace).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.notify({severity:Xe.Error,message:g(4837,"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 n=null;try{n=(await this._extensionsWorkbenchService.getExtensions([{id:t}],He.None))[0]}catch{}n?this._notificationService.notify({severity:Xe.Error,message:g(4838,"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,n.displayName,n.publisherDisplayName),actions:{primary:[new rn("install",g(4839,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(n).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.error(g(4840,"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",i,t))}async $setPerformanceMarks(e){this._extensionHostKind===lo.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===lo.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return ef.uriToBrowserUri(N.revive(e))}async $getAllStaticBrowserUris(){return Array.from(ef.getRegisteredBrowserUris(),e=>[e,ef.uriToBrowserUri(e)])}};Yze=D([Gi(Be.MainThreadExtensionService),_(1,fs),_(2,bi),_(3,Xo),_(4,xc),_(5,Nl),_(6,gXe),_(7,vi),_(8,Jr)],Yze);class Yqt{constructor(e){this._actual=e}async resolveAuthority(e,t){return Jqt(await this._actual.$resolveAuthority(e,t))}async getCanonicalURI(e,t){const i=await this._actual.$getCanonicalURI(e,t);return i&&N.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 Jqt(s){return s.type==="ok"?{type:"ok",value:{...s.value,authority:Xqt(s.value.authority)}}:s}function Xqt(s){return{...s,connectTo:Zqt(s.connectTo)}}function Zqt(s){return s.type===qW.WebSocket?new Dit(s.host,s.port):new xit(s.id)}var Wm;let Jze=Wm=class{constructor(e,t){this._fileService=t,this._fileProvider=new mo,this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostFileSystem);const i=e.getProxy(Ye.ExtHostFileSystemInfo);for(const n of t.listCapabilities())i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.capabilities);this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(n=>i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.provider?.capabilities??null))),this._disposables.add(t.onDidChangeFileSystemProviderCapabilities(n=>i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.provider.capabilities)))}dispose(){this._disposables.dispose(),this._fileProvider.dispose()}async $registerFileSystemProvider(e,t,i,n){this._fileProvider.set(e,new dPe(this._fileService,t,i,n,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(N.revive(e)).then(t=>({ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.readonly?lp.Readonly:void 0,type:Wm._asFileType(t)})).catch(Wm._handleError)}$readdir(e){return this._fileService.resolve(N.revive(e),{resolveMetadata:!1}).then(t=>{if(!t.isDirectory){const i=new Error(t.name);throw i.name=ot.FileNotADirectory,i}return t.children?t.children.map(i=>[i.name,Wm._asFileType(i)]):[]}).catch(Wm._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=sn.File:e.isDirectory&&(t+=sn.Directory),e.isSymbolicLink&&(t+=sn.SymbolicLink),t}$readFile(e){return this._fileService.readFile(N.revive(e)).then(t=>t.value).catch(Wm._handleError)}$writeFile(e,t){return this._fileService.writeFile(N.revive(e),t).then(()=>{}).catch(Wm._handleError)}$rename(e,t,i){return this._fileService.move(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Wm._handleError)}$copy(e,t,i){return this._fileService.copy(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Wm._handleError)}$mkdir(e){return this._fileService.createFolder(N.revive(e)).then(()=>{}).catch(Wm._handleError)}$delete(e,t){return this._fileService.del(N.revive(e),t).catch(Wm._handleError)}static _handleError(e){if(e instanceof Td)switch(e.fileOperationResult){case Qi.FILE_NOT_FOUND:e.name=ot.FileNotFound;break;case Qi.FILE_IS_DIRECTORY:e.name=ot.FileIsADirectory;break;case Qi.FILE_PERMISSION_DENIED:e.name=ot.NoPermissions;break;case Qi.FILE_MOVE_CONFLICT:e.name=ot.FileExists;break}else if(e instanceof Error){const t=Vk(e);t!==ot.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};Jze=Wm=D([Gi(Be.MainThreadFileSystem),_(1,Jt)],Jze);class dPe{constructor(e,t,i,n,o,r){this.readOnlyMessage=n,this._handle=o,this._proxy=r,this._onDidChange=new I,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=M.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(dPe._createFileChange))}static _createFileChange(e){return{resource:N.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,$e.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,n,o){return this._proxy.$read(this._handle,e,t,o).then(r=>(i.set(r.buffer,n),r.byteLength))}write(e,t,i,n,o){return this._proxy.$write(this._handle,e,t,$e.wrap(i).slice(n,n+o))}}const Koe=class Koe extends V{constructor(e,t,i,n){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=n,this.watcherDisposables=this._register(new wn),this.requests=void 0,this.restartCounter=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){this.canRestart(e,t)?this.restartCounter{this._proxy.$onFileEvent({created:v.rawAdded,changed:v.rawUpdated,deleted:v.rawDeleted})}));const p=this,m=new class{async participate(v,b,w,y,C){if(w?.isUndoing)return;const A=new ci(C),L=setTimeout(()=>A.cancel(),y),k=await o.withProgress({location:ud.Notification,title:this._progressLabel(b),cancellable:!0,delay:Math.min(y/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(b,v,y,A.token);return U_(z,A.token)},()=>{A.cancel()}).finally(()=>{A.dispose(),clearTimeout(L)});if(!k||k.edit.edits.length===0)return;const P=k.edit.edits.some(z=>z.metadata?.needsConfirmation);let R=a.getBoolean(oj.MementoKeyAdditionalEdits,Ie.PROFILE);if(l.extensionTestsLocationURI&&(R=!1),R===void 0){let z;if(k.extensionNames.length===1?b===Ai.CREATE?z=g(4841,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):b===Ai.COPY?z=g(4842,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):b===Ai.MOVE?z=g(4843,"Extension '{0}' wants to make refactoring changes with this file move",k.extensionNames[0]):z=g(4844,"Extension '{0}' wants to make refactoring changes with this file deletion",k.extensionNames[0]):b===Ai.CREATE?z=g(4845,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):b===Ai.COPY?z=g(4846,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):b===Ai.MOVE?z=g(4847,"{0} extensions want to make refactoring changes with this file move",k.extensionNames.length):z=g(4848,"{0} extensions want to make refactoring changes with this file deletion",k.extensionNames.length),P){const{confirmed:G}=await r.confirm({type:Xe.Info,message:z,primaryButton:g(4849,"Show &&Preview"),cancelButton:g(4850,"Skip Changes")});if(R=!0,!G)return}else{let G;(function(ne){ne[ne.OK=0]="OK",ne[ne.Preview=1]="Preview",ne[ne.Cancel=2]="Cancel"})(G||(G={}));const{result:Y,checkboxChecked:j}=await r.prompt({type:Xe.Info,message:z,buttons:[{label:g(4851,"&&OK"),run:()=>G.OK},{label:g(4849,"Show &&Preview"),run:()=>G.Preview}],cancelButton:{label:g(4850,"Skip Changes"),run:()=>G.Cancel},checkbox:{label:g(4852,"Do not ask me again")}});if(Y===G.Cancel)return;R=Y===G.Preview,j&&a.store(oj.MementoKeyAdditionalEdits,R,Ie.PROFILE,an.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await n.apply(By(k.edit,d),{undoRedoGroupId:w?.undoRedoGroupId,showPreview:R})}_progressLabel(v){switch(v){case Ai.CREATE:return g(4853,"Running 'File Create' participants...");case Ai.MOVE:return g(4854,"Running 'File Rename' participants...");case Ai.COPY:return g(4855,"Running 'File Copy' participants...");case Ai.DELETE:return g(4856,"Running 'File Delete' participants...");case Ai.WRITE:return g(4857,"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,n,o){const r=N.revive(i),a={...n};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=`${zy(h,"/")}/${I1}`;a.includes.push(eQt(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()}},oj=JR,JR.MementoKeyAdditionalEdits="file.particpants.additionalEdits",JR);IEe=oj=D([Gi(Be.MainThreadFileSystemEventService),_(1,Jt),_(2,zb),_(3,PN),_(4,cg),_(5,to),_(6,$i),_(7,Ge),_(8,Za),_(9,ks),_(10,yi),_(11,Ge),_(12,Te)],IEe);At(class extends li{constructor(){super({id:"files.participants.resetChoice",title:{value:g(4858,"Reset choice for 'File operation needs preview'"),original:"Reset choice for 'File operation needs preview'"},f1:!0})}run(e){e.get($i).remove(IEe.MementoKeyAdditionalEdits,Ie.PROFILE)}});const xg=Symbol("unset");class xte{constructor(){this.root=new Mue,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||hi.empty()}get entries(){return this.root.children?.entries()||hi.empty()}insert(e,t,i){this.opNode(e,n=>n._value=t,i)}mutate(e,t){this.opNode(e,i=>i._value=t(i._value===xg?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 n=t[i].node._value;if(n!==xg){for(this._size--,t[i].node._value=xg;i>0;i--){const{node:o,part:r}=t[i];if(o.children?.size||o._value!==xg)break;t[i-1].node.children.delete(r)}return n}}*deleteRecursive(e){const t=this.getPathToKey(e);if(!t)return;const i=t[t.length-1].node;for(let n=t.length-1;n>0;n--){const o=t[n-1];if(o.node.children.delete(t[n].part),o.node.children.size>0||o.node._value!==xg)break}for(const n of Zze(i))n._value!==xg&&(this._size--,yield n._value)}find(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return;t=n}return t._value===xg?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;if(n._value!==xg)return!0;t=n}return!1}hasKeyOrChildren(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;t=n}return!0}hasKey(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;t=n}return t._value!==xg}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const n of e){const o=t[i].node.children?.get(n);if(!o)return;t.push({part:n,node:o}),i++}return t}opNode(e,t,i){let n=this.root;for(const a of e){if(n.children)if(n.children.has(a))n=n.children.get(a);else{const c=new Mue;n.children.set(a,c),n=c}else{const c=new Mue;n.children=new Map([[a,c]]),n=c}i?.(n)}const o=n._value===xg?0:1;t(n);const r=n._value===xg?0:1;this._size+=r-o}*values(){for(const{_value:e}of Zze(this.root))e!==xg&&(yield e)}}function*Zze(s){const e=[s];for(;e.length>0;){const t=e.pop();if(yield t,t.children)for(const i of t.children.values())e.push(i)}}let Mue=class{constructor(){this._value=xg}get value(){return this._value===xg?void 0:this._value}set value(e){this._value=e===void 0?xg:e}};var t_;(function(s){s.Delimiter="\0"})(t_||(t_={}));var Ov;(function(s){s[s.IsSame=0]="IsSame",s[s.Disconnected=1]="Disconnected",s[s.IsChild=2]="IsChild",s[s.IsParent=3]="IsParent"})(Ov||(Ov={}));class vn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new vn([t]);const n=[e.id];for(let o=i;o&&o.id!==t;o=o.parent)n.push(o.id);return n.push(t),new vn(n.reverse())}static isRoot(e){return!e.includes(t_.Delimiter)}static root(e){const t=e.indexOf(t_.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new vn(e.split(t_.Delimiter))}static join(e,t){return new vn([...e.path,t])}static joinToString(e,t){return e.toString()+t_.Delimiter+t}static parentId(e){const t=e.lastIndexOf(t_.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(t_.Delimiter);return t===-1?e:e.slice(t+t_.Delimiter.length)}static isChild(e,t){return t[e.length]===t_.Delimiter&&t.startsWith(e)}static compare(e,t){return e===t?Ov.IsSame:vn.isChild(e,t)?Ov.IsChild:vn.isChild(t,e)?Ov.IsParent:Ov.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let i=0;for(;i1?new vn(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 vn(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new vn(this.path,e)}compare(e){if(typeof e=="string")return vn.compare(this.toString(),e);for(let t=0;tthis.viewEnd?Ov.IsChild:e.viewEnd"runId"in s;var LH;(function(s){s.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),s.deserialize=(e,t)=>({range:F.lift(t.range),uri:e.asCanonicalUri(N.revive(t.uri))})})(LH||(LH={}));var O_;(function(s){s[s.Error=0]="Error",s[s.Output=1]="Output"})(O_||(O_={}));var Dte;(function(s){s.serialize=e=>({label:e.label,uri:e.uri?.toJSON(),position:e.position?.toJSON()}),s.deserialize=(e,t)=>({label:t.label,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,position:t.position?oe.lift(t.position):void 0})})(Dte||(Dte={}));var kte;(function(s){s.serialize=e=>({message:e.message,type:O_.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&LH.serialize(e.location),stackTrace:e.stackTrace?.map(Dte.serialize)}),s.deserialize=(e,t)=>({message:t.message,type:O_.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&LH.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(i=>Dte.deserialize(e,i))})})(kte||(kte={}));const iQt=(s,e)=>`${e?"s":"e"}${s}`;var Ite;(function(s){s.serialize=e=>({message:e.message,type:O_.Output,offset:e.offset,length:e.length,location:e.location&&LH.serialize(e.location)}),s.deserialize=(e,t)=>({message:t.message,type:O_.Output,offset:t.offset,length:t.length,location:t.location&&LH.deserialize(e,t.location)})})(Ite||(Ite={}));var p$;(function(s){s.serialize=e=>e.type===O_.Error?kte.serialize(e):Ite.serialize(e),s.deserialize=(e,t)=>t.type===O_.Error?kte.deserialize(e,t):Ite.deserialize(e,t),s.isDiffable=e=>e.type===O_.Error&&e.actual!==void 0&&e.expected!==void 0})(p$||(p$={}));var lz;(function(s){s.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),s.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(p$.serialize)}),s.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>p$.deserialize(e,i))})})(lz||(lz={}));const Bnt="\0",rj=(s,e)=>s+Bnt+e,Wnt=s=>{const e=s.indexOf(Bnt);return{ctrlId:s.slice(0,e),tagId:s.slice(e+1)}};var m$;(function(s){s.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}),s.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,range:t.range?F.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(m$||(m$={}));var Ld;(function(s){s[s.NotExpandable=0]="NotExpandable",s[s.Expandable=1]="Expandable",s[s.BusyExpanding=2]="BusyExpanding",s[s.Expanded=3]="Expanded"})(Ld||(Ld={}));var yD;(function(s){s.serialize=e=>({expand:e.expand,item:m$.serialize(e.item)}),s.deserialize=(e,t)=>({controllerId:vn.root(t.item.extId),expand:t.expand,item:m$.deserialize(e,t.item)})})(yD||(yD={}));var _$;(function(s){s.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}},s.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?F.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}}})(_$||(_$={}));const TEe=(s,e)=>{e.expand!==void 0&&(s.expand=e.expand),e.item!==void 0&&(s.item=s.item?Object.assign(s.item,e.item):e.item)};var Tte;(function(s){s.serializeWithoutMessages=e=>({...yD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(lz.serializeWithoutMessages)}),s.serialize=e=>({...yD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(lz.serialize)}),s.deserialize=(e,t)=>({...yD.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>lz.deserialize(e,i)),retired:!0})})(Tte||(Tte={}));var LEe;(function(s){s.empty=()=>({covered:0,total:0}),s.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(LEe||(LEe={}));var REe;(function(s){s.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testIds:e.testIds,uri:e.uri.toJSON()}),s.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testIds:t.testIds,uri:e.asCanonicalUri(N.revive(t.uri))}),s.empty=(e,t)=>({id:e,uri:t,statement:LEe.empty()})})(REe||(REe={}));function hPe(s){return{...s,location:s.location?.toJSON()}}function uPe(s){return s.location=s.location?oe.isIPosition(s.location)?oe.lift(s.location):F.lift(s.location):void 0,s}var RH;(function(s){s[s.Declaration=0]="Declaration",s[s.Statement=1]="Statement",s[s.Branch=2]="Branch"})(RH||(RH={}));var MEe;(function(s){s.serialize=e=>e.type===RH.Declaration?Rte.serialize(e):Mte.serialize(e),s.deserialize=e=>e.type===RH.Declaration?Rte.deserialize(e):Mte.deserialize(e)})(MEe||(MEe={}));var Lte;(function(s){s.serialize=hPe,s.deserialize=uPe})(Lte||(Lte={}));var Rte;(function(s){s.serialize=hPe,s.deserialize=uPe})(Rte||(Rte={}));var Mte;(function(s){s.serialize=e=>({...hPe(e),branches:e.branches?.map(Lte.serialize)}),s.deserialize=e=>({...uPe(e),branches:e.branches?.map(Lte.deserialize)})})(Mte||(Mte={}));var fa;(function(s){s[s.Add=0]="Add",s[s.Update=1]="Update",s[s.DocumentSynced=2]="DocumentSynced",s[s.Remove=3]="Remove",s[s.IncrementPendingExtHosts=4]="IncrementPendingExtHosts",s[s.Retire=5]="Retire",s[s.AddTag=6]="AddTag",s[s.RemoveTag=7]="RemoveTag"})(fa||(fa={}));var MH;(function(s){s.deserialize=(e,t)=>t.op===fa.Add?{op:t.op,item:yD.deserialize(e,t.item)}:t.op===fa.Update?{op:t.op,item:_$.deserialize(t.item)}:t.op===fa.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(N.revive(t.uri)),docv:t.docv}:t,s.serialize=e=>e.op===fa.Add?{op:e.op,item:yD.serialize(e.item)}:e.op===fa.Update?{op:e.op,item:_$.serialize(e.item)}:e})(MH||(MH={}));class nQt{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 fa.Add:this.add(yD.deserialize(this.uriIdentity,i.item),t);break;case fa.Update:this.update(_$.deserialize(i.item),t);break;case fa.Remove:this.remove(i.itemId,t);break;case fa.Retire:this.retireTest(i.itemId);break;case fa.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case fa.AddTag:this._tags.set(i.tag.id,i.tag);break;case fa.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=vn.parentId(e.item.extId)?.toString();let n;if(!i)n=this.createItem(e),this.roots.add(n),this.items.set(e.item.extId,n);else if(this.items.has(i)){const o=this.items.get(i);o.children.add(e.item.extId),n=this.createItem(e,o),this.items.set(e.item.extId,n)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(n),e.expand===Ld.BusyExpanding&&this.busyControllerCount++,n}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Ld.BusyExpanding&&this.busyControllerCount--,e.expand===Ld.BusyExpanding&&this.busyControllerCount++),TEe(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const n=vn.parentId(i.item.extId)?.toString();n?this.items.get(n).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===Ld.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Hd;(function(s){s[s.Upsert=0]="Upsert",s[s.SetTags=1]="SetTags",s[s.UpdateCanResolveChildren=2]="UpdateCanResolveChildren",s[s.RemoveChild=3]="RemoveChild",s[s.SetProp=4]="SetProp",s[s.Bulk=5]="Bulk",s[s.DocumentSynced=6]="DocumentSynced"})(Hd||(Hd={}));const I4=(s,e)=>s===e,sQt={range:(s,e)=>s===e?!0:!s||!e?!1:s.equalsRange(e),busy:I4,label:I4,description:I4,error:I4,sortText:I4,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.includes(t)))},oQt=Object.entries(sQt),rQt=(s,e)=>{let t;for(const[i,n]of oQt)n(s[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class aQt extends V{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new cn(()=>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 fa.DocumentSynced:{for(const t of this.diff)if(t.op===fa.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case fa.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===fa.Update&&t.item.extId===e.item.extId){TEe(t.item,e.item);return}if(t.op===fa.Add&&t.item.item.extId===e.item.extId){TEe(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===Ld.Expandable){const n=this.resolveChildren(i);return n.isOpen()?this.expandChildren(i,t-1):n.wait().then(()=>this.expandChildren(i,t-1))}else if(i.expand===Ld.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 Hd.RemoveChild:this.removeItem(vn.joinToString(e.fullId,t.id));break;case Hd.Upsert:this.upsertItem(t.item,e);break;case Hd.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Hd.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Hd.UpdateCanResolveChildren:this.updateExpandability(e);break;case Hd.SetProp:this.pushDiff({op:fa.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Hd.DocumentSynced:this.documentSynced(e.actual.uri);break;default:Z7()}}documentSynced(e){e&&this.pushDiff({op:fa.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=vn.fromExtHostTestItem(e,this.root.id,t?.actual),n=this.options.getApiFor(e);n.parent&&n.parent!==t?.actual&&this.options.getChildren(n.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:Ld.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(o.fullId.toString(),o),this.setItemParent(e,t),this.pushDiff({op:fa.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=rQt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,o.actual=e,o.resolveBarrier=void 0,o.expand=Ld.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(o,{op:Hd.SetProp,update:c})),this.connectItemAndChildren(e,o,t);for(const[d,h]of r)this.options.getChildren(e).get(h.id)||this.removeItem(vn.joinToString(i,h.id));const l=o.expandLevels;l!==void 0&&queueMicrotask(()=>{o.expand===Ld.Expandable&&(o.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(o.actual.uri)}diffTagRefs(e,t,i){const n=new Set(t.map(o=>o.id));for(const o of e)n.delete(o.id)||this.incrementTagRefs(o);this.pushDiff({op:fa.Update,item:{extId:i,item:{tags:e.map(o=>rj(this.options.controllerId,o.id))}}}),n.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:fa.AddTag,tag:{id:rj(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:fa.RemoveTag,id:rj(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 n=this.options.getApiFor(e);n.parent=i?.actual,n.listener=o=>this.onTestItemEvent(t,o),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[n,o]of this.options.getChildren(e))this.upsertItem(o,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Ld.Expanded:Ld.BusyExpanding:t=e.actual.canResolveChildren?Ld.Expandable:Ld.NotExpandable:t=Ld.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:fa.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Ld.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[n,o]of this.options.getChildren(e.actual)){const r=this.expand(vn.joinToString(e.fullId,o.id),t);Qy(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 qd;return o.open(),o}e.expand=Ld.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new qd,i=o=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,o)};let n;try{n=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(o){i(o)}return Qy(n)?n.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:fa.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:fa.Remove,itemId:e});const i=[t];for(;i.length;){const n=i.pop();if(n){this.options.getApiFor(n.actual).listener=void 0;for(const o of n.actual.tags)this.decrementTagRefs(o.id);this.tree.delete(n.fullId.toString());for(const[o,r]of this.options.getChildren(n.actual))i.push(this.tree.get(vn.joinToString(n.fullId,r.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class cQt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class Nte extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class lQt 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 dQt=(s,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(n,o){for(const r of i.values())n.call(o,r,this)},[Symbol.iterator](){return i.entries()},replace(n){const o=new Map,r=new Set(i.keys()),a={op:Hd.Bulk,ops:[]};for(const c of n){if(!(c instanceof t))throw new Nte(c.id);const l=e(c).controllerId;if(l!==s.controllerId)throw new lQt(c.id,l,s.controllerId);if(o.has(c.id))throw new cQt(c.id);o.set(c.id,c),r.delete(c.id),a.ops.push({op:Hd.Upsert,item:c})}for(const c of r.keys())a.ops.push({op:Hd.RemoveChild,id:c});s.listener?.(a),i=o},add(n){if(!(n instanceof t))throw new Nte(n.id);i.set(n.id,n),s.listener?.({op:Hd.Upsert,item:n})},delete(n){i.delete(n)&&s.listener?.({op:Hd.RemoveChild,id:n})},get(n){return i.get(n)},toJSON(){return Array.from(i.values())}}},Hnt=new WeakMap,hQt=(s,e)=>{const t={controllerId:e};return Hnt.set(s,t),t},qce=s=>{const e=Hnt.get(s);if(!e)throw new Nte(s?.id||"");return e};var MC;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.Assistant=2]="Assistant"})(MC||(MC={}));const t8e={type:"object",properties:{vendor:{type:"string",description:g(3049,"A globally unique vendor of language models.")}}},uQt=eh.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(3050,"Contribute language models of a specific vendor."),oneOf:[t8e,{type:"array",items:t8e}]},activationEventsGenerator:(s,e)=>{for(const t of s)e.push(`onLanguageModelChat:${t.vendor}`)}});let i8e=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(uQt.setHandler(i=>{this._vendors.clear();for(const o of i){if(!dl(o.description,"chatProvider")){o.collector.error(g(3051,"This contribution point requires the 'chatProvider' proposal."));continue}for(const r of hi.wrap(o.value)){if(this._vendors.has(r.vendor)){o.collector.error(g(3052,"The vendor '{0}' is already registered and cannot be registered twice",r.vendor));continue}if(Gu(r.vendor)){o.collector.error(g(3053,"The vendor field cannot be empty."));continue}if(r.vendor.trim()!==r.vendor){o.collector.error(g(3054,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(r.vendor)}}const n=[];for(const[o,r]of this._providers)this._vendors.has(r.metadata.vendor)||(this._providers.delete(o),n.push(o));n.length>0&&this._onDidChangeProviders.fire({removed:n})}))}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(n=>this._extensionService.activateByEvent(`onLanguageModelChat:${n}`));await Promise.all(i)}const t=[];for(const[i,n]of this._providers)(e.vendor===void 0||n.metadata.vendor===e.vendor)&&(e.family===void 0||n.metadata.family===e.family)&&(e.version===void 0||n.metadata.version===e.version)&&(e.identifier===void 0||n.metadata.id===e.identifier)&&(!n.metadata.targetExtensions||n.metadata.targetExtensions.some(o=>Sn.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))})}async sendChatRequest(e,t,i,n,o){const r=this._providers.get(e);if(!r)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return r.sendChatRequest(i,t,n,o)}computeTokenLength(e,t,i){const n=this._providers.get(e);if(!n)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return n.provideTokenCount(t,i)}};i8e=D([_(0,fs),_(1,Ge)],i8e);var Wb;(function(s){function e(i){const{selectionStartLineNumber:n,selectionStartColumn:o,positionLineNumber:r,positionColumn:a}=i,c=new bs(n-1,o-1),l=new bs(r-1,a-1);return new cC(c,l)}s.to=e;function t(i){const{anchor:n,active:o}=i;return{selectionStartLineNumber:n.line+1,selectionStartColumn:n.character+1,positionLineNumber:o.line+1,positionColumn:o.character+1}}s.from=t})(Wb||(Wb={}));var et;(function(s){function e(i){if(!i)return;const{start:n,end:o}=i;return{startLineNumber:n.line+1,startColumn:n.character+1,endLineNumber:o.line+1,endColumn:o.character+1}}s.from=e;function t(i){if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:r,endColumn:a}=i;return new Jn(n-1,o-1,r-1,a-1)}s.to=t})(et||(et={}));var CD;(function(s){function e(i){return{uri:i.uri,range:et.from(i.range)}}s.from=e;function t(i){return new yp(N.revive(i.uri),et.to(i.range))}s.to=t})(CD||(CD={}));var NEe;(function(s){function e(t){switch(t){case nr.Comment:return LS.Comment;case nr.Other:return LS.Other;case nr.RegEx:return LS.RegEx;case nr.String:return LS.String}}s.to=e})(NEe||(NEe={}));var Yo;(function(s){function e(i){return new bs(i.lineNumber-1,i.column-1)}s.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}s.from=t})(Yo||(Yo={}));var NH;(function(s){function e(n,o,r){return Fi(H_(n).map(a=>t(a,o,r)))}s.from=e;function t(n,o,r){if(typeof n=="string")return{$serialized:!0,language:n,isBuiltin:r?.isBuiltin};if(n)return{$serialized:!0,language:n.language,scheme:i(n.scheme,o),pattern:Gf.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType,isBuiltin:r?.isBuiltin}}function i(n,o){return o&&typeof n=="string"?o.transformOutgoingScheme(n):n}})(NH||(NH={}));var Pte;(function(s){function e(i){switch(i){case Bx.Unnecessary:return u_.Unnecessary;case Bx.Deprecated:return u_.Deprecated}}s.from=e;function t(i){switch(i){case u_.Unnecessary:return Bx.Unnecessary;case u_.Deprecated:return Bx.Deprecated;default:return}}s.to=t})(Pte||(Pte={}));var PH;(function(s){function e(i){let n;return i.code&&(Lt(i.code)||lc(i.code)?n=String(i.code):n={value:String(i.code.value),target:i.code.target}),{...et.from(i.range),message:i.message,source:i.source,code:n,severity:Ote.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(Fte.from),tags:Array.isArray(i.tags)?Fi(i.tags.map(Pte.from)):void 0}}s.from=e;function t(i){const n=new I9(et.to(i),i.message,Ote.to(i.severity));return n.source=i.source,n.code=Lt(i.code)?i.code:i.code?.value,n.relatedInformation=i.relatedInformation&&i.relatedInformation.map(Fte.to),n.tags=i.tags&&Fi(i.tags.map(Pte.to)),n}s.to=t})(PH||(PH={}));var Fte;(function(s){function e(i){return{...et.from(i.location.range),message:i.message,resource:i.location.uri}}s.from=e;function t(i){return new XW(new yp(i.resource,et.to(i)),i.message)}s.to=t})(Fte||(Fte={}));var Ote;(function(s){function e(i){switch(i){case Bd.Error:return Ws.Error;case Bd.Warning:return Ws.Warning;case Bd.Information:return Ws.Info;case Bd.Hint:return Ws.Hint}return Ws.Error}s.from=e;function t(i){switch(i){case Ws.Info:return Bd.Information;case Ws.Warning:return Bd.Warning;case Ws.Error:return Bd.Error;case Ws.Hint:return Bd.Hint;default:return Bd.Error}}s.to=t})(Ote||(Ote={}));var xl;(function(s){function e(i){return typeof i=="number"&&i>=rH.One?i-1:i===rH.Beside?ev:hA}s.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}s.to=t})(xl||(xl={}));function gQt(s){return typeof s.range<"u"}function Unt(s){return s.length===0?!0:!!gQt(s[0])}var Ps;(function(s){function e(a){return a.map(s.from)}s.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 df.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=N.parse(u,!0);f=f.with({query:n(f.query,l)}),l[u]=f}catch{}return""},h=new zu.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(VQe(u).href):"",zu(c.value,{renderer:h}),c}s.from=i;function n(a,c){if(!a)return a;let l;try{l=j2(a)}catch{}if(!l)return a;let d=!1;return l=S2(l,h=>{if(N.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 df(a.value,a.supportThemeIcons);return c.isTrusted=a.isTrusted,c.supportHtml=a.supportHtml,c.baseUri=a.baseUri?N.from(a.baseUri):void 0,c}s.to=o;function r(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=r})(Ps||(Ps={}));function fQt(s){return Unt(s)?s.map(e=>({range:et.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Ps.fromMany(e.hoverMessage):e.hoverMessage?Ps.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):s.map(e=>({range:et.from(e)}))}function Qce(s){return typeof s>"u"?s:typeof s=="string"?N.file(s):s}var FH;(function(s){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?Qce(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}}s.from=e})(FH||(FH={}));var Bte;(function(s){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?Qce(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?FH.from(t.before):void 0,after:t.after?FH.from(t.after):void 0}}s.from=e})(Bte||(Bte={}));var PEe;(function(s){function e(t){if(typeof t>"u")return t;switch(t){case Hx.OpenOpen:return ni.AlwaysGrowsWhenTypingAtEdges;case Hx.ClosedClosed:return ni.NeverGrowsWhenTypingAtEdges;case Hx.OpenClosed:return ni.GrowsOnlyWhenTypingBefore;case Hx.ClosedOpen:return ni.GrowsOnlyWhenTypingAfter}}s.from=e})(PEe||(PEe={}));var FEe;(function(s){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?PEe.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?Bte.from(t.light):void 0,dark:t.dark?Bte.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?Qce(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?FH.from(t.before):void 0,after:t.after?FH.from(t.after):void 0}}s.from=e})(FEe||(FEe={}));var od;(function(s){function e(i){return{text:i.newText,eol:i.newEol&&WH.from(i.newEol),range:et.from(i.range)}}s.from=e;function t(i){const n=new VA(et.to(i.range),i.text);return n.newEol=typeof i.eol>"u"?void 0:WH.to(i.eol),n}s.to=t})(od||(od={}));var Yu;(function(s){function e(i,n){const o={edits:[]};if(i instanceof hI){const r=new Dk;for(const a of i._allEntries())a._type===vc.File&&N.isUri(a.to)&&a.from===void 0&&r.add(a.to);for(const a of i._allEntries())if(a._type===vc.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:mTe($e.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===vc.Text?o.edits.push({resource:a.uri,textEdit:od.from(a.edit),versionId:r.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===vc.Snippet?o.edits.push({resource:a.uri,textEdit:{range:et.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:r.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===vc.Cell?o.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:n?.getNotebookDocumentVersion(a.uri)}):a._type===vc.CellReplace&&o.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:n?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:dI.Replace,index:a.index,count:a.count,cells:a.cells.map(S$.from)}})}return o}s.from=e;function t(i){const n=new hI,o=new ui;for(const r of i.edits)if(r.textEdit){const a=r,c=N.revive(a.resource),l=et.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=Nce.replace(l,new uI(d)):u=VA.replace(l,d);const f=o.get(c);f?f.push(u):o.set(c,[u])}else n.renameFile(N.revive(r.oldResource),N.revive(r.newResource),r.options);for(const[r,a]of o)n.set(r,a);return n}s.to=t})(Yu||(Yu={}));var iv;(function(s){const e=Object.create(null);e[_r.File]=pt.File,e[_r.Module]=pt.Module,e[_r.Namespace]=pt.Namespace,e[_r.Package]=pt.Package,e[_r.Class]=pt.Class,e[_r.Method]=pt.Method,e[_r.Property]=pt.Property,e[_r.Field]=pt.Field,e[_r.Constructor]=pt.Constructor,e[_r.Enum]=pt.Enum,e[_r.Interface]=pt.Interface,e[_r.Function]=pt.Function,e[_r.Variable]=pt.Variable,e[_r.Constant]=pt.Constant,e[_r.String]=pt.String,e[_r.Number]=pt.Number,e[_r.Boolean]=pt.Boolean,e[_r.Array]=pt.Array,e[_r.Object]=pt.Object,e[_r.Key]=pt.Key,e[_r.Null]=pt.Null,e[_r.EnumMember]=pt.EnumMember,e[_r.Struct]=pt.Struct,e[_r.Event]=pt.Event,e[_r.Operator]=pt.Operator,e[_r.TypeParameter]=pt.TypeParameter;function t(n){return typeof e[n]=="number"?e[n]:pt.Property}s.from=t;function i(n){for(const o in e)if(e[o]===n)return Number(o);return _r.Property}s.to=i})(iv||(iv={}));var zA;(function(s){function e(i){switch(i){case eH.Deprecated:return y8.Deprecated}}s.from=e;function t(i){switch(i){case y8.Deprecated:return eH.Deprecated}}s.to=t})(zA||(zA={}));var v$;(function(s){function e(i){return{name:i.name,kind:iv.from(i.kind),tags:i.tags&&i.tags.map(zA.from),containerName:i.containerName,location:hf.from(i.location)}}s.from=e;function t(i){const n=new tH(i.name,iv.to(i.kind),i.containerName,hf.to(i.location));return n.tags=i.tags&&i.tags.map(zA.to),n}s.to=t})(v$||(v$={}));var OEe;(function(s){function e(i){const n={name:i.name||"!!MISSING: name!!",detail:i.detail,range:et.from(i.range),selectionRange:et.from(i.selectionRange),kind:iv.from(i.kind),tags:i.tags?.map(zA.from)??[]};return i.children&&(n.children=i.children.map(e)),n}s.from=e;function t(i){const n=new iH(i.name,i.detail,iv.to(i.kind),et.to(i.range),et.to(i.selectionRange));return eo(i.tags)&&(n.tags=i.tags.map(zA.to)),i.children&&(n.children=i.children.map(t)),n}s.to=t})(OEe||(OEe={}));var gN;(function(s){function e(i){const n=new Pce(iv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),et.to(i.range),et.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,o){if(n=n??i._sessionId,o=o??i._itemId,n===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:o,name:i.name,detail:i.detail,kind:iv.from(i.kind),uri:i.uri,range:et.from(i.range),selectionRange:et.from(i.selectionRange),tags:i.tags?.map(zA.from)}}s.from=t})(gN||(gN={}));var BEe;(function(s){function e(t){return new UNe(gN.to(t.from),t.fromRanges.map(i=>et.to(i)))}s.to=e})(BEe||(BEe={}));var WEe;(function(s){function e(t){return new VNe(gN.to(t.to),t.fromRanges.map(i=>et.to(i)))}s.to=e})(WEe||(WEe={}));var hf;(function(s){function e(i){return{range:i.range&&et.from(i.range),uri:i.uri}}s.from=e;function t(i){return new yp(N.revive(i.uri),et.to(i.range))}s.to=t})(hf||(hf={}));var b$;(function(s){function e(i){const n=i,o=i;return{originSelectionRange:n.originSelectionRange?et.from(n.originSelectionRange):void 0,uri:n.targetUri?n.targetUri:o.uri,range:et.from(n.targetRange?n.targetRange:o.range),targetSelectionRange:n.targetSelectionRange?et.from(n.targetSelectionRange):void 0}}s.from=e;function t(i){return{targetUri:N.revive(i.uri),targetRange:et.to(i.range),targetSelectionRange:i.targetSelectionRange?et.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?et.to(i.originSelectionRange):void 0}}s.to=t})(b$||(b$={}));var w$;(function(s){function e(i){return{range:et.from(i.range),contents:Ps.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}s.from=e;function t(i){const n=i.contents.map(Ps.to),o=et.to(i.range),r=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new L9(n,o,r,a)}s.to=t})(w$||(w$={}));var HEe;(function(s){function e(i){return{range:et.from(i.range),expression:i.expression}}s.from=e;function t(i){return new Y9(et.to(i.range),i.expression)}s.to=t})(HEe||(HEe={}));var Wte;(function(s){function e(i){if(i instanceof J9)return{type:"text",range:et.from(i.range),text:i.text};if(i instanceof X9)return{type:"variable",range:et.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof Z9)return{type:"expression",range:et.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}s.from=e;function t(i){switch(i.type){case"text":return{range:et.to(i.range),text:i.text};case"variable":return{range:et.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:et.to(i.range),expression:i.expression}}}s.to=t})(Wte||(Wte={}));var Hte;(function(s){function e(i){return{frameId:i.frameId,stoppedLocation:et.from(i.stoppedLocation)}}s.from=e;function t(i){return new jAe(i.frameId,et.to(i.stoppedLocation))}s.to=t})(Hte||(Hte={}));var OH;(function(s){function e(i){return{range:et.from(i.range),kind:i.kind}}s.from=e;function t(i){return new R9(et.to(i.range),i.kind)}s.to=t})(OH||(OH={}));var UEe;(function(s){function e(i){return{uri:i.uri,highlights:i.highlights.map(OH.from)}}s.from=e;function t(i){return new M9(N.revive(i.uri),i.highlights.map(OH.to))}s.to=t})(UEe||(UEe={}));var VEe;(function(s){function e(t){switch(t){case Ku.TriggerCharacter:return VT.TriggerCharacter;case Ku.TriggerForIncompleteCompletions:return VT.TriggerForIncompleteCompletions;case Ku.Invoke:default:return VT.Invoke}}s.to=e})(VEe||(VEe={}));var zEe;(function(s){function e(t){return{triggerKind:VEe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}s.to=e})(zEe||(zEe={}));var Ute;(function(s){function e(i){switch(i){case oH.Deprecated:return I2.Deprecated}}s.from=e;function t(i){switch(i){case I2.Deprecated:return oH.Deprecated}}s.to=t})(Ute||(Ute={}));var Vte;(function(s){const e=new Map([[Zi.Method,Me.Method],[Zi.Function,Me.Function],[Zi.Constructor,Me.Constructor],[Zi.Field,Me.Field],[Zi.Variable,Me.Variable],[Zi.Class,Me.Class],[Zi.Interface,Me.Interface],[Zi.Struct,Me.Struct],[Zi.Module,Me.Module],[Zi.Property,Me.Property],[Zi.Unit,Me.Unit],[Zi.Value,Me.Value],[Zi.Constant,Me.Constant],[Zi.Enum,Me.Enum],[Zi.EnumMember,Me.EnumMember],[Zi.Keyword,Me.Keyword],[Zi.Snippet,Me.Snippet],[Zi.Text,Me.Text],[Zi.Color,Me.Color],[Zi.File,Me.File],[Zi.Reference,Me.Reference],[Zi.Folder,Me.Folder],[Zi.Event,Me.Event],[Zi.Operator,Me.Operator],[Zi.TypeParameter,Me.TypeParameter],[Zi.Issue,Me.Issue],[Zi.User,Me.User]]);function t(o){return e.get(o)??Me.Property}s.from=t;const i=new Map([[Me.Method,Zi.Method],[Me.Function,Zi.Function],[Me.Constructor,Zi.Constructor],[Me.Field,Zi.Field],[Me.Variable,Zi.Variable],[Me.Class,Zi.Class],[Me.Interface,Zi.Interface],[Me.Struct,Zi.Struct],[Me.Module,Zi.Module],[Me.Property,Zi.Property],[Me.Unit,Zi.Unit],[Me.Value,Zi.Value],[Me.Constant,Zi.Constant],[Me.Enum,Zi.Enum],[Me.EnumMember,Zi.EnumMember],[Me.Keyword,Zi.Keyword],[Me.Snippet,Zi.Snippet],[Me.Text,Zi.Text],[Me.Color,Zi.Color],[Me.File,Zi.File],[Me.Reference,Zi.Reference],[Me.Folder,Zi.Folder],[Me.Event,Zi.Event],[Me.Operator,Zi.Operator],[Me.TypeParameter,Zi.TypeParameter],[Me.User,Zi.User],[Me.Issue,Zi.Issue]]);function n(o){return i.get(o)??Zi.Property}s.to=n})(Vte||(Vte={}));var $Ee;(function(s){function e(t,i){const n=new B9(t.label);return n.insertText=t.insertText,n.kind=Vte.to(t.kind),n.tags=t.tags?.map(Ute.to),n.detail=t.detail,n.documentation=dd(t.documentation)?Ps.to(t.documentation):t.documentation,n.sortText=t.sortText,n.filterText=t.filterText,n.preselect=t.preselect,n.commitCharacters=t.commitCharacters,F.isIRange(t.range)?n.range=et.to(t.range):typeof t.range=="object"&&(n.range={inserting:et.to(t.range.insert),replacing:et.to(t.range.replace)}),n.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&Yg.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&Yg.InsertAsSnippet?n.insertText=new uI(t.insertText):(n.insertText=t.insertText,n.textEdit=n.range instanceof Jn?new VA(n.range,n.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(n.additionalTextEdits=t.additionalTextEdits.map(o=>od.to(o))),n.command=i&&t.command?i.fromInternal(t.command):void 0,n}s.to=e})($Ee||($Ee={}));var zte;(function(s){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Ps.fromStrict(i.documentation)}}s.from=e;function t(i){return{label:i.label,documentation:dd(i.documentation)?Ps.to(i.documentation):i.documentation}}s.to=t})(zte||(zte={}));var $te;(function(s){function e(i){return{label:i.label,documentation:Ps.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(zte.from):[],activeParameter:i.activeParameter}}s.from=e;function t(i){return{label:i.label,documentation:dd(i.documentation)?Ps.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(zte.to):[],activeParameter:i.activeParameter}}s.to=t})($te||($te={}));var y$;(function(s){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map($te.from):[]}}s.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map($te.to):[]}}s.to=t})(y$||(y$={}));var GEe;(function(s){function e(t,i){const n=new O9(Yo.to(i.position),typeof i.label=="string"?i.label:i.label.map(KEe.to.bind(void 0,t)),i.kind&&Gte.to(i.kind));return n.textEdits=i.textEdits&&i.textEdits.map(od.to),n.tooltip=dd(i.tooltip)?Ps.to(i.tooltip):i.tooltip,n.paddingLeft=i.paddingLeft,n.paddingRight=i.paddingRight,n}s.to=e})(GEe||(GEe={}));var KEe;(function(s){function e(t,i){const n=new F9(i.label);return n.tooltip=dd(i.tooltip)?Ps.to(i.tooltip):i.tooltip,Fj.is(i.command)&&(n.command=t.fromInternal(i.command)),i.location&&(n.location=hf.to(i.location)),n}s.to=e})(KEe||(KEe={}));var Gte;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(Gte||(Gte={}));var XT;(function(s){function e(i){return{range:et.from(i.range),url:i.target,tooltip:i.tooltip}}s.from=e;function t(i){let n;if(i.url)try{n=typeof i.url=="string"?N.parse(i.url,!0):N.revive(i.url)}catch{}const o=new H9(et.to(i.range),n);return o.tooltip=i.tooltip,o}s.to=t})(XT||(XT={}));var Kte;(function(s){function e(i){const n=new V9(i.label);return i.textEdit&&(n.textEdit=od.to(i.textEdit)),i.additionalTextEdits&&(n.additionalTextEdits=i.additionalTextEdits.map(o=>od.to(o))),n}s.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?od.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(n=>od.from(n)):void 0}}s.from=t})(Kte||(Kte={}));var BH;(function(s){function e(i){return new sN(i[0],i[1],i[2],i[3])}s.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}s.from=t})(BH||(BH={}));var qEe;(function(s){function e(i){return{range:et.from(i.range)}}s.from=e;function t(i){return new sH(et.to(i.range))}s.to=t})(qEe||(qEe={}));var qte;(function(s){function e(t){switch(t){case Cn.AUTO:return zT.AfterDelay;case Cn.EXPLICIT:return zT.Manual;case Cn.FOCUS_CHANGE:case Cn.WINDOW_CHANGE:return zT.FocusOut}}s.to=e})(qte||(qte={}));var aB;(function(s){function e(i){switch(i){case o_.Off:return wr.Off;case o_.Relative:return wr.Relative;case o_.Interval:return wr.Interval;case o_.On:default:return wr.On}}s.from=e;function t(i){switch(i){case wr.Off:return o_.Off;case wr.Relative:return o_.Relative;case wr.Interval:return o_.Interval;case wr.On:default:return o_.On}}s.to=t})(aB||(aB={}));var WH;(function(s){function e(i){if(i===D_.CRLF)return Sh.CRLF;if(i===D_.LF)return Sh.LF}s.from=e;function t(i){if(i===Sh.CRLF)return D_.CRLF;if(i===Sh.LF)return D_.LF}s.to=t})(WH||(WH={}));var QEe;(function(s){function e(t){if(typeof t=="object")return t.viewId;switch(t){case _D.SourceControl:return ud.Scm;case _D.Window:return ud.Window;case _D.Notification:return ud.Notification}throw new Error("Unknown 'ProgressLocation'")}s.from=e})(QEe||(QEe={}));var Qte;(function(s){function e(i){const n={start:i.start+1,end:i.end+1};return i.kind&&(n.kind=jte.from(i.kind)),n}s.from=e;function t(i){const n={start:i.start-1,end:i.end-1};return i.kind&&(n.kind=jte.to(i.kind)),n}s.to=t})(Qte||(Qte={}));var jte;(function(s){function e(i){if(i)switch(i){case Uw.Comment:return l_.Comment;case Uw.Imports:return l_.Imports;case Uw.Region:return l_.Region}}s.from=e;function t(i){if(i)switch(i.value){case l_.Comment.value:return Uw.Comment;case l_.Imports.value:return Uw.Imports;case l_.Region.value:return Uw.Region}}s.to=t})(jte||(jte={}));var dz;(function(s){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"?et.from(t.selection):void 0,override:typeof t.override=="boolean"?rm.id:void 0}}s.from=e})(dz||(dz={}));var Gf;(function(s){function e(o){return o instanceof GT?o.toJSON():typeof o=="string"?o:t(o)||i(o)?new GT(o.baseUri??o.base,o.pattern).toJSON():o}s.from=e;function t(o){const r=o;return r?N.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 n(o){return typeof o=="string"?o:new GT(N.revive(o.baseUri),o.pattern)}s.to=n})(Gf||(Gf={}));var jEe;(function(s){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:Gf.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}s.from=e})(jEe||(jEe={}));var Yte;(function(s){function e(i){return!!i&&typeof i=="object"&&"documents"in i&&Array.isArray(i.documents)&&i.documents.every(n=>Array.isArray(n)&&n.every(o=>o&&typeof o=="object"&&"uri"in o&&N.isUri(o.uri)&&"version"in o&&typeof o.version=="number"&&"ranges"in o&&Array.isArray(o.ranges)&&o.ranges.every(r=>r instanceof Jn)))}s.is=e;function t(i){return{documents:i.documents.map(n=>n.map(o=>({uri:N.from(o.uri),version:o.version,ranges:o.ranges.map(r=>et.from(r))})))}}s.from=t})(Yte||(Yte={}));var Wy;(function(s){function e(i){return{start:i.start,end:i.end}}s.from=e;function t(i){return new Sy(i.start,i.end)}s.to=t})(Wy||(Wy={}));var HH;(function(s){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}}s.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}s.from=t})(HH||(HH={}));var YEe;(function(s){function e(t){if(t===nz.Unconfirmed)return cN.Pending;if(t===nz.Pending)return;if(t===nz.Executing)return cN.Executing;throw new Error(`Unknown state: ${t}`)}s.to=e})(YEe||(YEe={}));var C$;(function(s){function e(i){switch(i){case zx.Markup:return EF.Markup;case zx.Code:default:return EF.Code}}s.from=e;function t(i){switch(i){case EF.Markup:return zx.Markup;case EF.Code:default:return zx.Code}}s.to=t})(C$||(C$={}));var OE;(function(s){function e(i){const n={metadata:i.metadata??Object.create(null),cells:[]};for(const o of i.cells)rG.validate(o),n.cells.push(S$.from(o));return n}s.from=e;function t(i){const n=new KNe(i.cells.map(S$.to));return CA(i.metadata)||(n.metadata=i.metadata),n}s.to=t})(OE||(OE={}));var S$;(function(s){function e(i){return{cellKind:C$.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:HH.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(pI.from):[]}}s.from=e;function t(i){return new rG(C$.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(pI.to):void 0,i.metadata,i.internalMetadata?HH.to(i.internalMetadata):void 0)}s.to=t})(S$||(S$={}));var UH;(function(s){function e(i){return{mime:i.mime,valueBytes:$e.wrap(i.data)}}s.from=e;function t(i){return new qNe(i.valueBytes.buffer,i.mime)}s.to=t})(UH||(UH={}));var pI;(function(s){function e(i){return{outputId:i.id,items:i.items.map(UH.from),metadata:i.metadata}}s.from=e;function t(i){const n=i.items.map(UH.to);return new i$(n,i.outputId,i.metadata)}s.to=t})(pI||(pI={}));var Jte;(function(s){function e(n){return i(n)?{include:Gf.from(n.include)??void 0,exclude:Gf.from(n.exclude)??void 0}:Gf.from(n)??void 0}s.from=e;function t(n){return i(n)?{include:Gf.to(n.include),exclude:Gf.to(n.exclude)}:Gf.to(n)}s.to=t;function i(n){const o=n;return o?!ra(o.include)&&!ra(o.exclude):!1}})(Jte||(Jte={}));var JEe;(function(s){function e(t,i,n){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===n$.Left?Mee.Left:Mee.Right,command:i.toInternal(o,n),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}s.from=e})(JEe||(JEe={}));var XEe;(function(s){function e(t,i,n){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(o,n),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}s.from=e})(XEe||(XEe={}));var ZEe;(function(s){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}s.from=e})(ZEe||(ZEe={}));var Xte;(function(s){function e(i){return{uri:i.uri,provides:i.provides}}s.from=e;function t(i){return new QNe(N.revive(i.uri),i.provides)}s.to=t})(Xte||(Xte={}));var VH;(function(s){function e(i){return{message:Ps.fromStrict(i.message)||"",type:O_.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:et.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(n=>({label:n.label,position:n.position&&Yo.from(n.position),uri:n.file&&N.revive(n.file).toJSON()}))}}s.from=e;function t(i){const n=new lN(typeof i.message=="string"?i.message:Ps.to(i.message));return n.actualOutput=i.actual,n.expectedOutput=i.expected,n.contextValue=i.contextValue,n.location=i.location?hf.to(i.location):void 0,n}s.to=t})(VH||(VH={}));var Hb;(function(s){s.namespace=rj,s.denamespace=Wnt})(Hb||(Hb={}));var mI;(function(s){function e(i){const n=qce(i).controllerId;return{extId:vn.fromExtHostTestItem(i,n).toString(),label:i.label,uri:N.revive(i.uri),busy:i.busy,tags:i.tags.map(o=>Hb.namespace(n,o.id)),range:F.lift(et.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Ps.fromStrict(i.error)||null}}s.from=e;function t(i){return{parent:void 0,error:void 0,id:vn.fromString(i.extId).localId,label:i.label,uri:N.revive(i.uri),tags:(i.tags||[]).map(n=>{const{tagId:o}=Hb.denamespace(n);return new yH(o)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:et.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}s.toPlain=t})(mI||(mI={}));(function(s){function e(i){return{id:i.id}}s.from=e;function t(i){return new yH(i.id)}s.to=t})(Hb||(Hb={}));var exe;(function(s){const e=(i,n)=>{const o=i.value;if(!o)return;const r={...mI.toPlain(o.item),parent:n,taskStates:o.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===O_.Error).map(VH.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 n=new xte;for(const a of i.items)n.insert(vn.fromString(a.item.extId).path,a);const o=[n.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(Fc)}}s.to=t})(exe||(exe={}));var Zte;(function(s){function e(o){return{covered:o.covered,total:o.total}}function t(o){return"line"in o?Yo.from(o):et.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:RH.Statement,branches:o.branches.length?o.branches.map(r=>({count:r.executed,location:r.location&&t(r.location),label:r.label})):void 0}:{type:RH.Declaration,name:o.name,count:o.executed,location:t(o.location)}}s.fromDetails=i;function n(o,r,a){return ij(a.statementCoverage),ij(a.branchCoverage),ij(a.declarationCoverage),{id:r,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testIds:a instanceof dN&&a.fromTests.length?a.fromTests.map(c=>vn.fromExtHostTestItem(c,o).toString()):void 0}}s.fromFile=n})(Zte||(Zte={}));var txe;(function(s){function e(t){switch(t){case Ch.Invoke:return nH.Invoke;case Ch.Auto:return nH.Automatic}}s.to=e})(txe||(txe={}));var ZT;(function(s){function e(i){const n=new Oce(iv.to(i.kind),i.name,i.detail||"",N.revive(i.uri),et.to(i.range),et.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,o){if(n=n??i._sessionId,o=o??i._itemId,n===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:o,kind:iv.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:et.from(i.range),selectionRange:et.from(i.selectionRange),tags:i.tags?.map(zA.from)}}s.from=t})(ZT||(ZT={}));var eie;(function(s){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}s.from=e})(eie||(eie={}));var tie;(function(s){function e(o,r,a){const c=r.fileData;return c?new G9t(new K9t(c.name,N.revive(c.uri),c.id,hm(()=>a(c.id)))):o===Us.uriList&&r.uriListData?new jee(n(r.uriListData)):new jee(r.asString)}s.to=e;async function t(o,r){const a=await r.asString();if(o===Us.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}}s.from=t;function i(o){return Zk.split(o).map(r=>{if(r.startsWith("#"))return r;try{return N.parse(r)}catch{}return r})}function n(o){return Zk.create(o.map(r=>typeof r=="string"?r:N.revive(r)))}})(tie||(tie={}));var B_;(function(s){function e(i,n){const o=i.items.map(([r,a])=>[r,tie.to(r,a,n)]);return new lH(o)}s.toDataTransfer=e;async function t(i){const n={items:[]},o=[];for(const[r,a]of i)o.push((async()=>{n.items.push([r,await tie.from(r,a)])})());return await Promise.all(o),n}s.from=t})(B_||(B_={}));var A$;(function(s){function e(i,n){return{kind:"reply",agentId:i.participant??n?.agentId??"",subCommand:i.command??n?.command,message:i.prompt,title:i.label}}s.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}s.to=t})(A$||(A$={}));var iie;(function(s){function e(i){switch(i){case MC.System:return Kp.System;case MC.User:return Kp.User;case MC.Assistant:return Kp.Assistant}}s.to=e;function t(i){switch(i){case Kp.System:return MC.System;case Kp.User:return MC.User;case Kp.Assistant:return MC.Assistant}return MC.User}s.from=t})(iie||(iie={}));var IF;(function(s){function e(i){let n="",o;i.content.type==="text"?n=i.content.value:o=new h$(i.content.name,i.content.value,i.content.isError);const r=iie.to(i.role),a=new rPe(r,n,i.name);return o!==void 0&&(a.content2=o),a}s.to=e;function t(i){const n=iie.from(i.role),o=i.name;let r;return i.content2 instanceof h$?r={type:"function_result",name:i.content2.name,value:i.content2.content,isError:i.content2.isError}:r={type:"text",value:i.content},{role:n,name:o,content:r}}s.from=t})(IF||(IF={}));var E$;(function(s){function e(i){return{kind:"markdownContent",content:Ps.from(i.value)}}s.from=e;function t(i){return new aG(Ps.to(i.content))}s.to=t})(E$||(E$={}));var nie;(function(s){function e(i){return{kind:"markdownVuln",content:Ps.from(i.value),vulnerabilities:i.vulnerabilities}}s.from=e;function t(i){return new SH(Ps.to(i.content),i.vulnerabilities)}s.to=t})(nie||(nie={}));var sie;(function(s){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}s.from=e;function t(i){return new AH(i.agentId,i.command)}s.to=t})(sie||(sie={}));var oie;(function(s){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data,buttons:t.buttons}}s.from=e})(oie||(oie={}));var x$;(function(s){function e(i){const{value:n,baseUri:o}=i;function r(a,c){return a.map(l=>{const d=N.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&r(l.children,d)}})}return{kind:"treeData",treeData:{label:_i(o),uri:o,children:r(n,o)}}}s.from=e;function t(i){const n=Mo(i.treeData);function o(c){return c.map(l=>({name:l.label,children:l.children&&o(l.children)}))}const r=n.uri,a=n.children?o(n.children):[];return new cG(a,r)}s.to=t})(x$||(x$={}));var D$;(function(s){function e(i){const n=o=>N.isUri(o);return{kind:"inlineReference",name:i.title,inlineReference:n(i.value)?i.value:CD.from(i.value)}}s.from=e;function t(i){const n=Mo(i);return new lG(N.isUri(n.inlineReference)?n.inlineReference:CD.to(n.inlineReference),i.name)}s.to=t})(D$||(D$={}));var zH;(function(s){function e(i){return{kind:"progressMessage",content:Ps.from(i.value)}}s.from=e;function t(i){return new EH(i.content.value)}s.to=t})(zH||(zH={}));var k$;(function(s){function e(i){return{kind:"warning",content:Ps.from(i.value)}}s.from=e;function t(i){return new xH(i.content.value)}s.to=t})(k$||(k$={}));var ixe;(function(s){function e(t){return{kind:"progressTask",content:Ps.from(t.value)}}s.from=e})(ixe||(ixe={}));var nxe;(function(s){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Ps.from(t):void 0}}s.from=e})(nxe||(nxe={}));var I$;(function(s){function e(i,n,o){return{kind:"command",command:n.toInternal(i.value,o)??{command:i.value.command,title:i.value.title}}}s.from=e;function t(i,n){return new dG(n.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}s.to=t})(I$||(I$={}));var rie;(function(s){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(n=>od.from(n))}}s.from=e;function t(i){return new DH(N.revive(i.uri),i.edits.map(n=>od.to(n)))}s.to=t})(rie||(rie={}));var fA;(function(s){function e(i){const n=We.isThemeIcon(i.iconPath)?i.iconPath:N.isUri(i.iconPath)?{light:N.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&N.isUri(i.iconPath.light)&&N.isUri(i.iconPath.dark)?{light:N.revive(i.iconPath.light),dark:N.revive(i.iconPath.dark)}:void 0;return"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:N.isUri(i.value.value)||!i.value.value?i.value.value:CD.from(i.value.value)},iconPath:n,options:i.options}:{kind:"reference",reference:N.isUri(i.value)?i.value:CD.from(i.value),iconPath:n,options:i.options}}s.from=e;function t(i){const n=Mo(i),o=r=>N.isUri(r)?r:CD.to(r);return new kb("variableName"in n.reference?{variableName:n.reference.variableName,value:n.reference.value&&o(n.reference.value)}:o(n.reference))}s.to=t})(fA||(fA={}));var aie;(function(s){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}s.from=e})(aie||(aie={}));var cie;(function(s){function e(n,o,r){return n instanceof aG?E$.from(n):n instanceof lG?D$.from(n):n instanceof kb?fA.from(n):n instanceof EH?zH.from(n):n instanceof cG?x$.from(n):n instanceof dG?I$.from(n,o,r):n instanceof DH?rie.from(n):n instanceof SH?nie.from(n):n instanceof AH?sie.from(n):n instanceof xH?k$.from(n):n instanceof l$?oie.from(n):n instanceof d$?aie.from(n):{kind:"markdownContent",content:Ps.from("")}}s.from=e;function t(n,o){switch(n.kind){case"reference":return fA.to(n);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(n,o)}}s.to=t;function i(n,o){switch(n.kind){case"markdownContent":return E$.to(n);case"inlineReference":return D$.to(n);case"progressMessage":return;case"treeData":return x$.to(n);case"command":return I$.to(n,o)}}s.toContent=i})(cie||(cie={}));var sxe;(function(s){function e(t,i){const n=t.variables.variables.filter(r=>r.isTool).map(r=>r.id),o=t.variables.variables.filter(r=>!r.isTool);return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:o.map(lie.to),location:T$.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:i,requestedTools:n}}s.to=e})(sxe||(sxe={}));var T$;(function(s){function e(i){switch(i){case Ir.Notebook:return r_.Notebook;case Ir.Terminal:return r_.Terminal;case Ir.Panel:return r_.Panel;case Ir.Editor:return r_.Editor}}s.to=e;function t(i){switch(i){case r_.Notebook:return Ir.Notebook;case r_.Terminal:return Ir.Terminal;case r_.Panel:return Ir.Panel;case r_.Editor:return Ir.Editor}}s.from=t})(T$||(T$={}));var lie;(function(s){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:lfe(i)?N.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&lfe(i.uri)?CD.to(Mo(i)):i,modelDescription:t.modelDescription}}s.to=e})(lie||(lie={}));var oxe;(function(s){function e(t,i,n){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,n)}}s.from=e})(oxe||(oxe={}));var cB;(function(s){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}s.to=e})(cB||(cB={}));var rxe;(function(s){function e(t,i,n){if(i.action.kind==="vote")return;const o=cB.to(t);if(i.action.kind==="command"){const r=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:n.fromInternal(r)??{command:r.id,title:r.title}}},result:o}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:A$.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}}s.to=e})(rxe||(rxe={}));var die;(function(s){function e(t,i,n){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,n)}s.from=e})(die||(die={}));var axe;(function(s){function e(t){return{kind:cxe.to(t.kind)}}s.to=e})(axe||(axe={}));var cxe;(function(s){function e(t){switch(t){case Jx.Word:return Wx.Word;case Jx.Line:return Wx.Line;case Jx.Suggest:return Wx.Suggest;default:return Wx.Unknown}}s.to=e})(cxe||(cxe={}));var lxe;(function(s){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||KSe.None,contextValue:t.contextValue}}s.from=e})(lxe||(lxe={}));var dxe;(function(s){function e(t){return{name:t.name,description:t.description,parametersSchema:t.parametersSchema}}s.to=e})(dxe||(dxe={}));class gPe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Fi(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 n=i.find(o=>o.id===t);if(!n)throw new Error("No matching file found in data transfer");return $e.wrap(await n.data())}dispose(){this.dataTransferFiles.clear()}}var n8e;(function(s){s.CallsTo="incomingCalls",s.CallsFrom="outgoingCalls"})(n8e||(n8e={}));const Vnt=new oo;class hie{static async create(e,t,i){const[n]=Vnt.ordered(e);if(!n)return;const o=await n.prepareCallHierarchy(e,t,i);if(o)return new hie(o.roots.reduce((r,a)=>r+a._sessionId,""),n,o.roots,new K1e(o))}constructor(e,t,i,n){this.id=e,this.provider=t,this.roots=i,this.ref=n,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends hie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(eo(i))return i}catch(i){No(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(eo(i))return i}catch(i){No(i)}return[]}}const hz=new Map;_t.registerCommand("_executePrepareCallHierarchy",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i));let o=s.get(gi).getModel(t),r;if(!o){const c=await s.get(fn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await hie.create(o,i,He.None);return a?(hz.set(a.id,a),hz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),hz.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function znt(s){return!0}_t.registerCommand("_executeProvideIncomingCalls",async(s,...e)=>{const[t]=e;Tt(znt());const i=hz.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,He.None)});_t.registerCommand("_executeProvideOutgoingCalls",async(s,...e)=>{const[t]=e;Tt(znt());const i=hz.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,He.None)});var hxe;(function(s){const e=[];function t(n){let o=n;return o&&e.push(o),{dispose(){if(o){const r=e.indexOf(o);r>=0&&(e.splice(r,1),o=void 0)}}}}s.register=t;function i(){return e.slice(0)}s.all=i})(hxe||(hxe={}));var uxe;(function(s){s[s.Idle=0]="Idle",s[s.Searching=1]="Searching",s[s.SlowSearch=2]="SlowSearch"})(uxe||(uxe={}));new Q("searchState",uxe.Idle);var s8e;(function(s){s.Subtypes="subtypes",s.Supertypes="supertypes"})(s8e||(s8e={}));const $nt=new oo;class uie{static async create(e,t,i){const[n]=$nt.ordered(e);if(!n)return;const o=await n.prepareTypeHierarchy(e,t,i);if(o)return new uie(o.roots.reduce((r,a)=>r+a._sessionId,""),n,o.roots,new K1e(o))}constructor(e,t,i,n){this.id=e,this.provider=t,this.roots=i,this.ref=n,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends uie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(eo(i))return i}catch(i){No(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(eo(i))return i}catch(i){No(i)}return[]}}const uz=new Map;_t.registerCommand("_executePrepareTypeHierarchy",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i));let o=s.get(gi).getModel(t),r;if(!o){const c=await s.get(fn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await uie.create(o,i,He.None);return a?(uz.set(a.id,a),uz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),uz.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function Gnt(s){const e=s;return typeof s=="object"&&typeof e.name=="string"&&typeof e.kind=="number"&&N.isUri(e.uri)&&F.isIRange(e.range)&&F.isIRange(e.selectionRange)}_t.registerCommand("_executeProvideSupertypes",async(s,...e)=>{const[t]=e;Tt(Gnt(t));const i=uz.get(t._sessionId);if(i)return i.provideSupertypes(t,He.None)});_t.registerCommand("_executeProvideSubtypes",async(s,...e)=>{const[t]=e;Tt(Gnt(t));const i=uz.get(t._sessionId);if(i)return i.provideSubtypes(t,He.None)});var Eo;let o8e=Eo=class extends V{constructor(e,t,i,n,o){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=n,this._uriIdentService=o,this._registrations=this._register(new mo),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(Ye.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=>Eo._reviveLocationDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Eo._reviveLocationLinkDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach(Eo._reviveWorkspaceSymbolDto),e):(e.location=Eo._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>By(i.edit,t)),e}static _reviveLinkDTO(e){return e.url&&typeof e.url!="string"&&(e.url=N.revive(e.url)),e}static _reviveCallHierarchyItemDto(e){return e&&(e.uri=N.revive(e.uri)),e}static _reviveTypeHierarchyItemDto(e){return e&&(e.uri=N.revive(e.uri)),e}$registerDocumentSymbolProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentSymbolProvider.register(t,{displayName:i,provideDocumentSymbols:(n,o)=>this._proxy.$provideDocumentSymbols(e,n.uri,o)}))}$registerCodeLensSupport(e,t,i){const n={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),n.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.codeLensProvider.register(t,n))}$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,n,o)=>this._proxy.$provideDefinition(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,n,o)=>this._proxy.$provideDeclaration(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,n,o)=>this._proxy.$provideImplementation(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,n,o)=>this._proxy.$provideTypeDefinition(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,n,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,n,a,o)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,n,o)=>this._proxy.$provideEvaluatableExpression(e,i.uri,n,o)}))}$registerInlineValuesProvider(e,t,i){const n={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),n.onDidChangeInlineValues=o.event}this._registrations.set(e,this._languageFeaturesService.inlineValuesProvider.register(t,n))}$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,n,o)=>this._proxy.$provideDocumentHighlights(e,i.uri,n,o)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,n,o,r)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,n,o.map(a=>a.uri),r).then(a=>{if(uU(a))return;const c=new ui;return a?.forEach(l=>{const d=N.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,n,o)=>{const r=await this._proxy.$provideLinkedEditingRanges(e,i.uri,n,o);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Eo._reviveRegExp(r.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,n,o,r)=>this._proxy.$provideReferences(e,i.uri,n,o,r).then(Eo._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,n,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:Eo._reviveCodeActionDto(u.actions,this._uriIdentService),dispose:()=>{typeof u.cacheId=="number"&&this._proxy.$releaseCodeActions(e,u.cacheId)}}},providedCodeActionKinds:i.providedKinds,documentation:i.documentation,displayName:n,extensionId:o};r&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=By(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 n=new gxe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,n),this._registrations.set(e,jr(this._languageFeaturesService.documentPasteEditProvider.register(t,n),Ee(()=>this._pasteEditProviders.delete(e))))}$resolvePasteFileData(e,t,i){const n=this._pasteEditProviders.get(e);if(!n)throw new Error("Could not find provider");return n.resolveFileData(t,i)}$registerDocumentFormattingSupport(e,t,i,n){this._registrations.set(e,this._languageFeaturesService.documentFormattingEditProvider.register(t,{extensionId:i,displayName:n,provideDocumentFormattingEdits:(o,r,a)=>this._proxy.$provideDocumentFormattingEdits(e,o.uri,r,a)}))}$registerRangeFormattingSupport(e,t,i,n,o){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:n,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,n){this._registrations.set(e,this._languageFeaturesService.onTypeFormattingEditProvider.register(t,{extensionId:n,autoFormatTriggerCharacters:i,provideOnTypeFormattingEdits:(o,r,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,o.uri,r,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const n={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,Eo._reviveWorkspaceSymbolDto(a.symbols)}};t&&(n.resolveWorkspaceSymbol=async(o,r)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,o,r);return a&&Eo._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,hxe.register(n))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(n,o,r,a)=>this._proxy.$provideRenameEdits(e,n.uri,o,r,a).then(c=>By(c,this._uriIdentService)),resolveRenameLocation:i?(n,o,r)=>this._proxy.$resolveRenameLocation(e,n.uri,o,r):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,n,o,r)=>this._proxy.$provideNewSymbolNames(e,i.uri,n,o,r)}))}$registerDocumentSemanticTokensProvider(e,t,i,n){let o;if(typeof n=="number"){const r=new I;this._registrations.set(n,r),o=r.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new pQt(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 mQt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const n=t[Li.label],o=t[Li.commandId],r=t[Li.commandIdent],a=t[Li.commitCharacters];return{label:n,extensionId:i,kind:t[Li.kind]??Me.Property,tags:t[Li.kindModifier],detail:t[Li.detail],documentation:t[Li.documentation],sortText:t[Li.sortText],filterText:t[Li.filterText],preselect:t[Li.preselect],insertText:t[Li.insertText]??(typeof n=="string"?n:n.label),range:t[Li.range]??e,insertTextRules:t[Li.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Li.additionalTextEdits],command:o?{$ident:r,id:o,title:"",arguments:r?[r]:t[Li.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,n,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[Ay.completions].map(u=>Eo._inflateSuggestDto(h[Ay.defaultRanges],u,o)),incomplete:h[Ay.isIncomplete]||!1,duration:h[Ay.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};n&&(r.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=Eo._inflateSuggestDto(a.range,l,o);return gp(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,r))}$registerInlineCompletionsSupport(e,t,i,n,o){const r={provideInlineCompletions:async(a,c,l,d)=>this._proxy.$provideInlineCompletions(e,a.uri,c,l,d),provideInlineEdits:async(a,c,l,d)=>this._proxy.$provideInlineEdits(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:n,yieldsToGroupIds:o,toString(){return`InlineCompletionsProvider(${n})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,r))}$registerInlineEditProvider(e,t,i){const n={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,n))}$registerSignatureHelpProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.signatureHelpProvider.register(t,{signatureHelpTriggerCharacters:i.triggerCharacters,signatureHelpRetriggerCharacters:i.retriggerCharacters,provideSignatureHelp:async(n,o,r,a)=>{const c=await this._proxy.$provideSignatureHelp(e,n.uri,o,a,r);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,n,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:Mo(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 Ma;return d?{...a,tooltip:d.tooltip,label:Mo(d.label),textEdits:d.textEdits}:a}),typeof n=="number"){const a=new I;this._registrations.set(n,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 n={provideLinks:(o,r)=>this._proxy.$provideDocumentLinks(e,o.uri,r).then(a=>{if(a)return{links:a.links.map(Eo._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(n.resolveLink=(o,r)=>{const a=o;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,r).then(c=>c&&Eo._reviveLinkDTO(c)):o}),this._registrations.set(e,this._languageFeaturesService.linkProvider.register(t,n))}$registerDocumentColorProvider(e,t){const i=this._proxy;this._registrations.set(e,this._languageFeaturesService.colorProvider.register(t,{provideDocumentColors:(n,o)=>i.$provideDocumentColors(e,n.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:(n,o,r)=>i.$provideColorPresentations(e,n.uri,{color:[o.color.red,o.color.green,o.color.blue,o.color.alpha],range:o.range},r)}))}$registerFoldingRangeProvider(e,t,i,n){const o={id:i.value,provideFoldingRanges:(r,a,c)=>this._proxy.$provideFoldingRanges(e,r.uri,a,c)};if(typeof n=="number"){const r=new I;this._registrations.set(n,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,n,o)=>this._proxy.$provideSelectionRanges(e,i.uri,n,o)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,Vnt.register(t,{prepareCallHierarchy:async(i,n,o)=>{const r=await this._proxy.$prepareCallHierarchy(e,i.uri,n,o);if(!(!r||r.length===0))return{dispose:()=>{for(const a of r)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:r.map(Eo._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,n)=>{const o=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,n);return o&&(o.forEach(r=>{r.to=Eo._reviveCallHierarchyItemDto(r.to)}),o)},provideIncomingCalls:async(i,n)=>{const o=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,n);return o&&(o.forEach(r=>{r.from=Eo._reviveCallHierarchyItemDto(r.from)}),o)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:Eo._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:Eo._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Eo._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Eo._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:Eo._reviveRegExp(e.beforeText),afterText:e.afterText?Eo._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Eo._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map(Eo._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const n={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Eo._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Eo._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Eo._reviveOnEnterRules(i.onEnterRules):void 0,autoClosingPairs:void 0,surroundingPairs:void 0,__electricCharacterSupport:void 0};i.autoClosingPairs?n.autoClosingPairs=i.autoClosingPairs:i.__characterPairSupport&&(n.autoClosingPairs=i.__characterPairSupport.autoClosingPairs),i.__electricCharacterSupport&&i.__electricCharacterSupport.docComment&&(n.__electricCharacterSupport={docComment:{open:i.__electricCharacterSupport.docComment.open,close:i.__electricCharacterSupport.docComment.close}}),this._languageService.isRegisteredLanguageId(t)&&this._registrations.set(e,this._languageConfigurationService.register(t,n,100))}$registerTypeHierarchyProvider(e,t){this._registrations.set(e,$nt.register(t,{prepareTypeHierarchy:async(i,n,o)=>{const r=await this._proxy.$prepareTypeHierarchy(e,i.uri,n,o);if(r)return{dispose:()=>{for(const a of r)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:r.map(Eo._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,n)=>{const o=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,n);return o&&o.map(Eo._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,n)=>{const o=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,n);return o&&o.map(Eo._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const n=new fxe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,n),this._registrations.set(e,jr(this._languageFeaturesService.documentDropEditProvider.register(t,n),Ee(()=>this._documentOnDropEditProviders.delete(e))))}async $resolveDocumentOnDropFileData(e,t,i){const n=this._documentOnDropEditProviders.get(e);if(!n)throw new Error("Could not find provider");return n.resolveDocumentOnDropFileData(t,i)}$registerMappedEditsProvider(e,t,i){const n=new _Qt(i,e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,n))}};o8e=Eo=D([Gi(Be.MainThreadLanguageFeatures),_(1,xi),_(2,Vs),_(3,it),_(4,ks)],o8e);let gxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new gPe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(o=>new Yn(o)),i.supportsCopy&&(this.prepareDocumentPaste=async(o,r,a,c)=>{const l=await B_.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,o.uri,r,l,c);if(!d)return;const h=new lce;for(const[u,f]of d.items)h.replace(u,q6(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(o,r,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await B_.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 Yn(f.kind.value):new Yn(""),yieldTo:f.yieldTo?.map(p=>({kind:new Yn(p)})),additionalEdit:f.additionalEdit?By(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=By(a.additionalEdit,this._uriIdentService)),o})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};gxe=D([_(3,ks)],gxe);let fxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new gPe,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=By(a.additionalEdit,this._uriIdentService)),o})}async provideDocumentDropEdits(e,t,i,n){const o=this.dataTransfers.add(i);try{const r=await B_.from(i);if(n.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,o.id,e.uri,t,r,n);return a?{edits:a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new Yn(l)})),kind:c.kind?new Yn(c.kind):void 0,additionalEdit:By(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(o.id,l))})),dispose:()=>{this._proxy.$releaseDocumentOnDropEdits(this._handle,o.id)}}:void 0}finally{o.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};fxe=D([_(3,ks)],fxe);class pQt{constructor(e,t,i,n){this._proxy=e,this._handle=t,this._legend=i,this.onDidChange=n}releaseDocumentSemanticTokens(e){e&&this._proxy.$releaseDocumentSemanticTokens(this._handle,parseInt(e,10))}getLegend(){return this._legend}async provideDocumentSemanticTokens(e,t,i){const n=t?parseInt(t,10):0,o=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,n,i);if(!o||i.isCancellationRequested)return null;const r=iZ(o);return r.type==="full"?{resultId:String(r.id),data:r.data}:{resultId:String(r.id),edits:r.deltas}}}class mQt{constructor(e,t,i){this._proxy=e,this._handle=t,this._legend=i}getLegend(){return this._legend}async provideDocumentRangeSemanticTokens(e,t,i){const n=await this._proxy.$provideDocumentRangeSemanticTokens(this._handle,e.uri,t,i);if(!n||i.isCancellationRequested)return null;const o=iZ(n);if(o.type==="full")return{resultId:String(o.id),data:o.data};throw new Error("Unexpected")}}class _Qt{constructor(e,t,i,n){this.displayName=e,this._handle=t,this._proxy=i,this._uriService=n}async provideMappedEdits(e,t,i,n){const o=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,n);return o?By(o,this._uriService):null}}let r8e=class{constructor(e,t,i,n,o){this._languageService=t,this._modelService=i,this._resolverService=n,this._languageStatusService=o,this._disposables=new Z,this._status=new mo,this._proxy=e.getProxy(Ye.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=N.revive(e),n=await this._resolverService.createModelReference(i);try{n.object.textEditorModel.setLanguage(this._languageService.createById(t))}finally{n.dispose()}}async $tokensAtPosition(e,t){const i=N.revive(e),n=this._modelService.getModel(i);if(!n)return;n.tokenization.tokenizeIfCheap(t.lineNumber);const o=n.tokenization.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1);return{type:o.getStandardTokenType(r),range:new F(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()}};r8e=D([Gi(Be.MainThreadLanguages),_(1,xi),_(2,gi),_(3,fn),_(4,Yae)],r8e);let a8e=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(Ye.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(n=>{mQe(n)?i.$setLogLevel(n):i.$setLogLevel(n[1],n[0])}))}$log(e,t){const i=this.loggerService.getLogger(N.revive(e));if(!i)throw new Error("Create the logger before logging");for(const[n,o]of t)LY(i,n,o)}async $createLogger(e,t){this.loggerService.createLogger(N.revive(e),t)}async $registerLogger(e){this.loggerService.registerLogger({...e,resource:N.revive(e.resource)})}async $deregisterLogger(e){this.loggerService.deregisterLogger(N.revive(e))}async $setVisibility(e,t){this.loggerService.setVisibility(N.revive(e),t)}$flush(e){const t=this.loggerService.getLogger(N.revive(e));if(!t)throw new Error("Create the logger before flushing");t.flush()}dispose(){this.disposables.dispose()}};a8e=D([Gi(Be.MainThreadLogger),_(1,uf)],a8e);_t.registerCommand("_extensionTests.setLogLevel",function(s,e){const t=s.get(uf),i=s.get(Za);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const n=bQe(e);n!==void 0&&t.setLogLevel(n)}});_t.registerCommand("_extensionTests.getLogLevel",function(s){const e=s.get(Ge);return r3(e.getLevel())});let c8e=class{constructor(e,t,i,n,o){this._notificationService=t,this._commandService=i,this._dialogService=n,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,n){return i.modal?this._showModalMessage(e,t,i.detail,n,i.useCustom):this._showMessage(e,t,n,i)}_showMessage(e,t,i,n){return new Promise(o=>{const r=i.map(d=>rl({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(o(d.handle),Promise.resolve())}));let a;n.source&&(a={label:n.source.label,id:n.source.identifier.value}),a||(a=g(4859,"Extension"));const c=[];n.source&&c.push(rl({id:n.source.identifier.value,label:g(4860,"Manage Extension"),run:()=>this._commandService.executeCommand("_extensions.manage",n.source.identifier.value)}));const l=this._notificationService.notify({severity:e,message:t,actions:{primary:r,secondary:c},source:a});M.once(l.onDidClose)(()=>{o(void 0)})})}async _showModalMessage(e,t,i,n,o){const r=[];let a;for(const l of n){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:r.push(d)}a||(r.length>0?a={label:g(4861,"Cancel"),run:()=>{}}:a={label:g(4862,"&&OK"),run:()=>{}});const{result:c}=await this._dialogService.prompt({type:e,message:t,detail:i,buttons:r,cancelButton:a,custom:o});return c}};c8e=D([Gi(Be.MainThreadMessageService),_(1,bi),_(2,vi),_(3,to),_(4,fs)],c8e);const vQt=(s,e,t)=>{const i=new Uint8Array(16);for(let r=0;r<16;r++)i[r]=Math.round(Math.random()*256);const n=mTe($e.wrap(i));return[`GET ws://localhost${s}?${e}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${n}`].join(`\r +`+g(8931,"Closing will terminate the running processes in the terminals."):g(8932,"Closing will terminate the running processes in this terminal.")});return t?$h.DONT_SAVE:$h.CANCEL}async revert(){this._isReverted=!0}constructor(e,t,i,n,o,r,a,c,l){super(),this.resource=e,this._terminalInstance=t,this._themeService=i,this._terminalInstanceService=n,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=yEe.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(AT.User),bt([t,i])}));const n=[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,bt(n),this._configurationService.getValue(Fw.EnablePersistentSessions)&&o.reason===rD.RELOAD?e.detachProcessAndDispose(AT.Shutdown):e.dispose(AT.Shutdown)})}getName(){return this._terminalInstance?.title||this.resource.fragment}getIcon(){if(!(!this._terminalInstance||!We.isThemeIcon(this._terminalInstance.icon)))return this._terminalInstance.icon}getLabelExtraClasses(){if(!this._terminalInstance)return[];const e=["terminal-tab","predefined-file-icon"],t=Mqt(this._terminalInstance);t&&e.push(t);const i=Nqt(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:Lze,pinned:!0,forceReload:!0}}}},ij=KR,KR.ID="workbench.editors.terminal",KR);CEe=ij=D([_(2,pn),_(3,PJe),_(4,we),_(5,Te),_(6,Zu),_(7,Le),_(8,to)],CEe);let Fze=class{constructor(e,t,i,n,o){this._editorGroupsService=t,this._configurationService=i,this._logService=n,this._dispoables=new Z,this._tabGroupModel=[],this._groupLookup=new Map,this._tabInfoLookup=new Map,this._multiDiffEditorInputListeners=new mo,this._proxy=e.getProxy(Ye.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 n=t.editorId;return{id:this._generateTabId(t,e.id),label:t.getName(),editorId:n,input:this._editorInputToDto(t),isPinned:e.isSticky(i),isPreview:!e.isPinned(i),isActive:e.isActive(t),isDirty:t.isDirty()}}_editorInputToDto(e){if(e instanceof bEe)return{kind:ha.TextMergeInput,base:e.base,input1:e.input1.uri,input2:e.input2.uri,result:e.resource};if(e instanceof rb)return{kind:ha.TextInput,uri:e.resource};if(e instanceof ip&&!(e instanceof $g)){const t=e.primary.resource,i=e.secondary.resource;return e.primary instanceof rb&&e.secondary instanceof rb&&ji(t,i)&&t&&i?{kind:ha.TextInput,uri:t}:{kind:ha.UnknownInput}}if(e instanceof qT)return{kind:ha.NotebookInput,notebookType:e.viewType,uri:e.resource};if(e instanceof tB)return{kind:ha.CustomEditorInput,viewType:e.viewType,uri:e.resource};if(e instanceof Pu)return{kind:ha.WebviewEditorInput,viewType:e.viewType};if(e instanceof CEe)return{kind:ha.TerminalEditorInput};if(e instanceof $g){if(e.modified instanceof rb&&e.original instanceof rb)return{kind:ha.TextDiffInput,modified:e.modified.resource,original:e.original.resource};if(e.modified instanceof qT&&e.original instanceof qT)return{kind:ha.NotebookDiffInput,notebookType:e.original.viewType,modified:e.modified.resource,original:e.original.resource}}if(e instanceof hEe)return{kind:ha.InteractiveEditorInput,uri:e.resource,inputBoxUri:e.inputResource};if(e instanceof $ye)return{kind:ha.ChatEditorInput};if(e instanceof iB){const t=[];for(const i of e?.resources.get()??[])i.originalUri&&i.modifiedUri&&t.push({kind:ha.TextDiffInput,original:i.originalUri,modified:i.modifiedUri});return{kind:ha.MultiDiffEditorInput,diffEditors:t}}return{kind:ha.UnknownInput}}_generateTabId(e,t){let i;const n=Na.getCanonicalUri(e,{supportSideBySide:Hs.BOTH});return n instanceof N?i=n.toString():i=`${n?.primary?.toString()}-${n?.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 n=this._generateTabId(t,e),o=this._tabInfoLookup.get(n);o?(o.tab.label=t.getName(),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:o.tab,kind:uh.TAB_UPDATE})):(this._logService.error("Invalid model for label change, rebuilding"),this._createTabsModel())}_onDidTabOpen(e,t,i){const n=this._editorGroupsService.getGroup(e),o=this._groupLookup.get(e)!==void 0;if(!n||!o){this._createTabsModel();return}const r=this._groupLookup.get(e)?.tabs;if(!r)return;const a=this._buildTabObject(n,t,i);r.splice(i,0,a);const c=this._generateTabId(t,e);this._tabInfoLookup.set(c,{group:n,editorInput:t,tab:a}),t instanceof iB&&this._multiDiffEditorInputListeners.set(t,M.fromObservableLight(t.resources)(()=>{const l=this._tabInfoLookup.get(c);l&&(l.tab=this._buildTabObject(n,t,i),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:l.tab,kind:uh.TAB_UPDATE}))})),this._proxy.$acceptTabOperation({groupId:e,index:i,tabDto:a,kind:uh.TAB_OPEN})}_onDidTabClose(e,t){const i=this._editorGroupsService.getGroup(e),n=this._groupLookup.get(e)?.tabs;if(!i||!n){this._createTabsModel();return}const o=n.splice(t,1);o.length!==0&&(this._tabInfoLookup.delete(o[0]?.id??""),o[0]?.input instanceof iB&&this._multiDiffEditorInputListeners.deleteAndDispose(o[0]?.input),this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:o[0],kind:uh.TAB_CLOSE}))}_onDidTabActiveChange(e,t){const i=this._groupLookup.get(e)?.tabs;if(!i)return;const n=i[t];n.isActive=!0,this._proxy.$acceptTabOperation({groupId:e,index:t,tabDto:n,kind:uh.TAB_UPDATE})}_onDidTabDirty(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n);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:uh.TAB_UPDATE})}_onDidTabPinChange(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n),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:uh.TAB_UPDATE})}_onDidTabPreviewChange(e,t,i){const n=this._generateTabId(i,e),o=this._tabInfoLookup.get(n),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:uh.TAB_UPDATE,groupId:e,tabDto:a,index:t})}_onDidTabMove(e,t,i,n){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:uh.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:tI(this._editorGroupsService,t),tabs:[]};t.editors.forEach((n,o)=>{const r=this._buildTabObject(t,n,o);e.push(r),this._tabInfoLookup.set(this._generateTabId(n,t.id),{group:t,tab:r,editorInput:n})}),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 Do.GROUP_ACTIVE:if(i===this._editorGroupsService.activeGroup.id){this._onDidGroupActivate();break}else return;case Do.EDITOR_LABEL:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabLabelChange(i,t.editor,t.editorIndex);break}case Do.EDITOR_OPEN:if(t.editor!==void 0&&t.editorIndex!==void 0){this._onDidTabOpen(i,t.editor,t.editorIndex);break}case Do.EDITOR_CLOSE:if(t.editorIndex!==void 0){this._onDidTabClose(i,t.editorIndex);break}case Do.EDITOR_ACTIVE:if(t.editorIndex!==void 0){this._onDidTabActiveChange(i,t.editorIndex);break}case Do.EDITOR_DIRTY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabDirty(i,t.editorIndex,t.editor);break}case Do.EDITOR_STICKY:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPinChange(i,t.editorIndex,t.editor);break}case Do.EDITOR_PIN:if(t.editorIndex!==void 0&&t.editor!==void 0){this._onDidTabPreviewChange(i,t.editorIndex,t.editor);break}case Do.EDITOR_TRANSIENT:break;case Do.EDITOR_MOVE:if(hqt(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,n){const o=TZ(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=FW.RIGHT;i===J_&&(h=OW(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:n})}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 n=[];for(const[o,r]of i)n.push(await o.closeEditors(r,{preserveFocus:t}));return n.every(o=>o)}async $closeGroup(e,t){const i=[];for(const n of e){const o=this._editorGroupsService.getGroup(n);o&&(i.push(await o.closeAllEditors()),o.count===0&&this._editorGroupsService.getGroup(o.id)&&this._editorGroupsService.removeGroup(o))}return i.every(n=>n)}};Fze=D([Gi(Be.MainThreadEditorTabs),_(1,Po),_(2,Te),_(3,Ge),_(4,ei)],Fze);let Oze=class{dispose(){}$onUnexpectedError(e){e&&e.$isError&&(e=r8(e)),vt(e)}};Oze=D([Gi(Be.MainThreadErrors)],Oze);let Bze=class{constructor(e,t,i,n,o,r,a,c,l){this._extensionService=t,this._notificationService=i,this._extensionsWorkbenchService=n,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 Wqt(e.getProxy(Ye.ExtHostExtensionService))),d._setAllMainProxyIdentifiers(Object.keys(Be).map(h=>Be[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,n,o){this._internalExtensionService._onDidActivateExtension(e,t,i,n,o)}$onExtensionRuntimeError(e,t){const i=r8(t);this._internalExtensionService._onExtensionRuntimeError(e,i),console.error(`[${e.value}]${i.message}`),console.error(i.stack)}async $onExtensionActivationError(e,t,i){const n=r8(t);if(this._internalExtensionService._onDidActivateExtensionError(e,n),i){const r=await this._extensionService.getExtension(e.value);if(r){const c=(await this._extensionsWorkbenchService.queryLocal()).find(l=>Ra(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(n);return}console.error(n.message)}async _handleMissingInstalledDependency(e,t){const i=e.displayName||e.name;if(this._extensionEnablementService.isEnabled(t))this._notificationService.notify({severity:Xe.Error,message:g(4830,"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 rn("reload",g(4831,"Reload Window"),"",!0,()=>this._hostService.reload())]}});else{const n=this._extensionEnablementService.getEnablementState(t);n===Gr.DisabledByVirtualWorkspace?this._notificationService.notify({severity:Xe.Error,message:g(4832,"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)}):n===Gr.DisabledByTrustRequirement?this._notificationService.notify({severity:Xe.Error,message:g(4833,"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 rn("manageWorkspaceTrust",g(4834,"Manage Workspace Trust"),"",!0,()=>this._commandService.executeCommand("workbench.trust.manage"))]}}):this._extensionEnablementService.canChangeEnablement(t)?this._notificationService.notify({severity:Xe.Error,message:g(4835,"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 rn("enable",g(4836,"Enable and Reload"),"",!0,()=>this._extensionEnablementService.setEnablement([t],n===Gr.DisabledGlobally?Gr.EnabledGlobally:Gr.EnabledWorkspace).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.notify({severity:Xe.Error,message:g(4837,"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 n=null;try{n=(await this._extensionsWorkbenchService.getExtensions([{id:t}],He.None))[0]}catch{}n?this._notificationService.notify({severity:Xe.Error,message:g(4838,"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,n.displayName,n.publisherDisplayName),actions:{primary:[new rn("install",g(4839,"Install and Reload"),"",!0,()=>this._extensionsWorkbenchService.install(n).then(()=>this._hostService.reload(),o=>this._notificationService.error(o)))]}}):this._notificationService.error(g(4840,"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",i,t))}async $setPerformanceMarks(e){this._extensionHostKind===lo.LocalProcess?this._timerService.setPerformanceMarks("localExtHost",e):this._extensionHostKind===lo.LocalWebWorker?this._timerService.setPerformanceMarks("workerExtHost",e):this._timerService.setPerformanceMarks("remoteExtHost",e)}async $asBrowserUri(e){return Jg.uriToBrowserUri(N.revive(e))}async $getAllStaticBrowserUris(){return Array.from(Jg.getRegisteredBrowserUris(),e=>[e,Jg.uriToBrowserUri(e)])}};Bze=D([Gi(Be.MainThreadExtensionService),_(1,fs),_(2,bi),_(3,Xo),_(4,xc),_(5,Ml),_(6,oXe),_(7,vi),_(8,Jr)],Bze);class Wqt{constructor(e){this._actual=e}async resolveAuthority(e,t){return Hqt(await this._actual.$resolveAuthority(e,t))}async getCanonicalURI(e,t){const i=await this._actual.$getCanonicalURI(e,t);return i&&N.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 Hqt(s){return s.type==="ok"?{type:"ok",value:{...s.value,authority:Uqt(s.value.authority)}}:s}function Uqt(s){return{...s,connectTo:Vqt(s.connectTo)}}function Vqt(s){return s.type===zW.WebSocket?new bit(s.host,s.port):new vit(s.id)}var Fm;let Wze=Fm=class{constructor(e,t){this._fileService=t,this._fileProvider=new mo,this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostFileSystem);const i=e.getProxy(Ye.ExtHostFileSystemInfo);for(const n of t.listCapabilities())i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.capabilities);this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(n=>i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.provider?.capabilities??null))),this._disposables.add(t.onDidChangeFileSystemProviderCapabilities(n=>i.$acceptProviderInfos(N.from({scheme:n.scheme,path:"/dummy"}),n.provider.capabilities)))}dispose(){this._disposables.dispose(),this._fileProvider.dispose()}async $registerFileSystemProvider(e,t,i,n){this._fileProvider.set(e,new XNe(this._fileService,t,i,n,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(N.revive(e)).then(t=>({ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.readonly?rp.Readonly:void 0,type:Fm._asFileType(t)})).catch(Fm._handleError)}$readdir(e){return this._fileService.resolve(N.revive(e),{resolveMetadata:!1}).then(t=>{if(!t.isDirectory){const i=new Error(t.name);throw i.name=ot.FileNotADirectory,i}return t.children?t.children.map(i=>[i.name,Fm._asFileType(i)]):[]}).catch(Fm._handleError)}static _asFileType(e){let t=0;return e.isFile?t+=sn.File:e.isDirectory&&(t+=sn.Directory),e.isSymbolicLink&&(t+=sn.SymbolicLink),t}$readFile(e){return this._fileService.readFile(N.revive(e)).then(t=>t.value).catch(Fm._handleError)}$writeFile(e,t){return this._fileService.writeFile(N.revive(e),t).then(()=>{}).catch(Fm._handleError)}$rename(e,t,i){return this._fileService.move(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Fm._handleError)}$copy(e,t,i){return this._fileService.copy(N.revive(e),N.revive(t),i.overwrite).then(()=>{}).catch(Fm._handleError)}$mkdir(e){return this._fileService.createFolder(N.revive(e)).then(()=>{}).catch(Fm._handleError)}$delete(e,t){return this._fileService.del(N.revive(e),t).catch(Fm._handleError)}static _handleError(e){if(e instanceof kd)switch(e.fileOperationResult){case Qi.FILE_NOT_FOUND:e.name=ot.FileNotFound;break;case Qi.FILE_IS_DIRECTORY:e.name=ot.FileIsADirectory;break;case Qi.FILE_PERMISSION_DENIED:e.name=ot.NoPermissions;break;case Qi.FILE_MOVE_CONFLICT:e.name=ot.FileExists;break}else if(e instanceof Error){const t=Ok(e);t!==ot.Unknown&&(e.name=t)}throw e}$ensureActivation(e){return this._fileService.activateProvider(e)}};Wze=Fm=D([Gi(Be.MainThreadFileSystem),_(1,Jt)],Wze);class XNe{constructor(e,t,i,n,o,r){this.readOnlyMessage=n,this._handle=o,this._proxy=r,this._onDidChange=new I,this.onDidChangeFile=this._onDidChange.event,this.onDidChangeCapabilities=M.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(XNe._createFileChange))}static _createFileChange(e){return{resource:N.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,$e.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,n,o){return this._proxy.$read(this._handle,e,t,o).then(r=>(i.set(r.buffer,n),r.byteLength))}write(e,t,i,n,o){return this._proxy.$write(this._handle,e,t,$e.wrap(i).slice(n,n+o))}}const Voe=class Voe extends V{constructor(e,t,i,n){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=n,this.watcherDisposables=this._register(new wn),this.requests=void 0,this.restartCounter=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){this.canRestart(e,t)?this.restartCounter{this._proxy.$onFileEvent({created:v.rawAdded,changed:v.rawUpdated,deleted:v.rawDeleted})}));const p=this,m=new class{async participate(v,b,w,y,C){if(w?.isUndoing)return;const A=new ci(C),L=setTimeout(()=>A.cancel(),y),k=await o.withProgress({location:dd.Notification,title:this._progressLabel(b),cancellable:!0,delay:Math.min(y/2,3e3)},()=>{const z=p._proxy.$onWillRunFileOperation(b,v,y,A.token);return B_(z,A.token)},()=>{A.cancel()}).finally(()=>{A.dispose(),clearTimeout(L)});if(!k||k.edit.edits.length===0)return;const P=k.edit.edits.some(z=>z.metadata?.needsConfirmation);let R=a.getBoolean(nj.MementoKeyAdditionalEdits,Ie.PROFILE);if(l.extensionTestsLocationURI&&(R=!1),R===void 0){let z;if(k.extensionNames.length===1?b===Ai.CREATE?z=g(4841,"Extension '{0}' wants to make refactoring changes with this file creation",k.extensionNames[0]):b===Ai.COPY?z=g(4842,"Extension '{0}' wants to make refactoring changes with this file copy",k.extensionNames[0]):b===Ai.MOVE?z=g(4843,"Extension '{0}' wants to make refactoring changes with this file move",k.extensionNames[0]):z=g(4844,"Extension '{0}' wants to make refactoring changes with this file deletion",k.extensionNames[0]):b===Ai.CREATE?z=g(4845,"{0} extensions want to make refactoring changes with this file creation",k.extensionNames.length):b===Ai.COPY?z=g(4846,"{0} extensions want to make refactoring changes with this file copy",k.extensionNames.length):b===Ai.MOVE?z=g(4847,"{0} extensions want to make refactoring changes with this file move",k.extensionNames.length):z=g(4848,"{0} extensions want to make refactoring changes with this file deletion",k.extensionNames.length),P){const{confirmed:G}=await r.confirm({type:Xe.Info,message:z,primaryButton:g(4849,"Show &&Preview"),cancelButton:g(4850,"Skip Changes")});if(R=!0,!G)return}else{let G;(function(ie){ie[ie.OK=0]="OK",ie[ie.Preview=1]="Preview",ie[ie.Cancel=2]="Cancel"})(G||(G={}));const{result:j,checkboxChecked:K}=await r.prompt({type:Xe.Info,message:z,buttons:[{label:g(4851,"&&OK"),run:()=>G.OK},{label:g(4849,"Show &&Preview"),run:()=>G.Preview}],cancelButton:{label:g(4850,"Skip Changes"),run:()=>G.Cancel},checkbox:{label:g(4852,"Do not ask me again")}});if(j===G.Cancel)return;R=j===G.Preview,K&&a.store(nj.MementoKeyAdditionalEdits,R,Ie.PROFILE,an.USER)}}c.info("[onWill-handler] applying additional workspace edit from extensions",k.extensionNames),await n.apply(Py(k.edit,d),{undoRedoGroupId:w?.undoRedoGroupId,showPreview:R})}_progressLabel(v){switch(v){case Ai.CREATE:return g(4853,"Running 'File Create' participants...");case Ai.MOVE:return g(4854,"Running 'File Rename' participants...");case Ai.COPY:return g(4855,"Running 'File Copy' participants...");case Ai.DELETE:return g(4856,"Running 'File Delete' participants...");case Ai.WRITE:return g(4857,"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,n,o){const r=N.revive(i),a={...n};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=`${Hy(h,"/")}/${E1}`;a.includes.push(zqt(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()}},nj=qR,qR.MementoKeyAdditionalEdits="file.particpants.additionalEdits",qR);SEe=nj=D([Gi(Be.MainThreadFileSystemEventService),_(1,Jt),_(2,Hb),_(3,LN),_(4,og),_(5,to),_(6,$i),_(7,Ge),_(8,Za),_(9,ks),_(10,yi),_(11,Ge),_(12,Te)],SEe);At(class extends li{constructor(){super({id:"files.participants.resetChoice",title:{value:g(4858,"Reset choice for 'File operation needs preview'"),original:"Reset choice for 'File operation needs preview'"},f1:!0})}run(e){e.get($i).remove(SEe.MementoKeyAdditionalEdits,Ie.PROFILE)}});const Sg=Symbol("unset");class Ate{constructor(){this.root=new xue,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||hi.empty()}get entries(){return this.root.children?.entries()||hi.empty()}insert(e,t,i){this.opNode(e,n=>n._value=t,i)}mutate(e,t){this.opNode(e,i=>i._value=t(i._value===Sg?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 n=t[i].node._value;if(n!==Sg){for(this._size--,t[i].node._value=Sg;i>0;i--){const{node:o,part:r}=t[i];if(o.children?.size||o._value!==Sg)break;t[i-1].node.children.delete(r)}return n}}*deleteRecursive(e){const t=this.getPathToKey(e);if(!t)return;const i=t[t.length-1].node;for(let n=t.length-1;n>0;n--){const o=t[n-1];if(o.node.children.delete(t[n].part),o.node.children.size>0||o.node._value!==Sg)break}for(const n of Uze(i))n._value!==Sg&&(this._size--,yield n._value)}find(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return;t=n}return t._value===Sg?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;if(n._value!==Sg)return!0;t=n}return!1}hasKeyOrChildren(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;t=n}return!0}hasKey(e){let t=this.root;for(const i of e){const n=t.children?.get(i);if(!n)return!1;t=n}return t._value!==Sg}getPathToKey(e){const t=[{part:"",node:this.root}];let i=0;for(const n of e){const o=t[i].node.children?.get(n);if(!o)return;t.push({part:n,node:o}),i++}return t}opNode(e,t,i){let n=this.root;for(const a of e){if(n.children)if(n.children.has(a))n=n.children.get(a);else{const c=new xue;n.children.set(a,c),n=c}else{const c=new xue;n.children=new Map([[a,c]]),n=c}i?.(n)}const o=n._value===Sg?0:1;t(n);const r=n._value===Sg?0:1;this._size+=r-o}*values(){for(const{_value:e}of Uze(this.root))e!==Sg&&(yield e)}}function*Uze(s){const e=[s];for(;e.length>0;){const t=e.pop();if(yield t,t.children)for(const i of t.children.values())e.push(i)}}let xue=class{constructor(){this._value=Sg}get value(){return this._value===Sg?void 0:this._value}set value(e){this._value=e===void 0?Sg:e}};var Xm;(function(s){s.Delimiter="\0"})(Xm||(Xm={}));var Nv;(function(s){s[s.IsSame=0]="IsSame",s[s.Disconnected=1]="Disconnected",s[s.IsChild=2]="IsChild",s[s.IsParent=3]="IsParent"})(Nv||(Nv={}));class vn{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new vn([t]);const n=[e.id];for(let o=i;o&&o.id!==t;o=o.parent)n.push(o.id);return n.push(t),new vn(n.reverse())}static isRoot(e){return!e.includes(Xm.Delimiter)}static root(e){const t=e.indexOf(Xm.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new vn(e.split(Xm.Delimiter))}static join(e,t){return new vn([...e.path,t])}static joinToString(e,t){return e.toString()+Xm.Delimiter+t}static parentId(e){const t=e.lastIndexOf(Xm.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(Xm.Delimiter);return t===-1?e:e.slice(t+Xm.Delimiter.length)}static isChild(e,t){return t[e.length]===Xm.Delimiter&&t.startsWith(e)}static compare(e,t){return e===t?Nv.IsSame:vn.isChild(e,t)?Nv.IsChild:vn.isChild(t,e)?Nv.IsParent:Nv.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let i=0;for(;i1?new vn(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 vn(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new vn(this.path,e)}compare(e){if(typeof e=="string")return vn.compare(this.toString(),e);for(let t=0;tthis.viewEnd?Nv.IsChild:e.viewEnd"runId"in s;var DH;(function(s){s.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),s.deserialize=(e,t)=>({range:F.lift(t.range),uri:e.asCanonicalUri(N.revive(t.uri))})})(DH||(DH={}));var N_;(function(s){s[s.Error=0]="Error",s[s.Output=1]="Output"})(N_||(N_={}));var Ete;(function(s){s.serialize=e=>({label:e.label,uri:e.uri?.toJSON(),position:e.position?.toJSON()}),s.deserialize=(e,t)=>({label:t.label,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,position:t.position?oe.lift(t.position):void 0})})(Ete||(Ete={}));var xte;(function(s){s.serialize=e=>({message:e.message,type:N_.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&DH.serialize(e.location),stackTrace:e.stackTrace?.map(Ete.serialize)}),s.deserialize=(e,t)=>({message:t.message,type:N_.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&DH.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(i=>Ete.deserialize(e,i))})})(xte||(xte={}));const Gqt=(s,e)=>`${e?"s":"e"}${s}`;var Dte;(function(s){s.serialize=e=>({message:e.message,type:N_.Output,offset:e.offset,length:e.length,location:e.location&&DH.serialize(e.location)}),s.deserialize=(e,t)=>({message:t.message,type:N_.Output,offset:t.offset,length:t.length,location:t.location&&DH.deserialize(e,t.location)})})(Dte||(Dte={}));var u$;(function(s){s.serialize=e=>e.type===N_.Error?xte.serialize(e):Dte.serialize(e),s.deserialize=(e,t)=>t.type===N_.Error?xte.deserialize(e,t):Dte.deserialize(e,t),s.isDiffable=e=>e.type===N_.Error&&e.actual!==void 0&&e.expected!==void 0})(u$||(u$={}));var rz;(function(s){s.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),s.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(u$.serialize)}),s.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>u$.deserialize(e,i))})})(rz||(rz={}));const Tnt="\0",sj=(s,e)=>s+Tnt+e,Lnt=s=>{const e=s.indexOf(Tnt);return{ctrlId:s.slice(0,e),tagId:s.slice(e+1)}};var g$;(function(s){s.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}),s.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(N.revive(t.uri)):void 0,range:t.range?F.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(g$||(g$={}));var Id;(function(s){s[s.NotExpandable=0]="NotExpandable",s[s.Expandable=1]="Expandable",s[s.BusyExpanding=2]="BusyExpanding",s[s.Expanded=3]="Expanded"})(Id||(Id={}));var vD;(function(s){s.serialize=e=>({expand:e.expand,item:g$.serialize(e.item)}),s.deserialize=(e,t)=>({controllerId:vn.root(t.item.extId),expand:t.expand,item:g$.deserialize(e,t.item)})})(vD||(vD={}));var f$;(function(s){s.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}},s.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?F.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}}})(f$||(f$={}));const AEe=(s,e)=>{e.expand!==void 0&&(s.expand=e.expand),e.item!==void 0&&(s.item=s.item?Object.assign(s.item,e.item):e.item)};var kte;(function(s){s.serializeWithoutMessages=e=>({...vD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(rz.serializeWithoutMessages)}),s.serialize=e=>({...vD.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(rz.serialize)}),s.deserialize=(e,t)=>({...vD.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>rz.deserialize(e,i)),retired:!0})})(kte||(kte={}));var EEe;(function(s){s.empty=()=>({covered:0,total:0}),s.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(EEe||(EEe={}));var xEe;(function(s){s.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testIds:e.testIds,uri:e.uri.toJSON()}),s.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testIds:t.testIds,uri:e.asCanonicalUri(N.revive(t.uri))}),s.empty=(e,t)=>({id:e,uri:t,statement:EEe.empty()})})(xEe||(xEe={}));function ZNe(s){return{...s,location:s.location?.toJSON()}}function ePe(s){return s.location=s.location?oe.isIPosition(s.location)?oe.lift(s.location):F.lift(s.location):void 0,s}var kH;(function(s){s[s.Declaration=0]="Declaration",s[s.Statement=1]="Statement",s[s.Branch=2]="Branch"})(kH||(kH={}));var DEe;(function(s){s.serialize=e=>e.type===kH.Declaration?Tte.serialize(e):Lte.serialize(e),s.deserialize=e=>e.type===kH.Declaration?Tte.deserialize(e):Lte.deserialize(e)})(DEe||(DEe={}));var Ite;(function(s){s.serialize=ZNe,s.deserialize=ePe})(Ite||(Ite={}));var Tte;(function(s){s.serialize=ZNe,s.deserialize=ePe})(Tte||(Tte={}));var Lte;(function(s){s.serialize=e=>({...ZNe(e),branches:e.branches?.map(Ite.serialize)}),s.deserialize=e=>({...ePe(e),branches:e.branches?.map(Ite.deserialize)})})(Lte||(Lte={}));var fa;(function(s){s[s.Add=0]="Add",s[s.Update=1]="Update",s[s.DocumentSynced=2]="DocumentSynced",s[s.Remove=3]="Remove",s[s.IncrementPendingExtHosts=4]="IncrementPendingExtHosts",s[s.Retire=5]="Retire",s[s.AddTag=6]="AddTag",s[s.RemoveTag=7]="RemoveTag"})(fa||(fa={}));var IH;(function(s){s.deserialize=(e,t)=>t.op===fa.Add?{op:t.op,item:vD.deserialize(e,t.item)}:t.op===fa.Update?{op:t.op,item:f$.deserialize(t.item)}:t.op===fa.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(N.revive(t.uri)),docv:t.docv}:t,s.serialize=e=>e.op===fa.Add?{op:e.op,item:vD.serialize(e.item)}:e.op===fa.Update?{op:e.op,item:f$.serialize(e.item)}:e})(IH||(IH={}));class Kqt{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 fa.Add:this.add(vD.deserialize(this.uriIdentity,i.item),t);break;case fa.Update:this.update(f$.deserialize(i.item),t);break;case fa.Remove:this.remove(i.itemId,t);break;case fa.Retire:this.retireTest(i.itemId);break;case fa.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case fa.AddTag:this._tags.set(i.tag.id,i.tag);break;case fa.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=vn.parentId(e.item.extId)?.toString();let n;if(!i)n=this.createItem(e),this.roots.add(n),this.items.set(e.item.extId,n);else if(this.items.has(i)){const o=this.items.get(i);o.children.add(e.item.extId),n=this.createItem(e,o),this.items.set(e.item.extId,n)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(n),e.expand===Id.BusyExpanding&&this.busyControllerCount++,n}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Id.BusyExpanding&&this.busyControllerCount--,e.expand===Id.BusyExpanding&&this.busyControllerCount++),AEe(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const n=vn.parentId(i.item.extId)?.toString();n?this.items.get(n).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===Id.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Bd;(function(s){s[s.Upsert=0]="Upsert",s[s.SetTags=1]="SetTags",s[s.UpdateCanResolveChildren=2]="UpdateCanResolveChildren",s[s.RemoveChild=3]="RemoveChild",s[s.SetProp=4]="SetProp",s[s.Bulk=5]="Bulk",s[s.DocumentSynced=6]="DocumentSynced"})(Bd||(Bd={}));const A4=(s,e)=>s===e,qqt={range:(s,e)=>s===e?!0:!s||!e?!1:s.equalsRange(e),busy:A4,label:A4,description:A4,error:A4,sortText:A4,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.includes(t)))},Qqt=Object.entries(qqt),jqt=(s,e)=>{let t;for(const[i,n]of Qqt)n(s[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class Yqt extends V{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new cn(()=>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 fa.DocumentSynced:{for(const t of this.diff)if(t.op===fa.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case fa.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===fa.Update&&t.item.extId===e.item.extId){AEe(t.item,e.item);return}if(t.op===fa.Add&&t.item.item.extId===e.item.extId){AEe(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===Id.Expandable){const n=this.resolveChildren(i);return n.isOpen()?this.expandChildren(i,t-1):n.wait().then(()=>this.expandChildren(i,t-1))}else if(i.expand===Id.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 Bd.RemoveChild:this.removeItem(vn.joinToString(e.fullId,t.id));break;case Bd.Upsert:this.upsertItem(t.item,e);break;case Bd.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case Bd.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Bd.UpdateCanResolveChildren:this.updateExpandability(e);break;case Bd.SetProp:this.pushDiff({op:fa.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Bd.DocumentSynced:this.documentSynced(e.actual.uri);break;default:j7()}}documentSynced(e){e&&this.pushDiff({op:fa.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=vn.fromExtHostTestItem(e,this.root.id,t?.actual),n=this.options.getApiFor(e);n.parent&&n.parent!==t?.actual&&this.options.getChildren(n.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:Id.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(o.fullId.toString(),o),this.setItemParent(e,t),this.pushDiff({op:fa.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=jqt(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,o.actual=e,o.resolveBarrier=void 0,o.expand=Id.NotExpandable,c&&(c.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete c.tags),this.onTestItemEvent(o,{op:Bd.SetProp,update:c})),this.connectItemAndChildren(e,o,t);for(const[d,h]of r)this.options.getChildren(e).get(h.id)||this.removeItem(vn.joinToString(i,h.id));const l=o.expandLevels;l!==void 0&&queueMicrotask(()=>{o.expand===Id.Expandable&&(o.expandLevels=void 0,this.expand(i.toString(),l))}),this.documentSynced(o.actual.uri)}diffTagRefs(e,t,i){const n=new Set(t.map(o=>o.id));for(const o of e)n.delete(o.id)||this.incrementTagRefs(o);this.pushDiff({op:fa.Update,item:{extId:i,item:{tags:e.map(o=>sj(this.options.controllerId,o.id))}}}),n.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:fa.AddTag,tag:{id:sj(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:fa.RemoveTag,id:sj(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 n=this.options.getApiFor(e);n.parent=i?.actual,n.listener=o=>this.onTestItemEvent(t,o),this.updateExpandability(t)}connectItemAndChildren(e,t,i){this.connectItem(e,t,i);for(const[n,o]of this.options.getChildren(e))this.upsertItem(o,t)}updateExpandability(e){let t;this._resolveHandler?e.resolveBarrier?t=e.resolveBarrier.isOpen()?Id.Expanded:Id.BusyExpanding:t=e.actual.canResolveChildren?Id.Expandable:Id.NotExpandable:t=Id.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:fa.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Id.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;const i=[];for(const[n,o]of this.options.getChildren(e.actual)){const r=this.expand(vn.joinToString(e.fullId,o.id),t);Gy(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 Gd;return o.open(),o}e.expand=Id.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new Gd,i=o=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,o)};let n;try{n=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(o){i(o)}return Gy(n)?n.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:fa.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:fa.Remove,itemId:e});const i=[t];for(;i.length;){const n=i.pop();if(n){this.options.getApiFor(n.actual).listener=void 0;for(const o of n.actual.tags)this.decrementTagRefs(o.id);this.tree.delete(n.fullId.toString());for(const[o,r]of this.options.getChildren(n.actual))i.push(this.tree.get(vn.joinToString(n.fullId,r.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class Jqt extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class Rte extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class Xqt 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 Zqt=(s,e,t)=>{let i=new Map;return{get size(){return i.size},forEach(n,o){for(const r of i.values())n.call(o,r,this)},[Symbol.iterator](){return i.entries()},replace(n){const o=new Map,r=new Set(i.keys()),a={op:Bd.Bulk,ops:[]};for(const c of n){if(!(c instanceof t))throw new Rte(c.id);const l=e(c).controllerId;if(l!==s.controllerId)throw new Xqt(c.id,l,s.controllerId);if(o.has(c.id))throw new Jqt(c.id);o.set(c.id,c),r.delete(c.id),a.ops.push({op:Bd.Upsert,item:c})}for(const c of r.keys())a.ops.push({op:Bd.RemoveChild,id:c});s.listener?.(a),i=o},add(n){if(!(n instanceof t))throw new Rte(n.id);i.set(n.id,n),s.listener?.({op:Bd.Upsert,item:n})},delete(n){i.delete(n)&&s.listener?.({op:Bd.RemoveChild,id:n})},get(n){return i.get(n)},toJSON(){return Array.from(i.values())}}},Rnt=new WeakMap,eQt=(s,e)=>{const t={controllerId:e};return Rnt.set(s,t),t},zce=s=>{const e=Rnt.get(s);if(!e)throw new Rte(s?.id||"");return e};var RC;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.Assistant=2]="Assistant"})(RC||(RC={}));const zze={type:"object",properties:{vendor:{type:"string",description:g(3049,"A globally unique vendor of language models.")}}},tQt=Xd.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:g(3050,"Contribute language models of a specific vendor."),oneOf:[zze,{type:"array",items:zze}]},activationEventsGenerator:(s,e)=>{for(const t of s)e.push(`onLanguageModelChat:${t.vendor}`)}});let $ze=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(tQt.setHandler(i=>{this._vendors.clear();for(const o of i){if(!ll(o.description,"chatProvider")){o.collector.error(g(3051,"This contribution point requires the 'chatProvider' proposal."));continue}for(const r of hi.wrap(o.value)){if(this._vendors.has(r.vendor)){o.collector.error(g(3052,"The vendor '{0}' is already registered and cannot be registered twice",r.vendor));continue}if(zu(r.vendor)){o.collector.error(g(3053,"The vendor field cannot be empty."));continue}if(r.vendor.trim()!==r.vendor){o.collector.error(g(3054,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(r.vendor)}}const n=[];for(const[o,r]of this._providers)this._vendors.has(r.metadata.vendor)||(this._providers.delete(o),n.push(o));n.length>0&&this._onDidChangeProviders.fire({removed:n})}))}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(n=>this._extensionService.activateByEvent(`onLanguageModelChat:${n}`));await Promise.all(i)}const t=[];for(const[i,n]of this._providers)(e.vendor===void 0||n.metadata.vendor===e.vendor)&&(e.family===void 0||n.metadata.family===e.family)&&(e.version===void 0||n.metadata.version===e.version)&&(e.identifier===void 0||n.metadata.id===e.identifier)&&(!n.metadata.targetExtensions||n.metadata.targetExtensions.some(o=>Sn.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))})}async sendChatRequest(e,t,i,n,o){const r=this._providers.get(e);if(!r)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return r.sendChatRequest(i,t,n,o)}computeTokenLength(e,t,i){const n=this._providers.get(e);if(!n)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return n.provideTokenCount(t,i)}};$ze=D([_(0,fs),_(1,Ge)],$ze);var Fb;(function(s){function e(i){const{selectionStartLineNumber:n,selectionStartColumn:o,positionLineNumber:r,positionColumn:a}=i,c=new bs(n-1,o-1),l=new bs(r-1,a-1);return new oC(c,l)}s.to=e;function t(i){const{anchor:n,active:o}=i;return{selectionStartLineNumber:n.line+1,selectionStartColumn:n.character+1,positionLineNumber:o.line+1,positionColumn:o.character+1}}s.from=t})(Fb||(Fb={}));var et;(function(s){function e(i){if(!i)return;const{start:n,end:o}=i;return{startLineNumber:n.line+1,startColumn:n.character+1,endLineNumber:o.line+1,endColumn:o.character+1}}s.from=e;function t(i){if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:r,endColumn:a}=i;return new Jn(n-1,o-1,r-1,a-1)}s.to=t})(et||(et={}));var bD;(function(s){function e(i){return{uri:i.uri,range:et.from(i.range)}}s.from=e;function t(i){return new vp(N.revive(i.uri),et.to(i.range))}s.to=t})(bD||(bD={}));var kEe;(function(s){function e(t){switch(t){case nr.Comment:return TS.Comment;case nr.Other:return TS.Other;case nr.RegEx:return TS.RegEx;case nr.String:return TS.String}}s.to=e})(kEe||(kEe={}));var Yo;(function(s){function e(i){return new bs(i.lineNumber-1,i.column-1)}s.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}s.from=t})(Yo||(Yo={}));var TH;(function(s){function e(n,o,r){return Fi(O_(n).map(a=>t(a,o,r)))}s.from=e;function t(n,o,r){if(typeof n=="string")return{$serialized:!0,language:n,isBuiltin:r?.isBuiltin};if(n)return{$serialized:!0,language:n.language,scheme:i(n.scheme,o),pattern:Vf.from(n.pattern)??void 0,exclusive:n.exclusive,notebookType:n.notebookType,isBuiltin:r?.isBuiltin}}function i(n,o){return o&&typeof n=="string"?o.transformOutgoingScheme(n):n}})(TH||(TH={}));var Mte;(function(s){function e(i){switch(i){case Px.Unnecessary:return l_.Unnecessary;case Px.Deprecated:return l_.Deprecated}}s.from=e;function t(i){switch(i){case l_.Unnecessary:return Px.Unnecessary;case l_.Deprecated:return Px.Deprecated;default:return}}s.to=t})(Mte||(Mte={}));var LH;(function(s){function e(i){let n;return i.code&&(Lt(i.code)||lc(i.code)?n=String(i.code):n={value:String(i.code.value),target:i.code.target}),{...et.from(i.range),message:i.message,source:i.source,code:n,severity:Pte.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(Nte.from),tags:Array.isArray(i.tags)?Fi(i.tags.map(Mte.from)):void 0}}s.from=e;function t(i){const n=new x9(et.to(i),i.message,Pte.to(i.severity));return n.source=i.source,n.code=Lt(i.code)?i.code:i.code?.value,n.relatedInformation=i.relatedInformation&&i.relatedInformation.map(Nte.to),n.tags=i.tags&&Fi(i.tags.map(Mte.to)),n}s.to=t})(LH||(LH={}));var Nte;(function(s){function e(i){return{...et.from(i.location.range),message:i.message,resource:i.location.uri}}s.from=e;function t(i){return new QW(new vp(i.resource,et.to(i)),i.message)}s.to=t})(Nte||(Nte={}));var Pte;(function(s){function e(i){switch(i){case Fd.Error:return Ws.Error;case Fd.Warning:return Ws.Warning;case Fd.Information:return Ws.Info;case Fd.Hint:return Ws.Hint}return Ws.Error}s.from=e;function t(i){switch(i){case Ws.Info:return Fd.Information;case Ws.Warning:return Fd.Warning;case Ws.Error:return Fd.Error;case Ws.Hint:return Fd.Hint;default:return Fd.Error}}s.to=t})(Pte||(Pte={}));var El;(function(s){function e(i){return typeof i=="number"&&i>=iH.One?i-1:i===iH.Beside?J_:dA}s.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}s.to=t})(El||(El={}));function iQt(s){return typeof s.range<"u"}function Mnt(s){return s.length===0?!0:!!iQt(s[0])}var Ps;(function(s){function e(a){return a.map(s.from)}s.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 af.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=N.parse(u,!0);f=f.with({query:n(f.query,l)}),l[u]=f}catch{}return""},h=new Uu.Renderer;return h.link=d,h.image=u=>typeof u=="string"?d(NQe(u).href):"",Uu(c.value,{renderer:h}),c}s.from=i;function n(a,c){if(!a)return a;let l;try{l=G2(a)}catch{}if(!l)return a;let d=!1;return l=b2(l,h=>{if(N.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 af(a.value,a.supportThemeIcons);return c.isTrusted=a.isTrusted,c.supportHtml=a.supportHtml,c.baseUri=a.baseUri?N.from(a.baseUri):void 0,c}s.to=o;function r(a){if(a)return typeof a=="string"?a:s.from(a)}s.fromStrict=r})(Ps||(Ps={}));function nQt(s){return Mnt(s)?s.map(e=>({range:et.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Ps.fromMany(e.hoverMessage):e.hoverMessage?Ps.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):s.map(e=>({range:et.from(e)}))}function $ce(s){return typeof s>"u"?s:typeof s=="string"?N.file(s):s}var RH;(function(s){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?$ce(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}}s.from=e})(RH||(RH={}));var Fte;(function(s){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?$ce(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?RH.from(t.before):void 0,after:t.after?RH.from(t.after):void 0}}s.from=e})(Fte||(Fte={}));var IEe;(function(s){function e(t){if(typeof t>"u")return t;switch(t){case Ox.OpenOpen:return ni.AlwaysGrowsWhenTypingAtEdges;case Ox.ClosedClosed:return ni.NeverGrowsWhenTypingAtEdges;case Ox.OpenClosed:return ni.GrowsOnlyWhenTypingBefore;case Ox.ClosedOpen:return ni.GrowsOnlyWhenTypingAfter}}s.from=e})(IEe||(IEe={}));var TEe;(function(s){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?IEe.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?Fte.from(t.light):void 0,dark:t.dark?Fte.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?$ce(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?RH.from(t.before):void 0,after:t.after?RH.from(t.after):void 0}}s.from=e})(TEe||(TEe={}));var nd;(function(s){function e(i){return{text:i.newText,eol:i.newEol&&PH.from(i.newEol),range:et.from(i.range)}}s.from=e;function t(i){const n=new HA(et.to(i.range),i.text);return n.newEol=typeof i.eol>"u"?void 0:PH.to(i.eol),n}s.to=t})(nd||(nd={}));var Qu;(function(s){function e(i,n){const o={edits:[]};if(i instanceof rI){const r=new Ck;for(const a of i._allEntries())a._type===vc.File&&N.isUri(a.to)&&a.from===void 0&&r.add(a.to);for(const a of i._allEntries())if(a._type===vc.File){let c;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?c={type:"base64",value:sTe($e.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===vc.Text?o.edits.push({resource:a.uri,textEdit:nd.from(a.edit),versionId:r.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===vc.Snippet?o.edits.push({resource:a.uri,textEdit:{range:et.from(a.range),text:a.edit.value,insertAsSnippet:!0},versionId:r.has(a.uri)?void 0:n?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===vc.Cell?o.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookMetadata:a.notebookMetadata,notebookVersionId:n?.getNotebookDocumentVersion(a.uri)}):a._type===vc.CellReplace&&o.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:n?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:oI.Replace,index:a.index,count:a.count,cells:a.cells.map(w$.from)}})}return o}s.from=e;function t(i){const n=new rI,o=new ui;for(const r of i.edits)if(r.textEdit){const a=r,c=N.revive(a.resource),l=et.to(a.textEdit.range),d=a.textEdit.text,h=a.textEdit.insertAsSnippet;let u;h?u=Tce.replace(l,new aI(d)):u=HA.replace(l,d);const f=o.get(c);f?f.push(u):o.set(c,[u])}else n.renameFile(N.revive(r.oldResource),N.revive(r.newResource),r.options);for(const[r,a]of o)n.set(r,a);return n}s.to=t})(Qu||(Qu={}));var Z_;(function(s){const e=Object.create(null);e[_r.File]=pt.File,e[_r.Module]=pt.Module,e[_r.Namespace]=pt.Namespace,e[_r.Package]=pt.Package,e[_r.Class]=pt.Class,e[_r.Method]=pt.Method,e[_r.Property]=pt.Property,e[_r.Field]=pt.Field,e[_r.Constructor]=pt.Constructor,e[_r.Enum]=pt.Enum,e[_r.Interface]=pt.Interface,e[_r.Function]=pt.Function,e[_r.Variable]=pt.Variable,e[_r.Constant]=pt.Constant,e[_r.String]=pt.String,e[_r.Number]=pt.Number,e[_r.Boolean]=pt.Boolean,e[_r.Array]=pt.Array,e[_r.Object]=pt.Object,e[_r.Key]=pt.Key,e[_r.Null]=pt.Null,e[_r.EnumMember]=pt.EnumMember,e[_r.Struct]=pt.Struct,e[_r.Event]=pt.Event,e[_r.Operator]=pt.Operator,e[_r.TypeParameter]=pt.TypeParameter;function t(n){return typeof e[n]=="number"?e[n]:pt.Property}s.from=t;function i(n){for(const o in e)if(e[o]===n)return Number(o);return _r.Property}s.to=i})(Z_||(Z_={}));var UA;(function(s){function e(i){switch(i){case YW.Deprecated:return v8.Deprecated}}s.from=e;function t(i){switch(i){case v8.Deprecated:return YW.Deprecated}}s.to=t})(UA||(UA={}));var p$;(function(s){function e(i){return{name:i.name,kind:Z_.from(i.kind),tags:i.tags&&i.tags.map(UA.from),containerName:i.containerName,location:cf.from(i.location)}}s.from=e;function t(i){const n=new JW(i.name,Z_.to(i.kind),i.containerName,cf.to(i.location));return n.tags=i.tags&&i.tags.map(UA.to),n}s.to=t})(p$||(p$={}));var LEe;(function(s){function e(i){const n={name:i.name||"!!MISSING: name!!",detail:i.detail,range:et.from(i.range),selectionRange:et.from(i.selectionRange),kind:Z_.from(i.kind),tags:i.tags?.map(UA.from)??[]};return i.children&&(n.children=i.children.map(e)),n}s.from=e;function t(i){const n=new XW(i.name,i.detail,Z_.to(i.kind),et.to(i.range),et.to(i.selectionRange));return eo(i.tags)&&(n.tags=i.tags.map(UA.to)),i.children&&(n.children=i.children.map(t)),n}s.to=t})(LEe||(LEe={}));var lN;(function(s){function e(i){const n=new Lce(Z_.to(i.kind),i.name,i.detail||"",N.revive(i.uri),et.to(i.range),et.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,o){if(n=n??i._sessionId,o=o??i._itemId,n===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:o,name:i.name,detail:i.detail,kind:Z_.from(i.kind),uri:i.uri,range:et.from(i.range),selectionRange:et.from(i.selectionRange),tags:i.tags?.map(UA.from)}}s.from=t})(lN||(lN={}));var REe;(function(s){function e(t){return new INe(lN.to(t.from),t.fromRanges.map(i=>et.to(i)))}s.to=e})(REe||(REe={}));var MEe;(function(s){function e(t){return new TNe(lN.to(t.to),t.fromRanges.map(i=>et.to(i)))}s.to=e})(MEe||(MEe={}));var cf;(function(s){function e(i){return{range:i.range&&et.from(i.range),uri:i.uri}}s.from=e;function t(i){return new vp(N.revive(i.uri),et.to(i.range))}s.to=t})(cf||(cf={}));var m$;(function(s){function e(i){const n=i,o=i;return{originSelectionRange:n.originSelectionRange?et.from(n.originSelectionRange):void 0,uri:n.targetUri?n.targetUri:o.uri,range:et.from(n.targetRange?n.targetRange:o.range),targetSelectionRange:n.targetSelectionRange?et.from(n.targetSelectionRange):void 0}}s.from=e;function t(i){return{targetUri:N.revive(i.uri),targetRange:et.to(i.range),targetSelectionRange:i.targetSelectionRange?et.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?et.to(i.originSelectionRange):void 0}}s.to=t})(m$||(m$={}));var _$;(function(s){function e(i){return{range:et.from(i.range),contents:Ps.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}s.from=e;function t(i){const n=i.contents.map(Ps.to),o=et.to(i.range),r=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new k9(n,o,r,a)}s.to=t})(_$||(_$={}));var NEe;(function(s){function e(i){return{range:et.from(i.range),expression:i.expression}}s.from=e;function t(i){return new q9(et.to(i.range),i.expression)}s.to=t})(NEe||(NEe={}));var Ote;(function(s){function e(i){if(i instanceof Q9)return{type:"text",range:et.from(i.range),text:i.text};if(i instanceof j9)return{type:"variable",range:et.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof Y9)return{type:"expression",range:et.from(i.range),expression:i.expression};throw new Error("Unknown 'InlineValue' type")}s.from=e;function t(i){switch(i.type){case"text":return{range:et.to(i.range),text:i.text};case"variable":return{range:et.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:et.to(i.range),expression:i.expression}}}s.to=t})(Ote||(Ote={}));var Bte;(function(s){function e(i){return{frameId:i.frameId,stoppedLocation:et.from(i.stoppedLocation)}}s.from=e;function t(i){return new zAe(i.frameId,et.to(i.stoppedLocation))}s.to=t})(Bte||(Bte={}));var MH;(function(s){function e(i){return{range:et.from(i.range),kind:i.kind}}s.from=e;function t(i){return new I9(et.to(i.range),i.kind)}s.to=t})(MH||(MH={}));var PEe;(function(s){function e(i){return{uri:i.uri,highlights:i.highlights.map(MH.from)}}s.from=e;function t(i){return new T9(N.revive(i.uri),i.highlights.map(MH.to))}s.to=t})(PEe||(PEe={}));var FEe;(function(s){function e(t){switch(t){case $u.TriggerCharacter:return BT.TriggerCharacter;case $u.TriggerForIncompleteCompletions:return BT.TriggerForIncompleteCompletions;case $u.Invoke:default:return BT.Invoke}}s.to=e})(FEe||(FEe={}));var OEe;(function(s){function e(t){return{triggerKind:FEe.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}s.to=e})(OEe||(OEe={}));var Wte;(function(s){function e(i){switch(i){case tH.Deprecated:return E2.Deprecated}}s.from=e;function t(i){switch(i){case E2.Deprecated:return tH.Deprecated}}s.to=t})(Wte||(Wte={}));var Hte;(function(s){const e=new Map([[Zi.Method,Ne.Method],[Zi.Function,Ne.Function],[Zi.Constructor,Ne.Constructor],[Zi.Field,Ne.Field],[Zi.Variable,Ne.Variable],[Zi.Class,Ne.Class],[Zi.Interface,Ne.Interface],[Zi.Struct,Ne.Struct],[Zi.Module,Ne.Module],[Zi.Property,Ne.Property],[Zi.Unit,Ne.Unit],[Zi.Value,Ne.Value],[Zi.Constant,Ne.Constant],[Zi.Enum,Ne.Enum],[Zi.EnumMember,Ne.EnumMember],[Zi.Keyword,Ne.Keyword],[Zi.Snippet,Ne.Snippet],[Zi.Text,Ne.Text],[Zi.Color,Ne.Color],[Zi.File,Ne.File],[Zi.Reference,Ne.Reference],[Zi.Folder,Ne.Folder],[Zi.Event,Ne.Event],[Zi.Operator,Ne.Operator],[Zi.TypeParameter,Ne.TypeParameter],[Zi.Issue,Ne.Issue],[Zi.User,Ne.User]]);function t(o){return e.get(o)??Ne.Property}s.from=t;const i=new Map([[Ne.Method,Zi.Method],[Ne.Function,Zi.Function],[Ne.Constructor,Zi.Constructor],[Ne.Field,Zi.Field],[Ne.Variable,Zi.Variable],[Ne.Class,Zi.Class],[Ne.Interface,Zi.Interface],[Ne.Struct,Zi.Struct],[Ne.Module,Zi.Module],[Ne.Property,Zi.Property],[Ne.Unit,Zi.Unit],[Ne.Value,Zi.Value],[Ne.Constant,Zi.Constant],[Ne.Enum,Zi.Enum],[Ne.EnumMember,Zi.EnumMember],[Ne.Keyword,Zi.Keyword],[Ne.Snippet,Zi.Snippet],[Ne.Text,Zi.Text],[Ne.Color,Zi.Color],[Ne.File,Zi.File],[Ne.Reference,Zi.Reference],[Ne.Folder,Zi.Folder],[Ne.Event,Zi.Event],[Ne.Operator,Zi.Operator],[Ne.TypeParameter,Zi.TypeParameter],[Ne.User,Zi.User],[Ne.Issue,Zi.Issue]]);function n(o){return i.get(o)??Zi.Property}s.to=n})(Hte||(Hte={}));var BEe;(function(s){function e(t,i){const n=new P9(t.label);return n.insertText=t.insertText,n.kind=Hte.to(t.kind),n.tags=t.tags?.map(Wte.to),n.detail=t.detail,n.documentation=cd(t.documentation)?Ps.to(t.documentation):t.documentation,n.sortText=t.sortText,n.filterText=t.filterText,n.preselect=t.preselect,n.commitCharacters=t.commitCharacters,F.isIRange(t.range)?n.range=et.to(t.range):typeof t.range=="object"&&(n.range={inserting:et.to(t.range.insert),replacing:et.to(t.range.replace)}),n.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&qg.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&qg.InsertAsSnippet?n.insertText=new aI(t.insertText):(n.insertText=t.insertText,n.textEdit=n.range instanceof Jn?new HA(n.range,n.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(n.additionalTextEdits=t.additionalTextEdits.map(o=>nd.to(o))),n.command=i&&t.command?i.fromInternal(t.command):void 0,n}s.to=e})(BEe||(BEe={}));var Ute;(function(s){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Ps.fromStrict(i.documentation)}}s.from=e;function t(i){return{label:i.label,documentation:cd(i.documentation)?Ps.to(i.documentation):i.documentation}}s.to=t})(Ute||(Ute={}));var Vte;(function(s){function e(i){return{label:i.label,documentation:Ps.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(Ute.from):[],activeParameter:i.activeParameter}}s.from=e;function t(i){return{label:i.label,documentation:cd(i.documentation)?Ps.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(Ute.to):[],activeParameter:i.activeParameter}}s.to=t})(Vte||(Vte={}));var v$;(function(s){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(Vte.from):[]}}s.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(Vte.to):[]}}s.to=t})(v$||(v$={}));var WEe;(function(s){function e(t,i){const n=new N9(Yo.to(i.position),typeof i.label=="string"?i.label:i.label.map(HEe.to.bind(void 0,t)),i.kind&&zte.to(i.kind));return n.textEdits=i.textEdits&&i.textEdits.map(nd.to),n.tooltip=cd(i.tooltip)?Ps.to(i.tooltip):i.tooltip,n.paddingLeft=i.paddingLeft,n.paddingRight=i.paddingRight,n}s.to=e})(WEe||(WEe={}));var HEe;(function(s){function e(t,i){const n=new M9(i.label);return n.tooltip=cd(i.tooltip)?Ps.to(i.tooltip):i.tooltip,Nj.is(i.command)&&(n.command=t.fromInternal(i.command)),i.location&&(n.location=cf.to(i.location)),n}s.to=e})(HEe||(HEe={}));var zte;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(zte||(zte={}));var QT;(function(s){function e(i){return{range:et.from(i.range),url:i.target,tooltip:i.tooltip}}s.from=e;function t(i){let n;if(i.url)try{n=typeof i.url=="string"?N.parse(i.url,!0):N.revive(i.url)}catch{}const o=new O9(et.to(i.range),n);return o.tooltip=i.tooltip,o}s.to=t})(QT||(QT={}));var $te;(function(s){function e(i){const n=new W9(i.label);return i.textEdit&&(n.textEdit=nd.to(i.textEdit)),i.additionalTextEdits&&(n.additionalTextEdits=i.additionalTextEdits.map(o=>nd.to(o))),n}s.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?nd.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(n=>nd.from(n)):void 0}}s.from=t})($te||($te={}));var NH;(function(s){function e(i){return new eN(i[0],i[1],i[2],i[3])}s.to=e;function t(i){return[i.red,i.green,i.blue,i.alpha]}s.from=t})(NH||(NH={}));var UEe;(function(s){function e(i){return{range:et.from(i.range)}}s.from=e;function t(i){return new eH(et.to(i.range))}s.to=t})(UEe||(UEe={}));var Gte;(function(s){function e(t){switch(t){case Cn.AUTO:return WT.AfterDelay;case Cn.EXPLICIT:return WT.Manual;case Cn.FOCUS_CHANGE:case Cn.WINDOW_CHANGE:return WT.FocusOut}}s.to=e})(Gte||(Gte={}));var nB;(function(s){function e(i){switch(i){case i_.Off:return wr.Off;case i_.Relative:return wr.Relative;case i_.Interval:return wr.Interval;case i_.On:default:return wr.On}}s.from=e;function t(i){switch(i){case wr.Off:return i_.Off;case wr.Relative:return i_.Relative;case wr.Interval:return i_.Interval;case wr.On:default:return i_.On}}s.to=t})(nB||(nB={}));var PH;(function(s){function e(i){if(i===A_.CRLF)return yh.CRLF;if(i===A_.LF)return yh.LF}s.from=e;function t(i){if(i===yh.CRLF)return A_.CRLF;if(i===yh.LF)return A_.LF}s.to=t})(PH||(PH={}));var VEe;(function(s){function e(t){if(typeof t=="object")return t.viewId;switch(t){case fD.SourceControl:return dd.Scm;case fD.Window:return dd.Window;case fD.Notification:return dd.Notification}throw new Error("Unknown 'ProgressLocation'")}s.from=e})(VEe||(VEe={}));var Kte;(function(s){function e(i){const n={start:i.start+1,end:i.end+1};return i.kind&&(n.kind=qte.from(i.kind)),n}s.from=e;function t(i){const n={start:i.start-1,end:i.end-1};return i.kind&&(n.kind=qte.to(i.kind)),n}s.to=t})(Kte||(Kte={}));var qte;(function(s){function e(i){if(i)switch(i){case Bw.Comment:return r_.Comment;case Bw.Imports:return r_.Imports;case Bw.Region:return r_.Region}}s.from=e;function t(i){if(i)switch(i.value){case r_.Comment.value:return Bw.Comment;case r_.Imports.value:return Bw.Imports;case r_.Region.value:return Bw.Region}}s.to=t})(qte||(qte={}));var az;(function(s){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"?et.from(t.selection):void 0,override:typeof t.override=="boolean"?nm.id:void 0}}s.from=e})(az||(az={}));var Vf;(function(s){function e(o){return o instanceof UT?o.toJSON():typeof o=="string"?o:t(o)||i(o)?new UT(o.baseUri??o.base,o.pattern).toJSON():o}s.from=e;function t(o){const r=o;return r?N.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 n(o){return typeof o=="string"?o:new UT(N.revive(o.baseUri),o.pattern)}s.to=n})(Vf||(Vf={}));var zEe;(function(s){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:Vf.from(i.pattern),exclusive:i.exclusive,notebookType:i.notebookType}}}else return}s.from=e})(zEe||(zEe={}));var Qte;(function(s){function e(i){return!!i&&typeof i=="object"&&"documents"in i&&Array.isArray(i.documents)&&i.documents.every(n=>Array.isArray(n)&&n.every(o=>o&&typeof o=="object"&&"uri"in o&&N.isUri(o.uri)&&"version"in o&&typeof o.version=="number"&&"ranges"in o&&Array.isArray(o.ranges)&&o.ranges.every(r=>r instanceof Jn)))}s.is=e;function t(i){return{documents:i.documents.map(n=>n.map(o=>({uri:N.from(o.uri),version:o.version,ranges:o.ranges.map(r=>et.from(r))})))}}s.from=t})(Qte||(Qte={}));var Fy;(function(s){function e(i){return{start:i.start,end:i.end}}s.from=e;function t(i){return new wy(i.start,i.end)}s.to=t})(Fy||(Fy={}));var FH;(function(s){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}}s.to=e;function t(i){return{lastRunSuccess:i.success,runStartTime:i.timing?.startTime,runEndTime:i.timing?.endTime,executionOrder:i.executionOrder}}s.from=t})(FH||(FH={}));var $Ee;(function(s){function e(t){if(t===ez.Unconfirmed)return sN.Pending;if(t===ez.Pending)return;if(t===ez.Executing)return sN.Executing;throw new Error(`Unknown state: ${t}`)}s.to=e})($Ee||($Ee={}));var b$;(function(s){function e(i){switch(i){case Hx.Markup:return yF.Markup;case Hx.Code:default:return yF.Code}}s.from=e;function t(i){switch(i){case yF.Markup:return Hx.Markup;case yF.Code:default:return Hx.Code}}s.to=t})(b$||(b$={}));var NE;(function(s){function e(i){const n={metadata:i.metadata??Object.create(null),cells:[]};for(const o of i.cells)iG.validate(o),n.cells.push(w$.from(o));return n}s.from=e;function t(i){const n=new NNe(i.cells.map(w$.to));return wA(i.metadata)||(n.metadata=i.metadata),n}s.to=t})(NE||(NE={}));var w$;(function(s){function e(i){return{cellKind:b$.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:FH.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(dI.from):[]}}s.from=e;function t(i){return new iG(b$.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(dI.to):void 0,i.metadata,i.internalMetadata?FH.to(i.internalMetadata):void 0)}s.to=t})(w$||(w$={}));var OH;(function(s){function e(i){return{mime:i.mime,valueBytes:$e.wrap(i.data)}}s.from=e;function t(i){return new PNe(i.valueBytes.buffer,i.mime)}s.to=t})(OH||(OH={}));var dI;(function(s){function e(i){return{outputId:i.id,items:i.items.map(OH.from),metadata:i.metadata}}s.from=e;function t(i){const n=i.items.map(OH.to);return new Z9(n,i.outputId,i.metadata)}s.to=t})(dI||(dI={}));var jte;(function(s){function e(n){return i(n)?{include:Vf.from(n.include)??void 0,exclude:Vf.from(n.exclude)??void 0}:Vf.from(n)??void 0}s.from=e;function t(n){return i(n)?{include:Vf.to(n.include),exclude:Vf.to(n.exclude)}:Vf.to(n)}s.to=t;function i(n){const o=n;return o?!ra(o.include)&&!ra(o.exclude):!1}})(jte||(jte={}));var GEe;(function(s){function e(t,i,n){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===e$.Left?Lee.Left:Lee.Right,command:i.toInternal(o,n),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}s.from=e})(GEe||(GEe={}));var KEe;(function(s){function e(t,i,n){const o=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{command:i.toInternal(o,n),label:t.label,description:t.description,detail:t.detail,documentation:t.documentation}}s.from=e})(KEe||(KEe={}));var qEe;(function(s){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}s.from=e})(qEe||(qEe={}));var Yte;(function(s){function e(i){return{uri:i.uri,provides:i.provides}}s.from=e;function t(i){return new FNe(N.revive(i.uri),i.provides)}s.to=t})(Yte||(Yte={}));var BH;(function(s){function e(i){return{message:Ps.fromStrict(i.message)||"",type:N_.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:et.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(n=>({label:n.label,position:n.position&&Yo.from(n.position),uri:n.file&&N.revive(n.file).toJSON()}))}}s.from=e;function t(i){const n=new oN(typeof i.message=="string"?i.message:Ps.to(i.message));return n.actualOutput=i.actual,n.expectedOutput=i.expected,n.contextValue=i.contextValue,n.location=i.location?cf.to(i.location):void 0,n}s.to=t})(BH||(BH={}));var Ob;(function(s){s.namespace=sj,s.denamespace=Lnt})(Ob||(Ob={}));var hI;(function(s){function e(i){const n=zce(i).controllerId;return{extId:vn.fromExtHostTestItem(i,n).toString(),label:i.label,uri:N.revive(i.uri),busy:i.busy,tags:i.tags.map(o=>Ob.namespace(n,o.id)),range:F.lift(et.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Ps.fromStrict(i.error)||null}}s.from=e;function t(i){return{parent:void 0,error:void 0,id:vn.fromString(i.extId).localId,label:i.label,uri:N.revive(i.uri),tags:(i.tags||[]).map(n=>{const{tagId:o}=Ob.denamespace(n);return new _H(o)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:et.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}s.toPlain=t})(hI||(hI={}));(function(s){function e(i){return{id:i.id}}s.from=e;function t(i){return new _H(i.id)}s.to=t})(Ob||(Ob={}));var QEe;(function(s){const e=(i,n)=>{const o=i.value;if(!o)return;const r={...hI.toPlain(o.item),parent:n,taskStates:o.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(c=>c.type===N_.Error).map(BH.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 n=new Ate;for(const a of i.items)n.insert(vn.fromString(a.item.extId).path,a);const o=[n.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(Fc)}}s.to=t})(QEe||(QEe={}));var Jte;(function(s){function e(o){return{covered:o.covered,total:o.total}}function t(o){return"line"in o?Yo.from(o):et.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:kH.Statement,branches:o.branches.length?o.branches.map(r=>({count:r.executed,location:r.location&&t(r.location),label:r.label})):void 0}:{type:kH.Declaration,name:o.name,count:o.executed,location:t(o.location)}}s.fromDetails=i;function n(o,r,a){return ej(a.statementCoverage),ej(a.branchCoverage),ej(a.declarationCoverage),{id:r,uri:a.uri,statement:e(a.statementCoverage),branch:a.branchCoverage&&e(a.branchCoverage),declaration:a.declarationCoverage&&e(a.declarationCoverage),testIds:a instanceof rN&&a.fromTests.length?a.fromTests.map(c=>vn.fromExtHostTestItem(c,o).toString()):void 0}}s.fromFile=n})(Jte||(Jte={}));var jEe;(function(s){function e(t){switch(t){case wh.Invoke:return ZW.Invoke;case wh.Auto:return ZW.Automatic}}s.to=e})(jEe||(jEe={}));var jT;(function(s){function e(i){const n=new Mce(Z_.to(i.kind),i.name,i.detail||"",N.revive(i.uri),et.to(i.range),et.to(i.selectionRange));return n._sessionId=i._sessionId,n._itemId=i._itemId,n}s.to=e;function t(i,n,o){if(n=n??i._sessionId,o=o??i._itemId,n===void 0||o===void 0)throw new Error("invalid item");return{_sessionId:n,_itemId:o,kind:Z_.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:et.from(i.range),selectionRange:et.from(i.selectionRange),tags:i.tags?.map(UA.from)}}s.from=t})(jT||(jT={}));var Xte;(function(s){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}s.from=e})(Xte||(Xte={}));var Zte;(function(s){function e(o,r,a){const c=r.fileData;return c?new N9t(new P9t(c.name,N.revive(c.uri),c.id,cm(()=>a(c.id)))):o===Us.uriList&&r.uriListData?new qee(n(r.uriListData)):new qee(r.asString)}s.to=e;async function t(o,r){const a=await r.asString();if(o===Us.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}}s.from=t;function i(o){return Qk.split(o).map(r=>{if(r.startsWith("#"))return r;try{return N.parse(r)}catch{}return r})}function n(o){return Qk.create(o.map(r=>typeof r=="string"?r:N.revive(r)))}})(Zte||(Zte={}));var P_;(function(s){function e(i,n){const o=i.items.map(([r,a])=>[r,Zte.to(r,a,n)]);return new oH(o)}s.toDataTransfer=e;async function t(i){const n={items:[]},o=[];for(const[r,a]of i)o.push((async()=>{n.items.push([r,await Zte.from(r,a)])})());return await Promise.all(o),n}s.from=t})(P_||(P_={}));var y$;(function(s){function e(i,n){return{kind:"reply",agentId:i.participant??n?.agentId??"",subCommand:i.command??n?.command,message:i.prompt,title:i.label}}s.from=e;function t(i){return{prompt:i.message,label:i.title,participant:i.agentId,command:i.subCommand}}s.to=t})(y$||(y$={}));var eie;(function(s){function e(i){switch(i){case RC.System:return zp.System;case RC.User:return zp.User;case RC.Assistant:return zp.Assistant}}s.to=e;function t(i){switch(i){case zp.System:return RC.System;case zp.User:return RC.User;case zp.Assistant:return RC.Assistant}return RC.User}s.from=t})(eie||(eie={}));var EF;(function(s){function e(i){let n="",o;i.content.type==="text"?n=i.content.value:o=new c$(i.content.name,i.content.value,i.content.isError);const r=eie.to(i.role),a=new QNe(r,n,i.name);return o!==void 0&&(a.content2=o),a}s.to=e;function t(i){const n=eie.from(i.role),o=i.name;let r;return i.content2 instanceof c$?r={type:"function_result",name:i.content2.name,value:i.content2.content,isError:i.content2.isError}:r={type:"text",value:i.content},{role:n,name:o,content:r}}s.from=t})(EF||(EF={}));var C$;(function(s){function e(i){return{kind:"markdownContent",content:Ps.from(i.value)}}s.from=e;function t(i){return new nG(Ps.to(i.content))}s.to=t})(C$||(C$={}));var tie;(function(s){function e(i){return{kind:"markdownVuln",content:Ps.from(i.value),vulnerabilities:i.vulnerabilities}}s.from=e;function t(i){return new bH(Ps.to(i.content),i.vulnerabilities)}s.to=t})(tie||(tie={}));var iie;(function(s){function e(i){return{kind:"agentDetection",agentId:i.participant,command:i.command}}s.from=e;function t(i){return new wH(i.agentId,i.command)}s.to=t})(iie||(iie={}));var nie;(function(s){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data,buttons:t.buttons}}s.from=e})(nie||(nie={}));var S$;(function(s){function e(i){const{value:n,baseUri:o}=i;function r(a,c){return a.map(l=>{const d=N.joinPath(c,l.name);return{label:l.name,uri:d,children:l.children&&r(l.children,d)}})}return{kind:"treeData",treeData:{label:_i(o),uri:o,children:r(n,o)}}}s.from=e;function t(i){const n=Mo(i.treeData);function o(c){return c.map(l=>({name:l.label,children:l.children&&o(l.children)}))}const r=n.uri,a=n.children?o(n.children):[];return new sG(a,r)}s.to=t})(S$||(S$={}));var A$;(function(s){function e(i){const n=o=>N.isUri(o);return{kind:"inlineReference",name:i.title,inlineReference:n(i.value)?i.value:bD.from(i.value)}}s.from=e;function t(i){const n=Mo(i);return new oG(N.isUri(n.inlineReference)?n.inlineReference:bD.to(n.inlineReference),i.name)}s.to=t})(A$||(A$={}));var WH;(function(s){function e(i){return{kind:"progressMessage",content:Ps.from(i.value)}}s.from=e;function t(i){return new yH(i.content.value)}s.to=t})(WH||(WH={}));var E$;(function(s){function e(i){return{kind:"warning",content:Ps.from(i.value)}}s.from=e;function t(i){return new CH(i.content.value)}s.to=t})(E$||(E$={}));var YEe;(function(s){function e(t){return{kind:"progressTask",content:Ps.from(t.value)}}s.from=e})(YEe||(YEe={}));var JEe;(function(s){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Ps.from(t):void 0}}s.from=e})(JEe||(JEe={}));var x$;(function(s){function e(i,n,o){return{kind:"command",command:n.toInternal(i.value,o)??{command:i.value.command,title:i.value.title}}}s.from=e;function t(i,n){return new rG(n.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}s.to=t})(x$||(x$={}));var sie;(function(s){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(n=>nd.from(n))}}s.from=e;function t(i){return new SH(N.revive(i.uri),i.edits.map(n=>nd.to(n)))}s.to=t})(sie||(sie={}));var gA;(function(s){function e(i){const n=We.isThemeIcon(i.iconPath)?i.iconPath:N.isUri(i.iconPath)?{light:N.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&N.isUri(i.iconPath.light)&&N.isUri(i.iconPath.dark)?{light:N.revive(i.iconPath.light),dark:N.revive(i.iconPath.dark)}:void 0;return"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:N.isUri(i.value.value)||!i.value.value?i.value.value:bD.from(i.value.value)},iconPath:n,options:i.options}:{kind:"reference",reference:N.isUri(i.value)?i.value:bD.from(i.value),iconPath:n,options:i.options}}s.from=e;function t(i){const n=Mo(i),o=r=>N.isUri(r)?r:bD.to(r);return new Eb("variableName"in n.reference?{variableName:n.reference.variableName,value:n.reference.value&&o(n.reference.value)}:o(n.reference))}s.to=t})(gA||(gA={}));var oie;(function(s){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}s.from=e})(oie||(oie={}));var rie;(function(s){function e(n,o,r){return n instanceof nG?C$.from(n):n instanceof oG?A$.from(n):n instanceof Eb?gA.from(n):n instanceof yH?WH.from(n):n instanceof sG?S$.from(n):n instanceof rG?x$.from(n,o,r):n instanceof SH?sie.from(n):n instanceof bH?tie.from(n):n instanceof wH?iie.from(n):n instanceof CH?E$.from(n):n instanceof r$?nie.from(n):n instanceof a$?oie.from(n):{kind:"markdownContent",content:Ps.from("")}}s.from=e;function t(n,o){switch(n.kind){case"reference":return gA.to(n);case"markdownContent":case"inlineReference":case"progressMessage":case"treeData":case"command":return i(n,o)}}s.to=t;function i(n,o){switch(n.kind){case"markdownContent":return C$.to(n);case"inlineReference":return A$.to(n);case"progressMessage":return;case"treeData":return S$.to(n);case"command":return x$.to(n,o)}}s.toContent=i})(rie||(rie={}));var XEe;(function(s){function e(t,i){const n=t.variables.variables.filter(r=>r.isTool).map(r=>r.id),o=t.variables.variables.filter(r=>!r.isTool);return{prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,references:o.map(aie.to),location:D$.to(t.location),acceptedConfirmationData:t.acceptedConfirmationData,rejectedConfirmationData:t.rejectedConfirmationData,location2:i,requestedTools:n}}s.to=e})(XEe||(XEe={}));var D$;(function(s){function e(i){switch(i){case Ir.Notebook:return n_.Notebook;case Ir.Terminal:return n_.Terminal;case Ir.Panel:return n_.Panel;case Ir.Editor:return n_.Editor}}s.to=e;function t(i){switch(i){case n_.Notebook:return Ir.Notebook;case n_.Terminal:return Ir.Terminal;case n_.Panel:return Ir.Panel;case n_.Editor:return Ir.Editor}}s.from=t})(D$||(D$={}));var aie;(function(s){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:nfe(i)?N.revive(i):i&&typeof i=="object"&&"uri"in i&&"range"in i&&nfe(i.uri)?bD.to(Mo(i)):i,modelDescription:t.modelDescription}}s.to=e})(aie||(aie={}));var ZEe;(function(s){function e(t,i,n){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,n)}}s.from=e})(ZEe||(ZEe={}));var sB;(function(s){function e(t){return{errorDetails:t.errorDetails,metadata:t.metadata}}s.to=e})(sB||(sB={}));var exe;(function(s){function e(t,i,n){if(i.action.kind==="vote")return;const o=sB.to(t);if(i.action.kind==="command"){const r=i.action.commandButton.command;return{action:{kind:"command",commandButton:{command:n.fromInternal(r)??{command:r.id,title:r.title}}},result:o}}else return i.action.kind==="followUp"?{action:{kind:"followUp",followup:y$.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}}s.to=e})(exe||(exe={}));var cie;(function(s){function e(t,i,n){return"terminalCommand"in t?{terminalCommand:t.terminalCommand,shouldExecute:t.shouldExecute}:"uri"in t?{uri:t.uri}:i.toInternal(t,n)}s.from=e})(cie||(cie={}));var txe;(function(s){function e(t){return{kind:ixe.to(t.kind)}}s.to=e})(txe||(txe={}));var ixe;(function(s){function e(t){switch(t){case Qx.Word:return Fx.Word;case Qx.Line:return Fx.Line;case Qx.Suggest:return Fx.Suggest;default:return Fx.Unknown}}s.to=e})(ixe||(ixe={}));var nxe;(function(s){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||HSe.None,contextValue:t.contextValue}}s.from=e})(nxe||(nxe={}));var sxe;(function(s){function e(t){return{name:t.name,description:t.description,parametersSchema:t.parametersSchema}}s.to=e})(sxe||(sxe={}));class tPe{constructor(){this.requestIdPool=0,this.dataTransferFiles=new Map}add(e){const t=this.requestIdPool++;return this.dataTransferFiles.set(t,Fi(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 n=i.find(o=>o.id===t);if(!n)throw new Error("No matching file found in data transfer");return $e.wrap(await n.data())}dispose(){this.dataTransferFiles.clear()}}var Gze;(function(s){s.CallsTo="incomingCalls",s.CallsFrom="outgoingCalls"})(Gze||(Gze={}));const Nnt=new oo;class lie{static async create(e,t,i){const[n]=Nnt.ordered(e);if(!n)return;const o=await n.prepareCallHierarchy(e,t,i);if(o)return new lie(o.roots.reduce((r,a)=>r+a._sessionId,""),n,o.roots,new N1e(o))}constructor(e,t,i,n){this.id=e,this.provider=t,this.roots=i,this.ref=n,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends lie{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async resolveIncomingCalls(e,t){try{const i=await this.provider.provideIncomingCalls(e,t);if(eo(i))return i}catch(i){No(i)}return[]}async resolveOutgoingCalls(e,t){try{const i=await this.provider.provideOutgoingCalls(e,t);if(eo(i))return i}catch(i){No(i)}return[]}}const cz=new Map;_t.registerCommand("_executePrepareCallHierarchy",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i));let o=s.get(gi).getModel(t),r;if(!o){const c=await s.get(fn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await lie.create(o,i,He.None);return a?(cz.set(a.id,a),cz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),cz.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function Pnt(s){return!0}_t.registerCommand("_executeProvideIncomingCalls",async(s,...e)=>{const[t]=e;Tt(Pnt());const i=cz.get(t._sessionId);if(i)return i.resolveIncomingCalls(t,He.None)});_t.registerCommand("_executeProvideOutgoingCalls",async(s,...e)=>{const[t]=e;Tt(Pnt());const i=cz.get(t._sessionId);if(i)return i.resolveOutgoingCalls(t,He.None)});var oxe;(function(s){const e=[];function t(n){let o=n;return o&&e.push(o),{dispose(){if(o){const r=e.indexOf(o);r>=0&&(e.splice(r,1),o=void 0)}}}}s.register=t;function i(){return e.slice(0)}s.all=i})(oxe||(oxe={}));var rxe;(function(s){s[s.Idle=0]="Idle",s[s.Searching=1]="Searching",s[s.SlowSearch=2]="SlowSearch"})(rxe||(rxe={}));new Y("searchState",rxe.Idle);var Kze;(function(s){s.Subtypes="subtypes",s.Supertypes="supertypes"})(Kze||(Kze={}));const Fnt=new oo;class die{static async create(e,t,i){const[n]=Fnt.ordered(e);if(!n)return;const o=await n.prepareTypeHierarchy(e,t,i);if(o)return new die(o.roots.reduce((r,a)=>r+a._sessionId,""),n,o.roots,new N1e(o))}constructor(e,t,i,n){this.id=e,this.provider=t,this.roots=i,this.ref=n,this.root=i[0]}dispose(){this.ref.release()}fork(e){const t=this;return new class extends die{constructor(){super(t.id,t.provider,[e],t.ref.acquire())}}}async provideSupertypes(e,t){try{const i=await this.provider.provideSupertypes(e,t);if(eo(i))return i}catch(i){No(i)}return[]}async provideSubtypes(e,t){try{const i=await this.provider.provideSubtypes(e,t);if(eo(i))return i}catch(i){No(i)}return[]}}const lz=new Map;_t.registerCommand("_executePrepareTypeHierarchy",async(s,...e)=>{const[t,i]=e;Tt(N.isUri(t)),Tt(oe.isIPosition(i));let o=s.get(gi).getModel(t),r;if(!o){const c=await s.get(fn).createModelReference(t);o=c.object.textEditorModel,r=c}try{const a=await die.create(o,i,He.None);return a?(lz.set(a.id,a),lz.forEach((c,l,d)=>{d.size>10&&(c.dispose(),lz.delete(l))}),[a.root]):[]}finally{r?.dispose()}});function Ont(s){const e=s;return typeof s=="object"&&typeof e.name=="string"&&typeof e.kind=="number"&&N.isUri(e.uri)&&F.isIRange(e.range)&&F.isIRange(e.selectionRange)}_t.registerCommand("_executeProvideSupertypes",async(s,...e)=>{const[t]=e;Tt(Ont(t));const i=lz.get(t._sessionId);if(i)return i.provideSupertypes(t,He.None)});_t.registerCommand("_executeProvideSubtypes",async(s,...e)=>{const[t]=e;Tt(Ont(t));const i=lz.get(t._sessionId);if(i)return i.provideSubtypes(t,He.None)});var Eo;let qze=Eo=class extends V{constructor(e,t,i,n,o){if(super(),this._languageService=t,this._languageConfigurationService=i,this._languageFeaturesService=n,this._uriIdentService=o,this._registrations=this._register(new mo),this._pasteEditProviders=new Map,this._documentOnDropEditProviders=new Map,this._proxy=e.getProxy(Ye.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=>Eo._reviveLocationDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveLocationLinkDto(e){return e&&(Array.isArray(e)?(e.forEach(t=>Eo._reviveLocationLinkDto(t)),e):(e.uri=N.revive(e.uri),e))}static _reviveWorkspaceSymbolDto(e){return e&&(Array.isArray(e)?(e.forEach(Eo._reviveWorkspaceSymbolDto),e):(e.location=Eo._reviveLocationDto(e.location),e))}static _reviveCodeActionDto(e,t){return e?.forEach(i=>Py(i.edit,t)),e}static _reviveLinkDTO(e){return e.url&&typeof e.url!="string"&&(e.url=N.revive(e.url)),e}static _reviveCallHierarchyItemDto(e){return e&&(e.uri=N.revive(e.uri)),e}static _reviveTypeHierarchyItemDto(e){return e&&(e.uri=N.revive(e.uri)),e}$registerDocumentSymbolProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.documentSymbolProvider.register(t,{displayName:i,provideDocumentSymbols:(n,o)=>this._proxy.$provideDocumentSymbols(e,n.uri,o)}))}$registerCodeLensSupport(e,t,i){const n={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),n.onDidChange=o.event}this._registrations.set(e,this._languageFeaturesService.codeLensProvider.register(t,n))}$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,n,o)=>this._proxy.$provideDefinition(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerDeclarationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.declarationProvider.register(t,{provideDeclaration:(i,n,o)=>this._proxy.$provideDeclaration(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerImplementationSupport(e,t){this._registrations.set(e,this._languageFeaturesService.implementationProvider.register(t,{provideImplementation:(i,n,o)=>this._proxy.$provideImplementation(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerTypeDefinitionSupport(e,t){this._registrations.set(e,this._languageFeaturesService.typeDefinitionProvider.register(t,{provideTypeDefinition:(i,n,o)=>this._proxy.$provideTypeDefinition(e,i.uri,n,o).then(Eo._reviveLocationLinkDto)}))}$registerHoverProvider(e,t){this._registrations.set(e,this._languageFeaturesService.hoverProvider.register(t,{provideHover:async(i,n,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,n,a,o)}}))}$registerEvaluatableExpressionProvider(e,t){this._registrations.set(e,this._languageFeaturesService.evaluatableExpressionProvider.register(t,{provideEvaluatableExpression:(i,n,o)=>this._proxy.$provideEvaluatableExpression(e,i.uri,n,o)}))}$registerInlineValuesProvider(e,t,i){const n={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),n.onDidChangeInlineValues=o.event}this._registrations.set(e,this._languageFeaturesService.inlineValuesProvider.register(t,n))}$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,n,o)=>this._proxy.$provideDocumentHighlights(e,i.uri,n,o)}))}$registerMultiDocumentHighlightProvider(e,t){this._registrations.set(e,this._languageFeaturesService.multiDocumentHighlightProvider.register(t,{selector:t,provideMultiDocumentHighlights:(i,n,o,r)=>this._proxy.$provideMultiDocumentHighlights(e,i.uri,n,o.map(a=>a.uri),r).then(a=>{if(aU(a))return;const c=new ui;return a?.forEach(l=>{const d=N.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,n,o)=>{const r=await this._proxy.$provideLinkedEditingRanges(e,i.uri,n,o);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Eo._reviveRegExp(r.wordPattern):void 0}}}))}$registerReferenceSupport(e,t){this._registrations.set(e,this._languageFeaturesService.referenceProvider.register(t,{provideReferences:(i,n,o,r)=>this._proxy.$provideReferences(e,i.uri,n,o,r).then(Eo._reviveLocationDto)}))}$registerCodeActionSupport(e,t,i,n,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:Eo._reviveCodeActionDto(u.actions,this._uriIdentService),dispose:()=>{typeof u.cacheId=="number"&&this._proxy.$releaseCodeActions(e,u.cacheId)}}},providedCodeActionKinds:i.providedKinds,documentation:i.documentation,displayName:n,extensionId:o};r&&(a.resolveCodeAction=async(c,l)=>{const d=await this._proxy.$resolveCodeAction(e,c.cacheId,l);return d.edit&&(c.edit=Py(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 n=new axe(e,this._proxy,i,this._uriIdentService);this._pasteEditProviders.set(e,n),this._registrations.set(e,jr(this._languageFeaturesService.documentPasteEditProvider.register(t,n),Ee(()=>this._pasteEditProviders.delete(e))))}$resolvePasteFileData(e,t,i){const n=this._pasteEditProviders.get(e);if(!n)throw new Error("Could not find provider");return n.resolveFileData(t,i)}$registerDocumentFormattingSupport(e,t,i,n){this._registrations.set(e,this._languageFeaturesService.documentFormattingEditProvider.register(t,{extensionId:i,displayName:n,provideDocumentFormattingEdits:(o,r,a)=>this._proxy.$provideDocumentFormattingEdits(e,o.uri,r,a)}))}$registerRangeFormattingSupport(e,t,i,n,o){this._registrations.set(e,this._languageFeaturesService.documentRangeFormattingEditProvider.register(t,{extensionId:i,displayName:n,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,n){this._registrations.set(e,this._languageFeaturesService.onTypeFormattingEditProvider.register(t,{extensionId:n,autoFormatTriggerCharacters:i,provideOnTypeFormattingEdits:(o,r,a,c,l)=>this._proxy.$provideOnTypeFormattingEdits(e,o.uri,r,a,c,l)}))}$registerNavigateTypeSupport(e,t){let i;const n={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,Eo._reviveWorkspaceSymbolDto(a.symbols)}};t&&(n.resolveWorkspaceSymbol=async(o,r)=>{const a=await this._proxy.$resolveWorkspaceSymbol(e,o,r);return a&&Eo._reviveWorkspaceSymbolDto(a)}),this._registrations.set(e,oxe.register(n))}$registerRenameSupport(e,t,i){this._registrations.set(e,this._languageFeaturesService.renameProvider.register(t,{provideRenameEdits:(n,o,r,a)=>this._proxy.$provideRenameEdits(e,n.uri,o,r,a).then(c=>Py(c,this._uriIdentService)),resolveRenameLocation:i?(n,o,r)=>this._proxy.$resolveRenameLocation(e,n.uri,o,r):void 0}))}$registerNewSymbolNamesProvider(e,t){this._registrations.set(e,this._languageFeaturesService.newSymbolNamesProvider.register(t,{supportsAutomaticNewSymbolNamesTriggerKind:this._proxy.$supportsAutomaticNewSymbolNamesTriggerKind(e),provideNewSymbolNames:(i,n,o,r)=>this._proxy.$provideNewSymbolNames(e,i.uri,n,o,r)}))}$registerDocumentSemanticTokensProvider(e,t,i,n){let o;if(typeof n=="number"){const r=new I;this._registrations.set(n,r),o=r.event}this._registrations.set(e,this._languageFeaturesService.documentSemanticTokensProvider.register(t,new sQt(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 oQt(this._proxy,e,i)))}static _inflateSuggestDto(e,t,i){const n=t[Li.label],o=t[Li.commandId],r=t[Li.commandIdent],a=t[Li.commitCharacters];return{label:n,extensionId:i,kind:t[Li.kind]??Ne.Property,tags:t[Li.kindModifier],detail:t[Li.detail],documentation:t[Li.documentation],sortText:t[Li.sortText],filterText:t[Li.filterText],preselect:t[Li.preselect],insertText:t[Li.insertText]??(typeof n=="string"?n:n.label),range:t[Li.range]??e,insertTextRules:t[Li.insertTextRules],commitCharacters:a?Array.from(a):void 0,additionalTextEdits:t[Li.additionalTextEdits],command:o?{$ident:r,id:o,title:"",arguments:r?[r]:t[Li.commandArguments]}:void 0,_id:t.x}}$registerCompletionsProvider(e,t,i,n,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[yy.completions].map(u=>Eo._inflateSuggestDto(h[yy.defaultRanges],u,o)),incomplete:h[yy.isIncomplete]||!1,duration:h[yy.duration],dispose:()=>{typeof h.x=="number"&&this._proxy.$releaseCompletionItems(e,h.x)}}}};n&&(r.resolveCompletionItem=(a,c)=>this._proxy.$resolveCompletionItem(e,a._id,c).then(l=>{if(!l)return a;const d=Eo._inflateSuggestDto(a.range,l,o);return dp(a,d,!0)})),this._registrations.set(e,this._languageFeaturesService.completionProvider.register(t,r))}$registerInlineCompletionsSupport(e,t,i,n,o){const r={provideInlineCompletions:async(a,c,l,d)=>this._proxy.$provideInlineCompletions(e,a.uri,c,l,d),provideInlineEdits:async(a,c,l,d)=>this._proxy.$provideInlineEdits(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:n,yieldsToGroupIds:o,toString(){return`InlineCompletionsProvider(${n})`}};this._registrations.set(e,this._languageFeaturesService.inlineCompletionsProvider.register(t,r))}$registerInlineEditProvider(e,t,i){const n={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,n))}$registerSignatureHelpProvider(e,t,i){this._registrations.set(e,this._languageFeaturesService.signatureHelpProvider.register(t,{signatureHelpTriggerCharacters:i.triggerCharacters,signatureHelpRetriggerCharacters:i.retriggerCharacters,provideSignatureHelp:async(n,o,r,a)=>{const c=await this._proxy.$provideSignatureHelp(e,n.uri,o,a,r);if(c)return{value:c,dispose:()=>{this._proxy.$releaseSignatureHelp(e,c.id)}}}}))}$registerInlayHintsProvider(e,t,i,n,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:Mo(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 Ma;return d?{...a,tooltip:d.tooltip,label:Mo(d.label),textEdits:d.textEdits}:a}),typeof n=="number"){const a=new I;this._registrations.set(n,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 n={provideLinks:(o,r)=>this._proxy.$provideDocumentLinks(e,o.uri,r).then(a=>{if(a)return{links:a.links.map(Eo._reviveLinkDTO),dispose:()=>{typeof a.cacheId=="number"&&this._proxy.$releaseDocumentLinks(e,a.cacheId)}}})};i&&(n.resolveLink=(o,r)=>{const a=o;return a.cacheId?this._proxy.$resolveDocumentLink(e,a.cacheId,r).then(c=>c&&Eo._reviveLinkDTO(c)):o}),this._registrations.set(e,this._languageFeaturesService.linkProvider.register(t,n))}$registerDocumentColorProvider(e,t){const i=this._proxy;this._registrations.set(e,this._languageFeaturesService.colorProvider.register(t,{provideDocumentColors:(n,o)=>i.$provideDocumentColors(e,n.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:(n,o,r)=>i.$provideColorPresentations(e,n.uri,{color:[o.color.red,o.color.green,o.color.blue,o.color.alpha],range:o.range},r)}))}$registerFoldingRangeProvider(e,t,i,n){const o={id:i.value,provideFoldingRanges:(r,a,c)=>this._proxy.$provideFoldingRanges(e,r.uri,a,c)};if(typeof n=="number"){const r=new I;this._registrations.set(n,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,n,o)=>this._proxy.$provideSelectionRanges(e,i.uri,n,o)}))}$registerCallHierarchyProvider(e,t){this._registrations.set(e,Nnt.register(t,{prepareCallHierarchy:async(i,n,o)=>{const r=await this._proxy.$prepareCallHierarchy(e,i.uri,n,o);if(!(!r||r.length===0))return{dispose:()=>{for(const a of r)this._proxy.$releaseCallHierarchy(e,a._sessionId)},roots:r.map(Eo._reviveCallHierarchyItemDto)}},provideOutgoingCalls:async(i,n)=>{const o=await this._proxy.$provideCallHierarchyOutgoingCalls(e,i._sessionId,i._itemId,n);return o&&(o.forEach(r=>{r.to=Eo._reviveCallHierarchyItemDto(r.to)}),o)},provideIncomingCalls:async(i,n)=>{const o=await this._proxy.$provideCallHierarchyIncomingCalls(e,i._sessionId,i._itemId,n);return o&&(o.forEach(r=>{r.from=Eo._reviveCallHierarchyItemDto(r.from)}),o)}}))}static _reviveRegExp(e){return new RegExp(e.pattern,e.flags)}static _reviveIndentationRule(e){return{decreaseIndentPattern:Eo._reviveRegExp(e.decreaseIndentPattern),increaseIndentPattern:Eo._reviveRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Eo._reviveRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Eo._reviveRegExp(e.unIndentedLinePattern):void 0}}static _reviveOnEnterRule(e){return{beforeText:Eo._reviveRegExp(e.beforeText),afterText:e.afterText?Eo._reviveRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Eo._reviveRegExp(e.previousLineText):void 0,action:e.action}}static _reviveOnEnterRules(e){return e.map(Eo._reviveOnEnterRule)}$setLanguageConfiguration(e,t,i){const n={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Eo._reviveRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Eo._reviveIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Eo._reviveOnEnterRules(i.onEnterRules):void 0,autoClosingPairs:void 0,surroundingPairs:void 0,__electricCharacterSupport:void 0};i.autoClosingPairs?n.autoClosingPairs=i.autoClosingPairs:i.__characterPairSupport&&(n.autoClosingPairs=i.__characterPairSupport.autoClosingPairs),i.__electricCharacterSupport&&i.__electricCharacterSupport.docComment&&(n.__electricCharacterSupport={docComment:{open:i.__electricCharacterSupport.docComment.open,close:i.__electricCharacterSupport.docComment.close}}),this._languageService.isRegisteredLanguageId(t)&&this._registrations.set(e,this._languageConfigurationService.register(t,n,100))}$registerTypeHierarchyProvider(e,t){this._registrations.set(e,Fnt.register(t,{prepareTypeHierarchy:async(i,n,o)=>{const r=await this._proxy.$prepareTypeHierarchy(e,i.uri,n,o);if(r)return{dispose:()=>{for(const a of r)this._proxy.$releaseTypeHierarchy(e,a._sessionId)},roots:r.map(Eo._reviveTypeHierarchyItemDto)}},provideSupertypes:async(i,n)=>{const o=await this._proxy.$provideTypeHierarchySupertypes(e,i._sessionId,i._itemId,n);return o&&o.map(Eo._reviveTypeHierarchyItemDto)},provideSubtypes:async(i,n)=>{const o=await this._proxy.$provideTypeHierarchySubtypes(e,i._sessionId,i._itemId,n);return o&&o.map(Eo._reviveTypeHierarchyItemDto)}}))}$registerDocumentOnDropEditProvider(e,t,i){const n=new cxe(e,this._proxy,i,this._uriIdentService);this._documentOnDropEditProviders.set(e,n),this._registrations.set(e,jr(this._languageFeaturesService.documentDropEditProvider.register(t,n),Ee(()=>this._documentOnDropEditProviders.delete(e))))}async $resolveDocumentOnDropFileData(e,t,i){const n=this._documentOnDropEditProviders.get(e);if(!n)throw new Error("Could not find provider");return n.resolveDocumentOnDropFileData(t,i)}$registerMappedEditsProvider(e,t,i){const n=new rQt(i,e,this._proxy,this._uriIdentService);this._registrations.set(e,this._languageFeaturesService.mappedEditsProvider.register(t,n))}};qze=Eo=D([Gi(Be.MainThreadLanguageFeatures),_(1,xi),_(2,Vs),_(3,it),_(4,ks)],qze);let axe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new tPe,this.copyMimeTypes=i.copyMimeTypes,this.pasteMimeTypes=i.pasteMimeTypes,this.providedPasteEditKinds=i.providedPasteEditKinds?.map(o=>new Yn(o)),i.supportsCopy&&(this.prepareDocumentPaste=async(o,r,a,c)=>{const l=await P_.from(a);if(c.isCancellationRequested)return;const d=await this._proxy.$prepareDocumentPaste(e,o.uri,r,l,c);if(!d)return;const h=new oce;for(const[u,f]of d.items)h.replace(u,z6(f.asString));return h}),i.supportsPaste&&(this.provideDocumentPasteEdits=async(o,r,a,c,l)=>{const d=this.dataTransfers.add(a);try{const h=await P_.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 Yn(f.kind.value):new Yn(""),yieldTo:f.yieldTo?.map(p=>({kind:new Yn(p)})),additionalEdit:f.additionalEdit?Py(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=Py(a.additionalEdit,this._uriIdentService)),o})}resolveFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};axe=D([_(3,ks)],axe);let cxe=class{constructor(e,t,i,n){this._handle=e,this._proxy=t,this._uriIdentService=n,this.dataTransfers=new tPe,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=Py(a.additionalEdit,this._uriIdentService)),o})}async provideDocumentDropEdits(e,t,i,n){const o=this.dataTransfers.add(i);try{const r=await P_.from(i);if(n.isCancellationRequested)return;const a=await this._proxy.$provideDocumentOnDropEdits(this._handle,o.id,e.uri,t,r,n);return a?{edits:a.map(c=>({...c,yieldTo:c.yieldTo?.map(l=>({kind:new Yn(l)})),kind:c.kind?new Yn(c.kind):void 0,additionalEdit:Py(c.additionalEdit,this._uriIdentService,l=>this.resolveDocumentOnDropFileData(o.id,l))})),dispose:()=>{this._proxy.$releaseDocumentOnDropEdits(this._handle,o.id)}}:void 0}finally{o.dispose()}}resolveDocumentOnDropFileData(e,t){return this.dataTransfers.resolveFileData(e,t)}};cxe=D([_(3,ks)],cxe);class sQt{constructor(e,t,i,n){this._proxy=e,this._handle=t,this._legend=i,this.onDidChange=n}releaseDocumentSemanticTokens(e){e&&this._proxy.$releaseDocumentSemanticTokens(this._handle,parseInt(e,10))}getLegend(){return this._legend}async provideDocumentSemanticTokens(e,t,i){const n=t?parseInt(t,10):0,o=await this._proxy.$provideDocumentSemanticTokens(this._handle,e.uri,n,i);if(!o||i.isCancellationRequested)return null;const r=eZ(o);return r.type==="full"?{resultId:String(r.id),data:r.data}:{resultId:String(r.id),edits:r.deltas}}}class oQt{constructor(e,t,i){this._proxy=e,this._handle=t,this._legend=i}getLegend(){return this._legend}async provideDocumentRangeSemanticTokens(e,t,i){const n=await this._proxy.$provideDocumentRangeSemanticTokens(this._handle,e.uri,t,i);if(!n||i.isCancellationRequested)return null;const o=eZ(n);if(o.type==="full")return{resultId:String(o.id),data:o.data};throw new Error("Unexpected")}}class rQt{constructor(e,t,i,n){this.displayName=e,this._handle=t,this._proxy=i,this._uriService=n}async provideMappedEdits(e,t,i,n){const o=await this._proxy.$provideMappedEdits(this._handle,e.uri,t,i,n);return o?Py(o,this._uriService):null}}let Qze=class{constructor(e,t,i,n,o){this._languageService=t,this._modelService=i,this._resolverService=n,this._languageStatusService=o,this._disposables=new Z,this._status=new mo,this._proxy=e.getProxy(Ye.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=N.revive(e),n=await this._resolverService.createModelReference(i);try{n.object.textEditorModel.setLanguage(this._languageService.createById(t))}finally{n.dispose()}}async $tokensAtPosition(e,t){const i=N.revive(e),n=this._modelService.getModel(i);if(!n)return;n.tokenization.tokenizeIfCheap(t.lineNumber);const o=n.tokenization.getLineTokens(t.lineNumber),r=o.findTokenIndexAtOffset(t.column-1);return{type:o.getStandardTokenType(r),range:new F(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()}};Qze=D([Gi(Be.MainThreadLanguages),_(1,xi),_(2,gi),_(3,fn),_(4,Kae)],Qze);let jze=class{constructor(e,t){this.loggerService=t,this.disposables=new Z;const i=e.getProxy(Ye.ExtHostLogLevelServiceShape);this.disposables.add(t.onDidChangeLogLevel(n=>{cQe(n)?i.$setLogLevel(n):i.$setLogLevel(n[1],n[0])}))}$log(e,t){const i=this.loggerService.getLogger(N.revive(e));if(!i)throw new Error("Create the logger before logging");for(const[n,o]of t)IY(i,n,o)}async $createLogger(e,t){this.loggerService.createLogger(N.revive(e),t)}async $registerLogger(e){this.loggerService.registerLogger({...e,resource:N.revive(e.resource)})}async $deregisterLogger(e){this.loggerService.deregisterLogger(N.revive(e))}async $setVisibility(e,t){this.loggerService.setVisibility(N.revive(e),t)}$flush(e){const t=this.loggerService.getLogger(N.revive(e));if(!t)throw new Error("Create the logger before flushing");t.flush()}dispose(){this.disposables.dispose()}};jze=D([Gi(Be.MainThreadLogger),_(1,lf)],jze);_t.registerCommand("_extensionTests.setLogLevel",function(s,e){const t=s.get(lf),i=s.get(Za);if(i.isExtensionDevelopment&&i.extensionTestsLocationURI){const n=hQe(e);n!==void 0&&t.setLogLevel(n)}});_t.registerCommand("_extensionTests.getLogLevel",function(s){const e=s.get(Ge);return n3(e.getLevel())});let Yze=class{constructor(e,t,i,n,o){this._notificationService=t,this._commandService=i,this._dialogService=n,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,n){return i.modal?this._showModalMessage(e,t,i.detail,n,i.useCustom):this._showMessage(e,t,n,i)}_showMessage(e,t,i,n){return new Promise(o=>{const r=i.map(d=>ol({id:`_extension_message_handle_${d.handle}`,label:d.title,enabled:!0,run:()=>(o(d.handle),Promise.resolve())}));let a;n.source&&(a={label:n.source.label,id:n.source.identifier.value}),a||(a=g(4859,"Extension"));const c=[];n.source&&c.push(ol({id:n.source.identifier.value,label:g(4860,"Manage Extension"),run:()=>this._commandService.executeCommand("_extensions.manage",n.source.identifier.value)}));const l=this._notificationService.notify({severity:e,message:t,actions:{primary:r,secondary:c},source:a});M.once(l.onDidClose)(()=>{o(void 0)})})}async _showModalMessage(e,t,i,n,o){const r=[];let a;for(const l of n){const d={label:l.title,run:()=>l.handle};l.isCloseAffordance?a=d:r.push(d)}a||(r.length>0?a={label:g(4861,"Cancel"),run:()=>{}}:a={label:g(4862,"&&OK"),run:()=>{}});const{result:c}=await this._dialogService.prompt({type:e,message:t,detail:i,buttons:r,cancelButton:a,custom:o});return c}};Yze=D([Gi(Be.MainThreadMessageService),_(1,bi),_(2,vi),_(3,to),_(4,fs)],Yze);const aQt=(s,e,t)=>{const i=new Uint8Array(16);for(let r=0;r<16;r++)i[r]=Math.round(Math.random()*256);const n=sTe($e.wrap(i));return[`GET ws://localhost${s}?${e}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${n}`].join(`\r `)+`\r \r -`},l8e=$e.fromString(`\r +`},Jze=$e.fromString(`\r \r -`);async function bQt(s,e,t,i,n){s.write($e.fromString(vQt(e,t)));const o=new Z;try{return await new Promise((r,a)=>{let c;o.add(s.onData(l=>{c?c=$e.concat([c,l],c.byteLength+l.byteLength):c=l;const d=c.indexOf(l8e);if(d===-1)return;r(s),s.pauseData();const h=c.slice(d+l8e.byteLength);h.byteLength&&n.onData.fire(h)})),o.add(s.onClose(l=>a(l??new Error("socket closed")))),o.add(s.onEnd(()=>a(new Error("socket ended"))))})}catch(r){throw s.dispose(),r}finally{o.dispose()}}let wQt=class extends V{constructor(e,t){super(),this.debugLabel=e,this.pausableDataEmitter=this._register(new kk),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){AAe.traceSocketEvent(this,this.debugLabel,e,t)}dispose(){this.ended||this.closeRemote(),this.didDisposeEmitter.fire(),super.dispose()}},d8e=class extends V{constructor(e,t){super(),this._remoteSocketFactoryService=t,this._registrations=new Map,this._remoteSockets=new Map,this._proxy=e.getProxy(Ye.ExtHostManagedSockets)}async $registerSocketFactory(e){const t=this,i=new class{supports(n){return n.id===e}connect(n,o,r,a){return new Promise((c,l)=>{if(n.id!==e)return l(new Error("Invalid connectTo"));const d=n.id;t._proxy.$openRemoteSocket(d).then(h=>{const u={onClose:new I,onData:new I,onEnd:new I};t._remoteSockets.set(h,u),fPe.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(qW.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:Aee.NodeSocketCloseEvent,error:t?new Error(t):void 0,hadError:!!t}),this._remoteSockets.delete(e)}$onDidManagedSocketEnd(e){this._remoteSockets.get(e)?.onEnd.fire()}};d8e=D([Gi(Be.MainThreadManagedSockets),_(1,URe)],d8e);class fPe extends wQt{static connect(e,t,i,n,o,r){const a=new fPe(e,t,o,r);return bQt(a,i,n,o,r)}constructor(e,t,i,n){super(i,n),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 FK="workbench.panel.output";new Q("inOutput",!1);new Q("activeLogOutput",!1);new Q("activeLogOutput.levelSettable",!1);new Q("activeLogOutput.level","");new Q("activeLogOutput.levelIsDefault",!1);new Q("outputView.scrollLock",!1);var lB;(function(s){s[s.Append=1]="Append",s[s.Replace=2]="Replace",s[s.Clear=3]="Clear"})(lB||(lB={}));const Knt={OutputChannels:"workbench.contributions.outputChannels"};class yQt{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)}}Qe.add(Knt.OutputChannels,new yQt);new Q("activeOutputChannel","");var aj,XR;let h8e=(XR=class extends V{constructor(e,t,i){super(),this._outputService=t,this._viewsService=i,this._proxy=e.getProxy(Ye.ExtHostOutputService);const n=()=>{const o=this._viewsService.isViewVisible(FK)?this._outputService.getActiveChannel():void 0;this._proxy.$setVisibleChannel(o?o.id:null)};this._register(M.any(this._outputService.onActiveOutputChannel,M.filter(this._viewsService.onDidChangeViewVisibility,({id:o})=>o===FK))(()=>n())),n()}async $register(e,t,i,n){const o=(aj._extensionIdPool.get(n)||0)+1;aj._extensionIdPool.set(n,o);const r=`extension-output-${n}-#${o}-${e}`,a=N.revive(t);return Qe.as(Knt.OutputChannels).registerChannel({id:r,label:e,file:a,log:!1,languageId:i,extensionId:n}),this._register(Ee(()=>this.$dispose(r))),r}async $update(e,t,i){const n=this._getChannel(e);n&&(t===lB.Append?n.update(t):lc(i)&&n.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(FK)){const t=this._outputService.getActiveChannel();t&&e===t.id&&this._viewsService.closeView(FK)}}async $dispose(e){this._getChannel(e)?.dispose()}_getChannel(e){return this._outputService.getChannel(e)}},aj=XR,XR._extensionIdPool=new Map,XR);h8e=aj=D([Gi(Be.MainThreadOutputService),_(1,Jae),_(2,Lm)],h8e);class CQt extends rn{constructor(e,t,i){super(e,t,void 0,!0,()=>i.executeCommand("_extensions.manage",e))}}let u8e=class{constructor(e,t,i){this._commandService=i,this._progress=new Map,this._proxy=e.getProxy(Ye.ExtHostProgress),this._progressService=t}dispose(){this._progress.forEach(e=>e.resolve()),this._progress.clear()}async $startProgress(e,t,i){const n=this._createTask(e);t.location===ud.Notification&&i&&(t={...t,location:ud.Notification,secondaryActions:[new CQt(i,g(4863,"Manage Extension"),this._commandService)]}),this._progressService.withProgress(t,n,()=>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})})}};u8e=D([Gi(Be.MainThreadProgress),_(1,cg),_(2,vi)],u8e);let g8e=class{constructor(e,t){this.quickDiffService=t,this.providerDisposables=new mo,this.proxy=e.getProxy(Ye.ExtHostQuickDiff)}async $registerQuickDiffProvider(e,t,i,n){const o={label:i,rootUri:N.revive(n),selector:t,isSCM:!1,getOriginalResource:async a=>N.revive(await this.proxy.$provideOriginalResource(e,a,He.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()}};g8e=D([Gi(Be.MainThreadQuickDiff),_(1,M6)],g8e);function f8e(s){s.dark=N.revive(s.dark),s.light&&(s.light=N.revive(s.light))}let p8e=class{constructor(e,t){this._items={},this.sessions=new Map,this._proxy=e.getProxy(Ye.ExtHostQuickOpen),this._quickInputService=t}dispose(){}$show(e,t,i){const n=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(n,t,i).then(o=>{if(o)return o.map(r=>r.handle)}):this._quickInputService.pick(n,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 n=Object.create(null);return e&&(n.title=e.title,n.password=e.password,n.placeHolder=e.placeHolder,n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.value=e.value,n.ignoreFocusLost=e.ignoreFocusOut),t&&(n.validateInput=o=>this._proxy.$validateInput(o)),this._quickInputService.input(n,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:n,handlesToItems:o}=i;for(const r in e)r==="id"||r==="type"||(r==="visible"?e.visible?n.show():n.hide():r==="items"?(o.clear(),e[r].forEach(a=>{a.type!=="separator"&&(a.buttons&&(a.buttons=a.buttons.map(c=>(c.iconPath&&f8e(c.iconPath),c))),o.set(a.handle,a))}),n[r]=e[r]):r==="activeItems"||r==="selectedItems"?n[r]=e[r].filter(a=>o.has(a)).map(a=>o.get(a)):r==="buttons"?n[r]=e.buttons.map(a=>a.handle===-1?this._quickInputService.backButton:(a.iconPath&&f8e(a.iconPath),a)):n[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)}};p8e=D([Gi(Be.MainThreadQuickOpen),_(1,In)],p8e);let m8e=class extends V{constructor(e,t,i){super(),this._environmentService=t,this._proxy=e.getProxy(Ye.ExtHostExtensionService);const n=this._environmentService.remoteAuthority;n&&this._register(i.onDidChangeConnectionData(()=>{const o=i.getConnectionData(n);o&&this._proxy.$updateRemoteConnectionData(o)}))}};m8e=D([QN,_(1,Jr),_(2,pC)],m8e);class SQt{constructor(e){this._proxy=e.getProxy(Ye.ExtHostDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.textEditorModel||!Ly(e.textEditorModel))return;const o=new Promise((r,a)=>{setTimeout(()=>a(new Error(g(4864,"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 Mre(o,n)}}let _8e=class{constructor(e,t,i){this._textFileService=i,this._saveParticipantDisposable=this._textFileService.files.addSaveParticipant(t.createInstance(SQt,e))}dispose(){this._saveParticipantDisposable.dispose()}};_8e=D([QN,_(1,we),_(2,Fo)],_8e);let v8e=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(Ye.ExtHostSpeech)}$registerProvider(e,t,i){this.logService.trace("[Speech] extension registered provider",i.extension.value);const n=this.speechService.registerSpeechProvider(t,{metadata:i,createSpeechToTextSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:M.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:M.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 U_(M.toPromise(M.filter(l.event,h=>h.status===Yve.Stopped)),o)}}},createKeywordRecognitionSession:o=>{if(o.isCancellationRequested)return{onDidChange:M.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:()=>{n.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()}};v8e=D([Gi(Be.MainThreadSpeech),_(1,Kae),_(2,Ge)],v8e);class AQt{constructor(e){this.timeout=1e4,this._proxy=e.getProxy(Ye.ExtHostWorkspace)}async participate(e,t){const i=new Promise((n,o)=>{setTimeout(()=>o(new Error(g(4865,"Aborted onWillCreateEditSessionIdentity-event after 10000ms"))),this.timeout),this._proxy.$onWillCreateEditSessionIdentity(e.uri,t,this.timeout).then(n,o)});return Mre(i,t)}}let b8e=class{constructor(e,t,i){this._editSessionIdentityService=i,this._saveParticipantDisposable=this._editSessionIdentityService.addEditSessionIdentityCreateParticipant(t.createInstance(AQt,e))}dispose(){this._saveParticipantDisposable.dispose()}};b8e=D([QN,_(1,we),_(2,$Re)],b8e);let gz=class{get childrenCount(){return this._children.size}get children(){return this._children.values()}get name(){return Vi.basename(this.relativePath)}constructor(e,t,i,n=void 0,o=void 0){this.uri=e,this.relativePath=t,this.context=i,this.element=n,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()}};gz.__decorator=D([Zt],gz.prototype,"name",null);function qnt(s,e){typeof s.element<"u"&&e.push(s.element);for(const t of s.children)qnt(t,e);return e}class EQt{static getRoot(e){for(;e.parent;)e=e.parent;return e}static collect(e){return qnt(e,[])}static isResourceNode(e){return e instanceof gz}constructor(e,t=N.file("/"),i=xn){this.extUri=i,this.root=new gz(t,"",e)}add(e,t){const i=this.extUri.relativePath(this.root.uri,e)||e.path,n=new y5(!1).reset(i);let o=this.root,r="";for(;;){const a=n.value();r=r+"/"+a;let c=o.get(a);if(c?n.hasNext()||(c.element=t):(c=new gz(this.extUri.joinPath(this.root.uri,r),r,this.root.context,n.hasNext()?void 0:t,o),o.set(a,c)),o=c,!n.hasNext())return;n.next()}}delete(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new y5(!1).reset(t);return this._delete(this.root,i)}_delete(e,t){const i=t.value(),n=e.get(i);if(n){if(t.hasNext()){const o=this._delete(n,t.next());return typeof o<"u"&&n.childrenCount===0&&e.delete(i),o}return e.delete(i),n.element}}clear(){this.root.clear()}getNode(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new y5(!1).reset(t);let n=this.root;for(;;){const o=i.value(),r=n.get(o);if(!r||!i.hasNext())return r;n=r,i.next()}}}function w8e(s){if(s!==void 0){if(N.isUri(s))return N.revive(s);if(We.isThemeIcon(s))return s;{const e=s;return{light:N.revive(e.light),dark:N.revive(e.dark)}}}}function Nue(s){const e=w8e(s.icon),t=s.labels?.map(i=>({title:i.title,icon:w8e(i.icon)}));return{...s,icon:e,labels:t}}class xQt extends V{constructor(e,t,i){super(),this.modelService=t,this.languageService=i,this._register(e.registerTextModelContentProvider(pe.vscodeSourceControl,this))}async provideTextContent(e){const t=this.modelService.getModel(e);return t||this.modelService.createModel("",this.languageService.createById("scminput"),e)}}class DQt{get resourceTree(){if(!this._resourceTree){const e=this.provider.rootUri??N.file("/");this._resourceTree=new EQt(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,n,o,r,a,c){this.sourceControlHandle=e,this.handle=t,this.provider=i,this.features=n,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:ws.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 kQt{constructor(e,t,i,n,o,r,a,c,l,d,h){this.proxy=e,this.sourceControlHandle=t,this.groupHandle=i,this.handle=n,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:ws.ScmResource,sourceControlHandle:this.sourceControlHandle,groupHandle:this.groupHandle,handle:this.handle}}}class IQt{get currentHistoryItemGroup(){return this._currentHistoryItemGroup}constructor(e,t){this.proxy=e,this.handle=t,this.currentHistoryItemGroupId=Ze(this,i=>this.currentHistoryItemGroup.read(i)?.id),this.currentHistoryItemGroupName=Ze(this,i=>this.currentHistoryItemGroup.read(i)?.name),this._currentHistoryItemGroup=fJ({owner:this,equalsFn:()=>!1},void 0)}async resolveHistoryItemGroupCommonAncestor(e,t){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,e,t,He.None)}async resolveHistoryItemGroupCommonAncestor2(e){return this.proxy.$resolveHistoryItemGroupCommonAncestor2(this.handle,e,He.None)}async provideHistoryItems(e,t){return(await this.proxy.$provideHistoryItems(this.handle,e,t,He.None))?.map(n=>Nue(n))}async provideHistoryItems2(e){return(await this.proxy.$provideHistoryItems2(this.handle,e,He.None))?.map(i=>Nue(i))}async provideHistoryItemSummary(e,t){const i=await this.proxy.$provideHistoryItemSummary(this.handle,e,t,He.None);return i?Nue(i):void 0}async provideHistoryItemChanges(e,t){return(await this.proxy.$provideHistoryItemChanges(this.handle,e,t,He.None))?.map(n=>({uri:N.revive(n.uri),originalUri:n.originalUri&&N.revive(n.originalUri),modifiedUri:n.modifiedUri&&N.revive(n.modifiedUri),renameUri:n.renameUri&&N.revive(n.renameUri)}))}$onDidChangeCurrentHistoryItemGroup(e){this._currentHistoryItemGroup.set(e,void 0)}}const qoe=class qoe{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 acceptInputCommand(){return this.features.acceptInputCommand}get actionButton(){return this.features.actionButton??void 0}get count(){return this._count}get statusBarCommands(){return this._statusBarCommands}get name(){return this._name??this._label}get commitTemplate(){return this._commitTemplate}get historyProvider(){return this._historyProvider}constructor(e,t,i,n,o,r,a,c,l){if(this.proxy=e,this._handle=t,this._providerId=i,this._label=n,this._rootUri=o,this._inputBoxTextModel=r,this._quickDiffService=a,this._uriIdentService=c,this._workspaceContextService=l,this._id=`scm${qoe.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._count=jt(this,void 0),this._statusBarCommands=jt(this,void 0),this._commitTemplate=jt(this,""),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.isSCM=!0,this._historyProvider=jt(this,void 0),o){const d=this._workspaceContextService.getWorkspaceFolder(o);d?.uri.toString()===o.toString()?this._name=d.name:o.path!=="/"&&(this._name=_i(o))}}$updateSourceControl(e){if(this.features={...this.features,...e},this._onDidChange.fire(),typeof e.commitTemplate<"u"&&this._commitTemplate.set(e.commitTemplate,void 0),typeof e.count<"u"&&this._count.set(e.count,void 0),typeof e.statusBarCommands<"u"&&this._statusBarCommands.set(e.statusBarCommands,void 0),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.get()){const t=new IQt(this.proxy,this.handle);this._historyProvider.set(t,void 0)}else e.hasHistoryProvider===!1&&this.historyProvider.get()&&this._historyProvider.set(void 0,void 0)}$registerGroups(e){const t=e.map(([i,n,o,r,a])=>{const c=new DQt(this.handle,i,this,r,o,n,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 n=this._groupsByHandle[t];if(!n){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,b,w,y]=l,[C,A]=u,L=We.isThemeIcon(C)?C:N.revive(C),k=(We.isThemeIcon(A)?A:N.revive(A))||L,P={icon:L,iconDark:k,tooltip:f,strikeThrough:p,faded:m};return new kQt(this.proxy,this.handle,t,d,N.revive(h),n,P,v||void 0,b,N.revive(w),N.revive(y))});n.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,He.None);return t&&N.revive(t)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e){this.historyProvider.get()&&this._historyProvider.get()?.$onDidChangeCurrentHistoryItemGroup(e)}toJSON(){return{$mid:ws.ScmProvider,handle:this.handle}}dispose(){this._quickDiff?.dispose()}};qoe.ID_HANDLE=0;let pxe=qoe,y8e=class{constructor(e,t,i,n,o,r,a,c,l){this.scmService=t,this.scmViewService=i,this.languageService=n,this.modelService=o,this.textModelService=r,this.quickDiffService=a,this._uriIdentService=c,this.workspaceContextService=l,this._repositories=new Map,this._repositoryBarriers=new Map,this._repositoryDisposables=new Map,this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostSCM),this._disposables.add(new xQt(this.textModelService,this.modelService,this.languageService))}dispose(){bt(this._repositories.values()),this._repositories.clear(),bt(this._repositoryDisposables.values()),this._repositoryDisposables.clear(),this._disposables.dispose()}async $registerSourceControl(e,t,i,n,o){this._repositoryBarriers.set(e,new qd);const r=await this.textModelService.createModelReference(N.revive(o)),a=new pxe(this._proxy,e,t,i,n?N.revive(n):void 0,r.object.textEditorModel,this.quickDiffService,this._uriIdentService,this.workspaceContextService),c=this.scmService.registerSCMProvider(a);this._repositories.set(e,c);const l=jr(r,M.filter(this.scmViewService.onDidFocusRepository,d=>d===c)(d=>this._proxy.$setSelectedSourceControl(e)),c.input.onDidChange(({value:d})=>this._proxy.$onInputBoxValueChange(e,d)));this._repositoryDisposables.set(e,l),this.scmViewService.focusedRepository===c&&setTimeout(()=>this._proxy.$setSelectedSourceControl(e),0),c.input.value&&setTimeout(()=>this._proxy.$onInputBoxValueChange(e,c.input.value),0),this._repositoryBarriers.get(e)?.open()}async $updateSourceControl(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$updateSourceControl(t)}async $unregisterSourceControl(e){await this._repositoryBarriers.get(e)?.wait();const t=this._repositories.get(e);t&&(this._repositoryDisposables.get(e).dispose(),this._repositoryDisposables.delete(e),t.dispose(),this._repositories.delete(e))}async $registerGroups(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;const o=n.provider;o.$registerGroups(t),o.$spliceGroupResourceStates(i)}async $updateGroup(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;n.provider.$updateGroup(t,i)}async $updateGroupLabel(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;n.provider.$updateGroupLabel(t,i)}async $spliceResourceStates(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$spliceGroupResourceStates(t)}async $unregisterGroup(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$unregisterGroup(t)}async $setInputBoxValue(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&i.input.setValue(t,!1)}async $setInputBoxPlaceholder(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.placeholder=t)}async $setInputBoxEnablement(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.enabled=t)}async $setInputBoxVisibility(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.visible=t)}async $showValidationMessage(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);n&&n.input.showValidationMessage(t,i)}async $setValidationProviderIsEnabled(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(t?i.input.validateInput=async(n,o)=>{const r=await this._proxy.$validateInput(e,n,o);return r&&{message:r[0],type:r[1]}}:i.input.validateInput=async()=>{})}async $onDidChangeHistoryProviderCurrentHistoryItemGroup(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(t)}};y8e=D([Gi(Be.MainThreadSCM),_(1,tMe),_(2,WJe),_(3,xi),_(4,gi),_(5,fn),_(6,M6),_(7,ks),_(8,yi)],y8e);var C8e;(function(s){s.FindInFilesActionId="workbench.action.findInFiles",s.FocusActiveEditorCommandId="search.action.focusActiveEditor",s.FocusSearchFromResults="search.action.focusSearchFromResults",s.OpenMatch="search.action.openResult",s.OpenMatchToSide="search.action.openResultToSide",s.RemoveActionId="search.action.remove",s.CopyPathCommandId="search.action.copyPath",s.CopyMatchCommandId="search.action.copyMatch",s.CopyAllCommandId="search.action.copyAll",s.OpenInEditorCommandId="search.action.openInEditor",s.ClearSearchHistoryCommandId="search.action.clearHistory",s.FocusSearchListCommandID="search.action.focusSearchList",s.ReplaceActionId="search.action.replace",s.ReplaceAllInFileActionId="search.action.replaceAllInFile",s.ReplaceAllInFolderActionId="search.action.replaceAllInFolder",s.CloseReplaceWidgetActionId="closeReplaceInFilesWidget",s.ToggleCaseSensitiveCommandId="toggleSearchCaseSensitive",s.ToggleWholeWordCommandId="toggleSearchWholeWord",s.ToggleRegexCommandId="toggleSearchRegex",s.TogglePreserveCaseId="toggleSearchPreserveCase",s.AddCursorsAtSearchResults="addCursorsAtSearchResults",s.RevealInSideBarForSearchResults="search.action.revealInSideBar",s.ReplaceInFilesActionId="workbench.action.replaceInFiles",s.ShowAllSymbolsActionId="workbench.action.showAllSymbols",s.QuickTextSearchActionId="workbench.action.quickTextSearch",s.CancelSearchActionId="search.action.cancel",s.RefreshSearchResultsActionId="search.action.refreshSearchResults",s.FocusNextSearchResultActionId="search.action.focusNextSearchResult",s.FocusPreviousSearchResultActionId="search.action.focusPreviousSearchResult",s.ToggleSearchOnTypeActionId="workbench.action.toggleSearchOnType",s.CollapseSearchResultsActionId="search.action.collapseSearchResults",s.ExpandSearchResultsActionId="search.action.expandSearchResults",s.ExpandRecursivelyCommandId="search.action.expandRecursively",s.ClearSearchResultsActionId="search.action.clearSearchResults",s.ViewAsTreeActionId="search.action.viewAsTree",s.ViewAsListActionId="search.action.viewAsList",s.ShowAIResultsActionId="search.action.showAIResults",s.HideAIResultsActionId="search.action.hideAIResults",s.ToggleQueryDetailsActionId="workbench.action.search.toggleQueryDetails",s.ExcludeFolderFromSearchId="search.action.excludeFromSearch",s.FocusNextInputActionId="search.focus.nextInputBox",s.FocusPreviousInputActionId="search.focus.previousInputBox",s.RestrictSearchToFolderId="search.action.restrictSearchToFolder",s.FindInFolderId="filesExplorer.findInFolder",s.FindInWorkspaceId="filesExplorer.findInWorkspace"})(C8e||(C8e={}));const TQt={SearchViewVisibleKey:new Q("searchViewletVisible",!0),SearchViewFocusedKey:new Q("searchViewletFocus",!1),InputBoxFocusedKey:new Q("inputBoxFocus",!1),SearchInputBoxFocusedKey:new Q("searchInputBoxFocus",!1),ReplaceInputBoxFocusedKey:new Q("replaceInputBoxFocus",!1),PatternIncludesFocusedKey:new Q("patternIncludesInputBoxFocus",!1),PatternExcludesFocusedKey:new Q("patternExcludesInputBoxFocus",!1),ReplaceActiveKey:new Q("replaceActive",!1),HasSearchResults:new Q("hasSearchResult",!1),FirstMatchFocusKey:new Q("firstMatchFocus",!1),FileMatchOrMatchFocusKey:new Q("fileMatchOrMatchFocus",!1),FileMatchOrFolderMatchFocusKey:new Q("fileMatchOrFolderMatchFocus",!1),FileMatchOrFolderMatchWithResourceFocusKey:new Q("fileMatchOrFolderMatchWithResourceFocus",!1),FileFocusKey:new Q("fileMatchFocus",!1),FolderFocusKey:new Q("folderMatchFocus",!1),ResourceFolderFocusKey:new Q("folderMatchWithResourceFocus",!1),IsEditableItemKey:new Q("isEditableItem",!0),MatchFocusKey:new Q("matchFocus",!1),ViewHasSearchPatternKey:new Q("viewHasSearchPattern",!1),ViewHasReplacePatternKey:new Q("viewHasReplacePattern",!1),ViewHasFilePatternKey:new Q("viewHasFilePattern",!1),ViewHasSomeCollapsibleKey:new Q("viewHasSomeCollapsibleResult",!1),InTreeViewKey:new Q("inTreeView",!1),AIResultsVisibleKey:new Q("AIResultsVisibleKey",!1),hasAIResultProvider:new Q("hasAIResultProviderKey",!1)};let S8e=class{constructor(e,t,i,n,o){this._searchService=t,this._telemetryService=i,this.contextKeyService=o,this._searchProvider=new Map,this._proxy=e.getProxy(Ye.ExtHostSearch),this._proxy.$enableExtensionHostSearch()}dispose(){this._searchProvider.forEach(e=>e.dispose()),this._searchProvider.clear()}$registerTextSearchProvider(e,t){this._searchProvider.set(e,new Pue(this._searchService,Z5.text,t,e,this._proxy))}$registerAITextSearchProvider(e,t){TQt.hasAIResultProvider.bindTo(this.contextKeyService).set(!0),this._searchProvider.set(e,new Pue(this._searchService,Z5.aiText,t,e,this._proxy))}$registerFileSearchProvider(e,t){this._searchProvider.set(e,new Pue(this._searchService,Z5.file,t,e,this._proxy))}$unregisterProvider(e){bt(this._searchProvider.get(e)),this._searchProvider.delete(e)}$handleFileMatch(e,t,i){const n=this._searchProvider.get(e);if(!n)throw new Error("Got result for unknown provider");n.handleFindMatch(t,i)}$handleTextMatch(e,t,i){const n=this._searchProvider.get(e);if(!n)throw new Error("Got result for unknown provider");n.handleFindMatch(t,i)}$handleTelemetry(e,t){this._telemetryService.publicLog(e,t)}};S8e=D([Gi(Be.MainThreadSearch),_(1,Zae),_(2,Yi),_(3,Te),_(4,Le)],S8e);const Qoe=class Qoe{constructor(e,t=++Qoe._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)}};Qoe._idPool=0;let mxe=Qoe;class Pue{constructor(e,t,i,n,o){this._scheme=i,this._handle=n,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=He.None){return this.doSearch(e,void 0,t)}textSearch(e,t,i=He.None){return this.doSearch(e,t,i)}doSearch(e,t,i=He.None){if(!e.folderQueries.length)throw new Error("Empty folderQueries");const n=new mxe(t);this._searches.set(n.id,n);const o=this._provideSearchResults(e,n.id,i);return Promise.resolve(o).then(r=>(this._searches.delete(n.id),{results:Array.from(n.matches.values()),stats:r.stats,limitHit:r.limitHit,messages:r.messages}),r=>(this._searches.delete(n.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(n=>{n.results?i.addMatch(Mo(n)):i.addMatch({resource:N.revive(n)})})}_provideSearchResults(e,t,i){switch(e.type){case cI.File:return this._proxy.$provideFileSearchResults(this._handle,t,e,i);case cI.Text:return this._proxy.$provideTextSearchResults(this._handle,t,e,i);default:return this._proxy.$provideAITextSearchResults(this._handle,t,e,i)}}}let A8e=class{constructor(e,t){this.statusbarService=t,this._store=new Z;const i=e.getProxy(Ye.ExtHostStatusBar),n=[];for(const[r,a]of t.getEntries())n.push(o(r,a));i.$acceptStaticEntries(n),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===O3.LEFT,accessibilityInformation:a.entry.ariaLabel?{label:a.entry.ariaLabel,role:a.entry.role}:void 0}}}dispose(){this._store.dispose()}$setEntry(e,t,i,n,o,r,a,c,l,d,h,u){this.statusbarService.setOrUpdateEntry(e,t,i,n,o,r,a,c,l,d,h,u)===B3.DidDefine&&this._store.add(Ee(()=>this.statusbarService.unsetEntry(e)))}$disposeEntry(e){this.statusbarService.unsetEntry(e)}};A8e=D([Gi(Be.MainThreadStatusBar),_(1,jRe)],A8e);async function LQt(s,e,t,i){return i.invokeFunction(async n=>{const o=n.get(Za),r=n.get(Em),a=n.get(N3),c=n.get($i),l=n.get(ks),d=n.get(Jt),h=n.get(yi),u=n.get(Ge),f=`extensionStorage.migrate.${s}-${e}`,p=s.toLowerCase()===e.toLowerCase()?`extension.storage.migrateFromLowerCaseKey.${s.toLowerCase()}`:void 0;if(s===e)return;const m=(b,w)=>w?l.extUri.joinPath(r.defaultProfile.globalStorageHome,b.toLowerCase()):l.extUri.joinPath(o.workspaceStorageHome,h.getWorkspace().id,b),v=t?Ie.PROFILE:Ie.WORKSPACE;if(!c.getBoolean(f,v,!1)&&!(p&&c.getBoolean(p,v,!1))){u.info(`Migrating ${t?"global":"workspace"} extension storage from ${s} to ${e}...`);const b=a.getExtensionState(s,t);b&&(a.setExtensionState(e,b,t),a.setExtensionState(s,void 0,t));const w=m(s,t),y=m(e,t);if(!l.extUri.isEqual(w,y))try{await d.move(w,y,!0)}catch(C){C.code!==ot.FileNotFound&&u.info(`Error while migrating ${t?"global":"workspace"} file storage from '${s}' to '${e}'`,su(C))}u.info(`Migrated ${t?"global":"workspace"} extension storage from ${s} to ${e}`),c.store(f,!0,v,an.MACHINE)}})}let E8e=class{constructor(e,t,i,n,o){this._extensionStorageService=t,this._storageService=i,this._instantiationService=n,this._logService=o,this._storageListener=new Z,this._sharedStorageKeysToWatch=new Map,this._proxy=e.getProxy(Ye.ExtHostStorage),this._storageListener.add(this._storageService.onDidChangeValue(Ie.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&&Wn&&e!==e.toLowerCase()&&(i=e.toLowerCase()),i&&(Wn&&i!==i.toLowerCase()&&this._extensionStorageService.getExtensionState(i.toLowerCase(),t)&&!this._extensionStorageService.getExtensionState(i,t)&&(i=i.toLowerCase()),await LQt(i,e,t,this._instantiationService))}catch(i){this._logService.error(i)}}};E8e=D([Gi(Be.MainThreadStorage),_(1,N3),_(2,$i),_(3,we),_(4,Ge)],E8e);var _xe,ZR;let x8e=(ZR=class extends V{constructor(e,t,i,n,o){super(),this._telemetryService=t,this._configurationService=i,this._environmentService=n,this._productService=o,this._proxy=e.getProxy(Ye.ExtHostTelemetry),Yq(this._productService,this._environmentService)&&this._register(this._configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(uje)||r.affectsConfiguration(gje))&&this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel)})),this._proxy.$initializeTelemetryLevel(this.telemetryLevel,Yq(this._productService,this._environmentService),this._productService.enabledTelemetryLevels)}get telemetryLevel(){return Yq(this._productService,this._environmentService)?this._telemetryService.telemetryLevel:Kg.NONE}$publicLog(e,t=Object.create(null)){t[_xe._name]=!0,this._telemetryService.publicLog(e,t)}$publicLog2(e,t){this.$publicLog(e,t)}},_xe=ZR,ZR._name="pluginHostTelemetry",ZR);x8e=_xe=D([Gi(Be.MainThreadTelemetry),_(1,Yi),_(2,Te),_(3,Za),_(4,Er)],x8e);class Qnt{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 n=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),n.dispose()}},this._terminalBufferMap.set(e,a)});return n}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 vxe=class extends V{get onProcessReady(){return this._onProcessReady.event}constructor(e,t,i,n){super(),this.instanceId=e,this._cols=t,this._rows=i,this._terminalService=n,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:Og.Title,value:e})}emitReady(e,t){this._onProcessReady.fire({pid:e,cwd:t,windowsPty:void 0})}emitProcessProperty({type:e,value:t}){switch(e){case Og.Cwd:this.emitCwd(t);break;case Og.InitialCwd:this.emitInitialCwd(t);break;case Og.Title:this.emitTitle(t);break;case Og.OverrideDimensions:this.emitOverrideDimensions(t);break;case Og.ResolvedShellLaunchConfig:this.emitResolvedShellLaunchConfig(t);break}}emitExit(e){this._onProcessExit.fire(e),this.dispose()}emitOverrideDimensions(e){this._onDidChangeProperty.fire({type:Og.OverrideDimensions,value:e})}emitResolvedShellLaunchConfig(e){this._onDidChangeProperty.fire({type:Og.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){}};vxe=D([_(3,OU)],vxe);function jnt(s){return[...s.entries()]}function RQt(s){return s?[...s.entries()]:[]}function MQt(s){return new Map(s)}function NQt(s){return new Map(s??[])}var fz;(function(s){s[s.TerminalCommand=0]="TerminalCommand",s[s.Opener=1]="Opener",s[s.Port=2]="Port",s[s.VscodeCommand=3]="VscodeCommand"})(fz||(fz={}));var H1;(function(s){s[s.CwdDetection=0]="CwdDetection",s[s.NaiveCwdDetection=1]="NaiveCwdDetection",s[s.CommandDetection=2]="CommandDetection",s[s.PartialCommandDetection=3]="PartialCommandDetection",s[s.BufferMarkDetection=4]="BufferMarkDetection"})(H1||(H1={}));var D8e;(function(s){s.Windows="windows",s.NoProblemsReported="noProblemsReported"})(D8e||(D8e={}));let k8e=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this._extHostContext=e,this._terminalService=t,this._terminalLinkProviderService=i,this._terminalQuickFixService=n,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 wn,this._sendCommandEventListener=new wn,this._linkProvider=this._store.add(new wn),this._os=po,this._proxy=e.getProxy(Ye.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],jnt(v[1].map)]);this._proxy.$initEnvironmentVariableCollections(m)}l.getEnvironment().then(async p=>{this._os=p?.os||po,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:N.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 vxe(r,a,c,this._terminalService):void 0,extHostTerminalId:e,forceShellIntegration:t.forceShellIntegration,isFeatureTerminal:t.isFeatureTerminal,isExtensionOwnedTerminal:t.isExtensionOwnedTerminal,useShellEnvironment:t.useShellEnvironment,isTransient:t.isTransient},n=Zs.withAsyncBody(async r=>{const a=await this._terminalService.createTerminal({config:i,location:await this._deserializeParentTerminal(t.location)});r(a)});this._extHostTerminals.set(e,n);const o=await n;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===fW.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!==fW.Editor&&this._terminalGroupService.hidePanel()}async $dispose(e){(await this._getTerminalInstance(e))?.dispose(kT.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(bxe,(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(H1.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=jr(e,t)}$stopSendingCommandEvents(){this._sendCommandEventListener.clear()}$startLinkProvider(){this._linkProvider.value=this._terminalLinkProviderService.registerLinkProvider(new PQt(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,n,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||!n)return;const c=o.outputMatcher;let l;if(c&&(l=FQt(n,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=>I8e(e,t,u));if(h)return I8e(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??kT.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(n=>this._proxy.$acceptProcessInput(t.instanceId,n)),t.onShutdown(n=>this._proxy.$acceptProcessShutdown(t.instanceId,n)),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,n){this._terminalProcessProxies.get(e)?.emitReady(t,i,n)}$sendProcessProperty(e,t){t.type===Og.Title&&this._terminalService.getInstanceFromId(e)?.rename(t.value),this._terminalProcessProxies.get(e)?.emitProcessProperty(t)}$setEnvironmentVariableCollection(e,t,i,n){if(i){const o={persistent:t,map:MQt(i),descriptionMap:NQt(n)};this._environmentVariableService.set(e,o)}else this._environmentVariableService.delete(e)}};k8e=D([Gi(Be.MainThreadTerminalService),_(1,OU),_(2,qJe),_(3,QJe),_(4,we),_(5,$Je),_(6,Ge),_(7,GJe),_(8,hg),_(9,iMe),_(10,VJe),_(11,KJe)],k8e);let bxe=class extends V{constructor(e,t){super(),this._callback=e,this._terminalService=t,this._register(this._bufferer=new Qnt(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))}};bxe=D([_(1,OU)],bxe);class PQt{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 FQt(s,e){const t=s.join(` -`).match(e.lineMatcher);return t?{regexMatch:t,outputLines:s}:void 0}function I8e(s,e,t){let i=fz.TerminalCommand;return"uri"in t?(t.uri=N.revive(t.uri),i=fz.Opener):"id"in t&&(i=fz.VscodeCommand),{id:s,type:i,source:e,...t}}let T8e=class extends V{constructor(e,t,i){super(),this._terminalService=t,this._proxy=e.getProxy(Ye.ExtHostTerminalShellIntegration);const n=new Map;this._register(Ee(()=>{for(const d of n.values())d.dispose()}));const o=this._store.add(this._terminalService.createOnInstanceEvent(d=>M.map(M.filter(d.capabilities.onDidAddCapabilityType,h=>h===H1.CommandDetection),()=>d))).event;this._store.add(o(d=>this._proxy.$shellIntegrationChange(d.instanceId)));const r=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(H1.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,L8e(d.data),d.data.isTrusted,this._convertCwdToUri(d.data.cwd)),n.get(h)?.dispose(),n.set(h,M.accumulate(d.instance.onData,50,this._store)(u=>this._proxy.$shellExecutionData(h,u.join())))}));const c=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(H1.CommandDetection,d=>d.onCommandFinished));this._store.add(c.event(d=>{a=void 0;const h=d.instance.instanceId;n.get(h)?.dispose(),setTimeout(()=>{this._proxy.$shellExecutionEnd(h,d.data.command,L8e(d.data),d.data.isTrusted,d.data.exitCode)})}));const l=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(H1.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?N.file(e):void 0}};T8e=D([Gi(Be.MainThreadTerminalShellIntegration),_(1,OU),_(2,Jr)],T8e);function L8e(s){switch(s.commandLineConfidence){case"high":return mD.High;case"medium":return mD.Medium;case"low":default:return mD.Low}}let R8e=class{constructor(e,t){this._themeService=t,this._proxy=e.getProxy(Ye.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()}};R8e=D([Gi(Be.MainThreadTheming),_(1,pn)],R8e);let M8e=class extends V{constructor(e,t,i,n,o){super(),this.viewsService=t,this.notificationService=i,this.extensionService=n,this.logService=o,this._dataProviders=this._register(new mo),this._dndControllers=new Map,this._proxy=e.getProxy(Ye.ExtHostTreeViews)}async $registerTreeViewDataProvider(e,t){this.logService.trace("MainThreadTreeViews#$registerTreeViewDataProvider",e,t),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{const i=new BQt(e,this._proxy,this.notificationService),n=new Z;this._dataProviders.set(e,{dataProvider:i,dispose:()=>n.dispose()});const o=t.hasHandleDrag||t.hasHandleDrop?new OQt(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,n),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 n=this.getTreeView(e);if(n&&t)return this.reveal(n,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),n=this._dataProviders.get(e);if(i&&n){const o=n.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 n=this.getTreeView(e);n&&(n.title=t,n.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 n=this._dndControllers.get(e);if(!n)throw new Error("Unknown tree");return n.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,n,o){o=o||{select:!1,focus:!1};const r=ra(o.select)?!1:o.select,a=ra(o.focus)?!1:o.focus;let c=Math.min(lc(o.expand)?o.expand:o.expand===!0?1:0,3);t.isEmpty()&&await e.refresh();for(const d of n){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(n=>this._proxy.$setExpanded(e,n.handle,!0))),i.add(t.onDidCollapseItem(n=>this._proxy.$setExpanded(e,n.handle,!1))),i.add(t.onDidChangeSelectionAndFocus(n=>this._proxy.$setSelectionAndFocus(e,n.selection.map(({handle:o})=>o),n.focus.handle))),i.add(t.onDidChangeVisibility(n=>this._proxy.$setVisible(e,n))),i.add(t.onDidChangeCheckboxState(n=>{this._proxy.$changeCheckboxState(e,n.map(o=>({treeItemHandle:o.handle,newState:o.checkbox?.isChecked??!1})))}))}getTreeView(e){const t=Qe.as(eI.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()}};M8e=D([Gi(Be.MainThreadTreeViews),_(1,Lm),_(2,bi),_(3,fs),_(4,Ge)],M8e);class OQt{constructor(e,t,i,n,o){this.treeViewId=e,this.dropMimeTypes=t,this.dragMimeTypes=i,this.hasWillDrop=n,this._proxy=o,this.dataTransfersCache=new gPe}async handleDrop(e,t,i,n,o,r){const a=this.dataTransfersCache.add(e);try{const c=await B_.from(e);return i.isCancellationRequested?void 0:await this._proxy.$handleDrop(this.treeViewId,a.id,c,t?.handle,i,n,o,r)}finally{a.dispose()}}async handleDrag(e,t,i){if(!this.hasWillDrop)return;const n=await this._proxy.$handleDrag(this.treeViewId,e,t,i);if(!n)return;const o=new lce;return n.items.forEach(([r,a])=>{o.replace(r,q6(a.asString))}),o}resolveDropFileData(e,t){return this.dataTransfersCache.resolveFileData(e,t)}}class BQt{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=>(tw.is(t)||this.notificationService.error(t),[]))}getItemsToRefresh(e){const t=[];if(e)for(const i of Object.keys(e)){const n=this.getItem(i);if(n){const o=e[i];if(this.updateTreeItem(n,o),i===o.handle)t.push(n);else{this.itemsMap.delete(i),this.itemsMap.set(n.handle,n);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 n of e){const o=new Xhe(n,i?r=>this._proxy.$resolve(this.treeViewId,n.handle,r):void 0);this.itemsMap.set(n.handle,o),t.push(o)}return t}updateTreeItem(e,t){if(t.children=t.children?t.children:void 0,e){const i=ja([...Object.keys(e instanceof Xhe?e.asTreeItem():e),...Object.keys(t)]);for(const n of i)e[n]=t[n];e instanceof Xhe&&e.resetResolve()}}}let N8e=class extends V{constructor(e,t){super(),this.downloadService=t}$download(e,t){return this.downloadService.download(N.revive(e),N.revive(t))}};N8e=D([Gi(Be.MainThreadDownloadService),_(1,HRe)],N8e);class WQt{constructor(e,t,i,n){this.proxy=e,this.handle=t,this.extensionId=i,this.extensionDisplayName=n}handleURL(e,t){return Sn.equals(this.extensionId,e.authority)?Promise.resolve(this.proxy.$handleExternalUri(this.handle,e)).then(()=>!0):Promise.resolve(!1)}}let P8e=class{constructor(e,t,i){this.urlService=t,this.extensionUrlHandler=i,this.handlers=new Map,this.proxy=e.getProxy(Ye.ExtHostUrls)}$registerUriHandler(e,t,i){const n=new WQt(this.proxy,e,t,i),o=this.urlService.registerHandler(n);return this.handlers.set(e,{extensionId:t,disposable:o}),this.extensionUrlHandler.registerExtensionHandler(t,n),Promise.resolve(void 0)}$unregisterUriHandler(e){const t=this.handlers.get(e);if(!t)return Promise.resolve(void 0);const{extensionId:i,disposable:n}=t;return this.extensionUrlHandler.unregisterExtensionHandler(i),this.handlers.delete(e),n.dispose(),Promise.resolve(void 0)}async $createAppUri(e){return this.urlService.create(e)}dispose(){this.handlers.forEach(({disposable:e})=>e.dispose()),this.handlers.clear()}};P8e=D([Gi(Be.MainThreadUrls),_(1,Uae),_(2,cXe)],P8e);const Ynt="default",HQt="workbench.externalUriOpeners",wxe={type:"string",enum:[]},F8e="\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",UQt={...V6,properties:{[HQt]:{type:"object",markdownDescription:g(8681,"Configure the opener to use for external URIs (http, https)."),defaultSnippets:[{body:{"example.com":"$1"}}],additionalProperties:{anyOf:[{type:"string",markdownDescription:g(8682,`Map URI pattern to an opener id. +`);async function cQt(s,e,t,i,n){s.write($e.fromString(aQt(e,t)));const o=new Z;try{return await new Promise((r,a)=>{let c;o.add(s.onData(l=>{c?c=$e.concat([c,l],c.byteLength+l.byteLength):c=l;const d=c.indexOf(Jze);if(d===-1)return;r(s),s.pauseData();const h=c.slice(d+Jze.byteLength);h.byteLength&&n.onData.fire(h)})),o.add(s.onClose(l=>a(l??new Error("socket closed")))),o.add(s.onEnd(()=>a(new Error("socket ended"))))})}catch(r){throw s.dispose(),r}finally{o.dispose()}}let lQt=class extends V{constructor(e,t){super(),this.debugLabel=e,this.pausableDataEmitter=this._register(new Sk),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){vAe.traceSocketEvent(this,this.debugLabel,e,t)}dispose(){this.ended||this.closeRemote(),this.didDisposeEmitter.fire(),super.dispose()}},Xze=class extends V{constructor(e,t){super(),this._remoteSocketFactoryService=t,this._registrations=new Map,this._remoteSockets=new Map,this._proxy=e.getProxy(Ye.ExtHostManagedSockets)}async $registerSocketFactory(e){const t=this,i=new class{supports(n){return n.id===e}connect(n,o,r,a){return new Promise((c,l)=>{if(n.id!==e)return l(new Error("Invalid connectTo"));const d=n.id;t._proxy.$openRemoteSocket(d).then(h=>{const u={onClose:new I,onData:new I,onEnd:new I};t._remoteSockets.set(h,u),iPe.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(zW.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:Cee.NodeSocketCloseEvent,error:t?new Error(t):void 0,hadError:!!t}),this._remoteSockets.delete(e)}$onDidManagedSocketEnd(e){this._remoteSockets.get(e)?.onEnd.fire()}};Xze=D([Gi(Be.MainThreadManagedSockets),_(1,IRe)],Xze);class iPe extends lQt{static connect(e,t,i,n,o,r){const a=new iPe(e,t,o,r);return cQt(a,i,n,o,r)}constructor(e,t,i,n){super(i,n),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 MK="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 oB;(function(s){s[s.Append=1]="Append",s[s.Replace=2]="Replace",s[s.Clear=3]="Clear"})(oB||(oB={}));const Bnt={OutputChannels:"workbench.contributions.outputChannels"};class dQt{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)}}Qe.add(Bnt.OutputChannels,new dQt);new Y("activeOutputChannel","");var oj,QR;let Zze=(QR=class extends V{constructor(e,t,i){super(),this._outputService=t,this._viewsService=i,this._proxy=e.getProxy(Ye.ExtHostOutputService);const n=()=>{const o=this._viewsService.isViewVisible(MK)?this._outputService.getActiveChannel():void 0;this._proxy.$setVisibleChannel(o?o.id:null)};this._register(M.any(this._outputService.onActiveOutputChannel,M.filter(this._viewsService.onDidChangeViewVisibility,({id:o})=>o===MK))(()=>n())),n()}async $register(e,t,i,n){const o=(oj._extensionIdPool.get(n)||0)+1;oj._extensionIdPool.set(n,o);const r=`extension-output-${n}-#${o}-${e}`,a=N.revive(t);return Qe.as(Bnt.OutputChannels).registerChannel({id:r,label:e,file:a,log:!1,languageId:i,extensionId:n}),this._register(Ee(()=>this.$dispose(r))),r}async $update(e,t,i){const n=this._getChannel(e);n&&(t===oB.Append?n.update(t):lc(i)&&n.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(MK)){const t=this._outputService.getActiveChannel();t&&e===t.id&&this._viewsService.closeView(MK)}}async $dispose(e){this._getChannel(e)?.dispose()}_getChannel(e){return this._outputService.getChannel(e)}},oj=QR,QR._extensionIdPool=new Map,QR);Zze=oj=D([Gi(Be.MainThreadOutputService),_(1,qae),_(2,km)],Zze);class hQt extends rn{constructor(e,t,i){super(e,t,void 0,!0,()=>i.executeCommand("_extensions.manage",e))}}let e8e=class{constructor(e,t,i){this._commandService=i,this._progress=new Map,this._proxy=e.getProxy(Ye.ExtHostProgress),this._progressService=t}dispose(){this._progress.forEach(e=>e.resolve()),this._progress.clear()}async $startProgress(e,t,i){const n=this._createTask(e);t.location===dd.Notification&&i&&(t={...t,location:dd.Notification,secondaryActions:[new hQt(i,g(4863,"Manage Extension"),this._commandService)]}),this._progressService.withProgress(t,n,()=>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})})}};e8e=D([Gi(Be.MainThreadProgress),_(1,og),_(2,vi)],e8e);let t8e=class{constructor(e,t){this.quickDiffService=t,this.providerDisposables=new mo,this.proxy=e.getProxy(Ye.ExtHostQuickDiff)}async $registerQuickDiffProvider(e,t,i,n){const o={label:i,rootUri:N.revive(n),selector:t,isSCM:!1,getOriginalResource:async a=>N.revive(await this.proxy.$provideOriginalResource(e,a,He.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()}};t8e=D([Gi(Be.MainThreadQuickDiff),_(1,I6)],t8e);function i8e(s){s.dark=N.revive(s.dark),s.light&&(s.light=N.revive(s.light))}let n8e=class{constructor(e,t){this._items={},this.sessions=new Map,this._proxy=e.getProxy(Ye.ExtHostQuickOpen),this._quickInputService=t}dispose(){}$show(e,t,i){const n=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(n,t,i).then(o=>{if(o)return o.map(r=>r.handle)}):this._quickInputService.pick(n,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 n=Object.create(null);return e&&(n.title=e.title,n.password=e.password,n.placeHolder=e.placeHolder,n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.value=e.value,n.ignoreFocusLost=e.ignoreFocusOut),t&&(n.validateInput=o=>this._proxy.$validateInput(o)),this._quickInputService.input(n,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:n,handlesToItems:o}=i;for(const r in e)r==="id"||r==="type"||(r==="visible"?e.visible?n.show():n.hide():r==="items"?(o.clear(),e[r].forEach(a=>{a.type!=="separator"&&(a.buttons&&(a.buttons=a.buttons.map(c=>(c.iconPath&&i8e(c.iconPath),c))),o.set(a.handle,a))}),n[r]=e[r]):r==="activeItems"||r==="selectedItems"?n[r]=e[r].filter(a=>o.has(a)).map(a=>o.get(a)):r==="buttons"?n[r]=e.buttons.map(a=>a.handle===-1?this._quickInputService.backButton:(a.iconPath&&i8e(a.iconPath),a)):n[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)}};n8e=D([Gi(Be.MainThreadQuickOpen),_(1,In)],n8e);let s8e=class extends V{constructor(e,t,i){super(),this._environmentService=t,this._proxy=e.getProxy(Ye.ExtHostExtensionService);const n=this._environmentService.remoteAuthority;n&&this._register(i.onDidChangeConnectionData(()=>{const o=i.getConnectionData(n);o&&this._proxy.$updateRemoteConnectionData(o)}))}};s8e=D([$N,_(1,Jr),_(2,hC)],s8e);class uQt{constructor(e){this._proxy=e.getProxy(Ye.ExtHostDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.textEditorModel||!ky(e.textEditorModel))return;const o=new Promise((r,a)=>{setTimeout(()=>a(new Error(g(4864,"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 Ire(o,n)}}let o8e=class{constructor(e,t,i){this._textFileService=i,this._saveParticipantDisposable=this._textFileService.files.addSaveParticipant(t.createInstance(uQt,e))}dispose(){this._saveParticipantDisposable.dispose()}};o8e=D([$N,_(1,we),_(2,Fo)],o8e);let r8e=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(Ye.ExtHostSpeech)}$registerProvider(e,t,i){this.logService.trace("[Speech] extension registered provider",i.extension.value);const n=this.speechService.registerSpeechProvider(t,{metadata:i,createSpeechToTextSession:(o,r)=>{if(o.isCancellationRequested)return{onDidChange:M.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:M.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 B_(M.toPromise(M.filter(l.event,h=>h.status===$ve.Stopped)),o)}}},createKeywordRecognitionSession:o=>{if(o.isCancellationRequested)return{onDidChange:M.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:()=>{n.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()}};r8e=D([Gi(Be.MainThreadSpeech),_(1,Vae),_(2,Ge)],r8e);class gQt{constructor(e){this.timeout=1e4,this._proxy=e.getProxy(Ye.ExtHostWorkspace)}async participate(e,t){const i=new Promise((n,o)=>{setTimeout(()=>o(new Error(g(4865,"Aborted onWillCreateEditSessionIdentity-event after 10000ms"))),this.timeout),this._proxy.$onWillCreateEditSessionIdentity(e.uri,t,this.timeout).then(n,o)});return Ire(i,t)}}let a8e=class{constructor(e,t,i){this._editSessionIdentityService=i,this._saveParticipantDisposable=this._editSessionIdentityService.addEditSessionIdentityCreateParticipant(t.createInstance(gQt,e))}dispose(){this._saveParticipantDisposable.dispose()}};a8e=D([$N,_(1,we),_(2,RRe)],a8e);let dz=class{get childrenCount(){return this._children.size}get children(){return this._children.values()}get name(){return Vi.basename(this.relativePath)}constructor(e,t,i,n=void 0,o=void 0){this.uri=e,this.relativePath=t,this.context=i,this.element=n,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()}};dz.__decorator=D([Zt],dz.prototype,"name",null);function Wnt(s,e){typeof s.element<"u"&&e.push(s.element);for(const t of s.children)Wnt(t,e);return e}class fQt{static getRoot(e){for(;e.parent;)e=e.parent;return e}static collect(e){return Wnt(e,[])}static isResourceNode(e){return e instanceof dz}constructor(e,t=N.file("/"),i=xn){this.extUri=i,this.root=new dz(t,"",e)}add(e,t){const i=this.extUri.relativePath(this.root.uri,e)||e.path,n=new v5(!1).reset(i);let o=this.root,r="";for(;;){const a=n.value();r=r+"/"+a;let c=o.get(a);if(c?n.hasNext()||(c.element=t):(c=new dz(this.extUri.joinPath(this.root.uri,r),r,this.root.context,n.hasNext()?void 0:t,o),o.set(a,c)),o=c,!n.hasNext())return;n.next()}}delete(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new v5(!1).reset(t);return this._delete(this.root,i)}_delete(e,t){const i=t.value(),n=e.get(i);if(n){if(t.hasNext()){const o=this._delete(n,t.next());return typeof o<"u"&&n.childrenCount===0&&e.delete(i),o}return e.delete(i),n.element}}clear(){this.root.clear()}getNode(e){const t=this.extUri.relativePath(this.root.uri,e)||e.path,i=new v5(!1).reset(t);let n=this.root;for(;;){const o=i.value(),r=n.get(o);if(!r||!i.hasNext())return r;n=r,i.next()}}}function c8e(s){if(s!==void 0){if(N.isUri(s))return N.revive(s);if(We.isThemeIcon(s))return s;{const e=s;return{light:N.revive(e.light),dark:N.revive(e.dark)}}}}function Due(s){const e=c8e(s.icon),t=s.labels?.map(i=>({title:i.title,icon:c8e(i.icon)}));return{...s,icon:e,labels:t}}class pQt extends V{constructor(e,t,i){super(),this.modelService=t,this.languageService=i,this._register(e.registerTextModelContentProvider(pe.vscodeSourceControl,this))}async provideTextContent(e){const t=this.modelService.getModel(e);return t||this.modelService.createModel("",this.languageService.createById("scminput"),e)}}class mQt{get resourceTree(){if(!this._resourceTree){const e=this.provider.rootUri??N.file("/");this._resourceTree=new fQt(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,n,o,r,a,c){this.sourceControlHandle=e,this.handle=t,this.provider=i,this.features=n,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:ws.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 _Qt{constructor(e,t,i,n,o,r,a,c,l,d,h){this.proxy=e,this.sourceControlHandle=t,this.groupHandle=i,this.handle=n,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:ws.ScmResource,sourceControlHandle:this.sourceControlHandle,groupHandle:this.groupHandle,handle:this.handle}}}class vQt{get currentHistoryItemGroup(){return this._currentHistoryItemGroup}constructor(e,t){this.proxy=e,this.handle=t,this.currentHistoryItemGroupId=Ze(this,i=>this.currentHistoryItemGroup.read(i)?.id),this.currentHistoryItemGroupName=Ze(this,i=>this.currentHistoryItemGroup.read(i)?.name),this._currentHistoryItemGroup=uJ({owner:this,equalsFn:()=>!1},void 0)}async resolveHistoryItemGroupCommonAncestor(e,t){return this.proxy.$resolveHistoryItemGroupCommonAncestor(this.handle,e,t,He.None)}async resolveHistoryItemGroupCommonAncestor2(e){return this.proxy.$resolveHistoryItemGroupCommonAncestor2(this.handle,e,He.None)}async provideHistoryItems(e,t){return(await this.proxy.$provideHistoryItems(this.handle,e,t,He.None))?.map(n=>Due(n))}async provideHistoryItems2(e){return(await this.proxy.$provideHistoryItems2(this.handle,e,He.None))?.map(i=>Due(i))}async provideHistoryItemSummary(e,t){const i=await this.proxy.$provideHistoryItemSummary(this.handle,e,t,He.None);return i?Due(i):void 0}async provideHistoryItemChanges(e,t){return(await this.proxy.$provideHistoryItemChanges(this.handle,e,t,He.None))?.map(n=>({uri:N.revive(n.uri),originalUri:n.originalUri&&N.revive(n.originalUri),modifiedUri:n.modifiedUri&&N.revive(n.modifiedUri),renameUri:n.renameUri&&N.revive(n.renameUri)}))}$onDidChangeCurrentHistoryItemGroup(e){this._currentHistoryItemGroup.set(e,void 0)}}const zoe=class zoe{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 acceptInputCommand(){return this.features.acceptInputCommand}get actionButton(){return this.features.actionButton??void 0}get count(){return this._count}get statusBarCommands(){return this._statusBarCommands}get name(){return this._name??this._label}get commitTemplate(){return this._commitTemplate}get historyProvider(){return this._historyProvider}constructor(e,t,i,n,o,r,a,c,l){if(this.proxy=e,this._handle=t,this._providerId=i,this._label=n,this._rootUri=o,this._inputBoxTextModel=r,this._quickDiffService=a,this._uriIdentService=c,this._workspaceContextService=l,this._id=`scm${zoe.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._count=jt(this,void 0),this._statusBarCommands=jt(this,void 0),this._commitTemplate=jt(this,""),this._onDidChange=new I,this.onDidChange=this._onDidChange.event,this.isSCM=!0,this._historyProvider=jt(this,void 0),o){const d=this._workspaceContextService.getWorkspaceFolder(o);d?.uri.toString()===o.toString()?this._name=d.name:o.path!=="/"&&(this._name=_i(o))}}$updateSourceControl(e){if(this.features={...this.features,...e},this._onDidChange.fire(),typeof e.commitTemplate<"u"&&this._commitTemplate.set(e.commitTemplate,void 0),typeof e.count<"u"&&this._count.set(e.count,void 0),typeof e.statusBarCommands<"u"&&this._statusBarCommands.set(e.statusBarCommands,void 0),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.get()){const t=new vQt(this.proxy,this.handle);this._historyProvider.set(t,void 0)}else e.hasHistoryProvider===!1&&this.historyProvider.get()&&this._historyProvider.set(void 0,void 0)}$registerGroups(e){const t=e.map(([i,n,o,r,a])=>{const c=new mQt(this.handle,i,this,r,o,n,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 n=this._groupsByHandle[t];if(!n){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,b,w,y]=l,[C,A]=u,L=We.isThemeIcon(C)?C:N.revive(C),k=(We.isThemeIcon(A)?A:N.revive(A))||L,P={icon:L,iconDark:k,tooltip:f,strikeThrough:p,faded:m};return new _Qt(this.proxy,this.handle,t,d,N.revive(h),n,P,v||void 0,b,N.revive(w),N.revive(y))});n.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,He.None);return t&&N.revive(t)}$onDidChangeHistoryProviderCurrentHistoryItemGroup(e){this.historyProvider.get()&&this._historyProvider.get()?.$onDidChangeCurrentHistoryItemGroup(e)}toJSON(){return{$mid:ws.ScmProvider,handle:this.handle}}dispose(){this._quickDiff?.dispose()}};zoe.ID_HANDLE=0;let lxe=zoe,l8e=class{constructor(e,t,i,n,o,r,a,c,l){this.scmService=t,this.scmViewService=i,this.languageService=n,this.modelService=o,this.textModelService=r,this.quickDiffService=a,this._uriIdentService=c,this.workspaceContextService=l,this._repositories=new Map,this._repositoryBarriers=new Map,this._repositoryDisposables=new Map,this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostSCM),this._disposables.add(new pQt(this.textModelService,this.modelService,this.languageService))}dispose(){bt(this._repositories.values()),this._repositories.clear(),bt(this._repositoryDisposables.values()),this._repositoryDisposables.clear(),this._disposables.dispose()}async $registerSourceControl(e,t,i,n,o){this._repositoryBarriers.set(e,new Gd);const r=await this.textModelService.createModelReference(N.revive(o)),a=new lxe(this._proxy,e,t,i,n?N.revive(n):void 0,r.object.textEditorModel,this.quickDiffService,this._uriIdentService,this.workspaceContextService),c=this.scmService.registerSCMProvider(a);this._repositories.set(e,c);const l=jr(r,M.filter(this.scmViewService.onDidFocusRepository,d=>d===c)(d=>this._proxy.$setSelectedSourceControl(e)),c.input.onDidChange(({value:d})=>this._proxy.$onInputBoxValueChange(e,d)));this._repositoryDisposables.set(e,l),this.scmViewService.focusedRepository===c&&setTimeout(()=>this._proxy.$setSelectedSourceControl(e),0),c.input.value&&setTimeout(()=>this._proxy.$onInputBoxValueChange(e,c.input.value),0),this._repositoryBarriers.get(e)?.open()}async $updateSourceControl(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$updateSourceControl(t)}async $unregisterSourceControl(e){await this._repositoryBarriers.get(e)?.wait();const t=this._repositories.get(e);t&&(this._repositoryDisposables.get(e).dispose(),this._repositoryDisposables.delete(e),t.dispose(),this._repositories.delete(e))}async $registerGroups(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;const o=n.provider;o.$registerGroups(t),o.$spliceGroupResourceStates(i)}async $updateGroup(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;n.provider.$updateGroup(t,i)}async $updateGroupLabel(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);if(!n)return;n.provider.$updateGroupLabel(t,i)}async $spliceResourceStates(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$spliceGroupResourceStates(t)}async $unregisterGroup(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$unregisterGroup(t)}async $setInputBoxValue(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&i.input.setValue(t,!1)}async $setInputBoxPlaceholder(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.placeholder=t)}async $setInputBoxEnablement(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.enabled=t)}async $setInputBoxVisibility(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(i.input.visible=t)}async $showValidationMessage(e,t,i){await this._repositoryBarriers.get(e)?.wait();const n=this._repositories.get(e);n&&n.input.showValidationMessage(t,i)}async $setValidationProviderIsEnabled(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);i&&(t?i.input.validateInput=async(n,o)=>{const r=await this._proxy.$validateInput(e,n,o);return r&&{message:r[0],type:r[1]}}:i.input.validateInput=async()=>{})}async $onDidChangeHistoryProviderCurrentHistoryItemGroup(e,t){await this._repositoryBarriers.get(e)?.wait();const i=this._repositories.get(e);if(!i)return;i.provider.$onDidChangeHistoryProviderCurrentHistoryItemGroup(t)}};l8e=D([Gi(Be.MainThreadSCM),_(1,zRe),_(2,LJe),_(3,xi),_(4,gi),_(5,fn),_(6,I6),_(7,ks),_(8,yi)],l8e);var d8e;(function(s){s.FindInFilesActionId="workbench.action.findInFiles",s.FocusActiveEditorCommandId="search.action.focusActiveEditor",s.FocusSearchFromResults="search.action.focusSearchFromResults",s.OpenMatch="search.action.openResult",s.OpenMatchToSide="search.action.openResultToSide",s.RemoveActionId="search.action.remove",s.CopyPathCommandId="search.action.copyPath",s.CopyMatchCommandId="search.action.copyMatch",s.CopyAllCommandId="search.action.copyAll",s.OpenInEditorCommandId="search.action.openInEditor",s.ClearSearchHistoryCommandId="search.action.clearHistory",s.FocusSearchListCommandID="search.action.focusSearchList",s.ReplaceActionId="search.action.replace",s.ReplaceAllInFileActionId="search.action.replaceAllInFile",s.ReplaceAllInFolderActionId="search.action.replaceAllInFolder",s.CloseReplaceWidgetActionId="closeReplaceInFilesWidget",s.ToggleCaseSensitiveCommandId="toggleSearchCaseSensitive",s.ToggleWholeWordCommandId="toggleSearchWholeWord",s.ToggleRegexCommandId="toggleSearchRegex",s.TogglePreserveCaseId="toggleSearchPreserveCase",s.AddCursorsAtSearchResults="addCursorsAtSearchResults",s.RevealInSideBarForSearchResults="search.action.revealInSideBar",s.ReplaceInFilesActionId="workbench.action.replaceInFiles",s.ShowAllSymbolsActionId="workbench.action.showAllSymbols",s.QuickTextSearchActionId="workbench.action.quickTextSearch",s.CancelSearchActionId="search.action.cancel",s.RefreshSearchResultsActionId="search.action.refreshSearchResults",s.FocusNextSearchResultActionId="search.action.focusNextSearchResult",s.FocusPreviousSearchResultActionId="search.action.focusPreviousSearchResult",s.ToggleSearchOnTypeActionId="workbench.action.toggleSearchOnType",s.CollapseSearchResultsActionId="search.action.collapseSearchResults",s.ExpandSearchResultsActionId="search.action.expandSearchResults",s.ExpandRecursivelyCommandId="search.action.expandRecursively",s.ClearSearchResultsActionId="search.action.clearSearchResults",s.ViewAsTreeActionId="search.action.viewAsTree",s.ViewAsListActionId="search.action.viewAsList",s.ShowAIResultsActionId="search.action.showAIResults",s.HideAIResultsActionId="search.action.hideAIResults",s.ToggleQueryDetailsActionId="workbench.action.search.toggleQueryDetails",s.ExcludeFolderFromSearchId="search.action.excludeFromSearch",s.FocusNextInputActionId="search.focus.nextInputBox",s.FocusPreviousInputActionId="search.focus.previousInputBox",s.RestrictSearchToFolderId="search.action.restrictSearchToFolder",s.FindInFolderId="filesExplorer.findInFolder",s.FindInWorkspaceId="filesExplorer.findInWorkspace"})(d8e||(d8e={}));const bQt={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 h8e=class{constructor(e,t,i,n,o){this._searchService=t,this._telemetryService=i,this.contextKeyService=o,this._searchProvider=new Map,this._proxy=e.getProxy(Ye.ExtHostSearch),this._proxy.$enableExtensionHostSearch()}dispose(){this._searchProvider.forEach(e=>e.dispose()),this._searchProvider.clear()}$registerTextSearchProvider(e,t){this._searchProvider.set(e,new kue(this._searchService,Y5.text,t,e,this._proxy))}$registerAITextSearchProvider(e,t){bQt.hasAIResultProvider.bindTo(this.contextKeyService).set(!0),this._searchProvider.set(e,new kue(this._searchService,Y5.aiText,t,e,this._proxy))}$registerFileSearchProvider(e,t){this._searchProvider.set(e,new kue(this._searchService,Y5.file,t,e,this._proxy))}$unregisterProvider(e){bt(this._searchProvider.get(e)),this._searchProvider.delete(e)}$handleFileMatch(e,t,i){const n=this._searchProvider.get(e);if(!n)throw new Error("Got result for unknown provider");n.handleFindMatch(t,i)}$handleTextMatch(e,t,i){const n=this._searchProvider.get(e);if(!n)throw new Error("Got result for unknown provider");n.handleFindMatch(t,i)}$handleTelemetry(e,t){this._telemetryService.publicLog(e,t)}};h8e=D([Gi(Be.MainThreadSearch),_(1,jae),_(2,Yi),_(3,Te),_(4,Le)],h8e);const $oe=class $oe{constructor(e,t=++$oe._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)}};$oe._idPool=0;let dxe=$oe;class kue{constructor(e,t,i,n,o){this._scheme=i,this._handle=n,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=He.None){return this.doSearch(e,void 0,t)}textSearch(e,t,i=He.None){return this.doSearch(e,t,i)}doSearch(e,t,i=He.None){if(!e.folderQueries.length)throw new Error("Empty folderQueries");const n=new dxe(t);this._searches.set(n.id,n);const o=this._provideSearchResults(e,n.id,i);return Promise.resolve(o).then(r=>(this._searches.delete(n.id),{results:Array.from(n.matches.values()),stats:r.stats,limitHit:r.limitHit,messages:r.messages}),r=>(this._searches.delete(n.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(n=>{n.results?i.addMatch(Mo(n)):i.addMatch({resource:N.revive(n)})})}_provideSearchResults(e,t,i){switch(e.type){case nI.File:return this._proxy.$provideFileSearchResults(this._handle,t,e,i);case nI.Text:return this._proxy.$provideTextSearchResults(this._handle,t,e,i);default:return this._proxy.$provideAITextSearchResults(this._handle,t,e,i)}}}let u8e=class{constructor(e,t){this.statusbarService=t,this._store=new Z;const i=e.getProxy(Ye.ExtHostStatusBar),n=[];for(const[r,a]of t.getEntries())n.push(o(r,a));i.$acceptStaticEntries(n),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===N3.LEFT,accessibilityInformation:a.entry.ariaLabel?{label:a.entry.ariaLabel,role:a.entry.role}:void 0}}}dispose(){this._store.dispose()}$setEntry(e,t,i,n,o,r,a,c,l,d,h,u){this.statusbarService.setOrUpdateEntry(e,t,i,n,o,r,a,c,l,d,h,u)===P3.DidDefine&&this._store.add(Ee(()=>this.statusbarService.unsetEntry(e)))}$disposeEntry(e){this.statusbarService.unsetEntry(e)}};u8e=D([Gi(Be.MainThreadStatusBar),_(1,ORe)],u8e);async function wQt(s,e,t,i){return i.invokeFunction(async n=>{const o=n.get(Za),r=n.get(Cm),a=n.get(L3),c=n.get($i),l=n.get(ks),d=n.get(Jt),h=n.get(yi),u=n.get(Ge),f=`extensionStorage.migrate.${s}-${e}`,p=s.toLowerCase()===e.toLowerCase()?`extension.storage.migrateFromLowerCaseKey.${s.toLowerCase()}`:void 0;if(s===e)return;const m=(b,w)=>w?l.extUri.joinPath(r.defaultProfile.globalStorageHome,b.toLowerCase()):l.extUri.joinPath(o.workspaceStorageHome,h.getWorkspace().id,b),v=t?Ie.PROFILE:Ie.WORKSPACE;if(!c.getBoolean(f,v,!1)&&!(p&&c.getBoolean(p,v,!1))){u.info(`Migrating ${t?"global":"workspace"} extension storage from ${s} to ${e}...`);const b=a.getExtensionState(s,t);b&&(a.setExtensionState(e,b,t),a.setExtensionState(s,void 0,t));const w=m(s,t),y=m(e,t);if(!l.extUri.isEqual(w,y))try{await d.move(w,y,!0)}catch(C){C.code!==ot.FileNotFound&&u.info(`Error while migrating ${t?"global":"workspace"} file storage from '${s}' to '${e}'`,nu(C))}u.info(`Migrated ${t?"global":"workspace"} extension storage from ${s} to ${e}`),c.store(f,!0,v,an.MACHINE)}})}let g8e=class{constructor(e,t,i,n,o){this._extensionStorageService=t,this._storageService=i,this._instantiationService=n,this._logService=o,this._storageListener=new Z,this._sharedStorageKeysToWatch=new Map,this._proxy=e.getProxy(Ye.ExtHostStorage),this._storageListener.add(this._storageService.onDidChangeValue(Ie.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&&Wn&&e!==e.toLowerCase()&&(i=e.toLowerCase()),i&&(Wn&&i!==i.toLowerCase()&&this._extensionStorageService.getExtensionState(i.toLowerCase(),t)&&!this._extensionStorageService.getExtensionState(i,t)&&(i=i.toLowerCase()),await wQt(i,e,t,this._instantiationService))}catch(i){this._logService.error(i)}}};g8e=D([Gi(Be.MainThreadStorage),_(1,L3),_(2,$i),_(3,we),_(4,Ge)],g8e);var hxe,jR;let f8e=(jR=class extends V{constructor(e,t,i,n,o){super(),this._telemetryService=t,this._configurationService=i,this._environmentService=n,this._productService=o,this._proxy=e.getProxy(Ye.ExtHostTelemetry),Qq(this._productService,this._environmentService)&&this._register(this._configurationService.onDidChangeConfiguration(r=>{(r.affectsConfiguration(sje)||r.affectsConfiguration(oje))&&this._proxy.$onDidChangeTelemetryLevel(this.telemetryLevel)})),this._proxy.$initializeTelemetryLevel(this.telemetryLevel,Qq(this._productService,this._environmentService),this._productService.enabledTelemetryLevels)}get telemetryLevel(){return Qq(this._productService,this._environmentService)?this._telemetryService.telemetryLevel:zg.NONE}$publicLog(e,t=Object.create(null)){t[hxe._name]=!0,this._telemetryService.publicLog(e,t)}$publicLog2(e,t){this.$publicLog(e,t)}},hxe=jR,jR._name="pluginHostTelemetry",jR);f8e=hxe=D([Gi(Be.MainThreadTelemetry),_(1,Yi),_(2,Te),_(3,Za),_(4,Er)],f8e);class Hnt{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 n=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),n.dispose()}},this._terminalBufferMap.set(e,a)});return n}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 uxe=class extends V{get onProcessReady(){return this._onProcessReady.event}constructor(e,t,i,n){super(),this.instanceId=e,this._cols=t,this._rows=i,this._terminalService=n,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:Ng.Title,value:e})}emitReady(e,t){this._onProcessReady.fire({pid:e,cwd:t,windowsPty:void 0})}emitProcessProperty({type:e,value:t}){switch(e){case Ng.Cwd:this.emitCwd(t);break;case Ng.InitialCwd:this.emitInitialCwd(t);break;case Ng.Title:this.emitTitle(t);break;case Ng.OverrideDimensions:this.emitOverrideDimensions(t);break;case Ng.ResolvedShellLaunchConfig:this.emitResolvedShellLaunchConfig(t);break}}emitExit(e){this._onProcessExit.fire(e),this.dispose()}emitOverrideDimensions(e){this._onDidChangeProperty.fire({type:Ng.OverrideDimensions,value:e})}emitResolvedShellLaunchConfig(e){this._onDidChangeProperty.fire({type:Ng.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){}};uxe=D([_(3,RU)],uxe);function Unt(s){return[...s.entries()]}function yQt(s){return s?[...s.entries()]:[]}function CQt(s){return new Map(s)}function SQt(s){return new Map(s??[])}var hz;(function(s){s[s.TerminalCommand=0]="TerminalCommand",s[s.Opener=1]="Opener",s[s.Port=2]="Port",s[s.VscodeCommand=3]="VscodeCommand"})(hz||(hz={}));var F1;(function(s){s[s.CwdDetection=0]="CwdDetection",s[s.NaiveCwdDetection=1]="NaiveCwdDetection",s[s.CommandDetection=2]="CommandDetection",s[s.PartialCommandDetection=3]="PartialCommandDetection",s[s.BufferMarkDetection=4]="BufferMarkDetection"})(F1||(F1={}));var p8e;(function(s){s.Windows="windows",s.NoProblemsReported="noProblemsReported"})(p8e||(p8e={}));let m8e=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this._extHostContext=e,this._terminalService=t,this._terminalLinkProviderService=i,this._terminalQuickFixService=n,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 wn,this._sendCommandEventListener=new wn,this._linkProvider=this._store.add(new wn),this._os=po,this._proxy=e.getProxy(Ye.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],Unt(v[1].map)]);this._proxy.$initEnvironmentVariableCollections(m)}l.getEnvironment().then(async p=>{this._os=p?.os||po,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:N.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 uxe(r,a,c,this._terminalService):void 0,extHostTerminalId:e,forceShellIntegration:t.forceShellIntegration,isFeatureTerminal:t.isFeatureTerminal,isExtensionOwnedTerminal:t.isExtensionOwnedTerminal,useShellEnvironment:t.useShellEnvironment,isTransient:t.isTransient},n=Zs.withAsyncBody(async r=>{const a=await this._terminalService.createTerminal({config:i,location:await this._deserializeParentTerminal(t.location)});r(a)});this._extHostTerminals.set(e,n);const o=await n;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===dW.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!==dW.Editor&&this._terminalGroupService.hidePanel()}async $dispose(e){(await this._getTerminalInstance(e))?.dispose(AT.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(gxe,(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(F1.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=jr(e,t)}$stopSendingCommandEvents(){this._sendCommandEventListener.clear()}$startLinkProvider(){this._linkProvider.value=this._terminalLinkProviderService.registerLinkProvider(new AQt(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,n,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||!n)return;const c=o.outputMatcher;let l;if(c&&(l=EQt(n,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=>_8e(e,t,u));if(h)return _8e(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??AT.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(n=>this._proxy.$acceptProcessInput(t.instanceId,n)),t.onShutdown(n=>this._proxy.$acceptProcessShutdown(t.instanceId,n)),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,n){this._terminalProcessProxies.get(e)?.emitReady(t,i,n)}$sendProcessProperty(e,t){t.type===Ng.Title&&this._terminalService.getInstanceFromId(e)?.rename(t.value),this._terminalProcessProxies.get(e)?.emitProcessProperty(t)}$setEnvironmentVariableCollection(e,t,i,n){if(i){const o={persistent:t,map:CQt(i),descriptionMap:SQt(n)};this._environmentVariableService.set(e,o)}else this._environmentVariableService.delete(e)}};m8e=D([Gi(Be.MainThreadTerminalService),_(1,RU),_(2,WJe),_(3,HJe),_(4,we),_(5,FJe),_(6,Ge),_(7,OJe),_(8,cg),_(9,$Re),_(10,NJe),_(11,BJe)],m8e);let gxe=class extends V{constructor(e,t){super(),this._callback=e,this._terminalService=t,this._register(this._bufferer=new Hnt(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))}};gxe=D([_(1,RU)],gxe);class AQt{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 EQt(s,e){const t=s.join(` +`).match(e.lineMatcher);return t?{regexMatch:t,outputLines:s}:void 0}function _8e(s,e,t){let i=hz.TerminalCommand;return"uri"in t?(t.uri=N.revive(t.uri),i=hz.Opener):"id"in t&&(i=hz.VscodeCommand),{id:s,type:i,source:e,...t}}let v8e=class extends V{constructor(e,t,i){super(),this._terminalService=t,this._proxy=e.getProxy(Ye.ExtHostTerminalShellIntegration);const n=new Map;this._register(Ee(()=>{for(const d of n.values())d.dispose()}));const o=this._store.add(this._terminalService.createOnInstanceEvent(d=>M.map(M.filter(d.capabilities.onDidAddCapabilityType,h=>h===F1.CommandDetection),()=>d))).event;this._store.add(o(d=>this._proxy.$shellIntegrationChange(d.instanceId)));const r=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(F1.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,b8e(d.data),d.data.isTrusted,this._convertCwdToUri(d.data.cwd)),n.get(h)?.dispose(),n.set(h,M.accumulate(d.instance.onData,50,this._store)(u=>this._proxy.$shellExecutionData(h,u.join())))}));const c=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(F1.CommandDetection,d=>d.onCommandFinished));this._store.add(c.event(d=>{a=void 0;const h=d.instance.instanceId;n.get(h)?.dispose(),setTimeout(()=>{this._proxy.$shellExecutionEnd(h,d.data.command,b8e(d.data),d.data.isTrusted,d.data.exitCode)})}));const l=this._store.add(this._terminalService.createOnInstanceCapabilityEvent(F1.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?N.file(e):void 0}};v8e=D([Gi(Be.MainThreadTerminalShellIntegration),_(1,RU),_(2,Jr)],v8e);function b8e(s){switch(s.commandLineConfidence){case"high":return gD.High;case"medium":return gD.Medium;case"low":default:return gD.Low}}let w8e=class{constructor(e,t){this._themeService=t,this._proxy=e.getProxy(Ye.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()}};w8e=D([Gi(Be.MainThreadTheming),_(1,pn)],w8e);let y8e=class extends V{constructor(e,t,i,n,o){super(),this.viewsService=t,this.notificationService=i,this.extensionService=n,this.logService=o,this._dataProviders=this._register(new mo),this._dndControllers=new Map,this._proxy=e.getProxy(Ye.ExtHostTreeViews)}async $registerTreeViewDataProvider(e,t){this.logService.trace("MainThreadTreeViews#$registerTreeViewDataProvider",e,t),this.extensionService.whenInstalledExtensionsRegistered().then(()=>{const i=new DQt(e,this._proxy,this.notificationService),n=new Z;this._dataProviders.set(e,{dataProvider:i,dispose:()=>n.dispose()});const o=t.hasHandleDrag||t.hasHandleDrop?new xQt(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,n),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 n=this.getTreeView(e);if(n&&t)return this.reveal(n,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),n=this._dataProviders.get(e);if(i&&n){const o=n.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 n=this.getTreeView(e);n&&(n.title=t,n.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 n=this._dndControllers.get(e);if(!n)throw new Error("Unknown tree");return n.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,n,o){o=o||{select:!1,focus:!1};const r=ra(o.select)?!1:o.select,a=ra(o.focus)?!1:o.focus;let c=Math.min(lc(o.expand)?o.expand:o.expand===!0?1:0,3);t.isEmpty()&&await e.refresh();for(const d of n){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(n=>this._proxy.$setExpanded(e,n.handle,!0))),i.add(t.onDidCollapseItem(n=>this._proxy.$setExpanded(e,n.handle,!1))),i.add(t.onDidChangeSelectionAndFocus(n=>this._proxy.$setSelectionAndFocus(e,n.selection.map(({handle:o})=>o),n.focus.handle))),i.add(t.onDidChangeVisibility(n=>this._proxy.$setVisible(e,n))),i.add(t.onDidChangeCheckboxState(n=>{this._proxy.$changeCheckboxState(e,n.map(o=>({treeItemHandle:o.handle,newState:o.checkbox?.isChecked??!1})))}))}getTreeView(e){const t=Qe.as(jk.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()}};y8e=D([Gi(Be.MainThreadTreeViews),_(1,km),_(2,bi),_(3,fs),_(4,Ge)],y8e);class xQt{constructor(e,t,i,n,o){this.treeViewId=e,this.dropMimeTypes=t,this.dragMimeTypes=i,this.hasWillDrop=n,this._proxy=o,this.dataTransfersCache=new tPe}async handleDrop(e,t,i,n,o,r){const a=this.dataTransfersCache.add(e);try{const c=await P_.from(e);return i.isCancellationRequested?void 0:await this._proxy.$handleDrop(this.treeViewId,a.id,c,t?.handle,i,n,o,r)}finally{a.dispose()}}async handleDrag(e,t,i){if(!this.hasWillDrop)return;const n=await this._proxy.$handleDrag(this.treeViewId,e,t,i);if(!n)return;const o=new oce;return n.items.forEach(([r,a])=>{o.replace(r,z6(a.asString))}),o}resolveDropFileData(e,t){return this.dataTransfersCache.resolveFileData(e,t)}}class DQt{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=>(Xb.is(t)||this.notificationService.error(t),[]))}getItemsToRefresh(e){const t=[];if(e)for(const i of Object.keys(e)){const n=this.getItem(i);if(n){const o=e[i];if(this.updateTreeItem(n,o),i===o.handle)t.push(n);else{this.itemsMap.delete(i),this.itemsMap.set(n.handle,n);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 n of e){const o=new Ghe(n,i?r=>this._proxy.$resolve(this.treeViewId,n.handle,r):void 0);this.itemsMap.set(n.handle,o),t.push(o)}return t}updateTreeItem(e,t){if(t.children=t.children?t.children:void 0,e){const i=ja([...Object.keys(e instanceof Ghe?e.asTreeItem():e),...Object.keys(t)]);for(const n of i)e[n]=t[n];e instanceof Ghe&&e.resetResolve()}}}let C8e=class extends V{constructor(e,t){super(),this.downloadService=t}$download(e,t){return this.downloadService.download(N.revive(e),N.revive(t))}};C8e=D([Gi(Be.MainThreadDownloadService),_(1,kRe)],C8e);class kQt{constructor(e,t,i,n){this.proxy=e,this.handle=t,this.extensionId=i,this.extensionDisplayName=n}handleURL(e,t){return Sn.equals(this.extensionId,e.authority)?Promise.resolve(this.proxy.$handleExternalUri(this.handle,e)).then(()=>!0):Promise.resolve(!1)}}let S8e=class{constructor(e,t,i){this.urlService=t,this.extensionUrlHandler=i,this.handlers=new Map,this.proxy=e.getProxy(Ye.ExtHostUrls)}$registerUriHandler(e,t,i){const n=new kQt(this.proxy,e,t,i),o=this.urlService.registerHandler(n);return this.handlers.set(e,{extensionId:t,disposable:o}),this.extensionUrlHandler.registerExtensionHandler(t,n),Promise.resolve(void 0)}$unregisterUriHandler(e){const t=this.handlers.get(e);if(!t)return Promise.resolve(void 0);const{extensionId:i,disposable:n}=t;return this.extensionUrlHandler.unregisterExtensionHandler(i),this.handlers.delete(e),n.dispose(),Promise.resolve(void 0)}async $createAppUri(e){return this.urlService.create(e)}dispose(){this.handlers.forEach(({disposable:e})=>e.dispose()),this.handlers.clear()}};S8e=D([Gi(Be.MainThreadUrls),_(1,Oae),_(2,eXe)],S8e);const Vnt="default",IQt="workbench.externalUriOpeners",fxe={type:"string",enum:[]},A8e="\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",TQt={...B6,properties:{[IQt]:{type:"object",markdownDescription:g(8681,"Configure the opener to use for external URIs (http, https)."),defaultSnippets:[{body:{"example.com":"$1"}}],additionalProperties:{anyOf:[{type:"string",markdownDescription:g(8682,`Map URI pattern to an opener id. Example patterns: -{0}`,F8e)},{type:"string",markdownDescription:g(8682,`Map URI pattern to an opener id. +{0}`,A8e)},{type:"string",markdownDescription:g(8682,`Map URI pattern to an opener id. Example patterns: -{0}`,F8e),enum:[Ynt],enumDescriptions:[g(8683,"Open using VS Code's standard opener.")]},wxe]}}}};function VQt(s,e){wxe.enum=s,wxe.enumDescriptions=e,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(UQt)}var yxe,eM;let Cxe=(eM=class extends V{constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new sI(yxe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(Ie.PROFILE,an.MACHINE);for(const[i,n]of Object.entries(this._mementoObject||{}))this.add(i,n.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 n=this._openers.get(e);if(n){n.isCurrentlyRegistered=n.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 n=e.find(o=>o.identifier.value===i.extensionId);n?this._extensionService.canRemoveExtension(n)||i.isCurrentlyRegistered||this.delete(t):this.delete(t)}}updateSchema(){const e=[],t=[];for(const[i,n]of this._openers)e.push(i),t.push(n.extensionId);VQt(e,t)}},yxe=eM,eM.STORAGE_ID="externalUriOpeners",eM);Cxe=yxe=D([_(0,$i),_(1,fs)],Cxe);let O8e=class extends V{constructor(e,t,i,n,o,r){super(),this.extensionService=n,this.openerService=o,this.notificationService=r,this._registeredOpeners=new Map,this.proxy=e.getProxy(Ye.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new Cxe(t,n))}async*getOpeners(e){if(!(e.scheme!==pe.http&&e.scheme!==pe.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,n)=>this.proxy.$canOpenUri(e,i,n),openExternalUri:async(i,n,o)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:n.sourceUri},o)}catch(r){if(!Fr(r)){const a=new rn("default",g(4866,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:Ynt})});a.tooltip=i.toString(),this.notificationService.notify({severity:Xe.Error,message:g(4867,"Could not open uri with '{0}': {1}",e,r.toString()),actions:{primary:[a]}})}}return!0}}}async $registerUriOpener(e,t,i,n){if(this._registeredOpeners.has(e))throw new Error(`Opener with id '${e}' already registered`);this._registeredOpeners.set(e,{schemes:new Set(t),label:n,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()}};O8e=D([Gi(Be.MainThreadUriOpeners),_(1,$i),_(2,LJe),_(3,fs),_(4,Ao),_(5,bi)],O8e);let B8e=class{constructor(e,t,i,n){this.hostService=t,this.openerService=i,this.userActivityService=n,this.disposables=new Z,this.proxy=e.getProxy(Ye.ExtHostWindow),M.latch(t.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus,this.proxy,this.disposables),n.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 n=N.from(e);let o;return t&&N.parse(t).toString()===n.toString()?o=t:o=n,this.openerService.open(o,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(N.revive(e),t)).resolved}};B8e=D([Gi(Be.MainThreadWindow),_(1,xc),_(2,Ao),_(3,aMe)],B8e);var Sxe;let Axe=Sxe=class extends V{static async create(e,t,i){return e.invokeFunction(async n=>{const r=await n.get(fn).createModelReference(i);return e.createInstance(Sxe,t,i,r)})}constructor(e,t,i,n){super(),this.viewType=e,this._resource=t,this._model=i,this.textFileService=n,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=>{ji(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(gh.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)}};Axe=Sxe=D([_(3,Fo)],Axe);new Q("webviewFindWidgetVisible",!1);new Q("webviewFindWidgetFocused",!1);new Q("webviewFindWidgetEnabled",!1);var W8e;(function(s){s.NotebookRenderer="notebookRenderer",s.CustomEditor="customEditor",s.WebviewView="webviewView"})(W8e||(W8e={}));let Exe=class{constructor(e,t){this._memento=new sI(e,t),this._state=this._memento.getMemento(Ie.APPLICATION,an.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),n=this._state[i];if(n&&typeof n=="string")return n;const o=ar();return this._state[i]=o,this._memento.saveMemento(),o}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};Exe=D([_(1,$i)],Exe);let gie=class{constructor(e,t){this._store=new Exe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};gie=D([_(1,$i)],gie);let fie=class extends V{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,To.ADDED)&&(i=!1,t=!0):e.contains(this.resource,To.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let n=!1;i&&(await Sr(100,He.None),this.isDisposed()?n=!0:n=!await this.fileService.exists(this.resource)),this.orphaned!==n&&!this.isDisposed()&&this.setOrphaned(n)}}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()}};fie=D([_(1,Jt)],fie);var cj,TF;(function(s){s[s.Custom=0]="Custom",s[s.Text=1]="Text"})(TF||(TF={}));let xxe=class extends V{constructor(e,t,i,n,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 mo),this._editorRenameBackups=new Map,this._webviewOriginStore=new gie("mainThreadCustomEditors.origins",o),this._proxyCustomEditors=e.getProxy(Ye.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of r.workingCopies)m instanceof LF&&qy(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof oB&&n.activateByEvent(`onCustomEditor:${f.viewType}`),!1),resolveWebview:()=>{throw new Error("not implemented")}})),this._register(a.onWillRunWorkingCopyFileOperation(async f=>this.onWillRunWorkingCopyFileOperation(f)))}$registerTextEditorProvider(e,t,i,n,o){this.registerEditorProvider(TF.Text,wte(e),t,i,n,!0,o)}$registerCustomEditorProvider(e,t,i,n,o){this.registerEditorProvider(TF.Custom,wte(e),t,i,{},n,o)}registerEditorProvider(e,t,i,n,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 oB&&l.viewType===i,resolveWebview:async(l,d)=>{const h=ar(),u=l.resource;l.webview.origin=this._webviewOriginStore.getOrigin(i,t.id),this.mainThreadWebviewPanels.addWebviewInput(h,l,{serializeBuffersForPostMessage:a}),l.webview.options=n,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){vt(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,{},He.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},rI(this._editorGroupService,l.group||0),d)}catch(m){vt(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,n,o){const r=this._customEditorService.models.tryRetain(t,i);if(r)return r;switch(e){case TF.Text:{const a=Axe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case TF.Custom:{const a=LF.create(this._instantiationService,this._proxyCustomEditors,i,t,n,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof oB&&ji(c.resource,t)),o);return this._customEditorService.models.add(t,i,a)}}}async $onDidEdit(e,t,i,n){(await this.getCustomEditorModel(e,t)).pushEdit(i,n)}async $onContentChange(e,t){(await this.getCustomEditorModel(e,t)).changeContent()}async getCustomEditorModel(e,t){const i=N.revive(e),n=await this._customEditorService.models.get(i,t);if(!n||!(n instanceof LF))throw new Error("Could not find model for webview editor");return n}async onWillRunWorkingCopyFileOperation(e){e.operation===Ai.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 LF&&i.isDirty()){const n=await i.backup(He.None);n.meta&&this._editorRenameBackups.set(i.editorResource.toString(),n.meta)}})())}};xxe=D([_(3,fs),_(4,$i),_(5,Rm),_(6,zb),_(7,JRe),_(8,Po),_(9,ei),_(10,we),_(11,N6)],xxe);var NC;(function(s){let e;(function(i){i[i.Allowed=0]="Allowed",i[i.NotAllowed=1]="NotAllowed",i[i.Pending=2]="Pending"})(e=s.Type||(s.Type={})),s.Allowed=Object.freeze({type:e.Allowed}),s.NotAllowed=Object.freeze({type:e.NotAllowed});class t{constructor(n){this.operation=n,this.type=e.Pending}}s.Pending=t})(NC||(NC={}));let LF=cj=class extends fie{static async create(e,t,i,n,o,r,a){const c=r();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(n,i,o.backupId,l,a);return e.createInstance(cj,t,i,n,!!o.backupId,d,!!l,r)}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){super(cj.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=NC.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=RNe,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=M.None,this._fromBackup=n,o&&(this._register(f.registerWorkingCopy(this)),this._register(m.onWillStop(v=>{this.isDirty()&&v.veto((async()=>!await this.save())(),g(9831,"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,"-"),n=`/${T8(t.with({query:null,fragment:null}).toString(!0))}`;return N.from({scheme:pe.vscodeCustomEditor,authority:i,path:n,query:JSON.stringify(t.toJSON())})}get name(){return Ko(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?aC.Untitled:aC.None}isDirty(){return this._isDirtyFromContentChange?!0:this._edits.length>0?this._savePoint!==this._currentEditIndex:this._fromBackup}isUntitled(){return this._editorResource.scheme===pe.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:Al.Resource,resource:this._editorResource,label:t??g(9832,"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,n=typeof e=="number"?this._edits.splice(t,i,e):this._edits.splice(t,i);n.length&&this._proxy.$disposeEdits(this._editorResource,this._viewType,n)}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,He.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=Rr(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=x8(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await Rr(n=>this._proxy.$onSaveAs(this._editorResource,this.viewType,t,n)),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===NC.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===NC.Type.Pending&&this._hotExitState.operation.cancel();const r=new NC.Pending(Rr(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=NC.Allowed,o.meta.backupId=c,this._backupId=c)}catch(c){if(Fr(c))throw c;this._hotExitState===r&&(this._hotExitState=NC.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===NC.Allowed)return o;throw new Error(`Cannot backup in this state: ${a}`)}};LF=cj=D([_(7,ag),_(8,Jt),_(9,Fs),_(10,JA),_(11,Jr),_(12,Rm),_(13,bf),_(14,fs)],LF);class zQt{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 $Qt{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 Dxe=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=n,this._editorService=o,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new $Qt("mainThreadWebview-"),this._webviewInputs=new zQt,this._revivers=this._register(new mo),this.webviewOriginStore=new gie("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(Ye.ExtHostWebviewPanels),this._register(M.any(o.onDidActiveEditorChange,o.onDidVisibleEditorsChange,n.onDidAddGroup,n.onDidRemoveGroup,n.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,n,o){const r=this.getTargetGroupFromShowOptions(o),a=o?{preserveFocus:!!o.preserveFocus,group:r}:{},c=wte(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:n.title,options:KQt(n.panelOptions),contentOptions:yte(n.webviewOptions),extension:c},this.webviewPanelViewType.fromExternal(i),n.title,a);this.addWebviewInput(t,d,{serializeBuffersForPostMessage:n.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=GQt(t))}$reveal(e,t){const i=this.tryGetWebviewInput(e);if(!i||i.isDisposed())return;const n=this.getTargetGroupFromShowOptions(t);this._webviewWorkbenchService.revealWebview(i,n,!!t.preserveFocus)}getTargetGroupFromShowOptions(e){if(typeof e.viewColumn>"u"||e.viewColumn===hA||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return hA;if(e.viewColumn===ev)return ev;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(hu.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:tCe.LAST});if(i){const n=UW(this._configurationService);return this._editorGroupService.addGroup(i,n)}}return hA}$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 n=this.webviewPanelViewType.toExternal(i.viewType);if(!n){i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(i.viewType));return}const o=ar();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,n,{title:i.getTitle(),state:r,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},rI(this._editorGroupService,i.group||0))}catch(a){vt(a),i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(n))}}}))}$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=(n,o,r)=>{if(!(r instanceof Ou))return;r.updateGroup(n.id);const a=this._webviewInputs.getHandleForInput(r);a&&(t[a]={visible:o===n.activeEditor,active:r===e,position:rI(this._editorGroupService,n.id)})};for(const n of this._editorGroupService.groups)for(const o of n.editors)o instanceof qg?(i(n,o,o.primary),i(n,o,o.secondary)):i(n,o,o);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};Dxe=D([_(2,Te),_(3,Po),_(4,ei),_(5,fs),_(6,$i),_(7,Yi),_(8,N6)],Dxe);function GQt(s){if(s)return{light:N.revive(s.light),dark:N.revive(s.dark)}}function KQt(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}let kxe=class extends V{constructor(e,t,i,n){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=n,this._webviewViews=this._register(new mo),this._webviewViewProviders=this._register(new mo),this._proxy=e.getProxy(Ye.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 n=wte(e),o=this._webviewViewService.register(t,{resolve:async(r,a)=>{const c=ar();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=n,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:n.id.value,id:t});try{await this._proxy.$resolveWebviewView(c,t,r.title,l,a)}catch(d){vt(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}};kxe=D([_(2,Yi),_(3,ZJe)],kxe);let H8e=class extends V{constructor(e,t){super();const i=this._register(t.createInstance(aEe,e));e.set(Be.MainThreadWebviews,i);const n=this._register(t.createInstance(Dxe,e,i));e.set(Be.MainThreadWebviewPanels,n);const o=this._register(t.createInstance(xxe,e,i,n));e.set(Be.MainThreadCustomEditors,o);const r=this._register(t.createInstance(kxe,e,i));e.set(Be.MainThreadWebviewViews,r)}};H8e=D([QN,_(1,we)],H8e);let U8e=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=n,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(See),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(Ye.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!ad&&!f.hasProvider(v.configuration)?this._proxy.$initializeWorkspace(this.getWorkspaceData(v),this.isWorkspaceTrusted()):this._contextService.getCompleteWorkspace().then(b=>this._proxy.$initializeWorkspace(this.getWorkspaceData(b),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,n){const o=n.map(r=>({uri:N.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 n;const o=t>0,r=i>0;return o&&!r?t===1?n=g(4868,"Extension '{0}' added 1 folder to the workspace",e):n=g(4869,"Extension '{0}' added {1} folders to the workspace",e,t):r&&!o?i===1?n=g(4870,"Extension '{0}' removed 1 folder from the workspace",e):n=g(4871,"Extension '{0}' removed {1} folders from the workspace",e,i):n=g(4872,"Extension '{0}' changed folders of the workspace",e),n}_onDidChangeWorkspace(){this._proxy.$acceptWorkspaceData(this.getWorkspaceData(this._contextService.getWorkspace()))}getWorkspaceData(e){return this._contextService.getWorkbenchState()===qi.EMPTY?null:{configuration:e.configuration||void 0,isUntitled:e.configuration?g3(e.configuration,this._environmentService):!1,folders:e.folders,id:e.id,name:this._labelService.getWorkspaceLabel(e),transient:e.transient}}$startFileSearch(e,t,i){const n=N.revive(e),o=this._contextService.getWorkspace(),r=this._queryBuilder.file(n?[n]:o.folders,t);return this._searchService.fileSearch(r,i).then(a=>a.results.map(c=>c.resource),a=>Fr(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,n,o){const r=N.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,n)};return this._searchService.textSearch(l,o,d).then(u=>({limitHit:u.limitHit}),u=>Fr(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(n=>Wit(n,e,t,i))}async $save(e,t){const i=N.revive(e),n=[...this._editorService.findEditors(i,{supportSideBySide:Hs.PRIMARY})],o=await this._editorService.save(n,{reason:Cn.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return lm(this._saveResultToUris(o))}_saveResultToUris(e){return e.success?Fi(e.editors.map(t=>Na.getCanonicalUri(t,{supportSideBySide:Hs.PRIMARY}))):[]}$saveAll(e){return this._editorService.saveAll({includeUntitled:e}).then(t=>t.success)}$resolveProxy(e){return this._requestService.resolveProxy(e)}$lookupAuthorization(e){return this._requestService.lookupAuthorization(e)}$lookupKerberosAuthorization(e){return this._requestService.lookupKerberosAuthorization(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(n,o)=>this._proxy.$getEditSessionIdentifier(n.uri,o),provideEditSessionIdentityMatch:async(n,o,r,a)=>this._proxy.$provideEditSessionIdentityMatch(n.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(n,o,r)=>{const a=await this._proxy.$provideCanonicalUri(n,o,r);return a&&N.revive(a)}});this.registeredCanonicalUriProviders.set(e,i),this._toDispose.add(i)}$unregisterCanonicalUriProvider(e){this.registeredCanonicalUriProviders.get(e)?.dispose(),this.registeredCanonicalUriProviders.delete(e)}};U8e=D([Gi(Be.MainThreadWorkspace),_(1,Zae),_(2,yi),_(3,$Re),_(4,zRe),_(5,ei),_(6,iC),_(7,bi),_(8,I6),_(9,we),_(10,Fs),_(11,Za),_(12,Jt),_(13,uC),_(14,vae)],U8e);var qQt=".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;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata .text *{max-width:700px}.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}";ut(qQt,{});let Jw=class{constructor(e,t,i,n,o){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=n,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 tp{constructor(e,t,i,n){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=n.filter(o=>o.comments&&o.comments.length).map(o=>tp.createCommentNode(e,t,i,o))}static createCommentNode(e,t,i,n){const{comments:o}=n,r=o.map(a=>new Jw(e,t,i,a,n));return r.length>1&&(r[0].replies=r.slice(1,r.length)),r[0].isRoot=!0,r[0]}}const jce="comments";class Ixe extends V{constructor(e,t,i,n){super(),this.configurationService=e,this._date=re(i,fe("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupManagedHover(Pr("mouse"),this._date,"")),this.setTimestamp(n)}get useRelativeTimeSetting(){return this.configurationService.getValue(jce).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 uNe(e,!0,!0)}getDateString(e){return e.toLocaleString(ql)}}const Txe=W("commentsView.resolvedIcon",{dark:UOe,light:UOe,hcDark:wt,hcLight:wt},g(9987,"Icon color for resolved comments.")),Lxe=W("commentsView.unresolvedIcon",{dark:$pe,light:$pe,hcDark:wt,hcLight:wt},g(9988,"Icon color for unresolved comments."));W("editorCommentsWidget.replyInputBackground",sce,g(9989,"Background color for comment reply input box."));const QQt=W("editorCommentsWidget.resolvedBorder",{dark:Txe,light:Txe,hcDark:wt,hcLight:wt},g(9990,"Color of borders and arrow for resolved comments.")),pPe=W("editorCommentsWidget.unresolvedBorder",{dark:Lxe,light:Lxe,hcDark:wt,hcLight:wt},g(9991,"Color of borders and arrow for unresolved comments."));W("editorCommentsWidget.rangeBackground",st(pPe,.1),g(9992,"Color of background for comment ranges."));W("editorCommentsWidget.rangeActiveBackground",st(pPe,.1),g(9993,"Color of background for currently selected or hovered comment range."));const jQt=new Map([[ru.Unresolved,pPe],[ru.Resolved,QQt]]),YQt=new Map([[ru.Unresolved,Lxe],[ru.Resolved,Txe]]),Jnt="--comment-thread-state-color",V8e="--comment-view-thread-state-color",Xnt="--comment-thread-state-background-color";function Znt(s,e,t){const i=s!==void 0?t.get(s):void 0;return i!==void 0?e.getColor(i):void 0}function JQt(s,e){return Znt(s,e,jQt)}function XQt(s,e){return Znt(s,e,YQt)}const joe=class joe{constructor(e,t,i){this.filter=e,this.showResolved=!0,this.showUnresolved=!0,e=e.trim(),this.showResolved=t,this.showUnresolved=i;const n=e.startsWith("!");this.textFilter={text:(n?pU(e,"!"):e).trim(),negate:n}}};joe._filter=OQe,joe._messageFilter=OY;let _S=joe;class Yce extends V{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,n){this.commentThreadsMap.set(e,{ownerLabel:i,resourceWithCommentThreads:this.groupByResource(e,t,n)}),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:n,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]=tp.createCommentNode(t,i,N.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(tp.createCommentNode(t,i,N.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(tp.createCommentNode(t,i,h.resource,l))}else c.push(new tp(t,i,N.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:n,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),o.length>0||r.length>0||a.length>0}hasCommentThreads(){return!!this._resourceCommentThreads.length}getMessage(){return this._resourceCommentThreads.length?"":g(5310,"There are no comments in this workspace yet.")}groupByResource(e,t,i){const n=[],o=new Map;for(const r of i8(i,Yce._compareURIs))o.set(r[0].resource,new tp(e,t,N.parse(r[0].resource),r));return o.forEach((r,a,c)=>{n.push(r)}),n}static _compareURIs(e,t){const i=e.resource.toString(),n=t.resource.toString();return in?1:0}}const jl="workbench.panel.comments",ZQt="Comments",Rxe=Pe(5319,"Comments"),bO=class bO{getHeight(e){return e instanceof Jw&&e.hasReply()?44:22}getTemplateId(e){return e instanceof tp?bO.RESOURCE_ID:e instanceof Jw?bO.COMMENT_ID:""}};bO.RESOURCE_ID="resource-with-comments",bO.COMMENT_ID="comment-node";let Mxe=bO;class ejt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=re(e,fe(".resource-container")),i=this.labels.create(t),n=re(t,fe(".separator")),o=t.appendChild(fe(".owner"));return{resourceLabel:i,owner:o,separator:n}}renderElement(e,t,i,n){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 Nxe=class{constructor(e){this.menuService=e}getResourceActions(e){return{actions:this.getActions(_e.CommentsViewThreadActions,e).primary}}getResourceContextActions(e){return this.getActions(_e.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]],n=this.contextKeyService.createOverlay(i),o=this.menuService.getMenuActions(e,n,{shouldForwardArgs:!0}),c={primary:[],secondary:[],menu:o};return zje(o,c,"inline"),c}dispose(){this.contextKeyService=void 0}};Nxe=D([_(0,Oa)],Nxe);let Pxe=class{constructor(e,t,i,n,o,r){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=n,this.hoverService=o,this.themeService=r,this.templateId="comment-node"}renderTemplate(e){const t=re(e,fe(".comment-thread-container")),i=re(t,fe(".comment-metadata-container")),n=re(i,fe(".comment-metadata")),o={icon:re(n,fe(".icon")),userNames:re(n,fe(".user")),timestamp:new Ixe(this.configurationService,this.hoverService,re(n,fe(".timestamp-container"))),relevance:re(n,fe(".relevance")),separator:re(n,fe(".separator")),commentPreview:re(n,fe(".text")),range:re(n,fe(".range"))};o.separator.innerText="·";const r=re(i,fe(".actions")),a=new hd(r,{actionViewItemProvider:this.actionViewItemProvider}),c=re(t,fe(".comment-snippet-container")),l={container:c,icon:re(c,fe(".icon")),count:re(c,fe(".count")),lastReplyDetail:re(c,fe(".reply-detail")),separator:re(c,fe(".separator")),timestamp:new Ixe(this.configurationService,this.hoverService,re(c,fe(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...We.asClassNameArray(ve.indent));const d=[o.timestamp,l.timestamp];return{threadMetadata:o,repliesMetadata:l,actionBar:a,disposables:d}}getCountString(e){return e>2?g(5320,"{0} replies",e-1):e===2?g(5321,"1 reply"):g(5322,"1 comment")}getRenderedComment(e,t){const i=f6(e,{inline:!0,actionHandler:{callback:o=>uae(this.openerService,o,e.isTrusted),disposables:t}}),n=i.element.getElementsByTagName("img");for(let o=0;ol.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...We.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(V8e,`${l}`),i.threadMetadata.icon.style.color=`var(${V8e})`}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.setupManagedHover(Pr("mouse"),i.threadMetadata.commentPreview,d.element.textContent??""))}e.element.range&&(e.element.range.startLineNumber===e.element.range.endLineNumber?i.threadMetadata.range.textContent=g(5326,"[Ln {0}]",e.element.range.startLineNumber):i.threadMetadata.range.textContent=g(5327,"[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:ws.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(5328,"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?XQt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};Pxe=D([_(2,Ao),_(3,Te),_(4,ec),_(5,pn)],Pxe);var pie;(function(s){s[s.Resource=0]="Resource",s[s.Comment=1]="Comment"})(pie||(pie={}));class tjt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?qs.Visible:e instanceof tp?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=_S._filter(this.options.textFilter.text,_i(e.resource));if(t)return{visibility:!0,data:{type:pie.Resource,uriMatches:t||[]}}}return qs.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&ru.Resolved===e.threadState||this.options.showUnresolved&&ru.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const n=_S._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||_S._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(o=>_S._messageFilter(this.options.textFilter.text,o.comment.userName)||_S._messageFilter(this.options.textFilter.text,typeof o.comment.body=="string"?o.comment.body:o.comment.body.value)).filter(o=>!!o).flat();return n.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:pie.Comment,textMatches:n}}:n.length&&this.options.textFilter.negate&&t===qs.Recurse?!1:n.length===0&&this.options.textFilter.negate&&t===qs.Recurse?!0:t}}let Fxe=class extends x3{constructor(e,t,i,n,o,r,a,c,l){const d=new Mxe,h=WN.bind(void 0,r),u=r.createInstance(Nxe);u.setContextKeyService(n);const f=[r.createInstance(ejt,e),r.createInstance(Pxe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof Yce?"root":p instanceof tp?`${p.uniqueOwner}-${p.id}`:p instanceof Jw?`${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,n,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 Jw))return;const i=e.browserEvent;i.preventDefault(),i.stopPropagation(),this.setFocus([t]);const n=this.menus.getResourceContextActions(t);n.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e.anchor,getActions:()=>n,getActionViewItem:o=>{const r=this.keybindingService.lookupKeybinding(o.id);if(r)return new Jy(o,o,{label:!0,keybinding:r.getLabel()})},onHide:o=>{o&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:ws.CommentThread,thread:t.thread})})}filterComments(){this.refilter()}getVisibleItemCount(){let e=0;const t=this.getNode();for(const i of t.children)for(const n of i.children)n.visible&&i.visible&&e++;return e}};Fxe=D([_(3,Le),_(4,lg),_(5,we),_(6,Te),_(7,lr),_(8,Ut)],Fxe);const mPe=new Q("commentsFilterFocus",!1),est=new Q("commentsView.showResolvedFilter",!0),tst=new Q("commentsView.showUnResolvedFilter",!0);class ijt extends V{constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=tst.bindTo(this.contextKeyService),this._showResolved=est.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 oG{constructor(){super({id:"commentsFocusViewFromFilter",title:g(9994,"Focus Comments view"),keybinding:{when:mPe,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.DownArrow},viewId:jl})}async runInView(s,e){e.focus()}});At(class extends oG{constructor(){super({id:"commentsClearFilterText",title:g(9995,"Clear filter text"),keybinding:{when:mPe,weight:Ae.WorkbenchContrib,primary:S.Escape},viewId:jl})}async runInView(s,e){e.clearFilterText()}});At(class extends oG{constructor(){super({id:"commentsFocusFilter",title:g(9996,"Focus comments filter"),keybinding:{when:FU.isEqualTo(jl),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyF},viewId:jl})}async runInView(s,e){e.focusFilter()}});At(class extends oG{constructor(){super({id:`workbench.actions.${jl}.toggleUnResolvedComments`,title:g(9997,"Show Unresolved"),category:g(9998,"Comments"),toggled:{condition:tst,title:g(9999,"Show Unresolved")},menu:{id:Ice,group:"1_filter",when:he.equals("view",jl),order:1},viewId:jl})}async runInView(s,e){e.filters.showUnresolved=!e.filters.showUnresolved}});At(class extends oG{constructor(){super({id:`workbench.actions.${jl}.toggleResolvedComments`,title:g(1e4,"Show Resolved"),category:g(9998,"Comments"),toggled:{condition:est,title:g(10001,"Show Resolved")},menu:{id:Ice,group:"1_filter",when:he.equals("view",jl),order:1},viewId:jl})}async runInView(s,e){e.filters.showResolved=!e.filters.showResolved}});var njt=".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 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}";ut(njt,{});const sjt=W("editorGutter.commentRangeForeground",{dark:BOe(Gpe,Hc),light:pp(BOe(Gpe,Hc),.05),hcDark:me.white,hcLight:me.black},g(10014,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),ist=W("editorOverviewRuler.commentForeground",sjt,g(10015,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),ojt=W("editorOverviewRuler.commentUnresolvedForeground",ist,g(10016,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),rjt=W("editorGutter.commentGlyphForeground",{dark:Rl,light:Rl,hcDark:me.black,hcLight:me.white},g(10017,"Editor gutter decoration color for commenting glyphs."));W("editorGutter.commentUnresolvedGlyphForeground",rjt,g(10018,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const Yoe=class Yoe{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===ru.Unresolved,t={description:Yoe.description,isWholeLine:!0,overviewRuler:{color:$o(e?ojt:ist),position:kl.Center},collapseOnReplaceEdit:!0,linesDecorationsClassName:`comment-range-glyph comment-thread${e?"-unresolved":""}`};return Gt.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:[es.EXACT]}}dispose(){this._commentsDecorations.clear()}};Yoe.description="comment-glyph-widget";let L$=Yoe;class R${constructor(e,t,i,n,o){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=n,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 n=!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&&n&&(c=this.keybindingService.lookupKeybinding(QC.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new Jd(this.container,{secondary:!n,title:l,...y6});if(n=!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()}}let ajt=0;const cjt="commenteditordecoration";let Oxe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=n,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.keybindingService=m,this.hoverService=v,this.textModelService=b,this._commentThreadDisposables=[],this._editorHeight=W5,this.form=re(t,fe(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(AW,this.form,AW.getEditorOptions(p),r,this._parentThread)),this.commentEditorIsEmpty=x_.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=ar()+"-"+(t?this._commentThread.threadId:++ajt),n=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let o=N.from({scheme:pe.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${n}`});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=re(this.form,fe(".validation-error.hidden"));const c=re(this.form,fe(".form-actions"));this._formActions=re(c,fe(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=re(c,fe(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=YZe(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 t=this._commentThread.comments&&this._commentThread.comments.length>0?this._commentOptions?.placeHolder||g(8268,"Reply..."):this._commentOptions?.placeHolder||g(8269,"Type a new comment");this.commentEditor.updateOptions({placeholder:t})}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 n=this._commentThread.input;n.value=i,this._commentThread.input=n}this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeInput(i=>{const n=this._commentThread,o=e.getModel();n.input&&o&&n.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 R$(this.keybindingService,this._contextKeyService,e,async n=>{await this._actionRunDelegate?.(),await n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ws.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 R$(this.keybindingService,this._contextKeyService,e,async n=>{this._actionRunDelegate?.(),n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ws.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=re(t,fe(`button.review-thread-reply-button.${ZS}`)),this._register(this.hoverService.setupManagedHover(Pr("mouse"),this._reviewThreadReplyButton,this._commentOptions?.prompt||g(8268,"Reply..."))),this._reviewThreadReplyButton.textContent=this._commentOptions?.prompt||g(8268,"Reply..."),this._register(ue(this._reviewThreadReplyButton,"click",i=>this.clearAndExpandReplyArea())),this._register(ue(this._reviewThreadReplyButton,"focus",i=>this.clearAndExpandReplyArea())),e.onDidBlurEditorWidget(()=>{e.getModel().getValueLength()===0&&t.classList.contains("expand")&&t.classList.remove("expand")})}dispose(){super.dispose(),bt(this._commentThreadDisposables)}};Oxe=D([_(12,eE),_(13,Te),_(14,Ut),_(15,ec),_(16,fn)],Oxe);const Joe=class Joe extends rn{constructor(e,t){super(Joe.ID,t||g(11548,"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}};Joe.ID="toolbar.toggle.pickReactions";let n1=Joe;class ljt extends Jy{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=re(this.label,fe(".reaction-icon")),i=N.revive(e.icon);t.style.backgroundImage=Zu(i)}else{const t=re(this.label,fe("span.reaction-label"));t.innerText=e.label}if(e.count){const t=re(this.label,fe("span.reaction-count"));t.innerText=`${e.count}`}}getTooltip(){const e=this.action,t=e.enabled?g(11549,"Toggle reaction, "):"";if(e.count===void 0)return g(11550,"{0}{1} reaction",t,e.label);if(e.reactors===void 0||e.reactors.length===0){if(e.count===1)return g(11551,"{0}1 reaction with {1}",t,e.label);if(e.count>1)return g(11552,"{0}{1} reactions with {2}",t,e.count,e.label)}else{if(e.reactors.length<=10&&e.reactors.length===e.count)return g(11553,"{0}{1} reacted with {2}",t,e.reactors.join(", "),e.label);if(e.count>1){const i=e.reactors.slice(0,10);return g(11554,"{0}{1} and {2} more reacted with {3}",t,i.join(", "),e.count-i.length,e.label)}}}}const Xoe=class Xoe extends rn{constructor(e,t="",i="",n=!0,o,r,a,c){super(Xoe.ID,t,i,n,o),this.reactors=r,this.icon=a,this.count=c}};Xoe.ID="toolbar.toggle.reaction";let Bxe=Xoe;class z8e extends $_{async runAction(e,t){await e.run(...t)}}let Wxe=class extends V{get domNode(){return this._domNode}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(),this.parentEditor=e,this.commentThread=t,this.comment=i,this.pendingEdit=n,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=b,this.textModelService=w,this._editAction=null,this._commentEditContainer=null,this._commentEditor=null,this._commentEditorDisposables=[],this._commentEditorModel=null,this._editorHeight=W5,this._commentFormActions=null,this._commentEditorActions=null,this._onDidClick=new I,this.isEditing=!1,this._domNode=fe("div.review-comment"),this._contextKeyService=this._register(f.createScoped(this._domNode)),this._commentContextValue=x_.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=re(this._domNode,fe("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=re(this._domNode,fe(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",ZS),p.getValue(jce)?.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(y=>!!y.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(ue(this._domNode,ke.CLICK,()=>this.isEditing||this._onDidClick.fire(this))),this._register(ue(this._domNode,ke.CONTEXT_MENU,y=>this.onContextMenu(y))),n&&this.switchToEditMode(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>{this.toggleToolbarHidden(!0)})),this.activeCommentListeners()}activeCommentListeners(){this._register(ue(this._domNode,ke.FOCUS_IN,()=>{this.commentService.setActiveCommentAndThread(this.owner,{thread:this.commentThread,comment:this.comment})},!0))}createScroll(e,t){this._scrollable=new yN({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Ll(ct(e),n)}),this._scrollableElement=this._register(new l6(t,{horizontal:Co.Visible,vertical:Co.Visible},this._scrollable)),this._register(this._scrollableElement.onScroll(n=>{n.scrollLeftChanged&&(t.scrollLeft=n.scrollLeft),n.scrollTopChanged&&(t.scrollTop=n.scrollTop)}));const i=this._register(new ii(t,"scroll")).event;this._register(i(n=>{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=re(this._body,fe(".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=re(this._avatar,fe("img.avatar"));t.src=ef.uriToBrowserUri(N.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=re(e,fe("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 Ixe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=re(e,fe(`div.comment-title.${ZS}`)),i=re(t,fe("comment-header-info")),n=re(i,fe("strong.author"));n.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=re(i,fe("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=re(t,fe(".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 djt(t,o,!1,r=>/^inline/.test(r)),o}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:ws.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:ws.CommentThread}]}createToolbar(){this.toolbar=new VYe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===n1.ID?new sA(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,n)=>this.actionViewItemProvider(i,n),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...We.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>vb.RIGHT}):this.actionViewItemProvider(e,t),orientation:F_.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new z8e,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:n,secondary:o}=this.getToolbarActions(i);e.push(...n),(e.length||o.length)&&(this.createToolbar(),this.toolbar.setActions(e,o))}actionViewItemProvider(e,t){return e.id===n1.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===Bxe.ID?new ljt(e):e instanceof Sc?this.instantiationService.createInstance(Lb,e,{hoverDelegate:t.hoverDelegate}):e instanceof Ty?this.instantiationService.createInstance(_3,e,t):new Jy({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new n1(()=>{n?.show()},g(11540,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(o=>new rn(`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(11541,"Toggling the comment reaction failed: {0}.",r.message):g(11542,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const n=new sA(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>o.id===n1.ID?n:this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>vb.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=re(e,fe("div.comment-reactions")),this._reactionsActionBar=new hd(this._reactionActionsContainer,{actionViewItemProvider:(i,n)=>i.id===n1.ID?new sA(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...We.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>vb.RIGHT}):this.actionViewItemProvider(i,n)}),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=re(e,fe(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(AW,t,AW.getEditorOptions(this.configurationService),this._contextKeyService,this.parentThread);const i=N.from({scheme:pe.commentsInput,path:`/commentinput-${this.comment.uniqueIdInThread}-${Date.now()}.md`}),n=await this.textModelService.createModelReference(i);this._commentEditorModel=n,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(),Ll(ct(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 dt(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=YZe(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(),bt(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,n=ZV(this._body),o=this._body.scrollHeight,r=cTe(this._body)+4;this._scrollableElement.setScrollDimensions({width:n,scrollWidth:i,height:r,scrollHeight:o})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=re(this._commentDetailsContainer,fe(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=re(this._commentEditContainer,fe(".form-actions")),t=re(e,fe(".other-actions"));this.createCommentWidgetFormActions(t);const i=re(e,fe(".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 R$(this.keybindingService,this._contextKeyService,e,n=>{const o=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:ws.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 R$(this.keybindingService,this._contextKeyService,e,n=>{const o=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:ws.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===T2.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(ue(this._domNode,"mouseenter",()=>{this.toggleToolbarHidden(!1),e.classList.add("mouseover")})),this._register(ue(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&&N.from(this.comment.userIconPath).toString()!==N.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===T2.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 Eh(ct(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:_e.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new z8e,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(),bt(this._commentEditorDisposables)}};Wxe=D([_(8,we),_(9,eE),_(10,bi),_(11,lr),_(12,Le),_(13,Te),_(14,ec),_(15,mr),_(16,Ut),_(17,fn)],Wxe);function djt(s,e,t,i=n=>n==="navigation"){for(const n of s){let[o,r]=n;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 Ar),a.push(...r)}}}let Hxe=class extends V{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,n,o,r,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=n,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 mo,this._register(ue(n,ke.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new Y_(this._options,this.languageService,this.openerService))}focus(){this._commentsElement.focus()}ensureFocusIntoNewEditingComment(){this._commentElements.length===1&&this._commentElements[0].isEditing&&this._commentElements[0].setFocus(!0)}async display(){if(this._commentsElement=re(this.container,fe("div.comments-container")),this._commentsElement.setAttribute("role","presentation"),this._commentsElement.tabIndex=0,this._updateAriaLabel(),this._register(ue(this._commentsElement,ke.KEY_DOWN,e=>{const t=new En(e);if((t.equals(S.UpArrow)||t.equals(S.DownArrow))&&(!this._focusedComment||!this._commentElements[this._focusedComment].isEditing)){const i=n=>{if(this._focusedComment===void 0&&n>=0)return 0;if(this._focusedComment===void 0&&n<0)return this._commentElements.length-1;const o=this._focusedComment+n;return Math.min(Math.max(0,o),this._commentElements.length-1)};this._setFocusedComment(t.equals(S.UpArrow)?i(-1):i(1))}})),this._commentDisposable.clearAndDisposeAll(),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===T2.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=z_(this.container);this._onDidResize.fire(e)}getDimensions(){return z_(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=Cr(this._commentElements[0].domNode),n=Cr(t[0].domNode);return{thread:i,comment:n}}}async updateCommentThread(e,t){const i=this._commentElements.length,n=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.deleteAndDispose(h),this._commentElements.splice(r[d],1),h.domNode.remove()}let a=null;const c=[],l=[];for(let d=n-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===T2.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(11501,"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(11502,"Comment thread with {0} comments on the entire document. {1}.",this._commentThread.comments?.length,this._commentThread.label):this._commentsElement.ariaLabel=g(11503,"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(Wxe,this._parentEditor,this._commentThread,e,this._pendingEdits?this._pendingEdits[e.uniqueIdInThread]:void 0,this.owner,this.parentResourceUri,this._parentCommentThreadWidget,this._markdownRenderer),i=new Z;return i.add(t.onDidClick(n=>this._setFocusedComment(this._commentElements.findIndex(o=>o.comment.uniqueIdInThread===n.comment.uniqueIdInThread)))),i.add(t),this._commentDisposable.set(t,i),t}dispose(){super.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._commentDisposable.dispose()}};Hxe=D([_(9,eE),_(10,Ao),_(11,xi)],Hxe);const hjt=oi("review-comment-collapse",ve.chevronUp,g(11504,"Icon to collapse a review comment.")),ujt="expand-review-action "+We.asClassName(hjt);class gjt extends V{constructor(e,t,i,n,o,r,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=n,this._contextKeyService=o,this.instantiationService=r,this._contextMenuService=a,this._headElement=fe(".head"),e.appendChild(this._headElement),this._register(Ee(()=>this._headElement.remove())),this._fillHead()}_fillHead(){const e=re(this._headElement,fe(".review-title"));this._headingLabel=re(e,fe("span.filename")),this.createThreadLabel();const t=re(this._headElement,fe(".review-actions"));this._actionbarWidget=new hd(t,{actionViewItemProvider:WN.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new rn("review.expand",g(11505,"Collapse"),ujt,!0,()=>this._delegate.collapse());const i=this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);this._register(i),this.setActionBarActions(i),this._register(i),this._register(i.onDidChange(n=>{this.setActionBarActions(i)})),this._register(ue(this._headElement,ke.CONTEXT_MENU,n=>this.onContextMenu(n))),this._actionbarWidget.context=this._commentThread}setActionBarActions(e){const t=e.getActions({shouldForwardArgs:!0}).reduce((i,[,n])=>[...i,...n],[]);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(11506,"Start discussion"))),e&&(this._headingLabel.textContent=fT(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(n=>n[1]).flat();if(!t.length)return;const i=new Eh(ct(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new $_,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:ws.CommentThread})})}}let Uxe=class extends V{constructor(e,t,i,n,o,r){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=n,this._actionRunDelegate=o,this._keybindingService=r,this._container=re(e,fe(".comment-additional-actions")),re(this._container,fe(".section-separator")),this._buttonBar=re(this._container,fe(".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[,n]=i;for(const o of n){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 R$(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:ws.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};Uxe=D([_(5,Ut)],Uxe);var lj;function fjt(s,e,t){const i=new Set;return jr(...s.map((n,o)=>jr(n.onDidFocus(()=>{t?.(o,"focus"),i.size||e(!0),i.add(o)}),n.onDidBlur(()=>{t?.(o,"blur"),i.delete(o),i.size||e(!1)}))))}const _Pe=new Q("navigableContainerFocused",!1);var tM;let fN=(tM=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=_Pe.bindTo(e),lj.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),lj.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),jr(fjt(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,n)=>{t.log("NavigableContainerManager.partFocusChange",e.name,i,n)}),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)}))):V.None}static getActive(){return this.INSTANCE?.lastContainer}},lj=tM,tM.ID="workbench.contrib.navigableContainerManager",tM);fN=lj=D([_(0,Le),_(1,Ge),_(2,Te)],fN);function nst(s){return fN.register(s)}Qu(fN.ID,fN,yc.BlockStartup);So.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:Ae.WorkbenchContrib,when:he.and(_Pe,he.or(Sae?.negate(),kDt)),primary:U.CtrlCmd|S.UpArrow,handler:()=>{fN.getActive()?.focusPreviousWidget()}});So.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:Ae.WorkbenchContrib,when:he.and(_Pe,he.or(Sae?.negate(),IDt)),primary:U.CtrlCmd|S.DownArrow,handler:()=>{fN.getActive()?.focusNextWidget()}});let Vxe=class extends V{get commentThread(){return this._commentThread}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.container=e,this._parentEditor=t,this._owner=i,this._parentResourceUri=n,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=x_.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=x_.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new gjt(e,{collapse:this.collapse.bind(this)},this._commentMenus,this._commentThread,this._contextKeyService,this._scopedInstantiationService,p)),this._header.updateCommentThread(this._commentThread);const b=fe(".body");e.appendChild(b),this._register(Ee(()=>b.remove()));const w=this._register(Ac(b));this._register(nst({name:"commentThreadWidget",focusNotifiers:[w],focusNextWidget:()=>{this._commentReply?.isCommentEditorFocused()||this._commentReply?.expandReplyAreaAndFocusCommentEditor()},focusPreviousWidget:()=>{this._commentReply?.isCommentEditorFocused()&&this._commentThread.comments?.length&&this._body.focus()}})),this._register(w.onDidFocus(()=>this._focusedContextKey.set(!0))),this._register(w.onDidBlur(()=>this._focusedContextKey.reset())),this._register(this.configurationService.onDidChangeConfiguration(A=>{A.affectsConfiguration(vr.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(Hxe,this._parentEditor,this._owner,this._parentResourceUri,b,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=gl(this.container),this._commentThreadContextValue=x_.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const y=x_.commentControllerContext.bindTo(this._contextKeyService),C=this.commentService.getCommentController(this._owner);C?.contextValue&&y.set(C.contextValue),this.currentThreadListeners()}_setAriaLabel(){let e=g(11238,"Comment"),t;this.configurationService.getValue(vr.Comments)&&(t=this._keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp,this._contextKeyService)?.getLabel()??void 0),t?e=g(11239,"{0}, use ({1}) for accessibility help",e,t):e=g(11240,"{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(ue(this.container,ke.MOUSE_ENTER,i=>{i.toElement===this.container&&(e=!0,this.updateCurrentThread(e,t))},!0)),this._register(ue(this.container,ke.MOUSE_LEAVE,i=>{i.fromElement===this.container&&(e=!1,this.updateCurrentThread(e,t))},!0)),this._register(ue(this.container,ke.FOCUS_IN,()=>{t=!0,this.updateCurrentThread(e,t)},!0)),this._register(ue(this.container,ke.FOCUS_OUT,()=>{t=!1,this.updateCurrentThread(e,t)},!0))}async updateCommentThread(e){const t=this._commentThread.collapsibleState===Lc.Expanded&&this._commentThreadState===ru.Unresolved&&e.state===ru.Resolved;this._commentThreadState=e.state,this._commentThread=e,bt(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(jce).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(n=>{this._refresh(n)})),this._commentThread.canReply&&this._commentReply&&this._commentReply.focusIfNeeded(),this._bindCommentThreadListeners()}_refresh(e){this._body.layout(),this._onDidResize.fire(e)}dispose(){super.dispose(),bt(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(Oxe,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(Uxe,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)}ensureFocusIntoNewEditingComment(){this._body.ensureFocusIntoNewEditingComment()}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(${Jnt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${Xnt}) }`);const n=e.getColor(ITe);n&&i.push(`.review-widget .body .comment-body a { color: ${n} }`);const o=e.getColor(tft);o&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${o} }`);const r=e.getColor(mp);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(ift);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(nft);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(KRe);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(wt);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(oqe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(nqe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(sqe);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}`,A8e),enum:[Vnt],enumDescriptions:[g(8683,"Open using VS Code's standard opener.")]},fxe]}}}};function LQt(s,e){fxe.enum=s,fxe.enumDescriptions=e,Qe.as(Nn.Configuration).notifyConfigurationSchemaUpdated(TQt)}var pxe,YR;let mxe=(YR=class extends V{constructor(e,t){super(),this._extensionService=t,this._openers=new Map,this._memento=new Zk(pxe.STORAGE_ID,e),this._mementoObject=this._memento.getMemento(Ie.PROFILE,an.MACHINE);for(const[i,n]of Object.entries(this._mementoObject||{}))this.add(i,n.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 n=this._openers.get(e);if(n){n.isCurrentlyRegistered=n.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 n=e.find(o=>o.identifier.value===i.extensionId);n?this._extensionService.canRemoveExtension(n)||i.isCurrentlyRegistered||this.delete(t):this.delete(t)}}updateSchema(){const e=[],t=[];for(const[i,n]of this._openers)e.push(i),t.push(n.extensionId);LQt(e,t)}},pxe=YR,YR.STORAGE_ID="externalUriOpeners",YR);mxe=pxe=D([_(0,$i),_(1,fs)],mxe);let E8e=class extends V{constructor(e,t,i,n,o,r){super(),this.extensionService=n,this.openerService=o,this.notificationService=r,this._registeredOpeners=new Map,this.proxy=e.getProxy(Ye.ExtHostUriOpeners),this._register(i.registerExternalOpenerProvider(this)),this._contributedExternalUriOpenersStore=this._register(new mxe(t,n))}async*getOpeners(e){if(!(e.scheme!==pe.http&&e.scheme!==pe.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,n)=>this.proxy.$canOpenUri(e,i,n),openExternalUri:async(i,n,o)=>{try{await this.proxy.$openUri(e,{resolvedUri:i,sourceUri:n.sourceUri},o)}catch(r){if(!Fr(r)){const a=new rn("default",g(4866,"Open using default opener"),void 0,void 0,async()=>{await this.openerService.open(i,{allowTunneling:!1,allowContributedOpeners:Vnt})});a.tooltip=i.toString(),this.notificationService.notify({severity:Xe.Error,message:g(4867,"Could not open uri with '{0}': {1}",e,r.toString()),actions:{primary:[a]}})}}return!0}}}async $registerUriOpener(e,t,i,n){if(this._registeredOpeners.has(e))throw new Error(`Opener with id '${e}' already registered`);this._registeredOpeners.set(e,{schemes:new Set(t),label:n,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()}};E8e=D([Gi(Be.MainThreadUriOpeners),_(1,$i),_(2,SJe),_(3,fs),_(4,Ao),_(5,bi)],E8e);let x8e=class{constructor(e,t,i,n){this.hostService=t,this.openerService=i,this.userActivityService=n,this.disposables=new Z,this.proxy=e.getProxy(Ye.ExtHostWindow),M.latch(t.onDidChangeFocus)(this.proxy.$onDidChangeWindowFocus,this.proxy,this.disposables),n.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 n=N.from(e);let o;return t&&N.parse(t).toString()===n.toString()?o=t:o=n,this.openerService.open(o,{openExternal:!0,allowTunneling:i.allowTunneling,allowContributedOpeners:i.allowContributedOpeners})}async $asExternalUri(e,t){return(await this.openerService.resolveExternalUri(N.revive(e),t)).resolved}};x8e=D([Gi(Be.MainThreadWindow),_(1,xc),_(2,Ao),_(3,jRe)],x8e);var _xe;let vxe=_xe=class extends V{static async create(e,t,i){return e.invokeFunction(async n=>{const r=await n.get(fn).createModelReference(i);return e.createInstance(_xe,t,i,r)})}constructor(e,t,i,n){super(),this.viewType=e,this._resource=t,this._model=i,this.textFileService=n,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=>{ji(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(hh.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)}};vxe=_xe=D([_(3,Fo)],vxe);new Y("webviewFindWidgetVisible",!1);new Y("webviewFindWidgetFocused",!1);new Y("webviewFindWidgetEnabled",!1);var D8e;(function(s){s.NotebookRenderer="notebookRenderer",s.CustomEditor="customEditor",s.WebviewView="webviewView"})(D8e||(D8e={}));let bxe=class{constructor(e,t){this._memento=new Zk(e,t),this._state=this._memento.getMemento(Ie.APPLICATION,an.MACHINE)}getOrigin(e,t){const i=this._getKey(e,t),n=this._state[i];if(n&&typeof n=="string")return n;const o=ar();return this._state[i]=o,this._memento.saveMemento(),o}_getKey(e,t){return JSON.stringify({viewType:e,key:t})}};bxe=D([_(1,$i)],bxe);let hie=class{constructor(e,t){this._store=new bxe(e,t)}getOrigin(e,t){return this._store.getOrigin(e,t.value)}};hie=D([_(1,$i)],hie);let uie=class extends V{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,To.ADDED)&&(i=!1,t=!0):e.contains(this.resource,To.DELETED)&&(i=!0,t=!0),t&&this.orphaned!==i){let n=!1;i&&(await Sr(100,He.None),this.isDisposed()?n=!0:n=!await this.fileService.exists(this.resource)),this.orphaned!==n&&!this.isDisposed()&&this.setOrphaned(n)}}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()}};uie=D([_(1,Jt)],uie);var rj,xF;(function(s){s[s.Custom=0]="Custom",s[s.Text=1]="Text"})(xF||(xF={}));let wxe=class extends V{constructor(e,t,i,n,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 mo),this._editorRenameBackups=new Map,this._webviewOriginStore=new hie("mainThreadCustomEditors.origins",o),this._proxyCustomEditors=e.getProxy(Ye.ExtHostCustomEditors),this._register(a.registerWorkingCopyProvider(f=>{const p=[];for(const m of r.workingCopies)m instanceof DF&&$y(f,m.editorResource)&&p.push(m);return p})),this._register(u.registerResolver({canResolve:f=>(f instanceof tB&&n.activateByEvent(`onCustomEditor:${f.viewType}`),!1),resolveWebview:()=>{throw new Error("not implemented")}})),this._register(a.onWillRunWorkingCopyFileOperation(async f=>this.onWillRunWorkingCopyFileOperation(f)))}$registerTextEditorProvider(e,t,i,n,o){this.registerEditorProvider(xF.Text,vte(e),t,i,n,!0,o)}$registerCustomEditorProvider(e,t,i,n,o){this.registerEditorProvider(xF.Custom,vte(e),t,i,{},n,o)}registerEditorProvider(e,t,i,n,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 tB&&l.viewType===i,resolveWebview:async(l,d)=>{const h=ar(),u=l.resource;l.webview.origin=this._webviewOriginStore.getOrigin(i,t.id),this.mainThreadWebviewPanels.addWebviewInput(h,l,{serializeBuffersForPostMessage:a}),l.webview.options=n,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){vt(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,{},He.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},tI(this._editorGroupService,l.group||0),d)}catch(m){vt(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,n,o){const r=this._customEditorService.models.tryRetain(t,i);if(r)return r;switch(e){case xF.Text:{const a=vxe.create(this._instantiationService,i,t);return this._customEditorService.models.add(t,i,a)}case xF.Custom:{const a=DF.create(this._instantiationService,this._proxyCustomEditors,i,t,n,()=>Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(c=>c instanceof tB&&ji(c.resource,t)),o);return this._customEditorService.models.add(t,i,a)}}}async $onDidEdit(e,t,i,n){(await this.getCustomEditorModel(e,t)).pushEdit(i,n)}async $onContentChange(e,t){(await this.getCustomEditorModel(e,t)).changeContent()}async getCustomEditorModel(e,t){const i=N.revive(e),n=await this._customEditorService.models.get(i,t);if(!n||!(n instanceof DF))throw new Error("Could not find model for webview editor");return n}async onWillRunWorkingCopyFileOperation(e){e.operation===Ai.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 DF&&i.isDirty()){const n=await i.backup(He.None);n.meta&&this._editorRenameBackups.set(i.editorResource.toString(),n.meta)}})())}};wxe=D([_(3,fs),_(4,$i),_(5,Im),_(6,Hb),_(7,WRe),_(8,Po),_(9,ei),_(10,we),_(11,T6)],wxe);var MC;(function(s){let e;(function(i){i[i.Allowed=0]="Allowed",i[i.NotAllowed=1]="NotAllowed",i[i.Pending=2]="Pending"})(e=s.Type||(s.Type={})),s.Allowed=Object.freeze({type:e.Allowed}),s.NotAllowed=Object.freeze({type:e.NotAllowed});class t{constructor(n){this.operation=n,this.type=e.Pending}}s.Pending=t})(MC||(MC={}));let DF=rj=class extends uie{static async create(e,t,i,n,o,r,a){const c=r();let l;c.length!==0&&(l=c[0].untitledDocumentData);const{editable:d}=await t.$createCustomDocument(n,i,o.backupId,l,a);return e.createInstance(rj,t,i,n,!!o.backupId,d,!!l,r)}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){super(rj.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=MC.Allowed,this._currentEditIndex=-1,this._savePoint=-1,this._edits=[],this._isDirtyFromContentChange=!1,this.typeId=wNe,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=M.None,this._fromBackup=n,o&&(this._register(f.registerWorkingCopy(this)),this._register(m.onWillStop(v=>{this.isDirty()&&v.veto((async()=>!await this.save())(),g(9831,"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,"-"),n=`/${D8(t.with({query:null,fragment:null}).toString(!0))}`;return N.from({scheme:pe.vscodeCustomEditor,authority:i,path:n,query:JSON.stringify(t.toJSON())})}get name(){return Ko(this._labelService.getUriLabel(this._editorResource))}get capabilities(){return this.isUntitled()?sC.Untitled:sC.None}isDirty(){return this._isDirtyFromContentChange?!0:this._edits.length>0?this._savePoint!==this._currentEditIndex:this._fromBackup}isUntitled(){return this._editorResource.scheme===pe.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:Sl.Resource,resource:this._editorResource,label:t??g(9832,"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,n=typeof e=="number"?this._edits.splice(t,i,e):this._edits.splice(t,i);n.length&&this._proxy.$disposeEdits(this._editorResource,this._viewType,n)}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,He.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=Rr(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=S8(this._editorResource,t,this._pathService.defaultUriScheme);return this._fileDialogService.pickFileToSave(i,e?.availableFileSystems)}async saveCustomEditorAs(e,t,i){return this._editable?(await Rr(n=>this._proxy.$onSaveAs(this._editorResource,this.viewType,t,n)),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===MC.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===MC.Type.Pending&&this._hotExitState.operation.cancel();const r=new MC.Pending(Rr(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=MC.Allowed,o.meta.backupId=c,this._backupId=c)}catch(c){if(Fr(c))throw c;this._hotExitState===r&&(this._hotExitState=MC.NotAllowed),c.message&&(a=c.message)}if(this._hotExitState===MC.Allowed)return o;throw new Error(`Cannot backup in this state: ${a}`)}};DF=rj=D([_(7,sg),_(8,Jt),_(9,Fs),_(10,jA),_(11,Jr),_(12,Im),_(13,mf),_(14,fs)],DF);class RQt{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 MQt{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 yxe=class extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this._mainThreadWebviews=t,this._configurationService=i,this._editorGroupService=n,this._editorService=o,this._telemetryService=c,this._webviewWorkbenchService=l,this.webviewPanelViewType=new MQt("mainThreadWebview-"),this._webviewInputs=new RQt,this._revivers=this._register(new mo),this.webviewOriginStore=new hie("mainThreadWebviewPanel.origins",a),this._proxy=e.getProxy(Ye.ExtHostWebviewPanels),this._register(M.any(o.onDidActiveEditorChange,o.onDidVisibleEditorsChange,n.onDidAddGroup,n.onDidRemoveGroup,n.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,n,o){const r=this.getTargetGroupFromShowOptions(o),a=o?{preserveFocus:!!o.preserveFocus,group:r}:{},c=vte(e),l=this.webviewOriginStore.getOrigin(i,c.id),d=this._webviewWorkbenchService.openWebview({origin:l,providedViewType:i,title:n.title,options:PQt(n.panelOptions),contentOptions:bte(n.webviewOptions),extension:c},this.webviewPanelViewType.fromExternal(i),n.title,a);this.addWebviewInput(t,d,{serializeBuffersForPostMessage:n.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=NQt(t))}$reveal(e,t){const i=this.tryGetWebviewInput(e);if(!i||i.isDisposed())return;const n=this.getTargetGroupFromShowOptions(t);this._webviewWorkbenchService.revealWebview(i,n,!!t.preserveFocus)}getTargetGroupFromShowOptions(e){if(typeof e.viewColumn>"u"||e.viewColumn===dA||this._editorGroupService.count===1&&this._editorGroupService.activeGroup.isEmpty)return dA;if(e.viewColumn===J_)return J_;if(e.viewColumn>=0){const t=this._editorGroupService.getGroups(du.GRID_APPEARANCE)[e.viewColumn];if(t)return t.id;const i=this._editorGroupService.findGroup({location:jye.LAST});if(i){const n=OW(this._configurationService);return this._editorGroupService.addGroup(i,n)}}return dA}$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 n=this.webviewPanelViewType.toExternal(i.viewType);if(!n){i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(i.viewType));return}const o=ar();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,n,{title:i.getTitle(),state:r,panelOptions:i.webview.options,webviewOptions:i.webview.contentOptions,active:i===this._editorService.activeEditor},tI(this._editorGroupService,i.group||0))}catch(a){vt(a),i.webview.setHtml(this._mainThreadWebviews.getWebviewResolvedFailedContent(n))}}}))}$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=(n,o,r)=>{if(!(r instanceof Pu))return;r.updateGroup(n.id);const a=this._webviewInputs.getHandleForInput(r);a&&(t[a]={visible:o===n.activeEditor,active:r===e,position:tI(this._editorGroupService,n.id)})};for(const n of this._editorGroupService.groups)for(const o of n.editors)o instanceof $g?(i(n,o,o.primary),i(n,o,o.secondary)):i(n,o,o);Object.keys(t).length&&this._proxy.$onDidChangeWebviewPanelViewStates(t)}tryGetWebviewInput(e){return this._webviewInputs.getInputForHandle(e)}};yxe=D([_(2,Te),_(3,Po),_(4,ei),_(5,fs),_(6,$i),_(7,Yi),_(8,T6)],yxe);function NQt(s){if(s)return{light:N.revive(s.light),dark:N.revive(s.dark)}}function PQt(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}let Cxe=class extends V{constructor(e,t,i,n){super(),this.mainThreadWebviews=t,this._telemetryService=i,this._webviewViewService=n,this._webviewViews=this._register(new mo),this._webviewViewProviders=this._register(new mo),this._proxy=e.getProxy(Ye.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 n=vte(e),o=this._webviewViewService.register(t,{resolve:async(r,a)=>{const c=ar();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=n,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:n.id.value,id:t});try{await this._proxy.$resolveWebviewView(c,t,r.title,l,a)}catch(d){vt(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}};Cxe=D([_(2,Yi),_(3,GJe)],Cxe);let k8e=class extends V{constructor(e,t){super();const i=this._register(t.createInstance(tEe,e));e.set(Be.MainThreadWebviews,i);const n=this._register(t.createInstance(yxe,e,i));e.set(Be.MainThreadWebviewPanels,n);const o=this._register(t.createInstance(wxe,e,i,n));e.set(Be.MainThreadCustomEditors,o);const r=this._register(t.createInstance(Cxe,e,i));e.set(Be.MainThreadWebviewViews,r)}};k8e=D([$N,_(1,we)],k8e);let I8e=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){this._searchService=t,this._contextService=i,this._editSessionIdentityService=n,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(yee),this.registeredEditSessionProviders=new Map,this.registeredCanonicalUriProviders=new Map,this._proxy=e.getProxy(Ye.ExtHostWorkspace);const v=this._contextService.getWorkspace();v.configuration&&!od&&!f.hasProvider(v.configuration)?this._proxy.$initializeWorkspace(this.getWorkspaceData(v),this.isWorkspaceTrusted()):this._contextService.getCompleteWorkspace().then(b=>this._proxy.$initializeWorkspace(this.getWorkspaceData(b),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,n){const o=n.map(r=>({uri:N.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 n;const o=t>0,r=i>0;return o&&!r?t===1?n=g(4868,"Extension '{0}' added 1 folder to the workspace",e):n=g(4869,"Extension '{0}' added {1} folders to the workspace",e,t):r&&!o?i===1?n=g(4870,"Extension '{0}' removed 1 folder from the workspace",e):n=g(4871,"Extension '{0}' removed {1} folders from the workspace",e,i):n=g(4872,"Extension '{0}' changed folders of the workspace",e),n}_onDidChangeWorkspace(){this._proxy.$acceptWorkspaceData(this.getWorkspaceData(this._contextService.getWorkspace()))}getWorkspaceData(e){return this._contextService.getWorkbenchState()===qi.EMPTY?null:{configuration:e.configuration||void 0,isUntitled:e.configuration?d3(e.configuration,this._environmentService):!1,folders:e.folders,id:e.id,name:this._labelService.getWorkspaceLabel(e),transient:e.transient}}$startFileSearch(e,t,i){const n=N.revive(e),o=this._contextService.getWorkspace(),r=this._queryBuilder.file(n?[n]:o.folders,t);return this._searchService.fileSearch(r,i).then(a=>a.results.map(c=>c.resource),a=>Fr(a)?null:Promise.reject(a))}$startTextSearch(e,t,i,n,o){const r=N.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,n)};return this._searchService.textSearch(l,o,d).then(u=>({limitHit:u.limitHit}),u=>Fr(u)?null:Promise.reject(u))}$checkExists(e,t,i){return this._instantiationService.invokeFunction(n=>Lit(n,e,t,i))}async $save(e,t){const i=N.revive(e),n=[...this._editorService.findEditors(i,{supportSideBySide:Hs.PRIMARY})],o=await this._editorService.save(n,{reason:Cn.EXPLICIT,saveAs:t.saveAs,force:!t.saveAs});return rm(this._saveResultToUris(o))}_saveResultToUris(e){return e.success?Fi(e.editors.map(t=>Na.getCanonicalUri(t,{supportSideBySide:Hs.PRIMARY}))):[]}$saveAll(e){return this._editorService.saveAll({includeUntitled:e}).then(t=>t.success)}$resolveProxy(e){return this._requestService.resolveProxy(e)}$lookupAuthorization(e){return this._requestService.lookupAuthorization(e)}$lookupKerberosAuthorization(e){return this._requestService.lookupKerberosAuthorization(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(n,o)=>this._proxy.$getEditSessionIdentifier(n.uri,o),provideEditSessionIdentityMatch:async(n,o,r,a)=>this._proxy.$provideEditSessionIdentityMatch(n.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(n,o,r)=>{const a=await this._proxy.$provideCanonicalUri(n,o,r);return a&&N.revive(a)}});this.registeredCanonicalUriProviders.set(e,i),this._toDispose.add(i)}$unregisterCanonicalUriProvider(e){this.registeredCanonicalUriProviders.get(e)?.dispose(),this.registeredCanonicalUriProviders.delete(e)}};I8e=D([Gi(Be.MainThreadWorkspace),_(1,jae),_(2,yi),_(3,RRe),_(4,LRe),_(5,ei),_(6,Zy),_(7,bi),_(8,E6),_(9,we),_(10,Fs),_(11,Za),_(12,Jt),_(13,cC),_(14,fae)],I8e);var FQt=".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;overflow:hidden;padding-right:5px;text-overflow:ellipsis}.comments-panel .comments-panel-container .tree-container .comment-thread-container .comment-metadata .text *{max-width:700px}.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}";ut(FQt,{});let Qw=class{constructor(e,t,i,n,o){this.uniqueOwner=e,this.owner=t,this.resource=i,this.comment=n,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 Xf{constructor(e,t,i,n){this.uniqueOwner=e,this.owner=t,this.id=i.toString(),this.resource=i,this.commentThreads=n.filter(o=>o.comments&&o.comments.length).map(o=>Xf.createCommentNode(e,t,i,o))}static createCommentNode(e,t,i,n){const{comments:o}=n,r=o.map(a=>new Qw(e,t,i,a,n));return r.length>1&&(r[0].replies=r.slice(1,r.length)),r[0].isRoot=!0,r[0]}}const Gce="comments";class Sxe extends V{constructor(e,t,i,n){super(),this.configurationService=e,this._date=re(i,fe("span.timestamp")),this._date.style.display="none",this._useRelativeTime=this.useRelativeTimeSetting,this.hover=this._register(t.setupManagedHover(Pr("mouse"),this._date,"")),this.setTimestamp(n)}get useRelativeTimeSetting(){return this.configurationService.getValue(Gce).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 eNe(e,!0,!0)}getDateString(e){return e.toLocaleString(Kl)}}const Axe=W("commentsView.resolvedIcon",{dark:IOe,light:IOe,hcDark:wt,hcLight:wt},g(9987,"Icon color for resolved comments.")),Exe=W("commentsView.unresolvedIcon",{dark:Bpe,light:Bpe,hcDark:wt,hcLight:wt},g(9988,"Icon color for unresolved comments."));W("editorCommentsWidget.replyInputBackground",ece,g(9989,"Background color for comment reply input box."));const OQt=W("editorCommentsWidget.resolvedBorder",{dark:Axe,light:Axe,hcDark:wt,hcLight:wt},g(9990,"Color of borders and arrow for resolved comments.")),nPe=W("editorCommentsWidget.unresolvedBorder",{dark:Exe,light:Exe,hcDark:wt,hcLight:wt},g(9991,"Color of borders and arrow for unresolved comments."));W("editorCommentsWidget.rangeBackground",st(nPe,.1),g(9992,"Color of background for comment ranges."));W("editorCommentsWidget.rangeActiveBackground",st(nPe,.1),g(9993,"Color of background for currently selected or hovered comment range."));const BQt=new Map([[ou.Unresolved,nPe],[ou.Resolved,OQt]]),WQt=new Map([[ou.Unresolved,Exe],[ou.Resolved,Axe]]),znt="--comment-thread-state-color",T8e="--comment-view-thread-state-color",$nt="--comment-thread-state-background-color";function Gnt(s,e,t){const i=s!==void 0?t.get(s):void 0;return i!==void 0?e.getColor(i):void 0}function HQt(s,e){return Gnt(s,e,BQt)}function UQt(s,e){return Gnt(s,e,WQt)}const Goe=class Goe{constructor(e,t,i){this.filter=e,this.showResolved=!0,this.showUnresolved=!0,e=e.trim(),this.showResolved=t,this.showUnresolved=i;const n=e.startsWith("!");this.textFilter={text:(n?dU(e,"!"):e).trim(),negate:n}}};Goe._filter=IQe,Goe._messageFilter=PY;let mS=Goe;class Kce extends V{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,n){this.commentThreadsMap.set(e,{ownerLabel:i,resourceWithCommentThreads:this.groupByResource(e,t,n)}),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:n,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]=Xf.createCommentNode(t,i,N.parse(h.id),l):l.comments&&l.comments.length&&h.commentThreads.push(Xf.createCommentNode(t,i,N.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(Xf.createCommentNode(t,i,h.resource,l))}else c.push(new Xf(t,i,N.parse(l.resource),[l]))}),this.commentThreadsMap.set(t,{ownerLabel:n,resourceWithCommentThreads:c}),this.updateResourceCommentThreads(),o.length>0||r.length>0||a.length>0}hasCommentThreads(){return!!this._resourceCommentThreads.length}getMessage(){return this._resourceCommentThreads.length?"":g(5310,"There are no comments in this workspace yet.")}groupByResource(e,t,i){const n=[],o=new Map;for(const r of Zz(i,Kce._compareURIs))o.set(r[0].resource,new Xf(e,t,N.parse(r[0].resource),r));return o.forEach((r,a,c)=>{n.push(r)}),n}static _compareURIs(e,t){const i=e.resource.toString(),n=t.resource.toString();return in?1:0}}const Ql="workbench.panel.comments",VQt="Comments",xxe=Fe(5319,"Comments"),pO=class pO{getHeight(e){return e instanceof Qw&&e.hasReply()?44:22}getTemplateId(e){return e instanceof Xf?pO.RESOURCE_ID:e instanceof Qw?pO.COMMENT_ID:""}};pO.RESOURCE_ID="resource-with-comments",pO.COMMENT_ID="comment-node";let Dxe=pO;class zQt{constructor(e){this.labels=e,this.templateId="resource-with-comments"}renderTemplate(e){const t=re(e,fe(".resource-container")),i=this.labels.create(t),n=re(t,fe(".separator")),o=t.appendChild(fe(".owner"));return{resourceLabel:i,owner:o,separator:n}}renderElement(e,t,i,n){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 kxe=class{constructor(e){this.menuService=e}getResourceActions(e){return{actions:this.getActions(_e.CommentsViewThreadActions,e).primary}}getResourceContextActions(e){return this.getActions(_e.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]],n=this.contextKeyService.createOverlay(i),o=this.menuService.getMenuActions(e,n,{shouldForwardArgs:!0}),c={primary:[],secondary:[],menu:o};return Pje(o,c,"inline"),c}dispose(){this.contextKeyService=void 0}};kxe=D([_(0,Oa)],kxe);let Ixe=class{constructor(e,t,i,n,o,r){this.actionViewItemProvider=e,this.menus=t,this.openerService=i,this.configurationService=n,this.hoverService=o,this.themeService=r,this.templateId="comment-node"}renderTemplate(e){const t=re(e,fe(".comment-thread-container")),i=re(t,fe(".comment-metadata-container")),n=re(i,fe(".comment-metadata")),o={icon:re(n,fe(".icon")),userNames:re(n,fe(".user")),timestamp:new Sxe(this.configurationService,this.hoverService,re(n,fe(".timestamp-container"))),relevance:re(n,fe(".relevance")),separator:re(n,fe(".separator")),commentPreview:re(n,fe(".text")),range:re(n,fe(".range"))};o.separator.innerText="·";const r=re(i,fe(".actions")),a=new ld(r,{actionViewItemProvider:this.actionViewItemProvider}),c=re(t,fe(".comment-snippet-container")),l={container:c,icon:re(c,fe(".icon")),count:re(c,fe(".count")),lastReplyDetail:re(c,fe(".reply-detail")),separator:re(c,fe(".separator")),timestamp:new Sxe(this.configurationService,this.hoverService,re(c,fe(".timestamp-container")))};l.separator.innerText="·",l.icon.classList.add(...We.asClassNameArray(ve.indent));const d=[o.timestamp,l.timestamp];return{threadMetadata:o,repliesMetadata:l,actionBar:a,disposables:d}}getCountString(e){return e>2?g(5320,"{0} replies",e-1):e===2?g(5321,"1 reply"):g(5322,"1 comment")}getRenderedComment(e,t){const i=d6(e,{inline:!0,actionHandler:{callback:o=>cae(this.openerService,o,e.isTrusted),disposables:t}}),n=i.element.getElementsByTagName("img");for(let o=0;ol.startsWith("codicon"))),i.threadMetadata.icon.classList.add(...We.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(T8e,`${l}`),i.threadMetadata.icon.style.color=`var(${T8e})`}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.setupManagedHover(Pr("mouse"),i.threadMetadata.commentPreview,d.element.textContent??""))}e.element.range&&(e.element.range.startLineNumber===e.element.range.endLineNumber?i.threadMetadata.range.textContent=g(5326,"[Ln {0}]",e.element.range.startLineNumber):i.threadMetadata.range.textContent=g(5327,"[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:ws.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(5328,"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?UQt(e,t):void 0}disposeTemplate(e){e.disposables.forEach(t=>t.dispose()),e.actionBar.dispose()}};Ixe=D([_(2,Ao),_(3,Te),_(4,ec),_(5,pn)],Ixe);var gie;(function(s){s[s.Resource=0]="Resource",s[s.Comment=1]="Comment"})(gie||(gie={}));class $Qt{constructor(e){this.options=e}filter(e,t){return this.options.filter===""&&this.options.showResolved&&this.options.showUnresolved?qs.Visible:e instanceof Xf?this.filterResourceMarkers(e):this.filterCommentNode(e,t)}filterResourceMarkers(e){if(this.options.textFilter.text&&!this.options.textFilter.negate){const t=mS._filter(this.options.textFilter.text,_i(e.resource));if(t)return{visibility:!0,data:{type:gie.Resource,uriMatches:t||[]}}}return qs.Recurse}filterCommentNode(e,t){if(!(e.threadState===void 0||this.options.showResolved&&ou.Resolved===e.threadState||this.options.showUnresolved&&ou.Unresolved===e.threadState))return!1;if(!this.options.textFilter.text)return!0;const n=mS._messageFilter(this.options.textFilter.text,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)||mS._messageFilter(this.options.textFilter.text,e.comment.userName)||e.replies.map(o=>mS._messageFilter(this.options.textFilter.text,o.comment.userName)||mS._messageFilter(this.options.textFilter.text,typeof o.comment.body=="string"?o.comment.body:o.comment.body.value)).filter(o=>!!o).flat();return n.length&&!this.options.textFilter.negate?{visibility:!0,data:{type:gie.Comment,textMatches:n}}:n.length&&this.options.textFilter.negate&&t===qs.Recurse?!1:n.length===0&&this.options.textFilter.negate&&t===qs.Recurse?!0:t}}let Txe=class extends S3{constructor(e,t,i,n,o,r,a,c,l){const d=new Dxe,h=PN.bind(void 0,r),u=r.createInstance(kxe);u.setContextKeyService(n);const f=[r.createInstance(zQt,e),r.createInstance(Ixe,h,u)];super("CommentsTree",t,d,f,{accessibilityProvider:i.accessibilityProvider,identityProvider:{getId:p=>p instanceof Kce?"root":p instanceof Xf?`${p.uniqueOwner}-${p.id}`:p instanceof Qw?`${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,n,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 Qw))return;const i=e.browserEvent;i.preventDefault(),i.stopPropagation(),this.setFocus([t]);const n=this.menus.getResourceContextActions(t);n.length&&this.contextMenuService.showContextMenu({getAnchor:()=>e.anchor,getActions:()=>n,getActionViewItem:o=>{const r=this.keybindingService.lookupKeybinding(o.id);if(r)return new Qy(o,o,{label:!0,keybinding:r.getLabel()})},onHide:o=>{o&&this.domFocus()},getActionsContext:()=>({commentControlHandle:t.controllerHandle,commentThreadHandle:t.threadHandle,$mid:ws.CommentThread,thread:t.thread})})}filterComments(){this.refilter()}getVisibleItemCount(){let e=0;const t=this.getNode();for(const i of t.children)for(const n of i.children)n.visible&&i.visible&&e++;return e}};Txe=D([_(3,Le),_(4,rg),_(5,we),_(6,Te),_(7,lr),_(8,Ut)],Txe);const sPe=new Y("commentsFilterFocus",!1),Knt=new Y("commentsView.showResolvedFilter",!0),qnt=new Y("commentsView.showUnResolvedFilter",!0);class GQt extends V{constructor(e,t){super(),this.contextKeyService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._showUnresolved=qnt.bindTo(this.contextKeyService),this._showResolved=Knt.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 tG{constructor(){super({id:"commentsFocusViewFromFilter",title:g(9994,"Focus Comments view"),keybinding:{when:sPe,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.DownArrow},viewId:Ql})}async runInView(s,e){e.focus()}});At(class extends tG{constructor(){super({id:"commentsClearFilterText",title:g(9995,"Clear filter text"),keybinding:{when:sPe,weight:Ae.WorkbenchContrib,primary:S.Escape},viewId:Ql})}async runInView(s,e){e.clearFilterText()}});At(class extends tG{constructor(){super({id:"commentsFocusFilter",title:g(9996,"Focus comments filter"),keybinding:{when:LU.isEqualTo(Ql),weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyF},viewId:Ql})}async runInView(s,e){e.focusFilter()}});At(class extends tG{constructor(){super({id:`workbench.actions.${Ql}.toggleUnResolvedComments`,title:g(9997,"Show Unresolved"),category:g(9998,"Comments"),toggled:{condition:qnt,title:g(9999,"Show Unresolved")},menu:{id:Ece,group:"1_filter",when:he.equals("view",Ql),order:1},viewId:Ql})}async runInView(s,e){e.filters.showUnresolved=!e.filters.showUnresolved}});At(class extends tG{constructor(){super({id:`workbench.actions.${Ql}.toggleResolvedComments`,title:g(1e4,"Show Resolved"),category:g(9998,"Comments"),toggled:{condition:Knt,title:g(10001,"Show Resolved")},menu:{id:Ece,group:"1_filter",when:he.equals("view",Ql),order:1},viewId:Ql})}async runInView(s,e){e.filters.showResolved=!e.filters.showResolved}});var KQt=".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 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}";ut(KQt,{});const qQt=W("editorGutter.commentRangeForeground",{dark:xOe(Wpe,Hc),light:up(xOe(Wpe,Hc),.05),hcDark:me.white,hcLight:me.black},g(10014,"Editor gutter decoration color for commenting ranges. This color should be opaque.")),Qnt=W("editorOverviewRuler.commentForeground",qQt,g(10015,"Editor overview ruler decoration color for resolved comments. This color should be opaque.")),QQt=W("editorOverviewRuler.commentUnresolvedForeground",Qnt,g(10016,"Editor overview ruler decoration color for unresolved comments. This color should be opaque.")),jQt=W("editorGutter.commentGlyphForeground",{dark:Ll,light:Ll,hcDark:me.black,hcLight:me.white},g(10017,"Editor gutter decoration color for commenting glyphs."));W("editorGutter.commentUnresolvedGlyphForeground",jQt,g(10018,"Editor gutter decoration color for commenting glyphs for unresolved comment threads."));const Koe=class Koe{constructor(e,t){this._commentsOptions=this.createDecorationOptions(),this._editor=e,this._commentsDecorations=this._editor.createDecorationsCollection(),this.setLineNumber(t)}createDecorationOptions(){const e=this._threadState===ou.Unresolved,t={description:Koe.description,isWholeLine:!0,overviewRuler:{color:$o(e?QQt:Qnt),position:Dl.Center},collapseOnReplaceEdit:!0,linesDecorationsClassName:`comment-range-glyph comment-thread${e?"-unresolved":""}`};return Gt.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:[es.EXACT]}}dispose(){this._commentsDecorations.clear()}};Koe.description="comment-glyph-widget";let k$=Koe;class I${constructor(e,t,i,n,o){this.keybindingService=e,this.contextKeyService=t,this.container=i,this.actionHandler=n,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 n=!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&&n&&(c=this.keybindingService.lookupKeybinding(qC.Submit,this.contextKeyService)?.getLabel());const l=c?`${a.label} (${c})`:a.label,d=new jd(this.container,{secondary:!n,title:l,..._6});if(n=!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()}}let YQt=0;const JQt="commenteditordecoration";let Lxe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(),this.owner=e,this._parentEditor=i,this._commentThread=n,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.keybindingService=m,this.hoverService=v,this.textModelService=b,this._commentThreadDisposables=[],this._editorHeight=F5,this.form=re(t,fe(".comment-form")),this.commentEditor=this._register(this._scopedInstatiationService.createInstance(wW,this.form,wW.getEditorOptions(p),r,this._parentThread)),this.commentEditorIsEmpty=S_.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=ar()+"-"+(t?this._commentThread.threadId:++YQt),n=JSON.stringify({extensionId:this._commentThread.extensionId,commentThreadId:this._commentThread.threadId});let o=N.from({scheme:pe.commentsInput,path:`/${this._commentThread.extensionId}/commentinput-${i}.md?${n}`});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=re(this.form,fe(".validation-error.hidden"));const c=re(this.form,fe(".form-actions"));this._formActions=re(c,fe(".other-actions")),this.createCommentWidgetFormActions(this._formActions,a.object.textEditorModel),this._editorActions=re(c,fe(".editor-actions")),this.createCommentWidgetEditorActions(this._editorActions,a.object.textEditorModel)}calculateEditorHeight(){const e=VZe(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 t=this._commentThread.comments&&this._commentThread.comments.length>0?this._commentOptions?.placeHolder||g(8268,"Reply..."):this._commentOptions?.placeHolder||g(8269,"Type a new comment");this.commentEditor.updateOptions({placeholder:t})}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 n=this._commentThread.input;n.value=i,this._commentThread.input=n}this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._commentThreadDisposables.push(this._commentThread.onDidChangeInput(i=>{const n=this._commentThread,o=e.getModel();n.input&&o&&n.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 I$(this.keybindingService,this._contextKeyService,e,async n=>{await this._actionRunDelegate?.(),await n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ws.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 I$(this.keybindingService,this._contextKeyService,e,async n=>{this._actionRunDelegate?.(),n.run({thread:this._commentThread,text:this.commentEditor.getValue(),$mid:ws.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=re(t,fe(`button.review-thread-reply-button.${XS}`)),this._register(this.hoverService.setupManagedHover(Pr("mouse"),this._reviewThreadReplyButton,this._commentOptions?.prompt||g(8268,"Reply..."))),this._reviewThreadReplyButton.textContent=this._commentOptions?.prompt||g(8268,"Reply..."),this._register(ue(this._reviewThreadReplyButton,"click",i=>this.clearAndExpandReplyArea())),this._register(ue(this._reviewThreadReplyButton,"focus",i=>this.clearAndExpandReplyArea())),e.onDidBlurEditorWidget(()=>{e.getModel().getValueLength()===0&&t.classList.contains("expand")&&t.classList.remove("expand")})}dispose(){super.dispose(),bt(this._commentThreadDisposables)}};Lxe=D([_(12,XA),_(13,Te),_(14,Ut),_(15,ec),_(16,fn)],Lxe);const qoe=class qoe extends rn{constructor(e,t){super(qoe.ID,t||g(11548,"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}};qoe.ID="toolbar.toggle.pickReactions";let Z0=qoe;class XQt extends Qy{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=re(this.label,fe(".reaction-icon")),i=N.revive(e.icon);t.style.backgroundImage=Yu(i)}else{const t=re(this.label,fe("span.reaction-label"));t.innerText=e.label}if(e.count){const t=re(this.label,fe("span.reaction-count"));t.innerText=`${e.count}`}}getTooltip(){const e=this.action,t=e.enabled?g(11549,"Toggle reaction, "):"";if(e.count===void 0)return g(11550,"{0}{1} reaction",t,e.label);if(e.reactors===void 0||e.reactors.length===0){if(e.count===1)return g(11551,"{0}1 reaction with {1}",t,e.label);if(e.count>1)return g(11552,"{0}{1} reactions with {2}",t,e.count,e.label)}else{if(e.reactors.length<=10&&e.reactors.length===e.count)return g(11553,"{0}{1} reacted with {2}",t,e.reactors.join(", "),e.label);if(e.count>1){const i=e.reactors.slice(0,10);return g(11554,"{0}{1} and {2} more reacted with {3}",t,i.join(", "),e.count-i.length,e.label)}}}}const Qoe=class Qoe extends rn{constructor(e,t="",i="",n=!0,o,r,a,c){super(Qoe.ID,t,i,n,o),this.reactors=r,this.icon=a,this.count=c}};Qoe.ID="toolbar.toggle.reaction";let Rxe=Qoe;class L8e extends U_{async runAction(e,t){await e.run(...t)}}let Mxe=class extends V{get domNode(){return this._domNode}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w){super(),this.parentEditor=e,this.commentThread=t,this.comment=i,this.pendingEdit=n,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=b,this.textModelService=w,this._editAction=null,this._commentEditContainer=null,this._commentEditor=null,this._commentEditorDisposables=[],this._commentEditorModel=null,this._editorHeight=F5,this._commentFormActions=null,this._commentEditorActions=null,this._onDidClick=new I,this.isEditing=!1,this._domNode=fe("div.review-comment"),this._contextKeyService=this._register(f.createScoped(this._domNode)),this._commentContextValue=S_.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=re(this._domNode,fe("div.avatar-container")),this.updateCommentUserIcon(this.comment.userIconPath),this._commentDetailsContainer=re(this._domNode,fe(".review-comment-contents")),this.createHeader(this._commentDetailsContainer),this._body=document.createElement("div"),this._body.classList.add("comment-body",XS),p.getValue(Gce)?.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(y=>!!y.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(ue(this._domNode,ke.CLICK,()=>this.isEditing||this._onDidClick.fire(this))),this._register(ue(this._domNode,ke.CONTEXT_MENU,y=>this.onContextMenu(y))),n&&this.switchToEditMode(),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>{this.toggleToolbarHidden(!0)})),this.activeCommentListeners()}activeCommentListeners(){this._register(ue(this._domNode,ke.FOCUS_IN,()=>{this.commentService.setActiveCommentAndThread(this.owner,{thread:this.commentThread,comment:this.comment})},!0))}createScroll(e,t){this._scrollable=new _N({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:n=>Tl(ct(e),n)}),this._scrollableElement=this._register(new o6(t,{horizontal:Co.Visible,vertical:Co.Visible},this._scrollable)),this._register(this._scrollableElement.onScroll(n=>{n.scrollLeftChanged&&(t.scrollLeft=n.scrollLeft),n.scrollTopChanged&&(t.scrollTop=n.scrollTop)}));const i=this._register(new ii(t,"scroll")).event;this._register(i(n=>{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=re(this._body,fe(".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=re(this._avatar,fe("img.avatar"));t.src=Jg.uriToBrowserUri(N.revive(e)).toString(!0),t.onerror=i=>t.remove()}}get onDidClick(){return this._onDidClick.event}createTimestamp(e){this._timestamp=re(e,fe("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 Sxe(this.configurationService,this.hoverService,this._timestamp,t),this._register(this._timestampWidget)):this._timestampWidget?.dispose()}createHeader(e){const t=re(e,fe(`div.comment-title.${XS}`)),i=re(t,fe("comment-header-info")),n=re(i,fe("strong.author"));n.innerText=this.comment.userName,this.createTimestamp(i),this._isPendingLabel=re(i,fe("span.isPending")),this.comment.label?this._isPendingLabel.innerText=this.comment.label:this._isPendingLabel.innerText="",this._actionsToolbarContainer=re(t,fe(".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 ZQt(t,o,!1,r=>/^inline/.test(r)),o}get commentNodeContext(){return[{thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,$mid:ws.CommentNode},{commentControlHandle:this.commentThread.controllerHandle,commentThreadHandle:this.commentThread.commentThreadHandle,$mid:ws.CommentThread}]}createToolbar(){this.toolbar=new NYe(this._actionsToolbarContainer,this.contextMenuService,{actionViewItemProvider:(e,t)=>e.id===Z0.ID?new nA(e,e.menuActions,this.contextMenuService,{...t,actionViewItemProvider:(i,n)=>this.actionViewItemProvider(i,n),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...We.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>pb.RIGHT}):this.actionViewItemProvider(e,t),orientation:M_.HORIZONTAL}),this.toolbar.context=this.commentNodeContext,this.toolbar.actionRunner=new L8e,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:n,secondary:o}=this.getToolbarActions(i);e.push(...n),(e.length||o.length)&&(this.createToolbar(),this.toolbar.setActions(e,o))}actionViewItemProvider(e,t){return e.id===Z0.ID?t={label:!1,icon:!0}:t={label:!1,icon:!0},e.id===Rxe.ID?new XQt(e):e instanceof Sc?this.instantiationService.createInstance(kb,e,{hoverDelegate:t.hoverDelegate}):e instanceof Dy?this.instantiationService.createInstance(f3,e,t):new Qy({},e,t)}async submitComment(){this._commentEditor&&this._commentFormActions&&(await this._commentFormActions.triggerDefaultAction(),this.pendingEdit=void 0)}createReactionPicker(e){const t=this._register(new Z0(()=>{n?.show()},g(11540,"Toggle Reaction")));let i=[];e&&e.length&&(i=e.map(o=>new rn(`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(11541,"Toggling the comment reaction failed: {0}.",r.message):g(11542,"Toggling the comment reaction failed");this.notificationService.error(a)}}))),t.menuActions=i;const n=new nA(t,t.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>o.id===Z0.ID?n:this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:"toolbar-toggle-pickReactions",anchorAlignmentProvider:()=>pb.RIGHT});return t}createReactionsContainer(e){if(this._reactionActionsContainer=re(e,fe("div.comment-reactions")),this._reactionsActionBar=new ld(this._reactionActionsContainer,{actionViewItemProvider:(i,n)=>i.id===Z0.ID?new nA(i,i.menuActions,this.contextMenuService,{actionViewItemProvider:(o,r)=>this.actionViewItemProvider(o,r),actionRunner:this.actionRunner,classNames:["toolbar-toggle-pickReactions",...We.asClassNameArray(ve.reactions)],anchorAlignmentProvider:()=>pb.RIGHT}):this.actionViewItemProvider(i,n)}),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=re(e,fe(".edit-textarea"));this._commentEditor=this.instantiationService.createInstance(wW,t,wW.getEditorOptions(this.configurationService),this._contextKeyService,this.parentThread);const i=N.from({scheme:pe.commentsInput,path:`/commentinput-${this.comment.uniqueIdInThread}-${Date.now()}.md`}),n=await this.textModelService.createModelReference(i);this._commentEditorModel=n,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(),Tl(ct(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 dt(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=VZe(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(),bt(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,n=YV(this._body),o=this._body.scrollHeight,r=Y1e(this._body)+4;this._scrollableElement.setScrollDimensions({width:n,scrollWidth:i,height:r,scrollHeight:o})}async switchToEditMode(){if(this.isEditing)return;this.isEditing=!0,this._body.classList.add("hidden"),this._commentEditContainer=re(this._commentDetailsContainer,fe(".edit-container")),await this.createCommentEditor(this._commentEditContainer);const e=re(this._commentEditContainer,fe(".form-actions")),t=re(e,fe(".other-actions"));this.createCommentWidgetFormActions(t);const i=re(e,fe(".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 I$(this.keybindingService,this._contextKeyService,e,n=>{const o=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:ws.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 I$(this.keybindingService,this._contextKeyService,e,n=>{const o=this._commentEditor.getValue();n.run({thread:this.commentThread,commentUniqueId:this.comment.uniqueIdInThread,text:o,$mid:ws.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===x2.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(ue(this._domNode,"mouseenter",()=>{this.toggleToolbarHidden(!1),e.classList.add("mouseover")})),this._register(ue(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&&N.from(this.comment.userIconPath).toString()!==N.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===x2.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 Sh(ct(this._domNode),e);this.contextMenuService.showContextMenu({getAnchor:()=>t,menuId:_e.CommentThreadCommentContext,menuActionOptions:{shouldForwardArgs:!0},contextKeyService:this._contextKeyService,actionRunner:new L8e,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(),bt(this._commentEditorDisposables)}};Mxe=D([_(8,we),_(9,XA),_(10,bi),_(11,lr),_(12,Le),_(13,Te),_(14,ec),_(15,mr),_(16,Ut),_(17,fn)],Mxe);function ZQt(s,e,t,i=n=>n==="navigation"){for(const n of s){let[o,r]=n;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 Ar),a.push(...r)}}}let Nxe=class extends V{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,n,o,r,a,c,l,d,h,u){super(),this._parentEditor=e,this.owner=t,this.parentResourceUri=i,this.container=n,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 mo,this._register(ue(n,ke.FOCUS_IN,f=>{this.commentService.setActiveEditingCommentThread(this._commentThread)})),this._markdownRenderer=this._register(new q_(this._options,this.languageService,this.openerService))}focus(){this._commentsElement.focus()}ensureFocusIntoNewEditingComment(){this._commentElements.length===1&&this._commentElements[0].isEditing&&this._commentElements[0].setFocus(!0)}async display(){if(this._commentsElement=re(this.container,fe("div.comments-container")),this._commentsElement.setAttribute("role","presentation"),this._commentsElement.tabIndex=0,this._updateAriaLabel(),this._register(ue(this._commentsElement,ke.KEY_DOWN,e=>{const t=new En(e);if((t.equals(S.UpArrow)||t.equals(S.DownArrow))&&(!this._focusedComment||!this._commentElements[this._focusedComment].isEditing)){const i=n=>{if(this._focusedComment===void 0&&n>=0)return 0;if(this._focusedComment===void 0&&n<0)return this._commentElements.length-1;const o=this._focusedComment+n;return Math.min(Math.max(0,o),this._commentElements.length-1)};this._setFocusedComment(t.equals(S.UpArrow)?i(-1):i(1))}})),this._commentDisposable.clearAndDisposeAll(),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===x2.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=H_(this.container);this._onDidResize.fire(e)}getDimensions(){return H_(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=Cr(this._commentElements[0].domNode),n=Cr(t[0].domNode);return{thread:i,comment:n}}}async updateCommentThread(e,t){const i=this._commentElements.length,n=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.deleteAndDispose(h),this._commentElements.splice(r[d],1),h.domNode.remove()}let a=null;const c=[],l=[];for(let d=n-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===x2.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(11501,"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(11502,"Comment thread with {0} comments on the entire document. {1}.",this._commentThread.comments?.length,this._commentThread.label):this._commentsElement.ariaLabel=g(11503,"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(Mxe,this._parentEditor,this._commentThread,e,this._pendingEdits?this._pendingEdits[e.uniqueIdInThread]:void 0,this.owner,this.parentResourceUri,this._parentCommentThreadWidget,this._markdownRenderer),i=new Z;return i.add(t.onDidClick(n=>this._setFocusedComment(this._commentElements.findIndex(o=>o.comment.uniqueIdInThread===n.comment.uniqueIdInThread)))),i.add(t),this._commentDisposable.set(t,i),t}dispose(){super.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._commentDisposable.dispose()}};Nxe=D([_(9,XA),_(10,Ao),_(11,xi)],Nxe);const ejt=oi("review-comment-collapse",ve.chevronUp,g(11504,"Icon to collapse a review comment.")),tjt="expand-review-action "+We.asClassName(ejt);class ijt extends V{constructor(e,t,i,n,o,r,a){super(),this._delegate=t,this._commentMenus=i,this._commentThread=n,this._contextKeyService=o,this.instantiationService=r,this._contextMenuService=a,this._headElement=fe(".head"),e.appendChild(this._headElement),this._register(Ee(()=>this._headElement.remove())),this._fillHead()}_fillHead(){const e=re(this._headElement,fe(".review-title"));this._headingLabel=re(e,fe("span.filename")),this.createThreadLabel();const t=re(this._headElement,fe(".review-actions"));this._actionbarWidget=new ld(t,{actionViewItemProvider:PN.bind(void 0,this.instantiationService)}),this._register(this._actionbarWidget),this._collapseAction=new rn("review.expand",g(11505,"Collapse"),tjt,!0,()=>this._delegate.collapse());const i=this._commentMenus.getCommentThreadTitleActions(this._contextKeyService);this._register(i),this.setActionBarActions(i),this._register(i),this._register(i.onDidChange(n=>{this.setActionBarActions(i)})),this._register(ue(this._headElement,ke.CONTEXT_MENU,n=>this.onContextMenu(n))),this._actionbarWidget.context=this._commentThread}setActionBarActions(e){const t=e.getActions({shouldForwardArgs:!0}).reduce((i,[,n])=>[...i,...n],[]);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(11506,"Start discussion"))),e&&(this._headingLabel.textContent=dT(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(n=>n[1]).flat();if(!t.length)return;const i=new Sh(ct(this._headElement),e);this._contextMenuService.showContextMenu({getAnchor:()=>i,getActions:()=>t,actionRunner:new U_,getActionsContext:()=>({commentControlHandle:this._commentThread.controllerHandle,commentThreadHandle:this._commentThread.commentThreadHandle,$mid:ws.CommentThread})})}}let Pxe=class extends V{constructor(e,t,i,n,o,r){super(),this._commentThread=t,this._contextKeyService=i,this._commentMenus=n,this._actionRunDelegate=o,this._keybindingService=r,this._container=re(e,fe(".comment-additional-actions")),re(this._container,fe(".section-separator")),this._buttonBar=re(this._container,fe(".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[,n]=i;for(const o of n){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 I$(this._keybindingService,this._contextKeyService,e,async i=>{this._actionRunDelegate?.(),i.run({thread:this._commentThread,$mid:ws.CommentThreadInstance})},4),this._register(this._commentFormActions),this._commentFormActions.setActions(t,!0),this._enableDisableMenu(t)}};Pxe=D([_(5,Ut)],Pxe);var aj;function njt(s,e,t){const i=new Set;return jr(...s.map((n,o)=>jr(n.onDidFocus(()=>{t?.(o,"focus"),i.size||e(!0),i.add(o)}),n.onDidBlur(()=>{t?.(o,"blur"),i.delete(o),i.size||e(!1)}))))}const oPe=new Y("navigableContainerFocused",!1);var JR;let dN=(JR=class{constructor(e,t,i){this.logService=t,this.configurationService=i,this.containers=new Set,this.focused=oPe.bindTo(e),aj.INSTANCE=this}dispose(){this.containers.clear(),this.focused.reset(),aj.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),jr(njt(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,n)=>{t.log("NavigableContainerManager.partFocusChange",e.name,i,n)}),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)}))):V.None}static getActive(){return this.INSTANCE?.lastContainer}},aj=JR,JR.ID="workbench.contrib.navigableContainerManager",JR);dN=aj=D([_(0,Le),_(1,Ge),_(2,Te)],dN);function jnt(s){return dN.register(s)}Ku(dN.ID,dN,yc.BlockStartup);So.registerCommandAndKeybindingRule({id:"widgetNavigation.focusPrevious",weight:Ae.WorkbenchContrib,when:he.and(oPe,he.or(bae?.negate(),_Dt)),primary:U.CtrlCmd|S.UpArrow,handler:()=>{dN.getActive()?.focusPreviousWidget()}});So.registerCommandAndKeybindingRule({id:"widgetNavigation.focusNext",weight:Ae.WorkbenchContrib,when:he.and(oPe,he.or(bae?.negate(),vDt)),primary:U.CtrlCmd|S.DownArrow,handler:()=>{dN.getActive()?.focusNextWidget()}});let Fxe=class extends V{get commentThread(){return this._commentThread}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.container=e,this._parentEditor=t,this._owner=i,this._parentResourceUri=n,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=S_.commentThreadIsEmpty.bindTo(this._contextKeyService),this._threadIsEmpty.set(!a.comments||!a.comments.length),this._focusedContextKey=S_.commentFocused.bindTo(this._contextKeyService),this._commentMenus=this.commentService.getCommentMenus(this._owner),this._register(this._header=new ijt(e,{collapse:this.collapse.bind(this)},this._commentMenus,this._commentThread,this._contextKeyService,this._scopedInstantiationService,p)),this._header.updateCommentThread(this._commentThread);const b=fe(".body");e.appendChild(b),this._register(Ee(()=>b.remove()));const w=this._register(Ac(b));this._register(jnt({name:"commentThreadWidget",focusNotifiers:[w],focusNextWidget:()=>{this._commentReply?.isCommentEditorFocused()||this._commentReply?.expandReplyAreaAndFocusCommentEditor()},focusPreviousWidget:()=>{this._commentReply?.isCommentEditorFocused()&&this._commentThread.comments?.length&&this._body.focus()}})),this._register(w.onDidFocus(()=>this._focusedContextKey.set(!0))),this._register(w.onDidBlur(()=>this._focusedContextKey.reset())),this._register(this.configurationService.onDidChangeConfiguration(A=>{A.affectsConfiguration(vr.Comments)&&this._setAriaLabel()})),this._body=this._scopedInstantiationService.createInstance(Nxe,this._parentEditor,this._owner,this._parentResourceUri,b,this._markdownOptions,this._commentThread,this._pendingEdits,this._scopedInstantiationService,this),this._register(this._body),this._setAriaLabel(),this._styleElement=ul(this.container),this._commentThreadContextValue=S_.commentThreadContext.bindTo(this._contextKeyService),this._commentThreadContextValue.set(a.contextValue);const y=S_.commentControllerContext.bindTo(this._contextKeyService),C=this.commentService.getCommentController(this._owner);C?.contextValue&&y.set(C.contextValue),this.currentThreadListeners()}_setAriaLabel(){let e=g(11238,"Comment"),t;this.configurationService.getValue(vr.Comments)&&(t=this._keybindingService.lookupKeybinding(Yd.OpenAccessibilityHelp,this._contextKeyService)?.getLabel()??void 0),t?e=g(11239,"{0}, use ({1}) for accessibility help",e,t):e=g(11240,"{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(ue(this.container,ke.MOUSE_ENTER,i=>{i.toElement===this.container&&(e=!0,this.updateCurrentThread(e,t))},!0)),this._register(ue(this.container,ke.MOUSE_LEAVE,i=>{i.fromElement===this.container&&(e=!1,this.updateCurrentThread(e,t))},!0)),this._register(ue(this.container,ke.FOCUS_IN,()=>{t=!0,this.updateCurrentThread(e,t)},!0)),this._register(ue(this.container,ke.FOCUS_OUT,()=>{t=!1,this.updateCurrentThread(e,t)},!0))}async updateCommentThread(e){const t=this._commentThread.collapsibleState===Lc.Expanded&&this._commentThreadState===ou.Unresolved&&e.state===ou.Resolved;this._commentThreadState=e.state,this._commentThread=e,bt(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(Gce).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(n=>{this._refresh(n)})),this._commentThread.canReply&&this._commentReply&&this._commentReply.focusIfNeeded(),this._bindCommentThreadListeners()}_refresh(e){this._body.layout(),this._onDidResize.fire(e)}dispose(){super.dispose(),bt(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(Lxe,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(Pxe,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)}ensureFocusIntoNewEditingComment(){this._body.ensureFocusIntoNewEditingComment()}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(${znt}) }`),i.push(`.monaco-editor .review-widget > .head { background-color: var(${$nt}) }`);const n=e.getColor(_Te);n&&i.push(`.review-widget .body .comment-body a { color: ${n} }`);const o=e.getColor($gt);o&&i.push(`.review-widget .body .comment-body a:hover, a:active { color: ${o} }`);const r=e.getColor(gp);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(Ggt);a&&i.push(`.review-widget .body .review-comment blockquote { background: ${a}; }`);const c=e.getColor(Kgt);c&&i.push(`.review-widget .body .review-comment blockquote { border-color: ${c}; }`);const l=e.getColor(NRe);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(wt);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(JKe);h&&i.push(`.review-widget .validation-error { border: 1px solid ${h}; }`);const u=e.getColor(jKe);u&&i.push(`.review-widget .validation-error { background: ${u}; }`);const f=e.getColor(YKe);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()}};Vxe=D([_(12,eE),_(13,lr),_(14,Te),_(15,Ut)],Vxe);function $8e(s,e){return JQt(s,e)??e.getColor(uMe)}var Ey;(function(s){s[s.None=0]="None",s[s.Widget=1]="Widget",s[s.Editor=2]="Editor"})(Ey||(Ey={}));function pjt(s){const e=s.target.range;if(!e||!s.event.leftButton||s.target.type!==Rt.GUTTER_LINE_DECORATIONS)return null;const t=s.target.detail;return t.offsetX-t.glyphMarginWidth-t.lineNumbersWidth-t.glyphMarginLeft>20?null:{lineNumber:e.startLineNumber}}function mjt(s,e){if(!s)return null;const{lineNumber:t}=s;return e.target.range?t:null}let zxe=class extends lMe{get uniqueOwner(){return this._uniqueOwner}get commentThread(){return this._commentThread}get expanded(){return this._isExpanded}constructor(e,t,i,n,o,r,a,c,l,d){super(e,{keepEditorSelection:!0,isAccessible:!0}),this._uniqueOwner=t,this._commentThread=i,this._pendingComment=n,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=this._globalToDispose.add(r.createChild(new Uc([Le,this._contextKeyService])));const h=this.commentService.getCommentController(this._uniqueOwner);h&&(this._commentOptions=h.options),this._initialCollapsibleState=n?Lc.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=Ey.None){this.makeVisible(e,t);const i=this._commentThread.comments?.find(n=>n.uniqueIdInThread===e);this.commentService.setActiveCommentAndThread(this.uniqueOwner,{thread:this._commentThread,comment:i})}_expandAndShowZoneWidget(){this._isExpanded||this.show(this.arrowPosition(this._commentThread.range),2)}_setFocus(e){e===Ey.Widget?this._commentThreadWidget.focus():e===Ey.Editor&&this._commentThreadWidget.focusCommentEditor()}_goToComment(e,t){const i=this.editor.getLayoutInfo().height,n=this._commentThreadWidget.getCommentCoords(e);if(n){let o=1;if(this._commentThread.range){const r=n.thread,a=n.comment;o=this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber)-i/2+a.top-r.top}this.editor.setScrollTop(o),this._setFocus(t)}else this._goToThread(t)}_goToThread(e){const t=this._commentThread.range?new F(this._commentThread.range.startLineNumber,this._commentThread.range.startColumn,this._commentThread.range.endLineNumber+1,1):new F(1,1,1,1);this.editor.revealRangeInCenter(t),this._setFocus(e)}makeVisible(e,t=Ey.None){this._expandAndShowZoneWidget(),e!==void 0&&this._goToComment(e,t),this._goToThread(t)}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(Vxe,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||cd.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 n;if(t.lineNumber!==i.endLineNumber){const o=t.lineNumber-i.endLineNumber;n=new F(i.startLineNumber+o,i.startColumn,i.endLineNumber+o,i.endColumn)}else n=new F(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);await this.commentService.updateCommentThreadTemplate(this.uniqueOwner,this._commentThread.commentThreadHandle,n)}}},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=Lc.Collapsed}expand(e){this._commentThread.collapsibleState=Lc.Expanded,e&&this.commentService.setActiveCommentAndThread(this.uniqueOwner,{thread:this._commentThread})}getGlyphPosition(){return this._commentGlyph?this._commentGlyph.getPosition().position.lineNumber:0}toggleExpand(){this._isExpanded?this._commentThread.collapsibleState=Lc.Collapsed:this._commentThread.collapsibleState=Lc.Expanded}async update(e){this._commentThread!==e&&(this._commentThreadDisposables.forEach(n=>n.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===Lc.Expanded&&!this._isExpanded?this.show(this.arrowPosition(this._commentThread.range),2):this._commentThread.collapsibleState!==Lc.Expanded&&this.hide()}_onWidth(e){this._commentThreadWidget.layout(e)}_doLayout(e,t){this._commentThreadWidget.layout(t)}async display(e,t){e&&(this._commentGlyph=new L$(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===Lc.Expanded||e===void 0)&&this.show(this.arrowPosition(e),2),t&&this.makeVisible(),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===Lc.Expanded&&!this._isExpanded){this.show(this.arrowPosition(this._commentThread.range),2),this._commentThreadWidget.ensureFocusIntoNewEditingComment();return}if(e===Lc.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=$8e(this._commentThread.state,this.themeService.getColorTheme())||me.transparent;this.style({frameColor:e,arrowColor:e}),this.container?.style.setProperty(Jnt,`${e}`),this.container?.style.setProperty(Xnt,`${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=Lc.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),n=Math.round(i/3),o=Math.round(i/9)*2,r=Math.ceil((t+e.height+n+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=vm.capture(this.editor);this._relayout(r),c.restore(this.editor)}}_applyTheme(e){const t=$8e(this._commentThread.state,this.themeService.getColorTheme())||me.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 n=F.isIRange(e)?e:e?F.fromPositions(e):void 0;if(i?.position&&n&&i.position.lineNumber!==n.endLineNumber){const o=i.position.lineNumber-n.endLineNumber;n=new F(n.startLineNumber+o,n.startColumn,n.endLineNumber+o,n.endColumn)}this._isExpanded=!0,super.show(n??new F(0,0,0,0),t),this._commentThread.collapsibleState=Lc.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)}};zxe=D([_(5,we),_(6,pn),_(7,eE),_(8,Le),_(9,Te)],zxe);class G8e{get id(){return this._decorationId}set id(e){this._decorationId=e}constructor(e,t){this.range=e,this.options=t}}const Zz=class Zz extends V{constructor(e){super(),this.decorationIds=[],this.activeDecorationIds=[],this.threadCollapseStateListeners=[];const t={description:Zz.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};this.decorationOptions=Gt.createDynamic(t);const i={description:Zz.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};this.activeDecorationOptions=Gt.createDynamic(i),this._register(e.onDidChangeCurrentCommentThread(n=>{this.updateCurrent(n)})),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===Lc.Expanded&&(this.currentThreadCollapseStateListener=e.onDidChangeCollapsibleState(n=>{n===Lc.Collapsed&&this.updateCurrent(void 0)}),t.push(new G8e(i,this.activeDecorationOptions)))}this.editor.changeDecorations(i=>{this.activeDecorationIds=i.deltaDecorations(this.activeDecorationIds,t),t.forEach((n,o)=>n.id=this.decorationIds[o])})}update(e,t){const i=e?.getModel();if(!e||!i)return;bt(this.threadCollapseStateListeners),this.editor=e;const n=[];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!==Lc.Collapsed&&n.push(new G8e(a,this.decorationOptions)))});e.changeDecorations(o=>{this.decorationIds=o.deltaDecorations(this.decorationIds,n),n.forEach((r,a)=>r.id=this.decorationIds[a])})}dispose(){bt(this.threadCollapseStateListeners),this.currentThreadCollapseStateListener?.dispose(),super.dispose()}};Zz.description="comment-thread-range-decorator";let $xe=Zz;const _jt="editor.contrib.review";class fE{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,n,o,r,a,c=!1){this._editor=e,this._ownerId=t,this._extensionId=i,this._label=n,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 wO=class wO{constructor(){this.commentingRangeDecorations=[],this.decorationIds=[],this._lastHover=-1,this._onDidChangeDecorationsCount=new I,this.onDidChangeDecorationsCount=this._onDidChangeDecorationsCount.event;const e={description:wO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph comment-diff-added"};this.decorationOptions=Gt.createDynamic(e);const t={description:wO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph line-hover"};this.hoverDecorationOptions=Gt.createDynamic(t);const i={description:wO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph multiline-add"};this.multilineDecorationOptions=Gt.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 F(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,n){e&&(this._editor=e,this._infos=t,this._doUpdate(e,t,i,n))}_lineHasThread(e,t){return e.getDecorationsInRange(t)?.find(i=>i.options.description===L$.description)}_doUpdate(e,t,i=-1,n=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 F(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn);let h=n?d.intersectRanges(n):void 0;if(n&&i>=0&&h&&!(h.startLineNumber===h.endLineNumber&&i===h.startLineNumber)){let u;i<=h.startLineNumber?(u=h.collapseToStart(),h=new F(h.startLineNumber+1,1,h.endLineNumber,1)):(u=new F(h.endLineNumber,1,h.endLineNumber,1),h=new F(h.startLineNumber,1,h.endLineNumber-1,1)),r.push(new fE(e,c.uniqueOwner,c.extensionId,c.label,h,this.multilineDecorationOptions,c.commentingRanges,!0)),this._lineHasThread(e,u)||r.push(new fE(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 b=new F(l.startLineNumber,1,f,1);r.push(new fE(e,c.uniqueOwner,c.extensionId,c.label,b,this.decorationOptions,c.commentingRanges,!0))}if(v){const b=new F(m,1,l.endLineNumber,1);r.push(new fE(e,c.uniqueOwner,c.extensionId,c.label,b,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 n?n.map(o=>({action:{ownerId:o.uniqueOwner,extensionId:o.extensionId,label:o.label,commentingRangesInfo:o.commentingRanges}})):[]}const t=new Map;for(const n of this.commentingRangeDecorations){const o=n.getActiveRange();if(o&&this.areRangesIntersectingOrTouchingByLine(o,e)){const r=n.getCommentAction(),a=t.get(r.ownerId);if(a?.action.commentingRangesInfo===r.commentingRangesInfo){const c=new F(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(n=>i.has(n.action.ownerId)?!1:(i.add(n.action.ownerId),!0))}getNearestCommentingRange(e,t){let i,n;if(t){n=[];for(let o=this.commentingRangeDecorations.length-1;o>=0;o--)n.push(this.commentingRangeDecorations[o])}else n=this.commentingRangeDecorations;for(const o of n){const r=o.getActiveRange();if(r){if(i&&this.areRangesIntersectingOrTouchingByLine(r,i)){i=F.plusRange(i,r);continue}if(r.startLineNumber<=e.lineNumber&&e.lineNumber<=r.endLineNumber){i=new F(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn);continue}if(!(!t&&r.endLineNumbere.lineNumber))return r}}return n.length>0?n[0].getActiveRange()??void 0:void 0}dispose(){this.commentingRangeDecorations=[]}};wO.description="commenting-range-decorator";let mie=wO;function sst(s,e,t,i,n,o,r,a,c){if(!i.resource)return;s.isCommentingEnabled||s.enableCommenting(!0);const l=i.range,d=o?Ey.Editor:a?Ey.None:Ey.Widget,h=e.activeTextEditorControl,u=im(h)?[h.getOriginalEditor(),h.getModifiedEditor()]:h?[h]:[],f=i.threadId,p=n?.uniqueIdInThread,m=N.parse(i.resource);for(const v of u){const b=v.getModel();if(b instanceof C_&&t.extUri.isEqual(m,b.uri)){f&&Qr(v)&&_ie.get(v)?.revealCommentThread(f,p,!0,d);return}}e.openEditor({resource:m,options:{pinned:r,preserveFocus:a,selection:l??new F(1,1,1,1)}},c?ev:hA).then(v=>{if(v){const b=v.getControl();f&&Qr(b)&&_ie.get(b)?.revealCommentThread(f,p,!0,d)}})}let _ie=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this.commentService=t,this.instantiationService=i,this.codeEditorService=n,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=x_.activeCursorHasCommentingRange.bindTo(l),this._activeEditorHasCommentingRange=x_.activeEditorHasCommentingRange.bindTo(l),!(e instanceof lf)&&(this.editor=e,this._commentingRangeDecorator=new mie,this.globalToDispose.add(this._commentingRangeDecorator.onDidChangeDecorationsCount(f=>{f===0?this.clearEditorListeners():this._editorDisposables.length===0&&this.registerEditorListeners()})),this.globalToDispose.add(this._commentThreadRangeDecorator=new $xe(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,[]),bt(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",cjt,{}),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 b;if(p.commentThread.comments&&p.commentThread.comments.length){const w=p.commentThread.comments[p.commentThread.comments.length-1];typeof w.body=="string"?b=w.body:b=w.body.value}v!==b&&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(){bt(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 F(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(F.fromPositions(e,{column:-1,lineNumber:e.lineNumber})):void 0;let i=!1;if(t)for(const n of t)if(n.options.description===L$.description){i=!1;break}else n.options.description===mie.description&&(i=!0);this._activeCursorHasCommentingRange.set(i)}isEditorInlineOriginal(e){return this.configurationService.getValue("diffEditor.renderSideBySide")?!1:!!this.editorService.visibleTextEditorControls.find(i=>i.getEditorType()===CU.IDiffEditor?i.getOriginalEditor()===e:!1)}beginCompute(){return this._computePromise=Rr(e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return t?this.commentService.getDocumentComments(t):Promise.resolve([])}),this._computeAndSetPromise=this._computePromise.then(async e=>{await this.setComments(Fi(e)),this._computePromise=null},e=>console.log(e)),this._computePromise.then(()=>this._computeAndSetPromise=void 0),this._computeAndSetPromise}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=Fi(e);this._commentingRangeDecorator.update(this.editor,t,this.editor?.getPosition()?.lineNumber,this.editor?.getSelection()??void 0)}},e=>(vt(e),null)))}static get(e){return e.getContribution(_jt)}revealCommentThread(e,t,i,n){const o=this._commentWidgets.filter(r=>r.commentThread.threadId===e);o.length===1?o[0].reveal(t,n):i&&(this._computeAndSetPromise?this._computeAndSetPromise.then(r=>{this.revealCommentThread(e,t,!1,n)}):this.beginCompute().then(r=>{this.revealCommentThread(e,t,!1,n)}))}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===ru.Unresolved&&e.expand()}nextCommentThread(){this._findNearestCommentThread()}_findNearestCommentThread(e){if(!this._commentWidgets.length||!this.editor?.hasModel())return;const t=e?this.editor.getSelection().getStartPosition():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}),n=w2(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;n===this._commentWidgets.length?o=this._commentWidgets[0]:o=i[n],this.editor.setSelection(o.commentThread.range??new F(1,1,1,1)),o.reveal(void 0,Ey.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 n=e?i.getEndPosition():i.getStartPosition();this.editor.setPosition(n),this.editor.revealLineInCenterIfOutsideViewport(n.lineNumber)}if(this.accessibilityService.isScreenReaderOptimized()){const n=i?.getStartPosition().lineNumber,o=i?.getEndPosition().lineNumber;n&&o&&Ah(n===o?g(5346,"Line {0}",n):g(5347,"Lines {0} to {1}",n,o))}}nextCommentingRange(){this._findNearestCommentingRange()}previousCommentingRange(){this._findNearestCommentingRange(!0)}dispose(){this.globalToDispose.dispose(),this.localToDispose.dispose(),bt(this._editorDisposables),bt(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&&F.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:F.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 Mh(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 n=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 n)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(n=>n.uniqueOwner===t.uniqueOwner&&F.lift(n.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 n=i[0].getPendingComments().newComment;let o;!n||t.body.includes(n)?o=t.body:n.includes(t.body)?o=n:o=`${n} -${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?F.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(vr.Comments)){const t=this.keybindingService.lookupKeybinding(Xd.OpenAccessibilityHelp)?.getAriaLabel();Ah(t?g(5348,"Editor has commenting ranges, run the command Open Accessibility Help ({0}), for more information.",t):g(5349,"Editor has commenting ranges, run the command Open Accessibility Help, which is currently not triggerable via keybinding, for more information."))}else Ah(g(5350,"Editor has commenting ranges."))})}async openCommentsView(e){if(e.comments&&e.comments.length>0){const t=this.configurationService.getValue(jce).openView;if(t==="file")return this.viewsService.openView(jl);if((t==="firstFile"||t==="firstFileUnresolved"&&e.state===ru.Unresolved)&&!this.viewsService.getViewWithId(jl)?.hasRendered)return this.viewsService.openView(jl)}}async displayCommentThread(e,t,i,n,o){const r=this.editor?.getModel();if(!r||!this.editor||this.isEditorInlineOriginal(this.editor))return;let a;t.range&&!n&&(a=this.commentService.removeContinueOnComment({uniqueOwner:e,uri:r.uri,range:t.range,isReply:!0}));const c=this.instantiationService.createInstance(zxe,this.editor,e,t,n??a?.body,o);await c.display(t.range,i),this._commentWidgets.push(c),this.openCommentsView(t)}onEditorMouseDown(e){this.mouseDownInfo=pjt(e)}onEditorMouseUp(e){const t=mjt(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,n=e.target.position.lineNumber;let o,r;t!==n?t>n?r=new F(t,this.editor.getModel().getLineLength(t)+1,n,1):r=new F(t,1,n,this.editor.getModel().getLineLength(n)+1):i&&(r=this.editor.getSelection()),r&&r.startLineNumber<=n&&n<=r.endLineNumber?(o=r,this.editor.setSelection(new F(r.endLineNumber,1,r.endLineNumber,1))):i&&(o=new F(n,1,n,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(n=>n.getGlyphPosition()===(e?e.endLineNumber:0));if(i.length){const n=i.every(o=>o.expanded);i.forEach(n?o=>o.collapse():o=>o.expand(!0)),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 F(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 n=this.getCommentProvidersQuickPicks(i);return this.quickInputService.pick(n,{placeHolder:g(5351,"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:n}=i[0].action,o=e&&i[0].range?this.clipUserRangeToCommentRange(e,i[0].range):e;this.addCommentAtLine2(o,n)}return Promise.resolve()}getCommentProvidersQuickPicks(e){return e.map(i=>{const{ownerId:n,extensionId:o,label:r}=i.action;return{label:r??o??n,id:n}})}getContextMenuActions(e,t){const i=[];return e.forEach(n=>{const{ownerId:o,extensionId:r,label:a}=n.action;i.push(new rn("addCommentThread",`${a||r}`,void 0,!0,()=>{const c=n.range?this.clipUserRangeToCommentRange(t,n.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 n=e.getRawOptions().extraEditorClassName;return n&&(i=n.split(" ")),{lineDecorationsWidth:t,extraEditorClassName:i}}getWithoutCommentsEditorOptions(e,t,i){let n=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"&&(n+=11),n-=24,{extraEditorClassName:t,lineDecorationsWidth:n}}getWithCommentsLineDecorationWidth(e,t){let i=t;const n=e.getOptions();return n.get(x.folding)&&n.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,n=t||i;if(n&&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((!n||!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 n=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;n&&(a=n[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,n=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?(n||(this._pendingNewCommentCache[e.uniqueOwner]={}),this._pendingNewCommentCache[e.uniqueOwner][e.commentThread.threadId]=i):n&&delete n[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=[]}};_ie=D([_(1,eE),_(2,we),_(3,Kt),_(4,lr),_(5,In),_(6,Lm),_(7,Te),_(8,Le),_(9,ei),_(10,Ut),_(11,mr)],_ie);const vjt=new Q("commentsView.hasComments",!1),bjt=new Q("commentsView.someCommentsExpanded",!1),wjt=new Q("commentsView.commentFocused",!1),yjt="commentsViewState";function K8e(s){return hi.map(s.resourceCommentThreads,e=>{const t=hi.from(e.commentThreads),i=hi.map(t,n=>({element:n}));return{element:e,children:i}})}let Gxe=class extends ASe{get focusedCommentNode(){const e=this.tree?.getFocus();if(e?.length===1&&e[0]instanceof Jw)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 Jw);)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 Jw);)t=this.tree.navigate(t).previous();t&&this.tree.setFocus([t])}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){const v=new sI(yjt,m),b=v.getMemento(Ie.WORKSPACE,an.MACHINE);super({...e,filterOptions:{placeholder:g(5329,"Filter (e.g. text, author)"),ariaLabel:g(5330,"Filter comments"),history:b.filterHistory||[],text:b.filter||"",focusContextKey:mPe.key}},c,a,o,r,i,t,l,d,u,f),this.editorService=n,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=vjt.bindTo(r),this.someCommentsExpandedContextKey=bjt.bindTo(r),this.commentsFocusedContextKey=wjt.bindTo(r),this.stateMemento=v,this.viewState=b,this.filters=this._register(new ijt({showResolved:this.viewState.showResolved!==!1,showUnresolved:this.viewState.showUnresolved!==!1},this.contextKeyService)),this.filter=new tjt(new _S(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved)),this._register(this.filters.onDidChange(w=>{(w.showResolved||w.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(nst({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 _S(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(5331,"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=re(e,fe(".comments-panel-container"));this.treeContainer=re(t,fe(".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&&av(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,K8e(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=re(e,fe(".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(vr.Comments)){const r=this.keybindingService.lookupKeybinding(uNt.id)?.getAriaLabel();i=r?g(5332,`Inspect this in the accessible view ({0}). +`),this._commentReply?.setCommentEditorDecorations()}};Fxe=D([_(12,XA),_(13,lr),_(14,Te),_(15,Ut)],Fxe);function R8e(s,e){return HQt(s,e)??e.getColor(eMe)}var Cy;(function(s){s[s.None=0]="None",s[s.Widget=1]="Widget",s[s.Editor=2]="Editor"})(Cy||(Cy={}));function sjt(s){const e=s.target.range;if(!e||!s.event.leftButton||s.target.type!==Rt.GUTTER_LINE_DECORATIONS)return null;const t=s.target.detail;return t.offsetX-t.glyphMarginWidth-t.lineNumbersWidth-t.glyphMarginLeft>20?null:{lineNumber:e.startLineNumber}}function ojt(s,e){if(!s)return null;const{lineNumber:t}=s;return e.target.range?t:null}let Oxe=class extends JRe{get uniqueOwner(){return this._uniqueOwner}get commentThread(){return this._commentThread}get expanded(){return this._isExpanded}constructor(e,t,i,n,o,r,a,c,l,d){super(e,{keepEditorSelection:!0,isAccessible:!0}),this._uniqueOwner=t,this._commentThread=i,this._pendingComment=n,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=this._globalToDispose.add(r.createChild(new Uc([Le,this._contextKeyService])));const h=this.commentService.getCommentController(this._uniqueOwner);h&&(this._commentOptions=h.options),this._initialCollapsibleState=n?Lc.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=Cy.None){this.makeVisible(e,t);const i=this._commentThread.comments?.find(n=>n.uniqueIdInThread===e);this.commentService.setActiveCommentAndThread(this.uniqueOwner,{thread:this._commentThread,comment:i})}_expandAndShowZoneWidget(){this._isExpanded||this.show(this.arrowPosition(this._commentThread.range),2)}_setFocus(e){e===Cy.Widget?this._commentThreadWidget.focus():e===Cy.Editor&&this._commentThreadWidget.focusCommentEditor()}_goToComment(e,t){const i=this.editor.getLayoutInfo().height,n=this._commentThreadWidget.getCommentCoords(e);if(n){let o=1;if(this._commentThread.range){const r=n.thread,a=n.comment;o=this.editor.getTopForLineNumber(this._commentThread.range.startLineNumber)-i/2+a.top-r.top}this.editor.setScrollTop(o),this._setFocus(t)}else this._goToThread(t)}_goToThread(e){const t=this._commentThread.range?new F(this._commentThread.range.startLineNumber,this._commentThread.range.startColumn,this._commentThread.range.endLineNumber+1,1):new F(1,1,1,1);this.editor.revealRangeInCenter(t),this._setFocus(e)}makeVisible(e,t=Cy.None){this._expandAndShowZoneWidget(),e!==void 0&&this._goToComment(e,t),this._goToThread(t)}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(Fxe,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||rd.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 n;if(t.lineNumber!==i.endLineNumber){const o=t.lineNumber-i.endLineNumber;n=new F(i.startLineNumber+o,i.startColumn,i.endLineNumber+o,i.endColumn)}else n=new F(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);await this.commentService.updateCommentThreadTemplate(this.uniqueOwner,this._commentThread.commentThreadHandle,n)}}},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=Lc.Collapsed}expand(e){this._commentThread.collapsibleState=Lc.Expanded,e&&this.commentService.setActiveCommentAndThread(this.uniqueOwner,{thread:this._commentThread})}getGlyphPosition(){return this._commentGlyph?this._commentGlyph.getPosition().position.lineNumber:0}toggleExpand(){this._isExpanded?this._commentThread.collapsibleState=Lc.Collapsed:this._commentThread.collapsibleState=Lc.Expanded}async update(e){this._commentThread!==e&&(this._commentThreadDisposables.forEach(n=>n.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===Lc.Expanded&&!this._isExpanded?this.show(this.arrowPosition(this._commentThread.range),2):this._commentThread.collapsibleState!==Lc.Expanded&&this.hide()}_onWidth(e){this._commentThreadWidget.layout(e)}_doLayout(e,t){this._commentThreadWidget.layout(t)}async display(e,t){e&&(this._commentGlyph=new k$(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===Lc.Expanded||e===void 0)&&this.show(this.arrowPosition(e),2),t&&this.makeVisible(),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===Lc.Expanded&&!this._isExpanded){this.show(this.arrowPosition(this._commentThread.range),2),this._commentThreadWidget.ensureFocusIntoNewEditingComment();return}if(e===Lc.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=R8e(this._commentThread.state,this.themeService.getColorTheme())||me.transparent;this.style({frameColor:e,arrowColor:e}),this.container?.style.setProperty(znt,`${e}`),this.container?.style.setProperty($nt,`${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=Lc.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),n=Math.round(i/3),o=Math.round(i/9)*2,r=Math.ceil((t+e.height+n+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=pm.capture(this.editor);this._relayout(r),c.restore(this.editor)}}_applyTheme(e){const t=R8e(this._commentThread.state,this.themeService.getColorTheme())||me.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 n=F.isIRange(e)?e:e?F.fromPositions(e):void 0;if(i?.position&&n&&i.position.lineNumber!==n.endLineNumber){const o=i.position.lineNumber-n.endLineNumber;n=new F(n.startLineNumber+o,n.startColumn,n.endLineNumber+o,n.endColumn)}this._isExpanded=!0,super.show(n??new F(0,0,0,0),t),this._commentThread.collapsibleState=Lc.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)}};Oxe=D([_(5,we),_(6,pn),_(7,XA),_(8,Le),_(9,Te)],Oxe);class M8e{get id(){return this._decorationId}set id(e){this._decorationId=e}constructor(e,t){this.range=e,this.options=t}}const Yz=class Yz extends V{constructor(e){super(),this.decorationIds=[],this.activeDecorationIds=[],this.threadCollapseStateListeners=[];const t={description:Yz.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};this.decorationOptions=Gt.createDynamic(t);const i={description:Yz.description,isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};this.activeDecorationOptions=Gt.createDynamic(i),this._register(e.onDidChangeCurrentCommentThread(n=>{this.updateCurrent(n)})),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===Lc.Expanded&&(this.currentThreadCollapseStateListener=e.onDidChangeCollapsibleState(n=>{n===Lc.Collapsed&&this.updateCurrent(void 0)}),t.push(new M8e(i,this.activeDecorationOptions)))}this.editor.changeDecorations(i=>{this.activeDecorationIds=i.deltaDecorations(this.activeDecorationIds,t),t.forEach((n,o)=>n.id=this.decorationIds[o])})}update(e,t){const i=e?.getModel();if(!e||!i)return;bt(this.threadCollapseStateListeners),this.editor=e;const n=[];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!==Lc.Collapsed&&n.push(new M8e(a,this.decorationOptions)))});e.changeDecorations(o=>{this.decorationIds=o.deltaDecorations(this.decorationIds,n),n.forEach((r,a)=>r.id=this.decorationIds[a])})}dispose(){bt(this.threadCollapseStateListeners),this.currentThreadCollapseStateListener?.dispose(),super.dispose()}};Yz.description="comment-thread-range-decorator";let Bxe=Yz;const rjt="editor.contrib.review";class hE{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,n,o,r,a,c=!1){this._editor=e,this._ownerId=t,this._extensionId=i,this._label=n,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 mO=class mO{constructor(){this.commentingRangeDecorations=[],this.decorationIds=[],this._lastHover=-1,this._onDidChangeDecorationsCount=new I,this.onDidChangeDecorationsCount=this._onDidChangeDecorationsCount.event;const e={description:mO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph comment-diff-added"};this.decorationOptions=Gt.createDynamic(e);const t={description:mO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph line-hover"};this.hoverDecorationOptions=Gt.createDynamic(t);const i={description:mO.description,isWholeLine:!0,linesDecorationsClassName:"comment-range-glyph multiline-add"};this.multilineDecorationOptions=Gt.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 F(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,n){e&&(this._editor=e,this._infos=t,this._doUpdate(e,t,i,n))}_lineHasThread(e,t){return e.getDecorationsInRange(t)?.find(i=>i.options.description===k$.description)}_doUpdate(e,t,i=-1,n=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 F(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn);let h=n?d.intersectRanges(n):void 0;if(n&&i>=0&&h&&!(h.startLineNumber===h.endLineNumber&&i===h.startLineNumber)){let u;i<=h.startLineNumber?(u=h.collapseToStart(),h=new F(h.startLineNumber+1,1,h.endLineNumber,1)):(u=new F(h.endLineNumber,1,h.endLineNumber,1),h=new F(h.startLineNumber,1,h.endLineNumber-1,1)),r.push(new hE(e,c.uniqueOwner,c.extensionId,c.label,h,this.multilineDecorationOptions,c.commentingRanges,!0)),this._lineHasThread(e,u)||r.push(new hE(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 b=new F(l.startLineNumber,1,f,1);r.push(new hE(e,c.uniqueOwner,c.extensionId,c.label,b,this.decorationOptions,c.commentingRanges,!0))}if(v){const b=new F(m,1,l.endLineNumber,1);r.push(new hE(e,c.uniqueOwner,c.extensionId,c.label,b,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 n?n.map(o=>({action:{ownerId:o.uniqueOwner,extensionId:o.extensionId,label:o.label,commentingRangesInfo:o.commentingRanges}})):[]}const t=new Map;for(const n of this.commentingRangeDecorations){const o=n.getActiveRange();if(o&&this.areRangesIntersectingOrTouchingByLine(o,e)){const r=n.getCommentAction(),a=t.get(r.ownerId);if(a?.action.commentingRangesInfo===r.commentingRangesInfo){const c=new F(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(n=>i.has(n.action.ownerId)?!1:(i.add(n.action.ownerId),!0))}getNearestCommentingRange(e,t){let i,n;if(t){n=[];for(let o=this.commentingRangeDecorations.length-1;o>=0;o--)n.push(this.commentingRangeDecorations[o])}else n=this.commentingRangeDecorations;for(const o of n){const r=o.getActiveRange();if(r){if(i&&this.areRangesIntersectingOrTouchingByLine(r,i)){i=F.plusRange(i,r);continue}if(r.startLineNumber<=e.lineNumber&&e.lineNumber<=r.endLineNumber){i=new F(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn);continue}if(!(!t&&r.endLineNumbere.lineNumber))return r}}return n.length>0?n[0].getActiveRange()??void 0:void 0}dispose(){this.commentingRangeDecorations=[]}};mO.description="commenting-range-decorator";let fie=mO;function Ynt(s,e,t,i,n,o,r,a,c){if(!i.resource)return;s.isCommentingEnabled||s.enableCommenting(!0);const l=i.range,d=o?Cy.Editor:a?Cy.None:Cy.Widget,h=e.activeTextEditorControl,u=Zp(h)?[h.getOriginalEditor(),h.getModifiedEditor()]:h?[h]:[],f=i.threadId,p=n?.uniqueIdInThread,m=N.parse(i.resource);for(const v of u){const b=v.getModel();if(b instanceof b_&&t.extUri.isEqual(m,b.uri)){f&&Qr(v)&&pie.get(v)?.revealCommentThread(f,p,!0,d);return}}e.openEditor({resource:m,options:{pinned:r,preserveFocus:a,selection:l??new F(1,1,1,1)}},c?J_:dA).then(v=>{if(v){const b=v.getControl();f&&Qr(b)&&pie.get(b)?.revealCommentThread(f,p,!0,d)}})}let pie=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this.commentService=t,this.instantiationService=i,this.codeEditorService=n,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=S_.activeCursorHasCommentingRange.bindTo(l),this._activeEditorHasCommentingRange=S_.activeEditorHasCommentingRange.bindTo(l),!(e instanceof rf)&&(this.editor=e,this._commentingRangeDecorator=new fie,this.globalToDispose.add(this._commentingRangeDecorator.onDidChangeDecorationsCount(f=>{f===0?this.clearEditorListeners():this._editorDisposables.length===0&&this.registerEditorListeners()})),this.globalToDispose.add(this._commentThreadRangeDecorator=new Bxe(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,[]),bt(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",JQt,{}),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 b;if(p.commentThread.comments&&p.commentThread.comments.length){const w=p.commentThread.comments[p.commentThread.comments.length-1];typeof w.body=="string"?b=w.body:b=w.body.value}v!==b&&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(){bt(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 F(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(F.fromPositions(e,{column:-1,lineNumber:e.lineNumber})):void 0;let i=!1;if(t)for(const n of t)if(n.options.description===k$.description){i=!1;break}else n.options.description===fie.description&&(i=!0);this._activeCursorHasCommentingRange.set(i)}isEditorInlineOriginal(e){return this.configurationService.getValue("diffEditor.renderSideBySide")?!1:!!this.editorService.visibleTextEditorControls.find(i=>i.getEditorType()===_U.IDiffEditor?i.getOriginalEditor()===e:!1)}beginCompute(){return this._computePromise=Rr(e=>{const t=this.editor&&this.editor.hasModel()&&this.editor.getModel().uri;return t?this.commentService.getDocumentComments(t):Promise.resolve([])}),this._computeAndSetPromise=this._computePromise.then(async e=>{await this.setComments(Fi(e)),this._computePromise=null},e=>console.log(e)),this._computePromise.then(()=>this._computeAndSetPromise=void 0),this._computeAndSetPromise}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=Fi(e);this._commentingRangeDecorator.update(this.editor,t,this.editor?.getPosition()?.lineNumber,this.editor?.getSelection()??void 0)}},e=>(vt(e),null)))}static get(e){return e.getContribution(rjt)}revealCommentThread(e,t,i,n){const o=this._commentWidgets.filter(r=>r.commentThread.threadId===e);o.length===1?o[0].reveal(t,n):i&&(this._computeAndSetPromise?this._computeAndSetPromise.then(r=>{this.revealCommentThread(e,t,!1,n)}):this.beginCompute().then(r=>{this.revealCommentThread(e,t,!1,n)}))}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===ou.Unresolved&&e.expand()}nextCommentThread(){this._findNearestCommentThread()}_findNearestCommentThread(e){if(!this._commentWidgets.length||!this.editor?.hasModel())return;const t=e?this.editor.getSelection().getStartPosition():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}),n=m2(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;n===this._commentWidgets.length?o=this._commentWidgets[0]:o=i[n],this.editor.setSelection(o.commentThread.range??new F(1,1,1,1)),o.reveal(void 0,Cy.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 n=e?i.getEndPosition():i.getStartPosition();this.editor.setPosition(n),this.editor.revealLineInCenterIfOutsideViewport(n.lineNumber)}if(this.accessibilityService.isScreenReaderOptimized()){const n=i?.getStartPosition().lineNumber,o=i?.getEndPosition().lineNumber;n&&o&&Ch(n===o?g(5346,"Line {0}",n):g(5347,"Lines {0} to {1}",n,o))}}nextCommentingRange(){this._findNearestCommentingRange()}previousCommentingRange(){this._findNearestCommentingRange(!0)}dispose(){this.globalToDispose.dispose(),this.localToDispose.dispose(),bt(this._editorDisposables),bt(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&&F.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:F.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 Lh(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 n=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 n)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(n=>n.uniqueOwner===t.uniqueOwner&&F.lift(n.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 n=i[0].getPendingComments().newComment;let o;!n||t.body.includes(n)?o=t.body:n.includes(t.body)?o=n:o=`${n} +${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?F.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(vr.Comments)){const t=this.keybindingService.lookupKeybinding(Yd.OpenAccessibilityHelp)?.getAriaLabel();Ch(t?g(5348,"Editor has commenting ranges, run the command Open Accessibility Help ({0}), for more information.",t):g(5349,"Editor has commenting ranges, run the command Open Accessibility Help, which is currently not triggerable via keybinding, for more information."))}else Ch(g(5350,"Editor has commenting ranges."))})}async openCommentsView(e){if(e.comments&&e.comments.length>0){const t=this.configurationService.getValue(Gce).openView;if(t==="file")return this.viewsService.openView(Ql);if((t==="firstFile"||t==="firstFileUnresolved"&&e.state===ou.Unresolved)&&!this.viewsService.getViewWithId(Ql)?.hasRendered)return this.viewsService.openView(Ql)}}async displayCommentThread(e,t,i,n,o){const r=this.editor?.getModel();if(!r||!this.editor||this.isEditorInlineOriginal(this.editor))return;let a;t.range&&!n&&(a=this.commentService.removeContinueOnComment({uniqueOwner:e,uri:r.uri,range:t.range,isReply:!0}));const c=this.instantiationService.createInstance(Oxe,this.editor,e,t,n??a?.body,o);await c.display(t.range,i),this._commentWidgets.push(c),this.openCommentsView(t)}onEditorMouseDown(e){this.mouseDownInfo=sjt(e)}onEditorMouseUp(e){const t=ojt(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,n=e.target.position.lineNumber;let o,r;t!==n?t>n?r=new F(t,this.editor.getModel().getLineLength(t)+1,n,1):r=new F(t,1,n,this.editor.getModel().getLineLength(n)+1):i&&(r=this.editor.getSelection()),r&&r.startLineNumber<=n&&n<=r.endLineNumber?(o=r,this.editor.setSelection(new F(r.endLineNumber,1,r.endLineNumber,1))):i&&(o=new F(n,1,n,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(n=>n.getGlyphPosition()===(e?e.endLineNumber:0));if(i.length){const n=i.every(o=>o.expanded);i.forEach(n?o=>o.collapse():o=>o.expand(!0)),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 F(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 n=this.getCommentProvidersQuickPicks(i);return this.quickInputService.pick(n,{placeHolder:g(5351,"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:n}=i[0].action,o=e&&i[0].range?this.clipUserRangeToCommentRange(e,i[0].range):e;this.addCommentAtLine2(o,n)}return Promise.resolve()}getCommentProvidersQuickPicks(e){return e.map(i=>{const{ownerId:n,extensionId:o,label:r}=i.action;return{label:r??o??n,id:n}})}getContextMenuActions(e,t){const i=[];return e.forEach(n=>{const{ownerId:o,extensionId:r,label:a}=n.action;i.push(new rn("addCommentThread",`${a||r}`,void 0,!0,()=>{const c=n.range?this.clipUserRangeToCommentRange(t,n.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 n=e.getRawOptions().extraEditorClassName;return n&&(i=n.split(" ")),{lineDecorationsWidth:t,extraEditorClassName:i}}getWithoutCommentsEditorOptions(e,t,i){let n=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"&&(n+=11),n-=24,{extraEditorClassName:t,lineDecorationsWidth:n}}getWithCommentsLineDecorationWidth(e,t){let i=t;const n=e.getOptions();return n.get(x.folding)&&n.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,n=t||i;if(n&&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((!n||!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 n=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;n&&(a=n[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,n=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?(n||(this._pendingNewCommentCache[e.uniqueOwner]={}),this._pendingNewCommentCache[e.uniqueOwner][e.commentThread.threadId]=i):n&&delete n[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=[]}};pie=D([_(1,XA),_(2,we),_(3,Kt),_(4,lr),_(5,In),_(6,km),_(7,Te),_(8,Le),_(9,ei),_(10,Ut),_(11,mr)],pie);const ajt=new Y("commentsView.hasComments",!1),cjt=new Y("commentsView.someCommentsExpanded",!1),ljt=new Y("commentsView.commentFocused",!1),djt="commentsViewState";function N8e(s){return hi.map(s.resourceCommentThreads,e=>{const t=hi.from(e.commentThreads),i=hi.map(t,n=>({element:n}));return{element:e,children:i}})}let Wxe=class extends vSe{get focusedCommentNode(){const e=this.tree?.getFocus();if(e?.length===1&&e[0]instanceof Qw)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 Qw);)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 Qw);)t=this.tree.navigate(t).previous();t&&this.tree.setFocus([t])}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m){const v=new Zk(djt,m),b=v.getMemento(Ie.WORKSPACE,an.MACHINE);super({...e,filterOptions:{placeholder:g(5329,"Filter (e.g. text, author)"),ariaLabel:g(5330,"Filter comments"),history:b.filterHistory||[],text:b.filter||"",focusContextKey:sPe.key}},c,a,o,r,i,t,l,d,u,f),this.editorService=n,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=ajt.bindTo(r),this.someCommentsExpandedContextKey=cjt.bindTo(r),this.commentsFocusedContextKey=ljt.bindTo(r),this.stateMemento=v,this.viewState=b,this.filters=this._register(new GQt({showResolved:this.viewState.showResolved!==!1,showUnresolved:this.viewState.showUnresolved!==!1},this.contextKeyService)),this.filter=new $Qt(new mS(this.filterWidget.getFilterText(),this.filters.showResolved,this.filters.showUnresolved)),this._register(this.filters.onDidChange(w=>{(w.showResolved||w.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(jnt({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 mS(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(5331,"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=re(e,fe(".comments-panel-container"));this.treeContainer=re(t,fe(".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&&sv(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,N8e(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=re(e,fe(".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(vr.Comments)){const r=this.keybindingService.lookupKeybinding(tNt.id)?.getAriaLabel();i=r?g(5332,`Inspect this in the accessible view ({0}). `,r):g(5333,`Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding. -`)}const n=this.getReplyCountAsString(e,t),o=this.getRepliesAsString(e,t);return e.range?e.threadRelevance===Xx.Outdated?i+g(5334,"Outdated from {0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(5335,"{0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:e.threadRelevance===Xx.Outdated?i+g(5336,"Outdated from {0} in {1},{2} comment: {3}",e.comment.userName,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(5337,"{0} in {1},{2} comment: {3}",e.comment.userName,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o}getRepliesAsString(e,t){return!e.replies.length||t?"":` +`)}const n=this.getReplyCountAsString(e,t),o=this.getRepliesAsString(e,t);return e.range?e.threadRelevance===jx.Outdated?i+g(5334,"Outdated from {0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(5335,"{0} at line {1} column {2} in {3},{4} comment: {5}",e.comment.userName,e.range.startLineNumber,e.range.startColumn,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:e.threadRelevance===jx.Outdated?i+g(5336,"Outdated from {0} in {1},{2} comment: {3}",e.comment.userName,_i(e.resource),n,typeof e.comment.body=="string"?e.comment.body:e.comment.body.value)+o:i+g(5337,"{0} in {1},{2} comment: {3}",e.comment.userName,_i(e.resource),n,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(5338,"{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(5339," {0} replies,",e.replies.length):""}createTree(){this.treeLabels=this._register(this.instantiationService.createInstance(UA,this)),this.tree=this._register(this.instantiationService.createInstance(Fxe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof Yce?g(5340,"Comments for current workspace"):e instanceof tp?g(5341,"Comments in {0}, full path {1}",_i(e.resource),e.resource.fsPath):e instanceof Jw?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return Rxe.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()})),this._register(this.tree.onDidFocus(()=>this.commentsFocusedContextKey.set(!0))),this._register(this.tree.onDidBlur(()=>this.commentsFocusedContextKey.set(!1)))}openFile(e,t,i,n){if(!e||!(e instanceof tp||e instanceof Jw))return;const o=e instanceof tp?e.commentThreads[0].thread:e.thread,r=e instanceof tp?e.commentThreads[0].comment:void 0;return sst(this.commentService,this.editorService,this.uriIdentityService,o,r,!1,t,i,n)}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,K8e(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}};Gxe=D([_(1,we),_(2,xm),_(3,ei),_(4,Te),_(5,Le),_(6,lr),_(7,Ut),_(8,Ao),_(9,pn),_(10,eE),_(11,Yi),_(12,ec),_(13,ks),_(14,$i)],Gxe);const Cjt=new _e("Views");jn.appendMenuItem(_e.ViewContainerTitle,{submenu:Cjt,title:g(5295,"Views"),order:1});var hh;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(hh||(hh={}));const Zoe=class Zoe extends jTe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,n,o){super(o),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=n,this.cleanupOverlayScheduler=this._register(new cn(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=Zoe.OVERLAY_ID,this.container.style.top="0px",this.paneElement.appendChild(this.container),this.paneElement.classList.add("dragged-over"),this._register(Ee(()=>{this.container.remove(),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===ir.Panel?wJe:AJe)||"";const e=this.getColor(Js);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 $j(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(ue(this.container,ke.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}positionOverlay(e,t){const i=this.paneElement.clientWidth,n=this.paneElement.clientHeight,o=i/2,r=n/2;let a;switch(this.orientation===fi.VERTICAL?t=r&&(a=hh.DOWN):this.orientation===fi.HORIZONTAL&&(e=o&&(a=hh.RIGHT)),a){case hh.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case hh.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case hh.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case hh.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===fi.VERTICAL&&n<=25||this.orientation===fi.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===hh.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===hh.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===hh.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===hh.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}};Zoe.OVERLAY_ID="monaco-pane-drop-overlay";let RF=Zoe,Kxe=class extends WZ{constructor(e,t,i,n,o){const r=n.createScoped(e);r.createKey("viewContainer",t.id);const a=r.createKey("viewContainerLocation",PX(i.getViewContainerLocation(t)));super(_e.ViewContainerTitle,_e.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},r,o),this._register(r),this._register(M.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(PX(i.getViewContainerLocation(t)))))}};Kxe=D([_(2,xm),_(3,Le),_(4,Oa)],Kxe);let qxe=class extends Ytt{get onDidSashChange(){return qn(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,n,o,r,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=n,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,Ie.WORKSPACE,void 0),this.viewContainerModel=this.viewDescriptorService.getViewContainerModel(f)}create(e){const t=this.options;t.orientation=this.orientation,this.paneview=this._register(new Q5t(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(ue(e,ke.CONTEXT_MENU,c=>this.showContextMenu(new Eh(ct(e),c)))),this._register(fd.addTarget(e)),this._register(ue(e,uo.Contextmenu,c=>this.showContextMenu(new Eh(ct(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(Kxe,this.paneview.element,this.viewContainer)),this._register(this._menuActions.onDidChange(()=>this.updateTitleArea()));let i;const n=()=>{const c=e.getBoundingClientRect(),l=this.panes[this.panes.length-1].element.getBoundingClientRect(),d=this.orientation===fi.VERTICAL?l.bottom:c.top,h=this.orientation===fi.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(gS.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(r=n(),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 RF(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 RF(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)&&FVe(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(Jp.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(wc(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):WN(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 ir.Sidebar:case ir.AuxiliaryBar:return fi.VERTICAL;case ir.Panel:return jzt(this.layoutService.getPanelPosition())?fi.HORIZONTAL:fi.VERTICAL}return fi.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:n,index:o,disposable:r}of e)this.addPane(i,n,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+(n||20),0);for(const i of this.viewContainerModel.visibleViewDescriptors)this.orientation===fi.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,Ie.WORKSPACE,an.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:n,collapsed:o,index:r,size:a}of e){const c=this.createView(n,{id:n.id,title:n.name.value,fromExtensionId:n.extensionId,expanded:!o,singleViewPaneContainerTitle:n.singleViewPaneContainerTitle});c.render();const l=ue(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new Eh(ct(c.draggableElement),h),c)}),d=M.latch(M.map(c.onDidChange,()=>!c.isExpanded()))(h=>{this.viewContainerModel.setCollapsed(n.id,h)});t.push({pane:c,size:a||c.minimumSize,index:r,disposable:jr(l,d)})}this.addPanes(t),this.restoreViewSizes();const i=[];for(const{pane:n}of t)n.setVisible(this.isVisible()),i.push(n);return i}onDidRemoveViewDescriptors(e){e=e.sort((i,n)=>n.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,n=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)===ir.Panel;e.style({headerForeground:ze(d?hTt:CTt),headerBackground:ze(d?dTt:yTt),headerBorder:ze(d?uTt:EJe),dropBackground:ze(d?wJe:AJe),leftBorder:d?ze(gTt):void 0});const h=new Z;h.add(i),h.add(jr(e,o,r,a,l,c));const u={pane:e,disposable:h};this.paneItems.splice(n,0,u),qn(this.paneview).addPane(e,t,n);let f;h.add(gS.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(gS.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),b=this.viewDescriptorService.getViewDescriptorById(m.id);if(v!==this.viewContainer&&(!b||!b.canMoveView||this.viewContainer.rejectAddedViews))return;f=new RF(e.dropTargetElement,this.orientation??fi.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),b=this.viewDescriptorService.getViewContainerModel(v).allViewDescriptors;!b.some(w=>!w.canMoveView)&&b.length>0&&(f=new RF(e.dropTargetElement,this.orientation??fi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{FVe(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 b;if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const w=this.viewDescriptorService.getViewContainerById(m.id),y=this.viewDescriptorService.getViewContainerModel(w).allViewDescriptors;y.length>0&&!y.some(C=>!C.canMoveView)&&(v.push(...y),b=y[0])}else if(m.type==="view"){const w=this.viewDescriptorService.getViewContainerByViewId(m.id),y=this.viewDescriptorService.getViewDescriptorById(m.id);w!==this.viewContainer&&y&&y.canMoveView&&!this.viewContainer.rejectAddedViews&&v.push(y),y&&(b=y)}if(v&&this.viewDescriptorService.moveViewsToContainer(v,this.viewContainer,void 0,"dnd"),b){if(f.currentDropOperation===hh.DOWN||f.currentDropOperation===hh.RIGHT){const w=this.panes.findIndex(C=>C.id===b.id);let y=this.panes.findIndex(C=>C.id===e.id);w>=0&&y>=0&&(w>y&&y++,yC.id===b.id);let y=this.panes.findIndex(C=>C.id===e.id);w>=0&&y>=0&&(w=0&&y!==w&&this.movePane(this.panes[w],this.panes[y]))}v.length>1&&v.slice(1).forEach(w=>{let y=this.panes.findIndex(A=>A.id===b.id);const C=this.panes.findIndex(A=>A.id===w.id);C>=0&&y>=0&&(C>y&&y++,ythis.removePane(i)),this.updateViewHeaders(),t!==this.isViewMergedWithContainer()&&this.updateTitleArea(),this._onDidRemoveViews.fire(e)}removePane(e){const t=this.paneItems.findIndex(n=>n.pane===e);if(t===-1)return;this.lastFocusedPane===e&&(this.lastFocusedPane=void 0),qn(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),n=this.paneItems.findIndex(c=>c.pane===t),o=this.viewContainerModel.visibleViewDescriptors[i],r=this.viewContainerModel.visibleViewDescriptors[n];if(i<0||i>=this.paneItems.length||n<0||n>=this.paneItems.length)return;const[a]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,a),qn(this.paneview).movePane(e,t),this.viewContainerModel.move(o.id,r.id),this.updateTitleArea()}resizePane(e,t){qn(this.paneview).resizePane(e,t)}getPaneSize(e){return qn(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 n=e;n>=0;n--)if(this.paneItems[n].pane?.isVisible()&&this.paneItems[n]?.pane.isExpanded()){t=this.paneItems[n].pane;break}for(let n=e+1;no?(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()}};qxe=D([_(2,we),_(3,Te),_(4,kI),_(5,lr),_(6,Yi),_(7,fs),_(8,pn),_(9,$i),_(10,yi),_(11,xm)],qxe);class Jce extends li{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(xm),i=e.get(Le),n=FU.getValue(i);if(n===void 0)return;const o=t.getViewContainerByViewId(n),r=t.getViewContainerModel(o),a=r.visibleViewDescriptors.find(d=>d.id===n),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 Jce{constructor(){super({id:"views.moveViewUp",title:g(5296,"Move View Up"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.UpArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},-1)}});At(class extends Jce{constructor(){super({id:"views.moveViewLeft",title:g(5297,"Move View Left"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.LeftArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},-1)}});At(class extends Jce{constructor(){super({id:"views.moveViewDown",title:g(5298,"Move View Down"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.DownArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},1)}});At(class extends Jce{constructor(){super({id:"views.moveViewRight",title:g(5299,"Move View Right"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.RightArrow),weight:Ae.WorkbenchContrib+1,when:FU.notEqualsTo("")}},1)}});At(class extends li{constructor(){super({id:"vscode.moveViews",title:g(5300,"Move Views")})}async run(e,t){if(!Array.isArray(t?.viewIds)||typeof t?.destinationId!="string")return Promise.reject("Invalid arguments");const i=e.get(xm),n=i.getViewContainerById(t.destinationId);if(n){for(const o of t.viewIds){const r=i.getViewDescriptorById(o);r?.canMoveView&&i.moveViewsToContainer([r],n,hwe.Default,this.desc.id)}await e.get(Lm).openViewContainer(n.id,!0)}}});class Sjt{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||F.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,n,o,r,a,c,l,d){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=n,this.resource=o,this._range=r,this._canReply=c,this._isTemplate=l,this.editorId=d,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,l?this.comments=[]:a&&(this._comments=a)}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:ws.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class Ajt{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,n,o,r,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=n,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,n,o,r,a,c){const l=new Sjt(t,this.handle,e,i,N.revive(n).toString(),o,r,!0,a,c);return this._threads.set(t,l),l.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[l],removed:[],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[l],removed:[],changed:[],pending:[]}),l}updateCommentThread(e,t,i,n){const o=this.getKnownThread(e);o.batchUpdate(n),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===pe.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 n=await this._proxy.$provideCommentingRanges(this.handle,e,t);return{uniqueOwner:this._uniqueId,label:this.label,threads:i,commentingRanges:{resource:e,ranges:n?.ranges||[],fileComments:!!n?.fileComments}}}async getNotebookComments(e,t){if(e.scheme!==pe.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[]};const i=[];for(const n of[...this._threads.keys()]){const o=this._threads.get(n);o.resource===e.toString()&&(o.isDocumentCommentThread()||i.push(o))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,n,o){return this._proxy.$toggleReaction(this._handle,t.commentThreadHandle,e,i,n)}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:ws.CommentController,handle:this.handle}}}const q8e=oi("comments-view-icon",ve.commentDiscussion,g(4873,"View icon of the comments view."));let Q8e=class extends V{constructor(e,t,i,n,o,r){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=n,this._uriIdentityService=o,this._editorService=r,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(Ye.ExtHostComments),this._commentService.unregisterCommentController(),this._register(this._commentService.onDidChangeActiveEditingCommentThread(async a=>{const c=a.controllerHandle,l=this._commentControllers.get(c);l&&(this._activeEditingCommentThreadDisposables.clear(),this._activeEditingCommentThread=a,l.activeEditingCommentThread=this._activeEditingCommentThread)}))}$registerCommentController(e,t,i,n){const o=`${t}-${n}`;this._handlers.set(e,o);const r=new Ajt(this._proxy,this._commentService,e,o,t,i,{});this._commentService.registerCommentController(o,r),this._commentControllers.set(e,r);const a=!!this._viewDescriptorService.getViewDescriptorById(jl);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,n,o,r,a,c,l){const d=this._commentControllers.get(e);if(d)return d.createCommentThread(a.value,t,i,n,o,r,c,l)}$updateCommentThread(e,t,i,n,o){const r=this._commentControllers.get(e);if(r)return r.updateCommentThread(t,i,n,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)}async $revealCommentThread(e,t,i,n){const o=this._commentControllers.get(e);if(!o)return Promise.resolve();const r=o.getAllComments().find(c=>c.commentThreadHandle===t);if(!r||!r.isDocumentCommentThread())return Promise.resolve();const a=r.comments?.find(c=>c.uniqueIdInThread===i);sst(this._commentService,this._editorService,this._uriIdentityService,r,a,n.focusReply,void 0,n.preserveFocus)}async $hideCommentThread(e,t){const i=this._commentControllers.get(e);if(!i)return Promise.resolve();const n=i.getAllComments().find(o=>o.commentThreadHandle===t);if(!n||!n.isDocumentCommentThread())return Promise.resolve();n.collapsibleState=Lc.Collapsed}registerView(e){if(!e){const t=Qe.as(eI.ViewContainersRegistry).registerViewContainer({id:jl,title:Rxe,ctorDescriptor:new wi(qxe,[jl,{mergeViewWithContainerWhenSingleView:!0}]),storageId:ZQt,hideIfEmpty:!0,icon:q8e,order:10},ir.Panel);Qe.as(eI.ViewsRegistry).registerViews([{id:jl,name:Rxe,canToggleVisibility:!1,ctorDescriptor:new wi(Gxe),canMoveView:!0,containerIcon:q8e,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===jl&&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===jl)&&(this.setComments(),this.registerViewOpenedListener())})),this._register(this._viewDescriptorService.onDidChangeContainerLocation(t=>{const i=this._viewDescriptorService.getViewContainerByViewId(jl);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)}};Q8e=D([Gi(Be.MainThreadComments),_(1,eE),_(2,Lm),_(3,xm),_(4,ks),_(5,ei)],Q8e);var $x;(function(s){s[s.Output=1]="Output",s[s.OutputItems=2]="OutputItems",s[s.ExecutionState=3]="ExecutionState"})($x||($x={}));var rp;(function(s){function e(f){return{mime:f.mime,valueBytes:f.data}}s.toNotebookOutputItemDto=e;function t(f){return{outputId:f.outputId,metadata:f.metadata,items:f.outputs.map(e)}}s.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)}}s.toNotebookCellDataDto=i;function n(f){return{metadata:f.metadata,cells:f.cells.map(i)}}s.toNotebookDataDto=n;function o(f){return{mime:f.mime,data:f.valueBytes}}s.fromNotebookOutputItemDto=o;function r(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(o)}}s.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}}s.fromNotebookCellDataDto=a;function c(f){return{metadata:f.metadata,cells:f.cells.map(a)}}s.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}}s.toNotebookCellDto=l;function d(f){return f.editType===$x.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(r)}:f.editType===$x.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(o)}:f}s.fromCellExecuteUpdateDto=d;function h(f){return f}s.fromCellExecuteCompleteDto=h;function u(f){return f.editType===dI.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}s.fromCellEditOperationDto=u})(rp||(rp={}));let j8e=class{constructor(e,t,i,n){this._notebookService=t,this._cellStatusBarService=i,this._logService=n,this._disposables=new Z,this._notebookSerializer=new Map,this._notebookCellStatusBarRegistrations=new Map,this._proxy=e.getProxy(Ye.ExtHostNotebook)}dispose(){this._disposables.dispose(),bt(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,n,o){const r=new Z;r.add(this._notebookService.registerNotebookSerializer(i,t,{options:n,dataToNotebook:async a=>{const c=new js;let l;if(a.byteLength===0&&i==="interactive")l=rp.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,He.None);l=rp.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 js,l=this._proxy.$notebookToData(e,new jd(rp.toNotebookDataDto(a)),He.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(b=>(b.include||b).toString());if(!u.length)return{results:[],limitHit:!1};const f=Fi([{isFromSettings:!1,filenamePatterns:u},...l.get(i)??[]]),p=Array.from(l.keys()).flatMap(b=>b!==i?l.get(b)??[]:[]),m=await this._proxy.$searchInNotebooks(e,a,f,p,c);return{results:m.results.map(b=>({resource:N.revive(b.resource),cellResults:b.cellResults.map(y=>Mo(y))})),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 n=this,o={async provideCellStatusBarItems(a,c,l){const d=await n._proxy.$provideNotebookCellStatusBarItems(e,a,c,l);return{items:d?.items??[],dispose(){d&&n._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=n=>{this._notebookCellStatusBarRegistrations.get(n)&&(this._notebookCellStatusBarRegistrations.get(n)?.dispose(),this._notebookCellStatusBarRegistrations.delete(n))};i(e),typeof t=="number"&&i(t)}};j8e=D([Gi(Be.MainThreadNotebook),_(1,tE),_(2,PJe),_(3,Ge)],j8e);_t.registerCommand("_executeDataToNotebook",async(s,...e)=>{const[t,i]=e;Tt(typeof t=="string","string"),Tt(i instanceof $e,"VSBuffer");const o=await s.get(tE).withNotebookDataProvider(t);if(!(o instanceof hG))return;const r=await o.serializer.dataToNotebook(i);return new jd(rp.toNotebookDataDto(r))});_t.registerCommand("_executeNotebookToData",async(s,...e)=>{const[t,i]=e;Tt(typeof t=="string","string"),Tt(typeof i=="object");const o=await s.get(tE).withNotebookDataProvider(t);if(!(o instanceof hG))return;const r=rp.fromNotebookDataDto(i.value);return await o.serializer.notebookToData(r)});var Qxe;(function(s){s[s.cell=0]="cell",s[s.notebook=1]="notebook"})(Qxe||(Qxe={}));class Ejt{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=eo(e.supportedLanguages)?e.supportedLanguages:t.getRegisteredLanguageIds(),this.implementsExecutionOrder=e.supportsExecutionOrder??!1,this.hasVariableProvider=e.hasVariableProvider??!1,this.localResourceRoot=N.revive(e.extensionLocation),this.preloads=e.preloads?.map(i=>({uri:N.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=eo(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 xjt{constructor(e){this.notebookType=e}}let Y8e=class{constructor(e,t,i,n,o,r){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=n,this._notebookService=o,this._editors=new mo,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(Ye.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===Qxe.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:n}=this._notebookKernelService.getMatchingKernel(e.textModel);if(n){for(const[o,r]of this._kernels)if(r[0]===n){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 n=this._kernels.get(e);if(!n)throw new Error("kernel already disposed");const[o]=n;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,n=new class extends Ejt{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 P2;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===n.id?this._proxy.$acceptNotebookAssociation(e,a.notebook,!1):a.newKernel===n.id&&this._proxy.$acceptNotebookAssociation(e,a.notebook,!0)}),r=this._notebookKernelService.registerKernel(n);this._kernels.set(e,[n,jr(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 n=this._kernels.get(e);n&&this._notebookKernelService.updateKernelNotebookAffinity(n[0],N.revive(t),i)}$createExecution(e,t,i,n){const o=N.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,n);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(rp.fromCellExecuteUpdateDto))}catch(n){vt(n)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(rp.fromCellExecuteCompleteDto(t.value))}catch(i){vt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const n=N.revive(i),o=this._notebookService.getNotebookTextModel(n);if(!o)throw new Error(`Notebook not found: ${n.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(n);a.confirm(),this._notebookExecutions.set(e,a)}$beginNotebookExecution(e){try{this._notebookExecutions.get(e)?.begin()}catch(t){vt(t)}}$completeNotebookExecution(e){try{this._notebookExecutions.get(e)?.complete()}catch(t){vt(t)}finally{this._notebookExecutions.delete(e)}}async $addKernelDetectionTask(e,t){const i=new xjt(t),n=this._notebookKernelService.registerNotebookKernelDetectionTask(i);this._kernelDetectionTasks.set(e,[i,n])}$removeKernelDetectionTask(e){const t=this._kernelDetectionTasks.get(e);t&&(t[1].dispose(),this._kernelDetectionTasks.delete(e))}async $addKernelSourceActionProvider(e,t,i){const n={viewType:i,provideKernelSourceActions:async()=>(await this._proxy.$provideKernelSourceActions(e,He.None)).map(a=>{let c=a.documentation;return a.documentation&&typeof a.documentation!="string"&&(c=N.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),n.onDidChangeSourceActions=r.event}const o=this._notebookKernelService.registerKernelSourceActionProvider(i,n);this._kernelSourceActionProviders.set(e,[n,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(N.revive(e))}};Y8e=D([Gi(Be.MainThreadNotebookKernels),_(1,xi),_(2,OJe),_(3,FJe),_(4,tE),_(5,R6)],Y8e);let jxe=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new ui,this._proxy=e.getProxy(Ye.ExtHostNotebookDocuments),this._modelReferenceCollection=new Fnt(this._uriIdentityService.extUri),this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(n=>this._proxy.$acceptDirtyStateChanged(n.resource,n.isDirty()))),this._disposables.add(this._notebookEditorModelResolverService.onDidSaveNotebook(n=>this._proxy.$acceptModelSaved(n))),this._disposables.add(t.onWillFailWithConflict(n=>{this._modelReferenceCollection.remove(n.resource)}))}dispose(){this._disposables.dispose(),this._modelReferenceCollection.dispose(),bt(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(n=>{const o={versionId:n.versionId,rawEvents:[]};for(const a of n.rawEvents)switch(a.kind){case Sl.ModelChange:o.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>rp.toNotebookCellDto(l))])});break;case Sl.Move:o.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case Sl.Output:o.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(rp.toNotebookOutputDto)});break;case Sl.OutputItem:o.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(rp.toNotebookOutputItemDto),append:a.append});break;case Sl.ChangeCellLanguage:case Sl.ChangeCellContent:case Sl.ChangeCellMetadata:case Sl.ChangeCellInternalMetadata:o.rawEvents.push(a);break}const r=n.rawEvents.find(a=>a.kind===Sl.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new jd(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=rp.fromNotebookDataDto(e.content);t.object.notebook.reset(i.cells,i.metadata,t.object.notebook.transientOptions)}return t.object.resource}async $tryOpenNotebook(e){const t=N.revive(e),i=await this._notebookEditorModelResolverService.resolve(t,void 0);return this._modelReferenceCollection.add(t,i),t}async $trySaveNotebook(e){const t=N.revive(e),i=await this._notebookEditorModelResolverService.resolve(t),n=await i.object.save();return i.dispose(),n}};jxe=D([_(1,$ae),_(2,ks)],jxe);class Djt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let Yxe=class{constructor(e,t,i,n,o){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=n,this._configurationService=o,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(Ye.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(),bt(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 n=new Djt(t,i);this._mainThreadEditors.set(t.getId(),n)}}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=nB(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=rI(this._editorGroupService,t.group))}Ys(e,this._currentViewColumnInfo)||(this._currentViewColumnInfo=e,this._proxy.$acceptEditorViewColumns(e))}async $tryShowNotebookDocument(e,t,i){const n={cellSelections:i.selections,preserveFocus:i.preserveFocus,pinned:i.pinned,activation:i.preserveFocus?Gk.RESTORE:void 0,override:t},o=await this._editorService.openEditor({resource:N.revive(e),options:n},RZ(this._editorGroupService,this._configurationService,i.position)),r=nB(o);if(r)return r.getId();throw new Error(`Notebook Editor creation failure for document ${JSON.stringify(e)}`)}async $tryRevealRange(e,t,i){const n=this._notebookEditorService.getNotebookEditor(e);if(!n)return;const o=n;if(!o.hasModel()||t.start>=o.getLength())return;const r=o.cellAt(t.start);switch(i){case DF.Default:return o.revealCellRangeInView(t);case DF.InCenter:return o.revealInCenter(r);case DF.InCenterIfOutsideViewport:return o.revealInCenterIfOutsideViewport(r);case DF.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}))}};Yxe=D([_(1,ei),_(2,R6),_(3,Po),_(4,Te)],Yxe);var dj;class J8e{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=Sre(e.documents,t.documents),n=Qge(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,r=Qge(e.visibleEditors,t.visibleEditors);return{addedDocuments:i.added,removedDocuments:i.removed.map(a=>a.uri),addedEditors:n.added,removedEditors:n.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,n){this.documents=e,this.textEditors=t,this.activeEditor=i,this.visibleEditors=n}}let X8e=dj=class{constructor(e,t,i,n,o,r,a){this._notebookService=i,this._notebookEditorService=n,this._editorService=o,this._editorGroupService=r,this._logService=a,this._disposables=new Z,this._editorListeners=new mo,this._proxy=e.getProxy(Ye.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(jxe,e),this._mainThreadEditors=t.createInstance(Yxe,e),e.set(Be.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(Be.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(),jr(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 n=nB(this._editorService.activeEditorPane);let o=null;n?o=n.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=nB(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const r=new J8e(new Set(this._notebookService.listNotebookDocuments()),t,o,i);this._onDelta(J8e.delta(this._currentState,r)),this._currentState=r}_onDelta(e){if(dj._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(dj._asModelAddData),addedEditors:e.addedEditors.map(this._asEditorAddData,this)};this._proxy.$acceptDocumentAndEditorsDelta(new jd(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(rp.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>nB(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&rI(this._editorGroupService,t.group)}}};X8e=dj=D([QN,_(1,we),_(2,tE),_(3,R6),_(4,ei),_(5,Po),_(6,Ge)],X8e);let Z8e=class extends V{constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(Ye.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)}};Z8e=D([Gi(Be.MainThreadNotebookRenderers),_(1,BJe)],Z8e);var M$;(function(s){s[s.Save=1]="Save",s[s.Backup=2]="Backup"})(M$||(M$={}));var hj,Fp;(function(s){s[s.SAVED=0]="SAVED",s[s.DIRTY=1]="DIRTY",s[s.PENDING_SAVE=2]="PENDING_SAVE",s[s.CONFLICT=3]="CONFLICT",s[s.ORPHAN=4]="ORPHAN",s[s.ERROR=5]="ERROR"})(Fp||(Fp={}));var iM;let e3e=(iM=class extends fie{get model(){return this._model}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(t,r),this.typeId=e,this.name=i,this.modelFactory=n,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.progressService=v,this.capabilities=aC.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 RGe,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,n=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=n,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,n,o;try{const r=await this.fileService.stat(this.resource);t=r.mtime,i=r.ctime,n=r.size,o=r.etag,this.setOrphaned(!1)}catch(r){t=Date.now(),i=Date.now(),n=0,o=S_,this.setOrphaned(r.fileOperationResult===Qi.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:n,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:S_,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=S_:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const n=this.versionId;try{const o=await this.fileService.readFileStream(this.resource,{etag:i,limits:e?.limits});if(this.setOrphaned(!1),n!==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===Qi.FILE_NOT_FOUND),this.isResolved()&&r===Qi.FILE_NOT_MODIFIED_SINCE){o instanceof C5&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&r===Qi.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,He.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,He.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 U_(this.model.snapshot(M$.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(Fp.CONFLICT)||this.hasState(Fp.ERROR))&&(e.reason===Cn.AUTO||e.reason===Cn.FOCUS_CHANGE||e.reason===Cn.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(Fp.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Cn.EXPLICIT);const 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 ci;return this.progressService.withProgress({title:g(10700,"Saving '{0}'",this.name),location:ud.Window,cancellable:!0,delay:this.isDirty()?3e3:5e3},n=>this.doSaveSequential(t,e,n,i),()=>{i.cancel()}).finally(()=>{i.dispose()})}doSaveSequential(e,t,i,n){return this.saveSequentializer.run(e,(async()=>{if(this.isResolved()&&!t.skipSaveParticipants&&this.workingCopyFileService.hasSaveParticipants)try{if(t.reason===Cn.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastContentChangeFromUndoRedo;a{try{const a={mtime:o.mtime,etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(o.resource)?S_:o.etag,unlock:t.writeUnlock};let c;if(typeof r.model.save=="function")try{c=await r.model.save(a,n.token)}catch(l){if(n.token.isCancellationRequested)return;throw l}else{const l=await U_(r.model.snapshot(M$.Save,n.token),n.token);if(n.token.isCancellationRequested)return;n.dispose(),t?.writeElevated&&this.elevatedFileService.isSupported(o.resource)?c=await this.elevatedFileService.writeFileElevated(o.resource,qn(l),a):c=await this.fileService.writeFile(o.resource,qn(l),a)}this.handleSaveSuccess(c,e,t)}catch(a){this.handleSaveError(a,e,t)}})(),()=>n.cancel())})(),()=>n.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===Qi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,n=[];let o;if(i.fileOperationResult===Qi.FILE_MODIFIED_SINCE)o=g(10702,"Failed to save '{0}': The content of the file is newer. Do you want to overwrite the file with your changes?",this.name),n.push(rl({id:"fileWorkingCopy.overwrite",label:g(10703,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Cn.EXPLICIT})})),n.push(rl({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===Qi.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===Qi.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);byt(e)&&n.push(...e.actions),h&&(d||l)?n.push(rl({id:"fileWorkingCopy.saveElevated",label:l?Qn?g(10705,"Overwrite as Admin..."):g(10706,"Overwrite as Sudo..."):Qn?g(10707,"Retry as Admin..."):g(10708,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Cn.EXPLICIT})}})):c?n.push(rl({id:"fileWorkingCopy.unlock",label:g(10703,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Cn.EXPLICIT})})):n.push(rl({id:"fileWorkingCopy.retry",label:g(10709,"Retry"),run:()=>this.save({...t,reason:Cn.EXPLICIT})})),n.push(rl({id:"fileWorkingCopy.saveAs",label:g(10710,"Save As..."),run:async()=>{const u=this.workingCopyEditorService.findEditor(this);u&&((await this.editorService.save(u,{saveAs:!0,reason:Cn.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),n.push(rl({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()})),c?l&&h?o=Qn?g(10711,"Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.",this.name):g(10712,"Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.",this.name):o=g(10713,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?o=Qn?g(10714,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.",this.name):g(10715,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.",this.name):o=g(10716,"Failed to save '{0}': {1}",this.name,Nr(e,!1))}const r=this.notificationService.notify({id:`${Wc(this.resource.toString())}`,severity:Xe.Error,message:o,actions:{primary:n}}),a=this._register(M.once(M.any(this.onDidSave,this.onDidRevert))(()=>r.close()));this._register(M.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!==Qi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Fp.CONFLICT:return this.inConflictMode;case Fp.DIRTY:return this.dirty;case Fp.ERROR:return this.inErrorMode;case Fp.ORPHAN:return this.isOrphaned();case Fp.PENDING_SAVE:return this.saveSequentializer.isRunning();case Fp.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()}},hj=iM,iM.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,iM);e3e=hj=D([_(5,Jt),_(6,Ge),_(7,zb),_(8,_d),_(9,H6),_(10,Rm),_(11,bi),_(12,pXe),_(13,ei),_(14,F6),_(15,cg)],e3e);var KP;let t3e=KP=class extends RI{constructor(e,t,i,n,o,r){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=n,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&&KP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return KP._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Fp.ORPHAN)}hasAssociatedFilePath(){return!KP._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return KP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Fp.ERROR):!1}revert(e){return Tt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Tt(this.isResolved()),this._workingCopy.save(e)}async load(e){return!this._workingCopy||!this._workingCopy.model?(this.resource.scheme===pe.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}),Tt(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&aC.Untitled)}};t3e=KP=D([_(5,_d)],t3e);class ost extends V{constructor(e,t,i,n,o){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=o,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(a=>{for(const c of a.rawEvents)if(c.kind!==Sl.Initialize&&!c.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const r=this._configurationService.getValue(HAe.remoteSaving);(r||e.uri.scheme===pe.vscodeRemote)&&(this.configuration={backupDelay:1e4}),r&&this.setSaveDelegate().catch(console.error)}async setSaveDelegate(){await this.getNotebookSerializer(),this.save=async(e,t)=>{try{let i=this._notebookService.tryGetDataProviderSync(this.notebookModel.viewType)?.serializer;if(i||(this._logService.warn("No serializer found for notebook model, checking if provider still needs to be resolved"),i=await this.getNotebookSerializer()),t.isCancellationRequested)throw new Ma;return await i.save(this._notebookModel.uri,this._notebookModel.versionId,e,t)}catch(i){throw t.isCancellationRequested||this._telemetryService.publicLogError2("notebook/SaveError",{isRemote:this._notebookModel.uri.scheme===pe.vscodeRemote,error:i}),i}}}dispose(){this._notebookModel.dispose(),super.dispose()}get notebookModel(){return this._notebookModel}async snapshot(e,t){const i=await this.getNotebookSerializer(),n={metadata:wj(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(HAe.outputBackupSizeLimit)*1024;if(e===M$.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=wj(a.metadata,d=>!i.options.transientCellMetadata[d]),n.cells.push(c)}const r=await i.notebookToData(n);if(t.isCancellationRequested)throw new Ma;return t6(r)}async update(e,t){const i=await this.getNotebookSerializer(),n=await eD(e),o=await i.dataToNotebook(n);if(t.isCancellationRequested)throw new Ma;this._notebookModel.reset(o.cells,o.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof hG))throw new Error("CANNOT open file notebook with this provider");return e.serializer}get versionId(){return this._notebookModel.alternativeVersionId}pushStackElement(){this._notebookModel.pushStackElement()}}let i3e=class{constructor(e,t,i,n,o){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=o}async createModel(e,t,i){const n=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(n instanceof hG))throw new Error("CANNOT open file notebook with this provider");const o=await eD(t),r=await n.serializer.dataToNotebook(o);if(i.isCancellationRequested)throw new Ma;const a=this._notebookService.createNotebookTextModel(n.viewType,e,r,n.serializer.options);return new ost(a,this._notebookService,this._configurationService,this._telemetryService,this._logService)}};i3e=D([_(1,tE),_(2,Te),_(3,Yi),_(4,Ge)],i3e);let kjt=class{constructor(e){this._proxy=e.getProxy(Ye.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.model||!(e.model instanceof ost))return;let o;const r=new Promise((a,c)=>{o=setTimeout(()=>c(new Error(g(4874,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,n).then(l=>{clearTimeout(o)}).then(a,c)});return Mre(r,n)}},n3e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(kjt,e))}dispose(){this._saveParticipantDisposable.dispose()}};n3e=D([QN,_(1,we),_(2,zb)],n3e);let s3e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` -`,Ca,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};s3e=D([Gi(Be.MainThreadInteractive),_(1,eMe)],s3e);const Ijt={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:g(6664,"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(6665,"Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:g(6666,"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 Jxe;(function(s){function e(t,i,n){if(!t)return;const o=Lt(t.type)?t.type:void 0;if(!o||o.length===0){n.error(g(6667,"The task type configuration is missing the required 'taskType' property"));return}const r=[];if(Array.isArray(t.required))for(const a of t.required)Lt(a)&&r.push(a);return{extensionId:i.value,taskType:o,required:r,properties:t.properties?xs(t.properties):{},when:t.when?he.deserialize(t.when):void 0}}s.from=e})(Jxe||(Jxe={}));const Tjt=eh.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:(s,e)=>{for(const t of s)t.type&&e.push(`onTaskType:${t.type}`)},jsonSchema:{description:g(6668,"Contributes task kinds"),type:"array",items:Ijt}});class Ljt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{Tjt.setHandler((i,n)=>{this._schema=void 0;try{for(const o of n.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 n.added){const r=o.value;for(const a of r){const c=Jxe.from(a,o.description.identifier,o.collector);c&&(this.taskTypes[c.taskType]=c)}}(n.removed.length>0||n.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=xs(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 Rjt=new Ljt,rst="settings";new Q("taskRunning",!1,g(3790,"Whether a task is currently running."));Pe(3791,"Tasks");var vie;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(vie||(vie={}));const ast="$customized";(function(s){function e(t){if(!t)return s.Strong;switch(t.toLowerCase()){case"escape":return s.Escape;case"strong":return s.Strong;case"weak":return s.Weak;default:return s.Strong}}s.from=e})(vie||(vie={}));var N$;(function(s){s.defaults={cwd:"${workspaceFolder}"}})(N$||(N$={}));var P$;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(P$||(P$={}));(function(s){function e(t){switch(t.toLowerCase()){case"always":return s.Always;case"silent":return s.Silent;case"never":return s.Never;default:return s.Always}}s.fromString=e})(P$||(P$={}));var F$;(function(s){s[s.Never=1]="Never",s[s.OnProblem=2]="OnProblem",s[s.Always=3]="Always"})(F$||(F$={}));(function(s){function e(t){switch(t.toLowerCase()){case"always":return s.Always;case"never":return s.Never;case"onproblem":return s.OnProblem;default:return s.OnProblem}}s.fromString=e})(F$||(F$={}));var O$;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(O$||(O$={}));(function(s){function e(t){switch(t.toLowerCase()){case"shared":return s.Shared;case"dedicated":return s.Dedicated;case"new":return s.New;default:return s.Shared}}s.fromString=e})(O$||(O$={}));var bie;(function(s){s.defaults={echo:!0,reveal:P$.Always,revealProblems:F$.Never,focus:!1,panel:O$.Shared,showReuseMessage:!0,clear:!1}})(bie||(bie={}));var am;(function(s){s[s.Shell=1]="Shell",s[s.Process=2]="Process",s[s.CustomExecution=3]="CustomExecution"})(am||(am={}));(function(s){function e(i){switch(i.toLowerCase()){case"shell":return s.Shell;case"process":return s.Process;case"customExecution":return s.CustomExecution;default:return s.Process}}s.fromString=e;function t(i){switch(i){case s.Shell:return"shell";case s.Process:return"process";case s.CustomExecution:return"customExecution";default:return"process"}}s.toString=t})(am||(am={}));var o3e;(function(s){function e(t){return Lt(t)?t:t.value}s.value=e})(o3e||(o3e={}));var r3e;(function(s){s.Clean={_id:"clean",isDefault:!1},s.Build={_id:"build",isDefault:!1},s.Rebuild={_id:"rebuild",isDefault:!1},s.Test={_id:"test",isDefault:!1};function e(i){return i===s.Clean._id||i===s.Build._id||i===s.Rebuild._id||i===s.Test._id}s.is=e;function t(i){if(i!==void 0)return Lt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}s.from=t})(r3e||(r3e={}));var ox;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.Folder=3]="Folder"})(ox||(ox={}));var pA;(function(s){s.Workspace="workspace",s.Extension="extension",s.InMemory="inMemory",s.WorkspaceFile="workspaceFile",s.User="user";function e(t){switch(t){case s.User:return St.USER;case s.WorkspaceFile:return St.WORKSPACE;default:return St.WORKSPACE_FOLDER}}s.toConfigurationTarget=e})(pA||(pA={}));var a3e;(function(s){s.parallel="parallel",s.sequence="sequence"})(a3e||(a3e={}));var Xxe;(function(s){s[s.default=1]="default",s[s.folderOpen=2]="folderOpen"})(Xxe||(Xxe={}));var wie;(function(s){s.defaults={reevaluateOnRerun:!0,runOn:Xxe.default,instanceLimit:1}})(wie||(wie={}));class vPe{constructor(e,t,i,n,o,r){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=n,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(Lt(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 pz extends vPe{constructor(e,t,i,n,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 pz(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 am.Shell:t="shell";break;case am.Process:t="process";break;case am.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 pz}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===pA.User?rst: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!==pA.Workspace&&(t+=this._source.kind),JSON.stringify({type:ast,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?_i(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new pz(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class mz extends vPe{constructor(e,t,i,n,o,r,a){super(e,i,n,r,a,t),this._source=t,this.configures=o}static is(e){return e instanceof mz}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?_i(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===pA.User?rst:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==pA.Workspace&&(t+=this._source.kind),JSON.stringify({type:ast,folder:e,id:t})}}class eL extends vPe{constructor(e,t,i,n,o,r,a,c,l){super(e,i,n,c,l,t),this.defines=o,this.hasDefinedMatchers=a,this.command=r,this.icon=l.icon,this.hide=l.hide}clone(){return new eL(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 eL}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===ox.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 eL(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var yie;(function(s){s[s.Process=1]="Process",s[s.Terminal=2]="Terminal"})(yie||(yie={}));(function(s){s._default=s.Terminal})(yie||(yie={}));var c3e;(function(s){s[s.V0_1_0=1]="V0_1_0",s[s.V2_0_0=2]="V2_0_0"})(c3e||(c3e={}));var __;(function(s){s.DependsOnStarted="dependsOnStarted",s.AcquiredInput="acquiredInput",s.Start="start",s.ProcessStarted="processStarted",s.Active="active",s.Inactive="inactive",s.Changed="changed",s.Terminated="terminated",s.ProcessEnded="processEnded",s.End="end"})(__||(__={}));var Cie;(function(s){s.SingleRun="singleRun",s.Background="background"})(Cie||(Cie={}));var l3e;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.FolderOpen=2]="FolderOpen",s[s.ConfigurationChange=3]="ConfigurationChange",s[s.Reconnect=4]="Reconnect"})(l3e||(l3e={}));var d3e;(function(s){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?Cie.Background:Cie.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:__.Start,terminalId:l,resolvedVariables:d}}s.start=t;function i(c,l,d){return{...e(c),kind:__.ProcessStarted,terminalId:l,processId:d}}s.processStarted=i;function n(c,l,d){return{...e(c),kind:__.ProcessEnded,terminalId:l,exitCode:d}}s.processEnded=n;function o(c,l,d){return{...e(c),kind:__.Terminated,exitReason:d,terminalId:l}}s.terminated=o;function r(c,l,d){return{...e(l),kind:c,terminalId:d}}s.general=r;function a(){return{kind:__.Changed}}s.changed=a})(d3e||(d3e={}));var Sie;(function(s){function e(i){const n=Object.keys(i).sort();let o="";for(const r of n){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}s.create=t})(Sie||(Sie={}));var h3e;(function(s){s.AutoDetect="task.autoDetect",s.SaveBeforeRun="task.saveBeforeRun",s.ShowDecorations="task.showDecorations",s.ProblemMatchersNeverPrompt="task.problemMatchers.neverPrompt",s.SlowProviderWarning="task.slowProviderWarning",s.QuickOpenHistory="task.quickOpen.history",s.QuickOpenDetail="task.quickOpen.detail",s.QuickOpenSkip="task.quickOpen.skip",s.QuickOpenShowAll="task.quickOpen.showAll",s.AllowAutomaticTasks="task.allowAutomaticTasks",s.Reconnection="task.reconnection",s.VerboseLogging="task.verboseLogging"})(h3e||(h3e={}));var u3e;(function(s){s.Tasks="tasks",s.SuppressTaskName="tasks.suppressTaskName",s.Windows="tasks.windows",s.Osx="tasks.osx",s.Linux="tasks.linux",s.ShowOutput="tasks.showOutput",s.IsShellCommand="tasks.isShellCommand",s.ServiceTestSetting="tasks.service.testSetting"})(u3e||(u3e={}));var Zxe;(function(s){function e(t,i){const n=Rjt.get(t.type);if(n===void 0){const c=xs(t);return delete c._key,Sie.create(c)}const o=Object.create(null);o.type=n.taskType;const r=new Set;n.required.forEach(c=>r.add(c));const a=n.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]=xs(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(3792,"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 Sie.create(o)}s.createTaskIdentifier=e})(Zxe||(Zxe={}));var Aie;(function(s){function e(t){return{id:t.id,task:Tf.from(t.task)}}s.from=e})(Aie||(Aie={}));var eDe;(function(s){function e(t,i){return{id:t.id,processId:i}}s.from=e})(eDe||(eDe={}));var tDe;(function(s){function e(t,i){return{id:t.id,exitCode:i}}s.from=e})(tDe||(tDe={}));var Eie;(function(s){function e(i){const n=Object.assign(Object.create(null),i);return delete n._key,n}s.from=e;function t(i,n){let o=Zxe.createTaskIdentifier(i,console);return o===void 0&&n&&(o={_key:ar(),type:"$executeOnly"}),o}s.to=t})(Eie||(Eie={}));var xie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?bie.defaults:Object.assign(Object.create(null),bie.defaults,i)}s.to=t})(xie||(xie={}));var Die;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?wie.defaults:Object.assign(Object.create(null),wie.defaults,i)}s.to=t})(Die||(Die={}));var kie;(function(s){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}s.from=e;function t(i){return i==null?N$.defaults:{cwd:i.cwd||N$.defaults.cwd,env:i.env}}s.to=t})(kie||(kie={}));var _z;(function(s){function e(n){const o=n;return o&&!!o.process}s.is=e;function t(n){const o=Lt(n.name)?n.name:n.name.value,r=n.args?n.args.map(c=>Lt(c)?c:c.value):[],a={process:o,args:r};return n.options&&(a.options=kie.from(n.options)),a}s.from=t;function i(n){const o={runtime:am.Process,name:n.process,args:n.args,presentation:void 0};return o.options=kie.to(n.options),o}s.to=i})(_z||(_z={}));var Iie;(function(s){function e(i){if(i==null)return;const n={cwd:i.cwd||N$.defaults.cwd,env:i.env};return i.shell&&(n.executable=i.shell.executable,n.shellArgs=i.shell.args,n.shellQuoting=i.shell.quoting),n}s.from=e;function t(i){if(i==null)return;const n={cwd:i.cwd,env:i.env};return i.executable&&(n.shell={executable:i.executable},i.shellArgs&&(n.shell.args=i.shellArgs),i.shellQuoting&&(n.shell.quoting=i.shellQuoting)),n}s.to=t})(Iie||(Iie={}));var vz;(function(s){function e(n){const o=n;return o&&(!!o.commandLine||!!o.command)}s.is=e;function t(n){const o={};return n.name&&Lt(n.name)&&(n.args===void 0||n.args===null||n.args.length===0)?o.commandLine=n.name:(o.command=n.name,o.args=n.args),n.options&&(o.options=Iie.from(n.options)),o}s.from=t;function i(n){const o={runtime:am.Shell,name:n.commandLine?n.commandLine:n.command,args:n.args,presentation:void 0};return n.options&&(o.options=Iie.to(n.options)),o}s.to=i})(vz||(vz={}));var U1;(function(s){function e(n){const o=n;return o&&o.customExecution==="customExecution"}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n){return{runtime:am.CustomExecution,presentation:void 0}}s.to=i})(U1||(U1={}));var Tie;(function(s){function e(i){const n={label:i.label};return i.kind===pA.Extension?(n.extensionId=i.extension,i.workspaceFolder?n.scope=i.workspaceFolder.uri:n.scope=i.scope):i.kind===pA.Workspace&&(n.extensionId="$core",n.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:ox.Global),n}s.from=e;function t(i,n){let o,r;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==ox.Global?n.getWorkspace().folders.length===0?(o=ox.Global,r=void 0):(o=ox.Folder,r=n.getWorkspace().folders[0]):typeof i.scope=="number"?o=i.scope:(o=ox.Folder,r=n.getWorkspaceFolder(N.revive(i.scope))??void 0),{kind:pA.Extension,label:i.label,extension:i.extensionId,scope:o,workspaceFolder:r}}s.to=t})(Tie||(Tie={}));var Lie;(function(s){function e(t){const i=t;return i&&Lt(i.id)&&!!i.workspaceFolder}s.is=e})(Lie||(Lie={}));var Tf;(function(s){function e(i){if(i==null||!pz.is(i)&&!eL.is(i)&&!mz.is(i))return;const n={_id:i._id,name:i.configurationProperties.name,definition:Eie.from(i.getDefinition(!0)),source:Tie.from(i._source),execution:void 0,presentationOptions:!mz.is(i)&&i.command?xie.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:eL.is(i)?i.hasDefinedMatchers:!1,runOptions:Die.from(i.runOptions)};if(n.group=iDe.from(i.configurationProperties.group),i.configurationProperties.detail&&(n.detail=i.configurationProperties.detail),!mz.is(i)&&i.command)switch(i.command.runtime){case am.Process:n.execution=_z.from(i.command);break;case am.Shell:n.execution=vz.from(i.command);break;case am.CustomExecution:n.execution=U1.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const o of i.configurationProperties.problemMatchers)Lt(o)&&n.problemMatchers.push(o);return n}s.from=e;function t(i,n,o,r,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(vz.is(i.execution)?c=vz.to(i.execution):_z.is(i.execution)?c=_z.to(i.execution):U1.is(i.execution)&&(c=U1.to(i.execution))),!c)return;c.presentation=xie.to(i.presentationOptions);const l=Tie.to(i.source,n),d=g(4875,"{0}: {1}",l.label,i.name),h=Eie.to(i.definition,o),u=U1.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new eL(u,l,d,h.type,h,c,i.hasDefinedMatchers,Die.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})}s.to=t})(Tf||(Tf={}));var iDe;(function(s){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}}s.from=e})(iDe||(iDe={}));var nDe;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(nDe||(nDe={}));let g3e=class extends V{constructor(e,t,i,n){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=n,this._proxy=e.getProxy(Ye.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async o=>{if(o.kind===__.Changed)return;const r=o.__task;if(o.kind===__.Start){const a=Aie.from(r.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&U1.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===__.ProcessStarted?this._proxy.$onDidStartTaskProcess(eDe.from(r.getTaskExecution(),o.processId)):o.kind===__.ProcessEnded?this._proxy.$onDidEndTaskProcess(tDe.from(r.getTaskExecution(),o.exitCode)):o.kind===__.End&&this._proxy.$OnDidEndTask(Aie.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 n=Tf.to(e,this._workspaceContextServer,!0);n?t(n._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=Tf.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=Tf.from(o);return r?(r.name=r.name===void 0?"":r.name,Promise.resolve(this._proxy.$resolveTask(e,r)).then(a=>{if(a)return Tf.to(a,this._workspaceContextServer,!0,o.configurationProperties.icon,o.configurationProperties.hide)})):Promise.resolve(void 0)}},n=this._taskService.registerTaskProvider(i,t);return this._providers.set(e,{disposable:n,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(nDe.to(e)).then(t=>{const i=[];for(const n of t){const o=Tf.from(n);o&&i.push(o)}return i})}getWorkspace(e){let t;if(typeof e=="string")t=e;else{const i=this._workspaceContextServer.getWorkspace(),n=N.revive(e);i.configuration?.toString()===n.toString()?t=i:t=this._workspaceContextServer.getWorkspaceFolder(n)}return t}async $getTaskExecution(e){if(Lie.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:Tf.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Tf.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Tf.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if(Lie.is(e)){const n=this.getWorkspace(e.workspaceFolder);n?this._taskService.getTask(n,e.id,!0).then(o=>{if(!o)i(new Error("Task not found"));else{const r={id:e.id,task:Tf.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 n=Tf.to(e,this._workspaceContextServer,!0);this._taskService.run(n).then(void 0,r=>{});const o={id:n._id,task:Tf.from(n)};t(o)}})}$customExecutionComplete(e,t){return new Promise((i,n)=>{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=>{n(a)});return}n(new Error("Task to mark as complete not found"))})})}$terminateTask(e){return new Promise((t,i)=>{this._taskService.getActiveTasks().then(n=>{for(const o of n)if(e===o._id){this._taskService.terminate(o).then(r=>{t(void 0)},r=>{i(void 0)});return}i(new La("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=Kd.Web;break;case"win32":i=Kd.Windows;break;case"darwin":i=Kd.Mac;break;case"linux":i=Kd.Linux;break;default:i=R6e}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:n=>N.from({scheme:t.scheme,authority:t.authority,path:n}),context:this._extHostContext,resolveVariables:(n,o,r)=>{const a=[];return o.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(n.uri,{process:o.process,variables:a})).then(c=>{const l=Array.from(Object.values(c.variables));return new Promise((d,h)=>{this._configurationResolverService.resolveWithInteraction(n,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:(n,o,r)=>this._proxy.$findExecutable(n,o,r)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};g3e=D([Gi(Be.MainThreadTask),_(1,UJe),_(2,yi),_(3,oMe)],g3e);let f3e=class extends V{constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new mo)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};f3e=D([Gi(Be.MainThreadLabelService),_(1,Fs)],f3e);var Mp;(function(s){s.Http="http",s.Https="https"})(Mp||(Mp={}));var RS;(function(s){s.ConstantPrivate="constantPrivate",s.Private="private",s.Public="public"})(RS||(RS={}));var BE;(function(s){s[s.Notify=1]="Notify",s[s.OpenBrowser=2]="OpenBrowser",s[s.OpenPreview=3]="OpenPreview",s[s.Silent=4]="Silent",s[s.Ignore=5]="Ignore",s[s.OpenBrowserOnce=6]="OpenBrowserOnce"})(BE||(BE={}));function Mjt(s){if(s.scheme!=="http"&&s.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(s.authority);if(e)return{address:e[1],port:+e[2]}}const B$=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function W$(s){return B$.indexOf(s)>=0}const Rie=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function H$(s){return Rie.indexOf(s)>=0}class Njt{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 p3e=class extends V{constructor(e,t){super(),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 n=Array.from(i.values());for(const o of n){const r=await o.value;r&&typeof r!="string"&&e.push(r)}}return e}async dispose(){super.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,n,o){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:n,protocol:o,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(H$(e)||W$(e))&&(e=B$[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,n,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"),n||(n=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,n,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 n=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),n}}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 n=i.get(t);n.refcount=0,await this.tryDisposeTunnel(e,t,n)}}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 n=i.get(t),o=n?await n.value:void 0;(!o||typeof o=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];W$(e)?(i.push(...B$),i.push(...Rie)):H$(e)&&i.push(...Rie);const n=i.map(o=>this._tunnels.get(o));for(const o of n){const r=o?.get(t);if(r)return r}}canTunnel(e){return!!Mjt(e)}createWithProvider(e,t,i,n,o,r,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${n}.`);const c=i;this._factoryInProgress.add(c);const l=n===void 0?i:n,d={elevationRequired:o?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:n,privacy:r,public:r?r!==RS.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}};p3e=D([_(0,Ge),_(1,Te)],p3e);const _u=ae("IExtHostInitDataService"),Jo=ae("IExtHostRpcService");class Pjt{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)}}class Fjt extends Njt{}var Mie;(function(s){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?RS.Public:RS.Private),protocol:i.protocol}}s.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==RS.ConstantPrivate&&i.privacy!==RS.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}s.fromServiceTunnel=t})(Mie||(Mie={}));const bPe=ae("IExtHostTunnelService");let sDe=class extends V{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(Be.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 n=new Fjt(i.remoteAddress,i.localAddress,()=>this._proxy.$closeTunnel(i.remoteAddress));return this._register(n),n}}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 Qs(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,n,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:n},o)}catch{h=await l.provider.providePortAttributes(d,i,n,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(n,o)=>await e.provideTunnel(n,o,He.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 n=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&n.length===0&&(n=[{id:"private",label:g(574,"Private"),themeIcon:"lock"},{id:"public",label:g(575,"Public"),themeIcon:"eye"}]);const o=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:n,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 n=await i;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),n===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(n.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(n.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:n,disposeListener:o}),Mie.fromApiTunnel(n)}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(n=>this._showCandidatePort(n.host,n.port,n.detail??""))),i=e.filter((n,o)=>t[o]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(n=>n.port).join(", ")} to ${i.map(n=>n.port).join(", ")}`),i}};sDe=D([_(0,Jo),_(1,_u),_(2,Ge)],sDe);const Ojt=10*1e3,OK="remote.tunnels.toRestore",Fue="remote.tunnels.toRestoreExpiration",Bjt=1e3*60*60*24*14,m3e="onTunnel",cst=new Q("forwardedPortsViewEnabled",!1,g(8676,"Whether the Ports view is enabled."));function Wjt(s){const e=s.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 tL;(function(s){s.Other="Other",s.User="User",s.AutoForwardEnd="AutoForwardEnd"})(tL||(tL={}));var hb;(function(s){s[s.User=0]="User",s[s.Auto=1]="Auto",s[s.Extension=2]="Extension"})(hb||(hb={}));const Oue={source:hb.User,description:g(8677,"User Forwarded")};hb.Auto,g(8678,"Auto Forwarded");function _3e(s,e,t){const i=s.get(Ig(e,t));if(i)return i;if(W$(e))for(const n of B$){const o=Ig(n,t);if(s.has(o))return s.get(o)}else if(H$(e))for(const n of Rie){const o=Ig(n,t);if(s.has(o))return s.get(o)}}function vg(s,e,t){const i=_3e(s,e,t);if(i)return i;const n=H$(e)?"localhost":W$(e)?"0.0.0.0":void 0;if(n)return _3e(s,n,t)}function Ig(s,e){return s+":"+e}var WE;(function(s){s.Notify="notify",s.OpenBrowser="openBrowser",s.OpenBrowserOnce="openBrowserOnce",s.OpenPreview="openPreview",s.Silent="silent",s.Ignore="ignore"})(WE||(WE={}));function Hjt(s){return s&&"host"in s&&typeof s.host=="string"&&"port"in s&&typeof s.port=="number"&&(!("detail"in s)||typeof s.detail=="string")&&(!("pid"in s)||typeof s.pid=="string")}const yu=class yu extends V{constructor(e){super(),this.configurationService=e,this.portsAttributes=[],this._onDidChangeAttributes=new I,this.onDidChangeAttributes=this._onDidChangeAttributes.event,this._register(e.onDidChangeConfiguration(t=>{(t.affectsConfiguration(yu.SETTING)||t.affectsConfiguration(yu.DEFAULTS))&&this.updateAttributes()})),this.updateAttributes()}updateAttributes(){this.portsAttributes=this.readSetting(),this._onDidChangeAttributes.fire()}getAttributes(e,t,i){let n=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(;n>=0;){const r=this.portsAttributes[n];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),n=this.findNextIndex(e,t,i,this.portsAttributes,n+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&&Lt(e.host)&&lc(e.port)}findNextIndex(e,t,i,n,o){if(o>=n.length)return-1;const r=!W$(t)&&!H$(t),c=n.slice(o).findIndex(l=>lc(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(yu.SETTING);if(!e||!kn(e))return[];const t=[];for(const n in e){if(n===void 0)continue;const o=e[n];let r;if(Number(n))r=Number(n);else if(Lt(n))if(yu.RANGE.test(n)){const a=n.match(yu.RANGE);r={start:Number(a[1]),end:Number(a[2])}}else if(yu.HOST_AND_PORT.test(n)){const a=n.match(yu.HOST_AND_PORT);r={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(n)}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(yu.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,n){return lc(i.key)?i.key:n.hasStartEnd(i.key)?i.key.start:n.hasHostAndPort(i.key)?i.key.port:Number.MAX_VALUE}return e.sort((i,n)=>t(i,this)-t(n,this))}getOtherAttributes(){return this.defaultPortAttributes}static providedActionToAction(e){switch(e){case BE.Notify:return WE.Notify;case BE.OpenBrowser:return WE.OpenBrowser;case BE.OpenBrowserOnce:return WE.OpenBrowserOnce;case BE.OpenPreview:return WE.OpenPreview;case BE.Silent:return WE.Silent;case BE.Ignore:return WE.Ignore;default:return}}async addAttributes(e,t,i){const o=this.configurationService.inspect(yu.SETTING).userRemoteValue;let r;!o||!kn(o)?r={}:r=xs(o),r[`${e}`]||(r[`${e}`]={});for(const a in t)r[`${e}`][a]=t[a];return this.configurationService.updateValue(yu.SETTING,r,i)}};yu.SETTING="remote.portsAttributes",yu.DEFAULTS="remote.otherPortsAttributes",yu.RANGE=/^(\d+)\-(\d+)$/,yu.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let Nie=yu,U$=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=n,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 Nie(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=Ig(f.tunnelRemoteHost,f.tunnelRemotePort),m=vg(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??Mp.Http,localUri:await this.makeLocalUri(f.localAddress,u?.get(f.tunnelRemotePort)),localPort:f.tunnelLocalPort,name:u?.get(f.tunnelRemotePort)?.label,runningProcess:m?.detail,hasRunningProcess:!!m,pid:m?.pid,privacy:f.privacy,source:Oue}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=Ig(h.tunnelRemoteHost,h.tunnelRemotePort);if(!vg(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!vg(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!vg(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=vg(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??Mp.Http,localUri:await this.makeLocalUri(h.localAddress,p),localPort:h.tunnelLocalPort,name:p?.label,closeable:!0,runningProcess:f?.detail,hasRunningProcess:!!f,pid:f?.pid,privacy:h.privacy,source:Oue})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,tL.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(m3e))?(this.contextKeyService.createKey(cst.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=Ig(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 N.parse(e);const i=t?.protocol??"http";return N.parse(`${i}://${e}`)}async addStorageKeyPostfix(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?Wc(t.configuration.path):t.folders.length>0?Wc(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(OK)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(Fue)}async getTunnelRestoreValue(){const e=this.storageService.get(OK,Ie.WORKSPACE);if(e)return this.storageService.remove(OK,Ie.WORKSPACE),await this.storeForwarded(),e;const t=await this.getTunnelRestoreStorageKey();if(t)return this.storageService.get(t,Ie.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 n=vg(this.detected,i.remoteHost,i.remotePort);i.source.source!==hb.Extension&&!n||i.source.source===hb.Extension&&n?await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,elevateIfNeeded:!0,source:i.source}):i.source.source===hb.Extension&&!n&&this.unrestoredExtensionTunnels.set(Ig(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(Ie.PROFILE,void 0,this.restoreListener)(async t=>{t.key===e&&(this.tunnelRestoreValue=Promise.resolve(this.storageService.get(e,Ie.PROFILE)),await this.restoreForwarded())}))}}cleanupExpiredTunnelsForRestore(){const e=this.storageService.keys(Ie.PROFILE,an.USER).filter(t=>t.startsWith(Fue));for(const t of e){const i=this.storageService.getNumber(t,Ie.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 n=await this.getTunnelRestoreStorageKey(),o=await this.getRestoreExpirationStorageKey();!i&&n&&o?(this.storageService.remove(n,Ie.PROFILE),this.storageService.remove(o,Ie.PROFILE)):i!==this.knownPortsRestoreValue&&n&&o&&(this.storageService.store(n,i,Ie.PROFILE,an.USER),this.storageService.store(o,Date.now()+Bjt,Ie.PROFILE,an.USER)),this.knownPortsRestoreValue=i}}async showPortMismatchModalIfNeeded(e,t,i){if(!e.tunnelLocalPort||!i?.requireLocalPort||e.tunnelLocalPort===t)return;const n=new Date;if(this.mismatchCooldown.getTime()+Ojt>n.getTime())return;this.mismatchCooldown=n;const o=g(8679,`Local port {0} could not be used for forwarding to remote port {1}. +`)}getReplyCountAsString(e,t){return e.replies.length&&!t?g(5339," {0} replies,",e.replies.length):""}createTree(){this.treeLabels=this._register(this.instantiationService.createInstance(WA,this)),this.tree=this._register(this.instantiationService.createInstance(Txe,this.treeLabels,this.treeContainer,{overrideStyles:this.getLocationBasedColors().listOverrideStyles,selectionNavigation:!0,filter:this.filter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:e=>{}},accessibilityProvider:{getAriaLabel:e=>e instanceof Kce?g(5340,"Comments for current workspace"):e instanceof Xf?g(5341,"Comments in {0}, full path {1}",_i(e.resource),e.resource.fsPath):e instanceof Qw?this.getScreenReaderInfoForNode(e,!0):"",getWidgetAriaLabel(){return xxe.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()})),this._register(this.tree.onDidFocus(()=>this.commentsFocusedContextKey.set(!0))),this._register(this.tree.onDidBlur(()=>this.commentsFocusedContextKey.set(!1)))}openFile(e,t,i,n){if(!e||!(e instanceof Xf||e instanceof Qw))return;const o=e instanceof Xf?e.commentThreads[0].thread:e.thread,r=e instanceof Xf?e.commentThreads[0].comment:void 0;return Ynt(this.commentService,this.editorService,this.uriIdentityService,o,r,!1,t,i,n)}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,N8e(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}};Wxe=D([_(1,we),_(2,Sm),_(3,ei),_(4,Te),_(5,Le),_(6,lr),_(7,Ut),_(8,Ao),_(9,pn),_(10,XA),_(11,Yi),_(12,ec),_(13,ks),_(14,$i)],Wxe);const hjt=new _e("Views");jn.appendMenuItem(_e.ViewContainerTitle,{submenu:hjt,title:g(5295,"Views"),order:1});var lh;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(lh||(lh={}));const joe=class joe extends OTe{get currentDropOperation(){return this._currentDropOperation}constructor(e,t,i,n,o){super(o),this.paneElement=e,this.orientation=t,this.bounds=i,this.location=n,this.cleanupOverlayScheduler=this._register(new cn(()=>this.dispose(),300)),this.create()}get disposed(){return!!this._disposed}create(){this.container=document.createElement("div"),this.container.id=joe.OVERLAY_ID,this.container.style.top="0px",this.paneElement.appendChild(this.container),this.paneElement.classList.add("dragged-over"),this._register(Ee(()=>{this.container.remove(),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===ir.Panel?uJe:mJe)||"";const e=this.getColor(Js);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 Vj(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(ue(this.container,ke.MOUSE_OVER,()=>{this.cleanupOverlayScheduler.isScheduled()||this.cleanupOverlayScheduler.schedule()}))}positionOverlay(e,t){const i=this.paneElement.clientWidth,n=this.paneElement.clientHeight,o=i/2,r=n/2;let a;switch(this.orientation===fi.VERTICAL?t=r&&(a=lh.DOWN):this.orientation===fi.HORIZONTAL&&(e=o&&(a=lh.RIGHT)),a){case lh.UP:this.doPositionOverlay({top:"0",left:"0",width:"100%",height:"50%"});break;case lh.DOWN:this.doPositionOverlay({bottom:"0",left:"0",width:"100%",height:"50%"});break;case lh.LEFT:this.doPositionOverlay({top:"0",left:"0",width:"50%",height:"100%"});break;case lh.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===fi.VERTICAL&&n<=25||this.orientation===fi.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===lh.UP?"2px":"0px",this.overlay.style.borderLeftWidth=e===lh.LEFT?"2px":"0px",this.overlay.style.borderBottomWidth=e===lh.DOWN?"2px":"0px",this.overlay.style.borderRightWidth=e===lh.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}};joe.OVERLAY_ID="monaco-pane-drop-overlay";let kF=joe,Hxe=class extends OZ{constructor(e,t,i,n,o){const r=n.createScoped(e);r.createKey("viewContainer",t.id);const a=r.createKey("viewContainerLocation",MX(i.getViewContainerLocation(t)));super(_e.ViewContainerTitle,_e.ViewContainerTitleContext,{shouldForwardArgs:!0,renderShortTitle:!0},r,o),this._register(r),this._register(M.filter(i.onDidChangeContainerLocation,c=>c.viewContainer===t)(()=>a.set(MX(i.getViewContainerLocation(t)))))}};Hxe=D([_(2,Sm),_(3,Le),_(4,Oa)],Hxe);let Uxe=class extends Vtt{get onDidSashChange(){return qn(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,n,o,r,a,c,l,d,h,u){super(e,l,d),this.options=t,this.instantiationService=i,this.configurationService=n,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,Ie.WORKSPACE,void 0),this.viewContainerModel=this.viewDescriptorService.getViewContainerModel(f)}create(e){const t=this.options;t.orientation=this.orientation,this.paneview=this._register(new O5t(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(ue(e,ke.CONTEXT_MENU,c=>this.showContextMenu(new Sh(ct(e),c)))),this._register(ud.addTarget(e)),this._register(ue(e,uo.Contextmenu,c=>this.showContextMenu(new Sh(ct(e),c)))),this._menuActions=this._register(this.instantiationService.createInstance(Hxe,this.paneview.element,this.viewContainer)),this._register(this._menuActions.onDidChange(()=>this.updateTitleArea()));let i;const n=()=>{const c=e.getBoundingClientRect(),l=this.panes[this.panes.length-1].element.getBoundingClientRect(),d=this.orientation===fi.VERTICAL?l.bottom:c.top,h=this.orientation===fi.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(uS.INSTANCE.registerTarget(e,{onDragEnter:c=>{if(r=n(),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 kF(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 kF(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)&&AVe(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(Qp.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(wc(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):PN(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 ir.Sidebar:case ir.AuxiliaryBar:return fi.VERTICAL;case ir.Panel:return Bzt(this.layoutService.getPanelPosition())?fi.HORIZONTAL:fi.VERTICAL}return fi.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:n,index:o,disposable:r}of e)this.addPane(i,n,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+(n||20),0);for(const i of this.viewContainerModel.visibleViewDescriptors)this.orientation===fi.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,Ie.WORKSPACE,an.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:n,collapsed:o,index:r,size:a}of e){const c=this.createView(n,{id:n.id,title:n.name.value,fromExtensionId:n.extensionId,expanded:!o,singleViewPaneContainerTitle:n.singleViewPaneContainerTitle});c.render();const l=ue(c.draggableElement,"contextmenu",h=>{h.stopPropagation(),h.preventDefault(),this.onContextMenu(new Sh(ct(c.draggableElement),h),c)}),d=M.latch(M.map(c.onDidChange,()=>!c.isExpanded()))(h=>{this.viewContainerModel.setCollapsed(n.id,h)});t.push({pane:c,size:a||c.minimumSize,index:r,disposable:jr(l,d)})}this.addPanes(t),this.restoreViewSizes();const i=[];for(const{pane:n}of t)n.setVisible(this.isVisible()),i.push(n);return i}onDidRemoveViewDescriptors(e){e=e.sort((i,n)=>n.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,n=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)===ir.Panel;e.style({headerForeground:ze(d?eTt:hTt),headerBackground:ze(d?Z1t:dTt),headerBorder:ze(d?tTt:_Je),dropBackground:ze(d?uJe:mJe),leftBorder:d?ze(iTt):void 0});const h=new Z;h.add(i),h.add(jr(e,o,r,a,l,c));const u={pane:e,disposable:h};this.paneItems.splice(n,0,u),qn(this.paneview).addPane(e,t,n);let f;h.add(uS.INSTANCE.registerDraggable(e.draggableElement,()=>({type:"view",id:e.id}),{})),h.add(uS.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),b=this.viewDescriptorService.getViewDescriptorById(m.id);if(v!==this.viewContainer&&(!b||!b.canMoveView||this.viewContainer.rejectAddedViews))return;f=new kF(e.dropTargetElement,this.orientation??fi.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),b=this.viewDescriptorService.getViewContainerModel(v).allViewDescriptors;!b.some(w=>!w.canMoveView)&&b.length>0&&(f=new kF(e.dropTargetElement,this.orientation??fi.VERTICAL,void 0,this.viewDescriptorService.getViewContainerLocation(this.viewContainer),this.themeService))}}},onDragOver:p=>{AVe(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 b;if(m.type==="composite"&&m.id!==this.viewContainer.id&&!this.viewContainer.rejectAddedViews){const w=this.viewDescriptorService.getViewContainerById(m.id),y=this.viewDescriptorService.getViewContainerModel(w).allViewDescriptors;y.length>0&&!y.some(C=>!C.canMoveView)&&(v.push(...y),b=y[0])}else if(m.type==="view"){const w=this.viewDescriptorService.getViewContainerByViewId(m.id),y=this.viewDescriptorService.getViewDescriptorById(m.id);w!==this.viewContainer&&y&&y.canMoveView&&!this.viewContainer.rejectAddedViews&&v.push(y),y&&(b=y)}if(v&&this.viewDescriptorService.moveViewsToContainer(v,this.viewContainer,void 0,"dnd"),b){if(f.currentDropOperation===lh.DOWN||f.currentDropOperation===lh.RIGHT){const w=this.panes.findIndex(C=>C.id===b.id);let y=this.panes.findIndex(C=>C.id===e.id);w>=0&&y>=0&&(w>y&&y++,yC.id===b.id);let y=this.panes.findIndex(C=>C.id===e.id);w>=0&&y>=0&&(w=0&&y!==w&&this.movePane(this.panes[w],this.panes[y]))}v.length>1&&v.slice(1).forEach(w=>{let y=this.panes.findIndex(A=>A.id===b.id);const C=this.panes.findIndex(A=>A.id===w.id);C>=0&&y>=0&&(C>y&&y++,ythis.removePane(i)),this.updateViewHeaders(),t!==this.isViewMergedWithContainer()&&this.updateTitleArea(),this._onDidRemoveViews.fire(e)}removePane(e){const t=this.paneItems.findIndex(n=>n.pane===e);if(t===-1)return;this.lastFocusedPane===e&&(this.lastFocusedPane=void 0),qn(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),n=this.paneItems.findIndex(c=>c.pane===t),o=this.viewContainerModel.visibleViewDescriptors[i],r=this.viewContainerModel.visibleViewDescriptors[n];if(i<0||i>=this.paneItems.length||n<0||n>=this.paneItems.length)return;const[a]=this.paneItems.splice(i,1);this.paneItems.splice(n,0,a),qn(this.paneview).movePane(e,t),this.viewContainerModel.move(o.id,r.id),this.updateTitleArea()}resizePane(e,t){qn(this.paneview).resizePane(e,t)}getPaneSize(e){return qn(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 n=e;n>=0;n--)if(this.paneItems[n].pane?.isVisible()&&this.paneItems[n]?.pane.isExpanded()){t=this.paneItems[n].pane;break}for(let n=e+1;no?(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()}};Uxe=D([_(2,we),_(3,Te),_(4,CI),_(5,lr),_(6,Yi),_(7,fs),_(8,pn),_(9,$i),_(10,yi),_(11,Sm)],Uxe);class qce extends li{constructor(e,t){super(e),this.offset=t}async run(e){const t=e.get(Sm),i=e.get(Le),n=LU.getValue(i);if(n===void 0)return;const o=t.getViewContainerByViewId(n),r=t.getViewContainerModel(o),a=r.visibleViewDescriptors.find(d=>d.id===n),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 qce{constructor(){super({id:"views.moveViewUp",title:g(5296,"Move View Up"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.UpArrow),weight:Ae.WorkbenchContrib+1,when:LU.notEqualsTo("")}},-1)}});At(class extends qce{constructor(){super({id:"views.moveViewLeft",title:g(5297,"Move View Left"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.LeftArrow),weight:Ae.WorkbenchContrib+1,when:LU.notEqualsTo("")}},-1)}});At(class extends qce{constructor(){super({id:"views.moveViewDown",title:g(5298,"Move View Down"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.DownArrow),weight:Ae.WorkbenchContrib+1,when:LU.notEqualsTo("")}},1)}});At(class extends qce{constructor(){super({id:"views.moveViewRight",title:g(5299,"Move View Right"),keybinding:{primary:rr(U.CtrlCmd+S.KeyK,S.RightArrow),weight:Ae.WorkbenchContrib+1,when:LU.notEqualsTo("")}},1)}});At(class extends li{constructor(){super({id:"vscode.moveViews",title:g(5300,"Move Views")})}async run(e,t){if(!Array.isArray(t?.viewIds)||typeof t?.destinationId!="string")return Promise.reject("Invalid arguments");const i=e.get(Sm),n=i.getViewContainerById(t.destinationId);if(n){for(const o of t.viewIds){const r=i.getViewDescriptorById(o);r?.canMoveView&&i.moveViewsToContainer([r],n,owe.Default,this.desc.id)}await e.get(km).openViewContainer(n.id,!0)}}});class ujt{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||F.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,n,o,r,a,c,l,d){this.commentThreadHandle=e,this.controllerHandle=t,this.extensionId=i,this.threadId=n,this.resource=o,this._range=r,this._canReply=c,this._isTemplate=l,this.editorId=d,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,l?this.comments=[]:a&&(this._comments=a)}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:ws.CommentThread,commentControlHandle:this.controllerHandle,commentThreadHandle:this.commentThreadHandle}}}class gjt{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,n,o,r,a){this._proxy=e,this._commentService=t,this._handle=i,this._uniqueId=n,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,n,o,r,a,c){const l=new ujt(t,this.handle,e,i,N.revive(n).toString(),o,r,!0,a,c);return this._threads.set(t,l),l.isDocumentCommentThread()?this._commentService.updateComments(this._uniqueId,{added:[l],removed:[],changed:[],pending:[]}):this._commentService.updateNotebookComments(this._uniqueId,{added:[l],removed:[],changed:[],pending:[]}),l}updateCommentThread(e,t,i,n){const o=this.getKnownThread(e);o.batchUpdate(n),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===pe.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 n=await this._proxy.$provideCommentingRanges(this.handle,e,t);return{uniqueOwner:this._uniqueId,label:this.label,threads:i,commentingRanges:{resource:e,ranges:n?.ranges||[],fileComments:!!n?.fileComments}}}async getNotebookComments(e,t){if(e.scheme!==pe.vscodeNotebookCell)return{uniqueOwner:this._uniqueId,label:this.label,threads:[]};const i=[];for(const n of[...this._threads.keys()]){const o=this._threads.get(n);o.resource===e.toString()&&(o.isDocumentCommentThread()||i.push(o))}return{uniqueOwner:this._uniqueId,label:this.label,threads:i}}async toggleReaction(e,t,i,n,o){return this._proxy.$toggleReaction(this._handle,t.commentThreadHandle,e,i,n)}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:ws.CommentController,handle:this.handle}}}const P8e=oi("comments-view-icon",ve.commentDiscussion,g(4873,"View icon of the comments view."));let F8e=class extends V{constructor(e,t,i,n,o,r){super(),this._commentService=t,this._viewsService=i,this._viewDescriptorService=n,this._uriIdentityService=o,this._editorService=r,this._handlers=new Map,this._commentControllers=new Map,this._activeEditingCommentThreadDisposables=this._register(new Z),this._openViewListener=null,this._proxy=e.getProxy(Ye.ExtHostComments),this._commentService.unregisterCommentController(),this._register(this._commentService.onDidChangeActiveEditingCommentThread(async a=>{const c=a.controllerHandle,l=this._commentControllers.get(c);l&&(this._activeEditingCommentThreadDisposables.clear(),this._activeEditingCommentThread=a,l.activeEditingCommentThread=this._activeEditingCommentThread)}))}$registerCommentController(e,t,i,n){const o=`${t}-${n}`;this._handlers.set(e,o);const r=new gjt(this._proxy,this._commentService,e,o,t,i,{});this._commentService.registerCommentController(o,r),this._commentControllers.set(e,r);const a=!!this._viewDescriptorService.getViewDescriptorById(Ql);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,n,o,r,a,c,l){const d=this._commentControllers.get(e);if(d)return d.createCommentThread(a.value,t,i,n,o,r,c,l)}$updateCommentThread(e,t,i,n,o){const r=this._commentControllers.get(e);if(r)return r.updateCommentThread(t,i,n,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)}async $revealCommentThread(e,t,i,n){const o=this._commentControllers.get(e);if(!o)return Promise.resolve();const r=o.getAllComments().find(c=>c.commentThreadHandle===t);if(!r||!r.isDocumentCommentThread())return Promise.resolve();const a=r.comments?.find(c=>c.uniqueIdInThread===i);Ynt(this._commentService,this._editorService,this._uriIdentityService,r,a,n.focusReply,void 0,n.preserveFocus)}async $hideCommentThread(e,t){const i=this._commentControllers.get(e);if(!i)return Promise.resolve();const n=i.getAllComments().find(o=>o.commentThreadHandle===t);if(!n||!n.isDocumentCommentThread())return Promise.resolve();n.collapsibleState=Lc.Collapsed}registerView(e){if(!e){const t=Qe.as(jk.ViewContainersRegistry).registerViewContainer({id:Ql,title:xxe,ctorDescriptor:new wi(Uxe,[Ql,{mergeViewWithContainerWhenSingleView:!0}]),storageId:VQt,hideIfEmpty:!0,icon:P8e,order:10},ir.Panel);Qe.as(jk.ViewsRegistry).registerViews([{id:Ql,name:xxe,canToggleVisibility:!1,ctorDescriptor:new wi(Wxe),canMoveView:!0,containerIcon:P8e,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===Ql&&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===Ql)&&(this.setComments(),this.registerViewOpenedListener())})),this._register(this._viewDescriptorService.onDidChangeContainerLocation(t=>{const i=this._viewDescriptorService.getViewContainerByViewId(Ql);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)}};F8e=D([Gi(Be.MainThreadComments),_(1,XA),_(2,km),_(3,Sm),_(4,ks),_(5,ei)],F8e);var Ux;(function(s){s[s.Output=1]="Output",s[s.OutputItems=2]="OutputItems",s[s.ExecutionState=3]="ExecutionState"})(Ux||(Ux={}));var np;(function(s){function e(f){return{mime:f.mime,valueBytes:f.data}}s.toNotebookOutputItemDto=e;function t(f){return{outputId:f.outputId,metadata:f.metadata,items:f.outputs.map(e)}}s.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)}}s.toNotebookCellDataDto=i;function n(f){return{metadata:f.metadata,cells:f.cells.map(i)}}s.toNotebookDataDto=n;function o(f){return{mime:f.mime,data:f.valueBytes}}s.fromNotebookOutputItemDto=o;function r(f){return{outputId:f.outputId,metadata:f.metadata,outputs:f.items.map(o)}}s.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}}s.fromNotebookCellDataDto=a;function c(f){return{metadata:f.metadata,cells:f.cells.map(a)}}s.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}}s.toNotebookCellDto=l;function d(f){return f.editType===Ux.Output?{editType:f.editType,cellHandle:f.cellHandle,append:f.append,outputs:f.outputs.map(r)}:f.editType===Ux.OutputItems?{editType:f.editType,append:f.append,outputId:f.outputId,items:f.items.map(o)}:f}s.fromCellExecuteUpdateDto=d;function h(f){return f}s.fromCellExecuteCompleteDto=h;function u(f){return f.editType===oI.Replace?{editType:f.editType,index:f.index,count:f.count,cells:f.cells.map(a)}:f}s.fromCellEditOperationDto=u})(np||(np={}));let O8e=class{constructor(e,t,i,n){this._notebookService=t,this._cellStatusBarService=i,this._logService=n,this._disposables=new Z,this._notebookSerializer=new Map,this._notebookCellStatusBarRegistrations=new Map,this._proxy=e.getProxy(Ye.ExtHostNotebook)}dispose(){this._disposables.dispose(),bt(this._notebookSerializer.values())}$registerNotebookSerializer(e,t,i,n,o){const r=new Z;r.add(this._notebookService.registerNotebookSerializer(i,t,{options:n,dataToNotebook:async a=>{const c=new js;let l;if(a.byteLength===0&&i==="interactive")l=np.fromNotebookDataDto({cells:[],metadata:{}});else{const d=await this._proxy.$dataToNotebook(e,a,He.None);l=np.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 js,l=this._proxy.$notebookToData(e,new qd(np.toNotebookDataDto(a)),He.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(b=>(b.include||b).toString());if(!u.length)return{results:[],limitHit:!1};const f=Fi([{isFromSettings:!1,filenamePatterns:u},...l.get(i)??[]]),p=Array.from(l.keys()).flatMap(b=>b!==i?l.get(b)??[]:[]),m=await this._proxy.$searchInNotebooks(e,a,f,p,c);return{results:m.results.map(b=>({resource:N.revive(b.resource),cellResults:b.cellResults.map(y=>Mo(y))})),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 n=this,o={async provideCellStatusBarItems(a,c,l){const d=await n._proxy.$provideNotebookCellStatusBarItems(e,a,c,l);return{items:d?.items??[],dispose(){d&&n._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=n=>{this._notebookCellStatusBarRegistrations.get(n)&&(this._notebookCellStatusBarRegistrations.get(n)?.dispose(),this._notebookCellStatusBarRegistrations.delete(n))};i(e),typeof t=="number"&&i(t)}};O8e=D([Gi(Be.MainThreadNotebook),_(1,ZA),_(2,DJe),_(3,Ge)],O8e);_t.registerCommand("_executeDataToNotebook",async(s,...e)=>{const[t,i]=e;Tt(typeof t=="string","string"),Tt(i instanceof $e,"VSBuffer");const o=await s.get(ZA).withNotebookDataProvider(t);if(!(o instanceof aG))return;const r=await o.serializer.dataToNotebook(i);return new qd(np.toNotebookDataDto(r))});_t.registerCommand("_executeNotebookToData",async(s,...e)=>{const[t,i]=e;Tt(typeof t=="string","string"),Tt(typeof i=="object");const o=await s.get(ZA).withNotebookDataProvider(t);if(!(o instanceof aG))return;const r=np.fromNotebookDataDto(i.value);return await o.serializer.notebookToData(r)});var Vxe;(function(s){s[s.cell=0]="cell",s[s.notebook=1]="notebook"})(Vxe||(Vxe={}));class fjt{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=eo(e.supportedLanguages)?e.supportedLanguages:t.getRegisteredLanguageIds(),this.implementsExecutionOrder=e.supportsExecutionOrder??!1,this.hasVariableProvider=e.hasVariableProvider??!1,this.localResourceRoot=N.revive(e.extensionLocation),this.preloads=e.preloads?.map(i=>({uri:N.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=eo(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 pjt{constructor(e){this.notebookType=e}}let B8e=class{constructor(e,t,i,n,o,r){this._languageService=t,this._notebookKernelService=i,this._notebookExecutionStateService=n,this._notebookService=o,this._editors=new mo,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(Ye.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===Vxe.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:n}=this._notebookKernelService.getMatchingKernel(e.textModel);if(n){for(const[o,r]of this._kernels)if(r[0]===n){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 n=this._kernels.get(e);if(!n)throw new Error("kernel already disposed");const[o]=n;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,n=new class extends fjt{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 L2;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===n.id?this._proxy.$acceptNotebookAssociation(e,a.notebook,!1):a.newKernel===n.id&&this._proxy.$acceptNotebookAssociation(e,a.notebook,!0)}),r=this._notebookKernelService.registerKernel(n);this._kernels.set(e,[n,jr(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 n=this._kernels.get(e);n&&this._notebookKernelService.updateKernelNotebookAffinity(n[0],N.revive(t),i)}$createExecution(e,t,i,n){const o=N.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,n);c.confirm(),this._executions.set(e,c)}$updateExecution(e,t){const i=t.value;try{this._executions.get(e)?.update(i.map(np.fromCellExecuteUpdateDto))}catch(n){vt(n)}}$completeExecution(e,t){try{this._executions.get(e)?.complete(np.fromCellExecuteCompleteDto(t.value))}catch(i){vt(i)}finally{this._executions.delete(e)}}$createNotebookExecution(e,t,i){const n=N.revive(i),o=this._notebookService.getNotebookTextModel(n);if(!o)throw new Error(`Notebook not found: ${n.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(n);a.confirm(),this._notebookExecutions.set(e,a)}$beginNotebookExecution(e){try{this._notebookExecutions.get(e)?.begin()}catch(t){vt(t)}}$completeNotebookExecution(e){try{this._notebookExecutions.get(e)?.complete()}catch(t){vt(t)}finally{this._notebookExecutions.delete(e)}}async $addKernelDetectionTask(e,t){const i=new pjt(t),n=this._notebookKernelService.registerNotebookKernelDetectionTask(i);this._kernelDetectionTasks.set(e,[i,n])}$removeKernelDetectionTask(e){const t=this._kernelDetectionTasks.get(e);t&&(t[1].dispose(),this._kernelDetectionTasks.delete(e))}async $addKernelSourceActionProvider(e,t,i){const n={viewType:i,provideKernelSourceActions:async()=>(await this._proxy.$provideKernelSourceActions(e,He.None)).map(a=>{let c=a.documentation;return a.documentation&&typeof a.documentation!="string"&&(c=N.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),n.onDidChangeSourceActions=r.event}const o=this._notebookKernelService.registerKernelSourceActionProvider(i,n);this._kernelSourceActionProviders.set(e,[n,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(N.revive(e))}};B8e=D([Gi(Be.MainThreadNotebookKernels),_(1,xi),_(2,IJe),_(3,kJe),_(4,ZA),_(5,k6)],B8e);let zxe=class{constructor(e,t,i){this._notebookEditorModelResolverService=t,this._uriIdentityService=i,this._disposables=new Z,this._documentEventListenersMapping=new ui,this._proxy=e.getProxy(Ye.ExtHostNotebookDocuments),this._modelReferenceCollection=new knt(this._uriIdentityService.extUri),this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(n=>this._proxy.$acceptDirtyStateChanged(n.resource,n.isDirty()))),this._disposables.add(this._notebookEditorModelResolverService.onDidSaveNotebook(n=>this._proxy.$acceptModelSaved(n))),this._disposables.add(t.onWillFailWithConflict(n=>{this._modelReferenceCollection.remove(n.resource)}))}dispose(){this._disposables.dispose(),this._modelReferenceCollection.dispose(),bt(this._documentEventListenersMapping.values())}handleNotebooksAdded(e){for(const t of e){const i=new Z;i.add(t.onDidChangeContent(n=>{const o={versionId:n.versionId,rawEvents:[]};for(const a of n.rawEvents)switch(a.kind){case Cl.ModelChange:o.rawEvents.push({kind:a.kind,changes:a.changes.map(c=>[c[0],c[1],c[2].map(l=>np.toNotebookCellDto(l))])});break;case Cl.Move:o.rawEvents.push({kind:a.kind,index:a.index,length:a.length,newIdx:a.newIdx});break;case Cl.Output:o.rawEvents.push({kind:a.kind,index:a.index,outputs:a.outputs.map(np.toNotebookOutputDto)});break;case Cl.OutputItem:o.rawEvents.push({kind:a.kind,index:a.index,outputId:a.outputId,outputItems:a.outputItems.map(np.toNotebookOutputItemDto),append:a.append});break;case Cl.ChangeCellLanguage:case Cl.ChangeCellContent:case Cl.ChangeCellMetadata:case Cl.ChangeCellInternalMetadata:o.rawEvents.push(a);break}const r=n.rawEvents.find(a=>a.kind===Cl.ChangeDocumentMetadata);this._proxy.$acceptModelChanged(t.uri,new qd(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=np.fromNotebookDataDto(e.content);t.object.notebook.reset(i.cells,i.metadata,t.object.notebook.transientOptions)}return t.object.resource}async $tryOpenNotebook(e){const t=N.revive(e),i=await this._notebookEditorModelResolverService.resolve(t,void 0);return this._modelReferenceCollection.add(t,i),t}async $trySaveNotebook(e){const t=N.revive(e),i=await this._notebookEditorModelResolverService.resolve(t),n=await i.object.save();return i.dispose(),n}};zxe=D([_(1,Hae),_(2,ks)],zxe);class mjt{constructor(e,t){this.editor=e,this.disposables=t}dispose(){this.disposables.dispose()}}let $xe=class{constructor(e,t,i,n,o){this._editorService=t,this._notebookEditorService=i,this._editorGroupService=n,this._configurationService=o,this._disposables=new Z,this._mainThreadEditors=new Map,this._proxy=e.getProxy(Ye.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(),bt(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 n=new mjt(t,i);this._mainThreadEditors.set(t.getId(),n)}}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=ZO(t);i&&this._mainThreadEditors.has(i.getId())&&(e[i.getId()]=tI(this._editorGroupService,t.group))}Ys(e,this._currentViewColumnInfo)||(this._currentViewColumnInfo=e,this._proxy.$acceptEditorViewColumns(e))}async $tryShowNotebookDocument(e,t,i){const n={cellSelections:i.selections,preserveFocus:i.preserveFocus,pinned:i.pinned,activation:i.preserveFocus?Hk.RESTORE:void 0,override:t},o=await this._editorService.openEditor({resource:N.revive(e),options:n},TZ(this._editorGroupService,this._configurationService,i.position)),r=ZO(o);if(r)return r.getId();throw new Error(`Notebook Editor creation failure for document ${JSON.stringify(e)}`)}async $tryRevealRange(e,t,i){const n=this._notebookEditorService.getNotebookEditor(e);if(!n)return;const o=n;if(!o.hasModel()||t.start>=o.getLength())return;const r=o.cellAt(t.start);switch(i){case SF.Default:return o.revealCellRangeInView(t);case SF.InCenter:return o.revealInCenter(r);case SF.InCenterIfOutsideViewport:return o.revealInCenterIfOutsideViewport(r);case SF.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}))}};$xe=D([_(1,ei),_(2,k6),_(3,Po),_(4,Te)],$xe);var cj;class W8e{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=bre(e.documents,t.documents),n=Vge(e.textEditors,t.textEditors),o=e.activeEditor!==t.activeEditor?t.activeEditor:void 0,r=Vge(e.visibleEditors,t.visibleEditors);return{addedDocuments:i.added,removedDocuments:i.removed.map(a=>a.uri),addedEditors:n.added,removedEditors:n.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,n){this.documents=e,this.textEditors=t,this.activeEditor=i,this.visibleEditors=n}}let H8e=cj=class{constructor(e,t,i,n,o,r,a){this._notebookService=i,this._notebookEditorService=n,this._editorService=o,this._editorGroupService=r,this._logService=a,this._disposables=new Z,this._editorListeners=new mo,this._proxy=e.getProxy(Ye.ExtHostNotebook),this._mainThreadNotebooks=t.createInstance(zxe,e),this._mainThreadEditors=t.createInstance($xe,e),e.set(Be.MainThreadNotebookDocuments,this._mainThreadNotebooks),e.set(Be.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(),jr(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 n=ZO(this._editorService.activeEditorPane);let o=null;n?o=n.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=ZO(a);c?.hasModel()&&t.has(c.getId())&&i.set(c.getId(),c)}const r=new W8e(new Set(this._notebookService.listNotebookDocuments()),t,o,i);this._onDelta(W8e.delta(this._currentState,r)),this._currentState=r}_onDelta(e){if(cj._isDeltaEmpty(e))return;const t={removedDocuments:e.removedDocuments,removedEditors:e.removedEditors,newActiveEditor:e.newActiveEditor,visibleEditors:e.visibleEditors,addedDocuments:e.addedDocuments.map(cj._asModelAddData),addedEditors:e.addedEditors.map(this._asEditorAddData,this)};this._proxy.$acceptDocumentAndEditorsDelta(new qd(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(np.toNotebookCellDto)}}_asEditorAddData(e){const t=this._editorService.visibleEditorPanes.find(i=>ZO(i)===e);return{id:e.getId(),documentUri:e.textModel.uri,selections:e.getSelections(),visibleRanges:e.visibleRanges,viewColumn:t&&tI(this._editorGroupService,t.group)}}};H8e=cj=D([$N,_(1,we),_(2,ZA),_(3,k6),_(4,ei),_(5,Po),_(6,Ge)],H8e);let U8e=class extends V{constructor(e,t){super(),this.messaging=t,this.proxy=e.getProxy(Ye.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)}};U8e=D([Gi(Be.MainThreadNotebookRenderers),_(1,TJe)],U8e);var T$;(function(s){s[s.Save=1]="Save",s[s.Backup=2]="Backup"})(T$||(T$={}));var lj,Mp;(function(s){s[s.SAVED=0]="SAVED",s[s.DIRTY=1]="DIRTY",s[s.PENDING_SAVE=2]="PENDING_SAVE",s[s.CONFLICT=3]="CONFLICT",s[s.ORPHAN=4]="ORPHAN",s[s.ERROR=5]="ERROR"})(Mp||(Mp={}));var XR;let V8e=(XR=class extends uie{get model(){return this._model}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(t,r),this.typeId=e,this.name=i,this.modelFactory=n,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.progressService=v,this.capabilities=sC.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 AGe,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,n=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=n,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,n,o;try{const r=await this.fileService.stat(this.resource);t=r.mtime,i=r.ctime,n=r.size,o=r.etag,this.setOrphaned(!1)}catch(r){t=Date.now(),i=Date.now(),n=0,o=w_,this.setOrphaned(r.fileOperationResult===Qi.FILE_NOT_FOUND)}return this.resolveFromContent({resource:this.resource,name:this.name,mtime:t,ctime:i,size:n,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:w_,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=w_:this.lastResolvedFileStat&&(i=this.lastResolvedFileStat.etag);const n=this.versionId;try{const o=await this.fileService.readFileStream(this.resource,{etag:i,limits:e?.limits});if(this.setOrphaned(!1),n!==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===Qi.FILE_NOT_FOUND),this.isResolved()&&r===Qi.FILE_NOT_MODIFIED_SINCE){o instanceof b5&&this.updateLastResolvedFileStat(o.stat);return}if(this.isResolved()&&r===Qi.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,He.None)),this.installModelListeners(this._model)}async doUpdateModel(e){this.trace("doUpdateModel()"),this.ignoreDirtyOnModelContentChange=!0;try{await this.model?.update(e,He.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 B_(this.model.snapshot(T$.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(Mp.CONFLICT)||this.hasState(Mp.ERROR))&&(e.reason===Cn.AUTO||e.reason===Cn.FOCUS_CHANGE||e.reason===Cn.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(Mp.SAVED)):!1}async doSave(e){typeof e.reason!="number"&&(e.reason=Cn.EXPLICIT);const 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 ci;return this.progressService.withProgress({title:g(10700,"Saving '{0}'",this.name),location:dd.Window,cancellable:!0,delay:this.isDirty()?3e3:5e3},n=>this.doSaveSequential(t,e,n,i),()=>{i.cancel()}).finally(()=>{i.dispose()})}doSaveSequential(e,t,i,n){return this.saveSequentializer.run(e,(async()=>{if(this.isResolved()&&!t.skipSaveParticipants&&this.workingCopyFileService.hasSaveParticipants)try{if(t.reason===Cn.AUTO&&typeof this.lastContentChangeFromUndoRedo=="number"){const a=Date.now()-this.lastContentChangeFromUndoRedo;a{try{const a={mtime:o.mtime,etag:t.ignoreModifiedSince||!this.filesConfigurationService.preventSaveConflicts(o.resource)?w_:o.etag,unlock:t.writeUnlock};let c;if(typeof r.model.save=="function")try{c=await r.model.save(a,n.token)}catch(l){if(n.token.isCancellationRequested)return;throw l}else{const l=await B_(r.model.snapshot(T$.Save,n.token),n.token);if(n.token.isCancellationRequested)return;n.dispose(),t?.writeElevated&&this.elevatedFileService.isSupported(o.resource)?c=await this.elevatedFileService.writeFileElevated(o.resource,qn(l),a):c=await this.fileService.writeFile(o.resource,qn(l),a)}this.handleSaveSuccess(c,e,t)}catch(a){this.handleSaveError(a,e,t)}})(),()=>n.cancel())})(),()=>n.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===Qi.FILE_MODIFIED_SINCE&&(this.inConflictMode=!0),this.doHandleSaveError(e,i),this._onDidSaveError.fire()}doHandleSaveError(e,t){const i=e,n=[];let o;if(i.fileOperationResult===Qi.FILE_MODIFIED_SINCE)o=g(10702,"Failed to save '{0}': The content of the file is newer. Do you want to overwrite the file with your changes?",this.name),n.push(ol({id:"fileWorkingCopy.overwrite",label:g(10703,"Overwrite"),run:()=>this.save({...t,ignoreModifiedSince:!0,reason:Cn.EXPLICIT})})),n.push(ol({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()}));else{const c=i.fileOperationResult===Qi.FILE_WRITE_LOCKED,l=c&&i.options?.unlock,d=i.fileOperationResult===Qi.FILE_PERMISSION_DENIED,h=this.elevatedFileService.isSupported(this.resource);cyt(e)&&n.push(...e.actions),h&&(d||l)?n.push(ol({id:"fileWorkingCopy.saveElevated",label:l?Qn?g(10705,"Overwrite as Admin..."):g(10706,"Overwrite as Sudo..."):Qn?g(10707,"Retry as Admin..."):g(10708,"Retry as Sudo..."),run:()=>{this.save({...t,writeElevated:!0,writeUnlock:l,reason:Cn.EXPLICIT})}})):c?n.push(ol({id:"fileWorkingCopy.unlock",label:g(10703,"Overwrite"),run:()=>this.save({...t,writeUnlock:!0,reason:Cn.EXPLICIT})})):n.push(ol({id:"fileWorkingCopy.retry",label:g(10709,"Retry"),run:()=>this.save({...t,reason:Cn.EXPLICIT})})),n.push(ol({id:"fileWorkingCopy.saveAs",label:g(10710,"Save As..."),run:async()=>{const u=this.workingCopyEditorService.findEditor(this);u&&((await this.editorService.save(u,{saveAs:!0,reason:Cn.EXPLICIT})).success||this.doHandleSaveError(e,t))}})),n.push(ol({id:"fileWorkingCopy.revert",label:g(10704,"Discard"),run:()=>this.revert()})),c?l&&h?o=Qn?g(10711,"Failed to save '{0}': File is read-only. Select 'Overwrite as Admin' to retry as administrator.",this.name):g(10712,"Failed to save '{0}': File is read-only. Select 'Overwrite as Sudo' to retry as superuser.",this.name):o=g(10713,"Failed to save '{0}': File is read-only. Select 'Overwrite' to attempt to make it writeable.",this.name):h&&d?o=Qn?g(10714,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.",this.name):g(10715,"Failed to save '{0}': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.",this.name):o=g(10716,"Failed to save '{0}': {1}",this.name,Nr(e,!1))}const r=this.notificationService.notify({id:`${Wc(this.resource.toString())}`,severity:Xe.Error,message:o,actions:{primary:n}}),a=this._register(M.once(M.any(this.onDidSave,this.onDidRevert))(()=>r.close()));this._register(M.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!==Qi.FILE_NOT_FOUND)throw i(),o}this._onDidRevert.fire(),t&&this._onDidChangeDirty.fire()}hasState(e){switch(e){case Mp.CONFLICT:return this.inConflictMode;case Mp.DIRTY:return this.dirty;case Mp.ERROR:return this.inErrorMode;case Mp.ORPHAN:return this.isOrphaned();case Mp.PENDING_SAVE:return this.saveSequentializer.isRunning();case Mp.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()}},lj=XR,XR.UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD=500,XR);V8e=lj=D([_(5,Jt),_(6,Ge),_(7,Hb),_(8,pd),_(9,F6),_(10,Im),_(11,bi),_(12,aXe),_(13,ei),_(14,R6),_(15,og)],V8e);var zP;let z8e=zP=class extends xI{constructor(e,t,i,n,o,r){super(),this.resource=e,this._hasAssociatedFilePath=t,this.viewType=i,this._workingCopyManager=n,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&&zP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopyManager.stored.canDispose(this._workingCopy):!0}isDirty(){return this._workingCopy?.isDirty()??!1}isModified(){return this._workingCopy?.isModified()??!1}isOrphaned(){return zP._isStoredFileWorkingCopy(this._workingCopy)&&this._workingCopy.hasState(Mp.ORPHAN)}hasAssociatedFilePath(){return!zP._isStoredFileWorkingCopy(this._workingCopy)&&!!this._workingCopy?.hasAssociatedFilePath}isReadonly(){return zP._isStoredFileWorkingCopy(this._workingCopy)?this._workingCopy?.isReadonly():this._filesConfigurationService.isReadonly(this.resource)}get hasErrorState(){return this._workingCopy&&"hasState"in this._workingCopy?this._workingCopy.hasState(Mp.ERROR):!1}revert(e){return Tt(this.isResolved()),this._workingCopy.revert(e)}save(e){return Tt(this.isResolved()),this._workingCopy.save(e)}async load(e){return!this._workingCopy||!this._workingCopy.model?(this.resource.scheme===pe.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}),Tt(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&sC.Untitled)}};z8e=zP=D([_(5,pd)],z8e);class Jnt extends V{constructor(e,t,i,n,o){super(),this._notebookModel=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=o,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(a=>{for(const c of a.rawEvents)if(c.kind!==Cl.Initialize&&!c.transient){this._onDidChangeContent.fire({isRedoing:!1,isUndoing:!1,isInitial:!1});break}}));const r=this._configurationService.getValue(NAe.remoteSaving);(r||e.uri.scheme===pe.vscodeRemote)&&(this.configuration={backupDelay:1e4}),r&&this.setSaveDelegate().catch(console.error)}async setSaveDelegate(){await this.getNotebookSerializer(),this.save=async(e,t)=>{try{let i=this._notebookService.tryGetDataProviderSync(this.notebookModel.viewType)?.serializer;if(i||(this._logService.warn("No serializer found for notebook model, checking if provider still needs to be resolved"),i=await this.getNotebookSerializer()),t.isCancellationRequested)throw new Ma;return await i.save(this._notebookModel.uri,this._notebookModel.versionId,e,t)}catch(i){throw t.isCancellationRequested||this._telemetryService.publicLogError2("notebook/SaveError",{isRemote:this._notebookModel.uri.scheme===pe.vscodeRemote,error:i}),i}}}dispose(){this._notebookModel.dispose(),super.dispose()}get notebookModel(){return this._notebookModel}async snapshot(e,t){const i=await this.getNotebookSerializer(),n={metadata:vj(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(NAe.outputBackupSizeLimit)*1024;if(e===T$.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=vj(a.metadata,d=>!i.options.transientCellMetadata[d]),n.cells.push(c)}const r=await i.notebookToData(n);if(t.isCancellationRequested)throw new Ma;return J7(r)}async update(e,t){const i=await this.getNotebookSerializer(),n=await Jx(e),o=await i.dataToNotebook(n);if(t.isCancellationRequested)throw new Ma;this._notebookModel.reset(o.cells,o.metadata,i.options)}async getNotebookSerializer(){const e=await this._notebookService.withNotebookDataProvider(this.notebookModel.viewType);if(!(e instanceof aG))throw new Error("CANNOT open file notebook with this provider");return e.serializer}get versionId(){return this._notebookModel.alternativeVersionId}pushStackElement(){this._notebookModel.pushStackElement()}}let $8e=class{constructor(e,t,i,n,o){this._viewType=e,this._notebookService=t,this._configurationService=i,this._telemetryService=n,this._logService=o}async createModel(e,t,i){const n=await this._notebookService.withNotebookDataProvider(this._viewType);if(!(n instanceof aG))throw new Error("CANNOT open file notebook with this provider");const o=await Jx(t),r=await n.serializer.dataToNotebook(o);if(i.isCancellationRequested)throw new Ma;const a=this._notebookService.createNotebookTextModel(n.viewType,e,r,n.serializer.options);return new Jnt(a,this._notebookService,this._configurationService,this._telemetryService,this._logService)}};$8e=D([_(1,ZA),_(2,Te),_(3,Yi),_(4,Ge)],$8e);let _jt=class{constructor(e){this._proxy=e.getProxy(Ye.ExtHostNotebookDocumentSaveParticipant)}async participate(e,t,i,n){if(!e.model||!(e.model instanceof Jnt))return;let o;const r=new Promise((a,c)=>{o=setTimeout(()=>c(new Error(g(4874,"Aborted onWillSaveNotebookDocument-event after 1750ms"))),1750),this._proxy.$participateInSave(e.resource,t.reason,n).then(l=>{clearTimeout(o)}).then(a,c)});return Ire(r,n)}},G8e=class{constructor(e,t,i){this.workingCopyFileService=i,this._saveParticipantDisposable=this.workingCopyFileService.addSaveParticipant(t.createInstance(_jt,e))}dispose(){this._saveParticipantDisposable.dispose()}};G8e=D([$N,_(1,we),_(2,Hb)],G8e);let K8e=class{constructor(e,t){this._disposables=new Z,this._proxy=e.getProxy(Ye.ExtHostInteractive),this._disposables.add(t.onWillAddInteractiveDocument(i=>{this._proxy.$willAddInteractiveDocument(i.inputUri,` +`,Ca,i.notebookUri)})),this._disposables.add(t.onWillRemoveInteractiveDocument(i=>{this._proxy.$willRemoveInteractiveDocument(i.inputUri,i.notebookUri)}))}dispose(){this._disposables.dispose()}};K8e=D([Gi(Be.MainThreadInteractive),_(1,VRe)],K8e);const vjt={type:"object",additionalProperties:!1,properties:{type:{type:"string",description:g(6664,"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(6665,"Additional properties of the task type"),additionalProperties:{$ref:"http://json-schema.org/draft-07/schema#"}},when:{type:"string",markdownDescription:g(6666,"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 Gxe;(function(s){function e(t,i,n){if(!t)return;const o=Lt(t.type)?t.type:void 0;if(!o||o.length===0){n.error(g(6667,"The task type configuration is missing the required 'taskType' property"));return}const r=[];if(Array.isArray(t.required))for(const a of t.required)Lt(a)&&r.push(a);return{extensionId:i.value,taskType:o,required:r,properties:t.properties?xs(t.properties):{},when:t.when?he.deserialize(t.when):void 0}}s.from=e})(Gxe||(Gxe={}));const bjt=Xd.registerExtensionPoint({extensionPoint:"taskDefinitions",activationEventsGenerator:(s,e)=>{for(const t of s)t.type&&e.push(`onTaskType:${t.type}`)},jsonSchema:{description:g(6668,"Contributes task kinds"),type:"array",items:vjt}});class wjt{constructor(){this._onDefinitionsChanged=new I,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{bjt.setHandler((i,n)=>{this._schema=void 0;try{for(const o of n.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 n.added){const r=o.value;for(const a of r){const c=Gxe.from(a,o.description.identifier,o.collector);c&&(this.taskTypes[c.taskType]=c)}}(n.removed.length>0||n.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=xs(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 yjt=new wjt,Xnt="settings";new Y("taskRunning",!1,g(3790,"Whether a task is currently running."));Fe(3791,"Tasks");var mie;(function(s){s[s.Escape=1]="Escape",s[s.Strong=2]="Strong",s[s.Weak=3]="Weak"})(mie||(mie={}));const Znt="$customized";(function(s){function e(t){if(!t)return s.Strong;switch(t.toLowerCase()){case"escape":return s.Escape;case"strong":return s.Strong;case"weak":return s.Weak;default:return s.Strong}}s.from=e})(mie||(mie={}));var L$;(function(s){s.defaults={cwd:"${workspaceFolder}"}})(L$||(L$={}));var R$;(function(s){s[s.Always=1]="Always",s[s.Silent=2]="Silent",s[s.Never=3]="Never"})(R$||(R$={}));(function(s){function e(t){switch(t.toLowerCase()){case"always":return s.Always;case"silent":return s.Silent;case"never":return s.Never;default:return s.Always}}s.fromString=e})(R$||(R$={}));var M$;(function(s){s[s.Never=1]="Never",s[s.OnProblem=2]="OnProblem",s[s.Always=3]="Always"})(M$||(M$={}));(function(s){function e(t){switch(t.toLowerCase()){case"always":return s.Always;case"never":return s.Never;case"onproblem":return s.OnProblem;default:return s.OnProblem}}s.fromString=e})(M$||(M$={}));var N$;(function(s){s[s.Shared=1]="Shared",s[s.Dedicated=2]="Dedicated",s[s.New=3]="New"})(N$||(N$={}));(function(s){function e(t){switch(t.toLowerCase()){case"shared":return s.Shared;case"dedicated":return s.Dedicated;case"new":return s.New;default:return s.Shared}}s.fromString=e})(N$||(N$={}));var _ie;(function(s){s.defaults={echo:!0,reveal:R$.Always,revealProblems:M$.Never,focus:!1,panel:N$.Shared,showReuseMessage:!0,clear:!1}})(_ie||(_ie={}));var sm;(function(s){s[s.Shell=1]="Shell",s[s.Process=2]="Process",s[s.CustomExecution=3]="CustomExecution"})(sm||(sm={}));(function(s){function e(i){switch(i.toLowerCase()){case"shell":return s.Shell;case"process":return s.Process;case"customExecution":return s.CustomExecution;default:return s.Process}}s.fromString=e;function t(i){switch(i){case s.Shell:return"shell";case s.Process:return"process";case s.CustomExecution:return"customExecution";default:return"process"}}s.toString=t})(sm||(sm={}));var q8e;(function(s){function e(t){return Lt(t)?t:t.value}s.value=e})(q8e||(q8e={}));var Q8e;(function(s){s.Clean={_id:"clean",isDefault:!1},s.Build={_id:"build",isDefault:!1},s.Rebuild={_id:"rebuild",isDefault:!1},s.Test={_id:"test",isDefault:!1};function e(i){return i===s.Clean._id||i===s.Build._id||i===s.Rebuild._id||i===s.Test._id}s.is=e;function t(i){if(i!==void 0)return Lt(i)?e(i)?{_id:i,isDefault:!1}:void 0:i}s.from=t})(Q8e||(Q8e={}));var ix;(function(s){s[s.Global=1]="Global",s[s.Workspace=2]="Workspace",s[s.Folder=3]="Folder"})(ix||(ix={}));var fA;(function(s){s.Workspace="workspace",s.Extension="extension",s.InMemory="inMemory",s.WorkspaceFile="workspaceFile",s.User="user";function e(t){switch(t){case s.User:return St.USER;case s.WorkspaceFile:return St.WORKSPACE;default:return St.WORKSPACE_FOLDER}}s.toConfigurationTarget=e})(fA||(fA={}));var j8e;(function(s){s.parallel="parallel",s.sequence="sequence"})(j8e||(j8e={}));var Kxe;(function(s){s[s.default=1]="default",s[s.folderOpen=2]="folderOpen"})(Kxe||(Kxe={}));var vie;(function(s){s.defaults={reevaluateOnRerun:!0,runOn:Kxe.default,instanceLimit:1}})(vie||(vie={}));class rPe{constructor(e,t,i,n,o,r){this._label="",this._id=e,t&&(this._label=t),i&&(this.type=i),this.runOptions=n,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(Lt(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 uz extends rPe{constructor(e,t,i,n,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 uz(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 sm.Shell:t="shell";break;case sm.Process:t="process";break;case sm.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 uz}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===fA.User?Xnt: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!==fA.Workspace&&(t+=this._source.kind),JSON.stringify({type:Znt,folder:e,id:t})}getWorkspaceFolder(){return this._source.config.workspaceFolder}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?_i(this._source.config.workspace.configuration):void 0}getTelemetryKind(){return this._source.customizes?"workspace>extension":"workspace"}fromObject(e){return new uz(e._id,e._source,e._label,e.type,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}class gz extends rPe{constructor(e,t,i,n,o,r,a){super(e,i,n,r,a,t),this._source=t,this.configures=o}static is(e){return e instanceof gz}fromObject(e){return e}getDefinition(){return this.configures}getWorkspaceFileName(){return this._source.config.workspace&&this._source.config.workspace.configuration?_i(this._source.config.workspace.configuration):void 0}getWorkspaceFolder(){return this._source.config.workspaceFolder}getFolderId(){return this._source.kind===fA.User?Xnt:this._source.config.workspaceFolder?.uri.toString()}getKey(){const e=this.getFolderId();if(!e)return;let t=this.configurationProperties.identifier;return this._source.kind!==fA.Workspace&&(t+=this._source.kind),JSON.stringify({type:Znt,folder:e,id:t})}}class YT extends rPe{constructor(e,t,i,n,o,r,a,c,l){super(e,i,n,c,l,t),this.defines=o,this.hasDefinedMatchers=a,this.command=r,this.icon=l.icon,this.hide=l.hide}clone(){return new YT(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 YT}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===ix.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 YT(e._id,e._source,e._label,e.type,e.defines,e.command,e.hasDefinedMatchers,e.runOptions,e.configurationProperties)}}var bie;(function(s){s[s.Process=1]="Process",s[s.Terminal=2]="Terminal"})(bie||(bie={}));(function(s){s._default=s.Terminal})(bie||(bie={}));var Y8e;(function(s){s[s.V0_1_0=1]="V0_1_0",s[s.V2_0_0=2]="V2_0_0"})(Y8e||(Y8e={}));var f_;(function(s){s.DependsOnStarted="dependsOnStarted",s.AcquiredInput="acquiredInput",s.Start="start",s.ProcessStarted="processStarted",s.Active="active",s.Inactive="inactive",s.Changed="changed",s.Terminated="terminated",s.ProcessEnded="processEnded",s.End="end"})(f_||(f_={}));var wie;(function(s){s.SingleRun="singleRun",s.Background="background"})(wie||(wie={}));var J8e;(function(s){s[s.System=0]="System",s[s.User=1]="User",s[s.FolderOpen=2]="FolderOpen",s[s.ConfigurationChange=3]="ConfigurationChange",s[s.Reconnect=4]="Reconnect"})(J8e||(J8e={}));var X8e;(function(s){function e(c){return{taskId:c._id,taskName:c.configurationProperties.name,runType:c.configurationProperties.isBackground?wie.Background:wie.SingleRun,group:c.configurationProperties.group,__task:c}}function t(c,l,d){return{...e(c),kind:f_.Start,terminalId:l,resolvedVariables:d}}s.start=t;function i(c,l,d){return{...e(c),kind:f_.ProcessStarted,terminalId:l,processId:d}}s.processStarted=i;function n(c,l,d){return{...e(c),kind:f_.ProcessEnded,terminalId:l,exitCode:d}}s.processEnded=n;function o(c,l,d){return{...e(c),kind:f_.Terminated,exitReason:d,terminalId:l}}s.terminated=o;function r(c,l,d){return{...e(l),kind:c,terminalId:d}}s.general=r;function a(){return{kind:f_.Changed}}s.changed=a})(X8e||(X8e={}));var yie;(function(s){function e(i){const n=Object.keys(i).sort();let o="";for(const r of n){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}s.create=t})(yie||(yie={}));var Z8e;(function(s){s.AutoDetect="task.autoDetect",s.SaveBeforeRun="task.saveBeforeRun",s.ShowDecorations="task.showDecorations",s.ProblemMatchersNeverPrompt="task.problemMatchers.neverPrompt",s.SlowProviderWarning="task.slowProviderWarning",s.QuickOpenHistory="task.quickOpen.history",s.QuickOpenDetail="task.quickOpen.detail",s.QuickOpenSkip="task.quickOpen.skip",s.QuickOpenShowAll="task.quickOpen.showAll",s.AllowAutomaticTasks="task.allowAutomaticTasks",s.Reconnection="task.reconnection",s.VerboseLogging="task.verboseLogging"})(Z8e||(Z8e={}));var e3e;(function(s){s.Tasks="tasks",s.SuppressTaskName="tasks.suppressTaskName",s.Windows="tasks.windows",s.Osx="tasks.osx",s.Linux="tasks.linux",s.ShowOutput="tasks.showOutput",s.IsShellCommand="tasks.isShellCommand",s.ServiceTestSetting="tasks.service.testSetting"})(e3e||(e3e={}));var qxe;(function(s){function e(t,i){const n=yjt.get(t.type);if(n===void 0){const c=xs(t);return delete c._key,yie.create(c)}const o=Object.create(null);o.type=n.taskType;const r=new Set;n.required.forEach(c=>r.add(c));const a=n.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]=xs(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(3792,"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 yie.create(o)}s.createTaskIdentifier=e})(qxe||(qxe={}));var Cie;(function(s){function e(t){return{id:t.id,task:Df.from(t.task)}}s.from=e})(Cie||(Cie={}));var Qxe;(function(s){function e(t,i){return{id:t.id,processId:i}}s.from=e})(Qxe||(Qxe={}));var jxe;(function(s){function e(t,i){return{id:t.id,exitCode:i}}s.from=e})(jxe||(jxe={}));var Sie;(function(s){function e(i){const n=Object.assign(Object.create(null),i);return delete n._key,n}s.from=e;function t(i,n){let o=qxe.createTaskIdentifier(i,console);return o===void 0&&n&&(o={_key:ar(),type:"$executeOnly"}),o}s.to=t})(Sie||(Sie={}));var Aie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?_ie.defaults:Object.assign(Object.create(null),_ie.defaults,i)}s.to=t})(Aie||(Aie={}));var Eie;(function(s){function e(i){if(i!=null)return Object.assign(Object.create(null),i)}s.from=e;function t(i){return i==null?vie.defaults:Object.assign(Object.create(null),vie.defaults,i)}s.to=t})(Eie||(Eie={}));var xie;(function(s){function e(i){if(i!=null)return{cwd:i.cwd,env:i.env}}s.from=e;function t(i){return i==null?L$.defaults:{cwd:i.cwd||L$.defaults.cwd,env:i.env}}s.to=t})(xie||(xie={}));var fz;(function(s){function e(n){const o=n;return o&&!!o.process}s.is=e;function t(n){const o=Lt(n.name)?n.name:n.name.value,r=n.args?n.args.map(c=>Lt(c)?c:c.value):[],a={process:o,args:r};return n.options&&(a.options=xie.from(n.options)),a}s.from=t;function i(n){const o={runtime:sm.Process,name:n.process,args:n.args,presentation:void 0};return o.options=xie.to(n.options),o}s.to=i})(fz||(fz={}));var Die;(function(s){function e(i){if(i==null)return;const n={cwd:i.cwd||L$.defaults.cwd,env:i.env};return i.shell&&(n.executable=i.shell.executable,n.shellArgs=i.shell.args,n.shellQuoting=i.shell.quoting),n}s.from=e;function t(i){if(i==null)return;const n={cwd:i.cwd,env:i.env};return i.executable&&(n.shell={executable:i.executable},i.shellArgs&&(n.shell.args=i.shellArgs),i.shellQuoting&&(n.shell.quoting=i.shellQuoting)),n}s.to=t})(Die||(Die={}));var pz;(function(s){function e(n){const o=n;return o&&(!!o.commandLine||!!o.command)}s.is=e;function t(n){const o={};return n.name&&Lt(n.name)&&(n.args===void 0||n.args===null||n.args.length===0)?o.commandLine=n.name:(o.command=n.name,o.args=n.args),n.options&&(o.options=Die.from(n.options)),o}s.from=t;function i(n){const o={runtime:sm.Shell,name:n.commandLine?n.commandLine:n.command,args:n.args,presentation:void 0};return n.options&&(o.options=Die.to(n.options)),o}s.to=i})(pz||(pz={}));var O1;(function(s){function e(n){const o=n;return o&&o.customExecution==="customExecution"}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n){return{runtime:sm.CustomExecution,presentation:void 0}}s.to=i})(O1||(O1={}));var kie;(function(s){function e(i){const n={label:i.label};return i.kind===fA.Extension?(n.extensionId=i.extension,i.workspaceFolder?n.scope=i.workspaceFolder.uri:n.scope=i.scope):i.kind===fA.Workspace&&(n.extensionId="$core",n.scope=i.config.workspaceFolder?i.config.workspaceFolder.uri:ix.Global),n}s.from=e;function t(i,n){let o,r;return i.scope===void 0||typeof i.scope=="number"&&i.scope!==ix.Global?n.getWorkspace().folders.length===0?(o=ix.Global,r=void 0):(o=ix.Folder,r=n.getWorkspace().folders[0]):typeof i.scope=="number"?o=i.scope:(o=ix.Folder,r=n.getWorkspaceFolder(N.revive(i.scope))??void 0),{kind:fA.Extension,label:i.label,extension:i.extensionId,scope:o,workspaceFolder:r}}s.to=t})(kie||(kie={}));var Iie;(function(s){function e(t){const i=t;return i&&Lt(i.id)&&!!i.workspaceFolder}s.is=e})(Iie||(Iie={}));var Df;(function(s){function e(i){if(i==null||!uz.is(i)&&!YT.is(i)&&!gz.is(i))return;const n={_id:i._id,name:i.configurationProperties.name,definition:Sie.from(i.getDefinition(!0)),source:kie.from(i._source),execution:void 0,presentationOptions:!gz.is(i)&&i.command?Aie.from(i.command.presentation):void 0,isBackground:i.configurationProperties.isBackground,problemMatchers:[],hasDefinedMatchers:YT.is(i)?i.hasDefinedMatchers:!1,runOptions:Eie.from(i.runOptions)};if(n.group=Yxe.from(i.configurationProperties.group),i.configurationProperties.detail&&(n.detail=i.configurationProperties.detail),!gz.is(i)&&i.command)switch(i.command.runtime){case sm.Process:n.execution=fz.from(i.command);break;case sm.Shell:n.execution=pz.from(i.command);break;case sm.CustomExecution:n.execution=O1.from(i.command);break}if(i.configurationProperties.problemMatchers)for(const o of i.configurationProperties.problemMatchers)Lt(o)&&n.problemMatchers.push(o);return n}s.from=e;function t(i,n,o,r,a){if(!i||typeof i.name!="string")return;let c;if(i.execution&&(pz.is(i.execution)?c=pz.to(i.execution):fz.is(i.execution)?c=fz.to(i.execution):O1.is(i.execution)&&(c=O1.to(i.execution))),!c)return;c.presentation=Aie.to(i.presentationOptions);const l=kie.to(i.source,n),d=g(4875,"{0}: {1}",l.label,i.name),h=Sie.to(i.definition,o),u=O1.is(i.execution)&&i._id?i._id:`${i.source.extensionId}.${h._key}`;return new YT(u,l,d,h.type,h,c,i.hasDefinedMatchers,Eie.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})}s.to=t})(Df||(Df={}));var Yxe;(function(s){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}}s.from=e})(Yxe||(Yxe={}));var Jxe;(function(s){function e(i){return i}s.from=e;function t(i){return i}s.to=t})(Jxe||(Jxe={}));let t3e=class extends V{constructor(e,t,i,n){super(),this._taskService=t,this._workspaceContextServer=i,this._configurationResolverService=n,this._proxy=e.getProxy(Ye.ExtHostTask),this._providers=new Map,this._register(this._taskService.onDidStateChange(async o=>{if(o.kind===f_.Changed)return;const r=o.__task;if(o.kind===f_.Start){const a=Cie.from(r.getTaskExecution());let c=a.task.definition;if(a.task?.execution&&O1.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===f_.ProcessStarted?this._proxy.$onDidStartTaskProcess(Qxe.from(r.getTaskExecution(),o.processId)):o.kind===f_.ProcessEnded?this._proxy.$onDidEndTaskProcess(jxe.from(r.getTaskExecution(),o.exitCode)):o.kind===f_.End&&this._proxy.$OnDidEndTask(Cie.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 n=Df.to(e,this._workspaceContextServer,!0);n?t(n._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=Df.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=Df.from(o);return r?(r.name=r.name===void 0?"":r.name,Promise.resolve(this._proxy.$resolveTask(e,r)).then(a=>{if(a)return Df.to(a,this._workspaceContextServer,!0,o.configurationProperties.icon,o.configurationProperties.hide)})):Promise.resolve(void 0)}},n=this._taskService.registerTaskProvider(i,t);return this._providers.set(e,{disposable:n,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(Jxe.to(e)).then(t=>{const i=[];for(const n of t){const o=Df.from(n);o&&i.push(o)}return i})}getWorkspace(e){let t;if(typeof e=="string")t=e;else{const i=this._workspaceContextServer.getWorkspace(),n=N.revive(e);i.configuration?.toString()===n.toString()?t=i:t=this._workspaceContextServer.getWorkspaceFolder(n)}return t}async $getTaskExecution(e){if(Iie.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:Df.from(i)};throw new Error("Task not found")}else throw new Error("No workspace folder")}else{const t=Df.to(e,this._workspaceContextServer,!0);return{id:t._id,task:Df.from(t)}}}$executeTask(e){return new Promise((t,i)=>{if(Iie.is(e)){const n=this.getWorkspace(e.workspaceFolder);n?this._taskService.getTask(n,e.id,!0).then(o=>{if(!o)i(new Error("Task not found"));else{const r={id:e.id,task:Df.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 n=Df.to(e,this._workspaceContextServer,!0);this._taskService.run(n).then(void 0,r=>{});const o={id:n._id,task:Df.from(n)};t(o)}})}$customExecutionComplete(e,t){return new Promise((i,n)=>{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=>{n(a)});return}n(new Error("Task to mark as complete not found"))})})}$terminateTask(e){return new Promise((t,i)=>{this._taskService.getActiveTasks().then(n=>{for(const o of n)if(e===o._id){this._taskService.terminate(o).then(r=>{t(void 0)},r=>{i(void 0)});return}i(new La("Task to terminate not found"))})})}$registerTaskSystem(e,t){let i;switch(t.platform){case"Web":i=$d.Web;break;case"win32":i=$d.Windows;break;case"darwin":i=$d.Mac;break;case"linux":i=$d.Linux;break;default:i=A6e}this._taskService.registerTaskSystem(e,{platform:i,uriProvider:n=>N.from({scheme:t.scheme,authority:t.authority,path:n}),context:this._extHostContext,resolveVariables:(n,o,r)=>{const a=[];return o.variables.forEach(c=>a.push(c)),Promise.resolve(this._proxy.$resolveVariables(n.uri,{process:o.process,variables:a})).then(c=>{const l=Array.from(Object.values(c.variables));return new Promise((d,h)=>{this._configurationResolverService.resolveWithInteraction(n,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:(n,o,r)=>this._proxy.$findExecutable(n,o,r)})}async $registerSupportedExecutions(e,t,i){return this._taskService.registerSupportedExecutions(e,t,i)}};t3e=D([Gi(Be.MainThreadTask),_(1,MJe),_(2,yi),_(3,qRe)],t3e);let i3e=class extends V{constructor(e,t){super(),this._labelService=t,this._resourceLabelFormatters=this._register(new mo)}$registerResourceLabelFormatter(e,t){t.priority=!0;const i=this._labelService.registerCachedFormatter(t);this._resourceLabelFormatters.set(e,i)}$unregisterResourceLabelFormatter(e){this._resourceLabelFormatters.deleteAndDispose(e)}};i3e=D([Gi(Be.MainThreadLabelService),_(1,Fs)],i3e);var Tp;(function(s){s.Http="http",s.Https="https"})(Tp||(Tp={}));var LS;(function(s){s.ConstantPrivate="constantPrivate",s.Private="private",s.Public="public"})(LS||(LS={}));var PE;(function(s){s[s.Notify=1]="Notify",s[s.OpenBrowser=2]="OpenBrowser",s[s.OpenPreview=3]="OpenPreview",s[s.Silent=4]="Silent",s[s.Ignore=5]="Ignore",s[s.OpenBrowserOnce=6]="OpenBrowserOnce"})(PE||(PE={}));function Cjt(s){if(s.scheme!=="http"&&s.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(s.authority);if(e)return{address:e[1],port:+e[2]}}const P$=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function F$(s){return P$.indexOf(s)>=0}const Tie=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function O$(s){return Tie.indexOf(s)>=0}class Sjt{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 n3e=class extends V{constructor(e,t){super(),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 n=Array.from(i.values());for(const o of n){const r=await o.value;r&&typeof r!="string"&&e.push(r)}}return e}async dispose(){super.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,n,o){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:n,protocol:o,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(O$(e)||F$(e))&&(e=P$[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,n,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"),n||(n=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,n,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 n=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),n}}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 n=i.get(t);n.refcount=0,await this.tryDisposeTunnel(e,t,n)}}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 n=i.get(t),o=n?await n.value:void 0;(!o||typeof o=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];F$(e)?(i.push(...P$),i.push(...Tie)):O$(e)&&i.push(...Tie);const n=i.map(o=>this._tunnels.get(o));for(const o of n){const r=o?.get(t);if(r)return r}}canTunnel(e){return!!Cjt(e)}createWithProvider(e,t,i,n,o,r,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${n}.`);const c=i;this._factoryInProgress.add(c);const l=n===void 0?i:n,d={elevationRequired:o?this.isPortPrivileged(l):!1},h={remoteAddress:{host:t,port:i},localAddressPort:n,privacy:r,public:r?r!==LS.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}};n3e=D([_(0,Ge),_(1,Te)],n3e);const mu=ae("IExtHostInitDataService"),Jo=ae("IExtHostRpcService");class Ajt{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)}}class Ejt extends Sjt{}var Lie;(function(s){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?LS.Public:LS.Private),protocol:i.protocol}}s.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==LS.ConstantPrivate&&i.privacy!==LS.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}s.fromServiceTunnel=t})(Lie||(Lie={}));const aPe=ae("IExtHostTunnelService");let Xxe=class extends V{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(Be.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 n=new Ejt(i.remoteAddress,i.localAddress,()=>this._proxy.$closeTunnel(i.remoteAddress));return this._register(n),n}}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 Qs(()=>{this._portAttributesProviders.delete(i),this._proxy.$unregisterPortsAttributesProvider(i)})}async $providePortAttributes(e,t,i,n,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:n},o)}catch{h=await l.provider.providePortAttributes(d,i,n,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(n,o)=>await e.provideTunnel(n,o,He.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 n=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&n.length===0&&(n=[{id:"private",label:g(574,"Private"),themeIcon:"lock"},{id:"public",label:g(575,"Public"),themeIcon:"eye"}]);const o=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:n,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 n=await i;if(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider."),n===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(n.onDidDispose(()=>(this.logService.trace("ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose."),this._proxy.$closeTunnel(n.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:n,disposeListener:o}),Lie.fromApiTunnel(n)}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(n=>this._showCandidatePort(n.host,n.port,n.detail??""))),i=e.filter((n,o)=>t[o]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(n=>n.port).join(", ")} to ${i.map(n=>n.port).join(", ")}`),i}};Xxe=D([_(0,Jo),_(1,mu),_(2,Ge)],Xxe);const xjt=10*1e3,NK="remote.tunnels.toRestore",Iue="remote.tunnels.toRestoreExpiration",Djt=1e3*60*60*24*14,s3e="onTunnel",est=new Y("forwardedPortsViewEnabled",!1,g(8676,"Whether the Ports view is enabled."));function kjt(s){const e=s.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 JT;(function(s){s.Other="Other",s.User="User",s.AutoForwardEnd="AutoForwardEnd"})(JT||(JT={}));var cb;(function(s){s[s.User=0]="User",s[s.Auto=1]="Auto",s[s.Extension=2]="Extension"})(cb||(cb={}));const Tue={source:cb.User,description:g(8677,"User Forwarded")};cb.Auto,g(8678,"Auto Forwarded");function o3e(s,e,t){const i=s.get(xg(e,t));if(i)return i;if(F$(e))for(const n of P$){const o=xg(n,t);if(s.has(o))return s.get(o)}else if(O$(e))for(const n of Tie){const o=xg(n,t);if(s.has(o))return s.get(o)}}function pg(s,e,t){const i=o3e(s,e,t);if(i)return i;const n=O$(e)?"localhost":F$(e)?"0.0.0.0":void 0;if(n)return o3e(s,n,t)}function xg(s,e){return s+":"+e}var FE;(function(s){s.Notify="notify",s.OpenBrowser="openBrowser",s.OpenBrowserOnce="openBrowserOnce",s.OpenPreview="openPreview",s.Silent="silent",s.Ignore="ignore"})(FE||(FE={}));function Ijt(s){return s&&"host"in s&&typeof s.host=="string"&&"port"in s&&typeof s.port=="number"&&(!("detail"in s)||typeof s.detail=="string")&&(!("pid"in s)||typeof s.pid=="string")}const wu=class wu extends V{constructor(e){super(),this.configurationService=e,this.portsAttributes=[],this._onDidChangeAttributes=new I,this.onDidChangeAttributes=this._onDidChangeAttributes.event,this._register(e.onDidChangeConfiguration(t=>{(t.affectsConfiguration(wu.SETTING)||t.affectsConfiguration(wu.DEFAULTS))&&this.updateAttributes()})),this.updateAttributes()}updateAttributes(){this.portsAttributes=this.readSetting(),this._onDidChangeAttributes.fire()}getAttributes(e,t,i){let n=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(;n>=0;){const r=this.portsAttributes[n];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),n=this.findNextIndex(e,t,i,this.portsAttributes,n+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&&Lt(e.host)&&lc(e.port)}findNextIndex(e,t,i,n,o){if(o>=n.length)return-1;const r=!F$(t)&&!O$(t),c=n.slice(o).findIndex(l=>lc(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(wu.SETTING);if(!e||!kn(e))return[];const t=[];for(const n in e){if(n===void 0)continue;const o=e[n];let r;if(Number(n))r=Number(n);else if(Lt(n))if(wu.RANGE.test(n)){const a=n.match(wu.RANGE);r={start:Number(a[1]),end:Number(a[2])}}else if(wu.HOST_AND_PORT.test(n)){const a=n.match(wu.HOST_AND_PORT);r={host:a[1],port:Number(a[2])}}else{let a;try{a=RegExp(n)}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(wu.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,n){return lc(i.key)?i.key:n.hasStartEnd(i.key)?i.key.start:n.hasHostAndPort(i.key)?i.key.port:Number.MAX_VALUE}return e.sort((i,n)=>t(i,this)-t(n,this))}getOtherAttributes(){return this.defaultPortAttributes}static providedActionToAction(e){switch(e){case PE.Notify:return FE.Notify;case PE.OpenBrowser:return FE.OpenBrowser;case PE.OpenBrowserOnce:return FE.OpenBrowserOnce;case PE.OpenPreview:return FE.OpenPreview;case PE.Silent:return FE.Silent;case PE.Ignore:return FE.Ignore;default:return}}async addAttributes(e,t,i){const o=this.configurationService.inspect(wu.SETTING).userRemoteValue;let r;!o||!kn(o)?r={}:r=xs(o),r[`${e}`]||(r[`${e}`]={});for(const a in t)r[`${e}`][a]=t[a];return this.configurationService.updateValue(wu.SETTING,r,i)}};wu.SETTING="remote.portsAttributes",wu.DEFAULTS="remote.otherPortsAttributes",wu.RANGE=/^(\d+)\-(\d+)$/,wu.HOST_AND_PORT=/^([a-z0-9\-]+):(\d{1,5})$/;let Rie=wu,B$=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.tunnelService=e,this.storageService=t,this.configurationService=i,this.environmentService=n,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 Rie(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=xg(f.tunnelRemoteHost,f.tunnelRemotePort),m=pg(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??Tp.Http,localUri:await this.makeLocalUri(f.localAddress,u?.get(f.tunnelRemotePort)),localPort:f.tunnelLocalPort,name:u?.get(f.tunnelRemotePort)?.label,runningProcess:m?.detail,hasRunningProcess:!!m,pid:m?.pid,privacy:f.privacy,source:Tue}),this.remoteTunnels.set(p,f)}}),this.detected=new Map,this._register(this.tunnelService.onTunnelOpened(async h=>{const u=xg(h.tunnelRemoteHost,h.tunnelRemotePort);if(!pg(this.forwarded,h.tunnelRemoteHost,h.tunnelRemotePort)&&!pg(this.detected,h.tunnelRemoteHost,h.tunnelRemotePort)&&!pg(this.inProgress,h.tunnelRemoteHost,h.tunnelRemotePort)&&h.localAddress){const f=pg(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??Tp.Http,localUri:await this.makeLocalUri(h.localAddress,p),localPort:h.tunnelLocalPort,name:p?.label,closeable:!0,runningProcess:f?.detail,hasRunningProcess:!!f,pid:f?.pid,privacy:h.privacy,source:Tue})}await this.storeForwarded(),this.remoteTunnels.set(u,h),this._onForwardPort.fire(this.forwarded.get(u))})),this._register(this.tunnelService.onTunnelClosed(h=>this.onTunnelClosed(h,JT.Other))),this.checkExtensionActivationEvents()}extensionHasActivationEvent(){return this.extensionService.extensions.find(e=>e.activationEvents?.includes(s3e))?(this.contextKeyService.createKey(est.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=xg(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 N.parse(e);const i=t?.protocol??"http";return N.parse(`${i}://${e}`)}async addStorageKeyPostfix(e){const t=this.workspaceContextService.getWorkspace(),i=t.configuration?Wc(t.configuration.path):t.folders.length>0?Wc(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(NK)}async getRestoreExpirationStorageKey(){return this.addStorageKeyPostfix(Iue)}async getTunnelRestoreValue(){const e=this.storageService.get(NK,Ie.WORKSPACE);if(e)return this.storageService.remove(NK,Ie.WORKSPACE),await this.storeForwarded(),e;const t=await this.getTunnelRestoreStorageKey();if(t)return this.storageService.get(t,Ie.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 n=pg(this.detected,i.remoteHost,i.remotePort);i.source.source!==cb.Extension&&!n||i.source.source===cb.Extension&&n?await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,elevateIfNeeded:!0,source:i.source}):i.source.source===cb.Extension&&!n&&this.unrestoredExtensionTunnels.set(xg(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(Ie.PROFILE,void 0,this.restoreListener)(async t=>{t.key===e&&(this.tunnelRestoreValue=Promise.resolve(this.storageService.get(e,Ie.PROFILE)),await this.restoreForwarded())}))}}cleanupExpiredTunnelsForRestore(){const e=this.storageService.keys(Ie.PROFILE,an.USER).filter(t=>t.startsWith(Iue));for(const t of e){const i=this.storageService.getNumber(t,Ie.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 n=await this.getTunnelRestoreStorageKey(),o=await this.getRestoreExpirationStorageKey();!i&&n&&o?(this.storageService.remove(n,Ie.PROFILE),this.storageService.remove(o,Ie.PROFILE)):i!==this.knownPortsRestoreValue&&n&&o&&(this.storageService.store(n,i,Ie.PROFILE,an.USER),this.storageService.store(o,Date.now()+Djt,Ie.PROFILE,an.USER)),this.knownPortsRestoreValue=i}}async showPortMismatchModalIfNeeded(e,t,i){if(!e.tunnelLocalPort||!i?.requireLocalPort||e.tunnelLocalPort===t)return;const n=new Date;if(this.mismatchCooldown.getTime()+xjt>n.getTime())return;this.mismatchCooldown=n;const o=g(8679,`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 M.toPromise(this.onRestoreComplete.event),this.doForward(e,t)}async doForward(e,t){await this.extensionService.activateByEvent(m3e);const i=vg(this.forwarded,e.remote.host,e.remote.port);t=t??(t!==null?(await this.getAttributes([e.remote]))?.get(e.remote.port):void 0);const n=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=Ig(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,n,e.elevateIfNeeded?e.elevateIfNeeded:t?.elevateIfNeeded,e.privacy,t?.protocol);if(typeof l=="string")o=l;else if(l&&l.localAddress){const d=vg(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===Mp.Https?Mp.Https:Mp.Http:t?.protocol??Mp.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??Oue,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,n,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 n=i.get(e);i.delete(e),n&&(t.name=n.name??t.name,t.local=("local"in n?n.local:"localPort"in n?n.localPort:void 0)??t.local,t.privacy=t.privacy)}return t}async mergeAttributesIntoExistingTunnel(e,t,i){const n=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(n!==e.name&&(e.name=n,r=o.Fire),(i?.protocol||e.protocol!==Mp.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,tL.User),await this.doForward(t,i)}return vg(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const n=vg(this.forwarded,e,t),o=Ig(e,t);if(n){n.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 n=Ig(e,t),o=this.forwarded.get(n);return i===tL.AutoForwardEnd&&o&&o.source.source===hb.Auto&&this.sessionCachedProperties.set(n,{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=Ig(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=vg(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),n=typeof t.localAddress=="string"?t.localAddress:Ig(t.localAddress.host,t.localAddress.port);this.detected.set(Ig(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:n,protocol:Mp.Http,localUri:this.makeLocalUri(n),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:RS.ConstantPrivate,source:{source:hb.Extension,description:g(8680,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,n,RS.ConstantPrivate,Mp.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(n=>n.port).join(", ")}`),this._onCandidatesChanged.fire(i)}updateInResponseToCandidates(e){const t=this._candidates??new Map,i=new Map;return this._candidates=i,e.forEach(n=>{const o=Ig(n.host,n.port);i.set(o,{host:n.host,port:n.port,detail:n.detail,pid:n.pid}),t.has(o)&&t.delete(o);const r=vg(this.forwarded,n.host,n.port);r&&(r.runningProcess=n.detail,r.hasRunningProcess=!0,r.pid=n.pid)}),t.forEach((n,o)=>{const r=Wjt(o);if(!r)return;const a=vg(this.forwarded,r.host,r.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=vg(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 n=t.get(i.remotePort);(n?.protocol||i.protocol!==Mp.Http)&&n?.protocol!==i.protocol&&await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,source:i.source},n),n&&n.label&&n.label!==i.name&&await this.name(i.remoteHost,i.remotePort,n.label)}}async getAttributes(e,t=!0){const i=new Map,n=new Map;e.forEach(l=>{const d=vg(this._candidates??new Map,B$[0],l.port)??l;if(d){i.set(l.port,d);const h=Hjt(d)?d.pid:void 0;n.has(h)||n.set(h,[]),n.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(n.entries()).map(d=>{const h=d[1],u=i.get(h[0]);return l.providePortAttributes(h,u?.pid,u?.detail,He.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??Nie.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};U$.__decorator=D([ULe(1e3)],U$.prototype,"storeForwarded",null);U$=D([_(0,Hae),_(1,$i),_(2,Te),_(3,Jr),_(4,pC),_(5,yi),_(6,Ge),_(7,to),_(8,fs),_(9,Le)],U$);const v3e="remote.explorerType",b3e="remote.autoForwardPorts",w3e="remote.autoForwardPortsSource",y3e="output",Ujt="hybrid";var C3e;(function(s){s.Candidate="Candidate",s.Detected="Detected",s.Forwarded="Forwarded",s.Add="Add"})(C3e||(C3e={}));var S3e;(function(s){s[s.None=0]="None",s[s.New=1]="New",s[s.Label=2]="Label",s[s.LocalPort=3]="LocalPort"})(S3e||(S3e={}));const Vjt={type:"object",required:["id"],properties:{id:{description:g(3557,"The ID of a Get Started walkthrough to open."),type:"string"}}},zjt=eh.registerExtensionPoint({extensionPoint:"remoteHelp",jsonSchema:{description:g(3558,"Contributes help information for Remote"),type:"object",properties:{getStarted:{description:g(3559,"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"},Vjt]},documentation:{description:g(3560,"The url, or a command that returns the url, to your project's documentation page"),type:"string"},feedback:{description:g(3561,"The url, or a command that returns the url, to your project's feedback reporter"),type:"string",markdownDeprecationMessage:g(3562,"Use {0} instead","`reportIssue`")},reportIssue:{description:g(3563,"The url, or a command that returns the url, to your project's issue reporter"),type:"string"},issues:{description:g(3564,"The url, or a command that returns the url, to your project's issues list"),type:"string"}}}});let A3e=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(U$),zjt.setHandler(n=>{this._helpInformation.push(...n),this._onDidChangeHelpInformation.fire(n)})}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(v3e,this._targetType.toString(),Ie.WORKSPACE,an.MACHINE),this.storageService.store(v3e,this._targetType.toString(),Ie.PROFILE,an.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}};A3e=D([_(0,$i),_(1,Hae),_(2,we)],A3e);let E3e=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=n,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(Ye.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(b3e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue(w3e)!==y3e}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(b3e)||t.affectsConfiguration(w3e))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,n){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,n)}async $openTunnel(e,t){const i=await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:hb.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),Mie.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(Xe.Info,g(4876,"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(4877,"Use Port {0} as Sudo...",t.tunnelRemotePort),run:async()=>{this.elevateionRetry=!0,await this.remoteExplorerService.close({host:t.tunnelRemoteHost,port:t.tunnelRemotePort},tL.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:hb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,tL.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,n)=>this._proxy.$forwardPort(i,n).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:Ig(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??Mp.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(cst.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case YT.None:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case YT.Output:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":y3e}}]);break}case YT.Hybrid:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":Ujt}}]);break}}}).catch(()=>{})}};E3e=D([Gi(Be.MainThreadTunnelService),_(1,Xae),_(2,Hae),_(3,bi),_(4,Te),_(5,Ge),_(6,hg),_(7,Le)],E3e);function lst(s){return`onAuthenticationRequest:${s}`}let x3e=class extends V{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 mo),this._declaredProviders=[],this._register(t.onDidChangeExtensionSessionAccess(n=>{this._onDidChangeSessions.fire({providerId:n.providerId,label:n.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(Gu(e.id))throw new Error(g(2138,"An authentication contribution must specify an id."));if(Gu(e.label))throw new Error(g(2139,"An authentication contribution must specify a label."));if(this.declaredProviders.some(t=>t.id===e.id))throw new Error(g(2140,"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(n=>this._onDidChangeSessions.fire({providerId:e,label:t.label,event:n}))),wN(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 getAccounts(e){const t=await this.getSessions(e),i=new Array,n=new Set;for(const o of t)n.has(o.account.label)||(n.add(o.account.label),i.push(o.account));return i}async getSessions(e,t,i,n=!1){const o=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,n);if(o)return await o.getSessions(t,{account:i});throw new Error(`No authentication provider '${e}' is currently registered.`)}async createSession(e,t,i){const n=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,!!i?.activateImmediate);if(n)return await n.createSession(t,{account:i?.account});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(lst(e),t?Nb.Immediate:Nb.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const n=new Z,o=new Promise((a,c)=>{n.add(M.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);n.add(Ee(()=>clearTimeout(l)))});return Promise.race([o,r]).finally(()=>n.dispose())}};x3e=D([_(0,fs),_(1,Qae),_(2,hv)],x3e);class $jt extends V{constructor(e,t,i,n,o,r){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=n,this.notificationService=o,this.onDidChangeSessions=r.event}async getSessions(e,t){return this._proxy.$getSessions(this.id,e,t)}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(4878,"Successfully signed out."))}}let D3e=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=n,this.authenticationUsageService=o,this.dialogService=r,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAuthentication),this._register(this.authenticationService.onDidChangeSessions(h=>{this._proxy.$onDidChangeAuthenticationSessions(h.providerId,h.label)}))}async $registerAuthenticationProvider(e,t,i){const n=new I;this._registrations.set(e,n);const o=new $jt(this._proxy,e,t,i,this.notificationService,n);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(lst(e),Nb.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,n){let o;e.id.startsWith(zce)?o=g(4879,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):o=i?g(4880,"The extension '{0}' wants you to sign in again using {1}.",t,e.label):g(4881,"The extension '{0}' wants to sign in using {1}.",t,e.label);const r=[{label:g(4882,"&&Allow"),run(){return!0}}];n?.learnMore&&r.push({label:g(4883,"Learn more"),run:async()=>{const c=this.loginPrompt(e,t,i,n);return await this.openerService.open(N.revive(n.learnMore),{allowCommands:!0}),await c}});const{result:a}=await this.dialogService.prompt({type:Xe.Info,message:o,buttons:r,detail:n?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,n,o){const r=await this.authenticationService.getSessions(e,t,o.account,!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.clearSessionPreference&&this.authenticationExtensionsService.removeSessionPreference(e,i,t),!o.forceNewSession&&r.length){if(a.supportsMultipleAccounts){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,n,d,l))throw new Error("User did not consent to login.");let u;if(r?.length&&!o.forceNewSession)u=a.supportsMultipleAccounts&&!o.account?await this.authenticationExtensionsService.selectSession(e,i,n,t,r):r[0];else{let f=o.account;if(!f){const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?r.find(m=>m.id===p)?.account:void 0}u=await this.authenticationService.createSession(e,t,{activateImmediate:!0,account:f})}return this.authenticationAccessService.updateAllowedExtensions(e,u.account.label,[{id:i,name:n,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,n,t,r):await this.authenticationExtensionsService.requestNewSession(e,t,i,n))}async $getSession(e,t,i,n,o){const r=await this.doGetSession(e,t,i,n,o);return r&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,r.account.label,i,n)),r}async $getAccounts(e){return await this.authenticationService.getAccounts(e)}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};D3e=D([Gi(Be.MainThreadAuthentication),_(1,sMe),_(2,nXe),_(3,Qae),_(4,iXe),_(5,to),_(6,bi),_(7,fs),_(8,Yi),_(9,Ao)],D3e);let k3e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(Ye.ExtHostTimeline)}$registerTimelineProvider(e){this.logService.trace(`MainThreadTimeline#registerTimelineProvider: id=${e.id}`);const t=this._proxy,i=this._providerEmitters;let n=i.get(e.id);n===void 0&&(n=new I,i.set(e.id,n)),this._timelineService.registerTimelineProvider({...e,onDidChange:n.event,async provideTimeline(o,r,a){return Mo(await t.$getTimeline(e.id,o,r,a))},dispose(){i.delete(e.id),n?.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(){}};k3e=D([Gi(Be.MainThreadTimeline),_(1,Ge),_(2,XJe)],k3e);let dst=0;class Gjt{constructor(e,t,i,n){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=n,this.fileCoverage=new ui,this.didAddCoverage=gC(this),this.tree=new xte,this.associatedData=new Map}*allPerTestIDs(){const e=new Set;for(const t of this.tree.nodes)if(t.value&&t.value.perTestData)for(const i of t.value.perTestData)e.has(i)||(e.add(i),yield i)}append(e,t){const i=this.getComputedForUri(e.uri),n=this.result,o=(c,l)=>{l[c]?(l[c].covered+=(e[c]?.covered||0)-(i?.[c]?.covered||0),l[c].total+=(e[c]?.total||0)-(i?.[c]?.total||0)):e[c]&&(l[c]={...e[c]})},r=[...this.treePathForUri(e.uri,!0)],a=[];this.tree.mutatePath(this.treePathForUri(e.uri,!1),c=>{if(a.push(c),a.length===r.length)if(c.value){const l=c.value;l.id=e.id,l.statement=e.statement,l.branch=e.branch,l.declaration=e.declaration}else{const l=c.value=new I3e(e,n,this.accessor);this.fileCoverage.set(e.uri,l)}else if(c.value)o("statement",c.value),o("branch",c.value),o("declaration",c.value),c.value.didChange.trigger(t);else{const l=xs(e);l.id=String(dst++),l.uri=this.treePathToUri(r.slice(0,a.length)),c.value=new ust(l,n)}if(e.testIds){c.value.perTestData??=new Set;for(const l of e.testIds)c.value.perTestData.add(l)}}),a&&this.didAddCoverage.trigger(t,a)}filterTreeForTest(e){const t=new xte;for(const i of this.tree.values())if(i instanceof I3e){if(!i.perTestData?.has(e.toString()))continue;const n=[...this.treePathForUri(i.uri,!0)],o=[];t.mutatePath(this.treePathForUri(i.uri,!1),r=>{o.push(r),r.value??=new qjt(this.treePathToUri(n.slice(0,o.length)),i.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 N.from({scheme:e[0],authority:e[1],path:e.slice(2).join("/")})}}const Kjt=(s,e,t)=>{let i=s.covered,n=s.total;return e&&(i+=e.covered,n+=e.total),t&&(i+=t.covered,n+=t.total),n===0?1:i/n};class hst{get tpc(){return Kjt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=gC(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class ust extends hst{}class qjt extends ust{constructor(e,t){super({id:String(dst++),uri:e,statement:{covered:0,total:0}},t)}}class I3e extends hst{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async detailsForTest(e,t=He.None){this._detailsForTest??=new Map;const i=e.toString(),n=this._detailsForTest.get(i);if(n)return n;const o=(async()=>{try{return await this.accessor.getCoverageDetails(this.id,i,t)}catch(r){throw this._detailsForTest?.delete(i),r}})();return this._detailsForTest.set(i,o),o}async details(e=He.None){this._details??=this.accessor.getCoverageDetails(this.id,void 0,e);try{const t=await this._details;return this.resolved=!0,t}catch(t){throw this._details=void 0,t}}}const k_={[Hn.Running]:6,[Hn.Errored]:5,[Hn.Failed]:4,[Hn.Queued]:3,[Hn.Passed]:2,[Hn.Unset]:0,[Hn.Skipped]:1};brt(k_,(s,e)=>({statusNode:!0,state:Number(e),priority:s}));const Qjt=(s,e)=>k_[e]-k_[s],gst=(...s)=>{switch(s.length){case 0:return Hn.Unset;case 1:return s[0];case 2:return k_[s[0]]>k_[s[1]]?s[0]:s[1];default:{let e=s[0];for(let t=1;tNumber(s)).sort(Qjt),T3e={[Hn.Passed]:0,[Hn.Skipped]:1,[Hn.Failed]:2,[Hn.Errored]:3},fst=()=>new Uint32Array(jjt.length),Yjt=s=>"getOwnDuration"in s,oDe=(s,e,t=!1)=>{let i=s.getCurrentComputedState(e);if(i===void 0||t){i=s.getOwnState(e)??Hn.Unset;let n=0;const o=fst();for(const r of s.getChildren(e)){const a=oDe(s,r);n++,o[a]++,i=a===Hn.Skipped&&i===Hn.Unset?Hn.Skipped:gst(i,a)}n>Jjt&&mst.set(e,o),s.setComputedState(e,i)}return i},pst=(s,e,t=!1)=>{let i=s.getCurrentComputedDuration(e);if(i===void 0||t){const n=s.getOwnDuration(e);if(n!==void 0)i=n;else{i=void 0;for(const o of s.getChildren(e)){const r=pst(s,o);r!==void 0&&(i=(i||0)+r)}}s.setComputedDuration(e,i)}return i},Jjt=64,mst=new WeakMap,Xjt=(s,e,t,i=!0)=>{const n=s.getCurrentComputedState(e),o=k_[n],r=oDe(s,e,!0),a=k_[r],c=new Set;if(a!==o){s.setComputedState(e,r),c.add(e);let l=n,d=r;for(const h of s.getParents(e)){const u=mst.get(h);u&&(u[l]--,u[d]++);const f=s.getCurrentComputedState(h);if(a>o){if(f!==void 0&&k_[f]>=a||u&&u[d]>1)break;s.setComputedState(h,r),c.add(h)}else{if(f===void 0||k_[f]>o||u&&u[l]>0)break;d=oDe(s,h,!0),s.setComputedState(h,d),c.add(h)}l=f}}if(Yjt(s)&&i)for(const l of hi.concat(hi.single(e),s.getParents(e))){const d=s.getCurrentComputedDuration(l),h=pst(s,l,!0);if(d===h)break;s.setComputedDuration(l,h),c.add(l)}return c};M.None,Promise.resolve();class Zjt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new dc,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=$e.alloc(t);let n=0;for(const o of this.getRangeIter(e,t))i.buffer.set(o.buffer,n),n+=o.byteLength;return n0;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:n}}push(e){e.byteLength!==0&&(this.buffers.push(e),this.writeDataEmitter.fire(e),this.offset+=e.byteLength)}end(){this.endDeferred.complete()}}const L3e=(s,e)=>`\x1B]633;SetMark;Id=${iQt(s,e)};Hidden\x07`,eYt=(s,e,t)=>({controllerId:s,expand:Ld.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Hn.Unset,computedState:Hn.Unset});var s1;(function(s){s[s.ComputedStateChange=0]="ComputedStateChange",s[s.OwnStateChange=1]="OwnStateChange",s[s.NewMessage=2]="NewMessage"})(s1||(s1={}));let MF=class extends V{get completedAt(){return this._completedAt}get tests(){return this.testById.values()}getTestById(e){return this.testById.get(e)?.item}constructor(e,t,i,n){super(),this.id=e,this.persist=t,this.request=i,this.telemetry=n,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(7626,"Test run at {0}",new Date().toLocaleString(ql)),this.counts=fst(),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=vn.fromString(o.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield r.get(c.toString())}()}},this.doSerialize=new ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name,ctrlId:o.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(Tte.serializeWithoutMessages)})),this.doSerializeWithMessages=new ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name,ctrlId:o.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(Tte.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,n){const o=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let r;(n||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:O_.Output},u=n&&this.testById.get(n);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:s1.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:jt(this,void 0),otherMessages:[],output:new Zjt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Hn.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 n=1;nn.state===Hn.Queued||n.state===Hn.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[Hn.Errored]+this.counts[Hn.Failed],passes:this.counts[Hn.Passed],controller:this.request.targets.map(e=>e.controllerId).join(",")})}markRetired(e){for(const[t,i]of this.testById)!i.retired&&(!e||e.hasKeyOrParent(vn.fromString(t).path))&&(i.retired=!0,this.changeEmitter.fire({reason:s1.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 n=this.mustGetTaskIndex(t);for(const o of this.testById.values())i(o.tasks[n],o)&&this.fireUpdateAndRefresh(o,n,e)}fireUpdateAndRefresh(e,t,i,n){const o=e.ownComputedState,r=e.ownDuration,a={item:e,result:this,reason:s1.OwnStateChange,previousState:o,previousOwnDuration:r};e.tasks[t].state=i,n!==void 0&&(e.tasks[t].duration=n,e.ownDuration=Math.max(e.ownDuration||0,n));const c=gst(...e.tasks.map(l=>l.state));if(c===o){n!==r&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[o]--,this.counts[c]++,Xjt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:s1.ComputedStateChange}))}addTestToRun(e,t,i){const n=eYt(e,t);if(this.testById.set(t.extId,n),this.counts[Hn.Unset]++,i&&this.testById.get(i)?.children.push(n),this.tasks.length)for(let o=0;oi.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};MF=D([_(3,Yi)],MF);let R3e=class extends V{constructor(e,t,i,n,o){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=n,this.resultService=o,this.diffListener=this._register(new wn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(Ye.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),getTestsRelatedToCode:(r,a,c)=>this.proxy.$getTestsRelatedToCode(r,a,c)})),this._register(this.testService.onDidCancelTestRun(({runId:r})=>{this.proxy.$cancelExtensionTestRun(r)})),this._register(M.debounce(n.onDidChange,(r,a)=>a)(()=>{const r={};for(const a of[Kh.Run,Kh.Debug,Kh.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 MF&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new xte;for(const i of e)t.insert(vn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof MF&&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,n=>n.addTestChainToRun(e,i.map(o=>m$.deserialize(this.uriIdentityService,o))))}$appendCoverage(e,t,i){this.withLiveRun(e,n=>{const o=n.tasks.find(a=>a.id===t);if(!o)return;const r=REe.deserialize(this.uriIdentityService,i);ts(a=>{let c=o.coverage.read(void 0);c?c.append(r,a):(c=new Gjt(n,t,this.uriIdentityService,{getCoverageDetails:(l,d,h)=>this.proxy.$getCoverageDetails(l,d,h).then(u=>u.map(MEe.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,n,o){this.withLiveRun(e,r=>r.updateState(i,t,n,o))}$appendOutputToRun(e,t,i,n,o){const r=n&&{uri:N.revive(n.uri),range:F.lift(n.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,r,o))}$appendTestMessagesInRun(e,t,i,n){const o=this.resultService.getResult(e);if(o&&o instanceof MF)for(const r of n)o.appendMessage(i,t,p$.deserialize(this.uriIdentityService,r))}$registerTestController(e,t,i){const n=new Z,o=jt(`${e}.label`,t),r=jt(`${e}.cap`,i),a={id:e,label:o,capabilities: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),getRelatedCode:(c,l)=>this.proxy.$getCodeRelatedToTest(c,l).then(d=>d.map(h=>({uri:N.revive(h.uri),range:F.lift(h.range)})))};n.add(Ee(()=>this.testProfiles.removeProfile(e))),n.add(this.testService.registerTestController(e,a)),this.testProviderRegistrations.set(e,{instance:a,label:o,capabilities:r,disposable:n})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&ts(n=>{t.label!==void 0&&i.label.set(t.label,n),t.capabilities!==void 0&&i.capabilities.set(t.capabilities,n)})}$unregisterTestController(e){this.testProviderRegistrations.get(e)?.disposable.dispose(),this.testProviderRegistrations.delete(e)}$subscribeToDiffs(){this.proxy.$acceptDiff(this.testService.collection.getReviverDiff().map(MH.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=>MH.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 MF?t(i):void 0}};R3e=D([Gi(Be.MainThreadTesting),_(1,ks),_(2,JJe),_(3,jJe),_(4,YJe)],R3e);let M3e=class extends V{constructor(e,t,i,n){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new Tlt,this._proxy=e.getProxy(Ye.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),n=await this.secretStorageService.get(i);return this.logService.trace(`[mainThreadSecretState] ${n?"P":"No p"}assword found for: `,e,t),n}$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 n=this.getKey(e,t);await this.secretStorageService.set(n,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)}};M3e=D([Gi(Be.MainThreadSecretState),_(1,gJe),_(2,Ge),_(3,hv)],M3e);let N3e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(Ye.ExtHostShare)}$registerShareProvider(e,t,i,n,o){const r={id:i,label:n,selector:t,priority:o,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,He.None);return typeof l=="string"?l:N.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(),bt(this.providerDisposables.values()),this.providerDisposables.clear()}};N3e=D([Gi(Be.MainThreadShare),_(1,HJe)],N3e);let P3e=class extends V{constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new mo),this.proxy=e.getProxy(Ye.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,n){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:n,saveProfile:async(o,r,a)=>{const c=await this.proxy.$saveProfile(e,o,r,a);return c?Mo(c):null},readProfile:async(o,r)=>this.proxy.$readProfile(e,o,r)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};P3e=D([Gi(Be.MainThreadProfileContentHandlers),_(1,fXe)],P3e);let F3e=class extends V{constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,He.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(n,o)=>this._proxy.$provideAiRelatedInformation(e,n,o)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};F3e=D([Gi(Be.MainThreadAiRelatedInformation),_(1,nMe)],F3e);let O3e=class extends V{constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(n,o)=>this._proxy.$provideAiEmbeddingVector(t,n,o)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};O3e=D([Gi(Be.MainThreadAiEmbeddingVector),_(1,eXe)],O3e);let rDe=class extends Dee{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super(t,i,n,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()}};rDe=D([_(4,Yi),_(5,yi),_(6,Fs),_(7,Ge),_(8,uf),_(9,hv),_(10,Em),_(11,Er),_(12,pu),_(13,$i)],rDe);let aDe;function tYt(s){aDe=s}let cDe=class extends LAe{constructor(e,t,i,n,o,r,a,c,l){super(t,i,n,o,r,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return aDe==null?null:this._instantiationService.createInstance(aDe,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const n=i?2:1;return this._instantiationService.createInstance(rDe,this.workerConfig,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};cDe=D([_(4,we),_(5,hg),_(6,pC),_(7,Nl),_(8,Ge)],cDe);let lDe=class extends RAe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,n,o){const r=qKt(e.value);if(r!=null)return r;const a=super.pickExtensionHostKind(e,t,i,n,o);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};lDe=D([_(1,Ge)],lDe);let dDe=class extends TAe{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k){const P=t.createInstance(yAe),R=new cDe(e,P,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,w,r,p);super(P,R,new lDe(e!=null?[2,1,3]:[1,3],p),t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k)}async deltaExtensions(e,t){await this._handleDeltaExtensions(new S0(e,t))}};dDe=D([_(1,we),_(2,bi),_(3,hv),_(4,Yi),_(5,Nl),_(6,Jt),_(7,Er),_(8,P6),_(9,yi),_(10,Te),_(11,Im),_(12,rMe),_(13,Ge),_(14,hg),_(15,Bae),_(16,ig),_(17,pC),_(18,tce),_(19,ug),_(20,uC),_(21,Xae),_(22,to)],dDe);class iYt extends MAe{async readExtensionResource(e){return e.scheme===hee.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}v9t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>_9t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function nYt(s,e){return{[fs.toString()]:new wi(dDe,[void 0],!1),[Im.toString()]:new wi(wAe,[],!0),[Fae.toString()]:new wi(iYt,[],!0),[WU.toString()]:new wi(PAe,[],!0)}}const B3e=/^([^.]+\..+)[:=](.+)$/;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=>!B3e.test(t)):this.options.developmentOptions?.logLevel!==void 0?r3(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 n=B3e.exec(i);n&&n[1]&&n[2]&&t.push([n[1],n[2]])}return t.length?t:void 0}return this.options.developmentOptions?.extensionLogLevel!==void 0?this.options.developmentOptions?.extensionLogLevel.map(([t,i])=>[t,r3(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 Pt(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return N.file("/User").with({scheme:pe.vscodeUserData})}get argvResource(){return Pt(this.userRoamingDataHome,"argv.json")}get cacheHome(){return Pt(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return Pt(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return Pt(this.userRoamingDataHome,"History")}get stateResource(){return Pt(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return Pt(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return Pt(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return Pt(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return Pt(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return Pt(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return Pt(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 Pt(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,n){if(this.workspaceId=e,this.logsHome=t,this.options=i,this.productService=n,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){vt(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,n]of this.payload)switch(i){case"extensionDevelopmentPath":e.extensionDevelopmentLocationURI||(e.extensionDevelopmentLocationURI=[]),e.extensionDevelopmentLocationURI.push(N.parse(n)),e.isExtensionDevelopment=!0;break;case"extensionDevelopmentKind":e.extensionDevelopmentKind=[n];break;case"extensionTestsPath":e.extensionTestsLocationURI=N.parse(n);break;case"debugRenderer":e.debugRenderer=n==="true";break;case"debugId":e.params.debugId=n;break;case"inspect-brk-extensions":e.params.port=parseInt(n),e.params.break=!0;break;case"inspect-extensions":e.params.port=parseInt(n);break;case"enableProposedApi":e.extensionEnabledProposedApi=[];break}const t=this.options.developmentOptions;return t&&!e.isExtensionDevelopment&&(t.extensions?.length&&(e.extensionDevelopmentLocationURI=t.extensions.map(i=>N.revive(i)),e.isExtensionDevelopment=!0),t.extensionTestsPath&&(e.extensionTestsLocationURI=N.revive(t.extensionTestsPath))),e}get filesToOpenOrCreate(){if(this.payload){const e=this.payload.get("openFile");if(e){const t=N.parse(e);if(this.payload.has("gotoLineMode")){const i=AGe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:Ya(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:N.parse(t)},{fileUri:N.parse(e)}]}}get filesToMerge(){if(this.payload){const e=this.payload.get("mergeFile1"),t=this.payload.get("mergeFile2"),i=this.payload.get("mergeFileBase"),n=this.payload.get("mergeFileResult");if(e&&t&&i&&n)return[{fileUri:N.parse(e)},{fileUri:N.parse(t)},{fileUri:N.parse(i)},{fileUri:N.parse(n)}]}}}Yt.__decorator=D([Zt],Yt.prototype,"remoteAuthority",null);Yt.__decorator=D([Zt],Yt.prototype,"expectsResolverExtension",null);Yt.__decorator=D([Zt],Yt.prototype,"isBuilt",null);Yt.__decorator=D([Zt],Yt.prototype,"logLevel",null);Yt.__decorator=D([Zt],Yt.prototype,"windowLogsPath",null);Yt.__decorator=D([Zt],Yt.prototype,"logFile",null);Yt.__decorator=D([Zt],Yt.prototype,"userRoamingDataHome",null);Yt.__decorator=D([Zt],Yt.prototype,"argvResource",null);Yt.__decorator=D([Zt],Yt.prototype,"cacheHome",null);Yt.__decorator=D([Zt],Yt.prototype,"workspaceStorageHome",null);Yt.__decorator=D([Zt],Yt.prototype,"localHistoryHome",null);Yt.__decorator=D([Zt],Yt.prototype,"stateResource",null);Yt.__decorator=D([Zt],Yt.prototype,"userDataSyncHome",null);Yt.__decorator=D([Zt],Yt.prototype,"sync",null);Yt.__decorator=D([Zt],Yt.prototype,"keyboardLayoutResource",null);Yt.__decorator=D([Zt],Yt.prototype,"untitledWorkspacesHome",null);Yt.__decorator=D([Zt],Yt.prototype,"serviceMachineIdResource",null);Yt.__decorator=D([Zt],Yt.prototype,"extHostLogsPath",null);Yt.__decorator=D([Zt],Yt.prototype,"extHostTelemetryLogFile",null);Yt.__decorator=D([Zt],Yt.prototype,"debugExtensionHost",null);Yt.__decorator=D([Zt],Yt.prototype,"isExtensionDevelopment",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionDevelopmentLocationURI",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionDevelopmentLocationKind",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionTestsLocationURI",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionEnabledProposedApi",null);Yt.__decorator=D([Zt],Yt.prototype,"debugRenderer",null);Yt.__decorator=D([Zt],Yt.prototype,"enableSmokeTestDriver",null);Yt.__decorator=D([Zt],Yt.prototype,"disableExtensions",null);Yt.__decorator=D([Zt],Yt.prototype,"enableExtensions",null);Yt.__decorator=D([Zt],Yt.prototype,"webviewExternalEndpoint",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionTelemetryLogResource",null);Yt.__decorator=D([Zt],Yt.prototype,"disableTelemetry",null);Yt.__decorator=D([Zt],Yt.prototype,"verbose",null);Yt.__decorator=D([Zt],Yt.prototype,"logExtensionHostCommunication",null);Yt.__decorator=D([Zt],Yt.prototype,"skipReleaseNotes",null);Yt.__decorator=D([Zt],Yt.prototype,"skipWelcome",null);Yt.__decorator=D([Zt],Yt.prototype,"disableWorkspaceTrust",null);Yt.__decorator=D([Zt],Yt.prototype,"lastActiveProfile",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToOpenOrCreate",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToDiff",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToMerge",null);let hDe=class extends Yt{constructor(e=gNe().id,t=u4t(),i){super(e,ltt,t,i)}};hDe=D([_(2,Er)],hDe);function sYt(s){return{[Za.toString()]:new wi(hDe,[void 0,s],!0)}}class _st extends V{constructor(e=h4t()){super(),this.mainContainer=e,this.onDidChangeMainEditorCenteredLayout=M.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=M.None,this.onDidChangeZenMode=M.None,this.onDidChangeWindowMaximized=M.None,this.onDidChangeCenteredLayout=M.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=M.None,this.onDidChangeNotificationsVisibility=M.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=Qn?"windows":pr?"linux":"mac",i=Fi(["monaco-workbench",t,"web",$1e?"chromium":M6e?"firefox":N6e?"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(Hu())}get containers(){const e=[];for(const{window:t}of D8())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(Po),this.paneCompositeService=e.get(Tm),this.statusBarService=e.get(QRe),this.viewDescriptorService=e.get(xm),this.configurationService=e.get(Te),this.auxiliaryWindowService=e.get(sXe),this.hostService=e.get(xc),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(RK(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition(RK(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=RK(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=RK(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(n=>this.handleContainerDidLayout(t.container,n))),i.add(Ee(()=>this._onDidRemoveContainer.fire(t.container)))}))}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),kdt(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return ct(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=c4t(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=dNe(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(B1(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new bn(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&&xdt(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 n=this.paneCompositeService.getActivePaneComposite(i);if(n!=null&&e)this.paneCompositeService.hideActivePaneComposite(i);else if(n==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"),n=this.getPart("workbench.parts.auxiliarybar");t?.updateStyles(),i?.updateStyles(),n?.updateStyles(),this._onDidChangeSideBarPosition.fire(B1(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:z_(e)}layout(){this._mainContainerDimension=z_(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=Dt.get(Kt).getFocusedCodeEditor();t instanceof Yk?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}utt(s=>{const e=s.get(pu);e instanceof _st&&e.init(s)});function oYt(s){return{[pu.toString()]:new wi(_st,[s],!0)}}var Km;(function(s){s[s.Unknown=1]="Unknown",s[s.Keyboard=2]="Keyboard",s[s.Api=3]="Api"})(Km||(Km={}));let $A=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=n,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=Km.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(pb.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case Km.Unknown:case Km.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===Km.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=Km.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==Km.Api&&(pb.getInstance().isModifierPressed?this.shutdownReason=Km.Keyboard:this.shutdownReason=Km.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(M.runAndSubscribe(tm,({window:t,disposables:i})=>{const n=i.add(Ac(t)),o=i.add(new ii(t.document,"visibilitychange"));M.any(M.map(n.onDidFocus,()=>this.hasFocus,i),M.map(n.onDidBlur,()=>this.hasFocus,i),M.map(o.event,()=>this.hasFocus,i),M.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(r=>e.fire(r))},{window:si,disposables:this._store})),M.latch(e.event,void 0,this._store)}get hasFocus(){return Hu().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(M.runAndSubscribe(tm,({window:t,disposables:i})=>{const n=F2(t),o=i.add(Ac(t));i.add(o.onDidFocus(()=>e.fire(n))),ilt(t)&&i.add(mdt(t,()=>{const r=t.document.hasFocus();return r&&e.fire(n),r},100,20))},{window:si,disposables:this._store})),M.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(M.runAndSubscribe(tm,({window:t,disposables:i})=>{const n=F2(t),o=dm&&t.visualViewport?t.visualViewport:t,r=()=>{const a=$dt(t);return a!==null&&!a.guess};for(const a of[ke.FULLSCREEN_CHANGE,ke.WK_FULLSCREEN_CHANGE])i.add(ue(t.document,a,()=>e.fire({windowId:n,fullscreen:r()})));i.add(wdt(o,ke.RESIZE,()=>e.fire({windowId:n,fullscreen:r()}),void 0,Qt?2e3:800))},{window:si,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),n=[],o=[];for(const r of e)r.label=r.label||this.getRecentLabel(r),_Q(r)?t?.addMode?o.push({uri:r.folderUri}):this.doOpen({folderUri:r.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):Gye(r)?this.doOpen({workspaceUri:r.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):a4t(r)&&n.push(r);o.length>0&&this.withServices(r=>{r.get(iC).addFolders(o)}),n.length>0&&this.withServices(async r=>{const a=r.get(ei);if(t?.mergeMode&&n.length===4){const l=Fi(await Uhe(n,this.fileService,this.logService));if(l.length!==4||!Qv(l[0])||!Qv(l[1])||!Qv(l[2])||!Qv(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&&n.length===2){const l=Fi(await Uhe(n,this.fileService,this.logService));if(l.length!==2||!Qv(l[0])||!Qv(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 n)if(this.shouldReuse(t,!0)){let d=[];if(t?.gotoLineMode){const h=AGe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:Ya(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Fi(await Uhe(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=>p5t(l,n.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"),n=(i?.newWindowProfile?this.userDataProfilesService.profiles.find(o=>o.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return n.isDefault||t.push(["lastActiveProfile",n.id]),t.length?t:void 0}getRecentLabel(e){return _Q(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:Op.LONG}):Gye(e)?this.labelService.getWorkspaceLabel(hNe(e.workspaceUri),{verbose:Op.LONG}):this.labelService.getUriLabel(e.fileUri)}shouldReuse(e=Object.create(null),t){if(e.waitMarkerFileURI)return!0;const i=this.configurationService.getValue("window"),n=t?i?.openFilesInNewWindow||"off":i?.openFoldersInNewWindow||"default";let o=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(n==="on"||n==="off")&&(o=n==="on"),!o}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&_Q(e)&&e.folderUri.scheme===pe.file&&Py(this.contextService.getWorkspace())){this.withServices(async n=>{await n.get(iC).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(lD.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:n}=await this.dialogService.confirm({type:Xe.Warning,message:g(790,"The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),primaryButton:g(791,"&&Open")});n&&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(lD.RELOAD),si.location.reload()}async close(){await this.handleExpectedShutdown(lD.CLOSE),si.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=Km.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=Km.Api,this.lifecycleService.withExpectedShutdown(e)}getPathForFile(){}};$A.__decorator=D([Zt],$A.prototype,"onDidChangeFocus",null);$A.__decorator=D([Zt],$A.prototype,"onDidChangeActiveWindow",null);$A.__decorator=D([Zt],$A.prototype,"onDidChangeFullScreen",null);$A=D([_(0,pu),_(1,Te),_(2,Jt),_(3,Fs),_(4,hv),_(5,we),_(6,ig),_(7,Ge),_(8,to),_(9,yi),_(10,ug),_(11,Em)],$A);class rYt extends V{constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){Bj(si,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),Bj(si,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return si.matchMedia("(prefers-color-scheme: light)").matches?!1:!!si.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!si.matchMedia("(forced-colors: active)").matches}}function aYt(){return{[xc.toString()]:new wi($A,[],!0),[uXe.toString()]:new wi(rYt,[],!0)}}function cYt(s,e,t){let i,n,o,r,a;if(e){for(r=e.offset,a=r+e.length,o=r;o>0&&!Pie(s,o-1);)o--;let y=a;for(;yr&&s.substring(C,A)!==y&&v.push({offset:C,length:A-C,content:y})}let w=m();if(w!==ft.EOF){const y=u.getTokenOffset()+o,C=Bue(h,i);b(C,o,y)}for(;w!==ft.EOF;){let y=u.getTokenOffset()+u.getTokenLength()+o,C=m(),A="";for(;!l&&(C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia);){const k=u.getTokenOffset()+o;b(" ",y,k),y=u.getTokenOffset()+u.getTokenLength()+o,A=C===ft.LineCommentTrivia?p():"",C=m()}if(C===ft.CloseBraceToken)w!==ft.OpenBraceToken&&(d--,A=p());else if(C===ft.CloseBracketToken)w!==ft.OpenBracketToken&&(d--,A=p());else{switch(w){case ft.OpenBracketToken:case ft.OpenBraceToken:d++,A=p();break;case ft.CommaToken:case ft.LineCommentTrivia:A=p();break;case ft.BlockCommentTrivia:l?A=p():A=" ";break;case ft.ColonToken:A=" ";break;case ft.StringLiteral:if(C===ft.ColonToken){A="";break}case ft.NullKeyword:case ft.TrueKeyword:case ft.FalseKeyword:case ft.NumericLiteral:case ft.CloseBraceToken:case ft.CloseBracketToken:C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia?A=" ":C!==ft.CommaToken&&C!==ft.EOF&&(f=!0);break;case ft.Unknown:f=!0;break}l&&(C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia)&&(A=p())}const L=u.getTokenOffset()+o;b(A,y,L),w=C}return v}function Bue(s,e){let t="";for(let i=0;i(await this.remoteAuthorityResolverService.resolveAuthority(r)).authority}:void 0,c=xg(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,n,e.elevateIfNeeded?e.elevateIfNeeded:t?.elevateIfNeeded,e.privacy,t?.protocol);if(typeof l=="string")o=l;else if(l&&l.localAddress){const d=pg(this._candidates??new Map,e.remote.host,e.remote.port),h=l.protocol?l.protocol===Tp.Https?Tp.Https:Tp.Http:t?.protocol??Tp.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??Tue,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,n,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 n=i.get(e);i.delete(e),n&&(t.name=n.name??t.name,t.local=("local"in n?n.local:"localPort"in n?n.localPort:void 0)??t.local,t.privacy=t.privacy)}return t}async mergeAttributesIntoExistingTunnel(e,t,i){const n=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(n!==e.name&&(e.name=n,r=o.Fire),(i?.protocol||e.protocol!==Tp.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,JT.User),await this.doForward(t,i)}return pg(this.remoteTunnels,t.remote.host,t.remote.port)}async name(e,t,i){const n=pg(this.forwarded,e,t),o=xg(e,t);if(n){n.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 n=xg(e,t),o=this.forwarded.get(n);return i===JT.AutoForwardEnd&&o&&o.source.source===cb.Auto&&this.sessionCachedProperties.set(n,{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=xg(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=pg(this._candidates??new Map,t.remoteAddress.host,t.remoteAddress.port),n=typeof t.localAddress=="string"?t.localAddress:xg(t.localAddress.host,t.localAddress.port);this.detected.set(xg(t.remoteAddress.host,t.remoteAddress.port),{remoteHost:t.remoteAddress.host,remotePort:t.remoteAddress.port,localAddress:n,protocol:Tp.Http,localUri:this.makeLocalUri(n),closeable:!1,runningProcess:i?.detail,hasRunningProcess:!!i,pid:i?.pid,privacy:LS.ConstantPrivate,source:{source:cb.Extension,description:g(8680,"Statically Forwarded")}}),this.tunnelService.setEnvironmentTunnel(t.remoteAddress.host,t.remoteAddress.port,n,LS.ConstantPrivate,Tp.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(n=>n.port).join(", ")}`),this._onCandidatesChanged.fire(i)}updateInResponseToCandidates(e){const t=this._candidates??new Map,i=new Map;return this._candidates=i,e.forEach(n=>{const o=xg(n.host,n.port);i.set(o,{host:n.host,port:n.port,detail:n.detail,pid:n.pid}),t.has(o)&&t.delete(o);const r=pg(this.forwarded,n.host,n.port);r&&(r.runningProcess=n.detail,r.hasRunningProcess=!0,r.pid=n.pid)}),t.forEach((n,o)=>{const r=kjt(o);if(!r)return;const a=pg(this.forwarded,r.host,r.port);a&&(a.runningProcess=void 0,a.hasRunningProcess=!1,a.pid=void 0);const c=pg(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 n=t.get(i.remotePort);(n?.protocol||i.protocol!==Tp.Http)&&n?.protocol!==i.protocol&&await this.doForward({remote:{host:i.remoteHost,port:i.remotePort},local:i.localPort,name:i.name,source:i.source},n),n&&n.label&&n.label!==i.name&&await this.name(i.remoteHost,i.remotePort,n.label)}}async getAttributes(e,t=!0){const i=new Map,n=new Map;e.forEach(l=>{const d=pg(this._candidates??new Map,P$[0],l.port)??l;if(d){i.set(l.port,d);const h=Ijt(d)?d.pid:void 0;n.has(h)||n.set(h,[]),n.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(n.entries()).map(d=>{const h=d[1],u=i.get(h[0]);return l.providePortAttributes(h,u?.pid,u?.detail,He.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??Rie.providedActionToAction(h?.autoForwardAction),requireLocalPort:d?.requireLocalPort,protocol:d?.protocol})}),c}addAttributesProvider(e){this.portAttributesProviders.push(e)}};B$.__decorator=D([ILe(1e3)],B$.prototype,"storeForwarded",null);B$=D([_(0,Fae),_(1,$i),_(2,Te),_(3,Jr),_(4,hC),_(5,yi),_(6,Ge),_(7,to),_(8,fs),_(9,Le)],B$);const r3e="remote.explorerType",a3e="remote.autoForwardPorts",c3e="remote.autoForwardPortsSource",l3e="output",Tjt="hybrid";var d3e;(function(s){s.Candidate="Candidate",s.Detected="Detected",s.Forwarded="Forwarded",s.Add="Add"})(d3e||(d3e={}));var h3e;(function(s){s[s.None=0]="None",s[s.New=1]="New",s[s.Label=2]="Label",s[s.LocalPort=3]="LocalPort"})(h3e||(h3e={}));const Ljt={type:"object",required:["id"],properties:{id:{description:g(3557,"The ID of a Get Started walkthrough to open."),type:"string"}}},Rjt=Xd.registerExtensionPoint({extensionPoint:"remoteHelp",jsonSchema:{description:g(3558,"Contributes help information for Remote"),type:"object",properties:{getStarted:{description:g(3559,"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"},Ljt]},documentation:{description:g(3560,"The url, or a command that returns the url, to your project's documentation page"),type:"string"},feedback:{description:g(3561,"The url, or a command that returns the url, to your project's feedback reporter"),type:"string",markdownDeprecationMessage:g(3562,"Use {0} instead","`reportIssue`")},reportIssue:{description:g(3563,"The url, or a command that returns the url, to your project's issue reporter"),type:"string"},issues:{description:g(3564,"The url, or a command that returns the url, to your project's issues list"),type:"string"}}}});let u3e=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(B$),Rjt.setHandler(n=>{this._helpInformation.push(...n),this._onDidChangeHelpInformation.fire(n)})}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(r3e,this._targetType.toString(),Ie.WORKSPACE,an.MACHINE),this.storageService.store(r3e,this._targetType.toString(),Ie.PROFILE,an.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}};u3e=D([_(0,$i),_(1,Fae),_(2,we)],u3e);let g3e=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.remoteExplorerService=t,this.tunnelService=i,this.notificationService=n,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(Ye.ExtHostTunnelService),this._register(i.onTunnelOpened(()=>this._proxy.$onDidTunnelsChange())),this._register(i.onTunnelClosed(()=>this._proxy.$onDidTunnelsChange()))}processFindingEnabled(){return(!!this.configurationService.getValue(a3e)||this.tunnelService.hasTunnelProvider)&&this.configurationService.getValue(c3e)!==l3e}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(a3e)||t.affectsConfiguration(c3e))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,n){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,n)}async $openTunnel(e,t){const i=await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:cb.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),Lie.fromServiceTunnel(i)}async elevationPrompt(e,t,i){return this.notificationService.prompt(Xe.Info,g(4876,"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(4877,"Use Port {0} as Sudo...",t.tunnelRemotePort),run:async()=>{this.elevateionRetry=!0,await this.remoteExplorerService.close({host:t.tunnelRemoteHost,port:t.tunnelRemotePort},JT.Other),await this.remoteExplorerService.forward({remote:e.remoteAddress,local:e.localAddressPort,name:e.label,source:{source:cb.Extension,description:i},elevateIfNeeded:!0}),this.elevateionRetry=!1}}])}async $closeTunnel(e){return this.remoteExplorerService.close(e,JT.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,n)=>this._proxy.$forwardPort(i,n).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:xg(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??Tp.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(est.key,!0)}async $setCandidateFilter(){this.remoteExplorerService.setCandidateFilter(e=>this._proxy.$applyCandidateFilter(e))}async $setCandidatePortSource(e){this.remoteAgentService.getEnvironment().then(()=>{switch(e){case KT.None:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPorts":!1}}]);break}case KT.Output:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":l3e}}]);break}case KT.Hybrid:{Qe.as(Nn.Configuration).registerDefaultConfigurations([{overrides:{"remote.autoForwardPortsSource":Tjt}}]);break}}}).catch(()=>{})}};g3e=D([Gi(Be.MainThreadTunnelService),_(1,Qae),_(2,Fae),_(3,bi),_(4,Te),_(5,Ge),_(6,cg),_(7,Le)],g3e);function tst(s){return`onAuthenticationRequest:${s}`}let f3e=class extends V{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 mo),this._declaredProviders=[],this._register(t.onDidChangeExtensionSessionAccess(n=>{this._onDidChangeSessions.fire({providerId:n.providerId,label:n.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(zu(e.id))throw new Error(g(2138,"An authentication contribution must specify an id."));if(zu(e.label))throw new Error(g(2139,"An authentication contribution must specify a label."));if(this.declaredProviders.some(t=>t.id===e.id))throw new Error(g(2140,"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(n=>this._onDidChangeSessions.fire({providerId:e,label:t.label,event:n}))),mN(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 getAccounts(e){const t=await this.getSessions(e),i=new Array,n=new Set;for(const o of t)n.has(o.account.label)||(n.add(o.account.label),i.push(o.account));return i}async getSessions(e,t,i,n=!1){const o=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,n);if(o)return await o.getSessions(t,{account:i});throw new Error(`No authentication provider '${e}' is currently registered.`)}async createSession(e,t,i){const n=this._authenticationProviders.get(e)||await this.tryActivateProvider(e,!!i?.activateImmediate);if(n)return await n.createSession(t,{account:i?.account});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(tst(e),t?Lb.Immediate:Lb.Normal);let i=this._authenticationProviders.get(e);if(i)return i;const n=new Z,o=new Promise((a,c)=>{n.add(M.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);n.add(Ee(()=>clearTimeout(l)))});return Promise.race([o,r]).finally(()=>n.dispose())}};f3e=D([_(0,fs),_(1,$ae),_(2,cv)],f3e);class Mjt extends V{constructor(e,t,i,n,o,r){super(),this._proxy=e,this.id=t,this.label=i,this.supportsMultipleAccounts=n,this.notificationService=o,this.onDidChangeSessions=r.event}async getSessions(e,t){return this._proxy.$getSessions(this.id,e,t)}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(4878,"Successfully signed out."))}}let p3e=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.authenticationService=t,this.authenticationExtensionsService=i,this.authenticationAccessService=n,this.authenticationUsageService=o,this.dialogService=r,this.notificationService=a,this.extensionService=c,this.telemetryService=l,this.openerService=d,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAuthentication),this._register(this.authenticationService.onDidChangeSessions(h=>{this._proxy.$onDidChangeAuthenticationSessions(h.providerId,h.label)}))}async $registerAuthenticationProvider(e,t,i){const n=new I;this._registrations.set(e,n);const o=new Mjt(this._proxy,e,t,i,this.notificationService,n);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(tst(e),Lb.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,n){let o;e.id.startsWith(Wce)?o=g(4879,"The extension '{0}' wants to access the language models provided by {1}.",t,e.label):o=i?g(4880,"The extension '{0}' wants you to sign in again using {1}.",t,e.label):g(4881,"The extension '{0}' wants to sign in using {1}.",t,e.label);const r=[{label:g(4882,"&&Allow"),run(){return!0}}];n?.learnMore&&r.push({label:g(4883,"Learn more"),run:async()=>{const c=this.loginPrompt(e,t,i,n);return await this.openerService.open(N.revive(n.learnMore),{allowCommands:!0}),await c}});const{result:a}=await this.dialogService.prompt({type:Xe.Info,message:o,buttons:r,detail:n?.detail,cancelButton:!0});return a??!1}async doGetSession(e,t,i,n,o){const r=await this.authenticationService.getSessions(e,t,o.account,!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.clearSessionPreference&&this.authenticationExtensionsService.removeSessionPreference(e,i,t),!o.forceNewSession&&r.length){if(a.supportsMultipleAccounts){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,n,d,l))throw new Error("User did not consent to login.");let u;if(r?.length&&!o.forceNewSession)u=a.supportsMultipleAccounts&&!o.account?await this.authenticationExtensionsService.selectSession(e,i,n,t,r):r[0];else{let f=o.account;if(!f){const p=this.authenticationExtensionsService.getSessionPreference(e,i,t);f=p?r.find(m=>m.id===p)?.account:void 0}u=await this.authenticationService.createSession(e,t,{activateImmediate:!0,account:f})}return this.authenticationAccessService.updateAllowedExtensions(e,u.account.label,[{id:i,name:n,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,n,t,r):await this.authenticationExtensionsService.requestNewSession(e,t,i,n))}async $getSession(e,t,i,n,o){const r=await this.doGetSession(e,t,i,n,o);return r&&(this.sendProviderUsageTelemetry(i,e),this.authenticationUsageService.addAccountUsage(e,r.account.label,i,n)),r}async $getAccounts(e){return await this.authenticationService.getAccounts(e)}sendProviderUsageTelemetry(e,t){this.telemetryService.publicLog2("authentication.providerUsage",{providerId:t,extensionId:e})}};p3e=D([Gi(Be.MainThreadAuthentication),_(1,KRe),_(2,jJe),_(3,$ae),_(4,QJe),_(5,to),_(6,bi),_(7,fs),_(8,Yi),_(9,Ao)],p3e);let m3e=class{constructor(e,t,i){this.logService=t,this._timelineService=i,this._providerEmitters=new Map,this._proxy=e.getProxy(Ye.ExtHostTimeline)}$registerTimelineProvider(e){this.logService.trace(`MainThreadTimeline#registerTimelineProvider: id=${e.id}`);const t=this._proxy,i=this._providerEmitters;let n=i.get(e.id);n===void 0&&(n=new I,i.set(e.id,n)),this._timelineService.registerTimelineProvider({...e,onDidChange:n.event,async provideTimeline(o,r,a){return Mo(await t.$getTimeline(e.id,o,r,a))},dispose(){i.delete(e.id),n?.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(){}};m3e=D([Gi(Be.MainThreadTimeline),_(1,Ge),_(2,$Je)],m3e);let ist=0;class Njt{constructor(e,t,i,n){this.result=e,this.fromTaskId=t,this.uriIdentityService=i,this.accessor=n,this.fileCoverage=new ui,this.didAddCoverage=lC(this),this.tree=new Ate,this.associatedData=new Map}*allPerTestIDs(){const e=new Set;for(const t of this.tree.nodes)if(t.value&&t.value.perTestData)for(const i of t.value.perTestData)e.has(i)||(e.add(i),yield i)}append(e,t){const i=this.getComputedForUri(e.uri),n=this.result,o=(c,l)=>{l[c]?(l[c].covered+=(e[c]?.covered||0)-(i?.[c]?.covered||0),l[c].total+=(e[c]?.total||0)-(i?.[c]?.total||0)):e[c]&&(l[c]={...e[c]})},r=[...this.treePathForUri(e.uri,!0)],a=[];this.tree.mutatePath(this.treePathForUri(e.uri,!1),c=>{if(a.push(c),a.length===r.length)if(c.value){const l=c.value;l.id=e.id,l.statement=e.statement,l.branch=e.branch,l.declaration=e.declaration}else{const l=c.value=new _3e(e,n,this.accessor);this.fileCoverage.set(e.uri,l)}else if(c.value)o("statement",c.value),o("branch",c.value),o("declaration",c.value),c.value.didChange.trigger(t);else{const l=xs(e);l.id=String(ist++),l.uri=this.treePathToUri(r.slice(0,a.length)),c.value=new sst(l,n)}if(e.testIds){c.value.perTestData??=new Set;for(const l of e.testIds)c.value.perTestData.add(l)}}),a&&this.didAddCoverage.trigger(t,a)}filterTreeForTest(e){const t=new Ate;for(const i of this.tree.values())if(i instanceof _3e){if(!i.perTestData?.has(e.toString()))continue;const n=[...this.treePathForUri(i.uri,!0)],o=[];t.mutatePath(this.treePathForUri(i.uri,!1),r=>{o.push(r),r.value??=new Fjt(this.treePathToUri(n.slice(0,o.length)),i.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 N.from({scheme:e[0],authority:e[1],path:e.slice(2).join("/")})}}const Pjt=(s,e,t)=>{let i=s.covered,n=s.total;return e&&(i+=e.covered,n+=e.total),t&&(i+=t.covered,n+=t.total),n===0?1:i/n};class nst{get tpc(){return Pjt(this.statement,this.branch,this.declaration)}constructor(e,t){this.fromResult=t,this.didChange=lC(this),this.id=e.id,this.uri=e.uri,this.statement=e.statement,this.branch=e.branch,this.declaration=e.declaration}}class sst extends nst{}class Fjt extends sst{constructor(e,t){super({id:String(ist++),uri:e,statement:{covered:0,total:0}},t)}}class _3e extends nst{get hasSynchronousDetails(){return this._details instanceof Array||this.resolved}constructor(e,t,i){super(e,t),this.accessor=i}async detailsForTest(e,t=He.None){this._detailsForTest??=new Map;const i=e.toString(),n=this._detailsForTest.get(i);if(n)return n;const o=(async()=>{try{return await this.accessor.getCoverageDetails(this.id,i,t)}catch(r){throw this._detailsForTest?.delete(i),r}})();return this._detailsForTest.set(i,o),o}async details(e=He.None){this._details??=this.accessor.getCoverageDetails(this.id,void 0,e);try{const t=await this._details;return this.resolved=!0,t}catch(t){throw this._details=void 0,t}}}const E_={[Hn.Running]:6,[Hn.Errored]:5,[Hn.Failed]:4,[Hn.Queued]:3,[Hn.Passed]:2,[Hn.Unset]:0,[Hn.Skipped]:1};crt(E_,(s,e)=>({statusNode:!0,state:Number(e),priority:s}));const Ojt=(s,e)=>E_[e]-E_[s],ost=(...s)=>{switch(s.length){case 0:return Hn.Unset;case 1:return s[0];case 2:return E_[s[0]]>E_[s[1]]?s[0]:s[1];default:{let e=s[0];for(let t=1;tNumber(s)).sort(Ojt),v3e={[Hn.Passed]:0,[Hn.Skipped]:1,[Hn.Failed]:2,[Hn.Errored]:3},rst=()=>new Uint32Array(Bjt.length),Wjt=s=>"getOwnDuration"in s,Zxe=(s,e,t=!1)=>{let i=s.getCurrentComputedState(e);if(i===void 0||t){i=s.getOwnState(e)??Hn.Unset;let n=0;const o=rst();for(const r of s.getChildren(e)){const a=Zxe(s,r);n++,o[a]++,i=a===Hn.Skipped&&i===Hn.Unset?Hn.Skipped:ost(i,a)}n>Hjt&&cst.set(e,o),s.setComputedState(e,i)}return i},ast=(s,e,t=!1)=>{let i=s.getCurrentComputedDuration(e);if(i===void 0||t){const n=s.getOwnDuration(e);if(n!==void 0)i=n;else{i=void 0;for(const o of s.getChildren(e)){const r=ast(s,o);r!==void 0&&(i=(i||0)+r)}}s.setComputedDuration(e,i)}return i},Hjt=64,cst=new WeakMap,Ujt=(s,e,t,i=!0)=>{const n=s.getCurrentComputedState(e),o=E_[n],r=Zxe(s,e,!0),a=E_[r],c=new Set;if(a!==o){s.setComputedState(e,r),c.add(e);let l=n,d=r;for(const h of s.getParents(e)){const u=cst.get(h);u&&(u[l]--,u[d]++);const f=s.getCurrentComputedState(h);if(a>o){if(f!==void 0&&E_[f]>=a||u&&u[d]>1)break;s.setComputedState(h,r),c.add(h)}else{if(f===void 0||E_[f]>o||u&&u[l]>0)break;d=Zxe(s,h,!0),s.setComputedState(h,d),c.add(h)}l=f}}if(Wjt(s)&&i)for(const l of hi.concat(hi.single(e),s.getParents(e))){const d=s.getCurrentComputedDuration(l),h=ast(s,l,!0);if(d===h)break;s.setComputedDuration(l,h),c.add(l)}return c};M.None,Promise.resolve();class Vjt{constructor(){this.writeDataEmitter=new I,this.endDeferred=new dc,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=$e.alloc(t);let n=0;for(const o of this.getRangeIter(e,t))i.buffer.set(o.buffer,n),n+=o.byteLength;return n0;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:n}}push(e){e.byteLength!==0&&(this.buffers.push(e),this.writeDataEmitter.fire(e),this.offset+=e.byteLength)}end(){this.endDeferred.complete()}}const b3e=(s,e)=>`\x1B]633;SetMark;Id=${Gqt(s,e)};Hidden\x07`,zjt=(s,e,t)=>({controllerId:s,expand:Id.NotExpandable,item:{...e},children:[],tasks:[],ownComputedState:Hn.Unset,computedState:Hn.Unset});var e1;(function(s){s[s.ComputedStateChange=0]="ComputedStateChange",s[s.OwnStateChange=1]="OwnStateChange",s[s.NewMessage=2]="NewMessage"})(e1||(e1={}));let IF=class extends V{get completedAt(){return this._completedAt}get tests(){return this.testById.values()}getTestById(e){return this.testById.get(e)?.item}constructor(e,t,i,n){super(),this.id=e,this.persist=t,this.request=i,this.telemetry=n,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(7626,"Test run at {0}",new Date().toLocaleString(Kl)),this.counts=rst(),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=vn.fromString(o.item.extId).parentId;if(a)for(const c of a.idsToRoot())yield r.get(c.toString())}()}},this.doSerialize=new ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name,ctrlId:o.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(kte.serializeWithoutMessages)})),this.doSerializeWithMessages=new ya(()=>({id:this.id,completedAt:this.completedAt,tasks:this.tasks.map(o=>({id:o.id,name:o.name,ctrlId:o.ctrlId})),name:this.name,request:this.request,items:[...this.testById.values()].map(kte.serialize)}))}getStateById(e){return this.testById.get(e)}appendOutput(e,t,i,n){const o=e.byteLength>100?e.slice(0,100).toString()+"…":e.toString();let r;(n||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:N_.Output},u=n&&this.testById.get(n);u?(u.tasks[a].messages.push(h),this.changeEmitter.fire({item:u,result:this,reason:e1.NewMessage,message:h})):c.otherMessages.push(h)}addTask(e){this.tasks.push({...e,coverage:jt(this,void 0),otherMessages:[],output:new Vjt});for(const t of this.tests)t.tasks.push({duration:void 0,messages:[],state:Hn.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 n=1;nn.state===Hn.Queued||n.state===Hn.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[Hn.Errored]+this.counts[Hn.Failed],passes:this.counts[Hn.Passed],controller:this.request.targets.map(e=>e.controllerId).join(",")})}markRetired(e){for(const[t,i]of this.testById)!i.retired&&(!e||e.hasKeyOrParent(vn.fromString(t).path))&&(i.retired=!0,this.changeEmitter.fire({reason:e1.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 n=this.mustGetTaskIndex(t);for(const o of this.testById.values())i(o.tasks[n],o)&&this.fireUpdateAndRefresh(o,n,e)}fireUpdateAndRefresh(e,t,i,n){const o=e.ownComputedState,r=e.ownDuration,a={item:e,result:this,reason:e1.OwnStateChange,previousState:o,previousOwnDuration:r};e.tasks[t].state=i,n!==void 0&&(e.tasks[t].duration=n,e.ownDuration=Math.max(e.ownDuration||0,n));const c=ost(...e.tasks.map(l=>l.state));if(c===o){n!==r&&this.changeEmitter.fire(a);return}e.ownComputedState=c,this.counts[o]--,this.counts[c]++,Ujt(this.computedStateAccessor,e).forEach(l=>this.changeEmitter.fire(l===e?a:{item:l,result:this,reason:e1.ComputedStateChange}))}addTestToRun(e,t,i){const n=zjt(e,t);if(this.testById.set(t.extId,n),this.counts[Hn.Unset]++,i&&this.testById.get(i)?.children.push(n),this.tasks.length)for(let o=0;oi.id===e);if(t===-1)throw new Error(`Unknown task ${e} in updateState`);return t}};IF=D([_(3,Yi)],IF);let w3e=class extends V{constructor(e,t,i,n,o){super(),this.uriIdentityService=t,this.testService=i,this.testProfiles=n,this.resultService=o,this.diffListener=this._register(new wn),this.testProviderRegistrations=new Map,this.proxy=e.getProxy(Ye.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),getTestsRelatedToCode:(r,a,c)=>this.proxy.$getTestsRelatedToCode(r,a,c)})),this._register(this.testService.onDidCancelTestRun(({runId:r})=>{this.proxy.$cancelExtensionTestRun(r)})),this._register(M.debounce(n.onDidChange,(r,a)=>a)(()=>{const r={};for(const a of[Gh.Run,Gh.Debug,Gh.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 IF&&this.proxy.$disposeRun(a.id)})}))}$markTestRetired(e){let t;if(e){t=new Ate;for(const i of e)t.insert(vn.fromString(i).path,void 0)}for(const i of this.resultService.results)i instanceof IF&&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,n=>n.addTestChainToRun(e,i.map(o=>g$.deserialize(this.uriIdentityService,o))))}$appendCoverage(e,t,i){this.withLiveRun(e,n=>{const o=n.tasks.find(a=>a.id===t);if(!o)return;const r=xEe.deserialize(this.uriIdentityService,i);ts(a=>{let c=o.coverage.read(void 0);c?c.append(r,a):(c=new Njt(n,t,this.uriIdentityService,{getCoverageDetails:(l,d,h)=>this.proxy.$getCoverageDetails(l,d,h).then(u=>u.map(DEe.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,n,o){this.withLiveRun(e,r=>r.updateState(i,t,n,o))}$appendOutputToRun(e,t,i,n,o){const r=n&&{uri:N.revive(n.uri),range:F.lift(n.range)};this.withLiveRun(e,a=>a.appendOutput(i,t,r,o))}$appendTestMessagesInRun(e,t,i,n){const o=this.resultService.getResult(e);if(o&&o instanceof IF)for(const r of n)o.appendMessage(i,t,u$.deserialize(this.uriIdentityService,r))}$registerTestController(e,t,i){const n=new Z,o=jt(`${e}.label`,t),r=jt(`${e}.cap`,i),a={id:e,label:o,capabilities: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),getRelatedCode:(c,l)=>this.proxy.$getCodeRelatedToTest(c,l).then(d=>d.map(h=>({uri:N.revive(h.uri),range:F.lift(h.range)})))};n.add(Ee(()=>this.testProfiles.removeProfile(e))),n.add(this.testService.registerTestController(e,a)),this.testProviderRegistrations.set(e,{instance:a,label:o,capabilities:r,disposable:n})}$updateController(e,t){const i=this.testProviderRegistrations.get(e);i&&ts(n=>{t.label!==void 0&&i.label.set(t.label,n),t.capabilities!==void 0&&i.capabilities.set(t.capabilities,n)})}$unregisterTestController(e){this.testProviderRegistrations.get(e)?.disposable.dispose(),this.testProviderRegistrations.delete(e)}$subscribeToDiffs(){this.proxy.$acceptDiff(this.testService.collection.getReviverDiff().map(IH.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=>IH.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 IF?t(i):void 0}};w3e=D([Gi(Be.MainThreadTesting),_(1,ks),_(2,zJe),_(3,UJe),_(4,VJe)],w3e);let y3e=class extends V{constructor(e,t,i,n){super(),this.secretStorageService=t,this.logService=i,this._sequencer=new blt,this._proxy=e.getProxy(Ye.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),n=await this.secretStorageService.get(i);return this.logService.trace(`[mainThreadSecretState] ${n?"P":"No p"}assword found for: `,e,t),n}$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 n=this.getKey(e,t);await this.secretStorageService.set(n,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)}};y3e=D([Gi(Be.MainThreadSecretState),_(1,oJe),_(2,Ge),_(3,cv)],y3e);let C3e=class{constructor(e,t){this.shareService=t,this.providers=new Map,this.providerDisposables=new Map,this.proxy=e.getProxy(Ye.ExtHostShare)}$registerShareProvider(e,t,i,n,o){const r={id:i,label:n,selector:t,priority:o,provideShare:async c=>{const l=await this.proxy.$provideShare(e,c,He.None);return typeof l=="string"?l:N.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(),bt(this.providerDisposables.values()),this.providerDisposables.clear()}};C3e=D([Gi(Be.MainThreadShare),_(1,RJe)],C3e);let S3e=class extends V{constructor(e,t){super(),this.userDataProfileImportExportService=t,this.registeredHandlers=this._register(new mo),this.proxy=e.getProxy(Ye.ExtHostProfileContentHandlers)}async $registerProfileContentHandler(e,t,i,n){this.registeredHandlers.set(e,this.userDataProfileImportExportService.registerProfileContentHandler(e,{name:t,description:i,extensionId:n,saveProfile:async(o,r,a)=>{const c=await this.proxy.$saveProfile(e,o,r,a);return c?Mo(c):null},readProfile:async(o,r)=>this.proxy.$readProfile(e,o,r)}))}async $unregisterProfileContentHandler(e){this.registeredHandlers.deleteAndDispose(e)}};S3e=D([Gi(Be.MainThreadProfileContentHandlers),_(1,rXe)],S3e);let A3e=class extends V{constructor(e,t){super(),this._aiRelatedInformationService=t,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAiRelatedInformation)}$getAiRelatedInformation(e,t){return this._aiRelatedInformationService.getRelatedInformation(e,t,He.None)}$registerAiRelatedInformationProvider(e,t){const i={provideAiRelatedInformation:(n,o)=>this._proxy.$provideAiRelatedInformation(e,n,o)};this._registrations.set(e,this._aiRelatedInformationService.registerAiRelatedInformationProvider(t,i))}$unregisterAiRelatedInformationProvider(e){this._registrations.deleteAndDispose(e)}};A3e=D([Gi(Be.MainThreadAiRelatedInformation),_(1,GRe)],A3e);let E3e=class extends V{constructor(e,t){super(),this._AiEmbeddingVectorService=t,this._registrations=this._register(new mo),this._proxy=e.getProxy(Ye.ExtHostAiEmbeddingVector)}$registerAiEmbeddingVectorProvider(e,t){const i={provideAiEmbeddingVector:(n,o)=>this._proxy.$provideAiEmbeddingVector(t,n,o)};this._registrations.set(t,this._AiEmbeddingVectorService.registerAiEmbeddingVectorProvider(e,i))}$unregisterAiEmbeddingVectorProvider(e){this._registrations.deleteAndDispose(e)}};E3e=D([Gi(Be.MainThreadAiEmbeddingVector),_(1,KJe)],E3e);let eDe=class extends Eee{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p){super(t,i,n,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()}};eDe=D([_(4,Yi),_(5,yi),_(6,Fs),_(7,Ge),_(8,lf),_(9,cv),_(10,Cm),_(11,Er),_(12,fu),_(13,$i)],eDe);let tDe;function $jt(s){tDe=s}let iDe=class extends EAe{constructor(e,t,i,n,o,r,a,c,l){super(t,i,n,o,r,a,c,l),this.workerConfig=e}createExtensionHost(e,t,i){switch(t.kind){case 1:return tDe==null?null:this._instantiationService.createInstance(tDe,t,1,this._createLocalExtensionHostDataProvider(e,t,i));case 2:{if(this.workerConfig==null)return null;const n=i?2:1;return this._instantiationService.createInstance(eDe,this.workerConfig,t,n,this._createLocalExtensionHostDataProvider(e,t,i))}case 3:return super.createExtensionHost(e,t,i)}}};iDe=D([_(4,we),_(5,cg),_(6,hC),_(7,Ml),_(8,Ge)],iDe);let nDe=class extends xAe{constructor(e,t){super(t),this.allowedExtHostKinds=e}pickExtensionHostKind(e,t,i,n,o){const r=FKt(e.value);if(r!=null)return r;const a=super.pickExtensionHostKind(e,t,i,n,o);return a!=null&&!this.allowedExtHostKinds.includes(a)?this.allowedExtHostKinds[0]??null:a}};nDe=D([_(1,Ge)],nDe);let sDe=class extends AAe{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k){const P=t.createInstance(pAe),R=new iDe(e,P,async()=>this._scanWebExtensions(),()=>this._getExtensionRegistrySnapshotWhenReady(),t,m,w,r,p);super(P,R,new nDe(e!=null?[2,1,3]:[1,3],p),t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b,w,y,C,A,L,k)}async deltaExtensions(e,t){await this._handleDeltaExtensions(new w0(e,t))}};sDe=D([_(1,we),_(2,bi),_(3,cv),_(4,Yi),_(5,Ml),_(6,Jt),_(7,Er),_(8,L6),_(9,yi),_(10,Te),_(11,xm),_(12,QRe),_(13,Ge),_(14,cg),_(15,Nae),_(16,Zu),_(17,hC),_(18,Jae),_(19,lg),_(20,cC),_(21,Qae),_(22,to)],sDe);class Gjt extends DAe{async readExtensionResource(e){return e.scheme===lee.extensionFile?(await this._fileService.readFile(e)).value.toString():super.readExtensionResource(e)}}a9t({"vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html":()=>r9t(new URL(""+new URL("webWorkerExtensionHostIframe-gIqsUtfW.html",import.meta.url).href,import.meta.url).href)});function Kjt(s,e){return{[fs.toString()]:new wi(sDe,[void 0],!1),[xm.toString()]:new wi(fAe,[],!0),[Rae.toString()]:new wi(Gjt,[],!0),[NU.toString()]:new wi(IAe,[],!0)}}const x3e=/^([^.]+\..+)[:=](.+)$/;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=>!x3e.test(t)):this.options.developmentOptions?.logLevel!==void 0?n3(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 n=x3e.exec(i);n&&n[1]&&n[2]&&t.push([n[1],n[2]])}return t.length?t:void 0}return this.options.developmentOptions?.extensionLogLevel!==void 0?this.options.developmentOptions?.extensionLogLevel.map(([t,i])=>[t,n3(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 Pt(this.windowLogsPath,"window.log")}get userRoamingDataHome(){return N.file("/User").with({scheme:pe.vscodeUserData})}get argvResource(){return Pt(this.userRoamingDataHome,"argv.json")}get cacheHome(){return Pt(this.userRoamingDataHome,"caches")}get workspaceStorageHome(){return Pt(this.userRoamingDataHome,"workspaceStorage")}get localHistoryHome(){return Pt(this.userRoamingDataHome,"History")}get stateResource(){return Pt(this.userRoamingDataHome,"State","storage.json")}get userDataSyncHome(){return Pt(this.userRoamingDataHome,"sync",this.workspaceId)}get sync(){}get keyboardLayoutResource(){return Pt(this.userRoamingDataHome,"keyboardLayout.json")}get untitledWorkspacesHome(){return Pt(this.userRoamingDataHome,"Workspaces")}get serviceMachineIdResource(){return Pt(this.userRoamingDataHome,"machineid")}get extHostLogsPath(){return Pt(this.logsHome,"exthost")}get extHostTelemetryLogFile(){return Pt(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 Pt(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,n){if(this.workspaceId=e,this.logsHome=t,this.options=i,this.productService=n,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){vt(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,n]of this.payload)switch(i){case"extensionDevelopmentPath":e.extensionDevelopmentLocationURI||(e.extensionDevelopmentLocationURI=[]),e.extensionDevelopmentLocationURI.push(N.parse(n)),e.isExtensionDevelopment=!0;break;case"extensionDevelopmentKind":e.extensionDevelopmentKind=[n];break;case"extensionTestsPath":e.extensionTestsLocationURI=N.parse(n);break;case"debugRenderer":e.debugRenderer=n==="true";break;case"debugId":e.params.debugId=n;break;case"inspect-brk-extensions":e.params.port=parseInt(n),e.params.break=!0;break;case"inspect-extensions":e.params.port=parseInt(n);break;case"enableProposedApi":e.extensionEnabledProposedApi=[];break}const t=this.options.developmentOptions;return t&&!e.isExtensionDevelopment&&(t.extensions?.length&&(e.extensionDevelopmentLocationURI=t.extensions.map(i=>N.revive(i)),e.isExtensionDevelopment=!0),t.extensionTestsPath&&(e.extensionTestsLocationURI=N.revive(t.extensionTestsPath))),e}get filesToOpenOrCreate(){if(this.payload){const e=this.payload.get("openFile");if(e){const t=N.parse(e);if(this.payload.has("gotoLineMode")){const i=mGe(t.path);return[{fileUri:t.with({path:i.path}),options:{selection:Ya(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:N.parse(t)},{fileUri:N.parse(e)}]}}get filesToMerge(){if(this.payload){const e=this.payload.get("mergeFile1"),t=this.payload.get("mergeFile2"),i=this.payload.get("mergeFileBase"),n=this.payload.get("mergeFileResult");if(e&&t&&i&&n)return[{fileUri:N.parse(e)},{fileUri:N.parse(t)},{fileUri:N.parse(i)},{fileUri:N.parse(n)}]}}}Yt.__decorator=D([Zt],Yt.prototype,"remoteAuthority",null);Yt.__decorator=D([Zt],Yt.prototype,"expectsResolverExtension",null);Yt.__decorator=D([Zt],Yt.prototype,"isBuilt",null);Yt.__decorator=D([Zt],Yt.prototype,"logLevel",null);Yt.__decorator=D([Zt],Yt.prototype,"windowLogsPath",null);Yt.__decorator=D([Zt],Yt.prototype,"logFile",null);Yt.__decorator=D([Zt],Yt.prototype,"userRoamingDataHome",null);Yt.__decorator=D([Zt],Yt.prototype,"argvResource",null);Yt.__decorator=D([Zt],Yt.prototype,"cacheHome",null);Yt.__decorator=D([Zt],Yt.prototype,"workspaceStorageHome",null);Yt.__decorator=D([Zt],Yt.prototype,"localHistoryHome",null);Yt.__decorator=D([Zt],Yt.prototype,"stateResource",null);Yt.__decorator=D([Zt],Yt.prototype,"userDataSyncHome",null);Yt.__decorator=D([Zt],Yt.prototype,"sync",null);Yt.__decorator=D([Zt],Yt.prototype,"keyboardLayoutResource",null);Yt.__decorator=D([Zt],Yt.prototype,"untitledWorkspacesHome",null);Yt.__decorator=D([Zt],Yt.prototype,"serviceMachineIdResource",null);Yt.__decorator=D([Zt],Yt.prototype,"extHostLogsPath",null);Yt.__decorator=D([Zt],Yt.prototype,"extHostTelemetryLogFile",null);Yt.__decorator=D([Zt],Yt.prototype,"debugExtensionHost",null);Yt.__decorator=D([Zt],Yt.prototype,"isExtensionDevelopment",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionDevelopmentLocationURI",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionDevelopmentLocationKind",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionTestsLocationURI",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionEnabledProposedApi",null);Yt.__decorator=D([Zt],Yt.prototype,"debugRenderer",null);Yt.__decorator=D([Zt],Yt.prototype,"enableSmokeTestDriver",null);Yt.__decorator=D([Zt],Yt.prototype,"disableExtensions",null);Yt.__decorator=D([Zt],Yt.prototype,"enableExtensions",null);Yt.__decorator=D([Zt],Yt.prototype,"webviewExternalEndpoint",null);Yt.__decorator=D([Zt],Yt.prototype,"extensionTelemetryLogResource",null);Yt.__decorator=D([Zt],Yt.prototype,"disableTelemetry",null);Yt.__decorator=D([Zt],Yt.prototype,"verbose",null);Yt.__decorator=D([Zt],Yt.prototype,"logExtensionHostCommunication",null);Yt.__decorator=D([Zt],Yt.prototype,"skipReleaseNotes",null);Yt.__decorator=D([Zt],Yt.prototype,"skipWelcome",null);Yt.__decorator=D([Zt],Yt.prototype,"disableWorkspaceTrust",null);Yt.__decorator=D([Zt],Yt.prototype,"lastActiveProfile",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToOpenOrCreate",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToDiff",null);Yt.__decorator=D([Zt],Yt.prototype,"filesToMerge",null);let oDe=class extends Yt{constructor(e=tNe().id,t=t4t(),i){super(e,ttt,t,i)}};oDe=D([_(2,Er)],oDe);function qjt(s){return{[Za.toString()]:new wi(oDe,[void 0,s],!0)}}class lst extends V{constructor(e=e4t()){super(),this.mainContainer=e,this.onDidChangeMainEditorCenteredLayout=M.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=M.None,this.onDidChangeZenMode=M.None,this.onDidChangeWindowMaximized=M.None,this.onDidChangeCenteredLayout=M.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=M.None,this.onDidChangeNotificationsVisibility=M.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=Qn?"windows":pr?"linux":"mac",i=Fi(["monaco-workbench",t,"web",R1e?"chromium":E6e?"firefox":x6e?"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(Bu())}get containers(){const e=[];for(const{window:t}of A8())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(Po),this.paneCompositeService=e.get(Dm),this.statusBarService=e.get(FRe),this.viewDescriptorService=e.get(Sm),this.configurationService=e.get(Te),this.auxiliaryWindowService=e.get(YJe),this.hostService=e.get(xc),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(IK(this.configurationService.getValue("workbench.sideBar.location")??"left")),t.affectsConfiguration("workbench.panel.defaultLocation")&&this.setPanelPosition(IK(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=IK(this.configurationService.getValue("workbench.sideBar.location")??"left"),this.panelPosition=IK(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(n=>this.handleContainerDidLayout(t.container,n))),i.add(Ee(()=>this._onDidRemoveContainer.fire(t.container)))}))}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),_dt(e)&&this._onDidLayoutActiveContainer.fire(t)}getActiveContainerId(){const e=this.activeContainer;return ct(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=JUt(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=XMe(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(N1(e))}getPanelAlignment(){return"left"}setPanelAlignment(){}toggleZenMode(){}isEditorLayoutCentered(){return!1}centerEditorLayout(){}resizePart(){}isWindowMaximized(){return!1}updateWindowMaximizedState(){}getVisibleNeighborPart(){}getMaximumEditorDimensions(){return new bn(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&&pdt(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 n=this.paneCompositeService.getActivePaneComposite(i);if(n!=null&&e)this.paneCompositeService.hideActivePaneComposite(i);else if(n==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"),n=this.getPart("workbench.parts.auxiliarybar");t?.updateStyles(),i?.updateStyles(),n?.updateStyles(),this._onDidChangeSideBarPosition.fire(N1(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:H_(e)}layout(){this._mainContainerDimension=H_(window.document.body),this._onDidLayout.fire(this._mainContainerDimension)}get hasContainer(){return!0}focus(){const e=this.activeContainer;if(e===this.mainContainer){const t=Dt.get(Kt).getFocusedCodeEditor();t instanceof Gk?t.focus():this.focusPart("workbench.parts.editor")}else this.editorGroupService.getPart(e).activeGroup.focus()}}stt(s=>{const e=s.get(fu);e instanceof lst&&e.init(s)});function Qjt(s){return{[fu.toString()]:new wi(lst,[s],!0)}}var zm;(function(s){s[s.Unknown=1]="Unknown",s[s.Keyboard=2]="Keyboard",s[s.Api=3]="Api"})(zm||(zm={}));let VA=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u){super(),this.layoutService=e,this.configurationService=t,this.fileService=i,this.labelService=n,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=zm.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(ub.getInstance().event(()=>this.updateShutdownReasonFromEvent()))}onBeforeShutdown(e){switch(this.shutdownReason){case zm.Unknown:case zm.Keyboard:{const t=this.configurationService.getValue("window.confirmBeforeClose");(t==="always"||t==="keyboardOnly"&&this.shutdownReason===zm.Keyboard)&&e.veto(!0,"veto.confirmBeforeClose");break}}this.shutdownReason=zm.Unknown}updateShutdownReasonFromEvent(){this.shutdownReason!==zm.Api&&(ub.getInstance().isModifierPressed?this.shutdownReason=zm.Keyboard:this.shutdownReason=zm.Unknown)}get onDidChangeFocus(){const e=this._register(new I);return this._register(M.runAndSubscribe(Xp,({window:t,disposables:i})=>{const n=i.add(Ac(t)),o=i.add(new ii(t.document,"visibilitychange"));M.any(M.map(n.onDidFocus,()=>this.hasFocus,i),M.map(n.onDidBlur,()=>this.hasFocus,i),M.map(o.event,()=>this.hasFocus,i),M.map(this.onDidChangeActiveWindow,()=>this.hasFocus,i))(r=>e.fire(r))},{window:si,disposables:this._store})),M.latch(e.event,void 0,this._store)}get hasFocus(){return Bu().hasFocus()}async hadLastFocus(){return!0}async focus(e){e.focus()}get onDidChangeActiveWindow(){const e=this._register(new I);return this._register(M.runAndSubscribe(Xp,({window:t,disposables:i})=>{const n=R2(t),o=i.add(Ac(t));i.add(o.onDidFocus(()=>e.fire(n))),Gct(t)&&i.add(odt(t,()=>{const r=t.document.hasFocus();return r&&e.fire(n),r},100,20))},{window:si,disposables:this._store})),M.latch(e.event,void 0,this._store)}get onDidChangeFullScreen(){const e=this._register(new I);return this._register(M.runAndSubscribe(Xp,({window:t,disposables:i})=>{const n=R2(t),o=am&&t.visualViewport?t.visualViewport:t,r=()=>{const a=Mdt(t);return a!==null&&!a.guess};for(const a of[ke.FULLSCREEN_CHANGE,ke.WK_FULLSCREEN_CHANGE])i.add(ue(t.document,a,()=>e.fire({windowId:n,fullscreen:r()})));i.add(ldt(o,ke.RESIZE,()=>e.fire({windowId:n,fullscreen:r()}),void 0,Qt?2e3:800))},{window:si,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),n=[],o=[];for(const r of e)r.label=r.label||this.getRecentLabel(r),pQ(r)?t?.addMode?o.push({uri:r.folderUri}):this.doOpen({folderUri:r.folderUri},{reuse:this.shouldReuse(t,!1),payload:i}):Wye(r)?this.doOpen({workspaceUri:r.workspaceUri},{reuse:this.shouldReuse(t,!1),payload:i}):YUt(r)&&n.push(r);o.length>0&&this.withServices(r=>{r.get(Zy).addFolders(o)}),n.length>0&&this.withServices(async r=>{const a=r.get(ei);if(t?.mergeMode&&n.length===4){const l=Fi(await Nhe(n,this.fileService,this.logService));if(l.length!==4||!Gv(l[0])||!Gv(l[1])||!Gv(l[2])||!Gv(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&&n.length===2){const l=Fi(await Nhe(n,this.fileService,this.logService));if(l.length!==2||!Gv(l[0])||!Gv(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 n)if(this.shouldReuse(t,!0)){let d=[];if(t?.gotoLineMode){const h=mGe(l.fileUri.path);d=[{fileUri:l.fileUri.with({path:h.path}),options:{selection:Ya(h.line)?void 0:{startLineNumber:h.line,startColumn:h.column||1}}}]}else d=[l];a.openEditors(Fi(await Nhe(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=>s5t(l,n.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"),n=(i?.newWindowProfile?this.userDataProfilesService.profiles.find(o=>o.name===i.newWindowProfile):void 0)??this.userDataProfileService.currentProfile;return n.isDefault||t.push(["lastActiveProfile",n.id]),t.length?t:void 0}getRecentLabel(e){return pQ(e)?this.labelService.getWorkspaceLabel(e.folderUri,{verbose:Np.LONG}):Wye(e)?this.labelService.getWorkspaceLabel(ZMe(e.workspaceUri),{verbose:Np.LONG}):this.labelService.getUriLabel(e.fileUri)}shouldReuse(e=Object.create(null),t){if(e.waitMarkerFileURI)return!0;const i=this.configurationService.getValue("window"),n=t?i?.openFilesInNewWindow||"off":i?.openFoldersInNewWindow||"default";let o=(e.preferNewWindow||!!e.forceNewWindow)&&!e.forceReuseWindow;return!e.forceNewWindow&&!e.forceReuseWindow&&(n==="on"||n==="off")&&(o=n==="on"),!o}async doOpenEmptyWindow(e){return this.doOpen(void 0,{reuse:e?.forceReuseWindow,payload:this.preservePayload(!0)})}async doOpen(e,t){if(e&&pQ(e)&&e.folderUri.scheme===pe.file&&Ry(this.contextService.getWorkspace())){this.withServices(async n=>{await n.get(Zy).updateFolders(0,this.contextService.getWorkspace().folders.length,[{uri:e.folderUri}])});return}if(t?.reuse&&await this.handleExpectedShutdown(rD.LOAD),!await this.workspaceProvider.open(e,t)){const{confirmed:n}=await this.dialogService.confirm({type:Xe.Warning,message:g(790,"The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),primaryButton:g(791,"&&Open")});n&&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(rD.RELOAD),si.location.reload()}async close(){await this.handleExpectedShutdown(rD.CLOSE),si.close()}async withExpectedShutdown(e){const t=this.shutdownReason;try{return this.shutdownReason=zm.Api,await e()}finally{this.shutdownReason=t}}async handleExpectedShutdown(e){return this.shutdownReason=zm.Api,this.lifecycleService.withExpectedShutdown(e)}getPathForFile(){}};VA.__decorator=D([Zt],VA.prototype,"onDidChangeFocus",null);VA.__decorator=D([Zt],VA.prototype,"onDidChangeActiveWindow",null);VA.__decorator=D([Zt],VA.prototype,"onDidChangeFullScreen",null);VA=D([_(0,fu),_(1,Te),_(2,Jt),_(3,Fs),_(4,cv),_(5,we),_(6,Zu),_(7,Ge),_(8,to),_(9,yi),_(10,lg),_(11,Cm)],VA);class jjt extends V{constructor(){super(),this._onDidSchemeChangeEvent=this._register(new I),this.registerListeners()}registerListeners(){Fj(si,"(prefers-color-scheme: dark)",()=>{this._onDidSchemeChangeEvent.fire()}),Fj(si,"(forced-colors: active)",()=>{this._onDidSchemeChangeEvent.fire()})}get onDidChangeColorScheme(){return this._onDidSchemeChangeEvent.event}get dark(){return si.matchMedia("(prefers-color-scheme: light)").matches?!1:!!si.matchMedia("(prefers-color-scheme: dark)").matches}get highContrast(){return!!si.matchMedia("(forced-colors: active)").matches}}function Yjt(){return{[xc.toString()]:new wi(VA,[],!0),[sXe.toString()]:new wi(jjt,[],!0)}}function Jjt(s,e,t){let i,n,o,r,a;if(e){for(r=e.offset,a=r+e.length,o=r;o>0&&!Mie(s,o-1);)o--;let y=a;for(;yr&&s.substring(C,A)!==y&&v.push({offset:C,length:A-C,content:y})}let w=m();if(w!==ft.EOF){const y=u.getTokenOffset()+o,C=Lue(h,i);b(C,o,y)}for(;w!==ft.EOF;){let y=u.getTokenOffset()+u.getTokenLength()+o,C=m(),A="";for(;!l&&(C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia);){const k=u.getTokenOffset()+o;b(" ",y,k),y=u.getTokenOffset()+u.getTokenLength()+o,A=C===ft.LineCommentTrivia?p():"",C=m()}if(C===ft.CloseBraceToken)w!==ft.OpenBraceToken&&(d--,A=p());else if(C===ft.CloseBracketToken)w!==ft.OpenBracketToken&&(d--,A=p());else{switch(w){case ft.OpenBracketToken:case ft.OpenBraceToken:d++,A=p();break;case ft.CommaToken:case ft.LineCommentTrivia:A=p();break;case ft.BlockCommentTrivia:l?A=p():A=" ";break;case ft.ColonToken:A=" ";break;case ft.StringLiteral:if(C===ft.ColonToken){A="";break}case ft.NullKeyword:case ft.TrueKeyword:case ft.FalseKeyword:case ft.NumericLiteral:case ft.CloseBraceToken:case ft.CloseBracketToken:C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia?A=" ":C!==ft.CommaToken&&C!==ft.EOF&&(f=!0);break;case ft.Unknown:f=!0;break}l&&(C===ft.LineCommentTrivia||C===ft.BlockCommentTrivia)&&(A=p())}const L=u.getTokenOffset()+o;b(A,y,L),w=C}return v}function Lue(s,e){let t="";for(let i=0;i0&&(l=o.pop(),c=jme(a,o),c===void 0&&t!==void 0);)typeof l=="string"?t={[l]:t}:t=[t];if(c)if(c.type==="object"&&typeof l=="string"&&Array.isArray(c.children)){const d=jme(c,[l]);if(d!==void 0)if(t===void 0){if(!d.parent)throw new Error("Malformed AST");const h=c.children.indexOf(d.parent);let u,f=d.parent.offset+d.parent.length;if(h>0){const p=c.children[h-1];u=p.offset+p.length}else u=c.offset+1,c.children.length>1&&(f=c.children[1].offset);return yP(s,{offset:u,length:f-u,content:""},i)}else return yP(s,{offset:d.offset,length:d.length,content:JSON.stringify(t)},i);else{if(t===void 0)return[];const h=`${JSON.stringify(l)}: ${JSON.stringify(t)}`,u=c.children.length;let f;if(u>0){const p=c.children[u-1];f={offset:p.offset+p.length,length:0,content:","+h}}else c.children.length===0?f={offset:c.offset+1,length:0,content:h}:f={offset:c.offset+1,length:0,content:h+","};return yP(s,f,i)}}else if(c.type==="array"&&typeof l=="number"&&Array.isArray(c.children))if(t!==void 0){const d=`${JSON.stringify(t)}`;let h;if(c.children.length===0||l===0)h={offset:c.offset+1,length:0,content:c.children.length===0?d:d+","};else{const u=l===-1||l>c.children.length?c.children.length:l,f=c.children[u-1];h={offset:f.offset+f.length,length:0,content:","+d}}return yP(s,h,i)}else{const d=l,h=c.children[d];let u;if(c.children.length===1)u={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===d){const f=c.children[d-1],p=f.offset+f.length,m=c.offset+c.length;u={offset:p,length:m-2-p,content:""}}else u={offset:h.offset,length:c.children[d+1].offset-h.offset,content:""};return yP(s,u,i)}else throw new Error(`Can not add ${typeof l!="number"?"index":"property"} to parent of type ${c.type}`);else return t===void 0?[]:yP(s,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(t)},i)}function yP(s,e,t){let i=uDe(s,e),n=e.offset,o=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;n>0&&!Pie(i,n-1);)n--;for(;o=0;c--){const l=r[c];i=uDe(i,l),n=Math.min(n,l.offset),o=Math.max(o,l.offset+l.length),o+=l.content.length-l.length}const a=s.length-(i.length-o)-n;return[{offset:n,length:a,content:i.substring(n,o)}]}function uDe(s,e){return s.substring(0,e.offset)+e.content+s.substring(e.offset+e.length)}function W3e(s,e){const t=e.slice(0).sort((n,o)=>{const r=n.offset-o.offset;return r===0?n.length-o.length:r});let i=s.length;for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.offset+o.length<=i)s=uDe(s,o);else throw new Error("Overlapping edit");i=o.offset}return s}var V$;(function(s){s[s.ERROR_INVALID_FILE=0]="ERROR_INVALID_FILE"})(V$||(V$={}));class uYt extends Error{constructor(e,t){super(e),this.code=t}}let gDe=class{constructor(e,t,i){this.fileService=e,this.textModelResolverService=t,this.textFileService=i,this.queue=new bI}write(e,t){return Promise.resolve(this.queue.queue(()=>this.doWriteConfiguration(e,t)))}async doWriteConfiguration(e,t){const i=await this.resolveAndValidate(e,!0);try{await this.writeToBuffer(i.object.textEditorModel,t)}finally{i.dispose()}}async writeToBuffer(e,t){let i=!1;for(const n of t){const o=this.getEdits(e,n)[0];i=!!o&&this.applyEditsToBuffer(o,e)}if(i)return this.textFileService.save(e.uri)}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),o=new F(i.lineNumber,i.column,n.lineNumber,n.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?Zn.replace(o,e.content):Zn.insert(i,e.content);return t.pushEditOperations([new dt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits(e,t){const{tabSize:i,insertSpaces:n}=e.getOptions(),o=e.getEOL(),{path:r,value:a}=t;if(!r.length){const c=JSON.stringify(a,null,n?" ".repeat(i):" ");return[{content:c,length:c.length,offset:0}]}return Xce(e.getValue(),r,a,{tabSize:i,insertSpaces:n,eol:o})}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,"{}",{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e){const t=[];return sf(e.getValue(),t,{allowTrailingComma:!0,allowEmptyContent:!0}),t.length>0}async resolveAndValidate(e,t){const i=await this.resolveModelReference(e),n=i.object.textEditorModel;return this.hasParseErrors(n)?(i.dispose(),this.reject(V$.ERROR_INVALID_FILE)):i}reject(e){const t=this.toErrorMessage(e);return Promise.reject(new uYt(t,e))}toErrorMessage(e){switch(e){case V$.ERROR_INVALID_FILE:return g(856,"Unable to write into the file. Please open the file to correct errors/warnings in the file and try again.")}}};gDe=D([_(0,Jt),_(1,fn),_(2,Fo)],gDe);const jE=class jE{static keyOf(e){if(Array.isArray(e))return e.map(jE.keyOf).join(",");{const{color:t,letter:i}=e;return We.isThemeIcon(i)?`${t}+${i.id}`:`${t}/${i}`}}constructor(e,t,i){this.themeService=e,this._refCounter=0,this.data=t;const n=Wc(i).toString(36);this.itemColorClassName=`${jE._classNamesPrefix}-itemColor-${n}`,this.itemBadgeClassName=`${jE._classNamesPrefix}-itemBadge-${n}`,this.bubbleBadgeClassName=`${jE._classNamesPrefix}-bubbleBadge-${n}`,this.iconBadgeClassName=`${jE._classNamesPrefix}-iconBadge-${n}`}acquire(){this._refCounter+=1}release(){return--this._refCounter===0}appendCSSRules(e){Array.isArray(this.data)?this._appendForMany(this.data,e):this._appendForOne(this.data,e)}_appendForOne(e,t){const{color:i,letter:n}=e;Uf(`.${this.itemColorClassName}`,`color: ${KI(i)};`,t),We.isThemeIcon(n)?this._createIconCSSRule(n,i,t):n&&Uf(`.${this.itemBadgeClassName}::after`,`content: "${n}"; color: ${KI(i)};`,t)}_appendForMany(e,t){const{color:i}=e.find(r=>!!r.color)??e[0];Uf(`.${this.itemColorClassName}`,`color: ${KI(i)};`,t);const n=[];let o;for(const r of e)if(We.isThemeIcon(r.letter)){o=r.letter;break}else r.letter&&n.push(r.letter);o?this._createIconCSSRule(o,i,t):(n.length&&Uf(`.${this.itemBadgeClassName}::after`,`content: "${n.join(", ")}"; color: ${KI(i)};`,t),Uf(`.${this.bubbleBadgeClassName}::after`,`content: ""; color: ${KI(i)}; font-family: codicon; font-size: 14px; margin-right: 14px; opacity: 0.4;`,t))}_createIconCSSRule(e,t,i){const n=We.getModifier(e);n&&(e=We.modify(e,void 0));const o=mRe().getIcon(e.id);if(!o)return;const r=this.themeService.getProductIconTheme().getIcon(o);r&&Uf(`.${this.iconBadgeClassName}::after`,`content: '${r.fontCharacter}'; - color: ${e.color?KI(e.color.id):KI(t)}; - font-family: ${mq(r.font?.id??"codicon")}; +`}function Mie(s,e){return`\r +`.indexOf(s.charAt(e))!==-1}function eYt(s,e,t){return Qce(s,e,void 0,t)}function Qce(s,e,t,i,n){const o=e.slice(),a=wLe(s,[]);let c,l;for(;o.length>0&&(l=o.pop(),c=zme(a,o),c===void 0&&t!==void 0);)typeof l=="string"?t={[l]:t}:t=[t];if(c)if(c.type==="object"&&typeof l=="string"&&Array.isArray(c.children)){const d=zme(c,[l]);if(d!==void 0)if(t===void 0){if(!d.parent)throw new Error("Malformed AST");const h=c.children.indexOf(d.parent);let u,f=d.parent.offset+d.parent.length;if(h>0){const p=c.children[h-1];u=p.offset+p.length}else u=c.offset+1,c.children.length>1&&(f=c.children[1].offset);return vP(s,{offset:u,length:f-u,content:""},i)}else return vP(s,{offset:d.offset,length:d.length,content:JSON.stringify(t)},i);else{if(t===void 0)return[];const h=`${JSON.stringify(l)}: ${JSON.stringify(t)}`,u=c.children.length;let f;if(u>0){const p=c.children[u-1];f={offset:p.offset+p.length,length:0,content:","+h}}else c.children.length===0?f={offset:c.offset+1,length:0,content:h}:f={offset:c.offset+1,length:0,content:h+","};return vP(s,f,i)}}else if(c.type==="array"&&typeof l=="number"&&Array.isArray(c.children))if(t!==void 0){const d=`${JSON.stringify(t)}`;let h;if(c.children.length===0||l===0)h={offset:c.offset+1,length:0,content:c.children.length===0?d:d+","};else{const u=l===-1||l>c.children.length?c.children.length:l,f=c.children[u-1];h={offset:f.offset+f.length,length:0,content:","+d}}return vP(s,h,i)}else{const d=l,h=c.children[d];let u;if(c.children.length===1)u={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===d){const f=c.children[d-1],p=f.offset+f.length,m=c.offset+c.length;u={offset:p,length:m-2-p,content:""}}else u={offset:h.offset,length:c.children[d+1].offset-h.offset,content:""};return vP(s,u,i)}else throw new Error(`Can not add ${typeof l!="number"?"index":"property"} to parent of type ${c.type}`);else return t===void 0?[]:vP(s,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(t)},i)}function vP(s,e,t){let i=rDe(s,e),n=e.offset,o=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;n>0&&!Mie(i,n-1);)n--;for(;o=0;c--){const l=r[c];i=rDe(i,l),n=Math.min(n,l.offset),o=Math.max(o,l.offset+l.length),o+=l.content.length-l.length}const a=s.length-(i.length-o)-n;return[{offset:n,length:a,content:i.substring(n,o)}]}function rDe(s,e){return s.substring(0,e.offset)+e.content+s.substring(e.offset+e.length)}function D3e(s,e){const t=e.slice(0).sort((n,o)=>{const r=n.offset-o.offset;return r===0?n.length-o.length:r});let i=s.length;for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.offset+o.length<=i)s=rDe(s,o);else throw new Error("Overlapping edit");i=o.offset}return s}var W$;(function(s){s[s.ERROR_INVALID_FILE=0]="ERROR_INVALID_FILE"})(W$||(W$={}));class tYt extends Error{constructor(e,t){super(e),this.code=t}}let aDe=class{constructor(e,t,i){this.fileService=e,this.textModelResolverService=t,this.textFileService=i,this.queue=new gI}write(e,t){return Promise.resolve(this.queue.queue(()=>this.doWriteConfiguration(e,t)))}async doWriteConfiguration(e,t){const i=await this.resolveAndValidate(e,!0);try{await this.writeToBuffer(i.object.textEditorModel,t)}finally{i.dispose()}}async writeToBuffer(e,t){let i=!1;for(const n of t){const o=this.getEdits(e,n)[0];i=!!o&&this.applyEditsToBuffer(o,e)}if(i)return this.textFileService.save(e.uri)}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),o=new F(i.lineNumber,i.column,n.lineNumber,n.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?Zn.replace(o,e.content):Zn.insert(i,e.content);return t.pushEditOperations([new dt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits(e,t){const{tabSize:i,insertSpaces:n}=e.getOptions(),o=e.getEOL(),{path:r,value:a}=t;if(!r.length){const c=JSON.stringify(a,null,n?" ".repeat(i):" ");return[{content:c,length:c.length,offset:0}]}return Qce(e.getValue(),r,a,{tabSize:i,insertSpaces:n,eol:o})}async resolveModelReference(e){return await this.fileService.exists(e)||await this.textFileService.write(e,"{}",{encoding:"utf8"}),this.textModelResolverService.createModelReference(e)}hasParseErrors(e){const t=[];return ef(e.getValue(),t,{allowTrailingComma:!0,allowEmptyContent:!0}),t.length>0}async resolveAndValidate(e,t){const i=await this.resolveModelReference(e),n=i.object.textEditorModel;return this.hasParseErrors(n)?(i.dispose(),this.reject(W$.ERROR_INVALID_FILE)):i}reject(e){const t=this.toErrorMessage(e);return Promise.reject(new tYt(t,e))}toErrorMessage(e){switch(e){case W$.ERROR_INVALID_FILE:return g(856,"Unable to write into the file. Please open the file to correct errors/warnings in the file and try again.")}}};aDe=D([_(0,Jt),_(1,fn),_(2,Fo)],aDe);const KE=class KE{static keyOf(e){if(Array.isArray(e))return e.map(KE.keyOf).join(",");{const{color:t,letter:i}=e;return We.isThemeIcon(i)?`${t}+${i.id}`:`${t}/${i}`}}constructor(e,t,i){this.themeService=e,this._refCounter=0,this.data=t;const n=Wc(i).toString(36);this.itemColorClassName=`${KE._classNamesPrefix}-itemColor-${n}`,this.itemBadgeClassName=`${KE._classNamesPrefix}-itemBadge-${n}`,this.bubbleBadgeClassName=`${KE._classNamesPrefix}-bubbleBadge-${n}`,this.iconBadgeClassName=`${KE._classNamesPrefix}-iconBadge-${n}`}acquire(){this._refCounter+=1}release(){return--this._refCounter===0}appendCSSRules(e){Array.isArray(this.data)?this._appendForMany(this.data,e):this._appendForOne(this.data,e)}_appendForOne(e,t){const{color:i,letter:n}=e;Bf(`.${this.itemColorClassName}`,`color: ${HI(i)};`,t),We.isThemeIcon(n)?this._createIconCSSRule(n,i,t):n&&Bf(`.${this.itemBadgeClassName}::after`,`content: "${n}"; color: ${HI(i)};`,t)}_appendForMany(e,t){const{color:i}=e.find(r=>!!r.color)??e[0];Bf(`.${this.itemColorClassName}`,`color: ${HI(i)};`,t);const n=[];let o;for(const r of e)if(We.isThemeIcon(r.letter)){o=r.letter;break}else r.letter&&n.push(r.letter);o?this._createIconCSSRule(o,i,t):(n.length&&Bf(`.${this.itemBadgeClassName}::after`,`content: "${n.join(", ")}"; color: ${HI(i)};`,t),Bf(`.${this.bubbleBadgeClassName}::after`,`content: ""; color: ${HI(i)}; font-family: codicon; font-size: 14px; margin-right: 14px; opacity: 0.4;`,t))}_createIconCSSRule(e,t,i){const n=We.getModifier(e);n&&(e=We.modify(e,void 0));const o=sRe().getIcon(e.id);if(!o)return;const r=this.themeService.getProductIconTheme().getIcon(o);r&&Bf(`.${this.iconBadgeClassName}::after`,`content: '${r.fontCharacter}'; + color: ${e.color?HI(e.color.id):HI(t)}; + font-family: ${fq(r.font?.id??"codicon")}; font-size: 16px; margin-right: 14px; font-weight: normal; ${n==="spin"?"animation: codicon-spin 1.5s steps(30) infinite":""}; - `,i)}removeCSSRules(e){CS(this.itemColorClassName,e),CS(this.itemBadgeClassName,e),CS(this.bubbleBadgeClassName,e),CS(this.iconBadgeClassName,e)}};jE._classNamesPrefix="monaco-decoration";let Fie=jE;class gYt{constructor(e){this._themeService=e,this._dispoables=new Z,this._styleElement=gl(void 0,void 0,this._dispoables),this._decorationRules=new Map}dispose(){this._dispoables.dispose()}asDecoration(e,t){e.sort((d,h)=>(h.weight||0)-(d.weight||0));const i=Fie.keyOf(e);let n=this._decorationRules.get(i);n||(n=new Fie(this._themeService,e,i),this._decorationRules.set(i,n),n.appendCSSRules(this._styleElement)),n.acquire();const o=n.itemColorClassName;let r=n.itemBadgeClassName;const a=n.iconBadgeClassName;let c=ja(e.filter(d=>!Gu(d.tooltip)).map(d=>d.tooltip)).join(" • ");const l=e.some(d=>d.strikethrough);return t&&(r=n.bubbleBadgeClassName,c=g(857,"Contains emphasized items")),{labelClassName:o,badgeClassName:r,iconClassName:a,strikethrough:l,tooltip:c,dispose:()=>{n?.release()&&(this._decorationRules.delete(i),n.removeCSSRules(this._styleElement),n=void 0)}}}}class fYt{constructor(e){this._data=Dh.forUris(t=>!0),this._data.fill(!0,H_(e))}affectsResource(e){return this._data.hasElementOrSubtree(e)}}class BK{constructor(e,t){this.source=e,this.thenable=t}}function KI(s){return s?ze(s):"inherit"}let fDe=class{constructor(e,t){this._store=new Z,this._onDidChangeDecorationsDelayed=this._store.add(new Are({merge:i=>i.flat()})),this._onDidChangeDecorations=this._store.add(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._provider=new hl,this._decorationStyles=new gYt(t),this._data=Dh.forUris(i=>e.extUri.ignorePathCasing(i)),this._store.add(this._onDidChangeDecorationsDelayed.event(i=>{this._onDidChangeDecorations.fire(new fYt(i))}))}dispose(){this._store.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)},n=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(),n.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 n=!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 BK)&&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 BK)&&c.bubble&&(i.push(c),n=!0)}return i.length===0?void 0:this._decorationStyles.asDecoration(i,n)}_fetchData(e,t,i){const n=e.get(i);n instanceof BK&&(n.source.cancel(),e.delete(i));const o=new ci,r=i.provideDecorations(t,o.token);if(Qy(r)){const a=new BK(o,Promise.resolve(r).then(c=>{e.get(i)===a&&this._keepItem(e,i,t,c)}).catch(c=>{!Fr(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,n){const o=n||null,r=e.get(t);return e.set(t,o),(o||r)&&this._onDidChangeDecorationsDelayed.fire(i),o}};fDe=D([_(0,ks),_(1,pn)],fDe);class pYt{constructor(e){this.channel=e}async request(e,t){const[i,n]=await this.channel.call("request",[e],t);return{res:i,stream:t6(n)}}async resolveProxy(e){return this.channel.call("resolveProxy",[e])}async lookupAuthorization(e){return this.channel.call("lookupAuthorization",[e])}async lookupKerberosAuthorization(e){return this.channel.call("lookupKerberosAuthorization",[e])}async loadCertificates(){return this.channel.call("loadCertificates")}}const mYt="Offline";class _Yt extends Error{constructor(){super(mYt),this.name=this.message}}async function vYt(s,e){if(e.isCancellationRequested)throw xy();const t=new AbortController,i=e.onCancellationRequested(()=>t.abort()),n=s.timeout?AbortSignal.any([t.signal,AbortSignal.timeout(s.timeout)]):t.signal;try{const o=await fetch(s.url||"",{method:s.type||"GET",headers:bYt(s),body:s.data,signal:n});return{res:{statusCode:o.status,headers:wYt(o)},stream:t6($e.wrap(new Uint8Array(await o.arrayBuffer())))}}catch(o){throw navigator.onLine?o?.name==="AbortError"?xy():o?.name==="TimeoutError"?new Error(`Fetch timeout: ${s.timeout}ms`):o:new _Yt}finally{i.dispose()}}function bYt(s){if(s.headers||s.user||s.password||s.proxyAuthorization){const e=new Headers;e:for(const t in s.headers){switch(t.toLowerCase()){case"user-agent":case"accept-encoding":case"content-length":continue e}const i=s.headers[t];if(typeof i=="string")e.set(t,i);else if(Array.isArray(i))for(const n of i)e.append(t,n)}return(s.user||s.password)&&e.set("Authorization","Basic "+btoa(`${s.user||""}:${s.password||""}`)),s.proxyAuthorization&&e.set("Proxy-Authorization",s.proxyAuthorization),e}}function wYt(s){const e=Object.create(null);return s.headers.forEach((t,i)=>{e[i]?Array.isArray(e[i])?e[i].push(t):e[i]=[e[i],t]:e[i]=t}),e}let pDe=class extends E4t{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,()=>vYt(e,t))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){}async loadCertificates(){return[]}};pDe=D([_(0,Te),_(1,uf)],pDe);let mDe=class extends pDe{constructor(e,t,i){super(t,i),this.remoteAgentService=e}async request(e,t){try{const i=await super.request(e,t),n=this.remoteAgentService.getConnection();return n&&i.res.statusCode===405?this._makeRemoteRequest(n,e,t):i}catch(i){const n=this.remoteAgentService.getConnection();if(n)return this._makeRemoteRequest(n,e,t);throw i}}_makeRemoteRequest(e,t,i){return e.withChannel("request",n=>new pYt(n).request(t,i))}};mDe=D([_(0,hg),_(1,Te),_(2,uf)],mDe);_t.registerCommand("_workbench.fetchJSON",async function(s,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 yYt extends V{constructor(){super(...arguments),this.handlers=new Set}open(e,t){const i=[...this.handlers.values()];return Nre(i.map(n=>()=>n.handleURL(e,t)),void 0,!1).then(n=>n||!1)}registerHandler(e){return this.handlers.add(e),Ee(()=>this.handlers.delete(e))}}class CYt{constructor(e,t){this.urlService=e,this.productService=t}async open(e,t){return t?.openExternal||!AA(e,this.productService.urlProtocol)?!1:(typeof e=="string"&&(e=N.parse(e)),this.urlService.open(e,{trusted:!0}))}}let _De=class extends yYt{constructor(e,t,i){super(),this.provider=e.options?.urlCallbackProvider,this.provider&&this._register(this.provider.onCallback(n=>this.open(n,{trusted:!0}))),this._register(t.registerOpener(new CYt(this,i)))}create(e){return this.provider?this.provider.create(e):N.parse("unsupported://")}};_De=D([_(0,hv),_(1,Ao),_(2,Er)],_De);class SYt{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 n=this._providers.get(e.scheme);if(n)return n.provideCanonicalUri(e,t,i)}}let vDe=class{constructor(e,t){this.requestService=e,this.fileService=t}async download(e,t,i=He.None){if(e.scheme===pe.file||e.scheme===pe.vscodeRemote){await this.fileService.copy(e,t);return}const n={type:"GET",url:e.toString(!0)},o=await this.requestService.request(n,i);if(o.res.statusCode===200)await this.fileService.writeFile(t,o.stream);else{const r=await D4t(o);throw new Error(`Expected 200, got back ${o.res.statusCode} instead. + `,i)}removeCSSRules(e){yS(this.itemColorClassName,e),yS(this.itemBadgeClassName,e),yS(this.bubbleBadgeClassName,e),yS(this.iconBadgeClassName,e)}};KE._classNamesPrefix="monaco-decoration";let Nie=KE;class iYt{constructor(e){this._themeService=e,this._dispoables=new Z,this._styleElement=ul(void 0,void 0,this._dispoables),this._decorationRules=new Map}dispose(){this._dispoables.dispose()}asDecoration(e,t){e.sort((d,h)=>(h.weight||0)-(d.weight||0));const i=Nie.keyOf(e);let n=this._decorationRules.get(i);n||(n=new Nie(this._themeService,e,i),this._decorationRules.set(i,n),n.appendCSSRules(this._styleElement)),n.acquire();const o=n.itemColorClassName;let r=n.itemBadgeClassName;const a=n.iconBadgeClassName;let c=ja(e.filter(d=>!zu(d.tooltip)).map(d=>d.tooltip)).join(" • ");const l=e.some(d=>d.strikethrough);return t&&(r=n.bubbleBadgeClassName,c=g(857,"Contains emphasized items")),{labelClassName:o,badgeClassName:r,iconClassName:a,strikethrough:l,tooltip:c,dispose:()=>{n?.release()&&(this._decorationRules.delete(i),n.removeCSSRules(this._styleElement),n=void 0)}}}}class nYt{constructor(e){this._data=Eh.forUris(t=>!0),this._data.fill(!0,O_(e))}affectsResource(e){return this._data.hasElementOrSubtree(e)}}class PK{constructor(e,t){this.source=e,this.thenable=t}}function HI(s){return s?ze(s):"inherit"}let cDe=class{constructor(e,t){this._store=new Z,this._onDidChangeDecorationsDelayed=this._store.add(new wre({merge:i=>i.flat()})),this._onDidChangeDecorations=this._store.add(new I),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._provider=new dl,this._decorationStyles=new iYt(t),this._data=Eh.forUris(i=>e.extUri.ignorePathCasing(i)),this._store.add(this._onDidChangeDecorationsDelayed.event(i=>{this._onDidChangeDecorations.fire(new nYt(i))}))}dispose(){this._store.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)},n=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(),n.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 n=!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 PK)&&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 PK)&&c.bubble&&(i.push(c),n=!0)}return i.length===0?void 0:this._decorationStyles.asDecoration(i,n)}_fetchData(e,t,i){const n=e.get(i);n instanceof PK&&(n.source.cancel(),e.delete(i));const o=new ci,r=i.provideDecorations(t,o.token);if(Gy(r)){const a=new PK(o,Promise.resolve(r).then(c=>{e.get(i)===a&&this._keepItem(e,i,t,c)}).catch(c=>{!Fr(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,n){const o=n||null,r=e.get(t);return e.set(t,o),(o||r)&&this._onDidChangeDecorationsDelayed.fire(i),o}};cDe=D([_(0,ks),_(1,pn)],cDe);class sYt{constructor(e){this.channel=e}async request(e,t){const[i,n]=await this.channel.call("request",[e],t);return{res:i,stream:J7(n)}}async resolveProxy(e){return this.channel.call("resolveProxy",[e])}async lookupAuthorization(e){return this.channel.call("lookupAuthorization",[e])}async lookupKerberosAuthorization(e){return this.channel.call("lookupKerberosAuthorization",[e])}async loadCertificates(){return this.channel.call("loadCertificates")}}const oYt="Offline";class rYt extends Error{constructor(){super(oYt),this.name=this.message}}async function aYt(s,e){if(e.isCancellationRequested)throw Sy();const t=new AbortController,i=e.onCancellationRequested(()=>t.abort()),n=s.timeout?AbortSignal.any([t.signal,AbortSignal.timeout(s.timeout)]):t.signal;try{const o=await fetch(s.url||"",{method:s.type||"GET",headers:cYt(s),body:s.data,signal:n});return{res:{statusCode:o.status,headers:lYt(o)},stream:J7($e.wrap(new Uint8Array(await o.arrayBuffer())))}}catch(o){throw navigator.onLine?o?.name==="AbortError"?Sy():o?.name==="TimeoutError"?new Error(`Fetch timeout: ${s.timeout}ms`):o:new rYt}finally{i.dispose()}}function cYt(s){if(s.headers||s.user||s.password||s.proxyAuthorization){const e=new Headers;e:for(const t in s.headers){switch(t.toLowerCase()){case"user-agent":case"accept-encoding":case"content-length":continue e}const i=s.headers[t];if(typeof i=="string")e.set(t,i);else if(Array.isArray(i))for(const n of i)e.append(t,n)}return(s.user||s.password)&&e.set("Authorization","Basic "+btoa(`${s.user||""}:${s.password||""}`)),s.proxyAuthorization&&e.set("Proxy-Authorization",s.proxyAuthorization),e}}function lYt(s){const e=Object.create(null);return s.headers.forEach((t,i)=>{e[i]?Array.isArray(e[i])?e[i].push(t):e[i]=[e[i],t]:e[i]=t}),e}let lDe=class extends f4t{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,()=>aYt(e,t))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){}async loadCertificates(){return[]}};lDe=D([_(0,Te),_(1,lf)],lDe);let dDe=class extends lDe{constructor(e,t,i){super(t,i),this.remoteAgentService=e}async request(e,t){try{const i=await super.request(e,t),n=this.remoteAgentService.getConnection();return n&&i.res.statusCode===405?this._makeRemoteRequest(n,e,t):i}catch(i){const n=this.remoteAgentService.getConnection();if(n)return this._makeRemoteRequest(n,e,t);throw i}}_makeRemoteRequest(e,t,i){return e.withChannel("request",n=>new sYt(n).request(t,i))}};dDe=D([_(0,cg),_(1,Te),_(2,lf)],dDe);_t.registerCommand("_workbench.fetchJSON",async function(s,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 dYt extends V{constructor(){super(...arguments),this.handlers=new Set}open(e,t){const i=[...this.handlers.values()];return Tre(i.map(n=>()=>n.handleURL(e,t)),void 0,!1).then(n=>n||!1)}registerHandler(e){return this.handlers.add(e),Ee(()=>this.handlers.delete(e))}}class hYt{constructor(e,t){this.urlService=e,this.productService=t}async open(e,t){return t?.openExternal||!CA(e,this.productService.urlProtocol)?!1:(typeof e=="string"&&(e=N.parse(e)),this.urlService.open(e,{trusted:!0}))}}let hDe=class extends dYt{constructor(e,t,i){super(),this.provider=e.options?.urlCallbackProvider,this.provider&&this._register(this.provider.onCallback(n=>this.open(n,{trusted:!0}))),this._register(t.registerOpener(new hYt(this,i)))}create(e){return this.provider?this.provider.create(e):N.parse("unsupported://")}};hDe=D([_(0,cv),_(1,Ao),_(2,Er)],hDe);class uYt{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 n=this._providers.get(e.scheme);if(n)return n.provideCanonicalUri(e,t,i)}}let uDe=class{constructor(e,t){this.requestService=e,this.fileService=t}async download(e,t,i=He.None){if(e.scheme===pe.file||e.scheme===pe.vscodeRemote){await this.fileService.copy(e,t);return}const n={type:"GET",url:e.toString(!0)},o=await this.requestService.request(n,i);if(o.res.statusCode===200)await this.fileService.writeFile(t,o.stream);else{const r=await m4t(o);throw new Error(`Expected 200, got back ${o.res.statusCode} instead. -${r}`)}}};vDe=D([_(0,I6),_(1,Jt)],vDe);var bDe;let Oie=bDe=class{constructor(e,t,i,n){this.localUserHome=e,this.remoteAgentService=t,this.environmentService=i,this.contextService=n,this.resolveOS=(async()=>(await this.remoteAgentService.getEnvironment())?.os||po)(),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(n=>this.doHasValidBasename(e,n,t)):this.doHasValidBasename(e,t,i)}doHasValidBasename(e,t,i){return e.scheme===pe.file||e.scheme===pe.vscodeRemote?Clt(i??_i(e),t===Ds.Windows):!0}get defaultUriScheme(){return bDe.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return pe.vscodeRemote;const i=Ptt(t.getWorkspace());if(i)return i;const n=t.getWorkspace().folders[0];if(n)return n.uri.scheme;const o=t.getWorkspace().configuration;return o?o.scheme:pe.file}userHome(e){return e?.preferLocal?this.localUserHome:this.resolveUserHome}get resolvedUserHome(){return this.maybeUnresolvedUserHome}get path(){return this.resolveOS.then(e=>e===Ds.Windows?cc:Vi)}async fileURI(e){let t="";if(await this.resolveOS===Ds.Windows&&(e=e.replace(/\\/g,"/")),e[0]==="/"&&e[1]==="/"){const n=e.indexOf("/",2);n===-1?(t=e.substring(2),e="/"):(t=e.substring(2,n),e=e.substring(n)||"/")}return N.from({scheme:pe.file,authority:t,path:e,query:"",fragment:""})}};Oie=bDe=D([_(1,hg),_(2,Jr),_(3,yi)],Oie);function AYt(s,e){const t=e.getWorkspace(),i=lm(t.folders);return i?i.uri:t.configuration?Lr(t.configuration):N.from({scheme:Oie.findDefaultUriScheme(s,e),authority:s.remoteAuthority,path:"/"})}class EYt{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 xYt=new EYt;let wDe=class extends V{constructor(e){super(),this.markInactive=this._register(new cn(()=>{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(N2(()=>xYt.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()})}};wDe=D([_(0,we)],wDe);let yDe=class extends V{constructor(e,t){super(),this.logService=e,this.configurationService=t,this.participants=new hl}addFileOperationParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e,t,i,n){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,n)}catch(a){this.logService.warn(a)}}dispose(){this.participants.clear(),super.dispose()}};yDe=D([_(0,Ge),_(1,Te)],yDe);let CDe=class extends V{get length(){return this.saveParticipants.length}constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=B1e(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.model?.pushStackElement();for(const o of this.saveParticipants){if(n.isCancellationRequested||e.isDisposed())break;try{const r=o.participate(e,t,i,n);await U_(r,n)}catch(r){this.logService.warn(r)}}e.model?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};CDe=D([_(0,Ge)],CDe);let SDe=class extends V{constructor(e,t,i,n){super(),this.fileService=e,this.workingCopyService=t,this.instantiationService=i,this.uriIdentityService=n,this._onWillRunWorkingCopyFileOperation=this._register(new jx),this.onWillRunWorkingCopyFileOperation=this._onWillRunWorkingCopyFileOperation.event,this._onDidFailWorkingCopyFileOperation=this._register(new jx),this.onDidFailWorkingCopyFileOperation=this._onDidFailWorkingCopyFileOperation.event,this._onDidRunWorkingCopyFileOperation=this._register(new jx),this.onDidRunWorkingCopyFileOperation=this._onDidRunWorkingCopyFileOperation.event,this.correlationIds=0,this.fileOperationParticipants=this._register(this.instantiationService.createInstance(yDe)),this.saveParticipants=this._register(this.instantiationService.createInstance(CDe)),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,n){if(e.length===0)return[];if(t){const l=(await Zs.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,Ai.CREATE,n,i);const r={correlationId:this.correlationIds++,operation:Ai.CREATE,files:o};await this._onWillRunWorkingCopyFileOperation.fireAsync(r,He.None);let a;try{t?a=await Zs.settled(e.map(c=>this.fileService.createFile(c.resource,c.contents,{overwrite:c.overwrite}))):a=await Zs.settled(e.map(c=>this.fileService.createFolder(c.resource)))}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(r,He.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(r,He.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,n){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?Ai.MOVE:Ai.COPY,n,i);const a={correlationId:this.correlationIds++,operation:t?Ai.MOVE:Ai.COPY,files:r};await this._onWillRunWorkingCopyFileOperation.fireAsync(a,He.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 Zs.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,He.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(a,He.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 n=e.map(r=>({target:r.resource}));await this.runFileOperationParticipants(n,Ai.DELETE,i,t);const o={correlationId:this.correlationIds++,operation:Ai.DELETE,files:n};await this._onWillRunWorkingCopyFileOperation.fireAsync(o,He.None);for(const r of e){const a=this.getDirty(r.resource);await Zs.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,He.None),r}await this._onDidRunWorkingCopyFileOperation.fireAsync(o,He.None)}addFileOperationParticipant(e){return this.fileOperationParticipants.addFileOperationParticipant(e)}runFileOperationParticipants(e,t,i,n){return this.fileOperationParticipants.participate(e,t,i,n)}get hasSaveParticipants(){return this.saveParticipants.length>0}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i,n){return this.saveParticipants.participate(e,t,i,n)}registerWorkingCopyProvider(e){const t=B1e(this.workingCopyProviders,e);return Ee(t)}getDirty(e){const t=new Set;for(const i of this.workingCopyProviders)for(const n of i(e))n.isDirty()&&t.add(n);return Array.from(t)}};SDe=D([_(0,Jt),_(1,Rm),_(2,we),_(3,ks)],SDe);const DYt=eh.registerExtensionPoint({extensionPoint:"resourceLabelFormatters",jsonSchema:{description:g(858,"Contributes resource label formatting rules."),type:"array",items:{type:"object",required:["scheme","formatting"],properties:{scheme:{type:"string",description:g(859,'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.')},authority:{type:"string",description:g(860,"URI authority on which to match the formatter on. Simple glob patterns are supported.")},formatting:{description:g(861,"Rules for formatting uri resource labels."),type:"object",properties:{label:{type:"string",description:g(862,"Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables.")},separator:{type:"string",description:g(863,"Separator to be used in the uri label display. '/' or '' as an example.")},stripPathStartingSeparator:{type:"boolean",description:g(864,"Controls whether `${path}` substitutions should have starting separator characters stripped.")},tildify:{type:"boolean",description:g(865,"Controls if the start of the uri label should be tildified when possible.")},workspaceSuffix:{type:"string",description:g(866,"Suffix appended to the workspace label.")}}}}}}}),H3e=/\//g,kYt=/\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;function IYt(s){return!!(s&&s[2]===":")}let ADe=class{constructor(e){this.formattersDisposables=new Map,DYt.setHandler((t,i)=>{for(const n of i.added)for(const o of n.value){const r={...o};typeof r.formatting.label!="string"&&(r.formatting.label="${authority}${path}"),typeof r.formatting.separator!="string"&&(r.formatting.separator=ou),!dl(n.description,"contribLabelFormatterWorkspaceTooltip")&&r.formatting.workspaceTooltip&&(r.formatting.workspaceTooltip=void 0),this.formattersDisposables.set(r,e.registerFormatter(r))}for(const n of i.removed)for(const o of n.value)bt(this.formattersDisposables.get(o))})}};ADe=D([_(0,Fs)],ADe);Qe.as(cf.Workbench).registerWorkbenchContribution(ADe,Rs.Restored);const U3e=50;let EDe=class extends V{constructor(e,t,i,n,o,r){super(),this.environmentService=e,this.contextService=t,this.pathService=i,this.remoteAgentService=n,this._onDidChangeFormatters=this._register(new I({leakWarningThreshold:400})),this.onDidChangeFormatters=this._onDidChangeFormatters.event,this.os=po,this.userHome=i.defaultUriScheme===pe.file?this.pathService.userHome({preferLocal:!0}):void 0;const a=this.storedFormattersMemento=new sI("cachedResourceLabelFormatters2",o);this.storedFormatters=a.getMemento(Ie.PROFILE,an.MACHINE),this.formatters=this.storedFormatters?.formatters?.slice()||[],this.resolveRemoteEnvironment()}async resolveRemoteEnvironment(){const e=await this.remoteAgentService.getEnvironment();this.os=e?.os??po,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;zO(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 n=this.doGetUriLabel(e,i,t);return!i&&t.separator?n.replace(H3e,t.separator):n}doGetUriLabel(e,t,i={}){if(!t)return LMt(e,{os:this.os,tildify:this.userHome?{userHome:this.userHome}:void 0,relative:i.relative?{noPrefix:i.noPrefix,getWorkspace:()=>this.contextService.getWorkspace(),getWorkspaceFolder:n=>this.contextService.getWorkspaceFolder(n)}:void 0});if(i.relative&&this.contextService){let n=this.contextService.getWorkspaceFolder(e);if(!n){const o=this.contextService.getWorkspace(),r=lm(o.folders);r&&e.scheme!==r.uri.scheme&&e.path.startsWith(Vi.sep)&&(n=this.contextService.getWorkspaceFolder(r.uri.with({path:e.path})))}if(n){const o=this.formatUri(n.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&&n.uri.path===Vi.sep&&(r=r.substring(a)),this.contextService.getWorkspace().folders.length>1&&!i.noPrefix){const l=n?.name??EA(n.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 n;return t?.separator===cc.sep?n=cc:t?.separator===Vi.sep?n=Vi:n=this.os===Ds.Windows?cc:Vi,n.basename(i)}getWorkspaceLabel(e,t){if(Yme(e)){const i=GO(e);return P_(i)||iA(i)?this.getWorkspaceLabel(i,t):""}return N.isUri(e)?this.doGetSingleFolderWorkspaceLabel(e,t):P_(e)?this.doGetSingleFolderWorkspaceLabel(e.uri,t):iA(e)?this.doGetWorkspaceLabel(e.configPath,t):""}doGetWorkspaceLabel(e,t){if(g3(e,this.environmentService))return g(867,"Untitled (Workspace)");if(Py(e))return g(868,"Workspace");let i=_i(e);i.endsWith(xb)&&(i=i.substr(0,i.length-xb.length-1));let n;switch(t?.verbose){case Op.SHORT:n=i;break;case Op.LONG:n=g(869,"{0} (Workspace)",this.getUriLabel(Pt(Lr(e),i)));break;case Op.MEDIUM:default:n=g(870,"{0} (Workspace)",i);break}return t?.verbose===Op.SHORT?n:this.appendWorkspaceSuffix(n,e)}doGetSingleFolderWorkspaceLabel(e,t){let i;switch(t?.verbose){case Op.LONG:i=this.getUriLabel(e);break;case Op.SHORT:case Op.MEDIUM:default:i=_i(e)||Vi.sep;break}return t?.verbose===Op.SHORT?i:this.appendWorkspaceSuffix(i,e)}getSeparator(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.separator||Vi.sep}getHostLabel(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.workspaceSuffix||t||""}getHostTooltip(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.workspaceTooltip}registerCachedFormatter(e){const t=this.storedFormatters.formatters??=[];let i=t.findIndex(n=>n.scheme===e.scheme&&n.authority===e.authority);if(i===-1&&t.length>=U3e&&(i=U3e-1),i===-1)t.unshift(e);else{for(let n=i;n>0;n--)t[n]=t[n-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 n=t.label.replace(kYt,(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&&IYt(n)&&(n=n.charAt(1).toUpperCase()+n.substr(2)),t.tildify&&!i&&this.userHome&&(n=KXe(n,this.userHome.fsPath,this.os)),t.authorityPrefix&&e.authority&&(n=t.authorityPrefix+n),n.replace(H3e,t.separator)}appendWorkspaceSuffix(e,t){const i=this.findFormatting(t),n=i&&typeof i.workspaceSuffix=="string"?i.workspaceSuffix:void 0;return n?`${e} [${n}]`:e}};EDe=D([_(0,Jr),_(1,yi),_(2,bf),_(3,hg),_(4,$i),_(5,ig)],EDe);let xDe=class extends Oie{constructor(e,t,i){super(g4t().userHome??AYt(t,i),e,t,i)}};xDe=D([_(0,hg),_(1,Jr),_(2,yi)],xDe);function TYt(){return{[I6.toString()]:new wi(mDe,[],!0),[HRe.toString()]:new wi(vDe,[],!0),[iE.toString()]:new wi(fDe,[],!0),[DI.toString()]:new wi(gDe,[],!0),[Nae.toString()]:new wi(WRe,[],!0),[Uae.toString()]:new wi(_De,[],!0),[zRe.toString()]:new wi(SYt,[],!1),[aMe.toString()]:new wi(wDe,[],!0),[zb.toString()]:new wi(SDe,[],!1),[bf.toString()]:new wi(xDe,[],!0),[nce.toString()]:new wi(JSe,[],!0),[Fs.toString()]:new wi(EDe,[],!0)}}var V3e;(function(s){s[s.NONE=0]="NONE",s[s.EDITS=1]="EDITS",s[s.NAVIGATION=2]="NAVIGATION"})(V3e||(V3e={}));var z3e;(function(s){s[s.DEFAULT=0]="DEFAULT",s[s.EDITOR_GROUP=1]="EDITOR_GROUP",s[s.EDITOR=2]="EDITOR"})(z3e||(z3e={}));async function LYt(s,e=document.body,t={},i){btt(),p4t(e,t,i);const n=Dt.initialize({[Er.toString()]:gp({version:"1.92.2",quality:"stable",commit:"fee1edb8d6d72a0ddff41e5f71a671c23ed924b9",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??{}),...oYt(),...sYt(),...nYt(),...Rce(),...Xzt(),...aYt(),...TYt(),...s});await v4t(n)}async function vst(s){return await vtt(),Dt.get(s)}function bst(s){if(fNe.isOpen())return Dt.get(we).invokeFunction(s);const e=new Z,t=e.add(gtt.event(()=>{t.dispose(),e.add(Dt.get(we).invokeFunction(s))}));return e}function DDe(s,e){const t=kn(s.editor)?xs(s.editor):Object.create(null);return Object.assign(t,xs(e)),t}function $3e(s,e){const t=DDe(s);if(kn(s.diffEditor)){const i=xs(s.diffEditor);i.diffCodeLens=i.codeLens,delete i.codeLens,i.diffWordWrap=i.wordWrap,delete i.wordWrap,Object.assign(t,i)}return t.accessibilityVerbose=s.accessibility?.verbosity?.diffEditor??!1,Object.assign(t,xs(e)),t}function wst(s){let e=class extends s{constructor(i,n={},o,r){const{theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f,overflowWidgetsDomNode:p,dimension:m,...v}=n,b=DDe(r.getValue(n.model?.uri),v);super(o,i,{...b,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=b,this.optionsOverrides=v,this._register(r.onDidChangeConfiguration(C=>{const A=this.getModel()?.uri;A!=null&&C.affectsConfiguration(A,"editor")&&this.updateEditorConfiguration()})),this._register(this.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration();const w=o.createChild(new Uc([Le,this._contextKeyService])),y=this._register(w.createInstance(M3));this.onDidChangeModel(C=>{y.set(C.newModelUrl)}),y.set(this.getModel()?.uri)}updateEditorConfiguration(){if(!this.hasModel()||this.textResourceConfigurationService==null)return;const i=this.getModel().uri,n=this.textResourceConfigurationService.getValue(i);if(n==null)return;const o=DDe(n,this.optionsOverrides);let r=o;this.lastAppliedEditorOptions!=null&&(r=o8(this.lastAppliedEditorOptions,r)),Object.keys(r).length>0&&(this.lastAppliedEditorOptions=o,super.updateOptions(r))}updateOptions(i){this.optionsOverrides??(this.optionsOverrides={}),lS.applyUpdate(this.optionsOverrides,i)&&this.updateEditorConfiguration()}};return e=D([_(2,we),_(3,Ec)],e),e}const RYt=wst(BRe(Yk)),MYt=wst(BRe(IM));let kDe=class extends BRe(TJ){constructor(e,t={},i,n){const{theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c,overflowWidgetsDomNode:l,dimension:d,...h}=t,u=$3e(n.getValue(void 0),h);super(i,e,{...u,overflowWidgetsDomNode:l,dimension:d,theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c}),this.textResourceConfigurationService=n,this.optionsOverrides={},this.lastAppliedEditorOptions=u,this.optionsOverrides=h,this._register(n.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=$3e(t,this.optionsOverrides);let n=i;this.lastAppliedEditorOptions!=null&&(n=o8(this.lastAppliedEditorOptions,n)),Object.keys(n).length>0&&(this.lastAppliedEditorOptions=i,super.updateOptions(n))}updateOptions(e){this.optionsOverrides??(this.optionsOverrides={}),this.optionsOverrides={...this.optionsOverrides,...e},this.updateEditorConfiguration()}_createInnerEditor(e,t,i){return e.createInstance(RYt,t,i)}};kDe=D([_(2,we),_(3,Ec)],kDe);async function yst(s,e){await(await vst(Jt)).writeFile(s,$e.fromString(e))}async function NYt(s,e){return e!=null&&await yst(s,e),await(await vst(fn)).createModelReference(s)}function PYt(s){return s.registerKeybindingProvider!=null}let IDe=class extends jk{constructor(e,t,i,n,o,r,a){super(t,i,n,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)}};IDe=D([_(1,Le),_(2,vi),_(3,Yi),_(4,bi),_(5,Ge),_(6,Kt)],IDe);let Wue=null;function Cst(s){if(Wue==null){const e=new Uc;e.set(In,new wi(k3,[],!0));const t=s.get(Ut);!(t instanceof jk)&&PYt(t)&&e.set(Ut,new wi(IDe,[t],!0)),Wue=s.get(we).createChild(e)}return Wue}const FYt=(s,e,t)=>Dt.initialize(t??{}).invokeFunction(Cst).createInstance(MYt,s,e),OYt=(s,e,t)=>Dt.initialize(t??{}).invokeFunction(Cst).createInstance(kDe,s,e);var BYt='.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}';ut(BYt,{});var $H;(function(s){s[s.None=0]="None",s[s.Open=1]="Open",s[s.Close=-1]="Close"})($H||($H={}));function WYt(s){return Array.isArray(s)}function HYt(s){return!WYt(s)}function Sst(s){return typeof s=="string"}function G3e(s){return!Sst(s)}function o1(s){return!s}function mA(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function K3e(s){return s.replace(/[&<>'"_]/g,"-")}function UYt(s,e){console.log(`${s.languageId}: ${e}`)}function tr(s,e){return new Error(`${s.languageId}: ${e}`)}function rx(s,e,t,i,n){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 o1(l)?o1(d)?!o1(h)&&h0;){const i=s.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function zYt(s,e){let t=e;for(;t&&t.length>0;){if(s.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}var TDe;const Ast=5,ere=class ere{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 dB(e,t);let i=dB.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new dB(e,t),this._entries[i]=n,n)}};ere._INSTANCE=new ere(Ast);let z$=ere;class dB{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 dB._equals(this,e)}push(e){return z$.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return z$.create(this.parent,e)}}class NF{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 NF(this.languageId,this.state)}}const tre=class tre{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 bz(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new bz(e,t);const i=dB.getStackElementId(e);let n=this._entries[i];return n||(n=new bz(e,null),this._entries[i]=n,n)}};tre._INSTANCE=new tre(Ast);let ax=tre;class bz{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:ax.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof bz)||!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 $Yt{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 _8(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,r=i.state,a=Ta.get(o);if(!a)return this.enterLanguage(o),this.emit(n,""),r;const c=a.tokenize(e,t,r);if(n!==0)for(const l of c.tokens)this._tokens.push(new _8(l.offset+n,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 iTe(this._tokens,e)}}class Bie{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=_T.Null,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|Hi.BALANCED_BRACKETS_MASK;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(n===0&&o===0&&r===0)return new Uint32Array(0);if(n===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(n+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=Ta.get(t);if(i){if(i instanceof TDe){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}Ta.isResolved(t)||e.push(Ta.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=z$.create(null,this._lexer.start);return ax.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return UKe(this._languageId,i);const n=new $Yt,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return ATe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new Bie(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=WK(this._lexer,t.stack.state),!i))throw tr(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const r of i){if(!G3e(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||(n===-1||l0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const c=e.substring(r);return this._myTokenize(c,t,i,n+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,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 R=this._lexer.tokenizer[b];if(!R&&(R=WK(this._lexer,b),!R))throw tr(this._lexer,"tokenizer state is not defined: "+b);const z=a.substr(h);for(const G of R)if((h===0||!G.matchOnlyAtLineStart)&&(w=z.match(G.resolveRegex(b)),w)){y=w[0],C=G.action;break}}if(w||(w=[""],y=""),C||(h=this._lexer.maxStack)throw tr(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(C.next==="@pop"){if(d.depth<=1)throw tr(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(A));d=d.pop()}else if(C.next==="@popall")d=d.popall();else{let R=rx(this._lexer,C.next,y,w,b);if(R[0]==="@"&&(R=R.substr(1)),WK(this._lexer,R))d=d.push(R);else throw tr(this._lexer,"trying to set a next state '"+R+"' that is undefined in rule: "+this._safeRuleName(A))}}C.log&&typeof C.log=="string"&&UYt(this._lexer,this._lexer.languageId+": "+rx(this._lexer,C.log,y,w,b))}if(k===null)throw tr(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(A));const P=R=>{const z=this._languageService.getLanguageIdByLanguageName(R)||this._languageService.getLanguageIdByMimeType(R)||R,G=this._getNestedEmbeddedLanguageData(z);if(h0)throw tr(this._lexer,"groups cannot be nested: "+this._safeRuleName(A));if(w.length!==k.length+1)throw tr(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(A));let R=0;for(let z=1;zs});class wPe{static colorizeElement(e,t,i,n){n=n||{};const o=n.theme||"vs",r=n.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=KYt?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,c||"",a,n).then(l,d=>console.error(d))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),eTe(t)&&(t=t.substr(1));const a=ov(t);if(!e.isRegisteredLanguageId(i))return q3e(a,r,o);const c=await Ta.getOrCreate(i);return c?qYt(a,r,c,o):q3e(a,r,o)}static colorizeLine(e,t,i,n,o=4){const r=fp.isBasicASCII(e,t),a=fp.containsRTL(e,r,i);return Ure(new yI(!1,!0,e,!1,r,a,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function qYt(s,e,t,i){return new Promise((n,o)=>{const r=()=>{const a=QYt(s,e,t,i);if(t instanceof $$){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(r,o);return}}n(a)};r()})}function q3e(s,e,t){let i=[];const n=(Vo.None<>>0,o=new Uint32Array(2);o[0]=0,o[1]=n;for(let r=0,a=s.length;r")}return i.join("")}function QYt(s,e,t,i){let n=[],o=t.getInitialState();for(let r=0,a=s.length;r"),o=l.endState}return n.join("")}function jYt(s,e,t){return Dt.initialize(t||{}).createInstance(IM,s,e)}function YYt(s){return Dt.get(Kt).onCodeEditorAdd(t=>{s(t)})}function JYt(s){return Dt.get(Kt).onDiffEditorAdd(t=>{s(t)})}function XYt(){return Dt.get(Kt).listCodeEditors()}function ZYt(){return Dt.get(Kt).listDiffEditors()}function eJt(s,e,t){return Dt.initialize(t||{}).createInstance(TJ,s,e)}function tJt(s,e){const t=Dt.initialize(e||{});return new Cve(s,{},t)}function iJt(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return _t.registerCommand(s.id,s.run)}function nJt(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=he.deserialize(s.precondition),t=(n,...o)=>hc.runEditorCommand(n,o,e,(r,a,c)=>Promise.resolve(s.run(a,...c))),i=new Z;if(i.add(_t.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(jn.appendMenuItem(_e.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=Dt.get(Ut);if(!(n instanceof jk))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=he.and(e,he.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function sJt(s){return Est([s])}function Est(s){const e=Dt.get(Ut);return e instanceof jk?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:he.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),V.None)}function oJt(s,e,t){const i=Dt.get(xi),n=i.getLanguageIdByMimeType(e)||e;return zYe(Dt.get(gi),i,s,n,t)}function rJt(s,e){const t=Dt.get(xi),i=t.getLanguageIdByMimeType(e)||e||Ca;s.setLanguage(t.createById(i))}function aJt(s,e,t){s&&Dt.get(Am).changeOne(e,s.uri,t)}function cJt(s){Dt.get(Am).changeAll(s,[])}function lJt(s){return Dt.get(Am).read(s)}function dJt(s){return Dt.get(Am).onMarkerChanged(s)}function hJt(s){return Dt.get(gi).getModel(s)}function uJt(){return Dt.get(gi).getModels()}function gJt(s){return Dt.get(gi).onModelAdded(s)}function fJt(s){return Dt.get(gi).onModelRemoved(s)}function pJt(s){return Dt.get(gi).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function mJt(s){return ygt(Dt.get(gi),Dt.get(Vs),s)}function _Jt(s,e){const t=Dt.get(xi),i=Dt.get(cv);return wPe.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function vJt(s,e,t){const i=Dt.get(xi);return Dt.get(cv).registerEditorContainer(si.document.body),wPe.colorize(i,s,e,t)}function bJt(s,e,t=4){return Dt.get(cv).registerEditorContainer(si.document.body),wPe.colorizeModelLine(s,e,t)}function wJt(s){const e=Ta.get(s);return e||{getInitialState:()=>B8,tokenize:(t,i,n)=>UKe(s,n)}}function yJt(s,e){Ta.getOrCreate(e);const t=wJt(e),i=ov(s),n=[];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 s.openCodeEditor(i,t.resource,r)?i:null})}function kJt(){return{create:jYt,getEditors:XYt,getDiffEditors:ZYt,onDidCreateEditor:YYt,onDidCreateDiffEditor:JYt,createDiffEditor:eJt,addCommand:iJt,addEditorAction:nJt,addKeybindingRule:sJt,addKeybindingRules:Est,createModel:oJt,setModelLanguage:rJt,setModelMarkers:aJt,getModelMarkers:lJt,removeAllMarkers:cJt,onDidChangeMarkers:dJt,getModels:uJt,getModel:hJt,onDidCreateModel:gJt,onWillDisposeModel:fJt,onDidChangeModelLanguage:pJt,createWebWorker:mJt,colorizeElement:_Jt,colorize:vJt,colorizeModelLine:bJt,tokenize:yJt,defineTheme:CJt,setTheme:SJt,remeasureFonts:AJt,registerCommand:EJt,registerLinkOpener:xJt,registerEditorOpener:DJt,AccessibilitySupport:gfe,ContentWidgetPositionPreference:bfe,CursorChangeReason:wfe,DefaultEndOfLine:yfe,EditorAutoIndentStrategy:Sfe,EditorOption:Afe,EndOfLinePreference:Efe,EndOfLineSequence:xfe,MinimapPosition:Ofe,MinimapSectionHeaderStyle:Bfe,MouseTargetType:Wfe,OverlayWidgetPositionPreference:Vfe,OverviewRulerLane:zfe,GlyphMarginLane:Dfe,RenderLineNumbersType:Kfe,RenderMinimap:qfe,ScrollbarVisibility:jfe,ScrollType:Qfe,TextEditorCursorBlinkingStyle:tpe,TextEditorCursorStyle:ipe,TrackedRangeStickiness:npe,WrappingIndent:spe,InjectedTextCursorStops:Tfe,PositionAffinity:Gfe,ShowLightbulbIconMode:Jfe,ConfigurationChangedEvent:iGe,BareFontInfo:wx,FontInfo:_q,TextModelResolvedOptions:wq,FindMatch:F8,ApplyUpdateResult:JV,EditorZoom:Qp,createMultiFileDiffEditor:tJt,EditorType:CU,EditorOptions:wh}}function IJt(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function HK(s,e){return typeof s=="boolean"?s:e}function Q3e(s,e){return typeof s=="string"?s:e}function TJt(s){const e={};for(const t of s)e[t]=!0;return e}function j3e(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=TJt(s);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 LDe(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let c="";if(typeof s[a]=="string")c=s[a];else if(s[a]&&s[a]instanceof RegExp)c=s[a].source;else throw s[a]===void 0?tr(s,"language definition does not contain attribute '"+a+"', used at: "+e):tr(s,"attribute reference '"+a+"' must be a string, used at: "+e);return o1(c)?"":"(?:"+c+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const o=(s.ignoreCase?"i":"")+(s.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(VYt(s,e,l),o)),c)}return new RegExp(e,o)}function LJt(s,e,t,i){if(i<0)return s;if(i=100){i=i-100;const n=t.split(".");if(n.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=$H.Open;else if(t.bracket==="@close")i.bracket=$H.Close;else throw tr(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw tr(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!zYt(s,rx(s,n,"",[],""))))throw tr(s,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}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,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,o=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=LDe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=RDe(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function xst(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:HK(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:HK(e.ignoreCase,!1),unicode:HK(e.unicode,!1),tokenPostfix:Q3e(e.tokenPostfix,"."+s),defaultToken:Q3e(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=s,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 n(r,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw tr(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw tr(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const h=new MJt(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 tr(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 tr(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=HK(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw tr(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,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw tr(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 tr(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:mA(t,a.open),close:mA(t,a.close)});else throw tr(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 NJt(s){wT.registerLanguage(s)}function PJt(){let s=[];return s=s.concat(wT.getLanguages()),s}function FJt(s){return Dt.get(xi).languageIdCodec.encodeLanguageId(s)}function OJt(s,e){return Dt.withServices(()=>{const i=Dt.get(xi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function BJt(s,e){return Dt.withServices(()=>{const i=Dt.get(xi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function WJt(s,e){if(!Dt.get(xi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return Dt.get(Vs).register(s,e,100)}class HJt{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 G$.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new Lre(n.tokens,n.endState)}}class G${constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=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?UJt(i)?kst(s,i):new $$(Dt.get(xi),Dt.get(cv),s,xst(s,i),Dt.get(Te)):null});return Ta.registerFactory(s,t)}function $Jt(s,e){if(!Dt.get(xi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return Dst(e)?yPe(s,{create:()=>e}):Ta.register(s,kst(s,e))}function GJt(s,e){const t=i=>new $$(Dt.get(xi),Dt.get(cv),s,xst(s,i),Dt.get(Te));return Dst(e)?yPe(s,{create:()=>e}):Ta.register(s,t(e))}function KJt(s,e){return Dt.get(it).referenceProvider.register(s,e)}function qJt(s,e){return Dt.get(it).renameProvider.register(s,e)}function QJt(s,e){return Dt.get(it).newSymbolNamesProvider.register(s,e)}function jJt(s,e){return Dt.get(it).signatureHelpProvider.register(s,e)}function YJt(s,e){return Dt.get(it).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(c=>{if(c)return!c.range&&a&&(c.range=new F(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),c.range||(c.range=new F(n.lineNumber,n.column,n.lineNumber,n.column)),c})}})}function JJt(s,e){return Dt.get(it).documentSymbolProvider.register(s,e)}function XJt(s,e){return Dt.get(it).documentHighlightProvider.register(s,e)}function ZJt(s,e){return Dt.get(it).linkedEditingRangeProvider.register(s,e)}function eXt(s,e){return Dt.get(it).definitionProvider.register(s,e)}function tXt(s,e){return Dt.get(it).implementationProvider.register(s,e)}function iXt(s,e){return Dt.get(it).typeDefinitionProvider.register(s,e)}function nXt(s,e){return Dt.get(it).codeLensProvider.register(s,e)}function sXt(s,e,t){return Dt.get(it).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,o,r,a)=>{const l=Dt.get(Am).read({resource:n.uri}).filter(d=>F.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:l,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function oXt(s,e){return Dt.get(it).documentFormattingEditProvider.register(s,e)}function rXt(s,e){return Dt.get(it).documentRangeFormattingEditProvider.register(s,e)}function aXt(s,e){return Dt.get(it).onTypeFormattingEditProvider.register(s,e)}function cXt(s,e){return Dt.get(it).linkProvider.register(s,e)}function lXt(s,e){return Dt.get(it).completionProvider.register(s,e)}function dXt(s,e){return Dt.get(it).colorProvider.register(s,e)}function hXt(s,e){return Dt.get(it).foldingRangeProvider.register(s,e)}function uXt(s,e){return Dt.get(it).declarationProvider.register(s,e)}function gXt(s,e){return Dt.get(it).selectionRangeProvider.register(s,e)}function fXt(s,e){return Dt.get(it).documentSemanticTokensProvider.register(s,e)}function pXt(s,e){return Dt.get(it).documentRangeSemanticTokensProvider.register(s,e)}function mXt(s,e){return Dt.get(it).inlineCompletionsProvider.register(s,e)}function _Xt(s,e){return Dt.get(it).inlineEditProvider.register(s,e)}function vXt(s,e){return Dt.get(it).inlayHintsProvider.register(s,e)}function bXt(){return{register:NJt,getLanguages:PJt,onLanguage:OJt,onLanguageEncountered:BJt,getEncodedLanguageId:FJt,setLanguageConfiguration:WJt,setColorMap:zJt,registerTokensProviderFactory:yPe,setTokensProvider:$Jt,setMonarchTokensProvider:GJt,registerReferenceProvider:KJt,registerRenameProvider:qJt,registerNewSymbolNameProvider:QJt,registerCompletionItemProvider:lXt,registerSignatureHelpProvider:jJt,registerHoverProvider:YJt,registerDocumentSymbolProvider:JJt,registerDocumentHighlightProvider:XJt,registerLinkedEditingRangeProvider:ZJt,registerDefinitionProvider:eXt,registerImplementationProvider:tXt,registerTypeDefinitionProvider:iXt,registerCodeLensProvider:nXt,registerCodeActionProvider:sXt,registerDocumentFormattingEditProvider:oXt,registerDocumentRangeFormattingEditProvider:rXt,registerOnTypeFormattingEditProvider:aXt,registerLinkProvider:cXt,registerColorProvider:dXt,registerFoldingRangeProvider:hXt,registerDeclarationProvider:uXt,registerSelectionRangeProvider:gXt,registerDocumentSemanticTokensProvider:fXt,registerDocumentRangeSemanticTokensProvider:pXt,registerInlineCompletionsProvider:mXt,registerInlineEditProvider:_Xt,registerInlayHintsProvider:vXt,DocumentHighlightKind:Cfe,CompletionItemKind:mfe,CompletionItemTag:_fe,CompletionItemInsertTextRule:pfe,SymbolKind:Zfe,SymbolTag:epe,IndentAction:Ife,CompletionTriggerKind:vfe,SignatureHelpTriggerKind:Xfe,InlayHintKind:Lfe,InlineCompletionTriggerKind:Rfe,InlineEditTriggerKind:Mfe,CodeActionTriggerType:ffe,NewSymbolNameTag:Hfe,NewSymbolNameTriggerKind:Ufe,PartialAcceptTriggerKind:$fe,HoverVerbosityAction:kfe,FoldingRangeKind:l_,SelectedSuggestionInfo:pGe}}wh.wrappingIndent.defaultValue=Nu.None;wh.glyphMargin.defaultValue=!1;wh.autoIndent.defaultValue=ll.Advanced;wh.overviewRulerLanes.defaultValue=2;gW.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const vu=_Ge();vu.editor=kJt();vu.languages=bXt();vu.CancellationTokenSource;vu.Emitter;vu.KeyCode;vu.KeyMod;vu.Position;vu.Range;vu.Selection;vu.SelectionDirection;vu.MarkerSeverity;vu.MarkerTag;const Yv=vu.Uri;vu.Token;const pN=vu.editor,Gx=vu.languages,wXt=globalThis.MonacoEnvironment;(wXt?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=vu);const yXt=Gx.onLanguage;Gx.onLanguage=(s,e)=>bst(()=>yXt(s,e));const CXt=Gx.onLanguage;Gx.onLanguageEncountered=(s,e)=>bst(()=>CXt(s,e));pN.create=FYt;pN.createDiffEditor=OYt;pN.createModelReference=NYt;pN.writeFile=yst;const SXt={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"}]]}};function Zce(s,e,t="OK",i=()=>{},n=()=>{}){const o=document.createElement("dialog");o.classList.add("dialog"),o.classList.add("modal"),o.classList.add(s);const r=document.createElement("div");r.classList.add("titlebar");const a=document.createElement("i");a.classList.add("close_button"),a.classList.add("fa"),a.classList.add("fa-times"),a.onclick=()=>o.close(),r.appendChild(a);const c=document.createElement("div");c.classList.add("dialog_content");const l=document.createElement("button");let d=[];typeof e=="function"?d=e(u=>{l.disabled=!u}):d=e;for(const u of d)c.appendChild(u);const h=document.createElement("div");h.classList.add("button_row"),l.innerText=t,l.onclick=()=>{i(),o.close()},h.appendChild(l),o.appendChild(r),o.appendChild(c),o.appendChild(h),document.body.appendChild(o),o.onclose=n,o.showModal()}function AXt(s){alert(s)}function Y3e(...s){const e=document.createElement("p");e.innerText="Share this URL:";const t=[e];for(const i of s){const n=document.createElement("div");n.classList.add("url");const o=document.createElement("p");o.className="url_text",o.innerHTML=''+i+"";const r=document.createElement("button");r.classList.add("button"),r.classList.add("copy_url"),r.onclick=()=>navigator.clipboard.writeText(i);const a=document.createElement("i");a.classList.add("fa"),a.classList.add("fa-copy"),r.appendChild(a),n.appendChild(o),n.appendChild(r),t.push(n)}Zce("report_export_url",t)}async function EXt(s){const e=document.createElement("textarea");e.cols=80,e.rows=5,e.autofocus=!0,e.placeholder="Description";const t=document.createElement("div"),i=document.createElement("input");i.type="checkbox",i.id="is_public",i.checked=!0;const n=document.createElement("label");n.innerText="Create public Gist",n.htmlFor="is_public",t.appendChild(i),t.appendChild(n),Zce("gist_export_dialog",[e,t],"Export",()=>s(e.value,i.checked))}function xXt(){const s=document.createElement("div");s.innerHTML=` +${r}`)}}};uDe=D([_(0,E6),_(1,Jt)],uDe);var gDe;let Pie=gDe=class{constructor(e,t,i,n){this.localUserHome=e,this.remoteAgentService=t,this.environmentService=i,this.contextService=n,this.resolveOS=(async()=>(await this.remoteAgentService.getEnvironment())?.os||po)(),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(n=>this.doHasValidBasename(e,n,t)):this.doHasValidBasename(e,t,i)}doHasValidBasename(e,t,i){return e.scheme===pe.file||e.scheme===pe.vscodeRemote?hlt(i??_i(e),t===Ds.Windows):!0}get defaultUriScheme(){return gDe.findDefaultUriScheme(this.environmentService,this.contextService)}static findDefaultUriScheme(e,t){if(e.remoteAuthority)return pe.vscodeRemote;const i=Dtt(t.getWorkspace());if(i)return i;const n=t.getWorkspace().folders[0];if(n)return n.uri.scheme;const o=t.getWorkspace().configuration;return o?o.scheme:pe.file}userHome(e){return e?.preferLocal?this.localUserHome:this.resolveUserHome}get resolvedUserHome(){return this.maybeUnresolvedUserHome}get path(){return this.resolveOS.then(e=>e===Ds.Windows?cc:Vi)}async fileURI(e){let t="";if(await this.resolveOS===Ds.Windows&&(e=e.replace(/\\/g,"/")),e[0]==="/"&&e[1]==="/"){const n=e.indexOf("/",2);n===-1?(t=e.substring(2),e="/"):(t=e.substring(2,n),e=e.substring(n)||"/")}return N.from({scheme:pe.file,authority:t,path:e,query:"",fragment:""})}};Pie=gDe=D([_(1,cg),_(2,Jr),_(3,yi)],Pie);function gYt(s,e){const t=e.getWorkspace(),i=rm(t.folders);return i?i.uri:t.configuration?Lr(t.configuration):N.from({scheme:Pie.findDefaultUriScheme(s,e),authority:s.remoteAuthority,path:"/"})}class fYt{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 pYt=new fYt;let fDe=class extends V{constructor(e){super(),this.markInactive=this._register(new cn(()=>{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(T2(()=>pYt.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()})}};fDe=D([_(0,we)],fDe);let pDe=class extends V{constructor(e,t){super(),this.logService=e,this.configurationService=t,this.participants=new dl}addFileOperationParticipant(e){const t=this.participants.push(e);return Ee(()=>t())}async participate(e,t,i,n){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,n)}catch(a){this.logService.warn(a)}}dispose(){this.participants.clear(),super.dispose()}};pDe=D([_(0,Ge),_(1,Te)],pDe);let mDe=class extends V{get length(){return this.saveParticipants.length}constructor(e){super(),this.logService=e,this.saveParticipants=[]}addSaveParticipant(e){const t=x1e(this.saveParticipants,e);return Ee(()=>t())}async participate(e,t,i,n){e.model?.pushStackElement();for(const o of this.saveParticipants){if(n.isCancellationRequested||e.isDisposed())break;try{const r=o.participate(e,t,i,n);await B_(r,n)}catch(r){this.logService.warn(r)}}e.model?.pushStackElement()}dispose(){this.saveParticipants.splice(0,this.saveParticipants.length),super.dispose()}};mDe=D([_(0,Ge)],mDe);let _De=class extends V{constructor(e,t,i,n){super(),this.fileService=e,this.workingCopyService=t,this.instantiationService=i,this.uriIdentityService=n,this._onWillRunWorkingCopyFileOperation=this._register(new Kx),this.onWillRunWorkingCopyFileOperation=this._onWillRunWorkingCopyFileOperation.event,this._onDidFailWorkingCopyFileOperation=this._register(new Kx),this.onDidFailWorkingCopyFileOperation=this._onDidFailWorkingCopyFileOperation.event,this._onDidRunWorkingCopyFileOperation=this._register(new Kx),this.onDidRunWorkingCopyFileOperation=this._onDidRunWorkingCopyFileOperation.event,this.correlationIds=0,this.fileOperationParticipants=this._register(this.instantiationService.createInstance(pDe)),this.saveParticipants=this._register(this.instantiationService.createInstance(mDe)),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,n){if(e.length===0)return[];if(t){const l=(await Zs.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,Ai.CREATE,n,i);const r={correlationId:this.correlationIds++,operation:Ai.CREATE,files:o};await this._onWillRunWorkingCopyFileOperation.fireAsync(r,He.None);let a;try{t?a=await Zs.settled(e.map(c=>this.fileService.createFile(c.resource,c.contents,{overwrite:c.overwrite}))):a=await Zs.settled(e.map(c=>this.fileService.createFolder(c.resource)))}catch(c){throw await this._onDidFailWorkingCopyFileOperation.fireAsync(r,He.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(r,He.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,n){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?Ai.MOVE:Ai.COPY,n,i);const a={correlationId:this.correlationIds++,operation:t?Ai.MOVE:Ai.COPY,files:r};await this._onWillRunWorkingCopyFileOperation.fireAsync(a,He.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 Zs.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,He.None),c}return await this._onDidRunWorkingCopyFileOperation.fireAsync(a,He.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 n=e.map(r=>({target:r.resource}));await this.runFileOperationParticipants(n,Ai.DELETE,i,t);const o={correlationId:this.correlationIds++,operation:Ai.DELETE,files:n};await this._onWillRunWorkingCopyFileOperation.fireAsync(o,He.None);for(const r of e){const a=this.getDirty(r.resource);await Zs.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,He.None),r}await this._onDidRunWorkingCopyFileOperation.fireAsync(o,He.None)}addFileOperationParticipant(e){return this.fileOperationParticipants.addFileOperationParticipant(e)}runFileOperationParticipants(e,t,i,n){return this.fileOperationParticipants.participate(e,t,i,n)}get hasSaveParticipants(){return this.saveParticipants.length>0}addSaveParticipant(e){return this.saveParticipants.addSaveParticipant(e)}runSaveParticipants(e,t,i,n){return this.saveParticipants.participate(e,t,i,n)}registerWorkingCopyProvider(e){const t=x1e(this.workingCopyProviders,e);return Ee(t)}getDirty(e){const t=new Set;for(const i of this.workingCopyProviders)for(const n of i(e))n.isDirty()&&t.add(n);return Array.from(t)}};_De=D([_(0,Jt),_(1,Im),_(2,we),_(3,ks)],_De);const mYt=Xd.registerExtensionPoint({extensionPoint:"resourceLabelFormatters",jsonSchema:{description:g(858,"Contributes resource label formatting rules."),type:"array",items:{type:"object",required:["scheme","formatting"],properties:{scheme:{type:"string",description:g(859,'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.')},authority:{type:"string",description:g(860,"URI authority on which to match the formatter on. Simple glob patterns are supported.")},formatting:{description:g(861,"Rules for formatting uri resource labels."),type:"object",properties:{label:{type:"string",description:g(862,"Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables.")},separator:{type:"string",description:g(863,"Separator to be used in the uri label display. '/' or '' as an example.")},stripPathStartingSeparator:{type:"boolean",description:g(864,"Controls whether `${path}` substitutions should have starting separator characters stripped.")},tildify:{type:"boolean",description:g(865,"Controls if the start of the uri label should be tildified when possible.")},workspaceSuffix:{type:"string",description:g(866,"Suffix appended to the workspace label.")}}}}}}}),k3e=/\//g,_Yt=/\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;function vYt(s){return!!(s&&s[2]===":")}let vDe=class{constructor(e){this.formattersDisposables=new Map,mYt.setHandler((t,i)=>{for(const n of i.added)for(const o of n.value){const r={...o};typeof r.formatting.label!="string"&&(r.formatting.label="${authority}${path}"),typeof r.formatting.separator!="string"&&(r.formatting.separator=su),!ll(n.description,"contribLabelFormatterWorkspaceTooltip")&&r.formatting.workspaceTooltip&&(r.formatting.workspaceTooltip=void 0),this.formattersDisposables.set(r,e.registerFormatter(r))}for(const n of i.removed)for(const o of n.value)bt(this.formattersDisposables.get(o))})}};vDe=D([_(0,Fs)],vDe);Qe.as(of.Workbench).registerWorkbenchContribution(vDe,Rs.Restored);const I3e=50;let bDe=class extends V{constructor(e,t,i,n,o,r){super(),this.environmentService=e,this.contextService=t,this.pathService=i,this.remoteAgentService=n,this._onDidChangeFormatters=this._register(new I({leakWarningThreshold:400})),this.onDidChangeFormatters=this._onDidChangeFormatters.event,this.os=po,this.userHome=i.defaultUriScheme===pe.file?this.pathService.userHome({preferLocal:!0}):void 0;const a=this.storedFormattersMemento=new Zk("cachedResourceLabelFormatters2",o);this.storedFormatters=a.getMemento(Ie.PROFILE,an.MACHINE),this.formatters=this.storedFormatters?.formatters?.slice()||[],this.resolveRemoteEnvironment()}async resolveRemoteEnvironment(){const e=await this.remoteAgentService.getEnvironment();this.os=e?.os??po,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;WO(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 n=this.doGetUriLabel(e,i,t);return!i&&t.separator?n.replace(k3e,t.separator):n}doGetUriLabel(e,t,i={}){if(!t)return wMt(e,{os:this.os,tildify:this.userHome?{userHome:this.userHome}:void 0,relative:i.relative?{noPrefix:i.noPrefix,getWorkspace:()=>this.contextService.getWorkspace(),getWorkspaceFolder:n=>this.contextService.getWorkspaceFolder(n)}:void 0});if(i.relative&&this.contextService){let n=this.contextService.getWorkspaceFolder(e);if(!n){const o=this.contextService.getWorkspace(),r=rm(o.folders);r&&e.scheme!==r.uri.scheme&&e.path.startsWith(Vi.sep)&&(n=this.contextService.getWorkspaceFolder(r.uri.with({path:e.path})))}if(n){const o=this.formatUri(n.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&&n.uri.path===Vi.sep&&(r=r.substring(a)),this.contextService.getWorkspace().folders.length>1&&!i.noPrefix){const l=n?.name??SA(n.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 n;return t?.separator===cc.sep?n=cc:t?.separator===Vi.sep?n=Vi:n=this.os===Ds.Windows?cc:Vi,n.basename(i)}getWorkspaceLabel(e,t){if($me(e)){const i=UO(e);return R_(i)||tA(i)?this.getWorkspaceLabel(i,t):""}return N.isUri(e)?this.doGetSingleFolderWorkspaceLabel(e,t):R_(e)?this.doGetSingleFolderWorkspaceLabel(e.uri,t):tA(e)?this.doGetWorkspaceLabel(e.configPath,t):""}doGetWorkspaceLabel(e,t){if(d3(e,this.environmentService))return g(867,"Untitled (Workspace)");if(Ry(e))return g(868,"Workspace");let i=_i(e);i.endsWith(Sb)&&(i=i.substr(0,i.length-Sb.length-1));let n;switch(t?.verbose){case Np.SHORT:n=i;break;case Np.LONG:n=g(869,"{0} (Workspace)",this.getUriLabel(Pt(Lr(e),i)));break;case Np.MEDIUM:default:n=g(870,"{0} (Workspace)",i);break}return t?.verbose===Np.SHORT?n:this.appendWorkspaceSuffix(n,e)}doGetSingleFolderWorkspaceLabel(e,t){let i;switch(t?.verbose){case Np.LONG:i=this.getUriLabel(e);break;case Np.SHORT:case Np.MEDIUM:default:i=_i(e)||Vi.sep;break}return t?.verbose===Np.SHORT?i:this.appendWorkspaceSuffix(i,e)}getSeparator(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.separator||Vi.sep}getHostLabel(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.workspaceSuffix||t||""}getHostTooltip(e,t){return this.findFormatting(N.from({scheme:e,authority:t}))?.workspaceTooltip}registerCachedFormatter(e){const t=this.storedFormatters.formatters??=[];let i=t.findIndex(n=>n.scheme===e.scheme&&n.authority===e.authority);if(i===-1&&t.length>=I3e&&(i=I3e-1),i===-1)t.unshift(e);else{for(let n=i;n>0;n--)t[n]=t[n-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 n=t.label.replace(_Yt,(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&&vYt(n)&&(n=n.charAt(1).toUpperCase()+n.substr(2)),t.tildify&&!i&&this.userHome&&(n=BXe(n,this.userHome.fsPath,this.os)),t.authorityPrefix&&e.authority&&(n=t.authorityPrefix+n),n.replace(k3e,t.separator)}appendWorkspaceSuffix(e,t){const i=this.findFormatting(t),n=i&&typeof i.workspaceSuffix=="string"?i.workspaceSuffix:void 0;return n?`${e} [${n}]`:e}};bDe=D([_(0,Jr),_(1,yi),_(2,mf),_(3,cg),_(4,$i),_(5,Zu)],bDe);let wDe=class extends Pie{constructor(e,t,i){super(i4t().userHome??gYt(t,i),e,t,i)}};wDe=D([_(0,cg),_(1,Jr),_(2,yi)],wDe);function bYt(){return{[E6.toString()]:new wi(dDe,[],!0),[kRe.toString()]:new wi(uDe,[],!0),[eE.toString()]:new wi(cDe,[],!0),[yI.toString()]:new wi(aDe,[],!0),[Tae.toString()]:new wi(DRe,[],!0),[Oae.toString()]:new wi(hDe,[],!0),[LRe.toString()]:new wi(uYt,[],!1),[jRe.toString()]:new wi(fDe,[],!0),[Hb.toString()]:new wi(_De,[],!1),[mf.toString()]:new wi(wDe,[],!0),[Zae.toString()]:new wi(GSe,[],!0),[Fs.toString()]:new wi(bDe,[],!0)}}var T3e;(function(s){s[s.NONE=0]="NONE",s[s.EDITS=1]="EDITS",s[s.NAVIGATION=2]="NAVIGATION"})(T3e||(T3e={}));var L3e;(function(s){s[s.DEFAULT=0]="DEFAULT",s[s.EDITOR_GROUP=1]="EDITOR_GROUP",s[s.EDITOR=2]="EDITOR"})(L3e||(L3e={}));async function wYt(s,e=document.body,t={},i){htt(),s4t(e,t,i);const n=Dt.initialize({[Er.toString()]:dp({version:"1.92.2",quality:"stable",commit:"fee1edb8d6d72a0ddff41e5f71a671c23ed924b9",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??{}),...Qjt(),...qjt(),...Kjt(),...kce(),...Uzt(),...Yjt(),...bYt(),...s});await a4t(n)}async function dst(s){return await dtt(),Dt.get(s)}function hst(s){if(iNe.isOpen())return Dt.get(we).invokeFunction(s);const e=new Z,t=e.add(ott.event(()=>{t.dispose(),e.add(Dt.get(we).invokeFunction(s))}));return e}function yDe(s,e){const t=kn(s.editor)?xs(s.editor):Object.create(null);return Object.assign(t,xs(e)),t}function R3e(s,e){const t=yDe(s);if(kn(s.diffEditor)){const i=xs(s.diffEditor);i.diffCodeLens=i.codeLens,delete i.codeLens,i.diffWordWrap=i.wordWrap,delete i.wordWrap,Object.assign(t,i)}return t.accessibilityVerbose=s.accessibility?.verbosity?.diffEditor??!1,Object.assign(t,xs(e)),t}function ust(s){let e=class extends s{constructor(i,n={},o,r){const{theme:a,autoDetectHighContrast:c,model:l,value:d,language:h,accessibilityHelpUrl:u,ariaContainerElement:f,overflowWidgetsDomNode:p,dimension:m,...v}=n,b=yDe(r.getValue(n.model?.uri),v);super(o,i,{...b,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=b,this.optionsOverrides=v,this._register(r.onDidChangeConfiguration(C=>{const A=this.getModel()?.uri;A!=null&&C.affectsConfiguration(A,"editor")&&this.updateEditorConfiguration()})),this._register(this.onDidChangeModelLanguage(()=>this.updateEditorConfiguration())),this._register(this.onDidChangeModel(()=>this.updateEditorConfiguration())),this.updateEditorConfiguration();const w=o.createChild(new Uc([Le,this._contextKeyService])),y=this._register(w.createInstance(T3));this.onDidChangeModel(C=>{y.set(C.newModelUrl)}),y.set(this.getModel()?.uri)}updateEditorConfiguration(){if(!this.hasModel()||this.textResourceConfigurationService==null)return;const i=this.getModel().uri,n=this.textResourceConfigurationService.getValue(i);if(n==null)return;const o=yDe(n,this.optionsOverrides);let r=o;this.lastAppliedEditorOptions!=null&&(r=i8(this.lastAppliedEditorOptions,r)),Object.keys(r).length>0&&(this.lastAppliedEditorOptions=o,super.updateOptions(r))}updateOptions(i){this.optionsOverrides??(this.optionsOverrides={}),cS.applyUpdate(this.optionsOverrides,i)&&this.updateEditorConfiguration()}};return e=D([_(2,we),_(3,Ec)],e),e}const yYt=ust(xRe(Gk)),CYt=ust(xRe(EM));let CDe=class extends xRe(kJ){constructor(e,t={},i,n){const{theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c,overflowWidgetsDomNode:l,dimension:d,...h}=t,u=R3e(n.getValue(void 0),h);super(i,e,{...u,overflowWidgetsDomNode:l,dimension:d,theme:o,autoDetectHighContrast:r,modifiedAriaLabel:a,originalAriaLabel:c}),this.textResourceConfigurationService=n,this.optionsOverrides={},this.lastAppliedEditorOptions=u,this.optionsOverrides=h,this._register(n.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=R3e(t,this.optionsOverrides);let n=i;this.lastAppliedEditorOptions!=null&&(n=i8(this.lastAppliedEditorOptions,n)),Object.keys(n).length>0&&(this.lastAppliedEditorOptions=i,super.updateOptions(n))}updateOptions(e){this.optionsOverrides??(this.optionsOverrides={}),this.optionsOverrides={...this.optionsOverrides,...e},this.updateEditorConfiguration()}_createInnerEditor(e,t,i){return e.createInstance(yYt,t,i)}};CDe=D([_(2,we),_(3,Ec)],CDe);async function gst(s,e){await(await dst(Jt)).writeFile(s,$e.fromString(e))}async function SYt(s,e){return e!=null&&await gst(s,e),await(await dst(fn)).createModelReference(s)}function AYt(s){return s.registerKeybindingProvider!=null}let SDe=class extends $k{constructor(e,t,i,n,o,r,a){super(t,i,n,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)}};SDe=D([_(1,Le),_(2,vi),_(3,Yi),_(4,bi),_(5,Ge),_(6,Kt)],SDe);let Rue=null;function fst(s){if(Rue==null){const e=new Uc;e.set(In,new wi(E3,[],!0));const t=s.get(Ut);!(t instanceof $k)&&AYt(t)&&e.set(Ut,new wi(SDe,[t],!0)),Rue=s.get(we).createChild(e)}return Rue}const EYt=(s,e,t)=>Dt.initialize(t??{}).invokeFunction(fst).createInstance(CYt,s,e),xYt=(s,e,t)=>Dt.initialize(t??{}).invokeFunction(fst).createInstance(CDe,s,e);var DYt='.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}';ut(DYt,{});var HH;(function(s){s[s.None=0]="None",s[s.Open=1]="Open",s[s.Close=-1]="Close"})(HH||(HH={}));function kYt(s){return Array.isArray(s)}function IYt(s){return!kYt(s)}function pst(s){return typeof s=="string"}function M3e(s){return!pst(s)}function t1(s){return!s}function pA(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function N3e(s){return s.replace(/[&<>'"_]/g,"-")}function TYt(s,e){console.log(`${s.languageId}: ${e}`)}function tr(s,e){return new Error(`${s.languageId}: ${e}`)}function nx(s,e,t,i,n){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 t1(l)?t1(d)?!t1(h)&&h0;){const i=s.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function RYt(s,e){let t=e;for(;t&&t.length>0;){if(s.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}var ADe;const mst=5,Yoe=class Yoe{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 rB(e,t);let i=rB.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new rB(e,t),this._entries[i]=n,n)}};Yoe._INSTANCE=new Yoe(mst);let H$=Yoe;class rB{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 rB._equals(this,e)}push(e){return H$.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return H$.create(this.parent,e)}}class TF{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 TF(this.languageId,this.state)}}const Joe=class Joe{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 mz(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new mz(e,t);const i=rB.getStackElementId(e);let n=this._entries[i];return n||(n=new mz(e,null),this._entries[i]=n,n)}};Joe._INSTANCE=new Joe(mst);let sx=Joe;class mz{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:sx.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof mz)||!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 MYt{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 f8(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,r=i.state,a=Ta.get(o);if(!a)return this.enterLanguage(o),this.emit(n,""),r;const c=a.tokenize(e,t,r);if(n!==0)for(const l of c.tokens)this._tokens.push(new f8(l.offset+n,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 $1e(this._tokens,e)}}class Fie{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=gT.Null,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|Hi.BALANCED_BRACKETS_MASK;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(n===0&&o===0&&r===0)return new Uint32Array(0);if(n===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(n+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=Ta.get(t);if(i){if(i instanceof ADe){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}Ta.isResolved(t)||e.push(Ta.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=H$.create(null,this._lexer.start);return sx.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return MKe(this._languageId,i);const n=new MYt,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return uTe(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new Fie(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=FK(this._lexer,t.stack.state),!i))throw tr(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const r of i){if(!M3e(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||(n===-1||l0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const c=e.substring(r);return this._myTokenize(c,t,i,n+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,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 R=this._lexer.tokenizer[b];if(!R&&(R=FK(this._lexer,b),!R))throw tr(this._lexer,"tokenizer state is not defined: "+b);const z=a.substr(h);for(const G of R)if((h===0||!G.matchOnlyAtLineStart)&&(w=z.match(G.resolveRegex(b)),w)){y=w[0],C=G.action;break}}if(w||(w=[""],y=""),C||(h=this._lexer.maxStack)throw tr(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(b)}else if(C.next==="@pop"){if(d.depth<=1)throw tr(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(A));d=d.pop()}else if(C.next==="@popall")d=d.popall();else{let R=nx(this._lexer,C.next,y,w,b);if(R[0]==="@"&&(R=R.substr(1)),FK(this._lexer,R))d=d.push(R);else throw tr(this._lexer,"trying to set a next state '"+R+"' that is undefined in rule: "+this._safeRuleName(A))}}C.log&&typeof C.log=="string"&&TYt(this._lexer,this._lexer.languageId+": "+nx(this._lexer,C.log,y,w,b))}if(k===null)throw tr(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(A));const P=R=>{const z=this._languageService.getLanguageIdByLanguageName(R)||this._languageService.getLanguageIdByMimeType(R)||R,G=this._getNestedEmbeddedLanguageData(z);if(h0)throw tr(this._lexer,"groups cannot be nested: "+this._safeRuleName(A));if(w.length!==k.length+1)throw tr(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(A));let R=0;for(let z=1;zs});class cPe{static colorizeElement(e,t,i,n){n=n||{};const o=n.theme||"vs",r=n.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=PYt?.createHTML(d)??d;i.innerHTML=h};return this.colorize(t,c||"",a,n).then(l,d=>console.error(d))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),V1e(t)&&(t=t.substr(1));const a=iv(t);if(!e.isRegisteredLanguageId(i))return P3e(a,r,o);const c=await Ta.getOrCreate(i);return c?FYt(a,r,c,o):P3e(a,r,o)}static colorizeLine(e,t,i,n,o=4){const r=hp.isBasicASCII(e,t),a=hp.containsRTL(e,r,i);return Ore(new pI(!1,!0,e,!1,r,a,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function FYt(s,e,t,i){return new Promise((n,o)=>{const r=()=>{const a=OYt(s,e,t,i);if(t instanceof U$){const c=t.getLoadStatus();if(c.loaded===!1){c.promise.then(r,o);return}}n(a)};r()})}function P3e(s,e,t){let i=[];const n=(Vo.None<>>0,o=new Uint32Array(2);o[0]=0,o[1]=n;for(let r=0,a=s.length;r")}return i.join("")}function OYt(s,e,t,i){let n=[],o=t.getInitialState();for(let r=0,a=s.length;r"),o=l.endState}return n.join("")}function BYt(s,e,t){return Dt.initialize(t||{}).createInstance(EM,s,e)}function WYt(s){return Dt.get(Kt).onCodeEditorAdd(t=>{s(t)})}function HYt(s){return Dt.get(Kt).onDiffEditorAdd(t=>{s(t)})}function UYt(){return Dt.get(Kt).listCodeEditors()}function VYt(){return Dt.get(Kt).listDiffEditors()}function zYt(s,e,t){return Dt.initialize(t||{}).createInstance(kJ,s,e)}function $Yt(s,e){const t=Dt.initialize(e||{});return new mve(s,{},t)}function GYt(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return _t.registerCommand(s.id,s.run)}function KYt(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=he.deserialize(s.precondition),t=(n,...o)=>hc.runEditorCommand(n,o,e,(r,a,c)=>Promise.resolve(s.run(a,...c))),i=new Z;if(i.add(_t.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(jn.appendMenuItem(_e.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=Dt.get(Ut);if(!(n instanceof $k))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=he.and(e,he.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function qYt(s){return _st([s])}function _st(s){const e=Dt.get(Ut);return e instanceof $k?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:he.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),V.None)}function QYt(s,e,t){const i=Dt.get(xi),n=i.getLanguageIdByMimeType(e)||e;return PYe(Dt.get(gi),i,s,n,t)}function jYt(s,e){const t=Dt.get(xi),i=t.getLanguageIdByMimeType(e)||e||Ca;s.setLanguage(t.createById(i))}function YYt(s,e,t){s&&Dt.get(ym).changeOne(e,s.uri,t)}function JYt(s){Dt.get(ym).changeAll(s,[])}function XYt(s){return Dt.get(ym).read(s)}function ZYt(s){return Dt.get(ym).onMarkerChanged(s)}function eJt(s){return Dt.get(gi).getModel(s)}function tJt(){return Dt.get(gi).getModels()}function iJt(s){return Dt.get(gi).onModelAdded(s)}function nJt(s){return Dt.get(gi).onModelRemoved(s)}function sJt(s){return Dt.get(gi).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function oJt(s){return dgt(Dt.get(gi),Dt.get(Vs),s)}function rJt(s,e){const t=Dt.get(xi),i=Dt.get(ov);return cPe.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function aJt(s,e,t){const i=Dt.get(xi);return Dt.get(ov).registerEditorContainer(si.document.body),cPe.colorize(i,s,e,t)}function cJt(s,e,t=4){return Dt.get(ov).registerEditorContainer(si.document.body),cPe.colorizeModelLine(s,e,t)}function lJt(s){const e=Ta.get(s);return e||{getInitialState:()=>P8,tokenize:(t,i,n)=>MKe(s,n)}}function dJt(s,e){Ta.getOrCreate(e);const t=lJt(e),i=iv(s),n=[];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 s.openCodeEditor(i,t.resource,r)?i:null})}function _Jt(){return{create:BYt,getEditors:UYt,getDiffEditors:VYt,onDidCreateEditor:WYt,onDidCreateDiffEditor:HYt,createDiffEditor:zYt,addCommand:GYt,addEditorAction:KYt,addKeybindingRule:qYt,addKeybindingRules:_st,createModel:QYt,setModelLanguage:jYt,setModelMarkers:YYt,getModelMarkers:XYt,removeAllMarkers:JYt,onDidChangeMarkers:ZYt,getModels:tJt,getModel:eJt,onDidCreateModel:iJt,onWillDisposeModel:nJt,onDidChangeModelLanguage:sJt,createWebWorker:oJt,colorizeElement:rJt,colorize:aJt,colorizeModelLine:cJt,tokenize:dJt,defineTheme:hJt,setTheme:uJt,remeasureFonts:gJt,registerCommand:fJt,registerLinkOpener:pJt,registerEditorOpener:mJt,AccessibilitySupport:afe,ContentWidgetPositionPreference:gfe,CursorChangeReason:ffe,DefaultEndOfLine:pfe,EditorAutoIndentStrategy:_fe,EditorOption:vfe,EndOfLinePreference:bfe,EndOfLineSequence:wfe,MinimapPosition:Lfe,MinimapSectionHeaderStyle:Rfe,MouseTargetType:Mfe,OverlayWidgetPositionPreference:Ffe,OverviewRulerLane:Ofe,GlyphMarginLane:yfe,RenderLineNumbersType:Hfe,RenderMinimap:Ufe,ScrollbarVisibility:zfe,ScrollType:Vfe,TextEditorCursorBlinkingStyle:jfe,TextEditorCursorStyle:Yfe,TrackedRangeStickiness:Jfe,WrappingIndent:Xfe,InjectedTextCursorStops:Afe,PositionAffinity:Wfe,ShowLightbulbIconMode:Gfe,ConfigurationChangedEvent:Q6e,BareFontInfo:_x,FontInfo:pq,TextModelResolvedOptions:vq,FindMatch:M8,ApplyUpdateResult:QV,EditorZoom:Gp,createMultiFileDiffEditor:$Yt,EditorType:_U,EditorOptions:vh}}function vJt(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function OK(s,e){return typeof s=="boolean"?s:e}function F3e(s,e){return typeof s=="string"?s:e}function bJt(s){const e={};for(const t of s)e[t]=!0;return e}function O3e(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=bJt(s);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 EDe(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let c="";if(typeof s[a]=="string")c=s[a];else if(s[a]&&s[a]instanceof RegExp)c=s[a].source;else throw s[a]===void 0?tr(s,"language definition does not contain attribute '"+a+"', used at: "+e):tr(s,"attribute reference '"+a+"' must be a string, used at: "+e);return t1(c)?"":"(?:"+c+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const o=(s.ignoreCase?"i":"")+(s.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(LYt(s,e,l),o)),c)}return new RegExp(e,o)}function wJt(s,e,t,i){if(i<0)return s;if(i=100){i=i-100;const n=t.split(".");if(n.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=HH.Open;else if(t.bracket==="@close")i.bracket=HH.Close;else throw tr(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw tr(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!RYt(s,nx(s,n,"",[],""))))throw tr(s,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}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,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,o=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=EDe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=xDe(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function vst(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:OK(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:OK(e.ignoreCase,!1),unicode:OK(e.unicode,!1),tokenPostfix:F3e(e.tokenPostfix,"."+s),defaultToken:F3e(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=s,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 n(r,a,c){for(const l of c){let d=l.include;if(d){if(typeof d!="string")throw tr(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw tr(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const h=new CJt(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 tr(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 tr(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=OK(l.matchOnlyAtLineStart,!1)),h.setRegex(i,l.regex),h.setAction(i,l.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw tr(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,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw tr(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 tr(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:pA(t,a.open),close:pA(t,a.close)});else throw tr(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 SJt(s){mT.registerLanguage(s)}function AJt(){let s=[];return s=s.concat(mT.getLanguages()),s}function EJt(s){return Dt.get(xi).languageIdCodec.encodeLanguageId(s)}function xJt(s,e){return Dt.withServices(()=>{const i=Dt.get(xi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function DJt(s,e){return Dt.withServices(()=>{const i=Dt.get(xi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function kJt(s,e){if(!Dt.get(xi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return Dt.get(Vs).register(s,e,100)}class IJt{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 V$.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new Dre(n.tokens,n.endState)}}class V${constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=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?TJt(i)?wst(s,i):new U$(Dt.get(xi),Dt.get(ov),s,vst(s,i),Dt.get(Te)):null});return Ta.registerFactory(s,t)}function MJt(s,e){if(!Dt.get(xi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return bst(e)?lPe(s,{create:()=>e}):Ta.register(s,wst(s,e))}function NJt(s,e){const t=i=>new U$(Dt.get(xi),Dt.get(ov),s,vst(s,i),Dt.get(Te));return bst(e)?lPe(s,{create:()=>e}):Ta.register(s,t(e))}function PJt(s,e){return Dt.get(it).referenceProvider.register(s,e)}function FJt(s,e){return Dt.get(it).renameProvider.register(s,e)}function OJt(s,e){return Dt.get(it).newSymbolNamesProvider.register(s,e)}function BJt(s,e){return Dt.get(it).signatureHelpProvider.register(s,e)}function WJt(s,e){return Dt.get(it).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(c=>{if(c)return!c.range&&a&&(c.range=new F(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),c.range||(c.range=new F(n.lineNumber,n.column,n.lineNumber,n.column)),c})}})}function HJt(s,e){return Dt.get(it).documentSymbolProvider.register(s,e)}function UJt(s,e){return Dt.get(it).documentHighlightProvider.register(s,e)}function VJt(s,e){return Dt.get(it).linkedEditingRangeProvider.register(s,e)}function zJt(s,e){return Dt.get(it).definitionProvider.register(s,e)}function $Jt(s,e){return Dt.get(it).implementationProvider.register(s,e)}function GJt(s,e){return Dt.get(it).typeDefinitionProvider.register(s,e)}function KJt(s,e){return Dt.get(it).codeLensProvider.register(s,e)}function qJt(s,e,t){return Dt.get(it).codeActionProvider.register(s,{providedCodeActionKinds:t?.providedCodeActionKinds,documentation:t?.documentation,provideCodeActions:(n,o,r,a)=>{const l=Dt.get(ym).read({resource:n.uri}).filter(d=>F.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:l,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function QJt(s,e){return Dt.get(it).documentFormattingEditProvider.register(s,e)}function jJt(s,e){return Dt.get(it).documentRangeFormattingEditProvider.register(s,e)}function YJt(s,e){return Dt.get(it).onTypeFormattingEditProvider.register(s,e)}function JJt(s,e){return Dt.get(it).linkProvider.register(s,e)}function XJt(s,e){return Dt.get(it).completionProvider.register(s,e)}function ZJt(s,e){return Dt.get(it).colorProvider.register(s,e)}function eXt(s,e){return Dt.get(it).foldingRangeProvider.register(s,e)}function tXt(s,e){return Dt.get(it).declarationProvider.register(s,e)}function iXt(s,e){return Dt.get(it).selectionRangeProvider.register(s,e)}function nXt(s,e){return Dt.get(it).documentSemanticTokensProvider.register(s,e)}function sXt(s,e){return Dt.get(it).documentRangeSemanticTokensProvider.register(s,e)}function oXt(s,e){return Dt.get(it).inlineCompletionsProvider.register(s,e)}function rXt(s,e){return Dt.get(it).inlineEditProvider.register(s,e)}function aXt(s,e){return Dt.get(it).inlayHintsProvider.register(s,e)}function cXt(){return{register:SJt,getLanguages:AJt,onLanguage:xJt,onLanguageEncountered:DJt,getEncodedLanguageId:EJt,setLanguageConfiguration:kJt,setColorMap:RJt,registerTokensProviderFactory:lPe,setTokensProvider:MJt,setMonarchTokensProvider:NJt,registerReferenceProvider:PJt,registerRenameProvider:FJt,registerNewSymbolNameProvider:OJt,registerCompletionItemProvider:XJt,registerSignatureHelpProvider:BJt,registerHoverProvider:WJt,registerDocumentSymbolProvider:HJt,registerDocumentHighlightProvider:UJt,registerLinkedEditingRangeProvider:VJt,registerDefinitionProvider:zJt,registerImplementationProvider:$Jt,registerTypeDefinitionProvider:GJt,registerCodeLensProvider:KJt,registerCodeActionProvider:qJt,registerDocumentFormattingEditProvider:QJt,registerDocumentRangeFormattingEditProvider:jJt,registerOnTypeFormattingEditProvider:YJt,registerLinkProvider:JJt,registerColorProvider:ZJt,registerFoldingRangeProvider:eXt,registerDeclarationProvider:tXt,registerSelectionRangeProvider:iXt,registerDocumentSemanticTokensProvider:nXt,registerDocumentRangeSemanticTokensProvider:sXt,registerInlineCompletionsProvider:oXt,registerInlineEditProvider:rXt,registerInlayHintsProvider:aXt,DocumentHighlightKind:mfe,CompletionItemKind:dfe,CompletionItemTag:hfe,CompletionItemInsertTextRule:lfe,SymbolKind:qfe,SymbolTag:Qfe,IndentAction:Sfe,CompletionTriggerKind:ufe,SignatureHelpTriggerKind:Kfe,InlayHintKind:Efe,InlineCompletionTriggerKind:xfe,InlineEditTriggerKind:Dfe,CodeActionTriggerType:cfe,NewSymbolNameTag:Nfe,NewSymbolNameTriggerKind:Pfe,PartialAcceptTriggerKind:Bfe,HoverVerbosityAction:Cfe,FoldingRangeKind:r_,SelectedSuggestionInfo:aGe}}vh.wrappingIndent.defaultValue=Ru.None;vh.glyphMargin.defaultValue=!1;vh.autoIndent.defaultValue=cl.Advanced;vh.overviewRulerLanes.defaultValue=2;lW.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const _u=lGe();_u.editor=_Jt();_u.languages=cXt();_u.CancellationTokenSource;_u.Emitter;_u.KeyCode;_u.KeyMod;_u.Position;_u.Range;_u.Selection;_u.SelectionDirection;_u.MarkerSeverity;_u.MarkerTag;const qv=_u.Uri;_u.Token;const hN=_u.editor,Vx=_u.languages,lXt=globalThis.MonacoEnvironment;(lXt?.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=_u);const dXt=Vx.onLanguage;Vx.onLanguage=(s,e)=>hst(()=>dXt(s,e));const hXt=Vx.onLanguage;Vx.onLanguageEncountered=(s,e)=>hst(()=>hXt(s,e));hN.create=EYt;hN.createDiffEditor=xYt;hN.createModelReference=SYt;hN.writeFile=gst;const uXt={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"}]]}};function jce(s,e,t="OK",i=()=>{},n=()=>{}){const o=document.createElement("dialog");o.classList.add("dialog"),o.classList.add("modal"),o.classList.add(s);const r=document.createElement("div");r.classList.add("titlebar");const a=document.createElement("i");a.classList.add("close_button"),a.classList.add("fa"),a.classList.add("fa-times"),a.onclick=()=>o.close(),r.appendChild(a);const c=document.createElement("div");c.classList.add("dialog_content");const l=document.createElement("button");let d=[];typeof e=="function"?d=e(u=>{l.disabled=!u}):d=e;for(const u of d)c.appendChild(u);const h=document.createElement("div");h.classList.add("button_row"),l.innerText=t,l.onclick=()=>{i(),o.close()},h.appendChild(l),o.appendChild(r),o.appendChild(c),o.appendChild(h),document.body.appendChild(o),o.onclose=n,o.showModal()}function gXt(s){alert(s)}function B3e(...s){const e=document.createElement("p");e.innerText="Share this URL:";const t=[e];for(const i of s){const n=document.createElement("div");n.classList.add("url");const o=document.createElement("p");o.className="url_text",o.innerHTML=''+i+"";const r=document.createElement("button");r.classList.add("button"),r.classList.add("copy_url"),r.onclick=()=>navigator.clipboard.writeText(i);const a=document.createElement("i");a.classList.add("fa"),a.classList.add("fa-copy"),r.appendChild(a),n.appendChild(o),n.appendChild(r),t.push(n)}jce("report_export_url",t)}async function fXt(s){const e=document.createElement("textarea");e.cols=80,e.rows=5,e.autofocus=!0,e.placeholder="Description";const t=document.createElement("div"),i=document.createElement("input");i.type="checkbox",i.id="is_public",i.checked=!0;const n=document.createElement("label");n.innerText="Create public Gist",n.htmlFor="is_public",t.appendChild(i),t.appendChild(n),jce("gist_export_dialog",[e,t],"Export",()=>s(e.value,i.checked))}function pXt(){const s=document.createElement("div");s.innerHTML=`

    Welcome to SlintPad

    @@ -985,24 +985,24 @@ ${r}`)}}};vDe=D([_(0,I6),_(1,Jt)],vDe);var bDe;let Oie=bDe=class{constructor(e,t which runs in your local VS code installation as well as in the Visual Studio Code for the Web.

    SlintPad is licensed under the GNU GPLv3. The source code is located in our GitHub repository. -

    `,Zce("about_dialog",[s])}const DXt="1.9.0",CPe="github_token_v1";function MDe(){const s=localStorage.getItem(CPe);return s!=null&&s!==""}async function Ist(){return new Promise((s,e)=>{let t=null,i="";const n=o=>o.match(/^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$/);Zce("manage_github_dialog",o=>{o(!0);const r=document.createElement("div");r.classList.add("description_area");const a=document.createElement("p");r.appendChild(a);const c=document.createElement("div");c.classList.add("current_state");const l=document.createElement("input");l.classList.add("token_input"),l.type="text",l.pattern="^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$",l.oninput=()=>{const u=l.reportValidity();o(u),u?i=l.value:i=""};const d=document.createElement("button");d.classList.add("forget"),d.classList.add("button"),d.innerText="forget token";function h(u){i=u,i!==""?(l.style.display="none",l.value="",l.readOnly=!0,d.style.display="block",a.innerText="You have a github access token set up."):(a.innerHTML="You have no github access token set up.
    Visit your github account, go to your settings, then developer settings and create a personal access token there with the permission to read and write Gists. Then paste it into the text field below.",l.placeholder="Github personal access token",l.value="",l.style.display="block",l.readOnly=!1,d.style.display="none"),l.value=""}return h(SPe()??""),d.onclick=()=>{h("")},c.appendChild(l),c.appendChild(d),[r,c]},"OK",()=>{(n(i)||i==="")&&localStorage.setItem(CPe,i),t=MDe()},()=>{s(t)})})}function SPe(){return localStorage.getItem(CPe)}function kXt(s){if(s.length===1)return s[0].lastIndexOf("/")+1;let e=0,t=0;for(;s[0][e]&&s.every(i=>i[e]===s[0][e]);)s[0][e]==="/"&&(t=e),e++;return t}async function IXt(s,e,t){const i=SPe();console.assert(i!=null);const n={},o=s.open_document_urls;if(o.length===0)return Promise.reject("Nothing to export");const r=kXt(o),a=o[0];o.sort((u,f)=>u.split("/").length-f.split("/").length);for(const u of o){const f=u.slice(r);if(f.indexOf("/")>=0)return Promise.reject("Gists do not allow to create folders via the API");n[f]={content:s.document_contents(u)??""}}const c={};Object.entries(s.extra_files).forEach(async([u,f])=>{c[u.slice(1)]=f});const l={main:a.slice(r),mappings:c,slint_version:DXt};n["slint.json"]={content:JSON.stringify(l)};const d=JSON.stringify({description:e,public:t,files:n}),h=await fetch("https://api.github.com/gists",{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/vnd.github+json",Authorization:"Bearer "+i},redirect:"follow",referrerPolicy:"no-referrer",body:d});if(h.ok){const u=await h.json();if(u.errors){for(const f of u.errors)console.error(JSON.stringify(f));return Promise.reject(`Failed to publish to Github: + `,jce("about_dialog",[s])}const mXt="1.9.0",dPe="github_token_v1";function DDe(){const s=localStorage.getItem(dPe);return s!=null&&s!==""}async function yst(){return new Promise((s,e)=>{let t=null,i="";const n=o=>o.match(/^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$/);jce("manage_github_dialog",o=>{o(!0);const r=document.createElement("div");r.classList.add("description_area");const a=document.createElement("p");r.appendChild(a);const c=document.createElement("div");c.classList.add("current_state");const l=document.createElement("input");l.classList.add("token_input"),l.type="text",l.pattern="^github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}$",l.oninput=()=>{const u=l.reportValidity();o(u),u?i=l.value:i=""};const d=document.createElement("button");d.classList.add("forget"),d.classList.add("button"),d.innerText="forget token";function h(u){i=u,i!==""?(l.style.display="none",l.value="",l.readOnly=!0,d.style.display="block",a.innerText="You have a github access token set up."):(a.innerHTML="You have no github access token set up.
    Visit your github account, go to your settings, then developer settings and create a personal access token there with the permission to read and write Gists. Then paste it into the text field below.",l.placeholder="Github personal access token",l.value="",l.style.display="block",l.readOnly=!1,d.style.display="none"),l.value=""}return h(hPe()??""),d.onclick=()=>{h("")},c.appendChild(l),c.appendChild(d),[r,c]},"OK",()=>{(n(i)||i==="")&&localStorage.setItem(dPe,i),t=DDe()},()=>{s(t)})})}function hPe(){return localStorage.getItem(dPe)}function _Xt(s){if(s.length===1)return s[0].lastIndexOf("/")+1;let e=0,t=0;for(;s[0][e]&&s.every(i=>i[e]===s[0][e]);)s[0][e]==="/"&&(t=e),e++;return t}async function vXt(s,e,t){const i=hPe();console.assert(i!=null);const n={},o=s.open_document_urls;if(o.length===0)return Promise.reject("Nothing to export");const r=_Xt(o),a=o[0];o.sort((u,f)=>u.split("/").length-f.split("/").length);for(const u of o){const f=u.slice(r);if(f.indexOf("/")>=0)return Promise.reject("Gists do not allow to create folders via the API");n[f]={content:s.document_contents(u)??""}}const c={};Object.entries(s.extra_files).forEach(async([u,f])=>{c[u.slice(1)]=f});const l={main:a.slice(r),mappings:c,slint_version:mXt};n["slint.json"]={content:JSON.stringify(l)};const d=JSON.stringify({description:e,public:t,files:n}),h=await fetch("https://api.github.com/gists",{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/vnd.github+json",Authorization:"Bearer "+i},redirect:"follow",referrerPolicy:"no-referrer",body:d});if(h.ok){const u=await h.json();if(u.errors){for(const f of u.errors)console.error(JSON.stringify(f));return Promise.reject(`Failed to publish to Github: `+u.message)}else return u.html_url==null?Promise.reject("Failed to retrieve URL after publishing to Github"):Promise.resolve(u.html_url)}else{let u="";return h.status===422&&(d.length>5e4?u=` Your project too big to create a Gist from.`:u=` Is your project too big for a Gist?`),Promise.reject("Failed to publish a Gist to Github with status code:"+h.status+` -`+h.statusText+u)}}async function TXt(s){const e=s.pathname.split("/");if(e.length===3||e.length===2){const t=e[e.length-1];try{const i={Accept:"application/vnd.github+json"},n=SPe();n!=null&&(i.Authorization="Bearer "+n);const r=await(await fetch("https://api.github.com/gists/"+t,{method:"GET",headers:i})).json(),a={};let c,l,d;for(const[m,v]of Object.entries(r.files))if(m==="slint.json"){const b=JSON.parse(v.content);c=b.main;const w=b.mappings;Object.entries(w).forEach(([y,C])=>{a["/"+y]=C})}else{const b=v.raw_url;l==null&&(l=m,d=b),a["/"+m]=b}const h=new jii(a);if(r.errors)return Promise.reject(`Failed to read gist: +`+h.statusText+u)}}async function bXt(s){const e=s.pathname.split("/");if(e.length===3||e.length===2){const t=e[e.length-1];try{const i={Accept:"application/vnd.github+json"},n=hPe();n!=null&&(i.Authorization="Bearer "+n);const r=await(await fetch("https://api.github.com/gists/"+t,{method:"GET",headers:i})).json(),a={};let c,l,d;for(const[m,v]of Object.entries(r.files))if(m==="slint.json"){const b=JSON.parse(v.content);c=b.main;const w=b.mappings;Object.entries(w).forEach(([y,C])=>{a["/"+y]=C})}else{const b=v.raw_url;l==null&&(l=m,d=b),a["/"+m]=b}const h=new Bii(a);if(r.errors)return Promise.reject(`Failed to read gist: `+r.errors.join(` `));const u=r.description.match(/main file is: "(.+)"/i)?.[1];let f=c??u??"main.slint",p=a["/"+f];return p==null&&(f=l,p=d),Promise.resolve([p,"/"+f,h])}catch(i){return Promise.reject(`Failed to retrieve information on Gist: -`+i)}}return Promise.resolve([s.toString(),null,null])}async function LXt(s){const e=s.pathname.split("/");return e[3]==="blob"?(e.splice(3,1),Promise.resolve([s.protocol+"//raw.githubusercontent.com"+e.join("/"),null,null])):Promise.resolve([s.toString(),null,null])}async function RXt(s){try{const e=new URL(s);if(e.hostname==="gist.github.com")return TXt(e);if(e.hostname==="github.com")return LXt(e)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Nt;(function(s){function e(k,P,R=0,z=-1){let G=k.length;if(G===0)return-1;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let Y;z0;){let ge=ne>>1,De=j+ge;R(k[De],P)<0?(j=De+1,ne-=ge+1):ne=ge}return j}s.lowerBound=a;function c(k,P,R,z=0,G=-1){let Y=k.length;if(Y===0)return 0;z<0?z=Math.max(0,z+Y):z=Math.min(z,Y-1),G<0?G=Math.max(0,G+Y):G=Math.min(G,Y-1);let j=z,ne=G-z+1;for(;ne>0;){let ge=ne>>1,De=j+ge;R(k[De],P)>0?ne=ge:(j=De+1,ne-=ge+1)}return j}s.upperBound=c;function l(k,P,R){if(k===P)return!0;if(k.length!==P.length)return!1;for(let z=0,G=k.length;z=Y&&(R=G<0?Y-1:Y),z===void 0?z=G<0?-1:Y:z<0?z=Math.max(z+Y,G<0?-1:0):z>=Y&&(z=G<0?Y-1:Y);let j;G<0&&z>=R||G>0&&R>=z?j=0:G<0?j=Math.floor((z-R+1)/G+1):j=Math.floor((z-R-1)/G+1);let ne=[];for(let ge=0;ge=z))return;let Y=z-R+1;if(P>0?P=P%Y:P<0&&(P=(P%Y+Y)%Y),P===0)return;let j=R+P;u(k,R,j-1),u(k,j,z),u(k,R,z)}s.rotate=f;function p(k,P,R=0,z=-1){let G=k.length;if(G===0)return;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let Y;zP;--G)k[G]=k[G-1];k[P]=R}s.insert=m;function v(k,P){let R=k.length;if(P<0&&(P+=R),P<0||P>=R)return;let z=k[P];for(let G=P+1;G=R&&j<=z&&k[j]===P||z=R)&&k[j]===P?Y++:Y>0&&(k[j-Y]=k[j]);return Y>0&&(k.length=G-Y),Y}s.removeAllOf=y;function C(k,P,R=0,z=-1){let G,Y=i(k,P,R,z);return Y!==-1&&(G=v(k,Y)),{index:Y,value:G}}s.removeFirstWhere=C;function A(k,P,R=-1,z=0){let G,Y=n(k,P,R,z);return Y!==-1&&(G=v(k,Y)),{index:Y,value:G}}s.removeLastWhere=A;function L(k,P,R=0,z=-1){let G=k.length;if(G===0)return 0;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let Y=0;for(let j=0;j=R&&j<=z&&P(k[j],j)||z=R)&&P(k[j],j)?Y++:Y>0&&(k[j-Y]=k[j]);return Y>0&&(k.length=G-Y),Y}s.removeAllWhere=L})(Nt||(Nt={}));function*T4(){}function NDe(s,e){let t=0;for(const i of s)if(e(i,t++))return i}function MXt(s,e){let t=0;for(const i of s)if(e(i,t++)===!1)return!1;return!0}function NXt(s,e){let t=0;for(const i of s)if(e(i,t++))return!0;return!1}var J3e;(function(s){function e(t,i,n){return n===0?1/0:t>i&&n>0||t-1;e--)yield s[e]}function FXt(s){let e=[],t=new Set,i=new Map;for(const r of s)n(r);for(const[r]of i)o(r);return e;function n(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 K$;(function(s){function e(r,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}s.cmp=o})(K$||(K$={}));var Xc;(function(s){s.emptyObject=Object.freeze({}),s.emptyArray=Object.freeze([]);function e(d){return d===null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"}s.isPrimitive=e;function t(d){return Array.isArray(d)}s.isArray=t;function i(d){return!e(d)&&!t(d)}s.isObject=i;function n(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)}s.deepEqual=n;function o(d){return e(d)?d:t(d)?c(d):l(d)}s.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(" -> ")}.`)}s.ensureNoCycle=i;function n(r,a,c){const l=new Array,d=m=>{const v=a.get(m),b=[...v.requires,...v.optional];l.push(...b.reduce((w,y)=>{const C=c.get(y);return C&&w.push([m,C]),w},[]))};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(b=>b[0]));for(const b of v)l.filter(w=>w[1]===b).forEach(w=>{h.includes(w)||h.push(w)});u=m}const f=FXt(h),p=f.findIndex(m=>m===r);return p===-1?[r]:f.slice(0,p+1)}s.findDependents=n;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)}s.collectStartupPlugins=o})(X3e||(X3e={}));function BXt(s){let e=0;for(let t=0,i=s.length;t>>0),s[t]=e&255,e>>>=8}var PDe;(function(s){s.getRandomValues=(()=>{const e=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:BXt})()})(PDe||(PDe={}));function WXt(s){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 s(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 FDe;(function(s){s.uuid4=WXt(PDe.getRandomValues)})(FDe||(FDe={}));var Z3e;(function(s){function e(t){const i=document.body,n=o=>{o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",t),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}s.copyText=e})(Z3e||(Z3e={}));var Fa;(function(s){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}}s.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}}s.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(n)){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}s.calculateSingle=e;const t=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(Mv||(Mv={}));class ODe{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 PC.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 PC.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 PC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new PC.LinkedListNode(this,e),n=t,o=n.prev;return i.next=n,i.prev=o,n.prev=i,o.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof PC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new PC.LinkedListNode(this,e),n=t,o=n.next;return i.next=o,i.prev=n,n.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 PC.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(s){function e(t){let i=new s;return i.assign(t),i}s.from=e})(ODe||(ODe={}));var PC;(function(s){class e{constructor(i,n){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=n}}s.LinkedListNode=e})(PC||(PC={}));let Hm=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}};class FV extends Hm{get isConflatable(){return!0}conflate(e){return!0}}var zt;(function(s){let e=null;const t=(P=>R=>{let z=!1;return P.then(()=>!z&&R()),()=>{z=!0}})(Promise.resolve());function i(P,R){let z=u.get(P);if(!z||z.length===0){b(P,R);return}MXt(PXt(z),Y=>Y?v(Y,P,R):!0)&&b(P,R)}s.sendMessage=i;function n(P,R){if(!R.isConflatable){w(P,R);return}NXt(h,G=>G.handler!==P||!G.msg||G.msg.type!==R.type||!G.msg.isConflatable?!1:G.msg.conflate(R))||w(P,R)}s.postMessage=n;function o(P,R){let z=u.get(P);z&&z.indexOf(R)!==-1||(z?z.push(R):u.set(P,[R]))}s.installMessageHook=o;function r(P,R){let z=u.get(P);if(!z)return;let G=z.indexOf(R);G!==-1&&(z[G]=null,C(z))}s.removeMessageHook=r;function a(P){let R=u.get(P);R&&R.length>0&&(Nt.fill(R,null),C(R));for(const z of h)z.handler===P&&(z.handler=null,z.msg=null)}s.clearData=a;function c(){m||e===null||(e(),e=null,m=!0,y(),m=!1)}s.flush=c;function l(){return p}s.getExceptionHandler=l;function d(P){let R=p;return p=P,R}s.setExceptionHandler=d;const h=new ODe,u=new WeakMap,f=new Set;let p=P=>{console.error(P)},m=!1;function v(P,R,z){let G=!0;try{typeof P=="function"?G=P(R,z):G=P.messageHook(R,z)}catch(Y){p(Y)}return G}function b(P,R){try{P.processMessage(R)}catch(z){p(z)}}function w(P,R){h.addLast({handler:P,msg:R}),e===null&&(e=t(y))}function y(){if(e=null,h.isEmpty)return;let P={handler:null,msg:null};for(h.addLast(P);;){let R=h.removeFirst();if(R===P)return;R.handler&&R.msg&&i(R.handler,R.msg)}}function C(P){f.size===0&&t(A),f.add(P)}function A(){f.forEach(L),f.clear()}function L(P){Nt.removeAllWhere(P,k)}function k(P){return P===null}})(zt||(zt={}));class nv{constructor(e){this._pid=V1.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=V1.ensureMap(e);return this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e),t}set(e,t){let i,n=V1.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);let o=this._coerceValue(e,t);this._maybeNotify(e,i,n[this._pid]=o)}coerce(e){let t,i=V1.ensureMap(e);this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e);let n=this._coerceValue(e,t);this._maybeNotify(e,t,i[this._pid]=n)}_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 n=this._changed;n&&!this._compareValue(t,i)&&n(e,t,i)}}(function(s){function e(t){V1.ownerData.delete(t)}s.clearData=e})(nv||(nv={}));var V1;(function(s){s.ownerData=new WeakMap,s.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})();function e(t){let i=s.ownerData.get(t);return i||(i=Object.create(null),s.ownerData.set(t,i),i)}s.ensureMap=e})(V1||(V1={}));class Qa{constructor(e){this.sender=e}connect(e,t){return Wp.connect(this,e,t)}disconnect(e,t){return Wp.disconnect(this,e,t)}emit(e){Wp.emit(this,e)}}(function(s){function e(c,l){Wp.disconnectBetween(c,l)}s.disconnectBetween=e;function t(c){Wp.disconnectSender(c)}s.disconnectSender=t;function i(c){Wp.disconnectReceiver(c)}s.disconnectReceiver=i;function n(c){Wp.disconnectAll(c)}s.disconnectAll=n;function o(c){Wp.disconnectAll(c)}s.clearData=o;function r(){return Wp.exceptionHandler}s.getExceptionHandler=r;function a(c){let l=Wp.exceptionHandler;return Wp.exceptionHandler=c,l}s.setExceptionHandler=a})(Qa||(Qa={}));var Wp;(function(s){s.exceptionHandler=w=>{console.error(w)};function e(w,y,C){C=C||void 0;let A=c.get(w.sender);if(A||(A=[],c.set(w.sender,A)),u(A,w,y,C))return!1;let L=C||y,k=l.get(L);k||(k=[],l.set(L,k));let P={signal:w,slot:y,thisArg:C};return A.push(P),k.push(P),!0}s.connect=e;function t(w,y,C){C=C||void 0;let A=c.get(w.sender);if(!A||A.length===0)return!1;let L=u(A,w,y,C);if(!L)return!1;let k=C||y,P=l.get(k);return L.signal=null,p(A),p(P),!0}s.disconnect=t;function i(w,y){let C=c.get(w);if(!C||C.length===0)return;let A=l.get(y);if(!(!A||A.length===0)){for(const L of A)L.signal&&L.signal.sender===w&&(L.signal=null);p(C),p(A)}}s.disconnectBetween=i;function n(w){let y=c.get(w);if(!(!y||y.length===0)){for(const C of y){if(!C.signal)continue;let A=C.thisArg||C.slot;C.signal=null,p(l.get(A))}p(y)}}s.disconnectSender=n;function o(w){let y=l.get(w);if(!(!y||y.length===0)){for(const C of y){if(!C.signal)continue;let A=C.signal.sender;C.signal=null,p(c.get(A))}p(y)}}s.disconnectReceiver=o;function r(w){n(w),o(w)}s.disconnectAll=r;function a(w,y){let C=c.get(w.sender);if(!(!C||C.length===0))for(let A=0,L=C.length;AL.signal===y&&L.slot===C&&L.thisArg===A)}function f(w,y){let{signal:C,slot:A,thisArg:L}=w;try{A.call(L,C.sender,y)}catch(k){s.exceptionHandler(k)}}function p(w){d.size===0&&h(m),d.add(w)}function m(){d.forEach(v),d.clear()}function v(w){Nt.removeAllWhere(w,b)}function b(w){return w.signal===null}})(Wp||(Wp={}));class BDe{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class WDe{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(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(WDe||(WDe={}));class e9e extends WDe{constructor(){super(...arguments),this._disposed=new Qa(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),Qa.clearData(this))}}(function(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(e9e||(e9e={}));class qh{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:n}=this._scrollTarget,o=Su.SCROLL_EDGE_SIZE-n,r=Math.pow(o/Su.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(r*Su.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});Su.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(n=>{this._resolve=n});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"){Su.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Su.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=Su.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,i=this._currentTarget,n=this._currentElement,o=Su.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==n&&o!==i&&Su.dispatchDragExit(this,i,o,e),o!==n&&o!==i&&(i=Su.dispatchDragEnter(this,o,i,e)),i!==t&&(this._currentTarget=i,Su.dispatchDragLeave(this,t,i,e));let r=Su.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=Su.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=qh.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=qh.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=qh.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=qh.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(s){class e extends DragEvent{constructor(n,o){super(o.type,{bubbles:!0,cancelable:!0,altKey:n.altKey,button:n.button,clientX:n.clientX,clientY:n.clientY,ctrlKey:n.ctrlKey,detail:0,metaKey:n.metaKey,relatedTarget:o.related,screenX:n.screenX,screenY:n.screenY,shiftKey:n.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}}s.Event=e;function t(i,n=document){return Su.overrideCursor(i,n)}s.overrideCursor=t})(qh||(qh={}));var Su;(function(s){s.SCROLL_EDGE_SIZE=20;function e(C,A){return h[C]&u[A]?C:"none"}s.validateAction=e;function t(C,A=document){if(C){if(i&&C==i.event)return i.element;s.cursorBackdrop.style.zIndex="-1000";const L=A.elementFromPoint(C.clientX,C.clientY);return s.cursorBackdrop.style.zIndex="",i={event:C,element:L},L}else{const L=s.cursorBackdrop.style.transform;if(n&&L===n.transform)return n.element;const k=s.cursorBackdrop.getBoundingClientRect();s.cursorBackdrop.style.zIndex="-1000";const P=A.elementFromPoint(k.left+k.width/2,k.top+k.height/2);return s.cursorBackdrop.style.zIndex="",n={transform:L,element:P},P}}s.findElementBehindBackdrop=t;let i=null,n=null;function o(C){let A=C.clientX,L=C.clientY,k=t(C);for(;k;k=k.parentElement){if(!k.hasAttribute("data-lm-dragscroll"))continue;let P=0,R=0;k===document.body&&(P=window.pageXOffset,R=window.pageYOffset);let z=k.getBoundingClientRect(),G=z.top+R,Y=z.left+P,j=Y+z.width,ne=G+z.height;if(A=j||L=ne)continue;let ge=A-Y+1,De=L-G+1,Oe=j-A,yt=ne-L,Ne=Math.min(ge,De,Oe,yt);if(Ne>s.SCROLL_EDGE_SIZE)continue;let lt;switch(Ne){case yt:lt="bottom";break;case De:lt="top";break;case Oe:lt="right";break;case ge:lt="left";break;default:throw"unreachable"}let xt=k.scrollWidth-k.clientWidth,Ji=k.scrollHeight-k.clientHeight,Ii;switch(lt){case"top":Ii=Ji>0&&k.scrollTop>0;break;case"left":Ii=xt>0&&k.scrollLeft>0;break;case"right":Ii=xt>0&&k.scrollLeft0&&k.scrollTop{L===y&&s.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",p,!0),s.cursorBackdrop.removeEventListener("scroll",m,!0),k.removeChild(s.cursorBackdrop))})}s.overrideCursor=f;function p(C){s.cursorBackdrop&&(s.cursorBackdrop.style.transform=`translate(${C.clientX}px, ${C.clientY}px)`)}function m(C){if(!s.cursorBackdrop)return;let A=t();if(!A)return;const L=A.closest("[data-lm-dragscroll]");L&&(L.scrollTop+=s.cursorBackdrop.scrollTop-b,L.scrollLeft+=s.cursorBackdrop.scrollLeft-b,v())}function v(){s.cursorBackdrop.scrollTop=b,s.cursorBackdrop.scrollLeft=b}const b=500;function w(){const C=document.createElement("div");return C.classList.add("lm-cursor-backdrop"),C}let y=0;s.cursorBackdrop=w()})(Su||(Su={}));function Wie(){return HDe.keyboardLayout}class GH{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=GH.extractKeys(t),this._modifierKeys=GH.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(s){function e(i){let n=Object.create(null);for(let o in i)n[i[o]]=!0;return n}s.extractKeys=e;function t(i){let n=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=Xc.emptyObject){var i;let n=this._commands.get(e);return Promise.resolve((i=n?.describedBy.call(void 0,t))!==null&&i!==void 0?i:{args:null})}label(e,t=Xc.emptyObject){var i;let n=this._commands.get(e);return(i=n?.label.call(void 0,t))!==null&&i!==void 0?i:""}mnemonic(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Xc.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Xc.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Xc.emptyObject){let i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));let n;try{n=i.execute.call(void 0,t)}catch(r){n=Promise.reject(r)}let o=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:o}),o}addKeyBinding(e){let t=Bv.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new BDe(()=>{Nt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=lC.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(lC.isModifierKeyPressed(e)){let{exact:r}=Bv.matchKeyBinding(this._keyBindings,[t],e);r?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(r)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:n}=Bv.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=n.length!==0;if(!i&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||n.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)},Bv.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},Bv.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Bv.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]),Bv.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!r)return}let{command:t,args:i}=e,n={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,n)){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,n)}_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(s){function e(a){let c="",l=!1,d=!1,h=!1,u=!1;for(let f of a.split(/\s+/))f==="Accel"?Bu.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}}s.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&&Bu.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}s.normalizeKeystroke=t;function i(a){let c;return Bu.IS_WIN?c=a.winKeys||a.keys:Bu.IS_MAC?c=a.macKeys||a.keys:c=a.linuxKeys||a.keys,c.map(t)}s.normalizeKeys=i;function n(a){return typeof a=="string"?c(a):a.map(c).join(", ");function c(l){let d=[],h=Bu.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),Bu.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(Bv.formatKey).join(h)}}s.formatKeystroke=n;function o(a){let c=Wie(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}s.isModifierKeyPressed=o;function r(a){let c=Wie(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&Bu.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}s.keystrokeForKeydownEvent=r})(lC||(lC={}));var Bv;(function(s){s.CHORD_TIMEOUT=1e3,s.KEYBINDING_HOLD_TIMEOUT=1e3,s.modifierkeyTimeOut=500;function e(y){return{execute:y.execute,describedBy:p(typeof y.describedBy=="function"?y.describedBy:{args:null,...y.describedBy},()=>({args:null})),label:p(y.label,c),mnemonic:p(y.mnemonic,l),icon:p(y.icon,f),iconClass:p(y.iconClass,c),iconLabel:p(y.iconLabel,c),caption:p(y.caption,c),usage:p(y.usage,c),className:p(y.className,c),dataset:p(y.dataset,u),isEnabled:y.isEnabled||d,isToggled:y.isToggled||h,isToggleable:y.isToggleable||!!y.isToggled,isVisible:y.isVisible||d}}s.createCommand=e;function t(y){var C;return{keys:lC.normalizeKeys(y),selector:m(y),command:y.command,args:y.args||Xc.emptyObject,preventDefault:(C=y.preventDefault)!==null&&C!==void 0?C:!0}}s.createKeyBinding=t;function i(y,C,A){let L=null,k=[],P=1/0,R=0;for(let z=0,G=y.length;zP)continue;let ge=MS.calculateSpecificity(Y.selector);(!L||ne=R)&&(L=Y,P=ne,R=ge)}return{exact:L,partial:k}}s.matchKeyBinding=i;function n(y){y.target.dispatchEvent(w(y))}s.replayKeyEvent=n;function o(y){return Bu.IS_MAC?r.hasOwnProperty(y)?r[y]:y:a.hasOwnProperty(y)?a[y]:y}s.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(y,C){return y===void 0?C:typeof y=="function"?y:()=>y}function m(y){if(y.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${y.selector}`);if(!MS.isValid(y.selector))throw new Error(`Invalid selector: ${y.selector}`);return y.selector}function v(y,C){if(y.lengthC.length?2:1}function b(y,C){let A=C.target,L=C.currentTarget;for(let k=0;A!==null;A=A.parentElement,++k){if(A.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(MS.matches(A,y))return k;if(A===L)return-1}return-1}function w(y){let C=document.createEvent("Event"),A=y.bubbles||!0,L=y.cancelable||!0;return C.initEvent(y.type||"keydown",A,L),C.key=y.key||"",C.keyCode=y.keyCode||0,C.which=y.keyCode||0,C.ctrlKey=y.ctrlKey||!1,C.altKey=y.altKey||!1,C.shiftKey=y.shiftKey||!1,C.metaKey=y.metaKey||!1,C.view=y.view||window,C}})(Bv||(Bv={}));class UK{constructor(e){this.type="text",this.content=e}}class Hue{constructor(e,t,i,n){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=n}}function _a(s){let e={},t,i=[];for(let o=1,r=arguments.length;o=b.length){t(m[C],f);continue}let A=b[C],L=m[C];if(A===L){w=w.nextSibling;continue}if(A.type==="text"&&L.type==="text"){w.textContent!==L.content&&(w.textContent=L.content),w=w.nextSibling;continue}if(A.type==="text"||L.type==="text"){Nt.insert(b,C,L),t(L,f,w);continue}if(!A.renderer!=!L.renderer){Nt.insert(b,C,L),t(L,f,w);continue}let k=L.attrs.key;if(k&&k in v){let R=v[k];R.vNode!==A&&(Nt.move(b,b.indexOf(R.vNode,C+1),C),f.insertBefore(R.element,w),A=R.vNode,w=R.element)}if(A===L){w=w.nextSibling;continue}let P=A.attrs.key;if(P&&P!==k){Nt.insert(b,C,L),t(L,f,w);continue}if(A.tag!==L.tag){Nt.insert(b,C,L),t(L,f,w);continue}a(w,A.attrs,L.attrs),L.renderer?L.renderer.render(w,{attrs:L.attrs,children:L.children}):i(w,A.children,L.children),w=w.nextSibling}n(f,b,y,!0)}s.updateContent=i;function n(f,p,m,v){for(let b=p.length-1;b>=m;--b){const w=p[b],y=v?f.lastChild:f.childNodes[b];w.type==="text"||(w.renderer&&w.renderer.unrender?w.renderer.unrender(y,{attrs:w.attrs,children:w.children}):n(y,w.children,0,!1)),v&&f.removeChild(y)}}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,b;for(b in p)b in m||(v[b]="");for(b in m)p[b]!==m[b]&&(v[b]=m[b])}function u(f,p){let m=f.firstChild,v=Object.create(null);for(let b of p)b.type==="element"&&b.attrs.key&&(v[b.attrs.key]={vNode:b,element:m}),m=m.nextSibling;return v}})(r1||(r1={}));class AD{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var Zp;(function(s){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,b=h;for(let w=0;w0&&m>f;){let v=m/p;for(let b=0;b0&&m>f;){let v=m,b=h;for(let w=0;w=y.maxSize?(m-=y.maxSize-y.size,h-=y.stretch,y.size=y.maxSize,y.done=!0,p--,u--):(m-=C,y.size+=C)}}for(;p>0&&m>f;){let v=m/p;for(let b=0;b=w.maxSize?(m-=w.maxSize-w.size,w.size=w.maxSize,w.done=!0,p--):(m-=v,w.size+=v))}}}return 0}s.calc=e;function t(o,r,a){o.length===0||a===0||(a>0?i(o,r,a):n(o,r,-a))}s.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 n(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)}}})(Zp||(Zp={}));class UDe{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 Qa(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,Qa.clearData(this))}}class nt{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new Qa(this),this._hiddenMode=nt.HiddenMode.Display,this.node=Hie.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(nt.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&nt.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Qa.clearData(this),zt.clearData(this),nv.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(nt.Flag.IsDisposed)}get isAttached(){return this.testFlag(nt.Flag.IsAttached)}get isHidden(){return this.testFlag(nt.Flag.IsHidden)}get isVisible(){return this.testFlag(nt.Flag.IsVisible)}get title(){return Hie.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==nt.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 nt.ChildMessage("child-removed",this);zt.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new nt.ChildMessage("child-added",this);zt.sendMessage(this._parent,t)}this.isDisposed||zt.sendMessage(this,nt.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(nt.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(){zt.postMessage(this,nt.Msg.UpdateRequest)}fit(){zt.postMessage(this,nt.Msg.FitRequest)}activate(){zt.postMessage(this,nt.Msg.ActivateRequest)}close(){zt.sendMessage(this,nt.Msg.CloseRequest)}show(){if(this.testFlag(nt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.BeforeShow),this.clearFlag(nt.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.AfterShow),this.parent)){let e=new nt.ChildMessage("child-shown",this);zt.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(nt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.BeforeHide),this.setFlag(nt.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.AfterHide),this.parent)){let e=new nt.ChildMessage("child-hidden",this);zt.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(nt.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(nt.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(nt.Flag.IsVisible),this.setFlag(nt.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(nt.Flag.IsVisible),this.clearFlag(nt.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&&nt.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 nt.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case nt.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case nt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case nt.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case nt.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case nt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(s){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(s.HiddenMode||(s.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"}(s.Flag||(s.Flag={})),function(o){o.BeforeShow=new Hm("before-show"),o.AfterShow=new Hm("after-show"),o.BeforeHide=new Hm("before-hide"),o.AfterHide=new Hm("after-hide"),o.BeforeAttach=new Hm("before-attach"),o.AfterAttach=new Hm("after-attach"),o.BeforeDetach=new Hm("before-detach"),o.AfterDetach=new Hm("after-detach"),o.ParentChanged=new Hm("parent-changed"),o.UpdateRequest=new FV("update-request"),o.FitRequest=new FV("fit-request"),o.ActivateRequest=new FV("activate-request"),o.CloseRequest=new FV("close-request")}(s.Msg||(s.Msg={}));class e extends Hm{constructor(r,a){super(r),this.child=a}}s.ChildMessage=e;class t extends Hm{constructor(r,a){super("resize"),this.width=r,this.height=a}}s.ResizeMessage=t,function(o){o.UnknownSize=new o(-1,-1)}(t=s.ResizeMessage||(s.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.");zt.sendMessage(o,s.Msg.BeforeAttach),r.insertBefore(o.node,a),zt.sendMessage(o,s.Msg.AfterAttach)}s.attach=i;function n(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.");zt.sendMessage(o,s.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),zt.sendMessage(o,s.Msg.AfterDetach)}s.detach=n})(nt||(nt={}));var Hie;(function(s){s.titleProperty=new nv({name:"title",create:t=>new UDe({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}s.createNode=e})(Hie||(Hie={}));class mN{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,Qa.clearData(this),nv.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)zt.sendMessage(t,nt.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)zt.sendMessage(t,nt.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)zt.sendMessage(t,e)}onAfterAttach(e){for(const t of this)zt.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)zt.sendMessage(t,e)}onAfterDetach(e){for(const t of this)zt.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(s){function e(o){return PF.horizontalAlignmentProperty.get(o)}s.getHorizontalAlignment=e;function t(o,r){PF.horizontalAlignmentProperty.set(o,r)}s.setHorizontalAlignment=t;function i(o){return PF.verticalAlignmentProperty.get(o)}s.getVerticalAlignment=i;function n(o,r){PF.verticalAlignmentProperty.set(o,r)}s.setVerticalAlignment=n})(mN||(mN={}));class gG{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=Fa.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,i,n){let o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o"center",changed:e}),s.verticalAlignmentProperty=new nv({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(PF||(PF={}));class ele extends mN{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),n=Math.max(0,Math.min(e,this._widgets.length));if(i===-1){Nt.insert(this._widgets,n,t),this.parent&&this.attachWidget(n,t);return}n===this._widgets.length&&n--,i!==n&&(Nt.move(this._widgets,i,n),this.parent&&this.moveWidget(i,n,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Nt.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&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&zt.sendMessage(i,nt.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&zt.sendMessage(i,nt.Msg.AfterDetach);let n=this.parent.node.children[t];this.parent.isAttached&&zt.sendMessage(i,nt.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&zt.sendMessage(i,nt.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach)}}var q$;(function(s){function e(t){return Math.max(0,Math.floor(t))}s.clampDimension=e})(q$||(q$={}));var Q$=q$;class GA extends ele{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=q$.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=q$.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 vS.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,n=e.slice(0,i);for(;n.length0&&(o.sizeHint=o.size);Zp.adjust(this._sizers,e,n),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 gG(t),n=vS.createHandle(this.renderer),o=vS.averageSize(this._sizers),r=vS.createSizer(o);Nt.insert(this._items,e,i),Nt.insert(this._sizers,e,r),Nt.insert(this._handles,e,n),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(n),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),Nt.move(this._sizers,e,t),Nt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Nt.removeAt(this._items,e),n=Nt.removeAt(this._handles,e);Nt.removeAt(this._sizers,e),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(n),this.parent.isAttached&&zt.sendMessage(t,nt.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,n,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,n,a,o),i+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${o}px`):(n+=this.widgetOffset,c.update(i,n,r,a),n+=a,l.top=`${n}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=GA.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,n+=d.minWidth,o=Math.max(o,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,o+=d.minHeight,n=Math.max(n,d.minWidth))}let r=this._box=Fa.boxSizing(this.parent.node);n+=r.horizontalSum,o+=r.verticalSum;let a=this.parent.node.style;a.minWidth=`${n}px`,a.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&zt.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&zt.sendMessage(this.parent,nt.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=Zp.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 AD;return a.sizeHint=Math.floor(r),a}s.createSizer=e;function t(r){let a=r.createHandle();return a.style.position="absolute",a.style.contain="style",a}s.createHandle=t;function i(r){return r.reduce((a,c)=>a+c.size,0)/r.length||0}s.averageSize=i;function n(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)}s.normalize=n;function o(r){r.parent&&r.parent.layout instanceof GA&&r.parent.fit()}})(vS||(vS={}));class UXt extends GA{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=Q$.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],n=i.classList.contains("lm-mod-expanded"),o=Uie.createTitle(this.renderer,t.title,n);this._titles[e]=o,this.parent.node.replaceChild(o,i)}insertWidget(e,t){t.id||(t.id=`id-${FDe.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=Uie.createTitle(this.renderer,t.title);Nt.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){Nt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Nt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,n,o,r,a){const c=this._titles[e].style;c.top=`${n}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${o}px`:c.width=`${r}px`,super.updateItemPosition(e,t,i,n,o,r,a)}}var Uie;(function(s){function e(t,i,n=!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",n?"true":"false"),o.setAttribute("aria-controls",i.owner.id),n&&o.classList.add("lm-mod-expanded"),o}s.createTitle=e})(Uie||(Uie={}));class APe extends nt{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=VDe.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var VDe;(function(s){function e(t){return t.layout||new ele}s.createLayout=e})(VDe||(VDe={}));class KH extends APe{constructor(e={}){super({layout:zDe.createLayout(e)}),this._handleMoved=new Qa(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=Nt.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 n,o=t.handles[i],r=o.getBoundingClientRect();t.orientation==="horizontal"?n=e.clientX-r.left:n=e.clientY-r.top;let a=window.getComputedStyle(o),c=qh.overrideCursor(a.cursor);this._pressData={index:i,delta:n,override:c}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,i=this.layout,n=this.node.getBoundingClientRect();i.orientation==="horizontal"?t=e.clientX-n.left-this._pressData.delta:t=e.clientY-n.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(s){class e{createHandle(){let o=document.createElement("div");return o.className="lm-SplitPanel-handle",o}}s.Renderer=e,s.defaultRenderer=new e;function t(n){return GA.getStretch(n)}s.getStretch=t;function i(n,o){GA.setStretch(n,o)}s.setStretch=i})(KH||(KH={}));var zDe;(function(s){function e(t){return t.layout||new GA({renderer:t.renderer||KH.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}s.createLayout=e})(zDe||(zDe={}));class $De extends KH{constructor(e={}){super({...e,layout:GDe.createLayout(e)}),this._widgetSizesCache=new WeakMap,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}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=Nt.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 n=i.isHidden,o=t.absoluteSizes(),r=(n?-1:1)*this.spacing,a=o.reduce((l,d)=>l+d);let c=[...o];if(n){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=Nt.findFirstIndex(this.titles,n=>n.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 n=Nt.findFirstIndex(this.titles,o=>o.contains(t));if(n>=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=(n+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],n=this._computeWidgetSize(e);n&&this.setRelativeSizes(n,!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())}}(function(s){class e extends KH.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 n=document.createElement("h3");n.setAttribute("tabindex","0"),n.id=this.createTitleKey(i),n.className=this.titleClassName;for(const a in i.dataset)n.dataset[a]=i.dataset[a];const o=n.appendChild(this.createCollapseIcon(i));o.className="lm-AccordionPanel-titleCollapser";const r=n.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=i.label,r.title=i.caption||i.label,n}createTitleKey(i){let n=this._titleKeys.get(i);return n===void 0&&(n=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(i,n)),n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e})($De||($De={}));var GDe;(function(s){function e(t){return t.layout||new UXt({renderer:t.renderer||$De.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}s.createLayout=e})(GDe||(GDe={}));class Zg extends ele{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=Q$.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=Q$.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){Nt.insert(this._items,e,new gG(t)),Nt.insert(this._sizers,e,new AD),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),Nt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Nt.removeAt(this._items,e);Nt.removeAt(this._sizers,e),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.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:(n,o)=>Math.max(0,Math.floor(o)),changed:i}),s.sizeBasisProperty=new nv({name:"sizeBasis",create:()=>0,coerce:(n,o)=>Math.max(0,Math.floor(o)),changed:i});function e(n){return n==="left-to-right"||n==="right-to-left"}s.isHorizontal=e;function t(n){return Math.max(0,Math.floor(n))}s.clampSpacing=t;function i(n){n.parent&&n.parent.layout instanceof Zg&&n.parent.fit()}})(z1||(z1={}));class t9e extends APe{constructor(e={}){super({layout:KDe.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(s){function e(o){return Zg.getStretch(o)}s.getStretch=e;function t(o,r){Zg.setStretch(o,r)}s.setStretch=t;function i(o){return Zg.getSizeBasis(o)}s.getSizeBasis=i;function n(o,r){Zg.setSizeBasis(o,r)}s.setSizeBasis=n})(t9e||(t9e={}));var KDe;(function(s){function e(t){return t.layout||new Zg(t)}s.createLayout=e})(KDe||(KDe={}));class Vie extends nt{constructor(e){super({node:FC.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||Vie.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=FC.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>FC.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){Nt.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,n=this._results;if(n||(n=this._results=FC.search(this._items,t),this._activeIndex=t?Nt.findFirstIndex(n,FC.canActivate):-1),!t&&n.length===0){SD.render(null,i);return}if(t&&n.length===0){let c=this.renderer.renderEmptyMessage({query:t});SD.render(c,i);return}let o=this.renderer,r=this._activeIndex,a=new Array(n.length);for(let c=0,l=n.length;c=n.length)i.scrollTop=0;else{let c=i.children[r];Fa.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=Nt.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=eP-R),L=w.slice(0,A),k=w.slice(A);for(let P=0,R=k.length;Pm.command===f&&Xc.deepEqual(m.args,p))||null}}})(FC||(FC={}));class W_ extends nt{constructor(e){super({node:Sg.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new Qa(this),this._menuRequested=new Qa(this),this.addClass("lm-Menu"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||W_.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&&!Sg.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}})}SD.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=Wie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,o=Sg.findMnemonic(this._items,i,n);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=Nt.findFirstIndex(this.contentNode.children,n=>Fa.hitTest(n,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(Fa.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(Sg.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;W_.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,zt.sendMessage(this,nt.Msg.UpdateRequest);let n=this.contentNode.children[this._activeIndex];Sg.openSubmenu(i,n),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()},Sg.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},Sg.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Sg.saveWindowData()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return _a.li({className:n,dataset:o,tabindex:"0",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let n=this.createIconClass(i);return _a.div({className:n},i.item.icon,i.item.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return _a.div({className:"lm-Menu-itemLabel"},n)}renderShortcut(i){let n=this.formatShortcut(i);return _a.div({className:"lm-Menu-itemShortcut"},n)}renderSubmenu(i){return _a.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(i){let n="lm-Menu-item";i.item.isEnabled||(n+=" lm-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled"),i.item.isVisible||(n+=" lm-mod-hidden"),i.active&&(n+=" lm-mod-active"),i.collapsed&&(n+=" lm-mod-collapsed");let o=i.item.className;return o&&(n+=` ${o}`),n}createItemDataset(i){let n,{type:o,command:r,dataset:a}=i.item;return o==="command"?n={...a,type:o,command:r}:n={...a,type:o},n}createIconClass(i){let n="lm-Menu-itemIcon",o=i.item.iconClass;return o?`${n} ${o}`:n}createItemARIA(i){let n={};switch(i.item.type){case"separator":n.role="presentation";break;case"submenu":n["aria-haspopup"]="true",i.item.isEnabled||(n["aria-disabled"]="true");break;default:i.item.isEnabled||(n["aria-disabled"]="true"),n.role="menuitem"}return n}formatLabel(i){let{label:n,mnemonic:o}=i.item;if(o<0||o>=n.length)return n;let r=n.slice(0,o),a=n.slice(o+1),c=n[o],l=_a.span({className:"lm-Menu-itemMnemonic"},c);return[r,l,a]}formatShortcut(i){let n=i.item.keyBinding;return n?lC.formatKeystroke(n.keys):null}}s.Renderer=e,s.defaultRenderer=new e})(W_||(W_={}));var Sg;(function(s){s.TIMER_DELAY=300,s.SUBMENU_OVERLAP=3;let e=null,t=0;function i(){return t>0?(t--,e):d()}function n(){e=d(),t++}s.saveWindowData=n;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}s.createNode=o;function r(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}s.canActivate=r;function a(m,v){return new p(m.commands,v)}s.createItem=a;function c(m,v,b){for(let w=m;w;w=w.childMenu)if(Fa.hitTest(w.node,v,b))return!0;return!1}s.hitTestMenus=c;function l(m){let v=new Array(m.length);Nt.fill(v,!1);let b=0,w=m.length;for(;b=0;--y){let A=m[y];if(A.isVisible){if(A.type!=="separator")break;v[y]=!0}}let C=!1;for(;++bA+k&&(v=A+k-Y),!y&&b+j>L+P&&(b>L+P?b=L+P-j:b=b-j),G.transform=`translate(${Math.max(0,v)}px, ${Math.max(0,b)}px`,G.opacity="1"}s.openRootMenu=h;function u(m,v){const b=i();let w=b.pageXOffset,y=b.pageYOffset,C=b.clientWidth,A=b.clientHeight;zt.sendMessage(m,nt.Msg.UpdateRequest);let L=A,k=m.node,P=k.style;P.opacity="0",P.maxHeight=`${L}px`,nt.attach(m,document.body);let{width:R,height:z}=k.getBoundingClientRect(),G=Fa.boxSizing(m.node),Y=v.getBoundingClientRect(),j=Y.right-s.SUBMENU_OVERLAP;j+R>w+C&&(j=Y.left+s.SUBMENU_OVERLAP-R);let ne=Y.top-G.borderTop-G.paddingTop;ne+z>y+A&&(ne=Y.bottom+G.borderBottom+G.paddingBottom-z),P.transform=`translate(${Math.max(0,j)}px, ${Math.max(0,ne)}px`,P.opacity="1"}s.openSubmenu=u;function f(m,v,b){let w=-1,y=-1,C=!1,A=v.toUpperCase();for(let L=0,k=m.length;L=0&&Gw.command===v&&Xc.deepEqual(w.args,b))||null}return null}}})(Sg||(Sg={}));var i9e;(function(s){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}}s.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,n=e,o=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:n,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=qm.asTitle(t),n=this._titles.indexOf(i),o=Math.max(0,Math.min(e,this._titles.length));return n===-1?(Nt.insert(this._titles,o,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,i),i):(o===this._titles.length&&o--,n===o||(Nt.move(this._titles,n,o),this.update(),this._adjustCurrentForMove(n,o)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Nt.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":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()}onUpdateRequest(e){let t=this._titles,i=this.renderer,n=this.currentTitle,o=new Array(t.length);for(let r=0,a=t.length;rFa.hitTest(r,e.clientX,e.clientY));if(i===-1)return;let n=this.titles[i],o=t[i].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){let r=n.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};c.addEventListener("dblclick",d=>d.stopPropagation()),c.addEventListener("blur",l),c.addEventListener("keydown",d=>{d.key==="Enter"?(c.value!==""&&(n.label=n.caption=c.value),l()):d.key==="Escape"&&l()}),c.select(),c.focus(),o.children.length>0&&o.children[0].focus()}}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0&&e.button!==1||this._dragData)return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),i=this.contentNode.children,n=Nt.findFirstIndex(i,r=>Fa.hitTest(r,e.clientX,e.clientY));if(n===-1&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:i[n],index:n,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[n].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===n?this.currentIndex=-1:this.currentIndex=n,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&&!qm.dragExceeded(t,e))){if(!t.dragActive){let n=t.tab.getBoundingClientRect();this._orientation==="horizontal"?(t.tabPos=t.tab.offsetLeft,t.tabSize=n.width,t.tabPressPos=t.pressX-n.left):(t.tabPos=t.tab.offsetTop,t.tabSize=n.height,t.tabPressPos=t.pressY-n.top),t.tabLayout=qm.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=qh.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&qm.detachExceeded(t,e)){t.detachRequested=!0;let n=t.index,o=e.clientX,r=e.clientY,a=i[n],c=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:c,tab:a,clientX:o,clientY:r}),t.dragAborted)return}qm.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=Nt.findFirstIndex(o,l=>Fa.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;qm.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=qm.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,qm.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let n=t.index,o=t.targetIndex;o===-1||n===o||(Nt.move(this._titles,n,o),this._adjustCurrentForMove(n,o),this._tabMoved.emit({fromIndex:n,toIndex:o,title:this._titles[o]}),zt.sendMessage(this,nt.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&&(qm.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,n=this._currentIndex,o=this.insertBehavior;if(o==="select-tab"||o==="select-tab-if-needed"&&n===-1){this._currentIndex=e,this._previousTitle=i,this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:e,currentTitle:t});return}n>=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,n=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(n==="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(n==="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(n==="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(s){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(i){let n=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?_a.li({id:r,key:o,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):_a.li({id:r,key:o,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:n}=i;let o=this.createIconClass(i);return _a.div({className:o},n.icon,n.iconLabel)}renderLabel(i){return _a.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return _a.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(i){let n=this._tabKeys.get(i.title);return n===void 0&&(n=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(i.title,n)),n}createTabStyle(i){return{zIndex:`${i.zIndex}`}}createTabClass(i){let n="lm-TabBar-tab";return i.title.className&&(n+=` ${i.title.className}`),i.title.closable&&(n+=" lm-mod-closable"),i.current&&(n+=" lm-mod-current"),n}createTabDataset(i){return i.title.dataset}createTabARIA(i){return{role:"tab","aria-selected":i.current.toString()}}createIconClass(i){let n="lm-TabBar-tabIcon",o=i.title.iconClass;return o?`${n} ${o}`:n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e,s.addButtonSelector=".lm-TabBar-addButton"})(_I||(_I={}));var qm;(function(s){s.DRAG_THRESHOLD=5,s.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",d.appendChild(u),d}s.createNode=e;function t(d){return d instanceof UDe?d:new UDe(d)}s.asTitle=t;function i(d){let h=window.getComputedStyle(d);return 1e3*(parseFloat(h.transitionDuration)||0)}s.parseTransitionDuration=i;function n(d,h){let u=new Array(d.length);for(let f=0,p=d.length;f=s.DRAG_THRESHOLD||f>=s.DRAG_THRESHOLD}s.dragExceeded=o;function r(d,h){let u=d.contentRect;return h.clientX=u.right+s.DETACH_THRESHOLD||h.clientY=u.bottom+s.DETACH_THRESHOLD}s.detachExceeded=r;function a(d,h,u,f){let p,m,v,b;f==="horizontal"?(p=h.pressX,m=u.clientX-h.contentRect.left,v=u.clientX,b=h.contentRect.width):(p=h.pressY,m=u.clientY-h.contentRect.top,v=u.clientY,b=h.contentRect.height);let w=h.index,y=m-h.tabPressPos,C=y+h.tabSize;for(let A=0,L=d.length;A>1);if(Ah.index&&C>R)k=`${-h.tabSize-P.margin}px`,w=Math.max(w,A);else if(A===h.index){let z=v-p,G=b-(h.tabPos+h.tabSize);k=`${Math.max(-h.tabPos,Math.min(z,G))}px`}else k="";f==="horizontal"?d[A].style.left=k:d[A].style.top=k}h.targetIndex=w}s.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`}s.finalizeTabPosition=c;function l(d,h){for(const u of d)h==="horizontal"?u.style.left="":u.style.top=""}s.resetTabPositions=l})(qm||(qm={}));class VXt extends mN{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=Q$.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:nt.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=Q$.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():T4()}widgets(){return this._root?this._root.iterUserWidgets():T4()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():T4()}tabBars(){return this._root?this._root.iterTabBars():T4()}handles(){return this._root?this._root.iterHandles():T4()}moveHandle(e,t,i){let n=e.classList.contains("lm-mod-hidden");if(!this._root||n)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(),Zp.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=Vl.normalizeAreaConfig(e.main,t):i=null;let n=this.widgets(),o=this.tabBars(),r=this.handles();this._root=null;for(const a of n)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=Vl.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,n=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,n){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}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=Fa.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),n=e-i.left-this._box.borderLeft,o=t-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(n,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:n,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 gG(e)),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.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(Vl.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===nt.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=nt.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 n=Nt.removeFirstOf(i.children,t),o=Nt.removeAt(i.handles,n);if(Nt.removeAt(i.sizers,n),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 Vl.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Nt.removeAt(l.handles,d);Nt.removeAt(l.children,d),Nt.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,b=1/0,w=1/0,y=p.get(this.tabBar),C=this.tabBar.currentTitle,A=C?p.get(C.owner):void 0,[L,k]=this.sizers;return y&&y.fit(),A&&A.fit(),y&&!y.isHidden?(m=Math.max(m,y.minWidth),v+=y.minHeight,L.minSize=y.minHeight,L.maxSize=y.maxHeight):(L.minSize=0,L.maxSize=0),A&&!A.isHidden?(m=Math.max(m,A.minWidth),v+=A.minHeight,k.minSize=A.minHeight,k.maxSize=1/0):(k.minSize=0,k.maxSize=1/0),{minWidth:m,minHeight:v,maxWidth:b,maxHeight:w}}update(f,p,m,v,b,w){this._top=p,this._left=f,this._width=m,this._height=v;let y=w.get(this.tabBar),C=this.tabBar.currentTitle,A=C?w.get(C.owner):void 0;if(Zp.calc(this.sizers,v),y&&!y.isHidden){let L=this.sizers[0].size;y.update(f,p,m,L),p+=L}if(A&&!A.isHidden){let L=this.sizers[1].size;A.update(f,p,m,L)}}}s.TabLayoutNode=n;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,b)=>v+b,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,b=m?v:0,w=m?0:v,y=1/0,C=1/0;for(let A=0,L=this.children.length;A=p.length)&&(m=0),{type:"tab-area",widgets:p,currentIndex:m}}function l(u,f){let p=u.orientation,m=[],v=[];for(let b=0,w=u.children.length;b{let w=i(v,f,p),y=e(u.sizes[b]),C=f.createHandle();m.children.push(w),m.handles.push(C),m.sizers.push(y),w.parent=m}),m.syncHandles(),m.normalizeSizes(),m}})(Vl||(Vl={}));class j$ extends nt{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new Qa(this),this._addRequested=new Qa(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||j$.defaultRenderer,this._edges=e.edges||Qc.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 VXt({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new j$.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(Qc.createSingleDocumentConfig(this));break;default:throw"unreachable"}zt.postMessage(this,Qc.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=NDe(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),(Bu.IS_EDGE||Bu.IS_IE)&&zt.flush(),zt.postMessage(this,Qc.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),zt.postMessage(this,Qc.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){Qc.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){Qc.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),zt.postMessage(this,Qc.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:n,target:o}=Qc.findDropTarget(this,t,i,this._edges);if(this._tabsConstrained&&e.source!==this||n==="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 nt)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=o?Qc.getDropRef(o.tabBar):null;switch(n){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(),zt.postMessage(this,Qc.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,n=NDe(t.handles(),d=>d.contains(i));if(!n)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=n.getBoundingClientRect(),r=e.clientX-o.left,a=e.clientY-o.top,c=window.getComputedStyle(n),l=qh.overrideCursor(c.cursor,this._document);this._pressData={handle:n,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,n=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),zt.postMessage(this,Qc.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:n}=Qc.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let o,r,a,c,l=Fa.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*Qc.GOLDEN_RATIO;break;case"root-left":o=l.paddingTop,r=l.paddingLeft,a=d.width*Qc.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":o=l.paddingTop,r=d.width*Qc.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":o=d.height*Qc.GOLDEN_RATIO,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":o=n.top,r=n.left,a=n.right,c=n.bottom;break;case"widget-top":o=n.top,r=n.left,a=n.right,c=n.bottom+n.height/2;break;case"widget-left":o=n.top,r=n.left,a=n.right+n.width/2,c=n.bottom;break;case"widget-right":o=n.top,r=n.left+n.width/2,a=n.right,c=n.bottom;break;case"widget-bottom":o=n.top+n.height/2,r=n.left,a=n.right,c=n.bottom;break;case"widget-tab":{const h=n.tabBar.node.getBoundingClientRect().height;o=n.top,r=n.left,a=n.right,c=n.bottom+n.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 Qc.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(){zt.postMessage(this,Qc.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:n}=t;i&&i.owner.hide(),n&&n.owner.show(),(Bu.IS_EDGE||Bu.IS_IE)&&zt.flush(),zt.postMessage(this,Qc.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:n,clientX:o,clientY:r}=t,a=new OXt,c=()=>i.owner;a.setData("application/vnd.lumino.widget-factory",c);let l=n.cloneNode(!0);this._drag=new qh({document:this._document,mimeData:a,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden");let d=()=>{this._drag=null,n.classList.remove("lm-mod-hidden")};this._drag.start(o,r).then(d)}}(function(s){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(n){let o=this.node.style;o.top=`${n.top}px`,o.left=`${n.left}px`,o.right=`${n.right}px`,o.bottom=`${n.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(n){if(!this._hidden){if(n<=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")},n))}}}s.Overlay=e;class t{createTabBar(n){let o=new _I({document:n});return o.addClass("lm-DockPanel-tabBar"),o}createHandle(){let n=document.createElement("div");return n.className="lm-DockPanel-handle",n}}s.Renderer=t,s.defaultRenderer=new t})(j$||(j$={}));var Qc;(function(s){s.GOLDEN_RATIO=.618,s.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},s.LayoutModified=new FV("layout-modified"),s.isGeneratedTabBarProperty=new nv({name:"isGeneratedTabBar",create:()=>!1});function e(n){if(n.isEmpty)return{main:null};let o=Array.from(n.widgets()),r=n.selectedWidgets().next().value,a=r?o.indexOf(r):-1;return{main:{type:"tab-area",widgets:o,currentIndex:a}}}s.createSingleDocumentConfig=e;function t(n,o,r,a){if(!Fa.hitTest(n.node,o,r))return{zone:"invalid",target:null};let c=n.layout;if(c.isEmpty)return{zone:"root-all",target:null};if(n.mode==="multiple-document"){let y=n.node.getBoundingClientRect(),C=o-y.left+1,A=r-y.top+1,L=y.right-o,k=y.bottom-r;switch(Math.min(A,L,k,C)){case A:if(Am&&u>m&&h>v&&f>v)return{zone:"widget-all",target:l};d/=m,h/=v,u/=m,f/=v;let b=Math.min(d,h,u,f),w;switch(b){case d:w="widget-left";break;case h:w="widget-top";break;case u:w="widget-right";break;case f:w="widget-bottom";break;default:throw"unreachable"}return{zone:w,target:l}}s.findDropTarget=t;function i(n){return n.titles.length===0?null:n.currentTitle?n.currentTitle.owner:n.titles[n.titles.length-1].owner}s.getDropRef=i})(Qc||(Qc={}));class iL extends mN{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new AD],this._columnSizers=[new AD],this._box=null,e.rowCount!==void 0&&kd.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&kd.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=kd.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=kd.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&&(kd.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(kd.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=kd.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=kd.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=kd.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=kd.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){Nt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new gG(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Nt.findFirstIndex(this._items,n=>n.widget===e);if(t===-1)return;let i=Nt.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&&zt.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.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}}s.normalizeConfig=e;function t(c){return Math.max(0,Math.floor(c))}s.clampValue=t;function i(c,l){let d=s.cellConfigProperty.get(c.widget),h=s.cellConfigProperty.get(l.widget);return d.rowSpan-h.rowSpan}s.rowSpanCmp=i;function n(c,l){let d=s.cellConfigProperty.get(c.widget),h=s.cellConfigProperty.get(l.widget);return d.columnSpan-h.columnSpan}s.columnSpanCmp=n;function o(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}s.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}s.distributeMin=r;function a(c){c.parent&&c.parent.layout instanceof iL&&c.parent.fit()}})(kd||(kd={}));class Y$ extends nt{constructor(e={}){super({node:zie.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(nt.Flag.DisallowLayout),this.renderer=e.renderer||Y$.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),this._activeIndex!==e&&(this._activeIndex=e,e!==-1&&(this._tabFocusIndex=e),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),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 n=this._menus.indexOf(t),o=Math.max(0,Math.min(e,this._menus.length));if(n===-1){Nt.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--,n!==o&&(Nt.move(this._menus,n,o),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Nt.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"mouseleave":this._evtMouseLeave(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("mouseleave",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("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&(this.activeIndex=0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let i=this._menus,n=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.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 W_({commands:new lC}),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]=n.renderItem({title:this._overflowMenu.title,active:a===o&&i[a].items.length!==0,tabbable:a===r,onfocus:()=>{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]=n.renderItem({title:v.title,active:!1,tabbable:a===r,onfocus:()=>{this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),d.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}SD.render(d,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,i=0,n=-1,o=e.length;if(this._menuItemSizes.length==0)for(let r=0;rt&&n===-1&&(n=r)}else for(let r=0;rt){n=r;break}this._overflowIndex=n}_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){this.openActiveMenu();return}if(t===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(t===37){let r=this._activeIndex,a=this._menus.length;this.activeIndex=r===0?a-1:r-1;return}if(t===39){let r=this._activeIndex,a=this._menus.length;this.activeIndex=r===a-1?0:r+1;return}let i=Wie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,o=zie.findMnemonic(this._menus,i,n);o.index!==-1&&!o.multiple?(this.activeIndex=o.index,this.openActiveMenu()):o.index!==-1?this.activeIndex=o.index:o.auto!==-1&&(this.activeIndex=o.auto)}_evtMouseDown(e){if(!Fa.hitTest(this.node,e.clientX,e.clientY))return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let t=Nt.findFirstIndex(this.contentNode.children,i=>Fa.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{const i=this._positionForMenu(t);W_.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Nt.findFirstIndex(this.contentNode.children,n=>Fa.hitTest(n,e.clientX,e.clientY));if(t===this._activeIndex||t===-1&&this._childMenu)return;const i=t>=0&&this._childMenu?this._positionForMenu(t):null;W_.saveWindowData(),this.activeIndex=t,i&&this._openChildMenu(i)}_positionForMenu(e){let t=this.contentNode.children[e],{left:i,bottom:n}=t.getBoundingClientRect();return{top:n,left:i}}_evtMouseLeave(e){this._childMenu||(this.activeIndex=-1)}_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),zt.sendMessage(this,nt.Msg.UpdateRequest);let{left:n,top:o}=e;(typeof n>"u"||typeof o>"u")&&({left:n,top:o}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(n,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,n=this._menus.length;switch(t){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=i===0?n-1:i-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return _a.li({className:n,dataset:o,tabindex:i.tabbable?"0":"-1",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let n=this.createIconClass(i);return _a.div({className:n},i.title.icon,i.title.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return _a.div({className:"lm-MenuBar-itemLabel"},n)}createItemClass(i){let n="lm-MenuBar-item";return i.title.className&&(n+=` ${i.title.className}`),i.active&&(n+=" lm-mod-active"),n}createItemDataset(i){return i.title.dataset}createItemARIA(i){return{role:"menuitem","aria-haspopup":"true"}}createIconClass(i){let n="lm-MenuBar-itemIcon",o=i.title.iconClass;return o?`${n} ${o}`:n}formatLabel(i){let{label:n,mnemonic:o}=i.title;if(o<0||o>=n.length)return n;let r=n.slice(0,o),a=n.slice(o+1),c=n[o],l=_a.span({className:"lm-MenuBar-itemMnemonic"},c);return[r,l,a]}}s.Renderer=e,s.defaultRenderer=new e})(Y$||(Y$={}));var zie;(function(s){function e(){let i=document.createElement("div"),n=document.createElement("ul");return n.className="lm-MenuBar-content",i.appendChild(n),n.setAttribute("role","menubar"),i}s.createNode=e;function t(i,n,o){let r=-1,a=-1,c=!1,l=n.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===nt.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=nt.HiddenMode.Scale),t.hiddenMode=nt.HiddenMode.Scale):t.hiddenMode=nt.HiddenMode.Display,Nt.insert(this._items,e,new gG(t)),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Nt.removeAt(this._items,e);this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===nt.HiddenMode.Scale&&(t.hiddenMode=nt.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=nt.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(n))))}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,n){const o=this.getLanguage(e,null),r=this.configurationService.inspect(t,{resource:e,overrideIdentifier:o});n===void 0&&(n=this.deriveConfigurationTarget(r,o));const a=o&&r.overrideIdentifiers?.includes(o)?o:void 0;return this.configurationService.updateValue(t,i,{resource:e,overrideIdentifier:a},n)}deriveConfigurationTarget(e,t){if(t){if(e.memory?.override!==void 0)return St.MEMORY;if(e.workspaceFolder?.override!==void 0)return St.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return St.WORKSPACE;if(e.userRemote?.override!==void 0)return St.USER_REMOTE;if(e.userLocal?.override!==void 0)return St.USER_LOCAL}return e.memory?.value!==void 0?St.MEMORY:e.workspaceFolder?.value!==void 0?St.WORKSPACE_FOLDER:e.workspace?.value!==void 0?St.WORKSPACE:e.userRemote?.value!==void 0?St.USER_REMOTE:St.USER_LOCAL}_getValue(e,t,i){const n=e?this.getLanguage(e,t):void 0;return typeof i>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:n}):this.configurationService.getValue(i,{resource:e,overrideIdentifier:n})}inspect(e,t,i){const n=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:n})}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 n=t?this.getLanguage(t,null):void 0;return e.affectsConfiguration(i,{resource:t,overrideIdentifier:n})}}}};QDe=D([_(0,Te),_(1,gi),_(2,xi)],QDe);const tle=".vscode",$ie="settings",KXt=`${tle}/${$ie}.json`,qXt="vscode://schemas/settings/default",QXt="vscode://schemas/settings/user",jXt="vscode://schemas/settings/profile",YXt="vscode://schemas/settings/machine",Tst="vscode://schemas/settings/workspace",JXt="vscode://schemas/settings/folder",XXt="vscode://schemas/launch",ZXt="vscode://schemas/tasks";at.APPLICATION;const eZt=[at.MACHINE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Lst=[at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE],tZt=[at.APPLICATION,...Lst],Uue=[at.MACHINE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],uj=[at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Rst=[at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Of="tasks",cx="launch",EPe=Object.create(null);EPe[Of]=`${tle}/${Of}.json`;EPe[cx]=`${tle}/${cx}.json`;const Mst=Object.create(null);Mst[Of]=`${Of}.json`;const iZt=`{ +`+i)}}return Promise.resolve([s.toString(),null,null])}async function wXt(s){const e=s.pathname.split("/");return e[3]==="blob"?(e.splice(3,1),Promise.resolve([s.protocol+"//raw.githubusercontent.com"+e.join("/"),null,null])):Promise.resolve([s.toString(),null,null])}async function yXt(s){try{const e=new URL(s);if(e.hostname==="gist.github.com")return bXt(e);if(e.hostname==="github.com")return wXt(e)}catch{return Promise.reject("Failed to process URL")}return Promise.resolve([null,null,null])}var Nt;(function(s){function e(k,P,R=0,z=-1){let G=k.length;if(G===0)return-1;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let j;z0;){let ge=ie>>1,xe=K+ge;R(k[xe],P)<0?(K=xe+1,ie-=ge+1):ie=ge}return K}s.lowerBound=a;function c(k,P,R,z=0,G=-1){let j=k.length;if(j===0)return 0;z<0?z=Math.max(0,z+j):z=Math.min(z,j-1),G<0?G=Math.max(0,G+j):G=Math.min(G,j-1);let K=z,ie=G-z+1;for(;ie>0;){let ge=ie>>1,xe=K+ge;R(k[xe],P)>0?ie=ge:(K=xe+1,ie-=ge+1)}return K}s.upperBound=c;function l(k,P,R){if(k===P)return!0;if(k.length!==P.length)return!1;for(let z=0,G=k.length;z=j&&(R=G<0?j-1:j),z===void 0?z=G<0?-1:j:z<0?z=Math.max(z+j,G<0?-1:0):z>=j&&(z=G<0?j-1:j);let K;G<0&&z>=R||G>0&&R>=z?K=0:G<0?K=Math.floor((z-R+1)/G+1):K=Math.floor((z-R-1)/G+1);let ie=[];for(let ge=0;ge=z))return;let j=z-R+1;if(P>0?P=P%j:P<0&&(P=(P%j+j)%j),P===0)return;let K=R+P;u(k,R,K-1),u(k,K,z),u(k,R,z)}s.rotate=f;function p(k,P,R=0,z=-1){let G=k.length;if(G===0)return;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let j;zP;--G)k[G]=k[G-1];k[P]=R}s.insert=m;function v(k,P){let R=k.length;if(P<0&&(P+=R),P<0||P>=R)return;let z=k[P];for(let G=P+1;G=R&&K<=z&&k[K]===P||z=R)&&k[K]===P?j++:j>0&&(k[K-j]=k[K]);return j>0&&(k.length=G-j),j}s.removeAllOf=y;function C(k,P,R=0,z=-1){let G,j=i(k,P,R,z);return j!==-1&&(G=v(k,j)),{index:j,value:G}}s.removeFirstWhere=C;function A(k,P,R=-1,z=0){let G,j=n(k,P,R,z);return j!==-1&&(G=v(k,j)),{index:j,value:G}}s.removeLastWhere=A;function L(k,P,R=0,z=-1){let G=k.length;if(G===0)return 0;R<0?R=Math.max(0,R+G):R=Math.min(R,G-1),z<0?z=Math.max(0,z+G):z=Math.min(z,G-1);let j=0;for(let K=0;K=R&&K<=z&&P(k[K],K)||z=R)&&P(k[K],K)?j++:j>0&&(k[K-j]=k[K]);return j>0&&(k.length=G-j),j}s.removeAllWhere=L})(Nt||(Nt={}));function*E4(){}function kDe(s,e){let t=0;for(const i of s)if(e(i,t++))return i}function CXt(s,e){let t=0;for(const i of s)if(e(i,t++)===!1)return!1;return!0}function SXt(s,e){let t=0;for(const i of s)if(e(i,t++))return!0;return!1}var W3e;(function(s){function e(t,i,n){return n===0?1/0:t>i&&n>0||t-1;e--)yield s[e]}function EXt(s){let e=[],t=new Set,i=new Map;for(const r of s)n(r);for(const[r]of i)o(r);return e;function n(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 z$;(function(s){function e(r,a,c=0){let l=new Array(a.length);for(let d=0,h=c,u=a.length;da?1:0}s.cmp=o})(z$||(z$={}));var Jc;(function(s){s.emptyObject=Object.freeze({}),s.emptyArray=Object.freeze([]);function e(d){return d===null||typeof d=="boolean"||typeof d=="number"||typeof d=="string"}s.isPrimitive=e;function t(d){return Array.isArray(d)}s.isArray=t;function i(d){return!e(d)&&!t(d)}s.isObject=i;function n(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)}s.deepEqual=n;function o(d){return e(d)?d:t(d)?c(d):l(d)}s.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(" -> ")}.`)}s.ensureNoCycle=i;function n(r,a,c){const l=new Array,d=m=>{const v=a.get(m),b=[...v.requires,...v.optional];l.push(...b.reduce((w,y)=>{const C=c.get(y);return C&&w.push([m,C]),w},[]))};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(b=>b[0]));for(const b of v)l.filter(w=>w[1]===b).forEach(w=>{h.includes(w)||h.push(w)});u=m}const f=EXt(h),p=f.findIndex(m=>m===r);return p===-1?[r]:f.slice(0,p+1)}s.findDependents=n;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)}s.collectStartupPlugins=o})(H3e||(H3e={}));function DXt(s){let e=0;for(let t=0,i=s.length;t>>0),s[t]=e&255,e>>>=8}var IDe;(function(s){s.getRandomValues=(()=>{const e=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return e&&typeof e.getRandomValues=="function"?function(i){return e.getRandomValues(i)}:DXt})()})(IDe||(IDe={}));function kXt(s){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 s(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 TDe;(function(s){s.uuid4=kXt(IDe.getRandomValues)})(TDe||(TDe={}));var U3e;(function(s){function e(t){const i=document.body,n=o=>{o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",t),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}s.copyText=e})(U3e||(U3e={}));var Fa;(function(s){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}}s.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}}s.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(n)){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}s.calculateSingle=e;const t=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,a=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g})(Tv||(Tv={}));class LDe{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 NC.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 NC.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 NC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new NC.LinkedListNode(this,e),n=t,o=n.prev;return i.next=n,i.prev=o,n.prev=i,o.next=i,this._size++,i}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof NC.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let i=new NC.LinkedListNode(this,e),n=t,o=n.next;return i.next=o,i.prev=n,n.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 NC.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(s){function e(t){let i=new s;return i.assign(t),i}s.from=e})(LDe||(LDe={}));var NC;(function(s){class e{constructor(i,n){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=n}}s.LinkedListNode=e})(NC||(NC={}));class Om{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}}class NV extends Om{get isConflatable(){return!0}conflate(e){return!0}}var zt;(function(s){let e=null;const t=(P=>R=>{let z=!1;return P.then(()=>!z&&R()),()=>{z=!0}})(Promise.resolve());function i(P,R){let z=u.get(P);if(!z||z.length===0){b(P,R);return}CXt(AXt(z),j=>j?v(j,P,R):!0)&&b(P,R)}s.sendMessage=i;function n(P,R){if(!R.isConflatable){w(P,R);return}SXt(h,G=>G.handler!==P||!G.msg||G.msg.type!==R.type||!G.msg.isConflatable?!1:G.msg.conflate(R))||w(P,R)}s.postMessage=n;function o(P,R){let z=u.get(P);z&&z.indexOf(R)!==-1||(z?z.push(R):u.set(P,[R]))}s.installMessageHook=o;function r(P,R){let z=u.get(P);if(!z)return;let G=z.indexOf(R);G!==-1&&(z[G]=null,C(z))}s.removeMessageHook=r;function a(P){let R=u.get(P);R&&R.length>0&&(Nt.fill(R,null),C(R));for(const z of h)z.handler===P&&(z.handler=null,z.msg=null)}s.clearData=a;function c(){m||e===null||(e(),e=null,m=!0,y(),m=!1)}s.flush=c;function l(){return p}s.getExceptionHandler=l;function d(P){let R=p;return p=P,R}s.setExceptionHandler=d;const h=new LDe,u=new WeakMap,f=new Set;let p=P=>{console.error(P)},m=!1;function v(P,R,z){let G=!0;try{typeof P=="function"?G=P(R,z):G=P.messageHook(R,z)}catch(j){p(j)}return G}function b(P,R){try{P.processMessage(R)}catch(z){p(z)}}function w(P,R){h.addLast({handler:P,msg:R}),e===null&&(e=t(y))}function y(){if(e=null,h.isEmpty)return;let P={handler:null,msg:null};for(h.addLast(P);;){let R=h.removeFirst();if(R===P)return;R.handler&&R.msg&&i(R.handler,R.msg)}}function C(P){f.size===0&&t(A),f.add(P)}function A(){f.forEach(L),f.clear()}function L(P){Nt.removeAllWhere(P,k)}function k(P){return P===null}})(zt||(zt={}));class ev{constructor(e){this._pid=B1.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=B1.ensureMap(e);return this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e),t}set(e,t){let i,n=B1.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);let o=this._coerceValue(e,t);this._maybeNotify(e,i,n[this._pid]=o)}coerce(e){let t,i=B1.ensureMap(e);this._pid in i?t=i[this._pid]:t=i[this._pid]=this._createValue(e);let n=this._coerceValue(e,t);this._maybeNotify(e,t,i[this._pid]=n)}_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 n=this._changed;n&&!this._compareValue(t,i)&&n(e,t,i)}}(function(s){function e(t){B1.ownerData.delete(t)}s.clearData=e})(ev||(ev={}));var B1;(function(s){s.ownerData=new WeakMap,s.nextPID=(()=>{let t=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${t++}`})();function e(t){let i=s.ownerData.get(t);return i||(i=Object.create(null),s.ownerData.set(t,i),i)}s.ensureMap=e})(B1||(B1={}));class Qa{constructor(e){this.sender=e}connect(e,t){return Fp.connect(this,e,t)}disconnect(e,t){return Fp.disconnect(this,e,t)}emit(e){Fp.emit(this,e)}}(function(s){function e(c,l){Fp.disconnectBetween(c,l)}s.disconnectBetween=e;function t(c){Fp.disconnectSender(c)}s.disconnectSender=t;function i(c){Fp.disconnectReceiver(c)}s.disconnectReceiver=i;function n(c){Fp.disconnectAll(c)}s.disconnectAll=n;function o(c){Fp.disconnectAll(c)}s.clearData=o;function r(){return Fp.exceptionHandler}s.getExceptionHandler=r;function a(c){let l=Fp.exceptionHandler;return Fp.exceptionHandler=c,l}s.setExceptionHandler=a})(Qa||(Qa={}));var Fp;(function(s){s.exceptionHandler=w=>{console.error(w)};function e(w,y,C){C=C||void 0;let A=c.get(w.sender);if(A||(A=[],c.set(w.sender,A)),u(A,w,y,C))return!1;let L=C||y,k=l.get(L);k||(k=[],l.set(L,k));let P={signal:w,slot:y,thisArg:C};return A.push(P),k.push(P),!0}s.connect=e;function t(w,y,C){C=C||void 0;let A=c.get(w.sender);if(!A||A.length===0)return!1;let L=u(A,w,y,C);if(!L)return!1;let k=C||y,P=l.get(k);return L.signal=null,p(A),p(P),!0}s.disconnect=t;function i(w,y){let C=c.get(w);if(!C||C.length===0)return;let A=l.get(y);if(!(!A||A.length===0)){for(const L of A)L.signal&&L.signal.sender===w&&(L.signal=null);p(C),p(A)}}s.disconnectBetween=i;function n(w){let y=c.get(w);if(!(!y||y.length===0)){for(const C of y){if(!C.signal)continue;let A=C.thisArg||C.slot;C.signal=null,p(l.get(A))}p(y)}}s.disconnectSender=n;function o(w){let y=l.get(w);if(!(!y||y.length===0)){for(const C of y){if(!C.signal)continue;let A=C.signal.sender;C.signal=null,p(c.get(A))}p(y)}}s.disconnectReceiver=o;function r(w){n(w),o(w)}s.disconnectAll=r;function a(w,y){let C=c.get(w.sender);if(!(!C||C.length===0))for(let A=0,L=C.length;AL.signal===y&&L.slot===C&&L.thisArg===A)}function f(w,y){let{signal:C,slot:A,thisArg:L}=w;try{A.call(L,C.sender,y)}catch(k){s.exceptionHandler(k)}}function p(w){d.size===0&&h(m),d.add(w)}function m(){d.forEach(v),d.clear()}function v(w){Nt.removeAllWhere(w,b)}function b(w){return w.signal===null}})(Fp||(Fp={}));class RDe{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class MDe{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(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(MDe||(MDe={}));class V3e extends MDe{constructor(){super(...arguments),this._disposed=new Qa(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),Qa.clearData(this))}}(function(s){function e(t){let i=new s;for(const n of t)i.add(n);return i}s.from=e})(V3e||(V3e={}));class Kh{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:i,distance:n}=this._scrollTarget,o=Cu.SCROLL_EDGE_SIZE-n,r=Math.pow(o/Cu.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(r*Cu.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});Cu.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(n=>{this._resolve=n});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"){Cu.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=Cu.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=Cu.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,i=this._currentTarget,n=this._currentElement,o=Cu.findElementBehindBackdrop(e,this.document);this._currentElement=o,o!==n&&o!==i&&Cu.dispatchDragExit(this,i,o,e),o!==n&&o!==i&&(i=Cu.dispatchDragEnter(this,o,i,e)),i!==t&&(this._currentTarget=i,Cu.dispatchDragLeave(this,t,i,e));let r=Cu.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=Cu.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=Kh.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=Kh.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=Kh.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=Kh.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(s){class e extends DragEvent{constructor(n,o){super(o.type,{bubbles:!0,cancelable:!0,altKey:n.altKey,button:n.button,clientX:n.clientX,clientY:n.clientY,ctrlKey:n.ctrlKey,detail:0,metaKey:n.metaKey,relatedTarget:o.related,screenX:n.screenX,screenY:n.screenY,shiftKey:n.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}}s.Event=e;function t(i,n=document){return Cu.overrideCursor(i,n)}s.overrideCursor=t})(Kh||(Kh={}));var Cu;(function(s){s.SCROLL_EDGE_SIZE=20;function e(C,A){return h[C]&u[A]?C:"none"}s.validateAction=e;function t(C,A=document){if(C){if(i&&C==i.event)return i.element;s.cursorBackdrop.style.zIndex="-1000";const L=A.elementFromPoint(C.clientX,C.clientY);return s.cursorBackdrop.style.zIndex="",i={event:C,element:L},L}else{const L=s.cursorBackdrop.style.transform;if(n&&L===n.transform)return n.element;const k=s.cursorBackdrop.getBoundingClientRect();s.cursorBackdrop.style.zIndex="-1000";const P=A.elementFromPoint(k.left+k.width/2,k.top+k.height/2);return s.cursorBackdrop.style.zIndex="",n={transform:L,element:P},P}}s.findElementBehindBackdrop=t;let i=null,n=null;function o(C){let A=C.clientX,L=C.clientY,k=t(C);for(;k;k=k.parentElement){if(!k.hasAttribute("data-lm-dragscroll"))continue;let P=0,R=0;k===document.body&&(P=window.pageXOffset,R=window.pageYOffset);let z=k.getBoundingClientRect(),G=z.top+R,j=z.left+P,K=j+z.width,ie=G+z.height;if(A=K||L=ie)continue;let ge=A-j+1,xe=L-G+1,Re=K-A,yt=ie-L,Pe=Math.min(ge,xe,Re,yt);if(Pe>s.SCROLL_EDGE_SIZE)continue;let lt;switch(Pe){case yt:lt="bottom";break;case xe:lt="top";break;case Re:lt="right";break;case ge:lt="left";break;default:throw"unreachable"}let xt=k.scrollWidth-k.clientWidth,Ji=k.scrollHeight-k.clientHeight,Ii;switch(lt){case"top":Ii=Ji>0&&k.scrollTop>0;break;case"left":Ii=xt>0&&k.scrollLeft>0;break;case"right":Ii=xt>0&&k.scrollLeft0&&k.scrollTop{L===y&&s.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",p,!0),s.cursorBackdrop.removeEventListener("scroll",m,!0),k.removeChild(s.cursorBackdrop))})}s.overrideCursor=f;function p(C){s.cursorBackdrop&&(s.cursorBackdrop.style.transform=`translate(${C.clientX}px, ${C.clientY}px)`)}function m(C){if(!s.cursorBackdrop)return;let A=t();if(!A)return;const L=A.closest("[data-lm-dragscroll]");L&&(L.scrollTop+=s.cursorBackdrop.scrollTop-b,L.scrollLeft+=s.cursorBackdrop.scrollLeft-b,v())}function v(){s.cursorBackdrop.scrollTop=b,s.cursorBackdrop.scrollLeft=b}const b=500;function w(){const C=document.createElement("div");return C.classList.add("lm-cursor-backdrop"),C}let y=0;s.cursorBackdrop=w()})(Cu||(Cu={}));function Oie(){return NDe.keyboardLayout}class UH{constructor(e,t,i=[]){this.name=e,this._codes=t,this._keys=UH.extractKeys(t),this._modifierKeys=UH.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(s){function e(i){let n=Object.create(null);for(let o in i)n[i[o]]=!0;return n}s.extractKeys=e;function t(i){let n=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=Jc.emptyObject){var i;let n=this._commands.get(e);return Promise.resolve((i=n?.describedBy.call(void 0,t))!==null&&i!==void 0?i:{args:null})}label(e,t=Jc.emptyObject){var i;let n=this._commands.get(e);return(i=n?.label.call(void 0,t))!==null&&i!==void 0?i:""}mnemonic(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.mnemonic.call(void 0,t):-1}icon(e,t=Jc.emptyObject){var i;return(i=this._commands.get(e))===null||i===void 0?void 0:i.icon.call(void 0,t)}iconClass(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.iconClass.call(void 0,t):""}iconLabel(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.iconLabel.call(void 0,t):""}caption(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.caption.call(void 0,t):""}usage(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.usage.call(void 0,t):""}className(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.className.call(void 0,t):""}dataset(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.dataset.call(void 0,t):{}}isEnabled(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.isEnabled.call(void 0,t):!1}isToggled(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.isToggled.call(void 0,t):!1}isToggleable(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.isToggleable:!1}isVisible(e,t=Jc.emptyObject){let i=this._commands.get(e);return i?i.isVisible.call(void 0,t):!1}execute(e,t=Jc.emptyObject){let i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));let n;try{n=i.execute.call(void 0,t)}catch(r){n=Promise.reject(r)}let o=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:o}),o}addKeyBinding(e){let t=Pv.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new RDe(()=>{Nt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(e){if(e.defaultPrevented||this._replaying)return;const t=rC.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents(),this._clearPendingState();return}if(rC.isModifierKeyPressed(e)){let{exact:r}=Pv.matchKeyBinding(this._keyBindings,[t],e);r?(e.preventDefault(),e.stopPropagation(),this._startModifierTimer(r)):this._clearModifierTimer();return}this._keystrokes.push(t);const{exact:i,partial:n}=Pv.matchKeyBinding(this._keyBindings,this._keystrokes,e),o=n.length!==0;if(!i&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||n.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)},Pv.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},Pv.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Pv.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]),Pv.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!r)return}let{command:t,args:i}=e,n={_luminoEvent:{type:"keybinding",keys:e.keys},...i};if(!this.hasCommand(t)||!this.isEnabled(t,n)){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,n)}_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(s){function e(a){let c="",l=!1,d=!1,h=!1,u=!1;for(let f of a.split(/\s+/))f==="Accel"?Fu.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}}s.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&&Fu.IS_MAC&&(c+="Cmd "),l.key?c+l.key:c.trim()}s.normalizeKeystroke=t;function i(a){let c;return Fu.IS_WIN?c=a.winKeys||a.keys:Fu.IS_MAC?c=a.macKeys||a.keys:c=a.linuxKeys||a.keys,c.map(t)}s.normalizeKeys=i;function n(a){return typeof a=="string"?c(a):a.map(c).join(", ");function c(l){let d=[],h=Fu.IS_MAC?" ":"+",u=e(l);return u.ctrl&&d.push("Ctrl"),u.alt&&d.push("Alt"),u.shift&&d.push("Shift"),Fu.IS_MAC&&u.cmd&&d.push("Cmd"),d.push(u.key),d.map(Pv.formatKey).join(h)}}s.formatKeystroke=n;function o(a){let c=Oie(),l=c.keyForKeydownEvent(a);return c.isModifierKey(l)}s.isModifierKeyPressed=o;function r(a){let c=Oie(),l=c.keyForKeydownEvent(a),d=[];return a.ctrlKey&&d.push("Ctrl"),a.altKey&&d.push("Alt"),a.shiftKey&&d.push("Shift"),a.metaKey&&Fu.IS_MAC&&d.push("Cmd"),c.isModifierKey(l)||d.push(l),d.join(" ")}s.keystrokeForKeydownEvent=r})(rC||(rC={}));var Pv;(function(s){s.CHORD_TIMEOUT=1e3,s.KEYBINDING_HOLD_TIMEOUT=1e3,s.modifierkeyTimeOut=500;function e(y){return{execute:y.execute,describedBy:p(typeof y.describedBy=="function"?y.describedBy:{args:null,...y.describedBy},()=>({args:null})),label:p(y.label,c),mnemonic:p(y.mnemonic,l),icon:p(y.icon,f),iconClass:p(y.iconClass,c),iconLabel:p(y.iconLabel,c),caption:p(y.caption,c),usage:p(y.usage,c),className:p(y.className,c),dataset:p(y.dataset,u),isEnabled:y.isEnabled||d,isToggled:y.isToggled||h,isToggleable:y.isToggleable||!!y.isToggled,isVisible:y.isVisible||d}}s.createCommand=e;function t(y){var C;return{keys:rC.normalizeKeys(y),selector:m(y),command:y.command,args:y.args||Jc.emptyObject,preventDefault:(C=y.preventDefault)!==null&&C!==void 0?C:!0}}s.createKeyBinding=t;function i(y,C,A){let L=null,k=[],P=1/0,R=0;for(let z=0,G=y.length;zP)continue;let ge=RS.calculateSpecificity(j.selector);(!L||ie=R)&&(L=j,P=ie,R=ge)}return{exact:L,partial:k}}s.matchKeyBinding=i;function n(y){y.target.dispatchEvent(w(y))}s.replayKeyEvent=n;function o(y){return Fu.IS_MAC?r.hasOwnProperty(y)?r[y]:y:a.hasOwnProperty(y)?a[y]:y}s.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(y,C){return y===void 0?C:typeof y=="function"?y:()=>y}function m(y){if(y.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${y.selector}`);if(!RS.isValid(y.selector))throw new Error(`Invalid selector: ${y.selector}`);return y.selector}function v(y,C){if(y.lengthC.length?2:1}function b(y,C){let A=C.target,L=C.currentTarget;for(let k=0;A!==null;A=A.parentElement,++k){if(A.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(RS.matches(A,y))return k;if(A===L)return-1}return-1}function w(y){let C=document.createEvent("Event"),A=y.bubbles||!0,L=y.cancelable||!0;return C.initEvent(y.type||"keydown",A,L),C.key=y.key||"",C.keyCode=y.keyCode||0,C.which=y.keyCode||0,C.ctrlKey=y.ctrlKey||!1,C.altKey=y.altKey||!1,C.shiftKey=y.shiftKey||!1,C.metaKey=y.metaKey||!1,C.view=y.view||window,C}})(Pv||(Pv={}));class BK{constructor(e){this.type="text",this.content=e}}class Mue{constructor(e,t,i,n){this.type="element",this.tag=e,this.attrs=t,this.children=i,this.renderer=n}}function _a(s){let e={},t,i=[];for(let o=1,r=arguments.length;o=b.length){t(m[C],f);continue}let A=b[C],L=m[C];if(A===L){w=w.nextSibling;continue}if(A.type==="text"&&L.type==="text"){w.textContent!==L.content&&(w.textContent=L.content),w=w.nextSibling;continue}if(A.type==="text"||L.type==="text"){Nt.insert(b,C,L),t(L,f,w);continue}if(!A.renderer!=!L.renderer){Nt.insert(b,C,L),t(L,f,w);continue}let k=L.attrs.key;if(k&&k in v){let R=v[k];R.vNode!==A&&(Nt.move(b,b.indexOf(R.vNode,C+1),C),f.insertBefore(R.element,w),A=R.vNode,w=R.element)}if(A===L){w=w.nextSibling;continue}let P=A.attrs.key;if(P&&P!==k){Nt.insert(b,C,L),t(L,f,w);continue}if(A.tag!==L.tag){Nt.insert(b,C,L),t(L,f,w);continue}a(w,A.attrs,L.attrs),L.renderer?L.renderer.render(w,{attrs:L.attrs,children:L.children}):i(w,A.children,L.children),w=w.nextSibling}n(f,b,y,!0)}s.updateContent=i;function n(f,p,m,v){for(let b=p.length-1;b>=m;--b){const w=p[b],y=v?f.lastChild:f.childNodes[b];w.type==="text"||(w.renderer&&w.renderer.unrender?w.renderer.unrender(y,{attrs:w.attrs,children:w.children}):n(y,w.children,0,!1)),v&&f.removeChild(y)}}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,b;for(b in p)b in m||(v[b]="");for(b in m)p[b]!==m[b]&&(v[b]=m[b])}function u(f,p){let m=f.firstChild,v=Object.create(null);for(let b of p)b.type==="element"&&b.attrs.key&&(v[b.attrs.key]={vNode:b,element:m}),m=m.nextSibling;return v}})(i1||(i1={}));class yD{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}var Yp;(function(s){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,b=h;for(let w=0;w0&&m>f;){let v=m/p;for(let b=0;b0&&m>f;){let v=m,b=h;for(let w=0;w=y.maxSize?(m-=y.maxSize-y.size,h-=y.stretch,y.size=y.maxSize,y.done=!0,p--,u--):(m-=C,y.size+=C)}}for(;p>0&&m>f;){let v=m/p;for(let b=0;b=w.maxSize?(m-=w.maxSize-w.size,w.size=w.maxSize,w.done=!0,p--):(m-=v,w.size+=v))}}}return 0}s.calc=e;function t(o,r,a){o.length===0||a===0||(a>0?i(o,r,a):n(o,r,-a))}s.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 n(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)}}})(Yp||(Yp={}));class PDe{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 Qa(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,Qa.clearData(this))}}class nt{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new Qa(this),this._hiddenMode=nt.HiddenMode.Display,this.node=Bie.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(nt.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&nt.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Qa.clearData(this),zt.clearData(this),ev.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(nt.Flag.IsDisposed)}get isAttached(){return this.testFlag(nt.Flag.IsAttached)}get isHidden(){return this.testFlag(nt.Flag.IsHidden)}get isVisible(){return this.testFlag(nt.Flag.IsVisible)}get title(){return Bie.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==nt.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 nt.ChildMessage("child-removed",this);zt.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new nt.ChildMessage("child-added",this);zt.sendMessage(this._parent,t)}this.isDisposed||zt.sendMessage(this,nt.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(nt.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(){zt.postMessage(this,nt.Msg.UpdateRequest)}fit(){zt.postMessage(this,nt.Msg.FitRequest)}activate(){zt.postMessage(this,nt.Msg.ActivateRequest)}close(){zt.sendMessage(this,nt.Msg.CloseRequest)}show(){if(this.testFlag(nt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.BeforeShow),this.clearFlag(nt.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.AfterShow),this.parent)){let e=new nt.ChildMessage("child-shown",this);zt.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(nt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.BeforeHide),this.setFlag(nt.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&zt.sendMessage(this,nt.Msg.AfterHide),this.parent)){let e=new nt.ChildMessage("child-hidden",this);zt.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(nt.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(nt.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(nt.Flag.IsVisible),this.setFlag(nt.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(nt.Flag.IsVisible),this.clearFlag(nt.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&&nt.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 nt.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case nt.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case nt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case nt.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case nt.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case nt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}}(function(s){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(s.HiddenMode||(s.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"}(s.Flag||(s.Flag={})),function(o){o.BeforeShow=new Om("before-show"),o.AfterShow=new Om("after-show"),o.BeforeHide=new Om("before-hide"),o.AfterHide=new Om("after-hide"),o.BeforeAttach=new Om("before-attach"),o.AfterAttach=new Om("after-attach"),o.BeforeDetach=new Om("before-detach"),o.AfterDetach=new Om("after-detach"),o.ParentChanged=new Om("parent-changed"),o.UpdateRequest=new NV("update-request"),o.FitRequest=new NV("fit-request"),o.ActivateRequest=new NV("activate-request"),o.CloseRequest=new NV("close-request")}(s.Msg||(s.Msg={}));class e extends Om{constructor(r,a){super(r),this.child=a}}s.ChildMessage=e;class t extends Om{constructor(r,a){super("resize"),this.width=r,this.height=a}}s.ResizeMessage=t,function(o){o.UnknownSize=new o(-1,-1)}(t=s.ResizeMessage||(s.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.");zt.sendMessage(o,s.Msg.BeforeAttach),r.insertBefore(o.node,a),zt.sendMessage(o,s.Msg.AfterAttach)}s.attach=i;function n(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.");zt.sendMessage(o,s.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),zt.sendMessage(o,s.Msg.AfterDetach)}s.detach=n})(nt||(nt={}));var Bie;(function(s){s.titleProperty=new ev({name:"title",create:t=>new PDe({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}s.createNode=e})(Bie||(Bie={}));class uN{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,Qa.clearData(this),ev.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)zt.sendMessage(t,nt.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const t of this)zt.sendMessage(t,nt.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)zt.sendMessage(t,e)}onAfterAttach(e){for(const t of this)zt.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)zt.sendMessage(t,e)}onAfterDetach(e){for(const t of this)zt.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||zt.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(s){function e(o){return LF.horizontalAlignmentProperty.get(o)}s.getHorizontalAlignment=e;function t(o,r){LF.horizontalAlignmentProperty.set(o,r)}s.setHorizontalAlignment=t;function i(o){return LF.verticalAlignmentProperty.get(o)}s.getVerticalAlignment=i;function n(o,r){LF.verticalAlignmentProperty.set(o,r)}s.setVerticalAlignment=n})(uN||(uN={}));class lG{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=Fa.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,i,n){let o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),r=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o"center",changed:e}),s.verticalAlignmentProperty=new ev({name:"verticalAlignment",create:()=>"top",changed:e});function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(LF||(LF={}));class Yce extends uN{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),n=Math.max(0,Math.min(e,this._widgets.length));if(i===-1){Nt.insert(this._widgets,n,t),this.parent&&this.attachWidget(n,t);return}n===this._widgets.length&&n--,i!==n&&(Nt.move(this._widgets,i,n),this.parent&&this.moveWidget(i,n,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=Nt.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&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,i),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach)}moveWidget(e,t,i){this.parent.isAttached&&zt.sendMessage(i,nt.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&zt.sendMessage(i,nt.Msg.AfterDetach);let n=this.parent.node.children[t];this.parent.isAttached&&zt.sendMessage(i,nt.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&zt.sendMessage(i,nt.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach)}}var $$;(function(s){function e(t){return Math.max(0,Math.floor(t))}s.clampDimension=e})($$||($$={}));var G$=$$;class zA extends Yce{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=$$.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=$$.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 _S.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let i=this._sizers.length,n=e.slice(0,i);for(;n.length0&&(o.sizeHint=o.size);Yp.adjust(this._sizers,e,n),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 lG(t),n=_S.createHandle(this.renderer),o=_S.averageSize(this._sizers),r=_S.createSizer(o);Nt.insert(this._items,e,i),Nt.insert(this._sizers,e,r),Nt.insert(this._handles,e,n),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(n),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),Nt.move(this._sizers,e,t),Nt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let i=Nt.removeAt(this._items,e),n=Nt.removeAt(this._handles,e);Nt.removeAt(this._sizers,e),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(n),this.parent.isAttached&&zt.sendMessage(t,nt.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,n,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,n,a,o),i+=a,l.top=`${n}px`,l.left=`${i}px`,l.width=`${this._spacing}px`,l.height=`${o}px`):(n+=this.widgetOffset,c.update(i,n,r,a),n+=a,l.top=`${n}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=zA.getStretch(d.widget),i?(h.minSize=d.minWidth,h.maxSize=d.maxWidth,n+=d.minWidth,o=Math.max(o,d.minHeight)):(h.minSize=d.minHeight,h.maxSize=d.maxHeight,o+=d.minHeight,n=Math.max(n,d.minWidth))}let r=this._box=Fa.boxSizing(this.parent.node);n+=r.horizontalSum,o+=r.verticalSum;let a=this.parent.node.style;a.minWidth=`${n}px`,a.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&zt.sendMessage(this.parent.parent,nt.Msg.FitRequest),this._dirty&&zt.sendMessage(this.parent,nt.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=Yp.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 yD;return a.sizeHint=Math.floor(r),a}s.createSizer=e;function t(r){let a=r.createHandle();return a.style.position="absolute",a.style.contain="style",a}s.createHandle=t;function i(r){return r.reduce((a,c)=>a+c.size,0)/r.length||0}s.averageSize=i;function n(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)}s.normalize=n;function o(r){r.parent&&r.parent.layout instanceof zA&&r.parent.fit()}})(_S||(_S={}));class TXt extends zA{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=G$.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],n=i.classList.contains("lm-mod-expanded"),o=Wie.createTitle(this.renderer,t.title,n);this._titles[e]=o,this.parent.node.replaceChild(o,i)}insertWidget(e,t){t.id||(t.id=`id-${TDe.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const i=Wie.createTitle(this.renderer,t.title);Nt.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){Nt.move(this._titles,e,t),super.moveWidget(e,t,i)}detachWidget(e,t){const i=Nt.removeAt(this._titles,e);this.parent.node.removeChild(i),super.detachWidget(e,t)}updateItemPosition(e,t,i,n,o,r,a){const c=this._titles[e].style;c.top=`${n}px`,c.left=`${i}px`,c.height=`${this.widgetOffset}px`,t?c.width=`${o}px`:c.width=`${r}px`,super.updateItemPosition(e,t,i,n,o,r,a)}}var Wie;(function(s){function e(t,i,n=!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",n?"true":"false"),o.setAttribute("aria-controls",i.owner.id),n&&o.classList.add("lm-mod-expanded"),o}s.createTitle=e})(Wie||(Wie={}));class uPe extends nt{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=FDe.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var FDe;(function(s){function e(t){return t.layout||new Yce}s.createLayout=e})(FDe||(FDe={}));class VH extends uPe{constructor(e={}){super({layout:ODe.createLayout(e)}),this._handleMoved=new Qa(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=Nt.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 n,o=t.handles[i],r=o.getBoundingClientRect();t.orientation==="horizontal"?n=e.clientX-r.left:n=e.clientY-r.top;let a=window.getComputedStyle(o),c=Kh.overrideCursor(a.cursor);this._pressData={index:i,delta:n,override:c}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,i=this.layout,n=this.node.getBoundingClientRect();i.orientation==="horizontal"?t=e.clientX-n.left-this._pressData.delta:t=e.clientY-n.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(s){class e{createHandle(){let o=document.createElement("div");return o.className="lm-SplitPanel-handle",o}}s.Renderer=e,s.defaultRenderer=new e;function t(n){return zA.getStretch(n)}s.getStretch=t;function i(n,o){zA.setStretch(n,o)}s.setStretch=i})(VH||(VH={}));var ODe;(function(s){function e(t){return t.layout||new zA({renderer:t.renderer||VH.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}s.createLayout=e})(ODe||(ODe={}));class BDe extends VH{constructor(e={}){super({...e,layout:WDe.createLayout(e)}),this._widgetSizesCache=new WeakMap,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}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=Nt.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 n=i.isHidden,o=t.absoluteSizes(),r=(n?-1:1)*this.spacing,a=o.reduce((l,d)=>l+d);let c=[...o];if(n){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=Nt.findFirstIndex(this.titles,n=>n.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 n=Nt.findFirstIndex(this.titles,o=>o.contains(t));if(n>=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=(n+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],n=this._computeWidgetSize(e);n&&this.setRelativeSizes(n,!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())}}(function(s){class e extends VH.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 n=document.createElement("h3");n.setAttribute("tabindex","0"),n.id=this.createTitleKey(i),n.className=this.titleClassName;for(const a in i.dataset)n.dataset[a]=i.dataset[a];const o=n.appendChild(this.createCollapseIcon(i));o.className="lm-AccordionPanel-titleCollapser";const r=n.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=i.label,r.title=i.caption||i.label,n}createTitleKey(i){let n=this._titleKeys.get(i);return n===void 0&&(n=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(i,n)),n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e})(BDe||(BDe={}));var WDe;(function(s){function e(t){return t.layout||new TXt({renderer:t.renderer||BDe.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}s.createLayout=e})(WDe||(WDe={}));class Yg extends Yce{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=G$.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=G$.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){Nt.insert(this._items,e,new lG(t)),Nt.insert(this._sizers,e,new yD),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),Nt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let i=Nt.removeAt(this._items,e);Nt.removeAt(this._sizers,e),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.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:(n,o)=>Math.max(0,Math.floor(o)),changed:i}),s.sizeBasisProperty=new ev({name:"sizeBasis",create:()=>0,coerce:(n,o)=>Math.max(0,Math.floor(o)),changed:i});function e(n){return n==="left-to-right"||n==="right-to-left"}s.isHorizontal=e;function t(n){return Math.max(0,Math.floor(n))}s.clampSpacing=t;function i(n){n.parent&&n.parent.layout instanceof Yg&&n.parent.fit()}})(W1||(W1={}));class z3e extends uPe{constructor(e={}){super({layout:HDe.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(s){function e(o){return Yg.getStretch(o)}s.getStretch=e;function t(o,r){Yg.setStretch(o,r)}s.setStretch=t;function i(o){return Yg.getSizeBasis(o)}s.getSizeBasis=i;function n(o,r){Yg.setSizeBasis(o,r)}s.setSizeBasis=n})(z3e||(z3e={}));var HDe;(function(s){function e(t){return t.layout||new Yg(t)}s.createLayout=e})(HDe||(HDe={}));class Hie extends nt{constructor(e){super({node:PC.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||Hie.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=PC.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map(i=>PC.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){Nt.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,n=this._results;if(n||(n=this._results=PC.search(this._items,t),this._activeIndex=t?Nt.findFirstIndex(n,PC.canActivate):-1),!t&&n.length===0){wD.render(null,i);return}if(t&&n.length===0){let c=this.renderer.renderEmptyMessage({query:t});wD.render(c,i);return}let o=this.renderer,r=this._activeIndex,a=new Array(n.length);for(let c=0,l=n.length;c=n.length)i.scrollTop=0;else{let c=i.children[r];Fa.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=Nt.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=eP-R),L=w.slice(0,A),k=w.slice(A);for(let P=0,R=k.length;Pm.command===f&&Jc.deepEqual(m.args,p))||null}}})(PC||(PC={}));class F_ extends nt{constructor(e){super({node:wg.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new Qa(this),this._menuRequested=new Qa(this),this.addClass("lm-Menu"),this.setFlag(nt.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||F_.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&&!wg.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}})}wD.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=Oie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,o=wg.findMnemonic(this._items,i,n);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=Nt.findFirstIndex(this.contentNode.children,n=>Fa.hitTest(n,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(Fa.hitTest(this._childMenu.node,t,i)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(wg.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;F_.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,zt.sendMessage(this,nt.Msg.UpdateRequest);let n=this.contentNode.children[this._activeIndex];wg.openSubmenu(i,n),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()},wg.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},wg.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){wg.saveWindowData()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return _a.li({className:n,dataset:o,tabindex:"0",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))}renderIcon(i){let n=this.createIconClass(i);return _a.div({className:n},i.item.icon,i.item.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return _a.div({className:"lm-Menu-itemLabel"},n)}renderShortcut(i){let n=this.formatShortcut(i);return _a.div({className:"lm-Menu-itemShortcut"},n)}renderSubmenu(i){return _a.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(i){let n="lm-Menu-item";i.item.isEnabled||(n+=" lm-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled"),i.item.isVisible||(n+=" lm-mod-hidden"),i.active&&(n+=" lm-mod-active"),i.collapsed&&(n+=" lm-mod-collapsed");let o=i.item.className;return o&&(n+=` ${o}`),n}createItemDataset(i){let n,{type:o,command:r,dataset:a}=i.item;return o==="command"?n={...a,type:o,command:r}:n={...a,type:o},n}createIconClass(i){let n="lm-Menu-itemIcon",o=i.item.iconClass;return o?`${n} ${o}`:n}createItemARIA(i){let n={};switch(i.item.type){case"separator":n.role="presentation";break;case"submenu":n["aria-haspopup"]="true",i.item.isEnabled||(n["aria-disabled"]="true");break;default:i.item.isEnabled||(n["aria-disabled"]="true"),n.role="menuitem"}return n}formatLabel(i){let{label:n,mnemonic:o}=i.item;if(o<0||o>=n.length)return n;let r=n.slice(0,o),a=n.slice(o+1),c=n[o],l=_a.span({className:"lm-Menu-itemMnemonic"},c);return[r,l,a]}formatShortcut(i){let n=i.item.keyBinding;return n?rC.formatKeystroke(n.keys):null}}s.Renderer=e,s.defaultRenderer=new e})(F_||(F_={}));var wg;(function(s){s.TIMER_DELAY=300,s.SUBMENU_OVERLAP=3;let e=null,t=0;function i(){return t>0?(t--,e):d()}function n(){e=d(),t++}s.saveWindowData=n;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}s.createNode=o;function r(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}s.canActivate=r;function a(m,v){return new p(m.commands,v)}s.createItem=a;function c(m,v,b){for(let w=m;w;w=w.childMenu)if(Fa.hitTest(w.node,v,b))return!0;return!1}s.hitTestMenus=c;function l(m){let v=new Array(m.length);Nt.fill(v,!1);let b=0,w=m.length;for(;b=0;--y){let A=m[y];if(A.isVisible){if(A.type!=="separator")break;v[y]=!0}}let C=!1;for(;++bA+k&&(v=A+k-j),!y&&b+K>L+P&&(b>L+P?b=L+P-K:b=b-K),G.transform=`translate(${Math.max(0,v)}px, ${Math.max(0,b)}px`,G.opacity="1"}s.openRootMenu=h;function u(m,v){const b=i();let w=b.pageXOffset,y=b.pageYOffset,C=b.clientWidth,A=b.clientHeight;zt.sendMessage(m,nt.Msg.UpdateRequest);let L=A,k=m.node,P=k.style;P.opacity="0",P.maxHeight=`${L}px`,nt.attach(m,document.body);let{width:R,height:z}=k.getBoundingClientRect(),G=Fa.boxSizing(m.node),j=v.getBoundingClientRect(),K=j.right-s.SUBMENU_OVERLAP;K+R>w+C&&(K=j.left+s.SUBMENU_OVERLAP-R);let ie=j.top-G.borderTop-G.paddingTop;ie+z>y+A&&(ie=j.bottom+G.borderBottom+G.paddingBottom-z),P.transform=`translate(${Math.max(0,K)}px, ${Math.max(0,ie)}px`,P.opacity="1"}s.openSubmenu=u;function f(m,v,b){let w=-1,y=-1,C=!1,A=v.toUpperCase();for(let L=0,k=m.length;L=0&&Gw.command===v&&Jc.deepEqual(w.args,b))||null}return null}}})(wg||(wg={}));var $3e;(function(s){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}}s.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,n=e,o=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:i,currentIndex:n,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=$m.asTitle(t),n=this._titles.indexOf(i),o=Math.max(0,Math.min(e,this._titles.length));return n===-1?(Nt.insert(this._titles,o,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(o,i),i):(o===this._titles.length&&o--,n===o||(Nt.move(this._titles,n,o),this.update(),this._adjustCurrentForMove(n,o)),i)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=Nt.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":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()}onUpdateRequest(e){let t=this._titles,i=this.renderer,n=this.currentTitle,o=new Array(t.length);for(let r=0,a=t.length;rFa.hitTest(r,e.clientX,e.clientY));if(i===-1)return;let n=this.titles[i],o=t[i].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){let r=n.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};c.addEventListener("dblclick",d=>d.stopPropagation()),c.addEventListener("blur",l),c.addEventListener("keydown",d=>{d.key==="Enter"?(c.value!==""&&(n.label=n.caption=c.value),l()):d.key==="Escape"&&l()}),c.select(),c.focus(),o.children.length>0&&o.children[0].focus()}}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0&&e.button!==1||this._dragData)return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),i=this.contentNode.children,n=Nt.findFirstIndex(i,r=>Fa.hitTest(r,e.clientX,e.clientY));if(n===-1&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:i[n],index:n,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[n].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===n?this.currentIndex=-1:this.currentIndex=n,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&&!$m.dragExceeded(t,e))){if(!t.dragActive){let n=t.tab.getBoundingClientRect();this._orientation==="horizontal"?(t.tabPos=t.tab.offsetLeft,t.tabSize=n.width,t.tabPressPos=t.pressX-n.left):(t.tabPos=t.tab.offsetTop,t.tabSize=n.height,t.tabPressPos=t.pressY-n.top),t.tabLayout=$m.snapTabLayout(i,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=Kh.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&$m.detachExceeded(t,e)){t.detachRequested=!0;let n=t.index,o=e.clientX,r=e.clientY,a=i[n],c=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:c,tab:a,clientX:o,clientY:r}),t.dragAborted)return}$m.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=Nt.findFirstIndex(o,l=>Fa.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;$m.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let i=$m.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,$m.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let n=t.index,o=t.targetIndex;o===-1||n===o||(Nt.move(this._titles,n,o),this._adjustCurrentForMove(n,o),this._tabMoved.emit({fromIndex:n,toIndex:o,title:this._titles[o]}),zt.sendMessage(this,nt.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&&($m.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,n=this._currentIndex,o=this.insertBehavior;if(o==="select-tab"||o==="select-tab-if-needed"&&n===-1){this._currentIndex=e,this._previousTitle=i,this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:e,currentTitle:t});return}n>=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,n=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(n==="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(n==="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(n==="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(s){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(i){let n=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?_a.li({id:r,key:o,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):_a.li({id:r,key:o,className:c,title:n,style:a,dataset:l,...d},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){const{title:n}=i;let o=this.createIconClass(i);return _a.div({className:o},n.icon,n.iconLabel)}renderLabel(i){return _a.div({className:"lm-TabBar-tabLabel"},i.title.label)}renderCloseIcon(i){return _a.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(i){let n=this._tabKeys.get(i.title);return n===void 0&&(n=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(i.title,n)),n}createTabStyle(i){return{zIndex:`${i.zIndex}`}}createTabClass(i){let n="lm-TabBar-tab";return i.title.className&&(n+=` ${i.title.className}`),i.title.closable&&(n+=" lm-mod-closable"),i.current&&(n+=" lm-mod-current"),n}createTabDataset(i){return i.title.dataset}createTabARIA(i){return{role:"tab","aria-selected":i.current.toString()}}createIconClass(i){let n="lm-TabBar-tabIcon",o=i.title.iconClass;return o?`${n} ${o}`:n}}e._nInstance=0,s.Renderer=e,s.defaultRenderer=new e,s.addButtonSelector=".lm-TabBar-addButton"})(uI||(uI={}));var $m;(function(s){s.DRAG_THRESHOLD=5,s.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",d.appendChild(u),d}s.createNode=e;function t(d){return d instanceof PDe?d:new PDe(d)}s.asTitle=t;function i(d){let h=window.getComputedStyle(d);return 1e3*(parseFloat(h.transitionDuration)||0)}s.parseTransitionDuration=i;function n(d,h){let u=new Array(d.length);for(let f=0,p=d.length;f=s.DRAG_THRESHOLD||f>=s.DRAG_THRESHOLD}s.dragExceeded=o;function r(d,h){let u=d.contentRect;return h.clientX=u.right+s.DETACH_THRESHOLD||h.clientY=u.bottom+s.DETACH_THRESHOLD}s.detachExceeded=r;function a(d,h,u,f){let p,m,v,b;f==="horizontal"?(p=h.pressX,m=u.clientX-h.contentRect.left,v=u.clientX,b=h.contentRect.width):(p=h.pressY,m=u.clientY-h.contentRect.top,v=u.clientY,b=h.contentRect.height);let w=h.index,y=m-h.tabPressPos,C=y+h.tabSize;for(let A=0,L=d.length;A>1);if(Ah.index&&C>R)k=`${-h.tabSize-P.margin}px`,w=Math.max(w,A);else if(A===h.index){let z=v-p,G=b-(h.tabPos+h.tabSize);k=`${Math.max(-h.tabPos,Math.min(z,G))}px`}else k="";f==="horizontal"?d[A].style.left=k:d[A].style.top=k}h.targetIndex=w}s.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`}s.finalizeTabPosition=c;function l(d,h){for(const u of d)h==="horizontal"?u.style.left="":u.style.top=""}s.resetTabPositions=l})($m||($m={}));class LXt extends uN{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=G$.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:nt.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=G$.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():E4()}widgets(){return this._root?this._root.iterUserWidgets():E4()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():E4()}tabBars(){return this._root?this._root.iterTabBars():E4()}handles(){return this._root?this._root.iterHandles():E4()}moveHandle(e,t,i){let n=e.classList.contains("lm-mod-hidden");if(!this._root||n)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(),Yp.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=Ul.normalizeAreaConfig(e.main,t):i=null;let n=this.widgets(),o=this.tabBars(),r=this.handles();this._root=null;for(const a of n)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=Ul.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,n=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,n){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}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=Fa.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),n=e-i.left-this._box.borderLeft,o=t-i.top-this._box.borderTop,r=this._root.hitTestTabNodes(n,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:n,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 lG(e)),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.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(Ul.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===nt.HiddenMode.Scale&&t.tabBar.titles.length==1){const u=t.tabBar.titles[0].owner;u.hiddenMode=nt.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 n=Nt.removeFirstOf(i.children,t),o=Nt.removeAt(i.handles,n);if(Nt.removeAt(i.sizers,n),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 Ul.TabLayoutNode){a.parent=l,l.children[d]=a;return}let h=Nt.removeAt(l.handles,d);Nt.removeAt(l.children,d),Nt.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,b=1/0,w=1/0,y=p.get(this.tabBar),C=this.tabBar.currentTitle,A=C?p.get(C.owner):void 0,[L,k]=this.sizers;return y&&y.fit(),A&&A.fit(),y&&!y.isHidden?(m=Math.max(m,y.minWidth),v+=y.minHeight,L.minSize=y.minHeight,L.maxSize=y.maxHeight):(L.minSize=0,L.maxSize=0),A&&!A.isHidden?(m=Math.max(m,A.minWidth),v+=A.minHeight,k.minSize=A.minHeight,k.maxSize=1/0):(k.minSize=0,k.maxSize=1/0),{minWidth:m,minHeight:v,maxWidth:b,maxHeight:w}}update(f,p,m,v,b,w){this._top=p,this._left=f,this._width=m,this._height=v;let y=w.get(this.tabBar),C=this.tabBar.currentTitle,A=C?w.get(C.owner):void 0;if(Yp.calc(this.sizers,v),y&&!y.isHidden){let L=this.sizers[0].size;y.update(f,p,m,L),p+=L}if(A&&!A.isHidden){let L=this.sizers[1].size;A.update(f,p,m,L)}}}s.TabLayoutNode=n;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,b)=>v+b,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,b=m?v:0,w=m?0:v,y=1/0,C=1/0;for(let A=0,L=this.children.length;A=p.length)&&(m=0),{type:"tab-area",widgets:p,currentIndex:m}}function l(u,f){let p=u.orientation,m=[],v=[];for(let b=0,w=u.children.length;b{let w=i(v,f,p),y=e(u.sizes[b]),C=f.createHandle();m.children.push(w),m.handles.push(C),m.sizers.push(y),w.parent=m}),m.syncHandles(),m.normalizeSizes(),m}})(Ul||(Ul={}));class K$ extends nt{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new Qa(this),this._addRequested=new Qa(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||K$.defaultRenderer,this._edges=e.edges||qc.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 LXt({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new K$.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(qc.createSingleDocumentConfig(this));break;default:throw"unreachable"}zt.postMessage(this,qc.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=kDe(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),(Fu.IS_EDGE||Fu.IS_IE)&&zt.flush(),zt.postMessage(this,qc.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),zt.postMessage(this,qc.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){qc.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){qc.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),zt.postMessage(this,qc.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:n,target:o}=qc.findDropTarget(this,t,i,this._edges);if(this._tabsConstrained&&e.source!==this||n==="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 nt)){e.dropAction="none";return}if(c.contains(this)){e.dropAction="none";return}let l=o?qc.getDropRef(o.tabBar):null;switch(n){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(),zt.postMessage(this,qc.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,i=e.target,n=kDe(t.handles(),d=>d.contains(i));if(!n)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=n.getBoundingClientRect(),r=e.clientX-o.left,a=e.clientY-o.top,c=window.getComputedStyle(n),l=Kh.overrideCursor(c.cursor,this._document);this._pressData={handle:n,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,n=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),zt.postMessage(this,qc.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:n}=qc.findDropTarget(this,e,t,this._edges);if(i==="invalid")return this.overlay.hide(100),i;let o,r,a,c,l=Fa.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*qc.GOLDEN_RATIO;break;case"root-left":o=l.paddingTop,r=l.paddingLeft,a=d.width*qc.GOLDEN_RATIO,c=l.paddingBottom;break;case"root-right":o=l.paddingTop,r=d.width*qc.GOLDEN_RATIO,a=l.paddingRight,c=l.paddingBottom;break;case"root-bottom":o=d.height*qc.GOLDEN_RATIO,r=l.paddingLeft,a=l.paddingRight,c=l.paddingBottom;break;case"widget-all":o=n.top,r=n.left,a=n.right,c=n.bottom;break;case"widget-top":o=n.top,r=n.left,a=n.right,c=n.bottom+n.height/2;break;case"widget-left":o=n.top,r=n.left,a=n.right+n.width/2,c=n.bottom;break;case"widget-right":o=n.top,r=n.left+n.width/2,a=n.right,c=n.bottom;break;case"widget-bottom":o=n.top+n.height/2,r=n.left,a=n.right,c=n.bottom;break;case"widget-tab":{const h=n.tabBar.node.getBoundingClientRect().height;o=n.top,r=n.left,a=n.right,c=n.bottom+n.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 qc.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(){zt.postMessage(this,qc.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:i,currentTitle:n}=t;i&&i.owner.hide(),n&&n.owner.show(),(Fu.IS_EDGE||Fu.IS_IE)&&zt.flush(),zt.postMessage(this,qc.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:n,clientX:o,clientY:r}=t,a=new xXt,c=()=>i.owner;a.setData("application/vnd.lumino.widget-factory",c);let l=n.cloneNode(!0);this._drag=new Kh({document:this._document,mimeData:a,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden");let d=()=>{this._drag=null,n.classList.remove("lm-mod-hidden")};this._drag.start(o,r).then(d)}}(function(s){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(n){let o=this.node.style;o.top=`${n.top}px`,o.left=`${n.left}px`,o.right=`${n.right}px`,o.bottom=`${n.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(n){if(!this._hidden){if(n<=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")},n))}}}s.Overlay=e;class t{createTabBar(n){let o=new uI({document:n});return o.addClass("lm-DockPanel-tabBar"),o}createHandle(){let n=document.createElement("div");return n.className="lm-DockPanel-handle",n}}s.Renderer=t,s.defaultRenderer=new t})(K$||(K$={}));var qc;(function(s){s.GOLDEN_RATIO=.618,s.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},s.LayoutModified=new NV("layout-modified"),s.isGeneratedTabBarProperty=new ev({name:"isGeneratedTabBar",create:()=>!1});function e(n){if(n.isEmpty)return{main:null};let o=Array.from(n.widgets()),r=n.selectedWidgets().next().value,a=r?o.indexOf(r):-1;return{main:{type:"tab-area",widgets:o,currentIndex:a}}}s.createSingleDocumentConfig=e;function t(n,o,r,a){if(!Fa.hitTest(n.node,o,r))return{zone:"invalid",target:null};let c=n.layout;if(c.isEmpty)return{zone:"root-all",target:null};if(n.mode==="multiple-document"){let y=n.node.getBoundingClientRect(),C=o-y.left+1,A=r-y.top+1,L=y.right-o,k=y.bottom-r;switch(Math.min(A,L,k,C)){case A:if(Am&&u>m&&h>v&&f>v)return{zone:"widget-all",target:l};d/=m,h/=v,u/=m,f/=v;let b=Math.min(d,h,u,f),w;switch(b){case d:w="widget-left";break;case h:w="widget-top";break;case u:w="widget-right";break;case f:w="widget-bottom";break;default:throw"unreachable"}return{zone:w,target:l}}s.findDropTarget=t;function i(n){return n.titles.length===0?null:n.currentTitle?n.currentTitle.owner:n.titles[n.titles.length-1].owner}s.getDropRef=i})(qc||(qc={}));class XT extends uN{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new yD],this._columnSizers=[new yD],this._box=null,e.rowCount!==void 0&&xd.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&xd.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=xd.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=xd.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&&(xd.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(xd.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=xd.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=xd.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=xd.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=xd.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){Nt.findFirstIndex(this._items,i=>i.widget===e)===-1&&(this._items.push(new lG(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=Nt.findFirstIndex(this._items,n=>n.widget===e);if(t===-1)return;let i=Nt.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&&zt.sendMessage(e,nt.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&zt.sendMessage(e,nt.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&zt.sendMessage(e,nt.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}}s.normalizeConfig=e;function t(c){return Math.max(0,Math.floor(c))}s.clampValue=t;function i(c,l){let d=s.cellConfigProperty.get(c.widget),h=s.cellConfigProperty.get(l.widget);return d.rowSpan-h.rowSpan}s.rowSpanCmp=i;function n(c,l){let d=s.cellConfigProperty.get(c.widget),h=s.cellConfigProperty.get(l.widget);return d.columnSpan-h.columnSpan}s.columnSpanCmp=n;function o(c,l){for(l=Math.max(1,Math.floor(l));c.lengthl&&(c.length=l)}s.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}s.distributeMin=r;function a(c){c.parent&&c.parent.layout instanceof XT&&c.parent.fit()}})(xd||(xd={}));class q$ extends nt{constructor(e={}){super({node:Uie.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(nt.Flag.DisallowLayout),this.renderer=e.renderer||q$.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),this._activeIndex!==e&&(this._activeIndex=e,e!==-1&&(this._tabFocusIndex=e),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),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 n=this._menus.indexOf(t),o=Math.max(0,Math.min(e,this._menus.length));if(n===-1){Nt.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--,n!==o&&(Nt.move(this._menus,n,o),i&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let i=Nt.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"mouseleave":this._evtMouseLeave(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("mouseleave",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("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&(this.activeIndex=0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let i=this._menus,n=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.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 F_({commands:new rC}),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]=n.renderItem({title:this._overflowMenu.title,active:a===o&&i[a].items.length!==0,tabbable:a===r,onfocus:()=>{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]=n.renderItem({title:v.title,active:!1,tabbable:a===r,onfocus:()=>{this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),d.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}wD.render(d,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,i=0,n=-1,o=e.length;if(this._menuItemSizes.length==0)for(let r=0;rt&&n===-1&&(n=r)}else for(let r=0;rt){n=r;break}this._overflowIndex=n}_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){this.openActiveMenu();return}if(t===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(t===37){let r=this._activeIndex,a=this._menus.length;this.activeIndex=r===0?a-1:r-1;return}if(t===39){let r=this._activeIndex,a=this._menus.length;this.activeIndex=r===a-1?0:r+1;return}let i=Oie().keyForKeydownEvent(e);if(!i)return;let n=this._activeIndex+1,o=Uie.findMnemonic(this._menus,i,n);o.index!==-1&&!o.multiple?(this.activeIndex=o.index,this.openActiveMenu()):o.index!==-1?this.activeIndex=o.index:o.auto!==-1&&(this.activeIndex=o.auto)}_evtMouseDown(e){if(!Fa.hitTest(this.node,e.clientX,e.clientY))return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let t=Nt.findFirstIndex(this.contentNode.children,i=>Fa.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{const i=this._positionForMenu(t);F_.saveWindowData(),this.activeIndex=t,this._openChildMenu(i)}}_evtMouseMove(e){let t=Nt.findFirstIndex(this.contentNode.children,n=>Fa.hitTest(n,e.clientX,e.clientY));if(t===this._activeIndex||t===-1&&this._childMenu)return;const i=t>=0&&this._childMenu?this._positionForMenu(t):null;F_.saveWindowData(),this.activeIndex=t,i&&this._openChildMenu(i)}_positionForMenu(e){let t=this.contentNode.children[e],{left:i,bottom:n}=t.getBoundingClientRect();return{top:n,left:i}}_evtMouseLeave(e){this._childMenu||(this.activeIndex=-1)}_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),zt.sendMessage(this,nt.Msg.UpdateRequest);let{left:n,top:o}=e;(typeof n>"u"||typeof o>"u")&&({left:n,top:o}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),t.items.length>0&&t.open(n,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,n=this._menus.length;switch(t){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=i===0?n-1:i-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}}(function(s){class e{renderItem(i){let n=this.createItemClass(i),o=this.createItemDataset(i),r=this.createItemARIA(i);return _a.li({className:n,dataset:o,tabindex:i.tabbable?"0":"-1",onfocus:i.onfocus,...r},this.renderIcon(i),this.renderLabel(i))}renderIcon(i){let n=this.createIconClass(i);return _a.div({className:n},i.title.icon,i.title.iconLabel)}renderLabel(i){let n=this.formatLabel(i);return _a.div({className:"lm-MenuBar-itemLabel"},n)}createItemClass(i){let n="lm-MenuBar-item";return i.title.className&&(n+=` ${i.title.className}`),i.active&&(n+=" lm-mod-active"),n}createItemDataset(i){return i.title.dataset}createItemARIA(i){return{role:"menuitem","aria-haspopup":"true"}}createIconClass(i){let n="lm-MenuBar-itemIcon",o=i.title.iconClass;return o?`${n} ${o}`:n}formatLabel(i){let{label:n,mnemonic:o}=i.title;if(o<0||o>=n.length)return n;let r=n.slice(0,o),a=n.slice(o+1),c=n[o],l=_a.span({className:"lm-MenuBar-itemMnemonic"},c);return[r,l,a]}}s.Renderer=e,s.defaultRenderer=new e})(q$||(q$={}));var Uie;(function(s){function e(){let i=document.createElement("div"),n=document.createElement("ul");return n.className="lm-MenuBar-content",i.appendChild(n),n.setAttribute("role","menubar"),i}s.createNode=e;function t(i,n,o){let r=-1,a=-1,c=!1,l=n.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===nt.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=nt.HiddenMode.Scale),t.hiddenMode=nt.HiddenMode.Scale):t.hiddenMode=nt.HiddenMode.Display,Nt.insert(this._items,e,new lG(t)),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,i){Nt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let i=Nt.removeAt(this._items,e);this.parent.isAttached&&zt.sendMessage(t,nt.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&zt.sendMessage(t,nt.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===nt.HiddenMode.Scale&&(t.hiddenMode=nt.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=nt.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(n))))}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,n){const o=this.getLanguage(e,null),r=this.configurationService.inspect(t,{resource:e,overrideIdentifier:o});n===void 0&&(n=this.deriveConfigurationTarget(r,o));const a=o&&r.overrideIdentifiers?.includes(o)?o:void 0;return this.configurationService.updateValue(t,i,{resource:e,overrideIdentifier:a},n)}deriveConfigurationTarget(e,t){if(t){if(e.memory?.override!==void 0)return St.MEMORY;if(e.workspaceFolder?.override!==void 0)return St.WORKSPACE_FOLDER;if(e.workspace?.override!==void 0)return St.WORKSPACE;if(e.userRemote?.override!==void 0)return St.USER_REMOTE;if(e.userLocal?.override!==void 0)return St.USER_LOCAL}return e.memory?.value!==void 0?St.MEMORY:e.workspaceFolder?.value!==void 0?St.WORKSPACE_FOLDER:e.workspace?.value!==void 0?St.WORKSPACE:e.userRemote?.value!==void 0?St.USER_REMOTE:St.USER_LOCAL}_getValue(e,t,i){const n=e?this.getLanguage(e,t):void 0;return typeof i>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:n}):this.configurationService.getValue(i,{resource:e,overrideIdentifier:n})}inspect(e,t,i){const n=e?this.getLanguage(e,t):void 0;return this.configurationService.inspect(i,{resource:e,overrideIdentifier:n})}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 n=t?this.getLanguage(t,null):void 0;return e.affectsConfiguration(i,{resource:t,overrideIdentifier:n})}}}};VDe=D([_(0,Te),_(1,gi),_(2,xi)],VDe);const Jce=".vscode",Vie="settings",PXt=`${Jce}/${Vie}.json`,FXt="vscode://schemas/settings/default",OXt="vscode://schemas/settings/user",BXt="vscode://schemas/settings/profile",WXt="vscode://schemas/settings/machine",Cst="vscode://schemas/settings/workspace",HXt="vscode://schemas/settings/folder",UXt="vscode://schemas/launch",VXt="vscode://schemas/tasks";at.APPLICATION;const zXt=[at.MACHINE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Sst=[at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE],$Xt=[at.APPLICATION,...Sst],Nue=[at.MACHINE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],dj=[at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Ast=[at.RESOURCE,at.LANGUAGE_OVERRIDABLE,at.MACHINE_OVERRIDABLE],Nf="tasks",ox="launch",gPe=Object.create(null);gPe[Nf]=`${Jce}/${Nf}.json`;gPe[ox]=`${Jce}/${ox}.json`;const Est=Object.create(null);Est[Nf]=`${Nf}.json`;const GXt=`{ "version": "2.0.0", "tasks": [] -}`,OC="workbench.settings.applyToAllProfiles",nZt=Qe.as(YA.JSONContribution),gj=Qe.as(Nn.Configuration),s9e={type:"object",defaultSnippets:[{body:{title:"",properties:{}}}],properties:{title:{description:g(3603,"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(3604,"When specified, gives the order of this category of settings relative to other categories."),type:"integer"},properties:{description:g(3605,"Description of the configuration properties."),type:"object",propertyNames:{pattern:"\\S+",patternErrorMessage:g(3606,"Property should not be empty.")},additionalProperties:{anyOf:[{title:g(3607,"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(3608,"Configuration that can be configured only in the user settings."),g(3609,"Configuration that can be configured only in the user settings or only in the remote settings."),g(3610,"Configuration that can be configured in the user, remote or workspace settings."),g(3611,"Configuration that can be configured in the user, remote, workspace or folder settings."),g(3612,"Resource configuration that can be configured in language specific settings."),g(3613,"Machine configuration that can be configured also in workspace or folder settings.")],markdownDescription:g(3614,"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(3615,"Descriptions for enum values")},markdownEnumDescriptions:{type:"array",items:{type:"string"},description:g(3616,"Descriptions for enum values in the markdown format.")},enumItemLabels:{type:"array",items:{type:"string"},markdownDescription:g(3617,"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(3618,"The description in the markdown format.")},deprecationMessage:{type:"string",description:g(3619,"If set, the property is marked as deprecated and the given message is shown as an explanation.")},markdownDeprecationMessage:{type:"string",description:g(3620,"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(3621,"The value will be shown in an inputbox."),g(3622,"The value will be shown in a textarea.")],default:"singlelineText",description:g(3623,"When specified, controls the presentation format of the string setting.")},order:{type:"integer",description:g(3624,"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(3625,"When enabled, Settings Sync will not sync the user value of this configuration by default.")}}}]}}}};let Hp;const Nst=eh.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:bKe}});Nst.setHandler((s,{added:e,removed:t})=>{Hp&&gj.deltaConfiguration(Hp);const i=Hp={};if(queueMicrotask(()=>{Hp===i&&(gj.deltaConfiguration(Hp),Hp=void 0)}),t.length){const n=t.map(o=>({overrides:xs(o.value),source:{id:o.description.identifier.value,displayName:o.description.displayName}}));Hp.removedDefaults=n}if(e.length){const n=gj.getConfigurationProperties(),o=[at.MACHINE_OVERRIDABLE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE],r=e.map(a=>{const c=xs(a.value);for(const l of Object.keys(c)){const d=n[l];if(d?.disallowConfigurationDefault){a.collector.warn(g(3626,"Cannot register configuration defaults for '{0}'. This setting does not allow contributing configuration defaults.",l)),delete c[l];continue}if(!tf.test(l)&&d?.scope&&!o.includes(d.scope)){a.collector.warn(g(3627,"Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",l)),delete c[l];continue}}return{overrides:c,source:{id:a.description.identifier.value,displayName:a.description.displayName}}});Hp.addedDefaults=r}});const sZt=eh.registerExtensionPoint({extensionPoint:"configuration",deps:[Nst],jsonSchema:{description:g(3628,"Contributes configuration settings."),oneOf:[s9e,{type:"array",items:s9e}]}}),Vue=new va;sZt.setHandler((s,{added:e,removed:t})=>{if(Hp??={},t.length){const r=[];for(const a of t)r.push(...Vue.get(a.description.identifier)||[]),Vue.delete(a.description.identifier);Hp.removedConfigurations=r}const i=new Set;function n(r,a){const c=xs(r);return c.title&&typeof c.title!="string"&&a.collector.error(g(3629,"'configuration.title' must be a string")),o(c,a),c.id=r.id||a.description.identifier.value,c.extensionInfo={id:a.description.identifier.value,displayName:a.description.displayName},c.restrictedProperties=a.description.capabilities?.untrustedWorkspaces?.supported==="limited"?a.description.capabilities?.untrustedWorkspaces.restrictedConfigurations:void 0,c.title=c.title||a.description.displayName||a.description.identifier.value,c}function o(r,a){const c=r.properties;if(c){typeof c!="object"&&(a.collector.error(g(3630,"'configuration.properties' must be an object")),r.properties={});for(const d in c){const h=c[d],u=SKe(d,h);if(u){delete c[d],a.collector.warn(u);continue}if(i.has(d)){delete c[d],a.collector.warn(g(3631,"Cannot register '{0}'. This property is already registered.",d));continue}if(!kn(h)){delete c[d],a.collector.error(g(3632,"configuration.properties property '{0}' must be an object",d));continue}i.add(d),h.scope=h.scope?gut(h.scope.toString()):at.WINDOW}}const l=r.allOf;if(l){a.collector.error(g(3633,"'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(n(d,a))):c.push(n(l,a)),Vue.set(a.description.identifier,c),r.push(...c)}Hp.addedConfigurations=r}gj.deltaConfiguration(Hp),Hp=void 0});nZt.registerSchema("vscode://schemas/workspaceConfig",{allowComments:!0,allowTrailingCommas:!0,default:{folders:[{path:""}],settings:{}},required:["folders"],properties:{folders:{minItems:0,uniqueItems:!0,description:g(3634,"List of folders to be loaded in the workspace."),items:{type:"object",defaultSnippets:[{body:{path:"$1"}}],oneOf:[{properties:{path:{type:"string",description:g(3635,"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(3636,"An optional name for the folder. ")}},required:["path"]},{properties:{uri:{type:"string",description:g(3637,"URI of the folder")},name:{type:"string",description:g(3636,"An optional name for the folder. ")}},required:["uri"]}]}},settings:{type:"object",default:{},description:g(3638,"Workspace settings"),$ref:Tst},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(3639,"Workspace launch configurations"),$ref:XXt},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(3640,"Workspace task configurations"),$ref:ZXt},extensions:{type:"object",default:{},description:g(3641,"Workspace extensions"),$ref:"vscode://schemas/extensions"},remoteAuthority:{type:"string",doNotSuggest:!0,description:g(3642,"The remote server where the workspace is located.")},transient:{type:"boolean",doNotSuggest:!0,description:g(3643,"A transient workspace will disappear when restarting or reloading.")}},errorMessage:g(3644,"Unknown workspace configuration property")});class oZt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.configuration}render(e){const t=e.contributes?.configuration?Array.isArray(e.contributes.configuration)?e.contributes.configuration:[e.contributes.configuration]:[],i=AKe(t),n=i?Object.keys(i):[],o=[g(3645,"ID"),g(3646,"Description"),g(3647,"Default")],r=n.sort((a,c)=>a.localeCompare(c)).map(a=>[new Mt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Mt(i[a].markdownDescription,!1):i[a].description??"",new Mt().appendCodeblock("json",JSON.stringify(Ya(i[a].default)?CKe(i[a].type):i[a].default,null,2))]);return{data:{headers:o,rows:r},dispose:()=>{}}}}Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(3648,"Settings"),access:{canToggle:!1},renderer:new wi(oZt)});let jDe=class extends V{constructor(e,t,i,n,o,r){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=n,this.hostService=o,this.storageService=r,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==qi.FOLDER||Ftt(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(mae);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:xme.WORKSPACE,isSecondary:!0};if(t.length===1){const n=t[0];this.notificationService.prompt(Xe.Info,g(3649,"This folder contains a workspace file '{0}'. Do you want to open it? [Learn more]({1}) about workspace files.",n,"https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(3650,"Open Workspace"),run:()=>this.hostService.openWindow([{workspaceUri:Pt(e,n)}])}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:K2.SILENT})}else t.length>1&&this.notificationService.prompt(Xe.Info,g(3651,"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(3652,"Select Workspace"),run:()=>{this.quickInputService.pick(t.map(n=>({label:n})),{placeHolder:g(3653,"Select a workspace to open")}).then(n=>{n&&this.hostService.openWindow([{workspaceUri:Pt(e,n.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:K2.SILENT})}};jDe=D([_(0,yi),_(1,bi),_(2,Jt),_(3,In),_(4,xc),_(5,$i)],jDe);Qe.as(cf.Workbench).registerWorkbenchContribution(jDe,Rs.Eventually);At(class extends li{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Pe(3650,"Open Workspace"),f1:!1,menu:{id:_e.EditorContent,when:he.and(M3.Extension.isEqualTo(mje),cJe.isEqualTo(ztt),aJe.toNegated())}})}async run(s,e){const t=s.get(xc),i=s.get(yi),n=s.get(bi);if(i.getWorkbenchState()===qi.WORKSPACE){const o=i.getWorkspace().configuration;if(o&&ji(o,e)){n.info(g(3654,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class Gie extends DA{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new DA(e,t),this._launchModel=as.createEmptyModel(t),this._tasksModel=as.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=s8(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 n=R8(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),o=Object.create(null);o[t]=n;const r=Object.keys(i).map(a=>`${t}.${a}`);return new as(o,r,[],void 0,this.logService)}return as.createEmptyModel(this.logService)}}class Pst extends DA{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=R8(e,r=>console.error(`Conflict in settings file ${this._name}: ${r}`)),n=Object.create(null);n[this.scope]=i;const o=Object.keys(e).map(r=>`${this.scope}.${r}`);return{contents:n,keys:o,overrides:[]}}}class o9e extends u3{constructor(e,t,i,n,o,r,a,c,l,d,h){super(e,t,i,n,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:Ys(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Ys(this.getValue(d,{resource:h.uri,overrideIdentifier:c}),e.getValue(d,{resource:h.uri,overrideIdentifier:c}))):!0)),l},i=t(this.allKeys(),e.allKeys()),n=[],o=ja([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const r of o){const a=t(this.getAllKeysForOverrideIdentifier(r),e.getAllKeysForOverrideIdentifier(r),r);a.length&&n.push([r,a])}return{keys:i,overrides:n}}}function rZt(s){return s.hasOwnProperty("workspace")}function fj(s){return s.hasOwnProperty("folderUri")}function aZt(s){return s.hasOwnProperty("fileUri")}function Fst(s){return Kie(s)||Ost(s)}function Kie(s){const e=s;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function Ost(s){const e=s;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function xPe(s,e,t,i,n){if(s.scheme!==i.scheme)return{name:t,uri:s.toString(!0)};let o=e?void 0:n.relativePath(i,s);if(o!==void 0)o.length===0?o=".":Qn&&(o=r9e(o));else if(s.scheme===pe.file)o=s.fsPath,Qn&&(o=r9e(o));else if(n.isEqualAuthority(s.authority,i.authority))o=s.path;else return{name:t,uri:s.toString(!0)};return{name:t,path:o}}function r9e(s){return s=Kw(s),vlt(s)||(s=S8(s)),s}function zue(s,e,t){const i=[],n=new Set,o=t.dirname(e);for(const r of s){let a;if(Kie(r))r.path&&(a=t.resolvePath(o,r.path));else if(Ost(r))try{a=N.parse(r.uri),a.path[0]!==Vi.sep&&(a=a.with({path:Vi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!n.has(c)){n.add(c);const l=r.name||t.basenameOrAuthority(a);i.push(new pae({uri:a,name:l,index:i.length},r))}}}return i}function a9e(s,e,t,i,n){const o=cZt(e,s),r=n.dirname(e),a=n.dirname(i),c=[];for(const u of o.folders){const f=Kie(u)?n.resolvePath(r,u.path):N.parse(u.uri);let p;t?p=!1:p=!Kie(u)||pM(u.path),c.push(xPe(f,p,u.name,a,n))}const l={insertSpaces:!1,tabSize:4,eol:pr||Qt?` +}`,FC="workbench.settings.applyToAllProfiles",KXt=Qe.as(QA.JSONContribution),hj=Qe.as(Nn.Configuration),K3e={type:"object",defaultSnippets:[{body:{title:"",properties:{}}}],properties:{title:{description:g(3603,"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(3604,"When specified, gives the order of this category of settings relative to other categories."),type:"integer"},properties:{description:g(3605,"Description of the configuration properties."),type:"object",propertyNames:{pattern:"\\S+",patternErrorMessage:g(3606,"Property should not be empty.")},additionalProperties:{anyOf:[{title:g(3607,"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(3608,"Configuration that can be configured only in the user settings."),g(3609,"Configuration that can be configured only in the user settings or only in the remote settings."),g(3610,"Configuration that can be configured in the user, remote or workspace settings."),g(3611,"Configuration that can be configured in the user, remote, workspace or folder settings."),g(3612,"Resource configuration that can be configured in language specific settings."),g(3613,"Machine configuration that can be configured also in workspace or folder settings.")],markdownDescription:g(3614,"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(3615,"Descriptions for enum values")},markdownEnumDescriptions:{type:"array",items:{type:"string"},description:g(3616,"Descriptions for enum values in the markdown format.")},enumItemLabels:{type:"array",items:{type:"string"},markdownDescription:g(3617,"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(3618,"The description in the markdown format.")},deprecationMessage:{type:"string",description:g(3619,"If set, the property is marked as deprecated and the given message is shown as an explanation.")},markdownDeprecationMessage:{type:"string",description:g(3620,"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(3621,"The value will be shown in an inputbox."),g(3622,"The value will be shown in a textarea.")],default:"singlelineText",description:g(3623,"When specified, controls the presentation format of the string setting.")},order:{type:"integer",description:g(3624,"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(3625,"When enabled, Settings Sync will not sync the user value of this configuration by default.")}}}]}}}};let Op;const xst=Xd.registerExtensionPoint({extensionPoint:"configurationDefaults",jsonSchema:{$ref:hKe}});xst.setHandler((s,{added:e,removed:t})=>{Op&&hj.deltaConfiguration(Op);const i=Op={};if(queueMicrotask(()=>{Op===i&&(hj.deltaConfiguration(Op),Op=void 0)}),t.length){const n=t.map(o=>({overrides:xs(o.value),source:{id:o.description.identifier.value,displayName:o.description.displayName}}));Op.removedDefaults=n}if(e.length){const n=hj.getConfigurationProperties(),o=[at.MACHINE_OVERRIDABLE,at.WINDOW,at.RESOURCE,at.LANGUAGE_OVERRIDABLE],r=e.map(a=>{const c=xs(a.value);for(const l of Object.keys(c)){const d=n[l];if(d?.disallowConfigurationDefault){a.collector.warn(g(3626,"Cannot register configuration defaults for '{0}'. This setting does not allow contributing configuration defaults.",l)),delete c[l];continue}if(!Xg.test(l)&&d?.scope&&!o.includes(d.scope)){a.collector.warn(g(3627,"Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",l)),delete c[l];continue}}return{overrides:c,source:{id:a.description.identifier.value,displayName:a.description.displayName}}});Op.addedDefaults=r}});const qXt=Xd.registerExtensionPoint({extensionPoint:"configuration",deps:[xst],jsonSchema:{description:g(3628,"Contributes configuration settings."),oneOf:[K3e,{type:"array",items:K3e}]}}),Pue=new va;qXt.setHandler((s,{added:e,removed:t})=>{if(Op??={},t.length){const r=[];for(const a of t)r.push(...Pue.get(a.description.identifier)||[]),Pue.delete(a.description.identifier);Op.removedConfigurations=r}const i=new Set;function n(r,a){const c=xs(r);return c.title&&typeof c.title!="string"&&a.collector.error(g(3629,"'configuration.title' must be a string")),o(c,a),c.id=r.id||a.description.identifier.value,c.extensionInfo={id:a.description.identifier.value,displayName:a.description.displayName},c.restrictedProperties=a.description.capabilities?.untrustedWorkspaces?.supported==="limited"?a.description.capabilities?.untrustedWorkspaces.restrictedConfigurations:void 0,c.title=c.title||a.description.displayName||a.description.identifier.value,c}function o(r,a){const c=r.properties;if(c){typeof c!="object"&&(a.collector.error(g(3630,"'configuration.properties' must be an object")),r.properties={});for(const d in c){const h=c[d],u=pKe(d,h);if(u){delete c[d],a.collector.warn(u);continue}if(i.has(d)){delete c[d],a.collector.warn(g(3631,"Cannot register '{0}'. This property is already registered.",d));continue}if(!kn(h)){delete c[d],a.collector.error(g(3632,"configuration.properties property '{0}' must be an object",d));continue}i.add(d),h.scope=h.scope?iut(h.scope.toString()):at.WINDOW}}const l=r.allOf;if(l){a.collector.error(g(3633,"'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(n(d,a))):c.push(n(l,a)),Pue.set(a.description.identifier,c),r.push(...c)}Op.addedConfigurations=r}hj.deltaConfiguration(Op),Op=void 0});KXt.registerSchema("vscode://schemas/workspaceConfig",{allowComments:!0,allowTrailingCommas:!0,default:{folders:[{path:""}],settings:{}},required:["folders"],properties:{folders:{minItems:0,uniqueItems:!0,description:g(3634,"List of folders to be loaded in the workspace."),items:{type:"object",defaultSnippets:[{body:{path:"$1"}}],oneOf:[{properties:{path:{type:"string",description:g(3635,"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(3636,"An optional name for the folder. ")}},required:["path"]},{properties:{uri:{type:"string",description:g(3637,"URI of the folder")},name:{type:"string",description:g(3636,"An optional name for the folder. ")}},required:["uri"]}]}},settings:{type:"object",default:{},description:g(3638,"Workspace settings"),$ref:Cst},launch:{type:"object",default:{configurations:[],compounds:[]},description:g(3639,"Workspace launch configurations"),$ref:UXt},tasks:{type:"object",default:{version:"2.0.0",tasks:[]},description:g(3640,"Workspace task configurations"),$ref:VXt},extensions:{type:"object",default:{},description:g(3641,"Workspace extensions"),$ref:"vscode://schemas/extensions"},remoteAuthority:{type:"string",doNotSuggest:!0,description:g(3642,"The remote server where the workspace is located.")},transient:{type:"boolean",doNotSuggest:!0,description:g(3643,"A transient workspace will disappear when restarting or reloading.")}},errorMessage:g(3644,"Unknown workspace configuration property")});class QXt extends V{constructor(){super(...arguments),this.type="table"}shouldRender(e){return!!e.contributes?.configuration}render(e){const t=e.contributes?.configuration?Array.isArray(e.contributes.configuration)?e.contributes.configuration:[e.contributes.configuration]:[],i=mKe(t),n=i?Object.keys(i):[],o=[g(3645,"ID"),g(3646,"Description"),g(3647,"Default")],r=n.sort((a,c)=>a.localeCompare(c)).map(a=>[new Mt().appendMarkdown(`\`${a}\``),i[a].markdownDescription?new Mt(i[a].markdownDescription,!1):i[a].description??"",new Mt().appendCodeblock("json",JSON.stringify(Ya(i[a].default)?fKe(i[a].type):i[a].default,null,2))]);return{data:{headers:o,rows:r},dispose:()=>{}}}}Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"configuration",label:g(3648,"Settings"),access:{canToggle:!1},renderer:new wi(QXt)});let zDe=class extends V{constructor(e,t,i,n,o,r){super(),this.contextService=e,this.notificationService=t,this.fileService=i,this.quickInputService=n,this.hostService=o,this.storageService=r,this.findWorkspaces()}async findWorkspaces(){const e=this.contextService.getWorkspace().folders[0];if(!e||this.contextService.getWorkbenchState()!==qi.FOLDER||ktt(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(uae);i.length>0&&this.doHandleWorkspaceFiles(e.uri,i)}}doHandleWorkspaceFiles(e,t){const i={id:"workspaces.dontPromptToOpen",scope:wme.WORKSPACE,isSecondary:!0};if(t.length===1){const n=t[0];this.notificationService.prompt(Xe.Info,g(3649,"This folder contains a workspace file '{0}'. Do you want to open it? [Learn more]({1}) about workspace files.",n,"https://go.microsoft.com/fwlink/?linkid=2025315"),[{label:g(3650,"Open Workspace"),run:()=>this.hostService.openWindow([{workspaceUri:Pt(e,n)}])}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:V2.SILENT})}else t.length>1&&this.notificationService.prompt(Xe.Info,g(3651,"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(3652,"Select Workspace"),run:()=>{this.quickInputService.pick(t.map(n=>({label:n})),{placeHolder:g(3653,"Select a workspace to open")}).then(n=>{n&&this.hostService.openWindow([{workspaceUri:Pt(e,n.label)}])})}}],{neverShowAgain:i,priority:this.storageService.isNew(Ie.WORKSPACE)?void 0:V2.SILENT})}};zDe=D([_(0,yi),_(1,bi),_(2,Jt),_(3,In),_(4,xc),_(5,$i)],zDe);Qe.as(of.Workbench).registerWorkbenchContribution(zDe,Rs.Eventually);At(class extends li{constructor(){super({id:"workbench.action.openWorkspaceFromEditor",title:Fe(3650,"Open Workspace"),f1:!1,menu:{id:_e.EditorContent,when:he.and(T3.Extension.isEqualTo(cje),eJe.isEqualTo(Ptt),ZYe.toNegated())}})}async run(s,e){const t=s.get(xc),i=s.get(yi),n=s.get(bi);if(i.getWorkbenchState()===qi.WORKSPACE){const o=i.getWorkspace().configuration;if(o&&ji(o,e)){n.info(g(3654,"This workspace is already open."));return}}return t.openWindow([{workspaceUri:e}])}});class zie extends EA{constructor(e,t){super(e,t),this._folders=[],this._transient=!1,this._settingsModelParser=new EA(e,t),this._launchModel=as.createEmptyModel(t),this._tasksModel=as.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=t8(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 n=I8(i,a=>console.error(`Conflict in settings file ${this._name}: ${a}`)),o=Object.create(null);o[t]=n;const r=Object.keys(i).map(a=>`${t}.${a}`);return new as(o,r,[],void 0,this.logService)}return as.createEmptyModel(this.logService)}}class Dst extends EA{constructor(e,t,i){super(e,i),this.scope=t}doParseRaw(e,t){const i=I8(e,r=>console.error(`Conflict in settings file ${this._name}: ${r}`)),n=Object.create(null);n[this.scope]=i;const o=Object.keys(e).map(r=>`${this.scope}.${r}`);return{contents:n,keys:o,overrides:[]}}}class q3e extends l3{constructor(e,t,i,n,o,r,a,c,l,d,h){super(e,t,i,n,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:Ys(this.getValue(d,{overrideIdentifier:c}),e.getValue(d,{overrideIdentifier:c}))?this._workspace&&this._workspace.folders.some(h=>!Ys(this.getValue(d,{resource:h.uri,overrideIdentifier:c}),e.getValue(d,{resource:h.uri,overrideIdentifier:c}))):!0)),l},i=t(this.allKeys(),e.allKeys()),n=[],o=ja([...this.allOverrideIdentifiers(),...e.allOverrideIdentifiers()]);for(const r of o){const a=t(this.getAllKeysForOverrideIdentifier(r),e.getAllKeysForOverrideIdentifier(r),r);a.length&&n.push([r,a])}return{keys:i,overrides:n}}}function jXt(s){return s.hasOwnProperty("workspace")}function uj(s){return s.hasOwnProperty("folderUri")}function YXt(s){return s.hasOwnProperty("fileUri")}function kst(s){return $ie(s)||Ist(s)}function $ie(s){const e=s;return typeof e?.path=="string"&&(!e.name||typeof e.name=="string")}function Ist(s){const e=s;return typeof e?.uri=="string"&&(!e.name||typeof e.name=="string")}function fPe(s,e,t,i,n){if(s.scheme!==i.scheme)return{name:t,uri:s.toString(!0)};let o=e?void 0:n.relativePath(i,s);if(o!==void 0)o.length===0?o=".":Qn&&(o=Q3e(o));else if(s.scheme===pe.file)o=s.fsPath,Qn&&(o=Q3e(o));else if(n.isEqualAuthority(s.authority,i.authority))o=s.path;else return{name:t,uri:s.toString(!0)};return{name:t,path:o}}function Q3e(s){return s=zw(s),alt(s)||(s=w8(s)),s}function Fue(s,e,t){const i=[],n=new Set,o=t.dirname(e);for(const r of s){let a;if($ie(r))r.path&&(a=t.resolvePath(o,r.path));else if(Ist(r))try{a=N.parse(r.uri),a.path[0]!==Vi.sep&&(a=a.with({path:Vi.sep+a.path}))}catch(c){console.warn(c)}if(a){const c=t.getComparisonKey(a);if(!n.has(c)){n.add(c);const l=r.name||t.basenameOrAuthority(a);i.push(new hae({uri:a,name:l,index:i.length},r))}}}return i}function j3e(s,e,t,i,n){const o=JXt(e,s),r=n.dirname(e),a=n.dirname(i),c=[];for(const u of o.folders){const f=$ie(u)?n.resolvePath(r,u.path):N.parse(u.uri);let p;t?p=!1:p=!$ie(u)||hM(u.path),c.push(fPe(f,p,u.name,a,n))}const l={insertSpaces:!1,tabSize:4,eol:pr||Qt?` `:`\r -`},d=Xce(s,["folders"],c,l);let h=W3e(s,d);return R2(o.remoteAuthority,KYe(i))&&(h=W3e(h,hYt(h,["remoteAuthority"],l))),h}function cZt(s,e){const t=sf(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>Fst(i));else throw new Error(`${s} looks like an invalid workspace file.`);return t}function lZt(s){return s.workspace&&typeof s.workspace=="object"&&typeof s.workspace.id=="string"&&typeof s.workspace.configPath=="string"}function dZt(s){return typeof s.folderUri=="string"}function hZt(s){return typeof s.fileUri=="string"}function uZt(s,e){const t={workspaces:[],files:[]};if(s){const i=function(o,r){for(let a=0;a{const r=o.label,a=o.remoteAuthority;lZt(o)?t.workspaces.push({label:r,remoteAuthority:a,workspace:{id:o.workspace.id,configPath:N.parse(o.workspace.configPath)}}):dZt(o)?t.workspaces.push({label:r,remoteAuthority:a,folderUri:N.parse(o.folderUri)}):hZt(o)&&t.files.push({label:r,remoteAuthority:a,fileUri:N.parse(o.fileUri)})})}return t}function gZt(s){const e={entries:[]};for(const t of s.workspaces)fj(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 s.files)e.entries.push({fileUri:t.fileUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority});return e}const Bst=Te;var fr;(function(s){s[s.ERROR_UNKNOWN_KEY=0]="ERROR_UNKNOWN_KEY",s[s.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION=1]="ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION",s[s.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE=2]="ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE",s[s.ERROR_INVALID_FOLDER_CONFIGURATION=3]="ERROR_INVALID_FOLDER_CONFIGURATION",s[s.ERROR_INVALID_USER_TARGET=4]="ERROR_INVALID_USER_TARGET",s[s.ERROR_INVALID_WORKSPACE_TARGET=5]="ERROR_INVALID_WORKSPACE_TARGET",s[s.ERROR_INVALID_FOLDER_TARGET=6]="ERROR_INVALID_FOLDER_TARGET",s[s.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION=7]="ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION",s[s.ERROR_NO_WORKSPACE_OPENED=8]="ERROR_NO_WORKSPACE_OPENED",s[s.ERROR_CONFIGURATION_FILE_DIRTY=9]="ERROR_CONFIGURATION_FILE_DIRTY",s[s.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE=10]="ERROR_CONFIGURATION_FILE_MODIFIED_SINCE",s[s.ERROR_INVALID_CONFIGURATION=11]="ERROR_INVALID_CONFIGURATION",s[s.ERROR_POLICY_CONFIGURATION=12]="ERROR_POLICY_CONFIGURATION",s[s.ERROR_INTERNAL=13]="ERROR_INTERNAL"})(fr||(fr={}));class c9e extends La{constructor(e,t){super(e),this.code=t}}var An;(function(s){s[s.USER_LOCAL=1]="USER_LOCAL",s[s.USER_REMOTE=2]="USER_REMOTE",s[s.WORKSPACE=3]="WORKSPACE",s[s.WORKSPACE_FOLDER=4]="WORKSPACE_FOLDER"})(An||(An={}));let YDe=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=n,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 bI}async writeConfiguration(e,t,i={}){const n=this.getConfigurationEditOperation(e,t,i.scopes||{});return this.queue.queue(async()=>{try{await this.doWriteConfiguration(n,i)}catch(o){if(i.donotNotifyError)throw o;await this.onError(o,n,i.scopes)}})}async doWriteConfiguration(e,t){await this.validate(e.target,e,!t.handleDirtyFile,t.scopes||{});const i=e.resource,n=await this.resolveModelReference(i);try{const o=this.getFormattingOptions(n.object.textEditorModel);await this.updateConfiguration(e,n.object.textEditorModel,o,t)}finally{n.dispose()}}async updateConfiguration(e,t,i,n){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(fr.ERROR_INVALID_CONFIGURATION,e.target,e);if(this.textFileService.isDirty(t.uri)&&n.handleDirtyFile)switch(n.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===Qi.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(fr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new c9e(g(8749,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),fr.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),o=new F(i.lineNumber,i.column,n.lineNumber,n.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?Zn.replace(o,e.content):Zn.insert(i,e.content);return t.pushEditOperations([new dt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,n){return t.length?Xce(i,t,e,n):[{content:JSON.stringify(e,null,n.insertSpaces&&n.tabSize?" ".repeat(n.tabSize):" "),length:i.length,offset:0}]}getFormattingOptions(e){const{insertSpaces:t,tabSize:i}=e.getOptions(),n=e.getEOL();return{insertSpaces:t,tabSize:i,eol:n}}async onError(e,t,i){switch(e.code){case fr.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case fr.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case fr.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===Of?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===cx?g(8751,"Open Launch Configuration"):null;i?this.notificationService.prompt(Xe.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Xe.Error,e.message,[{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const n=t.workspaceStandAloneConfigurationKey===Of?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===cx?g(8751,"Open Launch Configuration"):null;n?this.notificationService.prompt(Xe.Error,e.message,[{label:g(8753,"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:n,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Xe.Error,e.message,[{label:g(8753,"Save and Retry"),run:()=>this.writeConfiguration(t.target,{key:t.key,value:t.value},{handleDirtyFile:"save",scopes:i})},{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}openSettings(e){const t={jsonEditor:!0};switch(e.target){case An.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case An.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case An.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case An.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 n=this.toErrorMessage(e,t,i);return new c9e(n,e)}toErrorMessage(e,t,i){switch(e){case fr.ERROR_POLICY_CONFIGURATION:return g(8754,"Unable to write {0} because it is configured in system policy.",i.key);case fr.ERROR_UNKNOWN_KEY:return g(8755,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION:return g(8756,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE:return g(8757,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case fr.ERROR_INVALID_FOLDER_CONFIGURATION:return g(8758,"Unable to write to Folder Settings because {0} does not support the folder resource scope.",i.key);case fr.ERROR_INVALID_USER_TARGET:return g(8759,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case fr.ERROR_INVALID_WORKSPACE_TARGET:return g(8760,"Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",i.key);case fr.ERROR_INVALID_FOLDER_TARGET:return g(8761,"Unable to write to Folder Settings because no resource is provided.");case fr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION:return g(8762,"Unable to write to Language Settings because {0} is not a resource language setting.",i.key);case fr.ERROR_NO_WORKSPACE_OPENED:return g(8763,"Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",this.stringifyTarget(t));case fr.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===Of)return g(8764,"Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again.");if(i.workspaceStandAloneConfigurationKey===cx)return g(8765,"Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again.");switch(t){case An.USER_LOCAL:return g(8766,"Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.");case An.USER_REMOTE:return g(8767,"Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again.");case An.WORKSPACE:return g(8768,"Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again.");case An.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(n=o.name)}return g(8769,"Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",n)}default:return""}}case fr.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===Of)return g(8770,"Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again.");if(i.workspaceStandAloneConfigurationKey===cx)return g(8771,"Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again.");switch(t){case An.USER_LOCAL:return g(8772,"Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again.");case An.USER_REMOTE:return g(8773,"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 An.WORKSPACE:return g(8774,"Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again.");case An.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(n=o.name)}return g(8775,"Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",n)}default:return""}}case fr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===Of)return g(8776,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===cx)return g(8777,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case An.USER_LOCAL:return g(8778,"Unable to write into user settings because the content of the file is newer.");case An.USER_REMOTE:return g(8779,"Unable to write into remote user settings because the content of the file is newer.");case An.WORKSPACE:return g(8780,"Unable to write into workspace settings because the content of the file is newer.");case An.WORKSPACE_FOLDER:return g(8781,"Unable to write into folder settings because the content of the file is newer.")}case fr.ERROR_INTERNAL:return g(8782,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case An.USER_LOCAL:return g(8783,"User Settings");case An.USER_REMOTE:return g(8784,"Remote User Settings");case An.WORKSPACE:return g(8785,"Workspace Settings");case An.WORKSPACE_FOLDER:return g(8786,"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 Of:return iZt;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 sf(e,i,{allowTrailingComma:!0,allowEmptyContent:!0}),i.length>0}async validate(e,t,i,n){if(this.configurationService.inspect(t.key).policyValue!==void 0)throw this.toConfigurationEditingError(fr.ERROR_POLICY_CONFIGURATION,e,t);const r=Qe.as(Nn.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!tf.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(fr.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==Of&&(e===An.USER_LOCAL||e===An.USER_REMOTE))throw this.toConfigurationEditingError(fr.ERROR_INVALID_USER_TARGET,e,t);if((e===An.WORKSPACE||e===An.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===qi.EMPTY)throw this.toConfigurationEditingError(fr.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===An.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!tf.test(t.key)){if(r===at.APPLICATION)throw this.toConfigurationEditingError(fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(r===at.MACHINE)throw this.toConfigurationEditingError(fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===An.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!tf.test(t.key)&&r!==void 0&&!Rst.includes(r))throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(n.overrideIdentifiers?.length&&r!==at.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(fr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(fr.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===An.USER_LOCAL?Mst:EPe,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 n=t.key,r=Qe.as(Nn.Configuration).getConfigurationProperties()[n]?.scope;let a=i.overrideIdentifiers?.length?[yKe(i.overrideIdentifiers),n]:[n];if(e===An.USER_LOCAL||e===An.USER_REMOTE)return{key:n,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,n,"",null,r)??void 0,target:e};const c=this.getConfigurationFileResource(e,n,KXt,i.resource,r);return this.isWorkspaceConfigurationResource(c)&&(a=["settings",...a]),{key:n,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,n,o){if(e===An.USER_LOCAL)return t===Of?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===An.USER_REMOTE)return this.remoteSettingsResource;const r=this.contextService.getWorkbenchState();if(r!==qi.EMPTY){const a=this.contextService.getWorkspace();if(e===An.WORKSPACE){if(r===qi.WORKSPACE)return a.configuration??null;if(r===qi.FOLDER)return a.folders[0].toResource(i)}if(e===An.WORKSPACE_FOLDER&&n){const c=this.contextService.getWorkspaceFolder(n);if(c)return c.toResource(i)}}return null}};YDe=D([_(1,Bst),_(2,yi),_(3,ug),_(4,Em),_(5,Jt),_(6,fn),_(7,Fo),_(8,bi),_(9,B6),_(10,ei),_(11,ks)],YDe);const yO=class yO extends RYe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=Qe.as(Nn.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!CA(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=kn(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,n]of t)!tf.test(i)&&n.value!==void 0&&(e[i]=n.value);try{Object.keys(e).length?(localStorage.setItem(yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};yO.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let JDe=yO;class fZt extends cje{constructor(e,t,i,n){super(e.defaultProfile.settingsResource,{scopes:[at.APPLICATION]},i.extUri,t,n),this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._register(this.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new cn(()=>this.loadConfiguration().then(o=>this._onDidChangeConfiguration.fire(o)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(OC),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class pZt extends V{get hasTasksLoaded(){return this.userConfiguration.value instanceof qie}constructor(e,t,i,n,o,r){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=n,this.uriIdentityService=o,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new wn),this.userConfigurationChangeDisposable=this._register(new wn),this.userConfiguration.value=new cje(e,this.configurationParseOptions,o.extUri,this.fileService,r),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new cn(()=>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?[[Of,this.tasksResource]]:[],n=new qie(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),o=await n.loadConfiguration(e);return this.userConfiguration.value=n,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 qie extends V{constructor(e,t,i,n,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(jr(...this.allResources.map(c=>jr(this.fileService.watch(r.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new DA(e,a),this._folderSettingsParseOptions=n,this._standAloneConfigurations=[],this._cache=as.createEmptyModel(this.logService),this._register(M.debounce(M.any(M.filter(this.fileService.onDidFilesChange,c=>this.handleFileChangesEvent(c)),M.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()}': ${su(a)}`),a.fileOperationResult!==Qi.FILE_NOT_FOUND&&a.fileOperationResult!==Qi.FILE_NOT_DIRECTORY&&this.logService.error(a)}return"{}"})),[[i],n]=await Promise.all([e?Promise.resolve([void 0]):t([this.settingsResource]),t(this.standAloneConfigurationResources.map(([,o])=>o))]);return[i,n.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 n=0;ne.contains(t))||this.allResources.some(t=>e.contains(this.uriIdentityService.extUri.dirname(t),To.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Ai.CREATE)||e.isOperation(Ai.COPY)||e.isOperation(Ai.DELETE)||e.isOperation(Ai.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Ai.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class mZt extends V{constructor(e,t,i,n,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 _Zt(e,t,{scopes:Uue},r),o.getEnvironment().then(async a=>{if(a){const c=this._register(new $ue(a.settingsPath,{scopes:Uue},this._fileService,n,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 $ue)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:Uue})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof $ue){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==Qi.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class $ue extends V{constructor(e,t,i,n,o){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=n,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new wn),this.directoryWatcherDisposable=this._register(new wn),this.parser=new DA(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 cn(()=>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 as.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,To.UPDATED);e.contains(this.configurationResource,To.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,To.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Ai.CREATE)||e.isOperation(Ai.COPY)||e.isOperation(Ai.DELETE)||e.isOperation(Ai.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class _Zt extends V{constructor(e,t,i,n){super(),this.configurationCache=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.key={type:"user",key:e},this.parser=new DA("CachedRemoteUserConfiguration",n),this.parseOptions=i,this.configurationModel=as.createEmptyModel(n)}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 vZt extends V{get initialized(){return this._initialized}constructor(e,t,i,n){super(),this.configurationCache=e,this.fileService=t,this.uriIdentityService=i,this.logService=n,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 bZt(e,n)}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 VK(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:uj,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:uj,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await aje(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof VK)){const t=this._register(new VK(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:uj,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 VK){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class VK extends V{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 Gie("",i),this.workspaceSettings=as.createEmptyModel(i),this._register(M.any(M.filter(this.fileService.onDidFilesChange,n=>!!this._workspaceIdentifier&&n.contains(this._workspaceIdentifier.configPath)),M.filter(this.fileService.onDidRunOperation,n=>!!this._workspaceIdentifier&&(n.isOperation(Ai.CREATE)||n.isOperation(Ai.COPY)||n.isOperation(Ai.DELETE)||n.isOperation(Ai.WRITE))&&t.extUri.isEqual(n.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new cn(()=>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 Gie(this._workspaceIdentifier.id,this.logService),bt(this.workspaceConfigWatcher),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile()));let i="";try{i=await this.resolveContent(this._workspaceIdentifier)}catch(n){await this.fileService.exists(this._workspaceIdentifier.configPath)&&this.logService.error(n)}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):V.None}}class bZt{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=M.None,this.workspaceConfigurationModelParser=new Gie("",t),this.workspaceSettings=as.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),n=await this.configurationCache.read(i),o=JSON.parse(n);o.content&&(this.workspaceConfigurationModelParser=new Gie(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 wZt{constructor(e,t,i,n,o){this.configurationCache=n,this.logService=o,this.onDidChange=M.None,this.key={type:"folder",key:Wc(Pt(e,t).toString()).toString(16)},this._folderSettingsModelParser=new DA("CachedFolderConfiguration",o),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=as.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===$ie)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const n=new Pst(i,i,this.logService);n.parse(t[i]),this._standAloneConfigurations.push(n.configurationModel)}this.consolidate()}catch{}return this.configurationModel}async updateConfiguration(e,t){const i={};e&&(i[$ie]=e),t.forEach(([n,o])=>{o&&(i[n]=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 yZt extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=n,this.workspaceTrusted=o,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=qi.WORKSPACE===this.workbenchState?Rst:uj,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new wZt(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,aje(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 n=t.extUri.joinPath(this.configurationFolder,`${$ie}.json`),o=[Of,cx].map(r=>[r,t.extUri.joinPath(this.configurationFolder,`${r}.json`)]);return new qie(this.configurationFolder.toString(),n,o,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof qie){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}function l9e(s,e){return s.isDefault||s.useDefaultFlags?.settings?e?tZt:void 0:e?Lst:eZt}class Gue extends pje{constructor(){super(...arguments),this.initialized=!1}}class CZt extends V{get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,n,o,r,a,c,l,d){if(super(),this.userDataProfileService=n,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=Qe.as(Nn.Configuration),this.initRemoteUserConfigurationBarrier=new qd,this.completeWorkspaceBarrier=new qd,this.defaultConfiguration=this._register(new JDe(t,i,l)),this.policyConfiguration=d instanceof uJe?new Ukt:this._register(new Y_e(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new o9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,as.createEmptyModel(l),as.createEmptyModel(l),as.createEmptyModel(l),as.createEmptyModel(l),new ui,as.createEmptyModel(l),new ui,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new pZt(n.currentProfile.settingsResource,n.currentProfile.tasksResource,{scopes:l9e(n.currentProfile,!!e)},r,c,l)),this.cachedFolderConfigs=new ui,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new mZt(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 vZt(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(n.onDidChangeCurrentProfile(h=>this.onUserDataProfileChanged(h))),this.workspaceEditingQueue=new bI}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new fZt(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?qi.WORKSPACE:this.workspace.folders.length===1?qi.FOLDER:qi.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 qi.FOLDER:{let t;return N.isUri(e)?t=e:P_(e)&&(t=e.uri),N.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case qi.WORKSPACE:return iA(e)&&this.workspace.id===e.id}return!1}async doUpdateFolders(e,t,i){if(this.getWorkbenchState()!==qi.WORKSPACE||e.length+t.length===0)return Promise.resolve(void 0);let n=!1,o=this.getWorkspace().folders,r=o.map(a=>a.raw).filter((a,c)=>Fst(a)?!this.contains(t,o[c].uri):!0);if(n=o.length!==r.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);o=zue(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(xPe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(n=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(DI))),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,n=Pde(e)?e:Pde(t)?t:void 0;return this._configuration.getValue(i,n)}async updateValue(e,t,i,n,o){const r=tut(i)?i:Pde(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=r?n:i,c=a?[a]:[];if(r?.overrideIdentifiers&&(r.overrideIdentifiers=ja(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)),Ys(t,l.defaultValue)&&c.length===1&&(c[0]===St.USER||c[0]===St.USER_LOCAL)&&(t=void 0)}await Zs.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:n}=await this.reloadUserConfiguration();await this.reloadWorkspaceConfiguration(),await this.loadConfiguration(t,i,n,!0);return}if(fje(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case St.DEFAULT:this.reloadDefaultConfiguration();return;case St.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case St.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case St.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case St.WORKSPACE:case St.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){cs("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),cs("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()===qi.FOLDER?i[0]&&this._configuration.updateWorkspaceConfiguration(i[0]):this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted)),this.updateRestrictedSettings();let n=[];this.restrictedSettings.userLocal&&n.push(...this.restrictedSettings.userLocal),this.restrictedSettings.userRemote&&n.push(...this.restrictedSettings.userRemote),this.restrictedSettings.workspace&&n.push(...this.restrictedSettings.workspace),this.restrictedSettings.workspaceFolder?.forEach(o=>n.push(...o)),n=ja(n),n.length&&this.triggerConfigurationChange({keys:n,overrides:[]},{data:t,workspace:this.workspace},St.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===at.APPLICATION)return!0;const t=this.getValue(OC)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return iA(e)?this.createMultiFolderWorkspace(e):P_(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=zue(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),n=e.id,o=new Gue(n,i,this.workspaceConfiguration.isTransient(),t,r=>this.uriIdentityService.extUri.ignorePathCasing(r));return o.initialized=this.workspaceConfiguration.initialized,o}createSingleFolderWorkspace(e){const t=new Gue(e.id,[KY(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new Gue(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 n,o,r=[];if(i?(n=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();n&&a!==n&&this._onDidChangeWorkbenchState.fire(a);const c=this.workspace.configuration?this.workspace.configuration.fsPath:void 0;(o&&c!==o||a!==n)&&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(XP(si,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(n=>!e.some(o=>n.uri.toString()===o.uri.toString()));for(let n=0;n{cs("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(as.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(OC)})}return cs("code/didInitUserConfiguration"),c},[,o,[r,a]]=await Promise.all([t,i,n()]);cs("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(o,r,a,e),cs("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return as.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 as.createEmptyModel(this.logService)}async reloadWorkspaceConfiguration(){const e=this.getWorkbenchState();if(e===qi.FOLDER)return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);if(e===qi.WORKSPACE)return this.workspaceConfiguration.reload().then(()=>this.onWorkspaceConfigurationChanged(!1))}reloadWorkspaceFolderConfiguration(e){return this.onWorkspaceFolderConfigurationChanged(e)}async loadConfiguration(e,t,i,n){this.cachedFolderConfigs=new ui;const o=this.workspace.folders,r=await this.loadFolderConfigurations(o),a=this.getWorkspaceConfigurationModel(r),c=new ui;r.forEach((d,h)=>c.set(o[h].uri,d));const l=this._configuration;if(this._configuration=new o9e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,as.createEmptyModel(this.logService),new ui,this.workspace,this.logService),this.initialized=!0,n){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},St.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case qi.FOLDER:return e[0];case qi.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return as.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:l9e(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,n]=await Promise.all(t);n=n??this._configuration.applicationConfiguration,this.applicationConfiguration&&(i=this.localUserConfiguration.reparse({exclude:n.getValue(OC)})),await this.loadConfiguration(n,i,this._configuration.remoteUserConfiguration,!0)})())}onDefaultConfigurationChanged(e,t){if(this.workspace){const i=this._configuration.toData(),n=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()===qi.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(n,{data:i,workspace:this.workspace},St.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,St.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(OC)??[],n=this._configuration.compareAndUpdateApplicationConfiguration(e),o=this.getValue(OC)??[],r=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of n.keys)if(r[c]?.scope===at.APPLICATION){if(a.push(c),c===OC){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);n.keys=a,n.keys.includes(OC)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:o})),this.triggerConfigurationChange(n,t,St.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,St.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,St.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=zue(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:n,changed:o}=this.compareFolders(this.workspace.folders,t);i.length||n.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)),n=XI(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...n.added,...n.removed);const o=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),r=XI(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=XI(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=XI(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new ui;for(const p of this.workspace.folders){const v=(this.cachedFolderConfigs.get(p.uri)?.getRestrictedSettings()||[]).sort((y,C)=>y.localeCompare(C));v.length&&h.set(p.uri,v);const b=this._restrictedSettings.workspaceFolder?.get(p.uri)||[],w=XI(v,b,(y,C)=>y.localeCompare(C));e.push(...w.added,...w.removed)}const u=this.getWorkbenchState()===qi.WORKSPACE?this.workspaceConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)):this.workspace.folders[0]?h.get(this.workspace.folders[0].uri)||[]:[],f=XI(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 n={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,n,St.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(r)}else this.triggerConfigurationChange(o,n,St.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(n){i.push(n)},changes:e,fromCache:t});try{await Zs.settled(i)}catch{}}async onWorkspaceFolderConfigurationChanged(e){const[t]=await this.loadFolderConfigurations([e]),i={data:this._configuration.toData(),workspace:this.workspace},n=this._configuration.compareAndUpdateFolderConfiguration(e.uri,t);if(this.getWorkbenchState()===qi.FOLDER){const o=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(k2e(n,o),i,St.WORKSPACE)}else this.triggerConfigurationChange(n,i,St.WORKSPACE_FOLDER);this.updateRestrictedSettings()}async onFoldersChanged(){const e=[];for(const i of this.cachedFolderConfigs.keys())this.workspace.folders.filter(n=>n.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((n,o)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[o].uri,n))}),k2e(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new yZt(!this.initialized,t,tle,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(n){this.logService.warn(`Ignoring the error while validating workspace folder ${i.uri.toString()} - ${Nr(n)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,n,o){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===St.DEFAULT)throw new Error("Invalid configuration target");if(i===St.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,n),this.triggerConfigurationChange({keys:n?.overrideIdentifiers?.length?[yKe(n.overrideIdentifiers),e]:[e],overrides:n?.overrideIdentifiers?.length?n.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const r=this.toEditableConfigurationTarget(i,e);if(!r)throw new Error("Invalid configuration target");if(r===An.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(n?.overrideIdentifiers?.length&&n.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(r,n.resource);if(a){const c=n.overrideIdentifiers.sort(),l=a.overrides.find(d=>is([...d.identifiers].sort(),c));l&&(n.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(r,{key:e,value:t},{scopes:n,...o}),r){case An.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case An.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case An.WORKSPACE:return this.reloadWorkspaceConfiguration();case An.WORKSPACE_FOLDER:{const a=n&&n.resource?this.workspace.getFolder(n.resource):null;if(a)return this.reloadWorkspaceFolderConfiguration(a)}}}async createConfigurationEditingService(e){const t=(await this.remoteAgentService.getEnvironment())?.settingsPath??null;return e.createInstance(YDe,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case An.USER_LOCAL:return this._configuration.localUserConfiguration;case An.USER_REMOTE:return this._configuration.remoteUserConfiguration;case An.WORKSPACE:return this._configuration.workspaceConfiguration;case An.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case St.USER_LOCAL:return this._configuration.localUserConfiguration;case St.USER_REMOTE:return this._configuration.remoteUserConfiguration;case St.WORKSPACE:return this._configuration.workspaceConfiguration;case St.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Ys(t,i.value))return[];const n=[];return i.workspaceFolderValue!==void 0&&n.push(St.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&n.push(St.WORKSPACE),i.userRemoteValue!==void 0&&n.push(St.USER_REMOTE),i.userLocalValue!==void 0&&n.push(St.USER_LOCAL),i.applicationValue!==void 0&&n.push(St.APPLICATION),t===void 0?n:[n[0]||St.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==St.DEFAULT&&this.logService.debug(`Configuration keys changed in ${iut(i)} target`,...e.keys);const n=new PLe(e,t,this._configuration,this.workspace,this.logService);n.source=i,this._onDidChangeConfiguration.fire(n)}}toEditableConfigurationTarget(e,t){if(e===St.APPLICATION)return An.USER_LOCAL;if(e===St.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===at.MACHINE||i===at.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return An.USER_REMOTE}return An.USER_LOCAL}return e===St.USER_LOCAL?An.USER_LOCAL:e===St.USER_REMOTE?An.USER_REMOTE:e===St.WORKSPACE?An.WORKSPACE:e===St.WORKSPACE_FOLDER?An.WORKSPACE_FOLDER:null}}let XDe=class extends V{constructor(e,t,i,n,o){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,n.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const r=Qe.as(Nn.Configuration),a=this._register(new Mh(50));this._register(M.any(r.onDidUpdateConfiguration,r.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),o.phase===Rs.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Dg.properties,patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},X4.properties,cS.properties,qv.properties),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},eF.properties,aS.properties,cS.properties,qv.properties),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},n={properties:Object.assign({},eF.properties,aS.properties,cS.properties,qv.properties),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(aS.properties),this.checkAndFilterPropertiesRequiringTrust(cS.properties),this.checkAndFilterPropertiesRequiringTrust(qv.properties)),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.keys(Dg.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Dg.properties[d]),l),{}),patternProperties:Object.keys(Dg.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Dg.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=qi.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(aS.properties),this.checkAndFilterPropertiesRequiringTrust(qv.properties)),patternProperties:Dg.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:o,c={type:"object",description:g(3655,"Contribute defaults for configurations"),properties:Object.assign({},this.filterDefaultOverridableProperties(aS.properties),this.filterDefaultOverridableProperties(cS.properties),this.filterDefaultOverridableProperties(qv.properties)),patternProperties:{[IE]:{type:"object",default:{},$ref:bE}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:r,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:n,workspaceSettingsSchema:o,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=Qe.as(YA.JSONContribution);t.registerSchema(qXt,e.defaultSettingsSchema),t.registerSchema(QXt,e.userSettingsSchema),t.registerSchema(jXt,e.profileSettingsSchema),t.registerSchema(YXt,e.machineSettingsSchema),t.registerSchema(Tst,e.workspaceSettingsSchema),t.registerSchema(JXt,e.folderSettingsSchema),t.registerSchema(bKe,e.configDefaultsSchema)}checkAndFilterPropertiesRequiringTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return e;const t={};return Object.entries(e).forEach(([i,n])=>{n.restricted||(t[i]=n)}),t}filterDefaultOverridableProperties(e){const t={};return Object.entries(e).forEach(([i,n])=>{n.disallowConfigurationDefault||(t[i]=n)}),t}};XDe=D([_(0,yi),_(1,Jr),_(2,uC),_(3,fs),_(4,ig)],XDe);let ZDe=class extends V{constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(St.DEFAULT))}};ZDe=D([_(0,Te),_(1,fs)],ZDe);var jB;let Qie=(jB=class extends V{constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=Qe.as(Nn.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 n of e){const o=i[n];if(o?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(n)){this.processedExperimentalSettings.add(n);try{const r=await this.workbenchAssignmentService.getTreatment(`config.${n}`);!Ya(r)&&!Ys(r,o.default)&&(t[n]=r)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t}])}},jB.ID="workbench.contrib.updateExperimentalSettingsDefaults",jB);Qie=D([_(0,tXe)],Qie);const Wst=Qe.as(cf.Workbench);Wst.registerWorkbenchContribution(XDe,Rs.Restored);Wst.registerWorkbenchContribution(ZDe,Rs.Eventually);Qu(Qie.ID,Qie,yc.BlockRestore);const SZt=Qe.as(Nn.Configuration);SZt.registerConfiguration({...V6,properties:{[OC]:{type:"array",description:g(3656,"Configure settings to be applied for all profiles."),default:[],scope:at.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class AZt{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 n=this.cachedConfigurations.get(i);return n||(n=new EZt({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,n)),n}}class EZt{constructor({type:e,key:t},i,n){this.fileService=n,this.cachedConfigurationFolderResource=Pt(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=Pt(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new bI}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,$e.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==Qi.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}}}let eke=class{constructor(e,t,i,n){this.configurationService=e,this.environmentService=i,this.storageService=n,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 n=this.getOS(e);return n===Ds.Linux||n===Ds.Macintosh?` +`},d=Qce(s,["folders"],c,l);let h=D3e(s,d);return k2(o.remoteAuthority,BYe(i))&&(h=D3e(h,eYt(h,["remoteAuthority"],l))),h}function JXt(s,e){const t=ef(e);if(t&&Array.isArray(t.folders))t.folders=t.folders.filter(i=>kst(i));else throw new Error(`${s} looks like an invalid workspace file.`);return t}function XXt(s){return s.workspace&&typeof s.workspace=="object"&&typeof s.workspace.id=="string"&&typeof s.workspace.configPath=="string"}function ZXt(s){return typeof s.folderUri=="string"}function eZt(s){return typeof s.fileUri=="string"}function tZt(s,e){const t={workspaces:[],files:[]};if(s){const i=function(o,r){for(let a=0;a{const r=o.label,a=o.remoteAuthority;XXt(o)?t.workspaces.push({label:r,remoteAuthority:a,workspace:{id:o.workspace.id,configPath:N.parse(o.workspace.configPath)}}):ZXt(o)?t.workspaces.push({label:r,remoteAuthority:a,folderUri:N.parse(o.folderUri)}):eZt(o)&&t.files.push({label:r,remoteAuthority:a,fileUri:N.parse(o.fileUri)})})}return t}function iZt(s){const e={entries:[]};for(const t of s.workspaces)uj(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 s.files)e.entries.push({fileUri:t.fileUri.toString(),label:t.label,remoteAuthority:t.remoteAuthority});return e}const Tst=Te;var fr;(function(s){s[s.ERROR_UNKNOWN_KEY=0]="ERROR_UNKNOWN_KEY",s[s.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION=1]="ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION",s[s.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE=2]="ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE",s[s.ERROR_INVALID_FOLDER_CONFIGURATION=3]="ERROR_INVALID_FOLDER_CONFIGURATION",s[s.ERROR_INVALID_USER_TARGET=4]="ERROR_INVALID_USER_TARGET",s[s.ERROR_INVALID_WORKSPACE_TARGET=5]="ERROR_INVALID_WORKSPACE_TARGET",s[s.ERROR_INVALID_FOLDER_TARGET=6]="ERROR_INVALID_FOLDER_TARGET",s[s.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION=7]="ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION",s[s.ERROR_NO_WORKSPACE_OPENED=8]="ERROR_NO_WORKSPACE_OPENED",s[s.ERROR_CONFIGURATION_FILE_DIRTY=9]="ERROR_CONFIGURATION_FILE_DIRTY",s[s.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE=10]="ERROR_CONFIGURATION_FILE_MODIFIED_SINCE",s[s.ERROR_INVALID_CONFIGURATION=11]="ERROR_INVALID_CONFIGURATION",s[s.ERROR_POLICY_CONFIGURATION=12]="ERROR_POLICY_CONFIGURATION",s[s.ERROR_INTERNAL=13]="ERROR_INTERNAL"})(fr||(fr={}));class Y3e extends La{constructor(e,t){super(e),this.code=t}}var An;(function(s){s[s.USER_LOCAL=1]="USER_LOCAL",s[s.USER_REMOTE=2]="USER_REMOTE",s[s.WORKSPACE=3]="WORKSPACE",s[s.WORKSPACE_FOLDER=4]="WORKSPACE_FOLDER"})(An||(An={}));let $De=class{constructor(e,t,i,n,o,r,a,c,l,d,h,u){this.remoteSettingsResource=e,this.configurationService=t,this.contextService=i,this.userDataProfileService=n,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 gI}async writeConfiguration(e,t,i={}){const n=this.getConfigurationEditOperation(e,t,i.scopes||{});return this.queue.queue(async()=>{try{await this.doWriteConfiguration(n,i)}catch(o){if(i.donotNotifyError)throw o;await this.onError(o,n,i.scopes)}})}async doWriteConfiguration(e,t){await this.validate(e.target,e,!t.handleDirtyFile,t.scopes||{});const i=e.resource,n=await this.resolveModelReference(i);try{const o=this.getFormattingOptions(n.object.textEditorModel);await this.updateConfiguration(e,n.object.textEditorModel,o,t)}finally{n.dispose()}}async updateConfiguration(e,t,i,n){if(this.hasParseErrors(t.getValue(),e))throw this.toConfigurationEditingError(fr.ERROR_INVALID_CONFIGURATION,e.target,e);if(this.textFileService.isDirty(t.uri)&&n.handleDirtyFile)switch(n.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===Qi.FILE_MODIFIED_SINCE?this.toConfigurationEditingError(fr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE,t.target,t):new Y3e(g(8749,"Error while writing to {0}. {1}",this.stringifyTarget(t.target),i.message),fr.ERROR_INTERNAL)}}applyEditsToBuffer(e,t){const i=t.getPositionAt(e.offset),n=t.getPositionAt(e.offset+e.length),o=new F(i.lineNumber,i.column,n.lineNumber,n.column),r=t.getValueInRange(o);if(e.content!==r){const a=r?Zn.replace(o,e.content):Zn.insert(i,e.content);return t.pushEditOperations([new dt(i.lineNumber,i.column,i.lineNumber,i.column)],[a],()=>[]),!0}return!1}getEdits({value:e,jsonPath:t},i,n){return t.length?Qce(i,t,e,n):[{content:JSON.stringify(e,null,n.insertSpaces&&n.tabSize?" ".repeat(n.tabSize):" "),length:i.length,offset:0}]}getFormattingOptions(e){const{insertSpaces:t,tabSize:i}=e.getOptions(),n=e.getEOL();return{insertSpaces:t,tabSize:i,eol:n}}async onError(e,t,i){switch(e.code){case fr.ERROR_INVALID_CONFIGURATION:this.onInvalidConfigurationError(e,t);break;case fr.ERROR_CONFIGURATION_FILE_DIRTY:this.onConfigurationFileDirtyError(e,t,i);break;case fr.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===Nf?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===ox?g(8751,"Open Launch Configuration"):null;i?this.notificationService.prompt(Xe.Error,e.message,[{label:i,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Xe.Error,e.message,[{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}onConfigurationFileDirtyError(e,t,i){const n=t.workspaceStandAloneConfigurationKey===Nf?g(8750,"Open Tasks Configuration"):t.workspaceStandAloneConfigurationKey===ox?g(8751,"Open Launch Configuration"):null;n?this.notificationService.prompt(Xe.Error,e.message,[{label:g(8753,"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:n,run:()=>this.openFile(t.resource)}]):this.notificationService.prompt(Xe.Error,e.message,[{label:g(8753,"Save and Retry"),run:()=>this.writeConfiguration(t.target,{key:t.key,value:t.value},{handleDirtyFile:"save",scopes:i})},{label:g(8752,"Open Settings"),run:()=>this.openSettings(t)}])}openSettings(e){const t={jsonEditor:!0};switch(e.target){case An.USER_LOCAL:this.preferencesService.openUserSettings(t);break;case An.USER_REMOTE:this.preferencesService.openRemoteSettings(t);break;case An.WORKSPACE:this.preferencesService.openWorkspaceSettings(t);break;case An.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 n=this.toErrorMessage(e,t,i);return new Y3e(n,e)}toErrorMessage(e,t,i){switch(e){case fr.ERROR_POLICY_CONFIGURATION:return g(8754,"Unable to write {0} because it is configured in system policy.",i.key);case fr.ERROR_UNKNOWN_KEY:return g(8755,"Unable to write to {0} because {1} is not a registered configuration.",this.stringifyTarget(t),i.key);case fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION:return g(8756,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE:return g(8757,"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",i.key);case fr.ERROR_INVALID_FOLDER_CONFIGURATION:return g(8758,"Unable to write to Folder Settings because {0} does not support the folder resource scope.",i.key);case fr.ERROR_INVALID_USER_TARGET:return g(8759,"Unable to write to User Settings because {0} does not support for global scope.",i.key);case fr.ERROR_INVALID_WORKSPACE_TARGET:return g(8760,"Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",i.key);case fr.ERROR_INVALID_FOLDER_TARGET:return g(8761,"Unable to write to Folder Settings because no resource is provided.");case fr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION:return g(8762,"Unable to write to Language Settings because {0} is not a resource language setting.",i.key);case fr.ERROR_NO_WORKSPACE_OPENED:return g(8763,"Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",this.stringifyTarget(t));case fr.ERROR_INVALID_CONFIGURATION:{if(i.workspaceStandAloneConfigurationKey===Nf)return g(8764,"Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again.");if(i.workspaceStandAloneConfigurationKey===ox)return g(8765,"Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again.");switch(t){case An.USER_LOCAL:return g(8766,"Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again.");case An.USER_REMOTE:return g(8767,"Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again.");case An.WORKSPACE:return g(8768,"Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again.");case An.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(n=o.name)}return g(8769,"Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",n)}default:return""}}case fr.ERROR_CONFIGURATION_FILE_DIRTY:{if(i.workspaceStandAloneConfigurationKey===Nf)return g(8770,"Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again.");if(i.workspaceStandAloneConfigurationKey===ox)return g(8771,"Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again.");switch(t){case An.USER_LOCAL:return g(8772,"Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again.");case An.USER_REMOTE:return g(8773,"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 An.WORKSPACE:return g(8774,"Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again.");case An.WORKSPACE_FOLDER:{let n="<>";if(i.resource){const o=this.contextService.getWorkspaceFolder(i.resource);o&&(n=o.name)}return g(8775,"Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",n)}default:return""}}case fr.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:if(i.workspaceStandAloneConfigurationKey===Nf)return g(8776,"Unable to write into tasks configuration file because the content of the file is newer.");if(i.workspaceStandAloneConfigurationKey===ox)return g(8777,"Unable to write into launch configuration file because the content of the file is newer.");switch(t){case An.USER_LOCAL:return g(8778,"Unable to write into user settings because the content of the file is newer.");case An.USER_REMOTE:return g(8779,"Unable to write into remote user settings because the content of the file is newer.");case An.WORKSPACE:return g(8780,"Unable to write into workspace settings because the content of the file is newer.");case An.WORKSPACE_FOLDER:return g(8781,"Unable to write into folder settings because the content of the file is newer.")}case fr.ERROR_INTERNAL:return g(8782,"Unable to write to {0} because of an internal error.",this.stringifyTarget(t))}}stringifyTarget(e){switch(e){case An.USER_LOCAL:return g(8783,"User Settings");case An.USER_REMOTE:return g(8784,"Remote User Settings");case An.WORKSPACE:return g(8785,"Workspace Settings");case An.WORKSPACE_FOLDER:return g(8786,"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 Nf:return GXt;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 ef(e,i,{allowTrailingComma:!0,allowEmptyContent:!0}),i.length>0}async validate(e,t,i,n){if(this.configurationService.inspect(t.key).policyValue!==void 0)throw this.toConfigurationEditingError(fr.ERROR_POLICY_CONFIGURATION,e,t);const r=Qe.as(Nn.Configuration).getConfigurationProperties()[t.key]?.scope;if(!t.workspaceStandAloneConfigurationKey&&this.configurationService.keys().default.indexOf(t.key)<0&&!Xg.test(t.key)&&t.value!==void 0)throw this.toConfigurationEditingError(fr.ERROR_UNKNOWN_KEY,e,t);if(t.workspaceStandAloneConfigurationKey&&t.workspaceStandAloneConfigurationKey!==Nf&&(e===An.USER_LOCAL||e===An.USER_REMOTE))throw this.toConfigurationEditingError(fr.ERROR_INVALID_USER_TARGET,e,t);if((e===An.WORKSPACE||e===An.WORKSPACE_FOLDER)&&this.contextService.getWorkbenchState()===qi.EMPTY)throw this.toConfigurationEditingError(fr.ERROR_NO_WORKSPACE_OPENED,e,t);if(e===An.WORKSPACE&&!t.workspaceStandAloneConfigurationKey&&!Xg.test(t.key)){if(r===at.APPLICATION)throw this.toConfigurationEditingError(fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION,e,t);if(r===at.MACHINE)throw this.toConfigurationEditingError(fr.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE,e,t)}if(e===An.WORKSPACE_FOLDER){if(!t.resource)throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_TARGET,e,t);if(!t.workspaceStandAloneConfigurationKey&&!Xg.test(t.key)&&r!==void 0&&!Ast.includes(r))throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_CONFIGURATION,e,t)}if(n.overrideIdentifiers?.length&&r!==at.LANGUAGE_OVERRIDABLE)throw this.toConfigurationEditingError(fr.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION,e,t);if(!t.resource)throw this.toConfigurationEditingError(fr.ERROR_INVALID_FOLDER_TARGET,e,t);if(i&&this.textFileService.isDirty(t.resource))throw this.toConfigurationEditingError(fr.ERROR_CONFIGURATION_FILE_DIRTY,e,t)}getConfigurationEditOperation(e,t,i){if(t.key){const l=e===An.USER_LOCAL?Est:gPe,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 n=t.key,r=Qe.as(Nn.Configuration).getConfigurationProperties()[n]?.scope;let a=i.overrideIdentifiers?.length?[gKe(i.overrideIdentifiers),n]:[n];if(e===An.USER_LOCAL||e===An.USER_REMOTE)return{key:n,jsonPath:a,value:t.value,resource:this.getConfigurationFileResource(e,n,"",null,r)??void 0,target:e};const c=this.getConfigurationFileResource(e,n,PXt,i.resource,r);return this.isWorkspaceConfigurationResource(c)&&(a=["settings",...a]),{key:n,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,n,o){if(e===An.USER_LOCAL)return t===Nf?this.userDataProfileService.currentProfile.tasksResource:!this.userDataProfileService.currentProfile.isDefault&&this.configurationService.isSettingAppliedForAllProfiles(t)?this.userDataProfilesService.defaultProfile.settingsResource:this.userDataProfileService.currentProfile.settingsResource;if(e===An.USER_REMOTE)return this.remoteSettingsResource;const r=this.contextService.getWorkbenchState();if(r!==qi.EMPTY){const a=this.contextService.getWorkspace();if(e===An.WORKSPACE){if(r===qi.WORKSPACE)return a.configuration??null;if(r===qi.FOLDER)return a.folders[0].toResource(i)}if(e===An.WORKSPACE_FOLDER&&n){const c=this.contextService.getWorkspaceFolder(n);if(c)return c.toResource(i)}}return null}};$De=D([_(1,Tst),_(2,yi),_(3,lg),_(4,Cm),_(5,Jt),_(6,fn),_(7,Fo),_(8,bi),_(9,N6),_(10,ei),_(11,ks)],$De);const _O=class _O extends AYe{constructor(e,t,i){super(i),this.configurationCache=e,this.configurationRegistry=Qe.as(Nn.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!wA(this.cachedConfigurationDefaultsOverrides)}initializeCachedConfigurationDefaultsOverrides(){return this.initiaizeCachedConfigurationDefaultsOverridesPromise||(this.initiaizeCachedConfigurationDefaultsOverridesPromise=(async()=>{try{if(localStorage.getItem(_O.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY)){const e=await this.configurationCache.read(this.cacheKey);e&&(this.cachedConfigurationDefaultsOverrides=JSON.parse(e))}}catch{}this.cachedConfigurationDefaultsOverrides=kn(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,n]of t)!Xg.test(i)&&n.value!==void 0&&(e[i]=n.value);try{Object.keys(e).length?(localStorage.setItem(_O.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY,"yes"),await this.configurationCache.write(this.cacheKey,JSON.stringify(e))):(localStorage.removeItem(_O.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY),await this.configurationCache.remove(this.cacheKey))}catch{}}};_O.DEFAULT_OVERRIDES_CACHE_EXISTS_KEY="DefaultOverridesCacheExists";let GDe=_O;class nZt extends eje{constructor(e,t,i,n){super(e.defaultProfile.settingsResource,{scopes:[at.APPLICATION]},i.extUri,t,n),this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._register(this.onDidChange(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new cn(()=>this.loadConfiguration().then(o=>this._onDidChangeConfiguration.fire(o)),50))}async initialize(){return this.loadConfiguration()}async loadConfiguration(){const e=await super.loadConfiguration(),t=e.getValue(FC),i=Array.isArray(t)?t:[];return this.parseOptions.include||i.length?this.reparse({...this.parseOptions,include:i}):e}}class sZt extends V{get hasTasksLoaded(){return this.userConfiguration.value instanceof Gie}constructor(e,t,i,n,o,r){super(),this.settingsResource=e,this.tasksResource=t,this.configurationParseOptions=i,this.fileService=n,this.uriIdentityService=o,this.logService=r,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.userConfiguration=this._register(new wn),this.userConfigurationChangeDisposable=this._register(new wn),this.userConfiguration.value=new eje(e,this.configurationParseOptions,o.extUri,this.fileService,r),this.userConfigurationChangeDisposable.value=this.userConfiguration.value.onDidChange(()=>this.reloadConfigurationScheduler.schedule()),this.reloadConfigurationScheduler=this._register(new cn(()=>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?[[Nf,this.tasksResource]]:[],n=new Gie(t.toString(),this.settingsResource,i,this.configurationParseOptions,this.fileService,this.uriIdentityService,this.logService),o=await n.loadConfiguration(e);return this.userConfiguration.value=n,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 Gie extends V{constructor(e,t,i,n,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(jr(...this.allResources.map(c=>jr(this.fileService.watch(r.extUri.dirname(c)),this.fileService.watch(c))))),this._folderSettingsModelParser=new EA(e,a),this._folderSettingsParseOptions=n,this._standAloneConfigurations=[],this._cache=as.createEmptyModel(this.logService),this._register(M.debounce(M.any(M.filter(this.fileService.onDidFilesChange,c=>this.handleFileChangesEvent(c)),M.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()}': ${nu(a)}`),a.fileOperationResult!==Qi.FILE_NOT_FOUND&&a.fileOperationResult!==Qi.FILE_NOT_DIRECTORY&&this.logService.error(a)}return"{}"})),[[i],n]=await Promise.all([e?Promise.resolve([void 0]):t([this.settingsResource]),t(this.standAloneConfigurationResources.map(([,o])=>o))]);return[i,n.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 n=0;ne.contains(t))||this.allResources.some(t=>e.contains(this.uriIdentityService.extUri.dirname(t),To.DELETED)))}handleFileOperationEvent(e){return!!((e.isOperation(Ai.CREATE)||e.isOperation(Ai.COPY)||e.isOperation(Ai.DELETE)||e.isOperation(Ai.WRITE))&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,t))||e.isOperation(Ai.DELETE)&&this.allResources.some(t=>this.uriIdentityService.extUri.isEqual(e.resource,this.uriIdentityService.extUri.dirname(t))))}}class oZt extends V{constructor(e,t,i,n,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 rZt(e,t,{scopes:Nue},r),o.getEnvironment().then(async a=>{if(a){const c=this._register(new Oue(a.settingsPath,{scopes:Nue},this._fileService,n,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 Oue)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:Nue})}getRestrictedSettings(){return this._userConfiguration.getRestrictedSettings()}onDidUserConfigurationChange(e){this.updateCache(),this._onDidChangeConfiguration.fire(e)}async updateCache(){if(this._userConfiguration instanceof Oue){let e;try{e=await this._userConfiguration.resolveContent()}catch(t){if(t.fileOperationResult!==Qi.FILE_NOT_FOUND)return}await this._cachedConfiguration.updateConfiguration(e)}}}class Oue extends V{constructor(e,t,i,n,o){super(),this.configurationResource=e,this.fileService=i,this.uriIdentityService=n,this.logService=o,this._onDidChangeConfiguration=this._register(new I),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.fileWatcherDisposable=this._register(new wn),this.directoryWatcherDisposable=this._register(new wn),this.parser=new EA(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 cn(()=>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 as.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,To.UPDATED);e.contains(this.configurationResource,To.ADDED)?(t=!0,this.onResourceExists(!0)):e.contains(this.configurationResource,To.DELETED)&&(t=!0,this.onResourceExists(!1)),t&&this.reloadConfigurationScheduler.schedule()}handleFileOperationEvent(e){(e.isOperation(Ai.CREATE)||e.isOperation(Ai.COPY)||e.isOperation(Ai.DELETE)||e.isOperation(Ai.WRITE))&&this.uriIdentityService.extUri.isEqual(e.resource,this.configurationResource)&&this.reloadConfigurationScheduler.schedule()}onResourceExists(e){e?(this.stopWatchingDirectory(),this.watchResource()):(this.stopWatchingResource(),this.watchDirectory())}}class rZt extends V{constructor(e,t,i,n){super(),this.configurationCache=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.key={type:"user",key:e},this.parser=new EA("CachedRemoteUserConfiguration",n),this.parseOptions=i,this.configurationModel=as.createEmptyModel(n)}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 aZt extends V{get initialized(){return this._initialized}constructor(e,t,i,n){super(),this.configurationCache=e,this.fileService=t,this.uriIdentityService=i,this.logService=n,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 cZt(e,n)}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 WK(this.fileService,this.uriIdentityService,this.logService))),await this.reload()}async reload(){this._workspaceIdentifier&&await this._workspaceConfiguration.load(this._workspaceIdentifier,{scopes:dj,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:dj,skipRestricted:this.isUntrusted()}),this.getConfiguration()}getRestrictedSettings(){return this._workspaceConfiguration.getRestrictedSettings()}async waitAndInitialize(e){if(await ZQe(e.configPath,this.fileService),!(this._workspaceConfiguration instanceof WK)){const t=this._register(new WK(this.fileService,this.uriIdentityService,this.logService));await t.load(e,{scopes:dj,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 WK){const e=await this._workspaceConfiguration.resolveContent(this._workspaceIdentifier);await this._cachedConfiguration.updateWorkspace(this._workspaceIdentifier,e)}}}class WK extends V{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 zie("",i),this.workspaceSettings=as.createEmptyModel(i),this._register(M.any(M.filter(this.fileService.onDidFilesChange,n=>!!this._workspaceIdentifier&&n.contains(this._workspaceIdentifier.configPath)),M.filter(this.fileService.onDidRunOperation,n=>!!this._workspaceIdentifier&&(n.isOperation(Ai.CREATE)||n.isOperation(Ai.COPY)||n.isOperation(Ai.DELETE)||n.isOperation(Ai.WRITE))&&t.extUri.isEqual(n.resource,this._workspaceIdentifier.configPath)))(()=>this.reloadConfigurationScheduler.schedule())),this.reloadConfigurationScheduler=this._register(new cn(()=>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 zie(this._workspaceIdentifier.id,this.logService),bt(this.workspaceConfigWatcher),this.workspaceConfigWatcher=this._register(this.watchWorkspaceConfigurationFile()));let i="";try{i=await this.resolveContent(this._workspaceIdentifier)}catch(n){await this.fileService.exists(this._workspaceIdentifier.configPath)&&this.logService.error(n)}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):V.None}}class cZt{constructor(e,t){this.configurationCache=e,this.logService=t,this.onDidChange=M.None,this.workspaceConfigurationModelParser=new zie("",t),this.workspaceSettings=as.createEmptyModel(t)}async load(e,t){try{const i=this.getKey(e),n=await this.configurationCache.read(i),o=JSON.parse(n);o.content&&(this.workspaceConfigurationModelParser=new zie(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 lZt{constructor(e,t,i,n,o){this.configurationCache=n,this.logService=o,this.onDidChange=M.None,this.key={type:"folder",key:Wc(Pt(e,t).toString()).toString(16)},this._folderSettingsModelParser=new EA("CachedFolderConfiguration",o),this._folderSettingsParseOptions=i,this._standAloneConfigurations=[],this.configurationModel=as.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===Vie)this._folderSettingsModelParser.parse(t[i],this._folderSettingsParseOptions);else{const n=new Dst(i,i,this.logService);n.parse(t[i]),this._standAloneConfigurations.push(n.configurationModel)}this.consolidate()}catch{}return this.configurationModel}async updateConfiguration(e,t){const i={};e&&(i[Vie]=e),t.forEach(([n,o])=>{o&&(i[n]=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 dZt extends V{constructor(e,t,i,n,o,r,a,c,l){super(),this.workspaceFolder=t,this.workbenchState=n,this.workspaceTrusted=o,this.configurationCache=l,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.scopes=qi.WORKSPACE===this.workbenchState?Ast:dj,this.configurationFolder=a.extUri.joinPath(t.uri,i),this.cachedFolderConfiguration=new lZt(t.uri,i,{scopes:this.scopes,skipRestricted:this.isUntrusted()},l,c),e&&this.configurationCache.needsCaching(t.uri)?(this.folderConfiguration=this.cachedFolderConfiguration,ZQe(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 n=t.extUri.joinPath(this.configurationFolder,`${Vie}.json`),o=[Nf,ox].map(r=>[r,t.extUri.joinPath(this.configurationFolder,`${r}.json`)]);return new Gie(this.configurationFolder.toString(),n,o,{scopes:this.scopes,skipRestricted:this.isUntrusted()},e,t,i)}async updateCache(){if(this.configurationCache.needsCaching(this.configurationFolder)&&this.folderConfiguration instanceof Gie){const[e,t]=await this.folderConfiguration.resolveContents();this.cachedFolderConfiguration.updateConfiguration(e,t)}}}function J3e(s,e){return s.isDefault||s.useDefaultFlags?.settings?e?$Xt:void 0:e?Sst:zXt}class Bue extends aje{constructor(){super(...arguments),this.initialized=!1}}class hZt extends V{get restrictedSettings(){return this._restrictedSettings}constructor({remoteAuthority:e,configurationCache:t},i,n,o,r,a,c,l,d){if(super(),this.userDataProfileService=n,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=Qe.as(Nn.Configuration),this.initRemoteUserConfigurationBarrier=new Gd,this.completeWorkspaceBarrier=new Gd,this.defaultConfiguration=this._register(new GDe(t,i,l)),this.policyConfiguration=d instanceof sJe?new Tkt:this._register(new $_e(this.defaultConfiguration,d,l)),this.configurationCache=t,this._configuration=new q3e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,as.createEmptyModel(l),as.createEmptyModel(l),as.createEmptyModel(l),as.createEmptyModel(l),new ui,as.createEmptyModel(l),new ui,this.workspace,l),this.applicationConfigurationDisposables=this._register(new Z),this.createApplicationConfiguration(),this.localUserConfiguration=this._register(new sZt(n.currentProfile.settingsResource,n.currentProfile.tasksResource,{scopes:J3e(n.currentProfile,!!e)},r,c,l)),this.cachedFolderConfigs=new ui,this._register(this.localUserConfiguration.onDidChangeConfiguration(h=>this.onLocalUserConfigurationChanged(h))),e){const h=this.remoteUserConfiguration=this._register(new oZt(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 aZt(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(n.onDidChangeCurrentProfile(h=>this.onUserDataProfileChanged(h))),this.workspaceEditingQueue=new gI}createApplicationConfiguration(){this.applicationConfigurationDisposables.clear(),this.userDataProfileService.currentProfile.isDefault||this.userDataProfileService.currentProfile.useDefaultFlags?.settings?this.applicationConfiguration=null:(this.applicationConfiguration=this.applicationConfigurationDisposables.add(this._register(new nZt(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?qi.WORKSPACE:this.workspace.folders.length===1?qi.FOLDER:qi.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 qi.FOLDER:{let t;return N.isUri(e)?t=e:R_(e)&&(t=e.uri),N.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.workspace.folders[0].uri)}case qi.WORKSPACE:return tA(e)&&this.workspace.id===e.id}return!1}async doUpdateFolders(e,t,i){if(this.getWorkbenchState()!==qi.WORKSPACE||e.length+t.length===0)return Promise.resolve(void 0);let n=!1,o=this.getWorkspace().folders,r=o.map(a=>a.raw).filter((a,c)=>kst(a)?!this.contains(t,o[c].uri):!0);if(n=o.length!==r.length,e.length){const a=this.getWorkspace().configuration,c=this.uriIdentityService.extUri.dirname(a);o=Fue(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(fPe(u,!1,h.name,c,this.uriIdentityService.extUri))}}d.length>0&&(n=!0,typeof i=="number"&&i>=0&&ithis.workspaceConfiguration.setFolders(e,t.get(yI))),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,n=kde(e)?e:kde(t)?t:void 0;return this._configuration.getValue(i,n)}async updateValue(e,t,i,n,o){const r=$ht(i)?i:kde(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,a=r?n:i,c=a?[a]:[];if(r?.overrideIdentifiers&&(r.overrideIdentifiers=ja(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)),Ys(t,l.defaultValue)&&c.length===1&&(c[0]===St.USER||c[0]===St.USER_LOCAL)&&(t=void 0)}await Zs.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:n}=await this.reloadUserConfiguration();await this.reloadWorkspaceConfiguration(),await this.loadConfiguration(t,i,n,!0);return}if(rje(e)){await this.reloadWorkspaceFolderConfiguration(e);return}switch(e){case St.DEFAULT:this.reloadDefaultConfiguration();return;case St.USER:{const{local:t,remote:i}=await this.reloadUserConfiguration();await this.loadConfiguration(this._configuration.applicationConfiguration,t,i,!0);return}case St.USER_LOCAL:await this.reloadLocalUserConfiguration();return;case St.USER_REMOTE:await this.reloadRemoteUserConfiguration();return;case St.WORKSPACE:case St.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){cs("code/willInitWorkspaceService");const t=this.initialized;this.initialized=!1;const i=await this.createWorkspace(e);await this.updateWorkspaceAndInitializeConfiguration(i,t),this.checkAndMarkWorkspaceComplete(!1),cs("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()===qi.FOLDER?i[0]&&this._configuration.updateWorkspaceConfiguration(i[0]):this._configuration.updateWorkspaceConfiguration(this.workspaceConfiguration.updateWorkspaceTrust(this.isWorkspaceTrusted)),this.updateRestrictedSettings();let n=[];this.restrictedSettings.userLocal&&n.push(...this.restrictedSettings.userLocal),this.restrictedSettings.userRemote&&n.push(...this.restrictedSettings.userRemote),this.restrictedSettings.workspace&&n.push(...this.restrictedSettings.workspace),this.restrictedSettings.workspaceFolder?.forEach(o=>n.push(...o)),n=ja(n),n.length&&this.triggerConfigurationChange({keys:n,overrides:[]},{data:t,workspace:this.workspace},St.WORKSPACE)}}acquireInstantiationService(e){this.instantiationService=e}isSettingAppliedForAllProfiles(e){if(this.configurationRegistry.getConfigurationProperties()[e]?.scope===at.APPLICATION)return!0;const t=this.getValue(FC)??[];return Array.isArray(t)&&t.includes(e)}async createWorkspace(e){return tA(e)?this.createMultiFolderWorkspace(e):R_(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=Fue(this.workspaceConfiguration.getFolders(),t,this.uriIdentityService.extUri),n=e.id,o=new Bue(n,i,this.workspaceConfiguration.isTransient(),t,r=>this.uriIdentityService.extUri.ignorePathCasing(r));return o.initialized=this.workspaceConfiguration.initialized,o}createSingleFolderWorkspace(e){const t=new Bue(e.id,[$Y(e.uri)],!1,null,i=>this.uriIdentityService.extUri.ignorePathCasing(i));return t.initialized=!0,t}createEmptyWorkspace(e){const t=new Bue(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 n,o,r=[];if(i?(n=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();n&&a!==n&&this._onDidChangeWorkbenchState.fire(a);const c=this.workspace.configuration?this.workspace.configuration.fsPath:void 0;(o&&c!==o||a!==n)&&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(QP(si,()=>this.reloadLocalUserConfiguration(!1,this._configuration.localUserConfiguration)))}compareFolders(e,t){const i={added:[],removed:[],changed:[]};i.added=t.filter(n=>!e.some(o=>n.uri.toString()===o.uri.toString()));for(let n=0;n{cs("code/willInitUserConfiguration");const c=await Promise.all([this.localUserConfiguration.initialize(),this.remoteUserConfiguration?this.remoteUserConfiguration.initialize():Promise.resolve(as.createEmptyModel(this.logService))]);if(this.applicationConfiguration){const l=await i;c[0]=this.localUserConfiguration.reparse({exclude:l.getValue(FC)})}return cs("code/didInitUserConfiguration"),c},[,o,[r,a]]=await Promise.all([t,i,n()]);cs("code/willInitWorkspaceConfiguration"),await this.loadConfiguration(o,r,a,e),cs("code/didInitWorkspaceConfiguration")}reloadDefaultConfiguration(){this.onDefaultConfigurationChanged(this.defaultConfiguration.reload())}async reloadApplicationConfiguration(e){if(!this.applicationConfiguration)return as.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 as.createEmptyModel(this.logService)}async reloadWorkspaceConfiguration(){const e=this.getWorkbenchState();if(e===qi.FOLDER)return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);if(e===qi.WORKSPACE)return this.workspaceConfiguration.reload().then(()=>this.onWorkspaceConfigurationChanged(!1))}reloadWorkspaceFolderConfiguration(e){return this.onWorkspaceFolderConfigurationChanged(e)}async loadConfiguration(e,t,i,n){this.cachedFolderConfigs=new ui;const o=this.workspace.folders,r=await this.loadFolderConfigurations(o),a=this.getWorkspaceConfigurationModel(r),c=new ui;r.forEach((d,h)=>c.set(o[h].uri,d));const l=this._configuration;if(this._configuration=new q3e(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,e,t,i,a,c,as.createEmptyModel(this.logService),new ui,this.workspace,this.logService),this.initialized=!0,n){const d=this._configuration.compare(l);this.triggerConfigurationChange(d,{data:l.toData(),workspace:this.workspace},St.WORKSPACE)}this.updateRestrictedSettings()}getWorkspaceConfigurationModel(e){switch(this.getWorkbenchState()){case qi.FOLDER:return e[0];case qi.WORKSPACE:return this.workspaceConfiguration.getConfiguration();default:return as.createEmptyModel(this.logService)}}onUserDataProfileChanged(e){e.join((async()=>{const t=[];t.push(this.localUserConfiguration.reset(e.profile.settingsResource,e.profile.tasksResource,{scopes:J3e(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,n]=await Promise.all(t);n=n??this._configuration.applicationConfiguration,this.applicationConfiguration&&(i=this.localUserConfiguration.reparse({exclude:n.getValue(FC)})),await this.loadConfiguration(n,i,this._configuration.remoteUserConfiguration,!0)})())}onDefaultConfigurationChanged(e,t){if(this.workspace){const i=this._configuration.toData(),n=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()===qi.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(n,{data:i,workspace:this.workspace},St.DEFAULT),this.updateRestrictedSettings()}}onPolicyConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdatePolicyConfiguration(e);this.triggerConfigurationChange(i,t,St.DEFAULT)}onApplicationConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.applicationConfiguration.getValue(FC)??[],n=this._configuration.compareAndUpdateApplicationConfiguration(e),o=this.getValue(FC)??[],r=this.configurationRegistry.getConfigurationProperties(),a=[];for(const c of n.keys)if(r[c]?.scope===at.APPLICATION){if(a.push(c),c===FC){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);n.keys=a,n.keys.includes(FC)&&this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({exclude:o})),this.triggerConfigurationChange(n,t,St.USER)}onLocalUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateLocalUserConfiguration(e);this.triggerConfigurationChange(i,t,St.USER)}onRemoteUserConfigurationChanged(e){const t={data:this._configuration.toData(),workspace:this.workspace},i=this._configuration.compareAndUpdateRemoteUserConfiguration(e);this.triggerConfigurationChange(i,t,St.USER)}async onWorkspaceConfigurationChanged(e){if(this.workspace&&this.workspace.configuration){let t=Fue(this.workspaceConfiguration.getFolders(),this.workspace.configuration,this.uriIdentityService.extUri);if(this.workspace.initialized){const{added:i,removed:n,changed:o}=this.compareFolders(this.workspace.folders,t);i.length||n.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)),n=jI(i,this._restrictedSettings.default,(p,m)=>p.localeCompare(m));e.push(...n.added,...n.removed);const o=(this.applicationConfiguration?.getRestrictedSettings()||[]).sort((p,m)=>p.localeCompare(m)),r=jI(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=jI(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=jI(l,this._restrictedSettings.userRemote||[],(p,m)=>p.localeCompare(m));e.push(...d.added,...d.removed);const h=new ui;for(const p of this.workspace.folders){const v=(this.cachedFolderConfigs.get(p.uri)?.getRestrictedSettings()||[]).sort((y,C)=>y.localeCompare(C));v.length&&h.set(p.uri,v);const b=this._restrictedSettings.workspaceFolder?.get(p.uri)||[],w=jI(v,b,(y,C)=>y.localeCompare(C));e.push(...w.added,...w.removed)}const u=this.getWorkbenchState()===qi.WORKSPACE?this.workspaceConfiguration.getRestrictedSettings().sort((p,m)=>p.localeCompare(m)):this.workspace.folders[0]?h.get(this.workspace.folders[0].uri)||[]:[],f=jI(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 n={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,n,St.WORKSPACE_FOLDER),this._onDidChangeWorkspaceFolders.fire(r)}else this.triggerConfigurationChange(o,n,St.WORKSPACE);this.updateRestrictedSettings()}async handleWillChangeWorkspaceFolders(e,t){const i=[];this._onWillChangeWorkspaceFolders.fire({join(n){i.push(n)},changes:e,fromCache:t});try{await Zs.settled(i)}catch{}}async onWorkspaceFolderConfigurationChanged(e){const[t]=await this.loadFolderConfigurations([e]),i={data:this._configuration.toData(),workspace:this.workspace},n=this._configuration.compareAndUpdateFolderConfiguration(e.uri,t);if(this.getWorkbenchState()===qi.FOLDER){const o=this._configuration.compareAndUpdateWorkspaceConfiguration(t);this.triggerConfigurationChange(m2e(n,o),i,St.WORKSPACE)}else this.triggerConfigurationChange(n,i,St.WORKSPACE_FOLDER);this.updateRestrictedSettings()}async onFoldersChanged(){const e=[];for(const i of this.cachedFolderConfigs.keys())this.workspace.folders.filter(n=>n.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((n,o)=>{e.push(this._configuration.compareAndUpdateFolderConfiguration(t[o].uri,n))}),m2e(...e)}loadFolderConfigurations(e){return Promise.all([...e.map(t=>{let i=this.cachedFolderConfigs.get(t.uri);return i||(i=new dZt(!this.initialized,t,Jce,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(n){this.logService.warn(`Ignoring the error while validating workspace folder ${i.uri.toString()} - ${Nr(n)}`)}t.push(i)}return t}async writeConfigurationValue(e,t,i,n,o){if(!this.instantiationService)throw new Error("Cannot write configuration because the configuration service is not yet ready to accept writes.");if(i===St.DEFAULT)throw new Error("Invalid configuration target");if(i===St.MEMORY){const a={data:this._configuration.toData(),workspace:this.workspace};this._configuration.updateValue(e,t,n),this.triggerConfigurationChange({keys:n?.overrideIdentifiers?.length?[gKe(n.overrideIdentifiers),e]:[e],overrides:n?.overrideIdentifiers?.length?n.overrideIdentifiers.map(c=>[c,[e]]):[]},a,i);return}const r=this.toEditableConfigurationTarget(i,e);if(!r)throw new Error("Invalid configuration target");if(r===An.USER_REMOTE&&!this.remoteUserConfiguration)throw new Error("Invalid configuration target");if(n?.overrideIdentifiers?.length&&n.overrideIdentifiers.length>1){const a=this.getConfigurationModelForEditableConfigurationTarget(r,n.resource);if(a){const c=n.overrideIdentifiers.sort(),l=a.overrides.find(d=>is([...d.identifiers].sort(),c));l&&(n.overrideIdentifiers=l.identifiers)}}switch(this.configurationEditing=this.configurationEditing??this.createConfigurationEditingService(this.instantiationService),await(await this.configurationEditing).writeConfiguration(r,{key:e,value:t},{scopes:n,...o}),r){case An.USER_LOCAL:this.applicationConfiguration&&this.isSettingAppliedForAllProfiles(e)?await this.reloadApplicationConfiguration():await this.reloadLocalUserConfiguration();return;case An.USER_REMOTE:return this.reloadRemoteUserConfiguration().then(()=>{});case An.WORKSPACE:return this.reloadWorkspaceConfiguration();case An.WORKSPACE_FOLDER:{const a=n&&n.resource?this.workspace.getFolder(n.resource):null;if(a)return this.reloadWorkspaceFolderConfiguration(a)}}}async createConfigurationEditingService(e){const t=(await this.remoteAgentService.getEnvironment())?.settingsPath??null;return e.createInstance($De,t)}getConfigurationModelForEditableConfigurationTarget(e,t){switch(e){case An.USER_LOCAL:return this._configuration.localUserConfiguration;case An.USER_REMOTE:return this._configuration.remoteUserConfiguration;case An.WORKSPACE:return this._configuration.workspaceConfiguration;case An.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0}}getConfigurationModel(e,t){switch(e){case St.USER_LOCAL:return this._configuration.localUserConfiguration;case St.USER_REMOTE:return this._configuration.remoteUserConfiguration;case St.WORKSPACE:return this._configuration.workspaceConfiguration;case St.WORKSPACE_FOLDER:return t?this._configuration.folderConfigurations.get(t):void 0;default:return}}deriveConfigurationTargets(e,t,i){if(Ys(t,i.value))return[];const n=[];return i.workspaceFolderValue!==void 0&&n.push(St.WORKSPACE_FOLDER),i.workspaceValue!==void 0&&n.push(St.WORKSPACE),i.userRemoteValue!==void 0&&n.push(St.USER_REMOTE),i.userLocalValue!==void 0&&n.push(St.USER_LOCAL),i.applicationValue!==void 0&&n.push(St.APPLICATION),t===void 0?n:[n[0]||St.USER]}triggerConfigurationChange(e,t,i){if(e.keys.length){i!==St.DEFAULT&&this.logService.debug(`Configuration keys changed in ${Ght(i)} target`,...e.keys);const n=new SLe(e,t,this._configuration,this.workspace,this.logService);n.source=i,this._onDidChangeConfiguration.fire(n)}}toEditableConfigurationTarget(e,t){if(e===St.APPLICATION)return An.USER_LOCAL;if(e===St.USER){if(this.remoteUserConfiguration){const i=this.configurationRegistry.getConfigurationProperties()[t]?.scope;if(i===at.MACHINE||i===at.MACHINE_OVERRIDABLE||this.inspect(t).userRemoteValue!==void 0)return An.USER_REMOTE}return An.USER_LOCAL}return e===St.USER_LOCAL?An.USER_LOCAL:e===St.USER_REMOTE?An.USER_REMOTE:e===St.WORKSPACE?An.WORKSPACE:e===St.WORKSPACE_FOLDER?An.WORKSPACE_FOLDER:null}}let KDe=class extends V{constructor(e,t,i,n,o){super(),this.workspaceContextService=e,this.environmentService=t,this.workspaceTrustManagementService=i,n.whenInstalledExtensionsRegistered().then(()=>{this.registerConfigurationSchemas();const r=Qe.as(Nn.Configuration),a=this._register(new Lh(50));this._register(M.any(r.onDidUpdateConfiguration,r.onDidSchemaChange,i.onDidChangeTrust)(()=>a.trigger(()=>this.registerConfigurationSchemas(),o.phase===Rs.Eventually?void 0:2500)))})}registerConfigurationSchemas(){const e={properties:Ag.properties,patternProperties:Ag.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},t=this.environmentService.remoteAuthority?{properties:Object.assign({},Y4.properties,aS.properties,$v.properties),patternProperties:Ag.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:e,i={properties:Object.assign({},YP.properties,rS.properties,aS.properties,$v.properties),patternProperties:Ag.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},n={properties:Object.assign({},YP.properties,rS.properties,aS.properties,$v.properties),patternProperties:Ag.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},o={properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(rS.properties),this.checkAndFilterPropertiesRequiringTrust(aS.properties),this.checkAndFilterPropertiesRequiringTrust($v.properties)),patternProperties:Ag.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},r={properties:Object.keys(Ag.properties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Ag.properties[d]),l),{}),patternProperties:Object.keys(Ag.patternProperties).reduce((l,d)=>(l[d]=Object.assign({deprecationMessage:void 0},Ag.patternProperties[d]),l),{}),additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},a=qi.WORKSPACE===this.workspaceContextService.getWorkbenchState()?{properties:Object.assign({},this.checkAndFilterPropertiesRequiringTrust(rS.properties),this.checkAndFilterPropertiesRequiringTrust($v.properties)),patternProperties:Ag.patternProperties,additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0}:o,c={type:"object",description:g(3655,"Contribute defaults for configurations"),properties:Object.assign({},this.filterDefaultOverridableProperties(rS.properties),this.filterDefaultOverridableProperties(aS.properties),this.filterDefaultOverridableProperties($v.properties)),patternProperties:{[xE]:{type:"object",default:{},$ref:mE}},additionalProperties:!1};this.registerSchemas({defaultSettingsSchema:r,userSettingsSchema:t,profileSettingsSchema:i,machineSettingsSchema:n,workspaceSettingsSchema:o,folderSettingsSchema:a,configDefaultsSchema:c})}registerSchemas(e){const t=Qe.as(QA.JSONContribution);t.registerSchema(FXt,e.defaultSettingsSchema),t.registerSchema(OXt,e.userSettingsSchema),t.registerSchema(BXt,e.profileSettingsSchema),t.registerSchema(WXt,e.machineSettingsSchema),t.registerSchema(Cst,e.workspaceSettingsSchema),t.registerSchema(HXt,e.folderSettingsSchema),t.registerSchema(hKe,e.configDefaultsSchema)}checkAndFilterPropertiesRequiringTrust(e){if(this.workspaceTrustManagementService.isWorkspaceTrusted())return e;const t={};return Object.entries(e).forEach(([i,n])=>{n.restricted||(t[i]=n)}),t}filterDefaultOverridableProperties(e){const t={};return Object.entries(e).forEach(([i,n])=>{n.disallowConfigurationDefault||(t[i]=n)}),t}};KDe=D([_(0,yi),_(1,Jr),_(2,cC),_(3,fs),_(4,Zu)],KDe);let qDe=class extends V{constructor(e,t){super(),e.hasCachedConfigurationDefaultsOverrides()&&t.whenInstalledExtensionsRegistered().then(()=>e.reloadConfiguration(St.DEFAULT))}};qDe=D([_(0,Te),_(1,fs)],qDe);var GB;let Kie=(GB=class extends V{constructor(e){super(),this.workbenchAssignmentService=e,this.processedExperimentalSettings=new Set,this.configurationRegistry=Qe.as(Nn.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 n of e){const o=i[n];if(o?.tags?.includes("experimental")&&!this.processedExperimentalSettings.has(n)){this.processedExperimentalSettings.add(n);try{const r=await this.workbenchAssignmentService.getTreatment(`config.${n}`);!Ya(r)&&!Ys(r,o.default)&&(t[n]=r)}catch{}}}Object.keys(t).length&&this.configurationRegistry.registerDefaultConfigurations([{overrides:t}])}},GB.ID="workbench.contrib.updateExperimentalSettingsDefaults",GB);Kie=D([_(0,qJe)],Kie);const Lst=Qe.as(of.Workbench);Lst.registerWorkbenchContribution(KDe,Rs.Restored);Lst.registerWorkbenchContribution(qDe,Rs.Eventually);Ku(Kie.ID,Kie,yc.BlockRestore);const uZt=Qe.as(Nn.Configuration);uZt.registerConfiguration({...B6,properties:{[FC]:{type:"array",description:g(3656,"Configure settings to be applied for all profiles."),default:[],scope:at.APPLICATION,additionalProperties:!0,uniqueItems:!0}}});class gZt{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 n=this.cachedConfigurations.get(i);return n||(n=new fZt({type:e,key:t},this.cacheHome,this.fileService),this.cachedConfigurations.set(i,n)),n}}class fZt{constructor({type:e,key:t},i,n){this.fileService=n,this.cachedConfigurationFolderResource=Pt(i,"CachedConfigurations",e,t),this.cachedConfigurationFileResource=Pt(this.cachedConfigurationFolderResource,e==="workspaces"?"workspace.json":"configuration.json"),this.queue=new gI}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,$e.fromString(e))})}async remove(){try{await this.queue.queue(()=>this.fileService.del(this.cachedConfigurationFolderResource,{recursive:!0,useTrash:!1}))}catch(e){if(e.fileOperationResult!==Qi.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}}}let QDe=class{constructor(e,t,i,n){this.configurationService=e,this.environmentService=i,this.storageService=n,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 n=this.getOS(e);return n===Ds.Linux||n===Ds.Macintosh?` `:`\r -`}getOS(e){let t=po;const i=this.environmentService.remoteAuthority;if(i&&e&&e.scheme!==pe.file){const n=`resource.authority.os.${i}`;t=this.remoteEnvironment?this.remoteEnvironment.os:this.storageService.getNumber(n,Ie.WORKSPACE,po),this.storageService.store(n,t,Ie.WORKSPACE,an.MACHINE)}return t}};eke=D([_(0,Te),_(1,hg),_(2,Jr),_(3,$i)],eke);let tke=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.jsonEditingService=e,this.contextService=t,this.configurationService=i,this.notificationService=n,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=[pe.file];this.environmentService.remoteAuthority&&e.unshift(pe.vscodeRemote);let t=await this.fileDialogService.showSaveDialog({saveLabel:vMe(g(3657,"Save")),title:g(3658,"Save Workspace"),filters:sAt,defaultUri:Pt(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return mae(t)||(t=t.with({path:`${t.path}.${xb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&Jme(e,this.environmentService))return _i(e);const t=lm(this.contextService.getWorkspace().folders);return t?`${_i(t.uri)}.${xb}`:`workspace.${xb}`}async updateFolders(e,t,i,n){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:VFe(d.uri),name:d.name})));const c=r.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,n):c&&!l?this.removeFolders(r):this.includesSingleFolderWorkspace(r)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==qi.WORKSPACE?this.doAddFolders(a,e,n):this.doUpdateFolders(a,r,e,n)}async doUpdateFolders(e,t,i,n=!1){try{await this.contextService.updateFolders(e,t,i)}catch(o){if(n)throw o;this.handleWorkspaceConfigurationEditingError(o)}}addFolders(e,t=!1){const i=e.map(n=>({uri:VFe(n.uri),name:n.name}));return this.doAddFolders(i,void 0,t)}async doAddFolders(e,t,i=!1){const n=this.contextService.getWorkbenchState();if(n!==qi.WORKSPACE){let o=this.contextService.getWorkspace().folders.map(r=>({uri:r.uri}));return o.splice(typeof t=="number"?t:o.length,0,...e),o=ja(o,r=>this.uriIdentityService.extUri.getComparisonKey(r.uri)),n===qi.EMPTY&&o.length===0||n===qi.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()===qi.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,n=await this.workspacesService.createUntitledWorkspace(e,i);if(t)try{await this.saveWorkspaceAs(n,t)}finally{await this.workspacesService.deleteUntitledWorkspace(n)}else t=n.configPath,this.userDataProfileService.currentProfile.isDefault||await this.userDataProfilesService.setProfileForWorkspace(n,this.userDataProfileService.currentProfile);return this.enterWorkspace(t)}async saveAndEnterWorkspace(e){const t=this.getCurrentWorkspaceIdentifier();if(t){if(ji(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(!g3(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=g3(i,this.environmentService),r=await this.fileService.readFile(i),a=a9e(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:Cn.EXPLICIT});return}if(await this.fileService.exists(t))return;const r=a9e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:r}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case V$.ERROR_INVALID_FILE:this.onInvalidWorkspaceConfigurationFileError();break;default:this.notificationService.error(e.message)}}onInvalidWorkspaceConfigurationFileError(){const e=g(3659,"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(Xe.Error,e,[{label:g(3660,"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()===qi.FOLDER&&await this.migrateWorkspaceSettings(t),await this.configurationService.initialize(t),this.workspacesService.enterWorkspace(e)}migrateWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e,t=>t.scope===at.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n={};for(const o of this.configurationService.keys().workspace)if(i[o]){if(t&&!t(i[o]))continue;n[o]=this.configurationService.inspect(o).workspaceValue}return this.jsonEditingService.write(e.configPath,[{path:["settings"],value:n}],!0)}async trustWorkspaceConfiguration(e){this.contextService.getWorkbenchState()!==qi.EMPTY&&this.workspaceTrustManagementService.isWorkspaceTrusted()&&await this.workspaceTrustManagementService.setUrisTrust([e],!0)}getCurrentWorkspaceIdentifier(){const e=GO(this.contextService.getWorkspace());if(iA(e))return e}};tke=D([_(0,DI),_(1,yi),_(2,Bst),_(3,bi),_(4,vi),_(5,Jt),_(6,Fo),_(7,xI),_(8,Jr),_(9,ag),_(10,to),_(11,xc),_(12,ks),_(13,uC),_(14,Em),_(15,ug)],tke);var qP,nM;let ike=(nM=class extends V{constructor(e,t,i,n,o,r){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=n,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(Ie.APPLICATION,qP.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(Py(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 qi.FOLDER:this.addRecentlyOpened([{folderUri:e.folders[0].uri,remoteAuthority:t}]);break;case qi.WORKSPACE:this.addRecentlyOpened([{workspace:{id:e.id,configPath:e.configuration},remoteAuthority:t}]);break}}async getRecentlyOpened(){const e=this.storageService.get(qP.RECENTLY_OPENED_KEY,Ie.APPLICATION);if(e){const t=uZt(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(fj(i)&&i.folderUri.scheme===pe.file&&!Py(this.contextService.getWorkspace())||rZt(i)&&Py(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)aZt(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):fj(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(n=>n.toString()===i.fileUri.toString())),e.workspaces=e.workspaces.filter(i=>!t.some(n=>n.toString()===(fj(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store(qP.RECENTLY_OPENED_KEY,JSON.stringify(gZt(e)),Ie.APPLICATION,an.USER)}async clearRecentlyOpened(){this.storageService.remove(qP.RECENTLY_OPENED_KEY,Ie.APPLICATION)}async enterWorkspace(e){return{workspace:await this.getWorkspaceIdentifier(e)}}async createUntitledWorkspace(e,t){const i=(Date.now()+Math.round(Math.random()*1e3)).toString(),n=Pt(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${xb}`),o=[];if(e)for(const a of e)o.push(xPe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const r={folders:o,remoteAuthority:t};return await this.fileService.writeFile(n,$e.fromString(JSON.stringify(r,null," "))),this.getWorkspaceIdentifier(n)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==Qi.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return hNe(e)}async getDirtyWorkspaces(){return[]}},qP=nM,nM.RECENTLY_OPENED_KEY="recently.opened",nM);ike=qP=D([_(0,$i),_(1,yi),_(2,Ge),_(3,Jt),_(4,Jr),_(5,ks)],ike);var Ur;(function(s){s.Unknown="unknown",s.Env="env",s.Config="config",s.Command="command",s.Input="input",s.ExtensionInstallFolder="extensionInstallFolder",s.WorkspaceFolder="workspaceFolder",s.Cwd="cwd",s.WorkspaceFolderBasename="workspaceFolderBasename",s.UserHome="userHome",s.LineNumber="lineNumber",s.SelectedText="selectedText",s.File="file",s.FileWorkspaceFolder="fileWorkspaceFolder",s.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",s.RelativeFile="relativeFile",s.RelativeFileDirname="relativeFileDirname",s.FileDirname="fileDirname",s.FileExtname="fileExtname",s.FileBasename="fileBasename",s.FileBasenameNoExtension="fileBasenameNoExtension",s.FileDirnameBasename="fileDirnameBasename",s.ExecPath="execPath",s.ExecInstallFolder="execInstallFolder",s.PathSeparator="pathSeparator",s.PathSeparatorAlias="/"})(Ur||(Ur={}));class bg extends Error{constructor(e,t){super(t),this.variable=e}}const w1=class w1{constructor(e,t,i,n){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,n&&(this._envVariablesPromise=n.then(o=>this.prepareEnv(o)))}prepareEnv(e){if(Qn){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,n){const o=xs(t);Qn&&o.windows?Object.keys(o.windows).forEach(a=>o[a]=o.windows[a]):Qt&&o.osx?Object.keys(o.osx).forEach(a=>o[a]=o.osx[a]):pr&&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,n)}async resolveAnyAsync(e,t,i){return this.resolveAnyBase(e,t,i)}async resolveAnyMap(e,t,i){const n=new Map;return{newConfig:await this.resolveAnyBase(e,t,i,n),resolvedVariables:n}}resolveWithInteractionReplace(e,t,i,n){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(e,t,i,n){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,n,o){if(Lt(i))return this.resolveString(e,t,i,n,o);if(Array.isArray(i))return Promise.all(i.map(r=>this.recursiveResolve(e,t,r,n,o)));if(kn(i)){const r=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,n,o),await this.recursiveResolve(e,t,i[c],n,o)]));for(const[c,l]of a)r[c]=l;return r}return i}resolveString(e,t,i,n,o){return uat(i,w1.VARIABLE_REGEXP,async(r,a)=>{if(a.includes(w1.VARIABLE_LHS))return r;let c=await this.evaluateSingleVariable(e,r,a,t,n);return o?.set(a,c),c!==r&&Lt(c)&&c.match(w1.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,n,o)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,n,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 Kw(u);throw new bg(h,g(4048,"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 Kw(f)}throw new bg(h,g(4049,"Variable {0}: can not find workspace folder of '{1}'.",t,Ko(u)))},d=h=>{if(r){const u=this._context.getFolderUri(r);if(u)return u;throw new bg(h,g(4050,"Variable {0} can not be resolved. No such folder '{1}'.",t,r))}if(n)return n;throw this._context.getWorkspaceFolderCount()>1?new bg(h,g(4051,"Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",t)):new bg(h,g(4052,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(r){if(e.env){const h=e.env[Qn?r.toLowerCase():r];if(Lt(h))return h}return""}throw new bg(Ur.Env,g(4053,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(r){const h=this._context.getConfigurationValue(n,r);if(ra(h))throw new bg(Ur.Config,g(4054,"Variable {0} can not be resolved because setting '{1}' not found.",t,r));if(kn(h))throw new bg(Ur.Config,g(4055,"Variable {0} can not be resolved because '{1}' is a structured value.",t,r));return h}throw new bg(Ur.Config,g(4056,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(Ur.Command,t,r,o,"command");case"input":return this.resolveFromMap(Ur.Input,t,r,o,"input");case"extensionInstallFolder":if(r){const h=await this._context.getExtension(r);if(!h)throw new bg(Ur.ExtensionInstallFolder,g(4057,"Variable {0} can not be resolved because the extension {1} is not installed.",t,r));return this.fsPath(h.extensionLocation)}throw new bg(Ur.ExtensionInstallFolder,g(4058,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return Kw(this.fsPath(d(Ur.WorkspaceFolder)));case"cwd":return n||r?Kw(this.fsPath(d(Ur.Cwd))):x2();case"workspaceRootFolderName":case"workspaceFolderBasename":return Kw(Ko(this.fsPath(d(Ur.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new bg(Ur.UserHome,g(4059,"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 bg(Ur.LineNumber,g(4060,"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 bg(Ur.SelectedText,g(4061,"Variable {0} can not be resolved. Make sure to have some text selected in the active editor.",t))}case"file":return c(Ur.File);case"fileWorkspaceFolder":return l(Ur.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return Ko(l(Ur.FileWorkspaceFolderBasename));case"relativeFile":return n||r?k2(this.fsPath(d(Ur.RelativeFile)),c(Ur.RelativeFile)):c(Ur.RelativeFile);case"relativeFileDirname":{const h=Cb(c(Ur.RelativeFileDirname));if(n||r){const u=k2(this.fsPath(d(Ur.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return Cb(c(Ur.FileDirname));case"fileExtname":return Gy(c(Ur.FileExtname));case"fileBasename":return Ko(c(Ur.FileBasename));case"fileBasenameNoExtension":{const h=Ko(c(Ur.FileBasenameNoExtension));return h.slice(0,h.length-Gy(h).length)}case"fileDirnameBasename":return Ko(Cb(c(Ur.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 ou;default:try{const h=r?`${i}:${r}`:i;return this.resolveFromMap(Ur.Unknown,t,h,o,void 0)}catch{return t}}}}resolveFromMap(e,t,i,n,o){if(i&&n){const r=o===void 0?n[i]:n[o+":"+i];if(typeof r=="string")return r;throw new bg(e,g(4062,"Variable {0} can not be resolved because the command has no value.",t))}return t}};w1.VARIABLE_LHS="${",w1.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let jie=w1;const ire=class ire extends jie{constructor(e,t,i,n,o,r,a,c,l,d){super({getFolderUri:h=>{const u=r.getWorkspace().folders.filter(f=>f.name===h).pop();return u?u.uri:void 0},getWorkspaceFolderCount:()=>r.getWorkspace().folders.length,getConfigurationValue:(h,u)=>n.getValue(u,h?{resource:h}:{}),getAppRoot:()=>e.getAppRoot(),getExecPath:()=>e.getExecPath(),getFilePath:()=>{const h=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(h)return this.labelService.getUriLabel(h,{noPrefix:!0})},getWorkspaceFolderPathForFile:()=>{const h=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(!h)return;const u=r.getWorkspaceFolder(h);if(u)return this.labelService.getUriLabel(u.uri,{noPrefix:!0})},getSelectedText:()=>{const h=i.activeTextEditorControl;let u=null;if(Qr(h))u=h;else if(im(h)){const m=h.getOriginalEditor(),v=h.getModifiedEditor();u=m.hasWidgetFocus()?m:v}const f=u?.getModel(),p=u?.getSelection();if(f&&p)return f.getValueInRange(p)},getLineNumber:()=>{const h=i.activeTextEditorControl;if(Qr(h)){const u=h.getSelection();if(u){const f=u.positionLineNumber;return String(f)}}},getExtension:h=>d.getExtension(h)},c,l.userHome().then(h=>h.path),t),this.configurationService=n,this.commandService=o,this.workspaceContextService=r,this.quickInputService=a,this.labelService=c,this.pathService=l,this.userInputAccessQueue=new bI}async resolveWithInteractionReplace(e,t,i,n,o){return t=await this.resolveAnyAsync(e,t),this.resolveWithInteraction(e,t,i,n,o).then(r=>r?r.size>0?this.resolveAnyAsync(e,t,Object.fromEntries(r)):t:null)}async resolveWithInteraction(e,t,i,n,o){const r=await this.resolveAnyMap(e,t);t=r.newConfig;const a=r.resolvedVariables;return this.resolveWithInputAndCommands(e,t,n,i,o).then(c=>{if(this.updateMapping(c,a))return a})}updateMapping(e,t){if(!e)return!1;for(const[i,n]of Object.entries(e))t.set(i,n);return!0}async resolveWithInputAndCommands(e,t,i,n,o){if(!t)return Promise.resolve(void 0);let r=[];if(this.workspaceContextService.getWorkbenchState()!==qi.EMPTY&&n){const l=e?{resource:e.uri}:{},d=this.configurationService.inspect(n,l);if(d&&(d.userValue||d.workspaceValue||d.workspaceFolderValue))switch(o){case St.USER:r=d.userValue?.inputs;break;case St.WORKSPACE:r=d.workspaceValue?.inputs;break;default:r=d.workspaceFolderValue?.inputs}else{const h=this.configurationService.getValue(n,l);h&&(r=h.inputs)}}const a=[];this.findVariables(t,a);const c=Object.create(null);for(const l of a){const[d,h]=l.split(":",2);let u;switch(d){case"input":u=await this.showUserInput(h,r);break;case"command":{const f=(i?i[h]:void 0)||h;if(u=await this.commandService.executeCommand(f,t),typeof u!="string"&&!ra(u))throw new Error(g(8787,"Cannot substitute command variable '{0}' because command did not return a result of type string.",f));break}default:this._contributedVariables.has(l)&&(u=await this._contributedVariables.get(l)())}if(typeof u=="string")c[l]=u;else return}return c}findVariables(e,t){if(typeof e=="string"){let i;for(;(i=ire.INPUT_OR_COMMAND_VARIABLES_PATTERN.exec(e))!==null;)if(i.length===4){const n=i[1];t.indexOf(n)<0&&t.push(n)}for(const n of this._contributedVariables.keys())t.indexOf(n)<0&&e.indexOf("${"+n+"}")>=0&&t.push(n)}else if(Array.isArray(e))for(const i of e)this.findVariables(i,t);else if(e)for(const i of Object.values(e))this.findVariables(i,t)}showUserInput(e,t){if(!t)return Promise.reject(new Error(g(8788,"Variable '{0}' must be defined in an '{1}' section of the debug or task configuration.",e,"inputs")));const i=t.filter(n=>n.id===e).pop();if(i){const n=o=>{throw new Error(g(8789,"Input variable '{0}' is of type '{1}' and must include '{2}'.",e,i.type,o))};switch(i.type){case"promptString":{Lt(i.description)||n("description");const o={prompt:i.description,ignoreFocusLost:!0};return i.default&&(o.value=i.default),i.password&&(o.password=i.password),this.userInputAccessQueue.queue(()=>this.quickInputService.input(o)).then(r=>r)}case"pickString":{if(Lt(i.description)||n("description"),Array.isArray(i.options))for(const a of i.options)!Lt(a)&&!Lt(a.value)&&n("value");else n("options");const o=new Array;for(const a of i.options){const c=Lt(a)?a:a.value,l=Lt(a)?void 0:a.label,d={label:l?`${l}: ${c}`:c,value:c};c===i.default?(d.description=g(8790,"(Default)"),o.unshift(d)):o.push(d)}const r={placeHolder:i.description,matchOnDetail:!0,ignoreFocusLost:!0};return this.userInputAccessQueue.queue(()=>this.quickInputService.pick(o,r,void 0)).then(a=>{if(a)return a.value})}case"command":return Lt(i.command)||n("command"),this.userInputAccessQueue.queue(()=>this.commandService.executeCommand(i.command,i.args)).then(o=>{if(typeof o=="string"||ra(o))return o;throw new Error(g(8791,"Cannot substitute input variable '{0}' because command '{1}' did not return a result of type string.",e,i.command))});default:throw new Error(g(8792,"Input variable '{0}' can only be of type 'promptString', 'pickString', or 'command'.",e))}}return Promise.reject(new Error(g(8793,"Undefined input variable '{0}' encountered. Remove or define '{0}' to continue.",e)))}};ire.INPUT_OR_COMMAND_VARIABLES_PATTERN=/\${((input|command):(.*?))}/g;let nke=ire,ske=class extends nke{constructor(e,t,i,n,o,r,a,c){super({getAppRoot:()=>{},getExecPath:()=>{}},Promise.resolve(Object.create(null)),e,t,i,n,o,r,a,c)}};ske=D([_(0,ei),_(1,Te),_(2,vi),_(3,yi),_(4,In),_(5,Fs),_(6,bf),_(7,fs)],ske);function xZt(){throw new Error("unsupported")}function DZt(s){let e=null;return(...t)=>(e==null&&(e=s(...t)),e)}function kZt(s){return new Proxy(s,{construct:DZt((e,t)=>Reflect.construct(s,t))})}N.from({scheme:pe.vscodeUserData,path:"/User/settings.json"});Qe.as(Nn.Configuration);let oke=class extends CZt{constructor(e,t,i,n,o,r,a,c){const l=new AZt([pe.file,pe.vscodeUserData,pe.tmp],e,n);super({configurationCache:l},e,t,i,n,o,r,a,c)}};oke=D([_(0,Jr),_(1,ug),_(2,Em),_(3,Jt),_(4,hg),_(5,ks),_(6,Ge),_(7,bRe)],oke);class IZt extends tke{constructor(){super(...arguments),this.enterWorkspace=xZt}}let Hst;pNe(async s=>{const e=s.get(yi);e.acquireInstantiationService(s.get(we));const t=Hst??gNe();if(N.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const n=s.get(Jt);await n.createFolder(t),await n.writeFile(i,$e.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:ar(),configPath:i})}else await e.initialize(t)});const d9e=kZt(oke);function TZt(s){return Hst=s,{...Rce(),[Te.toString()]:new wi(d9e,[],!0),[yi.toString()]:new wi(d9e,[],!0),[Ec.toString()]:new wi(QDe,[],!0),[iC.toString()]:new wi(IZt,[],!0),[xI.toString()]:new wi(ike,[],!0),[CTe.toString()]:new wi(eke,[],!0),[oMe.toString()]:new wi(ske,[],!0)}}let rke=class extends xY{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(Qr(e))return e;if(im(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return W2(t)&&Qr(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const n=this.editorService.activeTextEditorControl;if(!i&&im(n)&&e.options&&e.resource&&t===n.getModifiedEditor()&&n.getModel()&&ji(e.resource,n.getModel()?.modified.uri)){const o=n.getModifiedEditor();return LZ(e.options,o,mt.Smooth),o}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!ji(t.getModel()?.uri,e.resource)){for(const r of this.editorService.visibleEditorPanes)if(s6(r.getControl())===t){r.group.pinEditor();break}}const o=await this.editorService.openEditor(e,i?ev:hA);if(o){const r=o.getControl();if(Qr(r))return r;if(W2(r)&&Qr(r.activeCodeEditor))return r.activeCodeEditor}return null}};rke=D([_(0,ei),_(1,pn),_(2,Te)],rke);let ake=class extends V{constructor(e,t,i,n,o){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=n,this.editorResolverService=o,this.editorInputCache=new ui,this.fileEditorFactory=Qe.as(tC.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:rm.id,label:rm.displayName,detail:rm.providerDisplayName,priority:f$.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(E_(e)){const n=this.createTextEditor(e.original),o=this.createTextEditor(e.modified);return this.instantiationService.createInstance(qg,e.label,e.description,n,o,void 0)}if(kS(e)){const n=this.createTextEditor(e.primary),o=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(op,e.label,e.description,o,n)}const t=e;if(t.forceUntitled||!t.resource||t.resource.scheme===pe.untitled){const n={languageId:t.languageId,initialValue:t.contents,encoding:t.encoding};let o;return t.resource?.scheme===pe.untitled?o=this.untitledTextEditorService.create({untitledResource:t.resource,...n}):o=this.untitledTextEditorService.create({associatedResource:t.resource,...n}),this.createOrGetCached(o.resource,()=>this.instantiationService.createInstance(S9,o))}const i=e;if(i.resource instanceof N){const n=i.label||_i(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(MT,r,i.label,i.description,i.languageId,i.contents),a=>{a instanceof S9||(a instanceof MT?(n&&a.setName(n),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 n=this.editorInputCache.get(e);return n?(i?.(n),n):(n=t(),this.editorInputCache.set(e,n),M.once(n.onWillDispose)(()=>this.editorInputCache.delete(e)),n)}};ake=D([_(0,W6),_(1,we),_(2,ks),_(3,Jt),_(4,BU)],ake);var OV,sM;let cke=(sM=class extends V{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 F6e,this.editorsPerResourceCounter=new ui,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(Zh.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 Do.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case Do.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)})),M.once(e.onWillDispose)(()=>bt(t))}onDidChangeEditorPartOptions(e){if(!Ys(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,n){const o=this.ensureKey(e,t),r=this.mostRecentEditorsMap.first;i||!r?this.mostRecentEditorsMap.set(o,o,r?Gl.AsOld:void 0):(this.mostRecentEditorsMap.set(o,o,Gl.AsOld),this.mostRecentEditorsMap.set(r,r,Gl.AsOld)),n&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,n,o;if(e instanceof op?(i=e.primary.resource,n=e.primary.typeId,o=e.primary.editorId):(i=e.resource,n=e.typeId,o=e.editorId),!i)return;const r=this.toIdentifier(n,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 n=this.keyMap.get(e.id);n&&n.delete(i.editor)&&n.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 n=i.get(t);return n||(n={groupId:e.id,editor:t},i.set(t,n)),n}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 n=this.editorGroupsContainer.getGroup(t);n&&await this.doEnsureOpenedEditorsLimit(i,n.getEditors(Zh.MOST_RECENTLY_ACTIVE).map(o=>({editor:o,groupId:t})),e)}else for(const n of this.editorGroupsContainer.groups)await this.ensureOpenedEditorsLimit(e,n.id);else await this.doEnsureOpenedEditorsLimit(i,[...this.mostRecentEditorsMap.values()],e)}async doEnsureOpenedEditorsLimit(e,t,i){let n;if(this.editorGroupService.partOptions.limit?.excludeDirty?n=t.filter(({editor:c})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Ei.Scratchpad))):n=t,e>=n.length)return;const o=n.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Ei.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let r=n.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(OV.STORAGE_KEY,Ie.WORKSPACE):this.storageService.store(OV.STORAGE_KEY,JSON.stringify(this.serialize()),Ie.WORKSPACE,an.MACHINE))}serialize(){const e=Qe.as(tC.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Fi(t.map(({editor:n,groupId:o})=>{const r=this.editorGroupsContainer.getGroup(o);if(!r)return;let a=i.get(r);a||(a=r.getEditors(Zh.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(r,a));const c=a.indexOf(n);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(OV.STORAGE_KEY,Ie.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(hu.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const n=t[i],o=n.getEditors(Zh.MOST_RECENTLY_ACTIVE);for(let r=o.length-1;r>=0;r--)this.addMostRecentEditor(n,o[r],!0,!0)}}for(const t of this.editorGroupsContainer.groups)this.registerGroupListeners(t)}deserialize(e){const t=[];for(const{groupId:i,index:n}of e.entries){const o=this.editorGroupsContainer.getGroup(i);if(!o)continue;const r=o.getEditorByIndex(n);if(!r)continue;const a=this.ensureKey(o,r);t.push([a,a]),this.updateEditorResourcesMap(r,!0)}this.mostRecentEditorsMap.fromJSON(t)}},OV=sM,sM.STORAGE_KEY="editors.mru",sM);cke=OV=D([_(1,Po),_(2,$i)],cke);function h9e(s,e,t){const i=s.get(Po),n=s.get(Te),o=LZt(e,t,i,n);return o instanceof Promise?o.then(r=>u9e(r,e,t,i)):u9e(o,e,t,i)}function u9e(s,e,t,i){let n;return i.activeGroup!==s&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==ev&&(n=Gk.ACTIVATE),[s,n]}function LZt(s,e,t,i){let n;const o=R5(s)?s.editor:s,r=s.options;if(e&&typeof e!="number")n=e;else if(typeof e=="number"&&e>=0)n=t.getGroup(e);else if(e===ev){const a=UW(i);let c=t.findGroup({direction:a});(!c||zK(c,o))&&(c=t.addGroup(t.activeGroup,a)),n=c}else if(e===$4t)n=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!r||typeof r.index!="number"){const a=t.getGroups(hu.MOST_RECENTLY_ACTIVE);if(r?.revealIfVisible){for(const c of a)if(RZt(c,o)){n=c;break}}if(!n&&(r?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||wa(o)&&o.hasCapability(Ei.Singleton))){let c,l;for(const d of a)if(Ust(d,o)&&(l||(l=d),!c&&d.isActive(o)&&(c=d)),l&&c)break;n=c||l}}if(!n){let a=t.activeGroup;if(zK(a,o)){for(const c of t.getGroups(hu.MOST_RECENTLY_ACTIVE))if(!zK(c,o)){a=c;break}zK(a,o)?n=t.addGroup(a,UW(i)):n=a}else n=a}return n}function zK(s,e){return!(!s.isLocked||Ust(s,e))}function RZt(s,e){return s.activeEditor?s.activeEditor.matches(e):!1}function Ust(s,e){for(const t of s.editors)if(t.matches(e))return!0;return!1}var lke;let dke=lke=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=n,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 ui,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(cke,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new lke(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})})),M.once(e.onWillDispose)(()=>{bt(t)})}handleVisibleEditorsChange(){const e=new Dk;for(const t of this.visibleEditors){const i=ja(Fi([Na.getCanonicalUri(t,{supportSideBySide:Hs.PRIMARY}),Na.getCanonicalUri(t,{supportSideBySide:Hs.SECONDARY})]),n=>n.toString());for(const n of i)this.fileService.hasProvider(n)&&!this.contextService.isInsideWorkspace(n)&&e.add(n)}for(const t of this.activeOutOfWorkspaceWatchers.keys())e.has(t)||(bt(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(Ai.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Ai.DELETE)||e.isOperation(Ai.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 n=[];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=SGe(r.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(r));a=Pt(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)};wa(c.editor)?n.push({editor:o,replacement:c.editor,options:{...c.options,...l}}):n.push({editor:o,replacement:{...c.editor,options:{...c.editor.options,...l}}})}n.length&&this.replaceEditors(n,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 n of this.getAllNonDirtyEditors({includeUntitled:!1,supportSideBySide:!0}))(async()=>{const o=n.resource;if(o&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(o,i))return;let r=!1;if(e instanceof zY?r=e.contains(o,To.DELETED):r=this.uriIdentityService.extUri.isEqualOrParent(o,e),!r)return;let a=!1;t&&this.fileService.hasProvider(o)&&(await Sr(100),a=await this.fileService.exists(o)),!a&&!n.isDisposed()&&n.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(n){n.hasCapability(Ei.Untitled)&&!e.includeUntitled||n.isDirty()||t.push(n)}for(const n of this.editors)e.supportSideBySide&&n instanceof op?(i(n.primary),i(n.secondary)):i(n);return t}get activeEditorPane(){return this.editorGroupsContainer.activeGroup?.activeEditorPane}get activeTextEditorControl(){const e=this.activeEditorPane;if(e){const t=e.getControl();if(Qr(t)||im(t))return t;if(W2(t)&&Qr(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return im(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(Zh.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case Zh.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:n})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(n)):this.editorsObserver.editors;case Zh.SEQUENTIAL:{const i=[];for(const n of this.editorGroupsContainer.getGroups(hu.GRID_APPEARANCE))i.push(...n.getEditors(Zh.SEQUENTIAL,t).map(o=>({editor:o,groupId:n.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Fi(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof XCe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const n of i)(Qr(n)||im(n))&&e.push(n)}return e}get visibleEditors(){return Fi(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let n,o=wa(e)?t:e.options,r;if(Itt(t)&&(i=t),!wa(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===az.ABORT)return;Hhe(a)&&(n=a.editor,o=a.options,r=a.group)}if(n||(n=wa(e)?e:await this.textEditorService.resolveTextEditor(e)),!r){let a;const c=this.instantiationService.invokeFunction(h9e,{editor:n,options:o},i);c instanceof Promise?[r,a]=await c:[r,a]=c,a&&(o={...o,activation:a})}return r.openEditor(n,o)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const n=new Map;for(const r of e){let a,c;if(!R5(r)){const d=await this.editorResolverService.resolveEditor(r,t);if(d===az.ABORT)continue;Hhe(d)&&(a=d,c=d.group)}if(a||(a=R5(r)?r:{editor:await this.textEditorService.resolveTextEditor(r),options:r.options}),!c){const d=this.instantiationService.invokeFunction(h9e,a,t);d instanceof Promise?[c]=await d:[c]=d}let l=n.get(c);l||(l=[],n.set(c,l)),l.push(a)}const o=[];for(const[r,a]of n)o.push(r.openEditors(a));return Fi(await Zs.settled(o))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:n}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case Bp.Open:return!0;case Bp.OpenInNewWindow:return await this.hostService.openWindow(t.map(r=>({fileUri:r})),{forceNewWindow:!0,diffMode:i,mergeMode:n}),!1;case Bp.Cancel:return!1}}extractEditorResources(e){const t=new Dk;let i=!1,n=!1;for(const o of e)if(R5(o)){const r=Na.getOriginalUri(o.editor,{supportSideBySide:Hs.BOTH});N.isUri(r)?t.add(r):r&&(r.primary&&t.add(r.primary),r.secondary&&t.add(r.secondary),i=o.editor instanceof qg)}else wb(o)&&(N.isUri(o.input1)&&t.add(o.input1.resource),N.isUri(o.input2)&&t.add(o.input2.resource),N.isUri(o.base)&&t.add(o.base.resource),N.isUri(o.result)&&t.add(o.result.resource),n=!0),E_(o)?(N.isUri(o.original.resource)&&t.add(o.original.resource),N.isUri(o.modified.resource)&&t.add(o.modified.resource),i=!0):Qv(o)&&t.add(o.resource);return{resources:Array.from(t.keys()),diffMode:i,mergeMode:n}}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:n,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(n)}for(const[n,o]of i)await n.closeEditors(o,t)}findEditors(e,t,i){const n=N.isUri(e)?e:e.resource,o=N.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==Hs.ANY&&t?.supportSideBySide!==Hs.SECONDARY&&!this.editorsObserver.hasEditors(n))return N.isUri(e)||Ya(i)?[]:void 0;if(Ya(i)){const r=[];for(const a of this.editorGroupsContainer.getGroups(hu.MOST_RECENTLY_ACTIVE)){const c=[];if(N.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(N.isUri(e))return r?r.findEditors(n,t):[];{if(!r)return;const a=r.findEditors(n,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,n=[];for(const o of e){let r;if(!wa(o.replacement)){const a=await this.editorResolverService.resolveEditor(o.replacement,i);if(a===az.ABORT)continue;Hhe(a)&&(r={editor:o.editor,replacement:a.editor,options:a.options,forceReplaceDirty:o.forceReplaceDirty})}r||(r={editor:o.editor,replacement:v4e(o)?o.replacement:await this.textEditorService.resolveTextEditor(o.replacement),options:v4e(o)?o.options:o.replacement.options,forceReplaceDirty:o.forceReplaceDirty}),n.push(r)}return i?.replaceEditors(n)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),n=[],o=[];if(t?.saveAs)o.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(Ei.Untitled)?o.push({groupId:a,editor:c}):n.push({groupId:a,editor:c});const r=await Zs.settled(n.map(({groupId:a,editor:c})=>(t?.reason===Cn.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(Ei.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof Ob?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:Fi(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 Zs.settled(i.map(async({groupId:n,editor:o})=>(this.editorGroupsContainer.getGroup(n)?.pinEditor(o),o.revert(n,t)))),!i.some(({editor:n})=>n.isDirty())}async revertAll(e){return this.revert(this.getAllModifiedEditors(e),e)}getAllModifiedEditors(e){const t=[];for(const i of this.editorGroupsContainer.getGroups(hu.MOST_RECENTLY_ACTIVE))for(const n of i.getEditors(Zh.MOST_RECENTLY_ACTIVE))n.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&n.hasCapability(Ei.Scratchpad)||!e?.includeUntitled&&n.hasCapability(Ei.Untitled)||e?.excludeSticky&&i.isSticky(n)||t.push({groupId:i.id,editor:n}));return t}getUniqueEditors(e){const t=[];for(const{editor:i,groupId:n}of e)t.some(o=>o.editor.matches(i))||t.push({editor:i,groupId:n});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>bt(e)),this.activeOutOfWorkspaceWatchers.clear()}};dke=lke=D([_(1,Po),_(2,we),_(3,Jt),_(4,Te),_(5,yi),_(6,ks),_(7,BU),_(8,vae),_(9,xc),_(10,ece)],dke);function kt(){throw new Error("unsupported")}var hke;class MZt{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=kt,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.createEditorActions=kt,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=kt,this.notifyIndexChanged=kt,this.relayout=kt,this.dispose=kt,this.toJSON=kt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=kt,this.onDidModelChange=M.None,this.onWillDispose=M.None,this.onDidActiveEditorChange=M.None,this.onWillCloseEditor=M.None,this.onDidCloseEditor=M.None,this.onWillMoveEditor=M.None,this.onWillOpenEditor=M.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=kt,this.openEditor=kt,this.openEditors=kt,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=kt,this.moveEditors=kt,this.copyEditor=kt,this.copyEditors=kt,this.closeEditor=kt,this.closeEditors=kt,this.closeAllEditors=kt,this.replaceEditors=kt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=kt,this.isLast=kt}get groupsView(){return kt()}notifyLabelChanged(){}get titleHeight(){return kt()}get element(){return kt()}get scopedContextKeyService(){return Dt.get(Le)}focus(){}}const J$=new MZt;class NZt{constructor(e){this.editor=e,this.onDidChangeControl=M.None,this.onDidChangeSizeConstraints=M.None,this.onDidFocus=M.None,this.onDidBlur=M.None,this.input=void 0,this.options=void 0,this.group=J$,this.scopedContextKeyService=void 0,this.getViewState=kt,this.isVisible=kt,this.hasFocus=kt,this.getId=kt,this.getTitle=kt,this.focus=kt}get minimumWidth(){return Rx.width}get maximumWidth(){return BJ.width}get minimumHeight(){return Rx.height}get maximumHeight(){return BJ.height}getControl(){return this.editor}}function PZt(s,e,t){async function i(n,o,r){const a=wa(n)?o:n.options;Itt(o)&&(r=o);const c=Qv(n)||wa(n)?n.resource:void 0;if(c==null||!s.canHandleResource(c))return e(n,o,r);let l;if(l=Dt.get(Kt).listCodeEditors().find(h=>h instanceof IM&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(n,o,r);if(h!=null)return h;const u=await s.createModelReference(c);if(l=await t?.(u,a,r===ev),l==null){u.dispose();return}}return a!=null&&LZ(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new NZt(l)}return i}let uke=class extends dke{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(void 0,i,n,o,r,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=PZt(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=Dt.get(Kt).getFocusedCodeEditor();return e!=null&&e instanceof Yk?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};uke=D([_(2,Po),_(3,we),_(4,Jt),_(5,Te),_(6,yi),_(7,ks),_(8,BU),_(9,vae),_(10,xc),_(11,ece),_(12,fn)],uke);class g9e{constructor(e,t,i){this.editor=e,this.input=t,this.group=i,this.onDidChangeControl=M.None,this.options=void 0,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChangeSizeConstraints=M.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 Yie=hke=class extends V{constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=kt,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=kt,this.relayout=kt,this.toJSON=kt,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=M.None,this._onDidCloseEditor=new I,this.onDidCloseEditor=this._onDidCloseEditor.event,this.onWillMoveEditor=M.None,this._onWillOpenEditor=new I,this.onWillOpenEditor=this._onWillOpenEditor.event,this.id=--hke.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 MT&&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=kt,this.moveEditors=kt,this.copyEditor=kt,this.copyEditors=kt,this.closeEditor=kt,this.closeEditors=kt,this.closeAllEditors=kt,this.replaceEditors=kt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=kt,this.isLast=kt;const n=a=>{const c=t.createInstance(MT,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new g9e(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:cA.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&o(a.oldModelUrl),a.newModelUrl!=null&&n(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(MT,r.uri,void 0,void 0,void 0,void 0);this.pane=new g9e(e,a,this)}}get groupsView(){return kt()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:M.None}}get titleHeight(){return kt()}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()}};Yie.idCounter=0;Yie=hke=D([_(1,we),_(2,Le)],Yie);let gke=class extends V{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=M.any(this._onDidChangeActiveGroup.event,this.delegate.onDidChangeActiveGroup),this._onDidAddGroup=new I,this.onDidAddGroup=M.any(this._onDidAddGroup.event,this.delegate.onDidAddGroup),this._onDidRemoveGroup=new I,this.onDidRemoveGroup=M.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=n=>[...this.delegate.getGroups(n),...this.additionalGroups],this.getGroup=n=>this.delegate.getGroup(n)??this.additionalGroups.find(o=>o.id===n),this.activateGroup=(...n)=>this.delegate.activateGroup(...n),this.getSize=(...n)=>this.delegate.getSize(...n),this.setSize=(...n)=>this.delegate.setSize(...n),this.arrangeGroups=(...n)=>this.delegate.arrangeGroups(...n),this.applyLayout=(...n)=>this.delegate.applyLayout(...n),this.setGroupOrientation=(...n)=>this.delegate.setGroupOrientation(...n),this.findGroup=(...n)=>this.delegate.findGroup(...n),this.addGroup=(...n)=>this.delegate.addGroup(...n),this.removeGroup=(...n)=>this.delegate.removeGroup(...n),this.moveGroup=(...n)=>this.delegate.moveGroup(...n),this.mergeGroup=(...n)=>this.delegate.mergeGroup(...n),this.mergeAllGroups=(...n)=>this.delegate.mergeAllGroups(...n),this.copyGroup=(...n)=>this.delegate.copyGroup(...n),this.onDidChangeEditorPartOptions=this.delegate.onDidChangeEditorPartOptions,setTimeout(()=>{const n=Dt.get(Kt),o=a=>{if(a instanceof IM){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(Yie,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},r=a=>{if(a instanceof IM){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(n.onCodeEditorAdd(o)),this._register(n.onCodeEditorRemove(r)),n.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}};gke=D([_(2,we)],gke);var YB;let Jie=(YB=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=n,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 ui(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new ui(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,Bg.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Bg.DISABLED)))}onConditionChanged(e,t){for(const i of e){const n=this.waitingOnConditionAutoSaveWorkingCopies.get(i);if(n?.condition===t)n.workingCopy.isDirty()&&this.filesConfigurationService.getAutoSaveMode(n.workingCopy.resource,n.reason).mode!==rc.OFF&&(this.discardAutoSave(n.workingCopy),this.logService.info("[editor auto save] running auto save from condition change event",n.workingCopy.resource.toString(),n.workingCopy.typeId),n.workingCopy.save({reason:n.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!==rc.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(Cn.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Cn.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Cn.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(Cn.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(Ei.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==rc.OFF?(e===Cn.WINDOW_CHANGE&&(i.mode===rc.ON_FOCUS_CHANGE||i.mode===rc.ON_WINDOW_CHANGE)||e===Cn.FOCUS_CHANGE&&i.mode===rc.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===Bg.ERRORS||i.reason===Bg.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 rc.ON_FOCUS_CHANGE:e=Cn.FOCUS_CHANGE;break;case rc.ON_WINDOW_CHANGE:e=Cn.WINDOW_CHANGE;break;case rc.AFTER_SHORT_DELAY:case rc.AFTER_LONG_DELAY:e=Cn.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&aC.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==rc.OFF?t.save({reason:e}):(i.reason===Bg.ERRORS||i.reason===Bg.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&aC.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 n=Cn.AUTO,o=this.filesConfigurationService.getAutoSaveMode(e.resource,n);o.mode!==rc.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:n})):(o.reason===Bg.ERRORS||o.reason===Bg.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:n,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){bt(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},YB.ID="workbench.contrib.editorAutoSave",YB);Jie=D([_(0,_d),_(1,xc),_(2,ei),_(3,Po),_(4,Rm),_(5,Ge),_(6,Am),_(7,ks)],Jie);Qu(Jie.ID,Jie,yc.BlockRestore);let fke=class extends RI{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Us.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()}};fke=D([_(2,Jt)],fke);var pke,HE;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Binary=2]="Binary"})(HE||(HE={}));let Xie=pke=class extends lb{get typeId(){return $tt}get editorId(){return rm.id}get capabilities(){let e=Ei.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=Ei.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly):e|=Ei.Untitled,e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(e,t,p,l,h,u,f,v,b),this.instantiationService=c,this.textModelService=d,this.pathService=m,this.forceOpenAs=HE.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),n&&this.setPreferredDescription(n),o&&this.setPreferredEncoding(o),r&&this.setPreferredLanguageId(r),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(w=>this.onDidCreateTextFileModel(w))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){ji(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(M.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!==pe.vscodeUserData&&this.resource.scheme!==pe.file&&this.resource.scheme!==pe.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=HE.Text}setForceOpenAsBinary(){this.forceOpenAs=HE.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(gh.SAVED)||this.model?.hasState(gh.CONFLICT)||this.model?.hasState(gh.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===HE.Binary?e.find(t=>t.typeId===JVt):e.find(t=>t.typeId===ztt)}resolve(e){return this.forceOpenAs===HE.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"?oae(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===HE.Text,reason:X3.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===EW.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(fke,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:YO(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:YO(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof pke?ji(e.resource,this.resource):Qv(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){bt(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};Xie=pke=D([_(7,we),_(8,Fo),_(9,fn),_(10,Fs),_(11,Jt),_(12,_d),_(13,ei),_(14,bf),_(15,Ec),_(16,nE)],Xie);Qe.as(tC.EditorFactory).registerFileEditorFactory({typeId:$tt,createFileEditor:(s,e,t,i,n,o,r,a)=>a.createInstance(Xie,s,e,t,i,n,o,r),isFileEditor:s=>s instanceof Xie});function Vst(s){const e=s.get(lg).lastFocusedList,t=e?.getHTMLElement();if(t&&av(t)&&e instanceof Xa){const i=Fi(e.getSelectedElements().filter(a=>a instanceof xZ)),n=e.getFocusedElements(),o=n.length?n[0]:void 0;let r;return o instanceof xZ&&(r=o),i.some(a=>a===r)?i:r?[r]:void 0}}async function DPe(s,e){const t=s.get(Po),i=s.get(Kt),n=s.get(Fo);let o=Vst(s);if(!o){const a=t.activeGroup;a.activeEditor&&(o=[],a.activeEditor instanceof op&&!e?.saveAs&&!(a.activeEditor.primary.hasCapability(Ei.Untitled)||a.activeEditor.secondary.hasCapability(Ei.Untitled))&&a.activeEditor.secondary.isModified()?(o.push({groupId:a.id,editor:a.activeEditor.primary}),o.push({groupId:a.id,editor:a.activeEditor.secondary})):o.push({groupId:a.id,editor:a.activeEditor}))}if(!o||o.length===0)return;await kPe(s,o,e);const r=i.getFocusedCodeEditor();if(r instanceof lf&&!r.isSimpleWidget){const a=r.getModel()?.uri;a&&!o.some(({editor:c})=>ji(Na.getCanonicalUri(c,{supportSideBySide:Hs.PRIMARY}),a))&&(n.files.get(a)?.isReadonly()||await n.save(a,e))}}function zst(s,e,t){const i=[];for(const n of e)for(const o of n.getEditors(Zh.MOST_RECENTLY_ACTIVE))o.isDirty()&&i.push({groupId:n.id,editor:o});return kPe(s,i,t)}async function kPe(s,e,t){const i=s.get(ei),n=s.get(bi),o=s.get(we);try{await i.save(e,t)}catch(r){Fr(r)||n.notify({id:e.map(({editor:a})=>Wc(a.resource?.toString())).join(),severity:Xe.Error,message:g(3756,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Nr(r,!1)),actions:{primary:[rl({id:"workbench.action.files.saveEditors",label:g(3757,"Retry"),run:()=>o.invokeFunction(a=>kPe(a,e,t))}),rl({id:"workbench.action.files.revertEditors",label:g(3758,"Discard"),run:()=>i.revert(e)})]}})}}So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyS,id:CFt,handler:s=>DPe(s,{reason:Cn.EXPLICIT,force:!0})});So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:rr(U.CtrlCmd|S.KeyK,S.KeyS),win:{primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyS)},id:SFt,handler:s=>DPe(s,{reason:Cn.EXPLICIT,force:!0,skipSaveParticipants:!0})});So.registerCommandAndKeybindingRule({id:yFt,weight:Ae.WorkbenchContrib,when:void 0,primary:U.CtrlCmd|U.Shift|S.KeyS,handler:s=>DPe(s,{reason:Cn.EXPLICIT,saveAs:!0})});So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:void 0,mac:{primary:U.CtrlCmd|U.Alt|S.KeyS},win:{primary:rr(U.CtrlCmd|S.KeyK,S.KeyS)},id:AFt,handler:s=>zst(s,s.get(Po).getGroups(hu.MOST_RECENTLY_ACTIVE),{reason:Cn.EXPLICIT})});_t.registerCommand({id:JZe,handler:(s,e,t)=>{const i=s.get(Po),n=v5t([t],s.get(ei),i,s.get(lg));let o;return n.groupedEditors.length?o=n.groupedEditors.map(({group:r})=>r):o=i.getGroups(hu.MOST_RECENTLY_ACTIVE),zst(s,o,{reason:Cn.EXPLICIT})}});_t.registerCommand({id:EFt,handler:async s=>(await s.get(ei).saveAll({includeUntitled:!1,reason:Cn.EXPLICIT})).success});_t.registerCommand({id:wFt,handler:async s=>{const e=s.get(Po),t=s.get(ei);let i=Vst(s);if(!i){const n=e.activeGroup;n.activeEditor&&(i=[{groupId:n.id,editor:n.activeEditor}])}if(!(!i||i.length===0))try{await t.revert(i.filter(({editor:n})=>!n.hasCapability(Ei.Untitled)),{force:!0})}catch(n){s.get(bi).error(g(3759,"Failed to revert '{0}': {1}",i.map(({editor:r})=>r.getName()).join(", "),Nr(n,!1)))}}});class FZt{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=si.vscodeWindowId,this.onDidLayout=M.None,this.onDidScroll=M.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=kt,this.isLayoutCentered=kt,this.enforcePartOptions=kt,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.onDidChangeGroupMaximized=M.None,this.activeGroup=J$,this.groups=[J$],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=kt,this.getSize=kt,this.setSize=kt,this.arrangeGroups=kt,this.toggleMaximizeGroup=kt,this.toggleExpandGroup=kt,this.applyLayout=kt,this.getLayout=kt,this.setGroupOrientation=kt,this.findGroup=()=>{},this.addGroup=kt,this.removeGroup=kt,this.moveGroup=kt,this.mergeGroup=kt,this.mergeAllGroups=kt,this.copyGroup=kt,this.partOptions=Vae,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=kt}get contentDimension(){return kt()}get sideGroup(){return kt()}}class OZt{constructor(){this.registerContextKeyProvider=kt,this.saveWorkingSet=kt,this.getWorkingSets=kt,this.applyWorkingSet=kt,this.deleteWorkingSet=kt,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new FZt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=kt,this.createAuxiliaryEditorPart=kt,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=kt,this.toggleExpandGroup=kt,this.partOptions=Vae,this.createEditorDropTarget=kt,this._serviceBrand=void 0,this.getLayout=kt,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidLayout=M.None,this.onDidScroll=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.activeGroup=J$,this.groups=[J$],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=kt,this.getSize=kt,this.setSize=kt,this.arrangeGroups=kt,this.applyLayout=kt,this.centerLayout=kt,this.isLayoutCentered=()=>!1,this.setGroupOrientation=kt,this.findGroup=()=>{},this.addGroup=kt,this.removeGroup=kt,this.moveGroup=kt,this.mergeGroup=kt,this.mergeAllGroups=kt,this.copyGroup=kt,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=kt}get contentDimension(){return kt()}get sideGroup(){return kt()}}let mke=class extends gke{constructor(e){super(e.createInstance(OZt),!0,e)}};mke=D([_(0,we)],mke);function BZt(s){return{[Kt.toString()]:new wi(rke,void 0,!0),[ei.toString()]:new wi(uke,[s,()=>!1],!0),[ece.toString()]:new wi(ake,[],!1),[Po.toString()]:new wi(mke)}}class X${static _readModifiers(e){e=e.toLowerCase().trim();let t=!1,i=!1,n=!1,o=!1,r;do r=!1,/^ctrl(\+|\-)/.test(e)&&(t=!0,e=e.substr(5),r=!0),/^shift(\+|\-)/.test(e)&&(i=!0,e=e.substr(6),r=!0),/^alt(\+|\-)/.test(e)&&(n=!0,e=e.substr(4),r=!0),/^meta(\+|\-)/.test(e)&&(o=!0,e=e.substr(5),r=!0),/^win(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),r=!0),/^cmd(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),r=!0);while(r);let a;const c=e.indexOf(" ");return c>0?(a=e.substring(0,c),e=e.substring(c)):(a=e,e=""),{remains:e,ctrl:t,shift:i,alt:n,meta:o,key:a}}static parseChord(e){const t=this._readModifiers(e),i=t.key.match(/^\[([^\]]+)\]$/);if(i){const o=i[1],r=Vp.lowerCaseToEnum(o);return[new gy(t.ctrl,t.shift,t.alt,t.meta,r),t.remains]}const n=Ia.fromUserSettings(t.key);return[new Ih(t.ctrl,t.shift,t.alt,t.meta,n),t.remains]}static parseKeybinding(e){if(!e)return null;const t=[];let i;for(;e.length>0;)[i,e]=this.parseChord(e),t.push(i);return t.length>0?new IO(t):null}}const $st=[{key:"commandPalette",id:_e.CommandPalette,description:g(8540,"The Command Palette"),supportsSubmenus:!1},{key:"touchBar",id:_e.TouchBarContext,description:g(8541,"The touch bar (macOS only)"),supportsSubmenus:!1},{key:"editor/title",id:_e.EditorTitle,description:g(8542,"The editor title menu")},{key:"editor/title/run",id:_e.EditorTitleRun,description:g(8543,"Run submenu inside the editor title menu")},{key:"editor/context",id:_e.EditorContext,description:g(8544,"The editor context menu")},{key:"editor/context/copy",id:_e.EditorContextCopy,description:g(8545,"'Copy as' submenu in the editor context menu")},{key:"editor/context/share",id:_e.EditorContextShare,description:g(8546,"'Share' submenu in the editor context menu"),proposed:"contribShareMenu"},{key:"explorer/context",id:_e.ExplorerContext,description:g(8547,"The file explorer context menu")},{key:"explorer/context/share",id:_e.ExplorerContextShare,description:g(8548,"'Share' submenu in the file explorer context menu"),proposed:"contribShareMenu"},{key:"editor/title/context",id:_e.EditorTitleContext,description:g(8549,"The editor tabs context menu")},{key:"editor/title/context/share",id:_e.EditorTitleContextShare,description:g(8550,"'Share' submenu inside the editor title context menu"),proposed:"contribShareMenu"},{key:"debug/callstack/context",id:_e.DebugCallStackContext,description:g(8551,"The debug callstack view context menu")},{key:"debug/variables/context",id:_e.DebugVariablesContext,description:g(8552,"The debug variables view context menu")},{key:"debug/toolBar",id:_e.DebugToolBar,description:g(8553,"The debug toolbar menu")},{key:"notebook/variables/context",id:_e.NotebookVariablesContext,description:g(8554,"The notebook variables view context menu")},{key:"menuBar/home",id:_e.MenubarHomeMenu,description:g(8555,"The home indicator context menu (web only)"),proposed:"contribMenuBarHome",supportsSubmenus:!1},{key:"menuBar/edit/copy",id:_e.MenubarCopy,description:g(8556,"'Copy as' submenu in the top level Edit menu")},{key:"scm/title",id:_e.SCMTitle,description:g(8557,"The Source Control title menu")},{key:"scm/sourceControl",id:_e.SCMSourceControl,description:g(8558,"The Source Control menu")},{key:"scm/sourceControl/title",id:_e.SCMSourceControlTitle,description:g(8559,"The Source Control title menu"),proposed:"contribSourceControlTitleMenu"},{key:"scm/resourceState/context",id:_e.SCMResourceContext,description:g(8560,"The Source Control resource state context menu")},{key:"scm/resourceFolder/context",id:_e.SCMResourceFolderContext,description:g(8561,"The Source Control resource folder context menu")},{key:"scm/resourceGroup/context",id:_e.SCMResourceGroupContext,description:g(8562,"The Source Control resource group context menu")},{key:"scm/change/title",id:_e.SCMChangeContext,description:g(8563,"The Source Control inline change menu")},{key:"scm/inputBox",id:_e.SCMInputBox,description:g(8564,"The Source Control input box menu"),proposed:"contribSourceControlInputBoxMenu"},{key:"scm/historyItemChanges/title",id:_e.SCMChangesSeparator,description:g(8565,"The Source Control incoming/outgoing changes title menu"),proposed:"contribSourceControlHistoryItemChangesMenu"},{key:"scm/historyItem/context",id:_e.SCMChangesContext,description:g(8566,"The Source Control history item context menu"),proposed:"contribSourceControlHistoryItemChangesMenu"},{key:"scm/incomingChanges",id:_e.SCMIncomingChanges,description:g(8567,"The Source Control incoming changes menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/incomingChanges/context",id:_e.SCMIncomingChangesContext,description:g(8568,"The Source Control incoming changes context menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/outgoingChanges",id:_e.SCMOutgoingChanges,description:g(8569,"The Source Control outgoing changes menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/outgoingChanges/context",id:_e.SCMOutgoingChangesContext,description:g(8570,"The Source Control outgoing changes context menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/incomingChanges/allChanges/context",id:_e.SCMIncomingChangesAllChangesContext,description:g(8571,"The Source Control all incoming changes context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/incomingChanges/historyItem/context",id:_e.SCMIncomingChangesHistoryItemContext,description:g(8572,"The Source Control incoming changes history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/outgoingChanges/allChanges/context",id:_e.SCMOutgoingChangesAllChangesContext,description:g(8573,"The Source Control all outgoing changes context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/outgoingChanges/historyItem/context",id:_e.SCMOutgoingChangesHistoryItemContext,description:g(8574,"The Source Control outgoing changes history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"statusBar/remoteIndicator",id:_e.StatusBarRemoteIndicatorMenu,description:g(8575,"The remote indicator menu in the status bar"),supportsSubmenus:!1},{key:"terminal/context",id:_e.TerminalInstanceContext,description:g(8576,"The terminal context menu")},{key:"terminal/title/context",id:_e.TerminalTabContext,description:g(8577,"The terminal tabs context menu")},{key:"view/title",id:_e.ViewTitle,description:g(8578,"The contributed view title menu")},{key:"view/item/context",id:_e.ViewItemContext,description:g(8579,"The contributed view item context menu")},{key:"comments/comment/editorActions",id:_e.CommentEditorActions,description:g(8580,"The contributed comment editor actions"),proposed:"contribCommentEditorActionsMenu"},{key:"comments/commentThread/title",id:_e.CommentThreadTitle,description:g(8581,"The contributed comment thread title menu")},{key:"comments/commentThread/context",id:_e.CommentThreadActions,description:g(8582,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/additionalActions",id:_e.CommentThreadAdditionalActions,description:g(8582,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1,proposed:"contribCommentThreadAdditionalMenu"},{key:"comments/commentThread/title/context",id:_e.CommentThreadTitleContext,description:g(8583,"The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."),proposed:"contribCommentPeekContext"},{key:"comments/comment/title",id:_e.CommentTitle,description:g(8584,"The contributed comment title menu")},{key:"comments/comment/context",id:_e.CommentActions,description:g(8585,"The contributed comment context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/comment/context",id:_e.CommentThreadCommentContext,description:g(8586,"The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."),proposed:"contribCommentPeekContext"},{key:"commentsView/commentThread/context",id:_e.CommentsViewThreadActions,description:g(8587,"The contributed comment thread context menu in the comments view"),proposed:"contribCommentsViewThreadMenus"},{key:"notebook/toolbar",id:_e.NotebookToolbar,description:g(8588,"The contributed notebook toolbar menu")},{key:"notebook/kernelSource",id:_e.NotebookKernelSource,description:g(8589,"The contributed notebook kernel sources menu"),proposed:"notebookKernelSource"},{key:"notebook/cell/title",id:_e.NotebookCellTitle,description:g(8590,"The contributed notebook cell title menu")},{key:"notebook/cell/execute",id:_e.NotebookCellExecute,description:g(8591,"The contributed notebook cell execution menu")},{key:"interactive/toolbar",id:_e.InteractiveToolbar,description:g(8592,"The contributed interactive toolbar menu")},{key:"interactive/cell/title",id:_e.InteractiveCellTitle,description:g(8593,"The contributed interactive cell title menu")},{key:"issue/reporter",id:_e.IssueReporter,description:g(8594,"The contributed issue reporter menu"),proposed:"contribIssueReporter"},{key:"testing/item/context",id:_e.TestItem,description:g(8595,"The contributed test item menu")},{key:"testing/item/gutter",id:_e.TestItemGutter,description:g(8596,"The menu for a gutter decoration for a test item")},{key:"testing/profiles/context",id:_e.TestProfilesContext,description:g(8597,"The menu for configuring testing profiles.")},{key:"testing/item/result",id:_e.TestPeekElement,description:g(8598,"The menu for an item in the Test Results view or peek.")},{key:"testing/message/context",id:_e.TestMessageContext,description:g(8599,"A prominent button overlaying editor content where the message is displayed")},{key:"testing/message/content",id:_e.TestMessageContent,description:g(8600,"Context menu for the message in the results tree")},{key:"extension/context",id:_e.ExtensionContext,description:g(8601,"The extension context menu")},{key:"timeline/title",id:_e.TimelineTitle,description:g(8602,"The Timeline view title menu")},{key:"timeline/item/context",id:_e.TimelineItemContext,description:g(8603,"The Timeline view item context menu")},{key:"ports/item/context",id:_e.TunnelContext,description:g(8604,"The Ports view item context menu")},{key:"ports/item/origin/inline",id:_e.TunnelOriginInline,description:g(8605,"The Ports view item origin inline menu")},{key:"ports/item/port/inline",id:_e.TunnelPortInline,description:g(8606,"The Ports view item port inline menu")},{key:"file/newFile",id:_e.NewFile,description:g(8607,"The 'New File...' quick pick, shown on welcome page and File menu."),supportsSubmenus:!1},{key:"webview/context",id:_e.WebviewContext,description:g(8608,"The webview context menu")},{key:"file/share",id:_e.MenubarShare,description:g(8609,"Share submenu shown in the top level File menu."),proposed:"contribShareMenu"},{key:"editor/inlineCompletions/actions",id:_e.InlineCompletionsActions,description:g(8610,"The actions shown when hovering on an inline completion"),supportsSubmenus:!1,proposed:"inlineCompletionsAdditions"},{key:"editor/inlineEdit/actions",id:_e.InlineEditActions,description:g(8611,"The actions shown when hovering on an inline edit"),supportsSubmenus:!1,proposed:"inlineEdit"},{key:"editor/content",id:_e.EditorContent,description:g(8612,"The prominent button in an editor, overlays its content"),proposed:"contribEditorContentMenu"},{key:"editor/lineNumber/context",id:_e.EditorLineNumberContext,description:g(8613,"The contributed editor line number context menu")},{key:"mergeEditor/result/title",id:_e.MergeInputResultToolbar,description:g(8614,"The result toolbar of the merge editor"),proposed:"contribMergeEditorMenus"},{key:"multiDiffEditor/resource/title",id:_e.MultiDiffEditorFileToolbar,description:g(8615,"The resource toolbar in the multi diff editor"),proposed:"contribMultiDiffEditorMenus"},{key:"diffEditor/gutter/hunk",id:_e.DiffEditorHunkToolbar,description:g(8616,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"diffEditor/gutter/selection",id:_e.DiffEditorSelectionToolbar,description:g(8616,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"}];var KA;(function(s){function e(f){return typeof f.command=="string"}s.isMenuItem=e;function t(f,p){return typeof f.command!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","command")),!1):f.alt&&typeof f.alt!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","alt")),!1):f.when&&typeof f.when!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}s.isValidMenuItem=t;function i(f,p){return typeof f.submenu!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","submenu")),!1):f.when&&typeof f.when!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}s.isValidSubmenuItem=i;function n(f,p){if(!Array.isArray(f))return p.error(g(8619,"submenu items must be an array")),!1;for(const m of f)if(e(m)){if(!t(m,p))return!1}else if(!i(m,p))return!1;return!0}s.isValidItems=n;function o(f,p){return typeof f!="object"?(p.error(g(8620,"submenu items must be an object")),!1):typeof f.id!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","id")),!1):typeof f.label!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","label")),!1):!0}s.isValidSubmenu=o;const r={type:"object",required:["command"],properties:{command:{description:g(8621,"Identifier of the command to execute. The command must be declared in the 'commands'-section"),type:"string"},alt:{description:g(8622,"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"),type:"string"},when:{description:g(8623,"Condition which must be true to show this item"),type:"string"},group:{description:g(8624,"Group into which this item belongs"),type:"string"}}},a={type:"object",required:["submenu"],properties:{submenu:{description:g(8625,"Identifier of the submenu to display in this item."),type:"string"},when:{description:g(8623,"Condition which must be true to show this item"),type:"string"},group:{description:g(8624,"Group into which this item belongs"),type:"string"}}},c={type:"object",required:["id","label"],properties:{id:{description:g(8626,"Identifier of the menu to display as a submenu."),type:"string"},label:{description:g(8627,"The label of the menu item which leads to this submenu."),type:"string"},icon:{description:g(8628,"(Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:g(8629,"Icon path when a light theme is used"),type:"string"},dark:{description:g(8630,"Icon path when a dark theme is used"),type:"string"}}}]}}};s.menusContribution={description:g(8631,"Contributes menu items to the editor"),type:"object",properties:O1e($st,f=>f.key,f=>({markdownDescription:f.proposed?g(8632,'Proposed API, requires `enabledApiProposal: ["{0}"]` - {1}',f.proposed,f.description):f.description,type:"array",items:f.supportsSubmenus===!1?r:{oneOf:[r,a]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[r,a]}}},s.submenusContribution={description:g(8633,"Contributes submenu items to the editor"),type:"array",items:c};function l(f,p){return f?Gu(f.command)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","command")),!1):!h(f.title,p,"title")||f.shortTitle&&!h(f.shortTitle,p,"shortTitle")?!1:f.enablement&&typeof f.enablement!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","precondition")),!1):!(f.category&&!h(f.category,p,"category")||!d(f.icon,p)):(p.error(g(8634,"expected non-empty value.")),!1)}s.isValidCommand=l;function d(f,p){return typeof f>"u"||typeof f=="string"||typeof f.dark=="string"&&typeof f.light=="string"?!0:(p.error(g(8635,"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")),!1)}function h(f,p,m){return typeof f>"u"?(p.error(g(8636,"property `{0}` is mandatory and must be of type `string` or `object`",m)),!1):typeof f=="string"&&Gu(f)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`",m)),!1):typeof f!="string"&&(Gu(f.original)||Gu(f.value))?(p.error(g(8637,"properties `{0}` and `{1}` are mandatory and must be of type `string`",`${m}.value`,`${m}.original`)),!1):!0}const u={type:"object",required:["command","title"],properties:{command:{description:g(8638,"Identifier of the command to execute"),type:"string"},title:{description:g(8639,"Title by which the command is represented in the UI"),type:"string"},shortTitle:{markdownDescription:g(8640,"(Optional) Short title by which the command is represented in the UI. Menus pick either `title` or `shortTitle` depending on the context in which they show commands."),type:"string"},category:{description:g(8641,"(Optional) Category string by which the command is grouped in the UI"),type:"string"},enablement:{description:g(8642,"(Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api."),type:"string"},icon:{description:g(8643,"(Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:g(8644,"Icon path when a light theme is used"),type:"string"},dark:{description:g(8645,"Icon path when a dark theme is used"),type:"string"}}}]}}};s.commandsContribution={description:g(8646,"Contributes commands to the command palette."),oneOf:[u,{type:"array",items:u}]}})(KA||(KA={}));const f9e=new Z,Gst=eh.registerExtensionPoint({extensionPoint:"commands",jsonSchema:KA.commandsContribution,activationEventsGenerator:(s,e)=>{for(const t of s)t.command&&e.push(`onCommand:${t.command}`)}});Gst.setHandler(s=>{function e(t,i){if(!KA.isValidCommand(t,i.collector))return;const{icon:n,enablement:o,category:r,title:a,shortTitle:c,command:l}=t;let d;n&&(typeof n=="string"?d=We.fromString(n)??{dark:Pt(i.description.extensionLocation,n),light:Pt(i.description.extensionLocation,n)}:d={dark:Pt(i.description.extensionLocation,n.dark),light:Pt(i.description.extensionLocation,n.light)});const h=jn.getCommand(l);h&&(h.source?i.collector.info(g(8647,"Command `{0}` already registered by {1} ({2})",t.command,h.source.title,h.source.id)):i.collector.info(g(8648,"Command `{0}` already registered",t.command))),f9e.add(jn.addCommand({id:l,title:a,source:{id:i.description.identifier.value,title:i.description.displayName??i.description.name},shortTitle:c,tooltip:a,category:r,precondition:he.deserialize(o),icon:d}))}f9e.clear();for(const t of s){const{value:i}=t;if(Array.isArray(i))for(const n of i)e(n,t);else e(i,t)}});const wz=new Map,Kst=eh.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:KA.submenusContribution});Kst.setHandler(s=>{wz.clear();for(const e of s){const{value:t,collector:i}=e;for(const[,n]of Object.entries(t)){if(!KA.isValidSubmenu(n,i))continue;if(!n.id){i.warn(g(8649,"`{0}` is not a valid submenu identifier",n.id));continue}if(wz.has(n.id)){i.info(g(8650,"The `{0}` submenu was already previously registered.",n.id));continue}if(!n.label){i.warn(g(8651,"`{0}` is not a valid submenu label",n.label));continue}let o;n.icon&&(typeof n.icon=="string"?o=We.fromString(n.icon)||{dark:Pt(e.description.extensionLocation,n.icon)}:o={dark:Pt(e.description.extensionLocation,n.icon.dark),light:Pt(e.description.extensionLocation,n.icon.light)});const r={id:_e.for(`api:${n.id}`),label:n.label,icon:o};wz.set(n.id,r)}}});const WZt=new Map($st.map(s=>[s.key,s])),p9e=new Z,Kue=new Map,HZt=eh.registerExtensionPoint({extensionPoint:"menus",jsonSchema:KA.menusContribution,deps:[Kst]});HZt.setHandler(s=>{p9e.clear(),Kue.clear();for(const e of s){const{value:t,collector:i}=e;for(const n of Object.entries(t)){if(!KA.isValidItems(n[1],i))continue;let o=WZt.get(n[0]);if(!o){const r=wz.get(n[0]);r&&(o={key:n[0],id:r.id,description:""})}if(o){if(o.proposed&&!dl(e.description,o.proposed)){i.error(g(8652,`{0} is a proposed menu identifier. It requires 'package.json#enabledApiProposals: ["{1}"]' and is only available when running out of dev or with the following command line switch: --enable-proposed-api {2}`,n[0],o.proposed,e.description.identifier.value));continue}for(const r of n[1]){let a;if(KA.isMenuItem(r)){const c=jn.getCommand(r.command),l=r.alt&&jn.getCommand(r.alt)||void 0;if(!c){i.error(g(8653,"Menu item references a command `{0}` which is not defined in the 'commands' section.",r.command));continue}r.alt&&!l&&i.warn(g(8654,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",r.alt)),r.command===r.alt&&i.info(g(8655,"Menu item references the same command as default and alt-command")),a={command:c,alt:l,group:void 0,order:void 0,when:void 0}}else{if(o.supportsSubmenus===!1){i.error(g(8656,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const c=wz.get(r.submenu);if(!c){i.error(g(8657,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",r.submenu));continue}let l=Kue.get(o.id.id);if(l||(l=new Set,Kue.set(o.id.id,l)),l.has(c.id.id)){i.warn(g(8658,"The `{0}` submenu was already contributed to the `{1}` menu.",r.submenu,n[0]));continue}l.add(c.id.id),a={submenu:c.id,icon:c.icon,title:c.label,group:void 0,order:void 0,when:void 0}}if(r.group){const c=r.group.lastIndexOf("@");c>0?(a.group=r.group.substr(0,c),a.order=Number(r.group.substr(c+1))||void 0):a.group=r.group}a.when=he.deserialize(r.when),p9e.add(jn.appendMenuItem(o.id,a))}}}}});let _ke=class extends V{constructor(e){super(),this._keybindingService=e,this.type="table"}shouldRender(e){return!!e.contributes?.commands}render(e){const i=(e.contributes?.commands||[]).map(l=>({id:l.command,title:l.title,keybindings:[],menus:[]})),n=O1e(i,l=>l.id),o=e.contributes?.menus||{};for(const l in o)for(const d of o[l])if(d.command){let h=n[d.command];h?h.menus.push(l):(h={id:d.command,title:"",keybindings:[],menus:[l]},n[h.id]=h,i.push(h))}if((e.contributes?.keybindings?Array.isArray(e.contributes.keybindings)?e.contributes.keybindings:[e.contributes.keybindings]:[]).forEach(l=>{const d=this.resolveKeybinding(l);if(!d)return;let h=n[l.command];h?h.keybindings.push(d):(h={id:l.command,title:"",keybindings:[d],menus:[]},n[h.id]=h,i.push(h))}),!i.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const a=[g(8659,"ID"),g(8660,"Title"),g(8661,"Keyboard Shortcuts"),g(8662,"Menu Contexts")],c=i.sort((l,d)=>l.id.localeCompare(d.id)).map(l=>[new Mt().appendMarkdown(`\`${l.id}\``),typeof l.title=="string"?l.title:l.title.value,l.keybindings,new Mt().appendMarkdown(`${l.menus.map(d=>`\`${d}\``).join(" ")}`)]);return{data:{headers:a,rows:c},dispose:()=>{}}}resolveKeybinding(e){let t;switch(cGe){case"win32":t=e.win;break;case"linux":t=e.linux;break;case"darwin":t=e.mac;break}return this._keybindingService.resolveUserBinding(t??e.key)[0]}};_ke=D([_(0,Ut)],_ke);Qe.as(J_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:g(8663,"Commands"),access:{canToggle:!1},renderer:new wi(_ke)});class qst{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${UZt(i+",",25)} "command": `);const n=t.when?JSON.stringify(t.when.serialize()):"",o=JSON.stringify(t.command);n.length>0?(e.write(`${o},`),e.writeLine(),e.write(` "when": ${n}`)):e.write(`${o}`),t.commandArgs&&(e.write(","),e.writeLine(),e.write(` "args": ${JSON.stringify(t.commandArgs)}`)),e.write(" }")}static readUserKeybindingItem(e){const t="key"in e&&typeof e.key=="string"?X$.parseKeybinding(e.key):null,i="when"in e&&typeof e.when=="string"?he.deserialize(e.when):void 0,n="command"in e&&typeof e.command=="string"?e.command:null,o="args"in e&&typeof e.args<"u"?e.args:void 0;return{keybinding:t,command:n,commandArgs:o,when:i,_sourceKey:"key"in e&&typeof e.key=="string"?e.key:void 0}}}function UZt(s,e){return s.length{this._keyboardMapper=this.keyboardLayoutService.getKeyboardMapper(),this.updateResolver()})),this._keybindingHoldMode=null,this._cachedResolver=null,this.userKeybindings=this._register(new GZt(o,l,c,d)),this.userKeybindings.initialize().then(()=>{this.userKeybindings.keybindings.length&&this.updateResolver()}),this._register(this.userKeybindings.onDidChange(()=>{d.debug("User keybindings changed"),this.updateResolver()})),_9e.setHandler(u=>{const f=[];for(const p of u)this._handleKeybindingsExtensionPointUser(p.description.identifier,p.description.isBuiltin,p.value,p.collector,f);So.setExtensionKeybindings(f),this.updateResolver()}),this.updateKeybindingsJsonSchema(),this._register(a.onDidRegisterExtensions(()=>this.updateKeybindingsJsonSchema())),this._register(M.runAndSubscribe(tm,({window:u,disposables:f})=>f.add(this._registerKeyListeners(u)),{window:si,disposables:this._store})),this._register(vGe(u=>{if(u!==si.vscodeWindowId)return;const f=navigator.keyboard;kO.keyboard!==Zx.None&&(rpe(si)?f?.lock(["Escape"]):f?.unlock(),this._cachedResolver=null,this._onDidUpdateKeybindings.fire())}))}_registerKeyListeners(e){const t=new Z;return t.add(ue(e,ke.KEY_DOWN,i=>{if(this._keybindingHoldMode)return;this.isComposingGlobalContextKey.set(i.isComposing);const n=new En(i);this._log(`/ Received keydown event - ${hlt(i)}`),this._log(`| Converted keydown event - ${ult(n)}`),this._dispatch(n,n.target)&&n.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t.add(ue(e,ke.KEY_UP,i=>{this._resetKeybindingHoldMode(),this.isComposingGlobalContextKey.set(i.isComposing);const n=new En(i);this._singleModifierDispatch(n,n.target)&&n.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t}registerSchemaContribution(e){this._contributions.push(e),e.onDidChange&&this._register(e.onDidChange(()=>this.updateKeybindingsJsonSchema())),this.updateKeybindingsJsonSchema()}updateKeybindingsJsonSchema(){this.kbsJsonSchema.updateSchema(this._contributions.flatMap(e=>e.getSchemaAdditions()))}_printKeybinding(e){return FLe.toLabel(po,e.chords,t=>t instanceof Ih?Ia.toString(t.keyCode):Vp.toString(t.scanCode))||"[null]"}_printResolvedKeybinding(e){return e.getDispatchChords().map(t=>t||"[null]").join(" ")}_printResolvedKeybindings(e,t,i){const o=`${t.padStart(35," ")} => `;if(i.length===0){e.push(`${o}${"[NO BINDING]".padStart(35," ")}`);return}for(const r of i)e.push(`${o}${this._printResolvedKeybinding(r).padStart(35," ")}`)}_dumpResolveKeybindingDebugInfo(){const e=new Set,t=[];t.push("Default Resolved Keybindings (unique only):");for(const i of So.getDefaultKeybindings()){if(!i.keybinding)continue;const n=this._printKeybinding(i.keybinding);if(e.has(n))continue;e.add(n);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,o)}t.push("User Resolved Keybindings (unique only):");for(const i of this.userKeybindings.keybindings){if(!i.keybinding)continue;const n=i._sourceKey??"Impossible: missing source key, but has keybinding";if(e.has(n))continue;e.add(n);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,o)}return t.join(` +`}getOS(e){let t=po;const i=this.environmentService.remoteAuthority;if(i&&e&&e.scheme!==pe.file){const n=`resource.authority.os.${i}`;t=this.remoteEnvironment?this.remoteEnvironment.os:this.storageService.getNumber(n,Ie.WORKSPACE,po),this.storageService.store(n,t,Ie.WORKSPACE,an.MACHINE)}return t}};QDe=D([_(0,Te),_(1,cg),_(2,Jr),_(3,$i)],QDe);let jDe=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v){super(),this.jsonEditingService=e,this.contextService=t,this.configurationService=i,this.notificationService=n,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=[pe.file];this.environmentService.remoteAuthority&&e.unshift(pe.vscodeRemote);let t=await this.fileDialogService.showSaveDialog({saveLabel:rMe(g(3657,"Save")),title:g(3658,"Save Workspace"),filters:qSt,defaultUri:Pt(await this.fileDialogService.defaultWorkspacePath(),this.getNewWorkspaceName()),availableFileSystems:e});if(t)return uae(t)||(t=t.with({path:`${t.path}.${Sb}`})),t}getNewWorkspaceName(){const e=this.getCurrentWorkspaceIdentifier()?.configPath;if(e&&Gme(e,this.environmentService))return _i(e);const t=rm(this.contextService.getWorkspace().folders);return t?`${_i(t.uri)}.${Sb}`:`workspace.${Sb}`}async updateFolders(e,t,i,n){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:TFe(d.uri),name:d.name})));const c=r.length>0,l=a.length>0;if(!(!l&&!c))return l&&!c?this.doAddFolders(a,e,n):c&&!l?this.removeFolders(r):this.includesSingleFolderWorkspace(r)?this.createAndEnterWorkspace(a):this.contextService.getWorkbenchState()!==qi.WORKSPACE?this.doAddFolders(a,e,n):this.doUpdateFolders(a,r,e,n)}async doUpdateFolders(e,t,i,n=!1){try{await this.contextService.updateFolders(e,t,i)}catch(o){if(n)throw o;this.handleWorkspaceConfigurationEditingError(o)}}addFolders(e,t=!1){const i=e.map(n=>({uri:TFe(n.uri),name:n.name}));return this.doAddFolders(i,void 0,t)}async doAddFolders(e,t,i=!1){const n=this.contextService.getWorkbenchState();if(n!==qi.WORKSPACE){let o=this.contextService.getWorkspace().folders.map(r=>({uri:r.uri}));return o.splice(typeof t=="number"?t:o.length,0,...e),o=ja(o,r=>this.uriIdentityService.extUri.getComparisonKey(r.uri)),n===qi.EMPTY&&o.length===0||n===qi.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()===qi.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,n=await this.workspacesService.createUntitledWorkspace(e,i);if(t)try{await this.saveWorkspaceAs(n,t)}finally{await this.workspacesService.deleteUntitledWorkspace(n)}else t=n.configPath,this.userDataProfileService.currentProfile.isDefault||await this.userDataProfilesService.setProfileForWorkspace(n,this.userDataProfileService.currentProfile);return this.enterWorkspace(t)}async saveAndEnterWorkspace(e){const t=this.getCurrentWorkspaceIdentifier();if(t){if(ji(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(!d3(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=d3(i,this.environmentService),r=await this.fileService.readFile(i),a=j3e(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:Cn.EXPLICIT});return}if(await this.fileService.exists(t))return;const r=j3e(JSON.stringify({folders:[]},null," "),t,!1,t,this.uriIdentityService.extUri);await this.textFileService.create([{resource:t,value:r}])}handleWorkspaceConfigurationEditingError(e){switch(e.code){case W$.ERROR_INVALID_FILE:this.onInvalidWorkspaceConfigurationFileError();break;default:this.notificationService.error(e.message)}}onInvalidWorkspaceConfigurationFileError(){const e=g(3659,"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(Xe.Error,e,[{label:g(3660,"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()===qi.FOLDER&&await this.migrateWorkspaceSettings(t),await this.configurationService.initialize(t),this.workspacesService.enterWorkspace(e)}migrateWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e,t=>t.scope===at.WINDOW)}copyWorkspaceSettings(e){return this.doCopyWorkspaceSettings(e)}doCopyWorkspaceSettings(e,t){const i=Qe.as(Nn.Configuration).getConfigurationProperties(),n={};for(const o of this.configurationService.keys().workspace)if(i[o]){if(t&&!t(i[o]))continue;n[o]=this.configurationService.inspect(o).workspaceValue}return this.jsonEditingService.write(e.configPath,[{path:["settings"],value:n}],!0)}async trustWorkspaceConfiguration(e){this.contextService.getWorkbenchState()!==qi.EMPTY&&this.workspaceTrustManagementService.isWorkspaceTrusted()&&await this.workspaceTrustManagementService.setUrisTrust([e],!0)}getCurrentWorkspaceIdentifier(){const e=UO(this.contextService.getWorkspace());if(tA(e))return e}};jDe=D([_(0,yI),_(1,yi),_(2,Tst),_(3,bi),_(4,vi),_(5,Jt),_(6,Fo),_(7,wI),_(8,Jr),_(9,sg),_(10,to),_(11,xc),_(12,ks),_(13,cC),_(14,Cm),_(15,lg)],jDe);var $P,ZR;let YDe=(ZR=class extends V{constructor(e,t,i,n,o,r){super(),this.storageService=e,this.contextService=t,this.logService=i,this.fileService=n,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(Ie.APPLICATION,$P.RECENTLY_OPENED_KEY,this._register(new Z))(()=>this._onRecentlyOpenedChange.fire())),this._register(this.contextService.onDidChangeWorkspaceFolders(e=>this.onDidChangeWorkspaceFolders(e)))}onDidChangeWorkspaceFolders(e){if(Ry(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 qi.FOLDER:this.addRecentlyOpened([{folderUri:e.folders[0].uri,remoteAuthority:t}]);break;case qi.WORKSPACE:this.addRecentlyOpened([{workspace:{id:e.id,configPath:e.configuration},remoteAuthority:t}]);break}}async getRecentlyOpened(){const e=this.storageService.get($P.RECENTLY_OPENED_KEY,Ie.APPLICATION);if(e){const t=tZt(JSON.parse(e),this.logService);return t.workspaces=t.workspaces.filter(i=>!(uj(i)&&i.folderUri.scheme===pe.file&&!Ry(this.contextService.getWorkspace())||jXt(i)&&Ry(i.workspace.configPath))),t}return{workspaces:[],files:[]}}async addRecentlyOpened(e){const t=await this.getRecentlyOpened();for(const i of e)YXt(i)?(this.doRemoveRecentlyOpened(t,[i.fileUri]),t.files.unshift(i)):uj(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(n=>n.toString()===i.fileUri.toString())),e.workspaces=e.workspaces.filter(i=>!t.some(n=>n.toString()===(uj(i)?i.folderUri.toString():i.workspace.configPath.toString())))}async saveRecentlyOpened(e){return this.storageService.store($P.RECENTLY_OPENED_KEY,JSON.stringify(iZt(e)),Ie.APPLICATION,an.USER)}async clearRecentlyOpened(){this.storageService.remove($P.RECENTLY_OPENED_KEY,Ie.APPLICATION)}async enterWorkspace(e){return{workspace:await this.getWorkspaceIdentifier(e)}}async createUntitledWorkspace(e,t){const i=(Date.now()+Math.round(Math.random()*1e3)).toString(),n=Pt(this.environmentService.untitledWorkspacesHome,`Untitled-${i}.${Sb}`),o=[];if(e)for(const a of e)o.push(fPe(a.uri,!0,a.name,this.environmentService.untitledWorkspacesHome,this.uriIdentityService.extUri));const r={folders:o,remoteAuthority:t};return await this.fileService.writeFile(n,$e.fromString(JSON.stringify(r,null," "))),this.getWorkspaceIdentifier(n)}async deleteUntitledWorkspace(e){try{await this.fileService.del(e.configPath)}catch(t){if(t.fileOperationResult!==Qi.FILE_NOT_FOUND)throw t}}async getWorkspaceIdentifier(e){return ZMe(e)}async getDirtyWorkspaces(){return[]}},$P=ZR,ZR.RECENTLY_OPENED_KEY="recently.opened",ZR);YDe=$P=D([_(0,$i),_(1,yi),_(2,Ge),_(3,Jt),_(4,Jr),_(5,ks)],YDe);var Ur;(function(s){s.Unknown="unknown",s.Env="env",s.Config="config",s.Command="command",s.Input="input",s.ExtensionInstallFolder="extensionInstallFolder",s.WorkspaceFolder="workspaceFolder",s.Cwd="cwd",s.WorkspaceFolderBasename="workspaceFolderBasename",s.UserHome="userHome",s.LineNumber="lineNumber",s.SelectedText="selectedText",s.File="file",s.FileWorkspaceFolder="fileWorkspaceFolder",s.FileWorkspaceFolderBasename="fileWorkspaceFolderBasename",s.RelativeFile="relativeFile",s.RelativeFileDirname="relativeFileDirname",s.FileDirname="fileDirname",s.FileExtname="fileExtname",s.FileBasename="fileBasename",s.FileBasenameNoExtension="fileBasenameNoExtension",s.FileDirnameBasename="fileDirnameBasename",s.ExecPath="execPath",s.ExecInstallFolder="execInstallFolder",s.PathSeparator="pathSeparator",s.PathSeparatorAlias="/"})(Ur||(Ur={}));class mg extends Error{constructor(e,t){super(t),this.variable=e}}const m1=class m1{constructor(e,t,i,n){this._contributedVariables=new Map,this._context=e,this._labelService=t,this._userHomePromise=i,n&&(this._envVariablesPromise=n.then(o=>this.prepareEnv(o)))}prepareEnv(e){if(Qn){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,n){const o=xs(t);Qn&&o.windows?Object.keys(o.windows).forEach(a=>o[a]=o.windows[a]):Qt&&o.osx?Object.keys(o.osx).forEach(a=>o[a]=o.osx[a]):pr&&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,n)}async resolveAnyAsync(e,t,i){return this.resolveAnyBase(e,t,i)}async resolveAnyMap(e,t,i){const n=new Map;return{newConfig:await this.resolveAnyBase(e,t,i,n),resolvedVariables:n}}resolveWithInteractionReplace(e,t,i,n){throw new Error("resolveWithInteractionReplace not implemented.")}resolveWithInteraction(e,t,i,n){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,n,o){if(Lt(i))return this.resolveString(e,t,i,n,o);if(Array.isArray(i))return Promise.all(i.map(r=>this.recursiveResolve(e,t,r,n,o)));if(kn(i)){const r=Object.create(null),a=await Promise.all(Object.keys(i).map(async c=>[await this.resolveString(e,t,c,n,o),await this.recursiveResolve(e,t,i[c],n,o)]));for(const[c,l]of a)r[c]=l;return r}return i}resolveString(e,t,i,n,o){return tat(i,m1.VARIABLE_REGEXP,async(r,a)=>{if(a.includes(m1.VARIABLE_LHS))return r;let c=await this.evaluateSingleVariable(e,r,a,t,n);return o?.set(a,c),c!==r&&Lt(c)&&c.match(m1.VARIABLE_REGEXP)&&(c=await this.resolveString(e,t,c,n,o)),c})}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,i,n,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 zw(u);throw new mg(h,g(4048,"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 zw(f)}throw new mg(h,g(4049,"Variable {0}: can not find workspace folder of '{1}'.",t,Ko(u)))},d=h=>{if(r){const u=this._context.getFolderUri(r);if(u)return u;throw new mg(h,g(4050,"Variable {0} can not be resolved. No such folder '{1}'.",t,r))}if(n)return n;throw this._context.getWorkspaceFolderCount()>1?new mg(h,g(4051,"Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.",t)):new mg(h,g(4052,"Variable {0} can not be resolved. Please open a folder.",t))};switch(i){case"env":if(r){if(e.env){const h=e.env[Qn?r.toLowerCase():r];if(Lt(h))return h}return""}throw new mg(Ur.Env,g(4053,"Variable {0} can not be resolved because no environment variable name is given.",t));case"config":if(r){const h=this._context.getConfigurationValue(n,r);if(ra(h))throw new mg(Ur.Config,g(4054,"Variable {0} can not be resolved because setting '{1}' not found.",t,r));if(kn(h))throw new mg(Ur.Config,g(4055,"Variable {0} can not be resolved because '{1}' is a structured value.",t,r));return h}throw new mg(Ur.Config,g(4056,"Variable {0} can not be resolved because no settings name is given.",t));case"command":return this.resolveFromMap(Ur.Command,t,r,o,"command");case"input":return this.resolveFromMap(Ur.Input,t,r,o,"input");case"extensionInstallFolder":if(r){const h=await this._context.getExtension(r);if(!h)throw new mg(Ur.ExtensionInstallFolder,g(4057,"Variable {0} can not be resolved because the extension {1} is not installed.",t,r));return this.fsPath(h.extensionLocation)}throw new mg(Ur.ExtensionInstallFolder,g(4058,"Variable {0} can not be resolved because no extension name is given.",t));default:switch(i){case"workspaceRoot":case"workspaceFolder":return zw(this.fsPath(d(Ur.WorkspaceFolder)));case"cwd":return n||r?zw(this.fsPath(d(Ur.Cwd))):C2();case"workspaceRootFolderName":case"workspaceFolderBasename":return zw(Ko(this.fsPath(d(Ur.WorkspaceFolderBasename))));case"userHome":{if(e.userHome)return e.userHome;throw new mg(Ur.UserHome,g(4059,"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 mg(Ur.LineNumber,g(4060,"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 mg(Ur.SelectedText,g(4061,"Variable {0} can not be resolved. Make sure to have some text selected in the active editor.",t))}case"file":return c(Ur.File);case"fileWorkspaceFolder":return l(Ur.FileWorkspaceFolder);case"fileWorkspaceFolderBasename":return Ko(l(Ur.FileWorkspaceFolderBasename));case"relativeFile":return n||r?A2(this.fsPath(d(Ur.RelativeFile)),c(Ur.RelativeFile)):c(Ur.RelativeFile);case"relativeFileDirname":{const h=bb(c(Ur.RelativeFileDirname));if(n||r){const u=A2(this.fsPath(d(Ur.RelativeFileDirname)),h);return u.length===0?".":u}return h}case"fileDirname":return bb(c(Ur.FileDirname));case"fileExtname":return Vy(c(Ur.FileExtname));case"fileBasename":return Ko(c(Ur.FileBasename));case"fileBasenameNoExtension":{const h=Ko(c(Ur.FileBasenameNoExtension));return h.slice(0,h.length-Vy(h).length)}case"fileDirnameBasename":return Ko(bb(c(Ur.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 su;default:try{const h=r?`${i}:${r}`:i;return this.resolveFromMap(Ur.Unknown,t,h,o,void 0)}catch{return t}}}}resolveFromMap(e,t,i,n,o){if(i&&n){const r=o===void 0?n[i]:n[o+":"+i];if(typeof r=="string")return r;throw new mg(e,g(4062,"Variable {0} can not be resolved because the command has no value.",t))}return t}};m1.VARIABLE_LHS="${",m1.VARIABLE_REGEXP=/\$\{(.*?)\}/g;let qie=m1;const Xoe=class Xoe extends qie{constructor(e,t,i,n,o,r,a,c,l,d){super({getFolderUri:h=>{const u=r.getWorkspace().folders.filter(f=>f.name===h).pop();return u?u.uri:void 0},getWorkspaceFolderCount:()=>r.getWorkspace().folders.length,getConfigurationValue:(h,u)=>n.getValue(u,h?{resource:h}:{}),getAppRoot:()=>e.getAppRoot(),getExecPath:()=>e.getExecPath(),getFilePath:()=>{const h=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(h)return this.labelService.getUriLabel(h,{noPrefix:!0})},getWorkspaceFolderPathForFile:()=>{const h=Na.getOriginalUri(i.activeEditor,{supportSideBySide:Hs.PRIMARY,filterByScheme:[pe.file,pe.vscodeUserData,this.pathService.defaultUriScheme]});if(!h)return;const u=r.getWorkspaceFolder(h);if(u)return this.labelService.getUriLabel(u.uri,{noPrefix:!0})},getSelectedText:()=>{const h=i.activeTextEditorControl;let u=null;if(Qr(h))u=h;else if(Zp(h)){const m=h.getOriginalEditor(),v=h.getModifiedEditor();u=m.hasWidgetFocus()?m:v}const f=u?.getModel(),p=u?.getSelection();if(f&&p)return f.getValueInRange(p)},getLineNumber:()=>{const h=i.activeTextEditorControl;if(Qr(h)){const u=h.getSelection();if(u){const f=u.positionLineNumber;return String(f)}}},getExtension:h=>d.getExtension(h)},c,l.userHome().then(h=>h.path),t),this.configurationService=n,this.commandService=o,this.workspaceContextService=r,this.quickInputService=a,this.labelService=c,this.pathService=l,this.userInputAccessQueue=new gI}async resolveWithInteractionReplace(e,t,i,n,o){return t=await this.resolveAnyAsync(e,t),this.resolveWithInteraction(e,t,i,n,o).then(r=>r?r.size>0?this.resolveAnyAsync(e,t,Object.fromEntries(r)):t:null)}async resolveWithInteraction(e,t,i,n,o){const r=await this.resolveAnyMap(e,t);t=r.newConfig;const a=r.resolvedVariables;return this.resolveWithInputAndCommands(e,t,n,i,o).then(c=>{if(this.updateMapping(c,a))return a})}updateMapping(e,t){if(!e)return!1;for(const[i,n]of Object.entries(e))t.set(i,n);return!0}async resolveWithInputAndCommands(e,t,i,n,o){if(!t)return Promise.resolve(void 0);let r=[];if(this.workspaceContextService.getWorkbenchState()!==qi.EMPTY&&n){const l=e?{resource:e.uri}:{},d=this.configurationService.inspect(n,l);if(d&&(d.userValue||d.workspaceValue||d.workspaceFolderValue))switch(o){case St.USER:r=d.userValue?.inputs;break;case St.WORKSPACE:r=d.workspaceValue?.inputs;break;default:r=d.workspaceFolderValue?.inputs}else{const h=this.configurationService.getValue(n,l);h&&(r=h.inputs)}}const a=[];this.findVariables(t,a);const c=Object.create(null);for(const l of a){const[d,h]=l.split(":",2);let u;switch(d){case"input":u=await this.showUserInput(h,r);break;case"command":{const f=(i?i[h]:void 0)||h;if(u=await this.commandService.executeCommand(f,t),typeof u!="string"&&!ra(u))throw new Error(g(8787,"Cannot substitute command variable '{0}' because command did not return a result of type string.",f));break}default:this._contributedVariables.has(l)&&(u=await this._contributedVariables.get(l)())}if(typeof u=="string")c[l]=u;else return}return c}findVariables(e,t){if(typeof e=="string"){let i;for(;(i=Xoe.INPUT_OR_COMMAND_VARIABLES_PATTERN.exec(e))!==null;)if(i.length===4){const n=i[1];t.indexOf(n)<0&&t.push(n)}for(const n of this._contributedVariables.keys())t.indexOf(n)<0&&e.indexOf("${"+n+"}")>=0&&t.push(n)}else if(Array.isArray(e))for(const i of e)this.findVariables(i,t);else if(e)for(const i of Object.values(e))this.findVariables(i,t)}showUserInput(e,t){if(!t)return Promise.reject(new Error(g(8788,"Variable '{0}' must be defined in an '{1}' section of the debug or task configuration.",e,"inputs")));const i=t.filter(n=>n.id===e).pop();if(i){const n=o=>{throw new Error(g(8789,"Input variable '{0}' is of type '{1}' and must include '{2}'.",e,i.type,o))};switch(i.type){case"promptString":{Lt(i.description)||n("description");const o={prompt:i.description,ignoreFocusLost:!0};return i.default&&(o.value=i.default),i.password&&(o.password=i.password),this.userInputAccessQueue.queue(()=>this.quickInputService.input(o)).then(r=>r)}case"pickString":{if(Lt(i.description)||n("description"),Array.isArray(i.options))for(const a of i.options)!Lt(a)&&!Lt(a.value)&&n("value");else n("options");const o=new Array;for(const a of i.options){const c=Lt(a)?a:a.value,l=Lt(a)?void 0:a.label,d={label:l?`${l}: ${c}`:c,value:c};c===i.default?(d.description=g(8790,"(Default)"),o.unshift(d)):o.push(d)}const r={placeHolder:i.description,matchOnDetail:!0,ignoreFocusLost:!0};return this.userInputAccessQueue.queue(()=>this.quickInputService.pick(o,r,void 0)).then(a=>{if(a)return a.value})}case"command":return Lt(i.command)||n("command"),this.userInputAccessQueue.queue(()=>this.commandService.executeCommand(i.command,i.args)).then(o=>{if(typeof o=="string"||ra(o))return o;throw new Error(g(8791,"Cannot substitute input variable '{0}' because command '{1}' did not return a result of type string.",e,i.command))});default:throw new Error(g(8792,"Input variable '{0}' can only be of type 'promptString', 'pickString', or 'command'.",e))}}return Promise.reject(new Error(g(8793,"Undefined input variable '{0}' encountered. Remove or define '{0}' to continue.",e)))}};Xoe.INPUT_OR_COMMAND_VARIABLES_PATTERN=/\${((input|command):(.*?))}/g;let JDe=Xoe,XDe=class extends JDe{constructor(e,t,i,n,o,r,a,c){super({getAppRoot:()=>{},getExecPath:()=>{}},Promise.resolve(Object.create(null)),e,t,i,n,o,r,a,c)}};XDe=D([_(0,ei),_(1,Te),_(2,vi),_(3,yi),_(4,In),_(5,Fs),_(6,mf),_(7,fs)],XDe);function pZt(){throw new Error("unsupported")}function mZt(s){let e=null;return(...t)=>(e==null&&(e=s(...t)),e)}function _Zt(s){return new Proxy(s,{construct:mZt((e,t)=>Reflect.construct(s,t))})}N.from({scheme:pe.vscodeUserData,path:"/User/settings.json"});Qe.as(Nn.Configuration);let ZDe=class extends hZt{constructor(e,t,i,n,o,r,a,c){const l=new gZt([pe.file,pe.vscodeUserData,pe.tmp],e,n);super({configurationCache:l},e,t,i,n,o,r,a,c)}};ZDe=D([_(0,Jr),_(1,lg),_(2,Cm),_(3,Jt),_(4,cg),_(5,ks),_(6,Ge),_(7,aRe)],ZDe);class vZt extends jDe{constructor(){super(...arguments),this.enterWorkspace=pZt}}let Rst;nNe(async s=>{const e=s.get(yi);e.acquireInstantiationService(s.get(we));const t=Rst??tNe();if(N.isUri(t)){const i=t.with({path:"/workspace.code-workspace"});try{const n=s.get(Jt);await n.createFolder(t),await n.writeFile(i,$e.fromString(JSON.stringify({folders:[{path:t.path}]})))}catch{}await e.initialize({id:ar(),configPath:i})}else await e.initialize(t)});const X3e=_Zt(ZDe);function bZt(s){return Rst=s,{...kce(),[Te.toString()]:new wi(X3e,[],!0),[yi.toString()]:new wi(X3e,[],!0),[Ec.toString()]:new wi(VDe,[],!0),[Zy.toString()]:new wi(vZt,[],!0),[wI.toString()]:new wi(YDe,[],!0),[dTe.toString()]:new wi(QDe,[],!0),[qRe.toString()]:new wi(XDe,[],!0)}}let eke=class extends AY{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(Qr(e))return e;if(Zp(e))return e.getModifiedEditor();const t=this.editorService.activeEditorPane?.getControl();return P2(t)&&Qr(t.activeCodeEditor)?t.activeCodeEditor:null}async doOpenCodeEditorFromDiff(e,t,i){const n=this.editorService.activeTextEditorControl;if(!i&&Zp(n)&&e.options&&e.resource&&t===n.getModifiedEditor()&&n.getModel()&&ji(e.resource,n.getModel()?.modified.uri)){const o=n.getModifiedEditor();return IZ(e.options,o,mt.Smooth),o}return null}async doOpenCodeEditor(e,t,i){if(!this.configurationService.getValue().workbench?.editor?.enablePreviewFromCodeNavigation&&t&&!e.options?.pinned&&!i&&!ji(t.getModel()?.uri,e.resource)){for(const r of this.editorService.visibleEditorPanes)if(e6(r.getControl())===t){r.group.pinEditor();break}}const o=await this.editorService.openEditor(e,i?J_:dA);if(o){const r=o.getControl();if(Qr(r))return r;if(P2(r)&&Qr(r.activeCodeEditor))return r.activeCodeEditor}return null}};eke=D([_(0,ei),_(1,pn),_(2,Te)],eke);let tke=class extends V{constructor(e,t,i,n,o){super(),this.untitledTextEditorService=e,this.instantiationService=t,this.uriIdentityService=i,this.fileService=n,this.editorResolverService=o,this.editorInputCache=new ui,this.fileEditorFactory=Qe.as(Xy.EditorFactory).getFileEditorFactory(),this.registerDefaultEditor()}registerDefaultEditor(){this._register(this.editorResolverService.registerEditor("*",{id:nm.id,label:nm.displayName,detail:nm.providerDisplayName,priority:h$.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(_b(e))return this.createTextEditor(e.result);if(C_(e)){const n=this.createTextEditor(e.original),o=this.createTextEditor(e.modified);return this.instantiationService.createInstance($g,e.label,e.description,n,o,void 0)}if(DS(e)){const n=this.createTextEditor(e.primary),o=this.createTextEditor(e.secondary);return this.instantiationService.createInstance(ip,e.label,e.description,o,n)}const t=e;if(t.forceUntitled||!t.resource||t.resource.scheme===pe.untitled){const n={languageId:t.languageId,initialValue:t.contents,encoding:t.encoding};let o;return t.resource?.scheme===pe.untitled?o=this.untitledTextEditorService.create({untitledResource:t.resource,...n}):o=this.untitledTextEditorService.create({associatedResource:t.resource,...n}),this.createOrGetCached(o.resource,()=>this.instantiationService.createInstance(w9,o))}const i=e;if(i.resource instanceof N){const n=i.label||_i(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(IT,r,i.label,i.description,i.languageId,i.contents),a=>{a instanceof w9||(a instanceof IT?(n&&a.setName(n),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 n=this.editorInputCache.get(e);return n?(i?.(n),n):(n=t(),this.editorInputCache.set(e,n),M.once(n.onWillDispose)(()=>this.editorInputCache.delete(e)),n)}};tke=D([_(0,P6),_(1,we),_(2,ks),_(3,Jt),_(4,MU)],tke);var PV,eM;let ike=(eM=class extends V{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 k6e,this.editorsPerResourceCounter=new ui,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(Xh.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 Do.GROUP_ACTIVE:{this.editorGroupsContainer.activeGroup===e&&e.activeEditor&&this.addMostRecentEditor(e,e.activeEditor,!0,!1);break}case Do.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)})),M.once(e.onWillDispose)(()=>bt(t))}onDidChangeEditorPartOptions(e){if(!Ys(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,n){const o=this.ensureKey(e,t),r=this.mostRecentEditorsMap.first;i||!r?this.mostRecentEditorsMap.set(o,o,r?$l.AsOld:void 0):(this.mostRecentEditorsMap.set(o,o,$l.AsOld),this.mostRecentEditorsMap.set(r,r,$l.AsOld)),n&&this.updateEditorResourcesMap(t,!0),this._onDidMostRecentlyActiveEditorsChange.fire()}updateEditorResourcesMap(e,t){let i,n,o;if(e instanceof ip?(i=e.primary.resource,n=e.primary.typeId,o=e.primary.editorId):(i=e.resource,n=e.typeId,o=e.editorId),!i)return;const r=this.toIdentifier(n,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 n=this.keyMap.get(e.id);n&&n.delete(i.editor)&&n.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 n=i.get(t);return n||(n={groupId:e.id,editor:t},i.set(t,n)),n}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 n=this.editorGroupsContainer.getGroup(t);n&&await this.doEnsureOpenedEditorsLimit(i,n.getEditors(Xh.MOST_RECENTLY_ACTIVE).map(o=>({editor:o,groupId:t})),e)}else for(const n of this.editorGroupsContainer.groups)await this.ensureOpenedEditorsLimit(e,n.id);else await this.doEnsureOpenedEditorsLimit(i,[...this.mostRecentEditorsMap.values()],e)}async doEnsureOpenedEditorsLimit(e,t,i){let n;if(this.editorGroupService.partOptions.limit?.excludeDirty?n=t.filter(({editor:c})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Ei.Scratchpad))):n=t,e>=n.length)return;const o=n.reverse().filter(({editor:c,groupId:l})=>!(c.isDirty()&&!c.isSaving()||c.hasCapability(Ei.Scratchpad)||i&&c===i.editor&&l===i.groupId||this.editorGroupsContainer.getGroup(l)?.isSticky(c)));let r=n.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(PV.STORAGE_KEY,Ie.WORKSPACE):this.storageService.store(PV.STORAGE_KEY,JSON.stringify(this.serialize()),Ie.WORKSPACE,an.MACHINE))}serialize(){const e=Qe.as(Xy.EditorFactory),t=[...this.mostRecentEditorsMap.values()],i=new Map;return{entries:Fi(t.map(({editor:n,groupId:o})=>{const r=this.editorGroupsContainer.getGroup(o);if(!r)return;let a=i.get(r);a||(a=r.getEditors(Xh.SEQUENTIAL).filter(l=>e.getEditorSerializer(l)?.canSerialize(l)),i.set(r,a));const c=a.indexOf(n);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(PV.STORAGE_KEY,Ie.WORKSPACE);t&&(e=!0,this.deserialize(JSON.parse(t)))}if(!e){const t=this.editorGroupsContainer.getGroups(du.MOST_RECENTLY_ACTIVE);for(let i=t.length-1;i>=0;i--){const n=t[i],o=n.getEditors(Xh.MOST_RECENTLY_ACTIVE);for(let r=o.length-1;r>=0;r--)this.addMostRecentEditor(n,o[r],!0,!0)}}for(const t of this.editorGroupsContainer.groups)this.registerGroupListeners(t)}deserialize(e){const t=[];for(const{groupId:i,index:n}of e.entries){const o=this.editorGroupsContainer.getGroup(i);if(!o)continue;const r=o.getEditorByIndex(n);if(!r)continue;const a=this.ensureKey(o,r);t.push([a,a]),this.updateEditorResourcesMap(r,!0)}this.mostRecentEditorsMap.fromJSON(t)}},PV=eM,eM.STORAGE_KEY="editors.mru",eM);ike=PV=D([_(1,Po),_(2,$i)],ike);function Z3e(s,e,t){const i=s.get(Po),n=s.get(Te),o=wZt(e,t,i,n);return o instanceof Promise?o.then(r=>e9e(r,e,t,i)):e9e(o,e,t,i)}function e9e(s,e,t,i){let n;return i.activeGroup!==s&&e.options&&!e.options.inactive&&e.options.preserveFocus&&typeof e.options.activation!="number"&&t!==J_&&(n=Hk.ACTIVATE),[s,n]}function wZt(s,e,t,i){let n;const o=I5(s)?s.editor:s,r=s.options;if(e&&typeof e!="number")n=e;else if(typeof e=="number"&&e>=0)n=t.getGroup(e);else if(e===J_){const a=OW(i);let c=t.findGroup({direction:a});(!c||HK(c,o))&&(c=t.addGroup(t.activeGroup,a)),n=c}else if(e===M4t)n=t.createAuxiliaryEditorPart().then(a=>a.activeGroup);else if(!r||typeof r.index!="number"){const a=t.getGroups(du.MOST_RECENTLY_ACTIVE);if(r?.revealIfVisible){for(const c of a)if(yZt(c,o)){n=c;break}}if(!n&&(r?.revealIfOpened||i.getValue("workbench.editor.revealIfOpen")||wa(o)&&o.hasCapability(Ei.Singleton))){let c,l;for(const d of a)if(Mst(d,o)&&(l||(l=d),!c&&d.isActive(o)&&(c=d)),l&&c)break;n=c||l}}if(!n){let a=t.activeGroup;if(HK(a,o)){for(const c of t.getGroups(du.MOST_RECENTLY_ACTIVE))if(!HK(c,o)){a=c;break}HK(a,o)?n=t.addGroup(a,OW(i)):n=a}else n=a}return n}function HK(s,e){return!(!s.isLocked||Mst(s,e))}function yZt(s,e){return s.activeEditor?s.activeEditor.matches(e):!1}function Mst(s,e){for(const t of s.editors)if(t.matches(e))return!0;return!1}var nke;let ske=nke=class extends V{constructor(e,t,i,n,o,r,a,c,l,d,h){super(),this.editorGroupService=t,this.instantiationService=i,this.fileService=n,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 ui,this.closeOnFileDelete=!1,this.editorGroupsContainer=e??t,this.editorsObserver=this._register(this.instantiationService.createInstance(ike,this.editorGroupsContainer)),this.onConfigurationUpdated(),this.registerListeners()}createScoped(e,t){return t.add(new nke(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})})),M.once(e.onWillDispose)(()=>{bt(t)})}handleVisibleEditorsChange(){const e=new Ck;for(const t of this.visibleEditors){const i=ja(Fi([Na.getCanonicalUri(t,{supportSideBySide:Hs.PRIMARY}),Na.getCanonicalUri(t,{supportSideBySide:Hs.SECONDARY})]),n=>n.toString());for(const n of i)this.fileService.hasProvider(n)&&!this.contextService.isInsideWorkspace(n)&&e.add(n)}for(const t of this.activeOutOfWorkspaceWatchers.keys())e.has(t)||(bt(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(Ai.MOVE)&&this.handleMovedFile(e.resource,e.target.resource),(e.isOperation(Ai.DELETE)||e.isOperation(Ai.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 n=[];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=pGe(r.path,e.path,this.uriIdentityService.extUri.ignorePathCasing(r));a=Pt(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)};wa(c.editor)?n.push({editor:o,replacement:c.editor,options:{...c.options,...l}}):n.push({editor:o,replacement:{...c.editor,options:{...c.editor.options,...l}}})}n.length&&this.replaceEditors(n,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 n of this.getAllNonDirtyEditors({includeUntitled:!1,supportSideBySide:!0}))(async()=>{const o=n.resource;if(o&&(this.closeOnFileDelete||!t)){if(i&&this.uriIdentityService.extUri.isEqualOrParent(o,i))return;let r=!1;if(e instanceof UY?r=e.contains(o,To.DELETED):r=this.uriIdentityService.extUri.isEqualOrParent(o,e),!r)return;let a=!1;t&&this.fileService.hasProvider(o)&&(await Sr(100),a=await this.fileService.exists(o)),!a&&!n.isDisposed()&&n.dispose()}})()}getAllNonDirtyEditors(e){const t=[];function i(n){n.hasCapability(Ei.Untitled)&&!e.includeUntitled||n.isDirty()||t.push(n)}for(const n of this.editors)e.supportSideBySide&&n instanceof ip?(i(n.primary),i(n.secondary)):i(n);return t}get activeEditorPane(){return this.editorGroupsContainer.activeGroup?.activeEditorPane}get activeTextEditorControl(){const e=this.activeEditorPane;if(e){const t=e.getControl();if(Qr(t)||Zp(t))return t;if(P2(t)&&Qr(t.activeCodeEditor))return t.activeCodeEditor}}get activeTextEditorLanguageId(){let e;const t=this.activeTextEditorControl;return Zp(t)?e=t.getModifiedEditor():e=t,e?.getModel()?.getLanguageId()}get count(){return this.editorsObserver.count}get editors(){return this.getEditors(Xh.SEQUENTIAL).map(({editor:e})=>e)}getEditors(e,t){switch(e){case Xh.MOST_RECENTLY_ACTIVE:return t?.excludeSticky?this.editorsObserver.editors.filter(({groupId:i,editor:n})=>!this.editorGroupsContainer.getGroup(i)?.isSticky(n)):this.editorsObserver.editors;case Xh.SEQUENTIAL:{const i=[];for(const n of this.editorGroupsContainer.getGroups(du.GRID_APPEARANCE))i.push(...n.getEditors(Xh.SEQUENTIAL,t).map(o=>({editor:o,groupId:n.id})));return i}}}get activeEditor(){const e=this.editorGroupsContainer.activeGroup;return e?e.activeEditor??void 0:void 0}get visibleEditorPanes(){return Fi(this.editorGroupsContainer.groups.map(e=>e.activeEditorPane))}get visibleTextEditorControls(){const e=[];for(const t of this.visibleEditorPanes){const i=[];t instanceof KCe?(i.push(t.getPrimaryEditorPane()?.getControl()),i.push(t.getSecondaryEditorPane()?.getControl())):i.push(t.getControl());for(const n of i)(Qr(n)||Zp(n))&&e.push(n)}return e}get visibleEditors(){return Fi(this.editorGroupsContainer.groups.map(e=>e.activeEditor))}async openEditor(e,t,i){let n,o=wa(e)?t:e.options,r;if(ytt(t)&&(i=t),!wa(e)){const a=await this.editorResolverService.resolveEditor(e,i);if(a===sz.ABORT)return;Mhe(a)&&(n=a.editor,o=a.options,r=a.group)}if(n||(n=wa(e)?e:await this.textEditorService.resolveTextEditor(e)),!r){let a;const c=this.instantiationService.invokeFunction(Z3e,{editor:n,options:o},i);c instanceof Promise?[r,a]=await c:[r,a]=c,a&&(o={...o,activation:a})}return r.openEditor(n,o)}async openEditors(e,t,i){if(i?.validateTrust&&!await this.handleWorkspaceTrust(e))return[];const n=new Map;for(const r of e){let a,c;if(!I5(r)){const d=await this.editorResolverService.resolveEditor(r,t);if(d===sz.ABORT)continue;Mhe(d)&&(a=d,c=d.group)}if(a||(a=I5(r)?r:{editor:await this.textEditorService.resolveTextEditor(r),options:r.options}),!c){const d=this.instantiationService.invokeFunction(Z3e,a,t);d instanceof Promise?[c]=await d:[c]=d}let l=n.get(c);l||(l=[],n.set(c,l)),l.push(a)}const o=[];for(const[r,a]of n)o.push(r.openEditors(a));return Fi(await Zs.settled(o))}async handleWorkspaceTrust(e){const{resources:t,diffMode:i,mergeMode:n}=this.extractEditorResources(e);switch(await this.workspaceTrustRequestService.requestOpenFilesTrust(t)){case Pp.Open:return!0;case Pp.OpenInNewWindow:return await this.hostService.openWindow(t.map(r=>({fileUri:r})),{forceNewWindow:!0,diffMode:i,mergeMode:n}),!1;case Pp.Cancel:return!1}}extractEditorResources(e){const t=new Ck;let i=!1,n=!1;for(const o of e)if(I5(o)){const r=Na.getOriginalUri(o.editor,{supportSideBySide:Hs.BOTH});N.isUri(r)?t.add(r):r&&(r.primary&&t.add(r.primary),r.secondary&&t.add(r.secondary),i=o.editor instanceof $g)}else _b(o)&&(N.isUri(o.input1)&&t.add(o.input1.resource),N.isUri(o.input2)&&t.add(o.input2.resource),N.isUri(o.base)&&t.add(o.base.resource),N.isUri(o.result)&&t.add(o.result.resource),n=!0),C_(o)?(N.isUri(o.original.resource)&&t.add(o.original.resource),N.isUri(o.modified.resource)&&t.add(o.modified.resource),i=!0):Gv(o)&&t.add(o.resource);return{resources:Array.from(t.keys()),diffMode:i,mergeMode:n}}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:n,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(n)}for(const[n,o]of i)await n.closeEditors(o,t)}findEditors(e,t,i){const n=N.isUri(e)?e:e.resource,o=N.isUri(e)?void 0:e.typeId;if(t?.supportSideBySide!==Hs.ANY&&t?.supportSideBySide!==Hs.SECONDARY&&!this.editorsObserver.hasEditors(n))return N.isUri(e)||Ya(i)?[]:void 0;if(Ya(i)){const r=[];for(const a of this.editorGroupsContainer.getGroups(du.MOST_RECENTLY_ACTIVE)){const c=[];if(N.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(N.isUri(e))return r?r.findEditors(n,t):[];{if(!r)return;const a=r.findEditors(n,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,n=[];for(const o of e){let r;if(!wa(o.replacement)){const a=await this.editorResolverService.resolveEditor(o.replacement,i);if(a===sz.ABORT)continue;Mhe(a)&&(r={editor:o.editor,replacement:a.editor,options:a.options,forceReplaceDirty:o.forceReplaceDirty})}r||(r={editor:o.editor,replacement:r4e(o)?o.replacement:await this.textEditorService.resolveTextEditor(o.replacement),options:r4e(o)?o.options:o.replacement.options,forceReplaceDirty:o.forceReplaceDirty}),n.push(r)}return i?.replaceEditors(n)}async save(e,t){Array.isArray(e)||(e=[e]);const i=this.getUniqueEditors(e),n=[],o=[];if(t?.saveAs)o.push(...i);else for(const{groupId:a,editor:c}of i)c.hasCapability(Ei.Untitled)?o.push({groupId:a,editor:c}):n.push({groupId:a,editor:c});const r=await Zs.settled(n.map(({groupId:a,editor:c})=>(t?.reason===Cn.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(Ei.Untitled)?this.editorGroupsContainer.groups.map(f=>f.id):[a];for(const f of u)h instanceof Nb?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:Fi(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 Zs.settled(i.map(async({groupId:n,editor:o})=>(this.editorGroupsContainer.getGroup(n)?.pinEditor(o),o.revert(n,t)))),!i.some(({editor:n})=>n.isDirty())}async revertAll(e){return this.revert(this.getAllModifiedEditors(e),e)}getAllModifiedEditors(e){const t=[];for(const i of this.editorGroupsContainer.getGroups(du.MOST_RECENTLY_ACTIVE))for(const n of i.getEditors(Xh.MOST_RECENTLY_ACTIVE))n.isModified()&&((typeof e?.includeUntitled=="boolean"||!e?.includeUntitled?.includeScratchpad)&&n.hasCapability(Ei.Scratchpad)||!e?.includeUntitled&&n.hasCapability(Ei.Untitled)||e?.excludeSticky&&i.isSticky(n)||t.push({groupId:i.id,editor:n}));return t}getUniqueEditors(e){const t=[];for(const{editor:i,groupId:n}of e)t.some(o=>o.editor.matches(i))||t.push({editor:i,groupId:n});return t}dispose(){super.dispose(),this.activeOutOfWorkspaceWatchers.forEach(e=>bt(e)),this.activeOutOfWorkspaceWatchers.clear()}};ske=nke=D([_(1,Po),_(2,we),_(3,Jt),_(4,Te),_(5,yi),_(6,ks),_(7,MU),_(8,fae),_(9,xc),_(10,Yae)],ske);function kt(){throw new Error("unsupported")}var oke;class CZt{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=kt,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.createEditorActions=kt,this.onDidFocus=M.None,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=kt,this.notifyIndexChanged=kt,this.relayout=kt,this.dispose=kt,this.toJSON=kt,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChange=M.None,this.layout=kt,this.onDidModelChange=M.None,this.onWillDispose=M.None,this.onDidActiveEditorChange=M.None,this.onWillCloseEditor=M.None,this.onDidCloseEditor=M.None,this.onWillMoveEditor=M.None,this.onWillOpenEditor=M.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=kt,this.openEditor=kt,this.openEditors=kt,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=kt,this.moveEditors=kt,this.copyEditor=kt,this.copyEditors=kt,this.closeEditor=kt,this.closeEditors=kt,this.closeAllEditors=kt,this.replaceEditors=kt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=kt,this.isLast=kt}get groupsView(){return kt()}notifyLabelChanged(){}get titleHeight(){return kt()}get element(){return kt()}get scopedContextKeyService(){return Dt.get(Le)}focus(){}}const Q$=new CZt;class SZt{constructor(e){this.editor=e,this.onDidChangeControl=M.None,this.onDidChangeSizeConstraints=M.None,this.onDidFocus=M.None,this.onDidBlur=M.None,this.input=void 0,this.options=void 0,this.group=Q$,this.scopedContextKeyService=void 0,this.getViewState=kt,this.isVisible=kt,this.hasFocus=kt,this.getId=kt,this.getTitle=kt,this.focus=kt}get minimumWidth(){return Ix.width}get maximumWidth(){return FJ.width}get minimumHeight(){return Ix.height}get maximumHeight(){return FJ.height}getControl(){return this.editor}}function AZt(s,e,t){async function i(n,o,r){const a=wa(n)?o:n.options;ytt(o)&&(r=o);const c=Gv(n)||wa(n)?n.resource:void 0;if(c==null||!s.canHandleResource(c))return e(n,o,r);let l;if(l=Dt.get(Kt).listCodeEditors().find(h=>h instanceof EM&&h.getModel()!=null&&h.getModel().uri.toString()===c.toString()),l==null){const h=await e(n,o,r);if(h!=null)return h;const u=await s.createModelReference(c);if(l=await t?.(u,a,r===J_),l==null){u.dispose();return}}return a!=null&&IZ(a,l,1),(a?.preserveFocus??!1)||(l.focus(),l.getContainerDomNode().scrollIntoView()),new SZt(l)}return i}let rke=class extends ske{constructor(e,t,i,n,o,r,a,c,l,d,h,u,f){super(void 0,i,n,o,r,a,c,l,d,h,u),this._isEditorPartVisible=t,this.openEditor=AZt(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){const e=Dt.get(Kt).getFocusedCodeEditor();return e!=null&&e instanceof Gk?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return super.openEditor(e,t,i)}};rke=D([_(2,Po),_(3,we),_(4,Jt),_(5,Te),_(6,yi),_(7,ks),_(8,MU),_(9,fae),_(10,xc),_(11,Yae),_(12,fn)],rke);class t9e{constructor(e,t,i){this.editor=e,this.input=t,this.group=i,this.onDidChangeControl=M.None,this.options=void 0,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=0,this.maximumHeight=Number.POSITIVE_INFINITY,this.onDidChangeSizeConstraints=M.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 Qie=oke=class extends V{constructor(e,t,i){super(),this.editor=e,this.scopedContextKeyService=i,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=kt,this.isTransient=()=>!1,this.windowId=si.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=M.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=kt,this.relayout=kt,this.toJSON=kt,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=M.None,this._onDidCloseEditor=new I,this.onDidCloseEditor=this._onDidCloseEditor.event,this.onWillMoveEditor=M.None,this._onWillOpenEditor=new I,this.onWillOpenEditor=this._onWillOpenEditor.event,this.id=--oke.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 IT&&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=kt,this.moveEditors=kt,this.copyEditor=kt,this.copyEditors=kt,this.closeEditor=kt,this.closeEditors=kt,this.closeAllEditors=kt,this.replaceEditors=kt,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=kt,this.isLast=kt;const n=a=>{const c=t.createInstance(IT,a,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:c,groupId:this.id}),this.pane=new t9e(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:aA.UNKNOWN,editor:c.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(a=>{a.oldModelUrl!=null&&o(a.oldModelUrl),a.newModelUrl!=null&&n(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(IT,r.uri,void 0,void 0,void 0,void 0);this.pane=new t9e(e,a,this)}}get groupsView(){return kt()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:M.None}}get titleHeight(){return kt()}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()}};Qie.idCounter=0;Qie=oke=D([_(1,we),_(2,Le)],Qie);let ake=class extends V{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=M.any(this._onDidChangeActiveGroup.event,this.delegate.onDidChangeActiveGroup),this._onDidAddGroup=new I,this.onDidAddGroup=M.any(this._onDidAddGroup.event,this.delegate.onDidAddGroup),this._onDidRemoveGroup=new I,this.onDidRemoveGroup=M.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=n=>[...this.delegate.getGroups(n),...this.additionalGroups],this.getGroup=n=>this.delegate.getGroup(n)??this.additionalGroups.find(o=>o.id===n),this.activateGroup=(...n)=>this.delegate.activateGroup(...n),this.getSize=(...n)=>this.delegate.getSize(...n),this.setSize=(...n)=>this.delegate.setSize(...n),this.arrangeGroups=(...n)=>this.delegate.arrangeGroups(...n),this.applyLayout=(...n)=>this.delegate.applyLayout(...n),this.setGroupOrientation=(...n)=>this.delegate.setGroupOrientation(...n),this.findGroup=(...n)=>this.delegate.findGroup(...n),this.addGroup=(...n)=>this.delegate.addGroup(...n),this.removeGroup=(...n)=>this.delegate.removeGroup(...n),this.moveGroup=(...n)=>this.delegate.moveGroup(...n),this.mergeGroup=(...n)=>this.delegate.mergeGroup(...n),this.mergeAllGroups=(...n)=>this.delegate.mergeAllGroups(...n),this.copyGroup=(...n)=>this.delegate.copyGroup(...n),this.onDidChangeEditorPartOptions=this.delegate.onDidChangeEditorPartOptions,setTimeout(()=>{const n=Dt.get(Kt),o=a=>{if(a instanceof EM){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(Qie,a);this.additionalGroups.push(f),this._onDidAddGroup.fire(f)}},r=a=>{if(a instanceof EM){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(n.onCodeEditorAdd(o)),this._register(n.onCodeEditorRemove(r)),n.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}};ake=D([_(2,we)],ake);var KB;let jie=(KB=class extends V{constructor(e,t,i,n,o,r,a,c){super(),this.filesConfigurationService=e,this.hostService=t,this.editorService=i,this.editorGroupService=n,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 ui(l=>this.uriIdentityService.extUri.getComparisonKey(l)),this.waitingOnConditionAutoSaveEditors=new ui(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,Pg.ERRORS))),this._register(this.filesConfigurationService.onDidChangeAutoSaveDisabled(e=>this.onConditionChanged([e],Pg.DISABLED)))}onConditionChanged(e,t){for(const i of e){const n=this.waitingOnConditionAutoSaveWorkingCopies.get(i);if(n?.condition===t)n.workingCopy.isDirty()&&this.filesConfigurationService.getAutoSaveMode(n.workingCopy.resource,n.reason).mode!==rc.OFF&&(this.discardAutoSave(n.workingCopy),this.logService.info("[editor auto save] running auto save from condition change event",n.workingCopy.resource.toString(),n.workingCopy.typeId),n.workingCopy.save({reason:n.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!==rc.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(Cn.WINDOW_CHANGE)}onActiveWindowChange(){this.maybeTriggerAutoSave(Cn.WINDOW_CHANGE)}onDidActiveEditorChange(){this.lastActiveEditor&&typeof this.lastActiveGroupId=="number"&&this.maybeTriggerAutoSave(Cn.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(Cn.FOCUS_CHANGE,{groupId:e.id,editor:t})}))}maybeTriggerAutoSave(e,t){if(t){if(!t.editor.isDirty()||t.editor.isReadonly()||t.editor.hasCapability(Ei.Untitled))return;const i=this.filesConfigurationService.getAutoSaveMode(t.editor,e);i.mode!==rc.OFF?(e===Cn.WINDOW_CHANGE&&(i.mode===rc.ON_FOCUS_CHANGE||i.mode===rc.ON_WINDOW_CHANGE)||e===Cn.FOCUS_CHANGE&&i.mode===rc.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===Pg.ERRORS||i.reason===Pg.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 rc.ON_FOCUS_CHANGE:e=Cn.FOCUS_CHANGE;break;case rc.ON_WINDOW_CHANGE:e=Cn.WINDOW_CHANGE;break;case rc.AFTER_SHORT_DELAY:case rc.AFTER_LONG_DELAY:e=Cn.AUTO;break}e&&this.saveAllDirtyAutoSaveables(e)}saveAllDirtyAutoSaveables(e){for(const t of this.workingCopyService.dirtyWorkingCopies){if(t.capabilities&sC.Untitled)continue;const i=this.filesConfigurationService.getAutoSaveMode(t.resource,e);i.mode!==rc.OFF?t.save({reason:e}):(i.reason===Pg.ERRORS||i.reason===Pg.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&sC.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 n=Cn.AUTO,o=this.filesConfigurationService.getAutoSaveMode(e.resource,n);o.mode!==rc.OFF?(this.logService.trace("[editor auto save] running auto save",e.resource.toString(),e.typeId),e.save({reason:n})):(o.reason===Pg.ERRORS||o.reason===Pg.DISABLED)&&this.waitingOnConditionAutoSaveWorkingCopies.set(e.resource,{workingCopy:e,reason:n,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){bt(this.scheduledAutoSavesAfterDelay.get(e)),this.scheduledAutoSavesAfterDelay.delete(e),this.waitingOnConditionAutoSaveWorkingCopies.delete(e.resource),this.waitingOnConditionAutoSaveEditors.delete(e.resource)}},KB.ID="workbench.contrib.editorAutoSave",KB);jie=D([_(0,pd),_(1,xc),_(2,ei),_(3,Po),_(4,Im),_(5,Ge),_(6,ym),_(7,ks)],jie);Ku(jie.ID,jie,yc.BlockRestore);let cke=class extends xI{constructor(e,t,i){super(),this.resource=e,this.name=t,this.fileService=i,this.mime=Us.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()}};cke=D([_(2,Jt)],cke);var lke,OE;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Binary=2]="Binary"})(OE||(OE={}));let Yie=lke=class extends rb{get typeId(){return Ftt}get editorId(){return nm.id}get capabilities(){let e=Ei.CanSplitInGroup;return this.model?this.model.isReadonly()&&(e|=Ei.Readonly):this.fileService.hasProvider(this.resource)?this.filesConfigurationService.isReadonly(this.resource)&&(e|=Ei.Readonly):e|=Ei.Untitled,e&Ei.Readonly||(e|=Ei.CanDropIntoEditor),e}constructor(e,t,i,n,o,r,a,c,l,d,h,u,f,p,m,v,b){super(e,t,p,l,h,u,f,v,b),this.instantiationService=c,this.textModelService=d,this.pathService=m,this.forceOpenAs=OE.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),n&&this.setPreferredDescription(n),o&&this.setPreferredEncoding(o),r&&this.setPreferredLanguageId(r),typeof a=="string"&&this.setPreferredContents(a),this._register(this.textFileService.files.onDidCreate(w=>this.onDidCreateTextFileModel(w))),this.model&&this.registerModelListeners(this.model)}onDidCreateTextFileModel(e){ji(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(M.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!==pe.vscodeUserData&&this.resource.scheme!==pe.file&&this.resource.scheme!==pe.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=OE.Text}setForceOpenAsBinary(){this.forceOpenAs=OE.Binary}isDirty(){return!!this.model?.isDirty()}isSaving(){return this.model?.hasState(hh.SAVED)||this.model?.hasState(hh.CONFLICT)||this.model?.hasState(hh.ERROR)?!1:this.filesConfigurationService.hasShortAutoSaveDelay(this)?!0:super.isSaving()}prefersEditorPane(e){return this.forceOpenAs===OE.Binary?e.find(t=>t.typeId===HVt):e.find(t=>t.typeId===Ptt)}resolve(e){return this.forceOpenAs===OE.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"?tae(t):void 0,reload:{async:!0},allowBinary:this.forceOpenAs===OE.Text,reason:j3.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===yW.FILE_IS_BINARY)return this.doResolveAsBinary();throw t}}async doResolveAsBinary(){const e=this.instantiationService.createInstance(cke,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:KO(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:KO(this,e.preserveViewState,this.editorService)}),t}matches(e){return this===e?!0:e instanceof lke?ji(e.resource,this.resource):Gv(e)?super.matches(e):!1}dispose(){this.model=void 0,this.disposeModelReference(),super.dispose()}disposeModelReference(){bt(this.cachedTextFileModelReference),this.cachedTextFileModelReference=void 0}};Yie=lke=D([_(7,we),_(8,Fo),_(9,fn),_(10,Fs),_(11,Jt),_(12,pd),_(13,ei),_(14,mf),_(15,Ec),_(16,tE)],Yie);Qe.as(Xy.EditorFactory).registerFileEditorFactory({typeId:Ftt,createFileEditor:(s,e,t,i,n,o,r,a)=>a.createInstance(Yie,s,e,t,i,n,o,r),isFileEditor:s=>s instanceof Yie});function Nst(s){const e=s.get(rg).lastFocusedList,t=e?.getHTMLElement();if(t&&sv(t)&&e instanceof Xa){const i=Fi(e.getSelectedElements().filter(a=>a instanceof AZ)),n=e.getFocusedElements(),o=n.length?n[0]:void 0;let r;return o instanceof AZ&&(r=o),i.some(a=>a===r)?i:r?[r]:void 0}}async function pPe(s,e){const t=s.get(Po),i=s.get(Kt),n=s.get(Fo);let o=Nst(s);if(!o){const a=t.activeGroup;a.activeEditor&&(o=[],a.activeEditor instanceof ip&&!e?.saveAs&&!(a.activeEditor.primary.hasCapability(Ei.Untitled)||a.activeEditor.secondary.hasCapability(Ei.Untitled))&&a.activeEditor.secondary.isModified()?(o.push({groupId:a.id,editor:a.activeEditor.primary}),o.push({groupId:a.id,editor:a.activeEditor.secondary})):o.push({groupId:a.id,editor:a.activeEditor}))}if(!o||o.length===0)return;await mPe(s,o,e);const r=i.getFocusedCodeEditor();if(r instanceof rf&&!r.isSimpleWidget){const a=r.getModel()?.uri;a&&!o.some(({editor:c})=>ji(Na.getCanonicalUri(c,{supportSideBySide:Hs.PRIMARY}),a))&&(n.files.get(a)?.isReadonly()||await n.save(a,e))}}function Pst(s,e,t){const i=[];for(const n of e)for(const o of n.getEditors(Xh.MOST_RECENTLY_ACTIVE))o.isDirty()&&i.push({groupId:n.id,editor:o});return mPe(s,i,t)}async function mPe(s,e,t){const i=s.get(ei),n=s.get(bi),o=s.get(we);try{await i.save(e,t)}catch(r){Fr(r)||n.notify({id:e.map(({editor:a})=>Wc(a.resource?.toString())).join(),severity:Xe.Error,message:g(3756,"Failed to save '{0}': {1}",e.map(({editor:a})=>a.getName()).join(", "),Nr(r,!1)),actions:{primary:[ol({id:"workbench.action.files.saveEditors",label:g(3757,"Retry"),run:()=>o.invokeFunction(a=>mPe(a,e,t))}),ol({id:"workbench.action.files.revertEditors",label:g(3758,"Discard"),run:()=>i.revert(e)})]}})}}So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:U.CtrlCmd|S.KeyS,id:hFt,handler:s=>pPe(s,{reason:Cn.EXPLICIT,force:!0})});So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:rr(U.CtrlCmd|S.KeyK,S.KeyS),win:{primary:rr(U.CtrlCmd|S.KeyK,U.CtrlCmd|U.Shift|S.KeyS)},id:uFt,handler:s=>pPe(s,{reason:Cn.EXPLICIT,force:!0,skipSaveParticipants:!0})});So.registerCommandAndKeybindingRule({id:dFt,weight:Ae.WorkbenchContrib,when:void 0,primary:U.CtrlCmd|U.Shift|S.KeyS,handler:s=>pPe(s,{reason:Cn.EXPLICIT,saveAs:!0})});So.registerCommandAndKeybindingRule({when:void 0,weight:Ae.WorkbenchContrib,primary:void 0,mac:{primary:U.CtrlCmd|U.Alt|S.KeyS},win:{primary:rr(U.CtrlCmd|S.KeyK,S.KeyS)},id:gFt,handler:s=>Pst(s,s.get(Po).getGroups(du.MOST_RECENTLY_ACTIVE),{reason:Cn.EXPLICIT})});_t.registerCommand({id:zZe,handler:(s,e,t)=>{const i=s.get(Po),n=a5t([t],s.get(ei),i,s.get(rg));let o;return n.groupedEditors.length?o=n.groupedEditors.map(({group:r})=>r):o=i.getGroups(du.MOST_RECENTLY_ACTIVE),Pst(s,o,{reason:Cn.EXPLICIT})}});_t.registerCommand({id:fFt,handler:async s=>(await s.get(ei).saveAll({includeUntitled:!1,reason:Cn.EXPLICIT})).success});_t.registerCommand({id:lFt,handler:async s=>{const e=s.get(Po),t=s.get(ei);let i=Nst(s);if(!i){const n=e.activeGroup;n.activeEditor&&(i=[{groupId:n.id,editor:n.activeEditor}])}if(!(!i||i.length===0))try{await t.revert(i.filter(({editor:n})=>!n.hasCapability(Ei.Untitled)),{force:!0})}catch(n){s.get(bi).error(g(3759,"Failed to revert '{0}': {1}",i.map(({editor:r})=>r.getName()).join(", "),Nr(n,!1)))}}});class EZt{constructor(){this.hasMaximizedGroup=()=>!1,this.windowId=si.vscodeWindowId,this.onDidLayout=M.None,this.onDidScroll=M.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=kt,this.isLayoutCentered=kt,this.enforcePartOptions=kt,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.onDidChangeGroupMaximized=M.None,this.activeGroup=Q$,this.groups=[Q$],this.count=0,this.orientation=0,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=kt,this.getSize=kt,this.setSize=kt,this.arrangeGroups=kt,this.toggleMaximizeGroup=kt,this.toggleExpandGroup=kt,this.applyLayout=kt,this.getLayout=kt,this.setGroupOrientation=kt,this.findGroup=()=>{},this.addGroup=kt,this.removeGroup=kt,this.moveGroup=kt,this.mergeGroup=kt,this.mergeAllGroups=kt,this.copyGroup=kt,this.partOptions=Bae,this.onDidChangeEditorPartOptions=M.None,this.createEditorDropTarget=kt}get contentDimension(){return kt()}get sideGroup(){return kt()}}class xZt{constructor(){this.registerContextKeyProvider=kt,this.saveWorkingSet=kt,this.getWorkingSets=kt,this.applyWorkingSet=kt,this.deleteWorkingSet=kt,this.onDidCreateAuxiliaryEditorPart=M.None,this.mainPart=new EZt,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=kt,this.createAuxiliaryEditorPart=kt,this.onDidChangeGroupMaximized=M.None,this.toggleMaximizeGroup=kt,this.toggleExpandGroup=kt,this.partOptions=Bae,this.createEditorDropTarget=kt,this._serviceBrand=void 0,this.getLayout=kt,this.onDidChangeActiveGroup=M.None,this.onDidAddGroup=M.None,this.onDidRemoveGroup=M.None,this.onDidMoveGroup=M.None,this.onDidActivateGroup=M.None,this.onDidLayout=M.None,this.onDidScroll=M.None,this.onDidChangeGroupIndex=M.None,this.onDidChangeGroupLocked=M.None,this.activeGroup=Q$,this.groups=[Q$],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=kt,this.getSize=kt,this.setSize=kt,this.arrangeGroups=kt,this.applyLayout=kt,this.centerLayout=kt,this.isLayoutCentered=()=>!1,this.setGroupOrientation=kt,this.findGroup=()=>{},this.addGroup=kt,this.removeGroup=kt,this.moveGroup=kt,this.mergeGroup=kt,this.mergeAllGroups=kt,this.copyGroup=kt,this.onDidChangeEditorPartOptions=M.None,this.enforcePartOptions=kt}get contentDimension(){return kt()}get sideGroup(){return kt()}}let dke=class extends ake{constructor(e){super(e.createInstance(xZt),!0,e)}};dke=D([_(0,we)],dke);function DZt(s){return{[Kt.toString()]:new wi(eke,void 0,!0),[ei.toString()]:new wi(rke,[s,()=>!1],!0),[Yae.toString()]:new wi(tke,[],!1),[Po.toString()]:new wi(dke)}}class j${static _readModifiers(e){e=e.toLowerCase().trim();let t=!1,i=!1,n=!1,o=!1,r;do r=!1,/^ctrl(\+|\-)/.test(e)&&(t=!0,e=e.substr(5),r=!0),/^shift(\+|\-)/.test(e)&&(i=!0,e=e.substr(6),r=!0),/^alt(\+|\-)/.test(e)&&(n=!0,e=e.substr(4),r=!0),/^meta(\+|\-)/.test(e)&&(o=!0,e=e.substr(5),r=!0),/^win(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),r=!0),/^cmd(\+|\-)/.test(e)&&(o=!0,e=e.substr(4),r=!0);while(r);let a;const c=e.indexOf(" ");return c>0?(a=e.substring(0,c),e=e.substring(c)):(a=e,e=""),{remains:e,ctrl:t,shift:i,alt:n,meta:o,key:a}}static parseChord(e){const t=this._readModifiers(e),i=t.key.match(/^\[([^\]]+)\]$/);if(i){const o=i[1],r=Wp.lowerCaseToEnum(o);return[new dy(t.ctrl,t.shift,t.alt,t.meta,r),t.remains]}const n=Ia.fromUserSettings(t.key);return[new Dh(t.ctrl,t.shift,t.alt,t.meta,n),t.remains]}static parseKeybinding(e){if(!e)return null;const t=[];let i;for(;e.length>0;)[i,e]=this.parseChord(e),t.push(i);return t.length>0?new EO(t):null}}const Fst=[{key:"commandPalette",id:_e.CommandPalette,description:g(8540,"The Command Palette"),supportsSubmenus:!1},{key:"touchBar",id:_e.TouchBarContext,description:g(8541,"The touch bar (macOS only)"),supportsSubmenus:!1},{key:"editor/title",id:_e.EditorTitle,description:g(8542,"The editor title menu")},{key:"editor/title/run",id:_e.EditorTitleRun,description:g(8543,"Run submenu inside the editor title menu")},{key:"editor/context",id:_e.EditorContext,description:g(8544,"The editor context menu")},{key:"editor/context/copy",id:_e.EditorContextCopy,description:g(8545,"'Copy as' submenu in the editor context menu")},{key:"editor/context/share",id:_e.EditorContextShare,description:g(8546,"'Share' submenu in the editor context menu"),proposed:"contribShareMenu"},{key:"explorer/context",id:_e.ExplorerContext,description:g(8547,"The file explorer context menu")},{key:"explorer/context/share",id:_e.ExplorerContextShare,description:g(8548,"'Share' submenu in the file explorer context menu"),proposed:"contribShareMenu"},{key:"editor/title/context",id:_e.EditorTitleContext,description:g(8549,"The editor tabs context menu")},{key:"editor/title/context/share",id:_e.EditorTitleContextShare,description:g(8550,"'Share' submenu inside the editor title context menu"),proposed:"contribShareMenu"},{key:"debug/callstack/context",id:_e.DebugCallStackContext,description:g(8551,"The debug callstack view context menu")},{key:"debug/variables/context",id:_e.DebugVariablesContext,description:g(8552,"The debug variables view context menu")},{key:"debug/toolBar",id:_e.DebugToolBar,description:g(8553,"The debug toolbar menu")},{key:"notebook/variables/context",id:_e.NotebookVariablesContext,description:g(8554,"The notebook variables view context menu")},{key:"menuBar/home",id:_e.MenubarHomeMenu,description:g(8555,"The home indicator context menu (web only)"),proposed:"contribMenuBarHome",supportsSubmenus:!1},{key:"menuBar/edit/copy",id:_e.MenubarCopy,description:g(8556,"'Copy as' submenu in the top level Edit menu")},{key:"scm/title",id:_e.SCMTitle,description:g(8557,"The Source Control title menu")},{key:"scm/sourceControl",id:_e.SCMSourceControl,description:g(8558,"The Source Control menu")},{key:"scm/sourceControl/title",id:_e.SCMSourceControlTitle,description:g(8559,"The Source Control title menu"),proposed:"contribSourceControlTitleMenu"},{key:"scm/resourceState/context",id:_e.SCMResourceContext,description:g(8560,"The Source Control resource state context menu")},{key:"scm/resourceFolder/context",id:_e.SCMResourceFolderContext,description:g(8561,"The Source Control resource folder context menu")},{key:"scm/resourceGroup/context",id:_e.SCMResourceGroupContext,description:g(8562,"The Source Control resource group context menu")},{key:"scm/change/title",id:_e.SCMChangeContext,description:g(8563,"The Source Control inline change menu")},{key:"scm/inputBox",id:_e.SCMInputBox,description:g(8564,"The Source Control input box menu"),proposed:"contribSourceControlInputBoxMenu"},{key:"scm/historyItemChanges/title",id:_e.SCMChangesSeparator,description:g(8565,"The Source Control incoming/outgoing changes title menu"),proposed:"contribSourceControlHistoryItemChangesMenu"},{key:"scm/historyItem/context",id:_e.SCMChangesContext,description:g(8566,"The Source Control history item context menu"),proposed:"contribSourceControlHistoryItemChangesMenu"},{key:"scm/incomingChanges",id:_e.SCMIncomingChanges,description:g(8567,"The Source Control incoming changes menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/incomingChanges/context",id:_e.SCMIncomingChangesContext,description:g(8568,"The Source Control incoming changes context menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/outgoingChanges",id:_e.SCMOutgoingChanges,description:g(8569,"The Source Control outgoing changes menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/outgoingChanges/context",id:_e.SCMOutgoingChangesContext,description:g(8570,"The Source Control outgoing changes context menu"),proposed:"contribSourceControlHistoryItemGroupMenu"},{key:"scm/incomingChanges/allChanges/context",id:_e.SCMIncomingChangesAllChangesContext,description:g(8571,"The Source Control all incoming changes context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/incomingChanges/historyItem/context",id:_e.SCMIncomingChangesHistoryItemContext,description:g(8572,"The Source Control incoming changes history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/outgoingChanges/allChanges/context",id:_e.SCMOutgoingChangesAllChangesContext,description:g(8573,"The Source Control all outgoing changes context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"scm/outgoingChanges/historyItem/context",id:_e.SCMOutgoingChangesHistoryItemContext,description:g(8574,"The Source Control outgoing changes history item context menu"),proposed:"contribSourceControlHistoryItemMenu"},{key:"statusBar/remoteIndicator",id:_e.StatusBarRemoteIndicatorMenu,description:g(8575,"The remote indicator menu in the status bar"),supportsSubmenus:!1},{key:"terminal/context",id:_e.TerminalInstanceContext,description:g(8576,"The terminal context menu")},{key:"terminal/title/context",id:_e.TerminalTabContext,description:g(8577,"The terminal tabs context menu")},{key:"view/title",id:_e.ViewTitle,description:g(8578,"The contributed view title menu")},{key:"view/item/context",id:_e.ViewItemContext,description:g(8579,"The contributed view item context menu")},{key:"comments/comment/editorActions",id:_e.CommentEditorActions,description:g(8580,"The contributed comment editor actions"),proposed:"contribCommentEditorActionsMenu"},{key:"comments/commentThread/title",id:_e.CommentThreadTitle,description:g(8581,"The contributed comment thread title menu")},{key:"comments/commentThread/context",id:_e.CommentThreadActions,description:g(8582,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/additionalActions",id:_e.CommentThreadAdditionalActions,description:g(8582,"The contributed comment thread context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1,proposed:"contribCommentThreadAdditionalMenu"},{key:"comments/commentThread/title/context",id:_e.CommentThreadTitleContext,description:g(8583,"The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."),proposed:"contribCommentPeekContext"},{key:"comments/comment/title",id:_e.CommentTitle,description:g(8584,"The contributed comment title menu")},{key:"comments/comment/context",id:_e.CommentActions,description:g(8585,"The contributed comment context menu, rendered as buttons below the comment editor"),supportsSubmenus:!1},{key:"comments/commentThread/comment/context",id:_e.CommentThreadCommentContext,description:g(8586,"The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."),proposed:"contribCommentPeekContext"},{key:"commentsView/commentThread/context",id:_e.CommentsViewThreadActions,description:g(8587,"The contributed comment thread context menu in the comments view"),proposed:"contribCommentsViewThreadMenus"},{key:"notebook/toolbar",id:_e.NotebookToolbar,description:g(8588,"The contributed notebook toolbar menu")},{key:"notebook/kernelSource",id:_e.NotebookKernelSource,description:g(8589,"The contributed notebook kernel sources menu"),proposed:"notebookKernelSource"},{key:"notebook/cell/title",id:_e.NotebookCellTitle,description:g(8590,"The contributed notebook cell title menu")},{key:"notebook/cell/execute",id:_e.NotebookCellExecute,description:g(8591,"The contributed notebook cell execution menu")},{key:"interactive/toolbar",id:_e.InteractiveToolbar,description:g(8592,"The contributed interactive toolbar menu")},{key:"interactive/cell/title",id:_e.InteractiveCellTitle,description:g(8593,"The contributed interactive cell title menu")},{key:"issue/reporter",id:_e.IssueReporter,description:g(8594,"The contributed issue reporter menu"),proposed:"contribIssueReporter"},{key:"testing/item/context",id:_e.TestItem,description:g(8595,"The contributed test item menu")},{key:"testing/item/gutter",id:_e.TestItemGutter,description:g(8596,"The menu for a gutter decoration for a test item")},{key:"testing/profiles/context",id:_e.TestProfilesContext,description:g(8597,"The menu for configuring testing profiles.")},{key:"testing/item/result",id:_e.TestPeekElement,description:g(8598,"The menu for an item in the Test Results view or peek.")},{key:"testing/message/context",id:_e.TestMessageContext,description:g(8599,"A prominent button overlaying editor content where the message is displayed")},{key:"testing/message/content",id:_e.TestMessageContent,description:g(8600,"Context menu for the message in the results tree")},{key:"extension/context",id:_e.ExtensionContext,description:g(8601,"The extension context menu")},{key:"timeline/title",id:_e.TimelineTitle,description:g(8602,"The Timeline view title menu")},{key:"timeline/item/context",id:_e.TimelineItemContext,description:g(8603,"The Timeline view item context menu")},{key:"ports/item/context",id:_e.TunnelContext,description:g(8604,"The Ports view item context menu")},{key:"ports/item/origin/inline",id:_e.TunnelOriginInline,description:g(8605,"The Ports view item origin inline menu")},{key:"ports/item/port/inline",id:_e.TunnelPortInline,description:g(8606,"The Ports view item port inline menu")},{key:"file/newFile",id:_e.NewFile,description:g(8607,"The 'New File...' quick pick, shown on welcome page and File menu."),supportsSubmenus:!1},{key:"webview/context",id:_e.WebviewContext,description:g(8608,"The webview context menu")},{key:"file/share",id:_e.MenubarShare,description:g(8609,"Share submenu shown in the top level File menu."),proposed:"contribShareMenu"},{key:"editor/inlineCompletions/actions",id:_e.InlineCompletionsActions,description:g(8610,"The actions shown when hovering on an inline completion"),supportsSubmenus:!1,proposed:"inlineCompletionsAdditions"},{key:"editor/inlineEdit/actions",id:_e.InlineEditActions,description:g(8611,"The actions shown when hovering on an inline edit"),supportsSubmenus:!1,proposed:"inlineEdit"},{key:"editor/content",id:_e.EditorContent,description:g(8612,"The prominent button in an editor, overlays its content"),proposed:"contribEditorContentMenu"},{key:"editor/lineNumber/context",id:_e.EditorLineNumberContext,description:g(8613,"The contributed editor line number context menu")},{key:"mergeEditor/result/title",id:_e.MergeInputResultToolbar,description:g(8614,"The result toolbar of the merge editor"),proposed:"contribMergeEditorMenus"},{key:"multiDiffEditor/resource/title",id:_e.MultiDiffEditorFileToolbar,description:g(8615,"The resource toolbar in the multi diff editor"),proposed:"contribMultiDiffEditorMenus"},{key:"diffEditor/gutter/hunk",id:_e.DiffEditorHunkToolbar,description:g(8616,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"},{key:"diffEditor/gutter/selection",id:_e.DiffEditorSelectionToolbar,description:g(8616,"The gutter toolbar in the diff editor"),proposed:"contribDiffEditorGutterToolBarMenus"}];var $A;(function(s){function e(f){return typeof f.command=="string"}s.isMenuItem=e;function t(f,p){return typeof f.command!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","command")),!1):f.alt&&typeof f.alt!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","alt")),!1):f.when&&typeof f.when!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}s.isValidMenuItem=t;function i(f,p){return typeof f.submenu!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","submenu")),!1):f.when&&typeof f.when!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","when")),!1):f.group&&typeof f.group!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","group")),!1):!0}s.isValidSubmenuItem=i;function n(f,p){if(!Array.isArray(f))return p.error(g(8619,"submenu items must be an array")),!1;for(const m of f)if(e(m)){if(!t(m,p))return!1}else if(!i(m,p))return!1;return!0}s.isValidItems=n;function o(f,p){return typeof f!="object"?(p.error(g(8620,"submenu items must be an object")),!1):typeof f.id!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","id")),!1):typeof f.label!="string"?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","label")),!1):!0}s.isValidSubmenu=o;const r={type:"object",required:["command"],properties:{command:{description:g(8621,"Identifier of the command to execute. The command must be declared in the 'commands'-section"),type:"string"},alt:{description:g(8622,"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"),type:"string"},when:{description:g(8623,"Condition which must be true to show this item"),type:"string"},group:{description:g(8624,"Group into which this item belongs"),type:"string"}}},a={type:"object",required:["submenu"],properties:{submenu:{description:g(8625,"Identifier of the submenu to display in this item."),type:"string"},when:{description:g(8623,"Condition which must be true to show this item"),type:"string"},group:{description:g(8624,"Group into which this item belongs"),type:"string"}}},c={type:"object",required:["id","label"],properties:{id:{description:g(8626,"Identifier of the menu to display as a submenu."),type:"string"},label:{description:g(8627,"The label of the menu item which leads to this submenu."),type:"string"},icon:{description:g(8628,"(Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:g(8629,"Icon path when a light theme is used"),type:"string"},dark:{description:g(8630,"Icon path when a dark theme is used"),type:"string"}}}]}}};s.menusContribution={description:g(8631,"Contributes menu items to the editor"),type:"object",properties:E1e(Fst,f=>f.key,f=>({markdownDescription:f.proposed?g(8632,'Proposed API, requires `enabledApiProposal: ["{0}"]` - {1}',f.proposed,f.description):f.description,type:"array",items:f.supportsSubmenus===!1?r:{oneOf:[r,a]}})),additionalProperties:{description:"Submenu",type:"array",items:{oneOf:[r,a]}}},s.submenusContribution={description:g(8633,"Contributes submenu items to the editor"),type:"array",items:c};function l(f,p){return f?zu(f.command)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`","command")),!1):!h(f.title,p,"title")||f.shortTitle&&!h(f.shortTitle,p,"shortTitle")?!1:f.enablement&&typeof f.enablement!="string"?(p.error(g(8618,"property `{0}` can be omitted or must be of type `string`","precondition")),!1):!(f.category&&!h(f.category,p,"category")||!d(f.icon,p)):(p.error(g(8634,"expected non-empty value.")),!1)}s.isValidCommand=l;function d(f,p){return typeof f>"u"||typeof f=="string"||typeof f.dark=="string"&&typeof f.light=="string"?!0:(p.error(g(8635,"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`")),!1)}function h(f,p,m){return typeof f>"u"?(p.error(g(8636,"property `{0}` is mandatory and must be of type `string` or `object`",m)),!1):typeof f=="string"&&zu(f)?(p.error(g(8617,"property `{0}` is mandatory and must be of type `string`",m)),!1):typeof f!="string"&&(zu(f.original)||zu(f.value))?(p.error(g(8637,"properties `{0}` and `{1}` are mandatory and must be of type `string`",`${m}.value`,`${m}.original`)),!1):!0}const u={type:"object",required:["command","title"],properties:{command:{description:g(8638,"Identifier of the command to execute"),type:"string"},title:{description:g(8639,"Title by which the command is represented in the UI"),type:"string"},shortTitle:{markdownDescription:g(8640,"(Optional) Short title by which the command is represented in the UI. Menus pick either `title` or `shortTitle` depending on the context in which they show commands."),type:"string"},category:{description:g(8641,"(Optional) Category string by which the command is grouped in the UI"),type:"string"},enablement:{description:g(8642,"(Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api."),type:"string"},icon:{description:g(8643,"(Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`"),anyOf:[{type:"string"},{type:"object",properties:{light:{description:g(8644,"Icon path when a light theme is used"),type:"string"},dark:{description:g(8645,"Icon path when a dark theme is used"),type:"string"}}}]}}};s.commandsContribution={description:g(8646,"Contributes commands to the command palette."),oneOf:[u,{type:"array",items:u}]}})($A||($A={}));const i9e=new Z,Ost=Xd.registerExtensionPoint({extensionPoint:"commands",jsonSchema:$A.commandsContribution,activationEventsGenerator:(s,e)=>{for(const t of s)t.command&&e.push(`onCommand:${t.command}`)}});Ost.setHandler(s=>{function e(t,i){if(!$A.isValidCommand(t,i.collector))return;const{icon:n,enablement:o,category:r,title:a,shortTitle:c,command:l}=t;let d;n&&(typeof n=="string"?d=We.fromString(n)??{dark:Pt(i.description.extensionLocation,n),light:Pt(i.description.extensionLocation,n)}:d={dark:Pt(i.description.extensionLocation,n.dark),light:Pt(i.description.extensionLocation,n.light)});const h=jn.getCommand(l);h&&(h.source?i.collector.info(g(8647,"Command `{0}` already registered by {1} ({2})",t.command,h.source.title,h.source.id)):i.collector.info(g(8648,"Command `{0}` already registered",t.command))),i9e.add(jn.addCommand({id:l,title:a,source:{id:i.description.identifier.value,title:i.description.displayName??i.description.name},shortTitle:c,tooltip:a,category:r,precondition:he.deserialize(o),icon:d}))}i9e.clear();for(const t of s){const{value:i}=t;if(Array.isArray(i))for(const n of i)e(n,t);else e(i,t)}});const _z=new Map,Bst=Xd.registerExtensionPoint({extensionPoint:"submenus",jsonSchema:$A.submenusContribution});Bst.setHandler(s=>{_z.clear();for(const e of s){const{value:t,collector:i}=e;for(const[,n]of Object.entries(t)){if(!$A.isValidSubmenu(n,i))continue;if(!n.id){i.warn(g(8649,"`{0}` is not a valid submenu identifier",n.id));continue}if(_z.has(n.id)){i.info(g(8650,"The `{0}` submenu was already previously registered.",n.id));continue}if(!n.label){i.warn(g(8651,"`{0}` is not a valid submenu label",n.label));continue}let o;n.icon&&(typeof n.icon=="string"?o=We.fromString(n.icon)||{dark:Pt(e.description.extensionLocation,n.icon)}:o={dark:Pt(e.description.extensionLocation,n.icon.dark),light:Pt(e.description.extensionLocation,n.icon.light)});const r={id:_e.for(`api:${n.id}`),label:n.label,icon:o};_z.set(n.id,r)}}});const kZt=new Map(Fst.map(s=>[s.key,s])),n9e=new Z,Wue=new Map,IZt=Xd.registerExtensionPoint({extensionPoint:"menus",jsonSchema:$A.menusContribution,deps:[Bst]});IZt.setHandler(s=>{n9e.clear(),Wue.clear();for(const e of s){const{value:t,collector:i}=e;for(const n of Object.entries(t)){if(!$A.isValidItems(n[1],i))continue;let o=kZt.get(n[0]);if(!o){const r=_z.get(n[0]);r&&(o={key:n[0],id:r.id,description:""})}if(o){if(o.proposed&&!ll(e.description,o.proposed)){i.error(g(8652,`{0} is a proposed menu identifier. It requires 'package.json#enabledApiProposals: ["{1}"]' and is only available when running out of dev or with the following command line switch: --enable-proposed-api {2}`,n[0],o.proposed,e.description.identifier.value));continue}for(const r of n[1]){let a;if($A.isMenuItem(r)){const c=jn.getCommand(r.command),l=r.alt&&jn.getCommand(r.alt)||void 0;if(!c){i.error(g(8653,"Menu item references a command `{0}` which is not defined in the 'commands' section.",r.command));continue}r.alt&&!l&&i.warn(g(8654,"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",r.alt)),r.command===r.alt&&i.info(g(8655,"Menu item references the same command as default and alt-command")),a={command:c,alt:l,group:void 0,order:void 0,when:void 0}}else{if(o.supportsSubmenus===!1){i.error(g(8656,"Menu item references a submenu for a menu which doesn't have submenu support."));continue}const c=_z.get(r.submenu);if(!c){i.error(g(8657,"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",r.submenu));continue}let l=Wue.get(o.id.id);if(l||(l=new Set,Wue.set(o.id.id,l)),l.has(c.id.id)){i.warn(g(8658,"The `{0}` submenu was already contributed to the `{1}` menu.",r.submenu,n[0]));continue}l.add(c.id.id),a={submenu:c.id,icon:c.icon,title:c.label,group:void 0,order:void 0,when:void 0}}if(r.group){const c=r.group.lastIndexOf("@");c>0?(a.group=r.group.substr(0,c),a.order=Number(r.group.substr(c+1))||void 0):a.group=r.group}a.when=he.deserialize(r.when),n9e.add(jn.appendMenuItem(o.id,a))}}}}});let hke=class extends V{constructor(e){super(),this._keybindingService=e,this.type="table"}shouldRender(e){return!!e.contributes?.commands}render(e){const i=(e.contributes?.commands||[]).map(l=>({id:l.command,title:l.title,keybindings:[],menus:[]})),n=E1e(i,l=>l.id),o=e.contributes?.menus||{};for(const l in o)for(const d of o[l])if(d.command){let h=n[d.command];h?h.menus.push(l):(h={id:d.command,title:"",keybindings:[],menus:[l]},n[h.id]=h,i.push(h))}if((e.contributes?.keybindings?Array.isArray(e.contributes.keybindings)?e.contributes.keybindings:[e.contributes.keybindings]:[]).forEach(l=>{const d=this.resolveKeybinding(l);if(!d)return;let h=n[l.command];h?h.keybindings.push(d):(h={id:l.command,title:"",keybindings:[d],menus:[]},n[h.id]=h,i.push(h))}),!i.length)return{data:{headers:[],rows:[]},dispose:()=>{}};const a=[g(8659,"ID"),g(8660,"Title"),g(8661,"Keyboard Shortcuts"),g(8662,"Menu Contexts")],c=i.sort((l,d)=>l.id.localeCompare(d.id)).map(l=>[new Mt().appendMarkdown(`\`${l.id}\``),typeof l.title=="string"?l.title:l.title.value,l.keybindings,new Mt().appendMarkdown(`${l.menus.map(d=>`\`${d}\``).join(" ")}`)]);return{data:{headers:a,rows:c},dispose:()=>{}}}resolveKeybinding(e){let t;switch(eGe){case"win32":t=e.win;break;case"linux":t=e.linux;break;case"darwin":t=e.mac;break}return this._keybindingService.resolveUserBinding(t??e.key)[0]}};hke=D([_(0,Ut)],hke);Qe.as(Q_.ExtensionFeaturesRegistry).registerExtensionFeature({id:"commands",label:g(8663,"Commands"),access:{canToggle:!1},renderer:new wi(hke)});class Wst{static writeKeybindingItem(e,t){if(!t.resolvedKeybinding)return;const i=JSON.stringify(t.resolvedKeybinding.getUserSettingsLabel());e.write(`{ "key": ${TZt(i+",",25)} "command": `);const n=t.when?JSON.stringify(t.when.serialize()):"",o=JSON.stringify(t.command);n.length>0?(e.write(`${o},`),e.writeLine(),e.write(` "when": ${n}`)):e.write(`${o}`),t.commandArgs&&(e.write(","),e.writeLine(),e.write(` "args": ${JSON.stringify(t.commandArgs)}`)),e.write(" }")}static readUserKeybindingItem(e){const t="key"in e&&typeof e.key=="string"?j$.parseKeybinding(e.key):null,i="when"in e&&typeof e.when=="string"?he.deserialize(e.when):void 0,n="command"in e&&typeof e.command=="string"?e.command:null,o="args"in e&&typeof e.args<"u"?e.args:void 0;return{keybinding:t,command:n,commandArgs:o,when:i,_sourceKey:"key"in e&&typeof e.key=="string"?e.key:void 0}}}function TZt(s,e){return s.length{this._keyboardMapper=this.keyboardLayoutService.getKeyboardMapper(),this.updateResolver()})),this._keybindingHoldMode=null,this._cachedResolver=null,this.userKeybindings=this._register(new NZt(o,l,c,d)),this.userKeybindings.initialize().then(()=>{this.userKeybindings.keybindings.length&&this.updateResolver()}),this._register(this.userKeybindings.onDidChange(()=>{d.debug("User keybindings changed"),this.updateResolver()})),o9e.setHandler(u=>{const f=[];for(const p of u)this._handleKeybindingsExtensionPointUser(p.description.identifier,p.description.isBuiltin,p.value,p.collector,f);So.setExtensionKeybindings(f),this.updateResolver()}),this.updateKeybindingsJsonSchema(),this._register(a.onDidRegisterExtensions(()=>this.updateKeybindingsJsonSchema())),this._register(M.runAndSubscribe(Xp,({window:u,disposables:f})=>f.add(this._registerKeyListeners(u)),{window:si,disposables:this._store})),this._register(dGe(u=>{if(u!==si.vscodeWindowId)return;const f=navigator.keyboard;AO.keyboard!==Yx.None&&(epe(si)?f?.lock(["Escape"]):f?.unlock(),this._cachedResolver=null,this._onDidUpdateKeybindings.fire())}))}_registerKeyListeners(e){const t=new Z;return t.add(ue(e,ke.KEY_DOWN,i=>{if(this._keybindingHoldMode)return;this.isComposingGlobalContextKey.set(i.isComposing);const n=new En(i);this._log(`/ Received keydown event - ${elt(i)}`),this._log(`| Converted keydown event - ${tlt(n)}`),this._dispatch(n,n.target)&&n.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t.add(ue(e,ke.KEY_UP,i=>{this._resetKeybindingHoldMode(),this.isComposingGlobalContextKey.set(i.isComposing);const n=new En(i);this._singleModifierDispatch(n,n.target)&&n.preventDefault(),this.isComposingGlobalContextKey.set(!1)})),t}registerSchemaContribution(e){this._contributions.push(e),e.onDidChange&&this._register(e.onDidChange(()=>this.updateKeybindingsJsonSchema())),this.updateKeybindingsJsonSchema()}updateKeybindingsJsonSchema(){this.kbsJsonSchema.updateSchema(this._contributions.flatMap(e=>e.getSchemaAdditions()))}_printKeybinding(e){return ALe.toLabel(po,e.chords,t=>t instanceof Dh?Ia.toString(t.keyCode):Wp.toString(t.scanCode))||"[null]"}_printResolvedKeybinding(e){return e.getDispatchChords().map(t=>t||"[null]").join(" ")}_printResolvedKeybindings(e,t,i){const o=`${t.padStart(35," ")} => `;if(i.length===0){e.push(`${o}${"[NO BINDING]".padStart(35," ")}`);return}for(const r of i)e.push(`${o}${this._printResolvedKeybinding(r).padStart(35," ")}`)}_dumpResolveKeybindingDebugInfo(){const e=new Set,t=[];t.push("Default Resolved Keybindings (unique only):");for(const i of So.getDefaultKeybindings()){if(!i.keybinding)continue;const n=this._printKeybinding(i.keybinding);if(e.has(n))continue;e.add(n);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,o)}t.push("User Resolved Keybindings (unique only):");for(const i of this.userKeybindings.keybindings){if(!i.keybinding)continue;const n=i._sourceKey??"Impossible: missing source key, but has keybinding";if(e.has(n))continue;e.add(n);const o=this._keyboardMapper.resolveKeybinding(i.keybinding);this._printResolvedKeybindings(t,n,o)}return t.join(` `)}_dumpDebugInfo(){const e=JSON.stringify(this.keyboardLayoutService.getCurrentKeyboardLayout(),null," "),t=this._keyboardMapper.dumpDebugInfo(),i=this._dumpResolveKeybindingDebugInfo(),n=JSON.stringify(this.keyboardLayoutService.getRawKeyboardMapping(),null," ");return`Layout info: ${e} @@ -1011,33 +1011,33 @@ ${i} ${t} Raw mapping: -${n}`}_dumpDebugInfoJSON(){const e={layout:this.keyboardLayoutService.getCurrentKeyboardLayout(),rawMapping:this.keyboardLayoutService.getRawKeyboardMapping()};return JSON.stringify(e,null," ")}enableKeybindingHoldMode(e){if(this._currentlyDispatchingCommandId!==e)return;this._keybindingHoldMode=new dc;const t=Ac(ct(void 0)),i=t.onDidBlur(()=>this._resetKeybindingHoldMode());return this._keybindingHoldMode.p.finally(()=>{i.dispose(),t.dispose()}),this._log(`+ Enabled hold-mode for ${e}.`),this._keybindingHoldMode.p}_resetKeybindingHoldMode(){this._keybindingHoldMode&&(this._keybindingHoldMode?.complete(),this._keybindingHoldMode=null)}customKeybindingsCount(){return this.userKeybindings.keybindings.length}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}getUserKeybindingItems(){return this._resolveUserKeybindingItems(this.userKeybindings.keybindings,!1)}_getResolver(){if(!this._cachedResolver){const e=this._resolveKeybindingItems(So.getDefaultKeybindings(),!0),t=this.getUserKeybindingItems();this._cachedResolver=new $O(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return this.hostService.hasFocus}_resolveKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new Dx(void 0,o.command,o.commandArgs,r,t,o.extensionId,o.isBuiltinExtension);else{if(this._assertBrowserConflicts(a))continue;const c=this._keyboardMapper.resolveKeybinding(a);for(let l=c.length-1;l>=0;l--){const d=c[l];i[n++]=new Dx(d,o.command,o.commandArgs,r,t,o.extensionId,o.isBuiltinExtension)}}}return i}_resolveUserKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0;if(!o.keybinding)i[n++]=new Dx(void 0,o.command,o.commandArgs,r,t,null,!1);else{const a=this._keyboardMapper.resolveKeybinding(o.keybinding);for(const c of a)i[n++]=new Dx(c,o.command,o.commandArgs,r,t,null,!1)}}return i}_assertBrowserConflicts(e){if(kO.keyboard===Zx.Always||kO.keyboard===Zx.FullScreen&&rpe(si))return!1;for(const t of e.chords){if(!t.metaKey&&!t.altKey&&!t.ctrlKey&&!t.shiftKey)continue;const i=U.CtrlCmd|U.Alt|U.Shift;let n=0;if(t.metaKey&&(n|=U.CtrlCmd),t.shiftKey&&(n|=U.Shift),t.altKey&&(n|=U.Alt),t.ctrlKey&&po===Ds.Macintosh&&(n|=U.WinCtrl),(n&i)===(U.CtrlCmd|U.Alt)&&(t instanceof gy&&(t.scanCode===X.ArrowLeft||t.scanCode===X.ArrowRight)||t instanceof Ih&&(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow))||(n&i)===U.CtrlCmd&&(t instanceof gy&&t.scanCode>=X.Digit1&&t.scanCode<=X.Digit0||t instanceof Ih&&t.keyCode>=S.Digit0&&t.keyCode<=S.Digit9))return!0}return!1}resolveKeybinding(e){return this._keyboardMapper.resolveKeybinding(e)}resolveKeyboardEvent(e){return this.keyboardLayoutService.validateCurrentKeyboardMapping(e),this._keyboardMapper.resolveKeyboardEvent(e)}resolveUserBinding(e){const t=X$.parseKeybinding(e);return t?this._keyboardMapper.resolveKeybinding(t):[]}_handleKeybindingsExtensionPointUser(e,t,i,n,o){if(Array.isArray(i))for(let r=0,a=i.length;r0&&o.error(g(3514,"Invalid `contributes.{0}`: {1}",_9e.name,a.join(` -`)))}static bindToCurrentPlatform(e,t,i,n){if(po===Ds.Windows&&n){if(n)return n}else if(po===Ds.Macintosh){if(t)return t}else if(i)return i;return e}_asCommandRule(e,t,i,n){const{command:o,args:r,when:a,key:c,mac:l,linux:d,win:h}=n,u=BV.bindToCurrentPlatform(c,l,d,h);if(!u)return;let f;t?f=Ae.BuiltinExtension+i:f=Ae.ExternalExtension+i;const p=jn.getCommand(o),m=p&&p.precondition;let v;return a&&m?v=he.and(m,he.deserialize(a)):a?v=he.deserialize(a):m&&(v=m),{id:o,args:r,when:v,weight:f,keybinding:X$.parseKeybinding(u),extensionId:e.value,isBuiltinExtension:t}}getDefaultKeybindingsContent(){const e=this._getResolver(),t=e.getDefaultKeybindings(),i=e.getDefaultBoundCommands();return BV._getDefaultKeybindings(t)+` +${n}`}_dumpDebugInfoJSON(){const e={layout:this.keyboardLayoutService.getCurrentKeyboardLayout(),rawMapping:this.keyboardLayoutService.getRawKeyboardMapping()};return JSON.stringify(e,null," ")}enableKeybindingHoldMode(e){if(this._currentlyDispatchingCommandId!==e)return;this._keybindingHoldMode=new dc;const t=Ac(ct(void 0)),i=t.onDidBlur(()=>this._resetKeybindingHoldMode());return this._keybindingHoldMode.p.finally(()=>{i.dispose(),t.dispose()}),this._log(`+ Enabled hold-mode for ${e}.`),this._keybindingHoldMode.p}_resetKeybindingHoldMode(){this._keybindingHoldMode&&(this._keybindingHoldMode?.complete(),this._keybindingHoldMode=null)}customKeybindingsCount(){return this.userKeybindings.keybindings.length}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}getUserKeybindingItems(){return this._resolveUserKeybindingItems(this.userKeybindings.keybindings,!1)}_getResolver(){if(!this._cachedResolver){const e=this._resolveKeybindingItems(So.getDefaultKeybindings(),!0),t=this.getUserKeybindingItems();this._cachedResolver=new HO(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return this.hostService.hasFocus}_resolveKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new Ax(void 0,o.command,o.commandArgs,r,t,o.extensionId,o.isBuiltinExtension);else{if(this._assertBrowserConflicts(a))continue;const c=this._keyboardMapper.resolveKeybinding(a);for(let l=c.length-1;l>=0;l--){const d=c[l];i[n++]=new Ax(d,o.command,o.commandArgs,r,t,o.extensionId,o.isBuiltinExtension)}}}return i}_resolveUserKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0;if(!o.keybinding)i[n++]=new Ax(void 0,o.command,o.commandArgs,r,t,null,!1);else{const a=this._keyboardMapper.resolveKeybinding(o.keybinding);for(const c of a)i[n++]=new Ax(c,o.command,o.commandArgs,r,t,null,!1)}}return i}_assertBrowserConflicts(e){if(AO.keyboard===Yx.Always||AO.keyboard===Yx.FullScreen&&epe(si))return!1;for(const t of e.chords){if(!t.metaKey&&!t.altKey&&!t.ctrlKey&&!t.shiftKey)continue;const i=U.CtrlCmd|U.Alt|U.Shift;let n=0;if(t.metaKey&&(n|=U.CtrlCmd),t.shiftKey&&(n|=U.Shift),t.altKey&&(n|=U.Alt),t.ctrlKey&&po===Ds.Macintosh&&(n|=U.WinCtrl),(n&i)===(U.CtrlCmd|U.Alt)&&(t instanceof dy&&(t.scanCode===X.ArrowLeft||t.scanCode===X.ArrowRight)||t instanceof Dh&&(t.keyCode===S.LeftArrow||t.keyCode===S.RightArrow))||(n&i)===U.CtrlCmd&&(t instanceof dy&&t.scanCode>=X.Digit1&&t.scanCode<=X.Digit0||t instanceof Dh&&t.keyCode>=S.Digit0&&t.keyCode<=S.Digit9))return!0}return!1}resolveKeybinding(e){return this._keyboardMapper.resolveKeybinding(e)}resolveKeyboardEvent(e){return this.keyboardLayoutService.validateCurrentKeyboardMapping(e),this._keyboardMapper.resolveKeyboardEvent(e)}resolveUserBinding(e){const t=j$.parseKeybinding(e);return t?this._keyboardMapper.resolveKeybinding(t):[]}_handleKeybindingsExtensionPointUser(e,t,i,n,o){if(Array.isArray(i))for(let r=0,a=i.length;r0&&o.error(g(3514,"Invalid `contributes.{0}`: {1}",o9e.name,a.join(` +`)))}static bindToCurrentPlatform(e,t,i,n){if(po===Ds.Windows&&n){if(n)return n}else if(po===Ds.Macintosh){if(t)return t}else if(i)return i;return e}_asCommandRule(e,t,i,n){const{command:o,args:r,when:a,key:c,mac:l,linux:d,win:h}=n,u=FV.bindToCurrentPlatform(c,l,d,h);if(!u)return;let f;t?f=Ae.BuiltinExtension+i:f=Ae.ExternalExtension+i;const p=jn.getCommand(o),m=p&&p.precondition;let v;return a&&m?v=he.and(m,he.deserialize(a)):a?v=he.deserialize(a):m&&(v=m),{id:o,args:r,when:v,weight:f,keybinding:j$.parseKeybinding(u),extensionId:e.value,isBuiltinExtension:t}}getDefaultKeybindingsContent(){const e=this._getResolver(),t=e.getDefaultKeybindings(),i=e.getDefaultBoundCommands();return FV._getDefaultKeybindings(t)+` -`+BV._getAllCommandsAsComment(i)}static _getDefaultKeybindings(e){const t=new VZt;t.writeLine("[");const i=e.length-1;return e.forEach((n,o)=>{qst.writeKeybindingItem(t,n),o!==i?t.writeLine(","):t.writeLine()}),t.writeLine("]"),t.toString()}static _getAllCommandsAsComment(e){const i=oit(e).sort().join(` +`+FV._getAllCommandsAsComment(i)}static _getDefaultKeybindings(e){const t=new LZt;t.writeLine("[");const i=e.length-1;return e.forEach((n,o)=>{Wst.writeKeybindingItem(t,n),o!==i?t.writeLine(","):t.writeLine()}),t.writeLine("]"),t.toString()}static _getAllCommandsAsComment(e){const i=Jtt(e).sort().join(` // - `);return"// "+g(3515,"Here are other available commands: ")+` -// - `+i}mightProducePrintableCharacter(e){if(e.ctrlKey||e.metaKey||e.altKey)return!1;const t=Vp.toEnum(e.code);if($Zt.indexOf(t)!==-1)return!!(e.keyCode===Vg[t]||Qt&&e.keyCode===Gb.get(t));if(Vg[t]!==-1)return!1;const n=this.keyboardLayoutService.getRawKeyboardMapping();if(!n)return!1;const o=n[e.code];return!(!o||!o.value||/\s/.test(o.value))}};vke=BV=D([_(0,Le),_(1,vi),_(2,Yi),_(3,bi),_(4,ug),_(5,xc),_(6,fs),_(7,Jt),_(8,ks),_(9,Ge),_(10,Oae)],vke);class GZt extends V{get keybindings(){return this._keybindings}constructor(e,t,i,n){super(),this.userDataProfileService=e,this.uriIdentityService=t,this.fileService=i,this._rawKeybindings=[],this._keybindings=[],this.watchDisposables=this._register(new Z),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.watch(),this.reloadConfigurationScheduler=this._register(new cn(()=>this.reload().then(o=>{o&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,o=>o.contains(this.userDataProfileService.currentProfile.keybindingsResource))(()=>{n.debug("Keybindings file changed"),this.reloadConfigurationScheduler.schedule()})),this._register(this.fileService.onDidRunOperation(o=>{o.operation===Ai.WRITE&&o.resource.toString()===this.userDataProfileService.currentProfile.keybindingsResource.toString()&&(n.debug("Keybindings file written"),this.reloadConfigurationScheduler.schedule())})),this._register(e.onDidChangeCurrentProfile(o=>{this.uriIdentityService.extUri.isEqual(o.previous.keybindingsResource,o.profile.keybindingsResource)||o.join(this.whenCurrentProfileChanged())}))}async whenCurrentProfileChanged(){this.watch(),this.reloadConfigurationScheduler.schedule()}watch(){this.watchDisposables.clear(),this.watchDisposables.add(this.fileService.watch(Lr(this.userDataProfileService.currentProfile.keybindingsResource))),this.watchDisposables.add(this.fileService.watch(this.userDataProfileService.currentProfile.keybindingsResource))}async initialize(){await this.reload()}async reload(){const e=await this.readUserKeybindings();return Ys(this._rawKeybindings,e)?!1:(this._rawKeybindings=e,this._keybindings=this._rawKeybindings.map(t=>qst.readUserKeybindingItem(t)),!0)}async readUserKeybindings(){try{const e=await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource),t=sf(e.value.toString());return Array.isArray(t)?t.filter(i=>i&&typeof i=="object"):[]}catch{return[]}}}const CO=class CO{constructor(){this.commandsSchemas=[],this.commandsEnum=[],this.removalCommandsEnum=[],this.commandsEnumDescriptions=[],this.schema={id:CO.schemaId,type:"array",title:g(3516,"Keybindings configuration"),allowTrailingCommas:!0,allowComments:!0,definitions:{editorGroupsSchema:{type:"array",items:{type:"object",properties:{groups:{$ref:"#/definitions/editorGroupsSchema",default:[{},{}]},size:{type:"number",default:.5}}}},commandNames:{type:"string",enum:this.commandsEnum,enumDescriptions:this.commandsEnumDescriptions,description:g(3517,"Name of the command to execute")},commandType:{anyOf:[{$ref:"#/definitions/commandNames"},{type:"string",enum:this.removalCommandsEnum,enumDescriptions:this.commandsEnumDescriptions,description:g(3518,"Name of the command to remove keyboard shortcut for")},{type:"string"}]},commandsSchemas:{allOf:this.commandsSchemas}},items:{required:["key"],type:"object",defaultSnippets:[{body:{key:"$1",command:"$2",when:"$3"}}],properties:{key:{type:"string",description:g(3519,"Key or key sequence (separated by space)")},command:{anyOf:[{if:{type:"array"},then:{not:{type:"array"},errorMessage:g(3520,`Incorrect type. Expected "{0}". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.`,"string")},else:{$ref:"#/definitions/commandType"}},{$ref:"#/definitions/commandType"}]},when:{type:"string",description:g(3521,"Condition when the key is active.")},args:{description:g(3522,"Arguments to pass to the command to execute.")}},$ref:"#/definitions/commandsSchemas"}},this.schemaRegistry=Qe.as(YA.JSONContribution),this.schemaRegistry.registerSchema(CO.schemaId,this.schema)}updateSchema(e){this.commandsSchemas.length=0,this.commandsEnum.length=0,this.removalCommandsEnum.length=0,this.commandsEnumDescriptions.length=0;const t=new Set,i=(r,a)=>{/^_/.test(r)||t.has(r)||(t.add(r),this.commandsEnum.push(r),this.commandsEnumDescriptions.push(GLe(a)?a.value:a),this.removalCommandsEnum.push(`-${r}`))},n=_t.getCommands();for(const[r,a]of n){const c=a.metadata;if(i(r,c?.description),!c||!c.args||c.args.length!==1||!c.args[0].schema)continue;const l=c.args[0].schema,d=typeof c.args[0].isOptional<"u"?!c.args[0].isOptional:Array.isArray(l.required)&&l.required.length>0,h={if:{required:["command"],properties:{command:{const:r}}},then:{required:[].concat(d?["args"]:[]),properties:{args:l}}};this.commandsSchemas.push(h)}const o=jn.getCommands();for(const r of o.keys())i(r);this.commandsSchemas.push(...e),this.schemaRegistry.notifySchemaChanged(CO.schemaId)}};CO.schemaId="vscode://schemas/keybindings";let bke=CO;function Zie(s){return s.name?s.name:s.id?s.id:s.layout}function KZt(s){const e=s,t={};for(const i in e){const n=e[i];if(n.length){const o=n[0],r=n[1],a=n[2],c=n[3],l=Number(n[4]),d=n.length===6?n[5]:void 0;t[i]={value:o,vkey:d,withShift:r,withAltGr:a,withShiftAltGr:c,valueIsDeadKey:(l&1)>0,withShiftIsDeadKey:(l&2)>0,withAltGrIsDeadKey:(l&4)>0,withShiftAltGrIsDeadKey:(l&8)>0}}else t[i]={value:"",valueIsDeadKey:!1,withShift:"",withShiftIsDeadKey:!1,withAltGr:"",withAltGrIsDeadKey:!1,withShiftAltGr:"",withShiftAltGrIsDeadKey:!1}}return t}class ile{constructor(e,t,i,n){this.layout=e,this.secondaryLayouts=t,this.mapping=KZt(i),this.isUserKeyboardLayout=!!n,this.layout.isUserKeyboardLayout=!!n}static createKeyboardLayoutFromDebugInfo(e,t,i){const n=new ile(e,[],{},!0);return n.mapping=t,n}update(e){this.layout=e.layout,this.secondaryLayouts=e.secondaryLayouts,this.mapping=e.mapping,this.isUserKeyboardLayout=e.isUserKeyboardLayout,this.layout.isUserKeyboardLayout=e.isUserKeyboardLayout}getScore(e){let t=0;for(const i in e){if(Qn&&(i==="Backslash"||i==="KeyQ")||pr&&(i==="Backspace"||i==="Escape"))continue;const n=this.mapping[i];n===void 0&&(t-=1);const o=e[i];n&&o&&n.value!==o.value&&(t-=1)}return t}equal(e){return this.isUserKeyboardLayout!==e.isUserKeyboardLayout||Zie(this.layout)!==Zie(e.layout)?!1:this.fuzzyEqual(e.mapping)}fuzzyEqual(e){for(const t in e){if(Qn&&(t==="Backslash"||t==="KeyQ"))continue;if(this.mapping[t]===void 0)return!1;const i=this.mapping[t],n=e[t];if(i.value!==n.value)return!1}return!0}}var Z$;(function(s){s[s.Code=0]="Code",s[s.KeyCode=1]="KeyCode"})(Z$||(Z$={}));function qZt(s){const e=s.getValue("keyboard"),t=e?.dispatch==="keyCode"?Z$.KeyCode:Z$.Code,i=!!e?.mapAltGrToCtrlAlt;return{dispatch:t,mapAltGrToCtrlAlt:i}}const QZt=Qe.as(Nn.Configuration),jZt={id:"keyboard",order:15,type:"object",title:g(8664,"Keyboard"),properties:{"keyboard.dispatch":{scope:at.APPLICATION,type:"string",enum:["code","keyCode"],default:"code",markdownDescription:g(8665,"Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."),included:po===Ds.Macintosh||po===Ds.Linux},"keyboard.mapAltGrToCtrlAlt":{scope:at.APPLICATION,type:"boolean",default:!1,markdownDescription:g(8666,"Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."),included:po===Ds.Windows}}};QZt.registerConfiguration(jZt);class YZt{constructor(e){this._actual=e,this._cache=new Map}dumpDebugInfo(){return this._actual.dumpDebugInfo()}resolveKeyboardEvent(e){return this._actual.resolveKeyboardEvent(e)}resolveKeybinding(e){const t=e.getHashCode(),i=this._cache.get(t);if(!i){const n=this._actual.resolveKeybinding(e);return this._cache.set(t,n),n}return i}}class WV extends OLe{constructor(e,t){super(Ds.Windows,t),this._mapper=e}_getLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getUILabelForKeyCode(e.keyCode)}_getUSLabelForKeybinding(e){return e.isDuplicateModifierCase()?"":Ia.toString(e.keyCode)}getUSLabel(){return p6.toLabel(this._os,this._chords,e=>this._getUSLabelForKeybinding(e))}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getAriaLabelForKeyCode(e.keyCode)}_getElectronAccelerator(e){return this._mapper.getElectronAcceleratorForKeyBinding(e)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=this._mapper.getUserSettingsLabelForKeyCode(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(e){return this.__isWYSIWYG(e.keyCode)}__isWYSIWYG(e){if(e===S.LeftArrow||e===S.UpArrow||e===S.RightArrow||e===S.DownArrow)return!0;const t=this._mapper.getAriaLabelForKeyCode(e),i=this._mapper.getUserSettingsLabelForKeyCode(e);return t===i}_getChordDispatch(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+=Ia.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===S.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===S.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===S.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===S.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static getProducedCharCode(e,t){return t?e.ctrlKey&&e.shiftKey&&e.altKey?t.withShiftAltGr:e.ctrlKey&&e.altKey?t.withAltGr:e.shiftKey?t.withShift:t.value:null}static getProducedChar(e,t){const i=this.getProducedCharCode(e,t);return i===null||i.length===0?" --- ":" "+i+" "}}class JZt{constructor(e,t,i){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._keyCodeToLabel=[],this._scanCodeToKeyCode=[],this._keyCodeToLabel=[],this._keyCodeExists=[],this._keyCodeToLabel[S.Unknown]=Ia.toString(S.Unknown);for(let a=X.None;a1)this._keyCodeToLabel[m]=h;else{const b=h.charCodeAt(0);if(b>=B.a&&b<=B.z){const w=B.A+(b-B.a);n[w]=!0,o=!0,this._keyCodeToLabel[m]=String.fromCharCode(B.A+(b-B.a))}else b>=B.A&&b<=B.Z?(n[b]=!0,o=!0,this._keyCodeToLabel[m]=h):this._keyCodeToLabel[m]=h}}const r=(a,c)=>{n[a]||(this._keyCodeToLabel[c]=String.fromCharCode(a))};if(r(B.A,S.KeyA),r(B.B,S.KeyB),r(B.C,S.KeyC),r(B.D,S.KeyD),r(B.E,S.KeyE),r(B.F,S.KeyF),r(B.G,S.KeyG),r(B.H,S.KeyH),r(B.I,S.KeyI),r(B.J,S.KeyJ),r(B.K,S.KeyK),r(B.L,S.KeyL),r(B.M,S.KeyM),r(B.N,S.KeyN),r(B.O,S.KeyO),r(B.P,S.KeyP),r(B.Q,S.KeyQ),r(B.R,S.KeyR),r(B.S,S.KeyS),r(B.T,S.KeyT),r(B.U,S.KeyU),r(B.V,S.KeyV),r(B.W,S.KeyW),r(B.X,S.KeyX),r(B.Y,S.KeyY),r(B.Z,S.KeyZ),!o){const a=(c,l)=>{this._keyCodeToLabel[c]=String.fromCharCode(l)};a(S.Semicolon,B.Semicolon),a(S.Equal,B.Equals),a(S.Comma,B.Comma),a(S.Minus,B.Dash),a(S.Period,B.Period),a(S.Slash,B.Slash),a(S.Backquote,B.BackTick),a(S.BracketLeft,B.OpenSquareBracket),a(S.Backslash,B.Backslash),a(S.BracketRight,B.CloseSquareBracket),a(S.Quote,B.SingleQuote)}}dumpDebugInfo(){const e=[],t=[X.ArrowUp,X.Numpad0];let i=0;e.push("-----------------------------------------------------------------------------------------------------------------------------------------");for(let n=X.None;nthis._resolveChord(i)));return t.length>0?[new WV(this,t)]:[]}}const yz=[];class v9e extends OLe{constructor(e,t,i){super(t,i),this._mapper=e}_getLabel(e){return this._mapper.getUILabelForScanCodeChord(e)}_getAriaLabel(e){return this._mapper.getAriaLabelForScanCodeChord(e)}_getElectronAccelerator(e){return this._mapper.getElectronAcceleratorLabelForScanCodeChord(e)}_getUserSettingsLabel(e){return this._mapper.getUserSettingsLabelForScanCodeChord(e)}_isWYSIWYG(e){if(!e||Vg[e.scanCode]!==S.DependsOnKbLayout)return!0;const t=this._mapper.getAriaLabelForScanCodeChord(e),i=this._mapper.getUserSettingsLabelForScanCodeChord(e);return!t&&!i?!0:!t||!i?!1:t.toLowerCase()===i.toLowerCase()}_getChordDispatch(e){return this._mapper.getDispatchStrForScanCodeChord(e)}_getSingleModifierChordDispatch(e){return(e.scanCode===X.ControlLeft||e.scanCode===X.ControlRight)&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":(e.scanCode===X.AltLeft||e.scanCode===X.AltRight)&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":(e.scanCode===X.ShiftLeft||e.scanCode===X.ShiftRight)&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":(e.scanCode===X.MetaLeft||e.scanCode===X.MetaRight)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}}class Cz{constructor(e,t,i,n){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.scanCode=n}toString(){return`${this.ctrlKey?"Ctrl+":""}${this.shiftKey?"Shift+":""}${this.altKey?"Alt+":""}${Vp.toString(this.scanCode)}`}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.scanCode===e.scanCode}getProducedCharCode(e){return e?this.ctrlKey&&this.shiftKey&&this.altKey?e.withShiftAltGr:this.ctrlKey&&this.altKey?e.withAltGr:this.shiftKey?e.withShift:e.value:""}getProducedChar(e){const t=i_.getCharCode(this.getProducedCharCode(e));return t===0?" --- ":t>=B.U_Combining_Grave_Accent&&t<=B.U_Combining_Latin_Small_Letter_X?"U+"+t.toString(16):" "+String.fromCharCode(t)+" "}}class wke{constructor(e,t,i,n){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.keyCode=n}toString(){return`${this.ctrlKey?"Ctrl+":""}${this.shiftKey?"Shift+":""}${this.altKey?"Alt+":""}${Ia.toString(this.keyCode)}`}}class XZt{constructor(){this._scanCodeToKeyCode=[],this._keyCodeToScanCode=[],this._scanCodeToKeyCode=[],this._keyCodeToScanCode=[]}registrationComplete(){this._moveToEnd(X.IntlHash),this._moveToEnd(X.IntlBackslash)}_moveToEnd(e){for(let t=0;t<8;t++){const i=this._scanCodeToKeyCode[(e<<3)+t];if(i)for(let n=0,o=i.length;n>>3===e){for(let h=a+1;h=S.Digit0&&t.keyCode<=S.Digit9,r=t.keyCode>=S.KeyA&&t.keyCode<=S.KeyZ,a=this._scanCodeToKeyCode[i];if(o||r){if(a){for(let c=0,l=a.length;c>>3;n[o]=new Cz(c,l,d,h)}return n}lookupScanCodeCombo(e){const t=this._encodeScanCodeCombo(e),i=this._scanCodeToKeyCode[t];if(!i||i.length===0)return[];const n=[];for(let o=0,r=i.length;o>>3;n[o]=new wke(c,l,d,h)}return n}guessStableKeyCode(e){if(e>=X.Digit1&&e<=X.Digit0)switch(e){case X.Digit1:return S.Digit1;case X.Digit2:return S.Digit2;case X.Digit3:return S.Digit3;case X.Digit4:return S.Digit4;case X.Digit5:return S.Digit5;case X.Digit6:return S.Digit6;case X.Digit7:return S.Digit7;case X.Digit8:return S.Digit8;case X.Digit9:return S.Digit9;case X.Digit0:return S.Digit0}const t=this.lookupScanCodeCombo(new Cz(!1,!1,!1,e)),i=this.lookupScanCodeCombo(new Cz(!1,!0,!1,e));if(t.length===1&&i.length===1){const n=t[0].shiftKey,o=t[0].keyCode,r=i[0].shiftKey,a=i[0].keyCode;if(o===a&&n!==r)return o}return S.DependsOnKbLayout}_encodeScanCodeCombo(e){return this._encode(e.ctrlKey,e.shiftKey,e.altKey,e.scanCode)}_encodeKeyCodeCombo(e){return this._encode(e.ctrlKey,e.shiftKey,e.altKey,e.keyCode)}_encode(e,t,i,n){return((e?1:0)<<0|(t?1:0)<<1|(i?1:0)<<2|n<<3)>>>0}}class i_{constructor(e,t,i,n){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._OS=n,this._scanCodeToLabel=[],this._scanCodeToDispatch=[],this._codeInfo=[],this._scanCodeKeyCodeMapper=new XZt,this._scanCodeToLabel=[],this._scanCodeToDispatch=[];const o=(d,h,u,f,p,m,v,b)=>{this._scanCodeKeyCodeMapper.registerIfUnknown(new Cz(!!d,!!h,!!u,f),new wke(!!p,!!m,!!v,b))},r=(d,h,u,f,p)=>{for(let m=d;m<=1;m++)for(let v=h;v<=1;v++)for(let b=u;b<=1;b++)o(m,v,b,f,m,v,b,p)};for(let d=X.None;d=B.a&&m<=B.z){const v=B.A+(m-B.a);d[v]=!0}}const h=(u,f,p,m)=>{d[u]||(a[Vp.toString(f)]={value:p,withShift:m,withAltGr:"",withShiftAltGr:""})};h(B.A,X.KeyA,"a","A"),h(B.B,X.KeyB,"b","B"),h(B.C,X.KeyC,"c","C"),h(B.D,X.KeyD,"d","D"),h(B.E,X.KeyE,"e","E"),h(B.F,X.KeyF,"f","F"),h(B.G,X.KeyG,"g","G"),h(B.H,X.KeyH,"h","H"),h(B.I,X.KeyI,"i","I"),h(B.J,X.KeyJ,"j","J"),h(B.K,X.KeyK,"k","K"),h(B.L,X.KeyL,"l","L"),h(B.M,X.KeyM,"m","M"),h(B.N,X.KeyN,"n","N"),h(B.O,X.KeyO,"o","O"),h(B.P,X.KeyP,"p","P"),h(B.Q,X.KeyQ,"q","Q"),h(B.R,X.KeyR,"r","R"),h(B.S,X.KeyS,"s","S"),h(B.T,X.KeyT,"t","T"),h(B.U,X.KeyU,"u","U"),h(B.V,X.KeyV,"v","V"),h(B.W,X.KeyW,"w","W"),h(B.X,X.KeyX,"x","X"),h(B.Y,X.KeyY,"y","Y"),h(B.Z,X.KeyZ,"z","Z")}const c=[];let l=0;for(const d in t)if(t.hasOwnProperty(d)){const h=Vp.toEnum(d);if(h===X.None||Vg[h]!==S.DependsOnKbLayout)continue;this._codeInfo[h]=t[d];const u=a[d]||t[d],f=i_.getCharCode(u.value),p=i_.getCharCode(u.withShift),m=i_.getCharCode(u.withAltGr),v=i_.getCharCode(u.withShiftAltGr),b={scanCode:h,value:f,withShift:p,withAltGr:m,withShiftAltGr:v};if(c[l++]=b,this._scanCodeToDispatch[h]=`[${Vp.toString(h)}]`,f>=B.a&&f<=B.z){const w=B.A+(f-B.a);this._scanCodeToLabel[h]=String.fromCharCode(w)}else f>=B.A&&f<=B.Z?this._scanCodeToLabel[h]=String.fromCharCode(f):f?this._scanCodeToLabel[h]=String.fromCharCode(f):this._scanCodeToLabel[h]=null}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withShiftAltGr;if(f===h.withAltGr||f===h.withShift||f===h.value)continue;const p=i_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?o(1,1,1,u,0,1,0,v):o(1,1,1,u,0,0,0,v)}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withAltGr;if(f===h.withShift||f===h.value)continue;const p=i_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?o(1,0,1,u,0,1,0,v):o(1,0,1,u,0,0,0,v)}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withShift;if(f===h.value)continue;const p=i_._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?(o(0,1,0,u,0,1,0,v),o(0,1,1,u,0,1,1,v),o(1,1,0,u,1,1,0,v),o(1,1,1,u,1,1,1,v)):(o(0,1,0,u,0,0,0,v),o(0,1,0,u,0,1,0,v),o(0,1,1,u,0,0,1,v),o(0,1,1,u,0,1,1,v),o(1,1,0,u,1,0,0,v),o(1,1,0,u,1,1,0,v),o(1,1,1,u,1,0,1,v),o(1,1,1,u,1,1,1,v))}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=i_._charCodeToKb(h.value);if(!f)continue;const p=f.shiftKey,m=f.keyCode;p?(o(0,0,0,u,0,1,0,m),o(0,0,1,u,0,1,1,m),o(1,0,0,u,1,1,0,m),o(1,0,1,u,1,1,1,m)):(o(0,0,0,u,0,0,0,m),o(0,0,1,u,0,0,1,m),o(0,1,0,u,0,1,0,m),o(0,1,1,u,0,1,1,m),o(1,0,0,u,1,0,0,m),o(1,0,1,u,1,0,1,m),o(1,1,0,u,1,1,0,m),o(1,1,1,u,1,1,1,m))}r(0,0,0,X.Digit1,S.Digit1),r(0,0,0,X.Digit2,S.Digit2),r(0,0,0,X.Digit3,S.Digit3),r(0,0,0,X.Digit4,S.Digit4),r(0,0,0,X.Digit5,S.Digit5),r(0,0,0,X.Digit6,S.Digit6),r(0,0,0,X.Digit7,S.Digit7),r(0,0,0,X.Digit8,S.Digit8),r(0,0,0,X.Digit9,S.Digit9),r(0,0,0,X.Digit0,S.Digit0),this._scanCodeKeyCodeMapper.registrationComplete()}dumpDebugInfo(){const e=[],t=[X.ArrowUp,X.Numpad0];let i=0;e.push(`isUSStandard: ${this._isUSStandard}`),e.push("----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");for(let n=X.None;n=0){const a=m8[i];a!==X.DependsOnKbLayout&&(t=a)}const n=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,o=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,r=new gy(n,e.shiftKey,o,e.metaKey,t);return new v9e(this,this._OS,[r])}_resolveChord(e){return e?e instanceof gy?[e]:this.keyCodeChordToScanCodeChord(e):[]}resolveKeybinding(e){const t=e.chords.map(i=>this._resolveChord(i));return this._toResolvedKeybinding(t)}static _redirectCharCode(e){switch(e){case B.U_IDEOGRAPHIC_FULL_STOP:return B.Period;case B.U_LEFT_CORNER_BRACKET:return B.OpenSquareBracket;case B.U_RIGHT_CORNER_BRACKET:return B.CloseSquareBracket;case B.U_LEFT_BLACK_LENTICULAR_BRACKET:return B.OpenSquareBracket;case B.U_RIGHT_BLACK_LENTICULAR_BRACKET:return B.CloseSquareBracket;case B.U_FULLWIDTH_SEMICOLON:return B.Semicolon;case B.U_FULLWIDTH_COMMA:return B.Comma}return e}static _charCodeToKb(e){return e=this._redirectCharCode(e),eimport("./layout.contribution.darwin-gdaUfoJf.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.default??e);case"./keyboardLayouts/layout.contribution.linux.js":return FT(()=>import("./layout.contribution.linux-xMjRz7iy.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.default??e);case"./keyboardLayouts/layout.contribution.win.js":return FT(()=>import("./layout.contribution.win-DZRWibbm.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.default??e);default:return new Promise(function(e,t){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+s)))})}}class eei extends V{get activeKeymap(){return this._activeKeymapInfo}get keymapInfos(){return this._keymapInfos}get activeKeyboardLayout(){return this._initialized?this._activeKeymapInfo?.layout??null:null}get activeKeyMapping(){return this._initialized?this._activeKeymapInfo?.mapping??null:null}get keyboardLayouts(){return this._keymapInfos.map(e=>e.layout)}constructor(e){super(),this._configurationService=e,this._onDidChangeKeyboardMapper=new I,this.onDidChangeKeyboardMapper=this._onDidChangeKeyboardMapper.event,this.keyboardLayoutMapAllowed=navigator.keyboard!==void 0,this._keyboardMapper=null,this._initialized=!1,this._keymapInfos=[],this._mru=[],this._activeKeymapInfo=null,navigator.keyboard&&navigator.keyboard.addEventListener&&navigator.keyboard.addEventListener("layoutchange",()=>{this._getBrowserKeyMapping().then(t=>{this.isKeyMappingActive(t)||this.setLayoutFromBrowserAPI()})}),this._register(this._configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration("keyboard")&&(this._keyboardMapper=null,this._onDidChangeKeyboardMapper.fire())}))}registerKeyboardLayout(e){this._keymapInfos.push(e),this._mru=this._keymapInfos}removeKeyboardLayout(e){let t=this._mru.indexOf(e);this._mru.splice(t,1),t=this._keymapInfos.indexOf(e),this._keymapInfos.splice(t,1)}getMatchedKeymapInfo(e){if(!e)return null;const t=this.getUSStandardLayout();if(t){let i=t.getScore(e);if(i===0)return{result:t,score:0};let n=t;for(let o=0;oi){if(r===0)return{result:this._mru[o],score:0};i=r,n=this._mru[o]}}return{result:n,score:i}}for(let i=0;it.layout.isUSStandard);return e.length?e[0]:null}isKeyMappingActive(e){return this._activeKeymapInfo&&e&&this._activeKeymapInfo.fuzzyEqual(e)}setUSKeyboardLayout(){this._activeKeymapInfo=this.getUSStandardLayout()}setActiveKeyMapping(e){let t=!1;const i=this.getMatchedKeymapInfo(e);if(i&&(this._activeKeymapInfo?e&&i.result.getScore(e)>this._activeKeymapInfo.getScore(e)&&(this._activeKeymapInfo=i.result,t=!0):(this._activeKeymapInfo=i.result,t=!0)),this._activeKeymapInfo||(this._activeKeymapInfo=this.getUSStandardLayout(),t=!0),!this._activeKeymapInfo||!t)return;const n=this._mru.indexOf(this._activeKeymapInfo);this._mru.splice(n,1),this._mru.unshift(this._activeKeymapInfo),this._setKeyboardData(this._activeKeymapInfo)}setActiveKeymapInfo(e){this._activeKeymapInfo=e;const t=this._mru.indexOf(this._activeKeymapInfo);t!==0&&(this._mru.splice(t,1),this._mru.unshift(this._activeKeymapInfo),this._setKeyboardData(this._activeKeymapInfo))}setLayoutFromBrowserAPI(){this._updateKeyboardLayoutAsync(this._initialized)}_updateKeyboardLayoutAsync(e,t){e&&this._getBrowserKeyMapping(t).then(i=>{this.isKeyMappingActive(i)||this.setActiveKeyMapping(i)})}getKeyboardMapper(){const e=qZt(this._configurationService);return e.dispatch===Z$.KeyCode||!this._initialized||!this._activeKeymapInfo?new Rve(e.mapAltGrToCtrlAlt,po):(this._keyboardMapper||(this._keyboardMapper=new YZt(Qst._createKeyboardMapper(this._activeKeymapInfo,e.mapAltGrToCtrlAlt))),this._keyboardMapper)}validateCurrentKeyboardMapping(e){!this._initialized||this._validateCurrentKeyboardMapping(e)||this._updateKeyboardLayoutAsync(!0,e)}setKeyboardLayout(e){const t=this.keymapInfos.filter(i=>Zie(i.layout)===e);t.length>0&&this.setActiveKeymapInfo(t[0])}_setKeyboardData(e){this._initialized=!0,this._keyboardMapper=null,this._onDidChangeKeyboardMapper.fire()}static _createKeyboardMapper(e,t){const i=e.mapping,n=!!e.layout.isUSStandard;return po===Ds.Windows?new JZt(n,i,t):Object.keys(i).length===0?new Rve(t,po):new i_(n,i,t,po)}_validateCurrentKeyboardMapping(e){if(!this._initialized)return!0;const t=e,i=this._activeKeymapInfo;if(!i||t.browserEvent.key==="Dead"||t.browserEvent.isComposing)return!0;const n=i.mapping[t.code];if(!n)return!1;if(n.value==="")return(e.ctrlKey||e.metaKey)&&setTimeout(()=>{this._getBrowserKeyMapping().then(a=>{this.isKeyMappingActive(a)||this.setLayoutFromBrowserAPI()})},350),!0;const o=t.altKey&&t.shiftKey?n.withShiftAltGr:t.altKey?n.withAltGr:t.shiftKey?n.withShift:n.value,r=t.altKey&&t.shiftKey&&n.withShiftAltGrIsDeadKey||t.altKey&&n.withAltGrIsDeadKey||t.shiftKey&&n.withShiftIsDeadKey||n.valueIsDeadKey;return!(r&&t.browserEvent.key!=="Dead"||!r&&t.browserEvent.key!==o)}async _getBrowserKeyMapping(e){if(this.keyboardLayoutMapAllowed)try{return await navigator.keyboard.getLayoutMap().then(t=>{const i={};for(const n of t)i[n[0]]={value:n[1],withShift:"",withAltGr:"",withShiftAltGr:""};return i})}catch{this.keyboardLayoutMapAllowed=!1}if(e&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.metaKey){const t={},i=e;return t[i.browserEvent.code]={value:i.browserEvent.key,withShift:"",withAltGr:"",withShiftAltGr:""},this.getMatchedKeymapInfo(t)?t:null}return null}}class Qst extends eei{constructor(e,t,i,n){super(e),ZZt("./keyboardLayouts/layout.contribution."+(Qn?"win":Qt?"darwin":"linux")+".js").then(r=>{const a=r.KeyboardLayoutContribution.INSTANCE.layoutInfos;this._keymapInfos.push(...a.map(c=>new ile(c.layout,c.secondaryLayouts,c.mapping,c.isUserKeyboardLayout))),this._mru=this._keymapInfos,this._initialized=!0,this.setLayoutFromBrowserAPI()})}}class tei extends V{get keyboardLayout(){return this._keyboardLayout}constructor(e,t){super(),this.keyboardLayoutResource=e,this.fileService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._keyboardLayout=null,this.reloadConfigurationScheduler=this._register(new cn(()=>this.reload().then(i=>{i&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,i=>i.contains(this.keyboardLayoutResource))(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){await this.reload()}async reload(){const e=this._keyboardLayout;try{const t=await this.fileService.readFile(this.keyboardLayoutResource),i=sf(t.value.toString());if(sD(i)==="object"){const n=i.layout,o=i.rawMapping;this._keyboardLayout=ile.createKeyboardLayoutFromDebugInfo(n,o,!0)}else this._keyboardLayout=null}catch{this._keyboardLayout=null}return e?!Ys(e,this._keyboardLayout):!0}}let yke=class extends V{constructor(e,t,i,n,o,r){super(),this.configurationService=r,this._onDidChangeKeyboardLayout=new I,this.onDidChangeKeyboardLayout=this._onDidChangeKeyboardLayout.event;const c=r.getValue("keyboard").layout;this._keyboardLayoutMode=c??"autodetect",this._factory=new Qst(r,i,n,o),this._register(this._factory.onDidChangeKeyboardMapper(()=>{this._onDidChangeKeyboardLayout.fire()})),c&&c!=="autodetect"&&this._factory.setKeyboardLayout(c),this._register(r.onDidChangeConfiguration(l=>{if(l.affectsConfiguration("keyboard.layout")){const h=r.getValue("keyboard").layout;this._keyboardLayoutMode=h,h==="autodetect"?this._factory.setLayoutFromBrowserAPI():this._factory.setKeyboardLayout(h)}})),this._userKeyboardLayout=new tei(e.keyboardLayoutResource,t),this._userKeyboardLayout.initialize().then(()=>{this._userKeyboardLayout.keyboardLayout&&(this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout),this.setUserKeyboardLayoutIfMatched())}),this._register(this._userKeyboardLayout.onDidChange(()=>{const l=this._factory.keymapInfos.filter(d=>d.isUserKeyboardLayout);l.length?this._userKeyboardLayout.keyboardLayout?l[0].update(this._userKeyboardLayout.keyboardLayout):this._factory.removeKeyboardLayout(l[0]):this._userKeyboardLayout.keyboardLayout&&this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout),this.setUserKeyboardLayoutIfMatched()}))}setUserKeyboardLayoutIfMatched(){const t=this.configurationService.getValue("keyboard").layout;t&&this._userKeyboardLayout.keyboardLayout&&Zie(this._userKeyboardLayout.keyboardLayout.layout)===t&&this._factory.activeKeymap&&(this._userKeyboardLayout.keyboardLayout.equal(this._factory.activeKeymap)||this._factory.setActiveKeymapInfo(this._userKeyboardLayout.keyboardLayout))}getKeyboardMapper(){return this._factory.getKeyboardMapper()}getCurrentKeyboardLayout(){return this._factory.activeKeyboardLayout}getAllKeyboardLayouts(){return this._factory.keyboardLayouts}getRawKeyboardMapping(){return this._factory.activeKeyMapping}validateCurrentKeyboardMapping(e){this._keyboardLayoutMode==="autodetect"&&this._factory.validateCurrentKeyboardMapping(e)}};yke=D([_(0,Za),_(1,Jt),_(2,bi),_(3,$i),_(4,vi),_(5,Te)],yke);const iei=Qe.as(Nn.Configuration),nei={id:"keyboard",order:15,type:"object",title:g(3523,"Keyboard"),properties:{"keyboard.layout":{type:"string",default:"autodetect",description:g(3524,"Control the keyboard layout used in web.")}}};iei.registerConfiguration(nei);let Cke=class extends V{constructor(e,t,i){super(),this._instantiationService=e,this._extensionService=t,this._logService=i,this._extensionHostIsReady=!1,this._onWillExecuteCommand=this._register(new I),this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new I,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._extensionService.whenInstalledExtensionsRegistered().then(n=>this._extensionHostIsReady=n),this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Promise.race([this._extensionService.activateByEvent("*"),Sr(3e4)])),this._starActivation}async executeCommand(e,...t){this._logService.trace("CommandService#executeCommand",e);const i=`onCommand:${e}`;return _t.getCommand(e)?this._extensionService.activationEventIsDone(i)?this._tryExecuteCommand(e,t):this._extensionHostIsReady?(await this._extensionService.activateByEvent(i),this._tryExecuteCommand(e,t)):(this._extensionService.activateByEvent(i),this._tryExecuteCommand(e,t)):(await Promise.all([this._extensionService.activateByEvent(i),Promise.race([this._activateStar(),M.toPromise(M.filter(_t.onDidRegisterCommand,o=>o===e))])]),this._tryExecuteCommand(e,t))}_tryExecuteCommand(e,t){const i=_t.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction(i.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};Cke=D([_(0,we),_(1,fs),_(2,Ge)],Cke);let Ske=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.contextKeyService=e,this.contextService=t,this.configurationService=i,this.environmentService=n,this.productService=o,this.editorGroupService=r,this.editorService=a,this.layoutService=c,this.paneCompositeService=l,this.workingCopyService=d,yDt.bindTo(this.contextKeyService),CDt.bindTo(this.contextKeyService),S6.bindTo(this.contextKeyService),iRe.bindTo(this.contextKeyService),SDt.bindTo(this.contextKeyService),ADt.bindTo(this.contextKeyService),EDt.bindTo(this.contextKeyService),i1t.bindTo(this.contextKeyService).set(D6(this.environmentService.remoteAuthority)||""),this.virtualWorkspaceContext=n1t.bindTo(this.contextKeyService),this.temporaryWorkspaceContext=aJe.bindTo(this.contextKeyService),this.updateWorkspaceContextKeys(),r1t.bindTo(this.contextKeyService).set(Yp.supported(si));const h=!this.environmentService.isBuilt||this.environmentService.isExtensionDevelopment;iWe.bindTo(this.contextKeyService).set(h),Eat(iWe.key,h),xDt.bindTo(this.contextKeyService).set(this.productService.quality||""),a1t.bindTo(this.contextKeyService).set(o.embedderIdentifier),this.activeEditorGroupEmpty=l1t.bindTo(this.contextKeyService),this.activeEditorGroupIndex=d1t.bindTo(this.contextKeyService),this.activeEditorGroupLast=h1t.bindTo(this.contextKeyService),this.activeEditorGroupLocked=u1t.bindTo(this.contextKeyService),this.multipleEditorGroupsContext=g1t.bindTo(this.contextKeyService),this.editorsVisibleContext=f1t.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext=t1t.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty),this.inputFocusedContext=nRe.bindTo(this.contextKeyService),this.workbenchStateContext=J0t.bindTo(this.contextKeyService),this.updateWorkbenchStateContextKey(),this.workspaceFolderCountContext=X0t.bindTo(this.contextKeyService),this.updateWorkspaceFolderCountContextKey(),this.openFolderWorkspaceSupportContext=Z0t.bindTo(this.contextKeyService),this.openFolderWorkspaceSupportContext.set(ad||typeof this.environmentService.remoteAuthority=="string"),this.emptyWorkspaceSupportContext=rJe.bindTo(this.contextKeyService),this.emptyWorkspaceSupportContext.set(ad||typeof this.environmentService.remoteAuthority=="string"),this.enterMultiRootWorkspaceSupportContext=e1t.bindTo(this.contextKeyService),this.enterMultiRootWorkspaceSupportContext.set(ad||typeof this.environmentService.remoteAuthority=="string"),this.splitEditorsVerticallyContext=_1t.bindTo(this.contextKeyService),this.updateSplitEditorsVerticallyContext(),this.isMainWindowFullscreenContext=s1t.bindTo(this.contextKeyService),this.isAuxiliaryWindowFocusedContext=o1t.bindTo(this.contextKeyService),this.inZenModeContext=p1t.bindTo(this.contextKeyService),this.isMainEditorCenteredLayoutContext=m1t.bindTo(this.contextKeyService),this.mainEditorAreaVisibleContext=v1t.bindTo(this.contextKeyService),this.editorTabsVisibleContext=b1t.bindTo(this.contextKeyService),this.sideBarVisibleContext=w1t.bindTo(this.contextKeyService),this.titleAreaVisibleContext=C1t.bindTo(this.contextKeyService),this.titleBarStyleContext=y1t.bindTo(this.contextKeyService),this.updateTitleBarContextKeys(),this.panelPositionContext=A1t.bindTo(this.contextKeyService),this.panelPositionContext.set(B1(this.layoutService.getPanelPosition())),this.panelVisibleContext=x1t.bindTo(this.contextKeyService),this.panelVisibleContext.set(this.layoutService.isVisible($v.PANEL_PART)),this.panelMaximizedContext=D1t.bindTo(this.contextKeyService),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.panelAlignmentContext=E1t.bindTo(this.contextKeyService),this.panelAlignmentContext.set(this.layoutService.getPanelAlignment()),this.auxiliaryBarVisibleContext=S1t.bindTo(this.contextKeyService),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible($v.AUXILIARYBAR_PART)),this.registerListeners()}registerListeners(){this.editorGroupService.whenReady.then(()=>{this.updateEditorAreaContextKeys(),this.updateActiveEditorGroupContextKeys(),this.updateVisiblePanesContextKeys()}),this._register(this.editorService.onDidActiveEditorChange(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorService.onDidVisibleEditorsChange(()=>this.updateVisiblePanesContextKeys())),this._register(this.editorGroupService.onDidAddGroup(()=>this.updateEditorGroupsContextKeys())),this._register(this.editorGroupService.onDidRemoveGroup(()=>this.updateEditorGroupsContextKeys())),this._register(this.editorGroupService.onDidChangeGroupIndex(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorGroupService.onDidChangeGroupLocked(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorGroupService.onDidChangeEditorPartOptions(()=>this.updateEditorAreaContextKeys())),this._register(M.runAndSubscribe(tm,({window:e,disposables:t})=>t.add(ue(e,ke.FOCUS_IN,()=>this.updateInputContextKeys(e.document),!0)),{window:si,disposables:this._store})),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateWorkbenchStateContextKey())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>{this.updateWorkspaceFolderCountContextKey(),this.updateWorkspaceContextKeys()})),this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.editor.openSideBySideDirection")&&this.updateSplitEditorsVerticallyContext()})),this._register(this.layoutService.onDidChangeZenMode(e=>this.inZenModeContext.set(e))),this._register(this.layoutService.onDidChangeActiveContainer(()=>this.isAuxiliaryWindowFocusedContext.set(this.layoutService.activeContainer!==this.layoutService.mainContainer))),this._register(vGe(e=>{e===si.vscodeWindowId&&this.isMainWindowFullscreenContext.set(rpe(si))})),this._register(this.layoutService.onDidChangeMainEditorCenteredLayout(e=>this.isMainEditorCenteredLayoutContext.set(e))),this._register(this.layoutService.onDidChangePanelPosition(e=>this.panelPositionContext.set(e))),this._register(this.layoutService.onDidChangePanelAlignment(e=>this.panelAlignmentContext.set(e))),this._register(this.paneCompositeService.onDidPaneCompositeClose(()=>this.updateSideBarContextKeys())),this._register(this.paneCompositeService.onDidPaneCompositeOpen(()=>this.updateSideBarContextKeys())),this._register(this.layoutService.onDidChangePartVisibility(()=>{this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible($v.EDITOR_PART,si)),this.panelVisibleContext.set(this.layoutService.isVisible($v.PANEL_PART)),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible($v.AUXILIARYBAR_PART)),this.updateTitleBarContextKeys()})),this._register(this.workingCopyService.onDidChangeDirty(e=>this.dirtyWorkingCopiesContext.set(e.isDirty()||this.workingCopyService.hasDirty)))}updateVisiblePanesContextKeys(){this.editorService.visibleEditorPanes.length>0?this.editorsVisibleContext.set(!0):this.editorsVisibleContext.reset()}updateActiveEditorGroupContextKeys(){this.editorService.activeEditor?this.activeEditorGroupEmpty.reset():this.activeEditorGroupEmpty.set(!0);const e=this.editorGroupService.activeGroup;this.activeEditorGroupIndex.set(e.index+1),this.activeEditorGroupLocked.set(e.isLocked),this.updateEditorGroupsContextKeys()}updateEditorGroupsContextKeys(){const e=this.editorGroupService.count;e>1?this.multipleEditorGroupsContext.set(!0):this.multipleEditorGroupsContext.reset();const t=this.editorGroupService.activeGroup;this.activeEditorGroupLast.set(t.index===e-1)}updateEditorAreaContextKeys(){this.editorTabsVisibleContext.set(this.editorGroupService.partOptions.showTabs==="multiple")}updateInputContextKeys(e){function t(){return!!e.activeElement&&(e.activeElement.tagName==="INPUT"||e.activeElement.tagName==="TEXTAREA")}const i=t();if(this.inputFocusedContext.set(i),i){const n=Ac(e.activeElement);M.once(n.onDidBlur)(()=>{ky().document===e&&this.inputFocusedContext.set(t()),n.dispose()})}}updateWorkbenchStateContextKey(){this.workbenchStateContext.set(this.getWorkbenchStateString())}updateWorkspaceFolderCountContextKey(){this.workspaceFolderCountContext.set(this.contextService.getWorkspace().folders.length)}updateSplitEditorsVerticallyContext(){const e=UW(this.configurationService);this.splitEditorsVerticallyContext.set(e===HW.DOWN)}getWorkbenchStateString(){switch(this.contextService.getWorkbenchState()){case qi.EMPTY:return"empty";case qi.FOLDER:return"folder";case qi.WORKSPACE:return"workspace"}}updateSideBarContextKeys(){this.sideBarVisibleContext.set(this.layoutService.isVisible($v.SIDEBAR_PART))}updateTitleBarContextKeys(){this.titleAreaVisibleContext.set(this.layoutService.isVisible($v.TITLEBAR_PART,si)),this.titleBarStyleContext.set(dNe(this.configurationService))}updateWorkspaceContextKeys(){this.virtualWorkspaceContext.set(Ptt(this.contextService.getWorkspace())||""),this.temporaryWorkspaceContext.set(Py(this.contextService.getWorkspace()))}};Ske=D([_(0,Le),_(1,yi),_(2,Te),_(3,Jr),_(4,Er),_(5,Po),_(6,ei),_(7,kI),_(8,Tm),_(9,Rm)],Ske);class sei extends li{constructor(){super({id:"workbench.action.toggleKeybindingsLog",title:Pe(3525,"Toggle Keyboard Shortcuts Troubleshooting"),category:ca.Developer,f1:!0})}run(e){e.get(Ut).toggleLogging()&&e.get(vi).executeCommand(uet)}}At(sei);class oei{static hasOpenBrace(e){for(;e.scan()!==ft.EOF;)if(e.getToken()===ft.OpenBraceToken)return!0;return!1}static offsetToPosition(e,t){let i=0;const n=e.getEOL().length,o=e.getLineCount();for(let r=1;r<=o;r++){const a=e.getLineLength(r)+n,c=i+a;if(c>t)return new oe(r,t-i+1);i=c}return new oe(o,e.getLineMaxColumn(o))}static insertSnippet(e,t){const i=e.getValueLengthInRange(new F(1,1,t.lineNumber,t.column));let n;(function(f){f[f.INVALID=0]="INVALID",f[f.AFTER_OBJECT=1]="AFTER_OBJECT",f[f.BEFORE_OBJECT=2]="BEFORE_OBJECT"})(n||(n={}));let o=n.INVALID,r=-1,a=n.INVALID;const c=LLe(e.getValue());let l=0,d=0;const h=(f,p)=>{p!==n.INVALID&&l===1&&d===0?(o=p,r=f,a=p):o!==n.INVALID&&(o=n.INVALID,r=c.getTokenOffset())};for(;c.scan()!==ft.EOF;){const f=c.getPosition(),p=c.getToken();let m=!1;switch(p){case ft.OpenBracketToken:m=!0,l++,h(f,n.BEFORE_OBJECT);break;case ft.CloseBracketToken:m=!0,l--,h(f,n.INVALID);break;case ft.CommaToken:m=!0,h(f,n.BEFORE_OBJECT);break;case ft.OpenBraceToken:m=!0,d++,h(f,n.INVALID);break;case ft.CloseBraceToken:m=!0,d--,h(f,n.AFTER_OBJECT);break;case ft.Trivia:case ft.LineBreakTrivia:m=!0}if(f>=i&&(o!==n.INVALID||r!==-1)){let v,b;return o!==n.INVALID?(v=m?f:c.getTokenOffset(),b=o):(v=r,b=a),b===n.AFTER_OBJECT?{position:this.offsetToPosition(e,v),prepend:",",append:""}:(c.setPosition(v),{position:this.offsetToPosition(e,v),prepend:"",append:this.hasOpenBrace(c)?",":""})}}const u=e.getLineCount();return{position:new oe(u,e.getLineMaxColumn(u)),prepend:` -[`,append:"]"}}}var rei=".defineKeybindingWidget{padding:10px;position:absolute}.defineKeybindingWidget .message{text-align:center;width:400px}.defineKeybindingWidget .existing,.defineKeybindingWidget .monaco-inputbox,.defineKeybindingWidget .output{display:block;margin-top:10px;text-align:center;width:400px}.defineKeybindingWidget .input{text-align:center}.defineKeybindingWidget .output{display:flex;justify-content:center}.defineKeybindingWidget .existing .existingText{cursor:pointer;text-decoration:underline}.defineKeybindingWidget .output .monaco-keybinding{margin:0 4px}.monaco-editor .keybindingInfo{background-color:rgba(100,100,250,.2);box-shadow:inset 0 0 0 1px #b9b9b9}.monaco-editor .keybindingError{background-color:hsla(0,94%,69%,.2);box-shadow:inset 0 0 0 1px #b9b9b9}";ut(rei,{});const aei=oi("settings-folder-dropdown",ve.triangleDown,g(6300,"Icon for the folder dropdown button in the split JSON Settings editor."));oi("settings-more-action",ve.gear,g(6301,"Icon for the 'more actions' action in the Settings UI."));oi("keybindings-record-keys",ve.recordKeys,g(6302,"Icon for the 'record keys' action in the keybinding UI."));oi("keybindings-sort",ve.sortPrecedence,g(6303,"Icon for the 'sort by precedence' toggle in the keybinding UI."));oi("keybindings-edit",ve.edit,g(6304,"Icon for the edit action in the keybinding UI."));oi("keybindings-add",ve.add,g(6305,"Icon for the add action in the keybinding UI."));oi("settings-edit",ve.edit,g(6306,"Icon for the edit action in the Settings UI."));oi("settings-remove",ve.close,g(6307,"Icon for the remove action in the Settings UI."));oi("settings-discard",ve.discard,g(6308,"Icon for the discard action in the Settings UI."));oi("preferences-clear-input",ve.clearAll,g(6309,"Icon for clear input in the Settings and keybinding UI."));oi("preferences-filter",ve.filter,g(6310,"Icon for the button that suggests filters for the Settings UI."));oi("preferences-open-settings",ve.goToFile,g(6311,"Icon for open settings commands."));let Ake=class extends zf{constructor(e,t,i,n){super(null,e),this.contextService=t,this.contextMenuService=i,this.hoverService=n,this._folderSettingCounts=new Map;const o=this.contextService.getWorkspace();this._folder=o.folders.length===1?o.folders[0]:null,this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.onWorkspaceFoldersChanged()))}get folder(){return this._folder}set folder(e){this._folder=e,this.update()}setCount(e,t){const i=this.contextService.getWorkspaceFolder(e);if(!i)throw new Error("unknown folder");const n=i.uri;this._folderSettingCounts.set(n.toString(),t),this.update()}render(e){this.element=e,this.container=e,this.labelElement=fe(".action-title"),this.detailsElement=fe(".action-details"),this.dropDownElement=fe(".dropdown-icon.hide"+We.asCSSSelector(aei)),this.anchorElement=fe("a.action-label.folder-settings",{role:"button","aria-haspopup":"true",tabindex:"0"},this.labelElement,this.detailsElement,this.dropDownElement),this.anchorElementHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.anchorElement,"")),this._register(ue(this.anchorElement,ke.MOUSE_DOWN,t=>en.stop(t))),this._register(ue(this.anchorElement,ke.CLICK,t=>this.onClick(t))),this._register(ue(this.container,ke.KEY_UP,t=>this.onKeyUp(t))),re(this.container,this.anchorElement),this.update()}onKeyUp(e){switch(new En(e).keyCode){case S.Enter:case S.Space:this.onClick(e);return}}onClick(e){en.stop(e,!0),!this.folder||this._action.checked?this.showMenu():this._action.run(this._folder)}updateEnabled(){this.update()}updateChecked(){this.update()}onWorkspaceFoldersChanged(){const e=this._folder,t=this.contextService.getWorkspace();e&&(this._folder=t.folders.filter(i=>ji(i.uri,e.uri))[0]||t.folders[0]),this._folder=this._folder?this._folder:t.folders.length===1?t.folders[0]:null,this.update(),this._action.checked&&this._action.run(this._folder)}update(){let e=0;this._folderSettingCounts.forEach(i=>e+=i);const t=this.contextService.getWorkspace();if(this._folder){this.labelElement.textContent=this._folder.name,this.anchorElementHover.update(this._folder.name);const i=this.labelWithCount(this._action.label,e);this.detailsElement.textContent=i,this.dropDownElement.classList.toggle("hide",t.folders.length===1||!this._action.checked)}else{const i=this.labelWithCount(this._action.label,e);this.labelElement.textContent=i,this.detailsElement.textContent="",this.anchorElementHover.update(this._action.label),this.dropDownElement.classList.remove("hide")}this.anchorElement.classList.toggle("checked",this._action.checked),this.container.classList.toggle("disabled",!this._action.enabled)}showMenu(){this.contextMenuService.showContextMenu({getAnchor:()=>this.container,getActions:()=>this.getDropdownMenuActions(),getActionViewItem:()=>{},onHide:()=>{this.anchorElement.blur()}})}getDropdownMenuActions(){const e=[],t=this.contextService.getWorkspace().folders;return this.contextService.getWorkbenchState()===qi.WORKSPACE&&t.length>0&&e.push(...t.map((i,n)=>{const o=this._folderSettingCounts.get(i.uri.toString());return{id:"folderSettingsTarget"+n,label:this.labelWithCount(i.name,o),tooltip:this.labelWithCount(i.name,o),checked:!!this.folder&&ji(this.folder.uri,i.uri),enabled:!0,class:void 0,run:()=>this._action.run(i)}})),e}labelWithCount(e,t){return t&&(e+=` (${t})`),e}};Ake=D([_(1,yi),_(2,lr),_(3,ec)],Ake);let b9e=class extends pd{constructor(e,t,i,n,o,r,a){super(),this.contextService=i,this.instantiationService=n,this.environmentService=o,this.labelService=r,this.languageService=a,this._settingsTarget=null,this._onDidTargetChange=this._register(new I),this.onDidTargetChange=this._onDidTargetChange.event,this.options=t??{},this.create(e),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.onWorkbenchStateChanged())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.update()))}resetLabels(){const e=this.environmentService.remoteAuthority,t=e&&this.labelService.getHostLabel(pe.vscodeRemote,e);this.userLocalSettings.label=g(10331,"User"),this.userRemoteSettings.label=g(10332,"Remote")+(t?` [${t}]`:""),this.workspaceSettings.label=g(10333,"Workspace"),this.folderSettingsAction.label=g(10334,"Folder")}create(e){const t=re(e,fe(".settings-tabs-widget"));this.settingsSwitcherBar=this._register(new hd(t,{orientation:F_.HORIZONTAL,focusOnlyEnabledItems:!0,ariaLabel:g(10335,"Settings Switcher"),ariaRole:"tablist",actionViewItemProvider:(o,r)=>o.id==="folderSettings"?this.folderSettings:void 0})),this.userLocalSettings=new rn("userSettings","",".settings-tab",!0,()=>this.updateTarget(St.USER_LOCAL)),this.userLocalSettings.tooltip=g(10331,"User"),this.userRemoteSettings=new rn("userSettingsRemote","",".settings-tab",!0,()=>this.updateTarget(St.USER_REMOTE));const i=this.environmentService.remoteAuthority,n=i&&this.labelService.getHostLabel(pe.vscodeRemote,i);this.userRemoteSettings.tooltip=g(10332,"Remote")+(n?` [${n}]`:""),this.workspaceSettings=new rn("workspaceSettings","",".settings-tab",!1,()=>this.updateTarget(St.WORKSPACE)),this.folderSettingsAction=new rn("folderSettings","",".settings-tab",!1,async o=>{this.updateTarget(fje(o)?o.uri:St.USER_LOCAL)}),this.folderSettings=this.instantiationService.createInstance(Ake,this.folderSettingsAction),this.resetLabels(),this.update(),this.settingsSwitcherBar.push([this.userLocalSettings,this.userRemoteSettings,this.workspaceSettings,this.folderSettingsAction])}get settingsTarget(){return this._settingsTarget}set settingsTarget(e){this._settingsTarget=e,this.userLocalSettings.checked=St.USER_LOCAL===this.settingsTarget,this.userRemoteSettings.checked=St.USER_REMOTE===this.settingsTarget,this.workspaceSettings.checked=St.WORKSPACE===this.settingsTarget,this.settingsTarget instanceof N?(this.folderSettings.action.checked=!0,this.folderSettings.folder=this.contextService.getWorkspaceFolder(this.settingsTarget)):this.folderSettings.action.checked=!1}setResultCount(e,t){if(e===St.WORKSPACE){let i=g(10333,"Workspace");t&&(i+=` (${t})`),this.workspaceSettings.label=i}else if(e===St.USER_LOCAL){let i=g(10331,"User");t&&(i+=` (${t})`),this.userLocalSettings.label=i}else e instanceof N&&this.folderSettings.setCount(e,t)}updateLanguageFilterIndicators(e){if(this.resetLabels(),e){const t=this.languageService.getLanguageName(e);if(t){const i=` [${t}]`;this.userLocalSettings.label+=i,this.userRemoteSettings.label+=i,this.workspaceSettings.label+=i,this.folderSettingsAction.label+=i}}}onWorkbenchStateChanged(){this.folderSettings.folder=null,this.update(),this.settingsTarget===St.WORKSPACE&&this.contextService.getWorkbenchState()===qi.WORKSPACE&&this.updateTarget(St.USER_LOCAL)}updateTarget(e){return this.settingsTarget===e||e instanceof N&&this.settingsTarget instanceof N&&ji(this.settingsTarget,e)||(this.settingsTarget=e,this._onDidTargetChange.fire(this.settingsTarget)),Promise.resolve(void 0)}async update(){this.settingsSwitcherBar.domNode.classList.toggle("empty-workbench",this.contextService.getWorkbenchState()===qi.EMPTY),this.userRemoteSettings.enabled=!!(this.options.enableRemoteSettings&&this.environmentService.remoteAuthority),this.workspaceSettings.enabled=this.contextService.getWorkbenchState()!==qi.EMPTY,this.folderSettings.action.enabled=this.contextService.getWorkbenchState()===qi.WORKSPACE&&this.contextService.getWorkspace().folders.length>0,this.workspaceSettings.tooltip=g(10333,"Workspace")}};b9e=D([_(2,yi),_(3,we),_(4,Jr),_(5,Fs),_(6,xi)],b9e);let Eke=class extends pd{constructor(e,t,i,n,o,r){super(),this.options=t,this.contextViewService=i,this.instantiationService=n,this.contextKeyService=o,this.keybindingService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onFocus=this._register(new I),this.onFocus=this._onFocus.event,this.create(e)}create(e){this.domNode=re(e,fe("div.settings-header-widget")),this.createSearchContainer(re(this.domNode,fe("div.settings-search-container"))),this.controlsDiv=re(this.domNode,fe("div.settings-search-controls")),this.options.showResultCount&&(this.countElement=re(this.controlsDiv,fe(".settings-count-widget")),this.countElement.style.backgroundColor=ze(yT),this.countElement.style.color=ze($re),this.countElement.style.border=`1px solid ${ze(wt)}`),this.inputBox.inputElement.setAttribute("aria-live",this.options.ariaLive||"off"),this.options.ariaLabelledBy&&this.inputBox.inputElement.setAttribute("aria-labelledBy",this.options.ariaLabelledBy);const t=this._register(Ac(this.inputBox.inputElement));this._register(t.onDidFocus(()=>this._onFocus.fire()));const i=this.options.focusKey;i&&(this._register(t.onDidFocus(()=>i.set(!0))),this._register(t.onDidBlur(()=>i.set(!1))))}createSearchContainer(e){this.searchContainer=e;const t=re(this.searchContainer,fe("div.settings-search-input"));this.inputBox=this._register(this.createInputBox(t)),this._register(this.inputBox.onDidChange(i=>this._onDidChange.fire(i)))}createInputBox(e){const t=()=>zX(this.keybindingService);return this._register(new iX(e,this.contextViewService,{...this.options,showHistoryHint:t},this.contextKeyService))}showMessage(e){this.countElement&&e!==this.countElement.textContent&&(this.countElement.textContent=e,this.inputBox.inputElement.setAttribute("aria-label",e),this.inputBox.inputElement.style.paddingRight=this.getControlsWidth()+"px")}layout(e){e.width<400?(this.countElement?.classList.add("hide"),this.inputBox.inputElement.style.paddingRight="0px"):(this.countElement?.classList.remove("hide"),this.inputBox.inputElement.style.paddingRight=this.getControlsWidth()+"px")}getControlsWidth(){return(this.countElement?Pd(this.countElement):0)+20}focus(){this.inputBox.focus(),this.getValue()&&this.inputBox.select()}hasFocus(){return this.inputBox.hasFocus()}clear(){this.inputBox.value=""}getValue(){return this.inputBox.value}setValue(e){return this.inputBox.value=e}dispose(){this.options.focusKey?.set(!1),super.dispose()}};Eke=D([_(2,mf),_(3,we),_(4,Le),_(5,Ut)],Eke);var QP,xke;let Dke=class extends Eke{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.recordDisposables=this._register(new Z),this._onKeybinding=this._register(new I),this.onKeybinding=this._onKeybinding.event,this._onEnter=this._register(new I),this.onEnter=this._onEnter.event,this._onEscape=this._register(new I),this.onEscape=this._onEscape.event,this._onBlur=this._register(new I),this.onBlur=this._onBlur.event,this._register(Ee(()=>this.stopRecordingKeys())),this._chords=null,this._inputValue=""}clear(){this._chords=null,super.clear()}startRecordingKeys(){this.recordDisposables.add(ue(this.inputBox.inputElement,ke.KEY_DOWN,e=>this._onKeyDown(new En(e)))),this.recordDisposables.add(ue(this.inputBox.inputElement,ke.BLUR,()=>this._onBlur.fire())),this.recordDisposables.add(ue(this.inputBox.inputElement,ke.INPUT,()=>{this.setInputValue(this._inputValue)}))}stopRecordingKeys(){this._chords=null,this.recordDisposables.clear()}setInputValue(e){this._inputValue=e,this.inputBox.value=this._inputValue}_onKeyDown(e){if(e.preventDefault(),e.stopPropagation(),!this.options.recordEnter&&e.equals(S.Enter)){this._onEnter.fire();return}if(e.equals(S.Escape)){this._onEscape.fire();return}this.printKeybinding(e)}printKeybinding(e){const t=this.keybindingService.resolveKeyboardEvent(e),i=`code: ${e.browserEvent.code}, keyCode: ${e.browserEvent.keyCode}, key: ${e.browserEvent.key} => UI: ${t.getAriaLabel()}, user settings: ${t.getUserSettingsLabel()}, dispatch: ${t.getDispatchChords()[0]}`,n=this.options;this._chords||(this._chords=[]),this._chords.length>0&&this._chords[this._chords.length-1].getDispatchChords()[0]===null?this._chords[this._chords.length-1]=t:(this._chords.length===2&&(this._chords=[]),this._chords.push(t));const r=this._chords.map(a=>a.getUserSettingsLabel()||"").join(" ");this.setInputValue(n.quoteRecordedKeys?`"${r}"`:r),this.inputBox.inputElement.title=i,this._onKeybinding.fire(this._chords)}};Dke=D([_(2,mf),_(3,we),_(4,Le),_(5,Ut)],Dke);var Ck;let kke=(Ck=class extends pd{constructor(e,t){super(),this.instantiationService=t,this._keybindingDisposables=this._register(new Z),this._chords=null,this._isVisible=!1,this._onHide=this._register(new I),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onShowExistingKeybindings=this._register(new I),this.onShowExistingKeybidings=this._onShowExistingKeybindings.event,this._domNode=ls(document.createElement("div")),this._domNode.setDisplay("none"),this._domNode.setClassName("defineKeybindingWidget"),this._domNode.setWidth(QP.WIDTH),this._domNode.setHeight(QP.HEIGHT);const i=g(8667,"Press desired key combination and then press ENTER.");re(this._domNode.domNode,fe(".message",void 0,i)),this._domNode.domNode.style.backgroundColor=ze(xh),this._domNode.domNode.style.color=ze(IN),this._domNode.domNode.style.boxShadow=`0 2px 8px ${ze(CI)}`,this._keybindingInputWidget=this._register(this.instantiationService.createInstance(Dke,this._domNode.domNode,{ariaLabel:i,history:[],inputBoxStyles:EM})),this._keybindingInputWidget.startRecordingKeys(),this._register(this._keybindingInputWidget.onKeybinding(n=>this.onKeybinding(n))),this._register(this._keybindingInputWidget.onEnter(()=>this.hide())),this._register(this._keybindingInputWidget.onEscape(()=>this.clearOrHide())),this._register(this._keybindingInputWidget.onBlur(()=>this.onCancel())),this._outputNode=re(this._domNode.domNode,fe(".output")),this._showExistingKeybindingsNode=re(this._domNode.domNode,fe(".existing")),e&&re(e,this._domNode.domNode)}get domNode(){return this._domNode.domNode}define(){return this._keybindingInputWidget.clear(),Zs.withAsyncBody(async e=>{this._isVisible||(this._isVisible=!0,this._domNode.setDisplay("block"),this._chords=null,this._keybindingInputWidget.setInputValue(""),Ms(this._outputNode),Ms(this._showExistingKeybindingsNode),await Sr(0),this._keybindingInputWidget.focus());const t=this._onHide.event(()=>{e(this.getUserSettingsLabel()),t.dispose()})})}layout(e){const t=Math.round((e.height-QP.HEIGHT)/2);this._domNode.setTop(t);const i=Math.round((e.width-QP.WIDTH)/2);this._domNode.setLeft(i)}printExisting(e){if(e>0){const t=fe("span.existingText"),i=e===1?g(8668,"1 existing command has this keybinding",e):g(8669,"{0} existing commands have this keybinding",e);re(t,document.createTextNode(i)),Mr(i),this._showExistingKeybindingsNode.appendChild(t),t.onmousedown=n=>{n.preventDefault()},t.onmouseup=n=>{n.preventDefault()},t.onclick=()=>{this._onShowExistingKeybindings.fire(this.getUserSettingsLabel())}}}onKeybinding(e){if(this._keybindingDisposables.clear(),this._chords=e,Ms(this._outputNode),Ms(this._showExistingKeybindingsNode),this._keybindingDisposables.add(new qk(this._outputNode,po,l_e)).set(this._chords?.[0]??void 0),this._chords)for(let n=1;nt.getUserSettingsLabel()).join(" ")),e}onCancel(){this._chords=null,this.hide()}clearOrHide(){this._chords===null?this.hide():(this._chords=null,this._keybindingInputWidget.clear(),Ms(this._outputNode),Ms(this._showExistingKeybindingsNode))}hide(){this._domNode.setDisplay("none"),this._isVisible=!1,this._onHide.fire()}},QP=Ck,Ck.WIDTH=400,Ck.HEIGHT=110,Ck);kke=QP=D([_(1,we)],kke);var oM;let Ike=(oM=class extends V{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(kke,null)),this._editor.addOverlayWidget(this)}getId(){return xke.ID}getDomNode(){return this._widget.domNode}getPosition(){return{preference:null}}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}start(){this._editor.hasModel()&&this._editor.revealPositionInCenterIfOutsideViewport(this._editor.getPosition(),mt.Smooth);const e=this._editor.getLayoutInfo();return this._widget.layout(new bn(e.width,e.height)),this._widget.define()}},xke=oM,oM.ID="editor.contrib.defineKeybindingWidget",oM);Ike=xke=D([_(1,we)],Ike);var Tke;const cei=g(3526,"You won't be able to produce this key combination under your current keyboard layout.");let Lke=class extends V{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._userDataProfileService=i,this._keybindingDecorationRenderer=this._register(new wn),this._defineWidget=this._register(this._instantiationService.createInstance(Ike,this._editor)),this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){this._keybindingDecorationRenderer.value=w9e(this._editor,this._userDataProfileService)?this._instantiationService.createInstance(Rke,this._editor):void 0}showDefineKeybindingWidget(){w9e(this._editor,this._userDataProfileService)&&this._defineWidget.start().then(e=>this._onAccepted(e))}_onAccepted(e){if(this._editor.focus(),e&&this._editor.hasModel()){new RegExp(/\\/g).test(e)&&(e=e.slice(0,-1)+"\\\\");let n=["{",' "key": '+JSON.stringify(e)+",",' "command": "${1:commandId}",',' "when": "${2:editorTextFocus}"',"}$0"].join(` -`);const o=oei.insertSnippet(this._editor.getModel(),this._editor.getPosition());n=o.prepend+n+o.append,this._editor.setPosition(o.position),fc.get(this._editor)?.insert(n,{overwriteBefore:0,overwriteAfter:0})}}};Lke=D([_(1,we),_(2,ug)],Lke);let Rke=Tke=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._dec=this._editor.createDecorationsCollection(),this._updateDecorations=this._register(new cn(()=>this._updateDecorationsNow(),500));const i=qn(this._editor.getModel());this._register(i.onDidChangeContent(()=>this._updateDecorations.schedule())),this._register(this._keybindingService.onDidUpdateKeybindings(()=>this._updateDecorations.schedule())),this._register({dispose:()=>{this._dec.clear(),this._updateDecorations.cancel()}}),this._updateDecorations.schedule()}_updateDecorationsNow(){const e=qn(this._editor.getModel()),t=[],i=RLe(e.getValue());if(i&&Array.isArray(i.children))for(let n=0,o=i.children.length;n{this.updateResolver()})),t.add(Ee(()=>{const i=this.keybindingProviders.indexOf(e);i>=0&&(this.keybindingProviders.splice(i,1),this.updateResolver())})),t}_getResolver(){return super._getResolver()}_dispatch(e,t){return this.shouldUseGlobalKeybindings()?super._dispatch(e,t):!1}getUserKeybindingItems(){return[...super.getUserKeybindingItems(),...this.keybindingProviders.flatMap(e=>e.provideKeybindings())]}};Mke=D([_(1,Le),_(2,vi),_(3,Yi),_(4,bi),_(5,ug),_(6,xc),_(7,fs),_(8,Jt),_(9,ks),_(10,Ge),_(11,Oae)],Mke);utt(s=>{s.get(we).createInstance(Ske)});function dei({shouldUseGlobalKeybindings:s=()=>!1}={}){return{...Rce(),[Ut.toString()]:new wi(Mke,[s],!1),[Oae.toString()]:new wi(yke,[],!0),[vi.toString()]:new wi(Cke,[],!0)}}class hei{constructor(){this._provider=new oo,this.onDidChange=this._provider.onDidChange}addStatus(e){return this._provider.register(e.selector,e)}getLanguageStatus(e){return this._provider.ordered(e).sort((t,i)=>{let n=i.severity-t.severity;return n===0&&(n=gm(t.source,i.source)),n===0&&(n=gm(t.id,i.id)),n})}}var Nke;function jst(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this._loadConfigurationsForMode(o)})})),this._register(this._languageService.onDidChange(()=>{for(const[o]of this._done)this._loadConfigurationsForMode(o)}))}async _loadConfigurationsForMode(e){const t=this._languageService.getConfigurationFiles(e),i=Wc(t.map(o=>o.toString()));if(this._done.get(e)===i)return;this._done.set(e,i);const n=await Promise.all(t.map(o=>this._readConfigFile(o)));for(const o of n)this._handleConfig(e,o)}async _readConfigFile(e){try{const t=await this._extensionResourceLoaderService.readExtensionResource(e),i=[];let n=sf(t,i);return i.length&&console.error(g(2492,"Errors parsing {0}: {1}",e.toString(),i.map(o=>`[${o.offset}, ${o.length}] ${kee(o.error)}`).join(` -`))),sD(n)!=="object"&&(console.error(g(2493,"{0}: Invalid format, JSON object expected.",e.toString())),n={}),n}catch(t){return console.error(t),{}}}static _extractValidCommentRule(e,t){const i=t.comments;if(typeof i>"u")return;if(!kn(i)){console.warn(`[${e}]: language configuration: expected \`comments\` to be an object.`);return}let n;return typeof i.lineComment<"u"&&(typeof i.lineComment!="string"?console.warn(`[${e}]: language configuration: expected \`comments.lineComment\` to be a string.`):(n=n||{},n.lineComment=i.lineComment)),typeof i.blockComment<"u"&&(L4(i.blockComment)?(n=n||{},n.blockComment=i.blockComment):console.warn(`[${e}]: language configuration: expected \`comments.blockComment\` to be an array of two strings.`)),n}static _extractValidBrackets(e,t){const i=t.brackets;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`brackets\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const n=[];for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let n;for(let o=0,r=i.length;o +// - `+i}mightProducePrintableCharacter(e){if(e.ctrlKey||e.metaKey||e.altKey)return!1;const t=Wp.toEnum(e.code);if(MZt.indexOf(t)!==-1)return!!(e.keyCode===Wg[t]||Qt&&e.keyCode===Vb.get(t));if(Wg[t]!==-1)return!1;const n=this.keyboardLayoutService.getRawKeyboardMapping();if(!n)return!1;const o=n[e.code];return!(!o||!o.value||/\s/.test(o.value))}};uke=FV=D([_(0,Le),_(1,vi),_(2,Yi),_(3,bi),_(4,lg),_(5,xc),_(6,fs),_(7,Jt),_(8,ks),_(9,Ge),_(10,Mae)],uke);class NZt extends V{get keybindings(){return this._keybindings}constructor(e,t,i,n){super(),this.userDataProfileService=e,this.uriIdentityService=t,this.fileService=i,this._rawKeybindings=[],this._keybindings=[],this.watchDisposables=this._register(new Z),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this.watch(),this.reloadConfigurationScheduler=this._register(new cn(()=>this.reload().then(o=>{o&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,o=>o.contains(this.userDataProfileService.currentProfile.keybindingsResource))(()=>{n.debug("Keybindings file changed"),this.reloadConfigurationScheduler.schedule()})),this._register(this.fileService.onDidRunOperation(o=>{o.operation===Ai.WRITE&&o.resource.toString()===this.userDataProfileService.currentProfile.keybindingsResource.toString()&&(n.debug("Keybindings file written"),this.reloadConfigurationScheduler.schedule())})),this._register(e.onDidChangeCurrentProfile(o=>{this.uriIdentityService.extUri.isEqual(o.previous.keybindingsResource,o.profile.keybindingsResource)||o.join(this.whenCurrentProfileChanged())}))}async whenCurrentProfileChanged(){this.watch(),this.reloadConfigurationScheduler.schedule()}watch(){this.watchDisposables.clear(),this.watchDisposables.add(this.fileService.watch(Lr(this.userDataProfileService.currentProfile.keybindingsResource))),this.watchDisposables.add(this.fileService.watch(this.userDataProfileService.currentProfile.keybindingsResource))}async initialize(){await this.reload()}async reload(){const e=await this.readUserKeybindings();return Ys(this._rawKeybindings,e)?!1:(this._rawKeybindings=e,this._keybindings=this._rawKeybindings.map(t=>Wst.readUserKeybindingItem(t)),!0)}async readUserKeybindings(){try{const e=await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource),t=ef(e.value.toString());return Array.isArray(t)?t.filter(i=>i&&typeof i=="object"):[]}catch{return[]}}}const vO=class vO{constructor(){this.commandsSchemas=[],this.commandsEnum=[],this.removalCommandsEnum=[],this.commandsEnumDescriptions=[],this.schema={id:vO.schemaId,type:"array",title:g(3516,"Keybindings configuration"),allowTrailingCommas:!0,allowComments:!0,definitions:{editorGroupsSchema:{type:"array",items:{type:"object",properties:{groups:{$ref:"#/definitions/editorGroupsSchema",default:[{},{}]},size:{type:"number",default:.5}}}},commandNames:{type:"string",enum:this.commandsEnum,enumDescriptions:this.commandsEnumDescriptions,description:g(3517,"Name of the command to execute")},commandType:{anyOf:[{$ref:"#/definitions/commandNames"},{type:"string",enum:this.removalCommandsEnum,enumDescriptions:this.commandsEnumDescriptions,description:g(3518,"Name of the command to remove keyboard shortcut for")},{type:"string"}]},commandsSchemas:{allOf:this.commandsSchemas}},items:{required:["key"],type:"object",defaultSnippets:[{body:{key:"$1",command:"$2",when:"$3"}}],properties:{key:{type:"string",description:g(3519,"Key or key sequence (separated by space)")},command:{anyOf:[{if:{type:"array"},then:{not:{type:"array"},errorMessage:g(3520,`Incorrect type. Expected "{0}". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.`,"string")},else:{$ref:"#/definitions/commandType"}},{$ref:"#/definitions/commandType"}]},when:{type:"string",description:g(3521,"Condition when the key is active.")},args:{description:g(3522,"Arguments to pass to the command to execute.")}},$ref:"#/definitions/commandsSchemas"}},this.schemaRegistry=Qe.as(QA.JSONContribution),this.schemaRegistry.registerSchema(vO.schemaId,this.schema)}updateSchema(e){this.commandsSchemas.length=0,this.commandsEnum.length=0,this.removalCommandsEnum.length=0,this.commandsEnumDescriptions.length=0;const t=new Set,i=(r,a)=>{/^_/.test(r)||t.has(r)||(t.add(r),this.commandsEnum.push(r),this.commandsEnumDescriptions.push(MLe(a)?a.value:a),this.removalCommandsEnum.push(`-${r}`))},n=_t.getCommands();for(const[r,a]of n){const c=a.metadata;if(i(r,c?.description),!c||!c.args||c.args.length!==1||!c.args[0].schema)continue;const l=c.args[0].schema,d=typeof c.args[0].isOptional<"u"?!c.args[0].isOptional:Array.isArray(l.required)&&l.required.length>0,h={if:{required:["command"],properties:{command:{const:r}}},then:{required:[].concat(d?["args"]:[]),properties:{args:l}}};this.commandsSchemas.push(h)}const o=jn.getCommands();for(const r of o.keys())i(r);this.commandsSchemas.push(...e),this.schemaRegistry.notifySchemaChanged(vO.schemaId)}};vO.schemaId="vscode://schemas/keybindings";let gke=vO;function Jie(s){return s.name?s.name:s.id?s.id:s.layout}function PZt(s){const e=s,t={};for(const i in e){const n=e[i];if(n.length){const o=n[0],r=n[1],a=n[2],c=n[3],l=Number(n[4]),d=n.length===6?n[5]:void 0;t[i]={value:o,vkey:d,withShift:r,withAltGr:a,withShiftAltGr:c,valueIsDeadKey:(l&1)>0,withShiftIsDeadKey:(l&2)>0,withAltGrIsDeadKey:(l&4)>0,withShiftAltGrIsDeadKey:(l&8)>0}}else t[i]={value:"",valueIsDeadKey:!1,withShift:"",withShiftIsDeadKey:!1,withAltGr:"",withAltGrIsDeadKey:!1,withShiftAltGr:"",withShiftAltGrIsDeadKey:!1}}return t}class Xce{constructor(e,t,i,n){this.layout=e,this.secondaryLayouts=t,this.mapping=PZt(i),this.isUserKeyboardLayout=!!n,this.layout.isUserKeyboardLayout=!!n}static createKeyboardLayoutFromDebugInfo(e,t,i){const n=new Xce(e,[],{},!0);return n.mapping=t,n}update(e){this.layout=e.layout,this.secondaryLayouts=e.secondaryLayouts,this.mapping=e.mapping,this.isUserKeyboardLayout=e.isUserKeyboardLayout,this.layout.isUserKeyboardLayout=e.isUserKeyboardLayout}getScore(e){let t=0;for(const i in e){if(Qn&&(i==="Backslash"||i==="KeyQ")||pr&&(i==="Backspace"||i==="Escape"))continue;const n=this.mapping[i];n===void 0&&(t-=1);const o=e[i];n&&o&&n.value!==o.value&&(t-=1)}return t}equal(e){return this.isUserKeyboardLayout!==e.isUserKeyboardLayout||Jie(this.layout)!==Jie(e.layout)?!1:this.fuzzyEqual(e.mapping)}fuzzyEqual(e){for(const t in e){if(Qn&&(t==="Backslash"||t==="KeyQ"))continue;if(this.mapping[t]===void 0)return!1;const i=this.mapping[t],n=e[t];if(i.value!==n.value)return!1}return!0}}var Y$;(function(s){s[s.Code=0]="Code",s[s.KeyCode=1]="KeyCode"})(Y$||(Y$={}));function FZt(s){const e=s.getValue("keyboard"),t=e?.dispatch==="keyCode"?Y$.KeyCode:Y$.Code,i=!!e?.mapAltGrToCtrlAlt;return{dispatch:t,mapAltGrToCtrlAlt:i}}const OZt=Qe.as(Nn.Configuration),BZt={id:"keyboard",order:15,type:"object",title:g(8664,"Keyboard"),properties:{"keyboard.dispatch":{scope:at.APPLICATION,type:"string",enum:["code","keyCode"],default:"code",markdownDescription:g(8665,"Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."),included:po===Ds.Macintosh||po===Ds.Linux},"keyboard.mapAltGrToCtrlAlt":{scope:at.APPLICATION,type:"boolean",default:!1,markdownDescription:g(8666,"Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."),included:po===Ds.Windows}}};OZt.registerConfiguration(BZt);class WZt{constructor(e){this._actual=e,this._cache=new Map}dumpDebugInfo(){return this._actual.dumpDebugInfo()}resolveKeyboardEvent(e){return this._actual.resolveKeyboardEvent(e)}resolveKeybinding(e){const t=e.getHashCode(),i=this._cache.get(t);if(!i){const n=this._actual.resolveKeybinding(e);return this._cache.set(t,n),n}return i}}class OV extends ELe{constructor(e,t){super(Ds.Windows,t),this._mapper=e}_getLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getUILabelForKeyCode(e.keyCode)}_getUSLabelForKeybinding(e){return e.isDuplicateModifierCase()?"":Ia.toString(e.keyCode)}getUSLabel(){return h6.toLabel(this._os,this._chords,e=>this._getUSLabelForKeybinding(e))}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":this._mapper.getAriaLabelForKeyCode(e.keyCode)}_getElectronAccelerator(e){return this._mapper.getElectronAcceleratorForKeyBinding(e)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=this._mapper.getUserSettingsLabelForKeyCode(e.keyCode);return t&&t.toLowerCase()}_isWYSIWYG(e){return this.__isWYSIWYG(e.keyCode)}__isWYSIWYG(e){if(e===S.LeftArrow||e===S.UpArrow||e===S.RightArrow||e===S.DownArrow)return!0;const t=this._mapper.getAriaLabelForKeyCode(e),i=this._mapper.getUserSettingsLabelForKeyCode(e);return t===i}_getChordDispatch(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+=Ia.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===S.Ctrl&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===S.Shift&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===S.Alt&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===S.Meta&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static getProducedCharCode(e,t){return t?e.ctrlKey&&e.shiftKey&&e.altKey?t.withShiftAltGr:e.ctrlKey&&e.altKey?t.withAltGr:e.shiftKey?t.withShift:t.value:null}static getProducedChar(e,t){const i=this.getProducedCharCode(e,t);return i===null||i.length===0?" --- ":" "+i+" "}}class HZt{constructor(e,t,i){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._keyCodeToLabel=[],this._scanCodeToKeyCode=[],this._keyCodeToLabel=[],this._keyCodeExists=[],this._keyCodeToLabel[S.Unknown]=Ia.toString(S.Unknown);for(let a=X.None;a1)this._keyCodeToLabel[m]=h;else{const b=h.charCodeAt(0);if(b>=B.a&&b<=B.z){const w=B.A+(b-B.a);n[w]=!0,o=!0,this._keyCodeToLabel[m]=String.fromCharCode(B.A+(b-B.a))}else b>=B.A&&b<=B.Z?(n[b]=!0,o=!0,this._keyCodeToLabel[m]=h):this._keyCodeToLabel[m]=h}}const r=(a,c)=>{n[a]||(this._keyCodeToLabel[c]=String.fromCharCode(a))};if(r(B.A,S.KeyA),r(B.B,S.KeyB),r(B.C,S.KeyC),r(B.D,S.KeyD),r(B.E,S.KeyE),r(B.F,S.KeyF),r(B.G,S.KeyG),r(B.H,S.KeyH),r(B.I,S.KeyI),r(B.J,S.KeyJ),r(B.K,S.KeyK),r(B.L,S.KeyL),r(B.M,S.KeyM),r(B.N,S.KeyN),r(B.O,S.KeyO),r(B.P,S.KeyP),r(B.Q,S.KeyQ),r(B.R,S.KeyR),r(B.S,S.KeyS),r(B.T,S.KeyT),r(B.U,S.KeyU),r(B.V,S.KeyV),r(B.W,S.KeyW),r(B.X,S.KeyX),r(B.Y,S.KeyY),r(B.Z,S.KeyZ),!o){const a=(c,l)=>{this._keyCodeToLabel[c]=String.fromCharCode(l)};a(S.Semicolon,B.Semicolon),a(S.Equal,B.Equals),a(S.Comma,B.Comma),a(S.Minus,B.Dash),a(S.Period,B.Period),a(S.Slash,B.Slash),a(S.Backquote,B.BackTick),a(S.BracketLeft,B.OpenSquareBracket),a(S.Backslash,B.Backslash),a(S.BracketRight,B.CloseSquareBracket),a(S.Quote,B.SingleQuote)}}dumpDebugInfo(){const e=[],t=[X.ArrowUp,X.Numpad0];let i=0;e.push("-----------------------------------------------------------------------------------------------------------------------------------------");for(let n=X.None;nthis._resolveChord(i)));return t.length>0?[new OV(this,t)]:[]}}const vz=[];class r9e extends ELe{constructor(e,t,i){super(t,i),this._mapper=e}_getLabel(e){return this._mapper.getUILabelForScanCodeChord(e)}_getAriaLabel(e){return this._mapper.getAriaLabelForScanCodeChord(e)}_getElectronAccelerator(e){return this._mapper.getElectronAcceleratorLabelForScanCodeChord(e)}_getUserSettingsLabel(e){return this._mapper.getUserSettingsLabelForScanCodeChord(e)}_isWYSIWYG(e){if(!e||Wg[e.scanCode]!==S.DependsOnKbLayout)return!0;const t=this._mapper.getAriaLabelForScanCodeChord(e),i=this._mapper.getUserSettingsLabelForScanCodeChord(e);return!t&&!i?!0:!t||!i?!1:t.toLowerCase()===i.toLowerCase()}_getChordDispatch(e){return this._mapper.getDispatchStrForScanCodeChord(e)}_getSingleModifierChordDispatch(e){return(e.scanCode===X.ControlLeft||e.scanCode===X.ControlRight)&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":(e.scanCode===X.AltLeft||e.scanCode===X.AltRight)&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":(e.scanCode===X.ShiftLeft||e.scanCode===X.ShiftRight)&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":(e.scanCode===X.MetaLeft||e.scanCode===X.MetaRight)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}}class bz{constructor(e,t,i,n){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.scanCode=n}toString(){return`${this.ctrlKey?"Ctrl+":""}${this.shiftKey?"Shift+":""}${this.altKey?"Alt+":""}${Wp.toString(this.scanCode)}`}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.scanCode===e.scanCode}getProducedCharCode(e){return e?this.ctrlKey&&this.shiftKey&&this.altKey?e.withShiftAltGr:this.ctrlKey&&this.altKey?e.withAltGr:this.shiftKey?e.withShift:e.value:""}getProducedChar(e){const t=Zm.getCharCode(this.getProducedCharCode(e));return t===0?" --- ":t>=B.U_Combining_Grave_Accent&&t<=B.U_Combining_Latin_Small_Letter_X?"U+"+t.toString(16):" "+String.fromCharCode(t)+" "}}class fke{constructor(e,t,i,n){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.keyCode=n}toString(){return`${this.ctrlKey?"Ctrl+":""}${this.shiftKey?"Shift+":""}${this.altKey?"Alt+":""}${Ia.toString(this.keyCode)}`}}class UZt{constructor(){this._scanCodeToKeyCode=[],this._keyCodeToScanCode=[],this._scanCodeToKeyCode=[],this._keyCodeToScanCode=[]}registrationComplete(){this._moveToEnd(X.IntlHash),this._moveToEnd(X.IntlBackslash)}_moveToEnd(e){for(let t=0;t<8;t++){const i=this._scanCodeToKeyCode[(e<<3)+t];if(i)for(let n=0,o=i.length;n>>3===e){for(let h=a+1;h=S.Digit0&&t.keyCode<=S.Digit9,r=t.keyCode>=S.KeyA&&t.keyCode<=S.KeyZ,a=this._scanCodeToKeyCode[i];if(o||r){if(a){for(let c=0,l=a.length;c>>3;n[o]=new bz(c,l,d,h)}return n}lookupScanCodeCombo(e){const t=this._encodeScanCodeCombo(e),i=this._scanCodeToKeyCode[t];if(!i||i.length===0)return[];const n=[];for(let o=0,r=i.length;o>>3;n[o]=new fke(c,l,d,h)}return n}guessStableKeyCode(e){if(e>=X.Digit1&&e<=X.Digit0)switch(e){case X.Digit1:return S.Digit1;case X.Digit2:return S.Digit2;case X.Digit3:return S.Digit3;case X.Digit4:return S.Digit4;case X.Digit5:return S.Digit5;case X.Digit6:return S.Digit6;case X.Digit7:return S.Digit7;case X.Digit8:return S.Digit8;case X.Digit9:return S.Digit9;case X.Digit0:return S.Digit0}const t=this.lookupScanCodeCombo(new bz(!1,!1,!1,e)),i=this.lookupScanCodeCombo(new bz(!1,!0,!1,e));if(t.length===1&&i.length===1){const n=t[0].shiftKey,o=t[0].keyCode,r=i[0].shiftKey,a=i[0].keyCode;if(o===a&&n!==r)return o}return S.DependsOnKbLayout}_encodeScanCodeCombo(e){return this._encode(e.ctrlKey,e.shiftKey,e.altKey,e.scanCode)}_encodeKeyCodeCombo(e){return this._encode(e.ctrlKey,e.shiftKey,e.altKey,e.keyCode)}_encode(e,t,i,n){return((e?1:0)<<0|(t?1:0)<<1|(i?1:0)<<2|n<<3)>>>0}}class Zm{constructor(e,t,i,n){this._isUSStandard=e,this._mapAltGrToCtrlAlt=i,this._OS=n,this._scanCodeToLabel=[],this._scanCodeToDispatch=[],this._codeInfo=[],this._scanCodeKeyCodeMapper=new UZt,this._scanCodeToLabel=[],this._scanCodeToDispatch=[];const o=(d,h,u,f,p,m,v,b)=>{this._scanCodeKeyCodeMapper.registerIfUnknown(new bz(!!d,!!h,!!u,f),new fke(!!p,!!m,!!v,b))},r=(d,h,u,f,p)=>{for(let m=d;m<=1;m++)for(let v=h;v<=1;v++)for(let b=u;b<=1;b++)o(m,v,b,f,m,v,b,p)};for(let d=X.None;d=B.a&&m<=B.z){const v=B.A+(m-B.a);d[v]=!0}}const h=(u,f,p,m)=>{d[u]||(a[Wp.toString(f)]={value:p,withShift:m,withAltGr:"",withShiftAltGr:""})};h(B.A,X.KeyA,"a","A"),h(B.B,X.KeyB,"b","B"),h(B.C,X.KeyC,"c","C"),h(B.D,X.KeyD,"d","D"),h(B.E,X.KeyE,"e","E"),h(B.F,X.KeyF,"f","F"),h(B.G,X.KeyG,"g","G"),h(B.H,X.KeyH,"h","H"),h(B.I,X.KeyI,"i","I"),h(B.J,X.KeyJ,"j","J"),h(B.K,X.KeyK,"k","K"),h(B.L,X.KeyL,"l","L"),h(B.M,X.KeyM,"m","M"),h(B.N,X.KeyN,"n","N"),h(B.O,X.KeyO,"o","O"),h(B.P,X.KeyP,"p","P"),h(B.Q,X.KeyQ,"q","Q"),h(B.R,X.KeyR,"r","R"),h(B.S,X.KeyS,"s","S"),h(B.T,X.KeyT,"t","T"),h(B.U,X.KeyU,"u","U"),h(B.V,X.KeyV,"v","V"),h(B.W,X.KeyW,"w","W"),h(B.X,X.KeyX,"x","X"),h(B.Y,X.KeyY,"y","Y"),h(B.Z,X.KeyZ,"z","Z")}const c=[];let l=0;for(const d in t)if(t.hasOwnProperty(d)){const h=Wp.toEnum(d);if(h===X.None||Wg[h]!==S.DependsOnKbLayout)continue;this._codeInfo[h]=t[d];const u=a[d]||t[d],f=Zm.getCharCode(u.value),p=Zm.getCharCode(u.withShift),m=Zm.getCharCode(u.withAltGr),v=Zm.getCharCode(u.withShiftAltGr),b={scanCode:h,value:f,withShift:p,withAltGr:m,withShiftAltGr:v};if(c[l++]=b,this._scanCodeToDispatch[h]=`[${Wp.toString(h)}]`,f>=B.a&&f<=B.z){const w=B.A+(f-B.a);this._scanCodeToLabel[h]=String.fromCharCode(w)}else f>=B.A&&f<=B.Z?this._scanCodeToLabel[h]=String.fromCharCode(f):f?this._scanCodeToLabel[h]=String.fromCharCode(f):this._scanCodeToLabel[h]=null}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withShiftAltGr;if(f===h.withAltGr||f===h.withShift||f===h.value)continue;const p=Zm._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?o(1,1,1,u,0,1,0,v):o(1,1,1,u,0,0,0,v)}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withAltGr;if(f===h.withShift||f===h.value)continue;const p=Zm._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?o(1,0,1,u,0,1,0,v):o(1,0,1,u,0,0,0,v)}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=h.withShift;if(f===h.value)continue;const p=Zm._charCodeToKb(f);if(!p)continue;const m=p.shiftKey,v=p.keyCode;m?(o(0,1,0,u,0,1,0,v),o(0,1,1,u,0,1,1,v),o(1,1,0,u,1,1,0,v),o(1,1,1,u,1,1,1,v)):(o(0,1,0,u,0,0,0,v),o(0,1,0,u,0,1,0,v),o(0,1,1,u,0,0,1,v),o(0,1,1,u,0,1,1,v),o(1,1,0,u,1,0,0,v),o(1,1,0,u,1,1,0,v),o(1,1,1,u,1,0,1,v),o(1,1,1,u,1,1,1,v))}for(let d=c.length-1;d>=0;d--){const h=c[d],u=h.scanCode,f=Zm._charCodeToKb(h.value);if(!f)continue;const p=f.shiftKey,m=f.keyCode;p?(o(0,0,0,u,0,1,0,m),o(0,0,1,u,0,1,1,m),o(1,0,0,u,1,1,0,m),o(1,0,1,u,1,1,1,m)):(o(0,0,0,u,0,0,0,m),o(0,0,1,u,0,0,1,m),o(0,1,0,u,0,1,0,m),o(0,1,1,u,0,1,1,m),o(1,0,0,u,1,0,0,m),o(1,0,1,u,1,0,1,m),o(1,1,0,u,1,1,0,m),o(1,1,1,u,1,1,1,m))}r(0,0,0,X.Digit1,S.Digit1),r(0,0,0,X.Digit2,S.Digit2),r(0,0,0,X.Digit3,S.Digit3),r(0,0,0,X.Digit4,S.Digit4),r(0,0,0,X.Digit5,S.Digit5),r(0,0,0,X.Digit6,S.Digit6),r(0,0,0,X.Digit7,S.Digit7),r(0,0,0,X.Digit8,S.Digit8),r(0,0,0,X.Digit9,S.Digit9),r(0,0,0,X.Digit0,S.Digit0),this._scanCodeKeyCodeMapper.registrationComplete()}dumpDebugInfo(){const e=[],t=[X.ArrowUp,X.Numpad0];let i=0;e.push(`isUSStandard: ${this._isUSStandard}`),e.push("----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");for(let n=X.None;n=0){const a=g8[i];a!==X.DependsOnKbLayout&&(t=a)}const n=e.ctrlKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,o=e.altKey||this._mapAltGrToCtrlAlt&&e.altGraphKey,r=new dy(n,e.shiftKey,o,e.metaKey,t);return new r9e(this,this._OS,[r])}_resolveChord(e){return e?e instanceof dy?[e]:this.keyCodeChordToScanCodeChord(e):[]}resolveKeybinding(e){const t=e.chords.map(i=>this._resolveChord(i));return this._toResolvedKeybinding(t)}static _redirectCharCode(e){switch(e){case B.U_IDEOGRAPHIC_FULL_STOP:return B.Period;case B.U_LEFT_CORNER_BRACKET:return B.OpenSquareBracket;case B.U_RIGHT_CORNER_BRACKET:return B.CloseSquareBracket;case B.U_LEFT_BLACK_LENTICULAR_BRACKET:return B.OpenSquareBracket;case B.U_RIGHT_BLACK_LENTICULAR_BRACKET:return B.CloseSquareBracket;case B.U_FULLWIDTH_SEMICOLON:return B.Semicolon;case B.U_FULLWIDTH_COMMA:return B.Comma}return e}static _charCodeToKb(e){return e=this._redirectCharCode(e),eimport("./layout.contribution.darwin-gdaUfoJf.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.default??e);case"./keyboardLayouts/layout.contribution.linux.js":return RT(()=>import("./layout.contribution.linux-xMjRz7iy.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>e.default??e);case"./keyboardLayouts/layout.contribution.win.js":return RT(()=>import("./layout.contribution.win-DZRWibbm.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>e.default??e);default:return new Promise(function(e,t){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+s)))})}}class zZt extends V{get activeKeymap(){return this._activeKeymapInfo}get keymapInfos(){return this._keymapInfos}get activeKeyboardLayout(){return this._initialized?this._activeKeymapInfo?.layout??null:null}get activeKeyMapping(){return this._initialized?this._activeKeymapInfo?.mapping??null:null}get keyboardLayouts(){return this._keymapInfos.map(e=>e.layout)}constructor(e){super(),this._configurationService=e,this._onDidChangeKeyboardMapper=new I,this.onDidChangeKeyboardMapper=this._onDidChangeKeyboardMapper.event,this.keyboardLayoutMapAllowed=navigator.keyboard!==void 0,this._keyboardMapper=null,this._initialized=!1,this._keymapInfos=[],this._mru=[],this._activeKeymapInfo=null,navigator.keyboard&&navigator.keyboard.addEventListener&&navigator.keyboard.addEventListener("layoutchange",()=>{this._getBrowserKeyMapping().then(t=>{this.isKeyMappingActive(t)||this.setLayoutFromBrowserAPI()})}),this._register(this._configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration("keyboard")&&(this._keyboardMapper=null,this._onDidChangeKeyboardMapper.fire())}))}registerKeyboardLayout(e){this._keymapInfos.push(e),this._mru=this._keymapInfos}removeKeyboardLayout(e){let t=this._mru.indexOf(e);this._mru.splice(t,1),t=this._keymapInfos.indexOf(e),this._keymapInfos.splice(t,1)}getMatchedKeymapInfo(e){if(!e)return null;const t=this.getUSStandardLayout();if(t){let i=t.getScore(e);if(i===0)return{result:t,score:0};let n=t;for(let o=0;oi){if(r===0)return{result:this._mru[o],score:0};i=r,n=this._mru[o]}}return{result:n,score:i}}for(let i=0;it.layout.isUSStandard);return e.length?e[0]:null}isKeyMappingActive(e){return this._activeKeymapInfo&&e&&this._activeKeymapInfo.fuzzyEqual(e)}setUSKeyboardLayout(){this._activeKeymapInfo=this.getUSStandardLayout()}setActiveKeyMapping(e){let t=!1;const i=this.getMatchedKeymapInfo(e);if(i&&(this._activeKeymapInfo?e&&i.result.getScore(e)>this._activeKeymapInfo.getScore(e)&&(this._activeKeymapInfo=i.result,t=!0):(this._activeKeymapInfo=i.result,t=!0)),this._activeKeymapInfo||(this._activeKeymapInfo=this.getUSStandardLayout(),t=!0),!this._activeKeymapInfo||!t)return;const n=this._mru.indexOf(this._activeKeymapInfo);this._mru.splice(n,1),this._mru.unshift(this._activeKeymapInfo),this._setKeyboardData(this._activeKeymapInfo)}setActiveKeymapInfo(e){this._activeKeymapInfo=e;const t=this._mru.indexOf(this._activeKeymapInfo);t!==0&&(this._mru.splice(t,1),this._mru.unshift(this._activeKeymapInfo),this._setKeyboardData(this._activeKeymapInfo))}setLayoutFromBrowserAPI(){this._updateKeyboardLayoutAsync(this._initialized)}_updateKeyboardLayoutAsync(e,t){e&&this._getBrowserKeyMapping(t).then(i=>{this.isKeyMappingActive(i)||this.setActiveKeyMapping(i)})}getKeyboardMapper(){const e=FZt(this._configurationService);return e.dispatch===Y$.KeyCode||!this._initialized||!this._activeKeymapInfo?new xve(e.mapAltGrToCtrlAlt,po):(this._keyboardMapper||(this._keyboardMapper=new WZt(Hst._createKeyboardMapper(this._activeKeymapInfo,e.mapAltGrToCtrlAlt))),this._keyboardMapper)}validateCurrentKeyboardMapping(e){!this._initialized||this._validateCurrentKeyboardMapping(e)||this._updateKeyboardLayoutAsync(!0,e)}setKeyboardLayout(e){const t=this.keymapInfos.filter(i=>Jie(i.layout)===e);t.length>0&&this.setActiveKeymapInfo(t[0])}_setKeyboardData(e){this._initialized=!0,this._keyboardMapper=null,this._onDidChangeKeyboardMapper.fire()}static _createKeyboardMapper(e,t){const i=e.mapping,n=!!e.layout.isUSStandard;return po===Ds.Windows?new HZt(n,i,t):Object.keys(i).length===0?new xve(t,po):new Zm(n,i,t,po)}_validateCurrentKeyboardMapping(e){if(!this._initialized)return!0;const t=e,i=this._activeKeymapInfo;if(!i||t.browserEvent.key==="Dead"||t.browserEvent.isComposing)return!0;const n=i.mapping[t.code];if(!n)return!1;if(n.value==="")return(e.ctrlKey||e.metaKey)&&setTimeout(()=>{this._getBrowserKeyMapping().then(a=>{this.isKeyMappingActive(a)||this.setLayoutFromBrowserAPI()})},350),!0;const o=t.altKey&&t.shiftKey?n.withShiftAltGr:t.altKey?n.withAltGr:t.shiftKey?n.withShift:n.value,r=t.altKey&&t.shiftKey&&n.withShiftAltGrIsDeadKey||t.altKey&&n.withAltGrIsDeadKey||t.shiftKey&&n.withShiftIsDeadKey||n.valueIsDeadKey;return!(r&&t.browserEvent.key!=="Dead"||!r&&t.browserEvent.key!==o)}async _getBrowserKeyMapping(e){if(this.keyboardLayoutMapAllowed)try{return await navigator.keyboard.getLayoutMap().then(t=>{const i={};for(const n of t)i[n[0]]={value:n[1],withShift:"",withAltGr:"",withShiftAltGr:""};return i})}catch{this.keyboardLayoutMapAllowed=!1}if(e&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.metaKey){const t={},i=e;return t[i.browserEvent.code]={value:i.browserEvent.key,withShift:"",withAltGr:"",withShiftAltGr:""},this.getMatchedKeymapInfo(t)?t:null}return null}}class Hst extends zZt{constructor(e,t,i,n){super(e),VZt("./keyboardLayouts/layout.contribution."+(Qn?"win":Qt?"darwin":"linux")+".js").then(r=>{const a=r.KeyboardLayoutContribution.INSTANCE.layoutInfos;this._keymapInfos.push(...a.map(c=>new Xce(c.layout,c.secondaryLayouts,c.mapping,c.isUserKeyboardLayout))),this._mru=this._keymapInfos,this._initialized=!0,this.setLayoutFromBrowserAPI()})}}class $Zt extends V{get keyboardLayout(){return this._keyboardLayout}constructor(e,t){super(),this.keyboardLayoutResource=e,this.fileService=t,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._keyboardLayout=null,this.reloadConfigurationScheduler=this._register(new cn(()=>this.reload().then(i=>{i&&this._onDidChange.fire()}),50)),this._register(M.filter(this.fileService.onDidFilesChange,i=>i.contains(this.keyboardLayoutResource))(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){await this.reload()}async reload(){const e=this._keyboardLayout;try{const t=await this.fileService.readFile(this.keyboardLayoutResource),i=ef(t.value.toString());if(tD(i)==="object"){const n=i.layout,o=i.rawMapping;this._keyboardLayout=Xce.createKeyboardLayoutFromDebugInfo(n,o,!0)}else this._keyboardLayout=null}catch{this._keyboardLayout=null}return e?!Ys(e,this._keyboardLayout):!0}}let pke=class extends V{constructor(e,t,i,n,o,r){super(),this.configurationService=r,this._onDidChangeKeyboardLayout=new I,this.onDidChangeKeyboardLayout=this._onDidChangeKeyboardLayout.event;const c=r.getValue("keyboard").layout;this._keyboardLayoutMode=c??"autodetect",this._factory=new Hst(r,i,n,o),this._register(this._factory.onDidChangeKeyboardMapper(()=>{this._onDidChangeKeyboardLayout.fire()})),c&&c!=="autodetect"&&this._factory.setKeyboardLayout(c),this._register(r.onDidChangeConfiguration(l=>{if(l.affectsConfiguration("keyboard.layout")){const h=r.getValue("keyboard").layout;this._keyboardLayoutMode=h,h==="autodetect"?this._factory.setLayoutFromBrowserAPI():this._factory.setKeyboardLayout(h)}})),this._userKeyboardLayout=new $Zt(e.keyboardLayoutResource,t),this._userKeyboardLayout.initialize().then(()=>{this._userKeyboardLayout.keyboardLayout&&(this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout),this.setUserKeyboardLayoutIfMatched())}),this._register(this._userKeyboardLayout.onDidChange(()=>{const l=this._factory.keymapInfos.filter(d=>d.isUserKeyboardLayout);l.length?this._userKeyboardLayout.keyboardLayout?l[0].update(this._userKeyboardLayout.keyboardLayout):this._factory.removeKeyboardLayout(l[0]):this._userKeyboardLayout.keyboardLayout&&this._factory.registerKeyboardLayout(this._userKeyboardLayout.keyboardLayout),this.setUserKeyboardLayoutIfMatched()}))}setUserKeyboardLayoutIfMatched(){const t=this.configurationService.getValue("keyboard").layout;t&&this._userKeyboardLayout.keyboardLayout&&Jie(this._userKeyboardLayout.keyboardLayout.layout)===t&&this._factory.activeKeymap&&(this._userKeyboardLayout.keyboardLayout.equal(this._factory.activeKeymap)||this._factory.setActiveKeymapInfo(this._userKeyboardLayout.keyboardLayout))}getKeyboardMapper(){return this._factory.getKeyboardMapper()}getCurrentKeyboardLayout(){return this._factory.activeKeyboardLayout}getAllKeyboardLayouts(){return this._factory.keyboardLayouts}getRawKeyboardMapping(){return this._factory.activeKeyMapping}validateCurrentKeyboardMapping(e){this._keyboardLayoutMode==="autodetect"&&this._factory.validateCurrentKeyboardMapping(e)}};pke=D([_(0,Za),_(1,Jt),_(2,bi),_(3,$i),_(4,vi),_(5,Te)],pke);const GZt=Qe.as(Nn.Configuration),KZt={id:"keyboard",order:15,type:"object",title:g(3523,"Keyboard"),properties:{"keyboard.layout":{type:"string",default:"autodetect",description:g(3524,"Control the keyboard layout used in web.")}}};GZt.registerConfiguration(KZt);let mke=class extends V{constructor(e,t,i){super(),this._instantiationService=e,this._extensionService=t,this._logService=i,this._extensionHostIsReady=!1,this._onWillExecuteCommand=this._register(new I),this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new I,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._extensionService.whenInstalledExtensionsRegistered().then(n=>this._extensionHostIsReady=n),this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Promise.race([this._extensionService.activateByEvent("*"),Sr(3e4)])),this._starActivation}async executeCommand(e,...t){this._logService.trace("CommandService#executeCommand",e);const i=`onCommand:${e}`;return _t.getCommand(e)?this._extensionService.activationEventIsDone(i)?this._tryExecuteCommand(e,t):this._extensionHostIsReady?(await this._extensionService.activateByEvent(i),this._tryExecuteCommand(e,t)):(this._extensionService.activateByEvent(i),this._tryExecuteCommand(e,t)):(await Promise.all([this._extensionService.activateByEvent(i),Promise.race([this._activateStar(),M.toPromise(M.filter(_t.onDidRegisterCommand,o=>o===e))])]),this._tryExecuteCommand(e,t))}_tryExecuteCommand(e,t){const i=_t.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction(i.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};mke=D([_(0,we),_(1,fs),_(2,Ge)],mke);let _ke=class extends V{constructor(e,t,i,n,o,r,a,c,l,d){super(),this.contextKeyService=e,this.contextService=t,this.configurationService=i,this.environmentService=n,this.productService=o,this.editorGroupService=r,this.editorService=a,this.layoutService=c,this.paneCompositeService=l,this.workingCopyService=d,dDt.bindTo(this.contextKeyService),hDt.bindTo(this.contextKeyService),b6.bindTo(this.contextKeyService),$Le.bindTo(this.contextKeyService),uDt.bindTo(this.contextKeyService),gDt.bindTo(this.contextKeyService),fDt.bindTo(this.contextKeyService),G0t.bindTo(this.contextKeyService).set(S6(this.environmentService.remoteAuthority)||""),this.virtualWorkspaceContext=K0t.bindTo(this.contextKeyService),this.temporaryWorkspaceContext=ZYe.bindTo(this.contextKeyService),this.updateWorkspaceContextKeys(),j0t.bindTo(this.contextKeyService).set(qp.supported(si));const h=!this.environmentService.isBuilt||this.environmentService.isExtensionDevelopment;$2e.bindTo(this.contextKeyService).set(h),fat($2e.key,h),pDt.bindTo(this.contextKeyService).set(this.productService.quality||""),Y0t.bindTo(this.contextKeyService).set(o.embedderIdentifier),this.activeEditorGroupEmpty=X0t.bindTo(this.contextKeyService),this.activeEditorGroupIndex=Z0t.bindTo(this.contextKeyService),this.activeEditorGroupLast=e1t.bindTo(this.contextKeyService),this.activeEditorGroupLocked=t1t.bindTo(this.contextKeyService),this.multipleEditorGroupsContext=i1t.bindTo(this.contextKeyService),this.editorsVisibleContext=n1t.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext=$0t.bindTo(this.contextKeyService),this.dirtyWorkingCopiesContext.set(this.workingCopyService.hasDirty),this.inputFocusedContext=GLe.bindTo(this.contextKeyService),this.workbenchStateContext=H0t.bindTo(this.contextKeyService),this.updateWorkbenchStateContextKey(),this.workspaceFolderCountContext=U0t.bindTo(this.contextKeyService),this.updateWorkspaceFolderCountContextKey(),this.openFolderWorkspaceSupportContext=V0t.bindTo(this.contextKeyService),this.openFolderWorkspaceSupportContext.set(od||typeof this.environmentService.remoteAuthority=="string"),this.emptyWorkspaceSupportContext=XYe.bindTo(this.contextKeyService),this.emptyWorkspaceSupportContext.set(od||typeof this.environmentService.remoteAuthority=="string"),this.enterMultiRootWorkspaceSupportContext=z0t.bindTo(this.contextKeyService),this.enterMultiRootWorkspaceSupportContext.set(od||typeof this.environmentService.remoteAuthority=="string"),this.splitEditorsVerticallyContext=r1t.bindTo(this.contextKeyService),this.updateSplitEditorsVerticallyContext(),this.isMainWindowFullscreenContext=q0t.bindTo(this.contextKeyService),this.isAuxiliaryWindowFocusedContext=Q0t.bindTo(this.contextKeyService),this.inZenModeContext=s1t.bindTo(this.contextKeyService),this.isMainEditorCenteredLayoutContext=o1t.bindTo(this.contextKeyService),this.mainEditorAreaVisibleContext=a1t.bindTo(this.contextKeyService),this.editorTabsVisibleContext=c1t.bindTo(this.contextKeyService),this.sideBarVisibleContext=l1t.bindTo(this.contextKeyService),this.titleAreaVisibleContext=h1t.bindTo(this.contextKeyService),this.titleBarStyleContext=d1t.bindTo(this.contextKeyService),this.updateTitleBarContextKeys(),this.panelPositionContext=g1t.bindTo(this.contextKeyService),this.panelPositionContext.set(N1(this.layoutService.getPanelPosition())),this.panelVisibleContext=p1t.bindTo(this.contextKeyService),this.panelVisibleContext.set(this.layoutService.isVisible(Uv.PANEL_PART)),this.panelMaximizedContext=m1t.bindTo(this.contextKeyService),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.panelAlignmentContext=f1t.bindTo(this.contextKeyService),this.panelAlignmentContext.set(this.layoutService.getPanelAlignment()),this.auxiliaryBarVisibleContext=u1t.bindTo(this.contextKeyService),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Uv.AUXILIARYBAR_PART)),this.registerListeners()}registerListeners(){this.editorGroupService.whenReady.then(()=>{this.updateEditorAreaContextKeys(),this.updateActiveEditorGroupContextKeys(),this.updateVisiblePanesContextKeys()}),this._register(this.editorService.onDidActiveEditorChange(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorService.onDidVisibleEditorsChange(()=>this.updateVisiblePanesContextKeys())),this._register(this.editorGroupService.onDidAddGroup(()=>this.updateEditorGroupsContextKeys())),this._register(this.editorGroupService.onDidRemoveGroup(()=>this.updateEditorGroupsContextKeys())),this._register(this.editorGroupService.onDidChangeGroupIndex(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorGroupService.onDidChangeGroupLocked(()=>this.updateActiveEditorGroupContextKeys())),this._register(this.editorGroupService.onDidChangeEditorPartOptions(()=>this.updateEditorAreaContextKeys())),this._register(M.runAndSubscribe(Xp,({window:e,disposables:t})=>t.add(ue(e,ke.FOCUS_IN,()=>this.updateInputContextKeys(e.document),!0)),{window:si,disposables:this._store})),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateWorkbenchStateContextKey())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>{this.updateWorkspaceFolderCountContextKey(),this.updateWorkspaceContextKeys()})),this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.editor.openSideBySideDirection")&&this.updateSplitEditorsVerticallyContext()})),this._register(this.layoutService.onDidChangeZenMode(e=>this.inZenModeContext.set(e))),this._register(this.layoutService.onDidChangeActiveContainer(()=>this.isAuxiliaryWindowFocusedContext.set(this.layoutService.activeContainer!==this.layoutService.mainContainer))),this._register(dGe(e=>{e===si.vscodeWindowId&&this.isMainWindowFullscreenContext.set(epe(si))})),this._register(this.layoutService.onDidChangeMainEditorCenteredLayout(e=>this.isMainEditorCenteredLayoutContext.set(e))),this._register(this.layoutService.onDidChangePanelPosition(e=>this.panelPositionContext.set(e))),this._register(this.layoutService.onDidChangePanelAlignment(e=>this.panelAlignmentContext.set(e))),this._register(this.paneCompositeService.onDidPaneCompositeClose(()=>this.updateSideBarContextKeys())),this._register(this.paneCompositeService.onDidPaneCompositeOpen(()=>this.updateSideBarContextKeys())),this._register(this.layoutService.onDidChangePartVisibility(()=>{this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible(Uv.EDITOR_PART,si)),this.panelVisibleContext.set(this.layoutService.isVisible(Uv.PANEL_PART)),this.panelMaximizedContext.set(this.layoutService.isPanelMaximized()),this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Uv.AUXILIARYBAR_PART)),this.updateTitleBarContextKeys()})),this._register(this.workingCopyService.onDidChangeDirty(e=>this.dirtyWorkingCopiesContext.set(e.isDirty()||this.workingCopyService.hasDirty)))}updateVisiblePanesContextKeys(){this.editorService.visibleEditorPanes.length>0?this.editorsVisibleContext.set(!0):this.editorsVisibleContext.reset()}updateActiveEditorGroupContextKeys(){this.editorService.activeEditor?this.activeEditorGroupEmpty.reset():this.activeEditorGroupEmpty.set(!0);const e=this.editorGroupService.activeGroup;this.activeEditorGroupIndex.set(e.index+1),this.activeEditorGroupLocked.set(e.isLocked),this.updateEditorGroupsContextKeys()}updateEditorGroupsContextKeys(){const e=this.editorGroupService.count;e>1?this.multipleEditorGroupsContext.set(!0):this.multipleEditorGroupsContext.reset();const t=this.editorGroupService.activeGroup;this.activeEditorGroupLast.set(t.index===e-1)}updateEditorAreaContextKeys(){this.editorTabsVisibleContext.set(this.editorGroupService.partOptions.showTabs==="multiple")}updateInputContextKeys(e){function t(){return!!e.activeElement&&(e.activeElement.tagName==="INPUT"||e.activeElement.tagName==="TEXTAREA")}const i=t();if(this.inputFocusedContext.set(i),i){const n=Ac(e.activeElement);M.once(n.onDidBlur)(()=>{Ey().document===e&&this.inputFocusedContext.set(t()),n.dispose()})}}updateWorkbenchStateContextKey(){this.workbenchStateContext.set(this.getWorkbenchStateString())}updateWorkspaceFolderCountContextKey(){this.workspaceFolderCountContext.set(this.contextService.getWorkspace().folders.length)}updateSplitEditorsVerticallyContext(){const e=OW(this.configurationService);this.splitEditorsVerticallyContext.set(e===FW.DOWN)}getWorkbenchStateString(){switch(this.contextService.getWorkbenchState()){case qi.EMPTY:return"empty";case qi.FOLDER:return"folder";case qi.WORKSPACE:return"workspace"}}updateSideBarContextKeys(){this.sideBarVisibleContext.set(this.layoutService.isVisible(Uv.SIDEBAR_PART))}updateTitleBarContextKeys(){this.titleAreaVisibleContext.set(this.layoutService.isVisible(Uv.TITLEBAR_PART,si)),this.titleBarStyleContext.set(XMe(this.configurationService))}updateWorkspaceContextKeys(){this.virtualWorkspaceContext.set(Dtt(this.contextService.getWorkspace())||""),this.temporaryWorkspaceContext.set(Ry(this.contextService.getWorkspace()))}};_ke=D([_(0,Le),_(1,yi),_(2,Te),_(3,Jr),_(4,Er),_(5,Po),_(6,ei),_(7,CI),_(8,Dm),_(9,Im)],_ke);class qZt extends li{constructor(){super({id:"workbench.action.toggleKeybindingsLog",title:Fe(3525,"Toggle Keyboard Shortcuts Troubleshooting"),category:ca.Developer,f1:!0})}run(e){e.get(Ut).toggleLogging()&&e.get(vi).executeCommand(net)}}At(qZt);class QZt{static hasOpenBrace(e){for(;e.scan()!==ft.EOF;)if(e.getToken()===ft.OpenBraceToken)return!0;return!1}static offsetToPosition(e,t){let i=0;const n=e.getEOL().length,o=e.getLineCount();for(let r=1;r<=o;r++){const a=e.getLineLength(r)+n,c=i+a;if(c>t)return new oe(r,t-i+1);i=c}return new oe(o,e.getLineMaxColumn(o))}static insertSnippet(e,t){const i=e.getValueLengthInRange(new F(1,1,t.lineNumber,t.column));let n;(function(f){f[f.INVALID=0]="INVALID",f[f.AFTER_OBJECT=1]="AFTER_OBJECT",f[f.BEFORE_OBJECT=2]="BEFORE_OBJECT"})(n||(n={}));let o=n.INVALID,r=-1,a=n.INVALID;const c=bLe(e.getValue());let l=0,d=0;const h=(f,p)=>{p!==n.INVALID&&l===1&&d===0?(o=p,r=f,a=p):o!==n.INVALID&&(o=n.INVALID,r=c.getTokenOffset())};for(;c.scan()!==ft.EOF;){const f=c.getPosition(),p=c.getToken();let m=!1;switch(p){case ft.OpenBracketToken:m=!0,l++,h(f,n.BEFORE_OBJECT);break;case ft.CloseBracketToken:m=!0,l--,h(f,n.INVALID);break;case ft.CommaToken:m=!0,h(f,n.BEFORE_OBJECT);break;case ft.OpenBraceToken:m=!0,d++,h(f,n.INVALID);break;case ft.CloseBraceToken:m=!0,d--,h(f,n.AFTER_OBJECT);break;case ft.Trivia:case ft.LineBreakTrivia:m=!0}if(f>=i&&(o!==n.INVALID||r!==-1)){let v,b;return o!==n.INVALID?(v=m?f:c.getTokenOffset(),b=o):(v=r,b=a),b===n.AFTER_OBJECT?{position:this.offsetToPosition(e,v),prepend:",",append:""}:(c.setPosition(v),{position:this.offsetToPosition(e,v),prepend:"",append:this.hasOpenBrace(c)?",":""})}}const u=e.getLineCount();return{position:new oe(u,e.getLineMaxColumn(u)),prepend:` +[`,append:"]"}}}var jZt=".defineKeybindingWidget{padding:10px;position:absolute}.defineKeybindingWidget .message{text-align:center;width:400px}.defineKeybindingWidget .existing,.defineKeybindingWidget .monaco-inputbox,.defineKeybindingWidget .output{display:block;margin-top:10px;text-align:center;width:400px}.defineKeybindingWidget .input{text-align:center}.defineKeybindingWidget .output{display:flex;justify-content:center}.defineKeybindingWidget .existing .existingText{cursor:pointer;text-decoration:underline}.defineKeybindingWidget .output .monaco-keybinding{margin:0 4px}.monaco-editor .keybindingInfo{background-color:rgba(100,100,250,.2);box-shadow:inset 0 0 0 1px #b9b9b9}.monaco-editor .keybindingError{background-color:hsla(0,94%,69%,.2);box-shadow:inset 0 0 0 1px #b9b9b9}";ut(jZt,{});const YZt=oi("settings-folder-dropdown",ve.triangleDown,g(6300,"Icon for the folder dropdown button in the split JSON Settings editor."));oi("settings-more-action",ve.gear,g(6301,"Icon for the 'more actions' action in the Settings UI."));oi("keybindings-record-keys",ve.recordKeys,g(6302,"Icon for the 'record keys' action in the keybinding UI."));oi("keybindings-sort",ve.sortPrecedence,g(6303,"Icon for the 'sort by precedence' toggle in the keybinding UI."));oi("keybindings-edit",ve.edit,g(6304,"Icon for the edit action in the keybinding UI."));oi("keybindings-add",ve.add,g(6305,"Icon for the add action in the keybinding UI."));oi("settings-edit",ve.edit,g(6306,"Icon for the edit action in the Settings UI."));oi("settings-remove",ve.close,g(6307,"Icon for the remove action in the Settings UI."));oi("settings-discard",ve.discard,g(6308,"Icon for the discard action in the Settings UI."));oi("preferences-clear-input",ve.clearAll,g(6309,"Icon for clear input in the Settings and keybinding UI."));oi("preferences-filter",ve.filter,g(6310,"Icon for the button that suggests filters for the Settings UI."));oi("preferences-open-settings",ve.goToFile,g(6311,"Icon for open settings commands."));let vke=class extends Hf{constructor(e,t,i,n){super(null,e),this.contextService=t,this.contextMenuService=i,this.hoverService=n,this._folderSettingCounts=new Map;const o=this.contextService.getWorkspace();this._folder=o.folders.length===1?o.folders[0]:null,this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.onWorkspaceFoldersChanged()))}get folder(){return this._folder}set folder(e){this._folder=e,this.update()}setCount(e,t){const i=this.contextService.getWorkspaceFolder(e);if(!i)throw new Error("unknown folder");const n=i.uri;this._folderSettingCounts.set(n.toString(),t),this.update()}render(e){this.element=e,this.container=e,this.labelElement=fe(".action-title"),this.detailsElement=fe(".action-details"),this.dropDownElement=fe(".dropdown-icon.hide"+We.asCSSSelector(YZt)),this.anchorElement=fe("a.action-label.folder-settings",{role:"button","aria-haspopup":"true",tabindex:"0"},this.labelElement,this.detailsElement,this.dropDownElement),this.anchorElementHover=this._register(this.hoverService.setupManagedHover(Pr("mouse"),this.anchorElement,"")),this._register(ue(this.anchorElement,ke.MOUSE_DOWN,t=>en.stop(t))),this._register(ue(this.anchorElement,ke.CLICK,t=>this.onClick(t))),this._register(ue(this.container,ke.KEY_UP,t=>this.onKeyUp(t))),re(this.container,this.anchorElement),this.update()}onKeyUp(e){switch(new En(e).keyCode){case S.Enter:case S.Space:this.onClick(e);return}}onClick(e){en.stop(e,!0),!this.folder||this._action.checked?this.showMenu():this._action.run(this._folder)}updateEnabled(){this.update()}updateChecked(){this.update()}onWorkspaceFoldersChanged(){const e=this._folder,t=this.contextService.getWorkspace();e&&(this._folder=t.folders.filter(i=>ji(i.uri,e.uri))[0]||t.folders[0]),this._folder=this._folder?this._folder:t.folders.length===1?t.folders[0]:null,this.update(),this._action.checked&&this._action.run(this._folder)}update(){let e=0;this._folderSettingCounts.forEach(i=>e+=i);const t=this.contextService.getWorkspace();if(this._folder){this.labelElement.textContent=this._folder.name,this.anchorElementHover.update(this._folder.name);const i=this.labelWithCount(this._action.label,e);this.detailsElement.textContent=i,this.dropDownElement.classList.toggle("hide",t.folders.length===1||!this._action.checked)}else{const i=this.labelWithCount(this._action.label,e);this.labelElement.textContent=i,this.detailsElement.textContent="",this.anchorElementHover.update(this._action.label),this.dropDownElement.classList.remove("hide")}this.anchorElement.classList.toggle("checked",this._action.checked),this.container.classList.toggle("disabled",!this._action.enabled)}showMenu(){this.contextMenuService.showContextMenu({getAnchor:()=>this.container,getActions:()=>this.getDropdownMenuActions(),getActionViewItem:()=>{},onHide:()=>{this.anchorElement.blur()}})}getDropdownMenuActions(){const e=[],t=this.contextService.getWorkspace().folders;return this.contextService.getWorkbenchState()===qi.WORKSPACE&&t.length>0&&e.push(...t.map((i,n)=>{const o=this._folderSettingCounts.get(i.uri.toString());return{id:"folderSettingsTarget"+n,label:this.labelWithCount(i.name,o),tooltip:this.labelWithCount(i.name,o),checked:!!this.folder&&ji(this.folder.uri,i.uri),enabled:!0,class:void 0,run:()=>this._action.run(i)}})),e}labelWithCount(e,t){return t&&(e+=` (${t})`),e}};vke=D([_(1,yi),_(2,lr),_(3,ec)],vke);let a9e=class extends gd{constructor(e,t,i,n,o,r,a){super(),this.contextService=i,this.instantiationService=n,this.environmentService=o,this.labelService=r,this.languageService=a,this._settingsTarget=null,this._onDidTargetChange=this._register(new I),this.onDidTargetChange=this._onDidTargetChange.event,this.options=t??{},this.create(e),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.onWorkbenchStateChanged())),this._register(this.contextService.onDidChangeWorkspaceFolders(()=>this.update()))}resetLabels(){const e=this.environmentService.remoteAuthority,t=e&&this.labelService.getHostLabel(pe.vscodeRemote,e);this.userLocalSettings.label=g(10331,"User"),this.userRemoteSettings.label=g(10332,"Remote")+(t?` [${t}]`:""),this.workspaceSettings.label=g(10333,"Workspace"),this.folderSettingsAction.label=g(10334,"Folder")}create(e){const t=re(e,fe(".settings-tabs-widget"));this.settingsSwitcherBar=this._register(new ld(t,{orientation:M_.HORIZONTAL,focusOnlyEnabledItems:!0,ariaLabel:g(10335,"Settings Switcher"),ariaRole:"tablist",actionViewItemProvider:(o,r)=>o.id==="folderSettings"?this.folderSettings:void 0})),this.userLocalSettings=new rn("userSettings","",".settings-tab",!0,()=>this.updateTarget(St.USER_LOCAL)),this.userLocalSettings.tooltip=g(10331,"User"),this.userRemoteSettings=new rn("userSettingsRemote","",".settings-tab",!0,()=>this.updateTarget(St.USER_REMOTE));const i=this.environmentService.remoteAuthority,n=i&&this.labelService.getHostLabel(pe.vscodeRemote,i);this.userRemoteSettings.tooltip=g(10332,"Remote")+(n?` [${n}]`:""),this.workspaceSettings=new rn("workspaceSettings","",".settings-tab",!1,()=>this.updateTarget(St.WORKSPACE)),this.folderSettingsAction=new rn("folderSettings","",".settings-tab",!1,async o=>{this.updateTarget(rje(o)?o.uri:St.USER_LOCAL)}),this.folderSettings=this.instantiationService.createInstance(vke,this.folderSettingsAction),this.resetLabels(),this.update(),this.settingsSwitcherBar.push([this.userLocalSettings,this.userRemoteSettings,this.workspaceSettings,this.folderSettingsAction])}get settingsTarget(){return this._settingsTarget}set settingsTarget(e){this._settingsTarget=e,this.userLocalSettings.checked=St.USER_LOCAL===this.settingsTarget,this.userRemoteSettings.checked=St.USER_REMOTE===this.settingsTarget,this.workspaceSettings.checked=St.WORKSPACE===this.settingsTarget,this.settingsTarget instanceof N?(this.folderSettings.action.checked=!0,this.folderSettings.folder=this.contextService.getWorkspaceFolder(this.settingsTarget)):this.folderSettings.action.checked=!1}setResultCount(e,t){if(e===St.WORKSPACE){let i=g(10333,"Workspace");t&&(i+=` (${t})`),this.workspaceSettings.label=i}else if(e===St.USER_LOCAL){let i=g(10331,"User");t&&(i+=` (${t})`),this.userLocalSettings.label=i}else e instanceof N&&this.folderSettings.setCount(e,t)}updateLanguageFilterIndicators(e){if(this.resetLabels(),e){const t=this.languageService.getLanguageName(e);if(t){const i=` [${t}]`;this.userLocalSettings.label+=i,this.userRemoteSettings.label+=i,this.workspaceSettings.label+=i,this.folderSettingsAction.label+=i}}}onWorkbenchStateChanged(){this.folderSettings.folder=null,this.update(),this.settingsTarget===St.WORKSPACE&&this.contextService.getWorkbenchState()===qi.WORKSPACE&&this.updateTarget(St.USER_LOCAL)}updateTarget(e){return this.settingsTarget===e||e instanceof N&&this.settingsTarget instanceof N&&ji(this.settingsTarget,e)||(this.settingsTarget=e,this._onDidTargetChange.fire(this.settingsTarget)),Promise.resolve(void 0)}async update(){this.settingsSwitcherBar.domNode.classList.toggle("empty-workbench",this.contextService.getWorkbenchState()===qi.EMPTY),this.userRemoteSettings.enabled=!!(this.options.enableRemoteSettings&&this.environmentService.remoteAuthority),this.workspaceSettings.enabled=this.contextService.getWorkbenchState()!==qi.EMPTY,this.folderSettings.action.enabled=this.contextService.getWorkbenchState()===qi.WORKSPACE&&this.contextService.getWorkspace().folders.length>0,this.workspaceSettings.tooltip=g(10333,"Workspace")}};a9e=D([_(2,yi),_(3,we),_(4,Jr),_(5,Fs),_(6,xi)],a9e);let bke=class extends gd{constructor(e,t,i,n,o,r){super(),this.options=t,this.contextViewService=i,this.instantiationService=n,this.contextKeyService=o,this.keybindingService=r,this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onFocus=this._register(new I),this.onFocus=this._onFocus.event,this.create(e)}create(e){this.domNode=re(e,fe("div.settings-header-widget")),this.createSearchContainer(re(this.domNode,fe("div.settings-search-container"))),this.controlsDiv=re(this.domNode,fe("div.settings-search-controls")),this.options.showResultCount&&(this.countElement=re(this.controlsDiv,fe(".settings-count-widget")),this.countElement.style.backgroundColor=ze(_T),this.countElement.style.color=ze(Hre),this.countElement.style.border=`1px solid ${ze(wt)}`),this.inputBox.inputElement.setAttribute("aria-live",this.options.ariaLive||"off"),this.options.ariaLabelledBy&&this.inputBox.inputElement.setAttribute("aria-labelledBy",this.options.ariaLabelledBy);const t=this._register(Ac(this.inputBox.inputElement));this._register(t.onDidFocus(()=>this._onFocus.fire()));const i=this.options.focusKey;i&&(this._register(t.onDidFocus(()=>i.set(!0))),this._register(t.onDidBlur(()=>i.set(!1))))}createSearchContainer(e){this.searchContainer=e;const t=re(this.searchContainer,fe("div.settings-search-input"));this.inputBox=this._register(this.createInputBox(t)),this._register(this.inputBox.onDidChange(i=>this._onDidChange.fire(i)))}createInputBox(e){const t=()=>UX(this.keybindingService);return this._register(new eX(e,this.contextViewService,{...this.options,showHistoryHint:t},this.contextKeyService))}showMessage(e){this.countElement&&e!==this.countElement.textContent&&(this.countElement.textContent=e,this.inputBox.inputElement.setAttribute("aria-label",e),this.inputBox.inputElement.style.paddingRight=this.getControlsWidth()+"px")}layout(e){e.width<400?(this.countElement?.classList.add("hide"),this.inputBox.inputElement.style.paddingRight="0px"):(this.countElement?.classList.remove("hide"),this.inputBox.inputElement.style.paddingRight=this.getControlsWidth()+"px")}getControlsWidth(){return(this.countElement?Md(this.countElement):0)+20}focus(){this.inputBox.focus(),this.getValue()&&this.inputBox.select()}hasFocus(){return this.inputBox.hasFocus()}clear(){this.inputBox.value=""}getValue(){return this.inputBox.value}setValue(e){return this.inputBox.value=e}dispose(){this.options.focusKey?.set(!1),super.dispose()}};bke=D([_(2,gf),_(3,we),_(4,Le),_(5,Ut)],bke);var GP,wke;let yke=class extends bke{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.recordDisposables=this._register(new Z),this._onKeybinding=this._register(new I),this.onKeybinding=this._onKeybinding.event,this._onEnter=this._register(new I),this.onEnter=this._onEnter.event,this._onEscape=this._register(new I),this.onEscape=this._onEscape.event,this._onBlur=this._register(new I),this.onBlur=this._onBlur.event,this._register(Ee(()=>this.stopRecordingKeys())),this._chords=null,this._inputValue=""}clear(){this._chords=null,super.clear()}startRecordingKeys(){this.recordDisposables.add(ue(this.inputBox.inputElement,ke.KEY_DOWN,e=>this._onKeyDown(new En(e)))),this.recordDisposables.add(ue(this.inputBox.inputElement,ke.BLUR,()=>this._onBlur.fire())),this.recordDisposables.add(ue(this.inputBox.inputElement,ke.INPUT,()=>{this.setInputValue(this._inputValue)}))}stopRecordingKeys(){this._chords=null,this.recordDisposables.clear()}setInputValue(e){this._inputValue=e,this.inputBox.value=this._inputValue}_onKeyDown(e){if(e.preventDefault(),e.stopPropagation(),!this.options.recordEnter&&e.equals(S.Enter)){this._onEnter.fire();return}if(e.equals(S.Escape)){this._onEscape.fire();return}this.printKeybinding(e)}printKeybinding(e){const t=this.keybindingService.resolveKeyboardEvent(e),i=`code: ${e.browserEvent.code}, keyCode: ${e.browserEvent.keyCode}, key: ${e.browserEvent.key} => UI: ${t.getAriaLabel()}, user settings: ${t.getUserSettingsLabel()}, dispatch: ${t.getDispatchChords()[0]}`,n=this.options;this._chords||(this._chords=[]),this._chords.length>0&&this._chords[this._chords.length-1].getDispatchChords()[0]===null?this._chords[this._chords.length-1]=t:(this._chords.length===2&&(this._chords=[]),this._chords.push(t));const r=this._chords.map(a=>a.getUserSettingsLabel()||"").join(" ");this.setInputValue(n.quoteRecordedKeys?`"${r}"`:r),this.inputBox.inputElement.title=i,this._onKeybinding.fire(this._chords)}};yke=D([_(2,gf),_(3,we),_(4,Le),_(5,Ut)],yke);var _k;let Cke=(_k=class extends gd{constructor(e,t){super(),this.instantiationService=t,this._keybindingDisposables=this._register(new Z),this._chords=null,this._isVisible=!1,this._onHide=this._register(new I),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._onShowExistingKeybindings=this._register(new I),this.onShowExistingKeybidings=this._onShowExistingKeybindings.event,this._domNode=ls(document.createElement("div")),this._domNode.setDisplay("none"),this._domNode.setClassName("defineKeybindingWidget"),this._domNode.setWidth(GP.WIDTH),this._domNode.setHeight(GP.HEIGHT);const i=g(8667,"Press desired key combination and then press ENTER.");re(this._domNode.domNode,fe(".message",void 0,i)),this._domNode.domNode.style.backgroundColor=ze(Ah),this._domNode.domNode.style.color=ze(EN),this._domNode.domNode.style.boxShadow=`0 2px 8px ${ze(mI)}`,this._keybindingInputWidget=this._register(this.instantiationService.createInstance(yke,this._domNode.domNode,{ariaLabel:i,history:[],inputBoxStyles:yM})),this._keybindingInputWidget.startRecordingKeys(),this._register(this._keybindingInputWidget.onKeybinding(n=>this.onKeybinding(n))),this._register(this._keybindingInputWidget.onEnter(()=>this.hide())),this._register(this._keybindingInputWidget.onEscape(()=>this.clearOrHide())),this._register(this._keybindingInputWidget.onBlur(()=>this.onCancel())),this._outputNode=re(this._domNode.domNode,fe(".output")),this._showExistingKeybindingsNode=re(this._domNode.domNode,fe(".existing")),e&&re(e,this._domNode.domNode)}get domNode(){return this._domNode.domNode}define(){return this._keybindingInputWidget.clear(),Zs.withAsyncBody(async e=>{this._isVisible||(this._isVisible=!0,this._domNode.setDisplay("block"),this._chords=null,this._keybindingInputWidget.setInputValue(""),Ms(this._outputNode),Ms(this._showExistingKeybindingsNode),await Sr(0),this._keybindingInputWidget.focus());const t=this._onHide.event(()=>{e(this.getUserSettingsLabel()),t.dispose()})})}layout(e){const t=Math.round((e.height-GP.HEIGHT)/2);this._domNode.setTop(t);const i=Math.round((e.width-GP.WIDTH)/2);this._domNode.setLeft(i)}printExisting(e){if(e>0){const t=fe("span.existingText"),i=e===1?g(8668,"1 existing command has this keybinding",e):g(8669,"{0} existing commands have this keybinding",e);re(t,document.createTextNode(i)),Mr(i),this._showExistingKeybindingsNode.appendChild(t),t.onmousedown=n=>{n.preventDefault()},t.onmouseup=n=>{n.preventDefault()},t.onclick=()=>{this._onShowExistingKeybindings.fire(this.getUserSettingsLabel())}}}onKeybinding(e){if(this._keybindingDisposables.clear(),this._chords=e,Ms(this._outputNode),Ms(this._showExistingKeybindingsNode),this._keybindingDisposables.add(new Vk(this._outputNode,po,n_e)).set(this._chords?.[0]??void 0),this._chords)for(let n=1;nt.getUserSettingsLabel()).join(" ")),e}onCancel(){this._chords=null,this.hide()}clearOrHide(){this._chords===null?this.hide():(this._chords=null,this._keybindingInputWidget.clear(),Ms(this._outputNode),Ms(this._showExistingKeybindingsNode))}hide(){this._domNode.setDisplay("none"),this._isVisible=!1,this._onHide.fire()}},GP=_k,_k.WIDTH=400,_k.HEIGHT=110,_k);Cke=GP=D([_(1,we)],Cke);var tM;let Ske=(tM=class extends V{constructor(e,t){super(),this._editor=e,this._widget=this._register(t.createInstance(Cke,null)),this._editor.addOverlayWidget(this)}getId(){return wke.ID}getDomNode(){return this._widget.domNode}getPosition(){return{preference:null}}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}start(){this._editor.hasModel()&&this._editor.revealPositionInCenterIfOutsideViewport(this._editor.getPosition(),mt.Smooth);const e=this._editor.getLayoutInfo();return this._widget.layout(new bn(e.width,e.height)),this._widget.define()}},wke=tM,tM.ID="editor.contrib.defineKeybindingWidget",tM);Ske=wke=D([_(1,we)],Ske);var Ake;const JZt=g(3526,"You won't be able to produce this key combination under your current keyboard layout.");let Eke=class extends V{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._userDataProfileService=i,this._keybindingDecorationRenderer=this._register(new wn),this._defineWidget=this._register(this._instantiationService.createInstance(Ske,this._editor)),this._register(this._editor.onDidChangeModel(n=>this._update())),this._update()}_update(){this._keybindingDecorationRenderer.value=c9e(this._editor,this._userDataProfileService)?this._instantiationService.createInstance(xke,this._editor):void 0}showDefineKeybindingWidget(){c9e(this._editor,this._userDataProfileService)&&this._defineWidget.start().then(e=>this._onAccepted(e))}_onAccepted(e){if(this._editor.focus(),e&&this._editor.hasModel()){new RegExp(/\\/g).test(e)&&(e=e.slice(0,-1)+"\\\\");let n=["{",' "key": '+JSON.stringify(e)+",",' "command": "${1:commandId}",',' "when": "${2:editorTextFocus}"',"}$0"].join(` +`);const o=QZt.insertSnippet(this._editor.getModel(),this._editor.getPosition());n=o.prepend+n+o.append,this._editor.setPosition(o.position),fc.get(this._editor)?.insert(n,{overwriteBefore:0,overwriteAfter:0})}}};Eke=D([_(1,we),_(2,lg)],Eke);let xke=Ake=class extends V{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._dec=this._editor.createDecorationsCollection(),this._updateDecorations=this._register(new cn(()=>this._updateDecorationsNow(),500));const i=qn(this._editor.getModel());this._register(i.onDidChangeContent(()=>this._updateDecorations.schedule())),this._register(this._keybindingService.onDidUpdateKeybindings(()=>this._updateDecorations.schedule())),this._register({dispose:()=>{this._dec.clear(),this._updateDecorations.cancel()}}),this._updateDecorations.schedule()}_updateDecorationsNow(){const e=qn(this._editor.getModel()),t=[],i=wLe(e.getValue());if(i&&Array.isArray(i.children))for(let n=0,o=i.children.length;n{this.updateResolver()})),t.add(Ee(()=>{const i=this.keybindingProviders.indexOf(e);i>=0&&(this.keybindingProviders.splice(i,1),this.updateResolver())})),t}_getResolver(){return super._getResolver()}_dispatch(e,t){return this.shouldUseGlobalKeybindings()?super._dispatch(e,t):!1}getUserKeybindingItems(){return[...super.getUserKeybindingItems(),...this.keybindingProviders.flatMap(e=>e.provideKeybindings())]}};Dke=D([_(1,Le),_(2,vi),_(3,Yi),_(4,bi),_(5,lg),_(6,xc),_(7,fs),_(8,Jt),_(9,ks),_(10,Ge),_(11,Mae)],Dke);stt(s=>{s.get(we).createInstance(_ke)});function ZZt({shouldUseGlobalKeybindings:s=()=>!1}={}){return{...kce(),[Ut.toString()]:new wi(Dke,[s],!1),[Mae.toString()]:new wi(pke,[],!0),[vi.toString()]:new wi(mke,[],!0)}}class eei{constructor(){this._provider=new oo,this.onDidChange=this._provider.onDidChange}addStatus(e){return this._provider.register(e.selector,e)}getLanguageStatus(e){return this._provider.ordered(e).sort((t,i)=>{let n=i.severity-t.severity;return n===0&&(n=dm(t.source,i.source)),n===0&&(n=dm(t.id,i.id)),n})}}var kke;function Ust(s){if(!Array.isArray(s))return!1;for(let e=0,t=s.length;e{this._extensionService.whenInstalledExtensionsRegistered().then(()=>{this._loadConfigurationsForMode(o)})})),this._register(this._languageService.onDidChange(()=>{for(const[o]of this._done)this._loadConfigurationsForMode(o)}))}async _loadConfigurationsForMode(e){const t=this._languageService.getConfigurationFiles(e),i=Wc(t.map(o=>o.toString()));if(this._done.get(e)===i)return;this._done.set(e,i);const n=await Promise.all(t.map(o=>this._readConfigFile(o)));for(const o of n)this._handleConfig(e,o)}async _readConfigFile(e){try{const t=await this._extensionResourceLoaderService.readExtensionResource(e),i=[];let n=ef(t,i);return i.length&&console.error(g(2492,"Errors parsing {0}: {1}",e.toString(),i.map(o=>`[${o.offset}, ${o.length}] ${xee(o.error)}`).join(` +`))),tD(n)!=="object"&&(console.error(g(2493,"{0}: Invalid format, JSON object expected.",e.toString())),n={}),n}catch(t){return console.error(t),{}}}static _extractValidCommentRule(e,t){const i=t.comments;if(typeof i>"u")return;if(!kn(i)){console.warn(`[${e}]: language configuration: expected \`comments\` to be an object.`);return}let n;return typeof i.lineComment<"u"&&(typeof i.lineComment!="string"?console.warn(`[${e}]: language configuration: expected \`comments.lineComment\` to be a string.`):(n=n||{},n.lineComment=i.lineComment)),typeof i.blockComment<"u"&&(x4(i.blockComment)?(n=n||{},n.blockComment=i.blockComment):console.warn(`[${e}]: language configuration: expected \`comments.blockComment\` to be an array of two strings.`)),n}static _extractValidBrackets(e,t){const i=t.brackets;if(typeof i>"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`brackets\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`autoClosingPairs\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`surroundingPairs\` to be an array.`);return}let n;for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);return}const n=[];for(let o=0,r=i.length;o"u")return;if(!Array.isArray(i)){console.warn(`[${e}]: language configuration: expected \`onEnterRules\` to be an array.`);return}let n;for(let o=0,r=i.length;o `,description:g(2505,"Defines what characters must be after the cursor in order for bracket or quote autoclosing to occur when using the 'languageDefined' autoclosing setting. This is typically the set of characters which can not start an expression."),type:"string"},surroundingPairs:{default:[["(",")"],["[","]"],["{","}"]],description:g(2506,"Defines the bracket pairs that can be used to surround a selected string."),type:"array",items:{oneOf:[{$ref:"#/definitions/bracketPair"},{type:"object",properties:{open:{$ref:"#/definitions/openBracket"},close:{$ref:"#/definitions/closeBracket"}}}]}},wordPattern:{default:"",description:g(2507,"Defines what is considered to be a word in the programming language."),type:["string","object"],properties:{pattern:{type:"string",description:g(2508,"The RegExp pattern used to match words."),default:""},flags:{type:"string",description:g(2509,"The RegExp flags used to match words."),default:"g",pattern:"^([gimuy]+)$",patternErrorMessage:g(2510,"Must match the pattern `/^([gimuy]+)$/`.")}}},indentationRules:{default:{increaseIndentPattern:"",decreaseIndentPattern:""},description:g(2511,"The language's indentation settings."),type:"object",properties:{increaseIndentPattern:{type:["string","object"],description:g(2512,"If a line matches this pattern, then all the lines after it should be indented once (until another rule matches)."),properties:{pattern:{type:"string",description:g(2513,"The RegExp pattern for increaseIndentPattern."),default:""},flags:{type:"string",description:g(2514,"The RegExp flags for increaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2515,"Must match the pattern `/^([gimuy]+)$/`.")}}},decreaseIndentPattern:{type:["string","object"],description:g(2516,"If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches)."),properties:{pattern:{type:"string",description:g(2517,"The RegExp pattern for decreaseIndentPattern."),default:""},flags:{type:"string",description:g(2518,"The RegExp flags for decreaseIndentPattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2519,"Must match the pattern `/^([gimuy]+)$/`.")}}},indentNextLinePattern:{type:["string","object"],description:g(2520,"If a line matches this pattern, then **only the next line** after it should be indented once."),properties:{pattern:{type:"string",description:g(2521,"The RegExp pattern for indentNextLinePattern."),default:""},flags:{type:"string",description:g(2522,"The RegExp flags for indentNextLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2523,"Must match the pattern `/^([gimuy]+)$/`.")}}},unIndentedLinePattern:{type:["string","object"],description:g(2524,"If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules."),properties:{pattern:{type:"string",description:g(2525,"The RegExp pattern for unIndentedLinePattern."),default:""},flags:{type:"string",description:g(2526,"The RegExp flags for unIndentedLinePattern."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2527,"Must match the pattern `/^([gimuy]+)$/`.")}}}}},folding:{type:"object",description:g(2528,"The language's folding settings."),properties:{offSide:{type:"boolean",description:g(2529,"A language adheres to the off-side rule if blocks in that language are expressed by their indentation. If set, empty lines belong to the subsequent block.")},markers:{type:"object",description:g(2530,"Language specific folding markers such as '#region' and '#endregion'. The start and end regexes will be tested against the contents of all lines and must be designed efficiently"),properties:{start:{type:"string",description:g(2531,"The RegExp pattern for the start marker. The regexp must start with '^'.")},end:{type:"string",description:g(2532,"The RegExp pattern for the end marker. The regexp must start with '^'.")}}}}},onEnterRules:{type:"array",description:g(2533,"The language's rules to be evaluated when pressing Enter."),items:{type:"object",description:g(2533,"The language's rules to be evaluated when pressing Enter."),required:["beforeText","action"],properties:{beforeText:{type:["string","object"],description:g(2534,"This rule will only execute if the text before the cursor matches this regular expression."),properties:{pattern:{type:"string",description:g(2535,"The RegExp pattern for beforeText."),default:""},flags:{type:"string",description:g(2536,"The RegExp flags for beforeText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2537,"Must match the pattern `/^([gimuy]+)$/`.")}}},afterText:{type:["string","object"],description:g(2538,"This rule will only execute if the text after the cursor matches this regular expression."),properties:{pattern:{type:"string",description:g(2539,"The RegExp pattern for afterText."),default:""},flags:{type:"string",description:g(2540,"The RegExp flags for afterText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2541,"Must match the pattern `/^([gimuy]+)$/`.")}}},previousLineText:{type:["string","object"],description:g(2542,"This rule will only execute if the text above the line matches this regular expression."),properties:{pattern:{type:"string",description:g(2543,"The RegExp pattern for previousLineText."),default:""},flags:{type:"string",description:g(2544,"The RegExp flags for previousLineText."),default:"",pattern:"^([gimuy]+)$",patternErrorMessage:g(2545,"Must match the pattern `/^([gimuy]+)$/`.")}}},action:{type:["string","object"],description:g(2546,"The action to execute."),required:["indent"],default:{indent:"indent"},properties:{indent:{type:"string",description:g(2547,"Describe what to do with the indentation"),default:"indent",enum:["none","indent","indentOutdent","outdent"],markdownEnumDescriptions:[g(2548,"Insert new line and copy the previous line's indentation."),g(2549,"Insert new line and indent once (relative to the previous line's indentation)."),g(2550,`Insert two new lines: - the first one indented which will hold the cursor - - the second one at the same indentation level`),g(2551,"Insert new line and outdent once (relative to the previous line's indentation).")]},appendText:{type:"string",description:g(2552,"Describes text to be appended after the new line and after the indentation."),default:""},removeText:{type:"number",description:g(2553,"Describes the number of characters to remove from the new line's indentation."),default:0}}}}}}}},fei=Qe.as(YA.JSONContribution);fei.registerSchema(uei,gei);var JB;let ene=(JB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(Pke)}},JB.ID="workbench.contrib.languageConfigurationExtensionPoint",JB);ene=D([_(0,we)],ene);Qu(ene.ID,ene,yc.BlockStartup);function pei(){return{...Rce(),[xi.toString()]:new wi(wbe,[],!1),[Yae.toString()]:new wi(hei,[],!0)}}let Fke=class extends V{constructor(e,t,i){super(),this._modelService=e,this._textModelService=t,this._undoRedoService=i,this._register(this._modelService.onModelRemoved(n=>{const o=this._undoRedoService.getElements(n.uri);if(!(o.past.length===0&&o.future.length===0)){for(const r of o.past)r instanceof mme&&r.setDelegate(this);for(const r of o.future)r instanceof mme&&r.setDelegate(this)}}))}prepareUndoRedo(e){const t=e.getMissingModels();if(t.length===0)return V.None;const i=t.map(async n=>{try{return await this._textModelService.createModelReference(n)}catch{return V.None}});return Promise.all(i).then(n=>({dispose:()=>bt(n)}))}};Fke=D([_(0,gi),_(1,fn),_(2,JA)],Fke);let Oke=class extends Brt{constructor(e,t,i,n){super(),this.instantiationService=e,this.textFileService=t,this.fileService=i,this.modelService=n,this.providers=new Map,this.modelsToDispose=new Set}createReferencedObject(e){return this.doCreateReferencedObject(e)}async doCreateReferencedObject(e,t){this.modelsToDispose.delete(e);const i=N.parse(e);if(i.scheme===pe.inMemory){if(!this.modelService.getModel(i))throw new Error(`Unable to resolve inMemory resource ${e}`);const o=this.instantiationService.createInstance(C9,i);if(this.ensureResolvedModel(o,e))return o}if(i.scheme===pe.untitled){const n=await this.textFileService.untitled.resolve({untitledResource:i});if(this.ensureResolvedModel(n,e))return n}if(this.fileService.hasProvider(i)){const n=await this.textFileService.files.resolve(i,{reason:X3.REFERENCE});if(this.ensureResolvedModel(n,e))return n}if(this.providers.has(i.scheme)){await this.resolveTextModelContent(e);const n=this.instantiationService.createInstance(C9,i);if(this.ensureResolvedModel(n,e))return n}if(!t)return await this.fileService.activateProvider(i.scheme),this.doCreateReferencedObject(e,!0);throw new Error(`Unable to resolve resource ${e}`)}ensureResolvedModel(e,t){if(nht(e))return!0;throw new Error(`Unable to resolve resource ${t}`)}destroyReferencedObject(e,t){N.parse(e).scheme!==pe.inMemory&&(this.modelsToDispose.add(e),(async()=>{try{const n=await t;if(!this.modelsToDispose.has(e)||(n instanceof dee?await this.textFileService.files.canDispose(n):n instanceof lee&&await this.textFileService.untitled.canDispose(n),!this.modelsToDispose.has(e)))return;n.dispose()}catch{}finally{this.modelsToDispose.delete(e)}})())}registerTextModelContentProvider(e,t){let i=this.providers.get(e);return i||(i=[],this.providers.set(e,i)),i.unshift(t),Ee(()=>{const n=this.providers.get(e);if(!n)return;const o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&this.providers.delete(e))})}hasTextModelContentProvider(e){return this.providers.get(e)!==void 0}async resolveTextModelContent(e){const t=N.parse(e),i=this.providers.get(t.scheme)||[];for(const n of i){const o=await n.provideTextContent(t);if(o)return o}throw new Error(`Unable to resolve text model content for resource ${e}`)}};Oke=D([_(0,we),_(1,Fo),_(2,Jt),_(3,gi)],Oke);let Bke=class extends V{get resourceModelCollection(){return this._resourceModelCollection||(this._resourceModelCollection=this.instantiationService.createInstance(Oke)),this._resourceModelCollection}get asyncModelCollection(){return this._asyncModelCollection||(this._asyncModelCollection=new Wrt(this.resourceModelCollection)),this._asyncModelCollection}constructor(e,t,i,n,o){super(),this.instantiationService=e,this.fileService=t,this.undoRedoService=i,this.modelService=n,this.uriIdentityService=o,this._resourceModelCollection=void 0,this._asyncModelCollection=void 0,this._register(new Fke(this.modelService,this,this.undoRedoService))}async createModelReference(e){return e=this.uriIdentityService.asCanonicalUri(e),await this.asyncModelCollection.acquire(e.toString())}registerTextModelContentProvider(e,t){return this.resourceModelCollection.registerTextModelContentProvider(e,t)}canHandleResource(e){return this.fileService.hasProvider(e)||e.scheme===pe.untitled||e.scheme===pe.inMemory?!0:this.resourceModelCollection.hasTextModelContentProvider(e.scheme)}};Bke=D([_(0,we),_(1,Jt),_(2,JA),_(3,gi),_(4,ks)],Bke);function mei(){return{[fn.toString()]:new wi(Bke,[],!0)}}var Wke,rM;let Hke=(rM=class extends X2{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:Wke.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new dc,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 Zs.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await Sz.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new oA(this.applicationStorageDatabase)),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(Ie.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,c_e(this.profileStorageProfile)){const{indexedDb:t,storage:i}=await this.applicationStoragePromise.p;this.profileStorageDatabase=t,this.profileStorage=i,this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(n=>this.emitDidChangeValue(Ie.PROFILE,n)))}else{const t=await Sz.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new oA(this.profileStorageDatabase)),this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(Ie.PROFILE,i))),await this.profileStorage.init(),this.updateIsNew(this.profileStorage)}}async createWorkspaceStorage(){this.workspaceStorageDisposables.clear();const e=await Sz.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new oA(this.workspaceStorageDatabase)),this.workspaceStorageDisposables.add(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(Ie.WORKSPACE,t))),await this.workspaceStorage.init(),this.updateIsNew(this.workspaceStorage)}updateIsNew(e){const t=e.getBoolean(Wq);t===void 0?e.set(Wq,!0):t&&e.set(Wq,!1)}getStorage(e){switch(e){case Ie.APPLICATION:return this.applicationStorage;case Ie.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case Ie.APPLICATION:return this.applicationStorageDatabase?.name;case Ie.PROFILE:return this.profileStorageDatabase?.name;default:return this.workspaceStorageDatabase?.name}}async switchToProfile(e){if(!this.canSwitchProfile(this.profileStorageProfile,e))return;const t=qn(this.profileStorage),i=t.items;t!==this.applicationStorage&&await t.close(),await this.createProfileStorage(e),this.switchData(i,qn(this.profileStorage),Ie.PROFILE)}async switchToWorkspace(e,t){const i=qn(this.workspaceStorage),n=t?i.items:new Map;await i.close(),this.workspace=e,await this.createWorkspaceStorage(),this.switchData(n,qn(this.workspaceStorage),Ie.WORKSPACE)}shouldFlushWhenIdle(){return ky().document.hasFocus()&&!this.hasPendingUpdate}close(){Ky&&(this.applicationStorage?.close(),this.profileStorageDatabase?.close(),this.workspaceStorageDatabase?.close()),this.dispose()}async clear(){for(const e of[Ie.APPLICATION,Ie.PROFILE,Ie.WORKSPACE]){for(const t of[an.USER,an.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await Zs.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return Wje(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},Wke=rM,rM.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,rM);Hke=Wke=D([_(2,Ge)],Hke);class _ei extends Bq{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const Rp=class Rp extends V{static async createApplicationStorage(e){return Rp.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return Rp.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return Rp.create({id:e},t)}static async create(e,t){try{const i=new Rp(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Nr(i,!0)}`),new _ei}}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=`${Rp.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new INe(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{wEt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await Z0.create(this.name,void 0,[Rp.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Nr(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(Rp.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(Rp.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(Rp.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};Rp.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",Rp.STORAGE_OBJECT_STORE="ItemTable";let Sz=Rp;var rw;const vei=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var aM;let tne=(aM=class extends V{static toKey(e){return`extensionKeys/${WJ(e.id)}@${e.version}`}static fromKey(e){const t=vei.exec(e);if(t&&t[1])return{id:t[1],version:t[2]}}static async removeOutdatedExtensionVersions(e,t){const i=await e.getInstalled(),n=[];for(const[o,r]of rw.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>Ra(c.identifier,{id:o}))?.manifest.version;for(const c of r)a!==c&&n.push(rw.toKey({id:o,version:c}))}for(const o of n)t.remove(o,Ie.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(Ie.PROFILE,an.MACHINE);for(const n of i){const o=rw.fromKey(n);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=rw.readAllExtensionsWithKeysForSync(e),this._register(this.storageService.onDidChangeValue(Ie.PROFILE,void 0,this._register(new Z))(n=>this.onDidChangeStorageValue(n)))}onDidChangeStorageValue(e){if(this.extensionsWithKeysForSync.has(e.key.toLowerCase())){this._onDidChangeExtensionStorageToSync.fire();return}const t=rw.fromKey(e.key);if(t){if(this.storageService.get(e.key,Ie.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(Lt(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return LM(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),n=this.getExtensionStateRaw(e,t);if(n)try{return JSON.parse(n)}catch(o){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${o}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),n=this.storageService.get(i,t?Ie.PROFILE:Ie.WORKSPACE);return n&&n?.length>rw.LARGE_STATE_WARNING_THRESHOLD&&this.logService.warn(`[mainThreadStorage] large extension state detected (extensionId: ${i}, global: ${t}): ${n.length/1024}kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.`),n}setExtensionState(e,t,i){const n=this.getExtensionId(e);t===void 0?this.storageService.remove(n,i?Ie.PROFILE:Ie.WORKSPACE):this.storageService.store(n,JSON.stringify(t),i?Ie.PROFILE:Ie.WORKSPACE,an.MACHINE)}setKeysForSync(e,t){this.storageService.store(rw.toKey(e),JSON.stringify(t),Ie.PROFILE,an.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(rw.toKey(e),Ie.PROFILE),n=i?JSON.parse(i):void 0;return n&&t?ja([...n,...t]):n||t}addToMigrationList(e,t){if(e!==t){const i=this.migrationList.filter(n=>!n.includes(e)&&!n.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",Ie.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),Ie.APPLICATION,an.MACHINE):this.storageService.remove("extensionStorage.migrationList",Ie.APPLICATION)}},rw=aM,aM.LARGE_STATE_WARNING_THRESHOLD=512*1024,aM);tne=rw=D([_(0,$i),_(1,Er),_(2,Ge)],tne);var Az;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(Az||(Az={}));class que extends oA{constructor(e,t){const i=t.read(e);if(super(new bei(e,t,i)),i!=null)for(const[n,o]of i)this.items.set(n,o)}}class bei{constructor(e,t,i=new Map){this.scope=e,this.provider=t,this.items=i,this.onDidChangeItemsExternal=this.provider.onDidChange??M.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 wei extends X2{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new que(Az.APPLICATION,this.provider)),this.profileStorage=this._register(new que(Az.PROFILE,this.provider)),this.workspaceStorage=this._register(new que(Az.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)}}pNe(async s=>{const e=s.get($i);e instanceof X2&&await e.initialize()});m4t(async s=>{const e=s.get(xc),t=s.get($i);e.onDidChangeFocus(i=>{i||t.flush()})});let Uke=class extends Hke{constructor(e,t,i){super(gNe(),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)}};Uke=D([_(1,ug),_(2,Ge)],Uke);function yei({customProvider:s,fallbackOverride:e}={}){return s!=null?{[$i.toString()]:new wi(wei,[s,e],!0),[N3.toString()]:new wi(tne,[],!0)}:{[$i.toString()]:new wi(Uke,[e],!0),[N3.toString()]:new wi(tne,[],!0)}}class Cei{constructor(){this._systemSchemes=new Set(Object.keys(pe)),this._providerInfo=new Map,this.extUri=new xN(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&Vn.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 jU=ae("IExtHostFileSystemInfo");var aw;let Vke=aw=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new sTe,this._proxy=e.getProxy(Be.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(n){try{let o;const r=i._fileSystemProvider.get(n.scheme);return r?(await i._proxy.$ensureActivation(n.scheme),o=await r.impl.stat(n)):o=await i._proxy.$stat(n),{type:o.type,ctime:o.ctime,mtime:o.mtime,size:o.size,permissions:o.permissions===lp.Readonly?1:void 0}}catch(o){aw._handleError(o)}},async readDirectory(n){try{const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),(await o.impl.readDirectory(n)).slice()):await i._proxy.$readdir(n)}catch(o){return aw._handleError(o)}},async createDirectory(n){try{const o=i._fileSystemProvider.get(n.scheme);return o&&!o.isReadonly?(await i._proxy.$ensureActivation(n.scheme),await i.mkdirp(o.impl,o.extUri,n)):await i._proxy.$mkdir(n)}catch(o){return aw._handleError(o)}},async readFile(n){try{const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),(await o.impl.readFile(n)).slice()):(await i._proxy.$readFile(n)).buffer}catch(o){return aw._handleError(o)}},async writeFile(n,o){try{const r=i._fileSystemProvider.get(n.scheme);return r&&!r.isReadonly?(await i._proxy.$ensureActivation(n.scheme),await i.mkdirp(r.impl,r.extUri,r.extUri.dirname(n)),await i._writeQueue.queueFor(n,()=>Promise.resolve(r.impl.writeFile(n,o,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(n,$e.wrap(o))}catch(r){return aw._handleError(r)}},async delete(n,o){try{const r=i._fileSystemProvider.get(n.scheme);return r&&!r.isReadonly&&!o?.useTrash?(await i._proxy.$ensureActivation(n.scheme),await r.impl.delete(n,{recursive:!1,...o})):await i._proxy.$delete(n,{recursive:!1,useTrash:!1,atomic:!1,...o})}catch(r){return aw._handleError(r)}},async rename(n,o,r){try{return await i._proxy.$rename(n,o,{overwrite:!1,...r})}catch(a){return aw._handleError(a)}},async copy(n,o,r){try{return await i._proxy.$copy(n,o,{overwrite:!1,...r})}catch(a){return aw._handleError(a)}},isWritableFileSystem(n){const o=t.getCapabilities(n);if(typeof o=="number")return!(o&Vn.Readonly)}})}async mkdirp(e,t,i){const n=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&sn.Directory))throw Jc.FileExists(`Unable to create folder '${i.scheme===pe.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(o){if(Vk(o)!==ot.FileNotFound)throw o;n.push(t.basename(i)),i=t.dirname(i)}for(let o=n.length-1;o>=0;o--){i=t.joinPath(i,n[o]);try{await e.createDirectory(i)}catch(r){if(Vk(r)!==ot.FileExists)throw r}}}static _handleError(e){if(e instanceof Jc)throw e;if(e instanceof xA)switch(e.code){case ot.FileExists:throw Jc.FileExists(e.message);case ot.FileNotFound:throw Jc.FileNotFound(e.message);case ot.FileNotADirectory:throw Jc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Jc.FileIsADirectory(e.message);case ot.NoPermissions:throw Jc.NoPermissions(e.message);case ot.Unavailable:throw Jc.Unavailable(e.message);default:throw new Jc(e.message,e.name)}if(!(e instanceof Error))throw new Jc(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Jc.Unavailable(e.message);switch(e.name){case ot.FileExists:throw Jc.FileExists(e.message);case ot.FileNotFound:throw Jc.FileNotFound(e.message);case ot.FileNotADirectory:throw Jc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Jc.FileIsADirectory(e.message);case ot.NoPermissions:throw Jc.NoPermissions(e.message);case ot.Unavailable:throw Jc.Unavailable(e.message);default:throw new Jc(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?xn:Rre,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??xn}};Vke=aw=D([_(0,Jo),_(1,jU)],Vke);const nle=ae("IExtHostConsumerFileSystem");class Yst extends rae{get disposed(){return this._disposed}constructor(e,t,i,n,o){super(),this.id=e,this.name=t,this.logger=i,this.proxy=n,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,lB.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,lB.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+=$e.fromString(t).byteLength,LY(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,lB.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class Sei extends Yst{appendLine(e){this.append(e)}}let zke=class{constructor(e,t,i,n,o,r){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=n,this.loggerService=o,this.logService=r,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(Be.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${stt(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 n=typeof t=="object"&&t.log,o=Lt(t)?t:void 0;if(Lt(o)&&!o.trim())throw new Error("illegal argument `languageId`. must not be empty");let r;const a=this.initData.environment.extensionLogLevel?.find(([l])=>Sn.equals(i.identifier,l))?.[1];a&&(r=bQe(a));const c=n?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}),n?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 n=await this.outputDirectoryPromise,o=this.extHostFileSystemInfo.extUri.joinPath(n,`${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 Yst(a,e,r,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const n=await this.createExtensionLogDirectory(i),o=e.replace(/[\\/:\*\?"<>\|]/g,""),r=this.extHostFileSystemInfo.extUri.joinPath(n,`${o}.log`),a=`${i.identifier.value}.${o}`,c=this.loggerService.createLogger(r,{id:a,name:e,logLevel:t,extensionId:i.identifier.value});return new Sei(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(n){if(Vk(n)!==ot.FileExists)throw n}return i})())}return t}createExtHostOutputChannel(e,t){let i=!1;const n=()=>{if(i)throw new Error("Channel has been closed")};return{get name(){return e},append(o){n(),t.then(r=>r.append(o))},appendLine(o){n(),t.then(r=>r.appendLine(o))},clear(){n(),t.then(o=>o.clear())},replace(o){n(),t.then(r=>r.replace(o))},show(o,r){n(),t.then(a=>a.show(o,r))},hide(){n(),t.then(o=>o.hide())},dispose(){i=!0,t.then(o=>o.dispose())}}}createExtHostLogOutputChannel(e,t,i){const n=new Z,o=()=>{if(n.isDisposed)throw new Error("Channel has been closed")},r=n.add(new I);function a(c){t=c,r.fire(c)}return i.then(c=>{n.add(c),c.logLevel!==t&&a(c.logLevel),n.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(){n.dispose()}}}};zke=D([_(0,Jo),_(1,_u),_(2,nle),_(3,jU),_(4,uf),_(5,Ge)],zke);const Jst=ae("IExtHostOutputService"),sle=ae("IURITransformerService");class Aei{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)}}function e7(s,e,t){return new xN(i=>IPe(i,t)).isEqual(s,e)}function Eei(s,e,t){return e7(s.uri,e.uri,t)?0:gm(s.uri.toString(),e.uri.toString())}function xei(s,e,t){return s.index!==e.index?s.indext(r,a,i)),o=e.slice(0).sort((r,a)=>t(r,a,i));return XI(n,o,(r,a)=>t(r,a,i))}function IPe(s,e){const t=e.getCapabilities(s.scheme);return!(t&&t&Vn.PathCaseSensitive)}class hB extends pje{static toExtHostWorkspace(e,t,i,n){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,b)=>{const w=N.revive(v.uri),y=hB._findFolder(i||t,w,n);y?(y.name=v.name,y.index=v.index,h.push(y)):h.push({uri:w,name:v.name,index:b})}):h.push(...a.map(({uri:v,name:b,index:w})=>({uri:N.revive(v),name:b,index:w}))),h.sort((v,b)=>v.indexIPe(v,n)),{added:p,removed:m}=Xst(u?u.workspaceFolders:[],f.workspaceFolders,Eei,n);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let n=0;nnew pae(c)),n,o,a),this._name=t,this._isUntitled=r,this._workspaceFolders=[],this._structure=Dh.forUris(a,()=>!0),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=Lr(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let $ke=class{constructor(e,t,i,n,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 jx,this._canonicalUriProviders=new Map,this._logService=n,this._extHostFileSystemInfo=i,this._uriTransformerService=o,this._requestIdProvider=new adt,this._barrier=new qd,this._proxy=e.getProxy(Be.MainThreadWorkspace),this._messageService=e.getProxy(Be.MainThreadMessageService);const r=t.workspace;this._confirmedWorkspace=r?new hB(r.id,r.name,[],!!r.transient,r.configuration?N.revive(r.configuration):null,!!r.isUntitled,a=>IPe(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?N.from({scheme:pe.untitled,path:_i(Lr(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,...n){const o=[];if(Array.isArray(n)&&n.forEach(d=>{N.isUri(d.uri)&&!o.some(h=>e7(h.uri,d.uri,this._extHostFileSystemInfo))&&o.push({uri:d.uri,name:d.name||EA(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||EA(d.uri),index:void 0})));for(let d=0;df!==d&&e7(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=Xst(r,a,xei,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(Xe.Error,g(572,"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,n="";if(typeof e=="string"?(i=N.file(e),n=e):typeof e<"u"&&(i=e,n=e.fsPath),!i)return n;const o=this.getWorkspaceFolder(i,!0);if(!o)return n;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let r=DN(o.uri,i);return t&&o.name&&(r=`${o.name}/${r}`),r}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=hB.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:n}=hB.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:n}))}findFiles(e,t,i,n,o=He.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${n.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,n=He.None){return this._logService.trace(`extHostWorkspace#findFiles2: fileSearch, extension: ${i.value}, entryPoint: findFiles2`),this._findFilesImpl(void 0,e,t,n)}async _findFilesImpl(e,t,i,n=He.None){if(n&&n.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}=Que(Gf.from(e));a=l,r.includePattern=c}else{const{includePattern:c,folder:l}=Que(Gf.from(t));a=l,r.filePattern=c}return this._proxy.$startFileSearch(a??null,r,n).then(c=>Array.isArray(c)?c.map(l=>N.revive(l)):[])}async findTextInFiles(e,t,i,n,o=He.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${n.value}, entryPoint: findTextInFiles`);const r=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=Que(Gf.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,disregardSearchExcludeSettings:typeof t.useSearchExclude=="boolean"?!t.useSearchExclude:!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=N.revive(u.resource);u.results.forEach(p=>{const m=Mo(p);l3t(m)?i({uri:f,preview:{text:m.preview.text,matches:n8(m.preview.matches,v=>new Jn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:n8(m.ranges,v=>new Jn(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 N.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return N.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}lookupAuthorization(e){return this._proxy.$lookupAuthorization(e)}lookupKerberosAuthorization(e){return this._proxy.$lookupKerberosAuthorization(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),n=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(n,i),Ee(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(n)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(N.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const n=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!n),!n)return;const o=await n.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",o),!!o)return o}async $provideEditSessionIdentityMatch(e,t,i,n){this._logService.info("Getting edit session identifier for workspaceFolder",e);const o=await this.resolveWorkspaceFolder(N.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,n);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,n)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillCreateEditSessionIdentityEvent.event(o,void 0,n)}}async $onWillCreateEditSessionIdentity(e,t,i){const n=await this.resolveWorkspaceFolder(N.revive(e));if(n===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:n},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),n=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(n,i),Ee(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(n)})}async provideCanonicalUri(e,t,i){const n=this._canonicalUriProviders.get(e.scheme);if(!n)return;const o=await n.provideCanonicalUri?.(N.revive(e),t,i);if(o)return o}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(N.revive(e),{targetScheme:t},i)}};$ke=D([_(0,Jo),_(1,_u),_(2,jU),_(3,Ge),_(4,sle)],$ke);const oE=ae("IExtHostWorkspace");function Que(s){let e,t;return s&&(typeof s=="string"?e=s:(e=s.pattern,t=N.revive(s.baseUri))),{includePattern:e,folder:t}}var HV,Sk;let Gke=(Sk=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Be.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=HV._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const n=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(o=>{if(!o){this._proxy.$onDidChange(i,null);return}const r=H_(o);if(r.length<=HV._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:cat(d.path,"/")})),c=i8(a,(d,h)=>d.rank-h.rank||gm(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=Cb(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=HV._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new Qs(()=>{n?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const n=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(N.revive(c),i));if(!d)return;try{t$.validate(d),d.badge&&typeof d.badge!="string"&&Ve(r,"codiconDecoration"),n[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)}})),n}},HV=Sk,Sk._handlePool=0,Sk._maxEventSize=250,Sk);Gke=HV=D([_(0,Jo),_(1,Ge)],Gke);const Zst=ae("IExtHostDecorations");function R4(s,e){if(e){const t=e.split(".");let i=s;for(let n=0;i&&nthis._actual)}$initializeConfiguration(e){this._actual=new Lei(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};Kke=D([_(0,Jo),_(1,oE),_(2,Ge)],Kke);class Lei{constructor(e,t,i,n){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=n,this._extHostWorkspace=t,this._configuration=u3.parse(i,n),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=u3.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const n=y9e(t)||{},o=this._toReadonlyValue(e?R4(this._configuration.getValue(void 0,n,this._extHostWorkspace.workspace),e):this._configuration.getValue(void 0,n,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,n,i?.identifier);function r(c){if(c==null)return null;if(typeof c=="boolean")return c?St.USER:St.WORKSPACE;switch(c){case $T.Global:return St.USER;case $T.Workspace:return St.WORKSPACE;case $T.WorkspaceFolder:return St.WORKSPACE_FOLDER}}const a={has(c){return typeof R4(o,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,n,i?.identifier);let d=R4(o,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(kn(f)){let m;const v=()=>{h=h||xs(o),m=m||R4(h,p)};return new Proxy(f,{get:(b,w)=>{if(typeof w=="string"&&w.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||R4(h,p),m[w];const y=b[w];return typeof w=="string"?u(y,`${p}.${w}`):y},set:(b,w,y)=>(v(),m&&(m[w]=y),!0),deleteProperty:(b,w)=>(v(),m&&delete m[w],!0),defineProperty:(b,w,y)=>(v(),m&&Object.defineProperty(m,w,y),!0)})}return Array.isArray(f)?xs(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,n,h):this._proxy.$removeConfigurationOption(u,c,n,h)},inspect:c=>{c=e?`${e}.${c}`:c;const l=this._configuration.inspect(c,n,this._extHostWorkspace.workspace);if(l)return{key:c,defaultValue:xs(l.policy?.value??l.default?.value),globalValue:xs(l.user?.value??l.application?.value),workspaceValue:xs(l.workspace?.value),workspaceFolderValue:xs(l.workspaceFolder?.value),defaultLanguageValue:xs(l.default?.override),globalLanguageValue:xs(l.user?.override??l.application?.override),workspaceLanguageValue:xs(l.workspace?.override),workspaceFolderLanguageValue:xs(l.workspaceFolder?.override),languageIds:xs(l.overrideIdentifiers)}}};return typeof o=="object"&&gp(a,o,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>kn(i)?new Proxy(i,{get:(n,o)=>t(n[o]),set:(n,o,r)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(o)}' of object`)},deleteProperty:(n,o)=>{throw new Error(`TypeError: Cannot delete read only property '${String(o)}' of object`)},defineProperty:(n,o)=>{throw new Error(`TypeError: Cannot define property '${String(o)}' for a readonly object`)},setPrototypeOf:n=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const n=tf.test(e)?at.RESOURCE:this._configurationScopes.get(e),o=i?`[${i.value}] `:"";if(at.RESOURCE===n){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(at.WINDOW===n){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 PLe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(n,o)=>i.affectsConfiguration(n,y9e(o))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const rE=ae("IExtHostConfiguration"),qI=(s,e,t,i)=>{let n=e;return{enumerable:!0,configurable:!1,get(){return n},set(o){if(!t(n,o)){const r=n;n=o,s.listener?.(i(o,r))}}}},CP=(s,e)=>s===e,pE={range:(s,e)=>s===e?!0:!s||!e?!1:s.isEqual(e),label:CP,description:CP,sortText:CP,busy:CP,error:CP,canResolveChildren:CP,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.find(i=>t.id===i.id)))},SP=s=>e=>({op:Hd.SetProp,update:s(e)}),Rei=(s,e)=>({range:(()=>{let t;const i=SP(n=>({range:F.lift(et.from(n))}));return{enumerable:!0,configurable:!1,get(){return t},set(n){s.listener?.({op:Hd.DocumentSynced}),pE.range(t,n)||(t=n,s.listener?.(i(n)))}}})(),label:qI(s,e,pE.label,SP(t=>({label:t}))),description:qI(s,void 0,pE.description,SP(t=>({description:t}))),sortText:qI(s,void 0,pE.sortText,SP(t=>({sortText:t}))),canResolveChildren:qI(s,!1,pE.canResolveChildren,t=>({op:Hd.UpdateCanResolveChildren,state:t})),busy:qI(s,!1,pE.busy,SP(t=>({busy:t}))),error:qI(s,void 0,pE.error,SP(t=>({error:Ps.fromStrict(t)||null}))),tags:qI(s,[],pE.tags,(t,i)=>({op:Hd.SetTags,new:t.map(Hb.from),old:i.map(Hb.from)}))}),Mei=s=>{const e=vn.fromString(s.extId),t=new jN(e.controllerId,e.localId,s.label,N.revive(s.uri)||void 0);return t.range=et.to(s.range||void 0),t.description=s.description||void 0,t.sortText=s.sortText||void 0,t.tags=s.tags.map(i=>Hb.to({id:Wnt(i).tagId})),t},C9e=s=>{let e;for(const t of s.tests){const i=Mei(t.item);qce(i).parent=e,e=i}return e};class jN{constructor(e,t,i,n){if(t.includes(t_.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const o=hQt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:n,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return o.parent instanceof TPe?void 0:o.parent}},children:{value:dQt(o,qce,jN),enumerable:!0,writable:!1},...Rei(o,i)})}}class TPe extends jN{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class Nei extends aQt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:n=>n&&i.getDocument(n)?.version,getApiFor:qce,getChildren:n=>n.children,root:new TPe(e,t),toITestItem:mI.from})}}let qke=class extends V{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=Kg.NONE,this._telemetryIsSupported=!1,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this.extHostTelemetryLogFile=N.revive(this.initData.environment.extensionTelemetryLogResource),this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly,this._outputLogger=t.createLogger(this.extHostTelemetryLogFile,{id:W1t,name:g(576,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{mQe(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()===Gn.Trace)}getTelemetryConfiguration(){return this._level===Kg.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=Kg.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=Kg.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=Kg.USAGE:!1}}instantiateLogger(e,t,i){const n=this.getTelemetryDetails(),o=new eot(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:n.isUsageEnabled,isErrorsEnabled:n.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"]=tot(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case tv.Web:t["common.uikind"]="web";break;case tv.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=D6(V1t(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,n)=>{const o=i.filter(r=>!r.isDisposed);o.length===0?this._telemetryLoggers.delete(n):this._telemetryLoggers.set(n,o)}),this._telemetryLoggers.forEach(i=>{for(const n of i)n.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 n=this._telemetryLoggers.get(e.value)?.filter(r=>!r.isDisposed);if(!n)return this._telemetryLoggers.delete(e.value),!1;let o=!1;for(const r of n)r.ignoreUnhandledExtHostErrors||(r.logError(t),o=!0);return o}};qke=D([_(0,_u),_(1,uf)],qke);class eot{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,n,o,r,a){this._extension=i,this._logger=n,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=qWe(t,[]),this._additionalCommonProperties&&(t=gp(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=gp(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},n=qWe(i,[]),o=new Error(n.message,{cause:n.cause});o.stack=n.stack,o.name=n.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 tot(s){const e=Date.now()-new Date(s).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const ole=ae("IExtHostTelemetry");var eS,p7,m7,_6e;let Qke=(_6e=class{constructor(e,t,i){Wt(this,eS);Wt(this,p7);Wt(this,m7);this._commands=new Map,this._apiCommands=new Map,Ct(this,eS,e.getProxy(Be.MainThreadCommands)),this._logService=t,Ct(this,m7,i),Ct(this,p7,e.getProxy(Be.MainThreadTelemetry)),this.converter=new Pei(this,n=>{const o=this._apiCommands.get(n);return o?.result===nn.Void?o:void 0},t),this._argumentProcessors=[{processArgument(n){return Mo(n)}},{processArgument(n){return S2(n,function(o){if(F.isIRange(o))return et.to(o);if(oe.isIPosition(o))return Yo.to(o);if(F.isIRange(o.range)&&N.isUri(o.uri))return hf.to(o);if(o instanceof $e)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 n=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,...n);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 Qs(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,n,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:n,metadata:o,extension:r}),e&&Ce(this,eS).$registerCommand(t),new Qs(()=>{this._commands.delete(t)&&e&&Ce(this,eS).$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 Ce(this,eS).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let n=!1;const o=S2(t,function(r){if(r instanceof bs)return Yo.from(r);if(r instanceof Jn)return et.from(r);if(r instanceof yp)return hf.from(r);if(Sy.isNotebookRange(r))return Wy.from(r);if(r instanceof ArrayBuffer)return n=!0,$e.wrap(new Uint8Array(r));if(r instanceof Uint8Array)return n=!0,$e.wrap(r);if(r instanceof $e)return n=!0,r;if(!Array.isArray(r))return r});try{const r=await Ce(this,eS).$executeCommand(e,n?new jd(o):o,i);return Mo(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 n=this._commands.get(e);if(!n)throw new Error("Unknown command");const{callback:o,thisArg:r,metadata:a}=n;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((o,r)=>r.processArgument(o,i.extension?.identifier),n)),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),Ce(this,eS).$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:n}=i;n&&(e[t]=n)}return Promise.resolve(e)}},eS=new WeakMap,p7=new WeakMap,m7=new WeakMap,_6e);Qke=D([_(0,Jo),_(1,Ge),_(2,ole)],Qke);const YN=ae("IExtHostCommands");class Pei{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${ar()}`,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 n=this._lookupApiCommand(e.command);if(n)i.id=n.internalId,i.arguments=n.args.map((o,r)=>o.convert(e.arguments&&e.arguments[r]));else if(eo(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 Ga=class Ga{static Arr(e){return new Ga(`${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,n){this.name=e,this.description=t,this.validate=i,this.convert=n}optional(){return new Ga(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 Ga(e??this.name,t??this.description,this.validate,this.convert)}};Ga.Uri=new Ga("uri","Uri of a text document",e=>N.isUri(e),e=>e),Ga.Position=new Ga("position","A position in a text document",e=>bs.isPosition(e),Yo.from),Ga.Range=new Ga("range","A range in a text document",e=>Jn.isRange(e),et.from),Ga.Selection=new Ga("selection","A selection in a text document",e=>cC.isSelection(e),Wb.from),Ga.Number=new Ga("number","",e=>typeof e=="number",e=>e),Ga.String=new Ga("string","",e=>typeof e=="string",e=>e),Ga.StringArray=Ga.Arr(Ga.String),Ga.CallHierarchyItem=new Ga("item","A call hierarchy item",e=>e instanceof Pce,gN.from),Ga.TypeHierarchyItem=new Ga("item","A type hierarchy item",e=>e instanceof Oce,ZT.from),Ga.TestItem=new Ga("testItem","A VS Code TestItem",e=>e instanceof jN,mI.from);let ht=Ga;const nre=class nre{constructor(e,t){this.description=e,this.convert=t}};nre.Void=new nre("no result",e=>e);let nn=nre;class gn{constructor(e,t,i,n,o){this.id=e,this.internalId=t,this.description=i,this.args=n,this.result=o}}const jke=new Map;function Fei(s,e){e?jke.set(s,e):jke.delete(s)}function Oei(s){return jke.get(s)}class Bei extends TKe{constructor(e,t,i,n,o,r,a){super(t,i,n,o),this._proxy=e,this._languageId=r,this._isDirty=a,this._isDisposed=!1}dispose(){Yf(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return is(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===pe.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===` -`?D_.LF:D_.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)},[Symbol.for("debug.description")](){return`TextDocument(${e._uri.toString()})`}}}return Object.freeze(this._document)}_acceptLanguageId(e){Yf(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){Yf(!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,n=t.start.line,o=t.end.line,r=[];r.push(this._lines[n].substring(t.start.character));for(let a=n+1;a=this._lines.length||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new Wei(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 bs(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof Jn))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 Jn(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof bs))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:t,character:i}=e,n=!1;if(t<0)t=0,i=0,n=!0;else if(t>=this._lines.length)t=this._lines.length-1,i=this._lines[t].length,n=!0;else{const o=this._lines[t].length;i<0?(i=0,n=!0):i>o&&(i=o,n=!0)}return n?new bs(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=Oei(this._languageId);else if(J1e(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const n=Ik(i.character+1,O7(t),this._lines[i.line],0);if(n)return new Jn(i.line,n.startColumn-1,i.line,n.endColumn-1)}}class Wei{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 Jn(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Jn(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 sre=class sre{constructor(e,t,i){const n=sre._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,n,FEe.from(i)),this.value=Object.freeze({key:n,dispose(){e.$removeTextEditorDecorationType(n)}})}};sre._Keys=new DU("TextEditorDecorationType");let Yke=sre;class Hei{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 bs)i=new Jn(e,e);else if(e instanceof Jn)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new Jn(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof Jn)t=e;else throw new Error("Unrecognized location");this._pushEdit(t,null,!0)}_pushEdit(e,t,i){const n=this._document.validateRange(e);this._collectedEdits.push({range:n,text:t,forceMoveMarkers:i})}setEndOfLine(e){if(this._throwIfFinalized(),e!==D_.LF&&e!==D_.CRLF)throw Pi("endOfLine");this._setEndOfLine=e}}class Uei{constructor(e,t,i,n){this._proxy=e,this._id=t,this._accept(i),this._logService=n;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=aB.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:aB.from(e)})))}assign(e){const t={};let i=!1;if(typeof e.tabSize<"u"){const n=this._validateTabSize(e.tabSize);n==="auto"?(i=!0,t.tabSize=n):typeof n=="number"&&this._tabSize!==n&&(this._tabSize=n,i=!0,t.tabSize=n)}if(typeof e.indentSize<"u"){const n=this._validateIndentSize(e.indentSize);n==="tabSize"?(i=!0,t.indentSize=n):typeof n=="number"&&this._originalIndentSize!==n&&(this._indentSize=n,this._originalIndentSize=n,i=!0,t.indentSize=n)}if(typeof e.insertSpaces<"u"){const n=this._validateInsertSpaces(e.insertSpaces);n==="auto"?(i=!0,t.insertSpaces=n):this._insertSpaces!==n&&(this._insertSpaces=n,i=!0,t.insertSpaces=n)}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=aB.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 Vei{constructor(e,t,i,n,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 Uei(this._proxy,this.id,r,i),this._visibleRanges=a,this._viewColumn=c;const l=this;this.value=Object.freeze({get document(){return n.value},set document(d){throw new A1("document")},get selection(){return l._selections&&l._selections[0]},set selection(d){if(!(d instanceof cC))throw Pi("selection");l._selections=[d],l._trySetSelection()},get selections(){return l._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof cC)))throw Pi("selections");l._selections=d,l._trySetSelection()},get visibleRanges(){return l._visibleRanges},set visibleRanges(d){throw new A1("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 A1("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 Hei(n.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=>et.from(p));else if(h instanceof bs){const{lineNumber:p,column:m}=Yo.from(h);f=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof Jn)f=[et.from(h)];else{f=[];for(const p of h)if(p instanceof Jn)f.push(et.from(p));else{const{lineNumber:m,column:v}=Yo.from(p);f.push({startLineNumber:m,startColumn:v,endLineNumber:m,endColumn:v})}}return t.$tryInsertSnippet(e,n.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(Unt(h))return t.$trySetDecorations(e,d.key,fQt(h));{const f=new Array(4*h.length);for(let p=0,m=h.length;pt.$tryRevealRange(e,et.from(d),h||W9.Default))},show(d){t.$tryShowEditor(e,xl.from(d))},hide(){t.$tryHideEditor(e)},[Symbol.for("debug.description")](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){Yf(!this._disposed),this._disposed=!0}_acceptOptions(e){Yf(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){Yf(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){Yf(!this._disposed),this._viewColumn=e}_acceptSelections(e){Yf(!this._disposed),this._selections=e}async _trySetSelection(){const e=this._selections.map(Wb.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:et.from(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,n,{setEndOfLine:typeof t.setEndOfLine=="number"?WH.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 zei{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let Jke=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new ui,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=[],n=[];if(e.removedDocuments)for(const o of e.removedDocuments){const r=N.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=N.revive(o.uri);let a=this._documents.get(r);if(a&&r.scheme!==pe.vscodeNotebookCell&&r.scheme!==pe.vscodeInteractiveInput)throw new Error(`document '${r} already exists!'`);a||(a=new zei(new Bei(this._extHostRpc.getProxy(Be.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&&n.push(r)}if(e.addedEditors)for(const o of e.addedEditors){const r=N.revive(o.documentUri);Yf(this._documents.has(r),`document '${r}' does not exist`),Yf(!this._editors.has(o.id),`editor '${o.id}' already exists!`);const a=this._documents.get(r).value,c=new Vei(o.id,this._extHostRpc.getProxy(Be.MainThreadTextEditors),this._logService,new ya(()=>a.document),o.selections.map(Wb.to),o.options,o.visibleRanges.map(l=>et.to(l)),typeof o.editorPosition=="number"?xl.to(o.editorPosition):void 0);this._editors.set(o.id,c)}e.newActiveEditor!==void 0&&(Yf(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),bt(t),bt(n),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 hi.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()]}};Jke=D([_(0,Jo),_(1,Ge)],Jke);const YU=ae("IExtHostDocumentsAndEditors"),JU=ae("IExtHostTerminalService");class S9e extends V{constructor(e,t,i,n){super(),this._proxy=e,this._id=t,this._creationOptions=i,this._name=n,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:iot(e.iconPath)??void 0,color:O2.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,n,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:n,color:O2.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:xl.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 jue{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:Og.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:Og.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let $ei=1,Xke=class extends V{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 wn),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(Be.MainThreadTerminalService),this._bufferer=new Qnt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:n=>{const o=r=>{const a=r;return this.getTerminalById(a.instanceId)?.value};switch(n?.$mid){case ws.TerminalContext:return o(n);default:{if(Array.isArray(n))for(let r=0;r{for(const[n,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 S9e(this._proxy,ar(),e,e.name),n=new jue(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,iot(e.iconPath),Kei(e.color)).then(o=>{const r=this._setupExtHostProcessListeners(o,n);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 n=this._terminals.find(o=>o.value===i);n&&(t.resolvedExtHostIdentifier=n._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 n=new jue(t),o=this._setupExtHostProcessListeners(e,n);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 n=this.getTerminalById(e);n&&n.setDimensions(t,i)&&this._onDidChangeTerminalDimensions.fire({terminal:n.value,dimensions:n.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 n=this._getTerminalObjectIndexById(this._terminals,e);if(n!==null){const o=this._terminals.splice(n,1)[0];o.setExitStatus(t,i),this._onDidCloseTerminal.fire(o.value)}}$acceptTerminalOpened(e,t,i,n){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:n.name,shellPath:n.executable,shellArgs:n.args,cwd:typeof n.cwd=="string"?n.cwd:N.revive(n.cwd),env:n.env,hideFromUser:n.hideFromUser},r=new S9e(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(573,"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 n=this._terminalProcesses.get(e);n?n.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 n=this._extensionTerminalAwaitingStart[e];return n&&t instanceof jue&&(t.startSendingEvents(n.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(n){if(n.code!=="EPIPE"&&n.code!=="ERR_IPC_CHANNEL_CLOSED")throw n}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Og.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Og.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new Qs(()=>{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 Qs(()=>{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 Qs(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new ci().token;if(i.isCancellationRequested)return;const n=this._quickFixProviders.get(e);if(!n)return;const o=await n.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?die.from(o,this._extHostCommands.converter,r):void 0;const a=[];for(const c of o){const l=die.from(c,this._extHostCommands.converter,r);l&&a.push(l)}return a}async $createContributedProfileTerminal(e,t){const i=new ci().token;let n=await this._profileProviders.get(e)?.provideTerminalProfile(i);if(!i.isCancellationRequested){if(n&&!("options"in n)&&(n={options:n}),!n||!("options"in n))throw new Error(`No terminal profile options provided for id "${e}"`);if("pty"in n.options){this.createExtensionTerminal(n.options,t);return}this.createTerminalFromOptions(n.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 ci;this._terminalLinkCancellationSource.set(e,o);const r=[],a={terminal:i.value,line:t},c=[];for(const h of this._linkProviders)c.push(Zs.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:$ei++,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(n=>n._id===t);return i>=0?i:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=this._register(new A9e),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=jnt(t.map),n=RQt(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,i.length===0?void 0:i,n)}$initEnvironmentVariableCollections(e){e.forEach(t=>{const i=t[0],n=this._register(new A9e(t[1]));this._setEnvironmentVariableCollection(i,n)})}$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),this._register(t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)}))}};Xke=D([_(1,YN),_(2,Jo)],Xke);class A9e extends V{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){super(),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 Gei(this,e),this.scopedCollections.set(t,i),this._register(i.onDidChangeCollection(()=>this._onDidChangeCollection.fire()))),i}replace(e,t,i,n){this._setIfDiffers(e,{value:t,type:HT.Replace,options:i??{applyAtProcessCreation:!0},scope:n})}append(e,t,i,n){this._setIfDiffers(e,{value:t,type:HT.Append,options:i??{applyAtProcessCreation:!0},scope:n})}prepend(e,t,i,n){this._setIfDiffers(e,{value:t,type:HT.Prepend,options:i??{applyAtProcessCreation:!0},scope:n})}_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),n=this.map.get(i),o=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!n||n.value!==t.value||n.type!==t.type||n.options?.applyAtProcessCreation!==o.applyAtProcessCreation||n.options?.applyAtShellIntegration!==o.applyAtShellIntegration||n.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),n=this.map.get(i);return n?E9e(n):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,n]of this.map)this.getScopeKey(n.scope)===this.getScopeKey(e)&&t.set(n.variable,E9e(n));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),n=this.descriptionMap.get(i);if(!n||n.description!==e){let o;typeof e=="string"?o=e:o=e?.value.split(` + - the second one at the same indentation level`),g(2551,"Insert new line and outdent once (relative to the previous line's indentation).")]},appendText:{type:"string",description:g(2552,"Describes text to be appended after the new line and after the indentation."),default:""},removeText:{type:"number",description:g(2553,"Describes the number of characters to remove from the new line's indentation."),default:0}}}}}}}},nei=Qe.as(QA.JSONContribution);nei.registerSchema(tei,iei);var qB;let Xie=(qB=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(Ike)}},qB.ID="workbench.contrib.languageConfigurationExtensionPoint",qB);Xie=D([_(0,we)],Xie);Ku(Xie.ID,Xie,yc.BlockStartup);function sei(){return{...kce(),[xi.toString()]:new wi(fbe,[],!1),[Kae.toString()]:new wi(eei,[],!0)}}let Tke=class extends V{constructor(e,t,i){super(),this._modelService=e,this._textModelService=t,this._undoRedoService=i,this._register(this._modelService.onModelRemoved(n=>{const o=this._undoRedoService.getElements(n.uri);if(!(o.past.length===0&&o.future.length===0)){for(const r of o.past)r instanceof dme&&r.setDelegate(this);for(const r of o.future)r instanceof dme&&r.setDelegate(this)}}))}prepareUndoRedo(e){const t=e.getMissingModels();if(t.length===0)return V.None;const i=t.map(async n=>{try{return await this._textModelService.createModelReference(n)}catch{return V.None}});return Promise.all(i).then(n=>({dispose:()=>bt(n)}))}};Tke=D([_(0,gi),_(1,fn),_(2,jA)],Tke);let Lke=class extends Drt{constructor(e,t,i,n){super(),this.instantiationService=e,this.textFileService=t,this.fileService=i,this.modelService=n,this.providers=new Map,this.modelsToDispose=new Set}createReferencedObject(e){return this.doCreateReferencedObject(e)}async doCreateReferencedObject(e,t){this.modelsToDispose.delete(e);const i=N.parse(e);if(i.scheme===pe.inMemory){if(!this.modelService.getModel(i))throw new Error(`Unable to resolve inMemory resource ${e}`);const o=this.instantiationService.createInstance(b9,i);if(this.ensureResolvedModel(o,e))return o}if(i.scheme===pe.untitled){const n=await this.textFileService.untitled.resolve({untitledResource:i});if(this.ensureResolvedModel(n,e))return n}if(this.fileService.hasProvider(i)){const n=await this.textFileService.files.resolve(i,{reason:j3.REFERENCE});if(this.ensureResolvedModel(n,e))return n}if(this.providers.has(i.scheme)){await this.resolveTextModelContent(e);const n=this.instantiationService.createInstance(b9,i);if(this.ensureResolvedModel(n,e))return n}if(!t)return await this.fileService.activateProvider(i.scheme),this.doCreateReferencedObject(e,!0);throw new Error(`Unable to resolve resource ${e}`)}ensureResolvedModel(e,t){if(Kdt(e))return!0;throw new Error(`Unable to resolve resource ${t}`)}destroyReferencedObject(e,t){N.parse(e).scheme!==pe.inMemory&&(this.modelsToDispose.add(e),(async()=>{try{const n=await t;if(!this.modelsToDispose.has(e)||(n instanceof cee?await this.textFileService.files.canDispose(n):n instanceof aee&&await this.textFileService.untitled.canDispose(n),!this.modelsToDispose.has(e)))return;n.dispose()}catch{}finally{this.modelsToDispose.delete(e)}})())}registerTextModelContentProvider(e,t){let i=this.providers.get(e);return i||(i=[],this.providers.set(e,i)),i.unshift(t),Ee(()=>{const n=this.providers.get(e);if(!n)return;const o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&this.providers.delete(e))})}hasTextModelContentProvider(e){return this.providers.get(e)!==void 0}async resolveTextModelContent(e){const t=N.parse(e),i=this.providers.get(t.scheme)||[];for(const n of i){const o=await n.provideTextContent(t);if(o)return o}throw new Error(`Unable to resolve text model content for resource ${e}`)}};Lke=D([_(0,we),_(1,Fo),_(2,Jt),_(3,gi)],Lke);let Rke=class extends V{get resourceModelCollection(){return this._resourceModelCollection||(this._resourceModelCollection=this.instantiationService.createInstance(Lke)),this._resourceModelCollection}get asyncModelCollection(){return this._asyncModelCollection||(this._asyncModelCollection=new krt(this.resourceModelCollection)),this._asyncModelCollection}constructor(e,t,i,n,o){super(),this.instantiationService=e,this.fileService=t,this.undoRedoService=i,this.modelService=n,this.uriIdentityService=o,this._resourceModelCollection=void 0,this._asyncModelCollection=void 0,this._register(new Tke(this.modelService,this,this.undoRedoService))}async createModelReference(e){return e=this.uriIdentityService.asCanonicalUri(e),await this.asyncModelCollection.acquire(e.toString())}registerTextModelContentProvider(e,t){return this.resourceModelCollection.registerTextModelContentProvider(e,t)}canHandleResource(e){return this.fileService.hasProvider(e)||e.scheme===pe.untitled||e.scheme===pe.inMemory?!0:this.resourceModelCollection.hasTextModelContentProvider(e.scheme)}};Rke=D([_(0,we),_(1,Jt),_(2,jA),_(3,gi),_(4,ks)],Rke);function oei(){return{[fn.toString()]:new wi(Rke,[],!0)}}var Mke,iM;let Nke=(iM=class extends Q2{get hasPendingUpdate(){return!!(this.applicationStorageDatabase?.hasPendingUpdate||this.profileStorageDatabase?.hasPendingUpdate||this.workspaceStorageDatabase?.hasPendingUpdate)}constructor(e,t,i){super({flushInterval:Mke.BROWSER_DEFAULT_FLUSH_INTERVAL}),this.workspace=e,this.userDataProfileService=t,this.logService=i,this.applicationStoragePromise=new dc,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 Zs.settled([this.createApplicationStorage(),this.createProfileStorage(this.profileStorageProfile),this.createWorkspaceStorage()])}async createApplicationStorage(){const e=await wz.createApplicationStorage(this.logService);this.applicationStorageDatabase=this._register(e),this.applicationStorage=this._register(new sA(this.applicationStorageDatabase)),this._register(this.applicationStorage.onDidChangeStorage(t=>this.emitDidChangeValue(Ie.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,i_e(this.profileStorageProfile)){const{indexedDb:t,storage:i}=await this.applicationStoragePromise.p;this.profileStorageDatabase=t,this.profileStorage=i,this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(n=>this.emitDidChangeValue(Ie.PROFILE,n)))}else{const t=await wz.createProfileStorage(this.profileStorageProfile,this.logService);this.profileStorageDatabase=this.profileStorageDisposables.add(t),this.profileStorage=this.profileStorageDisposables.add(new sA(this.profileStorageDatabase)),this.profileStorageDisposables.add(this.profileStorage.onDidChangeStorage(i=>this.emitDidChangeValue(Ie.PROFILE,i))),await this.profileStorage.init(),this.updateIsNew(this.profileStorage)}}async createWorkspaceStorage(){this.workspaceStorageDisposables.clear();const e=await wz.createWorkspaceStorage(this.workspace.id,this.logService);this.workspaceStorageDatabase=this.workspaceStorageDisposables.add(e),this.workspaceStorage=this.workspaceStorageDisposables.add(new sA(this.workspaceStorageDatabase)),this.workspaceStorageDisposables.add(this.workspaceStorage.onDidChangeStorage(t=>this.emitDidChangeValue(Ie.WORKSPACE,t))),await this.workspaceStorage.init(),this.updateIsNew(this.workspaceStorage)}updateIsNew(e){const t=e.getBoolean(Oq);t===void 0?e.set(Oq,!0):t&&e.set(Oq,!1)}getStorage(e){switch(e){case Ie.APPLICATION:return this.applicationStorage;case Ie.PROFILE:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(e){switch(e){case Ie.APPLICATION:return this.applicationStorageDatabase?.name;case Ie.PROFILE:return this.profileStorageDatabase?.name;default:return this.workspaceStorageDatabase?.name}}async switchToProfile(e){if(!this.canSwitchProfile(this.profileStorageProfile,e))return;const t=qn(this.profileStorage),i=t.items;t!==this.applicationStorage&&await t.close(),await this.createProfileStorage(e),this.switchData(i,qn(this.profileStorage),Ie.PROFILE)}async switchToWorkspace(e,t){const i=qn(this.workspaceStorage),n=t?i.items:new Map;await i.close(),this.workspace=e,await this.createWorkspaceStorage(),this.switchData(n,qn(this.workspaceStorage),Ie.WORKSPACE)}shouldFlushWhenIdle(){return Ey().document.hasFocus()&&!this.hasPendingUpdate}close(){zy&&(this.applicationStorage?.close(),this.profileStorageDatabase?.close(),this.workspaceStorageDatabase?.close()),this.dispose()}async clear(){for(const e of[Ie.APPLICATION,Ie.PROFILE,Ie.WORKSPACE]){for(const t of[an.USER,an.MACHINE])for(const i of this.keys(e,t))this.remove(i,e);await this.getStorage(e)?.whenFlushed()}await Zs.settled([this.applicationStorageDatabase?.clear()??Promise.resolve(),this.profileStorageDatabase?.clear()??Promise.resolve(),this.workspaceStorageDatabase?.clear()??Promise.resolve()])}hasScope(e){return Lje(e)?this.profileStorageProfile.id===e.id:this.workspace.id===e.id}},Mke=iM,iM.BROWSER_DEFAULT_FLUSH_INTERVAL=5*1e3,iM);Nke=Mke=D([_(2,Ge)],Nke);class rei extends Fq{constructor(){super(...arguments),this.hasPendingUpdate=!1,this.name="in-memory-indexedb-storage"}async clear(){(await this.getItems()).clear()}dispose(){}}const Ip=class Ip extends V{static async createApplicationStorage(e){return Ip.create({id:"global",broadcastChanges:!0},e)}static async createProfileStorage(e,t){return Ip.create({id:`global-${e.id}`,broadcastChanges:!0},t)}static async createWorkspaceStorage(e,t){return Ip.create({id:e},t)}static async create(e,t){try{const i=new Ip(e,t);return await i.whenConnected,i}catch(i){return t.error(`[IndexedDB Storage ${e.id}] create(): ${Nr(i,!0)}`),new rei}}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=`${Ip.STORAGE_DATABASE_PREFIX}${e.id}`,this.broadcastChannel=e.broadcastChanges?this._register(new _Ne(this.name)):void 0,this.whenConnected=this.connect(),this.registerListeners()}registerListeners(){this.broadcastChannel&&this._register(this.broadcastChannel.onDidReceiveData(e=>{lEt(e)&&this._onDidChangeItemsExternal.fire(e)}))}async connect(){try{return await j0.create(this.name,void 0,[Ip.STORAGE_OBJECT_STORE])}catch(e){throw this.logService.error(`[IndexedDB Storage ${this.name}] connect() error: ${Nr(e)}`),e}}async getItems(){const e=await this.whenConnected;function t(i){return typeof i=="string"}return e.getKeyValues(Ip.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(Ip.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(Ip.STORAGE_OBJECT_STORE,"readwrite",t=>t.clear())}};Ip.STORAGE_DATABASE_PREFIX="vscode-web-state-db-",Ip.STORAGE_OBJECT_STORE="ItemTable";let wz=Ip;var nw;const aei=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;var nM;let Zie=(nM=class extends V{static toKey(e){return`extensionKeys/${OJ(e.id)}@${e.version}`}static fromKey(e){const t=aei.exec(e);if(t&&t[1])return{id:t[1],version:t[2]}}static async removeOutdatedExtensionVersions(e,t){const i=await e.getInstalled(),n=[];for(const[o,r]of nw.readAllExtensionsWithKeysForSync(t)){const a=i.find(c=>Ra(c.identifier,{id:o}))?.manifest.version;for(const c of r)a!==c&&n.push(nw.toKey({id:o,version:c}))}for(const o of n)t.remove(o,Ie.PROFILE)}static readAllExtensionsWithKeysForSync(e){const t=new Map,i=e.keys(Ie.PROFILE,an.MACHINE);for(const n of i){const o=nw.fromKey(n);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=nw.readAllExtensionsWithKeysForSync(e),this._register(this.storageService.onDidChangeValue(Ie.PROFILE,void 0,this._register(new Z))(n=>this.onDidChangeStorageValue(n)))}onDidChangeStorageValue(e){if(this.extensionsWithKeysForSync.has(e.key.toLowerCase())){this._onDidChangeExtensionStorageToSync.fire();return}const t=nw.fromKey(e.key);if(t){if(this.storageService.get(e.key,Ie.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(Lt(e))return e;const t=e.manifest?e.manifest.publisher:e.publisher,i=e.manifest?e.manifest.name:e.name;return DM(t,i)}getExtensionState(e,t){const i=this.getExtensionId(e),n=this.getExtensionStateRaw(e,t);if(n)try{return JSON.parse(n)}catch(o){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${i}, global: ${t}): ${o}`)}}getExtensionStateRaw(e,t){const i=this.getExtensionId(e),n=this.storageService.get(i,t?Ie.PROFILE:Ie.WORKSPACE);return n&&n?.length>nw.LARGE_STATE_WARNING_THRESHOLD&&this.logService.warn(`[mainThreadStorage] large extension state detected (extensionId: ${i}, global: ${t}): ${n.length/1024}kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.`),n}setExtensionState(e,t,i){const n=this.getExtensionId(e);t===void 0?this.storageService.remove(n,i?Ie.PROFILE:Ie.WORKSPACE):this.storageService.store(n,JSON.stringify(t),i?Ie.PROFILE:Ie.WORKSPACE,an.MACHINE)}setKeysForSync(e,t){this.storageService.store(nw.toKey(e),JSON.stringify(t),Ie.PROFILE,an.MACHINE)}getKeysForSync(e){const t=this.productService.extensionSyncedKeys?.[e.id.toLowerCase()],i=this.storageService.get(nw.toKey(e),Ie.PROFILE),n=i?JSON.parse(i):void 0;return n&&t?ja([...n,...t]):n||t}addToMigrationList(e,t){if(e!==t){const i=this.migrationList.filter(n=>!n.includes(e)&&!n.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",Ie.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),Ie.APPLICATION,an.MACHINE):this.storageService.remove("extensionStorage.migrationList",Ie.APPLICATION)}},nw=nM,nM.LARGE_STATE_WARNING_THRESHOLD=512*1024,nM);Zie=nw=D([_(0,$i),_(1,Er),_(2,Ge)],Zie);var yz;(function(s){s[s.APPLICATION=-1]="APPLICATION",s[s.PROFILE=0]="PROFILE",s[s.WORKSPACE=1]="WORKSPACE"})(yz||(yz={}));class Hue extends sA{constructor(e,t){const i=t.read(e);if(super(new cei(e,t,i)),i!=null)for(const[n,o]of i)this.items.set(n,o)}}class cei{constructor(e,t,i=new Map){this.scope=e,this.provider=t,this.items=i,this.onDidChangeItemsExternal=this.provider.onDidChange??M.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 lei extends Q2{constructor(e,t){super({flushInterval:5e3}),this.provider=e,this.fallbackOverride=t,this.applicationStorage=this._register(new Hue(yz.APPLICATION,this.provider)),this.profileStorage=this._register(new Hue(yz.PROFILE,this.provider)),this.workspaceStorage=this._register(new Hue(yz.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)}}nNe(async s=>{const e=s.get($i);e instanceof Q2&&await e.initialize()});o4t(async s=>{const e=s.get(xc),t=s.get($i);e.onDidChangeFocus(i=>{i||t.flush()})});let Pke=class extends Nke{constructor(e,t,i){super(tNe(),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)}};Pke=D([_(1,lg),_(2,Ge)],Pke);function dei({customProvider:s,fallbackOverride:e}={}){return s!=null?{[$i.toString()]:new wi(lei,[s,e],!0),[L3.toString()]:new wi(Zie,[],!0)}:{[$i.toString()]:new wi(Pke,[e],!0),[L3.toString()]:new wi(Zie,[],!0)}}class hei{constructor(){this._systemSchemes=new Set(Object.keys(pe)),this._providerInfo=new Map,this.extUri=new CN(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&Vn.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 $U=ae("IExtHostFileSystemInfo");var sw;let Fke=sw=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new K1e,this._proxy=e.getProxy(Be.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(n){try{let o;const r=i._fileSystemProvider.get(n.scheme);return r?(await i._proxy.$ensureActivation(n.scheme),o=await r.impl.stat(n)):o=await i._proxy.$stat(n),{type:o.type,ctime:o.ctime,mtime:o.mtime,size:o.size,permissions:o.permissions===rp.Readonly?1:void 0}}catch(o){sw._handleError(o)}},async readDirectory(n){try{const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),(await o.impl.readDirectory(n)).slice()):await i._proxy.$readdir(n)}catch(o){return sw._handleError(o)}},async createDirectory(n){try{const o=i._fileSystemProvider.get(n.scheme);return o&&!o.isReadonly?(await i._proxy.$ensureActivation(n.scheme),await i.mkdirp(o.impl,o.extUri,n)):await i._proxy.$mkdir(n)}catch(o){return sw._handleError(o)}},async readFile(n){try{const o=i._fileSystemProvider.get(n.scheme);return o?(await i._proxy.$ensureActivation(n.scheme),(await o.impl.readFile(n)).slice()):(await i._proxy.$readFile(n)).buffer}catch(o){return sw._handleError(o)}},async writeFile(n,o){try{const r=i._fileSystemProvider.get(n.scheme);return r&&!r.isReadonly?(await i._proxy.$ensureActivation(n.scheme),await i.mkdirp(r.impl,r.extUri,r.extUri.dirname(n)),await i._writeQueue.queueFor(n,()=>Promise.resolve(r.impl.writeFile(n,o,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(n,$e.wrap(o))}catch(r){return sw._handleError(r)}},async delete(n,o){try{const r=i._fileSystemProvider.get(n.scheme);return r&&!r.isReadonly&&!o?.useTrash?(await i._proxy.$ensureActivation(n.scheme),await r.impl.delete(n,{recursive:!1,...o})):await i._proxy.$delete(n,{recursive:!1,useTrash:!1,atomic:!1,...o})}catch(r){return sw._handleError(r)}},async rename(n,o,r){try{return await i._proxy.$rename(n,o,{overwrite:!1,...r})}catch(a){return sw._handleError(a)}},async copy(n,o,r){try{return await i._proxy.$copy(n,o,{overwrite:!1,...r})}catch(a){return sw._handleError(a)}},isWritableFileSystem(n){const o=t.getCapabilities(n);if(typeof o=="number")return!(o&Vn.Readonly)}})}async mkdirp(e,t,i){const n=[];for(;!t.isEqual(i,t.dirname(i));)try{if(!((await e.stat(i)).type&sn.Directory))throw Yc.FileExists(`Unable to create folder '${i.scheme===pe.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(o){if(Ok(o)!==ot.FileNotFound)throw o;n.push(t.basename(i)),i=t.dirname(i)}for(let o=n.length-1;o>=0;o--){i=t.joinPath(i,n[o]);try{await e.createDirectory(i)}catch(r){if(Ok(r)!==ot.FileExists)throw r}}}static _handleError(e){if(e instanceof Yc)throw e;if(e instanceof AA)switch(e.code){case ot.FileExists:throw Yc.FileExists(e.message);case ot.FileNotFound:throw Yc.FileNotFound(e.message);case ot.FileNotADirectory:throw Yc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Yc.FileIsADirectory(e.message);case ot.NoPermissions:throw Yc.NoPermissions(e.message);case ot.Unavailable:throw Yc.Unavailable(e.message);default:throw new Yc(e.message,e.name)}if(!(e instanceof Error))throw new Yc(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw Yc.Unavailable(e.message);switch(e.name){case ot.FileExists:throw Yc.FileExists(e.message);case ot.FileNotFound:throw Yc.FileNotFound(e.message);case ot.FileNotADirectory:throw Yc.FileNotADirectory(e.message);case ot.FileIsADirectory:throw Yc.FileIsADirectory(e.message);case ot.NoPermissions:throw Yc.NoPermissions(e.message);case ot.Unavailable:throw Yc.Unavailable(e.message);default:throw new Yc(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?xn:kre,isReadonly:!!i?.isReadonly}),Ee(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??xn}};Fke=sw=D([_(0,Jo),_(1,$U)],Fke);const Zce=ae("IExtHostConsumerFileSystem");class Vst extends iae{get disposed(){return this._disposed}constructor(e,t,i,n,o){super(),this.id=e,this.name=t,this.logger=i,this.proxy=n,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,oB.Clear,e)}replace(e){const t=this.offset;this.info(e),this.proxy.$update(this.id,oB.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+=$e.fromString(t).byteLength,IY(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,oB.Append))}dispose(){super.dispose(),this._disposed||(this.proxy.$dispose(this.id),this._disposed=!0)}}class uei extends Vst{appendLine(e){this.append(e)}}let Oke=class{constructor(e,t,i,n,o,r){this.initData=t,this.extHostFileSystem=i,this.extHostFileSystemInfo=n,this.loggerService=o,this.logService=r,this.extensionLogDirectoryPromise=new Map,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(Be.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${Yet(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 n=typeof t=="object"&&t.log,o=Lt(t)?t:void 0;if(Lt(o)&&!o.trim())throw new Error("illegal argument `languageId`. must not be empty");let r;const a=this.initData.environment.extensionLogLevel?.find(([l])=>Sn.equals(i.identifier,l))?.[1];a&&(r=hQe(a));const c=n?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}),n?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 n=await this.outputDirectoryPromise,o=this.extHostFileSystemInfo.extUri.joinPath(n,`${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 Vst(a,e,r,this.proxy,i)}async doCreateLogOutputChannel(e,t,i){const n=await this.createExtensionLogDirectory(i),o=e.replace(/[\\/:\*\?"<>\|]/g,""),r=this.extHostFileSystemInfo.extUri.joinPath(n,`${o}.log`),a=`${i.identifier.value}.${o}`,c=this.loggerService.createLogger(r,{id:a,name:e,logLevel:t,extensionId:i.identifier.value});return new uei(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(n){if(Ok(n)!==ot.FileExists)throw n}return i})())}return t}createExtHostOutputChannel(e,t){let i=!1;const n=()=>{if(i)throw new Error("Channel has been closed")};return{get name(){return e},append(o){n(),t.then(r=>r.append(o))},appendLine(o){n(),t.then(r=>r.appendLine(o))},clear(){n(),t.then(o=>o.clear())},replace(o){n(),t.then(r=>r.replace(o))},show(o,r){n(),t.then(a=>a.show(o,r))},hide(){n(),t.then(o=>o.hide())},dispose(){i=!0,t.then(o=>o.dispose())}}}createExtHostLogOutputChannel(e,t,i){const n=new Z,o=()=>{if(n.isDisposed)throw new Error("Channel has been closed")},r=n.add(new I);function a(c){t=c,r.fire(c)}return i.then(c=>{n.add(c),c.logLevel!==t&&a(c.logLevel),n.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(){n.dispose()}}}};Oke=D([_(0,Jo),_(1,mu),_(2,Zce),_(3,$U),_(4,lf),_(5,Ge)],Oke);const zst=ae("IExtHostOutputService"),ele=ae("IURITransformerService");class gei{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)}}function J$(s,e,t){return new CN(i=>_Pe(i,t)).isEqual(s,e)}function fei(s,e,t){return J$(s.uri,e.uri,t)?0:dm(s.uri.toString(),e.uri.toString())}function pei(s,e,t){return s.index!==e.index?s.indext(r,a,i)),o=e.slice(0).sort((r,a)=>t(r,a,i));return jI(n,o,(r,a)=>t(r,a,i))}function _Pe(s,e){const t=e.getCapabilities(s.scheme);return!(t&&t&Vn.PathCaseSensitive)}class aB extends aje{static toExtHostWorkspace(e,t,i,n){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,b)=>{const w=N.revive(v.uri),y=aB._findFolder(i||t,w,n);y?(y.name=v.name,y.index=v.index,h.push(y)):h.push({uri:w,name:v.name,index:b})}):h.push(...a.map(({uri:v,name:b,index:w})=>({uri:N.revive(v),name:b,index:w}))),h.sort((v,b)=>v.index_Pe(v,n)),{added:p,removed:m}=$st(u?u.workspaceFolders:[],f.workspaceFolders,fei,n);return{workspace:f,added:p,removed:m}}static _findFolder(e,t,i){for(let n=0;nnew hae(c)),n,o,a),this._name=t,this._isUntitled=r,this._workspaceFolders=[],this._structure=Eh.forUris(a,()=>!0),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=Lr(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let Bke=class{constructor(e,t,i,n,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 Kx,this._canonicalUriProviders=new Map,this._logService=n,this._extHostFileSystemInfo=i,this._uriTransformerService=o,this._requestIdProvider=new Ylt,this._barrier=new Gd,this._proxy=e.getProxy(Be.MainThreadWorkspace),this._messageService=e.getProxy(Be.MainThreadMessageService);const r=t.workspace;this._confirmedWorkspace=r?new aB(r.id,r.name,[],!!r.transient,r.configuration?N.revive(r.configuration):null,!!r.isUntitled,a=>_Pe(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?N.from({scheme:pe.untitled,path:_i(Lr(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,...n){const o=[];if(Array.isArray(n)&&n.forEach(d=>{N.isUri(d.uri)&&!o.some(h=>J$(h.uri,d.uri,this._extHostFileSystemInfo))&&o.push({uri:d.uri,name:d.name||SA(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||SA(d.uri),index:void 0})));for(let d=0;df!==d&&J$(h.uri,u.uri,this._extHostFileSystemInfo)))return!1}a.forEach((d,h)=>d.index=h);const{added:c,removed:l}=$st(r,a,pei,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(Xe.Error,g(572,"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,n="";if(typeof e=="string"?(i=N.file(e),n=e):typeof e<"u"&&(i=e,n=e.fsPath),!i)return n;const o=this.getWorkspaceFolder(i,!0);if(!o)return n;typeof t>"u"&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let r=SN(o.uri,i);return t&&o.name&&(r=`${o.name}/${r}`),r}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=aB.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:n}=aB.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:n}))}findFiles(e,t,i,n,o=He.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${n.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,n=He.None){return this._logService.trace(`extHostWorkspace#findFiles2: fileSearch, extension: ${i.value}, entryPoint: findFiles2`),this._findFilesImpl(void 0,e,t,n)}async _findFilesImpl(e,t,i,n=He.None){if(n&&n.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}=Uue(Vf.from(e));a=l,r.includePattern=c}else{const{includePattern:c,folder:l}=Uue(Vf.from(t));a=l,r.filePattern=c}return this._proxy.$startFileSearch(a??null,r,n).then(c=>Array.isArray(c)?c.map(l=>N.revive(l)):[])}async findTextInFiles(e,t,i,n,o=He.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${n.value}, entryPoint: findTextInFiles`);const r=this._requestIdProvider.getNext(),a=typeof t.previewOptions>"u"?{matchLines:100,charsPerLine:1e4}:t.previewOptions,{includePattern:c,folder:l}=Uue(Vf.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,disregardSearchExcludeSettings:typeof t.useSearchExclude=="boolean"?!t.useSearchExclude:!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=N.revive(u.resource);u.results.forEach(p=>{const m=Mo(p);X8t(m)?i({uri:f,preview:{text:m.preview.text,matches:e8(m.preview.matches,v=>new Jn(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn))},ranges:e8(m.ranges,v=>new Jn(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 N.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return N.revive(t)}saveAll(e){return this._proxy.$saveAll(e)}resolveProxy(e){return this._proxy.$resolveProxy(e)}lookupAuthorization(e){return this._proxy.$lookupAuthorization(e)}lookupKerberosAuthorization(e){return this._proxy.$lookupKerberosAuthorization(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),n=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(n,i),Ee(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(n)})}async $getEditSessionIdentifier(e,t){this._logService.info("Getting edit session identifier for workspaceFolder",e);const i=await this.resolveWorkspaceFolder(N.revive(e));if(!i){this._logService.warn("Unable to resolve workspace folder");return}this._logService.info("Invoking #provideEditSessionIdentity for workspaceFolder",i);const n=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!n),!n)return;const o=await n.provideEditSessionIdentity(i,t);if(this._logService.info("Provider returned edit session identifier: ",o),!!o)return o}async $provideEditSessionIdentityMatch(e,t,i,n){this._logService.info("Getting edit session identifier for workspaceFolder",e);const o=await this.resolveWorkspaceFolder(N.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,n);if(this._logService.info("Provider returned edit session identifier match result: ",a),!!a)return a}getOnWillCreateEditSessionIdentityEvent(e){return(t,i,n)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillCreateEditSessionIdentityEvent.event(o,void 0,n)}}async $onWillCreateEditSessionIdentity(e,t,i){const n=await this.resolveWorkspaceFolder(N.revive(e));if(n===void 0)throw new Error("Unable to resolve workspace folder");await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:n},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),n=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(n,i),Ee(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(n)})}async provideCanonicalUri(e,t,i){const n=this._canonicalUriProviders.get(e.scheme);if(!n)return;const o=await n.provideCanonicalUri?.(N.revive(e),t,i);if(o)return o}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(N.revive(e),{targetScheme:t},i)}};Bke=D([_(0,Jo),_(1,mu),_(2,$U),_(3,Ge),_(4,ele)],Bke);const nE=ae("IExtHostWorkspace");function Uue(s){let e,t;return s&&(typeof s=="string"?e=s:(e=s.pattern,t=N.revive(s.baseUri))),{includePattern:e,folder:t}}var BV,vk;let Wke=(vk=class{constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(Be.MainThreadDecorations)}registerFileDecorationProvider(e,t){const i=BV._handlePool++;this._provider.set(i,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(i,t.identifier.value);const n=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(o=>{if(!o){this._proxy.$onDidChange(i,null);return}const r=O_(o);if(r.length<=BV._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:Jrt(d.path,"/")})),c=Zz(a,(d,h)=>d.rank-h.rank||dm(d.uri.path,h.uri.path)),l=[];e:for(const d of c){let h;for(const u of d){const f=bb(u.uri.path);if(h!==f&&(h=f,l.push(u.uri)>=BV._maxEventSize))break e}}this._proxy.$onDidChange(i,l)});return new Qs(()=>{n?.dispose(),this._proxy.$unregisterDecorationProvider(i),this._provider.delete(i)})}async $provideDecorations(e,t,i){if(!this._provider.has(e))return Object.create(null);const n=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(N.revive(c),i));if(!d)return;try{X9.validate(d),d.badge&&typeof d.badge!="string"&&Ve(r,"codiconDecoration"),n[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)}})),n}},BV=vk,vk._handlePool=0,vk._maxEventSize=250,vk);Wke=BV=D([_(0,Jo),_(1,Ge)],Wke);const Gst=ae("IExtHostDecorations");function D4(s,e){if(e){const t=e.split(".");let i=s;for(let n=0;i&&nthis._actual)}$initializeConfiguration(e){this._actual=new wei(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};Hke=D([_(0,Jo),_(1,nE),_(2,Ge)],Hke);class wei{constructor(e,t,i,n){this._onDidChangeConfiguration=new I,this._proxy=e,this._logService=n,this._extHostWorkspace=t,this._configuration=l3.parse(i,n),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=l3.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const n=l9e(t)||{},o=this._toReadonlyValue(e?D4(this._configuration.getValue(void 0,n,this._extHostWorkspace.workspace),e):this._configuration.getValue(void 0,n,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,n,i?.identifier);function r(c){if(c==null)return null;if(typeof c=="boolean")return c?St.USER:St.WORKSPACE;switch(c){case HT.Global:return St.USER;case HT.Workspace:return St.WORKSPACE;case HT.WorkspaceFolder:return St.WORKSPACE_FOLDER}}const a={has(c){return typeof D4(o,c)<"u"},get:(c,l)=>{this._validateConfigurationAccess(e?`${e}.${c}`:c,n,i?.identifier);let d=D4(o,c);if(typeof d>"u")d=l;else{let h;const u=(f,p)=>{if(kn(f)){let m;const v=()=>{h=h||xs(o),m=m||D4(h,p)};return new Proxy(f,{get:(b,w)=>{if(typeof w=="string"&&w.toLowerCase()==="tojson")return v(),()=>m;if(h)return m=m||D4(h,p),m[w];const y=b[w];return typeof w=="string"?u(y,`${p}.${w}`):y},set:(b,w,y)=>(v(),m&&(m[w]=y),!0),deleteProperty:(b,w)=>(v(),m&&delete m[w],!0),defineProperty:(b,w,y)=>(v(),m&&Object.defineProperty(m,w,y),!0)})}return Array.isArray(f)?xs(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,n,h):this._proxy.$removeConfigurationOption(u,c,n,h)},inspect:c=>{c=e?`${e}.${c}`:c;const l=this._configuration.inspect(c,n,this._extHostWorkspace.workspace);if(l)return{key:c,defaultValue:xs(l.policy?.value??l.default?.value),globalValue:xs(l.user?.value??l.application?.value),workspaceValue:xs(l.workspace?.value),workspaceFolderValue:xs(l.workspaceFolder?.value),defaultLanguageValue:xs(l.default?.override),globalLanguageValue:xs(l.user?.override??l.application?.override),workspaceLanguageValue:xs(l.workspace?.override),workspaceFolderLanguageValue:xs(l.workspaceFolder?.override),languageIds:xs(l.overrideIdentifiers)}}};return typeof o=="object"&&dp(a,o,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>kn(i)?new Proxy(i,{get:(n,o)=>t(n[o]),set:(n,o,r)=>{throw new Error(`TypeError: Cannot assign to read only property '${String(o)}' of object`)},deleteProperty:(n,o)=>{throw new Error(`TypeError: Cannot delete read only property '${String(o)}' of object`)},defineProperty:(n,o)=>{throw new Error(`TypeError: Cannot define property '${String(o)}' for a readonly object`)},setPrototypeOf:n=>{throw new Error("TypeError: Cannot set prototype for a readonly object")},isExtensible:()=>!1,preventExtensions:()=>!0}):i;return t(e)}_validateConfigurationAccess(e,t,i){const n=Xg.test(e)?at.RESOURCE:this._configurationScopes.get(e),o=i?`[${i.value}] `:"";if(at.RESOURCE===n){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(at.WINDOW===n){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 SLe(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(n,o)=>i.affectsConfiguration(n,l9e(o))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const sE=ae("IExtHostConfiguration"),UI=(s,e,t,i)=>{let n=e;return{enumerable:!0,configurable:!1,get(){return n},set(o){if(!t(n,o)){const r=n;n=o,s.listener?.(i(o,r))}}}},bP=(s,e)=>s===e,uE={range:(s,e)=>s===e?!0:!s||!e?!1:s.isEqual(e),label:bP,description:bP,sortText:bP,busy:bP,error:bP,canResolveChildren:bP,tags:(s,e)=>!(s.length!==e.length||s.some(t=>!e.find(i=>t.id===i.id)))},wP=s=>e=>({op:Bd.SetProp,update:s(e)}),yei=(s,e)=>({range:(()=>{let t;const i=wP(n=>({range:F.lift(et.from(n))}));return{enumerable:!0,configurable:!1,get(){return t},set(n){s.listener?.({op:Bd.DocumentSynced}),uE.range(t,n)||(t=n,s.listener?.(i(n)))}}})(),label:UI(s,e,uE.label,wP(t=>({label:t}))),description:UI(s,void 0,uE.description,wP(t=>({description:t}))),sortText:UI(s,void 0,uE.sortText,wP(t=>({sortText:t}))),canResolveChildren:UI(s,!1,uE.canResolveChildren,t=>({op:Bd.UpdateCanResolveChildren,state:t})),busy:UI(s,!1,uE.busy,wP(t=>({busy:t}))),error:UI(s,void 0,uE.error,wP(t=>({error:Ps.fromStrict(t)||null}))),tags:UI(s,[],uE.tags,(t,i)=>({op:Bd.SetTags,new:t.map(Ob.from),old:i.map(Ob.from)}))}),Cei=s=>{const e=vn.fromString(s.extId),t=new GN(e.controllerId,e.localId,s.label,N.revive(s.uri)||void 0);return t.range=et.to(s.range||void 0),t.description=s.description||void 0,t.sortText=s.sortText||void 0,t.tags=s.tags.map(i=>Ob.to({id:Lnt(i).tagId})),t},d9e=s=>{let e;for(const t of s.tests){const i=Cei(t.item);zce(i).parent=e,e=i}return e};class GN{constructor(e,t,i,n){if(t.includes(Xm.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const o=eQt(this,e);Object.defineProperties(this,{id:{value:t,enumerable:!0,writable:!1},uri:{value:n,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return o.parent instanceof vPe?void 0:o.parent}},children:{value:Zqt(o,zce,GN),enumerable:!0,writable:!1},...yei(o,i)})}}class vPe extends GN{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class Sei extends Yqt{constructor(e,t,i){super({controllerId:e,getDocumentVersion:n=>n&&i.getDocument(n)?.version,getApiFor:zce,getChildren:n=>n.children,root:new vPe(e,t),toITestItem:hI.from})}}let Uke=class extends V{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=zg.NONE,this._telemetryIsSupported=!1,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this.extHostTelemetryLogFile=N.revive(this.initData.environment.extensionTelemetryLogResource),this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly,this._outputLogger=t.createLogger(this.extHostTelemetryLogFile,{id:k1t,name:g(576,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0}),this._register(this._outputLogger),this._register(t.onDidChangeLogLevel(i=>{cQe(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()===Gn.Trace)}getTelemetryConfiguration(){return this._level===zg.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=zg.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=zg.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=zg.USAGE:!1}}instantiateLogger(e,t,i){const n=this.getTelemetryDetails(),o=new Kst(t,i,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:n.isUsageEnabled,isErrorsEnabled:n.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"]=qst(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case X_.Web:t["common.uikind"]="web";break;case X_.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=S6(L1t(this.initData.remote.authority)),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;const t=this.getTelemetryDetails();this._telemetryLoggers.forEach((i,n)=>{const o=i.filter(r=>!r.isDisposed);o.length===0?this._telemetryLoggers.delete(n):this._telemetryLoggers.set(n,o)}),this._telemetryLoggers.forEach(i=>{for(const n of i)n.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 n=this._telemetryLoggers.get(e.value)?.filter(r=>!r.isDisposed);if(!n)return this._telemetryLoggers.delete(e.value),!1;let o=!1;for(const r of n)r.ignoreUnhandledExtHostErrors||(r.logError(t),o=!0);return o}};Uke=D([_(0,mu),_(1,lf)],Uke);class Kst{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,n,o,r,a){this._extension=i,this._logger=n,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=PWe(t,[]),this._additionalCommonProperties&&(t=dp(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=dp(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},n=PWe(i,[]),o=new Error(n.message,{cause:n.cause});o.stack=n.stack,o.name=n.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 qst(s){const e=Date.now()-new Date(s).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const tle=ae("IExtHostTelemetry");var ZC,h7,u7,l6e;let Vke=(l6e=class{constructor(e,t,i){Wt(this,ZC);Wt(this,h7);Wt(this,u7);this._commands=new Map,this._apiCommands=new Map,Ct(this,ZC,e.getProxy(Be.MainThreadCommands)),this._logService=t,Ct(this,u7,i),Ct(this,h7,e.getProxy(Be.MainThreadTelemetry)),this.converter=new Aei(this,n=>{const o=this._apiCommands.get(n);return o?.result===nn.Void?o:void 0},t),this._argumentProcessors=[{processArgument(n){return Mo(n)}},{processArgument(n){return b2(n,function(o){if(F.isIRange(o))return et.to(o);if(oe.isIPosition(o))return Yo.to(o);if(F.isIRange(o.range)&&N.isUri(o.uri))return cf.to(o);if(o instanceof $e)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 n=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,...n);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 Qs(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,i,n,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:n,metadata:o,extension:r}),e&&Ce(this,ZC).$registerCommand(t),new Qs(()=>{this._commands.delete(t)&&e&&Ce(this,ZC).$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 Ce(this,ZC).$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let n=!1;const o=b2(t,function(r){if(r instanceof bs)return Yo.from(r);if(r instanceof Jn)return et.from(r);if(r instanceof vp)return cf.from(r);if(wy.isNotebookRange(r))return Fy.from(r);if(r instanceof ArrayBuffer)return n=!0,$e.wrap(new Uint8Array(r));if(r instanceof Uint8Array)return n=!0,$e.wrap(r);if(r instanceof $e)return n=!0,r;if(!Array.isArray(r))return r});try{const r=await Ce(this,ZC).$executeCommand(e,n?new qd(o):o,i);return Mo(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 n=this._commands.get(e);if(!n)throw new Error("Unknown command");const{callback:o,thisArg:r,metadata:a}=n;if(a?.args)for(let l=0;lthis._argumentProcessors.reduce((o,r)=>r.processArgument(o,i.extension?.identifier),n)),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),Ce(this,ZC).$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:n}=i;n&&(e[t]=n)}return Promise.resolve(e)}},ZC=new WeakMap,h7=new WeakMap,u7=new WeakMap,l6e);Vke=D([_(0,Jo),_(1,Ge),_(2,tle)],Vke);const KN=ae("IExtHostCommands");class Aei{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${ar()}`,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 n=this._lookupApiCommand(e.command);if(n)i.id=n.internalId,i.arguments=n.args.map((o,r)=>o.convert(e.arguments&&e.arguments[r]));else if(eo(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 Ga=class Ga{static Arr(e){return new Ga(`${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,n){this.name=e,this.description=t,this.validate=i,this.convert=n}optional(){return new Ga(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 Ga(e??this.name,t??this.description,this.validate,this.convert)}};Ga.Uri=new Ga("uri","Uri of a text document",e=>N.isUri(e),e=>e),Ga.Position=new Ga("position","A position in a text document",e=>bs.isPosition(e),Yo.from),Ga.Range=new Ga("range","A range in a text document",e=>Jn.isRange(e),et.from),Ga.Selection=new Ga("selection","A selection in a text document",e=>oC.isSelection(e),Fb.from),Ga.Number=new Ga("number","",e=>typeof e=="number",e=>e),Ga.String=new Ga("string","",e=>typeof e=="string",e=>e),Ga.StringArray=Ga.Arr(Ga.String),Ga.CallHierarchyItem=new Ga("item","A call hierarchy item",e=>e instanceof Lce,lN.from),Ga.TypeHierarchyItem=new Ga("item","A type hierarchy item",e=>e instanceof Mce,jT.from),Ga.TestItem=new Ga("testItem","A VS Code TestItem",e=>e instanceof GN,hI.from);let ht=Ga;const Zoe=class Zoe{constructor(e,t){this.description=e,this.convert=t}};Zoe.Void=new Zoe("no result",e=>e);let nn=Zoe;class gn{constructor(e,t,i,n,o){this.id=e,this.internalId=t,this.description=i,this.args=n,this.result=o}}const zke=new Map;function Eei(s,e){e?zke.set(s,e):zke.delete(s)}function xei(s){return zke.get(s)}class Dei extends CKe{constructor(e,t,i,n,o,r,a){super(t,i,n,o),this._proxy=e,this._languageId=r,this._isDirty=a,this._isDisposed=!1}dispose(){qf(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return is(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===pe.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===` +`?A_.LF:A_.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)},[Symbol.for("debug.description")](){return`TextDocument(${e._uri.toString()})`}}}return Object.freeze(this._document)}_acceptLanguageId(e){qf(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){qf(!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,n=t.start.line,o=t.end.line,r=[];r.push(this._lines[n].substring(t.start.character));for(let a=n+1;a=this._lines.length||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new kei(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 bs(t.index,Math.min(t.remainder,i))}_validateRange(e){if(!(e instanceof Jn))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 Jn(t.line,t.character,i.line,i.character)}_validatePosition(e){if(!(e instanceof bs))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:t,character:i}=e,n=!1;if(t<0)t=0,i=0,n=!0;else if(t>=this._lines.length)t=this._lines.length-1,i=this._lines[t].length,n=!0;else{const o=this._lines[t].length;i<0?(i=0,n=!0):i>o&&(i=o,n=!0)}return n?new bs(t,i):e}_getWordRangeAtPosition(e,t){const i=this._validatePosition(e);if(!t)t=xei(this._languageId);else if(W1e(t))throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);const n=Ak(i.character+1,M7(t),this._lines[i.line],0);if(n)return new Jn(i.line,n.startColumn-1,i.line,n.endColumn-1)}}class kei{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 Jn(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Jn(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 ere=class ere{constructor(e,t,i){const n=ere._Keys.nextId();e.$registerTextEditorDecorationType(t.identifier,n,TEe.from(i)),this.value=Object.freeze({key:n,dispose(){e.$removeTextEditorDecorationType(n)}})}};ere._Keys=new CU("TextEditorDecorationType");let $ke=ere;class Iei{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 bs)i=new Jn(e,e);else if(e instanceof Jn)i=e;else throw new Error("Unrecognized location");this._pushEdit(i,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new Jn(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof Jn)t=e;else throw new Error("Unrecognized location");this._pushEdit(t,null,!0)}_pushEdit(e,t,i){const n=this._document.validateRange(e);this._collectedEdits.push({range:n,text:t,forceMoveMarkers:i})}setEndOfLine(e){if(this._throwIfFinalized(),e!==A_.LF&&e!==A_.CRLF)throw Pi("endOfLine");this._setEndOfLine=e}}class Tei{constructor(e,t,i,n){this._proxy=e,this._id=t,this._accept(i),this._logService=n;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=nB.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:nB.from(e)})))}assign(e){const t={};let i=!1;if(typeof e.tabSize<"u"){const n=this._validateTabSize(e.tabSize);n==="auto"?(i=!0,t.tabSize=n):typeof n=="number"&&this._tabSize!==n&&(this._tabSize=n,i=!0,t.tabSize=n)}if(typeof e.indentSize<"u"){const n=this._validateIndentSize(e.indentSize);n==="tabSize"?(i=!0,t.indentSize=n):typeof n=="number"&&this._originalIndentSize!==n&&(this._indentSize=n,this._originalIndentSize=n,i=!0,t.indentSize=n)}if(typeof e.insertSpaces<"u"){const n=this._validateInsertSpaces(e.insertSpaces);n==="auto"?(i=!0,t.insertSpaces=n):this._insertSpaces!==n&&(this._insertSpaces=n,i=!0,t.insertSpaces=n)}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=nB.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 Lei{constructor(e,t,i,n,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 Tei(this._proxy,this.id,r,i),this._visibleRanges=a,this._viewColumn=c;const l=this;this.value=Object.freeze({get document(){return n.value},set document(d){throw new w1("document")},get selection(){return l._selections&&l._selections[0]},set selection(d){if(!(d instanceof oC))throw Pi("selection");l._selections=[d],l._trySetSelection()},get selections(){return l._selections},set selections(d){if(!Array.isArray(d)||d.some(h=>!(h instanceof oC)))throw Pi("selections");l._selections=d,l._trySetSelection()},get visibleRanges(){return l._visibleRanges},set visibleRanges(d){throw new w1("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 w1("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 Iei(n.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=>et.from(p));else if(h instanceof bs){const{lineNumber:p,column:m}=Yo.from(h);f=[{startLineNumber:p,startColumn:m,endLineNumber:p,endColumn:m}]}else if(h instanceof Jn)f=[et.from(h)];else{f=[];for(const p of h)if(p instanceof Jn)f.push(et.from(p));else{const{lineNumber:m,column:v}=Yo.from(p);f.push({startLineNumber:m,startColumn:v,endLineNumber:m,endColumn:v})}}return t.$tryInsertSnippet(e,n.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(Mnt(h))return t.$trySetDecorations(e,d.key,nQt(h));{const f=new Array(4*h.length);for(let p=0,m=h.length;pt.$tryRevealRange(e,et.from(d),h||F9.Default))},show(d){t.$tryShowEditor(e,El.from(d))},hide(){t.$tryHideEditor(e)},[Symbol.for("debug.description")](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){qf(!this._disposed),this._disposed=!0}_acceptOptions(e){qf(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){qf(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){qf(!this._disposed),this._viewColumn=e}_acceptSelections(e){qf(!this._disposed),this._selections=e}async _trySetSelection(){const e=this._selections.map(Fb.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:et.from(o.range),text:o.text,forceMoveMarkers:o.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,n,{setEndOfLine:typeof t.setEndOfLine=="number"?PH.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 Rei{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}}let Gke=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new ui,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=[],n=[];if(e.removedDocuments)for(const o of e.removedDocuments){const r=N.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=N.revive(o.uri);let a=this._documents.get(r);if(a&&r.scheme!==pe.vscodeNotebookCell&&r.scheme!==pe.vscodeInteractiveInput)throw new Error(`document '${r} already exists!'`);a||(a=new Rei(new Dei(this._extHostRpc.getProxy(Be.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&&n.push(r)}if(e.addedEditors)for(const o of e.addedEditors){const r=N.revive(o.documentUri);qf(this._documents.has(r),`document '${r}' does not exist`),qf(!this._editors.has(o.id),`editor '${o.id}' already exists!`);const a=this._documents.get(r).value,c=new Lei(o.id,this._extHostRpc.getProxy(Be.MainThreadTextEditors),this._logService,new ya(()=>a.document),o.selections.map(Fb.to),o.options,o.visibleRanges.map(l=>et.to(l)),typeof o.editorPosition=="number"?El.to(o.editorPosition):void 0);this._editors.set(o.id,c)}e.newActiveEditor!==void 0&&(qf(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),bt(t),bt(n),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 hi.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()]}};Gke=D([_(0,Jo),_(1,Ge)],Gke);const GU=ae("IExtHostDocumentsAndEditors"),KU=ae("IExtHostTerminalService");class h9e extends V{constructor(e,t,i,n){super(),this._proxy=e,this._id=t,this._creationOptions=i,this._name=n,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:Qst(e.iconPath)??void 0,color:M2.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,n,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:n,color:M2.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:El.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 Vue{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:Ng.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:Ng.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let Mei=1,Kke=class extends V{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 wn),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(Be.MainThreadTerminalService),this._bufferer=new Hnt(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:n=>{const o=r=>{const a=r;return this.getTerminalById(a.instanceId)?.value};switch(n?.$mid){case ws.TerminalContext:return o(n);default:{if(Array.isArray(n))for(let r=0;r{for(const[n,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 h9e(this._proxy,ar(),e,e.name),n=new Vue(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,Qst(e.iconPath),Pei(e.color)).then(o=>{const r=this._setupExtHostProcessListeners(o,n);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 n=this._terminals.find(o=>o.value===i);n&&(t.resolvedExtHostIdentifier=n._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 n=new Vue(t),o=this._setupExtHostProcessListeners(e,n);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 n=this.getTerminalById(e);n&&n.setDimensions(t,i)&&this._onDidChangeTerminalDimensions.fire({terminal:n.value,dimensions:n.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 n=this._getTerminalObjectIndexById(this._terminals,e);if(n!==null){const o=this._terminals.splice(n,1)[0];o.setExitStatus(t,i),this._onDidCloseTerminal.fire(o.value)}}$acceptTerminalOpened(e,t,i,n){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:n.name,shellPath:n.executable,shellArgs:n.args,cwd:typeof n.cwd=="string"?n.cwd:N.revive(n.cwd),env:n.env,hideFromUser:n.hideFromUser},r=new h9e(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(573,"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 n=this._terminalProcesses.get(e);n?n.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 n=this._extensionTerminalAwaitingStart[e];return n&&t instanceof Vue&&(t.startSendingEvents(n.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(n){if(n.code!=="EPIPE"&&n.code!=="ERR_IPC_CHANNEL_CLOSED")throw n}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Ng.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:Ng.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new Qs(()=>{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 Qs(()=>{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 Qs(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new ci().token;if(i.isCancellationRequested)return;const n=this._quickFixProviders.get(e);if(!n)return;const o=await n.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?cie.from(o,this._extHostCommands.converter,r):void 0;const a=[];for(const c of o){const l=cie.from(c,this._extHostCommands.converter,r);l&&a.push(l)}return a}async $createContributedProfileTerminal(e,t){const i=new ci().token;let n=await this._profileProviders.get(e)?.provideTerminalProfile(i);if(!i.isCancellationRequested){if(n&&!("options"in n)&&(n={options:n}),!n||!("options"in n))throw new Error(`No terminal profile options provided for id "${e}"`);if("pty"in n.options){this.createExtensionTerminal(n.options,t);return}this.createTerminalFromOptions(n.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 ci;this._terminalLinkCancellationSource.set(e,o);const r=[],a={terminal:i.value,line:t},c=[];for(const h of this._linkProviders)c.push(Zs.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:Mei++,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(n=>n._id===t);return i>=0?i:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=this._register(new u9e),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=Unt(t.map),n=yQt(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,i.length===0?void 0:i,n)}$initEnvironmentVariableCollections(e){e.forEach(t=>{const i=t[0],n=this._register(new u9e(t[1]));this._setEnvironmentVariableCollection(i,n)})}$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),this._register(t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)}))}};Kke=D([_(1,KN),_(2,Jo)],Kke);class u9e extends V{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){super(),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 Nei(this,e),this.scopedCollections.set(t,i),this._register(i.onDidChangeCollection(()=>this._onDidChangeCollection.fire()))),i}replace(e,t,i,n){this._setIfDiffers(e,{value:t,type:FT.Replace,options:i??{applyAtProcessCreation:!0},scope:n})}append(e,t,i,n){this._setIfDiffers(e,{value:t,type:FT.Append,options:i??{applyAtProcessCreation:!0},scope:n})}prepend(e,t,i,n){this._setIfDiffers(e,{value:t,type:FT.Prepend,options:i??{applyAtProcessCreation:!0},scope:n})}_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),n=this.map.get(i),o=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!n||n.value!==t.value||n.type!==t.type||n.options?.applyAtProcessCreation!==o.applyAtProcessCreation||n.options?.applyAtShellIntegration!==o.applyAtShellIntegration||n.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),n=this.map.get(i);return n?g9e(n):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,n]of this.map)this.getScopeKey(n.scope)===this.getScopeKey(e)&&t.set(n.variable,g9e(n));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),n=this.descriptionMap.get(i);if(!n||n.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 Gei{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,n)=>e.call(t,n,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 Zke=class extends Xke{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new rS}createTerminalFromOptions(e,t){throw new rS}};Zke=D([_(0,YN),_(1,Jo)],Zke);function iot(s){if(!(!s||typeof s=="string"))return"id"in s?{id:s.id,color:s.color}:s}function Kei(s){return O2.isThemeColor(s)?s:void 0}function E9e(s){const e={...s};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const rle=ae("IExtHostApiDeprecationService");let eIe=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(Be.MainThreadTelemetry)}report(e,t,i){const n=this.getUsageKey(e,t);this._reportedUsages.has(n)||(this._reportedUsages.add(n),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}`}};eIe=D([_(0,Jo),_(1,Ge)],eIe);var ine;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(ine||(ine={}));var nne;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(nne||(nne={}));var tIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(tIe||(tIe={}));var Ez;(function(s){function e(n){if(n){const o=n;return o&&!!o.process}else return!1}s.is=e;function t(n){if(n==null)return;const o={process:n.process,args:n.args};return n.options&&(o.options=tIe.from(n.options)),o}s.from=t;function i(n){if(n!=null)return new oN(n.process,n.args,n.options)}s.to=i})(Ez||(Ez={}));var iIe;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(iIe||(iIe={}));var xz;(function(s){function e(n){if(n){const o=n;return o&&(!!o.commandLine||!!o.command)}else return!1}s.is=e;function t(n){if(n==null)return;const o={};return n.commandLine!==void 0?o.commandLine=n.commandLine:(o.command=n.command,o.args=n.args),n.options&&(o.options=iIe.from(n.options)),o}s.from=t;function i(n){if(!(n==null||n.command===void 0&&n.commandLine===void 0))return n.commandLine?new gI(n.commandLine,n.options):new gI(n.command,n.args?n.args:[],n.options)}s.to=i})(xz||(xz={}));var _A;(function(s){function e(n){if(n){const o=n;return o&&o.customExecution==="customExecution"}else return!1}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n,o){return o.get(n)}s.to=i})(_A||(_A={}));var nIe;(function(s){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}s.from=e})(nIe||(nIe={}));var Kx;(function(s){function e(n,o){if(n==null)return[];const r=[];for(const a of n){const c=t(a,o);c&&r.push(c)}return r}s.fromMany=e;function t(n,o){if(n==null)return;let r;n.execution instanceof oN?r=Ez.from(n.execution):n.execution instanceof gI?r=xz.from(n.execution):n.execution&&n.execution instanceof Fce&&(r=_A.from(n.execution));const a=ine.from(n.definition);let c;return n.scope?typeof n.scope=="number"?c=n.scope:c=n.scope.uri:c=fI.Workspace,!a||!c?void 0:{_id:n._id,definition:a,name:n.name,source:{extensionId:o.identifier.value,label:n.source,scope:c},execution:r,isBackground:n.isBackground,group:nIe.from(n.group),presentationOptions:nne.from(n.presentationOptions),problemMatchers:n.problemMatchers,hasDefinedMatchers:n.hasDefinedMatchers,runOptions:n.runOptions?n.runOptions:{reevaluateOnRerun:!0},detail:n.detail}}s.from=t;async function i(n,o,r){if(n==null)return;let a;Ez.is(n.execution)?a=Ez.to(n.execution):xz.is(n.execution)?a=xz.to(n.execution):_A.is(n.execution)&&(a=_A.to(n._id,r));const c=ine.to(n.definition);let l;if(n.source&&(n.source.scope!==void 0?typeof n.source.scope=="number"?l=n.source.scope:l=await o.resolveWorkspaceFolder(N.revive(n.source.scope)):l=fI.Workspace),!c||!l)return;const d=new z9(c,l,n.name,n.source.label,a,n.problemMatchers);return n.isBackground!==void 0&&(d.isBackground=n.isBackground),n.group!==void 0&&(d.group=cH.from(n.group._id),d.group&&n.group.isDefault&&(d.group=new cH(d.group.id,d.group.label),n.group.isDefault===!0&&(d.group.isDefault=n.group.isDefault))),n.presentationOptions&&(d.presentationOptions=nne.to(n.presentationOptions)),n._id&&(d._id=n._id),n.detail&&(d.detail=n.detail),d}s.to=i})(Kx||(Kx={}));var sIe;(function(s){function e(i){return i}s.from=e;function t(i){if(i)return Object.assign(Object.create(null),i)}s.to=t})(sIe||(sIe={}));var _7;class Yue{constructor(e,t,i){Wt(this,_7);this._id=t,this._task=i,Ct(this,_7,e)}get task(){return this._task}terminate(){Ce(this,_7).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}_7=new WeakMap;let oIe=class{constructor(e,t,i,n,o,r,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(Be.MainThreadTask),this._workspaceProvider=i,this._editorService=n,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 Qs(()=>{});const n=this.nextHandle();return this._handlers.set(n,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(n,t),new Qs(()=>{this._handlers.delete(n),this._proxy.$unregisterTaskProvider(n)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(sIe.from(e)).then(async t=>{const i=[];for(const n of t){const o=await Kx.to(n,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 Yue))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 n=this._providedCustomExecutions2.get(e.id);n&&(this._activeCustomExecutions2.set(e.id,n),this._terminalService.attachPtyToTerminal(t,await n.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 n=[],o=jh(()=>i.provider.provideTasks(He.None)).then(r=>this.provideTasksInternal(t,n,i,r));return new Promise(r=>{o.then(a=>{Promise.all(n).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 n=await Kx.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!n)throw new Error("Unexpected: Task cannot be resolved.");const o=await i.provider.resolveTask(n,He.None);if(!o)return;this.checkDeprecation(o,i);const r=Kx.from(o,i.extension);if(!r)throw new Error("Unexpected: Task cannot be resolved.");if(o.definition!==n.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 _A.is(r.execution)&&await this.addCustomExecution(r,o,!0),await this.resolveTaskInternal(r)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,i){const n=await this._proxy.$createTaskId(e);!i&&!this._providedCustomExecutions2.has(n)&&(this._notProvidedCustomExecutions.add(n),this._activeCustomExecutions2.set(n,t.execution)),this._providedCustomExecutions2.set(n,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){const o=this._taskExecutionPromises.get(e);if(!o)throw new La("Unexpected: The specified task is missing an execution");return o}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let n;return t?n=Promise.resolve(new Yue(this,e.id,t)):n=Kx.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(o=>{if(!o)throw new La("Unexpected: Task does not exist.");return new Yue(this,e.id,o)}),this._taskExecutionPromises.set(e.id,n),n.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 n=i.next();for(;!n.done;)!this._activeCustomExecutions2.has(n.value)&&this._lastStartedTask!==n.value&&(this._providedCustomExecutions2.delete(n.value),this._notProvidedCustomExecutions.delete(n.value)),n=i.next()}};oIe=D([_(0,Jo),_(1,_u),_(2,oE),_(3,YU),_(4,rE),_(5,JU),_(6,Ge),_(7,rle)],oIe);let rIe=class extends oIe{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,o,r,a,c),this.registerTaskSystem(pe.vscodeRemote,{scheme:pe.vscodeRemote,authority:"",platform:Srt(Kd.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=Kx.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(_A.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new rS;const n=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(o=>{throw new Error(o)}),n}provideTasksInternal(e,t,i,n){const o=[];if(n)for(const r of n){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=Kx.from(r,i.extension);a&&_A.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(_A.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){}};rIe=D([_(0,Jo),_(1,_u),_(2,oE),_(3,YU),_(4,rE),_(5,JU),_(6,Ge),_(7,rle)],rIe);const not=ae("IExtHostTask"),fG=ae("IExtHostEditorTabs");class x9e{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 ha.TextInput:return new Bce(N.revive(this._dto.input.uri));case ha.TextDiffInput:return new c$(N.revive(this._dto.input.original),N.revive(this._dto.input.modified));case ha.TextMergeInput:return new jNe(N.revive(this._dto.input.base),N.revive(this._dto.input.input1),N.revive(this._dto.input.input2),N.revive(this._dto.input.result));case ha.CustomEditorInput:return new Wce(N.revive(this._dto.input.uri),this._dto.input.viewType);case ha.WebviewEditorInput:return new YNe(this._dto.input.viewType);case ha.NotebookInput:return new Hce(N.revive(this._dto.input.uri),this._dto.input.notebookType);case ha.NotebookDiffInput:return new Uce(N.revive(this._dto.input.original),N.revive(this._dto.input.modified),this._dto.input.notebookType);case ha.TerminalEditorInput:return new JNe;case ha.InteractiveEditorInput:return new XNe(N.revive(this._dto.input.uri),N.revive(this._dto.input.inputBoxUri));case ha.ChatEditorInput:return new ZNe;case ha.MultiDiffEditorInput:return new ePe(this._dto.input.diffEditors.map(e=>new c$(N.revive(e.original),N.revive(e.modified))));default:return}}}class qei{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 x9e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return xl.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===fh.TAB_OPEN){const i=new x9e(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===fh.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===fh.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 aIe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(Be.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 qn(e._extHostTabGroups.find(o=>o.groupId===i)?.apiObject)},close:async(i,n)=>{const o=Array.isArray(i)?i:[i];return o.length?Qei(o[0])?this._closeGroups(o,n):this._closeTabs(o,n):!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)),n=Sre(t,i),o=this._extHostTabGroups.filter(l=>n.removed.includes(l.groupId)).map(l=>l.apiObject),r=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new qei(l,()=>this._activeGroupId);return n.added.includes(d.groupId)?r.push(d.apiObject):a.push(d.apiObject),d});const c=qn(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(n=>n.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 fh.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case fh.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case fh.TAB_MOVE:case fh.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 n of e){const o=this._findExtHostTabFromApi(n);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 n of e){const o=this._findExtHostTabGroupFromApi(n);if(!o)throw new Error("Group close: Invalid group not found!");i.push(o.groupId)}return this._proxy.$closeGroup(i,t)}};aIe=D([_(0,Jo)],aIe);function Qei(s){return s.tabs!==void 0}const ore=class ore{constructor(e,t,i,n){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=n}};ore.NONE=new ore(!1,-1,-1,-1);let qH=ore;class D9e{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 qH(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 ale{constructor(e,t,i,n,o,r){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=n,this.exports=o,this.disposable=r}}class jei extends ale{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,V.None)}}class Yei extends ale{constructor(){super(!1,null,qH.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}class sne extends ale{constructor(e){super(!0,e,qH.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}let cIe=class{constructor(e,t,i,n){this._logService=n,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new va,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(n=>({id:n.identifier,reason:{startup:t,extensionId:n.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 sne(o));return this._host.onExtensionActivationError(e.id,o,new vHe(e.id.value)),r}const i=[],n=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const o of n){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 sne(l));return this._host.onExtensionActivationError(t.identifier,l,new vHe(o)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,n){const o=new lIe(e.id,t,e.reason,i,n,this._host,this._logService);return this._operations.set(e.id,o),o}_isHostExtension(e){return pD.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};cIe=D([_(3,Ge)],cIe);let lIe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,n,o,r,a){this._id=e,this._displayName=t,this._reason=i,this._deps=n,this._value=o,this._host=r,this._logService=a,this._barrier=new qd,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 sne(t),this._isDisposed&&Fr(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)}}};lIe=D([_(6,Ge)],lIe);class sot{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(Be.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const n=await this._proxy.$initializeExtensionStorage(e,t);let o;return n&&(o=this.safeParseValue(e,t,n)),o||i}setValue(e,t,i){return this._proxy.$setValue(e,t,i)}$acceptValue(e,t,i){const n=this.safeParseValue(e,t,i);n&&this._onDidChangeStorage.fire({shared:e,key:t,value:n})}safeParseValue(e,t,i){try{return JSON.parse(i)}catch(n){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${n}`)}}}const LPe=ae("IExtHostStorage");class oot{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(n=>(this._value=n,this)),this._storageListener=this._storage.onDidChangeStorage(n=>{n.shared===this._shared&&n.key===this._id&&(this._value=n.value)}),this._scheduler=new cn(()=>{const n=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const o of n.values())o.complete()}catch(o){for(const r of n.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 n=new dc;return this._deferredPromises.set(e,n),this._scheduler.isScheduled()||this._scheduler.schedule(),n.p}dispose(){this._storageListener.dispose()}}class Jei extends oot{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 RPe=ae("IExtensionStoragePaths");let dIe=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(n=>this._value=n)}async _getWorkspaceStorageURI(e){return N.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(N.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:N.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 N.joinPath(this._value,e.identifier.value)}globalValue(e){return N.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};dIe=D([_(0,_u),_(1,Ge),_(2,nle)],dIe);const MPe=ae("IExtHostAuthentication");let hIe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new Xei,this._proxy=e.getProxy(Be.MainThreadAuthentication)}async getSession(e,t,i,n={}){const o=Sn.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,n)})}async getAccounts(e){return await this._proxy.$ensureProvider(e),await this._proxy.$getAccounts(e)}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,n){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:n??{supportsMultipleAccounts:!1}});const o=i.onDidChangeSessions(r=>this._proxy.$sendDidChangeSessions(e,r));return this._proxy.$registerAuthenticationProvider(e,t,n?.supportsMultipleAccounts??!1),new Qs(()=>{o.dispose(),this._authenticationProviders.delete(e),this._proxy.$unregisterAuthenticationProvider(e)})}async $createSession(e,t,i){const n=this._authenticationProviders.get(e);if(n)return await n.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,i){const n=this._authenticationProviders.get(e);if(n)return await n.provider.getSessions(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)}$onDidChangeAuthenticationSessions(e,t){return e.startsWith(zce)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};hIe=D([_(0,Jo)],hIe);class Xei{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){const i=this._inFlightPromises.get(e);if(i)return i;const n=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,n),n}}var uIe;const NPe=ae("IExtHostLanguageModels");class k9e{constructor(e,t){this.option=e,this.stream=new P2,this.stream=t??new P2}}class Zei{constructor(){this._responseStreams=new Map,this._defaultStream=new P2,this._isDone=!1;const e=this;this.apiObject={get stream(){return e._defaultStream.asyncIterable},get text(){return Qd.map(e._defaultStream.asyncIterable,t=>{if(t instanceof kH)return t.value}).coalesce()}}}*_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;let t=this._responseStreams.get(e.index);t||(this._responseStreams.size===0?t=new k9e(e.index,this._defaultStream):t=new k9e(e.index),this._responseStreams.set(e.index,t));let i;e.part.type==="text"?i=new kH(e.part.value):i=new Vce(e.part.name,e.part.parameters),t.stream.emitOne(i)}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 cM;let gIe=(cM=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 va,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(Be.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,n){const o=uIe._idPool++;this._languageModels.set(o,{extension:e.identifier,provider:i,languageModelId:t});let r;n.auth&&(r={providerLabel:e.displayName||e.name,accountLabel:typeof n.auth=="object"?n.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(o,`${Sn.toKey(e.identifier)}/${o}/${t}`,{extension:e.identifier,id:t,vendor:n.vendor??Sn.toKey(e.identifier),name:n.name??"",family:n.family??"",version:n.version,maxInputTokens:n.maxInputTokens,maxOutputTokens:n.maxOutputTokens,auth:r,targetExtensions:n.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new Sn(c),l,d)});return Ee(()=>{this._languageModels.delete(o),this._proxy.$unregisterProvider(o),a?.dispose()})}async $startChatRequest(e,t,i,n,o,r){const a=this._languageModels.get(e);if(!a)throw new Error("Provider not found");const c=new lu(async d=>{if(r.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let h;if(d.part instanceof Vce?h={type:"function_use",name:d.part.name,parameters:d.part.parameters}:d.part instanceof kH&&(h={type:"text",value:d.part.value}),!h){this._logService.warn(`[CHAT](${a.extension.value}) UNKNOWN part ${JSON.stringify(d)}`);return}this._proxy.$reportResponsePart(t,{index:d.index,part:h})});let l;if(a.provider.provideLanguageModelResponse2)l=Promise.resolve(a.provider.provideLanguageModelResponse2(n.map(IF.to),o,Sn.toKey(i),c,r));else{const d=new lu(async h=>{c.report({index:h.index,part:new kH(h.part)})});l=Promise.resolve(a.provider.provideLanguageModelResponse(n.map(IF.to),o?.modelOptions??{},Sn.toKey(i),d,r))}l.then(()=>{this._proxy.$reportResponseDone(t,void 0)},d=>{this._proxy.$reportResponseDone(t,SA(d))})}$provideTokenLength(e,t,i){const n=this._languageModels.get(e);return n?Promise.resolve(n.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 va});if(e.removed)for(const t of e.removed){this._allLanguageModelData.delete(t);for(const[i,n]of this._pendingRequest)n.languageModelId===t&&(n.res.reject(new Ma),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}),n=[],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 Mw.NotFound(r);return o._computeTokenLength(r,l,d??He.None)},sendRequest(l,d,h){if(!o._allLanguageModelData.has(r))throw Mw.NotFound(r);return o._sendChatRequest(e,r,l,d??{},h??He.None)}},a.apiObjects.set(e.identifier,c)),n.push(c)}return n}async _sendChatRequest(e,t,i,n,o){const r=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw Mw.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,c)&&(!await this._getAuthAccess(e,{identifier:c.extension,displayName:c.auth.providerLabel},n.justification,!1)||!this._modelAccessList.get(a)?.has(c.extension)))throw Mw.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);try{const l=Math.random()*1e6|0,d=new Zei;this._pendingRequest.set(l,{languageModelId:t,res:d});try{await this._proxy.$tryStartChatRequest(a,t,l,r,n,o)}catch(h){throw this._pendingRequest.delete(l),h}return d.apiObject}catch(l){throw l.name===Mw.name?l:new Mw(`Language model '${t}' errored: ${Nr(l)}`,"Unknown",l)}}_convertMessages(e,t){const i=[];for(const n of t)n.role===Kp.System&&Ve(e,"languageModelSystem"),n.content2 instanceof h$&&Ve(e,"lmTools"),i.push(IF.from(n));return i}async $acceptResponsePart(e,t){const i=this._pendingRequest.get(e);i&&i.res.handleFragment(t)}async $acceptResponseDone(e,t){const i=this._pendingRequest.get(e);i&&(this._pendingRequest.delete(e),t?i.res.reject(l8(t)):i.res.resolve())}async _getAuthAccess(e,t,i,n){const o=zce+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(n)return!1;try{const a=i?g(577,"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&&!Sn.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 Mw.NotFound(`Language model '${e}' is unknown.`);const o=hi.find(this._languageModels.values(),r=>r.languageModelId===e);return o?o.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:IF.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:n,enabled:o}of e){const r=this._modelAccessList.get(i)??new A_;if(r.has(n)!==o){o?r.add(n):r.delete(n),this._modelAccessList.set(i,r);const c={from:i,to:n};t.push(c),this._onDidChangeModelAccess.fire(c)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);const t=this,i=M.signal(M.filter(this._onDidChangeModelAccess.event,o=>Sn.equals(o.from,e.identifier))),n=M.signal(this._onDidChangeProviders.event);return{get onDidChange(){return M.any(i,n)},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)}}}},uIe=cM,cM._idPool=1,cM);gIe=uIe=D([_(0,Jo),_(1,Ge),_(2,MPe)],gIe);class rot{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(Be.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 PPe=ae("IExtHostSecretState");var lx;class eti{constructor(e,t){Wt(this,lx);this.disposables=new Z,this._id=Sn.toKey(e.identifier),Ct(this,lx,t),this.onDidChange=M.map(M.filter(Ce(this,lx).onDidChangePassword,i=>i.extensionId===this._id),i=>({key:i.key}),this.disposables)}dispose(){this.disposables.dispose()}get(e){return Ce(this,lx).get(this._id,e)}store(e,t){return Ce(this,lx).store(this._id,e,t)}delete(e){return Ce(this,lx).delete(this._id,e)}}lx=new WeakMap;let fIe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(Be.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===S1}getMessage(e,t){const{message:i,args:n,comment:o}=t;if(this.isDefaultLanguage)return efe(i,n??{});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}`),efe(a??i,n??{})}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 n=await this._proxy.$fetchBundleContents(i),o=JSON.parse(n);t=e.isBuiltin?o.contents?.bundle:o}catch(n){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${i}: ${n.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 N.revive(t)}return e.l10n?N.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};fIe=D([_(0,_u),_(1,Jo),_(2,Ge)],fIe);const FPe=ae("IExtHostLocalizationService"),OPe=ae("IExtHostManagedSockets");let pIe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(Be.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new tti(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(),n=new Z;return this._managedRemoteSockets.set(t,new iti(t,i,n)),n.add(Ee(()=>this._managedRemoteSockets.delete(t))),n.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),n.dispose()})),n.add(i.onDidClose(o=>{this._proxy.$onDidManagedSocketClose(t,o?.stack??o?.message),n.dispose()})),n.add(i.onDidReceiveMessage(o=>this._proxy.$onDidManagedSocketHaveData(t,$e.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?.()}};pIe=D([_(0,Jo)],pIe);class tti{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class iti extends V{constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var mIe;const aot=ae("IHostUtils");let _Ie=mIe=class extends V{constructor(e,t,i,n,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=n,this._extHostConfiguration=o,this._logService=r,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(Be.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(Be.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(Be.MainThreadExtensionService),this._almostReadyToRunExtensions=new qd,this._readyToStartExtensionHost=new qd,this._readyToRunExtensions=new qd,this._eagerExtensionsActivated=new qd,this._activationEventsReader=new sti(this._initData.extensions.activationEvents),this._globalRegistry=new pD(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new A_(this._initData.extensions.myExtensions);this._myRegistry=new pD(this._activationEventsReader,cot(this._globalRegistry,p)),Wh&&(this._logService.info(`Creating extension host with the following global extensions: ${AP(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${AP(this._myRegistry)}`)),this._storage=new sot(this._extHostContext,this._logService),this._secretState=new rot(this._extHostContext),this._storagePath=c,this._instaService=this._store.add(e.createChild(new Uc([LPe,this._storage],[PPe,this._secretState]))),this._activator=this._register(new cIe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,b)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,SA(v),b)},actualActivateExtension:async(m,v)=>{if(pD.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new Yei;const b=this._myRegistry.getExtensionDescription(m);return this._activateExtension(b,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(),cs("code/extHost/ready"),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){vt(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(),c8&&qge(n=>{this._logService.error(n)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Sr(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 Sn(t.identifier.value),extensionLocation:N.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===pe.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 N.file(i)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||(this._extensionPathIndex=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new nti(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Dh.forUris(i=>EGe.ignorePathCasing(i));return await Promise.all(e.map(async i=>{if(this._getEntryPoint(i)){const n=await this._realPathExtensionUri(i.extensionLocation);t.set(n,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,n=>(this._logService.error(n),Promise.resolve(void 0))))}catch(n){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(n)}try{i.disposable.dispose()}catch(n){this._logService.error(`An error occurred when disposing the subscriptions for extension '${e.value}':`),this._logService.error(n)}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 n=i.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,n.codeLoadingTime,n.activateCallTime,n.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,"success",n),i},i=>{throw this._logExtensionActivationTimes(e,t,"failure"),i})}_logExtensionActivationTimes(e,t,i,n){const o=T9e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...o,...n||{},outcome:i})}_doActivateExtension(e,t){const i=T9e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const n=this._getEntryPoint(e);if(!n)return Promise.resolve(new jei(qH.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 Z,r=new D9e(t.startup);return Promise.all([this._loadCommonJSModule(e,Pt(e.extensionLocation,n),r),this._loadExtensionContext(e,o)]).then(a=>(cs(`code/extHost/willActivateExtension/${e.identifier.value}`),mIe._callActivate(this._logService,e.identifier,a[0],a[1],o,r))).then(a=>(cs(`code/extHost/didActivateExtension/${e.identifier.value}`),a))}_loadExtensionContext(e,t){const i=this._extHostLanguageModels.createLanguageModelAccessInformation(e),n=t.add(new Jei(e,this._storage)),o=t.add(new oot(e.identifier.value,!1,this._storage)),r=t.add(new eti(e,this._secretState)),a=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?QT.Test:QT.Development:QT.Production,c=this._initData.remote.isRemote?bD.Workspace:bD.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([n.whenReady,o.whenReady,this._storagePath.whenReady]).then(()=>{const l=this;let d,h;const u=dl(e,"ipc")?this._initData.messagePorts?.get(Sn.toKey(e.identifier)):void 0;return Object.freeze({globalState:n,workspaceState:o,secrets:r,subscriptions:[],get languageModelAccessInformation(){return i},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(f){return cfe(e.extensionLocation.fsPath,f)},get storagePath(){return l._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return l._storagePath.globalValue(e).fsPath},get logPath(){return cfe(l._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return N.joinPath(l._initData.logsLocation,e.identifier.value)},get storageUri(){return l._storagePath.workspaceValue(e)},get globalStorageUri(){return l._storagePath.globalValue(e)},get extensionMode(){return a},get extension(){return d===void 0&&(d=new UV(l,e.identifier,e,c,!1)),d},get extensionRuntime(){return Ve(e,"extensionRuntime"),l.extensionRuntime},get environmentVariableCollection(){return l._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!h){if(!u)return;const f=M.buffer(M.fromDOMEventEmitter(u,"message",p=>p.data));u.start(),h={onDidReceiveMessage:f,postMessage:u.postMessage.bind(u)}}return h}})})}static _callActivate(e,t,i,n,o,r){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,n,r).then(a=>new ale(!1,null,r.build(),i,a,Ee(()=>{o.dispose(),bt(n.subscriptions)})))}static _callActivateOptional(e,t,i,n,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,[n]);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 n=Date.now();V1e(()=>{for(let o=t;o50){this._activateAllStartupFinishedDeferred(e,o);break}else this._activateOneStartupFinished(r,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(bEt()),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 n of i)if(n.activationEvents)for(const o of n.activationEvents)o==="onStartupFinished"&&this._activateOneStartupFinished(n,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),n=this._handleRemoteResolverEagerExtensions(),o=Promise.all([n,e,i]).then(()=>{});return Promise.race([o,Sr(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,n={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 Bit(n,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(442,"Cannot load test runner."));const i=await this._loadCommonJSModule(null,t,new D9e(!1));if(!i||typeof i.run!="function")throw new Error(g(443,"Path {0} does not point to a valid extension test runner.",t.toString()));return new Promise((n,o)=>{const r=(l,d)=>{l?(Wh&&this._logService.error("Test runner called back with error",l),o(l)):(Wh&&(d?this._logService.info(`Test runner called back with ${d} failures.`):this._logService.info("Test runner called back with successful outcome.")),n(typeof d=="number"&&d>0?1:0))},a=Zm(t),c=i.run(a,r);c&&c.then&&c.then(()=>{Wh&&this._logService.info("Test runner finished successfully."),n(0)}).catch(l=>{Wh&&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(),Sr(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 t1("Not an authority that can be resolved!",ed.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=js.create(!1),n=()=>`[resolveAuthority(${uee(e)},${t})][${i.elapsed()}ms] `,o=w=>this._logService.info(`${n()}${w}`),r=w=>this._logService.warn(`${n()}${w}`),a=(w,y=void 0)=>this._logService.error(`${n()}${w}`,y),c=w=>{if(w instanceof t1)return{type:"error",error:{code:w._code,message:w._message,detail:w._detail}};throw w},l=async w=>{o(`activating resolver for ${w}...`);const{resolver:y,authorityPrefix:C}=await this._activateAndGetResolver(w);if(!y)throw a(`no resolver for ${C}`),new t1(`No remote extension installed to resolve ${C}.`,ed.NoResolverFound);return{resolver:y,authorityPrefix:C,remoteAuthority:w}},d=e.split(/@|%40/g).reverse();o(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async w=>{if(!(w instanceof t1)||w._code!==ed.InvalidAuthority)throw w;return r(`resolving nested authorities failed: ${w.message}`),[await l(e)]})}catch(w){return c(w)}const u=new J7;u.cancelAndSet(()=>o("waiting..."),1e3);let f,p;for(const[w,{authorityPrefix:y,resolver:C,remoteAuthority:A}]of h.entries())try{if(w===h.length-1)o("invoking final resolve()..."),cs(`code/extHost/willResolveAuthority/${y}`),f=await C.resolve(A,{resolveAttempt:t,execServer:p}),cs(`code/extHost/didResolveAuthorityOK/${y}`),o("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(C,sz.isManagedResolvedAuthority(f)?f:void 0));else{if(o(`invoking resolveExecServer() for ${A}`),cs(`code/extHost/willResolveExecServer/${y}`),p=await C.resolveExecServer?.(A,{resolveAttempt:t,execServer:p}),!p)throw new t1(`Exec server was not available for ${A}`,ed.NoResolverFound);cs(`code/extHost/didResolveExecServerOK/${y}`)}}catch(L){return cs(`code/extHost/didResolveAuthorityError/${y}`),a("returned an error",L),u.dispose(),c(L)}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 ${sz.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let b;if(sz.isManagedResolvedAuthority(f)){const w=t;this._extHostManagedSockets.setFactory(w,f.makeConnection),b={authority:e,connectTo:new xit(w),connectionToken:f.connectionToken}}else b={authority:e,connectTo:new Dit(f.host,f.port),connectionToken:f.connectionToken};return{type:"ok",value:{authority:b,options:v,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${uee(e)})`);const{resolver:i}=await this._activateAndGetResolver(e);if(!i)return null;const n=N.revive(t);if(typeof i.getCanonicalURI>"u")return n;const o=await jh(()=>i.getCanonicalURI(n));return o||n}async $startExtensionHost(e){e.toAdd.forEach(r=>r.extensionLocation=N.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=I9e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),n=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(n),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Wh&&(this._logService.info(`$startExtensionHost: global extensions: ${AP(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${AP(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===Nb.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=N.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=I9e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),n=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(n),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Wh&&(this._logService.info(`$deltaExtensions: global extensions: ${AP(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${AP(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=$e.alloc(e),i=Math.random()%256;for(let n=0;na.identifier));for(const a of i.myToRemove)o.delete(a);for(const a of i.myToAdd)o.add(a);const r=cot(n,o);return{globalRegistry:n,myExtensions:r}}function T9e(s,e){return{id:s.identifier.value,name:s.name,extensionVersion:s.version,publisherDisplayName:s.publisher,activationEvents:s.activationEvents?s.activationEvents.join(","):null,isBuiltin:s.isBuiltin,reason:e.activationEvent,reasonId:e.extensionId.value}}function AP(s){return s.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const MI=ae("IExtHostExtensionService");var Q1,v7,j1;class UV{constructor(e,t,i,n,o){Wt(this,Q1);Wt(this,v7);Wt(this,j1);Ct(this,Q1,e),Ct(this,v7,t),Ct(this,j1,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=Rk(Zm(i.extensionLocation)),this.packageJSON=i,this.extensionKind=n,this.isFromDifferentExtensionHost=o}get isActive(){return Ce(this,Q1).isActivated(Ce(this,j1))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return Ce(this,Q1).getExtensionExports(Ce(this,j1))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await Ce(this,Q1).activateByIdWithErrors(Ce(this,j1),{startup:!1,extensionId:Ce(this,v7),activationEvent:"api"}),this.exports}}Q1=new WeakMap,v7=new WeakMap,j1=new WeakMap;function cot(s,e){return s.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class nti{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 sti{constructor(e){this._map=new va,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])}}const BPe=ae("IExtHostVariableResolverProvider");class oti extends jie{constructor(e,t,i,n,o,r,a){function c(){if(i){const l=i.activeEditor();if(l)return l.document.uri;const d=n.tabGroups.all.find(h=>h.isActive)?.activeTab;if(d!==void 0){if(d.input instanceof c$||d.input instanceof Uce)return d.input.modified;if(d.input instanceof Bce||d.input instanceof Hce||d.input instanceof Wce)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:()=>x2(),getExecPath:()=>D2.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return Rk(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return Rk(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(D2))}}let vIe=class extends V{constructor(e,t,i,n,o){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=n,this.editorTabs=o,this._resolver=new ya(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 oti(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,r,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};vIe=D([_(0,MI),_(1,oE),_(2,YU),_(3,rE),_(4,fG)],vIe);var L9e;(function(s){s.ViewletId="workbench.view.extension.test",s.ExplorerViewId="workbench.view.testing",s.OutputPeekContributionId="editor.contrib.testingOutputPeek",s.DecorationsContributionId="editor.contrib.testingDecorations",s.CoverageDecorationsContributionId="editor.contrib.coverageDecorations",s.CoverageViewId="workbench.view.testCoverage",s.ResultsPanelId="workbench.panel.testResults",s.ResultsViewId="workbench.panel.testResults.view",s.MessageLanguageId="vscodeInternalTestMessage"})(L9e||(L9e={}));var R9e;(function(s){s.List="list",s.Tree="true"})(R9e||(R9e={}));var M9e;(function(s){s.ByLocation="location",s.ByStatus="status",s.ByDuration="duration"})(M9e||(M9e={}));Hn.Errored+"",g(4063,"Errored"),Hn.Failed+"",g(4064,"Failed"),Hn.Passed+"",g(4065,"Passed"),Hn.Queued+"",g(4066,"Queued"),Hn.Running+"",g(4067,"Running"),Hn.Skipped+"",g(4068,"Skipped"),Hn.Unset+"",g(4069,"Not yet run");Kh.Debug+"",g(4071,"Debug"),Kh.Run+"",g(4072,"Run"),Kh.Coverage+"",g(4073,"Coverage");var bIe;(function(s){s.CancelTestRefreshAction="testing.cancelTestRefresh",s.CancelTestRunAction="testing.cancelRun",s.ClearTestResultsAction="testing.clearTestResults",s.CollapseAllAction="testing.collapseAll",s.ConfigureTestProfilesAction="testing.configureProfile",s.ContinousRunUsingForTest="testing.continuousRunUsingForTest",s.CoverageAtCursor="testing.coverageAtCursor",s.CoverageByUri="testing.coverage.uri",s.CoverageClear="testing.coverage.close",s.CoverageCurrentFile="testing.coverageCurrentFile",s.CoverageFilterToTest="testing.coverageFilterToTest",s.CoverageFilterToTestInEditor="testing.coverageFilterToTestInEditor",s.CoverageLastRun="testing.coverageLastRun",s.CoverageSelectedAction="testing.coverageSelected",s.CoverageToggleToolbar="testing.coverageToggleToolbar",s.CoverageViewChangeSorting="testing.coverageViewChangeSorting",s.DebugAction="testing.debug",s.DebugAllAction="testing.debugAll",s.DebugAtCursor="testing.debugAtCursor",s.DebugByUri="testing.debug.uri",s.DebugCurrentFile="testing.debugCurrentFile",s.DebugFailedTests="testing.debugFailTests",s.DebugLastRun="testing.debugLastRun",s.DebugSelectedAction="testing.debugSelected",s.FilterAction="workbench.actions.treeView.testExplorer.filter",s.GetExplorerSelection="_testing.getExplorerSelection",s.GetSelectedProfiles="testing.getSelectedProfiles",s.GoToTest="testing.editFocusedTest",s.GoToRelatedTest="testing.goToRelatedTest",s.PeekRelatedTest="testing.peekRelatedTest",s.GoToRelatedCode="testing.goToRelatedCode",s.PeekRelatedCode="testing.peekRelatedCode",s.HideTestAction="testing.hideTest",s.OpenCoverage="testing.openCoverage",s.OpenOutputPeek="testing.openOutputPeek",s.RefreshTestsAction="testing.refreshTests",s.ReRunFailedTests="testing.reRunFailTests",s.ReRunLastRun="testing.reRunLastRun",s.RunAction="testing.run",s.RunAllAction="testing.runAll",s.RunAllWithCoverageAction="testing.coverageAll",s.RunAtCursor="testing.runAtCursor",s.RunByUri="testing.run.uri",s.RunCurrentFile="testing.runCurrentFile",s.RunSelectedAction="testing.runSelected",s.RunUsingProfileAction="testing.runUsing",s.RunWithCoverageAction="testing.coverage",s.SearchForTestExtension="testing.searchForTestExtension",s.SelectDefaultTestProfiles="testing.selectDefaultTestProfiles",s.ShowMostRecentOutputAction="testing.showMostRecentOutput",s.StartContinousRun="testing.startContinuousRun",s.StopContinousRun="testing.stopContinuousRun",s.TestingSortByDurationAction="testing.sortByDuration",s.TestingSortByLocationAction="testing.sortByLocation",s.TestingSortByStatusAction="testing.sortByStatus",s.TestingViewAsListAction="testing.viewAsList",s.TestingViewAsTreeAction="testing.viewAsTree",s.ToggleContinousRunForTest="testing.toggleContinuousRunForTest",s.ToggleInlineTestOutput="testing.toggleInlineTestOutput",s.UnhideAllTestsAction="testing.unhideAllTests",s.UnhideTestAction="testing.unhideTest"})(bIe||(bIe={}));let rti=0;const N9e=new WeakMap,cle=ae("IExtHostTesting");let wIe=class extends V{constructor(e,t,i,n){super(),this.logService=t,this.commands=i,this.editors=n,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(Be.MainThreadTesting),this.observer=new uti(this.proxy),this.runTracker=new lti(this.proxy,t),i.registerArgumentProcessor({processArgument:o=>{switch(o?.$mid){case ws.TestItemContext:{const r=o,a=r.tests[r.tests.length-1].item.extId;return this.controllers.get(vn.root(a))?.collection.tree.get(a)?.actual??C9e(o)}case ws.TestMessageMenuArgs:{const{test:r,message:a}=o,c=r.item.extId;return{test:this.controllers.get(vn.root(c))?.collection.tree.get(c)?.actual??C9e({$mid:ws.TestItemContext,tests:[r]}),message:VH.to(a)}}default:return o}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const o=await i.executeCommand(bIe.GetExplorerSelection),r=a=>{const c=this.controllers.get(vn.root(a));if(c)return vn.isRoot(a)?c.controller:c.collection.tree.get(a)?.actual};return{include:o?.include.map(r).filter(Fc)||[],exclude:o?.exclude.map(r).filter(Fc)||[]}})}createTestController(e,t,i,n){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 Nei(t,i,this.editors));r.root.label=i;const a=new Map,c=new Set,l=this.proxy,d=()=>{let f=0;n&&(f|=cz.Refresh);const p=u.relatedCodeProvider;return p&&(p?.provideRelatedTests&&(f|=cz.TestRelatedToCode),p?.provideRelatedCode&&(f|=cz.CodeRelatedToTest)),f},h={items:r.root.children,get label(){return i},set label(f){i=f,r.root.label=f,l.$updateController(t,{label:i})},get refreshHandler(){return n},set refreshHandler(f){n=f,l.$updateController(t,{capabilities:d()})},get id(){return t},get relatedCodeProvider(){return u.relatedCodeProvider},set relatedCodeProvider(f){Ve(e,"testRelatedCode"),u.relatedCodeProvider=f,l.$updateController(t,{capabilities:d()})},createRunProfile:(f,p,m,v,b,w)=>{let y=Wc(f);for(;a.has(y);)y++;return new dot(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,y,f,p,m,v,b,w)},createTestItem(f,p,m){return new jN(t,f,p,m)},createTestRun:(f,p,m=!0)=>this.runTracker.createTestRun(e,t,r,f,p,m),invalidateTestResults:f=>{if(f===void 0)this.proxy.$markTestRetired(void 0);else{const p=f instanceof Array?f:[f];this.proxy.$markTestRetired(p.map(m=>vn.fromExtHostTestItem(m,t).toString()))}},set resolveHandler(f){r.resolveHandler=f},get resolveHandler(){return r.resolveHandler},dispose:()=>{o.dispose()}},u={controller:h,collection:r,profiles:a,extension:e,activeProfiles:c};return l.$registerTestController(t,i,d()),o.add(Ee(()=>l.$unregisterTestController(t))),this.controllers.set(t,u),o.add(Ee(()=>this.controllers.delete(t))),o.add(r.onDidGenerateDiff(f=>l.$publishDiff(t,f.map(MH.serialize)))),h}createTestObserver(){return this.observer.checkout()}async runTests(e,t=He.None){const i=lot(e);if(!i)throw new Error("The request passed to `vscode.test.runTests` must include a profile");const n=this.controllers.get(i.controllerId);if(!n)throw new Error("Controller not found");await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,group:WPe[i.kind],targets:[{testIds:e.include?.map(o=>vn.fromExtHostTestItem(o,n.collection.root.id).toString())??[n.collection.root.id],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)}}}async $getTestsRelatedToCode(e,t,i){const n=this.editors.getDocument(N.revive(e));if(!n)return[];const o=Yo.to(t),r=[];return await Promise.all([...this.controllers.values()].map(async a=>{let c;try{c=await a.relatedCodeProvider?.provideRelatedTests?.(n.document,o,i)}catch(l){i.isCancellationRequested||this.logService.warn(`Error thrown while providing related tests for ${a.controller.label}`,l)}if(c){for(const l of c)r.push(vn.fromExtHostTestItem(l,a.controller.id).toString());a.collection.flushDiff()}})),r}async $getCodeRelatedToTest(e,t){const i=this.controllers.get(vn.root(e));if(!i)return[];const n=i.collection.tree.get(e);return n?(await i.relatedCodeProvider?.provideRelatedCode?.(n.actual,t))?.map(hf.from)??[]:[]}$syncTests(){for(const{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t,i){return(await this.runTracker.getCoverageDetails(e,t,i))?.map(Zte.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,n]of Object.entries(e)){const o=this.controllers.get(i);if(!o)continue;const r=new Map,a=n.filter(l=>!o.activeProfiles.has(l)),c=[...o.activeProfiles].filter(l=>!n.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=exe.to(t);return N9e.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(vn.fromString(e).controllerId)?.collection;i&&(await i.expand(e,t<0?1/0:t),i.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(t=>MH.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 ci(t),n=await Promise.all(e.map(o=>this.runControllerTestRequest(o,!0,i.token)));return!t.isCancellationRequested&&!n.some(o=>o.error)&&await new Promise(o=>t.onCancellationRequested(o)),i.dispose(!0),n}async $provideTestFollowups(e,t){const i=this.results.find(r=>N9e.get(r)===e.resultId),n=i&>i(vn.fromString(e.extId),i?.results);if(!n)return[];let o=[];return await Promise.all([...this.followupProviders].map(async r=>{try{const a=await r.provideFollowup(i,n,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=rti++;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()}$cancelExtensionTestRun(e){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e)}getMetadataForRun(e){for(const t of this.runTracker.trackers){const i=t.getTaskIdForRun(e);if(i)return{taskId:i,runId:t.id}}}async runControllerTestRequest(e,t,i){const n=this.controllers.get(e.controllerId);if(!n)return{};const{collection:o,profiles:r,extension:a}=n,c=r.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>o.tree.get(f)).filter(Fc),d=e.excludeExtIds.map(f=>n.collection.tree.get(f)).filter(Fc).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===Ov.IsChild));if(!l.length)return{};const h=new a$(l.some(f=>f.actual instanceof TPe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=tQt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,t7.fromInternal(e,n.collection),c,i);try{return await c.runHandler(h,i),{}}catch(f){return{error:String(f)}}finally{u&&u.hasRunningTasks&&!i.isCancellationRequested&&await M.toPromise(u.onEnd)}}};wIe=D([_(0,Jo),_(1,Ge),_(2,YN),_(3,YU)],wIe);const ati=1e4;var UE;(function(s){s[s.Running=0]="Running",s[s.Cancelling=1]="Cancelling",s[s.Ended=2]="Ended"})(UE||(UE={}));class cti extends V{get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,n,o,r){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=n,this.extension=o,this.state=UE.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 ci(r));const a=this._register(new cn(()=>this.forciblyEndTasks(),ati));this._register(this.cts.token.onCancellationRequested(()=>a.schedule()));const c=new I;this.onDidDispose=c.event,this._register(Ee(()=>{c.fire(),c.dispose()}))}getTaskIdForRun(e){for(const[t,{run:i}]of this.tasks)if(i===e)return t}cancel(){this.state===UE.Running?(this.cts.cancel(),this.state=UE.Cancelling):this.state===UE.Cancelling&&this.forciblyEndTasks()}async getCoverageDetails(e,t,i){const[,n]=vn.fromString(e).path,o=this.publishedCoverage.get(e);if(!o)return[];const{report:r,extIds:a}=o,c=this.tasks.get(n);if(!c)throw new Error("unreachable: run task was not found");let l;if(t&&r instanceof dN){const h=a.indexOf(t);if(h===-1)return[];l=r.fromTests[h]}return await(l?this.profile?.loadDetailedCoverageForTest?.(c.run,r,l,i):this.profile?.loadDetailedCoverage?.(c.run,r,i))??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,n=ar(),o=l=>(d,...h)=>{if(a){this.logService.warn(`Setting the state of test "${d.id}" is a no-op after the run ends.`);return}this.ensureTestIsKnown(d),l(d,...h)},r=(l,d)=>{const h=d instanceof Array?d.map(VH.from):[VH.from(d)];if(l.uri&&l.range){const u={range:et.from(l.range),uri:l.uri};for(const f of h)f.location=f.location||u}this.proxy.$appendTestMessagesInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),h)};let a=!1;const c={isPersisted:this.dto.isPersisted,token:this.cts.token,name:e,onDidDispose:this.onDidDispose,addCoverage:l=>{if(a)return;const d=l instanceof dN?l.fromTests:[];if(d.length){Ve(this.extension,"attributableCoverage");for(const f of d)this.ensureTestIsKnown(f)}const h=l.uri.toString(),u=new vn([t,n,h]).toString();this.publishedCoverage.set(u,{report:l,extIds:d.map(f=>vn.fromExtHostTestItem(f,i).toString())}),this.proxy.$appendCoverage(t,n,Zte.fromFile(i,u,l))},enqueued:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Queued)}),skipped:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Skipped)}),started:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Running)}),errored:o((l,d,h)=>{r(l,d),this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Errored,h)}),failed:o((l,d,h)=>{r(l,d),this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Failed,h)}),passed:o((l,d)=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,this.dto.controllerId).toString(),Hn.Passed,d)}),appendOutput:(l,d,h)=>{a||(h&&this.ensureTestIsKnown(h),this.proxy.$appendOutputToRun(t,n,$e.fromString(l),d&&hf.from(d),h&&vn.fromExtHostTestItem(h,i).toString()))},end:()=>{a||(a=!0,this.proxy.$finishedTestRunTask(t,n),--this.running||this.markEnded())}};return this.running++,this.tasks.set(n,{run:c}),this.proxy.$startedTestRunTask(t,{id:n,ctrlId:this.dto.controllerId,name:e,running:!0}),c}forciblyEndTasks(){for(const{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==UE.Ended&&(this.state=UE.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof jN))throw new Nte(e.id);if(this.sharedTestIds.has(vn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const n=mI.from(e);if(t.unshift(n),this.sharedTestIds.has(n.extId)||(this.sharedTestIds.add(n.extId),e===i))break;e=e.parent||i}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}}class lti{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,i){const n=vn.root(e);return this.trackedById.get(n)?.getCoverageDetails(e,t,i)||[]}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,n,o){return this.getTracker(t,i,n,e,o)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,n,o,r){const a=this.tracked.get(n);if(a)return a.createRun(o);const c=t7.fromPublic(t,i,n,r),l=lot(n);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!n.continuous,profile:l&&{group:WPe[l.kind],id:l.profileId},exclude:n.exclude?.map(h=>vn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:n.include?.map(h=>vn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:n.preserveFocus??!0,persist:r});const d=this.getTracker(n,c,n.profile,e);return M.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(o)}getTracker(e,t,i,n,o){const r=new cti(t,this.proxy,this.logService,i,n,o);return this.tracked.set(e,r),this.trackedById.set(r.id,r),r}}const lot=s=>{if(s.profile){if(!(s.profile instanceof dot))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return s.profile}};class t7{static fromPublic(e,t,i,n){return new t7(e,ar(),n,t)}static fromInternal(e,t){return new t7(e.controllerId,e.runId,!0,t)}constructor(e,t,i,n){this.controllerId=e,this.id=t,this.isPersisted=i,this.colllection=n}}class dti{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,mI.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=vn.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(n=>n.revived)},get updated(){return[...t].map(n=>n.revived)},get removed(){return[...i].map(n=>n.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}}class hti extends nQt{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:mI.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new dti(this.changeEmitter)}}class uti{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:hm(()=>{--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 hti({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const M4=(s,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(s.controllerId,s.profileId,i)};var Hv,Y1,b7,Np,XB;class dot{constructor(e,t,i,n,o,r,a,c,l,d=!1,h=void 0,u=!1){Wt(this,Hv);Wt(this,Y1);Wt(this,b7);Wt(this,Np);Wt(this,XB);this.controllerId=o,this.profileId=r,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,Ct(this,Hv,e),Ct(this,XB,t),Ct(this,Y1,i),Ct(this,b7,n),t.set(r,this);const f=WPe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(r),Ct(this,Np,{profileId:r,controllerId:o,tag:h?Hb.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{Ce(this,Np)&&(Ce(this,Hv).$publishTestRunProfile(Ce(this,Np)),Ct(this,Np,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,M4(this,Ce(this,Hv),Ce(this,Np),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,M4(this,Ce(this,Hv),Ce(this,Np),{supportsContinuousRun:e}))}get isDefault(){return Ce(this,Y1).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?Ce(this,Y1).add(this.profileId):Ce(this,Y1).delete(this.profileId),M4(this,Ce(this,Hv),Ce(this,Np),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,M4(this,Ce(this,Hv),Ce(this,Np),{tag:e?Hb.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,M4(this,Ce(this,Hv),Ce(this,Np),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return M.chain(Ce(this,b7),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(Fc))}dispose(){Ce(this,XB)?.delete(this.profileId)&&(Ct(this,XB,void 0),Ce(this,Hv).$removeTestProfile(this.controllerId,this.profileId)),Ct(this,Np,void 0)}}Hv=new WeakMap,Y1=new WeakMap,b7=new WeakMap,Np=new WeakMap,XB=new WeakMap;const WPe={[jT.Coverage]:Kh.Coverage,[jT.Debug]:Kh.Debug,[jT.Run]:Kh.Run};function gti(s,e){for(let t=0;tn.id===s.path[t]);if(!i)return;if(t===s.path.length-1)return i;e=i.children}}const hot=ae("IExtHostDebugService");let yIe=class extends V{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,n,o,r,a,c){super(),this._workspaceService=t,this._extensionService=i,this._configurationService=n,this._editorTabs=o,this._variableResolver=r,this._commands=a,this._testing=c,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=this._register(new I),this._onDidTerminateDebugSession=this._register(new I),this._onDidChangeActiveDebugSession=this._register(new I),this._onDidReceiveDebugSessionCustomEvent=this._register(new I),this._debugServiceProxy=e.getProxy(Be.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new I),this._onDidChangeActiveStackItem=this._register(new I),this._activeDebugConsole=new pti(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(l=>{this._register(l.onDidChange(d=>{this.registerAllDebugTypes(l)})),this.registerAllDebugTypes(l)})}async $getVisualizerTreeItem(e,t){const i=this.hydrateVisualizationContext(t);if(!i)return;const n=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(i);return n?this.convertVisualizerTreeItem(e,n):void 0}registerDebugVisualizationTree(e,t,i){const n=Sn.toKey(e.identifier),o=this.extensionVisKey(n,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 n=await this._debugVisualizationTrees.get(i.provider)?.editItem?.(i.item,t);return this.convertVisualizerTreeItem(i.provider,n||i.item)}$disposeVisualizedTree(e){const t=this._debugVisualizationElements.get(e);if(!t)return;const i=[t.children];for(const n of i)if(n)for(const o of n)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})),lxe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let n=`debug:${encodeURIComponent(i.path||"")}`,o="?";return t&&(n+=`${o}session=${encodeURIComponent(t.id)}`,o="&"),n+=`${o}ref=${i.sourceReference}`,N.parse(n)}else{if(i.path)return N.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 n=i.contributes.debuggers;if(n&&n.length>0)for(const o of n)uqt(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:n,provider:o,extensionId:r}=i;if(n.visualization||(n=await o.resolveDebugVisualization?.(n,t)||n,i.v=n),!n.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${o}'`);return this.serializeVisualization(r,n.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,n){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,n);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 n=Sn.toKey(e.identifier),o=this.extensionVisKey(n,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(n,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(n,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=[],n=new Map;for(const o of t)if(o instanceof Ux){let r=n.get(o.location.uri.toString());r||(r={type:"sourceMulti",uri:o.location.uri,lines:[]},n.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 Vx&&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 Ux).map(r=>r.id),n=t.filter(r=>r instanceof Vx).map(r=>r.id),o=t.filter(r=>r instanceof Xee).map(r=>r.id);return this._debugServiceProxy.$unregisterBreakpoints(i,n,o)}startDebugging(e,t,i){const n=i.testRun&&this._testing.getMetadataForRun(i.testRun);return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:i.parentSession?i.parentSession.id:void 0,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.consoleMode===e$.MergeWithParent?"mergeWithParent":"separate",noDebug:i.noDebug,compact:i.compact,suppressSaveBeforeStart:i.suppressSaveBeforeStart,testRun:n&&{runId:n.runId,taskId:n.taskId},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 Qs(()=>{});const n=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:n,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,i,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,n),new Qs(()=>{this._configProviders=this._configProviders.filter(o=>o.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(n)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new Qs(()=>{});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 n=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:n,factory:i}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,n),new Qs(()=>{this._adapterFactories=this._adapterFactories.filter(o=>o.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(n)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new Qs(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new Qs(()=>{this._trackerFactories=this._trackerFactories.filter(n=>n.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let i;const n=await this.getFolder(e);return n&&(i={uri:n.uri,name:n.name,index:n.index,toResource:()=>{throw new Error("Not implemented")}}),(await this._variableResolver.getResolver()).resolveAnyAsync(i,t)}createDebugAdapter(e,t){if(e.type==="implementation")return new _ti(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,n=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(n.type),n).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}' (extension might have failed to activate)`);const r=this.convertToDto(o),a=this.createDebugAdapter(r,n);if(!a)throw new Error(`Couldn't create a debug adapter for type '${n.type}'.`);const c=a;return this._debugAdapters.set(e,c),this.getDebugAdapterTrackers(n).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=Nnt(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=Mnt(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=[],n=[];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 Vx(o.functionName,o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode);else if(o.type==="data")a=new Xee(o.label,o.dataId,o.canPersist,o.enabled,o.hitCondition,o.condition,o.logMessage,o.mode);else{const c=N.revive(o.uri);a=new Ux(new yp(c,new bs(o.line,o.character)),o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode)}q9t(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 Vx&&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 Ux&&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 yp(N.revive(o.uri),new bs(o.line,o.character))}n.push(r)}}}this.fireBreakpointChanges(t,i,n)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new $Ne(i.api,e.threadId):t=new zNe(i.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,i){return jh(async()=>{const n=this.getConfigProviderByHandle(e);if(!n)throw new Error("no DebugConfigurationProvider found");if(!n.provideDebugConfigurations)throw new Error("DebugConfigurationProvider has no method provideDebugConfigurations");const o=await this.getFolder(t);return n.provideDebugConfigurations(o,i)}).then(n=>{if(!n)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return n})}$resolveDebugConfiguration(e,t,i,n){return jh(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,n)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,n){return jh(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,n)})}async $provideDebugAdapter(e,t){const i=this.getAdapterDescriptorFactoryByHandle(e);if(!i)return Promise.reject(new Error("no adapter descriptor factory found for handle"));const n=await this.getSession(t);return this.getAdapterDescriptor(i,n).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.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 n={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(n)}convertToDto(e){if(e instanceof q9)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof hH)return{type:"server",port:e.port,host:e.host};if(e instanceof Q9)return{type:"pipeServer",path:e.path};if(e instanceof j9)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 n of i)if(n.label&&n.type&&n.type===t)return!0}}return!1}getDebugAdapterTrackers(e){const i=e.configuration.type,n=this._trackerFactories.filter(o=>o.type===i||o.type==="*").map(o=>jh(()=>o.factory.createDebugAdapterTracker(e.api)).then(r=>r,r=>null));return Promise.race([Promise.all(n).then(o=>{const r=Fi(o);if(r.length>0)return new mti(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 hH(i));if(e){const o=await this._extensionService.getExtensionRegistry();return jh(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,o))).then(r=>{if(r)return r})}const n=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,n))}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),n=e.parent?this._debugSessions.get(e.parent):void 0;t=new fti(this._debugServiceProxy,e.id,e.type,e.name,i,e.configuration,n?.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=N.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:eee.Command};if("treeId"in t)return{type:eee.Tree,id:`${e}\0${t.treeId}`};throw new Error("Unsupported debug visualization type")}}getIconPathOrClass(e){const t=this.getIconUris(e);let i,n;return"id"in t?n=We.asClassName(t):i=t,{iconPath:i,iconClass:n}}getIconUris(e){if(e instanceof uu)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"?N.file(t):t,light:typeof i=="string"?N.file(i):i}}};yIe=D([_(0,Jo),_(1,oE),_(2,MI),_(3,rE),_(4,fG),_(5,BPe),_(6,YN),_(7,cle)],yIe);class fti{constructor(e,t,i,n,o,r,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=n,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 pti{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` -`)}})}}class mti{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 _ti extends knt{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 CIe=class extends yIe{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,o,r,a,c)}};CIe=D([_(0,Jo),_(1,oE),_(2,MI),_(3,rE),_(4,fG),_(5,BPe),_(6,YN),_(7,cle)],CIe);class vti{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&&j_(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&j_(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,n)=>{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=Ko(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=>{n(new Error(Nr(r)))})})}async searchInFolder(e,t){const i=new ci,n=this.getSearchOptionsForFolder(e),o=this.initDirectoryTree(),r=new Fit(this.config,e),a=!r.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=js.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},n,i.token),d=c.elapsed(),h=js.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=Vi.relative(e.folder.path,u.path);if(a){const p=Ko(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=Cee(this.config.includePattern,e.includePattern),i=Cee(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,n){if(i===this.filePattern){const r=Ko(this.filePattern);this.matchFile(n,{base:t,relativePath:this.filePattern,basename:r})}function o(r){const a=Ko(r),c=Cb(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,n){const o=this,r=this.filePattern;function a(c){const l=m3t(()=>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 rre=class rre{constructor(){this.sessions=new Map}fileSearch(e,t,i,n){const o=this.getSessionTokenSource(e.cacheKey),r=new vti(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,rre.BATCH_SIZE,c,n).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 ci),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Pt(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,n){const o=n.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)))}};rre.BATCH_SIZE=512;let SIe=rre;class P9e{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||[],n=new ci(t);return new Promise((o,r)=>{this.collector=new wti(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);VV(l)&&typeof this.query.maxResults=="number"&&this.resultCount+h>this.query.maxResults&&(this.isLimitHit=!0,a=!0,n.cancel(),l=this.trimResultToSize(l,this.query.maxResults-this.resultCount));const u=this.resultSize(l);this.resultCount+=u,(u>0||!VV(l))&&this.collector.add(l,d)}};Promise.all(i.map((l,d)=>this.searchInFolder(l,h=>c(h,d),n.token))).then(l=>{n.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=>{n.dispose();const d=Nr(l);r(new Error(d))})})}resultSize(e){return VV(e)?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){const i=Array.isArray(e.ranges)?e.ranges:[e.ranges],n=Array.isArray(e.preview.matches)?e.preview.matches:[e.preview.matches];return{ranges:i.slice(0,t),preview:{matches:n.slice(0,t),text:e.preview.text},uri:e.uri}}async searchInFolder(e,t,i){const n=new Fit(this.query,e),o=[],r={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===pe.file?p3t(()=>this.fileUtils.readdir(Lr(l.uri))):void 0,h=DN(e.folder,l.uri);if(h){const u=n.includedInQuery(h,Ko(h),d);Qy(u)?o.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===cI.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,r,i):c=await this.queryProviderPair.provider.provideTextSearchResults(bti(this.queryProviderPair.query.contentPattern),a,r,i),o.length&&await Promise.all(o),c}validateProviderResult(e){if(VV(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=Cee(this.query.includePattern,e.includePattern),i=Cee(this.query.excludePattern,e.excludePattern),n={folder:N.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??a3t,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(n.usePCRE2=this.query.usePCRE2),n}}function bti(s){return{isCaseSensitive:s.isCaseSensitive||!1,isRegExp:s.isRegExp||!1,isWordMatch:s.isWordMatch||!1,isMultiline:s.isMultiline||!1,pattern:s.pattern}}class wti{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new AIe(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!ji(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(yti(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 yti(s){return VV(s)?{preview:{matches:n8(s.preview.matches,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character})),text:s.preview.text},ranges:n8(s.ranges,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}))}:{text:s.text,lineNumber:s.lineNumber}}function VV(s){return!!s.preview}const SO=class SO{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()},SO.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))}};SO.TIMEOUT=4e3,SO.START_BATCH_AFTER_COUNT=50;let AIe=SO;const uot=ae("IExtHostSearch");let EIe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(Be.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 SIe}_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,n){const o=Jue(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))},n);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,n){const o=this._textSearchProvider.get(e);if(!o||!o.provideTextSearchResults)throw new Error(`Unknown Text Search Provider ${e}`);const r=Jue(i);return this.createTextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$provideAITextSearchResults(e,t,i,n){const o=this._aiTextSearchProvider.get(e);if(!o||!o.provideAITextSearchResults)throw new Error(`Unknown AI Text Search Provider ${e}`);const r=Jue(i);return this.createAITextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new P9e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new P9e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};EIe=D([_(0,Jo),_(1,sle),_(2,Ge)],EIe);function Jue(s){return{...s,folderQueries:s.folderQueries&&s.folderQueries.map(Cti),extraFileResources:s.extraFileResources&&s.extraFileResources.map(e=>N.revive(e))}}function Cti(s){return{...s,folder:N.revive(s.folder)}}var xIe,lM;let DIe=(lM=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=xIe.InitialState,this._proxy=e.getProxy(Be.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=N.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Gu(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===pe.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,i,t)}async asExternalUri(e,t){if(Gu(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return N.from(i)}},xIe=lM,lM.InitialState={focused:!0,active:!0},lM);DIe=xIe=D([_(0,Jo)],DIe);const got=ae("IExtHostWindow");let one=class extends _Qe{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Mo(i))),this._proxy=e.getProxy(Be.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(N.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,i){return new Sti(this._proxy,e,t,i)}};one=D([_(0,Jo),_(1,_u)],one);class Sti extends rae{constructor(e,t,i,n){super(n?.logLevel==="always"),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(i),this.proxy.$createLogger(t,n).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 fot=ae("IExtHostTerminalShellIntegration");let kIe=class extends V{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(Be.MainThreadTerminalShellIntegration),this._register(Ee(()=>{for(const[i,n]of this._activeShellIntegrations)n.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e){const t=this._extHostTerminalService.getTerminalById(e);if(!t)return;const i=t.value;let n=this._activeShellIntegrations.get(e);n||(n=new Ati(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,n),n.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),n.store.add(n.onDidRequestShellExecution(o=>this._proxy.$executeCommand(e,o))),n.store.add(n.onDidRequestEndExecution(o=>this._onDidEndTerminalShellExecution.fire(o))),n.store.add(n.onDidRequestChangeShellIntegration(o=>this._onDidChangeTerminalShellIntegration.fire(o))),t.shellIntegration=n.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:n.value})}$shellExecutionStart(e,t,i,n,o){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const r={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.startShellExecution(r,N.revive(o))}$shellExecutionEnd(e,t,i,n,o){const r={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.endShellExecution(r,o)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(N.revive(t))}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}};kIe=D([_(0,Jo),_(1,JU)],kIe);class Ati extends V{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(n,o){let r=n;o&&(r+=` "${o.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(r);const a={value:r,confidence:mD.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 n=this._currentExecution=new Eti(e,t??this._cwd);i?queueMicrotask(()=>this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:n.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;N.isUri(this._cwd)?t=!N.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 Eti{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 Qd.EMPTY;this._dataStream=new xti}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 xti extends V{constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new qd);const e=this._barrier;return new Qd(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(FPe,fIe,qt.Delayed);ce(uf,one,qt.Delayed);ce(rle,eIe,qt.Delayed);ce(YN,Qke,qt.Eager);ce(MPe,hIe,qt.Eager);ce(NPe,gIe,qt.Eager);ce(rE,Kke,qt.Eager);ce(nle,Vke,qt.Eager);ce(cle,wIe,qt.Eager);ce(hot,CIe,qt.Eager);ce(Zst,Gke,qt.Eager);ce(YU,Jke,qt.Eager);ce(OPe,pIe,qt.Eager);ce(jU,Cei,qt.Eager);ce(Jst,zke,qt.Delayed);ce(uot,EIe,qt.Eager);ce(LPe,sot,qt.Eager);ce(not,rIe,qt.Eager);ce(JU,Zke,qt.Eager);ce(fot,kIe,qt.Eager);ce(bPe,sDe,qt.Eager);ce(got,DIe,qt.Eager);ce(oE,$ke,qt.Eager);ce(PPe,rot,qt.Eager);ce(ole,qke,qt.Eager);ce(fG,aIe,qt.Eager);ce(BPe,vIe,qt.Eager);let IIe=class extends MYe{constructor(e,t,i){const n=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",o=i.remote.isRemote?g(578,"Extension Host (Remote)"):e?g(579,"Extension Host (Worker)"):g(580,"Extension Host");super(t.createLogger(n,{name:o}))}};IIe=D([_(1,uf),_(2,_u)],IIe);class F9e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ge),n=e.get(Jo).getProxy(Be.MainThreadErrors);qge(o=>{t.error(o);const r=SA(o);n.$onUnexpectedError(r)})}static async installFullHandler(e){const t=e.get(Ge),i=e.get(Jo),n=e.get(MI),o=e.get(ole),r=i.getProxy(Be.MainThreadExtensionService),a=i.getProxy(Be.MainThreadErrors),c=await n.getExtensionPathIndex(),l=new WeakMap;function d(f,p){if(l.has(f))return l.get(f).stack;let m="",v,b;for(const y of p)m+=` - at ${y.toString()}`,b=y.getFileName(),!v&&b&&(v=c.findSubstr(N.file(b)));const w=`${f.name||"Error"}: ${f.message||""}${m}`;return l.set(f,{extensionIdentifier:v?.identifier,stack:w}),w}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})}}),qge(f=>{t.error(f);const p=SA(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 HPe{constructor(e,t,i,n,o){this._hostUtils=i,this._rpcProtocol=new pee(e,null,n),t=HPe._transform(t,this._rpcProtocol);const r=new Uc(...Spe());r.set(_u,{_serviceBrand:void 0,...t,messagePorts:o}),r.set(Jo,new Pjt(this._rpcProtocol)),r.set(sle,new Aei(n)),r.set(aot,i),r.set(Ge,new wi(IIe,[!0],!0)),r.set(uf,new wi(one,[],!0));const a=new T3(r,!0);c8&&a.invokeFunction(F9e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ge)),cs("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(MI)),this._extensionService.initialize(),c8&&a.invokeFunction(F9e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(Be.MainThreadExtensionService);return N.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(Be.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([t,i])=>[N.revive(t),N.revive(i)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(n=>{n.extensionLocation=N.revive(t.transformIncomingURIs(n.extensionLocation))}),e.environment.appRoot=N.revive(t.transformIncomingURIs(e.environment.appRoot));const i=e.environment.extensionDevelopmentLocationURI;return i&&(e.environment.extensionDevelopmentLocationURI=i.map(n=>N.revive(t.transformIncomingURIs(n)))),e.environment.extensionTestsLocationURI=N.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=N.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=N.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.environment.extensionTelemetryLogResource=N.revive(t.transformIncomingURIs(e.environment.extensionTelemetryLogResource)),e.nlsBaseUrl=N.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=N.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}}class Dti{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Be.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const n=this._relatedInformationProviders.get(e);if(!n)throw new Error("related information provider not found");return await n.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(n,i),this._proxy.$registerAiRelatedInformationProvider(n,t),new Qs(()=>{this._proxy.$unregisterAiRelatedInformationProvider(n),this._relatedInformationProviders.delete(n)})}}const kti=[new gn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of DocumentHighlight-instances.",fv(OH.to))),new gn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[ht.Uri],new nn("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(s,e)=>{if(uU(s))return;class t extends tH{static to(n){const o=new t(n.name,iv.to(n.kind),n.containerName||"",new yp(e[0],et.to(n.range)));return o.detail=n.detail,o.range=o.location.range,o.selectionRange=et.to(n.selectionRange),o.children=n.children?n.children.map(t.to):[],o}}return s.map(t.to)})),new gn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[ht.Uri,new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",fv(od.to))),new gn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[ht.Uri,ht.Range,new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",fv(od.to))),new gn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[ht.Uri,ht.Position,new ht("ch","Trigger character",s=>typeof s=="string",s=>s),new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",fv(od.to))),new gn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",mE)),new gn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location-instances.",fv(hf.to))),new gn("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location-instances.",fv(hf.to))),new gn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Hover-instances.",fv(w$.to))),new gn("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Hover-instances.",fv(w$.to))),new gn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[ht.Uri,new ht("position","A position in a text document",s=>Array.isArray(s)&&s.every(e=>bs.isPosition(e)),s=>s.map(Yo.from))],new nn("A promise that resolves to an array of ranges.",s=>s.map(e=>{let t;for(const i of e.reverse())t=new sH(et.to(i),t);return t}))),new gn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[ht.String.with("query","Search string")],new nn("A promise that resolves to an array of SymbolInformation-instances.",s=>s.map(v$.to))),new gn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of CallHierarchyItem-instances",s=>s.map(gN.to))),new gn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[ht.CallHierarchyItem],new nn("A promise that resolves to an array of CallHierarchyIncomingCall-instances",s=>s.map(BEe.to))),new gn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[ht.CallHierarchyItem],new nn("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",s=>s.map(WEe.to))),new gn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[ht.Uri,ht.Position],new nn("A promise that resolves to a range and placeholder text.",s=>{if(s)return{range:et.to(s.range),placeholder:s.text}})),new gn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[ht.Uri,ht.Position,ht.String.with("newName","The new symbol name")],new nn("A promise that resolves to a WorkspaceEdit.",s=>{if(s){if(s.rejectReason)throw new Error(s.rejectReason);return Yu.to(s)}})),new gn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[ht.Uri,ht.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new nn("A promise that resolves to an array of DocumentLink-instances.",s=>s.map(XT.to))),new gn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[ht.Uri],new nn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new nte(s.tokenTypes,s.tokenModifiers)})),new gn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[ht.Uri],new nn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=iZ(s);if(e.type==="full")return new aN(e.data,void 0)})),new gn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[ht.Uri,ht.Range.optional()],new nn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new nte(s.tokenTypes,s.tokenModifiers)})),new gn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[ht.Uri,ht.Range],new nn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=iZ(s);if(e.type==="full")return new aN(e.data,void 0)})),new gn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[ht.Uri,ht.Position,ht.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),ht.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new nn("A promise that resolves to a CompletionList-instance.",(s,e,t)=>{if(!s)return new tN([]);const i=s.suggestions.map(n=>$Ee.to(n,t));return new tN(i,s.incomplete)})),new gn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[ht.Uri,ht.Position,ht.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new nn("A promise that resolves to SignatureHelp.",s=>{if(s)return y$.to(s)})),new gn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[ht.Uri,ht.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new nn("A promise that resolves to an array of CodeLens-instances.",(s,e,t)=>fv(i=>new P9(et.to(i.range),i.command&&t.fromInternal(i.command)))(s))),new gn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[ht.Uri,new ht("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",s=>Jn.isRange(s),s=>cC.isSelection(s)?Wb.from(s):et.from(s)),ht.String.with("kind","Code action kind to return code actions for").optional(),ht.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new nn("A promise that resolves to an array of Command-instances.",(s,e,t)=>fv(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const n=new N9(i.title,i.kind?new Sa(i.kind):void 0);return i.edit&&(n.edit=Yu.to(i.edit)),i.command&&(n.command=t.fromInternal(i.command)),n.isPreferred=i.isPreferred,n}})(s))),new gn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[ht.Uri],new nn("A promise that resolves to an array of ColorInformation objects.",s=>s?s.map(e=>new U9(et.to(e.range),BH.to(e.color))):[])),new gn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new ht("color","The color to show and insert",s=>s instanceof sN,BH.from),new ht("context","Context object with uri and range",s=>!0,s=>({uri:s.uri,range:et.from(s.range)}))],new nn("A promise that resolves to an array of ColorPresentation objects.",s=>s?s.map(Kte.to):[])),new gn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[ht.Uri,ht.Range],new nn("A promise that resolves to an array of Inlay objects",(s,e,t)=>s.map(GEe.to.bind(void 0,t)))),new gn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[ht.Uri],new nn("A promise that resolves to an array of FoldingRange objects",(s,e)=>{if(s)return s.map(Qte.to)})),new gn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new nn("A promise that resolves to an array of NotebookContentProvider static info objects.",fv(s=>({viewType:s.viewType,displayName:s.displayName,options:{transientOutputs:s.options.transientOutputs,transientCellMetadata:s.options.transientCellMetadata,transientDocumentMetadata:s.options.transientDocumentMetadata},filenamePattern:s.filenamePattern.map(e=>Jte.to(e))})))),new gn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[ht.Uri,ht.Range,new ht("context","An InlineValueContext",s=>s&&typeof s.frameId=="number"&&s.stoppedLocation instanceof Jn,s=>Hte.from(s))],new nn("A promise that resolves to an array of InlineValue objects",s=>s.map(Wte.to))),new gn("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 ht("uriOrString","Uri-instance or string (only http/https)",s=>N.isUri(s)||typeof s=="string"&&A8(s,pe.http,pe.https),s=>s),new ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="number"||typeof s=="object",s=>s&&(typeof s=="number"?[xl.from(s),void 0]:[xl.from(s.viewColumn),dz.from(s)])).optional(),ht.String.with("label","").optional()],nn.Void),new gn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[ht.Uri.with("resource","Resource to open"),ht.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 ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="number"||typeof s=="object",s=>s&&(typeof s=="number"?[xl.from(s),void 0]:[xl.from(s.viewColumn),dz.from(s)])).optional()],nn.Void),new gn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[ht.Uri.with("left","Left-hand side resource of the diff editor"),ht.Uri.with("right","Right-hand side resource of the diff editor"),ht.String.with("title","Human readable title for the diff editor").optional(),new ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="object",s=>s&&[xl.from(s.viewColumn),dz.from(s)]).optional()],nn.Void),new gn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[ht.String.with("title","Human readable title for the changes editor"),new ht("resourceList","List of resources to compare",s=>{for(const e of s){if(e.length!==3)return!1;const[t,i,n]=e;if(!N.isUri(t)||!N.isUri(i)&&i!==void 0&&i!==null||!N.isUri(n)&&n!==void 0&&n!==null)return!1}return!0},s=>s)],nn.Void),new gn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(ZT.to))),new gn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[ht.TypeHierarchyItem],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(ZT.to))),new gn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[ht.TypeHierarchyItem],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(ZT.to))),new gn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[ht.TestItem],nn.Void),new gn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[ht.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],nn.Void),new gn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[ht.String.with("name","The context key name"),new ht("value","The context key value",()=>!0,s=>s)],nn.Void),new gn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[ht.Uri,ht.StringArray,new ht("MappedEditsContext","Mapped Edits Context",s=>Yte.is(s),s=>Yte.from(s))],new nn("A promise that resolves to a workspace edit or null",s=>s?Yu.to(s):null)),new gn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new ht("Run arguments","",s=>!0,s=>{if(s)return{initialRange:s.initialRange?et.from(s.initialRange):void 0,initialSelection:cC.isSelection(s.initialSelection)?Wb.from(s.initialSelection):void 0,message:s.message,autoSend:s.autoSend,position:s.position?Yo.from(s.position):void 0}})],nn.Void)];class Iti{static register(e){kti.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",Pat)}}function fv(s){return e=>{if(Array.isArray(e))return e.map(s)}}function mE(s){if(!Array.isArray(s))return;const e=[];for(const t of s)mGe(t)?e.push(b$.to(t)):e.push(hf.to(t));return e}let TIe=class{constructor(e,t){this._proxy=e.getProxy(Be.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const n=new jd(Yu.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(n,void 0,i?.isRefactoring??!1)}};TIe=D([_(0,Jo)],TIe);class Tti{constructor(e,t,i,n,o){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=n,this._sessionDisposables=o,this._stopWatch=js.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(n){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,n),o}};const e=this;this._stopWatch.reset();const i=(n,o)=>{if(typeof this._firstProgress>"u"&&"content"in n&&(this._firstProgress=this._stopWatch.elapsed()),o){const r=this._proxy.$handleProgressChunk(this._request.requestId,n),a={report:c=>{r?.then(l=>{l&&(df.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,k$.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,fA.from(c),l))})}};Promise.all([r,o?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,nxe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,n)};this._apiObject={markdown(n){t(this.markdown);const o=new aG(n),r=E$.from(o);return i(r),this},markdownWithVulnerabilities(n,o){t(this.markdown),o&&Ve(e._extension,"chatParticipantAdditions");const r=new SH(n,o),a=nie.from(r);return i(a),this},filetree(n,o){t(this.filetree);const r=new cG(n,o),a=x$.from(r);return i(a),this},anchor(n,o){t(this.anchor);const r=new lG(n,o),a=D$.from(r);return i(a),this},button(n){t(this.anchor);const o=new dG(n),r=I$.from(o,e._commandsConverter,e._sessionDisposables);return i(r),this},progress(n,o){t(this.progress);const r=new tPe(n,o),a=o?ixe.from(r):zH.from(r);return i(a,o),this},warning(n){t(this.progress),Ve(e._extension,"chatParticipantAdditions");const o=new xH(n),r=k$.from(o);return i(r),this},reference(n,o){return this.reference2(n,o)},reference2(n,o,r){if(t(this.reference),"variableName"in n&&Ve(e._extension,"chatParticipantAdditions"),"variableName"in n&&!n.value){const a=e._request.variables.variables.find(c=>c.name===n.variableName);if(a){let c;if(a.references?.length)c=a.references.map(l=>({kind:"reference",reference:{variableName:n.variableName,value:l.reference}}));else{const l=new kb(n,o,r);c=[fA.from(l)]}return c.forEach(l=>i(l)),this}}else{const a=new kb(n,o,r),c=fA.from(a);i(c)}return this},codeCitation(n,o,r){t(this.codeCitation),Ve(e._extension,"chatParticipantAdditions");const a=new d$(n,o,r),c=aie.from(a);i(c)},textEdit(n,o){t(this.textEdit),Ve(e._extension,"chatParticipantAdditions");const r=new DH(n,o),a=rie.from(r);return i(a),this},detectedParticipant(n,o){t(this.detectedParticipant),Ve(e._extension,"chatParticipantAdditions");const r=new AH(n,o),a=sie.from(r);return i(a),this},confirmation(n,o,r,a){t(this.confirmation),Ve(e._extension,"chatParticipantAdditions");const c=new l$(n,o,r,a),l=oie.from(c);return i(l),this},push(n){if(t(this.push),(n instanceof DH||n instanceof SH||n instanceof AH||n instanceof xH||n instanceof l$||n instanceof d$)&&Ve(e._extension,"chatParticipantAdditions"),n instanceof kb)this.reference2(n.value,n.iconPath,n.options);else{const o=cie.from(n,e._commandsConverter,e._sessionDisposables);i(o)}return this}}}return this._apiObject}}const e8=class e8 extends V{constructor(e,t,i,n){super(),this._logService=t,this._commands=i,this._documents=n,this._agents=new Map,this._sessionDisposables=this._register(new mo),this._completionDisposables=this._register(new mo),this._proxy=e.getProxy(Be.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const n=e8._idPool++,o=new O9e(e,t,this._proxy,n,i);return this._agents.set(n,o),this._proxy.$registerAgent(n,e.identifier,t,{},void 0),o.apiAgent}createDynamicChatAgent(e,t,i,n){const o=e8._idPool++,r=new O9e(e,t,this._proxy,o,n);return this._agents.set(o,r),this._proxy.$registerAgent(o,e.identifier,t,{isSticky:!0},i),r.apiAgent}async $invokeAgent(e,t,i,n){const o=this._agents.get(e);if(!o)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);const r=Mo(t);let a=this._sessionDisposables.get(r.sessionId);a||(a=new Z,this._sessionDisposables.set(r.sessionId,a));const c=new Tti(o.extension,r,this._proxy,this._commands.converter,a);try{const l=await this.prepareHistoryTurns(r.agentId,i);let d;if(r.locationData?.type===Ir.Editor){const u=this._documents.getDocument(r.locationData.document);d=new sPe(u,Wb.to(r.locationData.selection),et.to(r.locationData.wholeRange))}else if(r.locationData?.type===Ir.Notebook){const u=this._documents.getDocument(r.locationData.sessionInputUri);d=new oPe(u)}else r.locationData?.type,Ir.Terminal;const h=o.invoke(sxe.to(r,d),{history:l},c.apiObject,n);return await U_(Promise.resolve(h).then(u=>{if(u?.metadata)try{JSON.stringify(u.metadata)}catch(p){const m=`result.metadata MUST be JSON.stringify-able. Got error: ${p.message}`;return this._logService.error(`[${o.extension.identifier.value}] [@${o.id}] ${m}`,o.extension),{errorDetails:{message:m},timings:c.timings}}let f;return u?.errorDetails&&(f={...u.errorDetails,responseIsIncomplete:!0}),f?.responseIsRedacted&&Ve(o.extension,"chatParticipantPrivate"),{errorDetails:f,timings:c.timings,metadata:u?.metadata}}),n)}catch(l){return this._logService.error(l,o.extension),l instanceof Mw&&l.cause&&(l=l.cause),{errorDetails:{message:Nr(l),responseIsIncomplete:!0}}}finally{c.close()}}async prepareHistoryTurns(e,t){const i=[];for(const n of t.history){const o=cB.to(n.result),r=e===n.request.agentId?o:{...o,metadata:void 0},a=n.request.variables.variables.filter(l=>!l.isTool).map(lie.to);i.push(new iPe(n.request.message,n.request.command,a,n.request.agentId));const c=Fi(n.response.map(l=>cie.toContent(l,this._commands.converter)));i.push(new nPe(c,r,n.request.agentId,n.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,n,o){const r=this._agents.get(t);if(!r)return Promise.resolve([]);const a=Mo(e),c=await this.prepareHistoryTurns(r.id,n),l=cB.to(i);return(await r.provideFollowups(l,{history:c},o)).filter(d=>{const h=!d.participant||hi.some(this._agents.values(),u=>u.id===d.participant&&Sn.equals(u.extension.identifier,r.extension.identifier));return h||this._logService.warn(`[@${r.id}] ChatFollowup refers to an unknown participant: ${d.participant}`),h}).map(d=>A$.from(d,a))}$acceptFeedback(e,t,i,n){const o=this._agents.get(e);if(!o)return;const r=cB.to(t);let a;switch(i){case WW.Down:a=CH.Unhelpful;break;case WW.Up:a=CH.Helpful;break}o.acceptFeedback(Object.freeze(n?{result:r,kind:a,reportIssue:n}:{result:r,kind:a}))}$acceptAction(e,t,i){const n=this._agents.get(e);if(!n||i.action.kind==="vote")return;const o=rxe.to(t,i,this._commands.converter);o&&n.acceptAction(Object.freeze(o))}async $invokeCompletionProvider(e,t,i){const n=this._agents.get(e);if(!n)return[];let o=this._completionDisposables.get(e);return o?o.clear():(o=new Z,this._completionDisposables.set(e,o)),(await n.invokeCompletionProvider(t,i)).map(a=>oxe.from(a,this._commands.converter,o))}async $provideWelcomeMessage(e,t,i){const n=this._agents.get(e);if(n)return await n.provideWelcomeMessage(T$.to(t),i)}async $provideSampleQuestions(e,t,i){const n=this._agents.get(e);if(n)return(await n.provideSampleQuestions(T$.to(t),i)).map(o=>A$.from(o,void 0))}};e8._idPool=0;let LIe=e8;class O9e{constructor(e,t,i,n,o){this.extension=e,this.id=t,this._proxy=i,this._handle=n,this._requestHandler=o,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)??[]:[]}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const n=await this._followupProvider.provideFollowups(e,t,i);return n?n.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(n=>typeof n=="string"?n:Ps.from(n)):[]}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(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof N?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 uu?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Ps.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Ps.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Ps.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,supportsSlowVariables:this._supportsSlowReferences}),t=!1}))},n=this;return{get id(){return n.id},get iconPath(){return n._iconPath},set iconPath(o){n._iconPath=o,i()},get requestHandler(){return n._requestHandler},set requestHandler(o){Tt(typeof o=="function","Invalid request handler"),n._requestHandler=o},get followupProvider(){return n._followupProvider},set followupProvider(o){n._followupProvider=o,i()},get isDefault(){return Ve(n.extension,"defaultChatParticipant"),n._isDefault},set isDefault(o){Ve(n.extension,"defaultChatParticipant"),n._isDefault=o,i()},get helpTextPrefix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextPrefix},set helpTextPrefix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextPrefix=o,i()},get helpTextVariablesPrefix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix},set helpTextVariablesPrefix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix=o,i()},get helpTextPostfix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextPostfix},set helpTextPostfix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextPostfix=o,i()},get isSecondary(){return Ve(n.extension,"defaultChatParticipant"),n._isSecondary},set isSecondary(o){Ve(n.extension,"defaultChatParticipant"),n._isSecondary=o,i()},get supportIssueReporting(){return Ve(n.extension,"chatParticipantPrivate"),n._supportIssueReporting},set supportIssueReporting(o){Ve(n.extension,"chatParticipantPrivate"),n._supportIssueReporting=o,i()},get onDidReceiveFeedback(){return n._onDidReceiveFeedback.event},set participantVariableProvider(o){if(Ve(n.extension,"chatParticipantAdditions"),n._agentVariableProvider=o,o){if(!o.triggerCharacters.length)throw new Error("triggerCharacters are required");n._proxy.$registerAgentCompletionsProvider(n._handle,n.id,o.triggerCharacters)}else n._proxy.$unregisterAgentCompletionsProvider(n._handle,n.id)},get participantVariableProvider(){return Ve(n.extension,"chatParticipantAdditions"),n._agentVariableProvider},set welcomeMessageProvider(o){Ve(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider=o,i()},get welcomeMessageProvider(){return Ve(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider},onDidPerformAction:dl(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(o){n._requester=o,i()},get requester(){return n._requester},set supportsSlowReferences(o){Ve(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences=o,i()},get supportsSlowReferences(){return Ve(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences},dispose(){e=!0,n._followupProvider=void 0,n._onDidReceiveFeedback.dispose(),n._proxy.$unregisterAgent(n._handle)}}}invoke(e,t,i,n){return this._requestHandler(e,t,i,n)}}const are=class are{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(Be.MainThreadChatVariables)}async $resolveVariable(e,t,i,n){const o=this._resolver.get(e);if(o)try{if(o.resolver.resolve2){Ve(o.extension,"chatParticipantAdditions");const r=new Lti(t,this._proxy),a=await o.resolver.resolve2(o.data.name,{prompt:i},r.apiObject,n);if(a&&a[0])return a[0].value}else{const r=await o.resolver.resolve(o.data.name,{prompt:i},n);if(r&&r[0])return r[0].value}}catch(r){No(r)}}registerVariableResolver(e,t,i,n,o,r,a,c,l){const d=are._idPool++,h=l?We.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:n,modelDescription:o,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:n,modelDescription:o,isSlow:r,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}};are._idPool=0;let RIe=are;class Lti{constructor(e,t){this._requestId=e,this._proxy=t,this._isClosed=!1}close(){this._isClosed=!0}get apiObject(){if(!this._apiObject){let t=function(n){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,n),o}};const e=this,i=n=>{this._proxy.$handleProgressChunk(this._requestId,n)};this._apiObject={progress(n){t(this.progress);const o=new EH(n),r=zH.from(o);return i(r),this},reference(n){t(this.reference);const o=new kb(n),r=fA.from(o);return i(r),this},push(n){return t(this.push),n instanceof kb?i(fA.from(n)):n instanceof EH&&i(zH.from(n)),this}}}return this._apiObject}}class Rti{constructor(e){const t=e.getProxy(Be.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const pot="vscode-cdn.net",Mti=`vscode-resource.${pot}`,MIe=`'self' https://*.${pot}`;function Dz(s,e){return s.scheme===pe.http||s.scheme===pe.https?s:(e&&e.authority&&e.isRemote&&s.scheme===pe.file&&(s=N.from({scheme:pe.vscodeRemote,authority:e.authority,path:s.path})),N.from({scheme:pe.https,authority:`${s.scheme}+${Nti(s.authority)}.${Mti}`,path:s.path,fragment:s.fragment,query:s.query}))}function Nti(s){return s.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=B.a&&t<=B.z||t>=B.A&&t<=B.Z||t>=B.Digit0&&t<=B.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class Pti{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 n=t.getVisibleTextEditors();for(const o of this._insets.values())n.indexOf(o.editor)<0&&o.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,n,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 Dz(f,a._remoteInfo)}get cspSource(){return MIe}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,n||{},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 Fti(s,e,t){const i=s.getProxy(Be.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new va,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===ws.CommentController){const b=this._commentControllers.get(v.handle);return b?b.value:v}else if(v&&v.$mid===ws.CommentThread){const b=v,w=this._commentControllers.get(b.commentControlHandle);if(!w)return b;const y=w.getCommentThread(b.commentThreadHandle);return y?y.value:b}else if(v&&(v.$mid===ws.CommentThreadReply||v.$mid===ws.CommentThreadInstance)){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);return w?v.$mid===ws.CommentThreadInstance?w.value:{thread:w.value,text:v.text}:v}else if(v&&v.$mid===ws.CommentNode){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);if(!w)return v;const y=v.commentUniqueId,C=w.getCommentByUniqueId(y);return C||v}else if(v&&v.$mid===ws.CommentThreadNode){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);if(!w)return v;const y=v.text,C=v.commentUniqueId,A=w.getCommentByUniqueId(C);return A?(typeof A.body=="string"?A.body=y:A.body=new df(y),A):v}return v}})}createCommentController(v,b,w){const y=f.handlePool++,C=new r(v,y,b,w);this._commentControllers.set(C.handle,C);const A=this._commentControllersByExtension.get(v.identifier)||[];return A.push(C),this._commentControllersByExtension.set(v.identifier,A),C.value}async $createCommentThreadTemplate(v,b,w,y){const C=this._commentControllers.get(v);C&&C.$createCommentThreadTemplate(b,w,y)}async $setActiveComment(v,b){const w=this._commentControllers.get(v);w&&w.$setActiveComment(b??void 0)}async $updateCommentThreadTemplate(v,b,w){const y=this._commentControllers.get(v);y&&y.$updateCommentThreadTemplate(b,w)}$deleteCommentThread(v,b){this._commentControllers.get(v)?.$deleteCommentThread(b)}async $provideCommentingRanges(v,b,w){const y=this._commentControllers.get(v);if(!y||!y.commentingRangeProvider)return Promise.resolve(void 0);const C=await t.ensureDocumentData(N.revive(b));return jh(async()=>{const A=await y.commentingRangeProvider.provideCommentingRanges(C.document,w);let L;return Array.isArray(A)?L={ranges:A,fileComments:!1}:A?L={ranges:A.ranges||[],fileComments:A.enableFileComments||!1}:L=A??void 0,L}).then(A=>{let L;return A&&(L={ranges:A.ranges.map(k=>et.from(k)),fileComments:A.fileComments}),L})}$toggleReaction(v,b,w,y,C){const A=this._commentControllers.get(v);return!A||!A.reactionHandler?Promise.resolve(void 0):jh(()=>{const L=A.getCommentThread(b);if(L){const k=L.getCommentByUniqueId(y.uniqueIdInThread);if(A!==void 0&&k&&A.reactionHandler)return A.reactionHandler(k,l(C))}return Promise.resolve(void 0)})}};f.handlePool=0;let n=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"?(Ve(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,b,w,y,C,A,L,k,P){this._commentControllerHandle=b,this._id=w,this._uri=y,this._range=C,this._comments=A,this.extensionDescription=L,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 wn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(b,this.handle,this._id,this._uri,et.from(this._range),this._comments.map(z=>a(this,z,this._commentsMap,this.extensionDescription)),L.identifier,this._isTemplate,P),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(b,this.handle)}});const R=this;this.value={get uri(){return R.uri},get range(){return R.range},set range(z){R.range=z},get comments(){return R.comments},set comments(z){R.comments=z},get collapsibleState(){return R.collapsibleState},set collapsibleState(z){R.collapsibleState=z},get canReply(){return R.canReply},set canReply(z){R.canReply=z},get contextValue(){return R.contextValue},set contextValue(z){R.contextValue=z},get label(){return R.label},set label(z){R.label=z},get state(){return R.state},set state(z){R.state=z},reveal:(z,G)=>R.reveal(z,G),hide:()=>R.hide(),dispose:()=>{R.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=w=>Object.prototype.hasOwnProperty.call(this.modifications,w),b={};v("range")&&(b.range=et.from(this._range)),v("label")&&(b.label=this.label),v("contextValue")&&(b.contextValue=this.contextValue??null),v("comments")&&(b.comments=this._comments.map(w=>a(this,w,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(b.collapseState=d(this._collapseState)),v("canReply")&&(b.canReply=this.canReply),v("state")&&(b.state=h(this._state)),v("applicability")&&(b.applicability=u(this._state)),v("isTemplate")&&(b.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,b)}getCommentByUniqueId(v){for(const b of this._commentsMap){const w=b[0],y=b[1];if(v===y)return w}}async reveal(v,b){Ve(this.extensionDescription,"commentReveal");let w;v&&v.body!==void 0?w=v:b=b??v;let y=w?this._commentsMap.get(w):void 0;y??=this._commentsMap.get(this._comments[0]);let C=!0,A=!1;return b?.focus===_H.Reply?(A=!0,C=!1):b?.focus===_H.Comment&&(C=!1),i.$revealCommentThread(this._commentControllerHandle,this.handle,y,{preserveFocus:C,focusReply:A})}async hide(){return i.$hideCommentThread(this._commentControllerHandle,this.handle)}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&&Ve(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 Ve(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return Ve(this._extension,"activeComment"),this._activeThread}constructor(v,b,w,y){this._extension=v,this._handle=b,this._id=w,this._label=y,this._threads=new Map,i.$registerCommentController(this.handle,w,y,this._extension.identifier.value);const C=this;this.value=Object.freeze({id:C.id,label:C.label,get options(){return C.options},set options(A){C.options=A},get commentingRangeProvider(){return C.commentingRangeProvider},set commentingRangeProvider(A){C.commentingRangeProvider=A},get reactionHandler(){return C.reactionHandler},set reactionHandler(A){C.reactionHandler=A},get activeCommentThread(){return C.activeCommentThread},createCommentThread(A,L,k){return C.createCommentThread(A,L,k).value},dispose:()=>{C.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,b,w){b===void 0&&Ve(this._extension,"fileComments");const y=new o(this.id,this.handle,void 0,v,b,w,this._extension,!1);return this._threads.set(y.handle,y),y}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const b=this._threads.get(v.commentThreadHandle);b&&(this._activeComment=v.uniqueIdInThread?b.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=b)}$createCommentThreadTemplate(v,b,w){const y=new o(this.id,this.handle,void 0,N.revive(v),et.to(b),[],this._extension,!0,w);return y.collapsibleState=Lc.Expanded,this._threads.set(y.handle,y),y}$updateCommentThreadTemplate(v,b){const w=this._threads.get(v);w&&(w.range=et.to(b))}$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,b,w){let y=b.get(v);return y||(y=++m.commentHandle,b.set(v,y)),v.state!==void 0&&Ve(w,"commentsDraftState"),v.reactions?.some(C=>C.reactors!==void 0)&&Ve(w,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:y,body:typeof v.body=="string"?v.body:Ps.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(C=>c(C)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function c(m){return{label:m.label,iconPath:m.iconPath?Qce(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?N.revive(m.iconPath):"",authorHasReacted:m.hasReacted||!1,reactors:m.reactors?.map(v=>({name:v}))}}function d(m){if(m!==void 0)switch(m){case fH.Expanded:return Lc.Expanded;case fH.Collapsed:return Lc.Collapsed}return Lc.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case pH.Unresolved:return ru.Unresolved;case pH.Resolved:return ru.Resolved}return ru.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case mH.Current:return Xx.Current;case mH.Outdated:return Xx.Outdated}return Xx.Current}return new n}var J1,X1,w7,y7,C7,Pw,Z1,eT,tT,iT,S7,ZB,nT;class Oti{constructor(e,t,i,n,o,r,a){Wt(this,J1);Wt(this,X1);Wt(this,w7);Wt(this,y7);Wt(this,C7);Wt(this,Pw);Wt(this,Z1);Wt(this,eT);Wt(this,tT);Wt(this,iT);Wt(this,S7);Wt(this,ZB);Wt(this,nT);Ct(this,Z1,""),Ct(this,tT,!1),Ct(this,iT,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,Ct(this,nT,new I),this._onDidDispose=Ce(this,nT).event,Ct(this,J1,e),Ct(this,X1,t),Ct(this,eT,i),Ct(this,y7,n),Ct(this,C7,o),Ct(this,Pw,r),Ct(this,S7,QH(r)),Ct(this,ZB,Bti(r)),Ct(this,w7,a)}dispose(){Ct(this,tT,!0),Ce(this,nT).fire(),Ce(this,nT).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return Ct(this,iT,!0),Dz(e,Ce(this,y7))}get cspSource(){const e=Ce(this,Pw).extensionLocation;if(e.scheme===pe.https||e.scheme===pe.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+MIe}return MIe}get html(){return this.assertNotDisposed(),Ce(this,Z1)}set html(e){this.assertNotDisposed(),Ce(this,Z1)!==e&&(Ct(this,Z1,e),Ce(this,ZB)&&!Ce(this,iT)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(Ct(this,iT,!0),Ce(this,w7).report("Webview vscode-resource: uris",Ce(this,Pw),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),Ce(this,X1).$setHtml(Ce(this,J1),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),Ce(this,eT)}set options(e){this.assertNotDisposed(),Ys(Ce(this,eT),e)||Ce(this,X1).$setOptions(Ce(this,J1),mot(Ce(this,Pw),Ce(this,C7),e)),Ct(this,eT,e)}async postMessage(e){if(Ce(this,tT))return!1;const t=xnt(e,{serializeBuffersForPostMessage:Ce(this,S7)});return Ce(this,X1).$postMessage(Ce(this,J1),t.message,...t.buffers)}assertNotDisposed(){if(Ce(this,tT))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!Ce(this,ZB))return e;const t=Ce(this,Pw).extensionLocation?.scheme===pe.vscodeRemote,i=Ce(this,Pw).extensionLocation.scheme===pe.vscodeRemote?Ce(this,Pw).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,o,r,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Dz(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,o,r,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Dz(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`})}}J1=new WeakMap,X1=new WeakMap,w7=new WeakMap,y7=new WeakMap,C7=new WeakMap,Pw=new WeakMap,Z1=new WeakMap,eT=new WeakMap,tT=new WeakMap,iT=new WeakMap,S7=new WeakMap,ZB=new WeakMap,nT=new WeakMap;function QH(s){try{const e=D9(x9(s.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function Bti(s){try{const e=D9(x9(s.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class Wti extends V{constructor(e,t,i,n,o){super(),this.remoteInfo=t,this.workspace=i,this._logService=n,this._deprecationService=o,this._webviews=new Map,this._webviewProxy=e.getProxy(Be.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const n=this.getWebview(e);if(n){const{message:o}=Dnt(t,i.value);n._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 n=new Oti(e,this._webviewProxy,Hti(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,n);const o=n._onDidDispose(()=>{o.dispose(),this.deleteWebview(e)});return n}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function rne(s){return{id:s.identifier,location:s.extensionLocation}}function mot(s,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||Uti(s,e)}}function Hti(s){return{enableCommandUris:s.enableCommandUris,enableScripts:s.enableScripts,enableForms:s.enableForms,portMapping:s.portMapping,localResourceRoots:s.localResourceRoots?.map(e=>N.from(e))}}function Uti(s,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),s.extensionLocation]}const cre=class cre{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(){cre.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};cre.enableDebugLogging=!1;let ym=cre;class Vti{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new ym("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=Qti(this.document.uri)+this._backupCounter++;return Pt(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 zti{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const n=this.key(e,t.uri);if(this._documents.has(n))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const o=new Vti(t,i);return this._documents.set(n,o),o}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var qx;(function(s){s[s.Text=0]="Text",s[s.Custom=1]="Custom"})(qx||(qx={}));class $ti{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:qx.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:qx.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 Qs(()=>this._providers.delete(e))}}class Gti{constructor(e,t,i,n,o){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=n,this._extHostWebviewPanels=o,this._editorProviders=new $ti,this._documents=new zti,this._proxy=e.getProxy(Be.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,n){const o=new Z;return Kti(i)?(o.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(rne(e),t,n.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},QH(e))):(o.add(this._editorProviders.addCustomProvider(t,e,i)),$K(i)&&o.add(i.onDidChangeCustomDocument(r=>{const a=this.getCustomDocumentEntry(t,r.document.uri);if(qti(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(rne(e),t,n.webviewOptions||{},!!n.supportsMultipleEditorsPerDocument,QH(e))),Qs.from(o,new Qs(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,n,o){const r=this._editorProviders.get(t);if(!r)throw new Error(`No provider found for '${t}'`);if(r.type!==qx.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=N.revive(e),c=await r.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:n?.buffer},o);let l;return $K(r.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(r.extension)??this._extensionStoragePaths.globalValue(r.extension)),this._documents.add(t,c,l),{editable:$K(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!==qx.Custom)throw new Error(`Invalid provider type for '${t}'`);const n=N.revive(e),{document:o}=this.getCustomDocumentEntry(t,n);this._documents.delete(t,o),o.dispose()}async $resolveCustomEditor(e,t,i,n,o,r){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=xl.to(o),l=this._extHostWebview.createNewWebview(t,n.contentOptions,a.extension),d=this._extHostWebviewPanels.createNewWebviewPanel(t,i,n.title,c,n.options,l,n.active),h=N.revive(e);switch(a.type){case qx.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,r)}case qx.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 n=this._editorProviders.get(i);if(!n)throw new Error(`No provider found for '${i}'`);if(!n.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=N.revive(t),a=this._extHostDocuments.getDocument(r);await n.provider.moveCustomTextEditor(a,o,He.None)}async $undo(e,t,i,n){return this.getCustomDocumentEntry(t,e).undo(i,n)}async $redo(e,t,i,n){return this.getCustomDocumentEntry(t,e).redo(i,n)}async $revert(e,t,i){const n=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(n.document,i),n.disposeBackup()}async $onSave(e,t,i){const n=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(n.document,i),n.disposeBackup()}async $onSaveAs(e,t,i,n){const o=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(o.document,N.revive(i),n)}async $backup(e,t,i){const n=this.getCustomDocumentEntry(t,e),r=await this.getCustomEditorProvider(t).backupCustomDocument(n.document,{destination:n.getNewBackupUri()},i);return n.updateBackup(r),r.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,N.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!$K(i))throw new Error("Custom document is not editable");return i}}function $K(s){return!!s.onDidChangeCustomDocument}function Kti(s){return typeof s.resolveCustomTextEditor=="function"}function qti(s){return typeof s.undo=="function"&&typeof s.redo=="function"}function Qti(s){const e=s.scheme===pe.file||s.scheme===pe.untitled?s.fsPath:s.toString();return Wc(e)+""}var I0,tS,dx,Ed;const hFe=class hFe{constructor(e,t,i,n,o,r,a,c){Wt(this,tS);Wt(this,dx);Wt(this,Ed);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=n,this._modelVersionIdProvider=o,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(n,i),Ct(this,Ed,new ui(l=>r.getComparisonKey(l))),Ct(this,tS,a),Ct(this,dx,c)}dispose(){this._isDisposed||(Ce(this,dx).fire([...Ce(this,Ed).keys()]),Ce(this,tS)?.$clear(this._owner),Ce(this,Ed).clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(N.isUri(e)){if(!t){this.delete(e);return}Ce(this,Ed).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let r;e=[...e].sort(hFe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!r||c.toString()!==r.toString())&&(r&&Ce(this,Ed).get(r).length===0&&Ce(this,Ed).delete(r),r=c,i.push(c),Ce(this,Ed).set(c,[])),l)Ce(this,Ed).get(c)?.push(...l);else{const d=Ce(this,Ed).get(c);d&&(d.length=0)}}}if(Ce(this,dx).fire(i),!Ce(this,tS))return;const n=[];let o=0;for(const r of i){let a=[];const c=Ce(this,Ed).get(r);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Bd.Error,Bd.Warning,Bd.Information,Bd.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...PH.from(h),modelVersionId:this._modelVersionIdProvider(r)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Ws.Info,message:g(4582,"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=>({...PH.from(l),modelVersionId:this._modelVersionIdProvider(r)}));if(n.push([r,a]),o+=a.length,o>this._maxDiagnosticsTotal)break}Ce(this,tS).$changeMany(this._owner,n)}delete(e){this._checkDisposed(),Ce(this,dx).fire([e]),Ce(this,Ed).delete(e),Ce(this,tS)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),Ce(this,dx).fire([...Ce(this,Ed).keys()]),Ce(this,Ed).clear(),Ce(this,tS)?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,n]of this)e.call(t,i,n,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of Ce(this,Ed).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=Ce(this,Ed).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(Ce(this,Ed).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}};tS=new WeakMap,dx=new WeakMap,Ed=new WeakMap;let ane=hFe;var uy;let NIe=(uy=class{static _mapper(e){const t=new ui;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,n){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=n,this._collections=new Map,this._onDidChangeDiagnostics=new Are({merge:o=>o.flat(),delay:50}),this.onDidChangeDiagnostics=M.map(this._onDidChangeDiagnostics.event,I0._mapper),this._proxy=e.getProxy(Be.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:n,_onDidChangeDiagnostics:o,_logService:r,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){n.$changeMany(u,f),r.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){n.$clear(u),r.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){n.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+I0._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+I0._idPool++;while(i.has(d))}return new class extends ane{constructor(){super(t,d,I0._maxDiagnosticsTotal,I0._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 n of this._collections.values())n.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 ane(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,n=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(N.revive(t),i.map(PH.to))}},I0=uy,uy._idPool=0,uy._maxDiagnosticsPerFile=1e3,uy._maxDiagnosticsTotal=1.1*uy._maxDiagnosticsPerFile,uy);NIe=I0=D([_(1,Ge),_(2,jU)],NIe);class jti{constructor(e){this._proxy=e.getProxy(Be.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&Ve(e,"showLocal"),this._proxy.$showOpenDialog(t).then(i=>i?i.map(n=>N.revive(n)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?N.revive(t):void 0)}}const lre=class lre{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(Be.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(pe).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=lre._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let n;if(typeof t.onDidChange=="function"){let o;n=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=ov(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(r,c)}).catch(vt).finally(()=>{o===a&&(o=void 0)});o=a})}return new Qs(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),n&&(n.dispose(),n=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(N.revive(t),He.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};lre._handlePool=0;let PIe=lre;class Yti{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._callbacks=new hl,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,n)=>{const r={dispose:this._callbacks.push([t,i,e])};return Array.isArray(n)&&n.push(r),r}}async $participateInSave(e,t){const i=N.revive(e);let n=!1;const o=setTimeout(()=>n=!0,this._thresholds.timeout),r=[];try{for(const a of[...this._callbacks]){if(n)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:qte.to(t)});r.push(l)}}finally{clearTimeout(o)}return r}_deliverEventAsyncAndBlameBadListeners([e,t,i],n){const o=this._badListeners.get(e);return typeof o=="number"&&o>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,n).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,n){const o=[],r=Date.now(),{document:a,reason:c}=n,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(o))throw Cre("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 VA))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&et.from(v),text:p,eol:m&&WH.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jd(u)):Promise.reject(new Error("concurrent_edits"))})}}class Jti{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(Be.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const n of i)this._onDidRemoveDocument.fire(n.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const n of i)this._onDidAddDocument.fire(n.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(n=>{this._documentLoader.delete(e.toString());const o=N.revive(n);return qn(this._documentsAndEditors.getDocument(o))},n=>(this._documentLoader.delete(e.toString()),Promise.reject(n))),this._documentLoader.set(e.toString(),i)),i}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>N.revive(t))}$acceptModelLanguageChanged(e,t){const i=N.revive(e),n=this._documentsAndEditors.getDocument(i);if(!n)throw new Error("unknown document");this._onDidRemoveDocument.fire(n.document),n._acceptLanguageId(t),this._onDidAddDocument.fire(n.document)}$acceptModelSaved(e){const t=N.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=N.revive(e),n=this._documentsAndEditors.getDocument(i);if(!n)throw new Error("unknown document");n._acceptIsDirty(t),this._onDidChangeDocument.fire({document:n.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const n=N.revive(e),o=this._documentsAndEditors.getDocument(n);if(!o)throw new Error("unknown document");o._acceptIsDirty(i),o.onEvents(t);let r;t.isUndoing?r=aH.Undo:t.isRedoing&&(r=aH.Redo),this._onDidChangeDocument.fire(x6e({document:o.document,contentChanges:t.changes.map(a=>({range:et.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:r}))}setWordDefinitionFor(e,t){Fei(e,t)}}class Xti{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(Be.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const n=this._handlePool++;return this._proxy.$registerEmbeddingProvider(n,t),this._provider.set(n,{id:t,provider:i}),Ee(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(n),this._provider.delete(n)})}async computeEmbeddings(e,t,i){i??=He.None;let n=!1;typeof t=="string"&&(t=[t],n=!0);const o=await this._proxy.$computeEmbeddings(e,t,i);if(o.length!==t.length)throw new Error;if(n){if(o.length!==1)throw new Error;return o[0]}return o}async $provideEmbeddings(e,t,i){const n=this._provider.get(e);if(!n)return[];const o=await n.provider.provideEmbeddings(t,i);return o||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class Zti{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Be.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const n=this._AiEmbeddingVectorProviders.get(e);if(!n)throw new Error("Embedding vector provider not found");const o=await n.provideEmbeddingVector(t,i);if(!o)throw new Error("Embedding vector provider returned undefined");return o}registerEmbeddingVectorProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(n,i),this._proxy.$registerAiEmbeddingVectorProvider(t,n),new Qs(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(n),this._AiEmbeddingVectorProviders.delete(n)})}}class eii{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,n,o=Ri.LastKnownState,r=Ri.LastKnownState;for(const a of e){let c=i?$y(i,a):0;for(c===0?n=Ri.Start:n=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 KT.Changed:p=To.UPDATED;break;case KT.Created:p=To.ADDED;break;case KT.Deleted:p=To.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:n,size:o,permissions:r}=e;return{type:t,ctime:i,mtime:n,size:o,permissions:r}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(N.revive(t))).then(i=>cne._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(N.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(N.revive(t))).then(i=>$e.wrap(i))}$writeFile(e,t,i,n){return Promise.resolve(this._getFsProvider(e).writeFile(N.revive(t),i.buffer,n))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(N.revive(t),i))}$rename(e,t,i,n){return Promise.resolve(this._getFsProvider(e).rename(N.revive(t),N.revive(i),n))}$copy(e,t,i,n){const o=this._getFsProvider(e);if(!o.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(o.copy(N.revive(t),N.revive(i),n))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(N.revive(t)))}$watch(e,t,i,n){const o=this._getFsProvider(e).watch(N.revive(i),n);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 n=this._getFsProvider(e);if(!n.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(n.open(N.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,n){const o=this._getFsProvider(e);if(!o.read)throw new Error('FileSystemProvider does not implement "read"');const r=$e.alloc(n);return Promise.resolve(o.read(t,i,r.buffer,0,n)).then(a=>r.slice(0,a))}$write(e,t,i,n){const o=this._getFsProvider(e);if(!o.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(o.write(t,i,n.buffer,0,n.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 tii{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,n,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=j_(o),c=typeof o=="string",l=r?.correlate,d=n(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=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!r?.ignoreChangeEvents)for(const u of h.changed){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!r?.ignoreDeleteEvents)for(const u of h.deleted){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidDelete.fire(f)}}});this._disposable=Qs.from(this.ensureWatching(e,i,o,r,r?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,n,o){const r=Qs.from();if(typeof i=="string"||n?.ignoreChangeEvents&&n?.ignoreCreateEvents&&n?.ignoreDeleteEvents)return r;const a=e.getProxy(Be.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(I1)||i.pattern.includes(Nme))&&(c=!0);let l;return o&&(n?.ignoreChangeEvents||n?.ignoreCreateEvents||n?.ignoreDeleteEvents)&&(l=LE.UPDATED|LE.ADDED|LE.DELETED,n?.ignoreChangeEvents&&(l&=~LE.UPDATED),n?.ignoreCreateEvents&&(l&=~LE.ADDED),n?.ignoreDeleteEvents&&(l&=~LE.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:n?.excludes??[],filter:l},!!o),Qs.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 iii{constructor(e){this._events=e,this.session=this._events.session,this._created=new ya(()=>this._events.created.map(N.revive)),this._changed=new ya(()=>this._events.changed.map(N.revive)),this._deleted=new ya(()=>this._events.deleted.map(N.revive))}get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}}class nii{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 jx,this._onWillCreateFile=new jx,this._onWillDeleteFile=new jx,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,n){return new tii(this._mainContext,e,t,this._onFileSystemEvent.event,Gf.from(i),n)}$onFileEvent(e){this._onFileSystemEvent.fire(new iii(e))}$onDidRunFileOperation(e,t){switch(e){case Ai.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:N.revive(i.source),newUri:N.revive(i.target)}))}));break;case Ai.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>N.revive(i.target))}));break;case Ai.CREATE:case Ai.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>N.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,n,o)=>{const r=function(c){i.call(n,c)};return r.extension=e,t.event(r,void 0,o)}}async $onWillRunFileOperation(e,t,i,n){switch(e){case Ai.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(o=>({oldUri:N.revive(o.source),newUri:N.revive(o.target)}))},i,n);case Ai.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(o=>N.revive(o.target))},i,n);case Ai.CREATE:case Ai.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(o=>N.revive(o.target))},i,n)}}async _fireWillEvent(e,t,i,n){const o=new Set,r=[];if(await e.fireAsync(t,n,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof hI&&(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)}),n.isCancellationRequested||r.length===0)return;const a={edits:[]};for(const[,c]of r){const{edits:l}=Yu.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(o)}}}class sii{constructor(e,t,i,n,o){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=n;const r=new gn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new ht("showOptions","Show Options",a=>!0,a=>a),new ht("resource","Interactive resource Uri",a=>!0,a=>a),new ht("controllerId","Notebook controller Id",a=>!0,a=>a),new ht("title","Interactive editor title",a=>!0,a=>a)],new nn("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:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri),notebookEditor:c.apiEditor}}return o.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri)}}));this._commands.registerApiCommand(r)}$willAddInteractiveDocument(e,t,i,n){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class oii{constructor(e){this._handlePool=0,this._proxy=e.getProxy(Be.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}class lne{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentSymbols(i,t);if(!uU(n))return n[0]instanceof iH?n.map(OEe.from):lne._asDocumentSymbolTree(n)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((n,o)=>{let r=n.location.range.start.compareTo(o.location.range.start);return r===0&&(r=o.location.range.end.compareTo(n.location.range.end)),r});const t=[],i=[];for(const n of e){const o={name:n.name||"!!MISSING: name!!",kind:iv.from(n.kind),tags:n.tags?.map(zA.from)||[],detail:"",containerName:n.containerName,range:et.from(n.location.range),selectionRange:et.from(n.location.range),children:[]};for(;;){if(i.length===0){i.push(o),t.push(o);break}const r=i[i.length-1];if(F.containsRange(r.range,o.range)&&!F.equalsRange(r.range,o.range)){r.children?.push(o),i.push(o);break}i.pop()}}return t}}class GK{constructor(e,t,i,n,o,r){this._documents=e,this._commands=t,this._provider=i,this._extension=n,this._extTelemetry=o,this._logService=r,this._cache=new ym("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideCodeLenses(i,t);if(!n||t.isCancellationRequested)return;const o=this._cache.add(n),r=new Z;this._disposables.set(o,r);const a={cacheId:o,lenses:[]};for(let c=0;cWte.from(a))}}class $9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.provideDocumentHighlights(n,o,i);if(Array.isArray(r))return r.map(OH.from)}}class G9e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,n){const o=this._documents.getDocument(e),r=i.map(l=>this._documents.getDocument(l)),a=Yo.to(t),c=await this._provider.provideMultiDocumentHighlights(o,a,r,n);if(Array.isArray(c))return c.map(UEe.from)}}class K9e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.provideLinkedEditingRanges(n,o,i);if(r&&Array.isArray(r.ranges))return{ranges:Fi(r.ranges.map(et.from)),wordPattern:r.wordPattern}}}class q9e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=await this._provider.provideReferences(o,r,i,n);if(Array.isArray(a))return a.map(hf.from)}}const AO=class AO{constructor(e,t,i,n,o,r,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=n,this._logService=o,this._extension=r,this._apiDeprecation=a,this._cache=new ym("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,n){const o=this._documents.getDocument(e),r=dt.isISelection(t)?Wb.to(t):et.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(r.intersection(f.range)&&a.push(f)>AO._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Sa(i.only):void 0,triggerKind:txe.to(i.trigger)},l=await this._provider.provideCodeActions(o,r,c,n);if(!eo(l)||n.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;fet.to(l)),a=B_.toDataTransfer(i,()=>{throw new Irt});if(await this._provider.prepareDocumentPaste(o,r,a,n),n.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof jee));return B_.from(c)}async providePasteEdits(e,t,i,n,o,r){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>et.to(u)),l=B_.toDataTransfer(n,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:o.only?new K9(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(4583,"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?Yu.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,n]=e,o=this._cache.get(i,n);if(!o||!this._provider.resolveDocumentPasteEdit)return{};const r=await this._provider.resolveDocumentPasteEdit(o,t)??o;return{additionalEdit:r.additionalEdit?Yu.from(r.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class Q9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideDocumentFormattingEdits(n,t,i);if(Array.isArray(o))return o.map(od.from)}}class Xue{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,n){const o=this._documents.getDocument(e),r=et.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(o,r,i,n);if(Array.isArray(a))return a.map(od.from)}async provideDocumentRangesFormattingEdits(e,t,i,n){Tt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const o=this._documents.getDocument(e),r=t.map(et.to),a=await this._provider.provideDocumentRangesFormattingEdits(o,r,i,n);if(Array.isArray(a))return a.map(od.from)}}class j9e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,n,o){const r=this._documents.getDocument(e),a=Yo.to(t),c=await this._provider.provideOnTypeFormattingEdits(r,a,i,n,o);if(Array.isArray(c))return c.map(od.from)}}class KK{constructor(e,t){this._provider=e,this._logService=t,this._cache=new ym("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!eo(i))return{symbols:[]};const n=this._cache.add(i),o={cacheId:n,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(t8._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}};t8.languageTriggerKindToVSCodeTriggerKind={[mM.Invoke]:gH.Invoke,[mM.Automatic]:gH.Automatic};let Iz=t8;class Zue{constructor(e,t){this.resultId=e,this.tokens=t}}class Lf{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const n=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(n,o.resultId,i):await this._provider.provideDocumentSemanticTokens(n,i);return o&&this._previousResults.delete(t),r?(r=Lf._fixProvidedSemanticTokens(r),this._send(Lf._convertToEdits(o,r),r)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return Lf._isSemanticTokens(e)?Lf._isCorrectSemanticTokens(e)?e:new aN(new Uint32Array(e.data),e.resultId):Lf._isSemanticTokensEdits(e)?Lf._isCorrectSemanticTokensEdits(e)?e:new oz(e.edits.map(t=>new GNe(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(!Lf._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,n=i.length,o=t.data,r=o.length;let a=0;const c=Math.min(n,r);for(;a({start:n.start,deleteCount:n.deleteCount,data:n.data}))})}return null}}class Y9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideDocumentRangeSemanticTokens(n,et.to(t),i);return o?this._send(o):null}_send(e){return d9({id:0,type:"full",data:e.data})}}class a1{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,n,o){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=n,this._extension=o,this._cache=new ym("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=o.getWordRangeAtPosition(r)||new Jn(r,r),c=a.with({end:r}),l=new js,d=await this._provider.provideCompletionItems(o,r,n,zEe.to(i));if(!d||n.isCancellationRequested)return;const h=Array.isArray(d)?new tN(d):d,u=a1.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[Ay.completions]:p,[Ay.defaultRanges]:{replace:et.from(a),insert:et.from(c)},[Ay.isIncomplete]:h.isIncomplete||void 0,[Ay.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Ps.fromStrict(e.documentation),[Li.sortText]:e.sortText!==e.label?e.sortText:void 0,[Li.filterText]:e.filterText!==e.label?e.filterText:void 0,[Li.preselect]:e.preselect||void 0,[Li.insertTextRules]:e.keepWhitespace?Yg.KeepWhitespace:Yg.None,[Li.commitCharacters]:e.commitCharacters?.join(""),[Li.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(od.from),[Li.commandIdent]:r?.$ident,[Li.commandId]:r?.id,[Li.commandArguments]:r?.$ident?void 0:r?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Li.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Li.insertText]=e.insertText:e.insertText instanceof uI&&(a[Li.insertText]=e.insertText.value,a[Li.insertTextRules]|=Yg.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),Jn.isRange(c)?a[Li.range]=et.from(c):c&&(!i?.isEqual(c.inserting)||!n?.isEqual(c.replacing))&&(a[Li.range]={insert:et.from(c.inserting),replace:et.from(c.replacing)}),a}}class jP{async provideInlineCompletions(e,t,i,n){}async provideInlineEdits(e,t,i,n){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,n){}}class rii extends jP{constructor(e,t,i,n){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=n,this._references=new _ot,this._isAdditionsProposedApiEnabled=dl(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[em.Automatic]:uH.Automatic,[em.Explicit]:uH.Invoke}}get supportsHandleEvents(){return dl(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=await this._provider.provideInlineCompletionItems(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:et.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind]},n);if(!a||n.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?et.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}}async provideInlineEdits(e,t,i,n){if(!this._provider.provideInlineEdits)return;Ve(this._extension,"inlineCompletionsAdditions");const o=this._documents.getDocument(e),r=et.to(t),a=await this._provider.provideInlineEdits(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:et.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind],userPrompt:i.userPrompt},n);if(!a||n.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?et.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 n=this._references.get(e)?.items[t];n&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(n,i)}handlePartialAccept(e,t,i,n){const o=this._references.get(e)?.items[t];o&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(o,i),this._provider.handleDidPartiallyAcceptCompletionItem(o,axe.to(n)))}}class ege{async provideInlineEdits(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideInlineEdit(n,{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:et.from(o.range),accepted:c,rejected:l}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,n){this._documents=t,this._provider=i,this._commands=n,this._references=new _ot,this.languageTriggerKindToVSCodeTriggerKind={[L2.Automatic]:IH.Automatic,[L2.Invoke]:IH.Invoke}}}class _ot{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 tge{constructor(e,t){this._documents=e,this._provider=t,this._cache=new ym("SignatureHelp")}async provideSignatureHelp(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(o,r,n,a);if(c){const l=this._cache.add([c]);return{...y$.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=y$.to(e.activeSignatureHelp),n=this._cache.get(e.activeSignatureHelp.id,0);n?(t=n,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class qK{constructor(e,t,i,n,o){this._documents=e,this._commands=t,this._provider=i,this._logService=n,this._extension=o,this._cache=new ym("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const n=this._documents.getDocument(e),o=et.to(t),r=await this._provider.provideInlayHints(n,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 n={label:"",cacheId:t,tooltip:Ps.fromStrict(e.tooltip),position:Yo.from(e.position),textEdits:e.textEdits&&e.textEdits.map(od.from),kind:e.kind&&Gte.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")n.label=e.label;else{const o=[];n.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:Ps.fromStrict(r.tooltip)};yp.isLocation(r.location)&&(a.location=hf.from(r.location)),r.command&&(a.command=this._commands.toInternal(r.command,i)),o.push(a)}}return n}}class Qx{constructor(e,t){this._documents=e,this._provider=t,this._cache=new ym("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(n)||n.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:n.filter(Qx._validateLink).map(XT.from)};{const o=this._cache.add(n),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 n=await this._provider.resolveDocumentLink(i,t);if(!(!n||!Qx._validateLink(n)))return XT.from(n)}releaseLinks(e){this._cache.delete(e)}}class ige{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentColors(i,t);return Array.isArray(n)?n.map(r=>({color:BH.from(r.color),range:et.from(r.range)})):[]}async provideColorPresentations(e,t,i){const n=this._documents.getDocument(e),o=et.to(t.range),r=BH.to(t.color),a=await this._provider.provideColorPresentations(r,{document:n,range:o},i);if(Array.isArray(a))return a.map(Kte.from)}}class J9e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideFoldingRanges(n,t,i);if(Array.isArray(o))return o.map(Qte.from)}}class X9e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const n=this._documents.getDocument(e),o=t.map(Yo.to),r=await this._provider.provideSelectionRanges(n,o,i);if(!eo(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 n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyIncomingCalls(n,i);if(o)return o.map(r=>({from:this._cacheAndConvertItem(e,r.from),fromRanges:r.fromRanges.map(a=>et.from(a))}))}async provideCallsFrom(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyOutgoingCalls(n,i);if(o)return o.map(r=>({to:this._cacheAndConvertItem(e,r.to),fromRanges:r.fromRanges.map(a=>et.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=gN.from(t,e,i.size.toString(36));return i.set(n._itemId,t),n}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class F4{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new DU(""),this._cache=new Map}async prepareSession(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.prepareTypeHierarchy(n,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 n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySupertypes(n,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}async provideSubtypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySubtypes(n,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),n=ZT.from(t,e,i.size.toString(36));return i.set(n._itemId,t),n}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class QK{constructor(e,t,i,n,o){this._proxy=e,this._documents=t,this._provider=i,this._handle=n,this._extension=o,this._cache=new ym("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,n,o){const r=this._documents.getDocument(t),a=Yo.to(i),c=B_.toDataTransfer(n,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=H_(l),h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(4584,"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?Yu.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,n]=e,o=this._cache.get(i,n);if(!o||!this._provider.resolveDocumentDropEdit)return{};const r=await this._provider.resolveDocumentDropEdit(o,t)??o;return{additionalEdit:r.additionalEdit?Yu.from(r.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class Z9e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,n){const o=N.revive(e),r=this._documents.getDocument(o),a=i.documents.map(d=>d.map(h=>({uri:N.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>et.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(r,t,c,n);return l?Yu.from(l):null}}class O4{constructor(e,t){this.adapter=e,this.extension=t}}const Yc=class Yc{constructor(e,t,i,n,o,r,a,c){this._uriTransformer=t,this._documents=i,this._commands=n,this._diagnostics=o,this._logService=r,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(Be.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return NH.from(e,this._uriTransformer,t)}_createDisposable(e){return new Qs(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Yc._handlePool++}async _withAdapter(e,t,i,n,o,r=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return n;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=>{Fr(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`)}),He.isCancellationToken(o)?Mre(l,o):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new O4(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,n){const o=this._addNewAdapter(new lne(this._documents,i),e),r=n&&n.label||Yc._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,lne,n=>n.provideDocumentSymbols(N.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const n=this._nextHandle(),o=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(n,new O4(new GK(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(n,this._transformDocumentSelector(t,e),o);let r=this._createDisposable(n);if(o!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(o));r=Qs.from(r,a)}return r}$provideCodeLenses(e,t,i){return this._withAdapter(e,GK,n=>n.provideCodeLenses(N.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,GK,n=>n.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,GK,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const n=this._addNewAdapter(new B9e(this._documents,i),e);return this._proxy.$registerDefinitionSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDefinition(e,t,i,n){return this._withAdapter(e,B9e,o=>o.provideDefinition(N.revive(t),i,n),[],n)}registerDeclarationProvider(e,t,i){const n=this._addNewAdapter(new W9e(this._documents,i),e);return this._proxy.$registerDeclarationSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDeclaration(e,t,i,n){return this._withAdapter(e,W9e,o=>o.provideDeclaration(N.revive(t),i,n),[],n)}registerImplementationProvider(e,t,i){const n=this._addNewAdapter(new H9e(this._documents,i),e);return this._proxy.$registerImplementationSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideImplementation(e,t,i,n){return this._withAdapter(e,H9e,o=>o.provideImplementation(N.revive(t),i,n),[],n)}registerTypeDefinitionProvider(e,t,i){const n=this._addNewAdapter(new U9e(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideTypeDefinition(e,t,i,n){return this._withAdapter(e,U9e,o=>o.provideTypeDefinition(N.revive(t),i,n),[],n)}registerHoverProvider(e,t,i,n){const o=this._addNewAdapter(new kz(this._documents,i),e);return this._proxy.$registerHoverProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideHover(e,t,i,n,o){return this._withAdapter(e,kz,r=>r.provideHover(N.revive(t),i,n,o),void 0,o)}$releaseHover(e,t){this._withAdapter(e,kz,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,n){const o=this._addNewAdapter(new V9e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideEvaluatableExpression(e,t,i,n){return this._withAdapter(e,V9e,o=>o.provideEvaluatableExpression(N.revive(t),i,n),void 0,n)}registerInlineValuesProvider(e,t,i,n){const o=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new z9e(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=Qs.from(a,c)}return a}$provideInlineValues(e,t,i,n,o){return this._withAdapter(e,z9e,r=>r.provideInlineValues(N.revive(t),i,n,o),void 0,o)}registerDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new $9e(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}registerMultiDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new G9e(this._documents,i),e);return this._proxy.$registerMultiDocumentHighlightProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentHighlights(e,t,i,n){return this._withAdapter(e,$9e,o=>o.provideDocumentHighlights(N.revive(t),i,n),void 0,n)}$provideMultiDocumentHighlights(e,t,i,n,o){return this._withAdapter(e,G9e,r=>r.provideMultiDocumentHighlights(N.revive(t),i,n.map(a=>N.revive(a)),o),void 0,o)}registerLinkedEditingRangeProvider(e,t,i){const n=this._addNewAdapter(new K9e(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideLinkedEditingRanges(e,t,i,n){return this._withAdapter(e,K9e,async o=>{const r=await o.provideLinkedEditingRanges(N.revive(t),i,n);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?Yc._serializeRegExp(r.wordPattern):void 0}},void 0,n)}registerReferenceProvider(e,t,i){const n=this._addNewAdapter(new q9e(this._documents,i),e);return this._proxy.$registerReferenceSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideReferences(e,t,i,n,o){return this._withAdapter(e,q9e,r=>r.provideReferences(N.revive(t),i,n,o),void 0,o)}registerCodeActionProvider(e,t,i,n){const o=new Z,r=this._addNewAdapter(new OF(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(r,this._transformDocumentSelector(t,e),{providedKinds:n?.providedCodeActionKinds?.map(a=>a.value),documentation:n?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,o)}))},Yc._extLabel(e),Yc._extId(e),!!i.resolveCodeAction),o.add(this._createDisposable(r)),o}$provideCodeActions(e,t,i,n,o){return this._withAdapter(e,OF,r=>r.provideCodeActions(N.revive(t),i,n,o),void 0,o)}$resolveCodeAction(e,t,i){return this._withAdapter(e,OF,n=>n.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,OF,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const n=this._addNewAdapter(new Q9e(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(n,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(n)}$provideDocumentFormattingEdits(e,t,i,n){return this._withAdapter(e,Q9e,o=>o.provideDocumentFormattingEdits(N.revive(t),i,n),void 0,n)}registerDocumentRangeFormattingEditProvider(e,t,i){const n=typeof i.provideDocumentRangesFormattingEdits=="function",o=this._addNewAdapter(new Xue(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(o,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,n),this._createDisposable(o)}$provideDocumentRangeFormattingEdits(e,t,i,n,o){return this._withAdapter(e,Xue,r=>r.provideDocumentRangeFormattingEdits(N.revive(t),i,n,o),void 0,o)}$provideDocumentRangesFormattingEdits(e,t,i,n,o){return this._withAdapter(e,Xue,r=>r.provideDocumentRangesFormattingEdits(N.revive(t),i,n,o),void 0,o)}registerOnTypeFormattingEditProvider(e,t,i,n){const o=this._addNewAdapter(new j9e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(o,this._transformDocumentSelector(t,e),n,e.identifier),this._createDisposable(o)}$provideOnTypeFormattingEdits(e,t,i,n,o,r){return this._withAdapter(e,j9e,a=>a.provideOnTypeFormattingEdits(N.revive(t),i,n,o,r),void 0,r)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new KK(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,KK,n=>n.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,KK,n=>n.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,KK,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const n=this._addNewAdapter(new $1(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(n,this._transformDocumentSelector(t,e),$1.supportsResolving(i)),this._createDisposable(n)}$provideRenameEdits(e,t,i,n,o){return this._withAdapter(e,$1,r=>r.provideRenameEdits(N.revive(t),i,n,o),void 0,o)}$resolveRenameLocation(e,t,i,n){return this._withAdapter(e,$1,o=>o.resolveRenameLocation(N.revive(t),i,n),void 0,n)}registerNewSymbolNamesProvider(e,t,i){const n=this._addNewAdapter(new Iz(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,Iz,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,n,o){return this._withAdapter(e,Iz,r=>r.provideNewSymbolNames(N.revive(t),i,n,o),void 0,o)}registerDocumentSemanticTokensProvider(e,t,i,n){const o=this._addNewAdapter(new Lf(this._documents,i),e),r=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(o,this._transformDocumentSelector(t,e),n,r);let a=this._createDisposable(o);if(r){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(r));a=Qs.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,n){return this._withAdapter(e,Lf,o=>o.provideDocumentSemanticTokens(N.revive(t),i,n),null,n)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,Lf,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,n){const o=this._addNewAdapter(new Y9e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(o,this._transformDocumentSelector(t,e),n),this._createDisposable(o)}$provideDocumentRangeSemanticTokens(e,t,i,n){return this._withAdapter(e,Y9e,o=>o.provideDocumentRangeSemanticTokens(N.revive(t),i,n),null,n)}registerCompletionItemProvider(e,t,i,n){const o=this._addNewAdapter(new a1(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(o,this._transformDocumentSelector(t,e),n,a1.supportsResolving(i),e.identifier),this._createDisposable(o)}$provideCompletionItems(e,t,i,n,o){return this._withAdapter(e,a1,r=>r.provideCompletionItems(N.revive(t),i,n,o),void 0,o)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,a1,n=>n.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,a1,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,n){const o=new rii(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(o,e);return this._proxy.$registerInlineCompletionsSupport(r,this._transformDocumentSelector(t,e),o.supportsHandleEvents,Sn.toKey(e.identifier.value),n?.yieldTo?.map(a=>Sn.toKey(a))||[]),this._createDisposable(r)}$provideInlineCompletions(e,t,i,n,o){return this._withAdapter(e,jP,r=>r.provideInlineCompletions(N.revive(t),i,n,o),void 0,o)}$provideInlineEdits(e,t,i,n,o){return this._withAdapter(e,jP,r=>r.provideInlineEdits(N.revive(t),i,n,o),void 0,o)}$handleInlineCompletionDidShow(e,t,i,n){this._withAdapter(e,jP,async o=>{o.handleDidShowCompletionItem(t,i,n)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,n,o){this._withAdapter(e,jP,async r=>{r.handlePartialAccept(t,i,n,o)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,jP,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const n=new ege(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(n,e);return this._proxy.$registerInlineEditProvider(o,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(o)}$provideInlineEdit(e,t,i,n){return this._withAdapter(e,ege,o=>o.provideInlineEdits(N.revive(t),i,n),void 0,n)}$freeInlineEdit(e,t){this._withAdapter(e,ege,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,n){const o=Array.isArray(n)?{triggerCharacters:n,retriggerCharacters:[]}:n,r=this._addNewAdapter(new tge(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideSignatureHelp(e,t,i,n,o){return this._withAdapter(e,tge,r=>r.provideSignatureHelp(N.revive(t),i,n,o),void 0,o)}$releaseSignatureHelp(e,t){this._withAdapter(e,tge,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const n=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new qK(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(o,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",n,Yc._extLabel(e));let r=this._createDisposable(o);if(n!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(n));r=Qs.from(r,a)}return r}$provideInlayHints(e,t,i,n){return this._withAdapter(e,qK,o=>o.provideInlayHints(N.revive(t),i,n),void 0,n)}$resolveInlayHint(e,t,i){return this._withAdapter(e,qK,n=>n.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,qK,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const n=this._addNewAdapter(new Qx(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(n,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(n)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,Qx,n=>n.provideLinks(N.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,Qx,n=>n.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,Qx,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const n=this._addNewAdapter(new ige(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentColors(e,t,i){return this._withAdapter(e,ige,n=>n.provideColors(N.revive(t),i),[],i)}$provideColorPresentations(e,t,i,n){return this._withAdapter(e,ige,o=>o.provideColorPresentations(N.revive(t),i,n),void 0,n)}registerFoldingRangeProvider(e,t,i){const n=this._nextHandle(),o=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(n,new O4(new J9e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(n,this._transformDocumentSelector(t,e),e.identifier,o);let r=this._createDisposable(n);if(o!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(o));r=Qs.from(r,a)}return r}$provideFoldingRanges(e,t,i,n){return this._withAdapter(e,J9e,o=>o.provideFoldingRanges(N.revive(t),i,n),void 0,n)}registerSelectionRangeProvider(e,t,i){const n=this._addNewAdapter(new X9e(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideSelectionRanges(e,t,i,n){return this._withAdapter(e,X9e,o=>o.provideSelectionRanges(N.revive(t),i,n),[],n)}registerCallHierarchyProvider(e,t,i){const n=this._addNewAdapter(new P4(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$prepareCallHierarchy(e,t,i,n){return this._withAdapter(e,P4,o=>Promise.resolve(o.prepareSession(N.revive(t),i,n)),void 0,n)}$provideCallHierarchyIncomingCalls(e,t,i,n){return this._withAdapter(e,P4,o=>o.provideCallsTo(t,i,n),void 0,n)}$provideCallHierarchyOutgoingCalls(e,t,i,n){return this._withAdapter(e,P4,o=>o.provideCallsFrom(t,i,n),void 0,n)}$releaseCallHierarchy(e,t){this._withAdapter(e,P4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const n=this._addNewAdapter(new F4(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$prepareTypeHierarchy(e,t,i,n){return this._withAdapter(e,F4,o=>Promise.resolve(o.prepareSession(N.revive(t),i,n)),void 0,n)}$provideTypeHierarchySupertypes(e,t,i,n){return this._withAdapter(e,F4,o=>o.provideSupertypes(t,i,n),void 0,n)}$provideTypeHierarchySubtypes(e,t,i,n){return this._withAdapter(e,F4,o=>o.provideSubtypes(t,i,n),void 0,n)}$releaseTypeHierarchy(e,t){this._withAdapter(e,F4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,n){const o=this._nextHandle();return this._adapter.set(o,new O4(new QK(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerDocumentOnDropEditProvider(o,this._transformDocumentSelector(t,e),dl(e,"documentPaste")&&n?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:n.dropMimeTypes}:void 0),this._createDisposable(o)}$provideDocumentOnDropEdits(e,t,i,n,o,r){return this._withAdapter(e,QK,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,N.revive(i),n,o,r)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,QK,n=>n.resolveDropEdit(t,i),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,QK,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const n=this._addNewAdapter(new Z9e(this._documents,i),e);return this._proxy.$registerMappedEditsProvider(n,this._transformDocumentSelector(t,e),e.displayName??e.name),this._createDisposable(n)}$provideMappedEdits(e,t,i,n,o){return this._withAdapter(e,Z9e,r=>Promise.resolve(r.provideMappedEdits(t,i,n,o)),null,o)}registerDocumentPasteEditProvider(e,t,i,n){const o=this._nextHandle();return this._adapter.set(o,new O4(new N4(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:n.providedPasteEditKinds?.map(r=>r.value),copyMimeTypes:n.copyMimeTypes,pasteMimeTypes:n.pasteMimeTypes}),this._createDisposable(o)}$prepareDocumentPaste(e,t,i,n,o){return this._withAdapter(e,N4,r=>r.prepareDocumentPaste(N.revive(t),i,n,o),void 0,o)}$providePasteEdits(e,t,i,n,o,r,a){return this._withAdapter(e,N4,c=>c.providePasteEdits(t,N.revive(i),n,o,r,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,N4,n=>n.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,N4,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:Yc._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Yc._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Yc._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Yc._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Yc._serializeRegExp(e.beforeText),afterText:e.afterText?Yc._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Yc._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Yc._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>nN.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Yc._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:n}=i;if(n&&J1e(n))throw new Error(`Invalid language configuration: wordPattern '${n}' is not allowed to match the empty string.`);n?this._documents.setWordDefinitionFor(t,n):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?Yc._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Yc._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Yc._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Yc._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))}};Yc._handlePool=0;let FIe=Yc;class aii{constructor(e){this._registeredTools=new Map,this._allTools=new Map,this._proxy=e.getProxy(Be.MainThreadLanguageModelTools),this._proxy.$getTools().then(t=>{for(const i of t)this._allTools.set(i.name,Mo(i))})}async invokeTool(e,t,i){return await this._proxy.$invokeTool(e,t,i)}async $acceptToolDelta(e){e.added&&this._allTools.set(e.added.name,e.added),e.removed&&this._allTools.delete(e.removed)}get tools(){return Array.from(this._allTools.values()).map(e=>dxe.to(e))}async $invokeTool(e,t,i){const n=this._registeredTools.get(e);if(!n)throw new Error(`Unknown tool ${e}`);return await n.tool.invoke(t,i)}registerTool(e,t,i){return this._registeredTools.set(t,{extension:e,tool:i}),this._proxy.$registerTool(t),Ee(()=>{this._registeredTools.delete(t),this._proxy.$unregisterTool(t)})}}class cii{constructor(e,t,i,n){this._documents=t,this._commands=i,this._uriTransformer=n,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(Be.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,n=Yo.from(t),o=await this._proxy.$tokensAtPosition(e.uri,n),r={type:LS.Other,range:e.getWordRangeAtPosition(t)??new Jn(t.line,t.character,t.line,t.character)};if(!o)return r;const a={range:et.to(o.range),type:NEe.to(o.type)};return!a.range.contains(t)||i!==e.version?r:a}createLanguageStatusItem(e,t,i){const n=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:UT.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=jy(()=>{d.clear(),this._proxy.$setLanguageStatus(n,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:NH.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===UT.Error?Xe.Error:c.severity===UT.Warning?Xe.Warning:Xe.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(n),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){Ve(e,"languageStatusText"),c.text=f,h()},get text2(){return Ve(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 lii(s){return s&&s.title}let OIe=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(Be.MainThreadMessageService)}showMessage(e,t,i,n,o){const r={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof n=="string"||lii(n)?a=[n,...o]:(r.modal=n?.modal,r.useCustom=n?.useCustom,r.detail=n?.detail,a=o),r.useCustom&&Ve(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};OIe=D([_(1,Ge)],OIe);class nge{constructor(e,t,i,n){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=n}asApiEvent(){return{range:new Sy(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class BIe{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=N.revive(i.uri),this.cellKind=i.cellKind,this._outputs=i.outputs.map(pI.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(HH.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:C$.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(n){e._mime=n},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(pI.to)}setOutputItems(e,t,i){const n=i.map(UH.to),o=this._outputs.find(r=>r.id===e);if(o&&(t||(o.items.length=0),o.items.push(...n),o.items.length>1&&o.items.every(r=>Yit(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=P9t(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(HH.to(e))}setMime(e){}}const hre=class hre{constructor(e,t,i,n,o){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=n,this.handle=hre._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===pe.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()},[Symbol.for("debug.description")](){return`NotebookDocument(${this.uri.toString()})`}};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 n={notebook:this.apiNotebook,metadata:i,cellChanges:[],contentChanges:[]},o=[];for(const a of e.rawEvents)a.kind===Sl.ModelChange?this._spliceNotebookCells(a.changes,!1,n.contentChanges):a.kind===Sl.Move?this._moveCells(a.index,a.length,a.newIdx,n.contentChanges):a.kind===Sl.Output?(this._setCellOutputs(a.index,a.outputs),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===Sl.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===Sl.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===Sl.ChangeCellContent?o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===Sl.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===Sl.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),o.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===Sl.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 BIe(this,this._textDocumentsAndEditors,u);return t||o.push(BIe.asModelAddData(u)),f}),d=new nge(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);n.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:o,removedDocuments:r}),i)for(const a of n)i.push(a.asApiEvent())}_moveCells(e,t,i,n){const o=this._cells.splice(e,t);this._cells.splice(i,0,...o);const r=[new nge(e,t,o.map(a=>a.apiCell),[]),new nge(i,0,[],o)];for(const a of r)n.push(a.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,i,n){this._cells[e].setOutputItems(t,i,n)}_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)}};hre._handlePool=0;let WIe=hre;const ure=class ure{constructor(e,t,i,n,o,r){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=o,this._visibleRanges=n,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(Sy.isNotebookRange))throw Pi("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,Wy.from(t),i??s$.Default)},get viewColumn(){return e._viewColumn},[Symbol.for("debug.description")](){return`NotebookEditor(${this.notebook.uri.toString()})`}},ure.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(Wy.from))}_acceptViewColumn(e){this._viewColumn=e}};ure.apiEditorsToExtHost=new WeakMap;let i7=ure;class dii extends V{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 F(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 n3;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:n}=t.create(Sb.LF);this._inputTextBuffer=i,this._register(n)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new n3;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:n,disposable:o}=i.create(Sb.LF);return this._register(o),n})),this._outputTextBuffers}findInInputs(e){const i=new GC(e,!1,!1,null).parseSearchRequest();if(!i)return[];const n=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(n,i,!0,5e3)}findInOutputs(e){const i=new GC(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(n=>{const o=n.findMatchesLineByLine(this._getFullModelRange(n),i,!0,5e3);if(o.length!==0)return{textBuffer:n,matches:o}}).filter(n=>!!n):[]}}function e$e(s,e){let t=-1;const i=[];let n=[];return s.forEach(r=>{r.range.startLineNumber!==t&&n.length>0&&(i.push([...n]),n=[]),n.push(r),t=r.range.endLineNumber}),n.length>0&&i.push([...n]),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 d3t(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 Nei{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,n)=>e.call(t,n,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 qke=class extends Kke{constructor(e,t){super(!1,e,t)}createTerminal(e,t,i){throw new oS}createTerminalFromOptions(e,t){throw new oS}};qke=D([_(0,KN),_(1,Jo)],qke);function Qst(s){if(!(!s||typeof s=="string"))return"id"in s?{id:s.id,color:s.color}:s}function Pei(s){return M2.isThemeColor(s)?s:void 0}function g9e(s){const e={...s};return delete e.scope,e.options=e.options??void 0,delete e.variable,e}const ile=ae("IExtHostApiDeprecationService");let Qke=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(Be.MainThreadTelemetry)}report(e,t,i){const n=this.getUsageKey(e,t);this._reportedUsages.has(n)||(this._reportedUsages.add(n),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}`}};Qke=D([_(0,Jo),_(1,Ge)],Qke);var ene;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(ene||(ene={}));var tne;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(tne||(tne={}));var jke;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(jke||(jke={}));var Cz;(function(s){function e(n){if(n){const o=n;return o&&!!o.process}else return!1}s.is=e;function t(n){if(n==null)return;const o={process:n.process,args:n.args};return n.options&&(o.options=jke.from(n.options)),o}s.from=t;function i(n){if(n!=null)return new tN(n.process,n.args,n.options)}s.to=i})(Cz||(Cz={}));var Yke;(function(s){function e(i){if(i!=null)return i}s.from=e;function t(i){if(i!=null)return i}s.to=t})(Yke||(Yke={}));var Sz;(function(s){function e(n){if(n){const o=n;return o&&(!!o.commandLine||!!o.command)}else return!1}s.is=e;function t(n){if(n==null)return;const o={};return n.commandLine!==void 0?o.commandLine=n.commandLine:(o.command=n.command,o.args=n.args),n.options&&(o.options=Yke.from(n.options)),o}s.from=t;function i(n){if(!(n==null||n.command===void 0&&n.commandLine===void 0))return n.commandLine?new cI(n.commandLine,n.options):new cI(n.command,n.args?n.args:[],n.options)}s.to=i})(Sz||(Sz={}));var mA;(function(s){function e(n){if(n){const o=n;return o&&o.customExecution==="customExecution"}else return!1}s.is=e;function t(n){return{customExecution:"customExecution"}}s.from=t;function i(n,o){return o.get(n)}s.to=i})(mA||(mA={}));var Jke;(function(s){function e(t){if(t!=null)return{_id:t.id,isDefault:t.isDefault}}s.from=e})(Jke||(Jke={}));var zx;(function(s){function e(n,o){if(n==null)return[];const r=[];for(const a of n){const c=t(a,o);c&&r.push(c)}return r}s.fromMany=e;function t(n,o){if(n==null)return;let r;n.execution instanceof tN?r=Cz.from(n.execution):n.execution instanceof cI?r=Sz.from(n.execution):n.execution&&n.execution instanceof Rce&&(r=mA.from(n.execution));const a=ene.from(n.definition);let c;return n.scope?typeof n.scope=="number"?c=n.scope:c=n.scope.uri:c=lI.Workspace,!a||!c?void 0:{_id:n._id,definition:a,name:n.name,source:{extensionId:o.identifier.value,label:n.source,scope:c},execution:r,isBackground:n.isBackground,group:Jke.from(n.group),presentationOptions:tne.from(n.presentationOptions),problemMatchers:n.problemMatchers,hasDefinedMatchers:n.hasDefinedMatchers,runOptions:n.runOptions?n.runOptions:{reevaluateOnRerun:!0},detail:n.detail}}s.from=t;async function i(n,o,r){if(n==null)return;let a;Cz.is(n.execution)?a=Cz.to(n.execution):Sz.is(n.execution)?a=Sz.to(n.execution):mA.is(n.execution)&&(a=mA.to(n._id,r));const c=ene.to(n.definition);let l;if(n.source&&(n.source.scope!==void 0?typeof n.source.scope=="number"?l=n.source.scope:l=await o.resolveWorkspaceFolder(N.revive(n.source.scope)):l=lI.Workspace),!c||!l)return;const d=new H9(c,l,n.name,n.source.label,a,n.problemMatchers);return n.isBackground!==void 0&&(d.isBackground=n.isBackground),n.group!==void 0&&(d.group=sH.from(n.group._id),d.group&&n.group.isDefault&&(d.group=new sH(d.group.id,d.group.label),n.group.isDefault===!0&&(d.group.isDefault=n.group.isDefault))),n.presentationOptions&&(d.presentationOptions=tne.to(n.presentationOptions)),n._id&&(d._id=n._id),n.detail&&(d.detail=n.detail),d}s.to=i})(zx||(zx={}));var Xke;(function(s){function e(i){return i}s.from=e;function t(i){if(i)return Object.assign(Object.create(null),i)}s.to=t})(Xke||(Xke={}));var g7;class zue{constructor(e,t,i){Wt(this,g7);this._id=t,this._task=i,Ct(this,g7,e)}get task(){return this._task}terminate(){Ce(this,g7).terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}}g7=new WeakMap;let Zke=class{constructor(e,t,i,n,o,r,a,c){this._onDidExecuteTask=new I,this._onDidTerminateTask=new I,this._onDidTaskProcessStarted=new I,this._onDidTaskProcessEnded=new I,this._proxy=e.getProxy(Be.MainThreadTask),this._workspaceProvider=i,this._editorService=n,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 Qs(()=>{});const n=this.nextHandle();return this._handlers.set(n,{type:t,provider:i,extension:e}),this._proxy.$registerTaskProvider(n,t),new Qs(()=>{this._handlers.delete(n),this._proxy.$unregisterTaskProvider(n)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(Xke.from(e)).then(async t=>{const i=[];for(const n of t){const o=await zx.to(n,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 zue))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 n=this._providedCustomExecutions2.get(e.id);n&&(this._activeCustomExecutions2.set(e.id,n),this._terminalService.attachPtyToTerminal(t,await n.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 n=[],o=Qh(()=>i.provider.provideTasks(He.None)).then(r=>this.provideTasksInternal(t,n,i,r));return new Promise(r=>{o.then(a=>{Promise.all(n).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 n=await zx.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!n)throw new Error("Unexpected: Task cannot be resolved.");const o=await i.provider.resolveTask(n,He.None);if(!o)return;this.checkDeprecation(o,i);const r=zx.from(o,i.extension);if(!r)throw new Error("Unexpected: Task cannot be resolved.");if(o.definition!==n.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 mA.is(r.execution)&&await this.addCustomExecution(r,o,!0),await this.resolveTaskInternal(r)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,i){const n=await this._proxy.$createTaskId(e);!i&&!this._providedCustomExecutions2.has(n)&&(this._notProvidedCustomExecutions.add(n),this._activeCustomExecutions2.set(n,t.execution)),this._providedCustomExecutions2.set(n,t.execution)}async getTaskExecution(e,t){if(typeof e=="string"){const o=this._taskExecutionPromises.get(e);if(!o)throw new La("Unexpected: The specified task is missing an execution");return o}const i=this._taskExecutionPromises.get(e.id);if(i)return i;let n;return t?n=Promise.resolve(new zue(this,e.id,t)):n=zx.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(o=>{if(!o)throw new La("Unexpected: Task does not exist.");return new zue(this,e.id,o)}),this._taskExecutionPromises.set(e.id,n),n.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 n=i.next();for(;!n.done;)!this._activeCustomExecutions2.has(n.value)&&this._lastStartedTask!==n.value&&(this._providedCustomExecutions2.delete(n.value),this._notProvidedCustomExecutions.delete(n.value)),n=i.next()}};Zke=D([_(0,Jo),_(1,mu),_(2,nE),_(3,GU),_(4,sE),_(5,KU),_(6,Ge),_(7,ile)],Zke);let eIe=class extends Zke{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,o,r,a,c),this.registerTaskSystem(pe.vscodeRemote,{scheme:pe.vscodeRemote,authority:"",platform:urt($d.Web)})}async executeTask(e,t){if(!t.execution)throw new Error("Tasks to execute must include an execution");const i=zx.from(t,e);if(i===void 0)throw new Error("Task is not valid");if(mA.is(i.execution))await this.addCustomExecution(i,t,!1);else throw new oS;const n=await this.getTaskExecution(await this._proxy.$getTaskExecution(i),t);return this._proxy.$executeTask(i).catch(o=>{throw new Error(o)}),n}provideTasksInternal(e,t,i,n){const o=[];if(n)for(const r of n){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=zx.from(r,i.extension);a&&mA.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(mA.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){}};eIe=D([_(0,Jo),_(1,mu),_(2,nE),_(3,GU),_(4,sE),_(5,KU),_(6,Ge),_(7,ile)],eIe);const jst=ae("IExtHostTask"),dG=ae("IExtHostEditorTabs");class f9e{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 ha.TextInput:return new Nce(N.revive(this._dto.input.uri));case ha.TextDiffInput:return new o$(N.revive(this._dto.input.original),N.revive(this._dto.input.modified));case ha.TextMergeInput:return new ONe(N.revive(this._dto.input.base),N.revive(this._dto.input.input1),N.revive(this._dto.input.input2),N.revive(this._dto.input.result));case ha.CustomEditorInput:return new Pce(N.revive(this._dto.input.uri),this._dto.input.viewType);case ha.WebviewEditorInput:return new BNe(this._dto.input.viewType);case ha.NotebookInput:return new Fce(N.revive(this._dto.input.uri),this._dto.input.notebookType);case ha.NotebookDiffInput:return new Oce(N.revive(this._dto.input.original),N.revive(this._dto.input.modified),this._dto.input.notebookType);case ha.TerminalEditorInput:return new WNe;case ha.InteractiveEditorInput:return new HNe(N.revive(this._dto.input.uri),N.revive(this._dto.input.inputBoxUri));case ha.ChatEditorInput:return new UNe;case ha.MultiDiffEditorInput:return new VNe(this._dto.input.diffEditors.map(e=>new o$(N.revive(e.original),N.revive(e.modified))));default:return}}}class Fei{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 f9e(i,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){const e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return El.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===uh.TAB_OPEN){const i=new f9e(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===uh.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===uh.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 tIe=class{constructor(e){this._onDidChangeTabs=new I,this._onDidChangeTabGroups=new I,this._extHostTabGroups=[],this._proxy=e.getProxy(Be.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 qn(e._extHostTabGroups.find(o=>o.groupId===i)?.apiObject)},close:async(i,n)=>{const o=Array.isArray(i)?i:[i];return o.length?Oei(o[0])?this._closeGroups(o,n):this._closeTabs(o,n):!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)),n=bre(t,i),o=this._extHostTabGroups.filter(l=>n.removed.includes(l.groupId)).map(l=>l.apiObject),r=[],a=[];this._extHostTabGroups=e.map(l=>{const d=new Fei(l,()=>this._activeGroupId);return n.added.includes(d.groupId)?r.push(d.apiObject):a.push(d.apiObject),d});const c=qn(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(n=>n.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 uh.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[i.apiObject],closed:[],changed:[]}));return;case uh.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[i.apiObject],changed:[]}));return;case uh.TAB_MOVE:case uh.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 n of e){const o=this._findExtHostTabFromApi(n);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 n of e){const o=this._findExtHostTabGroupFromApi(n);if(!o)throw new Error("Group close: Invalid group not found!");i.push(o.groupId)}return this._proxy.$closeGroup(i,t)}};tIe=D([_(0,Jo)],tIe);function Oei(s){return s.tabs!==void 0}const tre=class tre{constructor(e,t,i,n){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=n}};tre.NONE=new tre(!1,-1,-1,-1);let zH=tre;class p9e{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 zH(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 nle{constructor(e,t,i,n,o,r){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=i,this.module=n,this.exports=o,this.disposable=r}}class Bei extends nle{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,V.None)}}class Wei extends nle{constructor(){super(!1,null,zH.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}class ine extends nle{constructor(e){super(!0,e,zH.NONE,{activate:void 0,deactivate:void 0},void 0,V.None)}}let iIe=class{constructor(e,t,i,n){this._logService=n,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new va,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(n=>({id:n.identifier,reason:{startup:t,extensionId:n.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 ine(o));return this._host.onExtensionActivationError(e.id,o,new rHe(e.id.value)),r}const i=[],n=typeof t.extensionDependencies>"u"?[]:t.extensionDependencies;for(const o of n){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 ine(l));return this._host.onExtensionActivationError(t.identifier,l,new rHe(o)),d}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,n){const o=new nIe(e.id,t,e.reason,i,n,this._host,this._logService);return this._operations.set(e.id,o),o}_isHostExtension(e){return uD.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};iIe=D([_(3,Ge)],iIe);let nIe=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,i,n,o,r,a){this._id=e,this._displayName=t,this._reason=i,this._deps=n,this._value=o,this._host=r,this._logService=a,this._barrier=new Gd,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 ine(t),this._isDisposed&&Fr(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)}}};nIe=D([_(6,Ge)],nIe);class Yst{constructor(e,t){this._logService=t,this._onDidChangeStorage=new I,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(Be.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,i){const n=await this._proxy.$initializeExtensionStorage(e,t);let o;return n&&(o=this.safeParseValue(e,t,n)),o||i}setValue(e,t,i){return this._proxy.$setValue(e,t,i)}$acceptValue(e,t,i){const n=this.safeParseValue(e,t,i);n&&this._onDidChangeStorage.fire({shared:e,key:t,value:n})}safeParseValue(e,t,i){try{return JSON.parse(i)}catch(n){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${n}`)}}}const bPe=ae("IExtHostStorage");class Jst{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(n=>(this._value=n,this)),this._storageListener=this._storage.onDidChangeStorage(n=>{n.shared===this._shared&&n.key===this._id&&(this._value=n.value)}),this._scheduler=new cn(()=>{const n=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(const o of n.values())o.complete()}catch(o){for(const r of n.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 n=new dc;return this._deferredPromises.set(e,n),this._scheduler.isScheduled()||this._scheduler.schedule(),n.p}dispose(){this._storageListener.dispose()}}class Hei extends Jst{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 wPe=ae("IExtensionStoragePaths");let sIe=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(n=>this._value=n)}async _getWorkspaceStorageURI(e){return N.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(N.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:N.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 N.joinPath(this._value,e.identifier.value)}globalValue(e){return N.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};sIe=D([_(0,mu),_(1,Ge),_(2,Zce)],sIe);const yPe=ae("IExtHostAuthentication");let oIe=class{constructor(e){this._authenticationProviders=new Map,this._onDidChangeSessions=new I,this.onDidChangeSessions=this._onDidChangeSessions.event,this._getSessionTaskSingler=new Uei,this._proxy=e.getProxy(Be.MainThreadAuthentication)}async getSession(e,t,i,n={}){const o=Sn.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,n)})}async getAccounts(e){return await this._proxy.$ensureProvider(e),await this._proxy.$getAccounts(e)}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,n){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:n??{supportsMultipleAccounts:!1}});const o=i.onDidChangeSessions(r=>this._proxy.$sendDidChangeSessions(e,r));return this._proxy.$registerAuthenticationProvider(e,t,n?.supportsMultipleAccounts??!1),new Qs(()=>{o.dispose(),this._authenticationProviders.delete(e),this._proxy.$unregisterAuthenticationProvider(e)})}async $createSession(e,t,i){const n=this._authenticationProviders.get(e);if(n)return await n.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,i){const n=this._authenticationProviders.get(e);if(n)return await n.provider.getSessions(t,i);throw new Error(`Unable to find authentication provider with handle: ${e}`)}$onDidChangeAuthenticationSessions(e,t){return e.startsWith(Wce)||this._onDidChangeSessions.fire({provider:{id:e,label:t}}),Promise.resolve()}};oIe=D([_(0,Jo)],oIe);class Uei{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){const i=this._inFlightPromises.get(e);if(i)return i;const n=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,n),n}}var rIe;const CPe=ae("IExtHostLanguageModels");class m9e{constructor(e,t){this.option=e,this.stream=new L2,this.stream=t??new L2}}class Vei{constructor(){this._responseStreams=new Map,this._defaultStream=new L2,this._isDone=!1;const e=this;this.apiObject={get stream(){return e._defaultStream.asyncIterable},get text(){return Kd.map(e._defaultStream.asyncIterable,t=>{if(t instanceof AH)return t.value}).coalesce()}}}*_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;let t=this._responseStreams.get(e.index);t||(this._responseStreams.size===0?t=new m9e(e.index,this._defaultStream):t=new m9e(e.index),this._responseStreams.set(e.index,t));let i;e.part.type==="text"?i=new AH(e.part.value):i=new Bce(e.part.name,e.part.parameters),t.stream.emitOne(i)}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 sM;let aIe=(sM=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 va,this._pendingRequest=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(Be.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose()}registerLanguageModel(e,t,i,n){const o=rIe._idPool++;this._languageModels.set(o,{extension:e.identifier,provider:i,languageModelId:t});let r;n.auth&&(r={providerLabel:e.displayName||e.name,accountLabel:typeof n.auth=="object"?n.auth.label:void 0}),this._proxy.$registerLanguageModelProvider(o,`${Sn.toKey(e.identifier)}/${o}/${t}`,{extension:e.identifier,id:t,vendor:n.vendor??Sn.toKey(e.identifier),name:n.name??"",family:n.family??"",version:n.version,maxInputTokens:n.maxInputTokens,maxOutputTokens:n.maxOutputTokens,auth:r,targetExtensions:n.extensions});const a=i.onDidReceiveLanguageModelResponse2?.(({extensionId:c,participant:l,tokenCount:d})=>{this._proxy.$whenLanguageModelChatRequestMade(t,new Sn(c),l,d)});return Ee(()=>{this._languageModels.delete(o),this._proxy.$unregisterProvider(o),a?.dispose()})}async $startChatRequest(e,t,i,n,o,r){const a=this._languageModels.get(e);if(!a)throw new Error("Provider not found");const c=new cu(async d=>{if(r.isCancellationRequested){this._logService.warn(`[CHAT](${a.extension.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let h;if(d.part instanceof Bce?h={type:"function_use",name:d.part.name,parameters:d.part.parameters}:d.part instanceof AH&&(h={type:"text",value:d.part.value}),!h){this._logService.warn(`[CHAT](${a.extension.value}) UNKNOWN part ${JSON.stringify(d)}`);return}this._proxy.$reportResponsePart(t,{index:d.index,part:h})});let l;if(a.provider.provideLanguageModelResponse2)l=Promise.resolve(a.provider.provideLanguageModelResponse2(n.map(EF.to),o,Sn.toKey(i),c,r));else{const d=new cu(async h=>{c.report({index:h.index,part:new AH(h.part)})});l=Promise.resolve(a.provider.provideLanguageModelResponse(n.map(EF.to),o?.modelOptions??{},Sn.toKey(i),d,r))}l.then(()=>{this._proxy.$reportResponseDone(t,void 0)},d=>{this._proxy.$reportResponseDone(t,yA(d))})}$provideTokenLength(e,t,i){const n=this._languageModels.get(e);return n?Promise.resolve(n.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 va});if(e.removed)for(const t of e.removed){this._allLanguageModelData.delete(t);for(const[i,n]of this._pendingRequest)n.languageModelId===t&&(n.res.reject(new Ma),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}),n=[],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 Tw.NotFound(r);return o._computeTokenLength(r,l,d??He.None)},sendRequest(l,d,h){if(!o._allLanguageModelData.has(r))throw Tw.NotFound(r);return o._sendChatRequest(e,r,l,d??{},h??He.None)}},a.apiObjects.set(e.identifier,c)),n.push(c)}return n}async _sendChatRequest(e,t,i,n,o){const r=this._convertMessages(e,i),a=e.identifier,c=this._allLanguageModelData.get(t)?.metadata;if(!c||!this._allLanguageModelData.has(t))throw Tw.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(a,c)&&(!await this._getAuthAccess(e,{identifier:c.extension,displayName:c.auth.providerLabel},n.justification,!1)||!this._modelAccessList.get(a)?.has(c.extension)))throw Tw.NoPermissions(`Language model '${t}' cannot be used by '${a.value}'.`);try{const l=Math.random()*1e6|0,d=new Vei;this._pendingRequest.set(l,{languageModelId:t,res:d});try{await this._proxy.$tryStartChatRequest(a,t,l,r,n,o)}catch(h){throw this._pendingRequest.delete(l),h}return d.apiObject}catch(l){throw l.name===Tw.name?l:new Tw(`Language model '${t}' errored: ${Nr(l)}`,"Unknown",l)}}_convertMessages(e,t){const i=[];for(const n of t)n.role===zp.System&&Ve(e,"languageModelSystem"),n.content2 instanceof c$&&Ve(e,"lmTools"),i.push(EF.from(n));return i}async $acceptResponsePart(e,t){const i=this._pendingRequest.get(e);i&&i.res.handleFragment(t)}async $acceptResponseDone(e,t){const i=this._pendingRequest.get(e);i&&(this._pendingRequest.delete(e),t?i.res.reject(r8(t)):i.res.resolve())}async _getAuthAccess(e,t,i,n){const o=Wce+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(n)return!1;try{const a=i?g(577,"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&&!Sn.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 Tw.NotFound(`Language model '${e}' is unknown.`);const o=hi.find(this._languageModels.values(),r=>r.languageModelId===e);return o?o.provider.provideTokenCount(t,i):this._proxy.$countTokens(e,typeof t=="string"?t:EF.from(t),i)}$updateModelAccesslist(e){const t=new Array;for(const{from:i,to:n,enabled:o}of e){const r=this._modelAccessList.get(i)??new y_;if(r.has(n)!==o){o?r.add(n):r.delete(n),this._modelAccessList.set(i,r);const c={from:i,to:n};t.push(c),this._onDidChangeModelAccess.fire(c)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);const t=this,i=M.signal(M.filter(this._onDidChangeModelAccess.event,o=>Sn.equals(o.from,e.identifier))),n=M.signal(this._onDidChangeProviders.event);return{get onDidChange(){return M.any(i,n)},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)}}}},rIe=sM,sM._idPool=1,sM);aIe=rIe=D([_(0,Jo),_(1,Ge),_(2,yPe)],aIe);class Xst{constructor(e){this._onDidChangePassword=new I,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(Be.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 SPe=ae("IExtHostSecretState");var rx;class zei{constructor(e,t){Wt(this,rx);this.disposables=new Z,this._id=Sn.toKey(e.identifier),Ct(this,rx,t),this.onDidChange=M.map(M.filter(Ce(this,rx).onDidChangePassword,i=>i.extensionId===this._id),i=>({key:i.key}),this.disposables)}dispose(){this.disposables.dispose()}get(e){return Ce(this,rx).get(this._id,e)}store(e,t){return Ce(this,rx).store(this._id,e,t)}delete(e){return Ce(this,rx).delete(this._id,e)}}rx=new WeakMap;let cIe=class{constructor(e,t,i){this.logService=i,this.bundleCache=new Map,this._proxy=t.getProxy(Be.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===b1}getMessage(e,t){const{message:i,args:n,comment:o}=t;if(this.isDefaultLanguage)return Qge(i,n??{});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}`),Qge(a??i,n??{})}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 n=await this._proxy.$fetchBundleContents(i),o=JSON.parse(n);t=e.isBuiltin?o.contents?.bundle:o}catch(n){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${i}: ${n.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 N.revive(t)}return e.l10n?N.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};cIe=D([_(0,mu),_(1,Jo),_(2,Ge)],cIe);const APe=ae("IExtHostLocalizationService"),EPe=ae("IExtHostManagedSockets");let lIe=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(Be.MainThreadManagedSockets)}setFactory(e,t){for(const i of this._managedRemoteSockets.values())i.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new $ei(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(),n=new Z;return this._managedRemoteSockets.set(t,new Gei(t,i,n)),n.add(Ee(()=>this._managedRemoteSockets.delete(t))),n.add(i.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),n.dispose()})),n.add(i.onDidClose(o=>{this._proxy.$onDidManagedSocketClose(t,o?.stack??o?.message),n.dispose()})),n.add(i.onDidReceiveMessage(o=>this._proxy.$onDidManagedSocketHaveData(t,$e.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?.()}};lIe=D([_(0,Jo)],lIe);class $ei{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}}class Gei extends V{constructor(e,t,i){super(),this.socketId=e,this.actual=t,this._register(i)}}var dIe;const Zst=ae("IHostUtils");let hIe=dIe=class extends V{constructor(e,t,i,n,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=n,this._extHostConfiguration=o,this._logService=r,this._extHostTunnelService=l,this._extHostTerminalService=d,this._extHostLocalizationService=h,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(Be.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(Be.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(Be.MainThreadExtensionService),this._almostReadyToRunExtensions=new Gd,this._readyToStartExtensionHost=new Gd,this._readyToRunExtensions=new Gd,this._eagerExtensionsActivated=new Gd,this._activationEventsReader=new qei(this._initData.extensions.activationEvents),this._globalRegistry=new uD(this._activationEventsReader,this._initData.extensions.allExtensions);const p=new y_(this._initData.extensions.myExtensions);this._myRegistry=new uD(this._activationEventsReader,eot(this._globalRegistry,p)),Bh&&(this._logService.info(`Creating extension host with the following global extensions: ${yP(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${yP(this._myRegistry)}`)),this._storage=new Yst(this._extHostContext,this._logService),this._secretState=new Xst(this._extHostContext),this._storagePath=c,this._instaService=this._store.add(e.createChild(new Uc([bPe,this._storage],[SPe,this._secretState]))),this._activator=this._register(new iIe(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(m,v,b)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(m,yA(v),b)},actualActivateExtension:async(m,v)=>{if(uD.isHostExtension(m,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(m,v),new Wei;const b=this._myRegistry.getExtensionDescription(m);return this._activateExtension(b,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(),cs("code/extHost/ready"),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){vt(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(),o8&&Uge(n=>{this._logService.error(n)}),this._extHostContext.dispose();const i=this._deactivateAll();Promise.race([Sr(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 Sn(t.identifier.value),extensionLocation:N.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===pe.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 N.file(i)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||(this._extensionPathIndex=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new Kei(e))),this._extensionPathIndex}async _createExtensionPathIndex(e){const t=Eh.forUris(i=>_Ge.ignorePathCasing(i));return await Promise.all(e.map(async i=>{if(this._getEntryPoint(i)){const n=await this._realPathExtensionUri(i.extensionLocation);t.set(n,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,n=>(this._logService.error(n),Promise.resolve(void 0))))}catch(n){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(n)}try{i.disposable.dispose()}catch(n){this._logService.error(`An error occurred when disposing the subscriptions for extension '${e.value}':`),this._logService.error(n)}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 n=i.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,n.codeLoadingTime,n.activateCallTime,n.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,"success",n),i},i=>{throw this._logExtensionActivationTimes(e,t,"failure"),i})}_logExtensionActivationTimes(e,t,i,n){const o=v9e(e,t);this._mainThreadTelemetryProxy.$publicLog2("extensionActivationTimes",{...o,...n||{},outcome:i})}_doActivateExtension(e,t){const i=v9e(e,t);this._mainThreadTelemetryProxy.$publicLog2("activatePlugin",i);const n=this._getEntryPoint(e);if(!n)return Promise.resolve(new Bei(zH.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 Z,r=new p9e(t.startup);return Promise.all([this._loadCommonJSModule(e,Pt(e.extensionLocation,n),r),this._loadExtensionContext(e,o)]).then(a=>(cs(`code/extHost/willActivateExtension/${e.identifier.value}`),dIe._callActivate(this._logService,e.identifier,a[0],a[1],o,r))).then(a=>(cs(`code/extHost/didActivateExtension/${e.identifier.value}`),a))}_loadExtensionContext(e,t){const i=this._extHostLanguageModels.createLanguageModelAccessInformation(e),n=t.add(new Hei(e,this._storage)),o=t.add(new Jst(e.identifier.value,!1,this._storage)),r=t.add(new zei(e,this._secretState)),a=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?$T.Test:$T.Development:$T.Production,c=this._initData.remote.isRemote?mD.Workspace:mD.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([n.whenReady,o.whenReady,this._storagePath.whenReady]).then(()=>{const l=this;let d,h;const u=ll(e,"ipc")?this._initData.messagePorts?.get(Sn.toKey(e.identifier)):void 0;return Object.freeze({globalState:n,workspaceState:o,secrets:r,subscriptions:[],get languageModelAccessInformation(){return i},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(f){return ife(e.extensionLocation.fsPath,f)},get storagePath(){return l._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return l._storagePath.globalValue(e).fsPath},get logPath(){return ife(l._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return N.joinPath(l._initData.logsLocation,e.identifier.value)},get storageUri(){return l._storagePath.workspaceValue(e)},get globalStorageUri(){return l._storagePath.globalValue(e)},get extensionMode(){return a},get extension(){return d===void 0&&(d=new WV(l,e.identifier,e,c,!1)),d},get extensionRuntime(){return Ve(e,"extensionRuntime"),l.extensionRuntime},get environmentVariableCollection(){return l._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!h){if(!u)return;const f=M.buffer(M.fromDOMEventEmitter(u,"message",p=>p.data));u.start(),h={onDidReceiveMessage:f,postMessage:u.postMessage.bind(u)}}return h}})})}static _callActivate(e,t,i,n,o,r){return i=i||{activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,i,n,r).then(a=>new nle(!1,null,r.build(),i,a,Ee(()=>{o.dispose(),bt(n.subscriptions)})))}static _callActivateOptional(e,t,i,n,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,[n]);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 n=Date.now();T1e(()=>{for(let o=t;o50){this._activateAllStartupFinishedDeferred(e,o);break}else this._activateOneStartupFinished(r,a)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(cEt()),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 n of i)if(n.activationEvents)for(const o of n.activationEvents)o==="onStartupFinished"&&this._activateOneStartupFinished(n,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),n=this._handleRemoteResolverEagerExtensions(),o=Promise.all([n,e,i]).then(()=>{});return Promise.race([o,Sr(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,n={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 Tit(n,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(442,"Cannot load test runner."));const i=await this._loadCommonJSModule(null,t,new p9e(!1));if(!i||typeof i.run!="function")throw new Error(g(443,"Path {0} does not point to a valid extension test runner.",t.toString()));return new Promise((n,o)=>{const r=(l,d)=>{l?(Bh&&this._logService.error("Test runner called back with error",l),o(l)):(Bh&&(d?this._logService.info(`Test runner called back with ${d} failures.`):this._logService.info("Test runner called back with successful outcome.")),n(typeof d=="number"&&d>0?1:0))},a=Ym(t),c=i.run(a,r);c&&c.then&&c.then(()=>{Bh&&this._logService.info("Test runner finished successfully."),n(0)}).catch(l=>{Bh&&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(),Sr(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 J0("Not an authority that can be resolved!",Xl.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=js.create(!1),n=()=>`[resolveAuthority(${dee(e)},${t})][${i.elapsed()}ms] `,o=w=>this._logService.info(`${n()}${w}`),r=w=>this._logService.warn(`${n()}${w}`),a=(w,y=void 0)=>this._logService.error(`${n()}${w}`,y),c=w=>{if(w instanceof J0)return{type:"error",error:{code:w._code,message:w._message,detail:w._detail}};throw w},l=async w=>{o(`activating resolver for ${w}...`);const{resolver:y,authorityPrefix:C}=await this._activateAndGetResolver(w);if(!y)throw a(`no resolver for ${C}`),new J0(`No remote extension installed to resolve ${C}.`,Xl.NoResolverFound);return{resolver:y,authorityPrefix:C,remoteAuthority:w}},d=e.split(/@|%40/g).reverse();o(`activating remote resolvers ${d.join(" -> ")}`);let h;try{h=await Promise.all(d.map(l)).catch(async w=>{if(!(w instanceof J0)||w._code!==Xl.InvalidAuthority)throw w;return r(`resolving nested authorities failed: ${w.message}`),[await l(e)]})}catch(w){return c(w)}const u=new q7;u.cancelAndSet(()=>o("waiting..."),1e3);let f,p;for(const[w,{authorityPrefix:y,resolver:C,remoteAuthority:A}]of h.entries())try{if(w===h.length-1)o("invoking final resolve()..."),cs(`code/extHost/willResolveAuthority/${y}`),f=await C.resolve(A,{resolveAttempt:t,execServer:p}),cs(`code/extHost/didResolveAuthorityOK/${y}`),o("setting tunnel factory..."),this._register(await this._extHostTunnelService.setTunnelFactory(C,tz.isManagedResolvedAuthority(f)?f:void 0));else{if(o(`invoking resolveExecServer() for ${A}`),cs(`code/extHost/willResolveExecServer/${y}`),p=await C.resolveExecServer?.(A,{resolveAttempt:t,execServer:p}),!p)throw new J0(`Exec server was not available for ${A}`,Xl.NoResolverFound);cs(`code/extHost/didResolveExecServerOK/${y}`)}}catch(L){return cs(`code/extHost/didResolveAuthorityError/${y}`),a("returned an error",L),u.dispose(),c(L)}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 ${tz.isManagedResolvedAuthority(f)?"managed authority":`${f.host}:${f.port}`}`);let b;if(tz.isManagedResolvedAuthority(f)){const w=t;this._extHostManagedSockets.setFactory(w,f.makeConnection),b={authority:e,connectTo:new vit(w),connectionToken:f.connectionToken}}else b={authority:e,connectTo:new bit(f.host,f.port),connectionToken:f.connectionToken};return{type:"ok",value:{authority:b,options:v,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${dee(e)})`);const{resolver:i}=await this._activateAndGetResolver(e);if(!i)return null;const n=N.revive(t);if(typeof i.getCanonicalURI>"u")return n;const o=await Qh(()=>i.getCanonicalURI(n));return o||n}async $startExtensionHost(e){e.toAdd.forEach(r=>r.extensionLocation=N.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=_9e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),n=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(n),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Bh&&(this._logService.info(`$startExtensionHost: global extensions: ${yP(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${yP(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===Lb.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=N.revive(r.extensionLocation));const{globalRegistry:t,myExtensions:i}=_9e(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),n=await this._createExtensionPathIndex(i);return(await this.getExtensionPathIndex()).setSearchTree(n),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(i),Bh&&(this._logService.info(`$deltaExtensions: global extensions: ${yP(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${yP(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=$e.alloc(e),i=Math.random()%256;for(let n=0;na.identifier));for(const a of i.myToRemove)o.delete(a);for(const a of i.myToAdd)o.add(a);const r=eot(n,o);return{globalRegistry:n,myExtensions:r}}function v9e(s,e){return{id:s.identifier.value,name:s.name,extensionVersion:s.version,publisherDisplayName:s.publisher,activationEvents:s.activationEvents?s.activationEvents.join(","):null,isBuiltin:s.isBuiltin,reason:e.activationEvent,reasonId:e.extensionId.value}}function yP(s){return s.getAllExtensionDescriptions().map(e=>e.identifier.value).join(",")}const DI=ae("IExtHostExtensionService");var $1,f7,G1;class WV{constructor(e,t,i,n,o){Wt(this,$1);Wt(this,f7);Wt(this,G1);Ct(this,$1,e),Ct(this,f7,t),Ct(this,G1,i.identifier),this.id=i.identifier.value,this.extensionUri=i.extensionLocation,this.extensionPath=Dk(Ym(i.extensionLocation)),this.packageJSON=i,this.extensionKind=n,this.isFromDifferentExtensionHost=o}get isActive(){return Ce(this,$1).isActivated(Ce(this,G1))}get exports(){if(!(this.packageJSON.api==="none"||this.isFromDifferentExtensionHost))return Ce(this,$1).getExtensionExports(Ce(this,G1))}async activate(){if(this.isFromDifferentExtensionHost)throw new Error("Cannot activate foreign extension");return await Ce(this,$1).activateByIdWithErrors(Ce(this,G1),{startup:!1,extensionId:Ce(this,f7),activationEvent:"api"}),this.exports}}$1=new WeakMap,f7=new WeakMap,G1=new WeakMap;function eot(s,e){return s.getAllExtensionDescriptions().filter(t=>e.has(t.identifier))}class Kei{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 qei{constructor(e){this._map=new va,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])}}const xPe=ae("IExtHostVariableResolverProvider");class Qei extends qie{constructor(e,t,i,n,o,r,a){function c(){if(i){const l=i.activeEditor();if(l)return l.document.uri;const d=n.tabGroups.all.find(h=>h.isActive)?.activeTab;if(d!==void 0){if(d.input instanceof o$||d.input instanceof Oce)return d.input.modified;if(d.input instanceof Nce||d.input instanceof Fce||d.input instanceof Pce)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:()=>C2(),getExecPath:()=>S2.VSCODE_EXEC_PATH,getFilePath:()=>{const l=c();if(l)return Dk(l.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){const l=c();if(l){const d=t.getWorkspaceFolder(l);if(d)return Dk(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(S2))}}let uIe=class extends V{constructor(e,t,i,n,o){super(),this.extensionService=e,this.workspaceService=t,this.editorService=i,this.configurationService=n,this.editorTabs=o,this._resolver=new ya(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 Qei(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,r,c,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};uIe=D([_(0,DI),_(1,nE),_(2,GU),_(3,sE),_(4,dG)],uIe);var b9e;(function(s){s.ViewletId="workbench.view.extension.test",s.ExplorerViewId="workbench.view.testing",s.OutputPeekContributionId="editor.contrib.testingOutputPeek",s.DecorationsContributionId="editor.contrib.testingDecorations",s.CoverageDecorationsContributionId="editor.contrib.coverageDecorations",s.CoverageViewId="workbench.view.testCoverage",s.ResultsPanelId="workbench.panel.testResults",s.ResultsViewId="workbench.panel.testResults.view",s.MessageLanguageId="vscodeInternalTestMessage"})(b9e||(b9e={}));var w9e;(function(s){s.List="list",s.Tree="true"})(w9e||(w9e={}));var y9e;(function(s){s.ByLocation="location",s.ByStatus="status",s.ByDuration="duration"})(y9e||(y9e={}));Hn.Errored+"",g(4063,"Errored"),Hn.Failed+"",g(4064,"Failed"),Hn.Passed+"",g(4065,"Passed"),Hn.Queued+"",g(4066,"Queued"),Hn.Running+"",g(4067,"Running"),Hn.Skipped+"",g(4068,"Skipped"),Hn.Unset+"",g(4069,"Not yet run");Gh.Debug+"",g(4071,"Debug"),Gh.Run+"",g(4072,"Run"),Gh.Coverage+"",g(4073,"Coverage");var gIe;(function(s){s.CancelTestRefreshAction="testing.cancelTestRefresh",s.CancelTestRunAction="testing.cancelRun",s.ClearTestResultsAction="testing.clearTestResults",s.CollapseAllAction="testing.collapseAll",s.ConfigureTestProfilesAction="testing.configureProfile",s.ContinousRunUsingForTest="testing.continuousRunUsingForTest",s.CoverageAtCursor="testing.coverageAtCursor",s.CoverageByUri="testing.coverage.uri",s.CoverageClear="testing.coverage.close",s.CoverageCurrentFile="testing.coverageCurrentFile",s.CoverageFilterToTest="testing.coverageFilterToTest",s.CoverageFilterToTestInEditor="testing.coverageFilterToTestInEditor",s.CoverageLastRun="testing.coverageLastRun",s.CoverageSelectedAction="testing.coverageSelected",s.CoverageToggleToolbar="testing.coverageToggleToolbar",s.CoverageViewChangeSorting="testing.coverageViewChangeSorting",s.DebugAction="testing.debug",s.DebugAllAction="testing.debugAll",s.DebugAtCursor="testing.debugAtCursor",s.DebugByUri="testing.debug.uri",s.DebugCurrentFile="testing.debugCurrentFile",s.DebugFailedTests="testing.debugFailTests",s.DebugLastRun="testing.debugLastRun",s.DebugSelectedAction="testing.debugSelected",s.FilterAction="workbench.actions.treeView.testExplorer.filter",s.GetExplorerSelection="_testing.getExplorerSelection",s.GetSelectedProfiles="testing.getSelectedProfiles",s.GoToTest="testing.editFocusedTest",s.GoToRelatedTest="testing.goToRelatedTest",s.PeekRelatedTest="testing.peekRelatedTest",s.GoToRelatedCode="testing.goToRelatedCode",s.PeekRelatedCode="testing.peekRelatedCode",s.HideTestAction="testing.hideTest",s.OpenCoverage="testing.openCoverage",s.OpenOutputPeek="testing.openOutputPeek",s.RefreshTestsAction="testing.refreshTests",s.ReRunFailedTests="testing.reRunFailTests",s.ReRunLastRun="testing.reRunLastRun",s.RunAction="testing.run",s.RunAllAction="testing.runAll",s.RunAllWithCoverageAction="testing.coverageAll",s.RunAtCursor="testing.runAtCursor",s.RunByUri="testing.run.uri",s.RunCurrentFile="testing.runCurrentFile",s.RunSelectedAction="testing.runSelected",s.RunUsingProfileAction="testing.runUsing",s.RunWithCoverageAction="testing.coverage",s.SearchForTestExtension="testing.searchForTestExtension",s.SelectDefaultTestProfiles="testing.selectDefaultTestProfiles",s.ShowMostRecentOutputAction="testing.showMostRecentOutput",s.StartContinousRun="testing.startContinuousRun",s.StopContinousRun="testing.stopContinuousRun",s.TestingSortByDurationAction="testing.sortByDuration",s.TestingSortByLocationAction="testing.sortByLocation",s.TestingSortByStatusAction="testing.sortByStatus",s.TestingViewAsListAction="testing.viewAsList",s.TestingViewAsTreeAction="testing.viewAsTree",s.ToggleContinousRunForTest="testing.toggleContinuousRunForTest",s.ToggleInlineTestOutput="testing.toggleInlineTestOutput",s.UnhideAllTestsAction="testing.unhideAllTests",s.UnhideTestAction="testing.unhideTest"})(gIe||(gIe={}));let jei=0;const C9e=new WeakMap,sle=ae("IExtHostTesting");let fIe=class extends V{constructor(e,t,i,n){super(),this.logService=t,this.commands=i,this.editors=n,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(Be.MainThreadTesting),this.observer=new tti(this.proxy),this.runTracker=new Xei(this.proxy,t),i.registerArgumentProcessor({processArgument:o=>{switch(o?.$mid){case ws.TestItemContext:{const r=o,a=r.tests[r.tests.length-1].item.extId;return this.controllers.get(vn.root(a))?.collection.tree.get(a)?.actual??d9e(o)}case ws.TestMessageMenuArgs:{const{test:r,message:a}=o,c=r.item.extId;return{test:this.controllers.get(vn.root(c))?.collection.tree.get(c)?.actual??d9e({$mid:ws.TestItemContext,tests:[r]}),message:BH.to(a)}}default:return o}}}),i.registerCommand(!1,"testing.getExplorerSelection",async()=>{const o=await i.executeCommand(gIe.GetExplorerSelection),r=a=>{const c=this.controllers.get(vn.root(a));if(c)return vn.isRoot(a)?c.controller:c.collection.tree.get(a)?.actual};return{include:o?.include.map(r).filter(Fc)||[],exclude:o?.exclude.map(r).filter(Fc)||[]}})}createTestController(e,t,i,n){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 Sei(t,i,this.editors));r.root.label=i;const a=new Map,c=new Set,l=this.proxy,d=()=>{let f=0;n&&(f|=oz.Refresh);const p=u.relatedCodeProvider;return p&&(p?.provideRelatedTests&&(f|=oz.TestRelatedToCode),p?.provideRelatedCode&&(f|=oz.CodeRelatedToTest)),f},h={items:r.root.children,get label(){return i},set label(f){i=f,r.root.label=f,l.$updateController(t,{label:i})},get refreshHandler(){return n},set refreshHandler(f){n=f,l.$updateController(t,{capabilities:d()})},get id(){return t},get relatedCodeProvider(){return u.relatedCodeProvider},set relatedCodeProvider(f){Ve(e,"testRelatedCode"),u.relatedCodeProvider=f,l.$updateController(t,{capabilities:d()})},createRunProfile:(f,p,m,v,b,w)=>{let y=Wc(f);for(;a.has(y);)y++;return new iot(this.proxy,a,c,this.defaultProfilesChangedEmitter.event,t,y,f,p,m,v,b,w)},createTestItem(f,p,m){return new GN(t,f,p,m)},createTestRun:(f,p,m=!0)=>this.runTracker.createTestRun(e,t,r,f,p,m),invalidateTestResults:f=>{if(f===void 0)this.proxy.$markTestRetired(void 0);else{const p=f instanceof Array?f:[f];this.proxy.$markTestRetired(p.map(m=>vn.fromExtHostTestItem(m,t).toString()))}},set resolveHandler(f){r.resolveHandler=f},get resolveHandler(){return r.resolveHandler},dispose:()=>{o.dispose()}},u={controller:h,collection:r,profiles:a,extension:e,activeProfiles:c};return l.$registerTestController(t,i,d()),o.add(Ee(()=>l.$unregisterTestController(t))),this.controllers.set(t,u),o.add(Ee(()=>this.controllers.delete(t))),o.add(r.onDidGenerateDiff(f=>l.$publishDiff(t,f.map(IH.serialize)))),h}createTestObserver(){return this.observer.checkout()}async runTests(e,t=He.None){const i=tot(e);if(!i)throw new Error("The request passed to `vscode.test.runTests` must include a profile");const n=this.controllers.get(i.controllerId);if(!n)throw new Error("Controller not found");await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,group:DPe[i.kind],targets:[{testIds:e.include?.map(o=>vn.fromExtHostTestItem(o,n.collection.root.id).toString())??[n.collection.root.id],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)}}}async $getTestsRelatedToCode(e,t,i){const n=this.editors.getDocument(N.revive(e));if(!n)return[];const o=Yo.to(t),r=[];return await Promise.all([...this.controllers.values()].map(async a=>{let c;try{c=await a.relatedCodeProvider?.provideRelatedTests?.(n.document,o,i)}catch(l){i.isCancellationRequested||this.logService.warn(`Error thrown while providing related tests for ${a.controller.label}`,l)}if(c){for(const l of c)r.push(vn.fromExtHostTestItem(l,a.controller.id).toString());a.collection.flushDiff()}})),r}async $getCodeRelatedToTest(e,t){const i=this.controllers.get(vn.root(e));if(!i)return[];const n=i.collection.tree.get(e);return n?(await i.relatedCodeProvider?.provideRelatedCode?.(n.actual,t))?.map(cf.from)??[]:[]}$syncTests(){for(const{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t,i){return(await this.runTracker.getCoverageDetails(e,t,i))?.map(Jte.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,n]of Object.entries(e)){const o=this.controllers.get(i);if(!o)continue;const r=new Map,a=n.filter(l=>!o.activeProfiles.has(l)),c=[...o.activeProfiles].filter(l=>!n.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=QEe.to(t);return C9e.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(vn.fromString(e).controllerId)?.collection;i&&(await i.expand(e,t<0?1/0:t),i.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(t=>IH.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 ci(t),n=await Promise.all(e.map(o=>this.runControllerTestRequest(o,!0,i.token)));return!t.isCancellationRequested&&!n.some(o=>o.error)&&await new Promise(o=>t.onCancellationRequested(o)),i.dispose(!0),n}async $provideTestFollowups(e,t){const i=this.results.find(r=>C9e.get(r)===e.resultId),n=i&&iti(vn.fromString(e.extId),i?.results);if(!n)return[];let o=[];return await Promise.all([...this.followupProviders].map(async r=>{try{const a=await r.provideFollowup(i,n,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=jei++;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()}$cancelExtensionTestRun(e){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e)}getMetadataForRun(e){for(const t of this.runTracker.trackers){const i=t.getTaskIdForRun(e);if(i)return{taskId:i,runId:t.id}}}async runControllerTestRequest(e,t,i){const n=this.controllers.get(e.controllerId);if(!n)return{};const{collection:o,profiles:r,extension:a}=n,c=r.get(e.profileId);if(!c)return{};const l=e.testIds.map(f=>o.tree.get(f)).filter(Fc),d=e.excludeExtIds.map(f=>n.collection.tree.get(f)).filter(Fc).filter(f=>l.some(p=>p.fullId.compare(f.fullId)===Nv.IsChild));if(!l.length)return{};const h=new s$(l.some(f=>f.actual instanceof vPe)?void 0:l.map(f=>f.actual),d.map(f=>f.actual),c,t),u=$qt(e)&&this.runTracker.prepareForMainThreadTestRun(a,h,X$.fromInternal(e,n.collection),c,i);try{return await c.runHandler(h,i),{}}catch(f){return{error:String(f)}}finally{u&&u.hasRunningTasks&&!i.isCancellationRequested&&await M.toPromise(u.onEnd)}}};fIe=D([_(0,Jo),_(1,Ge),_(2,KN),_(3,GU)],fIe);const Yei=1e4;var BE;(function(s){s[s.Running=0]="Running",s[s.Cancelling=1]="Cancelling",s[s.Ended=2]="Ended"})(BE||(BE={}));class Jei extends V{get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,i,n,o,r){super(),this.dto=e,this.proxy=t,this.logService=i,this.profile=n,this.extension=o,this.state=BE.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 ci(r));const a=this._register(new cn(()=>this.forciblyEndTasks(),Yei));this._register(this.cts.token.onCancellationRequested(()=>a.schedule()));const c=new I;this.onDidDispose=c.event,this._register(Ee(()=>{c.fire(),c.dispose()}))}getTaskIdForRun(e){for(const[t,{run:i}]of this.tasks)if(i===e)return t}cancel(){this.state===BE.Running?(this.cts.cancel(),this.state=BE.Cancelling):this.state===BE.Cancelling&&this.forciblyEndTasks()}async getCoverageDetails(e,t,i){const[,n]=vn.fromString(e).path,o=this.publishedCoverage.get(e);if(!o)return[];const{report:r,extIds:a}=o,c=this.tasks.get(n);if(!c)throw new Error("unreachable: run task was not found");let l;if(t&&r instanceof rN){const h=a.indexOf(t);if(h===-1)return[];l=r.fromTests[h]}return await(l?this.profile?.loadDetailedCoverageForTest?.(c.run,r,l,i):this.profile?.loadDetailedCoverage?.(c.run,r,i))??[]}createRun(e){const t=this.dto.id,i=this.dto.controllerId,n=ar(),o=l=>(d,...h)=>{if(a){this.logService.warn(`Setting the state of test "${d.id}" is a no-op after the run ends.`);return}this.ensureTestIsKnown(d),l(d,...h)},r=(l,d)=>{const h=d instanceof Array?d.map(BH.from):[BH.from(d)];if(l.uri&&l.range){const u={range:et.from(l.range),uri:l.uri};for(const f of h)f.location=f.location||u}this.proxy.$appendTestMessagesInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),h)};let a=!1;const c={isPersisted:this.dto.isPersisted,token:this.cts.token,name:e,onDidDispose:this.onDidDispose,addCoverage:l=>{if(a)return;const d=l instanceof rN?l.fromTests:[];if(d.length){Ve(this.extension,"attributableCoverage");for(const f of d)this.ensureTestIsKnown(f)}const h=l.uri.toString(),u=new vn([t,n,h]).toString();this.publishedCoverage.set(u,{report:l,extIds:d.map(f=>vn.fromExtHostTestItem(f,i).toString())}),this.proxy.$appendCoverage(t,n,Jte.fromFile(i,u,l))},enqueued:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Queued)}),skipped:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Skipped)}),started:o(l=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Running)}),errored:o((l,d,h)=>{r(l,d),this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Errored,h)}),failed:o((l,d,h)=>{r(l,d),this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,i).toString(),Hn.Failed,h)}),passed:o((l,d)=>{this.proxy.$updateTestStateInRun(t,n,vn.fromExtHostTestItem(l,this.dto.controllerId).toString(),Hn.Passed,d)}),appendOutput:(l,d,h)=>{a||(h&&this.ensureTestIsKnown(h),this.proxy.$appendOutputToRun(t,n,$e.fromString(l),d&&cf.from(d),h&&vn.fromExtHostTestItem(h,i).toString()))},end:()=>{a||(a=!0,this.proxy.$finishedTestRunTask(t,n),--this.running||this.markEnded())}};return this.running++,this.tasks.set(n,{run:c}),this.proxy.$startedTestRunTask(t,{id:n,ctrlId:this.dto.controllerId,name:e,running:!0}),c}forciblyEndTasks(){for(const{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==BE.Ended&&(this.state=BE.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof GN))throw new Rte(e.id);if(this.sharedTestIds.has(vn.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;const t=[],i=this.dto.colllection.root;for(;;){const n=hI.from(e);if(t.unshift(n),this.sharedTestIds.has(n.extId)||(this.sharedTestIds.add(n.extId),e===i))break;e=e.parent||i}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}}class Xei{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,i){const n=vn.root(e);return this.trackedById.get(n)?.getCoverageDetails(e,t,i)||[]}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,n,o){return this.getTracker(t,i,n,e,o)}cancelRunById(e){this.trackedById.get(e)?.cancel()}cancelAllRuns(){for(const e of this.tracked.values())e.cancel()}createTestRun(e,t,i,n,o,r){const a=this.tracked.get(n);if(a)return a.createRun(o);const c=X$.fromPublic(t,i,n,r),l=tot(n);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!n.continuous,profile:l&&{group:DPe[l.kind],id:l.profileId},exclude:n.exclude?.map(h=>vn.fromExtHostTestItem(h,i.root.id).toString())??[],id:c.id,include:n.include?.map(h=>vn.fromExtHostTestItem(h,i.root.id).toString())??[i.root.id],preserveFocus:n.preserveFocus??!0,persist:r});const d=this.getTracker(n,c,n.profile,e);return M.once(d.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(c.id)}),d.createRun(o)}getTracker(e,t,i,n,o){const r=new Jei(t,this.proxy,this.logService,i,n,o);return this.tracked.set(e,r),this.trackedById.set(r.id,r),r}}const tot=s=>{if(s.profile){if(!(s.profile instanceof iot))throw new Error("TestRunRequest.profile is not an instance created from TestController.createRunProfile");return s.profile}};class X${static fromPublic(e,t,i,n){return new X$(e,ar(),n,t)}static fromInternal(e,t){return new X$(e.controllerId,e.runId,!0,t)}constructor(e,t,i,n){this.controllerId=e,this.id=t,this.isPersisted=i,this.colllection=n}}class Zei{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,hI.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=vn.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(n=>n.revived)},get updated(){return[...t].map(n=>n.revived)},get removed(){return[...i].map(n=>n.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}}class eti extends Kqt{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:hI.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new Zei(this.changeEmitter)}}class tti{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:cm(()=>{--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 eti({asCanonicalUri:t=>t});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}}const k4=(s,e,t,i)=>{t?Object.assign(t,i):e.$updateTestRunConfig(s.controllerId,s.profileId,i)};var Ov,K1,p7,Lp,QB;class iot{constructor(e,t,i,n,o,r,a,c,l,d=!1,h=void 0,u=!1){Wt(this,Ov);Wt(this,K1);Wt(this,p7);Wt(this,Lp);Wt(this,QB);this.controllerId=o,this.profileId=r,this._label=a,this.kind=c,this.runHandler=l,this._tag=h,this._supportsContinuousRun=u,Ct(this,Ov,e),Ct(this,QB,t),Ct(this,K1,i),Ct(this,p7,n),t.set(r,this);const f=DPe[c];if(typeof f!="number")throw new Error(`Unknown TestRunProfile.group ${c}`);d&&i.add(r),Ct(this,Lp,{profileId:r,controllerId:o,tag:h?Ob.namespace(this.controllerId,h.id):null,label:a,group:f,isDefault:d,hasConfigurationHandler:!1,supportsContinuousRun:u}),queueMicrotask(()=>{Ce(this,Lp)&&(Ce(this,Ov).$publishTestRunProfile(Ce(this,Lp)),Ct(this,Lp,void 0))})}get label(){return this._label}set label(e){e!==this._label&&(this._label=e,k4(this,Ce(this,Ov),Ce(this,Lp),{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,k4(this,Ce(this,Ov),Ce(this,Lp),{supportsContinuousRun:e}))}get isDefault(){return Ce(this,K1).has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?Ce(this,K1).add(this.profileId):Ce(this,K1).delete(this.profileId),k4(this,Ce(this,Ov),Ce(this,Lp),{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,k4(this,Ce(this,Ov),Ce(this,Lp),{tag:e?Ob.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,k4(this,Ce(this,Ov),Ce(this,Lp),{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return M.chain(Ce(this,p7),e=>e.map(t=>t.get(this.controllerId)?.get(this.profileId)).filter(Fc))}dispose(){Ce(this,QB)?.delete(this.profileId)&&(Ct(this,QB,void 0),Ce(this,Ov).$removeTestProfile(this.controllerId,this.profileId)),Ct(this,Lp,void 0)}}Ov=new WeakMap,K1=new WeakMap,p7=new WeakMap,Lp=new WeakMap,QB=new WeakMap;const DPe={[GT.Coverage]:Gh.Coverage,[GT.Debug]:Gh.Debug,[GT.Run]:Gh.Run};function iti(s,e){for(let t=0;tn.id===s.path[t]);if(!i)return;if(t===s.path.length-1)return i;e=i.children}}const not=ae("IExtHostDebugService");let pIe=class extends V{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,n,o,r,a,c){super(),this._workspaceService=t,this._extensionService=i,this._configurationService=n,this._editorTabs=o,this._variableResolver=r,this._commands=a,this._testing=c,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=this._register(new I),this._onDidTerminateDebugSession=this._register(new I),this._onDidChangeActiveDebugSession=this._register(new I),this._onDidReceiveDebugSessionCustomEvent=this._register(new I),this._debugServiceProxy=e.getProxy(Be.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new I),this._onDidChangeActiveStackItem=this._register(new I),this._activeDebugConsole=new sti(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(l=>{this._register(l.onDidChange(d=>{this.registerAllDebugTypes(l)})),this.registerAllDebugTypes(l)})}async $getVisualizerTreeItem(e,t){const i=this.hydrateVisualizationContext(t);if(!i)return;const n=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(i);return n?this.convertVisualizerTreeItem(e,n):void 0}registerDebugVisualizationTree(e,t,i){const n=Sn.toKey(e.identifier),o=this.extensionVisKey(n,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 n=await this._debugVisualizationTrees.get(i.provider)?.editItem?.(i.item,t);return this.convertVisualizerTreeItem(i.provider,n||i.item)}$disposeVisualizedTree(e){const t=this._debugVisualizationElements.get(e);if(!t)return;const i=[t.children];for(const n of i)if(n)for(const o of n)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})),nxe.from(t,i)}asDebugSourceUri(e,t){const i=e;if(typeof i.sourceReference=="number"&&i.sourceReference>0){let n=`debug:${encodeURIComponent(i.path||"")}`,o="?";return t&&(n+=`${o}session=${encodeURIComponent(t.id)}`,o="&"),n+=`${o}ref=${i.sourceReference}`,N.parse(n)}else{if(i.path)return N.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 n=i.contributes.debuggers;if(n&&n.length>0)for(const o of n)tqt(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:n,provider:o,extensionId:r}=i;if(n.visualization||(n=await o.resolveDebugVisualization?.(n,t)||n,i.v=n),!n.visualization)throw new Error(`No visualization returned from resolveDebugVisualization in '${o}'`);return this.serializeVisualization(r,n.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,n){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,n);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 n=Sn.toKey(e.identifier),o=this.extensionVisKey(n,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(n,t),Ee(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(n,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=[],n=new Map;for(const o of t)if(o instanceof Bx){let r=n.get(o.location.uri.toString());r||(r={type:"sourceMulti",uri:o.location.uri,lines:[]},n.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 Wx&&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 Bx).map(r=>r.id),n=t.filter(r=>r instanceof Wx).map(r=>r.id),o=t.filter(r=>r instanceof Yee).map(r=>r.id);return this._debugServiceProxy.$unregisterBreakpoints(i,n,o)}startDebugging(e,t,i){const n=i.testRun&&this._testing.getMetadataForRun(i.testRun);return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:i.parentSession?i.parentSession.id:void 0,lifecycleManagedByParent:i.lifecycleManagedByParent,repl:i.consoleMode===J9.MergeWithParent?"mergeWithParent":"separate",noDebug:i.noDebug,compact:i.compact,suppressSaveBeforeStart:i.suppressSaveBeforeStart,testRun:n&&{runId:n.runId,taskId:n.taskId},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 Qs(()=>{});const n=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:n,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,i,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,n),new Qs(()=>{this._configProviders=this._configProviders.filter(o=>o.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(n)})}registerDebugAdapterDescriptorFactory(e,t,i){if(!i)return new Qs(()=>{});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 n=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:n,factory:i}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,n),new Qs(()=>{this._adapterFactories=this._adapterFactories.filter(o=>o.factory!==i),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(n)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new Qs(()=>{});const i=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:i,factory:t}),new Qs(()=>{this._trackerFactories=this._trackerFactories.filter(n=>n.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let i;const n=await this.getFolder(e);return n&&(i={uri:n.uri,name:n.name,index:n.index,toResource:()=>{throw new Error("Not implemented")}}),(await this._variableResolver.getResolver()).resolveAnyAsync(i,t)}createDebugAdapter(e,t){if(e.type==="implementation")return new rti(e.implementation)}createSignService(){}async $startDASession(e,t){const i=this,n=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(n.type),n).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.type}' (extension might have failed to activate)`);const r=this.convertToDto(o),a=this.createDebugAdapter(r,n);if(!a)throw new Error(`Couldn't create a debug adapter for type '${n.type}'.`);const c=a;return this._debugAdapters.set(e,c),this.getDebugAdapterTrackers(n).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=xnt(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=Ent(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=[],n=[];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 Wx(o.functionName,o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode);else if(o.type==="data")a=new Yee(o.label,o.dataId,o.canPersist,o.enabled,o.hitCondition,o.condition,o.logMessage,o.mode);else{const c=N.revive(o.uri);a=new Bx(new vp(c,new bs(o.line,o.character)),o.enabled,o.condition,o.hitCondition,o.logMessage,o.mode)}F9t(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 Wx&&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 Bx&&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 vp(N.revive(o.uri),new bs(o.line,o.character))}n.push(r)}}}this.fireBreakpointChanges(t,i,n)}async $acceptStackFrameFocus(e){let t;if(e){const i=await this.getSession(e.sessionId);e.kind==="thread"?t=new RNe(i.api,e.threadId):t=new LNe(i.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,i){return Qh(async()=>{const n=this.getConfigProviderByHandle(e);if(!n)throw new Error("no DebugConfigurationProvider found");if(!n.provideDebugConfigurations)throw new Error("DebugConfigurationProvider has no method provideDebugConfigurations");const o=await this.getFolder(t);return n.provideDebugConfigurations(o,i)}).then(n=>{if(!n)throw new Error("nothing returned from DebugConfigurationProvider.provideDebugConfigurations");return n})}$resolveDebugConfiguration(e,t,i,n){return Qh(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,n)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,i,n){return Qh(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,n)})}async $provideDebugAdapter(e,t){const i=this.getAdapterDescriptorFactoryByHandle(e);if(!i)return Promise.reject(new Error("no adapter descriptor factory found for handle"));const n=await this.getSession(t);return this.getAdapterDescriptor(i,n).then(o=>{if(!o)throw new Error(`Couldn't find a debug adapter descriptor for debug type '${n.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 n={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(n)}convertToDto(e){if(e instanceof $9)return{type:"executable",command:e.command,args:e.args,options:e.options};if(e instanceof aH)return{type:"server",port:e.port,host:e.host};if(e instanceof G9)return{type:"pipeServer",path:e.path};if(e instanceof K9)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 n of i)if(n.label&&n.type&&n.type===t)return!0}}return!1}getDebugAdapterTrackers(e){const i=e.configuration.type,n=this._trackerFactories.filter(o=>o.type===i||o.type==="*").map(o=>Qh(()=>o.factory.createDebugAdapterTracker(e.api)).then(r=>r,r=>null));return Promise.race([Promise.all(n).then(o=>{const r=Fi(o);if(r.length>0)return new oti(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 aH(i));if(e){const o=await this._extensionService.getExtensionRegistry();return Qh(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,o))).then(r=>{if(r)return r})}const n=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,n))}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),n=e.parent?this._debugSessions.get(e.parent):void 0;t=new nti(this._debugServiceProxy,e.id,e.type,e.name,i,e.configuration,n?.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=N.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:XZ.Command};if("treeId"in t)return{type:XZ.Tree,id:`${e}\0${t.treeId}`};throw new Error("Unsupported debug visualization type")}}getIconPathOrClass(e){const t=this.getIconUris(e);let i,n;return"id"in t?n=We.asClassName(t):i=t,{iconPath:i,iconClass:n}}getIconUris(e){if(e instanceof hu)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"?N.file(t):t,light:typeof i=="string"?N.file(i):i}}};pIe=D([_(0,Jo),_(1,nE),_(2,DI),_(3,sE),_(4,dG),_(5,xPe),_(6,KN),_(7,sle)],pIe);class nti{constructor(e,t,i,n,o,r,a){this._debugServiceProxy=e,this._id=t,this._type=i,this._name=n,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 sti{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(t){this.append(t+` +`)}})}}class oti{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 rti extends wnt{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 mIe=class extends pIe{constructor(e,t,i,n,o,r,a,c){super(e,t,i,n,o,r,a,c)}};mIe=D([_(0,Jo),_(1,nE),_(2,DI),_(3,sE),_(4,dG),_(5,xPe),_(6,KN),_(7,sle)],mIe);class ati{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&&K_(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&K_(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,n)=>{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=Ko(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=>{n(new Error(Nr(r)))})})}async searchInFolder(e,t){const i=new ci,n=this.getSearchOptionsForFolder(e),o=this.initDirectoryTree(),r=new kit(this.config,e),a=!r.hasSiblingExcludeClauses();let c;try{this.activeCancellationTokens.add(i),c=js.create();const l=await this.provider.provideFileSearchResults({pattern:this.config.filePattern||""},n,i.token),d=c.elapsed(),h=js.create();return this.isCanceled&&!this.isLimitHit||(l&&l.forEach(u=>{const f=Vi.relative(e.folder.path,u.path);if(a){const p=Ko(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=wee(this.config.includePattern,e.includePattern),i=wee(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,n){if(i===this.filePattern){const r=Ko(this.filePattern);this.matchFile(n,{base:t,relativePath:this.filePattern,basename:r})}function o(r){const a=Ko(r),c=bb(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,n){const o=this,r=this.filePattern;function a(c){const l=o3t(()=>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 ire=class ire{constructor(){this.sessions=new Map}fileSearch(e,t,i,n){const o=this.getSessionTokenSource(e.cacheKey),r=new ati(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,ire.BATCH_SIZE,c,n).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 ci),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:Pt(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,n){const o=n.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)))}};ire.BATCH_SIZE=512;let _Ie=ire;class S9e{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||[],n=new ci(t);return new Promise((o,r)=>{this.collector=new lti(e);let a=!1;const c=(l,d)=>{if(!a&&!this.isLimitHit){const h=this.resultSize(l);HV(l)&&typeof this.query.maxResults=="number"&&this.resultCount+h>this.query.maxResults&&(this.isLimitHit=!0,a=!0,n.cancel(),l=this.trimResultToSize(l,this.query.maxResults-this.resultCount));const u=this.resultSize(l);this.resultCount+=u,(u>0||!HV(l))&&this.collector.add(l,d)}};Promise.all(i.map((l,d)=>this.searchInFolder(l,h=>c(h,d),n.token))).then(l=>{n.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=>{n.dispose();const d=Nr(l);r(new Error(d))})})}resultSize(e){return HV(e)?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){const i=Array.isArray(e.ranges)?e.ranges:[e.ranges],n=Array.isArray(e.preview.matches)?e.preview.matches:[e.preview.matches];return{ranges:i.slice(0,t),preview:{matches:n.slice(0,t),text:e.preview.text},uri:e.uri}}async searchInFolder(e,t,i){const n=new kit(this.query,e),o=[],r={report:l=>{if(!this.validateProviderResult(l))return;const d=e.folder.scheme===pe.file?s3t(()=>this.fileUtils.readdir(Lr(l.uri))):void 0,h=SN(e.folder,l.uri);if(h){const u=n.includedInQuery(h,Ko(h),d);Gy(u)?o.push(u.then(f=>{f&&t(l)})):u&&t(l)}}},a=this.getSearchOptionsForFolder(e);let c;return this.queryProviderPair.query.type===nI.aiText?c=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,a,r,i):c=await this.queryProviderPair.provider.provideTextSearchResults(cti(this.queryProviderPair.query.contentPattern),a,r,i),o.length&&await Promise.all(o),c}validateProviderResult(e){if(HV(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=wee(this.query.includePattern,e.includePattern),i=wee(this.query.excludePattern,e.excludePattern),n={folder:N.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??Y8t,previewOptions:this.query.previewOptions,afterContext:this.query.afterContext,beforeContext:this.query.beforeContext};return"usePCRE2"in this.query&&(n.usePCRE2=this.query.usePCRE2),n}}function cti(s){return{isCaseSensitive:s.isCaseSensitive||!1,isRegExp:s.isRegExp||!1,isWordMatch:s.isWordMatch||!1,isMultiline:s.isMultiline||!1,pattern:s.pattern}}class lti{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new vIe(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!ji(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(dti(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 dti(s){return HV(s)?{preview:{matches:e8(s.preview.matches,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character})),text:s.preview.text},ranges:e8(s.ranges,e=>({startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}))}:{text:s.text,lineNumber:s.lineNumber}}function HV(s){return!!s.preview}const bO=class bO{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()},bO.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))}};bO.TIMEOUT=4e3,bO.START_BATCH_AFTER_COUNT=50;let vIe=bO;const sot=ae("IExtHostSearch");let bIe=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(Be.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 _Ie}_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,n){const o=$ue(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))},n);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,n){const o=this._textSearchProvider.get(e);if(!o||!o.provideTextSearchResults)throw new Error(`Unknown Text Search Provider ${e}`);const r=$ue(i);return this.createTextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$provideAITextSearchResults(e,t,i,n){const o=this._aiTextSearchProvider.get(e);if(!o||!o.provideAITextSearchResults)throw new Error(`Unknown AI Text Search Provider ${e}`);const r=$ue(i);return this.createAITextSearchManager(r,o).search(c=>this._proxy.$handleTextMatch(e,t,c),n)}$enableExtensionHostSearch(){}createTextSearchManager(e,t){return new S9e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new S9e({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};bIe=D([_(0,Jo),_(1,ele),_(2,Ge)],bIe);function $ue(s){return{...s,folderQueries:s.folderQueries&&s.folderQueries.map(hti),extraFileResources:s.extraFileResources&&s.extraFileResources.map(e=>N.revive(e))}}function hti(s){return{...s,folder:N.revive(s.folder)}}var wIe,oM;let yIe=(oM=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=wIe.InitialState,this._proxy=e.getProxy(Be.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=N.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return zu(e.scheme)?Promise.reject("Invalid scheme - cannot be empty"):e.scheme===pe.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,i,t)}async asExternalUri(e,t){if(zu(e.scheme))return Promise.reject("Invalid scheme - cannot be empty");const i=await this._proxy.$asExternalUri(e,t);return N.from(i)}},wIe=oM,oM.InitialState={focused:!0,active:!0},oM);yIe=wIe=D([_(0,Jo)],yIe);const oot=ae("IExtHostWindow");let nne=class extends lQe{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(i=>Mo(i))),this._proxy=e.getProxy(Be.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(N.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,i){return new uti(this._proxy,e,t,i)}};nne=D([_(0,Jo),_(1,mu)],nne);class uti extends iae{constructor(e,t,i,n){super(n?.logLevel==="always"),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(i),this.proxy.$createLogger(t,n).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 rot=ae("IExtHostTerminalShellIntegration");let CIe=class extends V{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(Be.MainThreadTerminalShellIntegration),this._register(Ee(()=>{for(const[i,n]of this._activeShellIntegrations)n.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e){const t=this._extHostTerminalService.getTerminalById(e);if(!t)return;const i=t.value;let n=this._activeShellIntegrations.get(e);n||(n=new gti(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,n),n.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),n.store.add(n.onDidRequestShellExecution(o=>this._proxy.$executeCommand(e,o))),n.store.add(n.onDidRequestEndExecution(o=>this._onDidEndTerminalShellExecution.fire(o))),n.store.add(n.onDidRequestChangeShellIntegration(o=>this._onDidChangeTerminalShellIntegration.fire(o))),t.shellIntegration=n.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:n.value})}$shellExecutionStart(e,t,i,n,o){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const r={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.startShellExecution(r,N.revive(o))}$shellExecutionEnd(e,t,i,n,o){const r={value:t,confidence:i,isTrusted:n};this._activeShellIntegrations.get(e)?.endShellExecution(r,o)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(N.revive(t))}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}};CIe=D([_(0,Jo),_(1,KU)],CIe);class gti extends V{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(n,o){let r=n;o&&(r+=` "${o.map(l=>`${l.replaceAll('"','\\"')}`).join('" "')}"`),i._onDidRequestShellExecution.fire(r);const a={value:r,confidence:gD.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 n=this._currentExecution=new fti(e,t??this._cwd);i?queueMicrotask(()=>this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:n.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;N.isUri(this._cwd)?t=!N.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 fti{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 Kd.EMPTY;this._dataStream=new pti}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 pti extends V{constructor(){super(...arguments),this._emitters=[]}createIterable(){this._barrier||(this._barrier=new Gd);const e=this._barrier;return new Kd(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(APe,cIe,qt.Delayed);ce(lf,nne,qt.Delayed);ce(ile,Qke,qt.Delayed);ce(KN,Vke,qt.Eager);ce(yPe,oIe,qt.Eager);ce(CPe,aIe,qt.Eager);ce(sE,Hke,qt.Eager);ce(Zce,Fke,qt.Eager);ce(sle,fIe,qt.Eager);ce(not,mIe,qt.Eager);ce(Gst,Wke,qt.Eager);ce(GU,Gke,qt.Eager);ce(EPe,lIe,qt.Eager);ce($U,hei,qt.Eager);ce(zst,Oke,qt.Delayed);ce(sot,bIe,qt.Eager);ce(bPe,Yst,qt.Eager);ce(jst,eIe,qt.Eager);ce(KU,qke,qt.Eager);ce(rot,CIe,qt.Eager);ce(aPe,Xxe,qt.Eager);ce(oot,yIe,qt.Eager);ce(nE,Bke,qt.Eager);ce(SPe,Xst,qt.Eager);ce(tle,Uke,qt.Eager);ce(dG,tIe,qt.Eager);ce(xPe,uIe,qt.Eager);let SIe=class extends EYe{constructor(e,t,i){const n=i.remote.isRemote?"remoteexthost":e?"workerexthost":"exthost",o=i.remote.isRemote?g(578,"Extension Host (Remote)"):e?g(579,"Extension Host (Worker)"):g(580,"Extension Host");super(t.createLogger(n,{name:o}))}};SIe=D([_(1,lf),_(2,mu)],SIe);class A9e{static async installEarlyHandler(e){Error.stackTraceLimit=100;const t=e.get(Ge),n=e.get(Jo).getProxy(Be.MainThreadErrors);Uge(o=>{t.error(o);const r=yA(o);n.$onUnexpectedError(r)})}static async installFullHandler(e){const t=e.get(Ge),i=e.get(Jo),n=e.get(DI),o=e.get(tle),r=i.getProxy(Be.MainThreadExtensionService),a=i.getProxy(Be.MainThreadErrors),c=await n.getExtensionPathIndex(),l=new WeakMap;function d(f,p){if(l.has(f))return l.get(f).stack;let m="",v,b;for(const y of p)m+=` + at ${y.toString()}`,b=y.getFileName(),!v&&b&&(v=c.findSubstr(N.file(b)));const w=`${f.name||"Error"}: ${f.message||""}${m}`;return l.set(f,{extensionIdentifier:v?.identifier,stack:w}),w}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})}}),Uge(f=>{t.error(f);const p=yA(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 kPe{constructor(e,t,i,n,o){this._hostUtils=i,this._rpcProtocol=new gee(e,null,n),t=kPe._transform(t,this._rpcProtocol);const r=new Uc(..._pe());r.set(mu,{_serviceBrand:void 0,...t,messagePorts:o}),r.set(Jo,new Ajt(this._rpcProtocol)),r.set(ele,new gei(n)),r.set(Zst,i),r.set(Ge,new wi(SIe,[!0],!0)),r.set(lf,new wi(nne,[],!0));const a=new D3(r,!0);o8&&a.invokeFunction(A9e.installEarlyHandler),this._logService=a.invokeFunction(c=>c.get(Ge)),cs("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(DI)),this._extensionService.initialize(),o8&&a.invokeFunction(A9e.installFullHandler)}async asBrowserUri(e){const t=this._rpcProtocol.getProxy(Be.MainThreadExtensionService);return N.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(Be.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([t,i])=>[N.revive(t),N.revive(i)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(n=>{n.extensionLocation=N.revive(t.transformIncomingURIs(n.extensionLocation))}),e.environment.appRoot=N.revive(t.transformIncomingURIs(e.environment.appRoot));const i=e.environment.extensionDevelopmentLocationURI;return i&&(e.environment.extensionDevelopmentLocationURI=i.map(n=>N.revive(t.transformIncomingURIs(n)))),e.environment.extensionTestsLocationURI=N.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=N.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=N.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.environment.extensionTelemetryLogResource=N.revive(t.transformIncomingURIs(e.environment.extensionTelemetryLogResource)),e.nlsBaseUrl=N.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=N.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}}class mti{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Be.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const n=this._relatedInformationProviders.get(e);if(!n)throw new Error("related information provider not found");return await n.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(n,i),this._proxy.$registerAiRelatedInformationProvider(n,t),new Qs(()=>{this._proxy.$unregisterAiRelatedInformationProvider(n),this._relatedInformationProviders.delete(n)})}}const _ti=[new gn("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of DocumentHighlight-instances.",hv(MH.to))),new gn("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[ht.Uri],new nn("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(s,e)=>{if(aU(s))return;class t extends JW{static to(n){const o=new t(n.name,Z_.to(n.kind),n.containerName||"",new vp(e[0],et.to(n.range)));return o.detail=n.detail,o.range=o.location.range,o.selectionRange=et.to(n.selectionRange),o.children=n.children?n.children.map(t.to):[],o}}return s.map(t.to)})),new gn("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[ht.Uri,new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",hv(nd.to))),new gn("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[ht.Uri,ht.Range,new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",hv(nd.to))),new gn("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[ht.Uri,ht.Position,new ht("ch","Trigger character",s=>typeof s=="string",s=>s),new ht("options","Formatting options",s=>!0,s=>s)],new nn("A promise that resolves to an array of TextEdits.",hv(nd.to))),new gn("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location or LocationLink instances.",gE)),new gn("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location-instances.",hv(cf.to))),new gn("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Location-instances.",hv(cf.to))),new gn("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Hover-instances.",hv(_$.to))),new gn("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of Hover-instances.",hv(_$.to))),new gn("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[ht.Uri,new ht("position","A position in a text document",s=>Array.isArray(s)&&s.every(e=>bs.isPosition(e)),s=>s.map(Yo.from))],new nn("A promise that resolves to an array of ranges.",s=>s.map(e=>{let t;for(const i of e.reverse())t=new eH(et.to(i),t);return t}))),new gn("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[ht.String.with("query","Search string")],new nn("A promise that resolves to an array of SymbolInformation-instances.",s=>s.map(p$.to))),new gn("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of CallHierarchyItem-instances",s=>s.map(lN.to))),new gn("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[ht.CallHierarchyItem],new nn("A promise that resolves to an array of CallHierarchyIncomingCall-instances",s=>s.map(REe.to))),new gn("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[ht.CallHierarchyItem],new nn("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",s=>s.map(MEe.to))),new gn("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[ht.Uri,ht.Position],new nn("A promise that resolves to a range and placeholder text.",s=>{if(s)return{range:et.to(s.range),placeholder:s.text}})),new gn("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[ht.Uri,ht.Position,ht.String.with("newName","The new symbol name")],new nn("A promise that resolves to a WorkspaceEdit.",s=>{if(s){if(s.rejectReason)throw new Error(s.rejectReason);return Qu.to(s)}})),new gn("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[ht.Uri,ht.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new nn("A promise that resolves to an array of DocumentLink-instances.",s=>s.map(QT.to))),new gn("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[ht.Uri],new nn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new tte(s.tokenTypes,s.tokenModifiers)})),new gn("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[ht.Uri],new nn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=eZ(s);if(e.type==="full")return new nN(e.data,void 0)})),new gn("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[ht.Uri,ht.Range.optional()],new nn("A promise that resolves to SemanticTokensLegend.",s=>{if(s)return new tte(s.tokenTypes,s.tokenModifiers)})),new gn("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[ht.Uri,ht.Range],new nn("A promise that resolves to SemanticTokens.",s=>{if(!s)return;const e=eZ(s);if(e.type==="full")return new nN(e.data,void 0)})),new gn("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[ht.Uri,ht.Position,ht.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),ht.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new nn("A promise that resolves to a CompletionList-instance.",(s,e,t)=>{if(!s)return new JM([]);const i=s.suggestions.map(n=>BEe.to(n,t));return new JM(i,s.incomplete)})),new gn("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[ht.Uri,ht.Position,ht.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new nn("A promise that resolves to SignatureHelp.",s=>{if(s)return v$.to(s)})),new gn("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[ht.Uri,ht.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new nn("A promise that resolves to an array of CodeLens-instances.",(s,e,t)=>hv(i=>new R9(et.to(i.range),i.command&&t.fromInternal(i.command)))(s))),new gn("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[ht.Uri,new ht("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",s=>Jn.isRange(s),s=>oC.isSelection(s)?Fb.from(s):et.from(s)),ht.String.with("kind","Code action kind to return code actions for").optional(),ht.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new nn("A promise that resolves to an array of Command-instances.",(s,e,t)=>hv(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const n=new L9(i.title,i.kind?new Sa(i.kind):void 0);return i.edit&&(n.edit=Qu.to(i.edit)),i.command&&(n.command=t.fromInternal(i.command)),n.isPreferred=i.isPreferred,n}})(s))),new gn("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[ht.Uri],new nn("A promise that resolves to an array of ColorInformation objects.",s=>s?s.map(e=>new B9(et.to(e.range),NH.to(e.color))):[])),new gn("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new ht("color","The color to show and insert",s=>s instanceof eN,NH.from),new ht("context","Context object with uri and range",s=>!0,s=>({uri:s.uri,range:et.from(s.range)}))],new nn("A promise that resolves to an array of ColorPresentation objects.",s=>s?s.map($te.to):[])),new gn("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[ht.Uri,ht.Range],new nn("A promise that resolves to an array of Inlay objects",(s,e,t)=>s.map(WEe.to.bind(void 0,t)))),new gn("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[ht.Uri],new nn("A promise that resolves to an array of FoldingRange objects",(s,e)=>{if(s)return s.map(Kte.to)})),new gn("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new nn("A promise that resolves to an array of NotebookContentProvider static info objects.",hv(s=>({viewType:s.viewType,displayName:s.displayName,options:{transientOutputs:s.options.transientOutputs,transientCellMetadata:s.options.transientCellMetadata,transientDocumentMetadata:s.options.transientDocumentMetadata},filenamePattern:s.filenamePattern.map(e=>jte.to(e))})))),new gn("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[ht.Uri,ht.Range,new ht("context","An InlineValueContext",s=>s&&typeof s.frameId=="number"&&s.stoppedLocation instanceof Jn,s=>Bte.from(s))],new nn("A promise that resolves to an array of InlineValue objects",s=>s.map(Ote.to))),new gn("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 ht("uriOrString","Uri-instance or string (only http/https)",s=>N.isUri(s)||typeof s=="string"&&y8(s,pe.http,pe.https),s=>s),new ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="number"||typeof s=="object",s=>s&&(typeof s=="number"?[El.from(s),void 0]:[El.from(s.viewColumn),az.from(s)])).optional(),ht.String.with("label","").optional()],nn.Void),new gn("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[ht.Uri.with("resource","Resource to open"),ht.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 ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="number"||typeof s=="object",s=>s&&(typeof s=="number"?[El.from(s),void 0]:[El.from(s.viewColumn),az.from(s)])).optional()],nn.Void),new gn("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[ht.Uri.with("left","Left-hand side resource of the diff editor"),ht.Uri.with("right","Right-hand side resource of the diff editor"),ht.String.with("title","Human readable title for the diff editor").optional(),new ht("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",s=>s===void 0||typeof s=="object",s=>s&&[El.from(s.viewColumn),az.from(s)]).optional()],nn.Void),new gn("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[ht.String.with("title","Human readable title for the changes editor"),new ht("resourceList","List of resources to compare",s=>{for(const e of s){if(e.length!==3)return!1;const[t,i,n]=e;if(!N.isUri(t)||!N.isUri(i)&&i!==void 0&&i!==null||!N.isUri(n)&&n!==void 0&&n!==null)return!1}return!0},s=>s)],nn.Void),new gn("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[ht.Uri,ht.Position],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(jT.to))),new gn("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[ht.TypeHierarchyItem],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(jT.to))),new gn("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[ht.TypeHierarchyItem],new nn("A promise that resolves to an array of TypeHierarchyItem-instances",s=>s.map(jT.to))),new gn("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[ht.TestItem],nn.Void),new gn("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[ht.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],nn.Void),new gn("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[ht.String.with("name","The context key name"),new ht("value","The context key value",()=>!0,s=>s)],nn.Void),new gn("vscode.executeMappedEditsProvider","_executeMappedEditsProvider","Execute Mapped Edits Provider",[ht.Uri,ht.StringArray,new ht("MappedEditsContext","Mapped Edits Context",s=>Qte.is(s),s=>Qte.from(s))],new nn("A promise that resolves to a workspace edit or null",s=>s?Qu.to(s):null)),new gn("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new ht("Run arguments","",s=>!0,s=>{if(s)return{initialRange:s.initialRange?et.from(s.initialRange):void 0,initialSelection:oC.isSelection(s.initialSelection)?Fb.from(s.initialSelection):void 0,message:s.message,autoSend:s.autoSend,position:s.position?Yo.from(s.position):void 0}})],nn.Void)];class vti{static register(e){_ti.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",Aat)}}function hv(s){return e=>{if(Array.isArray(e))return e.map(s)}}function gE(s){if(!Array.isArray(s))return;const e=[];for(const t of s)cGe(t)?e.push(m$.to(t)):e.push(cf.to(t));return e}let AIe=class{constructor(e,t){this._proxy=e.getProxy(Be.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const n=new qd(Qu.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(n,void 0,i?.isRefactoring??!1)}};AIe=D([_(0,Jo)],AIe);class bti{constructor(e,t,i,n,o){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=n,this._sessionDisposables=o,this._stopWatch=js.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(n){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,n),o}};const e=this;this._stopWatch.reset();const i=(n,o)=>{if(typeof this._firstProgress>"u"&&"content"in n&&(this._firstProgress=this._stopWatch.elapsed()),o){const r=this._proxy.$handleProgressChunk(this._request.requestId,n),a={report:c=>{r?.then(l=>{l&&(af.isMarkdownString(c.value)?this._proxy.$handleProgressChunk(this._request.requestId,E$.from(c),l):this._proxy.$handleProgressChunk(this._request.requestId,gA.from(c),l))})}};Promise.all([r,o?.(a)]).then(([c,l])=>{c!==void 0&&l!==void 0&&this._proxy.$handleProgressChunk(this._request.requestId,JEe.from(l),c)})}else this._proxy.$handleProgressChunk(this._request.requestId,n)};this._apiObject={markdown(n){t(this.markdown);const o=new nG(n),r=C$.from(o);return i(r),this},markdownWithVulnerabilities(n,o){t(this.markdown),o&&Ve(e._extension,"chatParticipantAdditions");const r=new bH(n,o),a=tie.from(r);return i(a),this},filetree(n,o){t(this.filetree);const r=new sG(n,o),a=S$.from(r);return i(a),this},anchor(n,o){t(this.anchor);const r=new oG(n,o),a=A$.from(r);return i(a),this},button(n){t(this.anchor);const o=new rG(n),r=x$.from(o,e._commandsConverter,e._sessionDisposables);return i(r),this},progress(n,o){t(this.progress);const r=new zNe(n,o),a=o?YEe.from(r):WH.from(r);return i(a,o),this},warning(n){t(this.progress),Ve(e._extension,"chatParticipantAdditions");const o=new CH(n),r=E$.from(o);return i(r),this},reference(n,o){return this.reference2(n,o)},reference2(n,o,r){if(t(this.reference),"variableName"in n&&Ve(e._extension,"chatParticipantAdditions"),"variableName"in n&&!n.value){const a=e._request.variables.variables.find(c=>c.name===n.variableName);if(a){let c;if(a.references?.length)c=a.references.map(l=>({kind:"reference",reference:{variableName:n.variableName,value:l.reference}}));else{const l=new Eb(n,o,r);c=[gA.from(l)]}return c.forEach(l=>i(l)),this}}else{const a=new Eb(n,o,r),c=gA.from(a);i(c)}return this},codeCitation(n,o,r){t(this.codeCitation),Ve(e._extension,"chatParticipantAdditions");const a=new a$(n,o,r),c=oie.from(a);i(c)},textEdit(n,o){t(this.textEdit),Ve(e._extension,"chatParticipantAdditions");const r=new SH(n,o),a=sie.from(r);return i(a),this},detectedParticipant(n,o){t(this.detectedParticipant),Ve(e._extension,"chatParticipantAdditions");const r=new wH(n,o),a=iie.from(r);return i(a),this},confirmation(n,o,r,a){t(this.confirmation),Ve(e._extension,"chatParticipantAdditions");const c=new r$(n,o,r,a),l=nie.from(c);return i(l),this},push(n){if(t(this.push),(n instanceof SH||n instanceof bH||n instanceof wH||n instanceof CH||n instanceof r$||n instanceof a$)&&Ve(e._extension,"chatParticipantAdditions"),n instanceof Eb)this.reference2(n.value,n.iconPath,n.options);else{const o=rie.from(n,e._commandsConverter,e._sessionDisposables);i(o)}return this}}}return this._apiObject}}const Jz=class Jz extends V{constructor(e,t,i,n){super(),this._logService=t,this._commands=i,this._documents=n,this._agents=new Map,this._sessionDisposables=this._register(new mo),this._completionDisposables=this._register(new mo),this._proxy=e.getProxy(Be.MainThreadChatAgents2)}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const n=Jz._idPool++,o=new E9e(e,t,this._proxy,n,i);return this._agents.set(n,o),this._proxy.$registerAgent(n,e.identifier,t,{},void 0),o.apiAgent}createDynamicChatAgent(e,t,i,n){const o=Jz._idPool++,r=new E9e(e,t,this._proxy,o,n);return this._agents.set(o,r),this._proxy.$registerAgent(o,e.identifier,t,{isSticky:!0},i),r.apiAgent}async $invokeAgent(e,t,i,n){const o=this._agents.get(e);if(!o)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);const r=Mo(t);let a=this._sessionDisposables.get(r.sessionId);a||(a=new Z,this._sessionDisposables.set(r.sessionId,a));const c=new bti(o.extension,r,this._proxy,this._commands.converter,a);try{const l=await this.prepareHistoryTurns(r.agentId,i);let d;if(r.locationData?.type===Ir.Editor){const u=this._documents.getDocument(r.locationData.document);d=new KNe(u,Fb.to(r.locationData.selection),et.to(r.locationData.wholeRange))}else if(r.locationData?.type===Ir.Notebook){const u=this._documents.getDocument(r.locationData.sessionInputUri);d=new qNe(u)}else r.locationData?.type,Ir.Terminal;const h=o.invoke(XEe.to(r,d),{history:l},c.apiObject,n);return await B_(Promise.resolve(h).then(u=>{if(u?.metadata)try{JSON.stringify(u.metadata)}catch(p){const m=`result.metadata MUST be JSON.stringify-able. Got error: ${p.message}`;return this._logService.error(`[${o.extension.identifier.value}] [@${o.id}] ${m}`,o.extension),{errorDetails:{message:m},timings:c.timings}}let f;return u?.errorDetails&&(f={...u.errorDetails,responseIsIncomplete:!0}),f?.responseIsRedacted&&Ve(o.extension,"chatParticipantPrivate"),{errorDetails:f,timings:c.timings,metadata:u?.metadata}}),n)}catch(l){return this._logService.error(l,o.extension),l instanceof Tw&&l.cause&&(l=l.cause),{errorDetails:{message:Nr(l),responseIsIncomplete:!0}}}finally{c.close()}}async prepareHistoryTurns(e,t){const i=[];for(const n of t.history){const o=sB.to(n.result),r=e===n.request.agentId?o:{...o,metadata:void 0},a=n.request.variables.variables.filter(l=>!l.isTool).map(aie.to);i.push(new $Ne(n.request.message,n.request.command,a,n.request.agentId));const c=Fi(n.response.map(l=>rie.toContent(l,this._commands.converter)));i.push(new GNe(c,r,n.request.agentId,n.request.command))}return i}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e)}async $provideFollowups(e,t,i,n,o){const r=this._agents.get(t);if(!r)return Promise.resolve([]);const a=Mo(e),c=await this.prepareHistoryTurns(r.id,n),l=sB.to(i);return(await r.provideFollowups(l,{history:c},o)).filter(d=>{const h=!d.participant||hi.some(this._agents.values(),u=>u.id===d.participant&&Sn.equals(u.extension.identifier,r.extension.identifier));return h||this._logService.warn(`[@${r.id}] ChatFollowup refers to an unknown participant: ${d.participant}`),h}).map(d=>y$.from(d,a))}$acceptFeedback(e,t,i,n){const o=this._agents.get(e);if(!o)return;const r=sB.to(t);let a;switch(i){case PW.Down:a=vH.Unhelpful;break;case PW.Up:a=vH.Helpful;break}o.acceptFeedback(Object.freeze(n?{result:r,kind:a,reportIssue:n}:{result:r,kind:a}))}$acceptAction(e,t,i){const n=this._agents.get(e);if(!n||i.action.kind==="vote")return;const o=exe.to(t,i,this._commands.converter);o&&n.acceptAction(Object.freeze(o))}async $invokeCompletionProvider(e,t,i){const n=this._agents.get(e);if(!n)return[];let o=this._completionDisposables.get(e);return o?o.clear():(o=new Z,this._completionDisposables.set(e,o)),(await n.invokeCompletionProvider(t,i)).map(a=>ZEe.from(a,this._commands.converter,o))}async $provideWelcomeMessage(e,t,i){const n=this._agents.get(e);if(n)return await n.provideWelcomeMessage(D$.to(t),i)}async $provideSampleQuestions(e,t,i){const n=this._agents.get(e);if(n)return(await n.provideSampleQuestions(D$.to(t),i)).map(o=>y$.from(o,void 0))}};Jz._idPool=0;let EIe=Jz;class E9e{constructor(e,t,i,n,o){this.extension=e,this.id=t,this._proxy=i,this._handle=n,this._requestHandler=o,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)??[]:[]}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const n=await this._followupProvider.provideFollowups(e,t,i);return n?n.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(n=>typeof n=="string"?n:Ps.from(n)):[]}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(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof N?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 hu?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,isSecondary:this._isSecondary,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Ps.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Ps.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Ps.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,supportsSlowVariables:this._supportsSlowReferences}),t=!1}))},n=this;return{get id(){return n.id},get iconPath(){return n._iconPath},set iconPath(o){n._iconPath=o,i()},get requestHandler(){return n._requestHandler},set requestHandler(o){Tt(typeof o=="function","Invalid request handler"),n._requestHandler=o},get followupProvider(){return n._followupProvider},set followupProvider(o){n._followupProvider=o,i()},get isDefault(){return Ve(n.extension,"defaultChatParticipant"),n._isDefault},set isDefault(o){Ve(n.extension,"defaultChatParticipant"),n._isDefault=o,i()},get helpTextPrefix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextPrefix},set helpTextPrefix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextPrefix=o,i()},get helpTextVariablesPrefix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix},set helpTextVariablesPrefix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextVariablesPrefix=o,i()},get helpTextPostfix(){return Ve(n.extension,"defaultChatParticipant"),n._helpTextPostfix},set helpTextPostfix(o){Ve(n.extension,"defaultChatParticipant"),n._helpTextPostfix=o,i()},get isSecondary(){return Ve(n.extension,"defaultChatParticipant"),n._isSecondary},set isSecondary(o){Ve(n.extension,"defaultChatParticipant"),n._isSecondary=o,i()},get supportIssueReporting(){return Ve(n.extension,"chatParticipantPrivate"),n._supportIssueReporting},set supportIssueReporting(o){Ve(n.extension,"chatParticipantPrivate"),n._supportIssueReporting=o,i()},get onDidReceiveFeedback(){return n._onDidReceiveFeedback.event},set participantVariableProvider(o){if(Ve(n.extension,"chatParticipantAdditions"),n._agentVariableProvider=o,o){if(!o.triggerCharacters.length)throw new Error("triggerCharacters are required");n._proxy.$registerAgentCompletionsProvider(n._handle,n.id,o.triggerCharacters)}else n._proxy.$unregisterAgentCompletionsProvider(n._handle,n.id)},get participantVariableProvider(){return Ve(n.extension,"chatParticipantAdditions"),n._agentVariableProvider},set welcomeMessageProvider(o){Ve(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider=o,i()},get welcomeMessageProvider(){return Ve(n.extension,"defaultChatParticipant"),n._welcomeMessageProvider},onDidPerformAction:ll(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(o){n._requester=o,i()},get requester(){return n._requester},set supportsSlowReferences(o){Ve(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences=o,i()},get supportsSlowReferences(){return Ve(n.extension,"chatParticipantPrivate"),n._supportsSlowReferences},dispose(){e=!0,n._followupProvider=void 0,n._onDidReceiveFeedback.dispose(),n._proxy.$unregisterAgent(n._handle)}}}invoke(e,t,i,n){return this._requestHandler(e,t,i,n)}}const nre=class nre{constructor(e){this._resolver=new Map,this._proxy=e.getProxy(Be.MainThreadChatVariables)}async $resolveVariable(e,t,i,n){const o=this._resolver.get(e);if(o)try{if(o.resolver.resolve2){Ve(o.extension,"chatParticipantAdditions");const r=new wti(t,this._proxy),a=await o.resolver.resolve2(o.data.name,{prompt:i},r.apiObject,n);if(a&&a[0])return a[0].value}else{const r=await o.resolver.resolve(o.data.name,{prompt:i},n);if(r&&r[0])return r[0].value}}catch(r){No(r)}}registerVariableResolver(e,t,i,n,o,r,a,c,l){const d=nre._idPool++,h=l?We.fromId(l):void 0;return this._resolver.set(d,{extension:e,data:{id:t,name:i,description:n,modelDescription:o,icon:h},resolver:a}),this._proxy.$registerVariable(d,{id:t,name:i,description:n,modelDescription:o,isSlow:r,fullName:c,icon:h}),Ee(()=>{this._resolver.delete(d),this._proxy.$unregisterVariable(d)})}};nre._idPool=0;let xIe=nre;class wti{constructor(e,t){this._requestId=e,this._proxy=t,this._isClosed=!1}close(){this._isClosed=!0}get apiObject(){if(!this._apiObject){let t=function(n){if(e._isClosed){const o=new Error("Response stream has been closed");throw Error.captureStackTrace(o,n),o}};const e=this,i=n=>{this._proxy.$handleProgressChunk(this._requestId,n)};this._apiObject={progress(n){t(this.progress);const o=new yH(n),r=WH.from(o);return i(r),this},reference(n){t(this.reference);const o=new Eb(n),r=gA.from(o);return i(r),this},push(n){return t(this.push),n instanceof Eb?i(gA.from(n)):n instanceof yH&&i(WH.from(n)),this}}}return this._apiObject}}class yti{constructor(e){const t=e.getProxy(Be.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const aot="vscode-cdn.net",Cti=`vscode-resource.${aot}`,DIe=`'self' https://*.${aot}`;function Az(s,e){return s.scheme===pe.http||s.scheme===pe.https?s:(e&&e.authority&&e.isRemote&&s.scheme===pe.file&&(s=N.from({scheme:pe.vscodeRemote,authority:e.authority,path:s.path})),N.from({scheme:pe.https,authority:`${s.scheme}+${Sti(s.authority)}.${Cti}`,path:s.path,fragment:s.fragment,query:s.query}))}function Sti(s){return s.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=B.a&&t<=B.z||t>=B.A&&t<=B.Z||t>=B.Digit0&&t<=B.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class Ati{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 n=t.getVisibleTextEditors();for(const o of this._insets.values())n.indexOf(o.editor)<0&&o.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,n,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 Az(f,a._remoteInfo)}get cspSource(){return DIe}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,n||{},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 Eti(s,e,t){const i=s.getProxy(Be.MainThreadComments),f=class f{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new va,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===ws.CommentController){const b=this._commentControllers.get(v.handle);return b?b.value:v}else if(v&&v.$mid===ws.CommentThread){const b=v,w=this._commentControllers.get(b.commentControlHandle);if(!w)return b;const y=w.getCommentThread(b.commentThreadHandle);return y?y.value:b}else if(v&&(v.$mid===ws.CommentThreadReply||v.$mid===ws.CommentThreadInstance)){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);return w?v.$mid===ws.CommentThreadInstance?w.value:{thread:w.value,text:v.text}:v}else if(v&&v.$mid===ws.CommentNode){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);if(!w)return v;const y=v.commentUniqueId,C=w.getCommentByUniqueId(y);return C||v}else if(v&&v.$mid===ws.CommentThreadNode){const b=this._commentControllers.get(v.thread.commentControlHandle);if(!b)return v;const w=b.getCommentThread(v.thread.commentThreadHandle);if(!w)return v;const y=v.text,C=v.commentUniqueId,A=w.getCommentByUniqueId(C);return A?(typeof A.body=="string"?A.body=y:A.body=new af(y),A):v}return v}})}createCommentController(v,b,w){const y=f.handlePool++,C=new r(v,y,b,w);this._commentControllers.set(C.handle,C);const A=this._commentControllersByExtension.get(v.identifier)||[];return A.push(C),this._commentControllersByExtension.set(v.identifier,A),C.value}async $createCommentThreadTemplate(v,b,w,y){const C=this._commentControllers.get(v);C&&C.$createCommentThreadTemplate(b,w,y)}async $setActiveComment(v,b){const w=this._commentControllers.get(v);w&&w.$setActiveComment(b??void 0)}async $updateCommentThreadTemplate(v,b,w){const y=this._commentControllers.get(v);y&&y.$updateCommentThreadTemplate(b,w)}$deleteCommentThread(v,b){this._commentControllers.get(v)?.$deleteCommentThread(b)}async $provideCommentingRanges(v,b,w){const y=this._commentControllers.get(v);if(!y||!y.commentingRangeProvider)return Promise.resolve(void 0);const C=await t.ensureDocumentData(N.revive(b));return Qh(async()=>{const A=await y.commentingRangeProvider.provideCommentingRanges(C.document,w);let L;return Array.isArray(A)?L={ranges:A,fileComments:!1}:A?L={ranges:A.ranges||[],fileComments:A.enableFileComments||!1}:L=A??void 0,L}).then(A=>{let L;return A&&(L={ranges:A.ranges.map(k=>et.from(k)),fileComments:A.fileComments}),L})}$toggleReaction(v,b,w,y,C){const A=this._commentControllers.get(v);return!A||!A.reactionHandler?Promise.resolve(void 0):Qh(()=>{const L=A.getCommentThread(b);if(L){const k=L.getCommentByUniqueId(y.uniqueIdInThread);if(A!==void 0&&k&&A.reactionHandler)return A.reactionHandler(k,l(C))}return Promise.resolve(void 0)})}};f.handlePool=0;let n=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"?(Ve(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,b,w,y,C,A,L,k,P){this._commentControllerHandle=b,this._id=w,this._uri=y,this._range=C,this._comments=A,this.extensionDescription=L,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 wn,this._acceptInputDisposables.value=new Z,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(b,this.handle,this._id,this._uri,et.from(this._range),this._comments.map(z=>a(this,z,this._commentsMap,this.extensionDescription)),L.identifier,this._isTemplate,P),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(b,this.handle)}});const R=this;this.value={get uri(){return R.uri},get range(){return R.range},set range(z){R.range=z},get comments(){return R.comments},set comments(z){R.comments=z},get collapsibleState(){return R.collapsibleState},set collapsibleState(z){R.collapsibleState=z},get canReply(){return R.canReply},set canReply(z){R.canReply=z},get contextValue(){return R.contextValue},set contextValue(z){R.contextValue=z},get label(){return R.label},set label(z){R.label=z},get state(){return R.state},set state(z){R.state=z},reveal:(z,G)=>R.reveal(z,G),hide:()=>R.hide(),dispose:()=>{R.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=w=>Object.prototype.hasOwnProperty.call(this.modifications,w),b={};v("range")&&(b.range=et.from(this._range)),v("label")&&(b.label=this.label),v("contextValue")&&(b.contextValue=this.contextValue??null),v("comments")&&(b.comments=this._comments.map(w=>a(this,w,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(b.collapseState=d(this._collapseState)),v("canReply")&&(b.canReply=this.canReply),v("state")&&(b.state=h(this._state)),v("applicability")&&(b.applicability=u(this._state)),v("isTemplate")&&(b.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,b)}getCommentByUniqueId(v){for(const b of this._commentsMap){const w=b[0],y=b[1];if(v===y)return w}}async reveal(v,b){Ve(this.extensionDescription,"commentReveal");let w;v&&v.body!==void 0?w=v:b=b??v;let y=w?this._commentsMap.get(w):void 0;y??=this._commentsMap.get(this._comments[0]);let C=!0,A=!1;return b?.focus===gH.Reply?(A=!0,C=!1):b?.focus===gH.Comment&&(C=!1),i.$revealCommentThread(this._commentControllerHandle,this.handle,y,{preserveFocus:C,focusReply:A})}async hide(){return i.$hideCommentThread(this._commentControllerHandle,this.handle)}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&&Ve(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 Ve(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return Ve(this._extension,"activeComment"),this._activeThread}constructor(v,b,w,y){this._extension=v,this._handle=b,this._id=w,this._label=y,this._threads=new Map,i.$registerCommentController(this.handle,w,y,this._extension.identifier.value);const C=this;this.value=Object.freeze({id:C.id,label:C.label,get options(){return C.options},set options(A){C.options=A},get commentingRangeProvider(){return C.commentingRangeProvider},set commentingRangeProvider(A){C.commentingRangeProvider=A},get reactionHandler(){return C.reactionHandler},set reactionHandler(A){C.reactionHandler=A},get activeCommentThread(){return C.activeCommentThread},createCommentThread(A,L,k){return C.createCommentThread(A,L,k).value},dispose:()=>{C.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,b,w){b===void 0&&Ve(this._extension,"fileComments");const y=new o(this.id,this.handle,void 0,v,b,w,this._extension,!1);return this._threads.set(y.handle,y),y}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const b=this._threads.get(v.commentThreadHandle);b&&(this._activeComment=v.uniqueIdInThread?b.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=b)}$createCommentThreadTemplate(v,b,w){const y=new o(this.id,this.handle,void 0,N.revive(v),et.to(b),[],this._extension,!0,w);return y.collapsibleState=Lc.Expanded,this._threads.set(y.handle,y),y}$updateCommentThreadTemplate(v,b){const w=this._threads.get(v);w&&(w.range=et.to(b))}$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,b,w){let y=b.get(v);return y||(y=++m.commentHandle,b.set(v,y)),v.state!==void 0&&Ve(w,"commentsDraftState"),v.reactions?.some(C=>C.reactors!==void 0)&&Ve(w,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:y,body:typeof v.body=="string"?v.body:Ps.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(C=>c(C)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function c(m){return{label:m.label,iconPath:m.iconPath?$ce(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?N.revive(m.iconPath):"",authorHasReacted:m.hasReacted||!1,reactors:m.reactors?.map(v=>({name:v}))}}function d(m){if(m!==void 0)switch(m){case dH.Expanded:return Lc.Expanded;case dH.Collapsed:return Lc.Collapsed}return Lc.Collapsed}function h(m){let v;if(typeof m=="object"?v=m.resolved:v=m,v!==void 0)switch(v){case hH.Unresolved:return ou.Unresolved;case hH.Resolved:return ou.Resolved}return ou.Unresolved}function u(m){let v;if(typeof m=="object"&&(v=m.applicability),v!==void 0)switch(v){case uH.Current:return jx.Current;case uH.Outdated:return jx.Outdated}return jx.Current}return new n}var q1,Q1,m7,_7,v7,Rw,j1,Y1,J1,X1,b7,jB,Z1;class xti{constructor(e,t,i,n,o,r,a){Wt(this,q1);Wt(this,Q1);Wt(this,m7);Wt(this,_7);Wt(this,v7);Wt(this,Rw);Wt(this,j1);Wt(this,Y1);Wt(this,J1);Wt(this,X1);Wt(this,b7);Wt(this,jB);Wt(this,Z1);Ct(this,j1,""),Ct(this,J1,!1),Ct(this,X1,!1),this._onMessageEmitter=new I,this.onDidReceiveMessage=this._onMessageEmitter.event,Ct(this,Z1,new I),this._onDidDispose=Ce(this,Z1).event,Ct(this,q1,e),Ct(this,Q1,t),Ct(this,Y1,i),Ct(this,_7,n),Ct(this,v7,o),Ct(this,Rw,r),Ct(this,b7,$H(r)),Ct(this,jB,Dti(r)),Ct(this,m7,a)}dispose(){Ct(this,J1,!0),Ce(this,Z1).fire(),Ce(this,Z1).dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return Ct(this,X1,!0),Az(e,Ce(this,_7))}get cspSource(){const e=Ce(this,Rw).extensionLocation;if(e.scheme===pe.https||e.scheme===pe.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+DIe}return DIe}get html(){return this.assertNotDisposed(),Ce(this,j1)}set html(e){this.assertNotDisposed(),Ce(this,j1)!==e&&(Ct(this,j1,e),Ce(this,jB)&&!Ce(this,X1)&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(Ct(this,X1,!0),Ce(this,m7).report("Webview vscode-resource: uris",Ce(this,Rw),"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),Ce(this,Q1).$setHtml(Ce(this,q1),this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),Ce(this,Y1)}set options(e){this.assertNotDisposed(),Ys(Ce(this,Y1),e)||Ce(this,Q1).$setOptions(Ce(this,q1),cot(Ce(this,Rw),Ce(this,v7),e)),Ct(this,Y1,e)}async postMessage(e){if(Ce(this,J1))return!1;const t=vnt(e,{serializeBuffersForPostMessage:Ce(this,b7)});return Ce(this,Q1).$postMessage(Ce(this,q1),t.message,...t.buffers)}assertNotDisposed(){if(Ce(this,J1))throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!Ce(this,jB))return e;const t=Ce(this,Rw).extensionLocation?.scheme===pe.vscodeRemote,i=Ce(this,Rw).extensionLocation.scheme===pe.vscodeRemote?Ce(this,Rw).extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,o,r,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Az(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(n,o,r,a,c,l)=>{const d=N.from({scheme:a||"file",path:decodeURIComponent(c)}),h=Az(d,{isRemote:t,authority:i}).toString();return`${o}${h}${l}`})}}q1=new WeakMap,Q1=new WeakMap,m7=new WeakMap,_7=new WeakMap,v7=new WeakMap,Rw=new WeakMap,j1=new WeakMap,Y1=new WeakMap,J1=new WeakMap,X1=new WeakMap,b7=new WeakMap,jB=new WeakMap,Z1=new WeakMap;function $H(s){try{const e=A9(S9(s.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function Dti(s){try{const e=A9(S9(s.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class kti extends V{constructor(e,t,i,n,o){super(),this.remoteInfo=t,this.workspace=i,this._logService=n,this._deprecationService=o,this._webviews=new Map,this._webviewProxy=e.getProxy(Be.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const n=this.getWebview(e);if(n){const{message:o}=bnt(t,i.value);n._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 n=new xti(e,this._webviewProxy,Iti(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,n);const o=n._onDidDispose(()=>{o.dispose(),this.deleteWebview(e)});return n}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function sne(s){return{id:s.identifier,location:s.extensionLocation}}function cot(s,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||Tti(s,e)}}function Iti(s){return{enableCommandUris:s.enableCommandUris,enableScripts:s.enableScripts,enableForms:s.enableForms,portMapping:s.portMapping,localResourceRoots:s.localResourceRoots?.map(e=>N.from(e))}}function Tti(s,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),s.extensionLocation]}const sre=class sre{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(){sre.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};sre.enableDebugLogging=!1;let vm=sre;class Lti{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new vm("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=Oti(this.document.uri)+this._backupCounter++;return Pt(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 Rti{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const n=this.key(e,t.uri);if(this._documents.has(n))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const o=new Lti(t,i);return this._documents.set(n,o),o}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var $x;(function(s){s[s.Text=0]="Text",s[s.Custom=1]="Custom"})($x||($x={}));class Mti{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:$x.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:$x.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 Qs(()=>this._providers.delete(e))}}class Nti{constructor(e,t,i,n,o){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=n,this._extHostWebviewPanels=o,this._editorProviders=new Mti,this._documents=new Rti,this._proxy=e.getProxy(Be.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,n){const o=new Z;return Pti(i)?(o.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(sne(e),t,n.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},$H(e))):(o.add(this._editorProviders.addCustomProvider(t,e,i)),UK(i)&&o.add(i.onDidChangeCustomDocument(r=>{const a=this.getCustomDocumentEntry(t,r.document.uri);if(Fti(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(sne(e),t,n.webviewOptions||{},!!n.supportsMultipleEditorsPerDocument,$H(e))),Qs.from(o,new Qs(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,n,o){const r=this._editorProviders.get(t);if(!r)throw new Error(`No provider found for '${t}'`);if(r.type!==$x.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=N.revive(e),c=await r.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:n?.buffer},o);let l;return UK(r.provider)&&this._extensionStoragePaths&&(l=this._extensionStoragePaths.workspaceValue(r.extension)??this._extensionStoragePaths.globalValue(r.extension)),this._documents.add(t,c,l),{editable:UK(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!==$x.Custom)throw new Error(`Invalid provider type for '${t}'`);const n=N.revive(e),{document:o}=this.getCustomDocumentEntry(t,n);this._documents.delete(t,o),o.dispose()}async $resolveCustomEditor(e,t,i,n,o,r){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const c=El.to(o),l=this._extHostWebview.createNewWebview(t,n.contentOptions,a.extension),d=this._extHostWebviewPanels.createNewWebviewPanel(t,i,n.title,c,n.options,l,n.active),h=N.revive(e);switch(a.type){case $x.Custom:{const{document:u}=this.getCustomDocumentEntry(i,h);return a.provider.resolveCustomEditor(u,d,r)}case $x.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 n=this._editorProviders.get(i);if(!n)throw new Error(`No provider found for '${i}'`);if(!n.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=N.revive(t),a=this._extHostDocuments.getDocument(r);await n.provider.moveCustomTextEditor(a,o,He.None)}async $undo(e,t,i,n){return this.getCustomDocumentEntry(t,e).undo(i,n)}async $redo(e,t,i,n){return this.getCustomDocumentEntry(t,e).redo(i,n)}async $revert(e,t,i){const n=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(n.document,i),n.disposeBackup()}async $onSave(e,t,i){const n=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(n.document,i),n.disposeBackup()}async $onSaveAs(e,t,i,n){const o=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(o.document,N.revive(i),n)}async $backup(e,t,i){const n=this.getCustomDocumentEntry(t,e),r=await this.getCustomEditorProvider(t).backupCustomDocument(n.document,{destination:n.getNewBackupUri()},i);return n.updateBackup(r),r.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,N.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!UK(i))throw new Error("Custom document is not editable");return i}}function UK(s){return!!s.onDidChangeCustomDocument}function Pti(s){return typeof s.resolveCustomTextEditor=="function"}function Fti(s){return typeof s.undo=="function"&&typeof s.redo=="function"}function Oti(s){const e=s.scheme===pe.file||s.scheme===pe.untitled?s.fsPath:s.toString();return Wc(e)+""}var x0,eS,ax,Sd;const ZPe=class ZPe{constructor(e,t,i,n,o,r,a,c){Wt(this,eS);Wt(this,ax);Wt(this,Sd);this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=n,this._modelVersionIdProvider=o,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(n,i),Ct(this,Sd,new ui(l=>r.getComparisonKey(l))),Ct(this,eS,a),Ct(this,ax,c)}dispose(){this._isDisposed||(Ce(this,ax).fire([...Ce(this,Sd).keys()]),Ce(this,eS)?.$clear(this._owner),Ce(this,Sd).clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(N.isUri(e)){if(!t){this.delete(e);return}Ce(this,Sd).set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let r;e=[...e].sort(ZPe._compareIndexedTuplesByUri);for(const a of e){const[c,l]=a;if((!r||c.toString()!==r.toString())&&(r&&Ce(this,Sd).get(r).length===0&&Ce(this,Sd).delete(r),r=c,i.push(c),Ce(this,Sd).set(c,[])),l)Ce(this,Sd).get(c)?.push(...l);else{const d=Ce(this,Sd).get(c);d&&(d.length=0)}}}if(Ce(this,ax).fire(i),!Ce(this,eS))return;const n=[];let o=0;for(const r of i){let a=[];const c=Ce(this,Sd).get(r);if(c)if(c.length>this._maxDiagnosticsPerFile){a=[];const l=[Fd.Error,Fd.Warning,Fd.Information,Fd.Hint];e:for(let d=0;d<4;d++)for(const h of c)if(h.severity===l[d]&&a.push({...LH.from(h),modelVersionId:this._modelVersionIdProvider(r)})===this._maxDiagnosticsPerFile)break e;a.push({severity:Ws.Info,message:g(4582,"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=>({...LH.from(l),modelVersionId:this._modelVersionIdProvider(r)}));if(n.push([r,a]),o+=a.length,o>this._maxDiagnosticsTotal)break}Ce(this,eS).$changeMany(this._owner,n)}delete(e){this._checkDisposed(),Ce(this,ax).fire([e]),Ce(this,Sd).delete(e),Ce(this,eS)?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),Ce(this,ax).fire([...Ce(this,Sd).keys()]),Ce(this,Sd).clear(),Ce(this,eS)?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,n]of this)e.call(t,i,n,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of Ce(this,Sd).keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=Ce(this,Sd).get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(Ce(this,Sd).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}};eS=new WeakMap,ax=new WeakMap,Sd=new WeakMap;let one=ZPe;var ly;let kIe=(ly=class{static _mapper(e){const t=new ui;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,n){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=n,this._collections=new Map,this._onDidChangeDiagnostics=new wre({merge:o=>o.flat(),delay:50}),this.onDidChangeDiagnostics=M.map(this._onDidChangeDiagnostics.event,x0._mapper),this._proxy=e.getProxy(Be.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:n,_onDidChangeDiagnostics:o,_logService:r,_fileSystemInfoService:a,_extHostDocumentsAndEditors:c}=this,l=new class{$changeMany(u,f){n.$changeMany(u,f),r.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,u,f.length===0?"CLEARING":f)}$clear(u){n.$clear(u),r.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,u)}dispose(){n.dispose()}};let d;if(!t)t="_generated_diagnostic_collection_name_#"+x0._idPool++,d=t;else if(!i.has(t))d=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do d=t+x0._idPool++;while(i.has(d))}return new class extends one{constructor(){super(t,d,x0._maxDiagnosticsTotal,x0._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 n of this._collections.values())n.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 one(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,n=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(N.revive(t),i.map(LH.to))}},x0=ly,ly._idPool=0,ly._maxDiagnosticsPerFile=1e3,ly._maxDiagnosticsTotal=1.1*ly._maxDiagnosticsPerFile,ly);kIe=x0=D([_(1,Ge),_(2,$U)],kIe);class Bti{constructor(e){this._proxy=e.getProxy(Be.MainThreadDialogs)}showOpenDialog(e,t){return t?.allowUIResources&&Ve(e,"showLocal"),this._proxy.$showOpenDialog(t).then(i=>i?i.map(n=>N.revive(n)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?N.revive(t):void 0)}}const ore=class ore{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(Be.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(pe).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=ore._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let n;if(typeof t.onDidChange=="function"){let o;n=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=iv(c);if(!l.equalLines(d))return this._proxy.$onVirtualDocumentChange(r,c)}).catch(vt).finally(()=>{o===a&&(o=void 0)});o=a})}return new Qs(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),n&&(n.dispose(),n=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(N.revive(t),He.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};ore._handlePool=0;let IIe=ore;class Wti{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._callbacks=new dl,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,n)=>{const r={dispose:this._callbacks.push([t,i,e])};return Array.isArray(n)&&n.push(r),r}}async $participateInSave(e,t){const i=N.revive(e);let n=!1;const o=setTimeout(()=>n=!0,this._thresholds.timeout),r=[];try{for(const a of[...this._callbacks]){if(n)break;const c=this._documents.getDocument(i),l=await this._deliverEventAsyncAndBlameBadListeners(a,{document:c,reason:Gte.to(t)});r.push(l)}}finally{clearTimeout(o)}return r}_deliverEventAsyncAndBlameBadListeners([e,t,i],n){const o=this._badListeners.get(e);return typeof o=="number"&&o>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,n).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,n){const o=[],r=Date.now(),{document:a,reason:c}=n,{version:l}=a,d=Object.freeze({document:a,reason:c,waitUntil(h){if(Object.isFrozen(o))throw vre("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 HA))for(const{newText:p,newEol:m,range:v}of f)u.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&et.from(v),text:p,eol:m&&PH.from(m)}});if(u.edits.length!==0)return l===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new qd(u)):Promise.reject(new Error("concurrent_edits"))})}}class Hti{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(Be.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const n of i)this._onDidRemoveDocument.fire(n.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const n of i)this._onDidAddDocument.fire(n.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(n=>{this._documentLoader.delete(e.toString());const o=N.revive(n);return qn(this._documentsAndEditors.getDocument(o))},n=>(this._documentLoader.delete(e.toString()),Promise.reject(n))),this._documentLoader.set(e.toString(),i)),i}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>N.revive(t))}$acceptModelLanguageChanged(e,t){const i=N.revive(e),n=this._documentsAndEditors.getDocument(i);if(!n)throw new Error("unknown document");this._onDidRemoveDocument.fire(n.document),n._acceptLanguageId(t),this._onDidAddDocument.fire(n.document)}$acceptModelSaved(e){const t=N.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=N.revive(e),n=this._documentsAndEditors.getDocument(i);if(!n)throw new Error("unknown document");n._acceptIsDirty(t),this._onDidChangeDocument.fire({document:n.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const n=N.revive(e),o=this._documentsAndEditors.getDocument(n);if(!o)throw new Error("unknown document");o._acceptIsDirty(i),o.onEvents(t);let r;t.isUndoing?r=nH.Undo:t.isRedoing&&(r=nH.Redo),this._onDidChangeDocument.fire(v6e({document:o.document,contentChanges:t.changes.map(a=>({range:et.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:r}))}setWordDefinitionFor(e,t){Eei(e,t)}}class Uti{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(Be.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const n=this._handlePool++;return this._proxy.$registerEmbeddingProvider(n,t),this._provider.set(n,{id:t,provider:i}),Ee(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(n),this._provider.delete(n)})}async computeEmbeddings(e,t,i){i??=He.None;let n=!1;typeof t=="string"&&(t=[t],n=!0);const o=await this._proxy.$computeEmbeddings(e,t,i);if(o.length!==t.length)throw new Error;if(n){if(o.length!==1)throw new Error;return o[0]}return o}async $provideEmbeddings(e,t,i){const n=this._provider.get(e);if(!n)return[];const o=await n.provider.provideEmbeddings(t,i);return o||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class Vti{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(Be.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const n=this._AiEmbeddingVectorProviders.get(e);if(!n)throw new Error("Embedding vector provider not found");const o=await n.provideEmbeddingVector(t,i);if(!o)throw new Error("Embedding vector provider returned undefined");return o}registerEmbeddingVectorProvider(e,t,i){const n=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(n,i),this._proxy.$registerAiEmbeddingVectorProvider(t,n),new Qs(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(n),this._AiEmbeddingVectorProviders.delete(n)})}}class zti{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,n,o=Ri.LastKnownState,r=Ri.LastKnownState;for(const a of e){let c=i?Uy(i,a):0;for(c===0?n=Ri.Start:n=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 VT.Changed:p=To.UPDATED;break;case VT.Created:p=To.ADDED;break;case VT.Deleted:p=To.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:n,size:o,permissions:r}=e;return{type:t,ctime:i,mtime:n,size:o,permissions:r}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(N.revive(t))).then(i=>rne._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(N.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(N.revive(t))).then(i=>$e.wrap(i))}$writeFile(e,t,i,n){return Promise.resolve(this._getFsProvider(e).writeFile(N.revive(t),i.buffer,n))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(N.revive(t),i))}$rename(e,t,i,n){return Promise.resolve(this._getFsProvider(e).rename(N.revive(t),N.revive(i),n))}$copy(e,t,i,n){const o=this._getFsProvider(e);if(!o.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(o.copy(N.revive(t),N.revive(i),n))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(N.revive(t)))}$watch(e,t,i,n){const o=this._getFsProvider(e).watch(N.revive(i),n);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 n=this._getFsProvider(e);if(!n.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(n.open(N.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,n){const o=this._getFsProvider(e);if(!o.read)throw new Error('FileSystemProvider does not implement "read"');const r=$e.alloc(n);return Promise.resolve(o.read(t,i,r.buffer,0,n)).then(a=>r.slice(0,a))}$write(e,t,i,n){const o=this._getFsProvider(e);if(!o.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(o.write(t,i,n.buffer,0,n.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 $ti{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,n,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=K_(o),c=typeof o=="string",l=r?.correlate,d=n(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=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidCreate.fire(f)}if(!r?.ignoreChangeEvents)for(const u of h.changed){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidChange.fire(f)}if(!r?.ignoreDeleteEvents)for(const u of h.deleted){const f=N.revive(u);a(f.fsPath)&&(!c||t.getWorkspaceFolder(f))&&this._onDidDelete.fire(f)}}});this._disposable=Qs.from(this.ensureWatching(e,i,o,r,r?.correlate),this._onDidCreate,this._onDidChange,this._onDidDelete,d)}ensureWatching(e,t,i,n,o){const r=Qs.from();if(typeof i=="string"||n?.ignoreChangeEvents&&n?.ignoreCreateEvents&&n?.ignoreDeleteEvents)return r;const a=e.getProxy(Be.MainThreadFileSystemEventService);let c=!1;(i.pattern.includes(E1)||i.pattern.includes(kme))&&(c=!0);let l;return o&&(n?.ignoreChangeEvents||n?.ignoreCreateEvents||n?.ignoreDeleteEvents)&&(l=kE.UPDATED|kE.ADDED|kE.DELETED,n?.ignoreChangeEvents&&(l&=~kE.UPDATED),n?.ignoreCreateEvents&&(l&=~kE.ADDED),n?.ignoreDeleteEvents&&(l&=~kE.DELETED)),a.$watch(t.identifier.value,this.session,i.baseUri,{recursive:c,excludes:n?.excludes??[],filter:l},!!o),Qs.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 Gti{constructor(e){this._events=e,this.session=this._events.session,this._created=new ya(()=>this._events.created.map(N.revive)),this._changed=new ya(()=>this._events.changed.map(N.revive)),this._deleted=new ya(()=>this._events.deleted.map(N.revive))}get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}}class Kti{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 Kx,this._onWillCreateFile=new Kx,this._onWillDeleteFile=new Kx,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,n){return new $ti(this._mainContext,e,t,this._onFileSystemEvent.event,Vf.from(i),n)}$onFileEvent(e){this._onFileSystemEvent.fire(new Gti(e))}$onDidRunFileOperation(e,t){switch(e){case Ai.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:N.revive(i.source),newUri:N.revive(i.target)}))}));break;case Ai.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>N.revive(i.target))}));break;case Ai.CREATE:case Ai.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>N.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,n,o)=>{const r=function(c){i.call(n,c)};return r.extension=e,t.event(r,void 0,o)}}async $onWillRunFileOperation(e,t,i,n){switch(e){case Ai.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(o=>({oldUri:N.revive(o.source),newUri:N.revive(o.target)}))},i,n);case Ai.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(o=>N.revive(o.target))},i,n);case Ai.CREATE:case Ai.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(o=>N.revive(o.target))},i,n)}}async _fireWillEvent(e,t,i,n){const o=new Set,r=[];if(await e.fireAsync(t,n,async(c,l)=>{const d=Date.now(),h=await Promise.resolve(c);h instanceof rI&&(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)}),n.isCancellationRequested||r.length===0)return;const a={edits:[]};for(const[,c]of r){const{edits:l}=Qu.from(c,{getTextDocumentVersion:d=>this._extHostDocumentsAndEditors.getDocument(d)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(l)}return{edit:a,extensionNames:Array.from(o)}}}class qti{constructor(e,t,i,n,o){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=n;const r=new gn("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new ht("showOptions","Show Options",a=>!0,a=>a),new ht("resource","Interactive resource Uri",a=>!0,a=>a),new ht("controllerId","Notebook controller Id",a=>!0,a=>a),new ht("title","Interactive editor title",a=>!0,a=>a)],new nn("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:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri),notebookEditor:c.apiEditor}}return o.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:N.revive(a.notebookUri),inputUri:N.revive(a.inputUri)}}));this._commands.registerApiCommand(r)}$willAddInteractiveDocument(e,t,i,n){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class Qti{constructor(e){this._handlePool=0,this._proxy=e.getProxy(Be.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),Ee(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}class ane{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentSymbols(i,t);if(!aU(n))return n[0]instanceof XW?n.map(LEe.from):ane._asDocumentSymbolTree(n)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((n,o)=>{let r=n.location.range.start.compareTo(o.location.range.start);return r===0&&(r=o.location.range.end.compareTo(n.location.range.end)),r});const t=[],i=[];for(const n of e){const o={name:n.name||"!!MISSING: name!!",kind:Z_.from(n.kind),tags:n.tags?.map(UA.from)||[],detail:"",containerName:n.containerName,range:et.from(n.location.range),selectionRange:et.from(n.location.range),children:[]};for(;;){if(i.length===0){i.push(o),t.push(o);break}const r=i[i.length-1];if(F.containsRange(r.range,o.range)&&!F.equalsRange(r.range,o.range)){r.children?.push(o),i.push(o);break}i.pop()}}return t}}class VK{constructor(e,t,i,n,o,r){this._documents=e,this._commands=t,this._provider=i,this._extension=n,this._extTelemetry=o,this._logService=r,this._cache=new vm("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideCodeLenses(i,t);if(!n||t.isCancellationRequested)return;const o=this._cache.add(n),r=new Z;this._disposables.set(o,r);const a={cacheId:o,lenses:[]};for(let c=0;cOte.from(a))}}class R9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.provideDocumentHighlights(n,o,i);if(Array.isArray(r))return r.map(MH.from)}}class M9e{constructor(e,t){this._documents=e,this._provider=t}async provideMultiDocumentHighlights(e,t,i,n){const o=this._documents.getDocument(e),r=i.map(l=>this._documents.getDocument(l)),a=Yo.to(t),c=await this._provider.provideMultiDocumentHighlights(o,a,r,n);if(Array.isArray(c))return c.map(PEe.from)}}class N9e{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.provideLinkedEditingRanges(n,o,i);if(r&&Array.isArray(r.ranges))return{ranges:Fi(r.ranges.map(et.from)),wordPattern:r.wordPattern}}}class P9e{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=await this._provider.provideReferences(o,r,i,n);if(Array.isArray(a))return a.map(cf.from)}}const wO=class wO{constructor(e,t,i,n,o,r,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=n,this._logService=o,this._extension=r,this._apiDeprecation=a,this._cache=new vm("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,n){const o=this._documents.getDocument(e),r=dt.isISelection(t)?Fb.to(t):et.to(t),a=[];for(const f of this._diagnostics.getDiagnostics(e))if(r.intersection(f.range)&&a.push(f)>wO._maxCodeActionsPerFile)break;const c={diagnostics:a,only:i.only?new Sa(i.only):void 0,triggerKind:jEe.to(i.trigger)},l=await this._provider.provideCodeActions(o,r,c,n);if(!eo(l)||n.isCancellationRequested)return;const d=this._cache.add(l),h=new Z;this._disposables.set(d,h);const u=[];for(let f=0;fet.to(l)),a=P_.toDataTransfer(i,()=>{throw new vrt});if(await this._provider.prepareDocumentPaste(o,r,a,n),n.isCancellationRequested)return;const c=Array.from(a).filter(([,l])=>!(l instanceof qee));return P_.from(c)}async providePasteEdits(e,t,i,n,o,r){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),c=i.map(u=>et.to(u)),l=P_.toDataTransfer(n,async u=>(await this._proxy.$resolvePasteFileData(this._handle,e,u)).buffer),d=await this._provider.provideDocumentPasteEdits(a,c,l,{only:o.only?new z9(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(4583,"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?Qu.from(u.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,n]=e,o=this._cache.get(i,n);if(!o||!this._provider.resolveDocumentPasteEdit)return{};const r=await this._provider.resolveDocumentPasteEdit(o,t)??o;return{additionalEdit:r.additionalEdit?Qu.from(r.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._cache.delete(e)}}class F9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideDocumentFormattingEdits(n,t,i);if(Array.isArray(o))return o.map(nd.from)}}class Gue{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,n){const o=this._documents.getDocument(e),r=et.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(o,r,i,n);if(Array.isArray(a))return a.map(nd.from)}async provideDocumentRangesFormattingEdits(e,t,i,n){Tt(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const o=this._documents.getDocument(e),r=t.map(et.to),a=await this._provider.provideDocumentRangesFormattingEdits(o,r,i,n);if(Array.isArray(a))return a.map(nd.from)}}class O9e{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,n,o){const r=this._documents.getDocument(e),a=Yo.to(t),c=await this._provider.provideOnTypeFormattingEdits(r,a,i,n,o);if(Array.isArray(c))return c.map(nd.from)}}class zK{constructor(e,t){this._provider=e,this._logService=t,this._cache=new vm("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!eo(i))return{symbols:[]};const n=this._cache.add(i),o={cacheId:n,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(Xz._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}};Xz.languageTriggerKindToVSCodeTriggerKind={[uM.Invoke]:lH.Invoke,[uM.Automatic]:lH.Automatic};let xz=Xz;class Kue{constructor(e,t){this.resultId=e,this.tokens=t}}class kf{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const n=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(n,o.resultId,i):await this._provider.provideDocumentSemanticTokens(n,i);return o&&this._previousResults.delete(t),r?(r=kf._fixProvidedSemanticTokens(r),this._send(kf._convertToEdits(o,r),r)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return kf._isSemanticTokens(e)?kf._isCorrectSemanticTokens(e)?e:new nN(new Uint32Array(e.data),e.resultId):kf._isSemanticTokensEdits(e)?kf._isCorrectSemanticTokensEdits(e)?e:new iz(e.edits.map(t=>new MNe(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(!kf._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,n=i.length,o=t.data,r=o.length;let a=0;const c=Math.min(n,r);for(;a({start:n.start,deleteCount:n.deleteCount,data:n.data}))})}return null}}class B9e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideDocumentRangeSemanticTokens(n,et.to(t),i);return o?this._send(o):null}_send(e){return a9({id:0,type:"full",data:e.data})}}class n1{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,n,o){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=n,this._extension=o,this._cache=new vm("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=o.getWordRangeAtPosition(r)||new Jn(r,r),c=a.with({end:r}),l=new js,d=await this._provider.provideCompletionItems(o,r,n,OEe.to(i));if(!d||n.isCancellationRequested)return;const h=Array.isArray(d)?new JM(d):d,u=n1.supportsResolving(this._provider)?this._cache.add(h.items):this._cache.add([]),f=new Z;this._disposables.set(u,f);const p=[],m={x:u,[yy.completions]:p,[yy.defaultRanges]:{replace:et.from(a),insert:et.from(c)},[yy.isIncomplete]:h.isIncomplete||void 0,[yy.duration]:l.elapsed()};for(let v=0;v"u"?void 0:Ps.fromStrict(e.documentation),[Li.sortText]:e.sortText!==e.label?e.sortText:void 0,[Li.filterText]:e.filterText!==e.label?e.filterText:void 0,[Li.preselect]:e.preselect||void 0,[Li.insertTextRules]:e.keepWhitespace?qg.KeepWhitespace:qg.None,[Li.commitCharacters]:e.commitCharacters?.join(""),[Li.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(nd.from),[Li.commandIdent]:r?.$ident,[Li.commandId]:r?.id,[Li.commandArguments]:r?.$ident?void 0:r?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Li.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Li.insertText]=e.insertText:e.insertText instanceof aI&&(a[Li.insertText]=e.insertText.value,a[Li.insertTextRules]|=qg.InsertAsSnippet);let c;return e.textEdit?c=e.textEdit.range:e.range&&(c=e.range),Jn.isRange(c)?a[Li.range]=et.from(c):c&&(!i?.isEqual(c.inserting)||!n?.isEqual(c.replacing))&&(a[Li.range]={insert:et.from(c.inserting),replace:et.from(c.replacing)}),a}}class KP{async provideInlineCompletions(e,t,i,n){}async provideInlineEdits(e,t,i,n){}disposeCompletions(e){}handleDidShowCompletionItem(e,t,i){}handlePartialAccept(e,t,i,n){}}class jti extends KP{constructor(e,t,i,n){super(),this._extension=e,this._documents=t,this._provider=i,this._commands=n,this._references=new lot,this._isAdditionsProposedApiEnabled=ll(this._extension,"inlineCompletionsAdditions"),this.languageTriggerKindToVSCodeTriggerKind={[Jp.Automatic]:cH.Automatic,[Jp.Explicit]:cH.Invoke}}get supportsHandleEvents(){return ll(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function")}async provideInlineCompletions(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=await this._provider.provideInlineCompletionItems(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:et.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind]},n);if(!a||n.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?et.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}}async provideInlineEdits(e,t,i,n){if(!this._provider.provideInlineEdits)return;Ve(this._extension,"inlineCompletionsAdditions");const o=this._documents.getDocument(e),r=et.to(t),a=await this._provider.provideInlineEdits(o,r,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:et.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind],userPrompt:i.userPrompt},n);if(!a||n.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?et.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 n=this._references.get(e)?.items[t];n&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(n,i)}handlePartialAccept(e,t,i,n){const o=this._references.get(e)?.items[t];o&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(o,i),this._provider.handleDidPartiallyAcceptCompletionItem(o,txe.to(n)))}}class que{async provideInlineEdits(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideInlineEdit(n,{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:et.from(o.range),accepted:c,rejected:l}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,n){this._documents=t,this._provider=i,this._commands=n,this._references=new lot,this.languageTriggerKindToVSCodeTriggerKind={[D2.Automatic]:EH.Automatic,[D2.Invoke]:EH.Invoke}}}class lot{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 Que{constructor(e,t){this._documents=e,this._provider=t,this._cache=new vm("SignatureHelp")}async provideSignatureHelp(e,t,i,n){const o=this._documents.getDocument(e),r=Yo.to(t),a=this.reviveContext(i),c=await this._provider.provideSignatureHelp(o,r,n,a);if(c){const l=this._cache.add([c]);return{...v$.from(c),id:l}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=v$.to(e.activeSignatureHelp),n=this._cache.get(e.activeSignatureHelp.id,0);n?(t=n,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class $K{constructor(e,t,i,n,o){this._documents=e,this._commands=t,this._provider=i,this._logService=n,this._extension=o,this._cache=new vm("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const n=this._documents.getDocument(e),o=et.to(t),r=await this._provider.provideInlayHints(n,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 n={label:"",cacheId:t,tooltip:Ps.fromStrict(e.tooltip),position:Yo.from(e.position),textEdits:e.textEdits&&e.textEdits.map(nd.from),kind:e.kind&&zte.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")n.label=e.label;else{const o=[];n.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:Ps.fromStrict(r.tooltip)};vp.isLocation(r.location)&&(a.location=cf.from(r.location)),r.command&&(a.command=this._commands.toInternal(r.command,i)),o.push(a)}}return n}}class Gx{constructor(e,t){this._documents=e,this._provider=t,this._cache=new vm("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(n)||n.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:n.filter(Gx._validateLink).map(QT.from)};{const o=this._cache.add(n),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 n=await this._provider.resolveDocumentLink(i,t);if(!(!n||!Gx._validateLink(n)))return QT.from(n)}releaseLinks(e){this._cache.delete(e)}}class jue{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),n=await this._provider.provideDocumentColors(i,t);return Array.isArray(n)?n.map(r=>({color:NH.from(r.color),range:et.from(r.range)})):[]}async provideColorPresentations(e,t,i){const n=this._documents.getDocument(e),o=et.to(t.range),r=NH.to(t.color),a=await this._provider.provideColorPresentations(r,{document:n,range:o},i);if(Array.isArray(a))return a.map($te.from)}}class W9e{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const n=this._documents.getDocument(e),o=await this._provider.provideFoldingRanges(n,t,i);if(Array.isArray(o))return o.map(Kte.from)}}class H9e{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const n=this._documents.getDocument(e),o=t.map(Yo.to),r=await this._provider.provideSelectionRanges(n,o,i);if(!eo(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 n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyIncomingCalls(n,i);if(o)return o.map(r=>({from:this._cacheAndConvertItem(e,r.from),fromRanges:r.fromRanges.map(a=>et.from(a))}))}async provideCallsFrom(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing call hierarchy item");const o=await this._provider.provideCallHierarchyOutgoingCalls(n,i);if(o)return o.map(r=>({to:this._cacheAndConvertItem(e,r.to),fromRanges:r.fromRanges.map(a=>et.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),n=lN.from(t,e,i.size.toString(36));return i.set(n._itemId,t),n}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class L4{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new CU(""),this._cache=new Map}async prepareSession(e,t,i){const n=this._documents.getDocument(e),o=Yo.to(t),r=await this._provider.prepareTypeHierarchy(n,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 n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySupertypes(n,i);if(o)return o.map(r=>this._cacheAndConvertItem(e,r))}async provideSubtypes(e,t,i){const n=this._itemFromCache(e,t);if(!n)throw new Error("missing type hierarchy item");const o=await this._provider.provideTypeHierarchySubtypes(n,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),n=jT.from(t,e,i.size.toString(36));return i.set(n._itemId,t),n}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class GK{constructor(e,t,i,n,o){this._proxy=e,this._documents=t,this._provider=i,this._handle=n,this._extension=o,this._cache=new vm("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,n,o){const r=this._documents.getDocument(t),a=Yo.to(i),c=P_.toDataTransfer(n,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=O_(l),h=this._cache.add(d);return d.map((u,f)=>({_cacheId:[h,f],title:u.title??g(4584,"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?Qu.from(u.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,n]=e,o=this._cache.get(i,n);if(!o||!this._provider.resolveDocumentDropEdit)return{};const r=await this._provider.resolveDocumentDropEdit(o,t)??o;return{additionalEdit:r.additionalEdit?Qu.from(r.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class U9e{constructor(e,t){this._documents=e,this._provider=t}async provideMappedEdits(e,t,i,n){const o=N.revive(e),r=this._documents.getDocument(o),a=i.documents.map(d=>d.map(h=>({uri:N.revive(h.uri),version:h.version,ranges:h.ranges.map(u=>et.to(u))}))),c={documents:a,selections:a[0]?.[0]?.ranges??[]},l=await this._provider.provideMappedEdits(r,t,c,n);return l?Qu.from(l):null}}class R4{constructor(e,t){this.adapter=e,this.extension=t}}const jc=class jc{constructor(e,t,i,n,o,r,a,c){this._uriTransformer=t,this._documents=i,this._commands=n,this._diagnostics=o,this._logService=r,this._apiDeprecation=a,this._extensionTelemetry=c,this._adapter=new Map,this._proxy=e.getProxy(Be.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return TH.from(e,this._uriTransformer,t)}_createDisposable(e){return new Qs(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return jc._handlePool++}async _withAdapter(e,t,i,n,o,r=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return n;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=>{Fr(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`)}),He.isCancellationToken(o)?Ire(l,o):l}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new R4(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,n){const o=this._addNewAdapter(new ane(this._documents,i),e),r=n&&n.label||jc._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,ane,n=>n.provideDocumentSymbols(N.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const n=this._nextHandle(),o=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(n,new R4(new VK(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(n,this._transformDocumentSelector(t,e),o);let r=this._createDisposable(n);if(o!==void 0){const a=i.onDidChangeCodeLenses(c=>this._proxy.$emitCodeLensEvent(o));r=Qs.from(r,a)}return r}$provideCodeLenses(e,t,i){return this._withAdapter(e,VK,n=>n.provideCodeLenses(N.revive(t),i),void 0,i)}$resolveCodeLens(e,t,i){return this._withAdapter(e,VK,n=>n.resolveCodeLens(t,i),void 0,void 0)}$releaseCodeLenses(e,t){this._withAdapter(e,VK,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0)}registerDefinitionProvider(e,t,i){const n=this._addNewAdapter(new x9e(this._documents,i),e);return this._proxy.$registerDefinitionSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDefinition(e,t,i,n){return this._withAdapter(e,x9e,o=>o.provideDefinition(N.revive(t),i,n),[],n)}registerDeclarationProvider(e,t,i){const n=this._addNewAdapter(new D9e(this._documents,i),e);return this._proxy.$registerDeclarationSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDeclaration(e,t,i,n){return this._withAdapter(e,D9e,o=>o.provideDeclaration(N.revive(t),i,n),[],n)}registerImplementationProvider(e,t,i){const n=this._addNewAdapter(new k9e(this._documents,i),e);return this._proxy.$registerImplementationSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideImplementation(e,t,i,n){return this._withAdapter(e,k9e,o=>o.provideImplementation(N.revive(t),i,n),[],n)}registerTypeDefinitionProvider(e,t,i){const n=this._addNewAdapter(new I9e(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideTypeDefinition(e,t,i,n){return this._withAdapter(e,I9e,o=>o.provideTypeDefinition(N.revive(t),i,n),[],n)}registerHoverProvider(e,t,i,n){const o=this._addNewAdapter(new Ez(this._documents,i),e);return this._proxy.$registerHoverProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideHover(e,t,i,n,o){return this._withAdapter(e,Ez,r=>r.provideHover(N.revive(t),i,n,o),void 0,o)}$releaseHover(e,t){this._withAdapter(e,Ez,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,n){const o=this._addNewAdapter(new T9e(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(o,this._transformDocumentSelector(t,e)),this._createDisposable(o)}$provideEvaluatableExpression(e,t,i,n){return this._withAdapter(e,T9e,o=>o.provideEvaluatableExpression(N.revive(t),i,n),void 0,n)}registerInlineValuesProvider(e,t,i,n){const o=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new L9e(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=Qs.from(a,c)}return a}$provideInlineValues(e,t,i,n,o){return this._withAdapter(e,L9e,r=>r.provideInlineValues(N.revive(t),i,n,o),void 0,o)}registerDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new R9e(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}registerMultiDocumentHighlightProvider(e,t,i){const n=this._addNewAdapter(new M9e(this._documents,i),e);return this._proxy.$registerMultiDocumentHighlightProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentHighlights(e,t,i,n){return this._withAdapter(e,R9e,o=>o.provideDocumentHighlights(N.revive(t),i,n),void 0,n)}$provideMultiDocumentHighlights(e,t,i,n,o){return this._withAdapter(e,M9e,r=>r.provideMultiDocumentHighlights(N.revive(t),i,n.map(a=>N.revive(a)),o),void 0,o)}registerLinkedEditingRangeProvider(e,t,i){const n=this._addNewAdapter(new N9e(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideLinkedEditingRanges(e,t,i,n){return this._withAdapter(e,N9e,async o=>{const r=await o.provideLinkedEditingRanges(N.revive(t),i,n);if(r)return{ranges:r.ranges,wordPattern:r.wordPattern?jc._serializeRegExp(r.wordPattern):void 0}},void 0,n)}registerReferenceProvider(e,t,i){const n=this._addNewAdapter(new P9e(this._documents,i),e);return this._proxy.$registerReferenceSupport(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideReferences(e,t,i,n,o){return this._withAdapter(e,P9e,r=>r.provideReferences(N.revive(t),i,n,o),void 0,o)}registerCodeActionProvider(e,t,i,n){const o=new Z,r=this._addNewAdapter(new MF(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(r,this._transformDocumentSelector(t,e),{providedKinds:n?.providedCodeActionKinds?.map(a=>a.value),documentation:n?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,o)}))},jc._extLabel(e),jc._extId(e),!!i.resolveCodeAction),o.add(this._createDisposable(r)),o}$provideCodeActions(e,t,i,n,o){return this._withAdapter(e,MF,r=>r.provideCodeActions(N.revive(t),i,n,o),void 0,o)}$resolveCodeAction(e,t,i){return this._withAdapter(e,MF,n=>n.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,MF,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const n=this._addNewAdapter(new F9e(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(n,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(n)}$provideDocumentFormattingEdits(e,t,i,n){return this._withAdapter(e,F9e,o=>o.provideDocumentFormattingEdits(N.revive(t),i,n),void 0,n)}registerDocumentRangeFormattingEditProvider(e,t,i){const n=typeof i.provideDocumentRangesFormattingEdits=="function",o=this._addNewAdapter(new Gue(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(o,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,n),this._createDisposable(o)}$provideDocumentRangeFormattingEdits(e,t,i,n,o){return this._withAdapter(e,Gue,r=>r.provideDocumentRangeFormattingEdits(N.revive(t),i,n,o),void 0,o)}$provideDocumentRangesFormattingEdits(e,t,i,n,o){return this._withAdapter(e,Gue,r=>r.provideDocumentRangesFormattingEdits(N.revive(t),i,n,o),void 0,o)}registerOnTypeFormattingEditProvider(e,t,i,n){const o=this._addNewAdapter(new O9e(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(o,this._transformDocumentSelector(t,e),n,e.identifier),this._createDisposable(o)}$provideOnTypeFormattingEdits(e,t,i,n,o,r){return this._withAdapter(e,O9e,a=>a.provideOnTypeFormattingEdits(N.revive(t),i,n,o,r),void 0,r)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new zK(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,zK,n=>n.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,zK,n=>n.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,zK,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const n=this._addNewAdapter(new H1(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(n,this._transformDocumentSelector(t,e),H1.supportsResolving(i)),this._createDisposable(n)}$provideRenameEdits(e,t,i,n,o){return this._withAdapter(e,H1,r=>r.provideRenameEdits(N.revive(t),i,n,o),void 0,o)}$resolveRenameLocation(e,t,i,n){return this._withAdapter(e,H1,o=>o.resolveRenameLocation(N.revive(t),i,n),void 0,n)}registerNewSymbolNamesProvider(e,t,i){const n=this._addNewAdapter(new xz(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,xz,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,n,o){return this._withAdapter(e,xz,r=>r.provideNewSymbolNames(N.revive(t),i,n,o),void 0,o)}registerDocumentSemanticTokensProvider(e,t,i,n){const o=this._addNewAdapter(new kf(this._documents,i),e),r=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(o,this._transformDocumentSelector(t,e),n,r);let a=this._createDisposable(o);if(r){const c=i.onDidChangeSemanticTokens(l=>this._proxy.$emitDocumentSemanticTokensEvent(r));a=Qs.from(a,c)}return a}$provideDocumentSemanticTokens(e,t,i,n){return this._withAdapter(e,kf,o=>o.provideDocumentSemanticTokens(N.revive(t),i,n),null,n)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,kf,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,n){const o=this._addNewAdapter(new B9e(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(o,this._transformDocumentSelector(t,e),n),this._createDisposable(o)}$provideDocumentRangeSemanticTokens(e,t,i,n){return this._withAdapter(e,B9e,o=>o.provideDocumentRangeSemanticTokens(N.revive(t),i,n),null,n)}registerCompletionItemProvider(e,t,i,n){const o=this._addNewAdapter(new n1(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(o,this._transformDocumentSelector(t,e),n,n1.supportsResolving(i),e.identifier),this._createDisposable(o)}$provideCompletionItems(e,t,i,n,o){return this._withAdapter(e,n1,r=>r.provideCompletionItems(N.revive(t),i,n,o),void 0,o)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,n1,n=>n.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,n1,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,n){const o=new jti(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(o,e);return this._proxy.$registerInlineCompletionsSupport(r,this._transformDocumentSelector(t,e),o.supportsHandleEvents,Sn.toKey(e.identifier.value),n?.yieldTo?.map(a=>Sn.toKey(a))||[]),this._createDisposable(r)}$provideInlineCompletions(e,t,i,n,o){return this._withAdapter(e,KP,r=>r.provideInlineCompletions(N.revive(t),i,n,o),void 0,o)}$provideInlineEdits(e,t,i,n,o){return this._withAdapter(e,KP,r=>r.provideInlineEdits(N.revive(t),i,n,o),void 0,o)}$handleInlineCompletionDidShow(e,t,i,n){this._withAdapter(e,KP,async o=>{o.handleDidShowCompletionItem(t,i,n)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,n,o){this._withAdapter(e,KP,async r=>{r.handlePartialAccept(t,i,n,o)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,KP,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const n=new que(e,this._documents,i,this._commands.converter),o=this._addNewAdapter(n,e);return this._proxy.$registerInlineEditProvider(o,this._transformDocumentSelector(t,e),e.identifier),this._createDisposable(o)}$provideInlineEdit(e,t,i,n){return this._withAdapter(e,que,o=>o.provideInlineEdits(N.revive(t),i,n),void 0,n)}$freeInlineEdit(e,t){this._withAdapter(e,que,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,n){const o=Array.isArray(n)?{triggerCharacters:n,retriggerCharacters:[]}:n,r=this._addNewAdapter(new Que(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideSignatureHelp(e,t,i,n,o){return this._withAdapter(e,Que,r=>r.provideSignatureHelp(N.revive(t),i,n,o),void 0,o)}$releaseSignatureHelp(e,t){this._withAdapter(e,Que,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const n=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new $K(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(o,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",n,jc._extLabel(e));let r=this._createDisposable(o);if(n!==void 0){const a=i.onDidChangeInlayHints(c=>this._proxy.$emitInlayHintsEvent(n));r=Qs.from(r,a)}return r}$provideInlayHints(e,t,i,n){return this._withAdapter(e,$K,o=>o.provideInlayHints(N.revive(t),i,n),void 0,n)}$resolveInlayHint(e,t,i){return this._withAdapter(e,$K,n=>n.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,$K,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const n=this._addNewAdapter(new Gx(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(n,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(n)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,Gx,n=>n.provideLinks(N.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,Gx,n=>n.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,Gx,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const n=this._addNewAdapter(new jue(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideDocumentColors(e,t,i){return this._withAdapter(e,jue,n=>n.provideColors(N.revive(t),i),[],i)}$provideColorPresentations(e,t,i,n){return this._withAdapter(e,jue,o=>o.provideColorPresentations(N.revive(t),i,n),void 0,n)}registerFoldingRangeProvider(e,t,i){const n=this._nextHandle(),o=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(n,new R4(new W9e(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(n,this._transformDocumentSelector(t,e),e.identifier,o);let r=this._createDisposable(n);if(o!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(o));r=Qs.from(r,a)}return r}$provideFoldingRanges(e,t,i,n){return this._withAdapter(e,W9e,o=>o.provideFoldingRanges(N.revive(t),i,n),void 0,n)}registerSelectionRangeProvider(e,t,i){const n=this._addNewAdapter(new H9e(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$provideSelectionRanges(e,t,i,n){return this._withAdapter(e,H9e,o=>o.provideSelectionRanges(N.revive(t),i,n),[],n)}registerCallHierarchyProvider(e,t,i){const n=this._addNewAdapter(new T4(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$prepareCallHierarchy(e,t,i,n){return this._withAdapter(e,T4,o=>Promise.resolve(o.prepareSession(N.revive(t),i,n)),void 0,n)}$provideCallHierarchyIncomingCalls(e,t,i,n){return this._withAdapter(e,T4,o=>o.provideCallsTo(t,i,n),void 0,n)}$provideCallHierarchyOutgoingCalls(e,t,i,n){return this._withAdapter(e,T4,o=>o.provideCallsFrom(t,i,n),void 0,n)}$releaseCallHierarchy(e,t){this._withAdapter(e,T4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const n=this._addNewAdapter(new L4(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(n,this._transformDocumentSelector(t,e)),this._createDisposable(n)}$prepareTypeHierarchy(e,t,i,n){return this._withAdapter(e,L4,o=>Promise.resolve(o.prepareSession(N.revive(t),i,n)),void 0,n)}$provideTypeHierarchySupertypes(e,t,i,n){return this._withAdapter(e,L4,o=>o.provideSupertypes(t,i,n),void 0,n)}$provideTypeHierarchySubtypes(e,t,i,n){return this._withAdapter(e,L4,o=>o.provideSubtypes(t,i,n),void 0,n)}$releaseTypeHierarchy(e,t){this._withAdapter(e,L4,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,n){const o=this._nextHandle();return this._adapter.set(o,new R4(new GK(this._proxy,this._documents,i,o,e),e)),this._proxy.$registerDocumentOnDropEditProvider(o,this._transformDocumentSelector(t,e),ll(e,"documentPaste")&&n?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:n.dropMimeTypes}:void 0),this._createDisposable(o)}$provideDocumentOnDropEdits(e,t,i,n,o,r){return this._withAdapter(e,GK,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,N.revive(i),n,o,r)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,GK,n=>n.resolveDropEdit(t,i),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,GK,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerMappedEditsProvider(e,t,i){const n=this._addNewAdapter(new U9e(this._documents,i),e);return this._proxy.$registerMappedEditsProvider(n,this._transformDocumentSelector(t,e),e.displayName??e.name),this._createDisposable(n)}$provideMappedEdits(e,t,i,n,o){return this._withAdapter(e,U9e,r=>Promise.resolve(r.provideMappedEdits(t,i,n,o)),null,o)}registerDocumentPasteEditProvider(e,t,i,n){const o=this._nextHandle();return this._adapter.set(o,new R4(new I4(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:n.providedPasteEditKinds?.map(r=>r.value),copyMimeTypes:n.copyMimeTypes,pasteMimeTypes:n.pasteMimeTypes}),this._createDisposable(o)}$prepareDocumentPaste(e,t,i,n,o){return this._withAdapter(e,I4,r=>r.prepareDocumentPaste(N.revive(t),i,n,o),void 0,o)}$providePasteEdits(e,t,i,n,o,r,a){return this._withAdapter(e,I4,c=>c.providePasteEdits(t,N.revive(i),n,o,r,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,I4,n=>n.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,I4,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:jc._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:jc._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?jc._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?jc._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:jc._serializeRegExp(e.beforeText),afterText:e.afterText?jc._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?jc._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(jc._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>ZM.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(jc._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:n}=i;if(n&&W1e(n))throw new Error(`Invalid language configuration: wordPattern '${n}' is not allowed to match the empty string.`);n?this._documents.setWordDefinitionFor(t,n):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?jc._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?jc._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?jc._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?jc._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))}};jc._handlePool=0;let TIe=jc;class Yti{constructor(e){this._registeredTools=new Map,this._allTools=new Map,this._proxy=e.getProxy(Be.MainThreadLanguageModelTools),this._proxy.$getTools().then(t=>{for(const i of t)this._allTools.set(i.name,Mo(i))})}async invokeTool(e,t,i){return await this._proxy.$invokeTool(e,t,i)}async $acceptToolDelta(e){e.added&&this._allTools.set(e.added.name,e.added),e.removed&&this._allTools.delete(e.removed)}get tools(){return Array.from(this._allTools.values()).map(e=>sxe.to(e))}async $invokeTool(e,t,i){const n=this._registeredTools.get(e);if(!n)throw new Error(`Unknown tool ${e}`);return await n.tool.invoke(t,i)}registerTool(e,t,i){return this._registeredTools.set(t,{extension:e,tool:i}),this._proxy.$registerTool(t),Ee(()=>{this._registeredTools.delete(t),this._proxy.$unregisterTool(t)})}}class Jti{constructor(e,t,i,n){this._documents=t,this._commands=i,this._uriTransformer=n,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(Be.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,n=Yo.from(t),o=await this._proxy.$tokensAtPosition(e.uri,n),r={type:TS.Other,range:e.getWordRangeAtPosition(t)??new Jn(t.line,t.character,t.line,t.character)};if(!o)return r;const a={range:et.to(o.range),type:kEe.to(o.type)};return!a.range.contains(t)||i!==e.version?r:a}createLanguageStatusItem(e,t,i){const n=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:OT.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=Ky(()=>{d.clear(),this._proxy.$setLanguageStatus(n,{id:a,name:c.name??e.displayName??e.name,source:e.displayName??e.name,selector:TH.from(c.selector,this._uriTransformer),label:c.text,detail:c.detail??"",severity:c.severity===OT.Error?Xe.Error:c.severity===OT.Warning?Xe.Warning:Xe.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(n),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){Ve(e,"languageStatusText"),c.text=f,h()},get text2(){return Ve(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 Xti(s){return s&&s.title}let LIe=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(Be.MainThreadMessageService)}showMessage(e,t,i,n,o){const r={source:{identifier:e.identifier,label:e.displayName||e.name}};let a;typeof n=="string"||Xti(n)?a=[n,...o]:(r.modal=n?.modal,r.useCustom=n?.useCustom,r.detail=n?.detail,a=o),r.useCustom&&Ve(e,"resolvers");const c=[];let l=!1;for(let d=0;d{if(typeof d=="number")return a[d]})}};LIe=D([_(1,Ge)],LIe);class Yue{constructor(e,t,i,n){this.start=e,this.deletedCount=t,this.deletedItems=i,this.items=n}asApiEvent(){return{range:new wy(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}}class RIe{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=N.revive(i.uri),this.cellKind=i.cellKind,this._outputs=i.outputs.map(dI.to),this._internalMetadata=i.internalMetadata??{},this._metadata=Object.freeze(i.metadata??{}),this._previousResult=Object.freeze(FH.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:b$.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(n){e._mime=n},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(dI.to)}setOutputItems(e,t,i){const n=i.map(OH.to),o=this._outputs.find(r=>r.id===e);if(o&&(t||(o.items.length=0),o.items.push(...n),o.items.length>1&&o.items.every(r=>Vit(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=A9t(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(FH.to(e))}setMime(e){}}const are=class are{constructor(e,t,i,n,o){this._proxy=e,this._textDocumentsAndEditors=t,this._textDocuments=i,this.uri=n,this.handle=are._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===pe.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()},[Symbol.for("debug.description")](){return`NotebookDocument(${this.uri.toString()})`}};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 n={notebook:this.apiNotebook,metadata:i,cellChanges:[],contentChanges:[]},o=[];for(const a of e.rawEvents)a.kind===Cl.ModelChange?this._spliceNotebookCells(a.changes,!1,n.contentChanges):a.kind===Cl.Move?this._moveCells(a.index,a.length,a.newIdx,n.contentChanges):a.kind===Cl.Output?(this._setCellOutputs(a.index,a.outputs),o.push({cell:this._cells[a.index].apiCell,outputs:this._cells[a.index].apiCell.outputs})):a.kind===Cl.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===Cl.ChangeCellLanguage?(this._changeCellLanguage(a.index,a.language),o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document})):a.kind===Cl.ChangeCellContent?o.push({cell:this._cells[a.index].apiCell,document:this._cells[a.index].apiCell.document}):a.kind===Cl.ChangeCellMime?this._changeCellMime(a.index,a.mime):a.kind===Cl.ChangeCellMetadata?(this._changeCellMetadata(a.index,a.metadata),o.push({cell:this._cells[a.index].apiCell,metadata:this._cells[a.index].apiCell.metadata})):a.kind===Cl.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 RIe(this,this._textDocumentsAndEditors,u);return t||o.push(RIe.asModelAddData(u)),f}),d=new Yue(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);n.push(d)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:o,removedDocuments:r}),i)for(const a of n)i.push(a.asApiEvent())}_moveCells(e,t,i,n){const o=this._cells.splice(e,t);this._cells.splice(i,0,...o);const r=[new Yue(e,t,o.map(a=>a.apiCell),[]),new Yue(i,0,[],o)];for(const a of r)n.push(a.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,i,n){this._cells[e].setOutputItems(t,i,n)}_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)}};are._handlePool=0;let MIe=are;const cre=class cre{constructor(e,t,i,n,o,r){this.id=e,this._proxy=t,this.notebookData=i,this._selections=[],this._visibleRanges=[],this._visible=!1,this._selections=o,this._visibleRanges=n,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(wy.isNotebookRange))throw Pi("selections");e._selections=t,e._trySetSelections(t)},get visibleRanges(){return e._visibleRanges},revealRange(t,i){e._proxy.$tryRevealRange(e.id,Fy.from(t),i??t$.Default)},get viewColumn(){return e._viewColumn},[Symbol.for("debug.description")](){return`NotebookEditor(${this.notebook.uri.toString()})`}},cre.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(Fy.from))}_acceptViewColumn(e){this._viewColumn=e}};cre.apiEditorsToExtHost=new WeakMap;let Z$=cre;class Zti extends V{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 F(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 e3;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:n}=t.create(wb.LF);this._inputTextBuffer=i,this._register(n)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new e3;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:n,disposable:o}=i.create(wb.LF);return this._register(o),n})),this._outputTextBuffers}findInInputs(e){const i=new $C(e,!1,!1,null).parseSearchRequest();if(!i)return[];const n=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(n,i,!0,5e3)}findInOutputs(e){const i=new $C(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(n=>{const o=n.findMatchesLineByLine(this._getFullModelRange(n),i,!0,5e3);if(o.length!==0)return{textBuffer:n,matches:o}}).filter(n=>!!n):[]}}function V9e(s,e){let t=-1;const i=[];let n=[];return s.forEach(r=>{r.range.startLineNumber!==t&&n.length>0&&(i.push([...n]),n=[]),n.push(r),t=r.range.endLineNumber}),n.length>0&&i.push([...n]),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 Z8t(a.join(` `)+` -`,r.map(d=>new F(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const y1=class y1{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,n,o,r,a){this._textDocumentsAndEditors=i,this._textDocuments=n,this._extHostFileSystem=o,this._extHostSearch=r,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new ui,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 ym("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(Be.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(Be.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(Be.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===ws.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===ws.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),y1._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(n=>Jte.from(n)).filter(n=>n!==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,priority:t.exclusive?f$.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(e,t,i){const n=y1._notebookStatusBarItemProviderHandlePool++,o=typeof i.onDidChangeCellStatusBarItems=="function"?y1._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(n,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(n,o,t);let r;return o!==void 0&&(r=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(o))),new Qs(()=>{this._notebookStatusBarItemProviders.delete(n),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(n,o),r?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&OE.from(e.content)});return N.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),n=this._documents.get(N.revive(i));return qn(n?.apiNotebook)}async showNotebookDocument(e,t){N.isUri(e)&&(e=await this.openNotebookDocument(e));let i;typeof t=="object"?i={position:xl.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(Wy.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const n=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),o=n&&this._editors.get(n)?.apiEditor;if(o)return o;throw n?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,n){const o=this._notebookStatusBarItemProviders.get(e),r=N.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,n);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>JEe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,n,o){if(Gu(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:n}),this._notebookProxy.$registerNotebookSerializer(r,{id:e.identifier,location:e.extensionLocation},t,ZEe.from(n),y1._convertNotebookRegistrationData(e,o)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(r)})}async $dataToNotebook(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const o=await n.serializer.deserializeNotebook(t.buffer,i);return new jd(OE.from(o))}async $notebookToData(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const o=await n.serializer.serializeNotebook(OE.to(t.value),i);return $e.wrap(o)}async $saveNotebook(e,t,i,n,o){const r=N.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 Td(g(4585,"Unable to modify read-only file '{0}'",this._resourceForError(r)),Qi.FILE_PERMISSION_DENIED);const l={metadata:wj(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new rG(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=wj(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(r,n),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&sn.File)!==0,isDirectory:(u.type&sn.Directory)!==0,isSymbolicLink:(u.type&sn.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&lp.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(r.scheme),locked:!!((u.permissions??0)&lp.Locked),etag:$Y({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${r.toString()})`),f}async $searchInNotebooks(e,t,i,n,o){const r=this._notebookSerializer.get(e)?.serializer;if(!r)return{limitHit:!1,results:[]};const a=new Dk;await(async(u,f,p)=>{await Promise.all(u.map(async m=>await Promise.all(m.filenamePatterns.map(v=>{const b={_reason:p._reason,folderQueries:p.folderQueries,includePattern:p.includePattern,excludePattern:p.excludePattern,maxResults:p.maxResults,type:cI.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(b,f,w=>{w.forEach(y=>{a.has(y)||n.some(A=>m.isFromSettings&&!A.isFromSettings?!1:A.filenamePatterns.some(L=>Uqt(L,y)))||a.add(y)})}).catch(w=>{if(w.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw w})}))))})(i,o,t);const l=new ui;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(o.isCancellationRequested)return;if(t.maxResults&&[...l.values()].reduce((b,w)=>b+w.cellResults.length,0)>t.maxResults){d=!0;return}const p=[],m=this._documents.get(u);if(m)m.apiNotebook.getCells().forEach(w=>p.push({input:w.document.getText(),outputs:w.outputs.flatMap(y=>y.items.map(C=>C.data.toString()))}));else{const b=await this._extHostFileSystem.value.readFile(u),w=$e.fromString(b.toString()),y=await r.deserializeNotebook(w.buffer,o);if(o.isCancellationRequested)return;OE.from(y).cells.forEach(A=>p.push({input:A.source,outputs:A.outputs.flatMap(L=>L.items.map(k=>k.valueBytes.toString()))}))}if(o.isCancellationRequested)return;p.forEach((b,w)=>{const y=t.contentPattern.pattern,C=new dii(b.input,void 0,b.outputs),A=C.findInInputs(y),L=C.findInOutputs(y),k=L.flatMap(P=>e$e(P.matches,P.textBuffer)).map((P,R)=>(P.webviewIndex=R,P));if(A.length>0||L.length>0){const P={index:w,contentResults:e$e(A,C.inputTextBuffer),webviewResults:k};f.push(P)}});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!==S_&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimeo.document.uri)}),this._onDidCloseNotebookDocument.fire(n.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 n=N.revive(i.uri);if(this._documents.has(n))throw new Error(`adding EXISTING notebook ${n} `);const o=new WIe(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,n,i);t.push(...i.cells.map(r=>BIe.asModelAddData(r))),this._documents.get(n)?.dispose(),this._documents.set(n,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=N.revive(t.documentUri),n=this._documents.get(i);n&&this._createExtHostEditor(n,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 n=t.has(i.id);i._acceptVisibility(n)}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=ht.String.with("notebookType","A notebook type"),i=new gn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new ht("data","Bytes to convert to data",o=>o instanceof Uint8Array,o=>$e.wrap(o))],new nn("Notebook Data",o=>OE.to(o.value))),n=new gn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new ht("NotebookData","Notebook data to convert to bytes",o=>!0,o=>new jd(OE.from(o)))],new nn("Bytes",o=>o.buffer));e.registerApiCommand(i),e.registerApiCommand(n)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};y1._notebookStatusBarItemProviderHandlePool=0;let HIe=y1;class hii{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._onWillSaveNotebookDocumentEvent=new jx}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,n)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillSaveNotebookDocumentEvent.event(o,void 0,n)}}async $participateInSave(e,t,i){const n=N.revive(e),o=this._notebooksAndEditors.getNotebookDocument(n);if(!o)throw new Error("Unable to resolve notebook document");const r=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:o.apiNotebook,reason:qte.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 hI?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}=Yu.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jd(a))}}class uii{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,n){const r=this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptModelChanged(t.value,i,n);this._onDidChangeNotebookDocument.fire(r)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(N.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let UIe=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(Wy.to)),t.selections&&i._acceptSelections(t.selections.selections.map(Wy.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(xl.to(e[t]))}};UIe=D([_(0,Ge)],UIe);const gii=100;let VIe=class{constructor(e,t,i,n,o){this._initData=t,this._extHostNotebook=i,this._commands=n,this._logService=o,this._activeExecutions=new ui,this._activeNotebookExecutions=new ui,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(Be.MainThreadNotebookKernels);const r=new gn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new ht("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})],nn.Void),a=new gn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[ht.Uri],new nn("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,n,o,r){for(const A of this._kernelData.values())if(A.controller.id===t&&Sn.equals(e.identifier,A.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:jK(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:n||e.identifier.value,preloads:r?r.map(Xte.from):[]};let p=o??l,m,v;this._proxy.$addKernel(a,f).catch(A=>{console.log(A),d=!0});let b=0;const w=()=>{if(d)return;const A=++b;Promise.resolve().then(()=>{A===b&&this._proxy.$updateKernel(a,f)})},y=new ui,C={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:h.event,get label(){return f.label},set label(A){f.label=A??e.displayName??e.name,w()},get detail(){return f.detail??""},set detail(A){f.detail=A,w()},get description(){return f.description??""},set description(A){f.description=A,w()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(A){f.supportedLanguages=A,w()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(A){f.supportsExecutionOrder=A,w()},get rendererScripts(){return f.preloads?f.preloads.map(Xte.to):[]},get executeHandler(){return p},set executeHandler(A){p=A??l},get interruptHandler(){return m},set interruptHandler(A){m=A,f.supportsInterrupt=!!A,w()},set variableProvider(A){Ve(e,"notebookVariableProvider"),v=A,f.hasVariableProvider=!!A,A?.onDidChangeVariables(L=>c._proxy.$variablesUpdated(L.uri)),w()},get variableProvider(){return v},createNotebookCellExecution(A){if(d)throw new Error("notebook controller is DISPOSED");if(!y.has(A.notebook.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(y.keys()).map(L=>L.toString())),new Error(`notebook controller is NOT associated to notebook: ${A.notebook.uri.toString()}`);return c._createNotebookCellExecution(A,jK(e.identifier,this.id))},createNotebookExecution(A){if(Ve(e,"notebookExecution"),d)throw new Error("notebook controller is DISPOSED");if(!y.has(A.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(y.keys()).map(L=>L.toString())),new Error(`notebook controller is NOT associated to notebook: ${A.uri.toString()}`);return c._createNotebookExecution(A,jK(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(A,L){L===o$.Hidden&&Ve(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,A.uri,L)},onDidReceiveMessage:u.event,postMessage(A,L){return Ve(e,"notebookMessaging"),c._proxy.$postMessage(a,L&&c._extHostNotebook.getIdByEditor(L),A)},asWebviewUri(A){return Ve(e,"notebookMessaging"),Dz(A,c._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:C,onDidReceiveMessage:u,onDidChangeSelection:h,associatedNotebooks:y}),C}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return jK(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,n=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const o={dispose:()=>{this._kernelDetectionTask.delete(i),n._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,o),o}registerKernelSourceActionProvider(e,t,i){const n=this._kernelSourceActionProviderHandlePool++,o=typeof i.onDidChangeNotebookKernelSourceActions=="function"?n:void 0,r=this;this._kernelSourceActionProviders.set(n,i),this._logService.trace(`NotebookKernelSourceActionProvider[${n}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(n,n,t);let a;return o!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(o))),{dispose:()=>{this._kernelSourceActionProviders.delete(n),r._proxy.$removeKernelSourceActionProvider(n,n),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const n=new Z;return(await i.provideNotebookKernelSourceActions(t)??[]).map(r=>XEe.from(r,this._commands.converter,n))}return[]}$acceptNotebookAssociation(e,t,i){const n=this._kernelData.get(e);if(n){const o=this._extHostNotebook.getNotebookDocument(N.revive(t));i?n.associatedNotebooks.set(o.uri,!0):n.associatedNotebooks.delete(o.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,o.uri.toString(),i),n.onDidChangeSelection.fire({selected:i,notebook:o.apiNotebook})}}async $executeCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getNotebookDocument(N.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 n.controller.executeHandler.call(n.controller,r,o.apiNotebook,n.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getNotebookDocument(N.revive(t));if(n.controller.interruptHandler)await n.controller.interruptHandler.call(n.controller,o.apiNotebook);else for(const r of i){const a=o.getCell(r);a&&this._activeExecutions.get(a.uri)?.cancel()}if(n.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,n,o,r,a){const c=this._kernelData.get(e);if(!c)return;const l=this._extHostNotebook.getNotebookDocument(N.revive(i)),d=c.controller.variableProvider;if(!d)return;let h;if(n!==void 0){if(h=this.variableStore[n],!h)return}else this.variableStore={};const u=o==="named"?wH.Named:wH.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++>=gii)return}}$acceptKernelMessageFromRenderer(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getEditorById(t);n.onDidReceiveMessage.fire(Object.freeze({editor:o.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const o=this._extHostNotebook.getNotebookDocument(N.revive(e)).getCell(t);if(o){const r=i?YEe.to(i):cN.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 n=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!n)throw new Error("invalid cell");if(this._activeExecutions.has(n.uri))throw new Error(`duplicate execution for ${n.uri}`);const o=new zIe(t,n,this._proxy);this._activeExecutions.set(n.uri,o);const r=o.onDidChangeState(()=>{o.state===Wv.Resolved&&(o.dispose(),r.dispose(),this._activeExecutions.delete(n.uri))});return o.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),n=e.getCells().find(a=>{const c=i.getCellFromApiCell(a);return c&&this._activeExecutions.has(c.uri)});if(n)throw new Error(`duplicate cell execution for ${n.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const o=new $Ie(t,i,this._proxy),r=o.onDidChangeState(()=>{o.state===JC.Resolved&&(o.dispose(),r.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[o,r]),o.asApiObject()}};VIe=D([_(4,Ge)],VIe);var Wv;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(Wv||(Wv={}));const gre=class gre extends V{get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=gre.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=Wv.Init,this._tokenSource=this._register(new ci),this._collector=new fii(10,n=>this.update(n)),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 jd(t))}verifyStateForOutput(){if(this._state===Wv.Init)throw new Error("Must call start before modifying cell output");if(this._state===Wv.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=i$.ensureUniqueMimeTypes(t.items,!0);return i===t.items?pI.from(t):pI.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const n=this.cellIndexToHandle(t),o=this.validateAndConvertOutputs(H_(e));return this.updateSoon({editType:$x.Output,cellHandle:n,append:i,outputs:o})}async updateOutputItems(e,t,i){return e=i$.ensureUniqueMimeTypes(H_(e),!0),this.updateSoon({editType:$x.OutputItems,items:e.map(UH.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:$x.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===Wv.Resolved||e._state===Wv.Started)throw new Error("Cannot call start again");e._state=Wv.Started,e._onDidChangeState.fire(),e.update({editType:$x.ExecutionState,runStartTime:i})},end(i,n,o){if(e._state===Wv.Resolved)throw new Error("Cannot call resolve twice");e._state=Wv.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 jd({runEndTime:n,lastRunSuccess:i,error:r}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,n){return e.verifyStateForOutput(),e.updateOutputs(i,n,!0)},replaceOutput(i,n){return e.verifyStateForOutput(),e.updateOutputs(i,n,!1)},appendOutputItems(i,n){return e.verifyStateForOutput(),e.updateOutputItems(i,n,!0)},replaceOutputItems(i,n){return e.verifyStateForOutput(),e.updateOutputItems(i,n,!1)}})}};gre.HANDLE=0;let zIe=gre;var JC;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(JC||(JC={}));const fre=class fre extends V{get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=fre.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=JC.Init,this._tokenSource=this._register(new ci),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===JC.Resolved||this._state===JC.Started)throw new Error("Cannot call start again");this._state=JC.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===JC.Resolved)throw new Error("Cannot call resolve twice");this._state=JC.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};fre.HANDLE=0;let $Ie=fre;class fii{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 dc,this.startedTimer=Date.now(),Sr(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 jK(s,e){return`${s.value}/${e}`}class pii{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(Be.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const n=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:n.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(n=>n.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(n,o,r)=>this.getOrCreateEmitterFor(t).event(n,o,r),postMessage:(n,o)=>{i7.apiEditorsToExtHost.has(n)&&([n,o]=[o,n]);const r=o&&i7.apiEditorsToExtHost.get(o);return this.proxy.$postMessage(r?.id,t,n)}}}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 mii{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(Be.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(Ve(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,n){const o=this.handlers.get(e);if(!o)throw new Error(`Unknown handler with id: ${e}`);return o.saveProfile(t,i,n)}async $readProfile(e,t,i){const n=this.handlers.get(e);if(!n)throw new Error(`Unknown handler with id: ${e}`);return n.readProfile(Lt(t)?t:N.revive(t),i)}}class _ii{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const n=this._handles++,{title:o,location:r,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(n,{location:QEe.from(r),title:o,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(No),this._withProgress(n,i,!!a)}_withProgress(e,t,i){let n;i&&(n=new ci,this._mapHandleToCancellationSource.set(e,n));const o=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),n?.dispose()};let r;try{r=t(new GIe(this._proxy,e),i&&n?n.token:He.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 vii(s,e){return s.message=e.message,typeof e.increment=="number"&&(typeof s.increment=="number"?s.increment+=e.increment:s.increment=e.increment),s}class GIe extends lu{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}GIe.__decorator=D([bAt(100,(s,e)=>vii(s,e),()=>Object.create(null))],GIe.prototype,"throttledReport",null);const pre=class pre{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Be.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const n=N.revive(t),o=this.providers.get(e);return o?jh(()=>o.provideOriginalResource(n,i)).then(r=>r||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,n){const o=pre.handlePool++;return this.providers.set(o,t),this.proxy.$registerQuickDiffProvider(o,NH.from(e,this.uriTransformer),i,n),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(o),this.providers.delete(o)}}}};pre.handlePool=0;let KIe=pre;function bii(s,e,t){const i=s.getProxy(Be.MainThreadQuickOpen);class n{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,b=He.None){this._onDidSelectItem=void 0;const w=Promise.resolve(m),y=++this._instances,C=i.$show(y,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},b),A={},L=C.then(()=>A);return Promise.race([L,w]).then(k=>{if(k===A)return;const P=dl(p,"quickPickItemTooltip");return w.then(R=>{const z=[];for(let G=0;G{v.onDidSelectItem(R[G])}),i.$setItems(y,z),C.then(G=>{if(typeof G=="number")return R[G];if(Array.isArray(G))return G.map(Y=>R[Y])})})}).then(void 0,k=>{if(!Fr(k))return i.$setError(y,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=He.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Fr(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 qT.Info:v=Xe.Info;break;case qT.Warning:v=Xe.Warning;break;case qT.Error:v=Xe.Error;break;default:v=m.message?Xe.Error:Xe.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=He.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[p]);if(!v)return;const b=await this._workspace.getWorkspaceFolders2();if(b)return b.find(w=>w.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 b=this._sessions.get(p);b instanceof d&&b._fireDidTriggerItemButton(m,v)}$onDidHide(p){this._sessions.get(p)?._fireDidHide()}}const u=class u{constructor(p,m){this._extension=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){const m=dl(this._extension,"quickInputButtonLocation");!m&&p.some(v=>v.location)&&console.warn(`Extension '${this._extension.identifier.value}' uses a button location which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`),this._buttons=p.slice(),this._handlesToButtons.clear(),p.forEach((v,b)=>{const w=v===vH.Back?-1:b;this._handlesToButtons.set(w,v)}),this.update({buttons:p.map((v,b)=>({...l(v.iconPath),tooltip:v.tooltip,handle:v===vH.Back?-1:b,location:m?v.location:void 0}))})}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=bt(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 uu)return{id:f.id};const p=c(f),m=a(f);return{dark:typeof p=="string"?N.file(p):p,light:typeof m=="string"?N.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=We.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends o{constructor(p,m){super(p,m),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((b,w)=>{this._handlesToItems.set(w,b),this._itemsToHandles.set(b,w)});const m=dl(this._extension,"quickPickItemTooltip"),v=[];for(let b=0;b({...l(C.iconPath),tooltip:C.tooltip,handle:A}))})}}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=Fi(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Fi(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 b=v.buttons[m];b&&this._onDidTriggerItemButtonEmitter.fire({button:b,item:v})}}class h extends o{constructor(p,m){super(p,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:Xe.Error}):this.update({validationMessage:p.message,severity:p.severity??Xe.Error}):this.update({validationMessage:void 0,severity:Xe.Ignore})}}return new n(e,t)}var qIe;function t$e(s){return s instanceof N}function wii(s,e){return s.scheme===pe.file&&e.scheme===pe.file&&pr?s.toString()===e.toString():s.toString().toLowerCase()===e.toString().toLowerCase()}function sge(s){if(s)return typeof s.iconPath=="string"?N.file(s.iconPath):N.isUri(s.iconPath)||We.isThemeIcon(s.iconPath)?s.iconPath:void 0}function i$e(s){if(s){if(N.isUri(s))return s;if(We.isThemeIcon(s))return s;{const e=s;return{light:e.light,dark:e.dark}}}else return}function oge(s){const e=i$e(s.icon),t=s.labels?.map(i=>({title:i.title,icon:i$e(i.icon)}));return{...s,icon:e,labels:t}}function rge(s,e){if(!s.iconPath&&!e.iconPath)return 0;if(s.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof s.iconPath=="string"?s.iconPath:N.isUri(s.iconPath)?s.iconPath.fsPath:s.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:N.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return Kq(t,i)}function yii(s,e){let t=0;if(s.strikeThrough!==e.strikeThrough)return s.strikeThrough?1:-1;if(s.faded!==e.faded)return s.faded?1:-1;if(s.tooltip!==e.tooltip)return(s.tooltip||"").localeCompare(e.tooltip||"");if(t=rge(s,e),t!==0)return t;if(s.light&&e.light)t=rge(s.light,e.light);else{if(s.light)return 1;if(e.light)return-1}if(t!==0)return t;if(s.dark&&e.dark)t=rge(s.dark,e.dark);else{if(s.dark)return 1;if(e.dark)return-1}return t}function Cii(s,e){if(s.command!==e.command)return s.commandthis._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(n$e),i=F1e(this._resourceSnapshot,e,n$e).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 P=new Z;h=this._commands.converter.toInternal(c.command,P),this._resourceStatesDisposablesMap.set(l,P)}else this._resourceStatesCommandsMap.set(l,c.command);const u=dl(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=sge(c.decorations),v=c.decorations&&sge(c.decorations.light)||m,b=c.decorations&&sge(c.decorations.dark)||m,w=[v,b],y=c.decorations&&c.decorations.tooltip||"",C=c.decorations&&!!c.decorations.strikeThrough,A=c.decorations&&!!c.decorations.faded,L=c.contextValue||"";return{rawResource:[l,d,w,y,C,A,L,h,f,p],handle:l}});return{start:r.start,deleteCount:r.deleteCount,toInsert:a}}),n=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,n}dispose(){this._disposed=!0,this._onDidDispose.fire()}};mre._handlePool=0;let QIe=mre;var xd;const _re=class _re{constructor(e,t,i,n,o,r,a){Wt(this,xd);this._extension=e,this._commands=n,this._id=o,this._label=r,this._rootUri=a,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new wn,this._commitTemplate=void 0,this._acceptInputDisposables=new wn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new wn,this._statusBarDisposables=new wn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=_re._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,Ct(this,xd,i);const c=N.from({scheme:pe.vscodeSourceControl,path:`${o}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new xii(e,t,Ce(this,xd),this.handle,c),Ce(this,xd).$registerSourceControl(this.handle,o,r,a,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,Ce(this,xd).$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;dl(this._extension,"quickDiffProvider")&&(t=e?.label),Ce(this,xd).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get historyProvider(){return Ve(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){Ve(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,Ce(this,xd).$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,Ce(this,xd).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,Ce(this,xd).$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);Ce(this,xd).$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return Ve(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){Ve(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(n=>this._commands.converter.toInternal(n,this._actionButtonDisposables.value))),description:e.description,enabled:e.enabled}:void 0;Ce(this,xd).$updateSourceControl(this.handle,{actionButton:t??null})}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&Eii(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));Ce(this,xd).$updateSourceControl(this.handle,{statusBarCommands:t})}get selected(){return this._selected}createResourceGroup(e,t,i){const n=dl(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,o=new QIe(Ce(this,xd),this._commands,this.handle,e,t,n,this._extension),r=M.once(o.onDidDispose)(()=>this.createdResourceGroups.delete(o));return this.createdResourceGroups.set(o,r),this.eventuallyAddResourceGroups(),o}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,n]of this.createdResourceGroups){n.dispose();const o=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});M.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),o.dispose(),this._groups.delete(i.handle),Ce(this,xd).$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)}Ce(this,xd).$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&&Ce(this,xd).$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()),Ce(this,xd).$unregisterSourceControl(this.handle)}};xd=new WeakMap,_re._handlePool=0;let _N=_re;_N.__decorator=D([ULe(100)],_N.prototype,"eventuallyAddResourceGroups",null);_N.__decorator=D([ULe(100)],_N.prototype,"eventuallyUpdateResourceStates",null);var dM;let jIe=(dM=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,n){this._commands=t,this._extHostDocuments=i,this.logService=n,this._sourceControls=new Map,this._sourceControlsByExtension=new va,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(Be.MainThreadSCM),this._telemetry=e.getProxy(Be.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:o=>{if(o&&o.$mid===ws.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===ws.ScmResourceGroup){const r=this._sourceControls.get(o.sourceControlHandle);return r?r.getResourceGroup(o.groupHandle):o}else if(o&&o.$mid===ws.ScmProvider){const r=this._sourceControls.get(o.handle);return r||o}return o}})}createSourceControl(e,t,i,n){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,n),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const o=qIe._handlePool++,r=new _N(e,this._extHostDocuments,this._proxy,this._commands,t,i,n);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 n=N.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,n.toString());const o=this._sourceControls.get(e);return!o||!o.quickDiffProvider||!o.quickDiffProvider.provideOriginalResource?Promise.resolve(null):jh(()=>o.quickDiffProvider.provideOriginalResource(n,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,n){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,n):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const n=this._sourceControls.get(e);return!n||!n.inputBox.validateInput?Promise.resolve(void 0):jh(()=>n.inputBox.validateInput(t,i)).then(o=>{if(!o)return Promise.resolve(void 0);const r=Ps.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,n){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor(t,i,n)??void 0}async $resolveHistoryItemGroupCommonAncestor2(e,t,i){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor2(t,i)??void 0}async $provideHistoryItems(e,t,i,n){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i,n))?.map(a=>oge(a))??void 0}async $provideHistoryItems2(e,t,i){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems2(t,i))?.map(r=>oge(r))??void 0}async $provideHistoryItemSummary(e,t,i,n){const o=this._sourceControls.get(e)?.historyProvider;if(typeof o?.provideHistoryItemSummary!="function")return;const r=await o.provideHistoryItemSummary(t,i,n);return r?oge(r):void 0}async $provideHistoryItemChanges(e,t,i,n){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,n)??void 0}},qIe=dM,dM._handlePool=0,dM);jIe=qIe=D([_(3,Ge)],jIe);const vre=class vre{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Be.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:et.to(t.selection),resourceUri:N.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=vre.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,NH.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};vre.handlePool=0;let YIe=vre;const bre=class bre{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(Be.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const n=this.providers.get(e);if(!n)return;const o=new Z,r=new ci;this.sessions.set(t,r);const a=await n.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 n=this.providers.get(e);if(!n)return;const o=new Z,r=new ci;this.sessions.set(t,r);const a=await n.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 n=new Z,o=new ci;this.sessions.set(t,o);const r=await i.provideKeywordRecognitionSession(o.token);r&&(n.add(r.onDidChange(a=>{o.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),n.add(o.token.onCancellationRequested(()=>n.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const n=bre.ID_POOL++;return this.providers.set(n,i),this.proxy.$registerProvider(n,t,{extension:e,displayName:e.value}),Ee(()=>{this.proxy.$unregisterProvider(n),this.providers.delete(n)})}};bre.ID_POOL=1;let JIe=bre;var e2,t2;const C1=class C1{constructor(e,t,i,n,o,r=TS.Left,a){Wt(this,e2);Wt(this,t2);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,Ct(this,e2,e),Ct(this,t2,t),o&&n){this._entryId=$9t(n.identifier,o);const c=i.get(this._entryId);c&&(r=c.alignLeft?TS.Left:TS.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(C1.ID_GEN++);this._extension=n,this._id=o,this._alignment=r,this._priority=this.validatePriority(a)}validatePriority(e){if(lc(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&&!C1.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:Ce(this,t2).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:Ce(this,t2).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,Ce(this,e2).$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(4587,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=C1.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const n=Ps.fromStrict(this._tooltip);Ce(this,e2).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,n,this._command?.internal,i,this._backgroundColor,this._alignment===TS.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};e2=new WeakMap,t2=new WeakMap,C1.ID_GEN=0,C1.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new dH("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new dH("statusBarItem.warningForeground")]]);let XIe=C1;class Dii{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",TS.Left,Number.MIN_VALUE),this._item.name=g(4588,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new Qs(()=>{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 kii{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(Be.MainThreadStatusBar),this._commands=t,this._statusMessage=new Dii(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,n){return new XIe(this._proxy,this._commands,this._existingItems,e,t,i,n)}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let n;return typeof t=="number"?n=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new Qs(()=>{i.dispose(),clearTimeout(n)})}}class Iii extends V{constructor(e,t){super(),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(Be.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i))),this._register(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 n;typeof t=="number"?n={position:xl.from(t),preserveFocus:i}:typeof t=="object"?n={position:xl.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?et.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:n={preserveFocus:!1};const o=await this._proxy.$tryShowTextDocument(e.uri,n),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 Yke(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 n=t.selections.selections.map(Wb.to);i._acceptSelections(n)}if(t.visibleRanges){const n=Fi(t.visibleRanges.map(et.to));i._acceptVisibleRanges(n)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:aB.to(t.options.lineNumbers)}}),t.selections){const n=iN.fromValue(t.selections.source),o=t.selections.selections.map(Wb.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:o,kind:n})}if(t.visibleRanges){const n=Fi(t.visibleRanges.map(et.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:n})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const n=xl.to(e[t]);i.value.viewColumn!==n&&(i._acceptViewColumn(n),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:n}))}}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let ZIe=class{constructor(e){this._actual=new ote(mS.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=mS.Light;break;case"hcDark":t=mS.HighContrast;break;case"hcLight":t=mS.HighContrastLight;break;default:t=mS.Dark}this._actual=new ote(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};ZIe=D([_(0,Jo)],ZIe);class Tii{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(Be.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,n)=>{if(i&&i.$mid===ws.TimelineActionContext)if(this._providers.get(i.source)&&Sn.equals(n,this._providers.get(i.source)?.extension)){const o=i.uri===void 0?void 0:N.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(s$e(o))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,n){return this._providers.get(e)?.provider.provideTimeline(N.revive(t),i,n)}registerTimelineProvider(e,t,i,n){const o=new Z,r=this.convertTimelineItem(t.id,n,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(n,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=s$e(n);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 uu?f={id:c.id,color:c.color}:N.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return df.isMarkdownString(l.tooltip)?p=Ps.from(l.tooltip):Lt(l.tooltip)?p=l.tooltip:df.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Ps.from(l.detail)):Lt(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 n of this._itemsBySourceAndUriMap.values())n.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function s$e(s){return s?.toString()}function o$e(s,e){if(Lt(s))return{label:s};if(s&&typeof s=="object"&&typeof s.label=="string"){let t;return Array.isArray(s.highlights)&&(t=s.highlights.filter(i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"),t=t.length?t:void 0),{label:s.label,highlights:t}}}class Lii extends V{constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new WRe;function n(o){return o&&o.$treeViewId&&(o.$treeItemHandle||o.$selectedTreeItems||o.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:o=>n(o)?this.convertArgument(o):Array.isArray(o)&&o.length>0?o.map(r=>n(r)?this.convertArgument(r):r):o})}registerTreeDataProvider(e,t,i){const n=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>n.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const n=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:n,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 Ve(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return Ve(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){dd(u)&&Ve(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&&QAe.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 tw(e))}async $handleDrop(e,t,i,n,o,r,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new tw(e));const d=B_.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,n,o)}async addAdditionalTransferItems(e,t,i,n,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,n);this.treeDragAndDropService.addDragOperationTransfer(o,a),await a}return e}async $handleDrag(e,t,i,n){const o=this.treeViews.get(e);if(!o)return Promise.reject(new tw(e));const r=await this.addAdditionalTransferItems(new lH,o,t,n,i);if(!(!r||n.isCancellationRequested))return B_.from(r)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new tw(e);return t.hasResolve}$resolve(e,t,i){const n=this.treeViews.get(e);if(!n)throw new tw(e);return n.resolveTreeItem(t,i)}$setExpanded(e,t,i){const n=this.treeViews.get(e);if(!n)throw new tw(e);n.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const n=this.treeViews.get(e);if(!n)throw new tw(e);n.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new tw(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new tw(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const n=this._register(new e0e(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,n),n}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 EO=class EO extends V{get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!ra(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,n,o,r){if(super(),this.viewId=e,this.proxy=i,this.commands=n,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 ci,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=M.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,Ps.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(n=>n.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=ra(t.select)?!0:t.select,n=ra(t.focus)?!1:t.focus,o=ra(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:n,expand:o})),r=>this.logService.error(r)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:n,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=eie.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=!is(this._selectedHandles,e);this._selectedHandles=e;const n=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),n&&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 n=this.getExtensionElement(i.treeItemHandle);return n?{extensionItem:n,treeItem:await this.dataProvider.getTreeItem(n),newState:i.newState?db.Checked:db.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?db.Checked:db.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const n=[];for(const o of e){const r=this.getExtensionElement(o);r&&n.push(r)}if(!(!this.dndController?.handleDrag||n.length===0))return await this.dndController.handleDrag(n,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const n=t?this.getExtensionElement(t):void 0;if(!(!n&&t||!this.dndController?.handleDrop))return jh(()=>this.dndController?.handleDrop?this.dndController.handleDrop(n,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 n=this.nodes.get(i);if(n){const o=await this.dataProvider.resolveTreeItem(n.extensionItem,i,t)??n.extensionItem;return this.validateTreeItem(o),n.item.tooltip=this.getTooltip(o.tooltip),n.item.command=this.getCommand(n.disposableStore,o.command),n.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(n=>(i.push(n),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):jh(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):jh(()=>this.dataProvider.getTreeItem(e)).then(n=>this.createHandle(e,n,t,!0)).then(n=>this.getChildren(t?t.item.handle:void 0).then(()=>{const o=this.getExtensionElement(n);if(o){const r=this.nodes.get(o);if(r)return Promise.resolve(r)}throw new Error(`Cannot resolve tree item for element ${n} 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 ci(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,n=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const o=Fi(n||[]),r=await Promise.all(Fi(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 Fi(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new ci,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 n=[];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))&&n.push(o)}}),n}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(n=>{n&&(t[i]=n.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),jh(()=>this.dataProvider.getTreeItem(t)).then(n=>{if(n){const o=this.createTreeNode(t,n,i.parent);return this.updateNodeCache(t,o,i,i.parent),i.dispose(),o}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const n=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(n.item.handle))throw new Error(g(4589,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,n),this.addNodeToParentCache(n,i),n}getTooltip(e){return df.isMarkdownString(e)?Ps.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,n;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,n=e.checkboxState.accessibilityInformation),{isChecked:t===db.Checked,tooltip:i,accessibilityInformation:n}}validateTreeItem(e){if(!$9.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 n=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:o$e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(n,t.command),contextValue:t.contextValue,icon:r,iconDark:this.getDarkIconPath(t)||r,themeIcon:this.getThemeIcon(t),collapsibleState:ra(t.collapsibleState)?vD.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:n,dispose(){n.dispose()}}}getThemeIcon(e){return e.iconPath instanceof uu?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:n},o,r){if(t)return`${EO.ID_HANDLE_PREFIX}/${t}`;const a=o$e(i),c=o?o.item.handle:EO.LABEL_HANDLE_PREFIX;let l=a?a.label:n?_i(n):"";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 uu))return typeof e.iconPath=="string"||N.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof uu)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return N.isUri(e)?e:N.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,n){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(n)||[],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 n=this.elements.get(i.item.handle);n&&this.clear(n)}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 n=this.elements.get(i.item.handle);n&&this.clear(n)}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)}};EO.LABEL_HANDLE_PREFIX="0",EO.ID_HANDLE_PREFIX="1";let e0e=EO;const wre=class wre{constructor(e){this._openers=new Map,this._proxy=e.getProxy(Be.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,n){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const o=n.schemes.find(r=>!wre.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,n.schemes,e,n.label),Ee(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const n=this._openers.get(e);if(!n)throw new Error(`Unknown opener with id: ${e}`);const o=N.revive(t);return n.canOpenExternalUri(o,i)}async $openUri(e,t,i){const n=this._openers.get(e);if(!n)throw new Error(`Unknown opener id: '${e}'`);return n.openExternalUri(N.revive(t.resolvedUri),{sourceUri:N.revive(t.sourceUri)},i)}};wre.supportedSchemes=new Set([pe.http,pe.https]);let t0e=wre;const yre=class yre{constructor(e){this.handles=new A_,this.handlers=new Map,this._proxy=e.getProxy(Be.MainThreadUrls)}registerUriHandler(e,t){const i=e.identifier;if(this.handles.has(i))throw new Error(`Protocol handler already registered for extension ${i}`);const n=yre.HandlePool++;return this.handles.add(i),this.handlers.set(n,t),this._proxy.$registerUriHandler(n,i,e.displayName||e.name),Ee(()=>{this.handles.delete(i),this.handlers.delete(n),this._proxy.$unregisterUriHandler(n)})}$handleExternalUri(e,t){const i=this.handlers.get(e);if(!i)return Promise.resolve(void 0);try{i.handleUri(N.revive(t))}catch(n){vt(n)}return Promise.resolve(void 0)}async createAppUri(e){return N.revive(await this._proxy.$createAppUri(e))}};yre.HandlePool=0;let i0e=yre;var hx,ux,E7,i2,x7,sT,n2,iS,s2,o2,gx,r2,a2;class Rii extends V{constructor(t,i,n,o){super();Wt(this,hx);Wt(this,ux);Wt(this,E7);Wt(this,i2);Wt(this,x7);Wt(this,sT);Wt(this,n2);Wt(this,iS);Wt(this,s2);Wt(this,o2);Wt(this,gx);Wt(this,r2);Wt(this,a2);Ct(this,iS,void 0),Ct(this,s2,!0),Ct(this,gx,!1),Ct(this,r2,this._register(new I)),this.onDidDispose=Ce(this,r2).event,Ct(this,a2,this._register(new I)),this.onDidChangeViewState=Ce(this,a2).event,Ct(this,hx,t),Ct(this,ux,i),Ct(this,i2,n),Ct(this,E7,o.viewType),Ct(this,x7,o.panelOptions),Ct(this,iS,o.viewColumn),Ct(this,sT,o.title),Ct(this,o2,o.active)}dispose(){Ce(this,gx)||(Ct(this,gx,!0),Ce(this,r2).fire(),Ce(this,ux).$disposeWebview(Ce(this,hx)),Ce(this,i2).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),Ce(this,i2)}get viewType(){return this.assertNotDisposed(),Ce(this,E7)}get title(){return this.assertNotDisposed(),Ce(this,sT)}set title(t){this.assertNotDisposed(),Ce(this,sT)!==t&&(Ct(this,sT,t),Ce(this,ux).$setTitle(Ce(this,hx),t))}get iconPath(){return this.assertNotDisposed(),Ce(this,n2)}set iconPath(t){this.assertNotDisposed(),Ce(this,n2)!==t&&(Ct(this,n2,t),Ce(this,ux).$setIconPath(Ce(this,hx),N.isUri(t)?{light:t,dark:t}:t))}get options(){return Ce(this,x7)}get viewColumn(){if(this.assertNotDisposed(),!(typeof Ce(this,iS)=="number"&&Ce(this,iS)<0))return Ce(this,iS)}get active(){return this.assertNotDisposed(),Ce(this,o2)}get visible(){return this.assertNotDisposed(),Ce(this,s2)}_updateViewState(t){Ce(this,gx)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(Ct(this,o2,t.active),Ct(this,s2,t.visible),Ct(this,iS,t.viewColumn),Ce(this,a2).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),Ce(this,ux).$reveal(Ce(this,hx),{viewColumn:typeof t>"u"?void 0:xl.from(t),preserveFocus:!!i})}assertNotDisposed(){if(Ce(this,gx))throw new Error("Webview is disposed")}}hx=new WeakMap,ux=new WeakMap,E7=new WeakMap,i2=new WeakMap,x7=new WeakMap,sT=new WeakMap,n2=new WeakMap,iS=new WeakMap,s2=new WeakMap,o2=new WeakMap,gx=new WeakMap,r2=new WeakMap,a2=new WeakMap;class UPe extends V{static newHandle(){return ar()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(Be.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,n,o={}){const r=typeof n=="object"?n.viewColumn:n,a={viewColumn:xl.from(r),preserveFocus:typeof n=="object"&&!!n.preserveFocus},c=QH(e),l=UPe.newHandle();this._proxy.$createWebviewPanel(rne(e),l,t,{title:i,panelOptions:Mii(o),webviewOptions:mot(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,n)=>{const o=e[i],r=e[n];return o.active?1:r.active?-1:+o.visible-+r.visible});for(const i of t){const n=this.getWebviewPanel(i);if(!n)continue;const o=e[i];n._updateViewState({active:o.active,visible:o.visible,viewColumn:xl.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:QH(e)}),new Qs(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,n){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,n,i.panelOptions,c,i.active);await r.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,n,o,r,a){const c=new Rii(e,this._proxy,r,{viewType:t,title:i,viewColumn:n,panelOptions:o,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function Mii(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}var fx,px,D7,c2,mx,oT,rT,l2,aT,d2,h2;class Nii extends V{constructor(t,i,n,o,r,a){super();Wt(this,fx);Wt(this,px);Wt(this,D7);Wt(this,c2);Wt(this,mx);Wt(this,oT);Wt(this,rT);Wt(this,l2);Wt(this,aT);Wt(this,d2);Wt(this,h2);Ct(this,mx,!1),Ct(this,d2,this._register(new I)),this.onDidChangeVisibility=Ce(this,d2).event,Ct(this,h2,this._register(new I)),this.onDidDispose=Ce(this,h2).event,Ct(this,D7,n),Ct(this,rT,o),Ct(this,fx,t),Ct(this,px,i),Ct(this,c2,r),Ct(this,oT,a)}dispose(){Ce(this,mx)||(Ct(this,mx,!0),Ce(this,h2).fire(),Ce(this,c2).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),Ce(this,rT)}set title(t){this.assertNotDisposed(),Ce(this,rT)!==t&&(Ct(this,rT,t),Ce(this,px).$setWebviewViewTitle(Ce(this,fx),t))}get description(){return this.assertNotDisposed(),Ce(this,l2)}set description(t){this.assertNotDisposed(),Ce(this,l2)!==t&&(Ct(this,l2,t),Ce(this,px).$setWebviewViewDescription(Ce(this,fx),t))}get visible(){return Ce(this,oT)}get webview(){return Ce(this,c2)}get viewType(){return Ce(this,D7)}_setVisible(t){t===Ce(this,oT)||Ce(this,mx)||(Ct(this,oT,t),Ce(this,d2).fire())}get badge(){return this.assertNotDisposed(),Ce(this,aT)}set badge(t){this.assertNotDisposed(),!(t?.value===Ce(this,aT)?.value&&t?.tooltip===Ce(this,aT)?.tooltip)&&(Ct(this,aT,eie.from(t)),Ce(this,px).$setWebviewViewBadge(Ce(this,fx),t))}show(t){this.assertNotDisposed(),Ce(this,px).$show(Ce(this,fx),!!t)}assertNotDisposed(){if(Ce(this,mx))throw new Error("Webview is disposed")}}fx=new WeakMap,px=new WeakMap,D7=new WeakMap,c2=new WeakMap,mx=new WeakMap,oT=new WeakMap,rT=new WeakMap,l2=new WeakMap,aT=new WeakMap,d2=new WeakMap,h2=new WeakMap;class Pii{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(Be.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,n){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(rne(e),t,{retainContextWhenHidden:n?.retainContextWhenHidden,serializeBuffersForPostMessage:QH(e)}),new Qs(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,n,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 Nii(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:n},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 Fii(s){const e=s.get(_u),t=s.get(jU),i=s.get(nle),n=s.get(MI),o=s.get(oE),r=s.get(ole),a=s.get(rE),c=s.get(sle),l=s.get(Jo),d=s.get(LPe),h=s.get(RPe),u=s.get(uf),f=s.get(Ge),p=s.get(bPe),m=s.get(rle),v=s.get(got),b=s.get(PPe),w=s.get(fG),y=s.get(OPe),C=s.get(MPe),A=s.get(NPe);l.set(Ye.ExtHostFileSystemInfo,t),l.set(Ye.ExtHostLogLevelServiceShape,u),l.set(Ye.ExtHostWorkspace,o),l.set(Ye.ExtHostConfiguration,a),l.set(Ye.ExtHostExtensionService,n),l.set(Ye.ExtHostStorage,d),l.set(Ye.ExtHostTunnelService,p),l.set(Ye.ExtHostWindow,v),l.set(Ye.ExtHostSecretState,b),l.set(Ye.ExtHostTelemetry,r),l.set(Ye.ExtHostEditorTabs,w),l.set(Ye.ExtHostManagedSockets,y),l.set(Ye.ExtHostAuthentication,C),l.set(Ye.ExtHostChatProvider,A);const L=l.set(Ye.ExtHostDecorations,s.get(Zst)),k=l.set(Ye.ExtHostDocumentsAndEditors,s.get(YU)),P=l.set(Ye.ExtHostCommands,s.get(YN)),R=l.set(Ye.ExtHostTerminalService,s.get(JU)),z=l.set(Ye.ExtHostTerminalShellIntegration,s.get(fot)),G=l.set(Ye.ExtHostDebugService,s.get(hot)),Y=l.set(Ye.ExtHostSearch,s.get(uot)),j=l.set(Ye.ExtHostTask,s.get(not)),ne=l.set(Ye.ExtHostOutputService,s.get(Jst)),ge=l.set(Ye.ExtHostLocalization,s.get(FPe)),De=l.set(Ye.ExtHostUrls,new i0e(l)),Oe=l.set(Ye.ExtHostDocuments,new Jti(l,k)),yt=l.set(Ye.ExtHostDocumentContentProviders,new PIe(l,k,f)),Ne=l.set(Ye.ExtHostDocumentSaveParticipant,new Yti(f,Oe,l.getProxy(Be.MainThreadBulkEdits))),lt=l.set(Ye.ExtHostNotebook,new HIe(l,P,k,Oe,i,Y,f)),xt=l.set(Ye.ExtHostNotebookDocuments,new uii(lt)),Ji=l.set(Ye.ExtHostNotebookEditors,new UIe(f,lt)),Ii=l.set(Ye.ExtHostNotebookKernels,new VIe(l,e,lt,P,f)),ns=l.set(Ye.ExtHostNotebookRenderers,new pii(l,lt)),zs=l.set(Ye.ExtHostNotebookDocumentSaveParticipant,new hii(f,lt,l.getProxy(Be.MainThreadBulkEdits))),Pn=l.set(Ye.ExtHostEditors,new Iii(l,k)),Xr=l.set(Ye.ExtHostTreeViews,new Lii(l.getProxy(Be.MainThreadTreeViews),P,f)),ds=l.set(Ye.ExtHostEditorInsets,new Pti(l.getProxy(Be.MainThreadEditorInsets),Pn,e.remote)),Zo=l.set(Ye.ExtHostDiagnostics,new NIe(l,f,t,k)),Zr=l.set(Ye.ExtHostLanguages,new cii(l,Oe,P.converter,c)),Di=l.set(Ye.ExtHostLanguageFeatures,new FIe(l,c,Oe,P,Zo,f,m,r)),ss=l.set(Ye.ExtHostFileSystem,new cne(l,Di)),Oo=l.set(Ye.ExtHostFileSystemEventService,new nii(l,f,k)),Tn=l.set(Ye.ExtHostQuickOpen,bii(l,o,P)),Ba=l.set(Ye.ExtHostSCM,new jIe(l,P,Oe,f)),vd=l.set(Ye.ExtHostQuickDiff,new KIe(l,c)),Fn=l.set(Ye.ExtHostShare,new YIe(l,c)),th=l.set(Ye.ExtHostComments,Fti(l,P,Oe)),pc=l.set(Ye.ExtHostProgress,new _ii(l.getProxy(Be.MainThreadProgress))),zc=l.set(Ye.ExtHostLabelService,new oii(l)),$s=l.set(Ye.ExtHostTheming,new ZIe(l)),tc=l.set(Ye.ExtHostTimeline,new Tii(l,P)),fl=l.set(Ye.ExtHostWebviews,new Wti(l,e.remote,o,f,m)),ih=l.set(Ye.ExtHostWebviewPanels,new UPe(l,fl,o)),gg=l.set(Ye.ExtHostCustomEditors,new Gti(l,Oe,h,fl,ih)),mc=l.set(Ye.ExtHostWebviewViews,new Pii(l,fl)),$c=l.set(Ye.ExtHostTesting,s.get(cle)),nh=l.set(Ye.ExtHostUriOpeners,new t0e(l)),Dc=l.set(Ye.ExtHostProfileContentHandlers,new mii(l));l.set(Ye.ExtHostInteractive,new sii(l,lt,k,P,f));const pl=l.set(Ye.ExtHostChatAgents2,new LIe(l,f,P,Oe)),ic=l.set(Ye.ExtHostChatVariables,new RIe(l)),Or=l.set(Ye.ExtHostLanguageModelTools,new aii(l)),ml=l.set(Ye.ExtHostAiRelatedInformation,new Dti(l)),sh=l.set(Ye.ExtHostAiEmbeddingVector,new Zti(l)),oh=l.set(Ye.ExtHostStatusBar,new kii(l,P.converter)),Gc=l.set(Ye.ExtHostSpeech,new JIe(l)),Kc=l.set(Ye.ExtHostEmbeddings,new Xti(l)),Wa=Object.values(Ye);l.assertRegistered(Wa);const Bo=new TIe(l,k),Is=new Rti(l),kc=new OIe(l,f),Nh=new jti(l);return Iti.register(P),function(be,Aa,ee){function xe(O){return($,se,Ke)=>{const Bi=O(Wi=>{try{$.call(se,Wi)}catch(ta){No(new Error(`[ExtensionListenerError] Extension '${be.identifier.value}' FAILED to handle event: ${ta.toString()}`,{cause:ta})),r.onExtensionError(be.identifier,ta)}});return Ke?.push(Bi),Bi}}const gt=function(){let O=!be.isUnderDevelopment;function $(){O||(f.info(`Extension '${be.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),O=!0)}return function se(Ke){if(Array.isArray(Ke))Ke.forEach(se);else if(typeof Ke=="string")$();else{const Bi=Ke;typeof Bi.scheme>"u"&&$(),typeof Bi.exclusive=="boolean"&&Ve(be,"documentFiltersExclusive")}return Ke}}(),zn={getSession(O,$,se){return typeof se?.forceNewSession=="object"&&se.forceNewSession.learnMore&&Ve(be,"authLearnMore"),se?.account&&Ve(be,"authGetSessions"),C.getSession(be,O,$,se)},getAccounts(O){return Ve(be,"authGetSessions"),C.getAccounts(O)},async hasSession(O,$){return Ve(be,"authSession"),!!await C.getSession(be,O,$,{silent:!0})},get onDidChangeSessions(){return xe(C.onDidChangeSessions)},registerAuthenticationProvider(O,$,se,Ke){return C.registerAuthenticationProvider(O,$,se,Ke)}},Cs={registerCommand(O,$,se){return P.registerCommand(!0,O,$,se,void 0,be)},registerTextEditorCommand(O,$,se){return P.registerCommand(!0,O,(...Ke)=>{const Bi=Pn.getActiveTextEditor();if(!Bi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}return Bi.edit(Wi=>{$.apply(se,[Bi,Wi,...Ke])}).then(Wi=>{Wi||f.warn("Edits from command "+O+" were not applied.")},Wi=>{f.warn("An error occurred while running command "+O,Wi)})},void 0,void 0,be)},registerDiffInformationCommand:(O,$,se)=>(Ve(be,"diffCommand"),P.registerCommand(!0,O,async(...Ke)=>{const Bi=k.activeEditor(!0);if(!Bi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}const Wi=await Pn.getDiffInformation(Bi.id);$.apply(se,[Wi,...Ke])},void 0,void 0,be)),executeCommand(O,...$){return P.executeCommand(O,...$)},getCommands(O=!1){return P.getCommands(O)}},Wo={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 Is.value},get shell(){return R.getDefaultShell(!1)},get onDidChangeShell(){return xe(R.onDidChangeShell)},get isTelemetryEnabled(){return r.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return xe(r.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return Ve(be,"telemetry"),r.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return Ve(be,"telemetry"),xe(r.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return tot(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(O,$){return eot.validateSender(O),r.instantiateLogger(be,O,$)},openExternal(O,$){return v.openUri(O,{allowTunneling:!!e.remote.authority,allowContributedOpeners:$?.allowContributedOpeners})},async asExternalUri(O){if(O.scheme===e.environment.appUriScheme)return De.createAppUri(O);try{return await v.asExternalUri(O,{allowTunneling:!!e.remote.authority})}catch($){if(AA(O,pe.http)||AA(O,pe.https))return O;throw $}},get remoteName(){return D6(e.remote.authority)},get remoteAuthority(){return Ve(be,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return xe(f.onDidChangeLogLevel)},get appQuality(){return Ve(be,"resolvers"),e.quality},get appCommit(){return Ve(be,"resolvers"),e.commit}},Ha={createTestController(O,$,se){return $c.createTestController(be,O,$,se)},createTestObserver(){return Ve(be,"testObserver"),$c.createTestObserver()},runTests(O){return Ve(be,"testObserver"),$c.runTests(O)},registerTestFollowupProvider(O){return Ve(be,"testObserver"),$c.registerTestFollowupProvider(O)},get onDidChangeTestResults(){return Ve(be,"testObserver"),xe($c.onResultsChanged)},get testResults(){return Ve(be,"testObserver"),$c.results}},ea=e.remote.isRemote?bD.Workspace:bD.UI,Ph={getExtension(O,$){dl(be,"extensionsAny")||($=!1);const se=Aa.mine.getExtensionDescription(O);if(se)return new UV(n,be.identifier,se,ea,!1);if($){const Ke=Aa.all.getExtensionDescription(O);if(Ke)return new UV(n,be.identifier,Ke,ea,!0)}},get all(){const O=[];for(const $ of Aa.mine.getAllExtensionDescriptions())O.push(new UV(n,be.identifier,$,ea,!1));return O},get allAcrossExtensionHosts(){Ve(be,"extensionsAny");const O=new A_(Aa.mine.getAllExtensionDescriptions().map(se=>se.identifier)),$=[];for(const se of Aa.all.getAllExtensionDescriptions()){const Ke=!O.has(se.identifier);$.push(new UV(n,be.identifier,se,ea,Ke))}return $},get onDidChange(){return dl(be,"extensionsAny")?xe(M.any(Aa.mine.onDidChange,Aa.all.onDidChange)):xe(Aa.mine.onDidChange)}},le={createDiagnosticCollection(O){return Zo.createDiagnosticCollection(be.identifier,O)},get onDidChangeDiagnostics(){return xe(Zo.onDidChangeDiagnostics)},getDiagnostics:O=>Zo.getDiagnostics(O),getLanguages(){return Zr.getLanguages()},setTextDocumentLanguage(O,$){return Zr.changeLanguage(O.uri,$)},match(O,$){const se=jEe.from(O);let Ke;return AQe(se)&&(Ke=lt.notebookDocuments.find(Bi=>Bi.apiNotebook.getCells().find(Wi=>Wi.document===$))?.apiNotebook),cae(se,$.uri,$.languageId,!0,Ke?.uri,Ke?.notebookType)},registerCodeActionsProvider(O,$,se){return Di.registerCodeActionProvider(be,gt(O),$,se)},registerDocumentPasteEditProvider(O,$,se){return Ve(be,"documentPaste"),Di.registerDocumentPasteEditProvider(be,gt(O),$,se)},registerCodeLensProvider(O,$){return Di.registerCodeLensProvider(be,gt(O),$)},registerDefinitionProvider(O,$){return Di.registerDefinitionProvider(be,gt(O),$)},registerDeclarationProvider(O,$){return Di.registerDeclarationProvider(be,gt(O),$)},registerImplementationProvider(O,$){return Di.registerImplementationProvider(be,gt(O),$)},registerTypeDefinitionProvider(O,$){return Di.registerTypeDefinitionProvider(be,gt(O),$)},registerHoverProvider(O,$){return Di.registerHoverProvider(be,gt(O),$,be.identifier)},registerEvaluatableExpressionProvider(O,$){return Di.registerEvaluatableExpressionProvider(be,gt(O),$,be.identifier)},registerInlineValuesProvider(O,$){return Di.registerInlineValuesProvider(be,gt(O),$,be.identifier)},registerDocumentHighlightProvider(O,$){return Di.registerDocumentHighlightProvider(be,gt(O),$)},registerMultiDocumentHighlightProvider(O,$){return Di.registerMultiDocumentHighlightProvider(be,gt(O),$)},registerLinkedEditingRangeProvider(O,$){return Di.registerLinkedEditingRangeProvider(be,gt(O),$)},registerReferenceProvider(O,$){return Di.registerReferenceProvider(be,gt(O),$)},registerRenameProvider(O,$){return Di.registerRenameProvider(be,gt(O),$)},registerNewSymbolNamesProvider(O,$){return Ve(be,"newSymbolNamesProvider"),Di.registerNewSymbolNamesProvider(be,gt(O),$)},registerDocumentSymbolProvider(O,$,se){return Di.registerDocumentSymbolProvider(be,gt(O),$,se)},registerWorkspaceSymbolProvider(O){return Di.registerWorkspaceSymbolProvider(be,O)},registerDocumentFormattingEditProvider(O,$){return Di.registerDocumentFormattingEditProvider(be,gt(O),$)},registerDocumentRangeFormattingEditProvider(O,$){return Di.registerDocumentRangeFormattingEditProvider(be,gt(O),$)},registerOnTypeFormattingEditProvider(O,$,se,...Ke){return Di.registerOnTypeFormattingEditProvider(be,gt(O),$,[se].concat(Ke))},registerDocumentSemanticTokensProvider(O,$,se){return Di.registerDocumentSemanticTokensProvider(be,gt(O),$,se)},registerDocumentRangeSemanticTokensProvider(O,$,se){return Di.registerDocumentRangeSemanticTokensProvider(be,gt(O),$,se)},registerSignatureHelpProvider(O,$,se,...Ke){return typeof se=="object"?Di.registerSignatureHelpProvider(be,gt(O),$,se):Di.registerSignatureHelpProvider(be,gt(O),$,typeof se>"u"?[]:[se,...Ke])},registerCompletionItemProvider(O,$,...se){return Di.registerCompletionItemProvider(be,gt(O),$,se)},registerInlineCompletionItemProvider(O,$,se){return $.handleDidShowCompletionItem&&Ve(be,"inlineCompletionsAdditions"),$.handleDidPartiallyAcceptCompletionItem&&Ve(be,"inlineCompletionsAdditions"),se&&Ve(be,"inlineCompletionsAdditions"),Di.registerInlineCompletionsProvider(be,gt(O),$,se)},registerInlineEditProvider(O,$){return Ve(be,"inlineEdit"),Di.registerInlineEditProvider(be,gt(O),$)},registerDocumentLinkProvider(O,$){return Di.registerDocumentLinkProvider(be,gt(O),$)},registerColorProvider(O,$){return Di.registerColorProvider(be,gt(O),$)},registerFoldingRangeProvider(O,$){return Di.registerFoldingRangeProvider(be,gt(O),$)},registerSelectionRangeProvider(O,$){return Di.registerSelectionRangeProvider(be,O,$)},registerCallHierarchyProvider(O,$){return Di.registerCallHierarchyProvider(be,O,$)},registerTypeHierarchyProvider(O,$){return Di.registerTypeHierarchyProvider(be,O,$)},setLanguageConfiguration:(O,$)=>Di.setLanguageConfiguration(be,O,$),getTokenInformationAtPosition(O,$){return Ve(be,"tokenInformation"),Zr.tokenAtPosition(O,$)},registerInlayHintsProvider(O,$){return Di.registerInlayHintsProvider(be,O,$)},createLanguageStatusItem(O,$){return Zr.createLanguageStatusItem(be,O,$)},registerDocumentDropEditProvider(O,$,se){return Di.registerDocumentOnDropEditProvider(be,O,$,dl(be,"documentPaste")?se:void 0)}},dr={get activeTextEditor(){return Pn.getActiveTextEditor()},get visibleTextEditors(){return Pn.getVisibleTextEditors()},get activeTerminal(){return R.activeTerminal},get terminals(){return R.terminals},async showTextDocument(O,$,se){N.isUri(O)&&O.scheme===pe.vscodeRemote&&!O.authority&&m.report("workspace.showTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority.");const Ke=await(N.isUri(O)?Promise.resolve(io.openTextDocument(O)):Promise.resolve(O));return Pn.showTextDocument(Ke,$,se)},createTextEditorDecorationType(O){return Pn.createTextEditorDecorationType(be,O)},onDidChangeActiveTextEditor(O,$,se){return xe(Pn.onDidChangeActiveTextEditor)(O,$,se)},onDidChangeVisibleTextEditors(O,$,se){return xe(Pn.onDidChangeVisibleTextEditors)(O,$,se)},onDidChangeTextEditorSelection(O,$,se){return xe(Pn.onDidChangeTextEditorSelection)(O,$,se)},onDidChangeTextEditorOptions(O,$,se){return xe(Pn.onDidChangeTextEditorOptions)(O,$,se)},onDidChangeTextEditorVisibleRanges(O,$,se){return xe(Pn.onDidChangeTextEditorVisibleRanges)(O,$,se)},onDidChangeTextEditorViewColumn(O,$,se){return xe(Pn.onDidChangeTextEditorViewColumn)(O,$,se)},onDidCloseTerminal(O,$,se){return xe(R.onDidCloseTerminal)(O,$,se)},onDidOpenTerminal(O,$,se){return xe(R.onDidOpenTerminal)(O,$,se)},onDidChangeActiveTerminal(O,$,se){return xe(R.onDidChangeActiveTerminal)(O,$,se)},onDidChangeTerminalDimensions(O,$,se){return Ve(be,"terminalDimensions"),xe(R.onDidChangeTerminalDimensions)(O,$,se)},onDidChangeTerminalState(O,$,se){return xe(R.onDidChangeTerminalState)(O,$,se)},onDidWriteTerminalData(O,$,se){return Ve(be,"terminalDataWriteEvent"),xe(R.onDidWriteTerminalData)(O,$,se)},onDidExecuteTerminalCommand(O,$,se){return Ve(be,"terminalExecuteCommandEvent"),xe(R.onDidExecuteTerminalCommand)(O,$,se)},onDidChangeTerminalShellIntegration(O,$,se){return Ve(be,"terminalShellIntegration"),xe(z.onDidChangeTerminalShellIntegration)(O,$,se)},onDidStartTerminalShellExecution(O,$,se){return Ve(be,"terminalShellIntegration"),xe(z.onDidStartTerminalShellExecution)(O,$,se)},onDidEndTerminalShellExecution(O,$,se){return Ve(be,"terminalShellIntegration"),xe(z.onDidEndTerminalShellExecution)(O,$,se)},get state(){return v.getState()},onDidChangeWindowState(O,$,se){return xe(v.onDidChangeWindowState)(O,$,se)},showInformationMessage(O,...$){return kc.showMessage(be,Xe.Info,O,$[0],$.slice(1))},showWarningMessage(O,...$){return kc.showMessage(be,Xe.Warning,O,$[0],$.slice(1))},showErrorMessage(O,...$){return kc.showMessage(be,Xe.Error,O,$[0],$.slice(1))},showQuickPick(O,$,se){return Tn.showQuickPick(be,O,$,se)},showWorkspaceFolderPick(O){return Tn.showWorkspaceFolderPick(O)},showInputBox(O,$){return Tn.showInput(O,$)},showOpenDialog(O){return Nh.showOpenDialog(be,O)},showSaveDialog(O){return Nh.showSaveDialog(O)},createStatusBarItem(O,$,se){let Ke,Bi,Wi;return typeof O=="string"?(Ke=O,Bi=$,Wi=se):(Bi=O,Wi=$),oh.createStatusBarEntry(be,Ke,Bi,Wi)},setStatusBarMessage(O,$){return oh.setStatusBarMessage(O,$)},withScmProgress(O){return m.report("window.withScmProgress",be,"Use 'withProgress' instead."),pc.withProgress(be,{location:_D.SourceControl},($,se)=>O({report(Ke){}}))},withProgress(O,$){return pc.withProgress(be,O,$)},createOutputChannel(O,$){return ne.createOutputChannel(O,$,be)},createWebviewPanel(O,$,se,Ke){return ih.createWebviewPanel(be,O,$,se,Ke)},createWebviewTextEditorInset(O,$,se,Ke){return Ve(be,"editorInsets"),ds.createWebviewEditorInset(O,$,se,Ke,be)},createTerminal(O,$,se){return typeof O=="object"?"pty"in O?R.createExtensionTerminal(O):R.createTerminalFromOptions(O):R.createTerminal(O,$,se)},registerTerminalLinkProvider(O){return R.registerLinkProvider(O)},registerTerminalProfileProvider(O,$){return R.registerProfileProvider(be,O,$)},registerTerminalQuickFixProvider(O,$){return Ve(be,"terminalQuickFixProvider"),R.registerTerminalQuickFixProvider(O,be.identifier.value,$)},registerTreeDataProvider(O,$){return Xr.registerTreeDataProvider(O,$,be)},createTreeView(O,$){return Xr.createTreeView(O,$,be)},registerWebviewPanelSerializer:(O,$)=>ih.registerWebviewPanelSerializer(be,O,$),registerCustomEditorProvider:(O,$,se={})=>gg.registerCustomEditorProvider(be,O,$,se),registerFileDecorationProvider(O){return L.registerFileDecorationProvider(O,be)},registerUriHandler(O){return De.registerUriHandler(be,O)},createQuickPick(){return Tn.createQuickPick(be)},createInputBox(){return Tn.createInputBox(be)},get activeColorTheme(){return $s.activeColorTheme},onDidChangeActiveColorTheme(O,$,se){return xe($s.onDidChangeActiveColorTheme)(O,$,se)},registerWebviewViewProvider(O,$,se){return mc.registerWebviewViewProvider(be,O,$,se?.webviewOptions)},get activeNotebookEditor(){return lt.activeNotebookEditor},onDidChangeActiveNotebookEditor(O,$,se){return xe(lt.onDidChangeActiveNotebookEditor)(O,$,se)},get visibleNotebookEditors(){return lt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return xe(lt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(O,$,se){return xe(Ji.onDidChangeNotebookEditorSelection)(O,$,se)},onDidChangeNotebookEditorVisibleRanges(O,$,se){return xe(Ji.onDidChangeNotebookEditorVisibleRanges)(O,$,se)},showNotebookDocument(O,$){return lt.showNotebookDocument(O,$)},registerExternalUriOpener(O,$,se){return Ve(be,"externalUriOpener"),nh.registerExternalUriOpener(be.identifier,O,$,se)},registerProfileContentHandler(O,$){return Ve(be,"profileContentHandlers"),Dc.registerProfileContentHandler(be,O,$)},registerQuickDiffProvider(O,$,se,Ke){return Ve(be,"quickDiffProvider"),vd.registerQuickDiffProvider(gt(O),$,se,Ke)},get tabGroups(){return w.tabGroups},registerShareProvider(O,$){return Ve(be,"shareProvider"),Fn.registerShareProvider(gt(O),$)}},io={get rootPath(){return m.report("workspace.rootPath",be,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),o.getPath()},set rootPath(O){throw new A1("rootPath")},getWorkspaceFolder(O){return o.getWorkspaceFolder(O)},get workspaceFolders(){return o.getWorkspaceFolders()},get name(){return o.name},set name(O){throw new A1("name")},get workspaceFile(){return o.workspaceFile},set workspaceFile(O){throw new A1("workspaceFile")},updateWorkspaceFolders:(O,$,...se)=>o.updateWorkspaceFolders(be,O,$||0,...se),onDidChangeWorkspaceFolders:function(O,$,se){return xe(o.onDidChangeWorkspace)(O,$,se)},asRelativePath:(O,$)=>o.getRelativePath(O,$),findFiles:(O,$,se,Ke)=>o.findFiles(O,$,se,be.identifier,Ke),findFiles2:(O,$,se)=>(Ve(be,"findFiles2"),o.findFiles2(O,$,be.identifier,se)),findFiles2New:(O,$,se)=>{Ve(be,"findFiles2New");const Ke={exclude:$?.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Rw.filesExclude||$?.useExcludeSettings===Rw.searchAndFilesExclude,useDefaultSearchExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Rw.searchAndFilesExclude,maxResults:$?.maxResults,useIgnoreFiles:$?.useIgnoreFiles?.local,useGlobalIgnoreFiles:$?.useIgnoreFiles?.global,useParentIgnoreFiles:$?.useIgnoreFiles?.parent,followSymlinks:$?.followSymlinks};return o.findFiles2(O&&O.length>0?O[0]:void 0,Ke,be.identifier,se)},findTextInFiles:(O,$,se,Ke)=>{Ve(be,"findTextInFiles");let Bi,Wi;return typeof $=="object"?(Bi=$,Wi=se):(Bi={},Wi=$,Ke=se),o.findTextInFiles(O,Bi||{},Wi,be.identifier,Ke)},findTextInFilesNew:(O,$,se)=>{Ve(be,"findTextInFilesNew"),Ve(be,"textSearchProviderNew");let Ke={};$&&(Ke={include:$.include&&$.include.length>0?$.include[0]:void 0,exclude:$.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:$.useExcludeSettings===void 0||$.useExcludeSettings===Rw.filesExclude||$.useExcludeSettings===Rw.searchAndFilesExclude,useSearchExclude:$.useExcludeSettings===void 0||$.useExcludeSettings===Rw.searchAndFilesExclude,maxResults:$.maxResults,useIgnoreFiles:$.useIgnoreFiles?.local,useGlobalIgnoreFiles:$.useIgnoreFiles?.global,useParentIgnoreFiles:$.useIgnoreFiles?.parent,followSymlinks:$.followSymlinks,encoding:$.encoding,previewOptions:$.previewOptions?{matchLines:$.previewOptions?.matchLines??100,charsPerLine:$.previewOptions?.charsPerLine??1e4}:void 0,beforeContext:$.surroundingContext,afterContext:$.surroundingContext});const Bi=Promise.resolve(void 0);return{results:new Qd(async ta=>{const Pl=async fg=>(ta.emitOne(r3t(fg)),fg);await Bi.then(fg=>o.findTextInFiles(O,Ke,Pl,be.identifier,se))}),complete:Bi.then(ta=>({limitHit:ta?.limitHit??!1}))}},save:O=>o.save(O),saveAs:O=>o.saveAs(O),saveAll:O=>o.saveAll(O),applyEdit(O,$){return Bo.applyWorkspaceEdit(O,be,$)},createFileSystemWatcher:(O,$,se,Ke)=>{let Bi;return typeof $=="boolean"?Bi={ignoreCreateEvents:!!$,ignoreChangeEvents:!!se,ignoreDeleteEvents:!!Ke,correlate:!1}:$&&(Ve(be,"createFileSystemWatcher"),Bi={...$,correlate:!0}),Oo.createFileSystemWatcher(o,be,O,Bi)},get textDocuments(){return Oe.getAllDocumentData().map(O=>O.document)},set textDocuments(O){throw new A1("textDocuments")},openTextDocument(O){let $;const se=O;if(typeof O=="string")$=Promise.resolve(N.file(O));else if(N.isUri(O))$=Promise.resolve(O);else if(!se||typeof se=="object")$=Oe.createDocumentData(se);else throw new Error("illegal argument - uriOrFileNameOrOptions");return $.then(Ke=>(Ke.scheme===pe.vscodeRemote&&!Ke.authority&&m.report("workspace.openTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority."),Oe.ensureDocumentData(Ke).then(Bi=>Bi.document)))},onDidOpenTextDocument:(O,$,se)=>xe(Oe.onDidAddDocument)(O,$,se),onDidCloseTextDocument:(O,$,se)=>xe(Oe.onDidRemoveDocument)(O,$,se),onDidChangeTextDocument:(O,$,se)=>xe(Oe.onDidChangeDocument)(O,$,se),onDidSaveTextDocument:(O,$,se)=>xe(Oe.onDidSaveDocument)(O,$,se),onWillSaveTextDocument:(O,$,se)=>xe(Ne.getOnWillSaveTextDocumentEvent(be))(O,$,se),get notebookDocuments(){return lt.notebookDocuments.map(O=>O.apiNotebook)},async openNotebookDocument(O,$){let se;if(N.isUri(O))se=O,await lt.openNotebookDocument(O);else if(typeof O=="string")se=N.revive(await lt.createNotebookDocument({viewType:O,content:$}));else throw new Error("Invalid arguments");return lt.getNotebookDocument(se).apiNotebook},onDidSaveNotebookDocument(O,$,se){return xe(xt.onDidSaveNotebookDocument)(O,$,se)},onDidChangeNotebookDocument(O,$,se){return xe(xt.onDidChangeNotebookDocument)(O,$,se)},onWillSaveNotebookDocument(O,$,se){return xe(zs.getOnWillSaveNotebookDocumentEvent(be))(O,$,se)},get onDidOpenNotebookDocument(){return xe(lt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return xe(lt.onDidCloseNotebookDocument)},registerNotebookSerializer(O,$,se,Ke){return lt.registerNotebookSerializer(be,O,$,se,dl(be,"notebookLiveShare")?Ke:void 0)},onDidChangeConfiguration:(O,$,se)=>xe(ee.onDidChangeConfiguration)(O,$,se),getConfiguration(O,$){return $=arguments.length===1?void 0:$,ee.getConfiguration(O,$,be)},registerTextDocumentContentProvider(O,$){return yt.registerTextDocumentContentProvider(O,$)},registerTaskProvider:(O,$)=>(m.report("window.registerTaskProvider",be,"Use the corresponding function on the 'tasks' namespace instead"),j.registerTaskProvider(be,O,$)),registerFileSystemProvider(O,$,se){return jr(ss.registerFileSystemProvider(be,O,$,se),i.addFileSystemProvider(O,$,se))},get fs(){return i.value},registerFileSearchProvider:(O,$)=>(Ve(be,"fileSearchProvider"),Y.registerFileSearchProvider(O,$)),registerTextSearchProvider:(O,$)=>(Ve(be,"textSearchProvider"),Y.registerTextSearchProvider(O,$)),registerAITextSearchProvider:(O,$)=>(Ve(be,"aiTextSearchProvider"),Ve(be,"textSearchProvider"),Y.registerAITextSearchProvider(O,$)),registerFileSearchProviderNew:(O,$)=>(Ve(be,"fileSearchProviderNew"),{dispose:()=>{}}),registerTextSearchProviderNew:(O,$)=>(Ve(be,"textSearchProviderNew"),{dispose:()=>{}}),registerAITextSearchProviderNew:(O,$)=>(Ve(be,"aiTextSearchProviderNew"),Ve(be,"textSearchProviderNew"),{dispose:()=>{}}),registerRemoteAuthorityResolver:(O,$)=>(Ve(be,"resolvers"),n.registerRemoteAuthorityResolver(O,$)),registerResourceLabelFormatter:O=>(Ve(be,"resolvers"),zc.$registerResourceLabelFormatter(O)),getRemoteExecServer:O=>(Ve(be,"resolvers"),n.getRemoteExecServer(O)),onDidCreateFiles:(O,$,se)=>xe(Oo.onDidCreateFile)(O,$,se),onDidDeleteFiles:(O,$,se)=>xe(Oo.onDidDeleteFile)(O,$,se),onDidRenameFiles:(O,$,se)=>xe(Oo.onDidRenameFile)(O,$,se),onWillCreateFiles:(O,$,se)=>xe(Oo.getOnWillCreateFileEvent(be))(O,$,se),onWillDeleteFiles:(O,$,se)=>xe(Oo.getOnWillDeleteFileEvent(be))(O,$,se),onWillRenameFiles:(O,$,se)=>xe(Oo.getOnWillRenameFileEvent(be))(O,$,se),openTunnel:O=>(Ve(be,"tunnels"),p.openTunnel(be,O).then($=>{if(!$)throw new Error("cannot open tunnel");return $})),get tunnels(){return Ve(be,"tunnels"),p.getTunnels()},onDidChangeTunnels:(O,$,se)=>(Ve(be,"tunnels"),xe(p.onDidChangeTunnels)(O,$,se)),registerPortAttributesProvider:(O,$)=>(Ve(be,"portsAttributes"),p.registerPortsAttributesProvider(O,$)),registerTunnelProvider:(O,$)=>(Ve(be,"tunnelFactory"),p.registerTunnelProvider(O,$)),registerTimelineProvider:(O,$)=>(Ve(be,"timeline"),tc.registerTimelineProvider(O,$,be.identifier,P.converter)),get isTrusted(){return o.trusted},requestWorkspaceTrust:O=>(Ve(be,"workspaceTrust"),o.requestWorkspaceTrust(O)),onDidGrantWorkspaceTrust:(O,$,se)=>xe(o.onDidGrantWorkspaceTrust)(O,$,se),registerEditSessionIdentityProvider:(O,$)=>(Ve(be,"editSessionIdentityProvider"),o.registerEditSessionIdentityProvider(O,$)),onWillCreateEditSessionIdentity:(O,$,se)=>(Ve(be,"editSessionIdentityProvider"),xe(o.getOnWillCreateEditSessionIdentityEvent(be))(O,$,se)),registerCanonicalUriProvider:(O,$)=>(Ve(be,"canonicalUriProvider"),o.registerCanonicalUriProvider(O,$)),getCanonicalUri:(O,$,se)=>(Ve(be,"canonicalUriProvider"),o.provideCanonicalUri(O,$,se))},un={get inputBox(){return m.report("scm.inputBox",be,"Use 'SourceControl.inputBox' instead"),Ba.getLastInputBox(be)},createSourceControl(O,$,se){return Ba.createSourceControl(be,O,$,se)}},Se={createCommentController(O,$){return th.createCommentController(be,O,$)}},rt={get activeDebugSession(){return G.activeDebugSession},get activeDebugConsole(){return G.activeDebugConsole},get breakpoints(){return G.breakpoints},get activeStackItem(){return G.activeStackItem},registerDebugVisualizationProvider(O,$){return Ve(be,"debugVisualization"),G.registerDebugVisualizationProvider(be,O,$)},registerDebugVisualizationTreeProvider(O,$){return Ve(be,"debugVisualization"),G.registerDebugVisualizationTree(be,O,$)},onDidStartDebugSession(O,$,se){return xe(G.onDidStartDebugSession)(O,$,se)},onDidTerminateDebugSession(O,$,se){return xe(G.onDidTerminateDebugSession)(O,$,se)},onDidChangeActiveDebugSession(O,$,se){return xe(G.onDidChangeActiveDebugSession)(O,$,se)},onDidReceiveDebugSessionCustomEvent(O,$,se){return xe(G.onDidReceiveDebugSessionCustomEvent)(O,$,se)},onDidChangeBreakpoints(O,$,se){return xe(G.onDidChangeBreakpoints)(O,$,se)},onDidChangeActiveStackItem(O,$,se){return xe(G.onDidChangeActiveStackItem)(O,$,se)},registerDebugConfigurationProvider(O,$,se){return G.registerDebugConfigurationProvider(O,$,se||A9.Initial)},registerDebugAdapterDescriptorFactory(O,$){return G.registerDebugAdapterDescriptorFactory(be,O,$)},registerDebugAdapterTrackerFactory(O,$){return G.registerDebugAdapterTrackerFactory(O,$)},startDebugging(O,$,se){return!se||typeof se=="object"&&"configuration"in se?G.startDebugging(O,$,{parentSession:se}):G.startDebugging(O,$,se||{})},stopDebugging(O){return G.stopDebugging(O)},addBreakpoints(O){return G.addBreakpoints(O)},removeBreakpoints(O){return G.removeBreakpoints(O)},asDebugSourceUri(O,$){return G.asDebugSourceUri(O,$)}},Ft={registerTaskProvider:(O,$)=>j.registerTaskProvider(be,O,$),fetchTasks:O=>j.fetchTasks(O),executeTask:O=>j.executeTask(be,O),get taskExecutions(){return j.taskExecutions},onDidStartTask:(O,$,se)=>xe(j.onDidStartTask)(O,$,se),onDidEndTask:(O,$,se)=>xe(j.onDidEndTask)(O,$,se),onDidStartTaskProcess:(O,$,se)=>xe(j.onDidStartTaskProcess)(O,$,se),onDidEndTaskProcess:(O,$,se)=>xe(j.onDidEndTaskProcess)(O,$,se)},Ci={createNotebookController(O,$,se,Ke,Bi){return Ii.createNotebookController(be,O,$,se,Ke,dl(be,"notebookMessaging")?Bi:void 0)},registerNotebookCellStatusBarItemProvider:(O,$)=>lt.registerNotebookCellStatusBarItemProvider(be,O,$),createRendererMessaging(O){return ns.createRendererMessaging(be,O)},createNotebookControllerDetectionTask(O){return Ve(be,"notebookKernelSource"),Ii.createNotebookControllerDetectionTask(be,O)},registerKernelSourceActionProvider(O,$){return Ve(be,"notebookKernelSource"),Ii.registerKernelSourceActionProvider(be,O,$)},onDidChangeNotebookCellExecutionState(O,$,se){return Ve(be,"notebookCellExecutionState"),xe(Ii.onDidChangeNotebookCellExecutionState)(O,$,se)}},Ot={t(...O){if(typeof O[0]=="string"){const $=O.shift(),se=!O||typeof O[0]!="object"?O:O[0];return ge.getMessage(be.identifier.value,{message:$,args:se})}return ge.getMessage(be.identifier.value,O[0])},get bundle(){return ge.getBundle(be.identifier.value)},get uri(){return ge.getBundleUri(be.identifier.value)}},K={_version:1,transferActiveChat(O){return Ve(be,"interactive"),pl.transferActiveChat(O)}},de={getRelatedInformation(O,$){return Ve(be,"aiRelatedInformation"),ml.getRelatedInformation(be,O,$)},registerRelatedInformationProvider(O,$){return Ve(be,"aiRelatedInformation"),ml.registerRelatedInformationProvider(be,O,$)},registerEmbeddingVectorProvider(O,$){return Ve(be,"aiRelatedInformation"),sh.registerEmbeddingVectorProvider(be,O,$)}},T={_version:1,registerChatResponseProvider(O,$,se){return Ve(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)},registerChatVariableResolver(O,$,se,Ke,Bi,Wi,ta,Pl){return Ve(be,"chatVariableResolver"),ic.registerVariableResolver(be,O,$,se,Ke,Bi,Wi,ta,Pl?.id)},registerMappedEditsProvider(O,$){return Ve(be,"mappedEditsProvider"),Di.registerMappedEditsProvider(be,O,$)},createChatParticipant(O,$){return pl.createChatAgent(be,O,$)},createDynamicChatParticipant(O,$,se){return Ve(be,"chatParticipantPrivate"),pl.createDynamicChatAgent(be,O,$,se)}},ie={selectChatModels:O=>A.selectLanguageModels(be,O??{}),onDidChangeChatModels:(O,$,se)=>A.onDidChangeProviders(O,$,se),registerChatModelProvider:(O,$,se)=>(Ve(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)),get embeddingModels(){return Ve(be,"embeddings"),Kc.embeddingsModels},onDidChangeEmbeddingModels:(O,$,se)=>(Ve(be,"embeddings"),Kc.onDidChange(O,$,se)),registerEmbeddingsProvider(O,$){return Ve(be,"embeddings"),Kc.registerEmbeddingsProvider(be,O,$)},async computeEmbeddings(O,$,se){return Ve(be,"embeddings"),Kc.computeEmbeddings(O,$,se)},registerTool(O,$){return Ve(be,"lmTools"),Or.registerTool(be,O,$)},invokeTool(O,$,se){return Ve(be,"lmTools"),Or.invokeTool(O,$,se)},get tools(){return Ve(be,"lmTools"),Or.tools}},ye={registerSpeechProvider(O,$){return Ve(be,"speech"),Gc.registerProvider(be.identifier,O,$)}};return{version:e.version,ai:de,authentication:zn,commands:Cs,comments:Se,chat:T,debug:rt,env:Wo,extensions:Ph,interactive:K,l10n:Ot,languages:le,lm:ie,notebooks:Ci,scm:un,speech:ye,tasks:Ft,tests:Ha,window:dr,workspace:io,Breakpoint:rN,TerminalOutputAnchor:Nee,ChatResultFeedbackKind:CH,ChatVariableLevel:ute,ChatCompletionItem:wnt,CallHierarchyIncomingCall:UNe,CallHierarchyItem:Pce,CallHierarchyOutgoingCall:VNe,CancellationError:Ma,CancellationTokenSource:ci,CandidatePortSource:YT,CodeAction:N9,CodeActionKind:Sa,CodeActionTriggerKind:nH,CodeLens:P9,Color:sN,ColorInformation:U9,ColorPresentation:V9,ColorThemeKind:mS,CommentMode:tte,CommentState:ite,CommentThreadCollapsibleState:fH,CommentThreadState:pH,CommentThreadApplicability:mH,CommentThreadFocus:_H,CompletionItem:B9,CompletionItemKind:Zi,CompletionItemTag:oH,CompletionList:tN,CompletionTriggerKind:VT,ConfigurationTarget:$T,CustomExecution:Fce,DebugAdapterExecutable:q9,DebugAdapterInlineImplementation:j9,DebugAdapterNamedPipeServer:Q9,DebugAdapterServer:hH,DebugConfigurationProviderTriggerKind:A9,DebugConsoleMode:e$,DebugVisualization:dnt,DecorationRangeBehavior:Hx,Diagnostic:I9,DiagnosticRelatedInformation:XW,DiagnosticSeverity:Bd,DiagnosticTag:Bx,Disposable:Qs,DocumentHighlight:R9,DocumentHighlightKind:ZW,MultiDocumentHighlight:M9,DocumentLink:H9,DocumentSymbol:iH,EndOfLine:D_,EnvironmentVariableMutatorType:HT,EvaluatableExpression:Y9,InlineValueText:J9,InlineValueVariableLookup:X9,InlineValueEvaluatableExpression:Z9,InlineCompletionTriggerKind:uH,EventEmitter:I,ExtensionKind:bD,ExtensionMode:QT,ExternalUriOpenerPriority:lte,FileChangeType:KT,FileDecoration:t$,FileDecoration2:t$,FileSystemError:Jc,FileType:sn,FilePermission:lp,FoldingRange:ete,FoldingRangeKind:Uw,FunctionBreakpoint:Vx,InlineCompletionItem:Uee,InlineCompletionList:Vee,Hover:T9,VerboseHover:L9,HoverVerbosityAction:Pee,IndentAction:yr,Location:yp,MarkdownString:df,OverviewRulerLane:kl,ParameterInformation:Fee,PortAutoForwardAction:dte,Position:bs,ProcessExecution:oN,ProgressLocation:_D,QuickInputButtonLocation:ste,QuickInputButtons:vH,Range:Jn,RelativePattern:GT,Selection:cC,SelectionRange:sH,SemanticTokens:aN,SemanticTokensBuilder:cnt,SemanticTokensEdit:GNe,SemanticTokensEdits:oz,SemanticTokensLegend:nte,ShellExecution:gI,ShellQuoting:Qee,SignatureHelp:Bee,SignatureHelpTriggerKind:Wee,SignatureInformation:Oee,SnippetString:uI,SourceBreakpoint:Ux,StandardTokenType:LS,StatusBarAlignment:TS,SymbolInformation:tH,SymbolKind:_r,SymbolTag:eH,Task:z9,TaskGroup:cH,TaskPanelKind:qee,TaskRevealKind:Kee,TaskScope:fI,TerminalLink:ent,TerminalQuickFixTerminalCommand:int,TerminalQuickFixOpener:tnt,TerminalLocation:Gee,TerminalProfile:nnt,TerminalExitReason:$ee,TerminalShellExecutionCommandLineConfidence:mD,TextDocumentSaveReason:zT,TextEdit:VA,SnippetTextEdit:Nce,TextEditorCursorStyle:qr,TextEditorLineNumbersStyle:o_,TextEditorRevealType:W9,TextEditorSelectionChangeKind:iN,SyntaxTokenType:nN,TextDocumentChangeReason:aH,ThemeColor:dH,ThemeIcon:uu,TreeItem:$9,TreeItemCheckboxState:db,TreeItemCollapsibleState:vD,TypeHierarchyItem:Oce,UIKind:tv,Uri:N,ViewColumn:rH,WorkspaceEdit:hI,DocumentPasteTriggerKind:Jee,DocumentDropEdit:Yee,DocumentDropOrPasteEditKind:K9,DocumentPasteEdit:ont,InlayHint:O9,InlayHintLabelPart:F9,InlayHintKind:Hee,RemoteAuthorityResolverError:t1,ResolvedAuthority:Zit,ManagedResolvedAuthority:sz,SourceControlInputBoxValidationType:zee,ExtensionRuntime:r$,TimelineItem:ate,NotebookRange:Sy,NotebookCellKind:zx,NotebookCellExecutionState:cN,NotebookCellData:rG,NotebookData:KNe,NotebookRendererScript:QNe,NotebookCellStatusBarAlignment:n$,NotebookEditorRevealType:s$,NotebookCellOutput:i$,NotebookCellOutputItem:qNe,NotebookCellStatusBarItem:hnt,NotebookControllerAffinity:rte,NotebookControllerAffinity2:o$,NotebookEdit:k9,NotebookKernelSourceAction:unt,NotebookVariablesRequestKind:wH,PortAttributes:fnt,LinkedEditingRanges:gnt,TestResultState:cte,TestRunRequest:a$,TestMessage:lN,TestMessage2:lN,TestMessageStackFrame:pnt,TestTag:yH,TestRunProfileKind:jT,TextSearchCompleteMessageType:wee,DataTransfer:lH,DataTransferItem:G9,TestCoverageCount:rz,FileCoverage:dN,FileCoverage2:dN,StatementCoverage:_nt,BranchCoverage:vnt,DeclarationCoverage:bnt,WorkspaceTrustState:ZAe,LanguageStatusSeverity:UT,QuickPickItemKind:bH,InputBoxValidationSeverity:qT,TabInputText:Bce,TabInputTextDiff:c$,TabInputTextMerge:jNe,TabInputCustom:Wce,TabInputNotebook:Hce,TabInputNotebookDiff:Uce,TabInputWebview:YNe,TabInputTerminal:JNe,TabInputInteractiveWindow:XNe,TabInputChat:ZNe,TabInputTextMultiDiff:ePe,TelemetryTrustedValue:Wae,LogLevel:Gn,EditSessionIdentityMatch:vte,InteractiveSessionVoteDirection:eEe,ChatCopyKind:hte,InteractiveEditorResponseFeedbackKind:tEe,DebugStackFrame:zNe,DebugThread:$Ne,RelatedInformationType:fte,SpeechToTextStatus:pte,TextToSpeechStatus:mte,PartialAcceptTriggerKind:Wx,KeywordRecognitionStatus:_te,ChatResponseMarkdownPart:aG,ChatResponseFileTreePart:cG,ChatResponseAnchorPart:lG,ChatResponseProgressPart:EH,ChatResponseProgressPart2:tPe,ChatResponseReferencePart:kb,ChatResponseReferencePart2:kb,ChatResponseCodeCitationPart:d$,ChatResponseWarningPart:xH,ChatResponseTextEditPart:DH,ChatResponseMarkdownWithVulnerabilitiesPart:SH,ChatResponseCommandButtonPart:dG,ChatResponseDetectedParticipantPart:AH,ChatResponseConfirmationPart:l$,ChatResponseReferencePartStatusKind:gte,ChatRequestTurn:iPe,ChatResponseTurn:nPe,ChatLocation:r_,ChatRequestEditorData:sPe,ChatRequestNotebookData:oPe,LanguageModelChatMessageRole:Kp,LanguageModelChatMessage:rPe,LanguageModelChatMessageFunctionResultPart:h$,LanguageModelChatResponseTextPart:kH,LanguageModelChatResponseFunctionUsePart:Vce,LanguageModelError:Mw,NewSymbolName:ant,NewSymbolNameTag:Zee,NewSymbolNameTriggerKind:gH,InlineEdit:ynt,InlineEditTriggerKind:IH,ExcludeSettingOptions:Rw,TextSearchContextNew:WNe,TextSearchMatchNew:BNe,TextSearchCompleteMessageTypeNew:yee}}}var pj;let n0e=class{constructor(e,t,i,n,o,r,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=n,this._extHostExtensionService=o,this._initData=r,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),cs("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();cs("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new Oii(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(s0e)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(o0e,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))}};n0e=D([_(2,we),_(3,rE),_(4,MI),_(5,_u),_(6,Ge)],n0e);var hM;let s0e=(hM=class{constructor(e){if(e.environment.appRoot&&pj.aliased.size){const t=Rh(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",n=`@${i}+\\/${i}+|${i}+`,o="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${o}\\/)(${n})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,n,o]=t,r=pj.aliased.get(n);if(r!==void 0)return console.warn(`${n} as been renamed to ${r}, please update your imports`),i+r+o}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},pj=hM,hM.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),hM);s0e=pj=D([_(0,_u)],s0e);class Oii{constructor(e,t,i,n,o){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=n,this._logService=o,this.nodeModuleName="vscode",this._extApiImpl=new va}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let n=this._extApiImpl.get(i.identifier);return n||(n=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,n)),n}if(!this._defaultApiImpl){let n="";this._extensionPaths.forEach((o,r)=>n+=` ${r} -> ${o.identifier.value} +`,r.map(d=>new F(d.range.startLineNumber-1,d.range.startColumn-1,d.range.endLineNumber-1,d.range.endColumn-1)))})}const _1=class _1{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,n,o,r,a){this._textDocumentsAndEditors=i,this._textDocuments=n,this._extHostFileSystem=o,this._extHostSearch=r,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new ui,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 vm("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(Be.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(Be.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(Be.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:c=>{if(c&&c.$mid===ws.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===ws.NotebookActionContext){const l=c.uri,d=this._documents.get(l);if(d)return d.apiNotebook}return c}}),_1._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(n=>jte.from(n)).filter(n=>n!==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,priority:t.exclusive?h$.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(e,t,i){const n=_1._notebookStatusBarItemProviderHandlePool++,o=typeof i.onDidChangeCellStatusBarItems=="function"?_1._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(n,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(n,o,t);let r;return o!==void 0&&(r=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(o))),new Qs(()=>{this._notebookStatusBarItemProviders.delete(n),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(n,o),r?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&NE.from(e.content)});return N.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),n=this._documents.get(N.revive(i));return qn(n?.apiNotebook)}async showNotebookDocument(e,t){N.isUri(e)&&(e=await this.openNotebookDocument(e));let i;typeof t=="object"?i={position:El.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(Fy.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0}:i={preserveFocus:!1};const n=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,e.notebookType,i),o=n&&this._editors.get(n)?.apiEditor;if(o)return o;throw n?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,n){const o=this._notebookStatusBarItemProviders.get(e),r=N.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,n);if(!l)return;const d=new Z,h=this._statusBarCache.add([d]),f=(Array.isArray(l)?l:[l]).map(p=>GEe.from(p,this._commandsConverter,d));return{cacheId:h,items:f}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,n,o){if(zu(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:n}),this._notebookProxy.$registerNotebookSerializer(r,{id:e.identifier,location:e.extensionLocation},t,qEe.from(n),_1._convertNotebookRegistrationData(e,o)),Ee(()=>{this._notebookProxy.$unregisterNotebookSerializer(r)})}async $dataToNotebook(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const o=await n.serializer.deserializeNotebook(t.buffer,i);return new qd(NE.from(o))}async $notebookToData(e,t,i){const n=this._notebookSerializer.get(e);if(!n)throw new Error("NO serializer found");const o=await n.serializer.serializeNotebook(NE.to(t.value),i);return $e.wrap(o)}async $saveNotebook(e,t,i,n,o){const r=N.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 kd(g(4585,"Unable to modify read-only file '{0}'",this._resourceForError(r)),Qi.FILE_PERMISSION_DENIED);const l={metadata:vj(c.apiNotebook.metadata,p=>!(a.options?.transientDocumentMetadata??{})[p]),cells:[]};for(const p of c.apiNotebook.getCells()){const m=new iG(p.kind,p.document.getText(),p.document.languageId,p.mime,a.options?.transientOutputs?[]:[...p.outputs],p.metadata,p.executionSummary);m.metadata=vj(p.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),l.cells.push(m)}if(await this._validateWriteFile(r,n),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&sn.File)!==0,isDirectory:(u.type&sn.Directory)!==0,isSymbolicLink:(u.type&sn.SymbolicLink)!==0,mtime:u.mtime,ctime:u.ctime,size:u.size,readonly:!!((u.permissions??0)&rp.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(r.scheme),locked:!!((u.permissions??0)&rp.Locked),etag:VY({mtime:u.mtime,size:u.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${r.toString()})`),f}async $searchInNotebooks(e,t,i,n,o){const r=this._notebookSerializer.get(e)?.serializer;if(!r)return{limitHit:!1,results:[]};const a=new Ck;await(async(u,f,p)=>{await Promise.all(u.map(async m=>await Promise.all(m.filenamePatterns.map(v=>{const b={_reason:p._reason,folderQueries:p.folderQueries,includePattern:p.includePattern,excludePattern:p.excludePattern,maxResults:p.maxResults,type:nI.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(b,f,w=>{w.forEach(y=>{a.has(y)||n.some(A=>m.isFromSettings&&!A.isFromSettings?!1:A.filenamePatterns.some(L=>Tqt(L,y)))||a.add(y)})}).catch(w=>{if(w.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw w})}))))})(i,o,t);const l=new ui;let d=!1;const h=Array.from(a).map(async u=>{const f=[];try{if(o.isCancellationRequested)return;if(t.maxResults&&[...l.values()].reduce((b,w)=>b+w.cellResults.length,0)>t.maxResults){d=!0;return}const p=[],m=this._documents.get(u);if(m)m.apiNotebook.getCells().forEach(w=>p.push({input:w.document.getText(),outputs:w.outputs.flatMap(y=>y.items.map(C=>C.data.toString()))}));else{const b=await this._extHostFileSystem.value.readFile(u),w=$e.fromString(b.toString()),y=await r.deserializeNotebook(w.buffer,o);if(o.isCancellationRequested)return;NE.from(y).cells.forEach(A=>p.push({input:A.source,outputs:A.outputs.flatMap(L=>L.items.map(k=>k.valueBytes.toString()))}))}if(o.isCancellationRequested)return;p.forEach((b,w)=>{const y=t.contentPattern.pattern,C=new Zti(b.input,void 0,b.outputs),A=C.findInInputs(y),L=C.findInOutputs(y),k=L.flatMap(P=>V9e(P.matches,P.textBuffer)).map((P,R)=>(P.webviewIndex=R,P));if(A.length>0||L.length>0){const P={index:w,contentResults:V9e(A,C.inputTextBuffer),webviewResults:k};f.push(P)}});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!==w_&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtimeo.document.uri)}),this._onDidCloseNotebookDocument.fire(n.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 n=N.revive(i.uri);if(this._documents.has(n))throw new Error(`adding EXISTING notebook ${n} `);const o=new MIe(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,n,i);t.push(...i.cells.map(r=>RIe.asModelAddData(r))),this._documents.get(n)?.dispose(),this._documents.set(n,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=N.revive(t.documentUri),n=this._documents.get(i);n&&this._createExtHostEditor(n,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 n=t.has(i.id);i._acceptVisibility(n)}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=ht.String.with("notebookType","A notebook type"),i=new gn("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new ht("data","Bytes to convert to data",o=>o instanceof Uint8Array,o=>$e.wrap(o))],new nn("Notebook Data",o=>NE.to(o.value))),n=new gn("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new ht("NotebookData","Notebook data to convert to bytes",o=>!0,o=>new qd(NE.from(o)))],new nn("Bytes",o=>o.buffer));e.registerApiCommand(i),e.registerApiCommand(n)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};_1._notebookStatusBarItemProviderHandlePool=0;let NIe=_1;class eii{constructor(e,t,i,n={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=n,this._onWillSaveNotebookDocumentEvent=new Kx}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,n)=>{const o=function(a){t.call(i,a)};return o.extension=e,this._onWillSaveNotebookDocumentEvent.event(o,void 0,n)}}async $participateInSave(e,t,i){const n=N.revive(e),o=this._notebooksAndEditors.getNotebookDocument(n);if(!o)throw new Error("Unable to resolve notebook document");const r=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:o.apiNotebook,reason:Gte.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 rI?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}=Qu.from(c);a.edits=a.edits.concat(l)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new qd(a))}}class tii{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,n){const r=this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptModelChanged(t.value,i,n);this._onDidChangeNotebookDocument.fire(r)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(N.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(N.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let PIe=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(Fy.to)),t.selections&&i._acceptSelections(t.selections.selections.map(Fy.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(El.to(e[t]))}};PIe=D([_(0,Ge)],PIe);const iii=100;let FIe=class{constructor(e,t,i,n,o){this._initData=t,this._extHostNotebook=i,this._commands=n,this._logService=o,this._activeExecutions=new ui,this._activeNotebookExecutions=new ui,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(Be.MainThreadNotebookKernels);const r=new gn("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new ht("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})],nn.Void),a=new gn("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[ht.Uri],new nn("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,n,o,r){for(const A of this._kernelData.values())if(A.controller.id===t&&Sn.equals(e.identifier,A.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:KK(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:n||e.identifier.value,preloads:r?r.map(Yte.from):[]};let p=o??l,m,v;this._proxy.$addKernel(a,f).catch(A=>{console.log(A),d=!0});let b=0;const w=()=>{if(d)return;const A=++b;Promise.resolve().then(()=>{A===b&&this._proxy.$updateKernel(a,f)})},y=new ui,C={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:h.event,get label(){return f.label},set label(A){f.label=A??e.displayName??e.name,w()},get detail(){return f.detail??""},set detail(A){f.detail=A,w()},get description(){return f.description??""},set description(A){f.description=A,w()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(A){f.supportedLanguages=A,w()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(A){f.supportsExecutionOrder=A,w()},get rendererScripts(){return f.preloads?f.preloads.map(Yte.to):[]},get executeHandler(){return p},set executeHandler(A){p=A??l},get interruptHandler(){return m},set interruptHandler(A){m=A,f.supportsInterrupt=!!A,w()},set variableProvider(A){Ve(e,"notebookVariableProvider"),v=A,f.hasVariableProvider=!!A,A?.onDidChangeVariables(L=>c._proxy.$variablesUpdated(L.uri)),w()},get variableProvider(){return v},createNotebookCellExecution(A){if(d)throw new Error("notebook controller is DISPOSED");if(!y.has(A.notebook.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(y.keys()).map(L=>L.toString())),new Error(`notebook controller is NOT associated to notebook: ${A.notebook.uri.toString()}`);return c._createNotebookCellExecution(A,KK(e.identifier,this.id))},createNotebookExecution(A){if(Ve(e,"notebookExecution"),d)throw new Error("notebook controller is DISPOSED");if(!y.has(A.uri))throw c._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(y.keys()).map(L=>L.toString())),new Error(`notebook controller is NOT associated to notebook: ${A.uri.toString()}`);return c._createNotebookExecution(A,KK(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(A,L){L===i$.Hidden&&Ve(e,"notebookControllerAffinityHidden"),c._proxy.$updateNotebookPriority(a,A.uri,L)},onDidReceiveMessage:u.event,postMessage(A,L){return Ve(e,"notebookMessaging"),c._proxy.$postMessage(a,L&&c._extHostNotebook.getIdByEditor(L),A)},asWebviewUri(A){return Ve(e,"notebookMessaging"),Az(A,c._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:C,onDidReceiveMessage:u,onDidChangeSelection:h,associatedNotebooks:y}),C}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return KK(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,n=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const o={dispose:()=>{this._kernelDetectionTask.delete(i),n._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,o),o}registerKernelSourceActionProvider(e,t,i){const n=this._kernelSourceActionProviderHandlePool++,o=typeof i.onDidChangeNotebookKernelSourceActions=="function"?n:void 0,r=this;this._kernelSourceActionProviders.set(n,i),this._logService.trace(`NotebookKernelSourceActionProvider[${n}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(n,n,t);let a;return o!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(c=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(o))),{dispose:()=>{this._kernelSourceActionProviders.delete(n),r._proxy.$removeKernelSourceActionProvider(n,n),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const n=new Z;return(await i.provideNotebookKernelSourceActions(t)??[]).map(r=>KEe.from(r,this._commands.converter,n))}return[]}$acceptNotebookAssociation(e,t,i){const n=this._kernelData.get(e);if(n){const o=this._extHostNotebook.getNotebookDocument(N.revive(t));i?n.associatedNotebooks.set(o.uri,!0):n.associatedNotebooks.delete(o.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,o.uri.toString(),i),n.onDidChangeSelection.fire({selected:i,notebook:o.apiNotebook})}}async $executeCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getNotebookDocument(N.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 n.controller.executeHandler.call(n.controller,r,o.apiNotebook,n.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getNotebookDocument(N.revive(t));if(n.controller.interruptHandler)await n.controller.interruptHandler.call(n.controller,o.apiNotebook);else for(const r of i){const a=o.getCell(r);a&&this._activeExecutions.get(a.uri)?.cancel()}if(n.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,n,o,r,a){const c=this._kernelData.get(e);if(!c)return;const l=this._extHostNotebook.getNotebookDocument(N.revive(i)),d=c.controller.variableProvider;if(!d)return;let h;if(n!==void 0){if(h=this.variableStore[n],!h)return}else this.variableStore={};const u=o==="named"?mH.Named:mH.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++>=iii)return}}$acceptKernelMessageFromRenderer(e,t,i){const n=this._kernelData.get(e);if(!n)return;const o=this._extHostNotebook.getEditorById(t);n.onDidReceiveMessage.fire(Object.freeze({editor:o.apiEditor,message:i}))}$cellExecutionChanged(e,t,i){const o=this._extHostNotebook.getNotebookDocument(N.revive(e)).getCell(t);if(o){const r=i?$Ee.to(i):sN.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 n=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!n)throw new Error("invalid cell");if(this._activeExecutions.has(n.uri))throw new Error(`duplicate execution for ${n.uri}`);const o=new OIe(t,n,this._proxy);this._activeExecutions.set(n.uri,o);const r=o.onDidChangeState(()=>{o.state===Fv.Resolved&&(o.dispose(),r.dispose(),this._activeExecutions.delete(n.uri))});return o.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),n=e.getCells().find(a=>{const c=i.getCellFromApiCell(a);return c&&this._activeExecutions.has(c.uri)});if(n)throw new Error(`duplicate cell execution for ${n.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const o=new BIe(t,i,this._proxy),r=o.onDidChangeState(()=>{o.state===YC.Resolved&&(o.dispose(),r.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[o,r]),o.asApiObject()}};FIe=D([_(4,Ge)],FIe);var Fv;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(Fv||(Fv={}));const lre=class lre extends V{get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=lre.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=Fv.Init,this._tokenSource=this._register(new ci),this._collector=new nii(10,n=>this.update(n)),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 qd(t))}verifyStateForOutput(){if(this._state===Fv.Init)throw new Error("Must call start before modifying cell output");if(this._state===Fv.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=Z9.ensureUniqueMimeTypes(t.items,!0);return i===t.items?dI.from(t):dI.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const n=this.cellIndexToHandle(t),o=this.validateAndConvertOutputs(O_(e));return this.updateSoon({editType:Ux.Output,cellHandle:n,append:i,outputs:o})}async updateOutputItems(e,t,i){return e=Z9.ensureUniqueMimeTypes(O_(e),!0),this.updateSoon({editType:Ux.OutputItems,items:e.map(OH.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:Ux.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===Fv.Resolved||e._state===Fv.Started)throw new Error("Cannot call start again");e._state=Fv.Started,e._onDidChangeState.fire(),e.update({editType:Ux.ExecutionState,runStartTime:i})},end(i,n,o){if(e._state===Fv.Resolved)throw new Error("Cannot call resolve twice");e._state=Fv.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 qd({runEndTime:n,lastRunSuccess:i,error:r}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,n){return e.verifyStateForOutput(),e.updateOutputs(i,n,!0)},replaceOutput(i,n){return e.verifyStateForOutput(),e.updateOutputs(i,n,!1)},appendOutputItems(i,n){return e.verifyStateForOutput(),e.updateOutputItems(i,n,!0)},replaceOutputItems(i,n){return e.verifyStateForOutput(),e.updateOutputItems(i,n,!1)}})}};lre.HANDLE=0;let OIe=lre;var YC;(function(s){s[s.Init=0]="Init",s[s.Started=1]="Started",s[s.Resolved=2]="Resolved"})(YC||(YC={}));const dre=class dre extends V{get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=dre.HANDLE++,this._onDidChangeState=new I,this.onDidChangeState=this._onDidChangeState.event,this._state=YC.Init,this._tokenSource=this._register(new ci),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===YC.Resolved||this._state===YC.Started)throw new Error("Cannot call start again");this._state=YC.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===YC.Resolved)throw new Error("Cannot call resolve twice");this._state=YC.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};dre.HANDLE=0;let BIe=dre;class nii{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 dc,this.startedTimer=Date.now(),Sr(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 KK(s,e){return`${s.value}/${e}`}class sii{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(Be.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const n=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:n.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(n=>n.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(n,o,r)=>this.getOrCreateEmitterFor(t).event(n,o,r),postMessage:(n,o)=>{Z$.apiEditorsToExtHost.has(n)&&([n,o]=[o,n]);const r=o&&Z$.apiEditorsToExtHost.get(o);return this.proxy.$postMessage(r?.id,t,n)}}}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 oii{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(Be.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if(Ve(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,n){const o=this.handlers.get(e);if(!o)throw new Error(`Unknown handler with id: ${e}`);return o.saveProfile(t,i,n)}async $readProfile(e,t,i){const n=this.handlers.get(e);if(!n)throw new Error(`Unknown handler with id: ${e}`);return n.readProfile(Lt(t)?t:N.revive(t),i)}}class rii{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e}async withProgress(e,t,i){const n=this._handles++,{title:o,location:r,cancellable:a}=t,c={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(n,{location:VEe.from(r),title:o,source:c,cancellable:a},e.isUnderDevelopment?void 0:e.identifier.value).catch(No),this._withProgress(n,i,!!a)}_withProgress(e,t,i){let n;i&&(n=new ci,this._mapHandleToCancellationSource.set(e,n));const o=a=>{this._proxy.$progressEnd(a),this._mapHandleToCancellationSource.delete(a),n?.dispose()};let r;try{r=t(new WIe(this._proxy,e),i&&n?n.token:He.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 aii(s,e){return s.message=e.message,typeof e.increment=="number"&&(typeof s.increment=="number"?s.increment+=e.increment:s.increment=e.increment),s}class WIe extends cu{constructor(e,t){super(i=>this.throttledReport(i)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}}WIe.__decorator=D([cAt(100,(s,e)=>aii(s,e),()=>Object.create(null))],WIe.prototype,"throttledReport",null);const hre=class hre{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Be.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const n=N.revive(t),o=this.providers.get(e);return o?Qh(()=>o.provideOriginalResource(n,i)).then(r=>r||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,n){const o=hre.handlePool++;return this.providers.set(o,t),this.proxy.$registerQuickDiffProvider(o,TH.from(e,this.uriTransformer),i,n),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(o),this.providers.delete(o)}}}};hre.handlePool=0;let HIe=hre;function cii(s,e,t){const i=s.getProxy(Be.MainThreadQuickOpen);class n{constructor(p,m){this._sessions=new Map,this._instances=0,this._workspace=p,this._commands=m}showQuickPick(p,m,v,b=He.None){this._onDidSelectItem=void 0;const w=Promise.resolve(m),y=++this._instances,C=i.$show(y,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},b),A={},L=C.then(()=>A);return Promise.race([L,w]).then(k=>{if(k===A)return;const P=ll(p,"quickPickItemTooltip");return w.then(R=>{const z=[];for(let G=0;G{v.onDidSelectItem(R[G])}),i.$setItems(y,z),C.then(G=>{if(typeof G=="number")return R[G];if(Array.isArray(G))return G.map(j=>R[j])})})}).then(void 0,k=>{if(!Fr(k))return i.$setError(y,k),Promise.reject(k)})}$onItemSelected(p){this._onDidSelectItem?.(p)}showInput(p,m=He.None){return this._validateInput=p?.validateInput,i.$input(p,typeof this._validateInput=="function",m).then(void 0,v=>{if(!Fr(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 zT.Info:v=Xe.Info;break;case zT.Warning:v=Xe.Warning;break;case zT.Error:v=Xe.Error;break;default:v=m.message?Xe.Error:Xe.Ignore;break}return{content:m.message,severity:v}}async showWorkspaceFolderPick(p,m=He.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[p]);if(!v)return;const b=await this._workspace.getWorkspaceFolders2();if(b)return b.find(w=>w.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 b=this._sessions.get(p);b instanceof d&&b._fireDidTriggerItemButton(m,v)}$onDidHide(p){this._sessions.get(p)?._fireDidHide()}}const u=class u{constructor(p,m){this._extension=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){const m=ll(this._extension,"quickInputButtonLocation");!m&&p.some(v=>v.location)&&console.warn(`Extension '${this._extension.identifier.value}' uses a button location which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`),this._buttons=p.slice(),this._handlesToButtons.clear(),p.forEach((v,b)=>{const w=v===fH.Back?-1:b;this._handlesToButtons.set(w,v)}),this.update({buttons:p.map((v,b)=>({...l(v.iconPath),tooltip:v.tooltip,handle:v===fH.Back?-1:b,location:m?v.location:void 0}))})}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=bt(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 hu)return{id:f.id};const p=c(f),m=a(f);return{dark:typeof p=="string"?N.file(p):p,light:typeof m=="string"?N.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=We.asClassName(p):m=p,{iconPath:m,iconClass:v}}class d extends o{constructor(p,m){super(p,m),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((b,w)=>{this._handlesToItems.set(w,b),this._itemsToHandles.set(b,w)});const m=ll(this._extension,"quickPickItemTooltip"),v=[];for(let b=0;b({...l(C.iconPath),tooltip:C.tooltip,handle:A}))})}}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=Fi(p.map(v=>this._handlesToItems.get(v)));this._activeItems=m,this._onDidChangeActiveEmitter.fire(m)}_fireDidChangeSelection(p){const m=Fi(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 b=v.buttons[m];b&&this._onDidTriggerItemButtonEmitter.fire({button:b,item:v})}}class h extends o{constructor(p,m){super(p,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:Xe.Error}):this.update({validationMessage:p.message,severity:p.severity??Xe.Error}):this.update({validationMessage:void 0,severity:Xe.Ignore})}}return new n(e,t)}var UIe;function z9e(s){return s instanceof N}function lii(s,e){return s.scheme===pe.file&&e.scheme===pe.file&&pr?s.toString()===e.toString():s.toString().toLowerCase()===e.toString().toLowerCase()}function Jue(s){if(s)return typeof s.iconPath=="string"?N.file(s.iconPath):N.isUri(s.iconPath)||We.isThemeIcon(s.iconPath)?s.iconPath:void 0}function $9e(s){if(s){if(N.isUri(s))return s;if(We.isThemeIcon(s))return s;{const e=s;return{light:e.light,dark:e.dark}}}else return}function Xue(s){const e=$9e(s.icon),t=s.labels?.map(i=>({title:i.title,icon:$9e(i.icon)}));return{...s,icon:e,labels:t}}function Zue(s,e){if(!s.iconPath&&!e.iconPath)return 0;if(s.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof s.iconPath=="string"?s.iconPath:N.isUri(s.iconPath)?s.iconPath.fsPath:s.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:N.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return $q(t,i)}function dii(s,e){let t=0;if(s.strikeThrough!==e.strikeThrough)return s.strikeThrough?1:-1;if(s.faded!==e.faded)return s.faded?1:-1;if(s.tooltip!==e.tooltip)return(s.tooltip||"").localeCompare(e.tooltip||"");if(t=Zue(s,e),t!==0)return t;if(s.light&&e.light)t=Zue(s.light,e.light);else{if(s.light)return 1;if(e.light)return-1}if(t!==0)return t;if(s.dark&&e.dark)t=Zue(s.dark,e.dark);else{if(s.dark)return 1;if(e.dark)return-1}return t}function hii(s,e){if(s.command!==e.command)return s.commandthis._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(G9e),i=A1e(this._resourceSnapshot,e,G9e).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 P=new Z;h=this._commands.converter.toInternal(c.command,P),this._resourceStatesDisposablesMap.set(l,P)}else this._resourceStatesCommandsMap.set(l,c.command);const u=ll(this._extension,"scmMultiDiffEditor"),f=u?c.multiDiffEditorOriginalUri:void 0,p=u?c.multiFileDiffEditorModifiedUri:void 0,m=Jue(c.decorations),v=c.decorations&&Jue(c.decorations.light)||m,b=c.decorations&&Jue(c.decorations.dark)||m,w=[v,b],y=c.decorations&&c.decorations.tooltip||"",C=c.decorations&&!!c.decorations.strikeThrough,A=c.decorations&&!!c.decorations.faded,L=c.contextValue||"";return{rawResource:[l,d,w,y,C,A,L,h,f,p],handle:l}});return{start:r.start,deleteCount:r.deleteCount,toInsert:a}}),n=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,n}dispose(){this._disposed=!0,this._onDidDispose.fire()}};ure._handlePool=0;let VIe=ure;var Ad;const gre=class gre{constructor(e,t,i,n,o,r,a){Wt(this,Ad);this._extension=e,this._commands=n,this._id=o,this._label=r,this._rootUri=a,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._historyProviderDisposable=new wn,this._commitTemplate=void 0,this._acceptInputDisposables=new wn,this._acceptInputCommand=void 0,this._actionButtonDisposables=new wn,this._statusBarDisposables=new wn,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new I,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=gre._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,Ct(this,Ad,i);const c=N.from({scheme:pe.vscodeSourceControl,path:`${o}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new pii(e,t,Ce(this,Ad),this.handle,c),Ce(this,Ad).$registerSourceControl(this.handle,o,r,a,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,Ce(this,Ad).$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;ll(this._extension,"quickDiffProvider")&&(t=e?.label),Ce(this,Ad).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get historyProvider(){return Ve(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){Ve(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new Z,Ce(this,Ad).$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemGroup(()=>{this._historyProviderCurrentHistoryItemGroup=e?.currentHistoryItemGroup,Ce(this,Ad).$onDidChangeHistoryProviderCurrentHistoryItemGroup(this.handle,this._historyProviderCurrentHistoryItemGroup)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,Ce(this,Ad).$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);Ce(this,Ad).$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return Ve(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){Ve(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(n=>this._commands.converter.toInternal(n,this._actionButtonDisposables.value))),description:e.description,enabled:e.enabled}:void 0;Ce(this,Ad).$updateSourceControl(this.handle,{actionButton:t??null})}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&fii(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));Ce(this,Ad).$updateSourceControl(this.handle,{statusBarCommands:t})}get selected(){return this._selected}createResourceGroup(e,t,i){const n=ll(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,o=new VIe(Ce(this,Ad),this._commands,this.handle,e,t,n,this._extension),r=M.once(o.onDidDispose)(()=>this.createdResourceGroups.delete(o));return this.createdResourceGroups.set(o,r),this.eventuallyAddResourceGroups(),o}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,n]of this.createdResourceGroups){n.dispose();const o=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});M.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),o.dispose(),this._groups.delete(i.handle),Ce(this,Ad).$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)}Ce(this,Ad).$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&&Ce(this,Ad).$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()),Ce(this,Ad).$unregisterSourceControl(this.handle)}};Ad=new WeakMap,gre._handlePool=0;let gN=gre;gN.__decorator=D([ILe(100)],gN.prototype,"eventuallyAddResourceGroups",null);gN.__decorator=D([ILe(100)],gN.prototype,"eventuallyUpdateResourceStates",null);var rM;let zIe=(rM=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,n){this._commands=t,this._extHostDocuments=i,this.logService=n,this._sourceControls=new Map,this._sourceControlsByExtension=new va,this._onDidChangeActiveProvider=new I,this._proxy=e.getProxy(Be.MainThreadSCM),this._telemetry=e.getProxy(Be.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:o=>{if(o&&o.$mid===ws.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===ws.ScmResourceGroup){const r=this._sourceControls.get(o.sourceControlHandle);return r?r.getResourceGroup(o.groupHandle):o}else if(o&&o.$mid===ws.ScmProvider){const r=this._sourceControls.get(o.handle);return r||o}return o}})}createSourceControl(e,t,i,n){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,n),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const o=UIe._handlePool++,r=new gN(e,this._extHostDocuments,this._proxy,this._commands,t,i,n);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 n=N.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,n.toString());const o=this._sourceControls.get(e);return!o||!o.quickDiffProvider||!o.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Qh(()=>o.quickDiffProvider.provideOriginalResource(n,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,n){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,n):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const n=this._sourceControls.get(e);return!n||!n.inputBox.validateInput?Promise.resolve(void 0):Qh(()=>n.inputBox.validateInput(t,i)).then(o=>{if(!o)return Promise.resolve(void 0);const r=Ps.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,n){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor(t,i,n)??void 0}async $resolveHistoryItemGroupCommonAncestor2(e,t,i){return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemGroupCommonAncestor2(t,i)??void 0}async $provideHistoryItems(e,t,i,n){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i,n))?.map(a=>Xue(a))??void 0}async $provideHistoryItems2(e,t,i){return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems2(t,i))?.map(r=>Xue(r))??void 0}async $provideHistoryItemSummary(e,t,i,n){const o=this._sourceControls.get(e)?.historyProvider;if(typeof o?.provideHistoryItemSummary!="function")return;const r=await o.provideHistoryItemSummary(t,i,n);return r?Xue(r):void 0}async $provideHistoryItemChanges(e,t,i,n){return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,n)??void 0}},UIe=rM,rM._handlePool=0,rM);zIe=UIe=D([_(3,Ge)],zIe);const fre=class fre{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(Be.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:et.to(t.selection),resourceUri:N.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=fre.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,TH.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};fre.handlePool=0;let $Ie=fre;const pre=class pre{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(Be.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const n=this.providers.get(e);if(!n)return;const o=new Z,r=new ci;this.sessions.set(t,r);const a=await n.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 n=this.providers.get(e);if(!n)return;const o=new Z,r=new ci;this.sessions.set(t,r);const a=await n.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 n=new Z,o=new ci;this.sessions.set(t,o);const r=await i.provideKeywordRecognitionSession(o.token);r&&(n.add(r.onDidChange(a=>{o.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),n.add(o.token.onCancellationRequested(()=>n.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const n=pre.ID_POOL++;return this.providers.set(n,i),this.proxy.$registerProvider(n,t,{extension:e,displayName:e.value}),Ee(()=>{this.proxy.$unregisterProvider(n),this.providers.delete(n)})}};pre.ID_POOL=1;let GIe=pre;var YB,JB;const v1=class v1{constructor(e,t,i,n,o,r=IS.Left,a){Wt(this,YB);Wt(this,JB);if(this._disposed=!1,this._text="",this._staleCommandRegistrations=new Z,Ct(this,YB,e),Ct(this,JB,t),o&&n){this._entryId=M9t(n.identifier,o);const c=i.get(this._entryId);c&&(r=c.alignLeft?IS.Left:IS.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(v1.ID_GEN++);this._extension=n,this._id=o,this._alignment=r,this._priority=this.validatePriority(a)}validatePriority(e){if(lc(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&&!v1.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:Ce(this,JB).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:Ce(this,JB).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,Ce(this,YB).$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(4587,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=v1.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));const n=Ps.fromStrict(this._tooltip);Ce(this,YB).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,n,this._command?.internal,i,this._backgroundColor,this._alignment===IS.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._disposed=!0}};YB=new WeakMap,JB=new WeakMap,v1.ID_GEN=0,v1.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new rH("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new rH("statusBarItem.warningForeground")]]);let KIe=v1;class mii{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",IS.Left,Number.MIN_VALUE),this._item.name=g(4588,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new Qs(()=>{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 _ii{constructor(e,t){this._existingItems=new Map,this._proxy=e.getProxy(Be.MainThreadStatusBar),this._commands=t,this._statusMessage=new mii(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}createStatusBarEntry(e,t,i,n){return new KIe(this._proxy,this._commands,this._existingItems,e,t,i,n)}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let n;return typeof t=="number"?n=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new Qs(()=>{i.dispose(),clearTimeout(n)})}}class vii extends V{constructor(e,t){super(),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(Be.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i))),this._register(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 n;typeof t=="number"?n={position:El.from(t),preserveFocus:i}:typeof t=="object"?n={position:El.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?et.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:n={preserveFocus:!1};const o=await this._proxy.$tryShowTextDocument(e.uri,n),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 $ke(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 n=t.selections.selections.map(Fb.to);i._acceptSelections(n)}if(t.visibleRanges){const n=Fi(t.visibleRanges.map(et.to));i._acceptVisibleRanges(n)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:nB.to(t.options.lineNumbers)}}),t.selections){const n=XM.fromValue(t.selections.source),o=t.selections.selections.map(Fb.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:o,kind:n})}if(t.visibleRanges){const n=Fi(t.visibleRanges.map(et.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:n})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const n=El.to(e[t]);i.value.viewColumn!==n&&(i._acceptViewColumn(n),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:n}))}}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let qIe=class{constructor(e){this._actual=new nte(pS.Dark),this._onDidChangeActiveColorTheme=new I}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=pS.Light;break;case"hcDark":t=pS.HighContrast;break;case"hcLight":t=pS.HighContrastLight;break;default:t=pS.Dark}this._actual=new nte(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};qIe=D([_(0,Jo)],qIe);class bii{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(Be.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,n)=>{if(i&&i.$mid===ws.TimelineActionContext)if(this._providers.get(i.source)&&Sn.equals(n,this._providers.get(i.source)?.extension)){const o=i.uri===void 0?void 0:N.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(K9e(o))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,n){return this._providers.get(e)?.provider.provideTimeline(N.revive(t),i,n)}registerTimelineProvider(e,t,i,n){const o=new Z,r=this.convertTimelineItem(t.id,n,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(n,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=K9e(n);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 hu?f={id:c.id,color:c.color}:N.isUri(c)?(h=c,u=c):{light:h,dark:u}=c);let p;return af.isMarkdownString(l.tooltip)?p=Ps.from(l.tooltip):Lt(l.tooltip)?p=l.tooltip:af.isMarkdownString(l.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),p=Ps.from(l.detail)):Lt(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 n of this._itemsBySourceAndUriMap.values())n.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function K9e(s){return s?.toString()}function q9e(s,e){if(Lt(s))return{label:s};if(s&&typeof s=="object"&&typeof s.label=="string"){let t;return Array.isArray(s.highlights)&&(t=s.highlights.filter(i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"),t=t.length?t:void 0),{label:s.label,highlights:t}}}class wii extends V{constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new DRe;function n(o){return o&&o.$treeViewId&&(o.$treeItemHandle||o.$selectedTreeItems||o.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:o=>n(o)?this.convertArgument(o):Array.isArray(o)&&o.length>0?o.map(r=>n(r)?this.convertArgument(r):r):o})}registerTreeDataProvider(e,t,i){const n=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>n.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const n=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:n,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 Ve(i,"treeViewActiveItem"),c.focusedElement},get onDidChangeActiveItem(){return Ve(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){cd(u)&&Ve(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&&VAe.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 Xb(e))}async $handleDrop(e,t,i,n,o,r,a,c){const l=this.treeViews.get(e);if(!l)return Promise.reject(new Xb(e));const d=P_.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,n,o)}async addAdditionalTransferItems(e,t,i,n,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,n);this.treeDragAndDropService.addDragOperationTransfer(o,a),await a}return e}async $handleDrag(e,t,i,n){const o=this.treeViews.get(e);if(!o)return Promise.reject(new Xb(e));const r=await this.addAdditionalTransferItems(new oH,o,t,n,i);if(!(!r||n.isCancellationRequested))return P_.from(r)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new Xb(e);return t.hasResolve}$resolve(e,t,i){const n=this.treeViews.get(e);if(!n)throw new Xb(e);return n.resolveTreeItem(t,i)}$setExpanded(e,t,i){const n=this.treeViews.get(e);if(!n)throw new Xb(e);n.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const n=this.treeViews.get(e);if(!n)throw new Xb(e);n.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new Xb(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new Xb(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const n=this._register(new QIe(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,n),n}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 yO=class yO extends V{get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!ra(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,n,o,r){if(super(),this.viewId=e,this.proxy=i,this.commands=n,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 ci,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=M.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,Ps.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(n=>n.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=ra(t.select)?!0:t.select,n=ra(t.focus)?!1:t.focus,o=ra(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:n,expand:o})),r=>this.logService.error(r)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:n,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=Xte.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=!is(this._selectedHandles,e);this._selectedHandles=e;const n=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),n&&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 n=this.getExtensionElement(i.treeItemHandle);return n?{extensionItem:n,treeItem:await this.dataProvider.getTreeItem(n),newState:i.newState?ab.Checked:ab.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?ab.Checked:ab.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const n=[];for(const o of e){const r=this.getExtensionElement(o);r&&n.push(r)}if(!(!this.dndController?.handleDrag||n.length===0))return await this.dndController.handleDrag(n,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const n=t?this.getExtensionElement(t):void 0;if(!(!n&&t||!this.dndController?.handleDrop))return Qh(()=>this.dndController?.handleDrop?this.dndController.handleDrop(n,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 n=this.nodes.get(i);if(n){const o=await this.dataProvider.resolveTreeItem(n.extensionItem,i,t)??n.extensionItem;return this.validateTreeItem(o),n.item.tooltip=this.getTooltip(o.tooltip),n.item.command=this.getCommand(n.disposableStore,o.command),n.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(n=>(i.push(n),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):Qh(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):Qh(()=>this.dataProvider.getTreeItem(e)).then(n=>this.createHandle(e,n,t,!0)).then(n=>this.getChildren(t?t.item.handle:void 0).then(()=>{const o=this.getExtensionElement(n);if(o){const r=this.nodes.get(o);if(r)return Promise.resolve(r)}throw new Error(`Cannot resolve tree item for element ${n} 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 ci(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,n=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const o=Fi(n||[]),r=await Promise.all(Fi(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 Fi(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new ci,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 n=[];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))&&n.push(o)}}),n}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(n=>{n&&(t[i]=n.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),Qh(()=>this.dataProvider.getTreeItem(t)).then(n=>{if(n){const o=this.createTreeNode(t,n,i.parent);return this.updateNodeCache(t,o,i,i.parent),i.dispose(),o}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const n=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(n.item.handle))throw new Error(g(4589,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,n),this.addNodeToParentCache(n,i),n}getTooltip(e){return af.isMarkdownString(e)?Ps.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,n;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,n=e.checkboxState.accessibilityInformation),{isChecked:t===ab.Checked,tooltip:i,accessibilityInformation:n}}validateTreeItem(e){if(!U9.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 n=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:q9e(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(n,t.command),contextValue:t.contextValue,icon:r,iconDark:this.getDarkIconPath(t)||r,themeIcon:this.getThemeIcon(t),collapsibleState:ra(t.collapsibleState)?pD.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:n,dispose(){n.dispose()}}}getThemeIcon(e){return e.iconPath instanceof hu?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:n},o,r){if(t)return`${yO.ID_HANDLE_PREFIX}/${t}`;const a=q9e(i),c=o?o.item.handle:yO.LABEL_HANDLE_PREFIX;let l=a?a.label:n?_i(n):"";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 hu))return typeof e.iconPath=="string"||N.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof hu)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return N.isUri(e)?e:N.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,n){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(n)||[],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 n=this.elements.get(i.item.handle);n&&this.clear(n)}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 n=this.elements.get(i.item.handle);n&&this.clear(n)}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)}};yO.LABEL_HANDLE_PREFIX="0",yO.ID_HANDLE_PREFIX="1";let QIe=yO;const mre=class mre{constructor(e){this._openers=new Map,this._proxy=e.getProxy(Be.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,n){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const o=n.schemes.find(r=>!mre.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,n.schemes,e,n.label),Ee(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const n=this._openers.get(e);if(!n)throw new Error(`Unknown opener with id: ${e}`);const o=N.revive(t);return n.canOpenExternalUri(o,i)}async $openUri(e,t,i){const n=this._openers.get(e);if(!n)throw new Error(`Unknown opener id: '${e}'`);return n.openExternalUri(N.revive(t.resolvedUri),{sourceUri:N.revive(t.sourceUri)},i)}};mre.supportedSchemes=new Set([pe.http,pe.https]);let jIe=mre;const _re=class _re{constructor(e){this.handles=new y_,this.handlers=new Map,this._proxy=e.getProxy(Be.MainThreadUrls)}registerUriHandler(e,t){const i=e.identifier;if(this.handles.has(i))throw new Error(`Protocol handler already registered for extension ${i}`);const n=_re.HandlePool++;return this.handles.add(i),this.handlers.set(n,t),this._proxy.$registerUriHandler(n,i,e.displayName||e.name),Ee(()=>{this.handles.delete(i),this.handlers.delete(n),this._proxy.$unregisterUriHandler(n)})}$handleExternalUri(e,t){const i=this.handlers.get(e);if(!i)return Promise.resolve(void 0);try{i.handleUri(N.revive(t))}catch(n){vt(n)}return Promise.resolve(void 0)}async createAppUri(e){return N.revive(await this._proxy.$createAppUri(e))}};_re.HandlePool=0;let YIe=_re;var cx,lx,y7,XB,C7,eT,ZB,tS,e2,t2,dx,i2,n2;class yii extends V{constructor(t,i,n,o){super();Wt(this,cx);Wt(this,lx);Wt(this,y7);Wt(this,XB);Wt(this,C7);Wt(this,eT);Wt(this,ZB);Wt(this,tS);Wt(this,e2);Wt(this,t2);Wt(this,dx);Wt(this,i2);Wt(this,n2);Ct(this,tS,void 0),Ct(this,e2,!0),Ct(this,dx,!1),Ct(this,i2,this._register(new I)),this.onDidDispose=Ce(this,i2).event,Ct(this,n2,this._register(new I)),this.onDidChangeViewState=Ce(this,n2).event,Ct(this,cx,t),Ct(this,lx,i),Ct(this,XB,n),Ct(this,y7,o.viewType),Ct(this,C7,o.panelOptions),Ct(this,tS,o.viewColumn),Ct(this,eT,o.title),Ct(this,t2,o.active)}dispose(){Ce(this,dx)||(Ct(this,dx,!0),Ce(this,i2).fire(),Ce(this,lx).$disposeWebview(Ce(this,cx)),Ce(this,XB).dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),Ce(this,XB)}get viewType(){return this.assertNotDisposed(),Ce(this,y7)}get title(){return this.assertNotDisposed(),Ce(this,eT)}set title(t){this.assertNotDisposed(),Ce(this,eT)!==t&&(Ct(this,eT,t),Ce(this,lx).$setTitle(Ce(this,cx),t))}get iconPath(){return this.assertNotDisposed(),Ce(this,ZB)}set iconPath(t){this.assertNotDisposed(),Ce(this,ZB)!==t&&(Ct(this,ZB,t),Ce(this,lx).$setIconPath(Ce(this,cx),N.isUri(t)?{light:t,dark:t}:t))}get options(){return Ce(this,C7)}get viewColumn(){if(this.assertNotDisposed(),!(typeof Ce(this,tS)=="number"&&Ce(this,tS)<0))return Ce(this,tS)}get active(){return this.assertNotDisposed(),Ce(this,t2)}get visible(){return this.assertNotDisposed(),Ce(this,e2)}_updateViewState(t){Ce(this,dx)||(this.active!==t.active||this.visible!==t.visible||this.viewColumn!==t.viewColumn)&&(Ct(this,t2,t.active),Ct(this,e2,t.visible),Ct(this,tS,t.viewColumn),Ce(this,n2).fire({webviewPanel:this}))}reveal(t,i){this.assertNotDisposed(),Ce(this,lx).$reveal(Ce(this,cx),{viewColumn:typeof t>"u"?void 0:El.from(t),preserveFocus:!!i})}assertNotDisposed(){if(Ce(this,dx))throw new Error("Webview is disposed")}}cx=new WeakMap,lx=new WeakMap,y7=new WeakMap,XB=new WeakMap,C7=new WeakMap,eT=new WeakMap,ZB=new WeakMap,tS=new WeakMap,e2=new WeakMap,t2=new WeakMap,dx=new WeakMap,i2=new WeakMap,n2=new WeakMap;class IPe extends V{static newHandle(){return ar()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(Be.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,n,o={}){const r=typeof n=="object"?n.viewColumn:n,a={viewColumn:El.from(r),preserveFocus:typeof n=="object"&&!!n.preserveFocus},c=$H(e),l=IPe.newHandle();this._proxy.$createWebviewPanel(sne(e),l,t,{title:i,panelOptions:Cii(o),webviewOptions:cot(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,n)=>{const o=e[i],r=e[n];return o.active?1:r.active?-1:+o.visible-+r.visible});for(const i of t){const n=this.getWebviewPanel(i);if(!n)continue;const o=e[i];n._updateViewState({active:o.active,visible:o.visible,viewColumn:El.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:$H(e)}),new Qs(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,n){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,n,i.panelOptions,c,i.active);await r.deserializeWebviewPanel(l,i.state)}createNewWebviewPanel(e,t,i,n,o,r,a){const c=new yii(e,this._proxy,r,{viewType:t,title:i,viewColumn:n,panelOptions:o,active:a});return this._webviewPanels.set(e,c),c}getWebviewPanel(e){return this._webviewPanels.get(e)}}function Cii(s){return{enableFindWidget:s.enableFindWidget,retainContextWhenHidden:s.retainContextWhenHidden}}var hx,ux,S7,s2,gx,tT,iT,o2,nT,r2,a2;class Sii extends V{constructor(t,i,n,o,r,a){super();Wt(this,hx);Wt(this,ux);Wt(this,S7);Wt(this,s2);Wt(this,gx);Wt(this,tT);Wt(this,iT);Wt(this,o2);Wt(this,nT);Wt(this,r2);Wt(this,a2);Ct(this,gx,!1),Ct(this,r2,this._register(new I)),this.onDidChangeVisibility=Ce(this,r2).event,Ct(this,a2,this._register(new I)),this.onDidDispose=Ce(this,a2).event,Ct(this,S7,n),Ct(this,iT,o),Ct(this,hx,t),Ct(this,ux,i),Ct(this,s2,r),Ct(this,tT,a)}dispose(){Ce(this,gx)||(Ct(this,gx,!0),Ce(this,a2).fire(),Ce(this,s2).dispose(),super.dispose())}get title(){return this.assertNotDisposed(),Ce(this,iT)}set title(t){this.assertNotDisposed(),Ce(this,iT)!==t&&(Ct(this,iT,t),Ce(this,ux).$setWebviewViewTitle(Ce(this,hx),t))}get description(){return this.assertNotDisposed(),Ce(this,o2)}set description(t){this.assertNotDisposed(),Ce(this,o2)!==t&&(Ct(this,o2,t),Ce(this,ux).$setWebviewViewDescription(Ce(this,hx),t))}get visible(){return Ce(this,tT)}get webview(){return Ce(this,s2)}get viewType(){return Ce(this,S7)}_setVisible(t){t===Ce(this,tT)||Ce(this,gx)||(Ct(this,tT,t),Ce(this,r2).fire())}get badge(){return this.assertNotDisposed(),Ce(this,nT)}set badge(t){this.assertNotDisposed(),!(t?.value===Ce(this,nT)?.value&&t?.tooltip===Ce(this,nT)?.tooltip)&&(Ct(this,nT,Xte.from(t)),Ce(this,ux).$setWebviewViewBadge(Ce(this,hx),t))}show(t){this.assertNotDisposed(),Ce(this,ux).$show(Ce(this,hx),!!t)}assertNotDisposed(){if(Ce(this,gx))throw new Error("Webview is disposed")}}hx=new WeakMap,ux=new WeakMap,S7=new WeakMap,s2=new WeakMap,gx=new WeakMap,tT=new WeakMap,iT=new WeakMap,o2=new WeakMap,nT=new WeakMap,r2=new WeakMap,a2=new WeakMap;class Aii{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(Be.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,n){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(sne(e),t,{retainContextWhenHidden:n?.retainContextWhenHidden,serializeBuffersForPostMessage:$H(e)}),new Qs(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,n,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 Sii(e,this._proxy,t,i,l,!0);this._webviewViews.set(e,d),await a.resolveWebviewView(d,{state:n},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 Eii(s){const e=s.get(mu),t=s.get($U),i=s.get(Zce),n=s.get(DI),o=s.get(nE),r=s.get(tle),a=s.get(sE),c=s.get(ele),l=s.get(Jo),d=s.get(bPe),h=s.get(wPe),u=s.get(lf),f=s.get(Ge),p=s.get(aPe),m=s.get(ile),v=s.get(oot),b=s.get(SPe),w=s.get(dG),y=s.get(EPe),C=s.get(yPe),A=s.get(CPe);l.set(Ye.ExtHostFileSystemInfo,t),l.set(Ye.ExtHostLogLevelServiceShape,u),l.set(Ye.ExtHostWorkspace,o),l.set(Ye.ExtHostConfiguration,a),l.set(Ye.ExtHostExtensionService,n),l.set(Ye.ExtHostStorage,d),l.set(Ye.ExtHostTunnelService,p),l.set(Ye.ExtHostWindow,v),l.set(Ye.ExtHostSecretState,b),l.set(Ye.ExtHostTelemetry,r),l.set(Ye.ExtHostEditorTabs,w),l.set(Ye.ExtHostManagedSockets,y),l.set(Ye.ExtHostAuthentication,C),l.set(Ye.ExtHostChatProvider,A);const L=l.set(Ye.ExtHostDecorations,s.get(Gst)),k=l.set(Ye.ExtHostDocumentsAndEditors,s.get(GU)),P=l.set(Ye.ExtHostCommands,s.get(KN)),R=l.set(Ye.ExtHostTerminalService,s.get(KU)),z=l.set(Ye.ExtHostTerminalShellIntegration,s.get(rot)),G=l.set(Ye.ExtHostDebugService,s.get(not)),j=l.set(Ye.ExtHostSearch,s.get(sot)),K=l.set(Ye.ExtHostTask,s.get(jst)),ie=l.set(Ye.ExtHostOutputService,s.get(zst)),ge=l.set(Ye.ExtHostLocalization,s.get(APe)),xe=l.set(Ye.ExtHostUrls,new YIe(l)),Re=l.set(Ye.ExtHostDocuments,new Hti(l,k)),yt=l.set(Ye.ExtHostDocumentContentProviders,new IIe(l,k,f)),Pe=l.set(Ye.ExtHostDocumentSaveParticipant,new Wti(f,Re,l.getProxy(Be.MainThreadBulkEdits))),lt=l.set(Ye.ExtHostNotebook,new NIe(l,P,k,Re,i,j,f)),xt=l.set(Ye.ExtHostNotebookDocuments,new tii(lt)),Ji=l.set(Ye.ExtHostNotebookEditors,new PIe(f,lt)),Ii=l.set(Ye.ExtHostNotebookKernels,new FIe(l,e,lt,P,f)),ns=l.set(Ye.ExtHostNotebookRenderers,new sii(l,lt)),zs=l.set(Ye.ExtHostNotebookDocumentSaveParticipant,new eii(f,lt,l.getProxy(Be.MainThreadBulkEdits))),Pn=l.set(Ye.ExtHostEditors,new vii(l,k)),Xr=l.set(Ye.ExtHostTreeViews,new wii(l.getProxy(Be.MainThreadTreeViews),P,f)),ds=l.set(Ye.ExtHostEditorInsets,new Ati(l.getProxy(Be.MainThreadEditorInsets),Pn,e.remote)),Zo=l.set(Ye.ExtHostDiagnostics,new kIe(l,f,t,k)),Zr=l.set(Ye.ExtHostLanguages,new Jti(l,Re,P.converter,c)),Di=l.set(Ye.ExtHostLanguageFeatures,new TIe(l,c,Re,P,Zo,f,m,r)),ss=l.set(Ye.ExtHostFileSystem,new rne(l,Di)),Oo=l.set(Ye.ExtHostFileSystemEventService,new Kti(l,f,k)),Tn=l.set(Ye.ExtHostQuickOpen,cii(l,o,P)),Ba=l.set(Ye.ExtHostSCM,new zIe(l,P,Re,f)),md=l.set(Ye.ExtHostQuickDiff,new HIe(l,c)),Fn=l.set(Ye.ExtHostShare,new $Ie(l,c)),Zd=l.set(Ye.ExtHostComments,Eti(l,P,Re)),pc=l.set(Ye.ExtHostProgress,new rii(l.getProxy(Be.MainThreadProgress))),Vc=l.set(Ye.ExtHostLabelService,new Qti(l)),$s=l.set(Ye.ExtHostTheming,new qIe(l)),tc=l.set(Ye.ExtHostTimeline,new bii(l,P)),gl=l.set(Ye.ExtHostWebviews,new kti(l,e.remote,o,f,m)),eh=l.set(Ye.ExtHostWebviewPanels,new IPe(l,gl,o)),dg=l.set(Ye.ExtHostCustomEditors,new Nti(l,Re,h,gl,eh)),mc=l.set(Ye.ExtHostWebviewViews,new Aii(l,gl)),zc=l.set(Ye.ExtHostTesting,s.get(sle)),th=l.set(Ye.ExtHostUriOpeners,new jIe(l)),Dc=l.set(Ye.ExtHostProfileContentHandlers,new oii(l));l.set(Ye.ExtHostInteractive,new qti(l,lt,k,P,f));const fl=l.set(Ye.ExtHostChatAgents2,new EIe(l,f,P,Re)),ic=l.set(Ye.ExtHostChatVariables,new xIe(l)),Or=l.set(Ye.ExtHostLanguageModelTools,new Yti(l)),pl=l.set(Ye.ExtHostAiRelatedInformation,new mti(l)),ih=l.set(Ye.ExtHostAiEmbeddingVector,new Vti(l)),nh=l.set(Ye.ExtHostStatusBar,new _ii(l,P.converter)),$c=l.set(Ye.ExtHostSpeech,new GIe(l)),Gc=l.set(Ye.ExtHostEmbeddings,new Uti(l)),Wa=Object.values(Ye);l.assertRegistered(Wa);const Bo=new AIe(l,k),Is=new yti(l),kc=new LIe(l,f),Rh=new Bti(l);return vti.register(P),function(be,Aa,ee){function De(O){return($,se,Ke)=>{const Bi=O(Wi=>{try{$.call(se,Wi)}catch(ta){No(new Error(`[ExtensionListenerError] Extension '${be.identifier.value}' FAILED to handle event: ${ta.toString()}`,{cause:ta})),r.onExtensionError(be.identifier,ta)}});return Ke?.push(Bi),Bi}}const gt=function(){let O=!be.isUnderDevelopment;function $(){O||(f.info(`Extension '${be.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),O=!0)}return function se(Ke){if(Array.isArray(Ke))Ke.forEach(se);else if(typeof Ke=="string")$();else{const Bi=Ke;typeof Bi.scheme>"u"&&$(),typeof Bi.exclusive=="boolean"&&Ve(be,"documentFiltersExclusive")}return Ke}}(),zn={getSession(O,$,se){return typeof se?.forceNewSession=="object"&&se.forceNewSession.learnMore&&Ve(be,"authLearnMore"),se?.account&&Ve(be,"authGetSessions"),C.getSession(be,O,$,se)},getAccounts(O){return Ve(be,"authGetSessions"),C.getAccounts(O)},async hasSession(O,$){return Ve(be,"authSession"),!!await C.getSession(be,O,$,{silent:!0})},get onDidChangeSessions(){return De(C.onDidChangeSessions)},registerAuthenticationProvider(O,$,se,Ke){return C.registerAuthenticationProvider(O,$,se,Ke)}},Cs={registerCommand(O,$,se){return P.registerCommand(!0,O,$,se,void 0,be)},registerTextEditorCommand(O,$,se){return P.registerCommand(!0,O,(...Ke)=>{const Bi=Pn.getActiveTextEditor();if(!Bi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}return Bi.edit(Wi=>{$.apply(se,[Bi,Wi,...Ke])}).then(Wi=>{Wi||f.warn("Edits from command "+O+" were not applied.")},Wi=>{f.warn("An error occurred while running command "+O,Wi)})},void 0,void 0,be)},registerDiffInformationCommand:(O,$,se)=>(Ve(be,"diffCommand"),P.registerCommand(!0,O,async(...Ke)=>{const Bi=k.activeEditor(!0);if(!Bi){f.warn("Cannot execute "+O+" because there is no active text editor.");return}const Wi=await Pn.getDiffInformation(Bi.id);$.apply(se,[Wi,...Ke])},void 0,void 0,be)),executeCommand(O,...$){return P.executeCommand(O,...$)},getCommands(O=!1){return P.getCommands(O)}},Wo={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 Is.value},get shell(){return R.getDefaultShell(!1)},get onDidChangeShell(){return De(R.onDidChangeShell)},get isTelemetryEnabled(){return r.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return De(r.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return Ve(be,"telemetry"),r.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return Ve(be,"telemetry"),De(r.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return qst(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(O,$){return Kst.validateSender(O),r.instantiateLogger(be,O,$)},openExternal(O,$){return v.openUri(O,{allowTunneling:!!e.remote.authority,allowContributedOpeners:$?.allowContributedOpeners})},async asExternalUri(O){if(O.scheme===e.environment.appUriScheme)return xe.createAppUri(O);try{return await v.asExternalUri(O,{allowTunneling:!!e.remote.authority})}catch($){if(CA(O,pe.http)||CA(O,pe.https))return O;throw $}},get remoteName(){return S6(e.remote.authority)},get remoteAuthority(){return Ve(be,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return f.getLevel()},get onDidChangeLogLevel(){return De(f.onDidChangeLogLevel)},get appQuality(){return Ve(be,"resolvers"),e.quality},get appCommit(){return Ve(be,"resolvers"),e.commit}},Ha={createTestController(O,$,se){return zc.createTestController(be,O,$,se)},createTestObserver(){return Ve(be,"testObserver"),zc.createTestObserver()},runTests(O){return Ve(be,"testObserver"),zc.runTests(O)},registerTestFollowupProvider(O){return Ve(be,"testObserver"),zc.registerTestFollowupProvider(O)},get onDidChangeTestResults(){return Ve(be,"testObserver"),De(zc.onResultsChanged)},get testResults(){return Ve(be,"testObserver"),zc.results}},ea=e.remote.isRemote?mD.Workspace:mD.UI,Mh={getExtension(O,$){ll(be,"extensionsAny")||($=!1);const se=Aa.mine.getExtensionDescription(O);if(se)return new WV(n,be.identifier,se,ea,!1);if($){const Ke=Aa.all.getExtensionDescription(O);if(Ke)return new WV(n,be.identifier,Ke,ea,!0)}},get all(){const O=[];for(const $ of Aa.mine.getAllExtensionDescriptions())O.push(new WV(n,be.identifier,$,ea,!1));return O},get allAcrossExtensionHosts(){Ve(be,"extensionsAny");const O=new y_(Aa.mine.getAllExtensionDescriptions().map(se=>se.identifier)),$=[];for(const se of Aa.all.getAllExtensionDescriptions()){const Ke=!O.has(se.identifier);$.push(new WV(n,be.identifier,se,ea,Ke))}return $},get onDidChange(){return ll(be,"extensionsAny")?De(M.any(Aa.mine.onDidChange,Aa.all.onDidChange)):De(Aa.mine.onDidChange)}},le={createDiagnosticCollection(O){return Zo.createDiagnosticCollection(be.identifier,O)},get onDidChangeDiagnostics(){return De(Zo.onDidChangeDiagnostics)},getDiagnostics:O=>Zo.getDiagnostics(O),getLanguages(){return Zr.getLanguages()},setTextDocumentLanguage(O,$){return Zr.changeLanguage(O.uri,$)},match(O,$){const se=zEe.from(O);let Ke;return mQe(se)&&(Ke=lt.notebookDocuments.find(Bi=>Bi.apiNotebook.getCells().find(Wi=>Wi.document===$))?.apiNotebook),sae(se,$.uri,$.languageId,!0,Ke?.uri,Ke?.notebookType)},registerCodeActionsProvider(O,$,se){return Di.registerCodeActionProvider(be,gt(O),$,se)},registerDocumentPasteEditProvider(O,$,se){return Ve(be,"documentPaste"),Di.registerDocumentPasteEditProvider(be,gt(O),$,se)},registerCodeLensProvider(O,$){return Di.registerCodeLensProvider(be,gt(O),$)},registerDefinitionProvider(O,$){return Di.registerDefinitionProvider(be,gt(O),$)},registerDeclarationProvider(O,$){return Di.registerDeclarationProvider(be,gt(O),$)},registerImplementationProvider(O,$){return Di.registerImplementationProvider(be,gt(O),$)},registerTypeDefinitionProvider(O,$){return Di.registerTypeDefinitionProvider(be,gt(O),$)},registerHoverProvider(O,$){return Di.registerHoverProvider(be,gt(O),$,be.identifier)},registerEvaluatableExpressionProvider(O,$){return Di.registerEvaluatableExpressionProvider(be,gt(O),$,be.identifier)},registerInlineValuesProvider(O,$){return Di.registerInlineValuesProvider(be,gt(O),$,be.identifier)},registerDocumentHighlightProvider(O,$){return Di.registerDocumentHighlightProvider(be,gt(O),$)},registerMultiDocumentHighlightProvider(O,$){return Di.registerMultiDocumentHighlightProvider(be,gt(O),$)},registerLinkedEditingRangeProvider(O,$){return Di.registerLinkedEditingRangeProvider(be,gt(O),$)},registerReferenceProvider(O,$){return Di.registerReferenceProvider(be,gt(O),$)},registerRenameProvider(O,$){return Di.registerRenameProvider(be,gt(O),$)},registerNewSymbolNamesProvider(O,$){return Ve(be,"newSymbolNamesProvider"),Di.registerNewSymbolNamesProvider(be,gt(O),$)},registerDocumentSymbolProvider(O,$,se){return Di.registerDocumentSymbolProvider(be,gt(O),$,se)},registerWorkspaceSymbolProvider(O){return Di.registerWorkspaceSymbolProvider(be,O)},registerDocumentFormattingEditProvider(O,$){return Di.registerDocumentFormattingEditProvider(be,gt(O),$)},registerDocumentRangeFormattingEditProvider(O,$){return Di.registerDocumentRangeFormattingEditProvider(be,gt(O),$)},registerOnTypeFormattingEditProvider(O,$,se,...Ke){return Di.registerOnTypeFormattingEditProvider(be,gt(O),$,[se].concat(Ke))},registerDocumentSemanticTokensProvider(O,$,se){return Di.registerDocumentSemanticTokensProvider(be,gt(O),$,se)},registerDocumentRangeSemanticTokensProvider(O,$,se){return Di.registerDocumentRangeSemanticTokensProvider(be,gt(O),$,se)},registerSignatureHelpProvider(O,$,se,...Ke){return typeof se=="object"?Di.registerSignatureHelpProvider(be,gt(O),$,se):Di.registerSignatureHelpProvider(be,gt(O),$,typeof se>"u"?[]:[se,...Ke])},registerCompletionItemProvider(O,$,...se){return Di.registerCompletionItemProvider(be,gt(O),$,se)},registerInlineCompletionItemProvider(O,$,se){return $.handleDidShowCompletionItem&&Ve(be,"inlineCompletionsAdditions"),$.handleDidPartiallyAcceptCompletionItem&&Ve(be,"inlineCompletionsAdditions"),se&&Ve(be,"inlineCompletionsAdditions"),Di.registerInlineCompletionsProvider(be,gt(O),$,se)},registerInlineEditProvider(O,$){return Ve(be,"inlineEdit"),Di.registerInlineEditProvider(be,gt(O),$)},registerDocumentLinkProvider(O,$){return Di.registerDocumentLinkProvider(be,gt(O),$)},registerColorProvider(O,$){return Di.registerColorProvider(be,gt(O),$)},registerFoldingRangeProvider(O,$){return Di.registerFoldingRangeProvider(be,gt(O),$)},registerSelectionRangeProvider(O,$){return Di.registerSelectionRangeProvider(be,O,$)},registerCallHierarchyProvider(O,$){return Di.registerCallHierarchyProvider(be,O,$)},registerTypeHierarchyProvider(O,$){return Di.registerTypeHierarchyProvider(be,O,$)},setLanguageConfiguration:(O,$)=>Di.setLanguageConfiguration(be,O,$),getTokenInformationAtPosition(O,$){return Ve(be,"tokenInformation"),Zr.tokenAtPosition(O,$)},registerInlayHintsProvider(O,$){return Di.registerInlayHintsProvider(be,O,$)},createLanguageStatusItem(O,$){return Zr.createLanguageStatusItem(be,O,$)},registerDocumentDropEditProvider(O,$,se){return Di.registerDocumentOnDropEditProvider(be,O,$,ll(be,"documentPaste")?se:void 0)}},dr={get activeTextEditor(){return Pn.getActiveTextEditor()},get visibleTextEditors(){return Pn.getVisibleTextEditors()},get activeTerminal(){return R.activeTerminal},get terminals(){return R.terminals},async showTextDocument(O,$,se){N.isUri(O)&&O.scheme===pe.vscodeRemote&&!O.authority&&m.report("workspace.showTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority.");const Ke=await(N.isUri(O)?Promise.resolve(io.openTextDocument(O)):Promise.resolve(O));return Pn.showTextDocument(Ke,$,se)},createTextEditorDecorationType(O){return Pn.createTextEditorDecorationType(be,O)},onDidChangeActiveTextEditor(O,$,se){return De(Pn.onDidChangeActiveTextEditor)(O,$,se)},onDidChangeVisibleTextEditors(O,$,se){return De(Pn.onDidChangeVisibleTextEditors)(O,$,se)},onDidChangeTextEditorSelection(O,$,se){return De(Pn.onDidChangeTextEditorSelection)(O,$,se)},onDidChangeTextEditorOptions(O,$,se){return De(Pn.onDidChangeTextEditorOptions)(O,$,se)},onDidChangeTextEditorVisibleRanges(O,$,se){return De(Pn.onDidChangeTextEditorVisibleRanges)(O,$,se)},onDidChangeTextEditorViewColumn(O,$,se){return De(Pn.onDidChangeTextEditorViewColumn)(O,$,se)},onDidCloseTerminal(O,$,se){return De(R.onDidCloseTerminal)(O,$,se)},onDidOpenTerminal(O,$,se){return De(R.onDidOpenTerminal)(O,$,se)},onDidChangeActiveTerminal(O,$,se){return De(R.onDidChangeActiveTerminal)(O,$,se)},onDidChangeTerminalDimensions(O,$,se){return Ve(be,"terminalDimensions"),De(R.onDidChangeTerminalDimensions)(O,$,se)},onDidChangeTerminalState(O,$,se){return De(R.onDidChangeTerminalState)(O,$,se)},onDidWriteTerminalData(O,$,se){return Ve(be,"terminalDataWriteEvent"),De(R.onDidWriteTerminalData)(O,$,se)},onDidExecuteTerminalCommand(O,$,se){return Ve(be,"terminalExecuteCommandEvent"),De(R.onDidExecuteTerminalCommand)(O,$,se)},onDidChangeTerminalShellIntegration(O,$,se){return Ve(be,"terminalShellIntegration"),De(z.onDidChangeTerminalShellIntegration)(O,$,se)},onDidStartTerminalShellExecution(O,$,se){return Ve(be,"terminalShellIntegration"),De(z.onDidStartTerminalShellExecution)(O,$,se)},onDidEndTerminalShellExecution(O,$,se){return Ve(be,"terminalShellIntegration"),De(z.onDidEndTerminalShellExecution)(O,$,se)},get state(){return v.getState()},onDidChangeWindowState(O,$,se){return De(v.onDidChangeWindowState)(O,$,se)},showInformationMessage(O,...$){return kc.showMessage(be,Xe.Info,O,$[0],$.slice(1))},showWarningMessage(O,...$){return kc.showMessage(be,Xe.Warning,O,$[0],$.slice(1))},showErrorMessage(O,...$){return kc.showMessage(be,Xe.Error,O,$[0],$.slice(1))},showQuickPick(O,$,se){return Tn.showQuickPick(be,O,$,se)},showWorkspaceFolderPick(O){return Tn.showWorkspaceFolderPick(O)},showInputBox(O,$){return Tn.showInput(O,$)},showOpenDialog(O){return Rh.showOpenDialog(be,O)},showSaveDialog(O){return Rh.showSaveDialog(O)},createStatusBarItem(O,$,se){let Ke,Bi,Wi;return typeof O=="string"?(Ke=O,Bi=$,Wi=se):(Bi=O,Wi=$),nh.createStatusBarEntry(be,Ke,Bi,Wi)},setStatusBarMessage(O,$){return nh.setStatusBarMessage(O,$)},withScmProgress(O){return m.report("window.withScmProgress",be,"Use 'withProgress' instead."),pc.withProgress(be,{location:fD.SourceControl},($,se)=>O({report(Ke){}}))},withProgress(O,$){return pc.withProgress(be,O,$)},createOutputChannel(O,$){return ie.createOutputChannel(O,$,be)},createWebviewPanel(O,$,se,Ke){return eh.createWebviewPanel(be,O,$,se,Ke)},createWebviewTextEditorInset(O,$,se,Ke){return Ve(be,"editorInsets"),ds.createWebviewEditorInset(O,$,se,Ke,be)},createTerminal(O,$,se){return typeof O=="object"?"pty"in O?R.createExtensionTerminal(O):R.createTerminalFromOptions(O):R.createTerminal(O,$,se)},registerTerminalLinkProvider(O){return R.registerLinkProvider(O)},registerTerminalProfileProvider(O,$){return R.registerProfileProvider(be,O,$)},registerTerminalQuickFixProvider(O,$){return Ve(be,"terminalQuickFixProvider"),R.registerTerminalQuickFixProvider(O,be.identifier.value,$)},registerTreeDataProvider(O,$){return Xr.registerTreeDataProvider(O,$,be)},createTreeView(O,$){return Xr.createTreeView(O,$,be)},registerWebviewPanelSerializer:(O,$)=>eh.registerWebviewPanelSerializer(be,O,$),registerCustomEditorProvider:(O,$,se={})=>dg.registerCustomEditorProvider(be,O,$,se),registerFileDecorationProvider(O){return L.registerFileDecorationProvider(O,be)},registerUriHandler(O){return xe.registerUriHandler(be,O)},createQuickPick(){return Tn.createQuickPick(be)},createInputBox(){return Tn.createInputBox(be)},get activeColorTheme(){return $s.activeColorTheme},onDidChangeActiveColorTheme(O,$,se){return De($s.onDidChangeActiveColorTheme)(O,$,se)},registerWebviewViewProvider(O,$,se){return mc.registerWebviewViewProvider(be,O,$,se?.webviewOptions)},get activeNotebookEditor(){return lt.activeNotebookEditor},onDidChangeActiveNotebookEditor(O,$,se){return De(lt.onDidChangeActiveNotebookEditor)(O,$,se)},get visibleNotebookEditors(){return lt.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return De(lt.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(O,$,se){return De(Ji.onDidChangeNotebookEditorSelection)(O,$,se)},onDidChangeNotebookEditorVisibleRanges(O,$,se){return De(Ji.onDidChangeNotebookEditorVisibleRanges)(O,$,se)},showNotebookDocument(O,$){return lt.showNotebookDocument(O,$)},registerExternalUriOpener(O,$,se){return Ve(be,"externalUriOpener"),th.registerExternalUriOpener(be.identifier,O,$,se)},registerProfileContentHandler(O,$){return Ve(be,"profileContentHandlers"),Dc.registerProfileContentHandler(be,O,$)},registerQuickDiffProvider(O,$,se,Ke){return Ve(be,"quickDiffProvider"),md.registerQuickDiffProvider(gt(O),$,se,Ke)},get tabGroups(){return w.tabGroups},registerShareProvider(O,$){return Ve(be,"shareProvider"),Fn.registerShareProvider(gt(O),$)}},io={get rootPath(){return m.report("workspace.rootPath",be,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),o.getPath()},set rootPath(O){throw new w1("rootPath")},getWorkspaceFolder(O){return o.getWorkspaceFolder(O)},get workspaceFolders(){return o.getWorkspaceFolders()},get name(){return o.name},set name(O){throw new w1("name")},get workspaceFile(){return o.workspaceFile},set workspaceFile(O){throw new w1("workspaceFile")},updateWorkspaceFolders:(O,$,...se)=>o.updateWorkspaceFolders(be,O,$||0,...se),onDidChangeWorkspaceFolders:function(O,$,se){return De(o.onDidChangeWorkspace)(O,$,se)},asRelativePath:(O,$)=>o.getRelativePath(O,$),findFiles:(O,$,se,Ke)=>o.findFiles(O,$,se,be.identifier,Ke),findFiles2:(O,$,se)=>(Ve(be,"findFiles2"),o.findFiles2(O,$,be.identifier,se)),findFiles2New:(O,$,se)=>{Ve(be,"findFiles2New");const Ke={exclude:$?.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Iw.filesExclude||$?.useExcludeSettings===Iw.searchAndFilesExclude,useDefaultSearchExcludes:!$?.useExcludeSettings||$?.useExcludeSettings===Iw.searchAndFilesExclude,maxResults:$?.maxResults,useIgnoreFiles:$?.useIgnoreFiles?.local,useGlobalIgnoreFiles:$?.useIgnoreFiles?.global,useParentIgnoreFiles:$?.useIgnoreFiles?.parent,followSymlinks:$?.followSymlinks};return o.findFiles2(O&&O.length>0?O[0]:void 0,Ke,be.identifier,se)},findTextInFiles:(O,$,se,Ke)=>{Ve(be,"findTextInFiles");let Bi,Wi;return typeof $=="object"?(Bi=$,Wi=se):(Bi={},Wi=$,Ke=se),o.findTextInFiles(O,Bi||{},Wi,be.identifier,Ke)},findTextInFilesNew:(O,$,se)=>{Ve(be,"findTextInFilesNew"),Ve(be,"textSearchProviderNew");let Ke={};$&&(Ke={include:$.include&&$.include.length>0?$.include[0]:void 0,exclude:$.exclude&&$.exclude.length>0?$.exclude[0]:void 0,useDefaultExcludes:$.useExcludeSettings===void 0||$.useExcludeSettings===Iw.filesExclude||$.useExcludeSettings===Iw.searchAndFilesExclude,useSearchExclude:$.useExcludeSettings===void 0||$.useExcludeSettings===Iw.searchAndFilesExclude,maxResults:$.maxResults,useIgnoreFiles:$.useIgnoreFiles?.local,useGlobalIgnoreFiles:$.useIgnoreFiles?.global,useParentIgnoreFiles:$.useIgnoreFiles?.parent,followSymlinks:$.followSymlinks,encoding:$.encoding,previewOptions:$.previewOptions?{matchLines:$.previewOptions?.matchLines??100,charsPerLine:$.previewOptions?.charsPerLine??1e4}:void 0,beforeContext:$.surroundingContext,afterContext:$.surroundingContext});const Bi=Promise.resolve(void 0);return{results:new Kd(async ta=>{const Nl=async hg=>(ta.emitOne(j8t(hg)),hg);await Bi.then(hg=>o.findTextInFiles(O,Ke,Nl,be.identifier,se))}),complete:Bi.then(ta=>({limitHit:ta?.limitHit??!1}))}},save:O=>o.save(O),saveAs:O=>o.saveAs(O),saveAll:O=>o.saveAll(O),applyEdit(O,$){return Bo.applyWorkspaceEdit(O,be,$)},createFileSystemWatcher:(O,$,se,Ke)=>{let Bi;return typeof $=="boolean"?Bi={ignoreCreateEvents:!!$,ignoreChangeEvents:!!se,ignoreDeleteEvents:!!Ke,correlate:!1}:$&&(Ve(be,"createFileSystemWatcher"),Bi={...$,correlate:!0}),Oo.createFileSystemWatcher(o,be,O,Bi)},get textDocuments(){return Re.getAllDocumentData().map(O=>O.document)},set textDocuments(O){throw new w1("textDocuments")},openTextDocument(O){let $;const se=O;if(typeof O=="string")$=Promise.resolve(N.file(O));else if(N.isUri(O))$=Promise.resolve(O);else if(!se||typeof se=="object")$=Re.createDocumentData(se);else throw new Error("illegal argument - uriOrFileNameOrOptions");return $.then(Ke=>(Ke.scheme===pe.vscodeRemote&&!Ke.authority&&m.report("workspace.openTextDocument",be,"A URI of 'vscode-remote' scheme requires an authority."),Re.ensureDocumentData(Ke).then(Bi=>Bi.document)))},onDidOpenTextDocument:(O,$,se)=>De(Re.onDidAddDocument)(O,$,se),onDidCloseTextDocument:(O,$,se)=>De(Re.onDidRemoveDocument)(O,$,se),onDidChangeTextDocument:(O,$,se)=>De(Re.onDidChangeDocument)(O,$,se),onDidSaveTextDocument:(O,$,se)=>De(Re.onDidSaveDocument)(O,$,se),onWillSaveTextDocument:(O,$,se)=>De(Pe.getOnWillSaveTextDocumentEvent(be))(O,$,se),get notebookDocuments(){return lt.notebookDocuments.map(O=>O.apiNotebook)},async openNotebookDocument(O,$){let se;if(N.isUri(O))se=O,await lt.openNotebookDocument(O);else if(typeof O=="string")se=N.revive(await lt.createNotebookDocument({viewType:O,content:$}));else throw new Error("Invalid arguments");return lt.getNotebookDocument(se).apiNotebook},onDidSaveNotebookDocument(O,$,se){return De(xt.onDidSaveNotebookDocument)(O,$,se)},onDidChangeNotebookDocument(O,$,se){return De(xt.onDidChangeNotebookDocument)(O,$,se)},onWillSaveNotebookDocument(O,$,se){return De(zs.getOnWillSaveNotebookDocumentEvent(be))(O,$,se)},get onDidOpenNotebookDocument(){return De(lt.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return De(lt.onDidCloseNotebookDocument)},registerNotebookSerializer(O,$,se,Ke){return lt.registerNotebookSerializer(be,O,$,se,ll(be,"notebookLiveShare")?Ke:void 0)},onDidChangeConfiguration:(O,$,se)=>De(ee.onDidChangeConfiguration)(O,$,se),getConfiguration(O,$){return $=arguments.length===1?void 0:$,ee.getConfiguration(O,$,be)},registerTextDocumentContentProvider(O,$){return yt.registerTextDocumentContentProvider(O,$)},registerTaskProvider:(O,$)=>(m.report("window.registerTaskProvider",be,"Use the corresponding function on the 'tasks' namespace instead"),K.registerTaskProvider(be,O,$)),registerFileSystemProvider(O,$,se){return jr(ss.registerFileSystemProvider(be,O,$,se),i.addFileSystemProvider(O,$,se))},get fs(){return i.value},registerFileSearchProvider:(O,$)=>(Ve(be,"fileSearchProvider"),j.registerFileSearchProvider(O,$)),registerTextSearchProvider:(O,$)=>(Ve(be,"textSearchProvider"),j.registerTextSearchProvider(O,$)),registerAITextSearchProvider:(O,$)=>(Ve(be,"aiTextSearchProvider"),Ve(be,"textSearchProvider"),j.registerAITextSearchProvider(O,$)),registerFileSearchProviderNew:(O,$)=>(Ve(be,"fileSearchProviderNew"),{dispose:()=>{}}),registerTextSearchProviderNew:(O,$)=>(Ve(be,"textSearchProviderNew"),{dispose:()=>{}}),registerAITextSearchProviderNew:(O,$)=>(Ve(be,"aiTextSearchProviderNew"),Ve(be,"textSearchProviderNew"),{dispose:()=>{}}),registerRemoteAuthorityResolver:(O,$)=>(Ve(be,"resolvers"),n.registerRemoteAuthorityResolver(O,$)),registerResourceLabelFormatter:O=>(Ve(be,"resolvers"),Vc.$registerResourceLabelFormatter(O)),getRemoteExecServer:O=>(Ve(be,"resolvers"),n.getRemoteExecServer(O)),onDidCreateFiles:(O,$,se)=>De(Oo.onDidCreateFile)(O,$,se),onDidDeleteFiles:(O,$,se)=>De(Oo.onDidDeleteFile)(O,$,se),onDidRenameFiles:(O,$,se)=>De(Oo.onDidRenameFile)(O,$,se),onWillCreateFiles:(O,$,se)=>De(Oo.getOnWillCreateFileEvent(be))(O,$,se),onWillDeleteFiles:(O,$,se)=>De(Oo.getOnWillDeleteFileEvent(be))(O,$,se),onWillRenameFiles:(O,$,se)=>De(Oo.getOnWillRenameFileEvent(be))(O,$,se),openTunnel:O=>(Ve(be,"tunnels"),p.openTunnel(be,O).then($=>{if(!$)throw new Error("cannot open tunnel");return $})),get tunnels(){return Ve(be,"tunnels"),p.getTunnels()},onDidChangeTunnels:(O,$,se)=>(Ve(be,"tunnels"),De(p.onDidChangeTunnels)(O,$,se)),registerPortAttributesProvider:(O,$)=>(Ve(be,"portsAttributes"),p.registerPortsAttributesProvider(O,$)),registerTunnelProvider:(O,$)=>(Ve(be,"tunnelFactory"),p.registerTunnelProvider(O,$)),registerTimelineProvider:(O,$)=>(Ve(be,"timeline"),tc.registerTimelineProvider(O,$,be.identifier,P.converter)),get isTrusted(){return o.trusted},requestWorkspaceTrust:O=>(Ve(be,"workspaceTrust"),o.requestWorkspaceTrust(O)),onDidGrantWorkspaceTrust:(O,$,se)=>De(o.onDidGrantWorkspaceTrust)(O,$,se),registerEditSessionIdentityProvider:(O,$)=>(Ve(be,"editSessionIdentityProvider"),o.registerEditSessionIdentityProvider(O,$)),onWillCreateEditSessionIdentity:(O,$,se)=>(Ve(be,"editSessionIdentityProvider"),De(o.getOnWillCreateEditSessionIdentityEvent(be))(O,$,se)),registerCanonicalUriProvider:(O,$)=>(Ve(be,"canonicalUriProvider"),o.registerCanonicalUriProvider(O,$)),getCanonicalUri:(O,$,se)=>(Ve(be,"canonicalUriProvider"),o.provideCanonicalUri(O,$,se))},un={get inputBox(){return m.report("scm.inputBox",be,"Use 'SourceControl.inputBox' instead"),Ba.getLastInputBox(be)},createSourceControl(O,$,se){return Ba.createSourceControl(be,O,$,se)}},Se={createCommentController(O,$){return Zd.createCommentController(be,O,$)}},rt={get activeDebugSession(){return G.activeDebugSession},get activeDebugConsole(){return G.activeDebugConsole},get breakpoints(){return G.breakpoints},get activeStackItem(){return G.activeStackItem},registerDebugVisualizationProvider(O,$){return Ve(be,"debugVisualization"),G.registerDebugVisualizationProvider(be,O,$)},registerDebugVisualizationTreeProvider(O,$){return Ve(be,"debugVisualization"),G.registerDebugVisualizationTree(be,O,$)},onDidStartDebugSession(O,$,se){return De(G.onDidStartDebugSession)(O,$,se)},onDidTerminateDebugSession(O,$,se){return De(G.onDidTerminateDebugSession)(O,$,se)},onDidChangeActiveDebugSession(O,$,se){return De(G.onDidChangeActiveDebugSession)(O,$,se)},onDidReceiveDebugSessionCustomEvent(O,$,se){return De(G.onDidReceiveDebugSessionCustomEvent)(O,$,se)},onDidChangeBreakpoints(O,$,se){return De(G.onDidChangeBreakpoints)(O,$,se)},onDidChangeActiveStackItem(O,$,se){return De(G.onDidChangeActiveStackItem)(O,$,se)},registerDebugConfigurationProvider(O,$,se){return G.registerDebugConfigurationProvider(O,$,se||y9.Initial)},registerDebugAdapterDescriptorFactory(O,$){return G.registerDebugAdapterDescriptorFactory(be,O,$)},registerDebugAdapterTrackerFactory(O,$){return G.registerDebugAdapterTrackerFactory(O,$)},startDebugging(O,$,se){return!se||typeof se=="object"&&"configuration"in se?G.startDebugging(O,$,{parentSession:se}):G.startDebugging(O,$,se||{})},stopDebugging(O){return G.stopDebugging(O)},addBreakpoints(O){return G.addBreakpoints(O)},removeBreakpoints(O){return G.removeBreakpoints(O)},asDebugSourceUri(O,$){return G.asDebugSourceUri(O,$)}},Ft={registerTaskProvider:(O,$)=>K.registerTaskProvider(be,O,$),fetchTasks:O=>K.fetchTasks(O),executeTask:O=>K.executeTask(be,O),get taskExecutions(){return K.taskExecutions},onDidStartTask:(O,$,se)=>De(K.onDidStartTask)(O,$,se),onDidEndTask:(O,$,se)=>De(K.onDidEndTask)(O,$,se),onDidStartTaskProcess:(O,$,se)=>De(K.onDidStartTaskProcess)(O,$,se),onDidEndTaskProcess:(O,$,se)=>De(K.onDidEndTaskProcess)(O,$,se)},Ci={createNotebookController(O,$,se,Ke,Bi){return Ii.createNotebookController(be,O,$,se,Ke,ll(be,"notebookMessaging")?Bi:void 0)},registerNotebookCellStatusBarItemProvider:(O,$)=>lt.registerNotebookCellStatusBarItemProvider(be,O,$),createRendererMessaging(O){return ns.createRendererMessaging(be,O)},createNotebookControllerDetectionTask(O){return Ve(be,"notebookKernelSource"),Ii.createNotebookControllerDetectionTask(be,O)},registerKernelSourceActionProvider(O,$){return Ve(be,"notebookKernelSource"),Ii.registerKernelSourceActionProvider(be,O,$)},onDidChangeNotebookCellExecutionState(O,$,se){return Ve(be,"notebookCellExecutionState"),De(Ii.onDidChangeNotebookCellExecutionState)(O,$,se)}},Ot={t(...O){if(typeof O[0]=="string"){const $=O.shift(),se=!O||typeof O[0]!="object"?O:O[0];return ge.getMessage(be.identifier.value,{message:$,args:se})}return ge.getMessage(be.identifier.value,O[0])},get bundle(){return ge.getBundle(be.identifier.value)},get uri(){return ge.getBundleUri(be.identifier.value)}},q={_version:1,transferActiveChat(O){return Ve(be,"interactive"),fl.transferActiveChat(O)}},de={getRelatedInformation(O,$){return Ve(be,"aiRelatedInformation"),pl.getRelatedInformation(be,O,$)},registerRelatedInformationProvider(O,$){return Ve(be,"aiRelatedInformation"),pl.registerRelatedInformationProvider(be,O,$)},registerEmbeddingVectorProvider(O,$){return Ve(be,"aiRelatedInformation"),ih.registerEmbeddingVectorProvider(be,O,$)}},T={_version:1,registerChatResponseProvider(O,$,se){return Ve(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)},registerChatVariableResolver(O,$,se,Ke,Bi,Wi,ta,Nl){return Ve(be,"chatVariableResolver"),ic.registerVariableResolver(be,O,$,se,Ke,Bi,Wi,ta,Nl?.id)},registerMappedEditsProvider(O,$){return Ve(be,"mappedEditsProvider"),Di.registerMappedEditsProvider(be,O,$)},createChatParticipant(O,$){return fl.createChatAgent(be,O,$)},createDynamicChatParticipant(O,$,se){return Ve(be,"chatParticipantPrivate"),fl.createDynamicChatAgent(be,O,$,se)}},ne={selectChatModels:O=>A.selectLanguageModels(be,O??{}),onDidChangeChatModels:(O,$,se)=>A.onDidChangeProviders(O,$,se),registerChatModelProvider:(O,$,se)=>(Ve(be,"chatProvider"),A.registerLanguageModel(be,O,$,se)),get embeddingModels(){return Ve(be,"embeddings"),Gc.embeddingsModels},onDidChangeEmbeddingModels:(O,$,se)=>(Ve(be,"embeddings"),Gc.onDidChange(O,$,se)),registerEmbeddingsProvider(O,$){return Ve(be,"embeddings"),Gc.registerEmbeddingsProvider(be,O,$)},async computeEmbeddings(O,$,se){return Ve(be,"embeddings"),Gc.computeEmbeddings(O,$,se)},registerTool(O,$){return Ve(be,"lmTools"),Or.registerTool(be,O,$)},invokeTool(O,$,se){return Ve(be,"lmTools"),Or.invokeTool(O,$,se)},get tools(){return Ve(be,"lmTools"),Or.tools}},ye={registerSpeechProvider(O,$){return Ve(be,"speech"),$c.registerProvider(be.identifier,O,$)}};return{version:e.version,ai:de,authentication:zn,commands:Cs,comments:Se,chat:T,debug:rt,env:Wo,extensions:Mh,interactive:q,l10n:Ot,languages:le,lm:ne,notebooks:Ci,scm:un,speech:ye,tasks:Ft,tests:Ha,window:dr,workspace:io,Breakpoint:iN,TerminalOutputAnchor:Ree,ChatResultFeedbackKind:vH,ChatVariableLevel:dte,ChatCompletionItem:unt,CallHierarchyIncomingCall:INe,CallHierarchyItem:Lce,CallHierarchyOutgoingCall:TNe,CancellationError:Ma,CancellationTokenSource:ci,CandidatePortSource:KT,CodeAction:L9,CodeActionKind:Sa,CodeActionTriggerKind:ZW,CodeLens:R9,Color:eN,ColorInformation:B9,ColorPresentation:W9,ColorThemeKind:pS,CommentMode:Zee,CommentState:ete,CommentThreadCollapsibleState:dH,CommentThreadState:hH,CommentThreadApplicability:uH,CommentThreadFocus:gH,CompletionItem:P9,CompletionItemKind:Zi,CompletionItemTag:tH,CompletionList:JM,CompletionTriggerKind:BT,ConfigurationTarget:HT,CustomExecution:Rce,DebugAdapterExecutable:$9,DebugAdapterInlineImplementation:K9,DebugAdapterNamedPipeServer:G9,DebugAdapterServer:aH,DebugConfigurationProviderTriggerKind:y9,DebugConsoleMode:J9,DebugVisualization:int,DecorationRangeBehavior:Ox,Diagnostic:x9,DiagnosticRelatedInformation:QW,DiagnosticSeverity:Fd,DiagnosticTag:Px,Disposable:Qs,DocumentHighlight:I9,DocumentHighlightKind:jW,MultiDocumentHighlight:T9,DocumentLink:O9,DocumentSymbol:XW,EndOfLine:A_,EnvironmentVariableMutatorType:FT,EvaluatableExpression:q9,InlineValueText:Q9,InlineValueVariableLookup:j9,InlineValueEvaluatableExpression:Y9,InlineCompletionTriggerKind:cH,EventEmitter:I,ExtensionKind:mD,ExtensionMode:$T,ExternalUriOpenerPriority:ate,FileChangeType:VT,FileDecoration:X9,FileDecoration2:X9,FileSystemError:Yc,FileType:sn,FilePermission:rp,FoldingRange:Xee,FoldingRangeKind:Bw,FunctionBreakpoint:Wx,InlineCompletionItem:Wee,InlineCompletionList:Hee,Hover:D9,VerboseHover:k9,HoverVerbosityAction:Mee,IndentAction:yr,Location:vp,MarkdownString:af,OverviewRulerLane:Dl,ParameterInformation:Nee,PortAutoForwardAction:cte,Position:bs,ProcessExecution:tN,ProgressLocation:fD,QuickInputButtonLocation:ite,QuickInputButtons:fH,Range:Jn,RelativePattern:UT,Selection:oC,SelectionRange:eH,SemanticTokens:nN,SemanticTokensBuilder:ent,SemanticTokensEdit:MNe,SemanticTokensEdits:iz,SemanticTokensLegend:tte,ShellExecution:cI,ShellQuoting:Kee,SignatureHelp:Fee,SignatureHelpTriggerKind:Oee,SignatureInformation:Pee,SnippetString:aI,SourceBreakpoint:Bx,StandardTokenType:TS,StatusBarAlignment:IS,SymbolInformation:JW,SymbolKind:_r,SymbolTag:YW,Task:H9,TaskGroup:sH,TaskPanelKind:Gee,TaskRevealKind:$ee,TaskScope:lI,TerminalLink:Kit,TerminalQuickFixTerminalCommand:Qit,TerminalQuickFixOpener:qit,TerminalLocation:zee,TerminalProfile:jit,TerminalExitReason:Vee,TerminalShellExecutionCommandLineConfidence:gD,TextDocumentSaveReason:WT,TextEdit:HA,SnippetTextEdit:Tce,TextEditorCursorStyle:qr,TextEditorLineNumbersStyle:i_,TextEditorRevealType:F9,TextEditorSelectionChangeKind:XM,SyntaxTokenType:ZM,TextDocumentChangeReason:nH,ThemeColor:rH,ThemeIcon:hu,TreeItem:U9,TreeItemCheckboxState:ab,TreeItemCollapsibleState:pD,TypeHierarchyItem:Mce,UIKind:X_,Uri:N,ViewColumn:iH,WorkspaceEdit:rI,DocumentPasteTriggerKind:jee,DocumentDropEdit:Qee,DocumentDropOrPasteEditKind:z9,DocumentPasteEdit:Jit,InlayHint:N9,InlayHintLabelPart:M9,InlayHintKind:Bee,RemoteAuthorityResolverError:J0,ResolvedAuthority:Git,ManagedResolvedAuthority:tz,SourceControlInputBoxValidationType:Uee,ExtensionRuntime:n$,TimelineItem:ote,NotebookRange:wy,NotebookCellKind:Hx,NotebookCellExecutionState:sN,NotebookCellData:iG,NotebookData:NNe,NotebookRendererScript:FNe,NotebookCellStatusBarAlignment:e$,NotebookEditorRevealType:t$,NotebookCellOutput:Z9,NotebookCellOutputItem:PNe,NotebookCellStatusBarItem:nnt,NotebookControllerAffinity:ste,NotebookControllerAffinity2:i$,NotebookEdit:E9,NotebookKernelSourceAction:snt,NotebookVariablesRequestKind:mH,PortAttributes:rnt,LinkedEditingRanges:ont,TestResultState:rte,TestRunRequest:s$,TestMessage:oN,TestMessage2:oN,TestMessageStackFrame:ant,TestTag:_H,TestRunProfileKind:GT,TextSearchCompleteMessageType:vee,DataTransfer:oH,DataTransferItem:V9,TestCoverageCount:nz,FileCoverage:rN,FileCoverage2:rN,StatementCoverage:lnt,BranchCoverage:dnt,DeclarationCoverage:hnt,WorkspaceTrustState:qAe,LanguageStatusSeverity:OT,QuickPickItemKind:pH,InputBoxValidationSeverity:zT,TabInputText:Nce,TabInputTextDiff:o$,TabInputTextMerge:ONe,TabInputCustom:Pce,TabInputNotebook:Fce,TabInputNotebookDiff:Oce,TabInputWebview:BNe,TabInputTerminal:WNe,TabInputInteractiveWindow:HNe,TabInputChat:UNe,TabInputTextMultiDiff:VNe,TelemetryTrustedValue:Pae,LogLevel:Gn,EditSessionIdentityMatch:mte,InteractiveSessionVoteDirection:QAe,ChatCopyKind:lte,InteractiveEditorResponseFeedbackKind:jAe,DebugStackFrame:LNe,DebugThread:RNe,RelatedInformationType:ute,SpeechToTextStatus:gte,TextToSpeechStatus:fte,PartialAcceptTriggerKind:Fx,KeywordRecognitionStatus:pte,ChatResponseMarkdownPart:nG,ChatResponseFileTreePart:sG,ChatResponseAnchorPart:oG,ChatResponseProgressPart:yH,ChatResponseProgressPart2:zNe,ChatResponseReferencePart:Eb,ChatResponseReferencePart2:Eb,ChatResponseCodeCitationPart:a$,ChatResponseWarningPart:CH,ChatResponseTextEditPart:SH,ChatResponseMarkdownWithVulnerabilitiesPart:bH,ChatResponseCommandButtonPart:rG,ChatResponseDetectedParticipantPart:wH,ChatResponseConfirmationPart:r$,ChatResponseReferencePartStatusKind:hte,ChatRequestTurn:$Ne,ChatResponseTurn:GNe,ChatLocation:n_,ChatRequestEditorData:KNe,ChatRequestNotebookData:qNe,LanguageModelChatMessageRole:zp,LanguageModelChatMessage:QNe,LanguageModelChatMessageFunctionResultPart:c$,LanguageModelChatResponseTextPart:AH,LanguageModelChatResponseFunctionUsePart:Bce,LanguageModelError:Tw,NewSymbolName:Zit,NewSymbolNameTag:Jee,NewSymbolNameTriggerKind:lH,InlineEdit:gnt,InlineEditTriggerKind:EH,ExcludeSettingOptions:Iw,TextSearchContextNew:DNe,TextSearchMatchNew:xNe,TextSearchCompleteMessageTypeNew:bee}}}var gj;let JIe=class{constructor(e,t,i,n,o,r,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=n,this._extHostExtensionService=o,this._initData=r,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),cs("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();cs("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new xii(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(XIe)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(ZIe,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))}};JIe=D([_(2,we),_(3,sE),_(4,DI),_(5,mu),_(6,Ge)],JIe);var aM;let XIe=(aM=class{constructor(e){if(e.environment.appRoot&&gj.aliased.size){const t=Th(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",n=`@${i}+\\/${i}+|${i}+`,o="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${o}\\/)(${n})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,n,o]=t,r=gj.aliased.get(n);if(r!==void 0)return console.warn(`${n} as been renamed to ${r}, please update your imports`),i+r+o}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},gj=aM,aM.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),aM);XIe=gj=D([_(0,mu)],XIe);class xii{constructor(e,t,i,n,o){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=n,this._logService=o,this.nodeModuleName="vscode",this._extApiImpl=new va}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let n=this._extApiImpl.get(i.identifier);return n||(n=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,n)),n}if(!this._defaultApiImpl){let n="";this._extensionPaths.forEach((o,r)=>n+=` ${r} -> ${o.identifier.value} `),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings: -${n}`),this._defaultApiImpl=this._apiFactory(mXe,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let o0e=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(Be.MainThreadTelemetry);const n=i.getProxy(Be.MainThreadWindow);this._impl=(o,r)=>{const a=N.parse(o);return r?this.callOriginal(o,r):a.scheme==="http"||a.scheme==="https"?n.$openUri(a,o,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?n.$openUri(a,o,{}):this.callOriginal(o,r)}}load(e,t,i){const n=this._extensionPaths.findSubstr(t);return n&&(this._extensionId=n.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})}};o0e=D([_(2,Jo)],o0e);let r0e=class{constructor(e,t){this._mainThreadConsole=e.getProxy(Be.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,n=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>function(){i._handleConsoleCall(e,t,n,arguments)}})}_handleConsoleCall(e,t,i,n){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:Wii(n,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,n)}};r0e=D([_(0,Jo),_(1,_u)],r0e);const Bii=1e5;function Wii(s,e){const t=[];if(s.length)for(let i=0;i"u")n="undefined";else if(n instanceof Error){const o=n;o.stack?n=o.stack:n=o.toString()}t.push(n)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(` +${n}`),this._defaultApiImpl=this._apiFactory(cXe,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let ZIe=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(Be.MainThreadTelemetry);const n=i.getProxy(Be.MainThreadWindow);this._impl=(o,r)=>{const a=N.parse(o);return r?this.callOriginal(o,r):a.scheme==="http"||a.scheme==="https"?n.$openUri(a,o,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?n.$openUri(a,o,{}):this.callOriginal(o,r)}}load(e,t,i){const n=this._extensionPaths.findSubstr(t);return n&&(this._extensionId=n.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})}};ZIe=D([_(2,Jo)],ZIe);let e0e=class{constructor(e,t){this._mainThreadConsole=e.getProxy(Be.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,n=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>function(){i._handleConsoleCall(e,t,n,arguments)}})}_handleConsoleCall(e,t,i,n){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:kii(n,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,n)}};e0e=D([_(0,Jo),_(1,mu)],e0e);const Dii=1e5;function kii(s,e){const t=[];if(s.length)for(let i=0;i"u")n="undefined";else if(n instanceof Error){const o=n;o.stack?n=o.stack:n=o.toString()}t.push(n)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(` `).slice(3).join(` -`)})}try{const i=Kge(t);return i.length>Bii?"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 a0e=class extends r0e{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};a0e=D([_(0,Jo),_(1,_u)],a0e);class Hii extends n0e{_installInterceptor(){}getModule(e,t){for(const i of this._alternatives){const n=i(e);if(n){e=n;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw new Error("CANNOT LOAD MODULE from here.")})}}class Uii extends _Ie{constructor(){super(...arguments),this.extensionRuntime=r$.Webworker}async _beforeAlmostReadyToRunExtensions(){c8&&this._instaService.createInstance(a0e),this._apiFactory=this._instaService.invokeFunction(Fii),this._fakeModules=this._instaService.createInstance(Hii,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:Vii(t.path,".js")});const n=e?.identifier.value;n&&performance.mark(`code/extHost/willFetchExtensionCode/${n}`);const o=N.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),r=await fetch(o.toString(!0));if(n&&performance.mark(`code/extHost/didFetchExtensionCode/${n}`),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(n?`Loading code for extension ${n} 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(),n&&performance.mark(`code/extHost/willLoadExtensionCode/${n}`),d(u,h,f),u.exports!==h?u.exports:h}finally{n&&performance.mark(`code/extHost/didLoadExtensionCode/${n}`),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 n;return i!=null&&this._productService.commit!=null&&!xk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,xk.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??(Wn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:ql,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:VRe(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:n,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:Wn?tv.Web:tv.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};c0e=D([_(3,Yi),_(4,yi),_(5,Fs),_(6,Ge),_(7,uf),_(8,hv),_(9,Er),_(10,Em)],c0e);async function Kii(s){return(await vot.p)(s)}tYt(c0e);_4t(async s=>{s.get(fs),Cnt(await Kii())});let bot=null;const l0e=new wit(!1);function qii(){return new Promise((s,e)=>{try{M8t("slintpad",l0e),LYt({...TZt(),...BZt((t,i,n)=>Promise.resolve(bot.open_model_ref(t))),...dei(),...pei(),...mei(),...yei()},void 0,{workspaceProvider:{trusted:!0,workspace:{folderUri:Yv.parse("slintpad:///")},open:t=>Promise.resolve(!1)}}).then(()=>{Gx.register({id:"slint",extensions:[".slint"],aliases:["Slint","slint"],mimetypes:["application/slint"]}),Gx.setLanguageConfiguration("slint",{comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],autoCloseBefore:";:.,=}])>` \n ",surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"`",close:"`"},{open:"/**",close:" */"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}},wordPattern:new RegExp("(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"),indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}}),Gx.onLanguage("slint",()=>{Gx.setMonarchTokensProvider("slint",SXt)}),s()})}catch(t){e(t)}})}const Qii=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; +`)})}try{const i=Hge(t);return i.length>Dii?"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 t0e=class extends e0e{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};t0e=D([_(0,Jo),_(1,mu)],t0e);class Iii extends JIe{_installInterceptor(){}getModule(e,t){for(const i of this._alternatives){const n=i(e);if(n){e=n;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw new Error("CANNOT LOAD MODULE from here.")})}}class Tii extends hIe{constructor(){super(...arguments),this.extensionRuntime=n$.Webworker}async _beforeAlmostReadyToRunExtensions(){o8&&this._instaService.createInstance(t0e),this._apiFactory=this._instaService.invokeFunction(Eii),this._fakeModules=this._instaService.createInstance(Iii,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:Lii(t.path,".js")});const n=e?.identifier.value;n&&performance.mark(`code/extHost/willFetchExtensionCode/${n}`);const o=N.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),r=await fetch(o.toString(!0));if(n&&performance.mark(`code/extHost/didFetchExtensionCode/${n}`),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(n?`Loading code for extension ${n} 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(),n&&performance.mark(`code/extHost/willLoadExtensionCode/${n}`),d(u,h,f),u.exports!==h?u.exports:h}finally{n&&performance.mark(`code/extHost/didLoadExtensionCode/${n}`),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 n;return i!=null&&this._productService.commit!=null&&!yk.isDefaultVariant()&&(n=N.joinPath(N.parse(i),this._productService.commit,this._productService.version,yk.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??(Wn?"web":"desktop"),appUriScheme:this._productService.urlProtocol,appLanguage:Kl,extensionTelemetryLogResource:this._environmentService.extHostTelemetryLogFile,isExtensionTelemetryLoggingOnly:TRe(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:n,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:Wn?X_.Web:X_.Desktop}}getInspectPort(){}enableInspectPort(){return Promise.resolve(!1)}dispose(){}};i0e=D([_(3,Yi),_(4,yi),_(5,Fs),_(6,Ge),_(7,lf),_(8,cv),_(9,Er),_(10,Cm)],i0e);async function Pii(s){return(await dot.p)(s)}$jt(i0e);r4t(async s=>{s.get(fs),fnt(await Pii())});let hot=null;const n0e=new uit(!1);function Fii(){return new Promise((s,e)=>{try{C8t("slintpad",n0e),wYt({...bZt(),...DZt((t,i,n)=>Promise.resolve(hot.open_model_ref(t))),...ZZt(),...sei(),...oei(),...dei()},void 0,{workspaceProvider:{trusted:!0,workspace:{folderUri:qv.parse("slintpad:///")},open:t=>Promise.resolve(!1)}}).then(()=>{Vx.register({id:"slint",extensions:[".slint"],aliases:["Slint","slint"],mimetypes:["application/slint"]}),Vx.setLanguageConfiguration("slint",{comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],autoCloseBefore:";:.,=}])>` \n ",surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"`",close:"`"},{open:"/**",close:" */"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}},wordPattern:new RegExp("(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"),indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}}),Vx.onLanguage("slint",()=>{Vx.setMonarchTokensProvider("slint",uXt)}),s()})}catch(t){e(t)}})}const Oii=`import { AboutSlint, Button, VerticalBox } from "std-widgets.slint"; export component Demo { VerticalBox { @@ -1053,14 +1053,14 @@ export component Demo { HorizontalLayout { alignment: center; Button { text: "OK!"; } } } } -`;function EP(s){return console.assert(s.startsWith("/")),Yv.from({scheme:"slintpad",path:s})}function dle(s){return s.scheme==="slintpad"}function VPe(s){return console.assert(dle(s)),s.path}var k7;class jii{constructor(e){Wt(this,k7);Ct(this,k7,e),console.assert(Object.keys(e).length>0),Object.keys(e).forEach(t=>console.assert(t.startsWith("/")))}from_internal(e){if(!dle(e))return e;const t=VPe(e),i=Ce(this,k7)[t]||null;return i?Yv.parse(i)??Yv.parse("file:///broken_url"):e}}k7=new WeakMap;var u2;class Yii{constructor(e){Wt(this,u2);Ct(this,u2,e)}from_internal(e){return dle(e)?Yv.from({scheme:Ce(this,u2).scheme,authority:Ce(this,u2).authority,path:VPe(e)}):e}}u2=new WeakMap;self.MonacoEnvironment={getWorker(s,e){return new Worker(new URL(""+new URL("monaco_worker-CFgjIjpz.js",import.meta.url).href,import.meta.url),{type:"module"})}};function Jii(s){try{const e=s?.path??"";return e.substring(e.lastIndexOf("/")+1)}catch{return s?.toString()??""}}var _x;const uFe=class uFe extends nt{constructor(t){const i=uFe.createNode();super({node:i});Wt(this,_x);this.id=t.object.textEditorModel?.uri.toString()??"",Ct(this,_x,pN.create(this.contentNode,{model:t.object.textEditorModel})),this.setFlag(nt.Flag.DisallowLayout),this.addClass("content"),this.addClass("editor"),this.title.label=Jii(t.object.textEditorModel?.uri),this.title.closable=!1,this.title.caption="Slint Code Editor"}static createNode(){const t=document.createElement("div"),i=document.createElement("div");return t.appendChild(i),t}get editor(){return Ce(this,_x)}dispose(){Ce(this,_x).dispose(),this.dispose()}get contentNode(){return this.node.getElementsByTagName("div")[0]}resize_editor(){if(Ce(this,_x)!=null){const t=this.contentNode.offsetWidth-2,i=this.contentNode.offsetHeight-2;Ce(this,_x).layout({width:t,height:i})}}onResize(t){this.isAttached&&this.resize_editor()}};_x=new WeakMap;let d0e=uFe;var cT,nS,sS,I7,T7,vx,g2;class Xii extends nt{constructor(t){super({});Wt(this,cT);Wt(this,nS,new Map);Wt(this,sS,null);Wt(this,I7,null);Wt(this,T7);Wt(this,vx,null);Wt(this,g2,{});Ct(this,T7,0),this.title.label="Editor",this.title.closable=!1,this.title.caption="Slint code editor",Ct(this,cT,new Zg({spacing:0})),super.layout=Ce(this,cT),Ct(this,I7,t.language_client),bot=this,t.file_reader=i=>this.handle_lsp_url_request(i),this.clear_editors(),this.open_default_content().then(i=>{Ce(this,I7)?.sendRequest("workspace/executeCommand",{command:"slint/showPreview",arguments:[i?.toString()??"",""]})})}async open_default_content(){const t=new URLSearchParams(window.location.search),i=t.get("snippet"),n=t.get("load_url"),o=t.get("load_demo");return i?(this.clear_editors(),Promise.resolve(this.open_file_with_content(EP("/main.slint"),i))):n?this.project_from_url(n):this.set_demo(o??"")}clear_editors(){Ct(this,T7,Ce(this,T7)+1),Ct(this,vx,null),Ce(this,sS)!==null&&Ce(this,cT).removeWidget(Ce(this,sS)),Ct(this,sS,new GXt({addButtonEnabled:!1})),Ce(this,cT).addWidget(Ce(this,sS)),Ce(this,nS).clear(),Ct(this,g2,{})}open_hello_world(){this.clear_editors();const t=EP("/main.slint");return this.open_file_with_content(t,Qii),t}open_file_with_content(t,i){l0e.registerFile(new T8t(t,i)),pN.createModelReference(t).then(n=>this.open_model_ref(n))}open_model_ref(t){const i=new d0e(t);return Ce(this,nS).set(t.object.textEditorModel?.uri??EP("unknown.slint"),i),Ce(this,sS).addWidget(i),i.editor}async map_url(t){const i=new URL(t),n=Yv.parse(i.toString()),o=Ce(this,vx)?.from_internal(n)??n,r=o.toString();if(dle(o)){const a=VPe(o);Ce(this,g2)[a]=r}return r}get current_editor_pane(){const t=Yv.parse(this.current_text_document_uri??"")??EP("broken.slint");return Ce(this,nS).get(t)??Ce(this,nS).entries().next().value[1]}get current_editor(){return this.current_editor_pane.editor}get current_editor_content(){return this.current_editor.getModel()?.getValue()??""}get current_text_document_uri(){return Ce(this,sS).currentWidget?.id}async project_from_url(t){return t==null?null:(this.clear_editors(),Promise.resolve((await this.open_tab_from_url(Yv.parse(t)))[0]))}async open_tab_from_url(t){const[i,n,o]=await RXt(t.toString()),r=Yv.parse(i??t.toString());return Ct(this,vx,o??new Yii(r)),this.safely_open_editor_with_url_content(r,EP(n??r.path),!0)}known_demos(){return[["","Hello World!"],["examples/gallery/gallery.slint","Gallery"],["examples/printerdemo/ui/printerdemo.slint","Printer Demo"],["examples/energy-monitor/ui/desktop_window.slint","Energy Monitor"],["examples/todo/ui/todo.slint","Todo Demo"],["examples/iot-dashboard/main.slint","IOT Dashboard"]]}add_empty_file_to_project(t){let i=t;i.startsWith("/")||(i="/"+i);const n=EP(i);return pN.getModel(n)?!1:(this.open_file_with_content(n,""),!0)}async set_demo(t){if(t){const i="XXXX_DEFAULT_TAG_XXXX";let n=i.startsWith("XXXX_DEFAULT_TAG_")?"master":i;{let o;(o=window.location.pathname.match(/releases\/([^/]*)\/editor/))&&(n="v"+o[1])}return this.project_from_url(`https://raw.githubusercontent.com/slint-ui/slint/${n}/${t}`)}else return Promise.resolve(this.open_hello_world())}get open_document_urls(){return new Array(...Ce(this,nS)).map((t,i)=>t.toString())}document_contents(t){const i=Yv.parse(t);return i===void 0?void 0:Ce(this,nS).get(i)?.editor.getModel()?.getValue()}get extra_files(){return Ce(this,g2)}async handle_lsp_url_request(t){if(Ce(this,vx)===null)return Promise.resolve("Error: Can not resolve URL.");const i=Yv.parse(t),n=Ce(this,vx).from_internal(i);return n===null?Promise.resolve("Error: Can not map URL."):(await this.safely_open_editor_with_url_content(n,i,!1))[1]}async safely_open_editor_with_url_content(t,i,n){try{const r=await l0e.readFile(i);return[i,new TextDecoder().decode(r)??""]}catch{}let o="";try{const r=await fetch(t.toString());if(!r.ok)return n&&alert("Failed to download data from "+t+`: -`+r.status+" "+r.statusText),[null,""];o=await r.text()}catch{return n&&alert("Failed to download data from "+t+"."),[null,""]}return this.open_file_with_content(i,o),[i,o]}}cT=new WeakMap,nS=new WeakMap,sS=new WeakMap,I7=new WeakMap,T7=new WeakMap,vx=new WeakMap,g2=new WeakMap;var oS,L7;class Zii{constructor(e,t){Wt(this,oS);Wt(this,L7);Ct(this,oS,e),Ct(this,L7,t),this.onError=Ce(this,oS).onError,this.onClose=Ce(this,oS).onClose,this.onPartialMessage=Ce(this,oS).onPartialMessage}dispose(){Ce(this,oS).dispose()}listen(e){return Ce(this,oS).listen(t=>{Ce(this,L7).call(this,t)||e(t)})}}oS=new WeakMap,L7=new WeakMap;var rd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function WEi(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function wot(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var n=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return s[i]}})}),t}var h0e={},u0e={},ps={},JN={},zPe={},dne={},ln={},Yl={};Object.defineProperty(Yl,"__esModule",{value:!0});Yl.stringArray=Yl.array=Yl.func=Yl.error=Yl.number=Yl.string=Yl.boolean=void 0;function eni(s){return s===!0||s===!1}Yl.boolean=eni;function yot(s){return typeof s=="string"||s instanceof String}Yl.string=yot;function tni(s){return typeof s=="number"||s instanceof Number}Yl.number=tni;function ini(s){return s instanceof Error}Yl.error=ini;function nni(s){return typeof s=="function"}Yl.func=nni;function Cot(s){return Array.isArray(s)}Yl.array=Cot;function sni(s){return Cot(s)&&s.every(e=>yot(e))}Yl.stringArray=sni;Object.defineProperty(ln,"__esModule",{value:!0});ln.Message=ln.NotificationType9=ln.NotificationType8=ln.NotificationType7=ln.NotificationType6=ln.NotificationType5=ln.NotificationType4=ln.NotificationType3=ln.NotificationType2=ln.NotificationType1=ln.NotificationType0=ln.NotificationType=ln.RequestType9=ln.RequestType8=ln.RequestType7=ln.RequestType6=ln.RequestType5=ln.RequestType4=ln.RequestType3=ln.RequestType2=ln.RequestType1=ln.RequestType=ln.RequestType0=ln.AbstractMessageSignature=ln.ParameterStructures=ln.ResponseError=ln.ErrorCodes=void 0;const T0=Yl;var g0e;(function(s){s.ParseError=-32700,s.InvalidRequest=-32600,s.MethodNotFound=-32601,s.InvalidParams=-32602,s.InternalError=-32603,s.jsonrpcReservedErrorRangeStart=-32099,s.serverErrorStart=-32099,s.MessageWriteError=-32099,s.MessageReadError=-32098,s.PendingResponseRejected=-32097,s.ConnectionInactive=-32096,s.ServerNotInitialized=-32002,s.UnknownErrorCode=-32001,s.jsonrpcReservedErrorRangeEnd=-32e3,s.serverErrorEnd=-32e3})(g0e||(ln.ErrorCodes=g0e={}));class $Pe extends Error{constructor(e,t,i){super(t),this.code=T0.number(e)?e:g0e.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,$Pe.prototype)}toJson(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}}ln.ResponseError=$Pe;class Ju{constructor(e){this.kind=e}static is(e){return e===Ju.auto||e===Ju.byName||e===Ju.byPosition}toString(){return this.kind}}ln.ParameterStructures=Ju;Ju.auto=new Ju("auto");Ju.byPosition=new Ju("byPosition");Ju.byName=new Ju("byName");class Vc{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Ju.auto}}ln.AbstractMessageSignature=Vc;class oni extends Vc{constructor(e){super(e,0)}}ln.RequestType0=oni;class rni extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.RequestType=rni;class ani extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.RequestType1=ani;class cni extends Vc{constructor(e){super(e,2)}}ln.RequestType2=cni;class lni extends Vc{constructor(e){super(e,3)}}ln.RequestType3=lni;class dni extends Vc{constructor(e){super(e,4)}}ln.RequestType4=dni;class hni extends Vc{constructor(e){super(e,5)}}ln.RequestType5=hni;class uni extends Vc{constructor(e){super(e,6)}}ln.RequestType6=uni;class gni extends Vc{constructor(e){super(e,7)}}ln.RequestType7=gni;class fni extends Vc{constructor(e){super(e,8)}}ln.RequestType8=fni;class pni extends Vc{constructor(e){super(e,9)}}ln.RequestType9=pni;class mni extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.NotificationType=mni;class _ni extends Vc{constructor(e){super(e,0)}}ln.NotificationType0=_ni;class vni extends Vc{constructor(e,t=Ju.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}}ln.NotificationType1=vni;class bni extends Vc{constructor(e){super(e,2)}}ln.NotificationType2=bni;class wni extends Vc{constructor(e){super(e,3)}}ln.NotificationType3=wni;class yni extends Vc{constructor(e){super(e,4)}}ln.NotificationType4=yni;class Cni extends Vc{constructor(e){super(e,5)}}ln.NotificationType5=Cni;class Sni extends Vc{constructor(e){super(e,6)}}ln.NotificationType6=Sni;class Ani extends Vc{constructor(e){super(e,7)}}ln.NotificationType7=Ani;class Eni extends Vc{constructor(e){super(e,8)}}ln.NotificationType8=Eni;class xni extends Vc{constructor(e){super(e,9)}}ln.NotificationType9=xni;var r$e;(function(s){function e(n){const o=n;return o&&T0.string(o.method)&&(T0.string(o.id)||T0.number(o.id))}s.isRequest=e;function t(n){const o=n;return o&&T0.string(o.method)&&n.id===void 0}s.isNotification=t;function i(n){const o=n;return o&&(o.result!==void 0||!!o.error)&&(T0.string(o.id)||T0.number(o.id)||o.id===null)}s.isResponse=i})(r$e||(ln.Message=r$e={}));var vA={},a$e;Object.defineProperty(vA,"__esModule",{value:!0});vA.LRUCache=vA.LinkedMap=vA.Touch=void 0;var xu;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(xu||(vA.Touch=xu={}));class Sot{constructor(){this[a$e]="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,t=xu.None){const i=this._map.get(e);if(i)return t!==xu.None&&this.touch(i,t),i.value}set(e,t,i=xu.None){let n=this._map.get(e);if(n)n.value=t,i!==xu.None&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case xu.None:this.addItemLast(n);break;case xu.First:this.addItemFirst(n);break;case xu.Last:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.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,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:t.key,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return i}values(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:t.value,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return i}entries(){const e=this._state;let t=this._head;const i={[Symbol.iterator]:()=>i,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:[t.key,t.value],done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return i}[(a$e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.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 t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==xu.First&&t!==xu.Last)){if(t===xu.First){if(e===this._head)return;const i=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===xu.Last){if(e===this._tail)return;const i=e.next,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}vA.LinkedMap=Sot;class Dni extends Sot{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),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,t=xu.AsNew){return super.get(e,t)}peek(e){return super.get(e,xu.None)}set(e,t){return super.set(e,t,xu.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}vA.LRUCache=Dni;var hle={};Object.defineProperty(hle,"__esModule",{value:!0});hle.Disposable=void 0;var c$e;(function(s){function e(t){return{dispose:t}}s.create=e})(c$e||(hle.Disposable=c$e={}));var dC={},aE={};Object.defineProperty(aE,"__esModule",{value:!0});let f0e;function p0e(){if(f0e===void 0)throw new Error("No runtime abstraction layer installed");return f0e}(function(s){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");f0e=t}s.install=e})(p0e||(p0e={}));aE.default=p0e;Object.defineProperty(dC,"__esModule",{value:!0});dC.Emitter=dC.Event=void 0;const kni=aE;var l$e;(function(s){const e={dispose(){}};s.None=function(){return e}})(l$e||(dC.Event=l$e={}));class Ini{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let i=!1;for(let n=0,o=this._callbacks.length;n{this._callbacks||(this._callbacks=new Ini),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const n={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),n.dispose=ule._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(n),n}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}dC.Emitter=ule;ule._noop=function(){};var vI={};Object.defineProperty(vI,"__esModule",{value:!0});vI.CancellationTokenSource=vI.CancellationToken=void 0;const Tni=aE,Lni=Yl,m0e=dC;var hne;(function(s){s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:m0e.Event.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:m0e.Event.None});function e(t){const i=t;return i&&(i===s.None||i===s.Cancelled||Lni.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}s.is=e})(hne||(vI.CancellationToken=hne={}));const Rni=Object.freeze(function(s,e){const t=(0,Tni.default)().timer.setTimeout(s.bind(e),0);return{dispose(){t.dispose()}}});class d$e{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?Rni:(this._emitter||(this._emitter=new m0e.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class Mni{get token(){return this._token||(this._token=new d$e),this._token}cancel(){this._token?this._token.cancel():this._token=hne.Cancelled}dispose(){this._token?this._token instanceof d$e&&this._token.dispose():this._token=hne.None}}vI.CancellationTokenSource=Mni;var jH={};Object.defineProperty(jH,"__esModule",{value:!0});jH.SharedArrayReceiverStrategy=jH.SharedArraySenderStrategy=void 0;const Nni=vI;var n7;(function(s){s.Continue=0,s.Cancelled=1})(n7||(n7={}));class Pni{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;const t=new SharedArrayBuffer(4),i=new Int32Array(t,0,1);i[0]=n7.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){const i=this.buffers.get(t);if(i===void 0)return;const n=new Int32Array(i,0,1);Atomics.store(n,0,n7.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}}jH.SharedArraySenderStrategy=Pni;class Fni{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n7.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class Oni{constructor(e){this.token=new Fni(e)}cancel(){}dispose(){}}class Bni{constructor(){this.kind="request"}createCancellationTokenSource(e){const t=e.$cancellationData;return t===void 0?new Nni.CancellationTokenSource:new Oni(t)}}jH.SharedArrayReceiverStrategy=Bni;var ED={},pG={};Object.defineProperty(pG,"__esModule",{value:!0});pG.Semaphore=void 0;const Wni=aE;let Hni=class{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,Wni.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 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()}}};pG.Semaphore=Hni;Object.defineProperty(ED,"__esModule",{value:!0});ED.ReadableStreamMessageReader=ED.AbstractMessageReader=ED.MessageReader=void 0;const _0e=aE,YP=Yl,age=dC,Uni=pG;var h$e;(function(s){function e(t){let i=t;return i&&YP.func(i.listen)&&YP.func(i.dispose)&&YP.func(i.onError)&&YP.func(i.onClose)&&YP.func(i.onPartialMessage)}s.is=e})(h$e||(ED.MessageReader=h$e={}));class Aot{constructor(){this.errorEmitter=new age.Emitter,this.closeEmitter=new age.Emitter,this.partialMessageEmitter=new age.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: ${YP.string(e.message)?e.message:"unknown"}`)}}ED.AbstractMessageReader=Aot;var v0e;(function(s){function e(t){let i,n;const o=new Map;let r;const a=new Map;if(t===void 0||typeof t=="string")i=t??"utf-8";else{if(i=t.charset??"utf-8",t.contentDecoder!==void 0&&(n=t.contentDecoder,o.set(n.name,n)),t.contentDecoders!==void 0)for(const c of t.contentDecoders)o.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(r=t.contentTypeDecoder,a.set(r.name,r)),t.contentTypeDecoders!==void 0)for(const c of t.contentTypeDecoders)a.set(c.name,c)}return r===void 0&&(r=(0,_0e.default)().applicationJson.decoder,a.set(r.name,r)),{charset:i,contentDecoder:n,contentDecoders:o,contentTypeDecoder:r,contentTypeDecoders:a}}s.fromOptions=e})(v0e||(v0e={}));class Vni extends Aot{constructor(e,t){super(),this.readable=e,this.options=v0e.fromOptions(t),this.buffer=(0,_0e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Uni.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 t=this.readable.onData(i=>{this.onData(i)});return this.readable.onError(i=>this.fireError(i)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){const i=this.buffer.tryReadHeaders(!0);if(!i)return;const n=i.get("content-length");if(!n){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(i))}`));return}const o=parseInt(n);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${n}`));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,n=await this.options.contentTypeDecoder.decode(i,this.options);this.callback(n)}).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,_0e.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))}}ED.ReadableStreamMessageReader=Vni;var xD={};Object.defineProperty(xD,"__esModule",{value:!0});xD.WriteableStreamMessageWriter=xD.AbstractMessageWriter=xD.MessageWriter=void 0;const u$e=aE,zV=Yl,zni=pG,g$e=dC,$ni="Content-Length: ",f$e=`\r -`;var p$e;(function(s){function e(t){let i=t;return i&&zV.func(i.dispose)&&zV.func(i.onClose)&&zV.func(i.onError)&&zV.func(i.write)}s.is=e})(p$e||(xD.MessageWriter=p$e={}));class Eot{constructor(){this.errorEmitter=new g$e.Emitter,this.closeEmitter=new g$e.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: ${zV.string(e.message)?e.message:"unknown"}`)}}xD.AbstractMessageWriter=Eot;var b0e;(function(s){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,u$e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,u$e.default)().applicationJson.encoder}}s.fromOptions=e})(b0e||(b0e={}));class Gni extends Eot{constructor(e,t){super(),this.writable=e,this.options=b0e.fromOptions(t),this.errorCount=0,this.writeSemaphore=new zni.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 n=[];return n.push($ni,i.byteLength.toString(),f$e),n.push(f$e),this.doWrite(e,n,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(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}xD.WriteableStreamMessageWriter=Gni;var gle={};Object.defineProperty(gle,"__esModule",{value:!0});gle.AbstractMessageBuffer=void 0;const Kni=13,qni=10,Qni=`\r -`;class jni{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,n=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,n=0;for(;e>0;){const o=this._chunks[n];if(o.byteLength>e){const r=o.slice(0,e);t.set(r,i),i+=e,this._chunks[n]=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}}gle.AbstractMessageBuffer=jni;var xot={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.createMessageConnection=s.ConnectionOptions=s.MessageStrategy=s.CancellationStrategy=s.CancellationSenderStrategy=s.CancellationReceiverStrategy=s.RequestCancellationReceiverStrategy=s.IdCancellationReceiverStrategy=s.ConnectionStrategy=s.ConnectionError=s.ConnectionErrors=s.LogTraceNotification=s.SetTraceNotification=s.TraceFormat=s.TraceValues=s.Trace=s.NullLogger=s.ProgressType=s.ProgressToken=void 0;const e=aE,t=Yl,i=ln,n=vA,o=dC,r=vI;var a;(function(j){j.type=new i.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(j){function ne(ge){return typeof ge=="string"||typeof ge=="number"}j.is=ne})(c||(s.ProgressToken=c={}));var l;(function(j){j.type=new i.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}s.ProgressType=d;var h;(function(j){function ne(ge){return t.func(ge)}j.is=ne})(h||(h={})),s.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||(s.Trace=u={}));var f;(function(j){j.Off="off",j.Messages="messages",j.Compact="compact",j.Verbose="verbose"})(f||(s.TraceValues=f={})),function(j){function ne(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=ne;function ge(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=ge}(u||(s.Trace=u={}));var p;(function(j){j.Text="text",j.JSON="json"})(p||(s.TraceFormat=p={})),function(j){function ne(ge){return t.string(ge)?(ge=ge.toLowerCase(),ge==="json"?j.JSON:j.Text):j.Text}j.fromString=ne}(p||(s.TraceFormat=p={}));var m;(function(j){j.type=new i.NotificationType("$/setTrace")})(m||(s.SetTraceNotification=m={}));var v;(function(j){j.type=new i.NotificationType("$/logTrace")})(v||(s.LogTraceNotification=v={}));var b;(function(j){j[j.Closed=1]="Closed",j[j.Disposed=2]="Disposed",j[j.AlreadyListening=3]="AlreadyListening"})(b||(s.ConnectionErrors=b={}));class w extends Error{constructor(ne,ge){super(ge),this.code=ne,Object.setPrototypeOf(this,w.prototype)}}s.ConnectionError=w;var y;(function(j){function ne(ge){const De=ge;return De&&t.func(De.cancelUndispatched)}j.is=ne})(y||(s.ConnectionStrategy=y={}));var C;(function(j){function ne(ge){const De=ge;return De&&(De.kind===void 0||De.kind==="id")&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=ne})(C||(s.IdCancellationReceiverStrategy=C={}));var A;(function(j){function ne(ge){const De=ge;return De&&De.kind==="request"&&t.func(De.createCancellationTokenSource)&&(De.dispose===void 0||t.func(De.dispose))}j.is=ne})(A||(s.RequestCancellationReceiverStrategy=A={}));var L;(function(j){j.Message=Object.freeze({createCancellationTokenSource(ge){return new r.CancellationTokenSource}});function ne(ge){return C.is(ge)||A.is(ge)}j.is=ne})(L||(s.CancellationReceiverStrategy=L={}));var k;(function(j){j.Message=Object.freeze({sendCancellation(ge,De){return ge.sendNotification(a.type,{id:De})},cleanup(ge){}});function ne(ge){const De=ge;return De&&t.func(De.sendCancellation)&&t.func(De.cleanup)}j.is=ne})(k||(s.CancellationSenderStrategy=k={}));var P;(function(j){j.Message=Object.freeze({receiver:L.Message,sender:k.Message});function ne(ge){const De=ge;return De&&L.is(De.receiver)&&k.is(De.sender)}j.is=ne})(P||(s.CancellationStrategy=P={}));var R;(function(j){function ne(ge){const De=ge;return De&&t.func(De.handleMessage)}j.is=ne})(R||(s.MessageStrategy=R={}));var z;(function(j){function ne(ge){const De=ge;return De&&(P.is(De.cancellationStrategy)||y.is(De.connectionStrategy)||R.is(De.messageStrategy))}j.is=ne})(z||(s.ConnectionOptions=z={}));var G;(function(j){j[j.New=1]="New",j[j.Listening=2]="Listening",j[j.Closed=3]="Closed",j[j.Disposed=4]="Disposed"})(G||(G={}));function Y(j,ne,ge,De){const Oe=ge!==void 0?ge:s.NullLogger;let yt=0,Ne=0,lt=0;const xt="2.0";let Ji;const Ii=new Map;let ns;const zs=new Map,Pn=new Map;let Xr,ds=new n.LinkedMap,Zo=new Map,Zr=new Set,Di=new Map,ss=u.Off,Oo=p.Text,Tn,Ba=G.New;const vd=new o.Emitter,Fn=new o.Emitter,th=new o.Emitter,pc=new o.Emitter,zc=new o.Emitter,$s=De&&De.cancellationStrategy?De.cancellationStrategy:P.Message;function tc(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}function fl(Se){return Se===null?"res-unknown-"+(++lt).toString():"res-"+Se.toString()}function ih(){return"not-"+(++Ne).toString()}function gg(Se,rt){i.Message.isRequest(rt)?Se.set(tc(rt.id),rt):i.Message.isResponse(rt)?Se.set(fl(rt.id),rt):Se.set(ih(),rt)}function mc(Se){}function $c(){return Ba===G.Listening}function nh(){return Ba===G.Closed}function Dc(){return Ba===G.Disposed}function pl(){(Ba===G.New||Ba===G.Listening)&&(Ba=G.Closed,Fn.fire(void 0))}function ic(Se){vd.fire([Se,void 0,void 0])}function Or(Se){vd.fire(Se)}j.onClose(pl),j.onError(ic),ne.onClose(pl),ne.onError(Or);function ml(){Xr||ds.size===0||(Xr=(0,e.default)().timer.setImmediate(()=>{Xr=void 0,oh()}))}function sh(Se){i.Message.isRequest(Se)?Kc(Se):i.Message.isNotification(Se)?Bo(Se):i.Message.isResponse(Se)?Wa(Se):Is(Se)}function oh(){if(ds.size===0)return;const Se=ds.shift();try{const rt=De?.messageStrategy;R.is(rt)?rt.handleMessage(Se,sh):sh(Se)}finally{ml()}}const Gc=Se=>{try{if(i.Message.isNotification(Se)&&Se.method===a.type.method){const rt=Se.params.id,Ft=tc(rt),Ci=ds.get(Ft);if(i.Message.isRequest(Ci)){const K=De?.connectionStrategy,de=K&&K.cancelUndispatched?K.cancelUndispatched(Ci,mc):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){ds.delete(Ft),Di.delete(rt),de.id=Ci.id,Aa(de,Se.method,Date.now()),ne.write(de).catch(()=>Oe.error("Sending response for canceled message failed."));return}}const Ot=Di.get(rt);if(Ot!==void 0){Ot.cancel(),xe(Se);return}else Zr.add(rt)}gg(ds,Se)}finally{ml()}};function Kc(Se){if(Dc())return;function rt(ie,ye,O){const $={jsonrpc:xt,id:Se.id};ie instanceof i.ResponseError?$.error=ie.toJson():$.result=ie===void 0?null:ie,Aa($,ye,O),ne.write($).catch(()=>Oe.error("Sending response failed."))}function Ft(ie,ye,O){const $={jsonrpc:xt,id:Se.id,error:ie.toJson()};Aa($,ye,O),ne.write($).catch(()=>Oe.error("Sending response failed."))}function Ci(ie,ye,O){ie===void 0&&(ie=null);const $={jsonrpc:xt,id:Se.id,result:ie};Aa($,ye,O),ne.write($).catch(()=>Oe.error("Sending response failed."))}ee(Se);const Ot=Ii.get(Se.method);let K,de;Ot&&(K=Ot.type,de=Ot.handler);const T=Date.now();if(de||Ji){const ie=Se.id??String(Date.now()),ye=C.is($s.receiver)?$s.receiver.createCancellationTokenSource(ie):$s.receiver.createCancellationTokenSource(Se);Se.id!==null&&Zr.has(Se.id)&&ye.cancel(),Se.id!==null&&Di.set(ie,ye);try{let O;if(de)if(Se.params===void 0){if(K!==void 0&&K.numberOfParams!==0){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${K.numberOfParams} params but received none.`),Se.method,T);return}O=de(ye.token)}else if(Array.isArray(Se.params)){if(K!==void 0&&K.parameterStructures===i.ParameterStructures.byName){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,T);return}O=de(...Se.params,ye.token)}else{if(K!==void 0&&K.parameterStructures===i.ParameterStructures.byPosition){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,T);return}O=de(Se.params,ye.token)}else Ji&&(O=Ji(Se.method,Se.params,ye.token));const $=O;O?$.then?$.then(se=>{Di.delete(ie),rt(se,Se.method,T)},se=>{Di.delete(ie),se instanceof i.ResponseError?Ft(se,Se.method,T):se&&t.string(se.message)?Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${se.message}`),Se.method,T):Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}):(Di.delete(ie),rt(O,Se.method,T)):(Di.delete(ie),Ci(O,Se.method,T))}catch(O){Di.delete(ie),O instanceof i.ResponseError?rt(O,Se.method,T):O&&t.string(O.message)?Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${O.message}`),Se.method,T):Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}}else Ft(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,T)}function Wa(Se){if(!Dc())if(Se.id===null)Se.error?Oe.error(`Received response message without id: Error is: -${JSON.stringify(Se.error,void 0,4)}`):Oe.error("Received response message without id. No further error information provided.");else{const rt=Se.id,Ft=Zo.get(rt);if(gt(Se,Ft),Ft!==void 0){Zo.delete(rt);try{if(Se.error){const Ci=Se.error;Ft.reject(new i.ResponseError(Ci.code,Ci.message,Ci.data))}else if(Se.result!==void 0)Ft.resolve(Se.result);else throw new Error("Should never happen.")}catch(Ci){Ci.message?Oe.error(`Response handler '${Ft.method}' failed with message: ${Ci.message}`):Oe.error(`Response handler '${Ft.method}' failed unexpectedly.`)}}}}function Bo(Se){if(Dc())return;let rt,Ft;if(Se.method===a.type.method){const Ci=Se.params.id;Zr.delete(Ci),xe(Se);return}else{const Ci=zs.get(Se.method);Ci&&(Ft=Ci.handler,rt=Ci.type)}if(Ft||ns)try{if(xe(Se),Ft)if(Se.params===void 0)rt!==void 0&&rt.numberOfParams!==0&&rt.parameterStructures!==i.ParameterStructures.byName&&Oe.error(`Notification ${Se.method} defines ${rt.numberOfParams} params but received none.`),Ft();else if(Array.isArray(Se.params)){const Ci=Se.params;Se.method===l.type.method&&Ci.length===2&&c.is(Ci[0])?Ft({token:Ci[0],value:Ci[1]}):(rt!==void 0&&(rt.parameterStructures===i.ParameterStructures.byName&&Oe.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),rt.numberOfParams!==Se.params.length&&Oe.error(`Notification ${Se.method} defines ${rt.numberOfParams} params but received ${Ci.length} arguments`)),Ft(...Ci))}else rt!==void 0&&rt.parameterStructures===i.ParameterStructures.byPosition&&Oe.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),Ft(Se.params);else ns&&ns(Se.method,Se.params)}catch(Ci){Ci.message?Oe.error(`Notification handler '${Se.method}' failed with message: ${Ci.message}`):Oe.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else th.fire(Se)}function Is(Se){if(!Se){Oe.error("Received empty message.");return}Oe.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(Se,null,4)}`);const rt=Se;if(t.string(rt.id)||t.number(rt.id)){const Ft=rt.id,Ci=Zo.get(Ft);Ci&&Ci.reject(new Error("The received response has neither a result nor an error property."))}}function kc(Se){if(Se!=null)switch(ss){case u.Verbose:return JSON.stringify(Se,null,4);case u.Compact:return JSON.stringify(Se);default:return}}function Nh(Se){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&Se.params&&(rt=`Params: ${kc(Se.params)} +`;function CP(s){return console.assert(s.startsWith("/")),qv.from({scheme:"slintpad",path:s})}function rle(s){return s.scheme==="slintpad"}function TPe(s){return console.assert(rle(s)),s.path}var A7;class Bii{constructor(e){Wt(this,A7);Ct(this,A7,e),console.assert(Object.keys(e).length>0),Object.keys(e).forEach(t=>console.assert(t.startsWith("/")))}from_internal(e){if(!rle(e))return e;const t=TPe(e),i=Ce(this,A7)[t]||null;return i?qv.parse(i)??qv.parse("file:///broken_url"):e}}A7=new WeakMap;var c2;class Wii{constructor(e){Wt(this,c2);Ct(this,c2,e)}from_internal(e){return rle(e)?qv.from({scheme:Ce(this,c2).scheme,authority:Ce(this,c2).authority,path:TPe(e)}):e}}c2=new WeakMap;self.MonacoEnvironment={getWorker(s,e){return new Worker(new URL(""+new URL("monaco_worker-CFgjIjpz.js",import.meta.url).href,import.meta.url),{type:"module"})}};function Hii(s){try{const e=s?.path??"";return e.substring(e.lastIndexOf("/")+1)}catch{return s?.toString()??""}}var fx;const eFe=class eFe extends nt{constructor(t){const i=eFe.createNode();super({node:i});Wt(this,fx);this.id=t.object.textEditorModel?.uri.toString()??"",Ct(this,fx,hN.create(this.contentNode,{model:t.object.textEditorModel})),this.setFlag(nt.Flag.DisallowLayout),this.addClass("content"),this.addClass("editor"),this.title.label=Hii(t.object.textEditorModel?.uri),this.title.closable=!1,this.title.caption="Slint Code Editor"}static createNode(){const t=document.createElement("div"),i=document.createElement("div");return t.appendChild(i),t}get editor(){return Ce(this,fx)}dispose(){Ce(this,fx).dispose(),this.dispose()}get contentNode(){return this.node.getElementsByTagName("div")[0]}resize_editor(){if(Ce(this,fx)!=null){const t=this.contentNode.offsetWidth-2,i=this.contentNode.offsetHeight-2;Ce(this,fx).layout({width:t,height:i})}}onResize(t){this.isAttached&&this.resize_editor()}};fx=new WeakMap;let s0e=eFe;var sT,iS,nS,E7,x7,px,l2;class Uii extends nt{constructor(t){super({});Wt(this,sT);Wt(this,iS,new Map);Wt(this,nS,null);Wt(this,E7,null);Wt(this,x7);Wt(this,px,null);Wt(this,l2,{});Ct(this,x7,0),this.title.label="Editor",this.title.closable=!1,this.title.caption="Slint code editor",Ct(this,sT,new Yg({spacing:0})),super.layout=Ce(this,sT),Ct(this,E7,t.language_client),hot=this,t.file_reader=i=>this.handle_lsp_url_request(i),this.clear_editors(),this.open_default_content().then(i=>{Ce(this,E7)?.sendRequest("workspace/executeCommand",{command:"slint/showPreview",arguments:[i?.toString()??"",""]})})}async open_default_content(){const t=new URLSearchParams(window.location.search),i=t.get("snippet"),n=t.get("load_url"),o=t.get("load_demo");return i?(this.clear_editors(),Promise.resolve(this.open_file_with_content(CP("/main.slint"),i))):n?this.project_from_url(n):this.set_demo(o??"")}clear_editors(){Ct(this,x7,Ce(this,x7)+1),Ct(this,px,null),Ce(this,nS)!==null&&Ce(this,sT).removeWidget(Ce(this,nS)),Ct(this,nS,new NXt({addButtonEnabled:!1})),Ce(this,sT).addWidget(Ce(this,nS)),Ce(this,iS).clear(),Ct(this,l2,{})}open_hello_world(){this.clear_editors();const t=CP("/main.slint");return this.open_file_with_content(t,Oii),t}open_file_with_content(t,i){n0e.registerFile(new b8t(t,i)),hN.createModelReference(t).then(n=>this.open_model_ref(n))}open_model_ref(t){const i=new s0e(t);return Ce(this,iS).set(t.object.textEditorModel?.uri??CP("unknown.slint"),i),Ce(this,nS).addWidget(i),i.editor}async map_url(t){const i=new URL(t),n=qv.parse(i.toString()),o=Ce(this,px)?.from_internal(n)??n,r=o.toString();if(rle(o)){const a=TPe(o);Ce(this,l2)[a]=r}return r}get current_editor_pane(){const t=qv.parse(this.current_text_document_uri??"")??CP("broken.slint");return Ce(this,iS).get(t)??Ce(this,iS).entries().next().value[1]}get current_editor(){return this.current_editor_pane.editor}get current_editor_content(){return this.current_editor.getModel()?.getValue()??""}get current_text_document_uri(){return Ce(this,nS).currentWidget?.id}async project_from_url(t){return t==null?null:(this.clear_editors(),Promise.resolve((await this.open_tab_from_url(qv.parse(t)))[0]))}async open_tab_from_url(t){const[i,n,o]=await yXt(t.toString()),r=qv.parse(i??t.toString());return Ct(this,px,o??new Wii(r)),this.safely_open_editor_with_url_content(r,CP(n??r.path),!0)}known_demos(){return[["","Hello World!"],["examples/gallery/gallery.slint","Gallery"],["examples/printerdemo/ui/printerdemo.slint","Printer Demo"],["examples/energy-monitor/ui/desktop_window.slint","Energy Monitor"],["examples/todo/ui/todo.slint","Todo Demo"],["examples/iot-dashboard/main.slint","IOT Dashboard"]]}add_empty_file_to_project(t){let i=t;i.startsWith("/")||(i="/"+i);const n=CP(i);return hN.getModel(n)?!1:(this.open_file_with_content(n,""),!0)}async set_demo(t){if(t){const i="XXXX_DEFAULT_TAG_XXXX";let n=i.startsWith("XXXX_DEFAULT_TAG_")?"master":i;{let o;(o=window.location.pathname.match(/releases\/([^/]*)\/editor/))&&(n="v"+o[1])}return this.project_from_url(`https://raw.githubusercontent.com/slint-ui/slint/${n}/${t}`)}else return Promise.resolve(this.open_hello_world())}get open_document_urls(){return new Array(...Ce(this,iS)).map((t,i)=>t.toString())}document_contents(t){const i=qv.parse(t);return i===void 0?void 0:Ce(this,iS).get(i)?.editor.getModel()?.getValue()}get extra_files(){return Ce(this,l2)}async handle_lsp_url_request(t){if(Ce(this,px)===null)return Promise.resolve("Error: Can not resolve URL.");const i=qv.parse(t),n=Ce(this,px).from_internal(i);return n===null?Promise.resolve("Error: Can not map URL."):(await this.safely_open_editor_with_url_content(n,i,!1))[1]}async safely_open_editor_with_url_content(t,i,n){try{const r=await n0e.readFile(i);return[i,new TextDecoder().decode(r)??""]}catch{}let o="";try{const r=await fetch(t.toString());if(!r.ok)return n&&alert("Failed to download data from "+t+`: +`+r.status+" "+r.statusText),[null,""];o=await r.text()}catch{return n&&alert("Failed to download data from "+t+"."),[null,""]}return this.open_file_with_content(i,o),[i,o]}}sT=new WeakMap,iS=new WeakMap,nS=new WeakMap,E7=new WeakMap,x7=new WeakMap,px=new WeakMap,l2=new WeakMap;var sS,D7;class Vii{constructor(e,t){Wt(this,sS);Wt(this,D7);Ct(this,sS,e),Ct(this,D7,t),this.onError=Ce(this,sS).onError,this.onClose=Ce(this,sS).onClose,this.onPartialMessage=Ce(this,sS).onPartialMessage}dispose(){Ce(this,sS).dispose()}listen(e){return Ce(this,sS).listen(t=>{Ce(this,D7).call(this,t)||e(t)})}}sS=new WeakMap,D7=new WeakMap;var sd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function MAi(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function uot(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var n=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return s[i]}})}),t}var o0e={},r0e={},ps={},qN={},LPe={},ege={},ln={},Ph={},Q9e;function hG(){if(Q9e)return Ph;Q9e=1,Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.stringArray=Ph.array=Ph.func=Ph.error=Ph.number=Ph.string=Ph.boolean=void 0;function s(a){return a===!0||a===!1}Ph.boolean=s;function e(a){return typeof a=="string"||a instanceof String}Ph.string=e;function t(a){return typeof a=="number"||a instanceof Number}Ph.number=t;function i(a){return a instanceof Error}Ph.error=i;function n(a){return typeof a=="function"}Ph.func=n;function o(a){return Array.isArray(a)}Ph.array=o;function r(a){return o(a)&&a.every(c=>e(c))}return Ph.stringArray=r,Ph}var j9e;function got(){if(j9e)return ln;j9e=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.Message=ln.NotificationType9=ln.NotificationType8=ln.NotificationType7=ln.NotificationType6=ln.NotificationType5=ln.NotificationType4=ln.NotificationType3=ln.NotificationType2=ln.NotificationType1=ln.NotificationType0=ln.NotificationType=ln.RequestType9=ln.RequestType8=ln.RequestType7=ln.RequestType6=ln.RequestType5=ln.RequestType4=ln.RequestType3=ln.RequestType2=ln.RequestType1=ln.RequestType=ln.RequestType0=ln.AbstractMessageSignature=ln.ParameterStructures=ln.ResponseError=ln.ErrorCodes=void 0;const s=hG();var e;(function(j){j.ParseError=-32700,j.InvalidRequest=-32600,j.MethodNotFound=-32601,j.InvalidParams=-32602,j.InternalError=-32603,j.jsonrpcReservedErrorRangeStart=-32099,j.serverErrorStart=-32099,j.MessageWriteError=-32099,j.MessageReadError=-32098,j.PendingResponseRejected=-32097,j.ConnectionInactive=-32096,j.ServerNotInitialized=-32002,j.UnknownErrorCode=-32001,j.jsonrpcReservedErrorRangeEnd=-32e3,j.serverErrorEnd=-32e3})(e||(ln.ErrorCodes=e={}));class t extends Error{constructor(K,ie,ge){super(ie),this.code=s.number(K)?K:e.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,t.prototype)}toJson(){const K={code:this.code,message:this.message};return this.data!==void 0&&(K.data=this.data),K}}ln.ResponseError=t;class i{constructor(K){this.kind=K}static is(K){return K===i.auto||K===i.byName||K===i.byPosition}toString(){return this.kind}}ln.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");class n{constructor(K,ie){this.method=K,this.numberOfParams=ie}get parameterStructures(){return i.auto}}ln.AbstractMessageSignature=n;class o extends n{constructor(K){super(K,0)}}ln.RequestType0=o;class r extends n{constructor(K,ie=i.auto){super(K,1),this._parameterStructures=ie}get parameterStructures(){return this._parameterStructures}}ln.RequestType=r;class a extends n{constructor(K,ie=i.auto){super(K,1),this._parameterStructures=ie}get parameterStructures(){return this._parameterStructures}}ln.RequestType1=a;class c extends n{constructor(K){super(K,2)}}ln.RequestType2=c;class l extends n{constructor(K){super(K,3)}}ln.RequestType3=l;class d extends n{constructor(K){super(K,4)}}ln.RequestType4=d;class h extends n{constructor(K){super(K,5)}}ln.RequestType5=h;class u extends n{constructor(K){super(K,6)}}ln.RequestType6=u;class f extends n{constructor(K){super(K,7)}}ln.RequestType7=f;class p extends n{constructor(K){super(K,8)}}ln.RequestType8=p;class m extends n{constructor(K){super(K,9)}}ln.RequestType9=m;class v extends n{constructor(K,ie=i.auto){super(K,1),this._parameterStructures=ie}get parameterStructures(){return this._parameterStructures}}ln.NotificationType=v;class b extends n{constructor(K){super(K,0)}}ln.NotificationType0=b;class w extends n{constructor(K,ie=i.auto){super(K,1),this._parameterStructures=ie}get parameterStructures(){return this._parameterStructures}}ln.NotificationType1=w;class y extends n{constructor(K){super(K,2)}}ln.NotificationType2=y;class C extends n{constructor(K){super(K,3)}}ln.NotificationType3=C;class A extends n{constructor(K){super(K,4)}}ln.NotificationType4=A;class L extends n{constructor(K){super(K,5)}}ln.NotificationType5=L;class k extends n{constructor(K){super(K,6)}}ln.NotificationType6=k;class P extends n{constructor(K){super(K,7)}}ln.NotificationType7=P;class R extends n{constructor(K){super(K,8)}}ln.NotificationType8=R;class z extends n{constructor(K){super(K,9)}}ln.NotificationType9=z;var G;return function(j){function K(xe){const Re=xe;return Re&&s.string(Re.method)&&(s.string(Re.id)||s.number(Re.id))}j.isRequest=K;function ie(xe){const Re=xe;return Re&&s.string(Re.method)&&xe.id===void 0}j.isNotification=ie;function ge(xe){const Re=xe;return Re&&(Re.result!==void 0||!!Re.error)&&(s.string(Re.id)||s.number(Re.id)||Re.id===null)}j.isResponse=ge}(G||(ln.Message=G={})),ln}var mC={},Y9e;function fot(){if(Y9e)return mC;Y9e=1;var s;Object.defineProperty(mC,"__esModule",{value:!0}),mC.LRUCache=mC.LinkedMap=mC.Touch=void 0;var e;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(e||(mC.Touch=e={}));class t{constructor(){this[s]="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(o){return this._map.has(o)}get(o,r=e.None){const a=this._map.get(o);if(a)return r!==e.None&&this.touch(a,r),a.value}set(o,r,a=e.None){let c=this._map.get(o);if(c)c.value=r,a!==e.None&&this.touch(c,a);else{switch(c={key:o,value:r,next:void 0,previous:void 0},a){case e.None:this.addItemLast(c);break;case e.First:this.addItemFirst(c);break;case e.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(o,c),this._size++}return this}delete(o){return!!this.remove(o)}remove(o){const r=this._map.get(o);if(r)return this._map.delete(o),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const o=this._head;return this._map.delete(o.key),this.removeItem(o),this._size--,o.value}forEach(o,r){const a=this._state;let c=this._head;for(;c;){if(r?o.bind(r)(c.value,c.key,this):o(c.value,c.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const o=this._state;let r=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==o)throw new Error("LinkedMap got modified during iteration.");if(r){const c={value:r.key,done:!1};return r=r.next,c}else return{value:void 0,done:!0}}};return a}values(){const o=this._state;let r=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==o)throw new Error("LinkedMap got modified during iteration.");if(r){const c={value:r.value,done:!1};return r=r.next,c}else return{value:void 0,done:!0}}};return a}entries(){const o=this._state;let r=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==o)throw new Error("LinkedMap got modified during iteration.");if(r){const c={value:[r.key,r.value],done:!1};return r=r.next,c}else return{value:void 0,done:!0}}};return a}[(s=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(o){if(o>=this.size)return;if(o===0){this.clear();return}let r=this._head,a=this.size;for(;r&&a>o;)this._map.delete(r.key),r=r.next,a--;this._head=r,this._size=a,r&&(r.previous=void 0),this._state++}addItemFirst(o){if(!this._head&&!this._tail)this._tail=o;else if(this._head)o.next=this._head,this._head.previous=o;else throw new Error("Invalid list");this._head=o,this._state++}addItemLast(o){if(!this._head&&!this._tail)this._head=o;else if(this._tail)o.previous=this._tail,this._tail.next=o;else throw new Error("Invalid list");this._tail=o,this._state++}removeItem(o){if(o===this._head&&o===this._tail)this._head=void 0,this._tail=void 0;else if(o===this._head){if(!o.next)throw new Error("Invalid list");o.next.previous=void 0,this._head=o.next}else if(o===this._tail){if(!o.previous)throw new Error("Invalid list");o.previous.next=void 0,this._tail=o.previous}else{const r=o.next,a=o.previous;if(!r||!a)throw new Error("Invalid list");r.previous=a,a.next=r}o.next=void 0,o.previous=void 0,this._state++}touch(o,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==e.First&&r!==e.Last)){if(r===e.First){if(o===this._head)return;const a=o.next,c=o.previous;o===this._tail?(c.next=void 0,this._tail=c):(a.previous=c,c.next=a),o.previous=void 0,o.next=this._head,this._head.previous=o,this._head=o,this._state++}else if(r===e.Last){if(o===this._tail)return;const a=o.next,c=o.previous;o===this._head?(a.previous=void 0,this._head=a):(a.previous=c,c.next=a),o.next=void 0,o.previous=this._tail,this._tail.next=o,this._tail=o,this._state++}}}toJSON(){const o=[];return this.forEach((r,a)=>{o.push([a,r])}),o}fromJSON(o){this.clear();for(const[r,a]of o)this.set(r,a)}}mC.LinkedMap=t;class i extends t{constructor(o,r=1){super(),this._limit=o,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(o){this._limit=o,this.checkTrim()}get ratio(){return this._ratio}set ratio(o){this._ratio=Math.min(Math.max(0,o),1),this.checkTrim()}get(o,r=e.AsNew){return super.get(o,r)}peek(o){return super.get(o,e.None)}set(o,r){return super.set(o,r,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return mC.LRUCache=i,mC}var M4={},J9e;function zii(){if(J9e)return M4;J9e=1,Object.defineProperty(M4,"__esModule",{value:!0}),M4.Disposable=void 0;var s;return function(e){function t(i){return{dispose:i}}e.create=t}(s||(M4.Disposable=s={})),M4}var VI={},qK={},X9e;function QN(){if(X9e)return qK;X9e=1,Object.defineProperty(qK,"__esModule",{value:!0});let s;function e(){if(s===void 0)throw new Error("No runtime abstraction layer installed");return s}return function(t){function i(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");s=n}t.install=i}(e||(e={})),qK.default=e,qK}var Z9e;function uG(){if(Z9e)return VI;Z9e=1,Object.defineProperty(VI,"__esModule",{value:!0}),VI.Emitter=VI.Event=void 0;const s=QN();var e;(function(n){const o={dispose(){}};n.None=function(){return o}})(e||(VI.Event=e={}));class t{add(o,r=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(o),this._contexts.push(r),Array.isArray(a)&&a.push({dispose:()=>this.remove(o,r)})}remove(o,r=null){if(!this._callbacks)return;let a=!1;for(let c=0,l=this._callbacks.length;c{this._callbacks||(this._callbacks=new t),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,r);const c={dispose:()=>{this._callbacks&&(this._callbacks.remove(o,r),c.dispose=i._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(c),c}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return VI.Emitter=i,i._noop=function(){},VI}var zI={},e$e;function RPe(){if(e$e)return zI;e$e=1,Object.defineProperty(zI,"__esModule",{value:!0}),zI.CancellationTokenSource=zI.CancellationToken=void 0;const s=QN(),e=hG(),t=uG();var i;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:t.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:t.Event.None});function c(l){const d=l;return d&&(d===a.None||d===a.Cancelled||e.boolean(d.isCancellationRequested)&&!!d.onCancellationRequested)}a.is=c})(i||(zI.CancellationToken=i={}));const n=Object.freeze(function(a,c){const l=(0,s.default)().timer.setTimeout(a.bind(c),0);return{dispose(){l.dispose()}}});class o{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?n:(this._emitter||(this._emitter=new t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class r{get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}}return zI.CancellationTokenSource=r,zI}var $I={},t$e;function $ii(){if(t$e)return $I;t$e=1,Object.defineProperty($I,"__esModule",{value:!0}),$I.SharedArrayReceiverStrategy=$I.SharedArraySenderStrategy=void 0;const s=RPe();var e;(function(r){r.Continue=0,r.Cancelled=1})(e||(e={}));class t{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const c=new SharedArrayBuffer(4),l=new Int32Array(c,0,1);l[0]=e.Continue,this.buffers.set(a.id,c),a.$cancellationData=c}async sendCancellation(a,c){const l=this.buffers.get(c);if(l===void 0)return;const d=new Int32Array(l,0,1);Atomics.store(d,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}$I.SharedArraySenderStrategy=t;class i{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class n{constructor(a){this.token=new i(a)}cancel(){}dispose(){}}class o{constructor(){this.kind="request"}createCancellationTokenSource(a){const c=a.$cancellationData;return c===void 0?new s.CancellationTokenSource:new n(c)}}return $I.SharedArrayReceiverStrategy=o,$I}var _C={},N4={},i$e;function pot(){if(i$e)return N4;i$e=1,Object.defineProperty(N4,"__esModule",{value:!0}),N4.Semaphore=void 0;const s=QN();class e{constructor(i=1){if(i<=0)throw new Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((n,o)=>{this._waiting.push({thunk:i,resolve:n,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,s.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=i.thunk();n instanceof Promise?n.then(o=>{this._active--,i.resolve(o),this.runNext()},o=>{this._active--,i.reject(o),this.runNext()}):(this._active--,i.resolve(n),this.runNext())}catch(n){this._active--,i.reject(n),this.runNext()}}}return N4.Semaphore=e,N4}var n$e;function Gii(){if(n$e)return _C;n$e=1,Object.defineProperty(_C,"__esModule",{value:!0}),_C.ReadableStreamMessageReader=_C.AbstractMessageReader=_C.MessageReader=void 0;const s=QN(),e=hG(),t=uG(),i=pot();var n;(function(c){function l(d){let h=d;return h&&e.func(h.listen)&&e.func(h.dispose)&&e.func(h.onError)&&e.func(h.onClose)&&e.func(h.onPartialMessage)}c.is=l})(n||(_C.MessageReader=n={}));class o{constructor(){this.errorEmitter=new t.Emitter,this.closeEmitter=new t.Emitter,this.partialMessageEmitter=new t.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(l){this.errorEmitter.fire(this.asError(l))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(l){this.partialMessageEmitter.fire(l)}asError(l){return l instanceof Error?l:new Error(`Reader received error. Reason: ${e.string(l.message)?l.message:"unknown"}`)}}_C.AbstractMessageReader=o;var r;(function(c){function l(d){let h,u;const f=new Map;let p;const m=new Map;if(d===void 0||typeof d=="string")h=d??"utf-8";else{if(h=d.charset??"utf-8",d.contentDecoder!==void 0&&(u=d.contentDecoder,f.set(u.name,u)),d.contentDecoders!==void 0)for(const v of d.contentDecoders)f.set(v.name,v);if(d.contentTypeDecoder!==void 0&&(p=d.contentTypeDecoder,m.set(p.name,p)),d.contentTypeDecoders!==void 0)for(const v of d.contentTypeDecoders)m.set(v.name,v)}return p===void 0&&(p=(0,s.default)().applicationJson.decoder,m.set(p.name,p)),{charset:h,contentDecoder:u,contentDecoders:f,contentTypeDecoder:p,contentTypeDecoders:m}}c.fromOptions=l})(r||(r={}));class a extends o{constructor(l,d){super(),this.readable=l,this.options=r.fromOptions(d),this.buffer=(0,s.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(l){this._partialMessageTimeout=l}get partialMessageTimeout(){return this._partialMessageTimeout}listen(l){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=l;const d=this.readable.onData(h=>{this.onData(h)});return this.readable.onError(h=>this.fireError(h)),this.readable.onClose(()=>this.fireClose()),d}onData(l){try{for(this.buffer.append(l);;){if(this.nextMessageLength===-1){const h=this.buffer.tryReadHeaders(!0);if(!h)return;const u=h.get("content-length");if(!u){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(h))}`));return}const f=parseInt(u);if(isNaN(f)){this.fireError(new Error(`Content-Length value must be a number. Got ${u}`));return}this.nextMessageLength=f}const d=this.buffer.tryReadBody(this.nextMessageLength);if(d===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const h=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(d):d,u=await this.options.contentTypeDecoder.decode(h,this.options);this.callback(u)}).catch(h=>{this.fireError(h)})}}catch(d){this.fireError(d)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,s.default)().timer.setTimeout((l,d)=>{this.partialMessageTimer=void 0,l===this.messageToken&&(this.firePartialMessage({messageToken:l,waitingTime:d}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return _C.ReadableStreamMessageReader=a,_C}var vC={},s$e;function Kii(){if(s$e)return vC;s$e=1,Object.defineProperty(vC,"__esModule",{value:!0}),vC.WriteableStreamMessageWriter=vC.AbstractMessageWriter=vC.MessageWriter=void 0;const s=QN(),e=hG(),t=pot(),i=uG(),n="Content-Length: ",o=`\r +`;var r;(function(d){function h(u){let f=u;return f&&e.func(f.dispose)&&e.func(f.onClose)&&e.func(f.onError)&&e.func(f.write)}d.is=h})(r||(vC.MessageWriter=r={}));class a{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h,u,f){this.errorEmitter.fire([this.asError(h),u,f])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(h){return h instanceof Error?h:new Error(`Writer received error. Reason: ${e.string(h.message)?h.message:"unknown"}`)}}vC.AbstractMessageWriter=a;var c;(function(d){function h(u){return u===void 0||typeof u=="string"?{charset:u??"utf-8",contentTypeEncoder:(0,s.default)().applicationJson.encoder}:{charset:u.charset??"utf-8",contentEncoder:u.contentEncoder,contentTypeEncoder:u.contentTypeEncoder??(0,s.default)().applicationJson.encoder}}d.fromOptions=h})(c||(c={}));class l extends a{constructor(h,u){super(),this.writable=h,this.options=c.fromOptions(u),this.errorCount=0,this.writeSemaphore=new t.Semaphore(1),this.writable.onError(f=>this.fireError(f)),this.writable.onClose(()=>this.fireClose())}async write(h){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(h,this.options).then(f=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(f):f).then(f=>{const p=[];return p.push(n,f.byteLength.toString(),o),p.push(o),this.doWrite(h,p,f)},f=>{throw this.fireError(f),f}))}async doWrite(h,u,f){try{return await this.writable.write(u.join(""),"ascii"),this.writable.write(f)}catch(p){return this.handleError(p,h),Promise.reject(p)}}handleError(h,u){this.errorCount++,this.fireError(h,u,this.errorCount)}end(){this.writable.end()}}return vC.WriteableStreamMessageWriter=l,vC}var P4={},o$e;function qii(){if(o$e)return P4;o$e=1,Object.defineProperty(P4,"__esModule",{value:!0}),P4.AbstractMessageBuffer=void 0;const s=13,e=10,t=`\r +`;class i{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const r=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let r=0,a=0,c=0,l=0;e:for(;athis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const l=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(l)}if(this._chunks[0].byteLength>o){const l=this._chunks[0],d=this.asNative(l,o);return this._chunks[0]=l.slice(o),this._totalLength-=o,d}const r=this.allocNative(o);let a=0,c=0;for(;o>0;){const l=this._chunks[c];if(l.byteLength>o){const d=l.slice(0,o);r.set(d,a),a+=o,this._chunks[c]=l.slice(o),this._totalLength-=o,o-=o}else r.set(l,a),a+=l.byteLength,this._chunks.shift(),this._totalLength-=l.byteLength,o-=l.byteLength}return r}}return P4.AbstractMessageBuffer=i,P4}var tge={},r$e;function Qii(){return r$e||(r$e=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.createMessageConnection=s.ConnectionOptions=s.MessageStrategy=s.CancellationStrategy=s.CancellationSenderStrategy=s.CancellationReceiverStrategy=s.RequestCancellationReceiverStrategy=s.IdCancellationReceiverStrategy=s.ConnectionStrategy=s.ConnectionError=s.ConnectionErrors=s.LogTraceNotification=s.SetTraceNotification=s.TraceFormat=s.TraceValues=s.Trace=s.NullLogger=s.ProgressType=s.ProgressToken=void 0;const e=QN(),t=hG(),i=got(),n=fot(),o=uG(),r=RPe();var a;(function(K){K.type=new i.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(K){function ie(ge){return typeof ge=="string"||typeof ge=="number"}K.is=ie})(c||(s.ProgressToken=c={}));var l;(function(K){K.type=new i.NotificationType("$/progress")})(l||(l={}));class d{constructor(){}}s.ProgressType=d;var h;(function(K){function ie(ge){return t.func(ge)}K.is=ie})(h||(h={})),s.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var u;(function(K){K[K.Off=0]="Off",K[K.Messages=1]="Messages",K[K.Compact=2]="Compact",K[K.Verbose=3]="Verbose"})(u||(s.Trace=u={}));var f;(function(K){K.Off="off",K.Messages="messages",K.Compact="compact",K.Verbose="verbose"})(f||(s.TraceValues=f={})),function(K){function ie(xe){if(!t.string(xe))return K.Off;switch(xe=xe.toLowerCase(),xe){case"off":return K.Off;case"messages":return K.Messages;case"compact":return K.Compact;case"verbose":return K.Verbose;default:return K.Off}}K.fromString=ie;function ge(xe){switch(xe){case K.Off:return"off";case K.Messages:return"messages";case K.Compact:return"compact";case K.Verbose:return"verbose";default:return"off"}}K.toString=ge}(u||(s.Trace=u={}));var p;(function(K){K.Text="text",K.JSON="json"})(p||(s.TraceFormat=p={})),function(K){function ie(ge){return t.string(ge)?(ge=ge.toLowerCase(),ge==="json"?K.JSON:K.Text):K.Text}K.fromString=ie}(p||(s.TraceFormat=p={}));var m;(function(K){K.type=new i.NotificationType("$/setTrace")})(m||(s.SetTraceNotification=m={}));var v;(function(K){K.type=new i.NotificationType("$/logTrace")})(v||(s.LogTraceNotification=v={}));var b;(function(K){K[K.Closed=1]="Closed",K[K.Disposed=2]="Disposed",K[K.AlreadyListening=3]="AlreadyListening"})(b||(s.ConnectionErrors=b={}));class w extends Error{constructor(ie,ge){super(ge),this.code=ie,Object.setPrototypeOf(this,w.prototype)}}s.ConnectionError=w;var y;(function(K){function ie(ge){const xe=ge;return xe&&t.func(xe.cancelUndispatched)}K.is=ie})(y||(s.ConnectionStrategy=y={}));var C;(function(K){function ie(ge){const xe=ge;return xe&&(xe.kind===void 0||xe.kind==="id")&&t.func(xe.createCancellationTokenSource)&&(xe.dispose===void 0||t.func(xe.dispose))}K.is=ie})(C||(s.IdCancellationReceiverStrategy=C={}));var A;(function(K){function ie(ge){const xe=ge;return xe&&xe.kind==="request"&&t.func(xe.createCancellationTokenSource)&&(xe.dispose===void 0||t.func(xe.dispose))}K.is=ie})(A||(s.RequestCancellationReceiverStrategy=A={}));var L;(function(K){K.Message=Object.freeze({createCancellationTokenSource(ge){return new r.CancellationTokenSource}});function ie(ge){return C.is(ge)||A.is(ge)}K.is=ie})(L||(s.CancellationReceiverStrategy=L={}));var k;(function(K){K.Message=Object.freeze({sendCancellation(ge,xe){return ge.sendNotification(a.type,{id:xe})},cleanup(ge){}});function ie(ge){const xe=ge;return xe&&t.func(xe.sendCancellation)&&t.func(xe.cleanup)}K.is=ie})(k||(s.CancellationSenderStrategy=k={}));var P;(function(K){K.Message=Object.freeze({receiver:L.Message,sender:k.Message});function ie(ge){const xe=ge;return xe&&L.is(xe.receiver)&&k.is(xe.sender)}K.is=ie})(P||(s.CancellationStrategy=P={}));var R;(function(K){function ie(ge){const xe=ge;return xe&&t.func(xe.handleMessage)}K.is=ie})(R||(s.MessageStrategy=R={}));var z;(function(K){function ie(ge){const xe=ge;return xe&&(P.is(xe.cancellationStrategy)||y.is(xe.connectionStrategy)||R.is(xe.messageStrategy))}K.is=ie})(z||(s.ConnectionOptions=z={}));var G;(function(K){K[K.New=1]="New",K[K.Listening=2]="Listening",K[K.Closed=3]="Closed",K[K.Disposed=4]="Disposed"})(G||(G={}));function j(K,ie,ge,xe){const Re=ge!==void 0?ge:s.NullLogger;let yt=0,Pe=0,lt=0;const xt="2.0";let Ji;const Ii=new Map;let ns;const zs=new Map,Pn=new Map;let Xr,ds=new n.LinkedMap,Zo=new Map,Zr=new Set,Di=new Map,ss=u.Off,Oo=p.Text,Tn,Ba=G.New;const md=new o.Emitter,Fn=new o.Emitter,Zd=new o.Emitter,pc=new o.Emitter,Vc=new o.Emitter,$s=xe&&xe.cancellationStrategy?xe.cancellationStrategy:P.Message;function tc(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}function gl(Se){return Se===null?"res-unknown-"+(++lt).toString():"res-"+Se.toString()}function eh(){return"not-"+(++Pe).toString()}function dg(Se,rt){i.Message.isRequest(rt)?Se.set(tc(rt.id),rt):i.Message.isResponse(rt)?Se.set(gl(rt.id),rt):Se.set(eh(),rt)}function mc(Se){}function zc(){return Ba===G.Listening}function th(){return Ba===G.Closed}function Dc(){return Ba===G.Disposed}function fl(){(Ba===G.New||Ba===G.Listening)&&(Ba=G.Closed,Fn.fire(void 0))}function ic(Se){md.fire([Se,void 0,void 0])}function Or(Se){md.fire(Se)}K.onClose(fl),K.onError(ic),ie.onClose(fl),ie.onError(Or);function pl(){Xr||ds.size===0||(Xr=(0,e.default)().timer.setImmediate(()=>{Xr=void 0,nh()}))}function ih(Se){i.Message.isRequest(Se)?Gc(Se):i.Message.isNotification(Se)?Bo(Se):i.Message.isResponse(Se)?Wa(Se):Is(Se)}function nh(){if(ds.size===0)return;const Se=ds.shift();try{const rt=xe?.messageStrategy;R.is(rt)?rt.handleMessage(Se,ih):ih(Se)}finally{pl()}}const $c=Se=>{try{if(i.Message.isNotification(Se)&&Se.method===a.type.method){const rt=Se.params.id,Ft=tc(rt),Ci=ds.get(Ft);if(i.Message.isRequest(Ci)){const q=xe?.connectionStrategy,de=q&&q.cancelUndispatched?q.cancelUndispatched(Ci,mc):void 0;if(de&&(de.error!==void 0||de.result!==void 0)){ds.delete(Ft),Di.delete(rt),de.id=Ci.id,Aa(de,Se.method,Date.now()),ie.write(de).catch(()=>Re.error("Sending response for canceled message failed."));return}}const Ot=Di.get(rt);if(Ot!==void 0){Ot.cancel(),De(Se);return}else Zr.add(rt)}dg(ds,Se)}finally{pl()}};function Gc(Se){if(Dc())return;function rt(ne,ye,O){const $={jsonrpc:xt,id:Se.id};ne instanceof i.ResponseError?$.error=ne.toJson():$.result=ne===void 0?null:ne,Aa($,ye,O),ie.write($).catch(()=>Re.error("Sending response failed."))}function Ft(ne,ye,O){const $={jsonrpc:xt,id:Se.id,error:ne.toJson()};Aa($,ye,O),ie.write($).catch(()=>Re.error("Sending response failed."))}function Ci(ne,ye,O){ne===void 0&&(ne=null);const $={jsonrpc:xt,id:Se.id,result:ne};Aa($,ye,O),ie.write($).catch(()=>Re.error("Sending response failed."))}ee(Se);const Ot=Ii.get(Se.method);let q,de;Ot&&(q=Ot.type,de=Ot.handler);const T=Date.now();if(de||Ji){const ne=Se.id??String(Date.now()),ye=C.is($s.receiver)?$s.receiver.createCancellationTokenSource(ne):$s.receiver.createCancellationTokenSource(Se);Se.id!==null&&Zr.has(Se.id)&&ye.cancel(),Se.id!==null&&Di.set(ne,ye);try{let O;if(de)if(Se.params===void 0){if(q!==void 0&&q.numberOfParams!==0){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${q.numberOfParams} params but received none.`),Se.method,T);return}O=de(ye.token)}else if(Array.isArray(Se.params)){if(q!==void 0&&q.parameterStructures===i.ParameterStructures.byName){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,T);return}O=de(...Se.params,ye.token)}else{if(q!==void 0&&q.parameterStructures===i.ParameterStructures.byPosition){Ft(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,T);return}O=de(Se.params,ye.token)}else Ji&&(O=Ji(Se.method,Se.params,ye.token));const $=O;O?$.then?$.then(se=>{Di.delete(ne),rt(se,Se.method,T)},se=>{Di.delete(ne),se instanceof i.ResponseError?Ft(se,Se.method,T):se&&t.string(se.message)?Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${se.message}`),Se.method,T):Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}):(Di.delete(ne),rt(O,Se.method,T)):(Di.delete(ne),Ci(O,Se.method,T))}catch(O){Di.delete(ne),O instanceof i.ResponseError?rt(O,Se.method,T):O&&t.string(O.message)?Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${O.message}`),Se.method,T):Ft(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,T)}}else Ft(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,T)}function Wa(Se){if(!Dc())if(Se.id===null)Se.error?Re.error(`Received response message without id: Error is: +${JSON.stringify(Se.error,void 0,4)}`):Re.error("Received response message without id. No further error information provided.");else{const rt=Se.id,Ft=Zo.get(rt);if(gt(Se,Ft),Ft!==void 0){Zo.delete(rt);try{if(Se.error){const Ci=Se.error;Ft.reject(new i.ResponseError(Ci.code,Ci.message,Ci.data))}else if(Se.result!==void 0)Ft.resolve(Se.result);else throw new Error("Should never happen.")}catch(Ci){Ci.message?Re.error(`Response handler '${Ft.method}' failed with message: ${Ci.message}`):Re.error(`Response handler '${Ft.method}' failed unexpectedly.`)}}}}function Bo(Se){if(Dc())return;let rt,Ft;if(Se.method===a.type.method){const Ci=Se.params.id;Zr.delete(Ci),De(Se);return}else{const Ci=zs.get(Se.method);Ci&&(Ft=Ci.handler,rt=Ci.type)}if(Ft||ns)try{if(De(Se),Ft)if(Se.params===void 0)rt!==void 0&&rt.numberOfParams!==0&&rt.parameterStructures!==i.ParameterStructures.byName&&Re.error(`Notification ${Se.method} defines ${rt.numberOfParams} params but received none.`),Ft();else if(Array.isArray(Se.params)){const Ci=Se.params;Se.method===l.type.method&&Ci.length===2&&c.is(Ci[0])?Ft({token:Ci[0],value:Ci[1]}):(rt!==void 0&&(rt.parameterStructures===i.ParameterStructures.byName&&Re.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),rt.numberOfParams!==Se.params.length&&Re.error(`Notification ${Se.method} defines ${rt.numberOfParams} params but received ${Ci.length} arguments`)),Ft(...Ci))}else rt!==void 0&&rt.parameterStructures===i.ParameterStructures.byPosition&&Re.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),Ft(Se.params);else ns&&ns(Se.method,Se.params)}catch(Ci){Ci.message?Re.error(`Notification handler '${Se.method}' failed with message: ${Ci.message}`):Re.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else Zd.fire(Se)}function Is(Se){if(!Se){Re.error("Received empty message.");return}Re.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(Se,null,4)}`);const rt=Se;if(t.string(rt.id)||t.number(rt.id)){const Ft=rt.id,Ci=Zo.get(Ft);Ci&&Ci.reject(new Error("The received response has neither a result nor an error property."))}}function kc(Se){if(Se!=null)switch(ss){case u.Verbose:return JSON.stringify(Se,null,4);case u.Compact:return JSON.stringify(Se);default:return}}function Rh(Se){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&Se.params&&(rt=`Params: ${kc(Se.params)} `),Tn.log(`Sending request '${Se.method} - (${Se.id})'.`,rt)}else zn("send-request",Se)}function be(Se){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&(Se.params?rt=`Params: ${kc(Se.params)} @@ -1074,7 +1074,7 @@ ${JSON.stringify(Se,null,4)}`);const rt=Se;if(t.string(rt.id)||t.number(rt.id)){ `)),Tn.log(`Sending response '${rt} - (${Se.id})'. Processing request took ${Date.now()-Ft}ms`,Ci)}else zn("send-response",Se)}function ee(Se){if(!(ss===u.Off||!Tn))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&Se.params&&(rt=`Params: ${kc(Se.params)} -`),Tn.log(`Received request '${Se.method} - (${Se.id})'.`,rt)}else zn("receive-request",Se)}function xe(Se){if(!(ss===u.Off||!Tn||Se.method===v.type.method))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&(Se.params?rt=`Params: ${kc(Se.params)} +`),Tn.log(`Received request '${Se.method} - (${Se.id})'.`,rt)}else zn("receive-request",Se)}function De(Se){if(!(ss===u.Off||!Tn||Se.method===v.type.method))if(Oo===p.Text){let rt;(ss===u.Verbose||ss===u.Compact)&&(Se.params?rt=`Params: ${kc(Se.params)} `:rt=`No parameters provided. @@ -1084,18 +1084,18 @@ ${JSON.stringify(Se,null,4)}`);const rt=Se;if(t.string(rt.id)||t.number(rt.id)){ `:Se.error===void 0&&(Ft=`No result returned. -`)),rt){const Ci=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Tn.log(`Received response '${rt.method} - (${Se.id})' in ${Date.now()-rt.timerStart}ms.${Ci}`,Ft)}else Tn.log(`Received response ${Se.id} without active response promise.`,Ft)}else zn("receive-response",Se)}function zn(Se,rt){if(!Tn||ss===u.Off)return;const Ft={isLSPMessage:!0,type:Se,message:rt,timestamp:Date.now()};Tn.log(Ft)}function Cs(){if(nh())throw new w(b.Closed,"Connection is closed.");if(Dc())throw new w(b.Disposed,"Connection is disposed.")}function Wo(){if($c())throw new w(b.AlreadyListening,"Connection is already listening")}function Ha(){if(!$c())throw new Error("Call listen() first.")}function ea(Se){return Se===void 0?null:Se}function Ph(Se){if(Se!==null)return Se}function le(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}function dr(Se,rt){switch(Se){case i.ParameterStructures.auto:return le(rt)?Ph(rt):[ea(rt)];case i.ParameterStructures.byName:if(!le(rt))throw new Error("Received parameters by name but param is not an object literal.");return Ph(rt);case i.ParameterStructures.byPosition:return[ea(rt)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}function io(Se,rt){let Ft;const Ci=Se.numberOfParams;switch(Ci){case 0:Ft=void 0;break;case 1:Ft=dr(Se.parameterStructures,rt[0]);break;default:Ft=[];for(let Ot=0;Ot{Cs();let Ft,Ci;if(t.string(Se)){Ft=Se;const K=rt[0];let de=0,T=i.ParameterStructures.auto;i.ParameterStructures.is(K)&&(de=1,T=K);let ie=rt.length;const ye=ie-de;switch(ye){case 0:Ci=void 0;break;case 1:Ci=dr(T,rt[de]);break;default:if(T===i.ParameterStructures.byName)throw new Error(`Received ${ye} parameters for 'by Name' notification parameter structure.`);Ci=rt.slice(de,ie).map(O=>ea(O));break}}else{const K=rt;Ft=Se.method,Ci=io(Se,K)}const Ot={jsonrpc:xt,method:Ft,params:Ci};return be(Ot),ne.write(Ot).catch(K=>{throw Oe.error("Sending notification failed."),K})},onNotification:(Se,rt)=>{Cs();let Ft;return t.func(Se)?ns=Se:rt&&(t.string(Se)?(Ft=Se,zs.set(Se,{type:void 0,handler:rt})):(Ft=Se.method,zs.set(Se.method,{type:Se,handler:rt}))),{dispose:()=>{Ft!==void 0?zs.delete(Ft):ns=void 0}}},onProgress:(Se,rt,Ft)=>{if(Pn.has(rt))throw new Error(`Progress handler for token ${rt} already registered`);return Pn.set(rt,Ft),{dispose:()=>{Pn.delete(rt)}}},sendProgress:(Se,rt,Ft)=>un.sendNotification(l.type,{token:rt,value:Ft}),onUnhandledProgress:pc.event,sendRequest:(Se,...rt)=>{Cs(),Ha();let Ft,Ci,Ot;if(t.string(Se)){Ft=Se;const ie=rt[0],ye=rt[rt.length-1];let O=0,$=i.ParameterStructures.auto;i.ParameterStructures.is(ie)&&(O=1,$=ie);let se=rt.length;r.CancellationToken.is(ye)&&(se=se-1,Ot=ye);const Ke=se-O;switch(Ke){case 0:Ci=void 0;break;case 1:Ci=dr($,rt[O]);break;default:if($===i.ParameterStructures.byName)throw new Error(`Received ${Ke} parameters for 'by Name' request parameter structure.`);Ci=rt.slice(O,se).map(Bi=>ea(Bi));break}}else{const ie=rt;Ft=Se.method,Ci=io(Se,ie);const ye=Se.numberOfParams;Ot=r.CancellationToken.is(ie[ye])?ie[ye]:void 0}const K=yt++;let de;Ot&&(de=Ot.onCancellationRequested(()=>{const ie=$s.sender.sendCancellation(un,K);return ie===void 0?(Oe.log(`Received no promise from cancellation strategy when cancelling id ${K}`),Promise.resolve()):ie.catch(()=>{Oe.log(`Sending cancellation messages for id ${K} failed`)})}));const T={jsonrpc:xt,id:K,method:Ft,params:Ci};return Nh(T),typeof $s.sender.enableCancellation=="function"&&$s.sender.enableCancellation(T),new Promise(async(ie,ye)=>{const O=Ke=>{ie(Ke),$s.sender.cleanup(K),de?.dispose()},$=Ke=>{ye(Ke),$s.sender.cleanup(K),de?.dispose()},se={method:Ft,timerStart:Date.now(),resolve:O,reject:$};try{await ne.write(T),Zo.set(K,se)}catch(Ke){throw Oe.error("Sending request failed."),se.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,Ke.message?Ke.message:"Unknown reason")),Ke}})},onRequest:(Se,rt)=>{Cs();let Ft=null;return h.is(Se)?(Ft=void 0,Ji=Se):t.string(Se)?(Ft=null,rt!==void 0&&(Ft=Se,Ii.set(Se,{handler:rt,type:void 0}))):rt!==void 0&&(Ft=Se.method,Ii.set(Se.method,{type:Se,handler:rt})),{dispose:()=>{Ft!==null&&(Ft!==void 0?Ii.delete(Ft):Ji=void 0)}}},hasPendingResponse:()=>Zo.size>0,trace:async(Se,rt,Ft)=>{let Ci=!1,Ot=p.Text;Ft!==void 0&&(t.boolean(Ft)?Ci=Ft:(Ci=Ft.sendNotification||!1,Ot=Ft.traceFormat||p.Text)),ss=Se,Oo=Ot,ss===u.Off?Tn=void 0:Tn=rt,Ci&&!nh()&&!Dc()&&await un.sendNotification(m.type,{value:u.toString(Se)})},onError:vd.event,onClose:Fn.event,onUnhandledNotification:th.event,onDispose:zc.event,end:()=>{ne.end()},dispose:()=>{if(Dc())return;Ba=G.Disposed,zc.fire(void 0);const Se=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const rt of Zo.values())rt.reject(Se);Zo=new Map,Di=new Map,Zr=new Set,ds=new n.LinkedMap,t.func(ne.dispose)&&ne.dispose(),t.func(j.dispose)&&j.dispose()},listen:()=>{Cs(),Wo(),Ba=G.Listening,j.listen(Gc)},inspect:()=>{(0,e.default)().console.log("inspect")}};return un.onNotification(v.type,Se=>{if(ss===u.Off||!Tn)return;const rt=ss===u.Verbose||ss===u.Compact;Tn.log(Se.message,rt?Se.verbose:void 0)}),un.onNotification(l.type,Se=>{const rt=Pn.get(Se.token);rt?rt(Se.value):pc.fire(Se)}),un}s.createMessageConnection=Y})(xot);(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.ProgressType=s.ProgressToken=s.createMessageConnection=s.NullLogger=s.ConnectionOptions=s.ConnectionStrategy=s.AbstractMessageBuffer=s.WriteableStreamMessageWriter=s.AbstractMessageWriter=s.MessageWriter=s.ReadableStreamMessageReader=s.AbstractMessageReader=s.MessageReader=s.SharedArrayReceiverStrategy=s.SharedArraySenderStrategy=s.CancellationToken=s.CancellationTokenSource=s.Emitter=s.Event=s.Disposable=s.LRUCache=s.Touch=s.LinkedMap=s.ParameterStructures=s.NotificationType9=s.NotificationType8=s.NotificationType7=s.NotificationType6=s.NotificationType5=s.NotificationType4=s.NotificationType3=s.NotificationType2=s.NotificationType1=s.NotificationType0=s.NotificationType=s.ErrorCodes=s.ResponseError=s.RequestType9=s.RequestType8=s.RequestType7=s.RequestType6=s.RequestType5=s.RequestType4=s.RequestType3=s.RequestType2=s.RequestType1=s.RequestType0=s.RequestType=s.Message=s.RAL=void 0,s.MessageStrategy=s.CancellationStrategy=s.CancellationSenderStrategy=s.CancellationReceiverStrategy=s.ConnectionError=s.ConnectionErrors=s.LogTraceNotification=s.SetTraceNotification=s.TraceFormat=s.TraceValues=s.Trace=void 0;const e=ln;Object.defineProperty(s,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(s,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(s,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(s,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(s,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(s,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(s,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(s,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(s,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(s,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(s,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(s,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(s,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(s,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(s,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(s,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(s,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(s,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(s,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(s,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(s,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(s,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(s,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(s,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(s,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(s,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=vA;Object.defineProperty(s,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(s,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(s,"Touch",{enumerable:!0,get:function(){return t.Touch}});const i=hle;Object.defineProperty(s,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const n=dC;Object.defineProperty(s,"Event",{enumerable:!0,get:function(){return n.Event}}),Object.defineProperty(s,"Emitter",{enumerable:!0,get:function(){return n.Emitter}});const o=vI;Object.defineProperty(s,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(s,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const r=jH;Object.defineProperty(s,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return r.SharedArraySenderStrategy}}),Object.defineProperty(s,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return r.SharedArrayReceiverStrategy}});const a=ED;Object.defineProperty(s,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(s,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(s,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=xD;Object.defineProperty(s,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(s,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(s,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=gle;Object.defineProperty(s,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=xot;Object.defineProperty(s,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(s,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(s,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(s,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(s,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(s,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(s,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(s,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(s,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(s,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(s,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(s,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(s,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(s,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(s,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(s,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(s,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=aE;s.RAL=h.default})(dne);Object.defineProperty(zPe,"__esModule",{value:!0});const Xw=dne;class fle extends Xw.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return fle.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)}}fle.emptyBuffer=new Uint8Array(0);class Yni{constructor(e){this.socket=e,this._onData=new Xw.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(n=>{this._onData.fire(new Uint8Array(n))},()=>{(0,Xw.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),Xw.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Xw.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Xw.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class Jni{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),Xw.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),Xw.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),Xw.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 Xni=new TextEncoder,Dot=Object.freeze({messageBuffer:Object.freeze({create:s=>new fle(s)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(s,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(Xni.encode(JSON.stringify(s,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(s,e)=>{if(!(s instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(s)))}})}),stream:Object.freeze({asReadableStream:s=>new Yni(s),asWritableStream:s=>new Jni(s)}),console,timer:Object.freeze({setTimeout(s,e,...t){const i=setTimeout(s,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(s,...e){const t=setTimeout(s,0,...e);return{dispose:()=>clearTimeout(t)}},setInterval(s,e,...t){const i=setInterval(s,e,...t);return{dispose:()=>clearInterval(i)}}})});function w0e(){return Dot}(function(s){function e(){Xw.RAL.install(Dot)}s.install=e})(w0e||(w0e={}));zPe.default=w0e;(function(s){var e=rd&&rd.__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=rd&&rd.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(s,"__esModule",{value:!0}),s.createMessageConnection=s.BrowserMessageWriter=s.BrowserMessageReader=void 0,zPe.default.install();const n=dne;t(dne,s);class o extends n.AbstractMessageReader{constructor(l){super(),this._onData=new n.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)}}s.BrowserMessageReader=o;class r extends n.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(){}}s.BrowserMessageWriter=r;function a(c,l,d,h){return d===void 0&&(d=n.NullLogger),n.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,n.createMessageConnection)(c,l,d,h)}s.createMessageConnection=a})(JN);var m$e=JN,kot={},y0e;(function(s){function e(t){return typeof t=="string"}s.is=e})(y0e||(y0e={}));var une;(function(s){function e(t){return typeof t=="string"}s.is=e})(une||(une={}));var C0e;(function(s){s.MIN_VALUE=-2147483648,s.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&s.MIN_VALUE<=t&&t<=s.MAX_VALUE}s.is=e})(C0e||(C0e={}));var s7;(function(s){s.MIN_VALUE=0,s.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&s.MIN_VALUE<=t&&t<=s.MAX_VALUE}s.is=e})(s7||(s7={}));var f_;(function(s){function e(i,n){return i===Number.MAX_VALUE&&(i=s7.MAX_VALUE),n===Number.MAX_VALUE&&(n=s7.MAX_VALUE),{line:i,character:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&Fe.uinteger(n.line)&&Fe.uinteger(n.character)}s.is=t})(f_||(f_={}));var ul;(function(s){function e(i,n,o,r){if(Fe.uinteger(i)&&Fe.uinteger(n)&&Fe.uinteger(o)&&Fe.uinteger(r))return{start:f_.create(i,n),end:f_.create(o,r)};if(f_.is(i)&&f_.is(n))return{start:i,end:n};throw new Error(`Range#create called with invalid arguments[${i}, ${n}, ${o}, ${r}]`)}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&f_.is(n.start)&&f_.is(n.end)}s.is=t})(ul||(ul={}));var o7;(function(s){function e(i,n){return{uri:i,range:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&ul.is(n.range)&&(Fe.string(n.uri)||Fe.undefined(n.uri))}s.is=t})(o7||(o7={}));var S0e;(function(s){function e(i,n,o,r){return{targetUri:i,targetRange:n,targetSelectionRange:o,originSelectionRange:r}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&ul.is(n.targetRange)&&Fe.string(n.targetUri)&&ul.is(n.targetSelectionRange)&&(ul.is(n.originSelectionRange)||Fe.undefined(n.originSelectionRange))}s.is=t})(S0e||(S0e={}));var gne;(function(s){function e(i,n,o,r){return{red:i,green:n,blue:o,alpha:r}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.numberRange(n.red,0,1)&&Fe.numberRange(n.green,0,1)&&Fe.numberRange(n.blue,0,1)&&Fe.numberRange(n.alpha,0,1)}s.is=t})(gne||(gne={}));var A0e;(function(s){function e(i,n){return{range:i,color:n}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&ul.is(n.range)&&gne.is(n.color)}s.is=t})(A0e||(A0e={}));var E0e;(function(s){function e(i,n,o){return{label:i,textEdit:n,additionalTextEdits:o}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.string(n.label)&&(Fe.undefined(n.textEdit)||Hy.is(n))&&(Fe.undefined(n.additionalTextEdits)||Fe.typedArray(n.additionalTextEdits,Hy.is))}s.is=t})(E0e||(E0e={}));var x0e;(function(s){s.Comment="comment",s.Imports="imports",s.Region="region"})(x0e||(x0e={}));var D0e;(function(s){function e(i,n,o,r,a,c){const l={startLine:i,endLine:n};return Fe.defined(o)&&(l.startCharacter=o),Fe.defined(r)&&(l.endCharacter=r),Fe.defined(a)&&(l.kind=a),Fe.defined(c)&&(l.collapsedText=c),l}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.uinteger(n.startLine)&&Fe.uinteger(n.startLine)&&(Fe.undefined(n.startCharacter)||Fe.uinteger(n.startCharacter))&&(Fe.undefined(n.endCharacter)||Fe.uinteger(n.endCharacter))&&(Fe.undefined(n.kind)||Fe.string(n.kind))}s.is=t})(D0e||(D0e={}));var fne;(function(s){function e(i,n){return{location:i,message:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&o7.is(n.location)&&Fe.string(n.message)}s.is=t})(fne||(fne={}));var k0e;(function(s){s.Error=1,s.Warning=2,s.Information=3,s.Hint=4})(k0e||(k0e={}));var I0e;(function(s){s.Unnecessary=1,s.Deprecated=2})(I0e||(I0e={}));var T0e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&Fe.string(i.href)}s.is=e})(T0e||(T0e={}));var r7;(function(s){function e(i,n,o,r,a,c){let l={range:i,message:n};return Fe.defined(o)&&(l.severity=o),Fe.defined(r)&&(l.code=r),Fe.defined(a)&&(l.source=a),Fe.defined(c)&&(l.relatedInformation=c),l}s.create=e;function t(i){var n;let o=i;return Fe.defined(o)&&ul.is(o.range)&&Fe.string(o.message)&&(Fe.number(o.severity)||Fe.undefined(o.severity))&&(Fe.integer(o.code)||Fe.string(o.code)||Fe.undefined(o.code))&&(Fe.undefined(o.codeDescription)||Fe.string((n=o.codeDescription)===null||n===void 0?void 0:n.href))&&(Fe.string(o.source)||Fe.undefined(o.source))&&(Fe.undefined(o.relatedInformation)||Fe.typedArray(o.relatedInformation,fne.is))}s.is=t})(r7||(r7={}));var vN;(function(s){function e(i,n,...o){let r={title:i,command:n};return Fe.defined(o)&&o.length>0&&(r.arguments=o),r}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.title)&&Fe.string(n.command)}s.is=t})(vN||(vN={}));var Hy;(function(s){function e(o,r){return{range:o,newText:r}}s.replace=e;function t(o,r){return{range:{start:o,end:o},newText:r}}s.insert=t;function i(o){return{range:o,newText:""}}s.del=i;function n(o){const r=o;return Fe.objectLiteral(r)&&Fe.string(r.newText)&&ul.is(r.range)}s.is=n})(Hy||(Hy={}));var nL;(function(s){function e(i,n,o){const r={label:i};return n!==void 0&&(r.needsConfirmation=n),o!==void 0&&(r.description=o),r}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&Fe.string(n.label)&&(Fe.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(Fe.string(n.description)||n.description===void 0)}s.is=t})(nL||(nL={}));var Qh;(function(s){function e(t){const i=t;return Fe.string(i)}s.is=e})(Qh||(Qh={}));var XC;(function(s){function e(o,r,a){return{range:o,newText:r,annotationId:a}}s.replace=e;function t(o,r,a){return{range:{start:o,end:o},newText:r,annotationId:a}}s.insert=t;function i(o,r){return{range:o,newText:"",annotationId:r}}s.del=i;function n(o){const r=o;return Hy.is(r)&&(nL.is(r.annotationId)||Qh.is(r.annotationId))}s.is=n})(XC||(XC={}));var a7;(function(s){function e(i,n){return{textDocument:i,edits:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&c7.is(n.textDocument)&&Array.isArray(n.edits)}s.is=t})(a7||(a7={}));var YH;(function(s){function e(i,n,o){let r={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(r.options=n),o!==void 0&&(r.annotationId=o),r}s.create=e;function t(i){let n=i;return n&&n.kind==="create"&&Fe.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||Fe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Fe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Qh.is(n.annotationId))}s.is=t})(YH||(YH={}));var JH;(function(s){function e(i,n,o,r){let a={kind:"rename",oldUri:i,newUri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),r!==void 0&&(a.annotationId=r),a}s.create=e;function t(i){let n=i;return n&&n.kind==="rename"&&Fe.string(n.oldUri)&&Fe.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||Fe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Fe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Qh.is(n.annotationId))}s.is=t})(JH||(JH={}));var XH;(function(s){function e(i,n,o){let r={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(r.options=n),o!==void 0&&(r.annotationId=o),r}s.create=e;function t(i){let n=i;return n&&n.kind==="delete"&&Fe.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||Fe.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||Fe.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||Qh.is(n.annotationId))}s.is=t})(XH||(XH={}));var pne;(function(s){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(n=>Fe.string(n.kind)?YH.is(n)||JH.is(n)||XH.is(n):a7.is(n)))}s.is=e})(pne||(pne={}));class YK{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let n,o;if(i===void 0?n=Hy.insert(e,t):Qh.is(i)?(o=i,n=XC.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),n=XC.insert(e,t,o)),this.edits.push(n),o!==void 0)return o}replace(e,t,i){let n,o;if(i===void 0?n=Hy.replace(e,t):Qh.is(i)?(o=i,n=XC.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),n=XC.replace(e,t,o)),this.edits.push(n),o!==void 0)return o}delete(e,t){let i,n;if(t===void 0?i=Hy.del(e):Qh.is(t)?(n=t,i=XC.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=XC.del(e,n)),this.edits.push(i),n!==void 0)return n}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 _$e{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(Qh.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 Zni{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new _$e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(a7.is(t)){const i=new YK(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new YK(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(c7.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 n=[],o={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(o),i=new YK(n,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 YK(i),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new _$e,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 n;nL.is(t)||Qh.is(t)?n=t:i=t;let o,r;if(n===void 0?o=YH.create(e,i):(r=Qh.is(n)?n:this._changeAnnotations.manage(n),o=YH.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}renameFile(e,t,i,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;nL.is(i)||Qh.is(i)?o=i:n=i;let r,a;if(o===void 0?r=JH.create(e,t,n):(a=Qh.is(o)?o:this._changeAnnotations.manage(o),r=JH.create(e,t,n,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 n;nL.is(t)||Qh.is(t)?n=t:i=t;let o,r;if(n===void 0?o=XH.create(e,i):(r=Qh.is(n)?n:this._changeAnnotations.manage(n),o=XH.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}}var L0e;(function(s){function e(i){return{uri:i}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)}s.is=t})(L0e||(L0e={}));var R0e;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)&&Fe.integer(n.version)}s.is=t})(R0e||(R0e={}));var c7;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)&&(n.version===null||Fe.integer(n.version))}s.is=t})(c7||(c7={}));var M0e;(function(s){function e(i,n,o,r){return{uri:i,languageId:n,version:o,text:r}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.string(n.uri)&&Fe.string(n.languageId)&&Fe.integer(n.version)&&Fe.string(n.text)}s.is=t})(M0e||(M0e={}));var mne;(function(s){s.PlainText="plaintext",s.Markdown="markdown";function e(t){const i=t;return i===s.PlainText||i===s.Markdown}s.is=e})(mne||(mne={}));var ZH;(function(s){function e(t){const i=t;return Fe.objectLiteral(t)&&mne.is(i.kind)&&Fe.string(i.value)}s.is=e})(ZH||(ZH={}));var N0e;(function(s){s.Text=1,s.Method=2,s.Function=3,s.Constructor=4,s.Field=5,s.Variable=6,s.Class=7,s.Interface=8,s.Module=9,s.Property=10,s.Unit=11,s.Value=12,s.Enum=13,s.Keyword=14,s.Snippet=15,s.Color=16,s.File=17,s.Reference=18,s.Folder=19,s.EnumMember=20,s.Constant=21,s.Struct=22,s.Event=23,s.Operator=24,s.TypeParameter=25})(N0e||(N0e={}));var P0e;(function(s){s.PlainText=1,s.Snippet=2})(P0e||(P0e={}));var F0e;(function(s){s.Deprecated=1})(F0e||(F0e={}));var O0e;(function(s){function e(i,n,o){return{newText:i,insert:n,replace:o}}s.create=e;function t(i){const n=i;return n&&Fe.string(n.newText)&&ul.is(n.insert)&&ul.is(n.replace)}s.is=t})(O0e||(O0e={}));var B0e;(function(s){s.asIs=1,s.adjustIndentation=2})(B0e||(B0e={}));var W0e;(function(s){function e(t){const i=t;return i&&(Fe.string(i.detail)||i.detail===void 0)&&(Fe.string(i.description)||i.description===void 0)}s.is=e})(W0e||(W0e={}));var H0e;(function(s){function e(t){return{label:t}}s.create=e})(H0e||(H0e={}));var U0e;(function(s){function e(t,i){return{items:t||[],isIncomplete:!!i}}s.create=e})(U0e||(U0e={}));var l7;(function(s){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s.fromPlainText=e;function t(i){const n=i;return Fe.string(n)||Fe.objectLiteral(n)&&Fe.string(n.language)&&Fe.string(n.value)}s.is=t})(l7||(l7={}));var V0e;(function(s){function e(t){let i=t;return!!i&&Fe.objectLiteral(i)&&(ZH.is(i.contents)||l7.is(i.contents)||Fe.typedArray(i.contents,l7.is))&&(t.range===void 0||ul.is(t.range))}s.is=e})(V0e||(V0e={}));var z0e;(function(s){function e(t,i){return i?{label:t,documentation:i}:{label:t}}s.create=e})(z0e||(z0e={}));var $0e;(function(s){function e(t,i,...n){let o={label:t};return Fe.defined(i)&&(o.documentation=i),Fe.defined(n)?o.parameters=n:o.parameters=[],o}s.create=e})($0e||($0e={}));var G0e;(function(s){s.Text=1,s.Read=2,s.Write=3})(G0e||(G0e={}));var K0e;(function(s){function e(t,i){let n={range:t};return Fe.number(i)&&(n.kind=i),n}s.create=e})(K0e||(K0e={}));var q0e;(function(s){s.File=1,s.Module=2,s.Namespace=3,s.Package=4,s.Class=5,s.Method=6,s.Property=7,s.Field=8,s.Constructor=9,s.Enum=10,s.Interface=11,s.Function=12,s.Variable=13,s.Constant=14,s.String=15,s.Number=16,s.Boolean=17,s.Array=18,s.Object=19,s.Key=20,s.Null=21,s.EnumMember=22,s.Struct=23,s.Event=24,s.Operator=25,s.TypeParameter=26})(q0e||(q0e={}));var Q0e;(function(s){s.Deprecated=1})(Q0e||(Q0e={}));var j0e;(function(s){function e(t,i,n,o,r){let a={name:t,kind:i,location:{uri:o,range:n}};return r&&(a.containerName=r),a}s.create=e})(j0e||(j0e={}));var Y0e;(function(s){function e(t,i,n,o){return o!==void 0?{name:t,kind:i,location:{uri:n,range:o}}:{name:t,kind:i,location:{uri:n}}}s.create=e})(Y0e||(Y0e={}));var J0e;(function(s){function e(i,n,o,r,a,c){let l={name:i,detail:n,kind:o,range:r,selectionRange:a};return c!==void 0&&(l.children=c),l}s.create=e;function t(i){let n=i;return n&&Fe.string(n.name)&&Fe.number(n.kind)&&ul.is(n.range)&&ul.is(n.selectionRange)&&(n.detail===void 0||Fe.string(n.detail))&&(n.deprecated===void 0||Fe.boolean(n.deprecated))&&(n.children===void 0||Array.isArray(n.children))&&(n.tags===void 0||Array.isArray(n.tags))}s.is=t})(J0e||(J0e={}));var X0e;(function(s){s.Empty="",s.QuickFix="quickfix",s.Refactor="refactor",s.RefactorExtract="refactor.extract",s.RefactorInline="refactor.inline",s.RefactorRewrite="refactor.rewrite",s.Source="source",s.SourceOrganizeImports="source.organizeImports",s.SourceFixAll="source.fixAll"})(X0e||(X0e={}));var d7;(function(s){s.Invoked=1,s.Automatic=2})(d7||(d7={}));var Z0e;(function(s){function e(i,n,o){let r={diagnostics:i};return n!=null&&(r.only=n),o!=null&&(r.triggerKind=o),r}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.typedArray(n.diagnostics,r7.is)&&(n.only===void 0||Fe.typedArray(n.only,Fe.string))&&(n.triggerKind===void 0||n.triggerKind===d7.Invoked||n.triggerKind===d7.Automatic)}s.is=t})(Z0e||(Z0e={}));var e1e;(function(s){function e(i,n,o){let r={title:i},a=!0;return typeof n=="string"?(a=!1,r.kind=n):vN.is(n)?r.command=n:r.edit=n,a&&o!==void 0&&(r.kind=o),r}s.create=e;function t(i){let n=i;return n&&Fe.string(n.title)&&(n.diagnostics===void 0||Fe.typedArray(n.diagnostics,r7.is))&&(n.kind===void 0||Fe.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||vN.is(n.command))&&(n.isPreferred===void 0||Fe.boolean(n.isPreferred))&&(n.edit===void 0||pne.is(n.edit))}s.is=t})(e1e||(e1e={}));var t1e;(function(s){function e(i,n){let o={range:i};return Fe.defined(n)&&(o.data=n),o}s.create=e;function t(i){let n=i;return Fe.defined(n)&&ul.is(n.range)&&(Fe.undefined(n.command)||vN.is(n.command))}s.is=t})(t1e||(t1e={}));var i1e;(function(s){function e(i,n){return{tabSize:i,insertSpaces:n}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&Fe.uinteger(n.tabSize)&&Fe.boolean(n.insertSpaces)}s.is=t})(i1e||(i1e={}));var n1e;(function(s){function e(i,n,o){return{range:i,target:n,data:o}}s.create=e;function t(i){let n=i;return Fe.defined(n)&&ul.is(n.range)&&(Fe.undefined(n.target)||Fe.string(n.target))}s.is=t})(n1e||(n1e={}));var s1e;(function(s){function e(i,n){return{range:i,parent:n}}s.create=e;function t(i){let n=i;return Fe.objectLiteral(n)&&ul.is(n.range)&&(n.parent===void 0||s.is(n.parent))}s.is=t})(s1e||(s1e={}));var o1e;(function(s){s.namespace="namespace",s.type="type",s.class="class",s.enum="enum",s.interface="interface",s.struct="struct",s.typeParameter="typeParameter",s.parameter="parameter",s.variable="variable",s.property="property",s.enumMember="enumMember",s.event="event",s.function="function",s.method="method",s.macro="macro",s.keyword="keyword",s.modifier="modifier",s.comment="comment",s.string="string",s.number="number",s.regexp="regexp",s.operator="operator",s.decorator="decorator"})(o1e||(o1e={}));var r1e;(function(s){s.declaration="declaration",s.definition="definition",s.readonly="readonly",s.static="static",s.deprecated="deprecated",s.abstract="abstract",s.async="async",s.modification="modification",s.documentation="documentation",s.defaultLibrary="defaultLibrary"})(r1e||(r1e={}));var a1e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}s.is=e})(a1e||(a1e={}));var c1e;(function(s){function e(i,n){return{range:i,text:n}}s.create=e;function t(i){const n=i;return n!=null&&ul.is(n.range)&&Fe.string(n.text)}s.is=t})(c1e||(c1e={}));var l1e;(function(s){function e(i,n,o){return{range:i,variableName:n,caseSensitiveLookup:o}}s.create=e;function t(i){const n=i;return n!=null&&ul.is(n.range)&&Fe.boolean(n.caseSensitiveLookup)&&(Fe.string(n.variableName)||n.variableName===void 0)}s.is=t})(l1e||(l1e={}));var d1e;(function(s){function e(i,n){return{range:i,expression:n}}s.create=e;function t(i){const n=i;return n!=null&&ul.is(n.range)&&(Fe.string(n.expression)||n.expression===void 0)}s.is=t})(d1e||(d1e={}));var h1e;(function(s){function e(i,n){return{frameId:i,stoppedLocation:n}}s.create=e;function t(i){const n=i;return Fe.defined(n)&&ul.is(i.stoppedLocation)}s.is=t})(h1e||(h1e={}));var _ne;(function(s){s.Type=1,s.Parameter=2;function e(t){return t===1||t===2}s.is=e})(_ne||(_ne={}));var vne;(function(s){function e(i){return{value:i}}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&(n.tooltip===void 0||Fe.string(n.tooltip)||ZH.is(n.tooltip))&&(n.location===void 0||o7.is(n.location))&&(n.command===void 0||vN.is(n.command))}s.is=t})(vne||(vne={}));var u1e;(function(s){function e(i,n,o){const r={position:i,label:n};return o!==void 0&&(r.kind=o),r}s.create=e;function t(i){const n=i;return Fe.objectLiteral(n)&&f_.is(n.position)&&(Fe.string(n.label)||Fe.typedArray(n.label,vne.is))&&(n.kind===void 0||_ne.is(n.kind))&&n.textEdits===void 0||Fe.typedArray(n.textEdits,Hy.is)&&(n.tooltip===void 0||Fe.string(n.tooltip)||ZH.is(n.tooltip))&&(n.paddingLeft===void 0||Fe.boolean(n.paddingLeft))&&(n.paddingRight===void 0||Fe.boolean(n.paddingRight))}s.is=t})(u1e||(u1e={}));var g1e;(function(s){function e(t){return{kind:"snippet",value:t}}s.createSnippet=e})(g1e||(g1e={}));var f1e;(function(s){function e(t,i,n,o){return{insertText:t,filterText:i,range:n,command:o}}s.create=e})(f1e||(f1e={}));var p1e;(function(s){function e(t){return{items:t}}s.create=e})(p1e||(p1e={}));var m1e;(function(s){s.Invoked=0,s.Automatic=1})(m1e||(m1e={}));var _1e;(function(s){function e(t,i){return{range:t,text:i}}s.create=e})(_1e||(_1e={}));var v1e;(function(s){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}s.create=e})(v1e||(v1e={}));var b1e;(function(s){function e(t){const i=t;return Fe.objectLiteral(i)&&une.is(i.uri)&&Fe.string(i.name)}s.is=e})(b1e||(b1e={}));const esi=[` +`)),rt){const Ci=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Tn.log(`Received response '${rt.method} - (${Se.id})' in ${Date.now()-rt.timerStart}ms.${Ci}`,Ft)}else Tn.log(`Received response ${Se.id} without active response promise.`,Ft)}else zn("receive-response",Se)}function zn(Se,rt){if(!Tn||ss===u.Off)return;const Ft={isLSPMessage:!0,type:Se,message:rt,timestamp:Date.now()};Tn.log(Ft)}function Cs(){if(th())throw new w(b.Closed,"Connection is closed.");if(Dc())throw new w(b.Disposed,"Connection is disposed.")}function Wo(){if(zc())throw new w(b.AlreadyListening,"Connection is already listening")}function Ha(){if(!zc())throw new Error("Call listen() first.")}function ea(Se){return Se===void 0?null:Se}function Mh(Se){if(Se!==null)return Se}function le(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}function dr(Se,rt){switch(Se){case i.ParameterStructures.auto:return le(rt)?Mh(rt):[ea(rt)];case i.ParameterStructures.byName:if(!le(rt))throw new Error("Received parameters by name but param is not an object literal.");return Mh(rt);case i.ParameterStructures.byPosition:return[ea(rt)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}function io(Se,rt){let Ft;const Ci=Se.numberOfParams;switch(Ci){case 0:Ft=void 0;break;case 1:Ft=dr(Se.parameterStructures,rt[0]);break;default:Ft=[];for(let Ot=0;Ot{Cs();let Ft,Ci;if(t.string(Se)){Ft=Se;const q=rt[0];let de=0,T=i.ParameterStructures.auto;i.ParameterStructures.is(q)&&(de=1,T=q);let ne=rt.length;const ye=ne-de;switch(ye){case 0:Ci=void 0;break;case 1:Ci=dr(T,rt[de]);break;default:if(T===i.ParameterStructures.byName)throw new Error(`Received ${ye} parameters for 'by Name' notification parameter structure.`);Ci=rt.slice(de,ne).map(O=>ea(O));break}}else{const q=rt;Ft=Se.method,Ci=io(Se,q)}const Ot={jsonrpc:xt,method:Ft,params:Ci};return be(Ot),ie.write(Ot).catch(q=>{throw Re.error("Sending notification failed."),q})},onNotification:(Se,rt)=>{Cs();let Ft;return t.func(Se)?ns=Se:rt&&(t.string(Se)?(Ft=Se,zs.set(Se,{type:void 0,handler:rt})):(Ft=Se.method,zs.set(Se.method,{type:Se,handler:rt}))),{dispose:()=>{Ft!==void 0?zs.delete(Ft):ns=void 0}}},onProgress:(Se,rt,Ft)=>{if(Pn.has(rt))throw new Error(`Progress handler for token ${rt} already registered`);return Pn.set(rt,Ft),{dispose:()=>{Pn.delete(rt)}}},sendProgress:(Se,rt,Ft)=>un.sendNotification(l.type,{token:rt,value:Ft}),onUnhandledProgress:pc.event,sendRequest:(Se,...rt)=>{Cs(),Ha();let Ft,Ci,Ot;if(t.string(Se)){Ft=Se;const ne=rt[0],ye=rt[rt.length-1];let O=0,$=i.ParameterStructures.auto;i.ParameterStructures.is(ne)&&(O=1,$=ne);let se=rt.length;r.CancellationToken.is(ye)&&(se=se-1,Ot=ye);const Ke=se-O;switch(Ke){case 0:Ci=void 0;break;case 1:Ci=dr($,rt[O]);break;default:if($===i.ParameterStructures.byName)throw new Error(`Received ${Ke} parameters for 'by Name' request parameter structure.`);Ci=rt.slice(O,se).map(Bi=>ea(Bi));break}}else{const ne=rt;Ft=Se.method,Ci=io(Se,ne);const ye=Se.numberOfParams;Ot=r.CancellationToken.is(ne[ye])?ne[ye]:void 0}const q=yt++;let de;Ot&&(de=Ot.onCancellationRequested(()=>{const ne=$s.sender.sendCancellation(un,q);return ne===void 0?(Re.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):ne.catch(()=>{Re.log(`Sending cancellation messages for id ${q} failed`)})}));const T={jsonrpc:xt,id:q,method:Ft,params:Ci};return Rh(T),typeof $s.sender.enableCancellation=="function"&&$s.sender.enableCancellation(T),new Promise(async(ne,ye)=>{const O=Ke=>{ne(Ke),$s.sender.cleanup(q),de?.dispose()},$=Ke=>{ye(Ke),$s.sender.cleanup(q),de?.dispose()},se={method:Ft,timerStart:Date.now(),resolve:O,reject:$};try{await ie.write(T),Zo.set(q,se)}catch(Ke){throw Re.error("Sending request failed."),se.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,Ke.message?Ke.message:"Unknown reason")),Ke}})},onRequest:(Se,rt)=>{Cs();let Ft=null;return h.is(Se)?(Ft=void 0,Ji=Se):t.string(Se)?(Ft=null,rt!==void 0&&(Ft=Se,Ii.set(Se,{handler:rt,type:void 0}))):rt!==void 0&&(Ft=Se.method,Ii.set(Se.method,{type:Se,handler:rt})),{dispose:()=>{Ft!==null&&(Ft!==void 0?Ii.delete(Ft):Ji=void 0)}}},hasPendingResponse:()=>Zo.size>0,trace:async(Se,rt,Ft)=>{let Ci=!1,Ot=p.Text;Ft!==void 0&&(t.boolean(Ft)?Ci=Ft:(Ci=Ft.sendNotification||!1,Ot=Ft.traceFormat||p.Text)),ss=Se,Oo=Ot,ss===u.Off?Tn=void 0:Tn=rt,Ci&&!th()&&!Dc()&&await un.sendNotification(m.type,{value:u.toString(Se)})},onError:md.event,onClose:Fn.event,onUnhandledNotification:Zd.event,onDispose:Vc.event,end:()=>{ie.end()},dispose:()=>{if(Dc())return;Ba=G.Disposed,Vc.fire(void 0);const Se=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const rt of Zo.values())rt.reject(Se);Zo=new Map,Di=new Map,Zr=new Set,ds=new n.LinkedMap,t.func(ie.dispose)&&ie.dispose(),t.func(K.dispose)&&K.dispose()},listen:()=>{Cs(),Wo(),Ba=G.Listening,K.listen($c)},inspect:()=>{(0,e.default)().console.log("inspect")}};return un.onNotification(v.type,Se=>{if(ss===u.Off||!Tn)return;const rt=ss===u.Verbose||ss===u.Compact;Tn.log(Se.message,rt?Se.verbose:void 0)}),un.onNotification(l.type,Se=>{const rt=Pn.get(Se.token);rt?rt(Se.value):pc.fire(Se)}),un}s.createMessageConnection=j}(tge)),tge}var a$e;function a0e(){return a$e||(a$e=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.ProgressType=s.ProgressToken=s.createMessageConnection=s.NullLogger=s.ConnectionOptions=s.ConnectionStrategy=s.AbstractMessageBuffer=s.WriteableStreamMessageWriter=s.AbstractMessageWriter=s.MessageWriter=s.ReadableStreamMessageReader=s.AbstractMessageReader=s.MessageReader=s.SharedArrayReceiverStrategy=s.SharedArraySenderStrategy=s.CancellationToken=s.CancellationTokenSource=s.Emitter=s.Event=s.Disposable=s.LRUCache=s.Touch=s.LinkedMap=s.ParameterStructures=s.NotificationType9=s.NotificationType8=s.NotificationType7=s.NotificationType6=s.NotificationType5=s.NotificationType4=s.NotificationType3=s.NotificationType2=s.NotificationType1=s.NotificationType0=s.NotificationType=s.ErrorCodes=s.ResponseError=s.RequestType9=s.RequestType8=s.RequestType7=s.RequestType6=s.RequestType5=s.RequestType4=s.RequestType3=s.RequestType2=s.RequestType1=s.RequestType0=s.RequestType=s.Message=s.RAL=void 0,s.MessageStrategy=s.CancellationStrategy=s.CancellationSenderStrategy=s.CancellationReceiverStrategy=s.ConnectionError=s.ConnectionErrors=s.LogTraceNotification=s.SetTraceNotification=s.TraceFormat=s.TraceValues=s.Trace=void 0;const e=got();Object.defineProperty(s,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(s,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(s,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(s,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(s,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(s,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(s,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(s,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(s,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(s,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(s,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(s,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(s,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(s,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(s,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(s,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(s,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(s,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(s,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(s,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(s,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(s,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(s,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(s,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(s,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(s,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=fot();Object.defineProperty(s,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(s,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(s,"Touch",{enumerable:!0,get:function(){return t.Touch}});const i=zii();Object.defineProperty(s,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const n=uG();Object.defineProperty(s,"Event",{enumerable:!0,get:function(){return n.Event}}),Object.defineProperty(s,"Emitter",{enumerable:!0,get:function(){return n.Emitter}});const o=RPe();Object.defineProperty(s,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(s,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const r=$ii();Object.defineProperty(s,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return r.SharedArraySenderStrategy}}),Object.defineProperty(s,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return r.SharedArrayReceiverStrategy}});const a=Gii();Object.defineProperty(s,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(s,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(s,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=Kii();Object.defineProperty(s,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(s,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(s,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=qii();Object.defineProperty(s,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const d=Qii();Object.defineProperty(s,"ConnectionStrategy",{enumerable:!0,get:function(){return d.ConnectionStrategy}}),Object.defineProperty(s,"ConnectionOptions",{enumerable:!0,get:function(){return d.ConnectionOptions}}),Object.defineProperty(s,"NullLogger",{enumerable:!0,get:function(){return d.NullLogger}}),Object.defineProperty(s,"createMessageConnection",{enumerable:!0,get:function(){return d.createMessageConnection}}),Object.defineProperty(s,"ProgressToken",{enumerable:!0,get:function(){return d.ProgressToken}}),Object.defineProperty(s,"ProgressType",{enumerable:!0,get:function(){return d.ProgressType}}),Object.defineProperty(s,"Trace",{enumerable:!0,get:function(){return d.Trace}}),Object.defineProperty(s,"TraceValues",{enumerable:!0,get:function(){return d.TraceValues}}),Object.defineProperty(s,"TraceFormat",{enumerable:!0,get:function(){return d.TraceFormat}}),Object.defineProperty(s,"SetTraceNotification",{enumerable:!0,get:function(){return d.SetTraceNotification}}),Object.defineProperty(s,"LogTraceNotification",{enumerable:!0,get:function(){return d.LogTraceNotification}}),Object.defineProperty(s,"ConnectionErrors",{enumerable:!0,get:function(){return d.ConnectionErrors}}),Object.defineProperty(s,"ConnectionError",{enumerable:!0,get:function(){return d.ConnectionError}}),Object.defineProperty(s,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return d.CancellationReceiverStrategy}}),Object.defineProperty(s,"CancellationSenderStrategy",{enumerable:!0,get:function(){return d.CancellationSenderStrategy}}),Object.defineProperty(s,"CancellationStrategy",{enumerable:!0,get:function(){return d.CancellationStrategy}}),Object.defineProperty(s,"MessageStrategy",{enumerable:!0,get:function(){return d.MessageStrategy}});const h=QN();s.RAL=h.default}(ege)),ege}Object.defineProperty(LPe,"__esModule",{value:!0});const jw=a0e();class ale extends jw.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return ale.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)}}ale.emptyBuffer=new Uint8Array(0);class jii{constructor(e){this.socket=e,this._onData=new jw.Emitter,this._messageListener=t=>{t.data.arrayBuffer().then(n=>{this._onData.fire(new Uint8Array(n))},()=>{(0,jw.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),jw.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),jw.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),jw.Disposable.create(()=>this.socket.removeEventListener("end",e))}onData(e){return this._onData.event(e)}}class Yii{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),jw.Disposable.create(()=>this.socket.removeEventListener("close",e))}onError(e){return this.socket.addEventListener("error",e),jw.Disposable.create(()=>this.socket.removeEventListener("error",e))}onEnd(e){return this.socket.addEventListener("end",e),jw.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 Jii=new TextEncoder,mot=Object.freeze({messageBuffer:Object.freeze({create:s=>new ale(s)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(s,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(Jii.encode(JSON.stringify(s,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(s,e)=>{if(!(s instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(e.charset).decode(s)))}})}),stream:Object.freeze({asReadableStream:s=>new jii(s),asWritableStream:s=>new Yii(s)}),console,timer:Object.freeze({setTimeout(s,e,...t){const i=setTimeout(s,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(s,...e){const t=setTimeout(s,0,...e);return{dispose:()=>clearTimeout(t)}},setInterval(s,e,...t){const i=setInterval(s,e,...t);return{dispose:()=>clearInterval(i)}}})});function c0e(){return mot}(function(s){function e(){jw.RAL.install(mot)}s.install=e})(c0e||(c0e={}));LPe.default=c0e;(function(s){var e=sd&&sd.__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=sd&&sd.__exportStar||function(c,l){for(var d in c)d!=="default"&&!Object.prototype.hasOwnProperty.call(l,d)&&e(l,c,d)};Object.defineProperty(s,"__esModule",{value:!0}),s.createMessageConnection=s.BrowserMessageWriter=s.BrowserMessageReader=void 0,LPe.default.install();const n=a0e();t(a0e(),s);class o extends n.AbstractMessageReader{constructor(l){super(),this._onData=new n.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)}}s.BrowserMessageReader=o;class r extends n.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(){}}s.BrowserMessageWriter=r;function a(c,l,d,h){return d===void 0&&(d=n.NullLogger),n.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,n.createMessageConnection)(c,l,d,h)}s.createMessageConnection=a})(qN);var c$e=qN,_ot={},l0e;(function(s){function e(t){return typeof t=="string"}s.is=e})(l0e||(l0e={}));var cne;(function(s){function e(t){return typeof t=="string"}s.is=e})(cne||(cne={}));var d0e;(function(s){s.MIN_VALUE=-2147483648,s.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&s.MIN_VALUE<=t&&t<=s.MAX_VALUE}s.is=e})(d0e||(d0e={}));var e7;(function(s){s.MIN_VALUE=0,s.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&s.MIN_VALUE<=t&&t<=s.MAX_VALUE}s.is=e})(e7||(e7={}));var h_;(function(s){function e(i,n){return i===Number.MAX_VALUE&&(i=e7.MAX_VALUE),n===Number.MAX_VALUE&&(n=e7.MAX_VALUE),{line:i,character:n}}s.create=e;function t(i){let n=i;return Oe.objectLiteral(n)&&Oe.uinteger(n.line)&&Oe.uinteger(n.character)}s.is=t})(h_||(h_={}));var hl;(function(s){function e(i,n,o,r){if(Oe.uinteger(i)&&Oe.uinteger(n)&&Oe.uinteger(o)&&Oe.uinteger(r))return{start:h_.create(i,n),end:h_.create(o,r)};if(h_.is(i)&&h_.is(n))return{start:i,end:n};throw new Error(`Range#create called with invalid arguments[${i}, ${n}, ${o}, ${r}]`)}s.create=e;function t(i){let n=i;return Oe.objectLiteral(n)&&h_.is(n.start)&&h_.is(n.end)}s.is=t})(hl||(hl={}));var t7;(function(s){function e(i,n){return{uri:i,range:n}}s.create=e;function t(i){let n=i;return Oe.objectLiteral(n)&&hl.is(n.range)&&(Oe.string(n.uri)||Oe.undefined(n.uri))}s.is=t})(t7||(t7={}));var h0e;(function(s){function e(i,n,o,r){return{targetUri:i,targetRange:n,targetSelectionRange:o,originSelectionRange:r}}s.create=e;function t(i){let n=i;return Oe.objectLiteral(n)&&hl.is(n.targetRange)&&Oe.string(n.targetUri)&&hl.is(n.targetSelectionRange)&&(hl.is(n.originSelectionRange)||Oe.undefined(n.originSelectionRange))}s.is=t})(h0e||(h0e={}));var lne;(function(s){function e(i,n,o,r){return{red:i,green:n,blue:o,alpha:r}}s.create=e;function t(i){const n=i;return Oe.objectLiteral(n)&&Oe.numberRange(n.red,0,1)&&Oe.numberRange(n.green,0,1)&&Oe.numberRange(n.blue,0,1)&&Oe.numberRange(n.alpha,0,1)}s.is=t})(lne||(lne={}));var u0e;(function(s){function e(i,n){return{range:i,color:n}}s.create=e;function t(i){const n=i;return Oe.objectLiteral(n)&&hl.is(n.range)&&lne.is(n.color)}s.is=t})(u0e||(u0e={}));var g0e;(function(s){function e(i,n,o){return{label:i,textEdit:n,additionalTextEdits:o}}s.create=e;function t(i){const n=i;return Oe.objectLiteral(n)&&Oe.string(n.label)&&(Oe.undefined(n.textEdit)||Oy.is(n))&&(Oe.undefined(n.additionalTextEdits)||Oe.typedArray(n.additionalTextEdits,Oy.is))}s.is=t})(g0e||(g0e={}));var f0e;(function(s){s.Comment="comment",s.Imports="imports",s.Region="region"})(f0e||(f0e={}));var p0e;(function(s){function e(i,n,o,r,a,c){const l={startLine:i,endLine:n};return Oe.defined(o)&&(l.startCharacter=o),Oe.defined(r)&&(l.endCharacter=r),Oe.defined(a)&&(l.kind=a),Oe.defined(c)&&(l.collapsedText=c),l}s.create=e;function t(i){const n=i;return Oe.objectLiteral(n)&&Oe.uinteger(n.startLine)&&Oe.uinteger(n.startLine)&&(Oe.undefined(n.startCharacter)||Oe.uinteger(n.startCharacter))&&(Oe.undefined(n.endCharacter)||Oe.uinteger(n.endCharacter))&&(Oe.undefined(n.kind)||Oe.string(n.kind))}s.is=t})(p0e||(p0e={}));var dne;(function(s){function e(i,n){return{location:i,message:n}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&t7.is(n.location)&&Oe.string(n.message)}s.is=t})(dne||(dne={}));var m0e;(function(s){s.Error=1,s.Warning=2,s.Information=3,s.Hint=4})(m0e||(m0e={}));var _0e;(function(s){s.Unnecessary=1,s.Deprecated=2})(_0e||(_0e={}));var v0e;(function(s){function e(t){const i=t;return Oe.objectLiteral(i)&&Oe.string(i.href)}s.is=e})(v0e||(v0e={}));var i7;(function(s){function e(i,n,o,r,a,c){let l={range:i,message:n};return Oe.defined(o)&&(l.severity=o),Oe.defined(r)&&(l.code=r),Oe.defined(a)&&(l.source=a),Oe.defined(c)&&(l.relatedInformation=c),l}s.create=e;function t(i){var n;let o=i;return Oe.defined(o)&&hl.is(o.range)&&Oe.string(o.message)&&(Oe.number(o.severity)||Oe.undefined(o.severity))&&(Oe.integer(o.code)||Oe.string(o.code)||Oe.undefined(o.code))&&(Oe.undefined(o.codeDescription)||Oe.string((n=o.codeDescription)===null||n===void 0?void 0:n.href))&&(Oe.string(o.source)||Oe.undefined(o.source))&&(Oe.undefined(o.relatedInformation)||Oe.typedArray(o.relatedInformation,dne.is))}s.is=t})(i7||(i7={}));var fN;(function(s){function e(i,n,...o){let r={title:i,command:n};return Oe.defined(o)&&o.length>0&&(r.arguments=o),r}s.create=e;function t(i){let n=i;return Oe.defined(n)&&Oe.string(n.title)&&Oe.string(n.command)}s.is=t})(fN||(fN={}));var Oy;(function(s){function e(o,r){return{range:o,newText:r}}s.replace=e;function t(o,r){return{range:{start:o,end:o},newText:r}}s.insert=t;function i(o){return{range:o,newText:""}}s.del=i;function n(o){const r=o;return Oe.objectLiteral(r)&&Oe.string(r.newText)&&hl.is(r.range)}s.is=n})(Oy||(Oy={}));var ZT;(function(s){function e(i,n,o){const r={label:i};return n!==void 0&&(r.needsConfirmation=n),o!==void 0&&(r.description=o),r}s.create=e;function t(i){const n=i;return Oe.objectLiteral(n)&&Oe.string(n.label)&&(Oe.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(Oe.string(n.description)||n.description===void 0)}s.is=t})(ZT||(ZT={}));var qh;(function(s){function e(t){const i=t;return Oe.string(i)}s.is=e})(qh||(qh={}));var JC;(function(s){function e(o,r,a){return{range:o,newText:r,annotationId:a}}s.replace=e;function t(o,r,a){return{range:{start:o,end:o},newText:r,annotationId:a}}s.insert=t;function i(o,r){return{range:o,newText:"",annotationId:r}}s.del=i;function n(o){const r=o;return Oy.is(r)&&(ZT.is(r.annotationId)||qh.is(r.annotationId))}s.is=n})(JC||(JC={}));var n7;(function(s){function e(i,n){return{textDocument:i,edits:n}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&s7.is(n.textDocument)&&Array.isArray(n.edits)}s.is=t})(n7||(n7={}));var GH;(function(s){function e(i,n,o){let r={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(r.options=n),o!==void 0&&(r.annotationId=o),r}s.create=e;function t(i){let n=i;return n&&n.kind==="create"&&Oe.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||Oe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Oe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||qh.is(n.annotationId))}s.is=t})(GH||(GH={}));var KH;(function(s){function e(i,n,o,r){let a={kind:"rename",oldUri:i,newUri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),r!==void 0&&(a.annotationId=r),a}s.create=e;function t(i){let n=i;return n&&n.kind==="rename"&&Oe.string(n.oldUri)&&Oe.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||Oe.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||Oe.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||qh.is(n.annotationId))}s.is=t})(KH||(KH={}));var qH;(function(s){function e(i,n,o){let r={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(r.options=n),o!==void 0&&(r.annotationId=o),r}s.create=e;function t(i){let n=i;return n&&n.kind==="delete"&&Oe.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||Oe.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||Oe.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||qh.is(n.annotationId))}s.is=t})(qH||(qH={}));var hne;(function(s){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(n=>Oe.string(n.kind)?GH.is(n)||KH.is(n)||qH.is(n):n7.is(n)))}s.is=e})(hne||(hne={}));class QK{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,i){let n,o;if(i===void 0?n=Oy.insert(e,t):qh.is(i)?(o=i,n=JC.insert(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),n=JC.insert(e,t,o)),this.edits.push(n),o!==void 0)return o}replace(e,t,i){let n,o;if(i===void 0?n=Oy.replace(e,t):qh.is(i)?(o=i,n=JC.replace(e,t,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),n=JC.replace(e,t,o)),this.edits.push(n),o!==void 0)return o}delete(e,t){let i,n;if(t===void 0?i=Oy.del(e):qh.is(t)?(n=t,i=JC.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),i=JC.del(e,n)),this.edits.push(i),n!==void 0)return n}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 l$e{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(qh.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 Xii{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new l$e(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(n7.is(t)){const i=new QK(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=i}})):e.changes&&Object.keys(e.changes).forEach(t=>{const i=new QK(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(s7.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 n=[],o={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(o),i=new QK(n,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 QK(i),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new l$e,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 n;ZT.is(t)||qh.is(t)?n=t:i=t;let o,r;if(n===void 0?o=GH.create(e,i):(r=qh.is(n)?n:this._changeAnnotations.manage(n),o=GH.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}renameFile(e,t,i,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;ZT.is(i)||qh.is(i)?o=i:n=i;let r,a;if(o===void 0?r=KH.create(e,t,n):(a=qh.is(o)?o:this._changeAnnotations.manage(o),r=KH.create(e,t,n,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 n;ZT.is(t)||qh.is(t)?n=t:i=t;let o,r;if(n===void 0?o=qH.create(e,i):(r=qh.is(n)?n:this._changeAnnotations.manage(n),o=qH.create(e,i,r)),this._workspaceEdit.documentChanges.push(o),r!==void 0)return r}}var b0e;(function(s){function e(i){return{uri:i}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&Oe.string(n.uri)}s.is=t})(b0e||(b0e={}));var w0e;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&Oe.string(n.uri)&&Oe.integer(n.version)}s.is=t})(w0e||(w0e={}));var s7;(function(s){function e(i,n){return{uri:i,version:n}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&Oe.string(n.uri)&&(n.version===null||Oe.integer(n.version))}s.is=t})(s7||(s7={}));var y0e;(function(s){function e(i,n,o,r){return{uri:i,languageId:n,version:o,text:r}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&Oe.string(n.uri)&&Oe.string(n.languageId)&&Oe.integer(n.version)&&Oe.string(n.text)}s.is=t})(y0e||(y0e={}));var une;(function(s){s.PlainText="plaintext",s.Markdown="markdown";function e(t){const i=t;return i===s.PlainText||i===s.Markdown}s.is=e})(une||(une={}));var QH;(function(s){function e(t){const i=t;return Oe.objectLiteral(t)&&une.is(i.kind)&&Oe.string(i.value)}s.is=e})(QH||(QH={}));var C0e;(function(s){s.Text=1,s.Method=2,s.Function=3,s.Constructor=4,s.Field=5,s.Variable=6,s.Class=7,s.Interface=8,s.Module=9,s.Property=10,s.Unit=11,s.Value=12,s.Enum=13,s.Keyword=14,s.Snippet=15,s.Color=16,s.File=17,s.Reference=18,s.Folder=19,s.EnumMember=20,s.Constant=21,s.Struct=22,s.Event=23,s.Operator=24,s.TypeParameter=25})(C0e||(C0e={}));var S0e;(function(s){s.PlainText=1,s.Snippet=2})(S0e||(S0e={}));var A0e;(function(s){s.Deprecated=1})(A0e||(A0e={}));var E0e;(function(s){function e(i,n,o){return{newText:i,insert:n,replace:o}}s.create=e;function t(i){const n=i;return n&&Oe.string(n.newText)&&hl.is(n.insert)&&hl.is(n.replace)}s.is=t})(E0e||(E0e={}));var x0e;(function(s){s.asIs=1,s.adjustIndentation=2})(x0e||(x0e={}));var D0e;(function(s){function e(t){const i=t;return i&&(Oe.string(i.detail)||i.detail===void 0)&&(Oe.string(i.description)||i.description===void 0)}s.is=e})(D0e||(D0e={}));var k0e;(function(s){function e(t){return{label:t}}s.create=e})(k0e||(k0e={}));var I0e;(function(s){function e(t,i){return{items:t||[],isIncomplete:!!i}}s.create=e})(I0e||(I0e={}));var o7;(function(s){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}s.fromPlainText=e;function t(i){const n=i;return Oe.string(n)||Oe.objectLiteral(n)&&Oe.string(n.language)&&Oe.string(n.value)}s.is=t})(o7||(o7={}));var T0e;(function(s){function e(t){let i=t;return!!i&&Oe.objectLiteral(i)&&(QH.is(i.contents)||o7.is(i.contents)||Oe.typedArray(i.contents,o7.is))&&(t.range===void 0||hl.is(t.range))}s.is=e})(T0e||(T0e={}));var L0e;(function(s){function e(t,i){return i?{label:t,documentation:i}:{label:t}}s.create=e})(L0e||(L0e={}));var R0e;(function(s){function e(t,i,...n){let o={label:t};return Oe.defined(i)&&(o.documentation=i),Oe.defined(n)?o.parameters=n:o.parameters=[],o}s.create=e})(R0e||(R0e={}));var M0e;(function(s){s.Text=1,s.Read=2,s.Write=3})(M0e||(M0e={}));var N0e;(function(s){function e(t,i){let n={range:t};return Oe.number(i)&&(n.kind=i),n}s.create=e})(N0e||(N0e={}));var P0e;(function(s){s.File=1,s.Module=2,s.Namespace=3,s.Package=4,s.Class=5,s.Method=6,s.Property=7,s.Field=8,s.Constructor=9,s.Enum=10,s.Interface=11,s.Function=12,s.Variable=13,s.Constant=14,s.String=15,s.Number=16,s.Boolean=17,s.Array=18,s.Object=19,s.Key=20,s.Null=21,s.EnumMember=22,s.Struct=23,s.Event=24,s.Operator=25,s.TypeParameter=26})(P0e||(P0e={}));var F0e;(function(s){s.Deprecated=1})(F0e||(F0e={}));var O0e;(function(s){function e(t,i,n,o,r){let a={name:t,kind:i,location:{uri:o,range:n}};return r&&(a.containerName=r),a}s.create=e})(O0e||(O0e={}));var B0e;(function(s){function e(t,i,n,o){return o!==void 0?{name:t,kind:i,location:{uri:n,range:o}}:{name:t,kind:i,location:{uri:n}}}s.create=e})(B0e||(B0e={}));var W0e;(function(s){function e(i,n,o,r,a,c){let l={name:i,detail:n,kind:o,range:r,selectionRange:a};return c!==void 0&&(l.children=c),l}s.create=e;function t(i){let n=i;return n&&Oe.string(n.name)&&Oe.number(n.kind)&&hl.is(n.range)&&hl.is(n.selectionRange)&&(n.detail===void 0||Oe.string(n.detail))&&(n.deprecated===void 0||Oe.boolean(n.deprecated))&&(n.children===void 0||Array.isArray(n.children))&&(n.tags===void 0||Array.isArray(n.tags))}s.is=t})(W0e||(W0e={}));var H0e;(function(s){s.Empty="",s.QuickFix="quickfix",s.Refactor="refactor",s.RefactorExtract="refactor.extract",s.RefactorInline="refactor.inline",s.RefactorRewrite="refactor.rewrite",s.Source="source",s.SourceOrganizeImports="source.organizeImports",s.SourceFixAll="source.fixAll"})(H0e||(H0e={}));var r7;(function(s){s.Invoked=1,s.Automatic=2})(r7||(r7={}));var U0e;(function(s){function e(i,n,o){let r={diagnostics:i};return n!=null&&(r.only=n),o!=null&&(r.triggerKind=o),r}s.create=e;function t(i){let n=i;return Oe.defined(n)&&Oe.typedArray(n.diagnostics,i7.is)&&(n.only===void 0||Oe.typedArray(n.only,Oe.string))&&(n.triggerKind===void 0||n.triggerKind===r7.Invoked||n.triggerKind===r7.Automatic)}s.is=t})(U0e||(U0e={}));var V0e;(function(s){function e(i,n,o){let r={title:i},a=!0;return typeof n=="string"?(a=!1,r.kind=n):fN.is(n)?r.command=n:r.edit=n,a&&o!==void 0&&(r.kind=o),r}s.create=e;function t(i){let n=i;return n&&Oe.string(n.title)&&(n.diagnostics===void 0||Oe.typedArray(n.diagnostics,i7.is))&&(n.kind===void 0||Oe.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||fN.is(n.command))&&(n.isPreferred===void 0||Oe.boolean(n.isPreferred))&&(n.edit===void 0||hne.is(n.edit))}s.is=t})(V0e||(V0e={}));var z0e;(function(s){function e(i,n){let o={range:i};return Oe.defined(n)&&(o.data=n),o}s.create=e;function t(i){let n=i;return Oe.defined(n)&&hl.is(n.range)&&(Oe.undefined(n.command)||fN.is(n.command))}s.is=t})(z0e||(z0e={}));var $0e;(function(s){function e(i,n){return{tabSize:i,insertSpaces:n}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&Oe.uinteger(n.tabSize)&&Oe.boolean(n.insertSpaces)}s.is=t})($0e||($0e={}));var G0e;(function(s){function e(i,n,o){return{range:i,target:n,data:o}}s.create=e;function t(i){let n=i;return Oe.defined(n)&&hl.is(n.range)&&(Oe.undefined(n.target)||Oe.string(n.target))}s.is=t})(G0e||(G0e={}));var K0e;(function(s){function e(i,n){return{range:i,parent:n}}s.create=e;function t(i){let n=i;return Oe.objectLiteral(n)&&hl.is(n.range)&&(n.parent===void 0||s.is(n.parent))}s.is=t})(K0e||(K0e={}));var q0e;(function(s){s.namespace="namespace",s.type="type",s.class="class",s.enum="enum",s.interface="interface",s.struct="struct",s.typeParameter="typeParameter",s.parameter="parameter",s.variable="variable",s.property="property",s.enumMember="enumMember",s.event="event",s.function="function",s.method="method",s.macro="macro",s.keyword="keyword",s.modifier="modifier",s.comment="comment",s.string="string",s.number="number",s.regexp="regexp",s.operator="operator",s.decorator="decorator"})(q0e||(q0e={}));var Q0e;(function(s){s.declaration="declaration",s.definition="definition",s.readonly="readonly",s.static="static",s.deprecated="deprecated",s.abstract="abstract",s.async="async",s.modification="modification",s.documentation="documentation",s.defaultLibrary="defaultLibrary"})(Q0e||(Q0e={}));var j0e;(function(s){function e(t){const i=t;return Oe.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}s.is=e})(j0e||(j0e={}));var Y0e;(function(s){function e(i,n){return{range:i,text:n}}s.create=e;function t(i){const n=i;return n!=null&&hl.is(n.range)&&Oe.string(n.text)}s.is=t})(Y0e||(Y0e={}));var J0e;(function(s){function e(i,n,o){return{range:i,variableName:n,caseSensitiveLookup:o}}s.create=e;function t(i){const n=i;return n!=null&&hl.is(n.range)&&Oe.boolean(n.caseSensitiveLookup)&&(Oe.string(n.variableName)||n.variableName===void 0)}s.is=t})(J0e||(J0e={}));var X0e;(function(s){function e(i,n){return{range:i,expression:n}}s.create=e;function t(i){const n=i;return n!=null&&hl.is(n.range)&&(Oe.string(n.expression)||n.expression===void 0)}s.is=t})(X0e||(X0e={}));var Z0e;(function(s){function e(i,n){return{frameId:i,stoppedLocation:n}}s.create=e;function t(i){const n=i;return Oe.defined(n)&&hl.is(i.stoppedLocation)}s.is=t})(Z0e||(Z0e={}));var gne;(function(s){s.Type=1,s.Parameter=2;function e(t){return t===1||t===2}s.is=e})(gne||(gne={}));var fne;(function(s){function e(i){return{value:i}}s.create=e;function t(i){const n=i;return Oe.objectLiteral(n)&&(n.tooltip===void 0||Oe.string(n.tooltip)||QH.is(n.tooltip))&&(n.location===void 0||t7.is(n.location))&&(n.command===void 0||fN.is(n.command))}s.is=t})(fne||(fne={}));var e1e;(function(s){function e(i,n,o){const r={position:i,label:n};return o!==void 0&&(r.kind=o),r}s.create=e;function t(i){const n=i;return Oe.objectLiteral(n)&&h_.is(n.position)&&(Oe.string(n.label)||Oe.typedArray(n.label,fne.is))&&(n.kind===void 0||gne.is(n.kind))&&n.textEdits===void 0||Oe.typedArray(n.textEdits,Oy.is)&&(n.tooltip===void 0||Oe.string(n.tooltip)||QH.is(n.tooltip))&&(n.paddingLeft===void 0||Oe.boolean(n.paddingLeft))&&(n.paddingRight===void 0||Oe.boolean(n.paddingRight))}s.is=t})(e1e||(e1e={}));var t1e;(function(s){function e(t){return{kind:"snippet",value:t}}s.createSnippet=e})(t1e||(t1e={}));var i1e;(function(s){function e(t,i,n,o){return{insertText:t,filterText:i,range:n,command:o}}s.create=e})(i1e||(i1e={}));var n1e;(function(s){function e(t){return{items:t}}s.create=e})(n1e||(n1e={}));var s1e;(function(s){s.Invoked=0,s.Automatic=1})(s1e||(s1e={}));var o1e;(function(s){function e(t,i){return{range:t,text:i}}s.create=e})(o1e||(o1e={}));var r1e;(function(s){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}s.create=e})(r1e||(r1e={}));var a1e;(function(s){function e(t){const i=t;return Oe.objectLiteral(i)&&cne.is(i.uri)&&Oe.string(i.name)}s.is=e})(a1e||(a1e={}));const Zii=[` `,`\r -`,"\r"];var w1e;(function(s){function e(o,r,a,c){return new tsi(o,r,a,c)}s.create=e;function t(o){let r=o;return!!(Fe.defined(r)&&Fe.string(r.uri)&&(Fe.undefined(r.languageId)||Fe.string(r.languageId))&&Fe.uinteger(r.lineCount)&&Fe.func(r.getText)&&Fe.func(r.positionAt)&&Fe.func(r.offsetAt))}s.is=t;function i(o,r){let a=o.getText(),c=n(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}s.applyEdits=i;function n(o,r){if(o.length<=1)return o;const a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);n(c,r),n(l,r);let d=0,h=0,u=0;for(;d{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}s.applyEdits=i;function n(o,r){if(o.length<=1)return o;const a=o.length/2|0,c=o.slice(0,a),l=o.slice(a);n(c,r),n(l,r);let d=0,h=0,u=0;for(;d0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return f_.create(0,e);for(;ie?n=r:i=r+1}let o=i-1;return f_.create(o,e-t[o])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],n=e.line+1"u"}s.undefined=i;function n(f){return f===!0||f===!1}s.boolean=n;function o(f){return e.call(f)==="[object String]"}s.string=o;function r(f){return e.call(f)==="[object Number]"}s.number=r;function a(f,p,m){return e.call(f)==="[object Number]"&&p<=f&&f<=m}s.numberRange=a;function c(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}s.integer=c;function l(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}s.uinteger=l;function d(f){return e.call(f)==="[object Function]"}s.func=d;function h(f){return f!==null&&typeof f=="object"}s.objectLiteral=h;function u(f,p){return Array.isArray(f)&&f.every(p)}s.typedArray=u})(Fe||(Fe={}));const isi=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return XC},get ChangeAnnotation(){return nL},get ChangeAnnotationIdentifier(){return Qh},get CodeAction(){return e1e},get CodeActionContext(){return Z0e},get CodeActionKind(){return X0e},get CodeActionTriggerKind(){return d7},get CodeDescription(){return T0e},get CodeLens(){return t1e},get Color(){return gne},get ColorInformation(){return A0e},get ColorPresentation(){return E0e},get Command(){return vN},get CompletionItem(){return H0e},get CompletionItemKind(){return N0e},get CompletionItemLabelDetails(){return W0e},get CompletionItemTag(){return F0e},get CompletionList(){return U0e},get CreateFile(){return YH},get DeleteFile(){return XH},get Diagnostic(){return r7},get DiagnosticRelatedInformation(){return fne},get DiagnosticSeverity(){return k0e},get DiagnosticTag(){return I0e},get DocumentHighlight(){return K0e},get DocumentHighlightKind(){return G0e},get DocumentLink(){return n1e},get DocumentSymbol(){return J0e},get DocumentUri(){return y0e},EOL:esi,get FoldingRange(){return D0e},get FoldingRangeKind(){return x0e},get FormattingOptions(){return i1e},get Hover(){return V0e},get InlayHint(){return u1e},get InlayHintKind(){return _ne},get InlayHintLabelPart(){return vne},get InlineCompletionContext(){return v1e},get InlineCompletionItem(){return f1e},get InlineCompletionList(){return p1e},get InlineCompletionTriggerKind(){return m1e},get InlineValueContext(){return h1e},get InlineValueEvaluatableExpression(){return d1e},get InlineValueText(){return c1e},get InlineValueVariableLookup(){return l1e},get InsertReplaceEdit(){return O0e},get InsertTextFormat(){return P0e},get InsertTextMode(){return B0e},get Location(){return o7},get LocationLink(){return S0e},get MarkedString(){return l7},get MarkupContent(){return ZH},get MarkupKind(){return mne},get OptionalVersionedTextDocumentIdentifier(){return c7},get ParameterInformation(){return z0e},get Position(){return f_},get Range(){return ul},get RenameFile(){return JH},get SelectedCompletionInfo(){return _1e},get SelectionRange(){return s1e},get SemanticTokenModifiers(){return r1e},get SemanticTokenTypes(){return o1e},get SemanticTokens(){return a1e},get SignatureInformation(){return $0e},get StringValue(){return g1e},get SymbolInformation(){return j0e},get SymbolKind(){return q0e},get SymbolTag(){return Q0e},get TextDocument(){return w1e},get TextDocumentEdit(){return a7},get TextDocumentIdentifier(){return L0e},get TextDocumentItem(){return M0e},get TextEdit(){return Hy},get URI(){return une},get VersionedTextDocumentIdentifier(){return R0e},WorkspaceChange:Zni,get WorkspaceEdit(){return pne},get WorkspaceFolder(){return b1e},get WorkspaceSymbol(){return Y0e},get integer(){return C0e},get uinteger(){return s7}},Symbol.toStringTag,{value:"Module"})),GPe=wot(isi);var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.ProtocolNotificationType=Lo.ProtocolNotificationType0=Lo.ProtocolRequestType=Lo.ProtocolRequestType0=Lo.RegistrationType=Lo.MessageDirection=void 0;const eU=JN;var v$e;(function(s){s.clientToServer="clientToServer",s.serverToClient="serverToClient",s.both="both"})(v$e||(Lo.MessageDirection=v$e={}));class nsi{constructor(e){this.method=e}}Lo.RegistrationType=nsi;class ssi extends eU.RequestType0{constructor(e){super(e)}}Lo.ProtocolRequestType0=ssi;class osi extends eU.RequestType{constructor(e){super(e,eU.ParameterStructures.byName)}}Lo.ProtocolRequestType=osi;class rsi extends eU.NotificationType0{constructor(e){super(e)}}Lo.ProtocolNotificationType0=rsi;class asi extends eU.NotificationType{constructor(e){super(e,eU.ParameterStructures.byName)}}Lo.ProtocolNotificationType=asi;var Iot={},ol={};Object.defineProperty(ol,"__esModule",{value:!0});ol.objectLiteral=ol.typedArray=ol.stringArray=ol.array=ol.func=ol.error=ol.number=ol.string=ol.boolean=void 0;function csi(s){return s===!0||s===!1}ol.boolean=csi;function Tot(s){return typeof s=="string"||s instanceof String}ol.string=Tot;function lsi(s){return typeof s=="number"||s instanceof Number}ol.number=lsi;function dsi(s){return s instanceof Error}ol.error=dsi;function hsi(s){return typeof s=="function"}ol.func=hsi;function Lot(s){return Array.isArray(s)}ol.array=Lot;function usi(s){return Lot(s)&&s.every(e=>Tot(e))}ol.stringArray=usi;function gsi(s,e){return Array.isArray(s)&&s.every(e)}ol.typedArray=gsi;function fsi(s){return s!==null&&typeof s=="object"}ol.objectLiteral=fsi;var ple={};Object.defineProperty(ple,"__esModule",{value:!0});ple.ImplementationRequest=void 0;const b$e=Lo;var w$e;(function(s){s.method="textDocument/implementation",s.messageDirection=b$e.MessageDirection.clientToServer,s.type=new b$e.ProtocolRequestType(s.method)})(w$e||(ple.ImplementationRequest=w$e={}));var mle={};Object.defineProperty(mle,"__esModule",{value:!0});mle.TypeDefinitionRequest=void 0;const y$e=Lo;var C$e;(function(s){s.method="textDocument/typeDefinition",s.messageDirection=y$e.MessageDirection.clientToServer,s.type=new y$e.ProtocolRequestType(s.method)})(C$e||(mle.TypeDefinitionRequest=C$e={}));var tU={};Object.defineProperty(tU,"__esModule",{value:!0});tU.DidChangeWorkspaceFoldersNotification=tU.WorkspaceFoldersRequest=void 0;const bne=Lo;var S$e;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=bne.MessageDirection.serverToClient,s.type=new bne.ProtocolRequestType0(s.method)})(S$e||(tU.WorkspaceFoldersRequest=S$e={}));var A$e;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=bne.MessageDirection.clientToServer,s.type=new bne.ProtocolNotificationType(s.method)})(A$e||(tU.DidChangeWorkspaceFoldersNotification=A$e={}));var _le={};Object.defineProperty(_le,"__esModule",{value:!0});_le.ConfigurationRequest=void 0;const E$e=Lo;var x$e;(function(s){s.method="workspace/configuration",s.messageDirection=E$e.MessageDirection.serverToClient,s.type=new E$e.ProtocolRequestType(s.method)})(x$e||(_le.ConfigurationRequest=x$e={}));var iU={};Object.defineProperty(iU,"__esModule",{value:!0});iU.ColorPresentationRequest=iU.DocumentColorRequest=void 0;const wne=Lo;var D$e;(function(s){s.method="textDocument/documentColor",s.messageDirection=wne.MessageDirection.clientToServer,s.type=new wne.ProtocolRequestType(s.method)})(D$e||(iU.DocumentColorRequest=D$e={}));var k$e;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=wne.MessageDirection.clientToServer,s.type=new wne.ProtocolRequestType(s.method)})(k$e||(iU.ColorPresentationRequest=k$e={}));var nU={};Object.defineProperty(nU,"__esModule",{value:!0});nU.FoldingRangeRefreshRequest=nU.FoldingRangeRequest=void 0;const yne=Lo;var I$e;(function(s){s.method="textDocument/foldingRange",s.messageDirection=yne.MessageDirection.clientToServer,s.type=new yne.ProtocolRequestType(s.method)})(I$e||(nU.FoldingRangeRequest=I$e={}));var T$e;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=yne.MessageDirection.serverToClient,s.type=new yne.ProtocolRequestType0(s.method)})(T$e||(nU.FoldingRangeRefreshRequest=T$e={}));var vle={};Object.defineProperty(vle,"__esModule",{value:!0});vle.DeclarationRequest=void 0;const L$e=Lo;var R$e;(function(s){s.method="textDocument/declaration",s.messageDirection=L$e.MessageDirection.clientToServer,s.type=new L$e.ProtocolRequestType(s.method)})(R$e||(vle.DeclarationRequest=R$e={}));var ble={};Object.defineProperty(ble,"__esModule",{value:!0});ble.SelectionRangeRequest=void 0;const M$e=Lo;var N$e;(function(s){s.method="textDocument/selectionRange",s.messageDirection=M$e.MessageDirection.clientToServer,s.type=new M$e.ProtocolRequestType(s.method)})(N$e||(ble.SelectionRangeRequest=N$e={}));var DD={};Object.defineProperty(DD,"__esModule",{value:!0});DD.WorkDoneProgressCancelNotification=DD.WorkDoneProgressCreateRequest=DD.WorkDoneProgress=void 0;const psi=JN,Cne=Lo;var P$e;(function(s){s.type=new psi.ProgressType;function e(t){return t===s.type}s.is=e})(P$e||(DD.WorkDoneProgress=P$e={}));var F$e;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=Cne.MessageDirection.serverToClient,s.type=new Cne.ProtocolRequestType(s.method)})(F$e||(DD.WorkDoneProgressCreateRequest=F$e={}));var O$e;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=Cne.MessageDirection.clientToServer,s.type=new Cne.ProtocolNotificationType(s.method)})(O$e||(DD.WorkDoneProgressCancelNotification=O$e={}));var kD={};Object.defineProperty(kD,"__esModule",{value:!0});kD.CallHierarchyOutgoingCallsRequest=kD.CallHierarchyIncomingCallsRequest=kD.CallHierarchyPrepareRequest=void 0;const sU=Lo;var B$e;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=sU.MessageDirection.clientToServer,s.type=new sU.ProtocolRequestType(s.method)})(B$e||(kD.CallHierarchyPrepareRequest=B$e={}));var W$e;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=sU.MessageDirection.clientToServer,s.type=new sU.ProtocolRequestType(s.method)})(W$e||(kD.CallHierarchyIncomingCallsRequest=W$e={}));var H$e;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=sU.MessageDirection.clientToServer,s.type=new sU.ProtocolRequestType(s.method)})(H$e||(kD.CallHierarchyOutgoingCallsRequest=H$e={}));var Kf={};Object.defineProperty(Kf,"__esModule",{value:!0});Kf.SemanticTokensRefreshRequest=Kf.SemanticTokensRangeRequest=Kf.SemanticTokensDeltaRequest=Kf.SemanticTokensRequest=Kf.SemanticTokensRegistrationType=Kf.TokenFormat=void 0;const qA=Lo;var U$e;(function(s){s.Relative="relative"})(U$e||(Kf.TokenFormat=U$e={}));var h7;(function(s){s.method="textDocument/semanticTokens",s.type=new qA.RegistrationType(s.method)})(h7||(Kf.SemanticTokensRegistrationType=h7={}));var V$e;(function(s){s.method="textDocument/semanticTokens/full",s.messageDirection=qA.MessageDirection.clientToServer,s.type=new qA.ProtocolRequestType(s.method),s.registrationMethod=h7.method})(V$e||(Kf.SemanticTokensRequest=V$e={}));var z$e;(function(s){s.method="textDocument/semanticTokens/full/delta",s.messageDirection=qA.MessageDirection.clientToServer,s.type=new qA.ProtocolRequestType(s.method),s.registrationMethod=h7.method})(z$e||(Kf.SemanticTokensDeltaRequest=z$e={}));var $$e;(function(s){s.method="textDocument/semanticTokens/range",s.messageDirection=qA.MessageDirection.clientToServer,s.type=new qA.ProtocolRequestType(s.method),s.registrationMethod=h7.method})($$e||(Kf.SemanticTokensRangeRequest=$$e={}));var G$e;(function(s){s.method="workspace/semanticTokens/refresh",s.messageDirection=qA.MessageDirection.serverToClient,s.type=new qA.ProtocolRequestType0(s.method)})(G$e||(Kf.SemanticTokensRefreshRequest=G$e={}));var wle={};Object.defineProperty(wle,"__esModule",{value:!0});wle.ShowDocumentRequest=void 0;const K$e=Lo;var q$e;(function(s){s.method="window/showDocument",s.messageDirection=K$e.MessageDirection.serverToClient,s.type=new K$e.ProtocolRequestType(s.method)})(q$e||(wle.ShowDocumentRequest=q$e={}));var yle={};Object.defineProperty(yle,"__esModule",{value:!0});yle.LinkedEditingRangeRequest=void 0;const Q$e=Lo;var j$e;(function(s){s.method="textDocument/linkedEditingRange",s.messageDirection=Q$e.MessageDirection.clientToServer,s.type=new Q$e.ProtocolRequestType(s.method)})(j$e||(yle.LinkedEditingRangeRequest=j$e={}));var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.WillDeleteFilesRequest=Wu.DidDeleteFilesNotification=Wu.DidRenameFilesNotification=Wu.WillRenameFilesRequest=Wu.DidCreateFilesNotification=Wu.WillCreateFilesRequest=Wu.FileOperationPatternKind=void 0;const sv=Lo;var Y$e;(function(s){s.file="file",s.folder="folder"})(Y$e||(Wu.FileOperationPatternKind=Y$e={}));var J$e;(function(s){s.method="workspace/willCreateFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolRequestType(s.method)})(J$e||(Wu.WillCreateFilesRequest=J$e={}));var X$e;(function(s){s.method="workspace/didCreateFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolNotificationType(s.method)})(X$e||(Wu.DidCreateFilesNotification=X$e={}));var Z$e;(function(s){s.method="workspace/willRenameFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolRequestType(s.method)})(Z$e||(Wu.WillRenameFilesRequest=Z$e={}));var e7e;(function(s){s.method="workspace/didRenameFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolNotificationType(s.method)})(e7e||(Wu.DidRenameFilesNotification=e7e={}));var t7e;(function(s){s.method="workspace/didDeleteFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolNotificationType(s.method)})(t7e||(Wu.DidDeleteFilesNotification=t7e={}));var i7e;(function(s){s.method="workspace/willDeleteFiles",s.messageDirection=sv.MessageDirection.clientToServer,s.type=new sv.ProtocolRequestType(s.method)})(i7e||(Wu.WillDeleteFilesRequest=i7e={}));var ID={};Object.defineProperty(ID,"__esModule",{value:!0});ID.MonikerRequest=ID.MonikerKind=ID.UniquenessLevel=void 0;const n7e=Lo;var s7e;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(s7e||(ID.UniquenessLevel=s7e={}));var o7e;(function(s){s.$import="import",s.$export="export",s.local="local"})(o7e||(ID.MonikerKind=o7e={}));var r7e;(function(s){s.method="textDocument/moniker",s.messageDirection=n7e.MessageDirection.clientToServer,s.type=new n7e.ProtocolRequestType(s.method)})(r7e||(ID.MonikerRequest=r7e={}));var TD={};Object.defineProperty(TD,"__esModule",{value:!0});TD.TypeHierarchySubtypesRequest=TD.TypeHierarchySupertypesRequest=TD.TypeHierarchyPrepareRequest=void 0;const oU=Lo;var a7e;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=oU.MessageDirection.clientToServer,s.type=new oU.ProtocolRequestType(s.method)})(a7e||(TD.TypeHierarchyPrepareRequest=a7e={}));var c7e;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=oU.MessageDirection.clientToServer,s.type=new oU.ProtocolRequestType(s.method)})(c7e||(TD.TypeHierarchySupertypesRequest=c7e={}));var l7e;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=oU.MessageDirection.clientToServer,s.type=new oU.ProtocolRequestType(s.method)})(l7e||(TD.TypeHierarchySubtypesRequest=l7e={}));var rU={};Object.defineProperty(rU,"__esModule",{value:!0});rU.InlineValueRefreshRequest=rU.InlineValueRequest=void 0;const Sne=Lo;var d7e;(function(s){s.method="textDocument/inlineValue",s.messageDirection=Sne.MessageDirection.clientToServer,s.type=new Sne.ProtocolRequestType(s.method)})(d7e||(rU.InlineValueRequest=d7e={}));var h7e;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=Sne.MessageDirection.serverToClient,s.type=new Sne.ProtocolRequestType0(s.method)})(h7e||(rU.InlineValueRefreshRequest=h7e={}));var LD={};Object.defineProperty(LD,"__esModule",{value:!0});LD.InlayHintRefreshRequest=LD.InlayHintResolveRequest=LD.InlayHintRequest=void 0;const aU=Lo;var u7e;(function(s){s.method="textDocument/inlayHint",s.messageDirection=aU.MessageDirection.clientToServer,s.type=new aU.ProtocolRequestType(s.method)})(u7e||(LD.InlayHintRequest=u7e={}));var g7e;(function(s){s.method="inlayHint/resolve",s.messageDirection=aU.MessageDirection.clientToServer,s.type=new aU.ProtocolRequestType(s.method)})(g7e||(LD.InlayHintResolveRequest=g7e={}));var f7e;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=aU.MessageDirection.serverToClient,s.type=new aU.ProtocolRequestType0(s.method)})(f7e||(LD.InlayHintRefreshRequest=f7e={}));var v_={};Object.defineProperty(v_,"__esModule",{value:!0});v_.DiagnosticRefreshRequest=v_.WorkspaceDiagnosticRequest=v_.DocumentDiagnosticRequest=v_.DocumentDiagnosticReportKind=v_.DiagnosticServerCancellationData=void 0;const Rot=JN,msi=ol,cU=Lo;var p7e;(function(s){function e(t){const i=t;return i&&msi.boolean(i.retriggerRequest)}s.is=e})(p7e||(v_.DiagnosticServerCancellationData=p7e={}));var m7e;(function(s){s.Full="full",s.Unchanged="unchanged"})(m7e||(v_.DocumentDiagnosticReportKind=m7e={}));var _7e;(function(s){s.method="textDocument/diagnostic",s.messageDirection=cU.MessageDirection.clientToServer,s.type=new cU.ProtocolRequestType(s.method),s.partialResult=new Rot.ProgressType})(_7e||(v_.DocumentDiagnosticRequest=_7e={}));var v7e;(function(s){s.method="workspace/diagnostic",s.messageDirection=cU.MessageDirection.clientToServer,s.type=new cU.ProtocolRequestType(s.method),s.partialResult=new Rot.ProgressType})(v7e||(v_.WorkspaceDiagnosticRequest=v7e={}));var b7e;(function(s){s.method="workspace/diagnostic/refresh",s.messageDirection=cU.MessageDirection.serverToClient,s.type=new cU.ProtocolRequestType0(s.method)})(b7e||(v_.DiagnosticRefreshRequest=b7e={}));var sl={};Object.defineProperty(sl,"__esModule",{value:!0});sl.DidCloseNotebookDocumentNotification=sl.DidSaveNotebookDocumentNotification=sl.DidChangeNotebookDocumentNotification=sl.NotebookCellArrayChange=sl.DidOpenNotebookDocumentNotification=sl.NotebookDocumentSyncRegistrationType=sl.NotebookDocument=sl.NotebookCell=sl.ExecutionSummary=sl.NotebookCellKind=void 0;const u7=GPe,yb=ol,hC=Lo;var y1e;(function(s){s.Markup=1,s.Code=2;function e(t){return t===1||t===2}s.is=e})(y1e||(sl.NotebookCellKind=y1e={}));var C1e;(function(s){function e(n,o){const r={executionOrder:n};return(o===!0||o===!1)&&(r.success=o),r}s.create=e;function t(n){const o=n;return yb.objectLiteral(o)&&u7.uinteger.is(o.executionOrder)&&(o.success===void 0||yb.boolean(o.success))}s.is=t;function i(n,o){return n===o?!0:n==null||o===null||o===void 0?!1:n.executionOrder===o.executionOrder&&n.success===o.success}s.equals=i})(C1e||(sl.ExecutionSummary=C1e={}));var Ane;(function(s){function e(o,r){return{kind:o,document:r}}s.create=e;function t(o){const r=o;return yb.objectLiteral(r)&&y1e.is(r.kind)&&u7.DocumentUri.is(r.document)&&(r.metadata===void 0||yb.objectLiteral(r.metadata))}s.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)&&!n(o.metadata,r.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||r.executionSummary!==void 0)&&!C1e.equals(o.executionSummary,r.executionSummary)&&a.add("executionSummary"),a}s.diff=i;function n(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=dr})(yt||(s.StaticRegistrationOptions=yt={}));var Ne;(function(le){function dr(io){const un=io;return un&&(un.documentSelector===null||Y.is(un.documentSelector))}le.is=dr})(Ne||(s.TextDocumentRegistrationOptions=Ne={}));var lt;(function(le){function dr(un){const Se=un;return i.objectLiteral(Se)&&(Se.workDoneProgress===void 0||i.boolean(Se.workDoneProgress))}le.is=dr;function io(un){const Se=un;return Se&&i.boolean(Se.workDoneProgress)}le.hasWorkDoneProgress=io})(lt||(s.WorkDoneProgressOptions=lt={}));var xt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(xt||(s.InitializeRequest=xt={}));var Ji;(function(le){le.unknownProtocolVersion=1})(Ji||(s.InitializeErrorCodes=Ji={}));var Ii;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ii||(s.InitializedNotification=Ii={}));var ns;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(ns||(s.ShutdownRequest=ns={}));var zs;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})(zs||(s.ExitNotification=zs={}));var Pn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Pn||(s.DidChangeConfigurationNotification=Pn={}));var Xr;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(Xr||(s.MessageType=Xr={}));var ds;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ds||(s.ShowMessageNotification=ds={}));var Zo;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(Zo||(s.ShowMessageRequest=Zo={}));var Zr;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Zr||(s.LogMessageNotification=Zr={}));var Di;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Di||(s.TelemetryEventNotification=Di={}));var ss;(function(le){le.None=0,le.Full=1,le.Incremental=2})(ss||(s.TextDocumentSyncKind=ss={}));var Oo;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Oo||(s.DidOpenTextDocumentNotification=Oo={}));var Tn;(function(le){function dr(un){let Se=un;return Se!=null&&typeof Se.text=="string"&&Se.range!==void 0&&(Se.rangeLength===void 0||typeof Se.rangeLength=="number")}le.isIncremental=dr;function io(un){let Se=un;return Se!=null&&typeof Se.text=="string"&&Se.range===void 0&&Se.rangeLength===void 0}le.isFull=io})(Tn||(s.TextDocumentContentChangeEvent=Tn={}));var Ba;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ba||(s.DidChangeTextDocumentNotification=Ba={}));var vd;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(vd||(s.DidCloseTextDocumentNotification=vd={}));var Fn;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Fn||(s.DidSaveTextDocumentNotification=Fn={}));var th;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(th||(s.TextDocumentSaveReason=th={}));var pc;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(pc||(s.WillSaveTextDocumentNotification=pc={}));var zc;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(zc||(s.WillSaveTextDocumentWaitUntilRequest=zc={}));var $s;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})($s||(s.DidChangeWatchedFilesNotification=$s={}));var tc;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(tc||(s.FileChangeType=tc={}));var fl;(function(le){function dr(io){const un=io;return i.objectLiteral(un)&&(t.URI.is(un.baseUri)||t.WorkspaceFolder.is(un.baseUri))&&i.string(un.pattern)}le.is=dr})(fl||(s.RelativePattern=fl={}));var ih;(function(le){le.Create=1,le.Change=2,le.Delete=4})(ih||(s.WatchKind=ih={}));var gg;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(gg||(s.PublishDiagnosticsNotification=gg={}));var mc;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(mc||(s.CompletionTriggerKind=mc={}));var $c;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})($c||(s.CompletionRequest=$c={}));var nh;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nh||(s.CompletionResolveRequest=nh={}));var Dc;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Dc||(s.HoverRequest=Dc={}));var pl;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(pl||(s.SignatureHelpTriggerKind=pl={}));var ic;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ic||(s.SignatureHelpRequest=ic={}));var Or;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Or||(s.DefinitionRequest=Or={}));var ml;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ml||(s.ReferencesRequest=ml={}));var sh;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(sh||(s.DocumentHighlightRequest=sh={}));var oh;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(oh||(s.DocumentSymbolRequest=oh={}));var Gc;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Gc||(s.CodeActionRequest=Gc={}));var Kc;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Kc||(s.CodeActionResolveRequest=Kc={}));var Wa;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wa||(s.WorkspaceSymbolRequest=Wa={}));var Bo;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Bo||(s.WorkspaceSymbolResolveRequest=Bo={}));var Is;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Is||(s.CodeLensRequest=Is={}));var kc;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(kc||(s.CodeLensResolveRequest=kc={}));var Nh;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Nh||(s.CodeLensRefreshRequest=Nh={}));var be;(function(le){le.method="textDocument/documentLink",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(be||(s.DocumentLinkRequest=be={}));var Aa;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Aa||(s.DocumentLinkResolveRequest=Aa={}));var ee;(function(le){le.method="textDocument/formatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ee||(s.DocumentFormattingRequest=ee={}));var xe;(function(le){le.method="textDocument/rangeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(xe||(s.DocumentRangeFormattingRequest=xe={}));var gt;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(gt||(s.DocumentRangesFormattingRequest=gt={}));var zn;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(zn||(s.DocumentOnTypeFormattingRequest=zn={}));var Cs;(function(le){le.Identifier=1})(Cs||(s.PrepareSupportDefaultBehavior=Cs={}));var Wo;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wo||(s.RenameRequest=Wo={}));var Ha;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ha||(s.PrepareRenameRequest=Ha={}));var ea;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ea||(s.ExecuteCommandRequest=ea={}));var Ph;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Ph||(s.ApplyWorkspaceEditRequest=Ph={}))})(Iot);var Sle={};Object.defineProperty(Sle,"__esModule",{value:!0});Sle.createProtocolConnection=void 0;const k7e=JN;function _si(s,e,t,i){return k7e.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,k7e.createMessageConnection)(s,e,t,i)}Sle.createProtocolConnection=_si;(function(s){var e=rd&&rd.__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=rd&&rd.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.LSPErrorCodes=s.createProtocolConnection=void 0,t(JN,s),t(GPe,s),t(Lo,s),t(Iot,s);var i=Sle;Object.defineProperty(s,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var n;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(n||(s.LSPErrorCodes=n={}))})(kot);(function(s){var e=rd&&rd.__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=rd&&rd.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.createProtocolConnection=void 0;const i=m$e;t(m$e,s),t(kot,s);function n(o,r,a,c){return(0,i.createMessageConnection)(o,r,a,c)}s.createProtocolConnection=n})(ps);var Mn={};const Xn=wot(GKt);var kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.asPromise=kr.thenable=kr.typedArray=kr.stringArray=kr.array=kr.func=kr.error=kr.number=kr.string=kr.boolean=void 0;function vsi(s){return s===!0||s===!1}kr.boolean=vsi;function Mot(s){return typeof s=="string"||s instanceof String}kr.string=Mot;function bsi(s){return typeof s=="number"||s instanceof Number}kr.number=bsi;function wsi(s){return s instanceof Error}kr.error=wsi;function Not(s){return typeof s=="function"}kr.func=Not;function Pot(s){return Array.isArray(s)}kr.array=Pot;function ysi(s){return Pot(s)&&s.every(e=>Mot(e))}kr.stringArray=ysi;function Csi(s,e){return Array.isArray(s)&&s.every(e)}kr.typedArray=Csi;function Fot(s){return s&&Not(s.then)}kr.thenable=Fot;function Ssi(s){return s instanceof Promise?s:Fot(s)?new Promise((e,t)=>{s.then(i=>e(i),i=>t(i))}):Promise.resolve(s)}kr.asPromise=Ssi;var or={};Object.defineProperty(or,"__esModule",{value:!0});or.generateUuid=or.parse=or.isUUID=or.v4=or.empty=void 0;class KPe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class so extends KPe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return so._oneOf(so._chars)}constructor(){super([so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),"-",so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),"-","4",so._randomHex(),so._randomHex(),so._randomHex(),"-",so._oneOf(so._timeHighBits),so._randomHex(),so._randomHex(),so._randomHex(),"-",so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex()].join(""))}}so._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];so._timeHighBits=["8","9","a","b"];or.empty=new KPe("00000000-0000-0000-0000-000000000000");function Oot(){return new so}or.v4=Oot;const Asi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Bot(s){return Asi.test(s)}or.isUUID=Bot;function Esi(s){if(!Bot(s))throw new Error("invalid uuid");return new KPe(s)}or.parse=Esi;function xsi(){return Oot().asHex()}or.generateUuid=xsi;Object.defineProperty(Mn,"__esModule",{value:!0});Mn.WorkspaceFeature=Mn.TextDocumentLanguageFeature=Mn.TextDocumentEventFeature=Mn.DynamicDocumentFeature=Mn.DynamicFeature=Mn.StaticFeature=Mn.ensure=Mn.LSPCancellationError=void 0;const sL=Xn,cge=ps,Ug=kr,I7e=or;class Dsi extends sL.CancellationError{constructor(e){super(),this.data=e}}Mn.LSPCancellationError=Dsi;function ksi(s,e){return s[e]===void 0&&(s[e]={}),s[e]}Mn.ensure=ksi;var T7e;(function(s){function e(t){const i=t;return i!=null&&Ug.func(i.fillClientCapabilities)&&Ug.func(i.initialize)&&Ug.func(i.getState)&&Ug.func(i.clear)&&(i.fillInitializeParams===void 0||Ug.func(i.fillInitializeParams))}s.is=e})(T7e||(Mn.StaticFeature=T7e={}));var L7e;(function(s){function e(t){const i=t;return i!=null&&Ug.func(i.fillClientCapabilities)&&Ug.func(i.initialize)&&Ug.func(i.getState)&&Ug.func(i.clear)&&(i.fillInitializeParams===void 0||Ug.func(i.fillInitializeParams))&&Ug.func(i.register)&&Ug.func(i.unregister)&&i.registrationType!==void 0}s.is=e})(L7e||(Mn.DynamicFeature=L7e={}));class qPe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const n of e){t++;for(const o of sL.workspace.textDocuments)if(sL.languages.match(n,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}}}Mn.DynamicDocumentFeature=qPe;class Isi extends qPe{static textDocumentFilter(e,t){for(const i of e)if(sL.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,n,o,r,a){super(e),this._event=t,this._type=i,this._middleware=n,this._createParams=o,this._textDocument=r,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new sL.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 n=this._createParams(i);await this._client.sendNotification(this._type,n),this.notificationSent(this.getTextDocument(i),this._type,n)};if(this.matches(e)){const i=this._middleware();return i?i(e,n=>t(n)):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(sL.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}Mn.TextDocumentEventFeature=Isi;class Tsi extends qPe{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(cge.TextDocumentRegistrationOptions.is(t)){const i=cge.StaticRegistrationOptions.hasId(t)?t.id:I7e.generateUuid(),n=t.documentSelector??e;if(n)return[i,Object.assign({},t,{documentSelector:n})]}else if(Ug.boolean(t)&&t===!0||cge.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=Ug.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[I7e.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Ug.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&&sL.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}}Mn.TextDocumentLanguageFeature=Tsi;class Lsi{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}}Mn.WorkspaceFeature=Lsi;var bA={};const Rsi=typeof process=="object"&&process&&process.platform==="win32";var Msi=Rsi?{sep:"\\"}:{sep:"/"},Nsi=Wot;function Wot(s,e,t){s instanceof RegExp&&(s=R7e(s,t)),e instanceof RegExp&&(e=R7e(e,t));var i=Hot(s,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+s.length,i[1]),post:t.slice(i[1]+e.length)}}function R7e(s,e){var t=e.match(s);return t?t[0]:null}Wot.range=Hot;function Hot(s,e,t){var i,n,o,r,a,c=t.indexOf(s),l=t.indexOf(e,c+1),d=c;if(c>=0&&l>0){if(s===e)return[c,l];for(i=[],o=t.length;d>=0&&!a;)d==c?(i.push(d),c=t.indexOf(s,d+1)):i.length==1?a=[i.pop(),l]:(n=i.pop(),n=0?c:l;i.length&&(a=[o,r])}return a}var Uot=Nsi,Psi=Bsi,Vot="\0SLASH"+Math.random()+"\0",zot="\0OPEN"+Math.random()+"\0",QPe="\0CLOSE"+Math.random()+"\0",$ot="\0COMMA"+Math.random()+"\0",Got="\0PERIOD"+Math.random()+"\0";function lge(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function Fsi(s){return s.split("\\\\").join(Vot).split("\\{").join(zot).split("\\}").join(QPe).split("\\,").join($ot).split("\\.").join(Got)}function Osi(s){return s.split(Vot).join("\\").split(zot).join("{").split(QPe).join("}").split($ot).join(",").split(Got).join(".")}function Kot(s){if(!s)return[""];var e=[],t=Uot("{","}",s);if(!t)return s.split(",");var i=t.pre,n=t.body,o=t.post,r=i.split(",");r[r.length-1]+="{"+n+"}";var a=Kot(o);return o.length&&(r[r.length-1]+=a.shift(),r.push.apply(r,a)),e.push.apply(e,r),e}function Bsi(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),$V(Fsi(s),!0).map(Osi)):[]}function Wsi(s){return"{"+s+"}"}function Hsi(s){return/^-?0\d/.test(s)}function Usi(s,e){return s<=e}function Vsi(s,e){return s>=e}function $V(s,e){var t=[],i=Uot("{","}",s);if(!i)return[s];var n=i.pre,o=i.post.length?$V(i.post,!1):[""];if(/\$$/.test(i.pre))for(var r=0;r=0;if(!d&&!h)return i.post.match(/,.*\}/)?(s=i.pre+"{"+i.body+QPe+i.post,$V(s)):[s];var u;if(d)u=i.body.split(/\.\./);else if(u=Kot(i.body),u.length===1&&(u=$V(u[0],!1).map(Wsi),u.length===1))return o.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=lge(u[0]),m=lge(u[1]),v=Math.max(u[0].length,u[1].length),b=u.length==3?Math.abs(lge(u[2])):1,w=Usi,y=m0){var P=new Array(k+1).join("0");A<0?L="-"+P+L.slice(1):L=P+L}}f.push(L)}}else{f=[];for(var R=0;R(Ene(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Ele(e,t).match(s));var Ale=cm;const S1e=Msi;cm.sep=S1e.sep;const Ev=Symbol("globstar **");cm.GLOBSTAR=Ev;const zsi=Psi,M7e={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},A1e="[^/]",dge=A1e+"*?",$si="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Gsi="(?:(?!(?:\\/|^)\\.).)*?",qot=s=>s.split("").reduce((e,t)=>(e[t]=!0,e),{}),N7e=qot("().*{}+?[]^$\\!"),Ksi=qot("[.("),P7e=/\/+/;cm.filter=(s,e={})=>(t,i,n)=>cm(t,s,e);const _E=(s,e={})=>{const t={};return Object.keys(s).forEach(i=>t[i]=s[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};cm.defaults=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return cm;const e=cm,t=(i,n,o)=>e(i,n,_E(s,o));return t.Minimatch=class extends e.Minimatch{constructor(n,o){super(n,_E(s,o))}},t.Minimatch.defaults=i=>e.defaults(_E(s,i)).Minimatch,t.filter=(i,n)=>e.filter(i,_E(s,n)),t.defaults=i=>e.defaults(_E(s,i)),t.makeRe=(i,n)=>e.makeRe(i,_E(s,n)),t.braceExpand=(i,n)=>e.braceExpand(i,_E(s,n)),t.match=(i,n,o)=>e.match(i,n,_E(s,o)),t};cm.braceExpand=(s,e)=>Qot(s,e);const Qot=(s,e={})=>(Ene(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:zsi(s)),qsi=1024*64,Ene=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>qsi)throw new TypeError("pattern is too long")},hge=Symbol("subparse");cm.makeRe=(s,e)=>new Ele(s,e||{}).makeRe();cm.match=(s,e,t={})=>{const i=new Ele(e,t);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(e),s};const Qsi=s=>s.replace(/\\(.)/g,"$1"),jsi=s=>s.replace(/\\([^-\]])/g,"$1"),Ysi=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Jsi=s=>s.replace(/[[\]\\]/g,"\\$&");class Ele{constructor(e,t){Ene(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=(...n)=>console.error(...n)),this.debug(this.pattern,i),i=this.globParts=i.map(n=>n.split(P7e)),this.debug(this.pattern,i),i=i.map((n,o,r)=>n.map(this.parse,this)),this.debug(this.pattern,i),i=i.filter(n=>n.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 n=0;n0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return h_.create(0,e);for(;ie?n=r:i=r+1}let o=i-1;return h_.create(o,e-t[o])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],n=e.line+1"u"}s.undefined=i;function n(f){return f===!0||f===!1}s.boolean=n;function o(f){return e.call(f)==="[object String]"}s.string=o;function r(f){return e.call(f)==="[object Number]"}s.number=r;function a(f,p,m){return e.call(f)==="[object Number]"&&p<=f&&f<=m}s.numberRange=a;function c(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}s.integer=c;function l(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}s.uinteger=l;function d(f){return e.call(f)==="[object Function]"}s.func=d;function h(f){return f!==null&&typeof f=="object"}s.objectLiteral=h;function u(f,p){return Array.isArray(f)&&f.every(p)}s.typedArray=u})(Oe||(Oe={}));const tni=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return JC},get ChangeAnnotation(){return ZT},get ChangeAnnotationIdentifier(){return qh},get CodeAction(){return V0e},get CodeActionContext(){return U0e},get CodeActionKind(){return H0e},get CodeActionTriggerKind(){return r7},get CodeDescription(){return v0e},get CodeLens(){return z0e},get Color(){return lne},get ColorInformation(){return u0e},get ColorPresentation(){return g0e},get Command(){return fN},get CompletionItem(){return k0e},get CompletionItemKind(){return C0e},get CompletionItemLabelDetails(){return D0e},get CompletionItemTag(){return A0e},get CompletionList(){return I0e},get CreateFile(){return GH},get DeleteFile(){return qH},get Diagnostic(){return i7},get DiagnosticRelatedInformation(){return dne},get DiagnosticSeverity(){return m0e},get DiagnosticTag(){return _0e},get DocumentHighlight(){return N0e},get DocumentHighlightKind(){return M0e},get DocumentLink(){return G0e},get DocumentSymbol(){return W0e},get DocumentUri(){return l0e},EOL:Zii,get FoldingRange(){return p0e},get FoldingRangeKind(){return f0e},get FormattingOptions(){return $0e},get Hover(){return T0e},get InlayHint(){return e1e},get InlayHintKind(){return gne},get InlayHintLabelPart(){return fne},get InlineCompletionContext(){return r1e},get InlineCompletionItem(){return i1e},get InlineCompletionList(){return n1e},get InlineCompletionTriggerKind(){return s1e},get InlineValueContext(){return Z0e},get InlineValueEvaluatableExpression(){return X0e},get InlineValueText(){return Y0e},get InlineValueVariableLookup(){return J0e},get InsertReplaceEdit(){return E0e},get InsertTextFormat(){return S0e},get InsertTextMode(){return x0e},get Location(){return t7},get LocationLink(){return h0e},get MarkedString(){return o7},get MarkupContent(){return QH},get MarkupKind(){return une},get OptionalVersionedTextDocumentIdentifier(){return s7},get ParameterInformation(){return L0e},get Position(){return h_},get Range(){return hl},get RenameFile(){return KH},get SelectedCompletionInfo(){return o1e},get SelectionRange(){return K0e},get SemanticTokenModifiers(){return Q0e},get SemanticTokenTypes(){return q0e},get SemanticTokens(){return j0e},get SignatureInformation(){return R0e},get StringValue(){return t1e},get SymbolInformation(){return O0e},get SymbolKind(){return P0e},get SymbolTag(){return F0e},get TextDocument(){return c1e},get TextDocumentEdit(){return n7},get TextDocumentIdentifier(){return b0e},get TextDocumentItem(){return y0e},get TextEdit(){return Oy},get URI(){return cne},get VersionedTextDocumentIdentifier(){return w0e},WorkspaceChange:Xii,get WorkspaceEdit(){return hne},get WorkspaceFolder(){return a1e},get WorkspaceSymbol(){return B0e},get integer(){return d0e},get uinteger(){return e7}},Symbol.toStringTag,{value:"Module"})),MPe=uot(tni);var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.ProtocolNotificationType=Lo.ProtocolNotificationType0=Lo.ProtocolRequestType=Lo.ProtocolRequestType0=Lo.RegistrationType=Lo.MessageDirection=void 0;const jH=qN;var d$e;(function(s){s.clientToServer="clientToServer",s.serverToClient="serverToClient",s.both="both"})(d$e||(Lo.MessageDirection=d$e={}));class ini{constructor(e){this.method=e}}Lo.RegistrationType=ini;class nni extends jH.RequestType0{constructor(e){super(e)}}Lo.ProtocolRequestType0=nni;class sni extends jH.RequestType{constructor(e){super(e,jH.ParameterStructures.byName)}}Lo.ProtocolRequestType=sni;class oni extends jH.NotificationType0{constructor(e){super(e)}}Lo.ProtocolNotificationType0=oni;class rni extends jH.NotificationType{constructor(e){super(e,jH.ParameterStructures.byName)}}Lo.ProtocolNotificationType=rni;var vot={},sl={};Object.defineProperty(sl,"__esModule",{value:!0});sl.objectLiteral=sl.typedArray=sl.stringArray=sl.array=sl.func=sl.error=sl.number=sl.string=sl.boolean=void 0;function ani(s){return s===!0||s===!1}sl.boolean=ani;function bot(s){return typeof s=="string"||s instanceof String}sl.string=bot;function cni(s){return typeof s=="number"||s instanceof Number}sl.number=cni;function lni(s){return s instanceof Error}sl.error=lni;function dni(s){return typeof s=="function"}sl.func=dni;function wot(s){return Array.isArray(s)}sl.array=wot;function hni(s){return wot(s)&&s.every(e=>bot(e))}sl.stringArray=hni;function uni(s,e){return Array.isArray(s)&&s.every(e)}sl.typedArray=uni;function gni(s){return s!==null&&typeof s=="object"}sl.objectLiteral=gni;var cle={};Object.defineProperty(cle,"__esModule",{value:!0});cle.ImplementationRequest=void 0;const h$e=Lo;var u$e;(function(s){s.method="textDocument/implementation",s.messageDirection=h$e.MessageDirection.clientToServer,s.type=new h$e.ProtocolRequestType(s.method)})(u$e||(cle.ImplementationRequest=u$e={}));var lle={};Object.defineProperty(lle,"__esModule",{value:!0});lle.TypeDefinitionRequest=void 0;const g$e=Lo;var f$e;(function(s){s.method="textDocument/typeDefinition",s.messageDirection=g$e.MessageDirection.clientToServer,s.type=new g$e.ProtocolRequestType(s.method)})(f$e||(lle.TypeDefinitionRequest=f$e={}));var YH={};Object.defineProperty(YH,"__esModule",{value:!0});YH.DidChangeWorkspaceFoldersNotification=YH.WorkspaceFoldersRequest=void 0;const pne=Lo;var p$e;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=pne.MessageDirection.serverToClient,s.type=new pne.ProtocolRequestType0(s.method)})(p$e||(YH.WorkspaceFoldersRequest=p$e={}));var m$e;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=pne.MessageDirection.clientToServer,s.type=new pne.ProtocolNotificationType(s.method)})(m$e||(YH.DidChangeWorkspaceFoldersNotification=m$e={}));var dle={};Object.defineProperty(dle,"__esModule",{value:!0});dle.ConfigurationRequest=void 0;const _$e=Lo;var v$e;(function(s){s.method="workspace/configuration",s.messageDirection=_$e.MessageDirection.serverToClient,s.type=new _$e.ProtocolRequestType(s.method)})(v$e||(dle.ConfigurationRequest=v$e={}));var JH={};Object.defineProperty(JH,"__esModule",{value:!0});JH.ColorPresentationRequest=JH.DocumentColorRequest=void 0;const mne=Lo;var b$e;(function(s){s.method="textDocument/documentColor",s.messageDirection=mne.MessageDirection.clientToServer,s.type=new mne.ProtocolRequestType(s.method)})(b$e||(JH.DocumentColorRequest=b$e={}));var w$e;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=mne.MessageDirection.clientToServer,s.type=new mne.ProtocolRequestType(s.method)})(w$e||(JH.ColorPresentationRequest=w$e={}));var XH={};Object.defineProperty(XH,"__esModule",{value:!0});XH.FoldingRangeRefreshRequest=XH.FoldingRangeRequest=void 0;const _ne=Lo;var y$e;(function(s){s.method="textDocument/foldingRange",s.messageDirection=_ne.MessageDirection.clientToServer,s.type=new _ne.ProtocolRequestType(s.method)})(y$e||(XH.FoldingRangeRequest=y$e={}));var C$e;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=_ne.MessageDirection.serverToClient,s.type=new _ne.ProtocolRequestType0(s.method)})(C$e||(XH.FoldingRangeRefreshRequest=C$e={}));var hle={};Object.defineProperty(hle,"__esModule",{value:!0});hle.DeclarationRequest=void 0;const S$e=Lo;var A$e;(function(s){s.method="textDocument/declaration",s.messageDirection=S$e.MessageDirection.clientToServer,s.type=new S$e.ProtocolRequestType(s.method)})(A$e||(hle.DeclarationRequest=A$e={}));var ule={};Object.defineProperty(ule,"__esModule",{value:!0});ule.SelectionRangeRequest=void 0;const E$e=Lo;var x$e;(function(s){s.method="textDocument/selectionRange",s.messageDirection=E$e.MessageDirection.clientToServer,s.type=new E$e.ProtocolRequestType(s.method)})(x$e||(ule.SelectionRangeRequest=x$e={}));var CD={};Object.defineProperty(CD,"__esModule",{value:!0});CD.WorkDoneProgressCancelNotification=CD.WorkDoneProgressCreateRequest=CD.WorkDoneProgress=void 0;const fni=qN,vne=Lo;var D$e;(function(s){s.type=new fni.ProgressType;function e(t){return t===s.type}s.is=e})(D$e||(CD.WorkDoneProgress=D$e={}));var k$e;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=vne.MessageDirection.serverToClient,s.type=new vne.ProtocolRequestType(s.method)})(k$e||(CD.WorkDoneProgressCreateRequest=k$e={}));var I$e;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=vne.MessageDirection.clientToServer,s.type=new vne.ProtocolNotificationType(s.method)})(I$e||(CD.WorkDoneProgressCancelNotification=I$e={}));var SD={};Object.defineProperty(SD,"__esModule",{value:!0});SD.CallHierarchyOutgoingCallsRequest=SD.CallHierarchyIncomingCallsRequest=SD.CallHierarchyPrepareRequest=void 0;const ZH=Lo;var T$e;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=ZH.MessageDirection.clientToServer,s.type=new ZH.ProtocolRequestType(s.method)})(T$e||(SD.CallHierarchyPrepareRequest=T$e={}));var L$e;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=ZH.MessageDirection.clientToServer,s.type=new ZH.ProtocolRequestType(s.method)})(L$e||(SD.CallHierarchyIncomingCallsRequest=L$e={}));var R$e;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=ZH.MessageDirection.clientToServer,s.type=new ZH.ProtocolRequestType(s.method)})(R$e||(SD.CallHierarchyOutgoingCallsRequest=R$e={}));var zf={};Object.defineProperty(zf,"__esModule",{value:!0});zf.SemanticTokensRefreshRequest=zf.SemanticTokensRangeRequest=zf.SemanticTokensDeltaRequest=zf.SemanticTokensRequest=zf.SemanticTokensRegistrationType=zf.TokenFormat=void 0;const GA=Lo;var M$e;(function(s){s.Relative="relative"})(M$e||(zf.TokenFormat=M$e={}));var a7;(function(s){s.method="textDocument/semanticTokens",s.type=new GA.RegistrationType(s.method)})(a7||(zf.SemanticTokensRegistrationType=a7={}));var N$e;(function(s){s.method="textDocument/semanticTokens/full",s.messageDirection=GA.MessageDirection.clientToServer,s.type=new GA.ProtocolRequestType(s.method),s.registrationMethod=a7.method})(N$e||(zf.SemanticTokensRequest=N$e={}));var P$e;(function(s){s.method="textDocument/semanticTokens/full/delta",s.messageDirection=GA.MessageDirection.clientToServer,s.type=new GA.ProtocolRequestType(s.method),s.registrationMethod=a7.method})(P$e||(zf.SemanticTokensDeltaRequest=P$e={}));var F$e;(function(s){s.method="textDocument/semanticTokens/range",s.messageDirection=GA.MessageDirection.clientToServer,s.type=new GA.ProtocolRequestType(s.method),s.registrationMethod=a7.method})(F$e||(zf.SemanticTokensRangeRequest=F$e={}));var O$e;(function(s){s.method="workspace/semanticTokens/refresh",s.messageDirection=GA.MessageDirection.serverToClient,s.type=new GA.ProtocolRequestType0(s.method)})(O$e||(zf.SemanticTokensRefreshRequest=O$e={}));var gle={};Object.defineProperty(gle,"__esModule",{value:!0});gle.ShowDocumentRequest=void 0;const B$e=Lo;var W$e;(function(s){s.method="window/showDocument",s.messageDirection=B$e.MessageDirection.serverToClient,s.type=new B$e.ProtocolRequestType(s.method)})(W$e||(gle.ShowDocumentRequest=W$e={}));var fle={};Object.defineProperty(fle,"__esModule",{value:!0});fle.LinkedEditingRangeRequest=void 0;const H$e=Lo;var U$e;(function(s){s.method="textDocument/linkedEditingRange",s.messageDirection=H$e.MessageDirection.clientToServer,s.type=new H$e.ProtocolRequestType(s.method)})(U$e||(fle.LinkedEditingRangeRequest=U$e={}));var Ou={};Object.defineProperty(Ou,"__esModule",{value:!0});Ou.WillDeleteFilesRequest=Ou.DidDeleteFilesNotification=Ou.DidRenameFilesNotification=Ou.WillRenameFilesRequest=Ou.DidCreateFilesNotification=Ou.WillCreateFilesRequest=Ou.FileOperationPatternKind=void 0;const tv=Lo;var V$e;(function(s){s.file="file",s.folder="folder"})(V$e||(Ou.FileOperationPatternKind=V$e={}));var z$e;(function(s){s.method="workspace/willCreateFiles",s.messageDirection=tv.MessageDirection.clientToServer,s.type=new tv.ProtocolRequestType(s.method)})(z$e||(Ou.WillCreateFilesRequest=z$e={}));var $$e;(function(s){s.method="workspace/didCreateFiles",s.messageDirection=tv.MessageDirection.clientToServer,s.type=new tv.ProtocolNotificationType(s.method)})($$e||(Ou.DidCreateFilesNotification=$$e={}));var G$e;(function(s){s.method="workspace/willRenameFiles",s.messageDirection=tv.MessageDirection.clientToServer,s.type=new tv.ProtocolRequestType(s.method)})(G$e||(Ou.WillRenameFilesRequest=G$e={}));var K$e;(function(s){s.method="workspace/didRenameFiles",s.messageDirection=tv.MessageDirection.clientToServer,s.type=new tv.ProtocolNotificationType(s.method)})(K$e||(Ou.DidRenameFilesNotification=K$e={}));var q$e;(function(s){s.method="workspace/didDeleteFiles",s.messageDirection=tv.MessageDirection.clientToServer,s.type=new tv.ProtocolNotificationType(s.method)})(q$e||(Ou.DidDeleteFilesNotification=q$e={}));var Q$e;(function(s){s.method="workspace/willDeleteFiles",s.messageDirection=tv.MessageDirection.clientToServer,s.type=new tv.ProtocolRequestType(s.method)})(Q$e||(Ou.WillDeleteFilesRequest=Q$e={}));var AD={};Object.defineProperty(AD,"__esModule",{value:!0});AD.MonikerRequest=AD.MonikerKind=AD.UniquenessLevel=void 0;const j$e=Lo;var Y$e;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(Y$e||(AD.UniquenessLevel=Y$e={}));var J$e;(function(s){s.$import="import",s.$export="export",s.local="local"})(J$e||(AD.MonikerKind=J$e={}));var X$e;(function(s){s.method="textDocument/moniker",s.messageDirection=j$e.MessageDirection.clientToServer,s.type=new j$e.ProtocolRequestType(s.method)})(X$e||(AD.MonikerRequest=X$e={}));var ED={};Object.defineProperty(ED,"__esModule",{value:!0});ED.TypeHierarchySubtypesRequest=ED.TypeHierarchySupertypesRequest=ED.TypeHierarchyPrepareRequest=void 0;const eU=Lo;var Z$e;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=eU.MessageDirection.clientToServer,s.type=new eU.ProtocolRequestType(s.method)})(Z$e||(ED.TypeHierarchyPrepareRequest=Z$e={}));var e7e;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=eU.MessageDirection.clientToServer,s.type=new eU.ProtocolRequestType(s.method)})(e7e||(ED.TypeHierarchySupertypesRequest=e7e={}));var t7e;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=eU.MessageDirection.clientToServer,s.type=new eU.ProtocolRequestType(s.method)})(t7e||(ED.TypeHierarchySubtypesRequest=t7e={}));var tU={};Object.defineProperty(tU,"__esModule",{value:!0});tU.InlineValueRefreshRequest=tU.InlineValueRequest=void 0;const bne=Lo;var i7e;(function(s){s.method="textDocument/inlineValue",s.messageDirection=bne.MessageDirection.clientToServer,s.type=new bne.ProtocolRequestType(s.method)})(i7e||(tU.InlineValueRequest=i7e={}));var n7e;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=bne.MessageDirection.serverToClient,s.type=new bne.ProtocolRequestType0(s.method)})(n7e||(tU.InlineValueRefreshRequest=n7e={}));var xD={};Object.defineProperty(xD,"__esModule",{value:!0});xD.InlayHintRefreshRequest=xD.InlayHintResolveRequest=xD.InlayHintRequest=void 0;const iU=Lo;var s7e;(function(s){s.method="textDocument/inlayHint",s.messageDirection=iU.MessageDirection.clientToServer,s.type=new iU.ProtocolRequestType(s.method)})(s7e||(xD.InlayHintRequest=s7e={}));var o7e;(function(s){s.method="inlayHint/resolve",s.messageDirection=iU.MessageDirection.clientToServer,s.type=new iU.ProtocolRequestType(s.method)})(o7e||(xD.InlayHintResolveRequest=o7e={}));var r7e;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=iU.MessageDirection.serverToClient,s.type=new iU.ProtocolRequestType0(s.method)})(r7e||(xD.InlayHintRefreshRequest=r7e={}));var p_={};Object.defineProperty(p_,"__esModule",{value:!0});p_.DiagnosticRefreshRequest=p_.WorkspaceDiagnosticRequest=p_.DocumentDiagnosticRequest=p_.DocumentDiagnosticReportKind=p_.DiagnosticServerCancellationData=void 0;const yot=qN,pni=sl,nU=Lo;var a7e;(function(s){function e(t){const i=t;return i&&pni.boolean(i.retriggerRequest)}s.is=e})(a7e||(p_.DiagnosticServerCancellationData=a7e={}));var c7e;(function(s){s.Full="full",s.Unchanged="unchanged"})(c7e||(p_.DocumentDiagnosticReportKind=c7e={}));var l7e;(function(s){s.method="textDocument/diagnostic",s.messageDirection=nU.MessageDirection.clientToServer,s.type=new nU.ProtocolRequestType(s.method),s.partialResult=new yot.ProgressType})(l7e||(p_.DocumentDiagnosticRequest=l7e={}));var d7e;(function(s){s.method="workspace/diagnostic",s.messageDirection=nU.MessageDirection.clientToServer,s.type=new nU.ProtocolRequestType(s.method),s.partialResult=new yot.ProgressType})(d7e||(p_.WorkspaceDiagnosticRequest=d7e={}));var h7e;(function(s){s.method="workspace/diagnostic/refresh",s.messageDirection=nU.MessageDirection.serverToClient,s.type=new nU.ProtocolRequestType0(s.method)})(h7e||(p_.DiagnosticRefreshRequest=h7e={}));var nl={};Object.defineProperty(nl,"__esModule",{value:!0});nl.DidCloseNotebookDocumentNotification=nl.DidSaveNotebookDocumentNotification=nl.DidChangeNotebookDocumentNotification=nl.NotebookCellArrayChange=nl.DidOpenNotebookDocumentNotification=nl.NotebookDocumentSyncRegistrationType=nl.NotebookDocument=nl.NotebookCell=nl.ExecutionSummary=nl.NotebookCellKind=void 0;const c7=MPe,vb=sl,aC=Lo;var l1e;(function(s){s.Markup=1,s.Code=2;function e(t){return t===1||t===2}s.is=e})(l1e||(nl.NotebookCellKind=l1e={}));var d1e;(function(s){function e(n,o){const r={executionOrder:n};return(o===!0||o===!1)&&(r.success=o),r}s.create=e;function t(n){const o=n;return vb.objectLiteral(o)&&c7.uinteger.is(o.executionOrder)&&(o.success===void 0||vb.boolean(o.success))}s.is=t;function i(n,o){return n===o?!0:n==null||o===null||o===void 0?!1:n.executionOrder===o.executionOrder&&n.success===o.success}s.equals=i})(d1e||(nl.ExecutionSummary=d1e={}));var wne;(function(s){function e(o,r){return{kind:o,document:r}}s.create=e;function t(o){const r=o;return vb.objectLiteral(r)&&l1e.is(r.kind)&&c7.DocumentUri.is(r.document)&&(r.metadata===void 0||vb.objectLiteral(r.metadata))}s.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)&&!n(o.metadata,r.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||r.executionSummary!==void 0)&&!d1e.equals(o.executionSummary,r.executionSummary)&&a.add("executionSummary"),a}s.diff=i;function n(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=dr})(yt||(s.StaticRegistrationOptions=yt={}));var Pe;(function(le){function dr(io){const un=io;return un&&(un.documentSelector===null||j.is(un.documentSelector))}le.is=dr})(Pe||(s.TextDocumentRegistrationOptions=Pe={}));var lt;(function(le){function dr(un){const Se=un;return i.objectLiteral(Se)&&(Se.workDoneProgress===void 0||i.boolean(Se.workDoneProgress))}le.is=dr;function io(un){const Se=un;return Se&&i.boolean(Se.workDoneProgress)}le.hasWorkDoneProgress=io})(lt||(s.WorkDoneProgressOptions=lt={}));var xt;(function(le){le.method="initialize",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(xt||(s.InitializeRequest=xt={}));var Ji;(function(le){le.unknownProtocolVersion=1})(Ji||(s.InitializeErrorCodes=Ji={}));var Ii;(function(le){le.method="initialized",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ii||(s.InitializedNotification=Ii={}));var ns;(function(le){le.method="shutdown",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType0(le.method)})(ns||(s.ShutdownRequest=ns={}));var zs;(function(le){le.method="exit",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType0(le.method)})(zs||(s.ExitNotification=zs={}));var Pn;(function(le){le.method="workspace/didChangeConfiguration",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Pn||(s.DidChangeConfigurationNotification=Pn={}));var Xr;(function(le){le.Error=1,le.Warning=2,le.Info=3,le.Log=4,le.Debug=5})(Xr||(s.MessageType=Xr={}));var ds;(function(le){le.method="window/showMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(ds||(s.ShowMessageNotification=ds={}));var Zo;(function(le){le.method="window/showMessageRequest",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType(le.method)})(Zo||(s.ShowMessageRequest=Zo={}));var Zr;(function(le){le.method="window/logMessage",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Zr||(s.LogMessageNotification=Zr={}));var Di;(function(le){le.method="telemetry/event",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(Di||(s.TelemetryEventNotification=Di={}));var ss;(function(le){le.None=0,le.Full=1,le.Incremental=2})(ss||(s.TextDocumentSyncKind=ss={}));var Oo;(function(le){le.method="textDocument/didOpen",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Oo||(s.DidOpenTextDocumentNotification=Oo={}));var Tn;(function(le){function dr(un){let Se=un;return Se!=null&&typeof Se.text=="string"&&Se.range!==void 0&&(Se.rangeLength===void 0||typeof Se.rangeLength=="number")}le.isIncremental=dr;function io(un){let Se=un;return Se!=null&&typeof Se.text=="string"&&Se.range===void 0&&Se.rangeLength===void 0}le.isFull=io})(Tn||(s.TextDocumentContentChangeEvent=Tn={}));var Ba;(function(le){le.method="textDocument/didChange",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Ba||(s.DidChangeTextDocumentNotification=Ba={}));var md;(function(le){le.method="textDocument/didClose",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(md||(s.DidCloseTextDocumentNotification=md={}));var Fn;(function(le){le.method="textDocument/didSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(Fn||(s.DidSaveTextDocumentNotification=Fn={}));var Zd;(function(le){le.Manual=1,le.AfterDelay=2,le.FocusOut=3})(Zd||(s.TextDocumentSaveReason=Zd={}));var pc;(function(le){le.method="textDocument/willSave",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})(pc||(s.WillSaveTextDocumentNotification=pc={}));var Vc;(function(le){le.method="textDocument/willSaveWaitUntil",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Vc||(s.WillSaveTextDocumentWaitUntilRequest=Vc={}));var $s;(function(le){le.method="workspace/didChangeWatchedFiles",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolNotificationType(le.method)})($s||(s.DidChangeWatchedFilesNotification=$s={}));var tc;(function(le){le.Created=1,le.Changed=2,le.Deleted=3})(tc||(s.FileChangeType=tc={}));var gl;(function(le){function dr(io){const un=io;return i.objectLiteral(un)&&(t.URI.is(un.baseUri)||t.WorkspaceFolder.is(un.baseUri))&&i.string(un.pattern)}le.is=dr})(gl||(s.RelativePattern=gl={}));var eh;(function(le){le.Create=1,le.Change=2,le.Delete=4})(eh||(s.WatchKind=eh={}));var dg;(function(le){le.method="textDocument/publishDiagnostics",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolNotificationType(le.method)})(dg||(s.PublishDiagnosticsNotification=dg={}));var mc;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.TriggerForIncompleteCompletions=3})(mc||(s.CompletionTriggerKind=mc={}));var zc;(function(le){le.method="textDocument/completion",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(zc||(s.CompletionRequest=zc={}));var th;(function(le){le.method="completionItem/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(th||(s.CompletionResolveRequest=th={}));var Dc;(function(le){le.method="textDocument/hover",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Dc||(s.HoverRequest=Dc={}));var fl;(function(le){le.Invoked=1,le.TriggerCharacter=2,le.ContentChange=3})(fl||(s.SignatureHelpTriggerKind=fl={}));var ic;(function(le){le.method="textDocument/signatureHelp",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ic||(s.SignatureHelpRequest=ic={}));var Or;(function(le){le.method="textDocument/definition",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Or||(s.DefinitionRequest=Or={}));var pl;(function(le){le.method="textDocument/references",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(pl||(s.ReferencesRequest=pl={}));var ih;(function(le){le.method="textDocument/documentHighlight",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ih||(s.DocumentHighlightRequest=ih={}));var nh;(function(le){le.method="textDocument/documentSymbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(nh||(s.DocumentSymbolRequest=nh={}));var $c;(function(le){le.method="textDocument/codeAction",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})($c||(s.CodeActionRequest=$c={}));var Gc;(function(le){le.method="codeAction/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Gc||(s.CodeActionResolveRequest=Gc={}));var Wa;(function(le){le.method="workspace/symbol",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wa||(s.WorkspaceSymbolRequest=Wa={}));var Bo;(function(le){le.method="workspaceSymbol/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Bo||(s.WorkspaceSymbolResolveRequest=Bo={}));var Is;(function(le){le.method="textDocument/codeLens",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Is||(s.CodeLensRequest=Is={}));var kc;(function(le){le.method="codeLens/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(kc||(s.CodeLensResolveRequest=kc={}));var Rh;(function(le){le.method="workspace/codeLens/refresh",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType0(le.method)})(Rh||(s.CodeLensRefreshRequest=Rh={}));var be;(function(le){le.method="textDocument/documentLink",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(be||(s.DocumentLinkRequest=be={}));var Aa;(function(le){le.method="documentLink/resolve",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Aa||(s.DocumentLinkResolveRequest=Aa={}));var ee;(function(le){le.method="textDocument/formatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ee||(s.DocumentFormattingRequest=ee={}));var De;(function(le){le.method="textDocument/rangeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(De||(s.DocumentRangeFormattingRequest=De={}));var gt;(function(le){le.method="textDocument/rangesFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(gt||(s.DocumentRangesFormattingRequest=gt={}));var zn;(function(le){le.method="textDocument/onTypeFormatting",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(zn||(s.DocumentOnTypeFormattingRequest=zn={}));var Cs;(function(le){le.Identifier=1})(Cs||(s.PrepareSupportDefaultBehavior=Cs={}));var Wo;(function(le){le.method="textDocument/rename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Wo||(s.RenameRequest=Wo={}));var Ha;(function(le){le.method="textDocument/prepareRename",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(Ha||(s.PrepareRenameRequest=Ha={}));var ea;(function(le){le.method="workspace/executeCommand",le.messageDirection=e.MessageDirection.clientToServer,le.type=new e.ProtocolRequestType(le.method)})(ea||(s.ExecuteCommandRequest=ea={}));var Mh;(function(le){le.method="workspace/applyEdit",le.messageDirection=e.MessageDirection.serverToClient,le.type=new e.ProtocolRequestType("workspace/applyEdit")})(Mh||(s.ApplyWorkspaceEditRequest=Mh={}))})(vot);var mle={};Object.defineProperty(mle,"__esModule",{value:!0});mle.createProtocolConnection=void 0;const w7e=qN;function mni(s,e,t,i){return w7e.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,w7e.createMessageConnection)(s,e,t,i)}mle.createProtocolConnection=mni;(function(s){var e=sd&&sd.__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=sd&&sd.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.LSPErrorCodes=s.createProtocolConnection=void 0,t(qN,s),t(MPe,s),t(Lo,s),t(vot,s);var i=mle;Object.defineProperty(s,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var n;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(n||(s.LSPErrorCodes=n={}))})(_ot);(function(s){var e=sd&&sd.__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=sd&&sd.__exportStar||function(o,r){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(r,a)&&e(r,o,a)};Object.defineProperty(s,"__esModule",{value:!0}),s.createProtocolConnection=void 0;const i=c$e;t(c$e,s),t(_ot,s);function n(o,r,a,c){return(0,i.createMessageConnection)(o,r,a,c)}s.createProtocolConnection=n})(ps);var Mn={};const Xn=uot(NKt);var kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.asPromise=kr.thenable=kr.typedArray=kr.stringArray=kr.array=kr.func=kr.error=kr.number=kr.string=kr.boolean=void 0;function _ni(s){return s===!0||s===!1}kr.boolean=_ni;function Cot(s){return typeof s=="string"||s instanceof String}kr.string=Cot;function vni(s){return typeof s=="number"||s instanceof Number}kr.number=vni;function bni(s){return s instanceof Error}kr.error=bni;function Sot(s){return typeof s=="function"}kr.func=Sot;function Aot(s){return Array.isArray(s)}kr.array=Aot;function wni(s){return Aot(s)&&s.every(e=>Cot(e))}kr.stringArray=wni;function yni(s,e){return Array.isArray(s)&&s.every(e)}kr.typedArray=yni;function Eot(s){return s&&Sot(s.then)}kr.thenable=Eot;function Cni(s){return s instanceof Promise?s:Eot(s)?new Promise((e,t)=>{s.then(i=>e(i),i=>t(i))}):Promise.resolve(s)}kr.asPromise=Cni;var or={};Object.defineProperty(or,"__esModule",{value:!0});or.generateUuid=or.parse=or.isUUID=or.v4=or.empty=void 0;class NPe{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class so extends NPe{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return so._oneOf(so._chars)}constructor(){super([so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),"-",so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),"-","4",so._randomHex(),so._randomHex(),so._randomHex(),"-",so._oneOf(so._timeHighBits),so._randomHex(),so._randomHex(),so._randomHex(),"-",so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex(),so._randomHex()].join(""))}}so._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];so._timeHighBits=["8","9","a","b"];or.empty=new NPe("00000000-0000-0000-0000-000000000000");function xot(){return new so}or.v4=xot;const Sni=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Dot(s){return Sni.test(s)}or.isUUID=Dot;function Ani(s){if(!Dot(s))throw new Error("invalid uuid");return new NPe(s)}or.parse=Ani;function Eni(){return xot().asHex()}or.generateUuid=Eni;Object.defineProperty(Mn,"__esModule",{value:!0});Mn.WorkspaceFeature=Mn.TextDocumentLanguageFeature=Mn.TextDocumentEventFeature=Mn.DynamicDocumentFeature=Mn.DynamicFeature=Mn.StaticFeature=Mn.ensure=Mn.LSPCancellationError=void 0;const eL=Xn,ige=ps,Bg=kr,y7e=or;class xni extends eL.CancellationError{constructor(e){super(),this.data=e}}Mn.LSPCancellationError=xni;function Dni(s,e){return s[e]===void 0&&(s[e]={}),s[e]}Mn.ensure=Dni;var C7e;(function(s){function e(t){const i=t;return i!=null&&Bg.func(i.fillClientCapabilities)&&Bg.func(i.initialize)&&Bg.func(i.getState)&&Bg.func(i.clear)&&(i.fillInitializeParams===void 0||Bg.func(i.fillInitializeParams))}s.is=e})(C7e||(Mn.StaticFeature=C7e={}));var S7e;(function(s){function e(t){const i=t;return i!=null&&Bg.func(i.fillClientCapabilities)&&Bg.func(i.initialize)&&Bg.func(i.getState)&&Bg.func(i.clear)&&(i.fillInitializeParams===void 0||Bg.func(i.fillInitializeParams))&&Bg.func(i.register)&&Bg.func(i.unregister)&&i.registrationType!==void 0}s.is=e})(S7e||(Mn.DynamicFeature=S7e={}));class PPe{constructor(e){this._client=e}getState(){const e=this.getDocumentSelectors();let t=0;for(const n of e){t++;for(const o of eL.workspace.textDocuments)if(eL.languages.match(n,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}}}Mn.DynamicDocumentFeature=PPe;class kni extends PPe{static textDocumentFilter(e,t){for(const i of e)if(eL.languages.match(i,t)>0)return!0;return!1}constructor(e,t,i,n,o,r,a){super(e),this._event=t,this._type=i,this._middleware=n,this._createParams=o,this._textDocument=r,this._selectorFilter=a,this._selectors=new Map,this._onNotificationSent=new eL.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 n=this._createParams(i);await this._client.sendNotification(this._type,n),this.notificationSent(this.getTextDocument(i),this._type,n)};if(this.matches(e)){const i=this._middleware();return i?i(e,n=>t(n)):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(eL.languages.match(t,e)>0)return{send:i=>this.callback(i)}}}Mn.TextDocumentEventFeature=kni;class Ini extends PPe{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(ige.TextDocumentRegistrationOptions.is(t)){const i=ige.StaticRegistrationOptions.hasId(t)?t.id:y7e.generateUuid(),n=t.documentSelector??e;if(n)return[i,Object.assign({},t,{documentSelector:n})]}else if(Bg.boolean(t)&&t===!0||ige.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];const i=Bg.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[y7e.generateUuid(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Bg.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&&eL.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}}Mn.TextDocumentLanguageFeature=Ini;class Tni{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}}Mn.WorkspaceFeature=Tni;var _A={};const Lni=typeof process=="object"&&process&&process.platform==="win32";var Rni=Lni?{sep:"\\"}:{sep:"/"},Mni=kot;function kot(s,e,t){s instanceof RegExp&&(s=A7e(s,t)),e instanceof RegExp&&(e=A7e(e,t));var i=Iot(s,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+s.length,i[1]),post:t.slice(i[1]+e.length)}}function A7e(s,e){var t=e.match(s);return t?t[0]:null}kot.range=Iot;function Iot(s,e,t){var i,n,o,r,a,c=t.indexOf(s),l=t.indexOf(e,c+1),d=c;if(c>=0&&l>0){if(s===e)return[c,l];for(i=[],o=t.length;d>=0&&!a;)d==c?(i.push(d),c=t.indexOf(s,d+1)):i.length==1?a=[i.pop(),l]:(n=i.pop(),n=0?c:l;i.length&&(a=[o,r])}return a}var Tot=Mni,Nni=Oni,Lot="\0SLASH"+Math.random()+"\0",Rot="\0OPEN"+Math.random()+"\0",FPe="\0CLOSE"+Math.random()+"\0",Mot="\0COMMA"+Math.random()+"\0",Not="\0PERIOD"+Math.random()+"\0";function nge(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function Pni(s){return s.split("\\\\").join(Lot).split("\\{").join(Rot).split("\\}").join(FPe).split("\\,").join(Mot).split("\\.").join(Not)}function Fni(s){return s.split(Lot).join("\\").split(Rot).join("{").split(FPe).join("}").split(Mot).join(",").split(Not).join(".")}function Pot(s){if(!s)return[""];var e=[],t=Tot("{","}",s);if(!t)return s.split(",");var i=t.pre,n=t.body,o=t.post,r=i.split(",");r[r.length-1]+="{"+n+"}";var a=Pot(o);return o.length&&(r[r.length-1]+=a.shift(),r.push.apply(r,a)),e.push.apply(e,r),e}function Oni(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),UV(Pni(s),!0).map(Fni)):[]}function Bni(s){return"{"+s+"}"}function Wni(s){return/^-?0\d/.test(s)}function Hni(s,e){return s<=e}function Uni(s,e){return s>=e}function UV(s,e){var t=[],i=Tot("{","}",s);if(!i)return[s];var n=i.pre,o=i.post.length?UV(i.post,!1):[""];if(/\$$/.test(i.pre))for(var r=0;r=0;if(!d&&!h)return i.post.match(/,.*\}/)?(s=i.pre+"{"+i.body+FPe+i.post,UV(s)):[s];var u;if(d)u=i.body.split(/\.\./);else if(u=Pot(i.body),u.length===1&&(u=UV(u[0],!1).map(Bni),u.length===1))return o.map(function(z){return i.pre+u[0]+z});var f;if(d){var p=nge(u[0]),m=nge(u[1]),v=Math.max(u[0].length,u[1].length),b=u.length==3?Math.abs(nge(u[2])):1,w=Hni,y=m0){var P=new Array(k+1).join("0");A<0?L="-"+P+L.slice(1):L=P+L}}f.push(L)}}else{f=[];for(var R=0;R(yne(e),!t.nocomment&&e.charAt(0)==="#"?!1:new vle(e,t).match(s));var _le=om;const h1e=Rni;om.sep=h1e.sep;const Cv=Symbol("globstar **");om.GLOBSTAR=Cv;const Vni=Nni,E7e={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},u1e="[^/]",sge=u1e+"*?",zni="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",$ni="(?:(?!(?:\\/|^)\\.).)*?",Fot=s=>s.split("").reduce((e,t)=>(e[t]=!0,e),{}),x7e=Fot("().*{}+?[]^$\\!"),Gni=Fot("[.("),D7e=/\/+/;om.filter=(s,e={})=>(t,i,n)=>om(t,s,e);const fE=(s,e={})=>{const t={};return Object.keys(s).forEach(i=>t[i]=s[i]),Object.keys(e).forEach(i=>t[i]=e[i]),t};om.defaults=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return om;const e=om,t=(i,n,o)=>e(i,n,fE(s,o));return t.Minimatch=class extends e.Minimatch{constructor(n,o){super(n,fE(s,o))}},t.Minimatch.defaults=i=>e.defaults(fE(s,i)).Minimatch,t.filter=(i,n)=>e.filter(i,fE(s,n)),t.defaults=i=>e.defaults(fE(s,i)),t.makeRe=(i,n)=>e.makeRe(i,fE(s,n)),t.braceExpand=(i,n)=>e.braceExpand(i,fE(s,n)),t.match=(i,n,o)=>e.match(i,n,fE(s,o)),t};om.braceExpand=(s,e)=>Oot(s,e);const Oot=(s,e={})=>(yne(s),e.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:Vni(s)),Kni=1024*64,yne=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>Kni)throw new TypeError("pattern is too long")},oge=Symbol("subparse");om.makeRe=(s,e)=>new vle(s,e||{}).makeRe();om.match=(s,e,t={})=>{const i=new vle(e,t);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(e),s};const qni=s=>s.replace(/\\(.)/g,"$1"),Qni=s=>s.replace(/\\([^-\]])/g,"$1"),jni=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Yni=s=>s.replace(/[[\]\\]/g,"\\$&");class vle{constructor(e,t){yne(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=(...n)=>console.error(...n)),this.debug(this.pattern,i),i=this.globParts=i.map(n=>n.split(D7e)),this.debug(this.pattern,i),i=i.map((n,o,r)=>n.map(this.parse,this)),this.debug(this.pattern,i),i=i.filter(n=>n.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 n=0;n>> 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 Qot(this.pattern,this.options)}parse(e,t){Ene(e);const i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Ev;if(e==="")return"";let n="",o=!1,r=!1;const a=[],c=[];let l,d=!1,h=-1,u=-1,f,p,m,v=e.charAt(0)===".",b=i.dot||v;const w=()=>v?"":b?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=k=>k.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",C=()=>{if(l){switch(l){case"*":n+=dge,o=!0;break;case"?":n+=A1e,o=!0;break;default:n+="\\"+l;break}this.debug("clearStateChar %j %j",l,n),l=!1}};for(let k=0,P;k(G||(G="\\"),z+z+G+"|")),this.debug(`tail=%j - %s`,k,k,p,n);const P=p.type==="*"?dge:p.type==="?"?A1e:"\\"+p.type;o=!0,n=n.slice(0,p.reStart)+P+"\\("+k}C(),r&&(n+="\\\\");const A=Ksi[n.charAt(0)];for(let k=c.length-1;k>-1;k--){const P=c[k],R=n.slice(0,P.reStart),z=n.slice(P.reStart,P.reEnd-8);let G=n.slice(P.reEnd);const Y=n.slice(P.reEnd-8,P.reEnd)+G,j=R.split(")").length,ne=R.split("(").length-j;let ge=G;for(let Oe=0;Oe(r=r.map(a=>typeof a=="string"?Ysi(a):a===Ev?Ev:a._src).reduce((a,c)=>(a[a.length-1]===Ev&&c===Ev||a.push(c),a),[]),r.forEach((a,c)=>{a!==Ev||r[c-1]===Ev||(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]=Ev))}),r.filter(a=>a!==Ev).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,n)}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;S1e.sep!=="/"&&(e=e.split(S1e.sep).join("/")),e=e.split(P7e),this.debug(this.pattern,"split",e);const n=this.set;this.debug(this.pattern,"set",n);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,n=new Set;Tz.fillTabResources(n);const o=new Set,r=new Set(n);for(const a of i.values())n.has(a)?r.delete(a):o.add(a);if(this.open=n,o.size>0){const a=new Set;for(const c of o)a.add(ko.Uri.parse(c));this._onClose.fire(a)}if(r.size>0){const a=new Set;for(const c of r)a.add(ko.Uri.parse(c));this._onOpen.fire(a)}};ko.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=ko.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 ko.Uri?ko.window.activeTextEditor?.document.uri===e:ko.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof ko.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return Tz.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const n of ko.window.tabGroups.all)for(const o of n.tabs){const r=o.input;let a;r instanceof ko.TabInputText?a=r.uri:r instanceof ko.TabInputTextDiff?a=r.modified:r instanceof ko.TabInputCustom&&(a=r.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var Ud;(function(s){s[s.document=1]="document",s[s.workspace=2]="workspace"})(Ud||(Ud={}));var NS;(function(s){function e(t){return t instanceof ko.Uri?t.toString():t.uri.toString()}s.asKey=e})(NS||(NS={}));class eoi{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const n=e===Ud.document?this.documentPullStates:this.workspacePullStates,[o,r,a]=t instanceof ko.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=n.get(o);return c===void 0&&(c={document:r,pulledVersion:a,resultId:void 0},n.set(o,c)),c}update(e,t,i,n){const o=e===Ud.document?this.documentPullStates:this.workspacePullStates,[r,a,c,l]=t instanceof ko.Uri?[t.toString(),t,i,n]:[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=NS.asKey(t);(e===Ud.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=NS.asKey(t);return(e===Ud.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=NS.asKey(t);return(e===Ud.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 toi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new ko.EventEmitter,this.provider=this.createProvider(),this.diagnostics=ko.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new eoi,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof ko.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 ko.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},n=>{this.client.error(`Document pull failed for text document ${i.toString()}`,n,!1)})}async pullAsync(e,t){if(this.isDisposed)return;const i=e instanceof ko.Uri,n=i?e:e.uri,o=n.toString();t=i?t:e.version;const r=this.openRequests.get(o),a=i?this.documentStates.track(Ud.document,e,t):this.documentStates.track(Ud.document,e);if(r===void 0){const c=new ko.CancellationTokenSource;this.openRequests.set(o,{state:wu.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof E1e.LSPCancellationError&&nl.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:wu.outDated,document:e}),d===void 0&&h instanceof ko.CancellationError)d={state:wu.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(n);return}if(this.openRequests.delete(o),!this.tabs.isVisible(e)){this.documentStates.unTrack(Ud.document,e);return}if(d.state===wu.outDated)return;l!==void 0&&(l.kind===Qm.DocumentDiagnosticReportKind.full&&this.diagnostics.set(n,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===wu.reschedule&&this.pull(e)}else r.state===wu.active?(r.tokenSource.cancel(),this.openRequests.set(o,{state:wu.reschedule,document:r.document})):r.state===wu.outDated&&this.openRequests.set(o,{state:wu.reschedule,document:r.document})}forgetDocument(e){const t=e instanceof ko.Uri?e:e.uri,i=t.toString(),n=this.openRequests.get(i);this.options.workspaceDiagnostics?n!==void 0?this.openRequests.set(i,{state:wu.reschedule,document:e}):this.pull(e,()=>{this.forget(Ud.document,e)}):(n!==void 0&&(n.state===wu.active&&n.tokenSource.cancel(),this.openRequests.set(i,{state:wu.outDated,document:e})),this.diagnostics.delete(t),this.forget(Ud.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,nl.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof E1e.LSPCancellationError)&&!nl.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,nl.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 ko.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===Qm.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(Ud.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(Ud.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,n)=>{const o=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof ko.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(nl.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}:h.kind===nl.DocumentDiagnosticReportKind.Full?{kind:Qm.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:Qm.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(nl.DocumentDiagnosticRequest.type,l,h,{kind:Qm.DocumentDiagnosticReportKind.full,items:[]}))},r=this.client.middleware;return r.provideDiagnostics?r.provideDiagnostics(t,i,n,o):o(t,i,n)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,n)=>{const o=async l=>l.kind===nl.DocumentDiagnosticReportKind.Full?{kind:Qm.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:Qm.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,Zsi.generateUuid)(),u=this.client.onProgress(nl.WorkspaceDiagnosticRequest.partialResult,h,async p=>{if(p==null){n(null);return}const m={items:[]};for(const v of p.items)try{m.items.push(await o(v))}catch(b){this.client.error("Converting workspace diagnostics failed.",b)}n(m)}),f={identifier:this.options.identifier,previousResultIds:r(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(nl.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(),n(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(nl.DocumentDiagnosticRequest.type,d,p,{items:[]})))},c=this.client.middleware;return c.provideWorkspaceDiagnostics?c.provideWorkspaceDiagnostics(t,i,n,a):a(t,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(const[e,t]of this.openRequests)t.state===wu.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:wu.outDated,document:t.document});this.diagnostics.dispose()}}class ioi{constructor(e){this.diagnosticRequestor=e,this.documents=new nl.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=NS.asKey(e);this.documents.has(t)||(this.documents.set(t,e,nl.Touch.Last),this.trigger())}remove(e){const t=NS.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,nl.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=NS.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,nl.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?NS.asKey(this.endDocument):void 0}}class noi{constructor(e,t,i){const n=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},o=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),r=[],a=p=>{const m=i.documentSelector;if(n.match!==void 0)return n.match(m,p);for(const v of m)if(nl.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 b=new Xsi.Minimatch(v.pattern,{noext:!0});if(!b.makeRe()||!b.match(p.fsPath))return!1}}return!0},c=p=>p instanceof ko.Uri?a(p):ko.languages.match(o,p)>0&&t.isVisible(p),l=p=>p instanceof ko.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new toi(e,t,i),this.backgroundScheduler=new ioi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=ko.window.activeTextEditor?.document,ko.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(nl.DidOpenTextDocumentNotification.method);r.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(Ud.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),r.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(Ud.document,m))continue;const v=m.toString();let b;for(const w of ko.workspace.textDocuments)if(v===w.uri.toString()){b=w;break}b!==void 0&&c(b)&&this.diagnosticRequestor.pull(b,()=>{d(b)})}}));const u=new Set;for(const p of ko.workspace.textDocuments)c(p)&&(this.diagnosticRequestor.pull(p,()=>{d(p)}),u.add(p.uri.toString()));if(n.onTabs===!0)for(const p of t.getTabResources())!u.has(p.toString())&&c(p)&&this.diagnosticRequestor.pull(p,()=>{d(p)});if(n.onChange===!0){const p=e.getFeature(nl.DidChangeTextDocumentNotification.method);r.push(p.onNotificationSent(async m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,xne.onType))&&this.diagnosticRequestor.knows(Ud.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(n.onSave===!0){const p=e.getFeature(nl.DidSaveTextDocumentNotification.method);r.push(p.onNotificationSent(m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,xne.onSave))&&this.diagnosticRequestor.knows(Ud.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(nl.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 ko.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=ko.Disposable.from(...r,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(Ud.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class soi extends E1e.TextDocumentLanguageFeature{constructor(e){super(e,nl.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=JK(JK(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,JK(JK(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(nl.DiagnosticRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeDiagnosticsEmitter.fire()});let[n,o]=this.getRegistration(t,e.diagnosticProvider);!n||!o||this.register({id:n,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 Tz);const t=new noi(this._client,this.tabs,e);return[t.disposable,t]}}bA.DiagnosticFeature=soi;var vh={},xle={},yh={};Object.defineProperty(yh,"__esModule",{value:!0});yh.forEach=yh.mapAsync=yh.map=yh.clearTestMode=yh.setTestMode=yh.Semaphore=yh.Delayer=void 0;const mG=ps;class ooi{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,mG.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)}}yh.Delayer=ooi;class roi{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,mG.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()}}}yh.Semaphore=roi;let jPe=!1;function aoi(){jPe=!0}yh.setTestMode=aoi;function coi(){jPe=!1}yh.clearTestMode=coi;const F7e=15;class YPe{constructor(e=F7e){this.yieldAfter=jPe===!0?Math.max(e,2):Math.max(e,F7e),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 loi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),o=new YPe(i?.yieldAfter);function r(c){o.start();for(let l=c;l{(0,mG.RAL)().timer.setImmediate(()=>{c(r(a))})});return n}yh.map=loi;async function doi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),o=new YPe(i?.yieldAfter);async function r(c){o.start();for(let l=c;l{(0,mG.RAL)().timer.setImmediate(()=>{c(r(a))})});return n}yh.mapAsync=doi;async function hoi(s,e,t,i){if(s.length===0)return;const n=new YPe(i?.yieldAfter);function o(a){n.start();for(let c=a;c{(0,mG.RAL)().timer.setImmediate(()=>{a(o(r))})})}yh.forEach=hoi;var Dle={};Object.defineProperty(Dle,"__esModule",{value:!0});const uoi=Xn;class goi extends uoi.CompletionItem{constructor(e){super(e)}}Dle.default=goi;var kle={};Object.defineProperty(kle,"__esModule",{value:!0});const foi=Xn;class poi extends foi.CodeLens{constructor(e){super(e)}}kle.default=poi;var Ile={};Object.defineProperty(Ile,"__esModule",{value:!0});const moi=Xn;class _oi extends moi.DocumentLink{constructor(e,t){super(e,t)}}Ile.default=_oi;var Tle={};Object.defineProperty(Tle,"__esModule",{value:!0});const voi=Xn;class boi extends voi.CodeAction{constructor(e,t){super(e),this.data=t}}Tle.default=boi;var bN={};Object.defineProperty(bN,"__esModule",{value:!0});bN.ProtocolDiagnostic=bN.DiagnosticCode=void 0;const woi=Xn,uge=kr;var O7e;(function(s){function e(t){const i=t;return i!=null&&(uge.number(i.value)||uge.string(i.value))&&uge.string(i.target)}s.is=e})(O7e||(bN.DiagnosticCode=O7e={}));class yoi extends woi.Diagnostic{constructor(e,t,i,n){super(e,t,i),this.data=n,this.hasDiagnosticCode=!1}}bN.ProtocolDiagnostic=yoi;var Lle={};Object.defineProperty(Lle,"__esModule",{value:!0});const Coi=Xn;class Soi extends Coi.CallHierarchyItem{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),a!==void 0&&(this.data=a)}}Lle.default=Soi;var Rle={};Object.defineProperty(Rle,"__esModule",{value:!0});const Aoi=Xn;class Eoi extends Aoi.TypeHierarchyItem{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),a!==void 0&&(this.data=a)}}Rle.default=Eoi;var Mle={};Object.defineProperty(Mle,"__esModule",{value:!0});const XK=Xn;class xoi extends XK.SymbolInformation{constructor(e,t,i,n,o){const r=!(n instanceof XK.Uri);super(e,t,i,r?n:new XK.Location(n,new XK.Range(0,0,0,0))),this.hasRange=r,o!==void 0&&(this.data=o)}}Mle.default=xoi;var Nle={};Object.defineProperty(Nle,"__esModule",{value:!0});const Doi=Xn;class koi extends Doi.InlayHint{constructor(e,t,i){super(e,t,i)}}Nle.default=koi;Object.defineProperty(xle,"__esModule",{value:!0});xle.createConverter=void 0;const Fl=Xn,ms=ps,QI=kr,B7e=yh,Ioi=Dle,Toi=kle,Loi=Ile,W7e=Tle,H7e=bN,Roi=Lle,Moi=Rle,Noi=Mle,Poi=Nle;var x1e;(function(s){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}s.is=e})(x1e||(x1e={}));function Foi(s){const t=s||(ee=>ee.toString());function i(ee){return t(ee)}function n(ee){return{uri:t(ee.uri)}}function o(ee){return{uri:t(ee.uri),languageId:ee.languageId,version:ee.version,text:ee.getText()}}function r(ee){return{uri:t(ee.uri),version:ee.version}}function a(ee){return{textDocument:o(ee)}}function c(ee){const xe=ee;return!!xe.document&&!!xe.contentChanges}function l(ee){const xe=ee;return!!xe.uri&&!!xe.version}function d(ee,xe,gt){if(l(ee))return{textDocument:{uri:t(ee.uri),version:ee.version},contentChanges:[{text:ee.getText()}]};if(c(ee)){const zn=xe,Cs=gt;return{textDocument:{uri:t(zn),version:Cs},contentChanges:ee.contentChanges.map(Ha=>{const ea=Ha.range;return{range:{start:{line:ea.start.line,character:ea.start.character},end:{line:ea.end.line,character:ea.end.character}},rangeLength:Ha.rangeLength,text:Ha.text}})}}else throw Error("Unsupported text document change parameter")}function h(ee){return{textDocument:n(ee)}}function u(ee,xe=!1){let gt={textDocument:n(ee)};return xe&&(gt.text=ee.getText()),gt}function f(ee){switch(ee){case Fl.TextDocumentSaveReason.Manual:return ms.TextDocumentSaveReason.Manual;case Fl.TextDocumentSaveReason.AfterDelay:return ms.TextDocumentSaveReason.AfterDelay;case Fl.TextDocumentSaveReason.FocusOut:return ms.TextDocumentSaveReason.FocusOut}return ms.TextDocumentSaveReason.Manual}function p(ee){return{textDocument:n(ee.document),reason:f(ee.reason)}}function m(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function v(ee){return{files:ee.files.map(xe=>({oldUri:t(xe.oldUri),newUri:t(xe.newUri)}))}}function b(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function w(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function y(ee){return{files:ee.files.map(xe=>({oldUri:t(xe.oldUri),newUri:t(xe.newUri)}))}}function C(ee){return{files:ee.files.map(xe=>({uri:t(xe)}))}}function A(ee,xe){return{textDocument:n(ee),position:ge(xe)}}function L(ee){switch(ee){case Fl.CompletionTriggerKind.TriggerCharacter:return ms.CompletionTriggerKind.TriggerCharacter;case Fl.CompletionTriggerKind.TriggerForIncompleteCompletions:return ms.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return ms.CompletionTriggerKind.Invoked}}function k(ee,xe,gt){return{textDocument:n(ee),position:ge(xe),context:{triggerKind:L(gt.triggerKind),triggerCharacter:gt.triggerCharacter}}}function P(ee){switch(ee){case Fl.SignatureHelpTriggerKind.Invoke:return ms.SignatureHelpTriggerKind.Invoked;case Fl.SignatureHelpTriggerKind.TriggerCharacter:return ms.SignatureHelpTriggerKind.TriggerCharacter;case Fl.SignatureHelpTriggerKind.ContentChange:return ms.SignatureHelpTriggerKind.ContentChange}}function R(ee){return{label:ee.label}}function z(ee){return ee.map(R)}function G(ee){return{label:ee.label,parameters:z(ee.parameters)}}function Y(ee){return ee.map(G)}function j(ee){return ee===void 0?ee:{signatures:Y(ee.signatures),activeSignature:ee.activeSignature,activeParameter:ee.activeParameter}}function ne(ee,xe,gt){return{textDocument:n(ee),position:ge(xe),context:{isRetrigger:gt.isRetrigger,triggerCharacter:gt.triggerCharacter,triggerKind:P(gt.triggerKind),activeSignatureHelp:j(gt.activeSignatureHelp)}}}function ge(ee){return{line:ee.line,character:ee.character}}function De(ee){return ee==null?ee:{line:ee.line>ms.uinteger.MAX_VALUE?ms.uinteger.MAX_VALUE:ee.line,character:ee.character>ms.uinteger.MAX_VALUE?ms.uinteger.MAX_VALUE:ee.character}}function Oe(ee,xe){return B7e.map(ee,De,xe)}function yt(ee){return ee.map(De)}function Ne(ee){return ee==null?ee:{start:De(ee.start),end:De(ee.end)}}function lt(ee){return ee.map(Ne)}function xt(ee){return ee==null?ee:ms.Location.create(i(ee.uri),Ne(ee.range))}function Ji(ee){switch(ee){case Fl.DiagnosticSeverity.Error:return ms.DiagnosticSeverity.Error;case Fl.DiagnosticSeverity.Warning:return ms.DiagnosticSeverity.Warning;case Fl.DiagnosticSeverity.Information:return ms.DiagnosticSeverity.Information;case Fl.DiagnosticSeverity.Hint:return ms.DiagnosticSeverity.Hint}}function Ii(ee){if(!ee)return;let xe=[];for(let gt of ee){let zn=ns(gt);zn!==void 0&&xe.push(zn)}return xe.length>0?xe:void 0}function ns(ee){switch(ee){case Fl.DiagnosticTag.Unnecessary:return ms.DiagnosticTag.Unnecessary;case Fl.DiagnosticTag.Deprecated:return ms.DiagnosticTag.Deprecated;default:return}}function zs(ee){return{message:ee.message,location:xt(ee.location)}}function Pn(ee){return ee.map(zs)}function Xr(ee){if(ee!=null)return QI.number(ee)||QI.string(ee)?ee:{value:ee.value,target:i(ee.target)}}function ds(ee){const xe=ms.Diagnostic.create(Ne(ee.range),ee.message),gt=ee instanceof H7e.ProtocolDiagnostic?ee:void 0;gt!==void 0&>.data!==void 0&&(xe.data=gt.data);const zn=Xr(ee.code);return H7e.DiagnosticCode.is(zn)?gt!==void 0&>.hasDiagnosticCode?xe.code=zn:(xe.code=zn.value,xe.codeDescription={href:zn.target}):xe.code=zn,QI.number(ee.severity)&&(xe.severity=Ji(ee.severity)),Array.isArray(ee.tags)&&(xe.tags=Ii(ee.tags)),ee.relatedInformation&&(xe.relatedInformation=Pn(ee.relatedInformation)),ee.source&&(xe.source=ee.source),xe}function Zo(ee,xe){return ee==null?ee:B7e.map(ee,ds,xe)}function Zr(ee){return ee==null?ee:ee.map(ds)}function Di(ee,xe){switch(ee){case"$string":return xe;case ms.MarkupKind.PlainText:return{kind:ee,value:xe};case ms.MarkupKind.Markdown:return{kind:ee,value:xe.value};default:return`Unsupported Markup content received. Kind is: ${ee}`}}function ss(ee){switch(ee){case Fl.CompletionItemTag.Deprecated:return ms.CompletionItemTag.Deprecated}}function Oo(ee){if(ee===void 0)return ee;const xe=[];for(let gt of ee){const zn=ss(gt);zn!==void 0&&xe.push(zn)}return xe}function Tn(ee,xe){return xe!==void 0?xe:ee+1}function Ba(ee,xe=!1){let gt,zn;QI.string(ee.label)?gt=ee.label:(gt=ee.label.label,xe&&(ee.label.detail!==void 0||ee.label.description!==void 0)&&(zn={detail:ee.label.detail,description:ee.label.description}));let Cs={label:gt};zn!==void 0&&(Cs.labelDetails=zn);let Wo=ee instanceof Ioi.default?ee:void 0;ee.detail&&(Cs.detail=ee.detail),ee.documentation&&(!Wo||Wo.documentationFormat==="$string"?Cs.documentation=ee.documentation:Cs.documentation=Di(Wo.documentationFormat,ee.documentation)),ee.filterText&&(Cs.filterText=ee.filterText),vd(Cs,ee),QI.number(ee.kind)&&(Cs.kind=Tn(ee.kind,Wo&&Wo.originalItemKind)),ee.sortText&&(Cs.sortText=ee.sortText),ee.additionalTextEdits&&(Cs.additionalTextEdits=pc(ee.additionalTextEdits)),ee.commitCharacters&&(Cs.commitCharacters=ee.commitCharacters.slice()),ee.command&&(Cs.command=Or(ee.command)),(ee.preselect===!0||ee.preselect===!1)&&(Cs.preselect=ee.preselect);const Ha=Oo(ee.tags);if(Wo){if(Wo.data!==void 0&&(Cs.data=Wo.data),Wo.deprecated===!0||Wo.deprecated===!1){if(Wo.deprecated===!0&&Ha!==void 0&&Ha.length>0){const ea=Ha.indexOf(Fl.CompletionItemTag.Deprecated);ea!==-1&&Ha.splice(ea,1)}Cs.deprecated=Wo.deprecated}Wo.insertTextMode!==void 0&&(Cs.insertTextMode=Wo.insertTextMode)}return Ha!==void 0&&Ha.length>0&&(Cs.tags=Ha),Cs.insertTextMode===void 0&&ee.keepWhitespace===!0&&(Cs.insertTextMode=ms.InsertTextMode.adjustIndentation),Cs}function vd(ee,xe){let gt=ms.InsertTextFormat.PlainText,zn,Cs;xe.textEdit?(zn=xe.textEdit.newText,Cs=xe.textEdit.range):xe.insertText instanceof Fl.SnippetString?(gt=ms.InsertTextFormat.Snippet,zn=xe.insertText.value):zn=xe.insertText,xe.range&&(Cs=xe.range),ee.insertTextFormat=gt,xe.fromEdit&&zn!==void 0&&Cs!==void 0?ee.textEdit=Fn(zn,Cs):ee.insertText=zn}function Fn(ee,xe){return x1e.is(xe)?ms.InsertReplaceEdit.create(ee,Ne(xe.inserting),Ne(xe.replacing)):{newText:ee,range:Ne(xe)}}function th(ee){return{range:Ne(ee.range),newText:ee.newText}}function pc(ee){return ee==null?ee:ee.map(th)}function zc(ee){return ee<=Fl.SymbolKind.TypeParameter?ee+1:ms.SymbolKind.Property}function $s(ee){return ee}function tc(ee){return ee.map($s)}function fl(ee,xe,gt){return{textDocument:n(ee),position:ge(xe),context:{includeDeclaration:gt.includeDeclaration}}}async function ih(ee,xe){let gt=ms.CodeAction.create(ee.title);if(ee instanceof W7e.default&&ee.data!==void 0&&(gt.data=ee.data),ee.kind!==void 0&&(gt.kind=Dc(ee.kind)),ee.diagnostics!==void 0&&(gt.diagnostics=await Zo(ee.diagnostics,xe)),ee.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return ee.command!==void 0&&(gt.command=Or(ee.command)),ee.isPreferred!==void 0&&(gt.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(gt.disabled={reason:ee.disabled.reason}),gt}function gg(ee){let xe=ms.CodeAction.create(ee.title);if(ee instanceof W7e.default&&ee.data!==void 0&&(xe.data=ee.data),ee.kind!==void 0&&(xe.kind=Dc(ee.kind)),ee.diagnostics!==void 0&&(xe.diagnostics=Zr(ee.diagnostics)),ee.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return ee.command!==void 0&&(xe.command=Or(ee.command)),ee.isPreferred!==void 0&&(xe.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(xe.disabled={reason:ee.disabled.reason}),xe}async function mc(ee,xe){if(ee==null)return ee;let gt;return ee.only&&QI.string(ee.only.value)&&(gt=[ee.only.value]),ms.CodeActionContext.create(await Zo(ee.diagnostics,xe),gt,nh(ee.triggerKind))}function $c(ee){if(ee==null)return ee;let xe;return ee.only&&QI.string(ee.only.value)&&(xe=[ee.only.value]),ms.CodeActionContext.create(Zr(ee.diagnostics),xe,nh(ee.triggerKind))}function nh(ee){switch(ee){case Fl.CodeActionTriggerKind.Invoke:return ms.CodeActionTriggerKind.Invoked;case Fl.CodeActionTriggerKind.Automatic:return ms.CodeActionTriggerKind.Automatic;default:return}}function Dc(ee){if(ee!=null)return ee.value}function pl(ee){return ee==null?ee:ms.InlineValueContext.create(ee.frameId,Ne(ee.stoppedLocation))}function ic(ee,xe,gt){return{context:ms.InlineCompletionContext.create(gt.triggerKind,gt.selectedCompletionInfo),textDocument:n(ee),position:De(xe)}}function Or(ee){let xe=ms.Command.create(ee.title,ee.command);return ee.arguments&&(xe.arguments=ee.arguments),xe}function ml(ee){let xe=ms.CodeLens.create(Ne(ee.range));return ee.command&&(xe.command=Or(ee.command)),ee instanceof Toi.default&&ee.data&&(xe.data=ee.data),xe}function sh(ee,xe){const gt={tabSize:ee.tabSize,insertSpaces:ee.insertSpaces};return xe.trimTrailingWhitespace&&(gt.trimTrailingWhitespace=!0),xe.trimFinalNewlines&&(gt.trimFinalNewlines=!0),xe.insertFinalNewline&&(gt.insertFinalNewline=!0),gt}function oh(ee){return{textDocument:n(ee)}}function Gc(ee){return{textDocument:n(ee)}}function Kc(ee){let xe=ms.DocumentLink.create(Ne(ee.range));ee.target&&(xe.target=i(ee.target)),ee.tooltip!==void 0&&(xe.tooltip=ee.tooltip);let gt=ee instanceof Loi.default?ee:void 0;return gt&>.data&&(xe.data=gt.data),xe}function Wa(ee){return{textDocument:n(ee)}}function Bo(ee){const xe={name:ee.name,kind:zc(ee.kind),uri:i(ee.uri),range:Ne(ee.range),selectionRange:Ne(ee.selectionRange)};return ee.detail!==void 0&&ee.detail.length>0&&(xe.detail=ee.detail),ee.tags!==void 0&&(xe.tags=tc(ee.tags)),ee instanceof Roi.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function Is(ee){const xe={name:ee.name,kind:zc(ee.kind),uri:i(ee.uri),range:Ne(ee.range),selectionRange:Ne(ee.selectionRange)};return ee.detail!==void 0&&ee.detail.length>0&&(xe.detail=ee.detail),ee.tags!==void 0&&(xe.tags=tc(ee.tags)),ee instanceof Moi.default&&ee.data!==void 0&&(xe.data=ee.data),xe}function kc(ee){const xe=ee instanceof Noi.default?{name:ee.name,kind:zc(ee.kind),location:ee.hasRange?xt(ee.location):{uri:t(ee.location.uri)},data:ee.data}:{name:ee.name,kind:zc(ee.kind),location:xt(ee.location)};return ee.tags!==void 0&&(xe.tags=tc(ee.tags)),ee.containerName!==""&&(xe.containerName=ee.containerName),xe}function Nh(ee){const xe=typeof ee.label=="string"?ee.label:ee.label.map(be),gt=ms.InlayHint.create(De(ee.position),xe);return ee.kind!==void 0&&(gt.kind=ee.kind),ee.textEdits!==void 0&&(gt.textEdits=pc(ee.textEdits)),ee.tooltip!==void 0&&(gt.tooltip=Aa(ee.tooltip)),ee.paddingLeft!==void 0&&(gt.paddingLeft=ee.paddingLeft),ee.paddingRight!==void 0&&(gt.paddingRight=ee.paddingRight),ee instanceof Poi.default&&ee.data!==void 0&&(gt.data=ee.data),gt}function be(ee){const xe=ms.InlayHintLabelPart.create(ee.value);return ee.location!==void 0&&(xe.location=xt(ee.location)),ee.command!==void 0&&(xe.command=Or(ee.command)),ee.tooltip!==void 0&&(xe.tooltip=Aa(ee.tooltip)),xe}function Aa(ee){return typeof ee=="string"?ee:{kind:ms.MarkupKind.Markdown,value:ee.value}}return{asUri:i,asTextDocumentIdentifier:n,asTextDocumentItem:o,asVersionedTextDocumentIdentifier:r,asOpenTextDocumentParams:a,asChangeTextDocumentParams:d,asCloseTextDocumentParams:h,asSaveTextDocumentParams:u,asWillSaveTextDocumentParams:p,asDidCreateFilesParams:m,asDidRenameFilesParams:v,asDidDeleteFilesParams:b,asWillCreateFilesParams:w,asWillRenameFilesParams:y,asWillDeleteFilesParams:C,asTextDocumentPositionParams:A,asCompletionParams:k,asSignatureHelpParams:ne,asWorkerPosition:ge,asRange:Ne,asRanges:lt,asPosition:De,asPositions:Oe,asPositionsSync:yt,asLocation:xt,asDiagnosticSeverity:Ji,asDiagnosticTag:ns,asDiagnostic:ds,asDiagnostics:Zo,asDiagnosticsSync:Zr,asCompletionItem:Ba,asTextEdit:th,asSymbolKind:zc,asSymbolTag:$s,asSymbolTags:tc,asReferenceParams:fl,asCodeAction:ih,asCodeActionSync:gg,asCodeActionContext:mc,asCodeActionContextSync:$c,asInlineValueContext:pl,asCommand:Or,asCodeLens:ml,asFormattingOptions:sh,asDocumentSymbolParams:oh,asCodeLensParams:Gc,asDocumentLink:Kc,asDocumentLinkParams:Wa,asCallHierarchyItem:Bo,asTypeHierarchyItem:Is,asInlayHint:Nh,asWorkspaceSymbol:kc,asInlineCompletionParams:ic}}xle.createConverter=Foi;var Ple={};Object.defineProperty(Ple,"__esModule",{value:!0});Ple.createConverter=void 0;const di=Xn,On=ps,jm=kr,hr=yh,Ooi=Dle,Boi=kle,Woi=Ile,Hoi=Tle,U7e=bN,Uoi=Lle,Voi=Rle,zoi=Mle,$oi=Nle,V7e=ps;var Dne;(function(s){function e(t){let i=t;return i&&jm.string(i.language)&&jm.string(i.value)}s.is=e})(Dne||(Dne={}));function Goi(s,e,t){const n=s||(T=>di.Uri.parse(T));function o(T){return n(T)}function r(T){const ie=[];for(const ye of T)if(typeof ye=="string")ie.push(ye);else if(V7e.NotebookCellTextDocumentFilter.is(ye))if(typeof ye.notebook=="string")ie.push({notebookType:ye.notebook,language:ye.language});else{const O=ye.notebook.notebookType??"*";ie.push({notebookType:O,scheme:ye.notebook.scheme,pattern:ye.notebook.pattern,language:ye.language})}else V7e.TextDocumentFilter.is(ye)&&ie.push({language:ye.language,scheme:ye.scheme,pattern:ye.pattern});return ie}async function a(T,ie){return hr.map(T,l,ie)}function c(T){const ie=new Array(T.length);for(let ye=0;ye0?ie:void 0}function u(T){switch(T){case On.DiagnosticTag.Unnecessary:return di.DiagnosticTag.Unnecessary;case On.DiagnosticTag.Deprecated:return di.DiagnosticTag.Deprecated;default:return}}function f(T){return T?new di.Position(T.line,T.character):void 0}function p(T){return T?new di.Range(T.start.line,T.start.character,T.end.line,T.end.character):void 0}async function m(T,ie){return hr.map(T,ye=>new di.Range(ye.start.line,ye.start.character,ye.end.line,ye.end.character),ie)}function v(T){if(T==null)return di.DiagnosticSeverity.Error;switch(T){case On.DiagnosticSeverity.Error:return di.DiagnosticSeverity.Error;case On.DiagnosticSeverity.Warning:return di.DiagnosticSeverity.Warning;case On.DiagnosticSeverity.Information:return di.DiagnosticSeverity.Information;case On.DiagnosticSeverity.Hint:return di.DiagnosticSeverity.Hint}return di.DiagnosticSeverity.Error}function b(T){if(jm.string(T))return y(T);if(Dne.is(T))return y().appendCodeblock(T.value,T.language);if(Array.isArray(T)){let ie=[];for(let ye of T){let O=y();Dne.is(ye)?O.appendCodeblock(ye.value,ye.language):O.appendMarkdown(ye),ie.push(O)}return ie}else return y(T)}function w(T){if(jm.string(T))return T;switch(T.kind){case On.MarkupKind.Markdown:return y(T.value);case On.MarkupKind.PlainText:return T.value;default:return`Unsupported Markup content received. Kind is: ${T.kind}`}}function y(T){let ie;if(T===void 0||typeof T=="string")ie=new di.MarkdownString(T);else switch(T.kind){case On.MarkupKind.Markdown:ie=new di.MarkdownString(T.value);break;case On.MarkupKind.PlainText:ie=new di.MarkdownString,ie.appendText(T.value);break;default:ie=new di.MarkdownString,ie.appendText(`Unsupported Markup content received. Kind is: ${T.kind}`);break}return ie.isTrusted=e,ie.supportHtml=t,ie}function C(T){if(T)return new di.Hover(b(T.contents),p(T.range))}async function A(T,ie,ye){if(!T)return;if(Array.isArray(T))return hr.map(T,Bi=>z(Bi,ie),ye);const O=T,{defaultRange:$,commitCharacters:se}=L(O,ie),Ke=await hr.map(O.items,Bi=>z(Bi,se,$,O.itemDefaults?.insertTextMode,O.itemDefaults?.insertTextFormat,O.itemDefaults?.data),ye);return new di.CompletionList(Ke,O.isIncomplete)}function L(T,ie){const ye=T.itemDefaults?.editRange,O=T.itemDefaults?.commitCharacters??ie;return On.Range.is(ye)?{defaultRange:p(ye),commitCharacters:O}:ye!==void 0?{defaultRange:{inserting:p(ye.insert),replacing:p(ye.replace)},commitCharacters:O}:{defaultRange:void 0,commitCharacters:O}}function k(T){return On.CompletionItemKind.Text<=T&&T<=On.CompletionItemKind.TypeParameter?[T-1,void 0]:[di.CompletionItemKind.Text,T]}function P(T){switch(T){case On.CompletionItemTag.Deprecated:return di.CompletionItemTag.Deprecated}}function R(T){if(T==null)return[];const ie=[];for(const ye of T){const O=P(ye);O!==void 0&&ie.push(O)}return ie}function z(T,ie,ye,O,$,se){const Ke=R(T.tags),Bi=G(T),Wi=new Ooi.default(Bi);T.detail&&(Wi.detail=T.detail),T.documentation&&(Wi.documentation=w(T.documentation),Wi.documentationFormat=jm.string(T.documentation)?"$string":T.documentation.kind),T.filterText&&(Wi.filterText=T.filterText);const ta=Y(T,ye,$);if(ta&&(Wi.insertText=ta.text,Wi.range=ta.range,Wi.fromEdit=ta.fromEdit),jm.number(T.kind)){let[ert,fFe]=k(T.kind);Wi.kind=ert,fFe&&(Wi.originalItemKind=fFe)}T.sortText&&(Wi.sortText=T.sortText),T.additionalTextEdits&&(Wi.additionalTextEdits=De(T.additionalTextEdits));const Pl=T.commitCharacters!==void 0?jm.stringArray(T.commitCharacters)?T.commitCharacters:void 0:ie;Pl&&(Wi.commitCharacters=Pl.slice()),T.command&&(Wi.command=pc(T.command)),(T.deprecated===!0||T.deprecated===!1)&&(Wi.deprecated=T.deprecated,T.deprecated===!0&&Ke.push(di.CompletionItemTag.Deprecated)),(T.preselect===!0||T.preselect===!1)&&(Wi.preselect=T.preselect);const fg=T.data??se;fg!==void 0&&(Wi.data=fg),Ke.length>0&&(Wi.tags=Ke);const ude=T.insertTextMode??O;return ude!==void 0&&(Wi.insertTextMode=ude,ude===On.InsertTextMode.asIs&&(Wi.keepWhitespace=!0)),Wi}function G(T){return On.CompletionItemLabelDetails.is(T.labelDetails)?{label:T.label,detail:T.labelDetails.detail,description:T.labelDetails.description}:T.label}function Y(T,ie,ye){const O=T.insertTextFormat??ye;if(T.textEdit!==void 0||ie!==void 0){const[$,se]=T.textEdit!==void 0?j(T.textEdit):[ie,T.textEditText??T.label];return O===On.InsertTextFormat.Snippet?{text:new di.SnippetString(se),range:$,fromEdit:!0}:{text:se,range:$,fromEdit:!0}}else return T.insertText?O===On.InsertTextFormat.Snippet?{text:new di.SnippetString(T.insertText),fromEdit:!1}:{text:T.insertText,fromEdit:!1}:void 0}function j(T){return On.InsertReplaceEdit.is(T)?[{inserting:p(T.insert),replacing:p(T.replace)},T.newText]:[p(T.range),T.newText]}function ne(T){if(T)return new di.TextEdit(p(T.range),T.newText)}async function ge(T,ie){if(T)return hr.map(T,ne,ie)}function De(T){if(!T)return;const ie=new Array(T.length);for(let ye=0;ye0){let ye=[];for(let O of T.children)ye.push(Fn(O));ie.children=ye}return ie}function th(T,ie){T.tags=Tn(ie.tags),ie.deprecated&&(T.tags?T.tags.includes(di.SymbolTag.Deprecated)||(T.tags=T.tags.concat(di.SymbolTag.Deprecated)):T.tags=[di.SymbolTag.Deprecated])}function pc(T){let ie={title:T.title,command:T.command};return T.arguments&&(ie.arguments=T.arguments),ie}async function zc(T,ie){if(T)return hr.map(T,pc,ie)}const $s=new Map;$s.set(On.CodeActionKind.Empty,di.CodeActionKind.Empty),$s.set(On.CodeActionKind.QuickFix,di.CodeActionKind.QuickFix),$s.set(On.CodeActionKind.Refactor,di.CodeActionKind.Refactor),$s.set(On.CodeActionKind.RefactorExtract,di.CodeActionKind.RefactorExtract),$s.set(On.CodeActionKind.RefactorInline,di.CodeActionKind.RefactorInline),$s.set(On.CodeActionKind.RefactorRewrite,di.CodeActionKind.RefactorRewrite),$s.set(On.CodeActionKind.Source,di.CodeActionKind.Source),$s.set(On.CodeActionKind.SourceOrganizeImports,di.CodeActionKind.SourceOrganizeImports);function tc(T){if(T==null)return;let ie=$s.get(T);if(ie)return ie;let ye=T.split(".");ie=di.CodeActionKind.Empty;for(let O of ye)ie=ie.append(O);return ie}function fl(T){if(T!=null)return T.map(ie=>tc(ie))}async function ih(T,ie){if(T==null)return;let ye=new Hoi.default(T.title,T.data);return T.kind!==void 0&&(ye.kind=tc(T.kind)),T.diagnostics!==void 0&&(ye.diagnostics=c(T.diagnostics)),T.edit!==void 0&&(ye.edit=await nh(T.edit,ie)),T.command!==void 0&&(ye.command=pc(T.command)),T.isPreferred!==void 0&&(ye.isPreferred=T.isPreferred),T.disabled!==void 0&&(ye.disabled={reason:T.disabled.reason}),ye}function gg(T,ie){return hr.mapAsync(T,async ye=>On.Command.is(ye)?pc(ye):ih(ye,ie),ie)}function mc(T){if(!T)return;let ie=new Boi.default(p(T.range));return T.command&&(ie.command=pc(T.command)),T.data!==void 0&&T.data!==null&&(ie.data=T.data),ie}async function $c(T,ie){if(T)return hr.map(T,mc,ie)}async function nh(T,ie){if(!T)return;const ye=new Map;if(T.changeAnnotations!==void 0){const se=T.changeAnnotations;await hr.forEach(Object.keys(se),Ke=>{const Bi=Dc(se[Ke]);ye.set(Ke,Bi)},ie)}const O=se=>{if(se!==void 0)return ye.get(se)},$=new di.WorkspaceEdit;if(T.documentChanges){const se=T.documentChanges;await hr.forEach(se,Ke=>{if(On.CreateFile.is(Ke))$.createFile(n(Ke.uri),Ke.options,O(Ke.annotationId));else if(On.RenameFile.is(Ke))$.renameFile(n(Ke.oldUri),n(Ke.newUri),Ke.options,O(Ke.annotationId));else if(On.DeleteFile.is(Ke))$.deleteFile(n(Ke.uri),Ke.options,O(Ke.annotationId));else if(On.TextDocumentEdit.is(Ke)){const Bi=n(Ke.textDocument.uri);for(const Wi of Ke.edits)On.AnnotatedTextEdit.is(Wi)?$.replace(Bi,p(Wi.range),Wi.newText,O(Wi.annotationId)):$.replace(Bi,p(Wi.range),Wi.newText)}else throw new Error(`Unknown workspace edit change received: -${JSON.stringify(Ke,void 0,4)}`)},ie)}else if(T.changes){const se=T.changes;await hr.forEach(Object.keys(se),Ke=>{$.set(n(Ke),De(se[Ke]))},ie)}return $}function Dc(T){if(T!==void 0)return{label:T.label,needsConfirmation:!!T.needsConfirmation,description:T.description}}function pl(T){let ie=p(T.range),ye=T.target?o(T.target):void 0,O=new Woi.default(ie,ye);return T.tooltip!==void 0&&(O.tooltip=T.tooltip),T.data!==void 0&&T.data!==null&&(O.data=T.data),O}async function ic(T,ie){if(T)return hr.map(T,pl,ie)}function Or(T){return new di.Color(T.red,T.green,T.blue,T.alpha)}function ml(T){return new di.ColorInformation(p(T.range),Or(T.color))}async function sh(T,ie){if(T)return hr.map(T,ml,ie)}function oh(T){let ie=new di.ColorPresentation(T.label);return ie.additionalTextEdits=De(T.additionalTextEdits),T.textEdit&&(ie.textEdit=ne(T.textEdit)),ie}async function Gc(T,ie){if(T)return hr.map(T,oh,ie)}function Kc(T){if(T)switch(T){case On.FoldingRangeKind.Comment:return di.FoldingRangeKind.Comment;case On.FoldingRangeKind.Imports:return di.FoldingRangeKind.Imports;case On.FoldingRangeKind.Region:return di.FoldingRangeKind.Region}}function Wa(T){return new di.FoldingRange(T.startLine,T.endLine,Kc(T.kind))}async function Bo(T,ie){if(T)return hr.map(T,Wa,ie)}function Is(T){return new di.SelectionRange(p(T.range),T.parent?Is(T.parent):void 0)}async function kc(T,ie){return Array.isArray(T)?hr.map(T,Is,ie):[]}function Nh(T){return On.InlineValueText.is(T)?new di.InlineValueText(p(T.range),T.text):On.InlineValueVariableLookup.is(T)?new di.InlineValueVariableLookup(p(T.range),T.variableName,T.caseSensitiveLookup):new di.InlineValueEvaluatableExpression(p(T.range),T.expression)}async function be(T,ie){return Array.isArray(T)?hr.map(T,Nh,ie):[]}async function Aa(T,ie){const ye=typeof T.label=="string"?T.label:await hr.map(T.label,ee,ie),O=new $oi.default(f(T.position),ye);return T.kind!==void 0&&(O.kind=T.kind),T.textEdits!==void 0&&(O.textEdits=await ge(T.textEdits,ie)),T.tooltip!==void 0&&(O.tooltip=xe(T.tooltip)),T.paddingLeft!==void 0&&(O.paddingLeft=T.paddingLeft),T.paddingRight!==void 0&&(O.paddingRight=T.paddingRight),T.data!==void 0&&(O.data=T.data),O}function ee(T){const ie=new di.InlayHintLabelPart(T.value);return T.location!==void 0&&(ie.location=Ji(T.location)),T.tooltip!==void 0&&(ie.tooltip=xe(T.tooltip)),T.command!==void 0&&(ie.command=pc(T.command)),ie}function xe(T){return typeof T=="string"?T:y(T)}async function gt(T,ie){if(Array.isArray(T))return hr.mapAsync(T,Aa,ie)}function zn(T){if(T===null)return;const ie=new Uoi.default(ss(T.kind),T.name,T.detail||"",o(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Tn(T.tags)),ie}async function Cs(T,ie){if(T!==null)return hr.map(T,zn,ie)}async function Wo(T,ie){return new di.CallHierarchyIncomingCall(zn(T.from),await m(T.fromRanges,ie))}async function Ha(T,ie){if(T!==null)return hr.mapAsync(T,Wo,ie)}async function ea(T,ie){return new di.CallHierarchyOutgoingCall(zn(T.to),await m(T.fromRanges,ie))}async function Ph(T,ie){if(T!==null)return hr.mapAsync(T,ea,ie)}async function le(T,ie){if(T!=null)return new di.SemanticTokens(new Uint32Array(T.data),T.resultId)}function dr(T){return new di.SemanticTokensEdit(T.start,T.deleteCount,T.data!==void 0?new Uint32Array(T.data):void 0)}async function io(T,ie){if(T!=null)return new di.SemanticTokensEdits(T.edits.map(dr),T.resultId)}function un(T){return T}async function Se(T,ie){if(T!=null)return new di.LinkedEditingRanges(await m(T.ranges,ie),rt(T.wordPattern))}function rt(T){if(T!=null)return new RegExp(T)}function Ft(T){if(T===null)return;let ie=new Voi.default(ss(T.kind),T.name,T.detail||"",o(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ie.tags=Tn(T.tags)),ie}async function Ci(T,ie){if(T!==null)return hr.map(T,Ft,ie)}function Ot(T){if(jm.string(T))return T;if(On.RelativePattern.is(T)){if(On.URI.is(T.baseUri))return new di.RelativePattern(o(T.baseUri),T.pattern);if(On.WorkspaceFolder.is(T.baseUri)){const ie=di.workspace.getWorkspaceFolder(o(T.baseUri.uri));return ie!==void 0?new di.RelativePattern(ie,T.pattern):void 0}}}async function K(T,ie){if(!T)return;if(Array.isArray(T))return hr.map(T,$=>de($),ie);const ye=T,O=await hr.map(ye.items,$=>de($),ie);return new di.InlineCompletionList(O)}function de(T){let ie;typeof T.insertText=="string"?ie=T.insertText:ie=new di.SnippetString(T.insertText.value);let ye;T.command&&(ye=pc(T.command));const O=new di.InlineCompletionItem(ie,p(T.range),ye);return T.filterText&&(O.filterText=T.filterText),O}return{asUri:o,asDocumentSelector:r,asDiagnostics:a,asDiagnostic:l,asRange:p,asRanges:m,asPosition:f,asDiagnosticSeverity:v,asDiagnosticTag:u,asHover:C,asCompletionResult:A,asCompletionItem:z,asTextEdit:ne,asTextEdits:ge,asSignatureHelp:Oe,asSignatureInformations:yt,asSignatureInformation:Ne,asParameterInformations:lt,asParameterInformation:xt,asDeclarationResult:Ii,asDefinitionResult:ns,asLocation:Ji,asReferences:Xr,asDocumentHighlights:ds,asDocumentHighlight:Zo,asDocumentHighlightKind:Zr,asSymbolKind:ss,asSymbolTag:Oo,asSymbolTags:Tn,asSymbolInformations:Di,asSymbolInformation:Ba,asDocumentSymbols:vd,asDocumentSymbol:Fn,asCommand:pc,asCommands:zc,asCodeAction:ih,asCodeActionKind:tc,asCodeActionKinds:fl,asCodeActionResult:gg,asCodeLens:mc,asCodeLenses:$c,asWorkspaceEdit:nh,asDocumentLink:pl,asDocumentLinks:ic,asFoldingRangeKind:Kc,asFoldingRange:Wa,asFoldingRanges:Bo,asColor:Or,asColorInformation:ml,asColorInformations:sh,asColorPresentation:oh,asColorPresentations:Gc,asSelectionRange:Is,asSelectionRanges:kc,asInlineValue:Nh,asInlineValues:be,asInlayHint:Aa,asInlayHints:gt,asSemanticTokensLegend:un,asSemanticTokens:le,asSemanticTokensEdit:dr,asSemanticTokensEdits:io,asCallHierarchyItem:zn,asCallHierarchyItems:Cs,asCallHierarchyIncomingCall:Wo,asCallHierarchyIncomingCalls:Ha,asCallHierarchyOutgoingCall:ea,asCallHierarchyOutgoingCalls:Ph,asLinkedEditingRanges:Se,asTypeHierarchyItem:Ft,asTypeHierarchyItems:Ci,asGlobPattern:Ot,asInlineCompletionResult:K,asInlineCompletionItem:de}}Ple.createConverter=Goi;var _G={};Object.defineProperty(_G,"__esModule",{value:!0});_G.ProgressPart=void 0;const z7e=Xn,$7e=ps,G7e=kr;class Koi{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress($7e.WorkDoneProgress.type,this._token,n=>{switch(n.kind){case"begin":this.begin(n);break;case"report":this.report(n);break;case"end":this.done(),i&&i(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&z7e.window.withProgress({location:z7e.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($7e.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((n,o)=>{this._resolve=n,this._reject=o})})}report(e){if(this._infinite&&G7e.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(G7e.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}}_G.ProgressPart=Koi;var Fle={};Object.defineProperty(Fle,"__esModule",{value:!0});Fle.NotebookDocumentSyncFeature=void 0;const ku=Xn,qoi=Ale,PS=ps,Qoi=or,K7e=kr;function q7e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}var BF;(function(s){(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=PS.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,n(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=o(h.metadata)),p}e.asNotebookDocument=i;function n(h,u){return h.map(f=>r(f,u))}e.asNotebookCells=n;function o(h){return c(new Set,h)}e.asMetadata=o;function r(h,u){const f=PS.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&&K7e.number(h.executionSummary.executionOrder)&&K7e.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=r;function a(h){switch(h){case ku.NotebookCellKind.Markup:return PS.NotebookCellKind.Markup;case ku.NotebookCellKind.Code:return PS.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=s.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=>s.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=>s.c2p.asNotebookCell(v,u))),m.textContent!==void 0&&(p.textContent=m.textContent.map(v=>s.c2p.asTextContentChange(v,u))),Object.keys(p).length>0&&(f.cells=p)}return f}e.asNotebookDocumentChangeEvent=d})(s.c2p||(s.c2p={}))})(BF||(BF={}));var D1e;(function(s){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()))}}s.create=e})(Ine||(Ine={}));class ZK{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(kne.asDocumentSelector(t)),ku.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of ku.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);ku.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&ku.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),ku.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of ku.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 ku.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(ku.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;const i=this.notebookSyncInfo.get(e.uri.toString()),n=this.cellMatches(e,t);if(i!==void 0){const o=i.uris.has(t.document.uri.toString());if(n&&o||!n&&!o)return;if(n){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 n&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){ku.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 n=t.document.uri,o=i.cells.findIndex(r=>r.document.uri.toString()===n.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 n=this.asNotebookDocumentChangeEvent(e,void 0,i,t);n!==void 0&&this.doSendChange(n,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 n=this.getMatchingCells(t);if(n===void 0)return;this.didOpen(t,n,i)}else{const n=this.getMatchingCells(t);if(n===void 0){this.didClose(t,i);return}const o=this.asNotebookDocumentChangeEvent(e.notebook,e,i,n);o!==void 0&&this.doSendChange(o,n).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(n=>t.uris.has(n.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=BF.c2p.asNotebookDocument(o,r,this.client.code2ProtocolConverter),c=r.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(PS.DidOpenNotebookDocumentNotification.type,{notebookDocument:a,cellTextDocuments:c})}catch(l){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",l),l}},n=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),Ine.create(t)),n?.didOpen!==void 0?n.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(PS.DidChangeNotebookDocumentNotification.type,{notebookDocument:BF.c2p.asVersionedNotebookDocumentIdentifier(o.notebook,this.client.code2ProtocolConverter),change:BF.c2p.asNotebookDocumentChangeEvent(o,this.client.code2ProtocolConverter)})}catch(r){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",r),r}},n=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),Ine.create(t??[])),n?.didChange!==void 0?n?.didChange(e,i):i(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){const t=async n=>{try{await this.client.sendNotification(PS.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(n.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(PS.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}},n=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),n?.didClose!==void 0?n.didClose(e,t,i):i(e,t)}asNotebookDocumentChangeEvent(e,t,i,n){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");const o={notebook:e};t?.metadata!==void 0&&(o.metadata=BF.c2p.asMetadata(t.metadata));let r;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];r=new Set(n.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&&n!==void 0){const a=i.cells,c=n,l=D1e.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||k1e.matchNotebook(i.notebook,e)){const n=this.filterCells(e,t,i.cells);return n.length===0?void 0:n}}}cellMatches(e,t){const i=this.getMatchingCells(e,[t]);return i!==void 0&&i[0]===t}filterCells(e,t,i){const n=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,n):n}}class G1{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=PS.NotebookDocumentSyncRegistrationType.type,ku.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==G1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const o of this.registrations.values())o instanceof ZK&&o.didOpenNotebookCellTextDocument(i,n)}),ku.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==G1.CellScheme)return;const[n]=this.findNotebookDocumentAndCell(i);if(n!==void 0)for(const o of this.registrations.values())o instanceof ZK&&o.didChangeNotebookCellTextDocument(n,t)}),ku.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==G1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const o of this.registrations.values())o instanceof ZK&&o.didCloseNotebookCellTextDocument(i,n)})}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=q7e(q7e(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(kne.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??Qoi.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new ZK(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!==G1.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&ku.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 ku.workspace.notebookDocuments)for(const n of i.getCells())if(n.document.uri.toString()===t)return[i,n];return[void 0,void 0]}}Fle.NotebookDocumentSyncFeature=G1;G1.CellScheme="vscode-notebook-cell";var RD={};Object.defineProperty(RD,"__esModule",{value:!0});RD.SyncConfigurationFeature=RD.toJSONObject=RD.ConfigurationFeature=void 0;const uB=Xn,GV=ps,joi=kr,Yoi=or,Q7e=Mn;class Joi{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(GV.ConfigurationRequest.type,(t,i)=>{let n=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,n):n(t)})}getConfiguration(e,t){let i=null;if(t){let n=t.lastIndexOf(".");if(n===-1)i=oL(uB.workspace.getConfiguration(void 0,e).get(t));else{let o=uB.workspace.getConfiguration(t.substr(0,n),e);o&&(i=oL(o.get(t.substr(n+1))))}}else{let n=uB.workspace.getConfiguration(void 0,e);i={};for(let o of Object.keys(n))n.has(o)&&(i[o]=oL(n.get(o)))}return i===void 0&&(i=null),i}clear(){}}RD.ConfigurationFeature=Joi;function oL(s){if(s){if(Array.isArray(s))return s.map(oL);if(typeof s=="object"){const e=Object.create(null);for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=oL(s[t]));return e}}return s}RD.toJSONObject=oL;class Xoi{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 GV.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,Q7e.ensure)((0,Q7e.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:Yoi.generateUuid(),registerOptions:{section:e}})}register(e){let t=uB.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(joi.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const n=async r=>r===void 0?this._client.sendNotification(GV.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(GV.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(r)});let o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(i,n):n(i)).catch(r=>{this._client.error(`Sending notification ${GV.DidChangeConfigurationNotification.type.method} failed`,r)})}extractSettingsInformation(e){function t(o,r){let a=o;for(let c=0;c=0?c=uB.workspace.getConfiguration(r.substr(0,a),i).get(r.substr(a+1)):c=uB.workspace.getConfiguration(void 0,i).get(r),c){let l=e[o].split(".");t(n,l)[l[l.length-1]]=oL(c)}}return n}}RD.SyncConfigurationFeature=Xoi;var qf={};Object.defineProperty(qf,"__esModule",{value:!0});qf.DidSaveTextDocumentFeature=qf.WillSaveWaitUntilFeature=qf.WillSaveFeature=qf.DidChangeTextDocumentFeature=qf.DidCloseTextDocumentFeature=qf.DidOpenTextDocumentFeature=void 0;const Xp=Xn,Da=ps,Oc=Mn,XU=or;class Zoi extends Oc.TextDocumentEventFeature{constructor(e,t){super(e,Xp.workspace.onDidOpenTextDocument,Da.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Oc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:XU.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return Da.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);Xp.workspace.textDocuments.forEach(i=>{const n=i.uri.toString();if(!this._syncedDocuments.has(n)&&Xp.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(n,i)}})}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,i)}}qf.DidOpenTextDocumentFeature=Zoi;class eri extends Oc.TextDocumentEventFeature{constructor(e,t,i){super(e,Xp.workspace.onDidCloseTextDocument,Da.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,n=>e.code2ProtocolConverter.asCloseTextDocumentParams(n),n=>n,Oc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return Da.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:XU.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(n=>{if(Xp.languages.match(t,n)>0&&!this._selectorFilter(i,n)&&!this._client.hasDedicatedTextSynchronizationFeature(n)){let o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(n.uri.toString()),(o.didClose?o.didClose(n,r):r(n)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}qf.DidCloseTextDocumentFeature=eri;class tri extends Oc.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new Xp.EventEmitter,this._onPendingChangeAdded=new Xp.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=Da.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return Da.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==Da.TextDocumentSyncKind.None&&this.register({id:XU.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=Xp.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,n=[];for(const o of this._changeData.values())if(Xp.languages.match(o.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const r=this._client.middleware;if(o.syncKind===Da.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(Da.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,Da.DidChangeTextDocumentNotification.type,l)};n.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}else if(o.syncKind===Da.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};n.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}}return Promise.all(n).then(void 0,o=>{throw this._client.error(`Sending document notification ${Da.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=Da.TextDocumentSyncKind.None;else{this._syncKind=Da.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===Da.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=Da.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(Xp.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==Da.TextDocumentSyncKind.Full)switch(e){case Da.TextDocumentSyncKind.Full:this._syncKind=e;break;case Da.TextDocumentSyncKind.Incremental:this._syncKind===Da.TextDocumentSyncKind.None&&(this._syncKind=Da.TextDocumentSyncKind.Incremental);break}}}qf.DidChangeTextDocumentFeature=tri;class iri extends Oc.TextDocumentEventFeature{constructor(e){super(e,Xp.workspace.onWillSaveTextDocument,Da.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Oc.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return Da.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:XU.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}qf.WillSaveFeature=iri;class nri extends Oc.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return Da.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:XU.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=Xp.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Oc.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=n=>this._client.sendRequest(Da.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(n)).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)}}qf.WillSaveWaitUntilFeature=nri;class sri extends Oc.TextDocumentEventFeature{constructor(e){super(e,Xp.workspace.onDidSaveTextDocument,Da.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Oc.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return Da.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;if(t&&i&&i.save){const n=typeof i.save=="boolean"?{includeText:!1}:{includeText:!!i.save.includeText};this.register({id:XU.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},n)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}qf.DidSaveTextDocumentFeature=sri;var Ole={};Object.defineProperty(Ole,"__esModule",{value:!0});Ole.CompletionItemFeature=void 0;const ori=Xn,xo=ps,gge=Mn,rri=or,ari=[xo.CompletionItemKind.Text,xo.CompletionItemKind.Method,xo.CompletionItemKind.Function,xo.CompletionItemKind.Constructor,xo.CompletionItemKind.Field,xo.CompletionItemKind.Variable,xo.CompletionItemKind.Class,xo.CompletionItemKind.Interface,xo.CompletionItemKind.Module,xo.CompletionItemKind.Property,xo.CompletionItemKind.Unit,xo.CompletionItemKind.Value,xo.CompletionItemKind.Enum,xo.CompletionItemKind.Keyword,xo.CompletionItemKind.Snippet,xo.CompletionItemKind.Color,xo.CompletionItemKind.File,xo.CompletionItemKind.Reference,xo.CompletionItemKind.Folder,xo.CompletionItemKind.EnumMember,xo.CompletionItemKind.Constant,xo.CompletionItemKind.Struct,xo.CompletionItemKind.Event,xo.CompletionItemKind.Operator,xo.CompletionItemKind.TypeParameter];class cri extends gge.TextDocumentLanguageFeature{constructor(e){super(e,xo.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,gge.ensure)((0,gge.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[xo.MarkupKind.Markdown,xo.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[xo.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[xo.InsertTextMode.asIs,xo.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=xo.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:ari},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:rri.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],n=e.allCommitCharacters,o=e.documentSelector,r={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,b)=>h.sendRequest(xo.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),b).then(w=>b.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(w,n,b),w=>h.handleFailedRequest(xo.CompletionRequest.type,b,w,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(xo.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(xo.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[ori.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),r,...i),r]}}Ole.CompletionItemFeature=cri;var Ble={};Object.defineProperty(Ble,"__esModule",{value:!0});Ble.HoverFeature=void 0;const lri=Xn,B4=ps,fge=Mn,dri=or;class hri extends fge.TextDocumentLanguageFeature{constructor(e){super(e,B4.HoverRequest.type)}fillClientCapabilities(e){const t=(0,fge.ensure)((0,fge.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[B4.MarkupKind.Markdown,B4.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:dri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(B4.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(B4.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return lri.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Ble.HoverFeature=hri;var Wle={};Object.defineProperty(Wle,"__esModule",{value:!0});Wle.DefinitionFeature=void 0;const uri=Xn,pge=ps,mge=Mn,gri=or;class fri extends mge.TextDocumentLanguageFeature{constructor(e){super(e,pge.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,mge.ensure)((0,mge.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:gri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(pge.DefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(pge.DefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideDefinition?l.provideDefinition(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return uri.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Wle.DefinitionFeature=fri;var Hle={};Object.defineProperty(Hle,"__esModule",{value:!0});Hle.SignatureHelpFeature=void 0;const j7e=Xn,W4=ps,_ge=Mn,pri=or;class mri extends _ge.TextDocumentLanguageFeature{constructor(e){super(e,W4.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,_ge.ensure)((0,_ge.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[W4.MarkupKind.Markdown,W4.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:pri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t={provideSignatureHelp:(i,n,o,r)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(W4.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(W4.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,n,r,o,c):c(i,n,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 n=e.triggerCharacters||[];return j7e.languages.registerSignatureHelpProvider(i,t,...n)}else{const n={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return j7e.languages.registerSignatureHelpProvider(i,t,n)}}}Hle.SignatureHelpFeature=mri;var Ule={};Object.defineProperty(Ule,"__esModule",{value:!0});Ule.DocumentHighlightFeature=void 0;const _ri=Xn,vge=ps,bge=Mn,vri=or;class bri extends bge.TextDocumentLanguageFeature{constructor(e){super(e,vge.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,bge.ensure)((0,bge.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:vri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(vge.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(vge.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(n,o,r,c):c(n,o,r)}};return[_ri.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Ule.DocumentHighlightFeature=bri;var JPe={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.DocumentSymbolFeature=s.SupportedSymbolTags=s.SupportedSymbolKinds=void 0;const e=Xn,t=ps,i=Mn,n=or;s.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],s.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:s.SupportedSymbolKinds},c.hierarchicalDocumentSymbolSupport=!0,c.tagSupport={valueSet:s.SupportedSymbolTags},c.labelSupport=!0}initialize(a,c){const l=this.getRegistrationOptions(c,a.documentSymbolProvider);l&&this.register({id:n.generateUuid(),registerOptions:l})}registerLanguageProvider(a){const c=a.documentSelector,l={provideDocumentSymbols:(h,u)=>{const f=this._client,p=async(v,b)=>{try{const w=await f.sendRequest(t.DocumentSymbolRequest.type,f.code2ProtocolConverter.asDocumentSymbolParams(v),b);if(b.isCancellationRequested||w===void 0||w===null)return null;if(w.length===0)return[];{const y=w[0];return t.DocumentSymbol.is(y)?await f.protocol2CodeConverter.asDocumentSymbols(w,b):await f.protocol2CodeConverter.asSymbolInformations(w,b)}}catch(w){return f.handleFailedRequest(t.DocumentSymbolRequest.type,b,w,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]}}s.DocumentSymbolFeature=o})(JPe);var Vle={};Object.defineProperty(Vle,"__esModule",{value:!0});Vle.WorkspaceSymbolFeature=void 0;const wri=Xn,H4=ps,wge=Mn,Y7e=JPe,yri=or;class Cri extends wge.WorkspaceFeature{constructor(e){super(e,H4.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,wge.ensure)((0,wge.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:Y7e.SupportedSymbolKinds},t.tagSupport={valueSet:Y7e.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:yri.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,n)=>{const o=this._client,r=(c,l)=>o.sendRequest(H4.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformations(d,l),d=>o.handleFailedRequest(H4.WorkspaceSymbolRequest.type,l,d,null)),a=o.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,n,r):r(i,n)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,n)=>{const o=this._client,r=(c,l)=>o.sendRequest(H4.WorkspaceSymbolResolveRequest.type,o.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformation(d),d=>o.handleFailedRequest(H4.WorkspaceSymbolResolveRequest.type,l,d,null)),a=o.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,n,r):r(i,n)}:void 0};return[wri.languages.registerWorkspaceSymbolProvider(t),t]}}Vle.WorkspaceSymbolFeature=Cri;var zle={};Object.defineProperty(zle,"__esModule",{value:!0});zle.ReferencesFeature=void 0;const Sri=Xn,yge=ps,Cge=Mn,Ari=or;class Eri extends Cge.TextDocumentLanguageFeature{constructor(e){super(e,yge.ReferencesRequest.type)}fillClientCapabilities(e){(0,Cge.ensure)((0,Cge.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:Ari.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(n,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(yge.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(yge.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(n,o,r,a,l):l(n,o,r,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Sri.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}zle.ReferencesFeature=Eri;var $le={};Object.defineProperty($le,"__esModule",{value:!0});$le.CodeActionFeature=void 0;const xri=Xn,xp=ps,Dri=or,Sge=Mn;class kri extends Sge.TextDocumentLanguageFeature{constructor(e){super(e,xp.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,Sge.ensure)((0,Sge.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[xp.CodeActionKind.Empty,xp.CodeActionKind.QuickFix,xp.CodeActionKind.Refactor,xp.CodeActionKind.RefactorExtract,xp.CodeActionKind.RefactorInline,xp.CodeActionKind.RefactorRewrite,xp.CodeActionKind.Source,xp.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:Dri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(n,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(xp.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(xp.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(n,o,r,a,l):l(n,o,r,a)},resolveCodeAction:e.resolveProvider?(n,o)=>{const r=this._client,a=this._client.middleware,c=async(l,d)=>r.sendRequest(xp.CodeActionResolveRequest.type,r.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asCodeAction(h,d),h=>r.handleFailedRequest(xp.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(n,o,c):c(n,o)}:void 0};return[xri.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}$le.CodeActionFeature=kri;var Gle={};Object.defineProperty(Gle,"__esModule",{value:!0});Gle.CodeLensFeature=void 0;const J7e=Xn,xP=ps,Iri=or,U4=Mn;class Tri extends U4.TextDocumentLanguageFeature{constructor(e){super(e,xP.CodeLensRequest.type)}fillClientCapabilities(e){(0,U4.ensure)((0,U4.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,U4.ensure)((0,U4.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(xP.CodeLensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeCodeLensEmitter.fire()});const n=this.getRegistrationOptions(t,e.codeLensProvider);n&&this.register({id:Iri.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new J7e.EventEmitter,n={onDidChangeCodeLenses:i.event,provideCodeLenses:(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(xP.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(xP.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(xP.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(xP.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(o,r,c):c(o,r)}:void 0};return[J7e.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeCodeLensEmitter:i}]}}Gle.CodeLensFeature=Tri;var MD={};Object.defineProperty(MD,"__esModule",{value:!0});MD.DocumentOnTypeFormattingFeature=MD.DocumentRangeFormattingFeature=MD.DocumentFormattingFeature=void 0;const Kle=Xn,ub=ps,XPe=or,wA=Mn;var dU;(function(s){function e(t){const i=Kle.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}s.fromConfiguration=e})(dU||(dU={}));class Lri extends wA.TextDocumentLanguageFeature{constructor(e){super(e,ub.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,wA.ensure)((0,wA.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:XPe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(n,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,dU.fromConfiguration(d))};return a.sendRequest(ub.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(ub.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(n,o,r,c):c(n,o,r)}};return[Kle.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}MD.DocumentFormattingFeature=Lri;class Rri extends wA.TextDocumentLanguageFeature{constructor(e){super(e,ub.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,wA.ensure)((0,wA.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:XPe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(n,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,dU.fromConfiguration(h))};return c.sendRequest(ub.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(ub.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(n,o,r,a,l):l(n,o,r,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(n,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,dU.fromConfiguration(h))};return c.sendRequest(ub.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(ub.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(n,o,r,a,l):l(n,o,r,a)}),[Kle.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}MD.DocumentRangeFormattingFeature=Rri;class Mri extends wA.TextDocumentLanguageFeature{constructor(e){super(e,ub.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,wA.ensure)((0,wA.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:XPe.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,b)=>{let w={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(f),position:d.code2ProtocolConverter.asPosition(p),ch:m,options:d.code2ProtocolConverter.asFormattingOptions(v,dU.fromConfiguration(f))};return d.sendRequest(ub.DocumentOnTypeFormattingRequest.type,w,b).then(y=>b.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(y,b),y=>d.handleFailedRequest(ub.DocumentOnTypeFormattingRequest.type,b,y,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(o,r,a,c,l,h):h(o,r,a,c,l)}},n=e.moreTriggerCharacter||[];return[Kle.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...n),i]}}MD.DocumentOnTypeFormattingFeature=Mri;var qle={};Object.defineProperty(qle,"__esModule",{value:!0});qle.RenameFeature=void 0;const Nri=Xn,jI=ps,Pri=or,X7e=kr,Age=Mn;class Fri extends Age.TextDocumentLanguageFeature{constructor(e){super(e,jI.RenameRequest.type)}fillClientCapabilities(e){let t=(0,Age.ensure)((0,Age.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=jI.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&(X7e.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:Pri.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(n,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(jI.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(jI.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(n,o,r,a,l):l(n,o,r,a)},prepareRename:e.prepareProvider?(n,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(jI.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:jI.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&&jI.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(n,o,r,c):c(n,o,r)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Nri.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&X7e.boolean(t.defaultBehavior)}}qle.RenameFeature=Fri;var Qle={};Object.defineProperty(Qle,"__esModule",{value:!0});Qle.DocumentLinkFeature=void 0;const Ori=Xn,V4=ps,Ege=Mn,Bri=or;class Wri extends Ege.TextDocumentLanguageFeature{constructor(e){super(e,V4.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,Ege.ensure)((0,Ege.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:Bri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(n,o)=>{const r=this._client,a=(l,d)=>r.sendRequest(V4.DocumentLinkRequest.type,r.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:r.protocol2CodeConverter.asDocumentLinks(h,d),h=>r.handleFailedRequest(V4.DocumentLinkRequest.type,d,h,null)),c=r.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(n,o,a):a(n,o)},resolveDocumentLink:e.resolveProvider?(n,o)=>{const r=this._client;let a=(l,d)=>r.sendRequest(V4.DocumentLinkResolveRequest.type,r.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asDocumentLink(h),h=>r.handleFailedRequest(V4.DocumentLinkResolveRequest.type,d,h,l));const c=r.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(n,o,a):a(n,o)}:void 0};return[Ori.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Qle.DocumentLinkFeature=Wri;var jle={};Object.defineProperty(jle,"__esModule",{value:!0});jle.ExecuteCommandFeature=void 0;const Hri=Xn,xge=ps,Uri=or,Z7e=Mn;class Vri{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 xge.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Z7e.ensure)((0,Z7e.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:Uri.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,n=(o,r)=>{let a={command:o,arguments:r};return t.sendRequest(xge.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(xge.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const o=[];for(const r of e.registerOptions.commands)o.push(Hri.commands.registerCommand(r,(...a)=>i.executeCommand?i.executeCommand(r,a,n):n(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()}}jle.ExecuteCommandFeature=Vri;var Yle={};Object.defineProperty(Yle,"__esModule",{value:!0});Yle.FileSystemWatcherFeature=void 0;const zri=Xn,YI=ps,eq=Mn;class $ri{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 YI.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,eq.ensure)((0,eq.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,eq.ensure)((0,eq.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 n=this._client.protocol2CodeConverter.asGlobPattern(i.globPattern);if(n===void 0)continue;let o=!0,r=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(o=(i.kind&YI.WatchKind.Create)!==0,r=(i.kind&YI.WatchKind.Change)!==0,a=(i.kind&YI.WatchKind.Delete)!==0);const c=zri.workspace.createFileSystemWatcher(n,!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 n of t)this.hookListeners(n,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,n,o){t&&e.onDidCreate(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:YI.FileChangeType.Created}),null,o),i&&e.onDidChange(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:YI.FileChangeType.Changed}),null,o),n&&e.onDidDelete(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:YI.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()}}Yle.FileSystemWatcherFeature=$ri;var Jle={};Object.defineProperty(Jle,"__esModule",{value:!0});Jle.ColorProviderFeature=void 0;const Gri=Xn,z4=ps,Dge=Mn;class Kri extends Dge.TextDocumentLanguageFeature{constructor(e){super(e,z4.DocumentColorRequest.type)}fillClientCapabilities(e){(0,Dge.ensure)((0,Dge.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.colorProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideColorPresentations:(n,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(z4.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(z4.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(n,o,r,c):c(n,o,r)},provideDocumentColors:(n,o)=>{const r=this._client,a=(l,d)=>{const h={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(l)};return r.sendRequest(z4.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>r.handleFailedRequest(z4.DocumentColorRequest.type,d,u,null))},c=r.middleware;return c.provideDocumentColors?c.provideDocumentColors(n,o,a):a(n,o)}};return[Gri.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Jle.ColorProviderFeature=Kri;var Xle={};Object.defineProperty(Xle,"__esModule",{value:!0});Xle.ImplementationFeature=void 0;const qri=Xn,kge=ps,Ige=Mn;class Qri extends Ige.TextDocumentLanguageFeature{constructor(e){super(e,kge.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Ige.ensure)((0,Ige.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.implementationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideImplementation:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(kge.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(kge.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return qri.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Xle.ImplementationFeature=Qri;var Zle={};Object.defineProperty(Zle,"__esModule",{value:!0});Zle.TypeDefinitionFeature=void 0;const jri=Xn,Tge=ps,$4=Mn;class Yri extends $4.TextDocumentLanguageFeature{constructor(e){super(e,Tge.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,$4.ensure)((0,$4.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,$4.ensure)((0,$4.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.typeDefinitionProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideTypeDefinition:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Tge.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Tge.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return jri.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Zle.TypeDefinitionFeature=Yri;var hU={};Object.defineProperty(hU,"__esModule",{value:!0});hU.WorkspaceFoldersFeature=hU.arrayDiff=void 0;const Jri=or,tq=Xn,G4=ps;function Lge(s,e){if(s!=null)return s[e]}function I1e(s,e){return s.filter(t=>e.indexOf(t)<0)}hU.arrayDiff=I1e;class Xri{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 G4.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=tq.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(G4.WorkspaceFoldersRequest.type,o=>{const r=()=>{const c=tq.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=Lge(Lge(Lge(e,"workspace"),"workspaceFolders"),"changeNotifications");let n;typeof i=="string"?n=i:i===!0&&(n=Jri.generateUuid()),n&&this.register({id:n,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=I1e(this._initialFolders,e),n=I1e(e,this._initialFolders);(n.length>0||i.length>0)&&(t=this.doSendEvent(n,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 ${G4.DidChangeWorkspaceFoldersNotification.type.method} failed`,i)})}doSendEvent(e,t){let i={event:{added:e.map(n=>this.asProtocol(n)),removed:t.map(n=>this.asProtocol(n))}};return this._client.sendNotification(G4.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,n=tq.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 ${G4.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,n),this.sendInitialEvent(tq.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}}}hU.WorkspaceFoldersFeature=Xri;var ede={};Object.defineProperty(ede,"__esModule",{value:!0});ede.FoldingRangeFeature=void 0;const e6e=Xn,JI=ps,K4=Mn;class Zri extends K4.TextDocumentLanguageFeature{constructor(e){super(e,JI.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,K4.ensure)((0,K4.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[JI.FoldingRangeKind.Comment,JI.FoldingRangeKind.Imports,JI.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,K4.ensure)((0,K4.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(JI.FoldingRangeRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeFoldingRange.fire()});let[i,n]=this.getRegistration(t,e.foldingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new e6e.EventEmitter,n={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(JI.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(JI.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(o,r,a,l):l(o,r,a)}};return[e6e.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeFoldingRange:i}]}}ede.FoldingRangeFeature=Zri;var tde={};Object.defineProperty(tde,"__esModule",{value:!0});tde.DeclarationFeature=void 0;const eai=Xn,Rge=ps,Mge=Mn;class tai extends Mge.TextDocumentLanguageFeature{constructor(e){super(e,Rge.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,Mge.ensure)((0,Mge.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.declarationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDeclaration:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Rge.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(Rge.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return eai.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}tde.DeclarationFeature=tai;var ide={};Object.defineProperty(ide,"__esModule",{value:!0});ide.SelectionRangeFeature=void 0;const iai=Xn,Nge=ps,Pge=Mn;class nai extends Pge.TextDocumentLanguageFeature{constructor(e){super(e,Nge.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,Pge.ensure)((0,Pge.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.selectionRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideSelectionRanges:(n,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(Nge.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(Nge.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return iai.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}ide.SelectionRangeFeature=nai;var nde={};Object.defineProperty(nde,"__esModule",{value:!0});nde.ProgressFeature=void 0;const t6e=ps,sai=_G;function oai(s,e){return s[e]===void 0&&(s[e]=Object.create(null)),s[e]}class rai{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:t6e.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){oai(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=n=>{this.activeParts.delete(n)},i=n=>{this.activeParts.add(new sai.ProgressPart(this._client,n.token,t))};e.onRequest(t6e.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}nde.ProgressFeature=rai;var sde={};Object.defineProperty(sde,"__esModule",{value:!0});sde.CallHierarchyFeature=void 0;const aai=Xn,L0=ps,Fge=Mn;class cai{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const n=this.client,o=this.middleware,r=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(L0.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>n.handleFailedRequest(L0.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,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(L0.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(L0.CallHierarchyIncomingCallsRequest.type,a,l,null))};return n.provideCallHierarchyIncomingCalls?n.provideCallHierarchyIncomingCalls(e,t,o):o(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(L0.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(L0.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return n.provideCallHierarchyOutgoingCalls?n.provideCallHierarchyOutgoingCalls(e,t,o):o(e,t)}}class lai extends Fge.TextDocumentLanguageFeature{constructor(e){super(e,L0.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,Fge.ensure)((0,Fge.ensure)(t,"textDocument"),"callHierarchy");i.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.callHierarchyProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=this._client,i=new cai(t);return[aai.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}sde.CallHierarchyFeature=lai;var ode={};Object.defineProperty(ode,"__esModule",{value:!0});ode.SemanticTokensFeature=void 0;const iq=Xn,Ss=ps,q4=Mn,dai=kr;class hai extends q4.TextDocumentLanguageFeature{constructor(e){super(e,Ss.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,q4.ensure)((0,q4.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[Ss.SemanticTokenTypes.namespace,Ss.SemanticTokenTypes.type,Ss.SemanticTokenTypes.class,Ss.SemanticTokenTypes.enum,Ss.SemanticTokenTypes.interface,Ss.SemanticTokenTypes.struct,Ss.SemanticTokenTypes.typeParameter,Ss.SemanticTokenTypes.parameter,Ss.SemanticTokenTypes.variable,Ss.SemanticTokenTypes.property,Ss.SemanticTokenTypes.enumMember,Ss.SemanticTokenTypes.event,Ss.SemanticTokenTypes.function,Ss.SemanticTokenTypes.method,Ss.SemanticTokenTypes.macro,Ss.SemanticTokenTypes.keyword,Ss.SemanticTokenTypes.modifier,Ss.SemanticTokenTypes.comment,Ss.SemanticTokenTypes.string,Ss.SemanticTokenTypes.number,Ss.SemanticTokenTypes.regexp,Ss.SemanticTokenTypes.operator,Ss.SemanticTokenTypes.decorator],t.tokenModifiers=[Ss.SemanticTokenModifiers.declaration,Ss.SemanticTokenModifiers.definition,Ss.SemanticTokenModifiers.readonly,Ss.SemanticTokenModifiers.static,Ss.SemanticTokenModifiers.deprecated,Ss.SemanticTokenModifiers.abstract,Ss.SemanticTokenModifiers.async,Ss.SemanticTokenModifiers.modification,Ss.SemanticTokenModifiers.documentation,Ss.SemanticTokenModifiers.defaultLibrary],t.formats=[Ss.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,q4.ensure)((0,q4.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Ss.SemanticTokensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeSemanticTokensEmitter.fire()});const[n,o]=this.getRegistration(t,e.semanticTokensProvider);!n||!o||this.register({id:n,registerOptions:o})}registerLanguageProvider(e){const t=e.documentSelector,i=dai.boolean(e.full)?e.full:e.full!==void 0,n=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,o=new iq.EventEmitter,r=i?{onDidChangeSemanticTokens:o.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,b=(w,y)=>{const C={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(w)};return m.sendRequest(Ss.SemanticTokensRequest.type,C,y).then(A=>y.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(A,y),A=>m.handleFailedRequest(Ss.SemanticTokensRequest.type,y,A,null))};return v.provideDocumentSemanticTokens?v.provideDocumentSemanticTokens(f,p,b):b(f,p)},provideDocumentSemanticTokensEdits:n?(f,p,m)=>{const v=this._client,b=v.middleware,w=(y,C,A)=>{const L={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(y),previousResultId:C};return v.sendRequest(Ss.SemanticTokensDeltaRequest.type,L,A).then(async k=>A.isCancellationRequested?null:Ss.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,A):await v.protocol2CodeConverter.asSemanticTokensEdits(k,A),k=>v.handleFailedRequest(Ss.SemanticTokensDeltaRequest.type,A,k,null))};return b.provideDocumentSemanticTokensEdits?b.provideDocumentSemanticTokensEdits(f,p,m,w):w(f,p,m)}:void 0}:void 0,c=e.range===!0?{provideDocumentRangeSemanticTokens:(f,p,m)=>{const v=this._client,b=v.middleware,w=(y,C,A)=>{const L={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(y),range:v.code2ProtocolConverter.asRange(C)};return v.sendRequest(Ss.SemanticTokensRangeRequest.type,L,A).then(k=>A.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,A),k=>v.handleFailedRequest(Ss.SemanticTokensRangeRequest.type,A,k,null))};return b.provideDocumentRangeSemanticTokens?b.provideDocumentRangeSemanticTokens(f,p,m,w):w(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(iq.languages.registerDocumentSemanticTokensProvider(u,r,h)),c!==void 0&&l.push(iq.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new iq.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:r,onDidChangeSemanticTokensEmitter:o}]}}ode.SemanticTokensFeature=hai;var Qf={};Object.defineProperty(Qf,"__esModule",{value:!0});Qf.WillDeleteFilesFeature=Qf.WillRenameFilesFeature=Qf.WillCreateFilesFeature=Qf.DidDeleteFilesFeature=Qf.DidRenameFilesFeature=Qf.DidCreateFilesFeature=void 0;const I_=Xn,uai=Ale,yA=ps,gai=or;function i6e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}function fai(s,e){return s[e]}function n6e(s,e,t){s[e]=t}class rL{constructor(e,t,i,n,o){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=n,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=i6e(i6e(e,"workspace"),"fileOperations");n6e(t,"dynamicRegistration",!0),n6e(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?fai(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:gai.generateUuid(),registerOptions:{filters:i.filters}})}catch(n){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${n}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));const t=e.registerOptions.filters.map(i=>{const n=new uai.Minimatch(i.pattern.glob,rL.asMinimatchOptions(i.pattern.options));if(!n.makeRe())throw new Error(`Invalid pattern ${i.pattern.glob}!`);return{scheme:i.scheme,matcher:n,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 rL.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===I_.FileType.File&&l.kind===yA.FileOperationPatternKind.file||d===I_.FileType.Directory&&l.kind===yA.FileOperationPatternKind.folder)return!0}else if(l.kind===yA.FileOperationPatternKind.folder&&await rL.getFileType(r)===I_.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),n=e.files.filter((o,r)=>i[r]);return{...e,files:n}}static async getFileType(e){try{return(await I_.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class jot extends rL{constructor(e,t,i,n,o,r,a){super(e,t,i,n,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 n=>this._client.sendNotification(this._notificationType,this._createParams(n));return this.doSend(t,i)}}}class Yot extends jot{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 rL.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 pai extends jot{constructor(e){super(e,I_.workspace.onDidCreateFiles,yA.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)}}Qf.DidCreateFilesFeature=pai;class mai extends Yot{constructor(e){super(e,I_.workspace.onDidRenameFiles,yA.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=I_.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)}}Qf.DidRenameFilesFeature=mai;class _ai extends Yot{constructor(e){super(e,I_.workspace.onDidDeleteFiles,yA.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=I_.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)}}Qf.DidDeleteFilesFeature=_ai;class ZPe extends rL{constructor(e,t,i,n,o,r,a){super(e,t,i,n,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=n=>this._client.sendRequest(this._requestType,this._createParams(n),n.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,i)}else return}}class vai extends ZPe{constructor(e){super(e,I_.workspace.onWillCreateFiles,yA.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)}}Qf.WillCreateFilesFeature=vai;class bai extends ZPe{constructor(e){super(e,I_.workspace.onWillRenameFiles,yA.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)}}Qf.WillRenameFilesFeature=bai;class wai extends ZPe{constructor(e){super(e,I_.workspace.onWillDeleteFiles,yA.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)}}Qf.WillDeleteFilesFeature=wai;var rde={};Object.defineProperty(rde,"__esModule",{value:!0});rde.LinkedEditingFeature=void 0;const yai=Xn,Oge=ps,Bge=Mn;class Cai extends Bge.TextDocumentLanguageFeature{constructor(e){super(e,Oge.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,Bge.ensure)((0,Bge.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.linkedEditingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideLinkedEditingRanges:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Oge.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(Oge.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return yai.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}rde.LinkedEditingFeature=Cai;var ade={};Object.defineProperty(ade,"__esModule",{value:!0});ade.TypeHierarchyFeature=void 0;const Sai=Xn,R0=ps,Wge=Mn;class Aai{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const n=this.client,o=this.middleware,r=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(R0.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>n.handleFailedRequest(R0.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,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(R0.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(R0.TypeHierarchySupertypesRequest.type,a,l,null))};return n.provideTypeHierarchySupertypes?n.provideTypeHierarchySupertypes(e,t,o):o(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(R0.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(R0.TypeHierarchySubtypesRequest.type,a,l,null))};return n.provideTypeHierarchySubtypes?n.provideTypeHierarchySubtypes(e,t,o):o(e,t)}}class Eai extends Wge.TextDocumentLanguageFeature{constructor(e){super(e,R0.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,Wge.ensure)((0,Wge.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.typeHierarchyProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=this._client,i=new Aai(t);return[Sai.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}ade.TypeHierarchyFeature=Eai;var cde={};Object.defineProperty(cde,"__esModule",{value:!0});cde.InlineValueFeature=void 0;const s6e=Xn,nq=ps,Q4=Mn;class xai extends Q4.TextDocumentLanguageFeature{constructor(e){super(e,nq.InlineValueRequest.type)}fillClientCapabilities(e){(0,Q4.ensure)((0,Q4.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,Q4.ensure)((0,Q4.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(nq.InlineValueRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlineValues.fire()});const[i,n]=this.getRegistration(t,e.inlineValueProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new s6e.EventEmitter,n={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(nq.InlineValueRequest.type,v,m).then(b=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(b,m),b=>l.handleFailedRequest(nq.InlineValueRequest.type,m,b,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(o,r,a,c,d):d(o,r,a,c)}};return[this.registerProvider(t,n),{provider:n,onDidChangeInlineValues:i}]}registerProvider(e,t){return s6e.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}cde.InlineValueFeature=xai;var lde={};Object.defineProperty(lde,"__esModule",{value:!0});lde.InlayHintsFeature=void 0;const o6e=Xn,DP=ps,j4=Mn;class Dai extends j4.TextDocumentLanguageFeature{constructor(e){super(e,DP.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,j4.ensure)((0,j4.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,j4.ensure)((0,j4.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(DP.InlayHintRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlayHints.fire()});const[i,n]=this.getRegistration(t,e.inlayHintProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new o6e.EventEmitter,n={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(DP.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(DP.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(o,r,a,l):l(o,r,a)}};return n.resolveInlayHint=e.resolveProvider===!0?(o,r)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(DP.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(DP.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(o,r,c):c(o,r)}:void 0,[this.registerProvider(t,n),{provider:n,onDidChangeInlayHints:i}]}registerProvider(e,t){return o6e.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}lde.InlayHintsFeature=Dai;var dde={};Object.defineProperty(dde,"__esModule",{value:!0});dde.InlineCompletionItemFeature=void 0;const kai=Xn,Hge=ps,Uge=Mn,Iai=or;class Tai extends Uge.TextDocumentLanguageFeature{constructor(e){super(e,Hge.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,Uge.ensure)((0,Uge.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:Iai.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(n,o,r,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(Hge.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(Hge.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(n,o,r,a,d):d(n,o,r,a)}};return[kai.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}dde.InlineCompletionItemFeature=Tai;Object.defineProperty(vh,"__esModule",{value:!0});vh.ProposedFeatures=Jot=vh.BaseLanguageClient=vh.MessageTransports=vh.SuspendMode=vh.State=vh.CloseAction=vh.ErrorAction=vh.RevealOutputChannelOn=void 0;const Wr=Xn,It=ps,Lai=xle,Rai=Ple,Nv=kr,sq=yh,r6e=or,Mai=_G,pv=Mn,Nai=bA,a6e=Fle,c6e=RD,kP=qf,Pai=Ole,Fai=Ble,Oai=Wle,Bai=Hle,Wai=Ule,Hai=JPe,Uai=Vle,Vai=zle,zai=$le,$ai=Gle,Vge=MD,Gai=qle,Kai=Qle,qai=jle,Qai=Yle,jai=Jle,Yai=Xle,Jai=Zle,Xai=hU,Zai=ede,eci=tde,tci=ide,ici=nde,nci=sde,sci=ode,IP=Qf,oci=rde,rci=ade,aci=cde,cci=lde,lci=dde;var c1;(function(s){s[s.Debug=0]="Debug",s[s.Info=1]="Info",s[s.Warn=2]="Warn",s[s.Error=3]="Error",s[s.Never=4]="Never"})(c1||(vh.RevealOutputChannelOn=c1={}));var g7;(function(s){s[s.Continue=1]="Continue",s[s.Shutdown=2]="Shutdown"})(g7||(vh.ErrorAction=g7={}));var ND;(function(s){s[s.DoNotRestart=1]="DoNotRestart",s[s.Restart=2]="Restart"})(ND||(vh.CloseAction=ND={}));var Lz;(function(s){s[s.Stopped=1]="Stopped",s[s.Starting=3]="Starting",s[s.Running=2]="Running"})(Lz||(vh.State=Lz={}));var l6e;(function(s){s.off="off",s.on="on"})(l6e||(vh.SuspendMode=l6e={}));var T1e;(function(s){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&Nv.stringArray(t.enabledCommands)?t:!1}s.sanitizeIsTrusted=e})(T1e||(T1e={}));class dci{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:g7.Continue}:{action:g7.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:ND.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:ND.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:ND.Restart})}}var no;(function(s){s.Initial="initial",s.Starting="starting",s.StartFailed="startFailed",s.Running="running",s.Stopping="stopping",s.Stopped="stopped"})(no||(no={}));var d6e;(function(s){function e(t){return t&&It.MessageReader.is(t.reader)&&It.MessageWriter.is(t.writer)}s.is=e})(d6e||(vh.MessageTransports=d6e={}));class aL{constructor(e,t,i){this._traceFormat=It.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new sq.Semaphore(1),this._id=e,this._name=t,i=i||{};const n={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(n.isTrusted=T1e.sanitizeIsTrusted(i.markdown.isTrusted),n.supportHtml=i.markdown.supportHtml===!0),this._clientOptions={documentSelector:i.documentSelector??[],synchronize:i.synchronize??{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName??this._name,revealOutputChannelOn:i.revealOutputChannelOn??c1.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:n,diagnosticPullOptions:i.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:i.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=no.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 sq.Semaphore(1),this._pendingChangeDelayer=new sq.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new sq.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new It.Emitter,this._stateChangeEmitter=new It.Emitter,this._trace=It.Trace.Off,this._tracer={log:(o,r)=>{Nv.string(o)?this.logTrace(o,r):this.logObjectTrace(o)}},this._c2p=Lai.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=Rai.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=Wr.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 no.Starting:return Lz.Starting;case no.Running:return Lz.Running;default:return Lz.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===It.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const n=this._clientOptions.middleware?.sendRequest;if(n!==void 0){let o,r;return t.length===1?It.CancellationToken.is(t[0])?r=t[0]:o=t[0]:t.length===2&&(o=t[0],r=t[1]),n(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 n=this.activeConnection();let o;return n!==void 0?(this._requestDisposables.set(i,n.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===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===It.TextDocumentSyncKind.Full;let n;i&&typeof e!="string"&&e.method===It.DidOpenTextDocumentNotification.method&&(n=t?.textDocument.uri,this._pendingOpenNotifications.add(n));const o=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(o),n!==void 0&&this._pendingOpenNotifications.delete(n);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 n=this.activeConnection();let o;return n!==void 0?(this._notificationDisposables.set(i,n.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===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,i)}catch(n){throw this.error(`Sending progress for token ${t} failed.`,n),n}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});const n=this.activeConnection();let o;const r=this._clientOptions.middleware?.handleWorkDoneProgress,a=It.WorkDoneProgress.is(e)&&r!==void 0?c=>{r(t,c,()=>i(c))}:i;return n!==void 0?(this._progressDisposables.set(t,n.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 dci(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 It.ResponseError){const t=e;return` Message: ${t.message} +>>> 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 Oot(this.pattern,this.options)}parse(e,t){yne(e);const i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Cv;if(e==="")return"";let n="",o=!1,r=!1;const a=[],c=[];let l,d=!1,h=-1,u=-1,f,p,m,v=e.charAt(0)===".",b=i.dot||v;const w=()=>v?"":b?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",y=k=>k.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",C=()=>{if(l){switch(l){case"*":n+=sge,o=!0;break;case"?":n+=u1e,o=!0;break;default:n+="\\"+l;break}this.debug("clearStateChar %j %j",l,n),l=!1}};for(let k=0,P;k(G||(G="\\"),z+z+G+"|")),this.debug(`tail=%j + %s`,k,k,p,n);const P=p.type==="*"?sge:p.type==="?"?u1e:"\\"+p.type;o=!0,n=n.slice(0,p.reStart)+P+"\\("+k}C(),r&&(n+="\\\\");const A=Gni[n.charAt(0)];for(let k=c.length-1;k>-1;k--){const P=c[k],R=n.slice(0,P.reStart),z=n.slice(P.reStart,P.reEnd-8);let G=n.slice(P.reEnd);const j=n.slice(P.reEnd-8,P.reEnd)+G,K=R.split(")").length,ie=R.split("(").length-K;let ge=G;for(let Re=0;Re(r=r.map(a=>typeof a=="string"?jni(a):a===Cv?Cv:a._src).reduce((a,c)=>(a[a.length-1]===Cv&&c===Cv||a.push(c),a),[]),r.forEach((a,c)=>{a!==Cv||r[c-1]===Cv||(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]=Cv))}),r.filter(a=>a!==Cv).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,n)}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;h1e.sep!=="/"&&(e=e.split(h1e.sep).join("/")),e=e.split(D7e),this.debug(this.pattern,"split",e);const n=this.set;this.debug(this.pattern,"set",n);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,n=new Set;Dz.fillTabResources(n);const o=new Set,r=new Set(n);for(const a of i.values())n.has(a)?r.delete(a):o.add(a);if(this.open=n,o.size>0){const a=new Set;for(const c of o)a.add(ko.Uri.parse(c));this._onClose.fire(a)}if(r.size>0){const a=new Set;for(const c of r)a.add(ko.Uri.parse(c));this._onOpen.fire(a)}};ko.window.tabGroups.onDidChangeTabs!==void 0?this.disposable=ko.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 ko.Uri?ko.window.activeTextEditor?.document.uri===e:ko.window.activeTextEditor?.document===e}isVisible(e){const t=e instanceof ko.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){const e=new Set;return Dz.fillTabResources(new Set,e),e}static fillTabResources(e,t){const i=e??new Set;for(const n of ko.window.tabGroups.all)for(const o of n.tabs){const r=o.input;let a;r instanceof ko.TabInputText?a=r.uri:r instanceof ko.TabInputTextDiff?a=r.modified:r instanceof ko.TabInputCustom&&(a=r.uri),a!==void 0&&!i.has(a.toString())&&(i.add(a.toString()),t!==void 0&&t.add(a))}}}var Wd;(function(s){s[s.document=1]="document",s[s.workspace=2]="workspace"})(Wd||(Wd={}));var MS;(function(s){function e(t){return t instanceof ko.Uri?t.toString():t.uri.toString()}s.asKey=e})(MS||(MS={}));class Zni{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,i){const n=e===Wd.document?this.documentPullStates:this.workspacePullStates,[o,r,a]=t instanceof ko.Uri?[t.toString(),t,i]:[t.uri.toString(),t.uri,t.version];let c=n.get(o);return c===void 0&&(c={document:r,pulledVersion:a,resultId:void 0},n.set(o,c)),c}update(e,t,i,n){const o=e===Wd.document?this.documentPullStates:this.workspacePullStates,[r,a,c,l]=t instanceof ko.Uri?[t.toString(),t,i,n]:[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=MS.asKey(t);(e===Wd.document?this.documentPullStates:this.workspacePullStates).delete(i)}tracks(e,t){const i=MS.asKey(t);return(e===Wd.document?this.documentPullStates:this.workspacePullStates).has(i)}getResultId(e,t){const i=MS.asKey(t);return(e===Wd.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 esi{constructor(e,t,i){this.client=e,this.tabs=t,this.options=i,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new ko.EventEmitter,this.provider=this.createProvider(),this.diagnostics=ko.languages.createDiagnosticCollection(i.identifier),this.openRequests=new Map,this.documentStates=new Zni,this.workspaceErrorCounter=0}knows(e,t){const i=t instanceof ko.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 ko.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},n=>{this.client.error(`Document pull failed for text document ${i.toString()}`,n,!1)})}async pullAsync(e,t){if(this.isDisposed)return;const i=e instanceof ko.Uri,n=i?e:e.uri,o=n.toString();t=i?t:e.version;const r=this.openRequests.get(o),a=i?this.documentStates.track(Wd.document,e,t):this.documentStates.track(Wd.document,e);if(r===void 0){const c=new ko.CancellationTokenSource;this.openRequests.set(o,{state:bu.active,document:e,version:t,tokenSource:c});let l,d;try{l=await this.provider.provideDiagnostics(e,a.resultId,c.token)??{kind:Gm.DocumentDiagnosticReportKind.full,items:[]}}catch(h){if(h instanceof g1e.LSPCancellationError&&il.DiagnosticServerCancellationData.is(h.data)&&h.data.retriggerRequest===!1&&(d={state:bu.outDated,document:e}),d===void 0&&h instanceof ko.CancellationError)d={state:bu.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(n);return}if(this.openRequests.delete(o),!this.tabs.isVisible(e)){this.documentStates.unTrack(Wd.document,e);return}if(d.state===bu.outDated)return;l!==void 0&&(l.kind===Gm.DocumentDiagnosticReportKind.full&&this.diagnostics.set(n,l.items),a.pulledVersion=t,a.resultId=l.resultId),d.state===bu.reschedule&&this.pull(e)}else r.state===bu.active?(r.tokenSource.cancel(),this.openRequests.set(o,{state:bu.reschedule,document:r.document})):r.state===bu.outDated&&this.openRequests.set(o,{state:bu.reschedule,document:r.document})}forgetDocument(e){const t=e instanceof ko.Uri?e:e.uri,i=t.toString(),n=this.openRequests.get(i);this.options.workspaceDiagnostics?n!==void 0?this.openRequests.set(i,{state:bu.reschedule,document:e}):this.pull(e,()=>{this.forget(Wd.document,e)}):(n!==void 0&&(n.state===bu.active&&n.tokenSource.cancel(),this.openRequests.set(i,{state:bu.outDated,document:e})),this.diagnostics.delete(t),this.forget(Wd.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,il.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof g1e.LSPCancellationError)&&!il.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,il.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 ko.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===Gm.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(Wd.document,i.uri)||this.diagnostics.set(i.uri,i.items)),this.documentStates.update(Wd.workspace,i.uri,i.version??void 0,i.resultId)})}createProvider(){const e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,i,n)=>{const o=(a,c,l)=>{const d={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(a instanceof ko.Uri?a:a.uri)},previousResultId:c};return this.isDisposed===!0||!this.client.isRunning()?{kind:Gm.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(il.DocumentDiagnosticRequest.type,d,l).then(async h=>h==null||this.isDisposed||l.isCancellationRequested?{kind:Gm.DocumentDiagnosticReportKind.full,items:[]}:h.kind===il.DocumentDiagnosticReportKind.Full?{kind:Gm.DocumentDiagnosticReportKind.full,resultId:h.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,l)}:{kind:Gm.DocumentDiagnosticReportKind.unChanged,resultId:h.resultId},h=>this.client.handleFailedRequest(il.DocumentDiagnosticRequest.type,l,h,{kind:Gm.DocumentDiagnosticReportKind.full,items:[]}))},r=this.client.middleware;return r.provideDiagnostics?r.provideDiagnostics(t,i,n,o):o(t,i,n)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,i,n)=>{const o=async l=>l.kind===il.DocumentDiagnosticReportKind.Full?{kind:Gm.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:Gm.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,Xni.generateUuid)(),u=this.client.onProgress(il.WorkspaceDiagnosticRequest.partialResult,h,async p=>{if(p==null){n(null);return}const m={items:[]};for(const v of p.items)try{m.items.push(await o(v))}catch(b){this.client.error("Converting workspace diagnostics failed.",b)}n(m)}),f={identifier:this.options.identifier,previousResultIds:r(l),partialResultToken:h};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(il.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(),n(m),{items:[]}},p=>(u.dispose(),this.client.handleFailedRequest(il.DocumentDiagnosticRequest.type,d,p,{items:[]})))},c=this.client.middleware;return c.provideWorkspaceDiagnostics?c.provideWorkspaceDiagnostics(t,i,n,a):a(t,i)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(const[e,t]of this.openRequests)t.state===bu.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:bu.outDated,document:t.document});this.diagnostics.dispose()}}class tsi{constructor(e){this.diagnosticRequestor=e,this.documents=new il.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;const t=MS.asKey(e);this.documents.has(t)||(this.documents.set(t,e,il.Touch.Last),this.trigger())}remove(e){const t=MS.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,il.RAL)().timer.setInterval(()=>{const e=this.documents.first;if(e!==void 0){const t=MS.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,il.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?MS.asKey(this.endDocument):void 0}}class isi{constructor(e,t,i){const n=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},o=e.protocol2CodeConverter.asDocumentSelector(i.documentSelector),r=[],a=p=>{const m=i.documentSelector;if(n.match!==void 0)return n.match(m,p);for(const v of m)if(il.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 b=new Jni.Minimatch(v.pattern,{noext:!0});if(!b.makeRe()||!b.match(p.fsPath))return!1}}return!0},c=p=>p instanceof ko.Uri?a(p):ko.languages.match(o,p)>0&&t.isVisible(p),l=p=>p instanceof ko.Uri?this.activeTextDocument?.uri.toString()===p.toString():this.activeTextDocument===p;this.diagnosticRequestor=new esi(e,t,i),this.backgroundScheduler=new tsi(this.diagnosticRequestor);const d=p=>{!c(p)||!i.interFileDependencies||l(p)||this.backgroundScheduler.add(p)};this.activeTextDocument=ko.window.activeTextEditor?.document,ko.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(il.DidOpenTextDocumentNotification.method);r.push(h.onNotificationSent(p=>{const m=p.textDocument;this.diagnosticRequestor.knows(Wd.document,m)||c(m)&&this.diagnosticRequestor.pull(m,()=>{d(m)})})),r.push(t.onOpen(p=>{for(const m of p){if(this.diagnosticRequestor.knows(Wd.document,m))continue;const v=m.toString();let b;for(const w of ko.workspace.textDocuments)if(v===w.uri.toString()){b=w;break}b!==void 0&&c(b)&&this.diagnosticRequestor.pull(b,()=>{d(b)})}}));const u=new Set;for(const p of ko.workspace.textDocuments)c(p)&&(this.diagnosticRequestor.pull(p,()=>{d(p)}),u.add(p.uri.toString()));if(n.onTabs===!0)for(const p of t.getTabResources())!u.has(p.toString())&&c(p)&&this.diagnosticRequestor.pull(p,()=>{d(p)});if(n.onChange===!0){const p=e.getFeature(il.DidChangeTextDocumentNotification.method);r.push(p.onNotificationSent(async m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,Cne.onType))&&this.diagnosticRequestor.knows(Wd.document,v)&&this.diagnosticRequestor.pull(v,()=>{this.backgroundScheduler.trigger()})}))}if(n.onSave===!0){const p=e.getFeature(il.DidSaveTextDocumentNotification.method);r.push(p.onNotificationSent(m=>{const v=m.textDocument;(n.filter===void 0||!n.filter(v,Cne.onSave))&&this.diagnosticRequestor.knows(Wd.document,v)&&this.diagnosticRequestor.pull(m.textDocument,()=>{this.backgroundScheduler.trigger()})}))}const f=e.getFeature(il.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 ko.workspace.textDocuments)c(p)&&this.diagnosticRequestor.pull(p)}),i.workspaceDiagnostics===!0&&i.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=ko.Disposable.from(...r,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(Wd.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}}class nsi extends g1e.TextDocumentLanguageFeature{constructor(e){super(e,il.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=jK(jK(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,jK(jK(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(il.DiagnosticRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeDiagnosticsEmitter.fire()});let[n,o]=this.getRegistration(t,e.diagnosticProvider);!n||!o||this.register({id:n,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 Dz);const t=new isi(this._client,this.tabs,e);return[t.disposable,t]}}_A.DiagnosticFeature=nsi;var mh={},ble={},bh={};Object.defineProperty(bh,"__esModule",{value:!0});bh.forEach=bh.mapAsync=bh.map=bh.clearTestMode=bh.setTestMode=bh.Semaphore=bh.Delayer=void 0;const gG=ps;class ssi{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,gG.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)}}bh.Delayer=ssi;class osi{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,gG.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()}}}bh.Semaphore=osi;let OPe=!1;function rsi(){OPe=!0}bh.setTestMode=rsi;function asi(){OPe=!1}bh.clearTestMode=asi;const k7e=15;class BPe{constructor(e=k7e){this.yieldAfter=OPe===!0?Math.max(e,2):Math.max(e,k7e),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 csi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),o=new BPe(i?.yieldAfter);function r(c){o.start();for(let l=c;l{(0,gG.RAL)().timer.setImmediate(()=>{c(r(a))})});return n}bh.map=csi;async function lsi(s,e,t,i){if(s.length===0)return[];const n=new Array(s.length),o=new BPe(i?.yieldAfter);async function r(c){o.start();for(let l=c;l{(0,gG.RAL)().timer.setImmediate(()=>{c(r(a))})});return n}bh.mapAsync=lsi;async function dsi(s,e,t,i){if(s.length===0)return;const n=new BPe(i?.yieldAfter);function o(a){n.start();for(let c=a;c{(0,gG.RAL)().timer.setImmediate(()=>{a(o(r))})})}bh.forEach=dsi;var wle={};Object.defineProperty(wle,"__esModule",{value:!0});const hsi=Xn;class usi extends hsi.CompletionItem{constructor(e){super(e)}}wle.default=usi;var yle={};Object.defineProperty(yle,"__esModule",{value:!0});const gsi=Xn;class fsi extends gsi.CodeLens{constructor(e){super(e)}}yle.default=fsi;var Cle={};Object.defineProperty(Cle,"__esModule",{value:!0});const psi=Xn;class msi extends psi.DocumentLink{constructor(e,t){super(e,t)}}Cle.default=msi;var Sle={};Object.defineProperty(Sle,"__esModule",{value:!0});const _si=Xn;class vsi extends _si.CodeAction{constructor(e,t){super(e),this.data=t}}Sle.default=vsi;var pN={};Object.defineProperty(pN,"__esModule",{value:!0});pN.ProtocolDiagnostic=pN.DiagnosticCode=void 0;const bsi=Xn,rge=kr;var I7e;(function(s){function e(t){const i=t;return i!=null&&(rge.number(i.value)||rge.string(i.value))&&rge.string(i.target)}s.is=e})(I7e||(pN.DiagnosticCode=I7e={}));class wsi extends bsi.Diagnostic{constructor(e,t,i,n){super(e,t,i),this.data=n,this.hasDiagnosticCode=!1}}pN.ProtocolDiagnostic=wsi;var Ale={};Object.defineProperty(Ale,"__esModule",{value:!0});const ysi=Xn;class Csi extends ysi.CallHierarchyItem{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),a!==void 0&&(this.data=a)}}Ale.default=Csi;var Ele={};Object.defineProperty(Ele,"__esModule",{value:!0});const Ssi=Xn;class Asi extends Ssi.TypeHierarchyItem{constructor(e,t,i,n,o,r,a){super(e,t,i,n,o,r),a!==void 0&&(this.data=a)}}Ele.default=Asi;var xle={};Object.defineProperty(xle,"__esModule",{value:!0});const YK=Xn;class Esi extends YK.SymbolInformation{constructor(e,t,i,n,o){const r=!(n instanceof YK.Uri);super(e,t,i,r?n:new YK.Location(n,new YK.Range(0,0,0,0))),this.hasRange=r,o!==void 0&&(this.data=o)}}xle.default=Esi;var Dle={};Object.defineProperty(Dle,"__esModule",{value:!0});const xsi=Xn;class Dsi extends xsi.InlayHint{constructor(e,t,i){super(e,t,i)}}Dle.default=Dsi;Object.defineProperty(ble,"__esModule",{value:!0});ble.createConverter=void 0;const Pl=Xn,ms=ps,GI=kr,T7e=bh,ksi=wle,Isi=yle,Tsi=Cle,L7e=Sle,R7e=pN,Lsi=Ale,Rsi=Ele,Msi=xle,Nsi=Dle;var f1e;(function(s){function e(t){const i=t;return i&&!!i.inserting&&!!i.replacing}s.is=e})(f1e||(f1e={}));function Psi(s){const t=s||(ee=>ee.toString());function i(ee){return t(ee)}function n(ee){return{uri:t(ee.uri)}}function o(ee){return{uri:t(ee.uri),languageId:ee.languageId,version:ee.version,text:ee.getText()}}function r(ee){return{uri:t(ee.uri),version:ee.version}}function a(ee){return{textDocument:o(ee)}}function c(ee){const De=ee;return!!De.document&&!!De.contentChanges}function l(ee){const De=ee;return!!De.uri&&!!De.version}function d(ee,De,gt){if(l(ee))return{textDocument:{uri:t(ee.uri),version:ee.version},contentChanges:[{text:ee.getText()}]};if(c(ee)){const zn=De,Cs=gt;return{textDocument:{uri:t(zn),version:Cs},contentChanges:ee.contentChanges.map(Ha=>{const ea=Ha.range;return{range:{start:{line:ea.start.line,character:ea.start.character},end:{line:ea.end.line,character:ea.end.character}},rangeLength:Ha.rangeLength,text:Ha.text}})}}else throw Error("Unsupported text document change parameter")}function h(ee){return{textDocument:n(ee)}}function u(ee,De=!1){let gt={textDocument:n(ee)};return De&&(gt.text=ee.getText()),gt}function f(ee){switch(ee){case Pl.TextDocumentSaveReason.Manual:return ms.TextDocumentSaveReason.Manual;case Pl.TextDocumentSaveReason.AfterDelay:return ms.TextDocumentSaveReason.AfterDelay;case Pl.TextDocumentSaveReason.FocusOut:return ms.TextDocumentSaveReason.FocusOut}return ms.TextDocumentSaveReason.Manual}function p(ee){return{textDocument:n(ee.document),reason:f(ee.reason)}}function m(ee){return{files:ee.files.map(De=>({uri:t(De)}))}}function v(ee){return{files:ee.files.map(De=>({oldUri:t(De.oldUri),newUri:t(De.newUri)}))}}function b(ee){return{files:ee.files.map(De=>({uri:t(De)}))}}function w(ee){return{files:ee.files.map(De=>({uri:t(De)}))}}function y(ee){return{files:ee.files.map(De=>({oldUri:t(De.oldUri),newUri:t(De.newUri)}))}}function C(ee){return{files:ee.files.map(De=>({uri:t(De)}))}}function A(ee,De){return{textDocument:n(ee),position:ge(De)}}function L(ee){switch(ee){case Pl.CompletionTriggerKind.TriggerCharacter:return ms.CompletionTriggerKind.TriggerCharacter;case Pl.CompletionTriggerKind.TriggerForIncompleteCompletions:return ms.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return ms.CompletionTriggerKind.Invoked}}function k(ee,De,gt){return{textDocument:n(ee),position:ge(De),context:{triggerKind:L(gt.triggerKind),triggerCharacter:gt.triggerCharacter}}}function P(ee){switch(ee){case Pl.SignatureHelpTriggerKind.Invoke:return ms.SignatureHelpTriggerKind.Invoked;case Pl.SignatureHelpTriggerKind.TriggerCharacter:return ms.SignatureHelpTriggerKind.TriggerCharacter;case Pl.SignatureHelpTriggerKind.ContentChange:return ms.SignatureHelpTriggerKind.ContentChange}}function R(ee){return{label:ee.label}}function z(ee){return ee.map(R)}function G(ee){return{label:ee.label,parameters:z(ee.parameters)}}function j(ee){return ee.map(G)}function K(ee){return ee===void 0?ee:{signatures:j(ee.signatures),activeSignature:ee.activeSignature,activeParameter:ee.activeParameter}}function ie(ee,De,gt){return{textDocument:n(ee),position:ge(De),context:{isRetrigger:gt.isRetrigger,triggerCharacter:gt.triggerCharacter,triggerKind:P(gt.triggerKind),activeSignatureHelp:K(gt.activeSignatureHelp)}}}function ge(ee){return{line:ee.line,character:ee.character}}function xe(ee){return ee==null?ee:{line:ee.line>ms.uinteger.MAX_VALUE?ms.uinteger.MAX_VALUE:ee.line,character:ee.character>ms.uinteger.MAX_VALUE?ms.uinteger.MAX_VALUE:ee.character}}function Re(ee,De){return T7e.map(ee,xe,De)}function yt(ee){return ee.map(xe)}function Pe(ee){return ee==null?ee:{start:xe(ee.start),end:xe(ee.end)}}function lt(ee){return ee.map(Pe)}function xt(ee){return ee==null?ee:ms.Location.create(i(ee.uri),Pe(ee.range))}function Ji(ee){switch(ee){case Pl.DiagnosticSeverity.Error:return ms.DiagnosticSeverity.Error;case Pl.DiagnosticSeverity.Warning:return ms.DiagnosticSeverity.Warning;case Pl.DiagnosticSeverity.Information:return ms.DiagnosticSeverity.Information;case Pl.DiagnosticSeverity.Hint:return ms.DiagnosticSeverity.Hint}}function Ii(ee){if(!ee)return;let De=[];for(let gt of ee){let zn=ns(gt);zn!==void 0&&De.push(zn)}return De.length>0?De:void 0}function ns(ee){switch(ee){case Pl.DiagnosticTag.Unnecessary:return ms.DiagnosticTag.Unnecessary;case Pl.DiagnosticTag.Deprecated:return ms.DiagnosticTag.Deprecated;default:return}}function zs(ee){return{message:ee.message,location:xt(ee.location)}}function Pn(ee){return ee.map(zs)}function Xr(ee){if(ee!=null)return GI.number(ee)||GI.string(ee)?ee:{value:ee.value,target:i(ee.target)}}function ds(ee){const De=ms.Diagnostic.create(Pe(ee.range),ee.message),gt=ee instanceof R7e.ProtocolDiagnostic?ee:void 0;gt!==void 0&>.data!==void 0&&(De.data=gt.data);const zn=Xr(ee.code);return R7e.DiagnosticCode.is(zn)?gt!==void 0&>.hasDiagnosticCode?De.code=zn:(De.code=zn.value,De.codeDescription={href:zn.target}):De.code=zn,GI.number(ee.severity)&&(De.severity=Ji(ee.severity)),Array.isArray(ee.tags)&&(De.tags=Ii(ee.tags)),ee.relatedInformation&&(De.relatedInformation=Pn(ee.relatedInformation)),ee.source&&(De.source=ee.source),De}function Zo(ee,De){return ee==null?ee:T7e.map(ee,ds,De)}function Zr(ee){return ee==null?ee:ee.map(ds)}function Di(ee,De){switch(ee){case"$string":return De;case ms.MarkupKind.PlainText:return{kind:ee,value:De};case ms.MarkupKind.Markdown:return{kind:ee,value:De.value};default:return`Unsupported Markup content received. Kind is: ${ee}`}}function ss(ee){switch(ee){case Pl.CompletionItemTag.Deprecated:return ms.CompletionItemTag.Deprecated}}function Oo(ee){if(ee===void 0)return ee;const De=[];for(let gt of ee){const zn=ss(gt);zn!==void 0&&De.push(zn)}return De}function Tn(ee,De){return De!==void 0?De:ee+1}function Ba(ee,De=!1){let gt,zn;GI.string(ee.label)?gt=ee.label:(gt=ee.label.label,De&&(ee.label.detail!==void 0||ee.label.description!==void 0)&&(zn={detail:ee.label.detail,description:ee.label.description}));let Cs={label:gt};zn!==void 0&&(Cs.labelDetails=zn);let Wo=ee instanceof ksi.default?ee:void 0;ee.detail&&(Cs.detail=ee.detail),ee.documentation&&(!Wo||Wo.documentationFormat==="$string"?Cs.documentation=ee.documentation:Cs.documentation=Di(Wo.documentationFormat,ee.documentation)),ee.filterText&&(Cs.filterText=ee.filterText),md(Cs,ee),GI.number(ee.kind)&&(Cs.kind=Tn(ee.kind,Wo&&Wo.originalItemKind)),ee.sortText&&(Cs.sortText=ee.sortText),ee.additionalTextEdits&&(Cs.additionalTextEdits=pc(ee.additionalTextEdits)),ee.commitCharacters&&(Cs.commitCharacters=ee.commitCharacters.slice()),ee.command&&(Cs.command=Or(ee.command)),(ee.preselect===!0||ee.preselect===!1)&&(Cs.preselect=ee.preselect);const Ha=Oo(ee.tags);if(Wo){if(Wo.data!==void 0&&(Cs.data=Wo.data),Wo.deprecated===!0||Wo.deprecated===!1){if(Wo.deprecated===!0&&Ha!==void 0&&Ha.length>0){const ea=Ha.indexOf(Pl.CompletionItemTag.Deprecated);ea!==-1&&Ha.splice(ea,1)}Cs.deprecated=Wo.deprecated}Wo.insertTextMode!==void 0&&(Cs.insertTextMode=Wo.insertTextMode)}return Ha!==void 0&&Ha.length>0&&(Cs.tags=Ha),Cs.insertTextMode===void 0&&ee.keepWhitespace===!0&&(Cs.insertTextMode=ms.InsertTextMode.adjustIndentation),Cs}function md(ee,De){let gt=ms.InsertTextFormat.PlainText,zn,Cs;De.textEdit?(zn=De.textEdit.newText,Cs=De.textEdit.range):De.insertText instanceof Pl.SnippetString?(gt=ms.InsertTextFormat.Snippet,zn=De.insertText.value):zn=De.insertText,De.range&&(Cs=De.range),ee.insertTextFormat=gt,De.fromEdit&&zn!==void 0&&Cs!==void 0?ee.textEdit=Fn(zn,Cs):ee.insertText=zn}function Fn(ee,De){return f1e.is(De)?ms.InsertReplaceEdit.create(ee,Pe(De.inserting),Pe(De.replacing)):{newText:ee,range:Pe(De)}}function Zd(ee){return{range:Pe(ee.range),newText:ee.newText}}function pc(ee){return ee==null?ee:ee.map(Zd)}function Vc(ee){return ee<=Pl.SymbolKind.TypeParameter?ee+1:ms.SymbolKind.Property}function $s(ee){return ee}function tc(ee){return ee.map($s)}function gl(ee,De,gt){return{textDocument:n(ee),position:ge(De),context:{includeDeclaration:gt.includeDeclaration}}}async function eh(ee,De){let gt=ms.CodeAction.create(ee.title);if(ee instanceof L7e.default&&ee.data!==void 0&&(gt.data=ee.data),ee.kind!==void 0&&(gt.kind=Dc(ee.kind)),ee.diagnostics!==void 0&&(gt.diagnostics=await Zo(ee.diagnostics,De)),ee.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return ee.command!==void 0&&(gt.command=Or(ee.command)),ee.isPreferred!==void 0&&(gt.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(gt.disabled={reason:ee.disabled.reason}),gt}function dg(ee){let De=ms.CodeAction.create(ee.title);if(ee instanceof L7e.default&&ee.data!==void 0&&(De.data=ee.data),ee.kind!==void 0&&(De.kind=Dc(ee.kind)),ee.diagnostics!==void 0&&(De.diagnostics=Zr(ee.diagnostics)),ee.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return ee.command!==void 0&&(De.command=Or(ee.command)),ee.isPreferred!==void 0&&(De.isPreferred=ee.isPreferred),ee.disabled!==void 0&&(De.disabled={reason:ee.disabled.reason}),De}async function mc(ee,De){if(ee==null)return ee;let gt;return ee.only&&GI.string(ee.only.value)&&(gt=[ee.only.value]),ms.CodeActionContext.create(await Zo(ee.diagnostics,De),gt,th(ee.triggerKind))}function zc(ee){if(ee==null)return ee;let De;return ee.only&&GI.string(ee.only.value)&&(De=[ee.only.value]),ms.CodeActionContext.create(Zr(ee.diagnostics),De,th(ee.triggerKind))}function th(ee){switch(ee){case Pl.CodeActionTriggerKind.Invoke:return ms.CodeActionTriggerKind.Invoked;case Pl.CodeActionTriggerKind.Automatic:return ms.CodeActionTriggerKind.Automatic;default:return}}function Dc(ee){if(ee!=null)return ee.value}function fl(ee){return ee==null?ee:ms.InlineValueContext.create(ee.frameId,Pe(ee.stoppedLocation))}function ic(ee,De,gt){return{context:ms.InlineCompletionContext.create(gt.triggerKind,gt.selectedCompletionInfo),textDocument:n(ee),position:xe(De)}}function Or(ee){let De=ms.Command.create(ee.title,ee.command);return ee.arguments&&(De.arguments=ee.arguments),De}function pl(ee){let De=ms.CodeLens.create(Pe(ee.range));return ee.command&&(De.command=Or(ee.command)),ee instanceof Isi.default&&ee.data&&(De.data=ee.data),De}function ih(ee,De){const gt={tabSize:ee.tabSize,insertSpaces:ee.insertSpaces};return De.trimTrailingWhitespace&&(gt.trimTrailingWhitespace=!0),De.trimFinalNewlines&&(gt.trimFinalNewlines=!0),De.insertFinalNewline&&(gt.insertFinalNewline=!0),gt}function nh(ee){return{textDocument:n(ee)}}function $c(ee){return{textDocument:n(ee)}}function Gc(ee){let De=ms.DocumentLink.create(Pe(ee.range));ee.target&&(De.target=i(ee.target)),ee.tooltip!==void 0&&(De.tooltip=ee.tooltip);let gt=ee instanceof Tsi.default?ee:void 0;return gt&>.data&&(De.data=gt.data),De}function Wa(ee){return{textDocument:n(ee)}}function Bo(ee){const De={name:ee.name,kind:Vc(ee.kind),uri:i(ee.uri),range:Pe(ee.range),selectionRange:Pe(ee.selectionRange)};return ee.detail!==void 0&&ee.detail.length>0&&(De.detail=ee.detail),ee.tags!==void 0&&(De.tags=tc(ee.tags)),ee instanceof Lsi.default&&ee.data!==void 0&&(De.data=ee.data),De}function Is(ee){const De={name:ee.name,kind:Vc(ee.kind),uri:i(ee.uri),range:Pe(ee.range),selectionRange:Pe(ee.selectionRange)};return ee.detail!==void 0&&ee.detail.length>0&&(De.detail=ee.detail),ee.tags!==void 0&&(De.tags=tc(ee.tags)),ee instanceof Rsi.default&&ee.data!==void 0&&(De.data=ee.data),De}function kc(ee){const De=ee instanceof Msi.default?{name:ee.name,kind:Vc(ee.kind),location:ee.hasRange?xt(ee.location):{uri:t(ee.location.uri)},data:ee.data}:{name:ee.name,kind:Vc(ee.kind),location:xt(ee.location)};return ee.tags!==void 0&&(De.tags=tc(ee.tags)),ee.containerName!==""&&(De.containerName=ee.containerName),De}function Rh(ee){const De=typeof ee.label=="string"?ee.label:ee.label.map(be),gt=ms.InlayHint.create(xe(ee.position),De);return ee.kind!==void 0&&(gt.kind=ee.kind),ee.textEdits!==void 0&&(gt.textEdits=pc(ee.textEdits)),ee.tooltip!==void 0&&(gt.tooltip=Aa(ee.tooltip)),ee.paddingLeft!==void 0&&(gt.paddingLeft=ee.paddingLeft),ee.paddingRight!==void 0&&(gt.paddingRight=ee.paddingRight),ee instanceof Nsi.default&&ee.data!==void 0&&(gt.data=ee.data),gt}function be(ee){const De=ms.InlayHintLabelPart.create(ee.value);return ee.location!==void 0&&(De.location=xt(ee.location)),ee.command!==void 0&&(De.command=Or(ee.command)),ee.tooltip!==void 0&&(De.tooltip=Aa(ee.tooltip)),De}function Aa(ee){return typeof ee=="string"?ee:{kind:ms.MarkupKind.Markdown,value:ee.value}}return{asUri:i,asTextDocumentIdentifier:n,asTextDocumentItem:o,asVersionedTextDocumentIdentifier:r,asOpenTextDocumentParams:a,asChangeTextDocumentParams:d,asCloseTextDocumentParams:h,asSaveTextDocumentParams:u,asWillSaveTextDocumentParams:p,asDidCreateFilesParams:m,asDidRenameFilesParams:v,asDidDeleteFilesParams:b,asWillCreateFilesParams:w,asWillRenameFilesParams:y,asWillDeleteFilesParams:C,asTextDocumentPositionParams:A,asCompletionParams:k,asSignatureHelpParams:ie,asWorkerPosition:ge,asRange:Pe,asRanges:lt,asPosition:xe,asPositions:Re,asPositionsSync:yt,asLocation:xt,asDiagnosticSeverity:Ji,asDiagnosticTag:ns,asDiagnostic:ds,asDiagnostics:Zo,asDiagnosticsSync:Zr,asCompletionItem:Ba,asTextEdit:Zd,asSymbolKind:Vc,asSymbolTag:$s,asSymbolTags:tc,asReferenceParams:gl,asCodeAction:eh,asCodeActionSync:dg,asCodeActionContext:mc,asCodeActionContextSync:zc,asInlineValueContext:fl,asCommand:Or,asCodeLens:pl,asFormattingOptions:ih,asDocumentSymbolParams:nh,asCodeLensParams:$c,asDocumentLink:Gc,asDocumentLinkParams:Wa,asCallHierarchyItem:Bo,asTypeHierarchyItem:Is,asInlayHint:Rh,asWorkspaceSymbol:kc,asInlineCompletionParams:ic}}ble.createConverter=Psi;var kle={};Object.defineProperty(kle,"__esModule",{value:!0});kle.createConverter=void 0;const di=Xn,On=ps,Km=kr,hr=bh,Fsi=wle,Osi=yle,Bsi=Cle,Wsi=Sle,M7e=pN,Hsi=Ale,Usi=Ele,Vsi=xle,zsi=Dle,N7e=ps;var Sne;(function(s){function e(t){let i=t;return i&&Km.string(i.language)&&Km.string(i.value)}s.is=e})(Sne||(Sne={}));function $si(s,e,t){const n=s||(T=>di.Uri.parse(T));function o(T){return n(T)}function r(T){const ne=[];for(const ye of T)if(typeof ye=="string")ne.push(ye);else if(N7e.NotebookCellTextDocumentFilter.is(ye))if(typeof ye.notebook=="string")ne.push({notebookType:ye.notebook,language:ye.language});else{const O=ye.notebook.notebookType??"*";ne.push({notebookType:O,scheme:ye.notebook.scheme,pattern:ye.notebook.pattern,language:ye.language})}else N7e.TextDocumentFilter.is(ye)&&ne.push({language:ye.language,scheme:ye.scheme,pattern:ye.pattern});return ne}async function a(T,ne){return hr.map(T,l,ne)}function c(T){const ne=new Array(T.length);for(let ye=0;ye0?ne:void 0}function u(T){switch(T){case On.DiagnosticTag.Unnecessary:return di.DiagnosticTag.Unnecessary;case On.DiagnosticTag.Deprecated:return di.DiagnosticTag.Deprecated;default:return}}function f(T){return T?new di.Position(T.line,T.character):void 0}function p(T){return T?new di.Range(T.start.line,T.start.character,T.end.line,T.end.character):void 0}async function m(T,ne){return hr.map(T,ye=>new di.Range(ye.start.line,ye.start.character,ye.end.line,ye.end.character),ne)}function v(T){if(T==null)return di.DiagnosticSeverity.Error;switch(T){case On.DiagnosticSeverity.Error:return di.DiagnosticSeverity.Error;case On.DiagnosticSeverity.Warning:return di.DiagnosticSeverity.Warning;case On.DiagnosticSeverity.Information:return di.DiagnosticSeverity.Information;case On.DiagnosticSeverity.Hint:return di.DiagnosticSeverity.Hint}return di.DiagnosticSeverity.Error}function b(T){if(Km.string(T))return y(T);if(Sne.is(T))return y().appendCodeblock(T.value,T.language);if(Array.isArray(T)){let ne=[];for(let ye of T){let O=y();Sne.is(ye)?O.appendCodeblock(ye.value,ye.language):O.appendMarkdown(ye),ne.push(O)}return ne}else return y(T)}function w(T){if(Km.string(T))return T;switch(T.kind){case On.MarkupKind.Markdown:return y(T.value);case On.MarkupKind.PlainText:return T.value;default:return`Unsupported Markup content received. Kind is: ${T.kind}`}}function y(T){let ne;if(T===void 0||typeof T=="string")ne=new di.MarkdownString(T);else switch(T.kind){case On.MarkupKind.Markdown:ne=new di.MarkdownString(T.value);break;case On.MarkupKind.PlainText:ne=new di.MarkdownString,ne.appendText(T.value);break;default:ne=new di.MarkdownString,ne.appendText(`Unsupported Markup content received. Kind is: ${T.kind}`);break}return ne.isTrusted=e,ne.supportHtml=t,ne}function C(T){if(T)return new di.Hover(b(T.contents),p(T.range))}async function A(T,ne,ye){if(!T)return;if(Array.isArray(T))return hr.map(T,Bi=>z(Bi,ne),ye);const O=T,{defaultRange:$,commitCharacters:se}=L(O,ne),Ke=await hr.map(O.items,Bi=>z(Bi,se,$,O.itemDefaults?.insertTextMode,O.itemDefaults?.insertTextFormat,O.itemDefaults?.data),ye);return new di.CompletionList(Ke,O.isIncomplete)}function L(T,ne){const ye=T.itemDefaults?.editRange,O=T.itemDefaults?.commitCharacters??ne;return On.Range.is(ye)?{defaultRange:p(ye),commitCharacters:O}:ye!==void 0?{defaultRange:{inserting:p(ye.insert),replacing:p(ye.replace)},commitCharacters:O}:{defaultRange:void 0,commitCharacters:O}}function k(T){return On.CompletionItemKind.Text<=T&&T<=On.CompletionItemKind.TypeParameter?[T-1,void 0]:[di.CompletionItemKind.Text,T]}function P(T){switch(T){case On.CompletionItemTag.Deprecated:return di.CompletionItemTag.Deprecated}}function R(T){if(T==null)return[];const ne=[];for(const ye of T){const O=P(ye);O!==void 0&&ne.push(O)}return ne}function z(T,ne,ye,O,$,se){const Ke=R(T.tags),Bi=G(T),Wi=new Fsi.default(Bi);T.detail&&(Wi.detail=T.detail),T.documentation&&(Wi.documentation=w(T.documentation),Wi.documentationFormat=Km.string(T.documentation)?"$string":T.documentation.kind),T.filterText&&(Wi.filterText=T.filterText);const ta=j(T,ye,$);if(ta&&(Wi.insertText=ta.text,Wi.range=ta.range,Wi.fromEdit=ta.fromEdit),Km.number(T.kind)){let[zot,iFe]=k(T.kind);Wi.kind=zot,iFe&&(Wi.originalItemKind=iFe)}T.sortText&&(Wi.sortText=T.sortText),T.additionalTextEdits&&(Wi.additionalTextEdits=xe(T.additionalTextEdits));const Nl=T.commitCharacters!==void 0?Km.stringArray(T.commitCharacters)?T.commitCharacters:void 0:ne;Nl&&(Wi.commitCharacters=Nl.slice()),T.command&&(Wi.command=pc(T.command)),(T.deprecated===!0||T.deprecated===!1)&&(Wi.deprecated=T.deprecated,T.deprecated===!0&&Ke.push(di.CompletionItemTag.Deprecated)),(T.preselect===!0||T.preselect===!1)&&(Wi.preselect=T.preselect);const hg=T.data??se;hg!==void 0&&(Wi.data=hg),Ke.length>0&&(Wi.tags=Ke);const ode=T.insertTextMode??O;return ode!==void 0&&(Wi.insertTextMode=ode,ode===On.InsertTextMode.asIs&&(Wi.keepWhitespace=!0)),Wi}function G(T){return On.CompletionItemLabelDetails.is(T.labelDetails)?{label:T.label,detail:T.labelDetails.detail,description:T.labelDetails.description}:T.label}function j(T,ne,ye){const O=T.insertTextFormat??ye;if(T.textEdit!==void 0||ne!==void 0){const[$,se]=T.textEdit!==void 0?K(T.textEdit):[ne,T.textEditText??T.label];return O===On.InsertTextFormat.Snippet?{text:new di.SnippetString(se),range:$,fromEdit:!0}:{text:se,range:$,fromEdit:!0}}else return T.insertText?O===On.InsertTextFormat.Snippet?{text:new di.SnippetString(T.insertText),fromEdit:!1}:{text:T.insertText,fromEdit:!1}:void 0}function K(T){return On.InsertReplaceEdit.is(T)?[{inserting:p(T.insert),replacing:p(T.replace)},T.newText]:[p(T.range),T.newText]}function ie(T){if(T)return new di.TextEdit(p(T.range),T.newText)}async function ge(T,ne){if(T)return hr.map(T,ie,ne)}function xe(T){if(!T)return;const ne=new Array(T.length);for(let ye=0;ye0){let ye=[];for(let O of T.children)ye.push(Fn(O));ne.children=ye}return ne}function Zd(T,ne){T.tags=Tn(ne.tags),ne.deprecated&&(T.tags?T.tags.includes(di.SymbolTag.Deprecated)||(T.tags=T.tags.concat(di.SymbolTag.Deprecated)):T.tags=[di.SymbolTag.Deprecated])}function pc(T){let ne={title:T.title,command:T.command};return T.arguments&&(ne.arguments=T.arguments),ne}async function Vc(T,ne){if(T)return hr.map(T,pc,ne)}const $s=new Map;$s.set(On.CodeActionKind.Empty,di.CodeActionKind.Empty),$s.set(On.CodeActionKind.QuickFix,di.CodeActionKind.QuickFix),$s.set(On.CodeActionKind.Refactor,di.CodeActionKind.Refactor),$s.set(On.CodeActionKind.RefactorExtract,di.CodeActionKind.RefactorExtract),$s.set(On.CodeActionKind.RefactorInline,di.CodeActionKind.RefactorInline),$s.set(On.CodeActionKind.RefactorRewrite,di.CodeActionKind.RefactorRewrite),$s.set(On.CodeActionKind.Source,di.CodeActionKind.Source),$s.set(On.CodeActionKind.SourceOrganizeImports,di.CodeActionKind.SourceOrganizeImports);function tc(T){if(T==null)return;let ne=$s.get(T);if(ne)return ne;let ye=T.split(".");ne=di.CodeActionKind.Empty;for(let O of ye)ne=ne.append(O);return ne}function gl(T){if(T!=null)return T.map(ne=>tc(ne))}async function eh(T,ne){if(T==null)return;let ye=new Wsi.default(T.title,T.data);return T.kind!==void 0&&(ye.kind=tc(T.kind)),T.diagnostics!==void 0&&(ye.diagnostics=c(T.diagnostics)),T.edit!==void 0&&(ye.edit=await th(T.edit,ne)),T.command!==void 0&&(ye.command=pc(T.command)),T.isPreferred!==void 0&&(ye.isPreferred=T.isPreferred),T.disabled!==void 0&&(ye.disabled={reason:T.disabled.reason}),ye}function dg(T,ne){return hr.mapAsync(T,async ye=>On.Command.is(ye)?pc(ye):eh(ye,ne),ne)}function mc(T){if(!T)return;let ne=new Osi.default(p(T.range));return T.command&&(ne.command=pc(T.command)),T.data!==void 0&&T.data!==null&&(ne.data=T.data),ne}async function zc(T,ne){if(T)return hr.map(T,mc,ne)}async function th(T,ne){if(!T)return;const ye=new Map;if(T.changeAnnotations!==void 0){const se=T.changeAnnotations;await hr.forEach(Object.keys(se),Ke=>{const Bi=Dc(se[Ke]);ye.set(Ke,Bi)},ne)}const O=se=>{if(se!==void 0)return ye.get(se)},$=new di.WorkspaceEdit;if(T.documentChanges){const se=T.documentChanges;await hr.forEach(se,Ke=>{if(On.CreateFile.is(Ke))$.createFile(n(Ke.uri),Ke.options,O(Ke.annotationId));else if(On.RenameFile.is(Ke))$.renameFile(n(Ke.oldUri),n(Ke.newUri),Ke.options,O(Ke.annotationId));else if(On.DeleteFile.is(Ke))$.deleteFile(n(Ke.uri),Ke.options,O(Ke.annotationId));else if(On.TextDocumentEdit.is(Ke)){const Bi=n(Ke.textDocument.uri);for(const Wi of Ke.edits)On.AnnotatedTextEdit.is(Wi)?$.replace(Bi,p(Wi.range),Wi.newText,O(Wi.annotationId)):$.replace(Bi,p(Wi.range),Wi.newText)}else throw new Error(`Unknown workspace edit change received: +${JSON.stringify(Ke,void 0,4)}`)},ne)}else if(T.changes){const se=T.changes;await hr.forEach(Object.keys(se),Ke=>{$.set(n(Ke),xe(se[Ke]))},ne)}return $}function Dc(T){if(T!==void 0)return{label:T.label,needsConfirmation:!!T.needsConfirmation,description:T.description}}function fl(T){let ne=p(T.range),ye=T.target?o(T.target):void 0,O=new Bsi.default(ne,ye);return T.tooltip!==void 0&&(O.tooltip=T.tooltip),T.data!==void 0&&T.data!==null&&(O.data=T.data),O}async function ic(T,ne){if(T)return hr.map(T,fl,ne)}function Or(T){return new di.Color(T.red,T.green,T.blue,T.alpha)}function pl(T){return new di.ColorInformation(p(T.range),Or(T.color))}async function ih(T,ne){if(T)return hr.map(T,pl,ne)}function nh(T){let ne=new di.ColorPresentation(T.label);return ne.additionalTextEdits=xe(T.additionalTextEdits),T.textEdit&&(ne.textEdit=ie(T.textEdit)),ne}async function $c(T,ne){if(T)return hr.map(T,nh,ne)}function Gc(T){if(T)switch(T){case On.FoldingRangeKind.Comment:return di.FoldingRangeKind.Comment;case On.FoldingRangeKind.Imports:return di.FoldingRangeKind.Imports;case On.FoldingRangeKind.Region:return di.FoldingRangeKind.Region}}function Wa(T){return new di.FoldingRange(T.startLine,T.endLine,Gc(T.kind))}async function Bo(T,ne){if(T)return hr.map(T,Wa,ne)}function Is(T){return new di.SelectionRange(p(T.range),T.parent?Is(T.parent):void 0)}async function kc(T,ne){return Array.isArray(T)?hr.map(T,Is,ne):[]}function Rh(T){return On.InlineValueText.is(T)?new di.InlineValueText(p(T.range),T.text):On.InlineValueVariableLookup.is(T)?new di.InlineValueVariableLookup(p(T.range),T.variableName,T.caseSensitiveLookup):new di.InlineValueEvaluatableExpression(p(T.range),T.expression)}async function be(T,ne){return Array.isArray(T)?hr.map(T,Rh,ne):[]}async function Aa(T,ne){const ye=typeof T.label=="string"?T.label:await hr.map(T.label,ee,ne),O=new zsi.default(f(T.position),ye);return T.kind!==void 0&&(O.kind=T.kind),T.textEdits!==void 0&&(O.textEdits=await ge(T.textEdits,ne)),T.tooltip!==void 0&&(O.tooltip=De(T.tooltip)),T.paddingLeft!==void 0&&(O.paddingLeft=T.paddingLeft),T.paddingRight!==void 0&&(O.paddingRight=T.paddingRight),T.data!==void 0&&(O.data=T.data),O}function ee(T){const ne=new di.InlayHintLabelPart(T.value);return T.location!==void 0&&(ne.location=Ji(T.location)),T.tooltip!==void 0&&(ne.tooltip=De(T.tooltip)),T.command!==void 0&&(ne.command=pc(T.command)),ne}function De(T){return typeof T=="string"?T:y(T)}async function gt(T,ne){if(Array.isArray(T))return hr.mapAsync(T,Aa,ne)}function zn(T){if(T===null)return;const ne=new Hsi.default(ss(T.kind),T.name,T.detail||"",o(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ne.tags=Tn(T.tags)),ne}async function Cs(T,ne){if(T!==null)return hr.map(T,zn,ne)}async function Wo(T,ne){return new di.CallHierarchyIncomingCall(zn(T.from),await m(T.fromRanges,ne))}async function Ha(T,ne){if(T!==null)return hr.mapAsync(T,Wo,ne)}async function ea(T,ne){return new di.CallHierarchyOutgoingCall(zn(T.to),await m(T.fromRanges,ne))}async function Mh(T,ne){if(T!==null)return hr.mapAsync(T,ea,ne)}async function le(T,ne){if(T!=null)return new di.SemanticTokens(new Uint32Array(T.data),T.resultId)}function dr(T){return new di.SemanticTokensEdit(T.start,T.deleteCount,T.data!==void 0?new Uint32Array(T.data):void 0)}async function io(T,ne){if(T!=null)return new di.SemanticTokensEdits(T.edits.map(dr),T.resultId)}function un(T){return T}async function Se(T,ne){if(T!=null)return new di.LinkedEditingRanges(await m(T.ranges,ne),rt(T.wordPattern))}function rt(T){if(T!=null)return new RegExp(T)}function Ft(T){if(T===null)return;let ne=new Usi.default(ss(T.kind),T.name,T.detail||"",o(T.uri),p(T.range),p(T.selectionRange),T.data);return T.tags!==void 0&&(ne.tags=Tn(T.tags)),ne}async function Ci(T,ne){if(T!==null)return hr.map(T,Ft,ne)}function Ot(T){if(Km.string(T))return T;if(On.RelativePattern.is(T)){if(On.URI.is(T.baseUri))return new di.RelativePattern(o(T.baseUri),T.pattern);if(On.WorkspaceFolder.is(T.baseUri)){const ne=di.workspace.getWorkspaceFolder(o(T.baseUri.uri));return ne!==void 0?new di.RelativePattern(ne,T.pattern):void 0}}}async function q(T,ne){if(!T)return;if(Array.isArray(T))return hr.map(T,$=>de($),ne);const ye=T,O=await hr.map(ye.items,$=>de($),ne);return new di.InlineCompletionList(O)}function de(T){let ne;typeof T.insertText=="string"?ne=T.insertText:ne=new di.SnippetString(T.insertText.value);let ye;T.command&&(ye=pc(T.command));const O=new di.InlineCompletionItem(ne,p(T.range),ye);return T.filterText&&(O.filterText=T.filterText),O}return{asUri:o,asDocumentSelector:r,asDiagnostics:a,asDiagnostic:l,asRange:p,asRanges:m,asPosition:f,asDiagnosticSeverity:v,asDiagnosticTag:u,asHover:C,asCompletionResult:A,asCompletionItem:z,asTextEdit:ie,asTextEdits:ge,asSignatureHelp:Re,asSignatureInformations:yt,asSignatureInformation:Pe,asParameterInformations:lt,asParameterInformation:xt,asDeclarationResult:Ii,asDefinitionResult:ns,asLocation:Ji,asReferences:Xr,asDocumentHighlights:ds,asDocumentHighlight:Zo,asDocumentHighlightKind:Zr,asSymbolKind:ss,asSymbolTag:Oo,asSymbolTags:Tn,asSymbolInformations:Di,asSymbolInformation:Ba,asDocumentSymbols:md,asDocumentSymbol:Fn,asCommand:pc,asCommands:Vc,asCodeAction:eh,asCodeActionKind:tc,asCodeActionKinds:gl,asCodeActionResult:dg,asCodeLens:mc,asCodeLenses:zc,asWorkspaceEdit:th,asDocumentLink:fl,asDocumentLinks:ic,asFoldingRangeKind:Gc,asFoldingRange:Wa,asFoldingRanges:Bo,asColor:Or,asColorInformation:pl,asColorInformations:ih,asColorPresentation:nh,asColorPresentations:$c,asSelectionRange:Is,asSelectionRanges:kc,asInlineValue:Rh,asInlineValues:be,asInlayHint:Aa,asInlayHints:gt,asSemanticTokensLegend:un,asSemanticTokens:le,asSemanticTokensEdit:dr,asSemanticTokensEdits:io,asCallHierarchyItem:zn,asCallHierarchyItems:Cs,asCallHierarchyIncomingCall:Wo,asCallHierarchyIncomingCalls:Ha,asCallHierarchyOutgoingCall:ea,asCallHierarchyOutgoingCalls:Mh,asLinkedEditingRanges:Se,asTypeHierarchyItem:Ft,asTypeHierarchyItems:Ci,asGlobPattern:Ot,asInlineCompletionResult:q,asInlineCompletionItem:de}}kle.createConverter=$si;var fG={};Object.defineProperty(fG,"__esModule",{value:!0});fG.ProgressPart=void 0;const P7e=Xn,F7e=ps,O7e=kr;class Gsi{constructor(e,t,i){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(F7e.WorkDoneProgress.type,this._token,n=>{switch(n.kind){case"begin":this.begin(n);break;case"report":this.report(n);break;case"end":this.done(),i&&i(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&P7e.window.withProgress({location:P7e.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(F7e.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((n,o)=>{this._resolve=n,this._reject=o})})}report(e){if(this._infinite&&O7e.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(O7e.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}}fG.ProgressPart=Gsi;var Ile={};Object.defineProperty(Ile,"__esModule",{value:!0});Ile.NotebookDocumentSyncFeature=void 0;const xu=Xn,Ksi=_le,NS=ps,qsi=or,B7e=kr;function W7e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}var NF;(function(s){(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=NS.NotebookDocument.create(f.asUri(h.uri),h.notebookType,h.version,n(u,f));return Object.keys(h.metadata).length>0&&(p.metadata=o(h.metadata)),p}e.asNotebookDocument=i;function n(h,u){return h.map(f=>r(f,u))}e.asNotebookCells=n;function o(h){return c(new Set,h)}e.asMetadata=o;function r(h,u){const f=NS.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&&B7e.number(h.executionSummary.executionOrder)&&B7e.boolean(h.executionSummary.success)&&(f.executionSummary={executionOrder:h.executionSummary.executionOrder,success:h.executionSummary.success}),f}e.asNotebookCell=r;function a(h){switch(h){case xu.NotebookCellKind.Markup:return NS.NotebookCellKind.Markup;case xu.NotebookCellKind.Code:return NS.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=s.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=>s.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=>s.c2p.asNotebookCell(v,u))),m.textContent!==void 0&&(p.textContent=m.textContent.map(v=>s.c2p.asTextContentChange(v,u))),Object.keys(p).length>0&&(f.cells=p)}return f}e.asNotebookDocumentChangeEvent=d})(s.c2p||(s.c2p={}))})(NF||(NF={}));var p1e;(function(s){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()))}}s.create=e})(Ene||(Ene={}));class JK{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(Ane.asDocumentSelector(t)),xu.workspace.onDidOpenNotebookDocument(i=>{this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i)},void 0,this.disposables);for(const i of xu.workspace.notebookDocuments)this.notebookDidOpen.add(i.uri.toString()),this.didOpen(i);xu.workspace.onDidChangeNotebookDocument(i=>this.didChangeNotebookDocument(i),void 0,this.disposables),this.options.save===!0&&xu.workspace.onDidSaveNotebookDocument(i=>this.didSave(i),void 0,this.disposables),xu.workspace.onDidCloseNotebookDocument(i=>{this.didClose(i),this.notebookDidOpen.delete(i.uri.toString())},void 0,this.disposables)}getState(){for(const e of xu.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 xu.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(xu.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;const i=this.notebookSyncInfo.get(e.uri.toString()),n=this.cellMatches(e,t);if(i!==void 0){const o=i.uris.has(t.document.uri.toString());if(n&&o||!n&&!o)return;if(n){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 n&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){xu.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 n=t.document.uri,o=i.cells.findIndex(r=>r.document.uri.toString()===n.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 n=this.asNotebookDocumentChangeEvent(e,void 0,i,t);n!==void 0&&this.doSendChange(n,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 n=this.getMatchingCells(t);if(n===void 0)return;this.didOpen(t,n,i)}else{const n=this.getMatchingCells(t);if(n===void 0){this.didClose(t,i);return}const o=this.asNotebookDocumentChangeEvent(e.notebook,e,i,n);o!==void 0&&this.doSendChange(o,n).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(n=>t.uris.has(n.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=NF.c2p.asNotebookDocument(o,r,this.client.code2ProtocolConverter),c=r.map(l=>this.client.code2ProtocolConverter.asTextDocumentItem(l.document));try{await this.client.sendNotification(NS.DidOpenNotebookDocumentNotification.type,{notebookDocument:a,cellTextDocuments:c})}catch(l){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",l),l}},n=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),Ene.create(t)),n?.didOpen!==void 0?n.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(NS.DidChangeNotebookDocumentNotification.type,{notebookDocument:NF.c2p.asVersionedNotebookDocumentIdentifier(o.notebook,this.client.code2ProtocolConverter),change:NF.c2p.asNotebookDocumentChangeEvent(o,this.client.code2ProtocolConverter)})}catch(r){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",r),r}},n=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),Ene.create(t??[])),n?.didChange!==void 0?n?.didChange(e,i):i(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){const t=async n=>{try{await this.client.sendNotification(NS.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(n.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(NS.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}},n=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),n?.didClose!==void 0?n.didClose(e,t,i):i(e,t)}asNotebookDocumentChangeEvent(e,t,i,n){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");const o={notebook:e};t?.metadata!==void 0&&(o.metadata=NF.c2p.asMetadata(t.metadata));let r;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){const a=[];r=new Set(n.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&&n!==void 0){const a=i.cells,c=n,l=p1e.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||m1e.matchNotebook(i.notebook,e)){const n=this.filterCells(e,t,i.cells);return n.length===0?void 0:n}}}cellMatches(e,t){const i=this.getMatchingCells(e,[t]);return i!==void 0&&i[0]===t}filterCells(e,t,i){const n=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,n):n}}class U1{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=NS.NotebookDocumentSyncRegistrationType.type,xu.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==U1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const o of this.registrations.values())o instanceof JK&&o.didOpenNotebookCellTextDocument(i,n)}),xu.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;const i=t.document;if(i.uri.scheme!==U1.CellScheme)return;const[n]=this.findNotebookDocumentAndCell(i);if(n!==void 0)for(const o of this.registrations.values())o instanceof JK&&o.didChangeNotebookCellTextDocument(n,t)}),xu.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==U1.CellScheme)return;const[i,n]=this.findNotebookDocumentAndCell(t);if(!(i===void 0||n===void 0))for(const o of this.registrations.values())o instanceof JK&&o.didCloseNotebookCellTextDocument(i,n)})}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=W7e(W7e(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){const t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(Ane.asDocumentSelector(t)))}initialize(e){const t=e.notebookDocumentSync;if(t===void 0)return;const i=t.id??qsi.generateUuid();this.register({id:i,registerOptions:t})}register(e){const t=new JK(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!==U1.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&xu.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 xu.workspace.notebookDocuments)for(const n of i.getCells())if(n.document.uri.toString()===t)return[i,n];return[void 0,void 0]}}Ile.NotebookDocumentSyncFeature=U1;U1.CellScheme="vscode-notebook-cell";var DD={};Object.defineProperty(DD,"__esModule",{value:!0});DD.SyncConfigurationFeature=DD.toJSONObject=DD.ConfigurationFeature=void 0;const cB=Xn,VV=ps,Qsi=kr,jsi=or,H7e=Mn;class Ysi{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(VV.ConfigurationRequest.type,(t,i)=>{let n=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,n):n(t)})}getConfiguration(e,t){let i=null;if(t){let n=t.lastIndexOf(".");if(n===-1)i=tL(cB.workspace.getConfiguration(void 0,e).get(t));else{let o=cB.workspace.getConfiguration(t.substr(0,n),e);o&&(i=tL(o.get(t.substr(n+1))))}}else{let n=cB.workspace.getConfiguration(void 0,e);i={};for(let o of Object.keys(n))n.has(o)&&(i[o]=tL(n.get(o)))}return i===void 0&&(i=null),i}clear(){}}DD.ConfigurationFeature=Ysi;function tL(s){if(s){if(Array.isArray(s))return s.map(tL);if(typeof s=="object"){const e=Object.create(null);for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=tL(s[t]));return e}}return s}DD.toJSONObject=tL;class Jsi{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 VV.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,H7e.ensure)((0,H7e.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:jsi.generateUuid(),registerOptions:{section:e}})}register(e){let t=cB.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(Qsi.string(e)?i=[e]:i=e,i!==void 0&&t!==void 0&&!i.some(a=>t.affectsConfiguration(a)))return;const n=async r=>r===void 0?this._client.sendNotification(VV.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(VV.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(r)});let o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(i,n):n(i)).catch(r=>{this._client.error(`Sending notification ${VV.DidChangeConfigurationNotification.type.method} failed`,r)})}extractSettingsInformation(e){function t(o,r){let a=o;for(let c=0;c=0?c=cB.workspace.getConfiguration(r.substr(0,a),i).get(r.substr(a+1)):c=cB.workspace.getConfiguration(void 0,i).get(r),c){let l=e[o].split(".");t(n,l)[l[l.length-1]]=tL(c)}}return n}}DD.SyncConfigurationFeature=Jsi;var $f={};Object.defineProperty($f,"__esModule",{value:!0});$f.DidSaveTextDocumentFeature=$f.WillSaveWaitUntilFeature=$f.WillSaveFeature=$f.DidChangeTextDocumentFeature=$f.DidCloseTextDocumentFeature=$f.DidOpenTextDocumentFeature=void 0;const jp=Xn,Da=ps,Oc=Mn,qU=or;class Xsi extends Oc.TextDocumentEventFeature{constructor(e,t){super(e,jp.workspace.onDidOpenTextDocument,Da.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,i=>e.code2ProtocolConverter.asOpenTextDocumentParams(i),i=>i,Oc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:qU.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return Da.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;const t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);jp.workspace.textDocuments.forEach(i=>{const n=i.uri.toString();if(!this._syncedDocuments.has(n)&&jp.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(n,i)}})}getTextDocument(e){return e}notificationSent(e,t,i){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,i)}}$f.DidOpenTextDocumentFeature=Xsi;class Zsi extends Oc.TextDocumentEventFeature{constructor(e,t,i){super(e,jp.workspace.onDidCloseTextDocument,Da.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,n=>e.code2ProtocolConverter.asCloseTextDocumentParams(n),n=>n,Oc.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t,this._pendingTextDocumentChanges=i}get registrationType(){return Da.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register({id:qU.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(n=>{if(jp.languages.match(t,n)>0&&!this._selectorFilter(i,n)&&!this._client.hasDedicatedTextSynchronizationFeature(n)){let o=this._client.middleware,r=a=>this._client.sendNotification(this._type,this._createParams(a));this._syncedDocuments.delete(n.uri.toString()),(o.didClose?o.didClose(n,r):r(n)).catch(a=>{this._client.error(`Sending document notification ${this._type.method} failed`,a)})}})}}$f.DidCloseTextDocumentFeature=Zsi;class eoi extends Oc.DynamicDocumentFeature{constructor(e,t){super(e),this._changeData=new Map,this._onNotificationSent=new jp.EventEmitter,this._onPendingChangeAdded=new jp.EventEmitter,this._pendingTextDocumentChanges=t,this._syncKind=Da.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return Da.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==Da.TextDocumentSyncKind.None&&this.register({id:qU.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=jp.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,n=[];for(const o of this._changeData.values())if(jp.languages.match(o.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){const r=this._client.middleware;if(o.syncKind===Da.TextDocumentSyncKind.Incremental){const a=async c=>{const l=this._client.code2ProtocolConverter.asChangeTextDocumentParams(c,t,i);await this._client.sendNotification(Da.DidChangeTextDocumentNotification.type,l),this.notificationSent(c.document,Da.DidChangeTextDocumentNotification.type,l)};n.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}else if(o.syncKind===Da.TextDocumentSyncKind.Full){const a=async c=>{const l=c.document.uri.toString();this._pendingTextDocumentChanges.set(l,c.document),this._onPendingChangeAdded.fire()};n.push(r.didChange?r.didChange(e,c=>a(c)):a(e))}}return Promise.all(n).then(void 0,o=>{throw this._client.error(`Sending document notification ${Da.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=Da.TextDocumentSyncKind.None;else{this._syncKind=Da.TextDocumentSyncKind.None;for(const t of this._changeData.values())if(this.updateSyncKind(t.syncKind),this._syncKind===Da.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=Da.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(jp.languages.match(t.documentSelector,e)>0)return{send:i=>this.callback(i)}}updateSyncKind(e){if(this._syncKind!==Da.TextDocumentSyncKind.Full)switch(e){case Da.TextDocumentSyncKind.Full:this._syncKind=e;break;case Da.TextDocumentSyncKind.Incremental:this._syncKind===Da.TextDocumentSyncKind.None&&(this._syncKind=Da.TextDocumentSyncKind.Incremental);break}}}$f.DidChangeTextDocumentFeature=eoi;class toi extends Oc.TextDocumentEventFeature{constructor(e){super(e,jp.workspace.onWillSaveTextDocument,Da.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,i)=>Oc.TextDocumentEventFeature.textDocumentFilter(t,i.document))}get registrationType(){return Da.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register({id:qU.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}}$f.WillSaveFeature=toi;class ioi extends Oc.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return Da.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register({id:qU.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||(this._listener=jp.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Oc.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,i=n=>this._client.sendRequest(Da.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(n)).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)}}$f.WillSaveWaitUntilFeature=ioi;class noi extends Oc.TextDocumentEventFeature{constructor(e){super(e,jp.workspace.onDidSaveTextDocument,Da.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Oc.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return Da.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Oc.ensure)((0,Oc.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){const i=e.resolvedTextDocumentSync;if(t&&i&&i.save){const n=typeof i.save=="boolean"?{includeText:!1}:{includeText:!!i.save.includeText};this.register({id:qU.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},n)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}$f.DidSaveTextDocumentFeature=noi;var Tle={};Object.defineProperty(Tle,"__esModule",{value:!0});Tle.CompletionItemFeature=void 0;const soi=Xn,xo=ps,age=Mn,ooi=or,roi=[xo.CompletionItemKind.Text,xo.CompletionItemKind.Method,xo.CompletionItemKind.Function,xo.CompletionItemKind.Constructor,xo.CompletionItemKind.Field,xo.CompletionItemKind.Variable,xo.CompletionItemKind.Class,xo.CompletionItemKind.Interface,xo.CompletionItemKind.Module,xo.CompletionItemKind.Property,xo.CompletionItemKind.Unit,xo.CompletionItemKind.Value,xo.CompletionItemKind.Enum,xo.CompletionItemKind.Keyword,xo.CompletionItemKind.Snippet,xo.CompletionItemKind.Color,xo.CompletionItemKind.File,xo.CompletionItemKind.Reference,xo.CompletionItemKind.Folder,xo.CompletionItemKind.EnumMember,xo.CompletionItemKind.Constant,xo.CompletionItemKind.Struct,xo.CompletionItemKind.Event,xo.CompletionItemKind.Operator,xo.CompletionItemKind.TypeParameter];class aoi extends age.TextDocumentLanguageFeature{constructor(e){super(e,xo.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,age.ensure)((0,age.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[xo.MarkupKind.Markdown,xo.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[xo.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[xo.InsertTextMode.asIs,xo.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=xo.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:roi},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]}}initialize(e,t){const i=this.getRegistrationOptions(t,e.completionProvider);i&&this.register({id:ooi.generateUuid(),registerOptions:i})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);const i=e.triggerCharacters??[],n=e.allCommitCharacters,o=e.documentSelector,r={provideCompletionItems:(a,c,l,d)=>{const h=this._client,u=this._client.middleware,f=(p,m,v,b)=>h.sendRequest(xo.CompletionRequest.type,h.code2ProtocolConverter.asCompletionParams(p,m,v),b).then(w=>b.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionResult(w,n,b),w=>h.handleFailedRequest(xo.CompletionRequest.type,b,w,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(xo.CompletionResolveRequest.type,l.code2ProtocolConverter.asCompletionItem(u,!!this.labelDetailsSupport.get(t)),f).then(p=>f.isCancellationRequested?null:l.protocol2CodeConverter.asCompletionItem(p),p=>l.handleFailedRequest(xo.CompletionResolveRequest.type,f,p,u));return d.resolveCompletionItem?d.resolveCompletionItem(a,c,h):h(a,c)}:void 0};return[soi.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),r,...i),r]}}Tle.CompletionItemFeature=aoi;var Lle={};Object.defineProperty(Lle,"__esModule",{value:!0});Lle.HoverFeature=void 0;const coi=Xn,F4=ps,cge=Mn,loi=or;class doi extends cge.TextDocumentLanguageFeature{constructor(e){super(e,F4.HoverRequest.type)}fillClientCapabilities(e){const t=(0,cge.ensure)((0,cge.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[F4.MarkupKind.Markdown,F4.MarkupKind.PlainText]}initialize(e,t){const i=this.getRegistrationOptions(t,e.hoverProvider);i&&this.register({id:loi.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideHover:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(F4.HoverRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asHover(f),f=>a.handleFailedRequest(F4.HoverRequest.type,u,f,null)),l=a.middleware;return l.provideHover?l.provideHover(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return coi.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Lle.HoverFeature=doi;var Rle={};Object.defineProperty(Rle,"__esModule",{value:!0});Rle.DefinitionFeature=void 0;const hoi=Xn,lge=ps,dge=Mn,uoi=or;class goi extends dge.TextDocumentLanguageFeature{constructor(e){super(e,lge.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,dge.ensure)((0,dge.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.definitionProvider);i&&this.register({id:uoi.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDefinition:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(lge.DefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(lge.DefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideDefinition?l.provideDefinition(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return hoi.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Rle.DefinitionFeature=goi;var Mle={};Object.defineProperty(Mle,"__esModule",{value:!0});Mle.SignatureHelpFeature=void 0;const U7e=Xn,O4=ps,hge=Mn,foi=or;class poi extends hge.TextDocumentLanguageFeature{constructor(e){super(e,O4.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,hge.ensure)((0,hge.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[O4.MarkupKind.Markdown,O4.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:foi.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t={provideSignatureHelp:(i,n,o,r)=>{const a=this._client,c=(d,h,u,f)=>a.sendRequest(O4.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(d,h,u),f).then(p=>f.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(p,f),p=>a.handleFailedRequest(O4.SignatureHelpRequest.type,f,p,null)),l=a.middleware;return l.provideSignatureHelp?l.provideSignatureHelp(i,n,r,o,c):c(i,n,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 n=e.triggerCharacters||[];return U7e.languages.registerSignatureHelpProvider(i,t,...n)}else{const n={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return U7e.languages.registerSignatureHelpProvider(i,t,n)}}}Mle.SignatureHelpFeature=poi;var Nle={};Object.defineProperty(Nle,"__esModule",{value:!0});Nle.DocumentHighlightFeature=void 0;const moi=Xn,uge=ps,gge=Mn,_oi=or;class voi extends gge.TextDocumentLanguageFeature{constructor(e){super(e,uge.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,gge.ensure)((0,gge.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentHighlightProvider);i&&this.register({id:_oi.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentHighlights:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(uge.DocumentHighlightRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentHighlights(f,u),f=>a.handleFailedRequest(uge.DocumentHighlightRequest.type,u,f,null)),l=a.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(n,o,r,c):c(n,o,r)}};return[moi.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Nle.DocumentHighlightFeature=voi;var WPe={};(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.DocumentSymbolFeature=s.SupportedSymbolTags=s.SupportedSymbolKinds=void 0;const e=Xn,t=ps,i=Mn,n=or;s.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],s.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:s.SupportedSymbolKinds},c.hierarchicalDocumentSymbolSupport=!0,c.tagSupport={valueSet:s.SupportedSymbolTags},c.labelSupport=!0}initialize(a,c){const l=this.getRegistrationOptions(c,a.documentSymbolProvider);l&&this.register({id:n.generateUuid(),registerOptions:l})}registerLanguageProvider(a){const c=a.documentSelector,l={provideDocumentSymbols:(h,u)=>{const f=this._client,p=async(v,b)=>{try{const w=await f.sendRequest(t.DocumentSymbolRequest.type,f.code2ProtocolConverter.asDocumentSymbolParams(v),b);if(b.isCancellationRequested||w===void 0||w===null)return null;if(w.length===0)return[];{const y=w[0];return t.DocumentSymbol.is(y)?await f.protocol2CodeConverter.asDocumentSymbols(w,b):await f.protocol2CodeConverter.asSymbolInformations(w,b)}}catch(w){return f.handleFailedRequest(t.DocumentSymbolRequest.type,b,w,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]}}s.DocumentSymbolFeature=o})(WPe);var Ple={};Object.defineProperty(Ple,"__esModule",{value:!0});Ple.WorkspaceSymbolFeature=void 0;const boi=Xn,B4=ps,fge=Mn,V7e=WPe,woi=or;class yoi extends fge.WorkspaceFeature{constructor(e){super(e,B4.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,fge.ensure)((0,fge.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:V7e.SupportedSymbolKinds},t.tagSupport={valueSet:V7e.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:woi.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(i,n)=>{const o=this._client,r=(c,l)=>o.sendRequest(B4.WorkspaceSymbolRequest.type,{query:c},l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformations(d,l),d=>o.handleFailedRequest(B4.WorkspaceSymbolRequest.type,l,d,null)),a=o.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,n,r):r(i,n)},resolveWorkspaceSymbol:e.resolveProvider===!0?(i,n)=>{const o=this._client,r=(c,l)=>o.sendRequest(B4.WorkspaceSymbolResolveRequest.type,o.code2ProtocolConverter.asWorkspaceSymbol(c),l).then(d=>l.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformation(d),d=>o.handleFailedRequest(B4.WorkspaceSymbolResolveRequest.type,l,d,null)),a=o.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(i,n,r):r(i,n)}:void 0};return[boi.languages.registerWorkspaceSymbolProvider(t),t]}}Ple.WorkspaceSymbolFeature=yoi;var Fle={};Object.defineProperty(Fle,"__esModule",{value:!0});Fle.ReferencesFeature=void 0;const Coi=Xn,pge=ps,mge=Mn,Soi=or;class Aoi extends mge.TextDocumentLanguageFeature{constructor(e){super(e,pge.ReferencesRequest.type)}fillClientCapabilities(e){(0,mge.ensure)((0,mge.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.referencesProvider);i&&this.register({id:Soi.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideReferences:(n,o,r,a)=>{const c=this._client,l=(h,u,f,p)=>c.sendRequest(pge.ReferencesRequest.type,c.code2ProtocolConverter.asReferenceParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asReferences(m,p),m=>c.handleFailedRequest(pge.ReferencesRequest.type,p,m,null)),d=c.middleware;return d.provideReferences?d.provideReferences(n,o,r,a,l):l(n,o,r,a)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Coi.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Fle.ReferencesFeature=Aoi;var Ole={};Object.defineProperty(Ole,"__esModule",{value:!0});Ole.CodeActionFeature=void 0;const Eoi=Xn,Sp=ps,xoi=or,_ge=Mn;class Doi extends _ge.TextDocumentLanguageFeature{constructor(e){super(e,Sp.CodeActionRequest.type)}fillClientCapabilities(e){const t=(0,_ge.ensure)((0,_ge.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Sp.CodeActionKind.Empty,Sp.CodeActionKind.QuickFix,Sp.CodeActionKind.Refactor,Sp.CodeActionKind.RefactorExtract,Sp.CodeActionKind.RefactorInline,Sp.CodeActionKind.RefactorRewrite,Sp.CodeActionKind.Source,Sp.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.codeActionProvider);i&&this.register({id:xoi.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideCodeActions:(n,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(Sp.CodeActionRequest.type,m,p).then(v=>p.isCancellationRequested||v===null||v===void 0?null:c.protocol2CodeConverter.asCodeActionResult(v,p),v=>c.handleFailedRequest(Sp.CodeActionRequest.type,p,v,null))},d=c.middleware;return d.provideCodeActions?d.provideCodeActions(n,o,r,a,l):l(n,o,r,a)},resolveCodeAction:e.resolveProvider?(n,o)=>{const r=this._client,a=this._client.middleware,c=async(l,d)=>r.sendRequest(Sp.CodeActionResolveRequest.type,r.code2ProtocolConverter.asCodeActionSync(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asCodeAction(h,d),h=>r.handleFailedRequest(Sp.CodeActionResolveRequest.type,d,h,l));return a.resolveCodeAction?a.resolveCodeAction(n,o,c):c(n,o)}:void 0};return[Eoi.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}Ole.CodeActionFeature=Doi;var Ble={};Object.defineProperty(Ble,"__esModule",{value:!0});Ble.CodeLensFeature=void 0;const z7e=Xn,SP=ps,koi=or,W4=Mn;class Ioi extends W4.TextDocumentLanguageFeature{constructor(e){super(e,SP.CodeLensRequest.type)}fillClientCapabilities(e){(0,W4.ensure)((0,W4.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,W4.ensure)((0,W4.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(SP.CodeLensRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeCodeLensEmitter.fire()});const n=this.getRegistrationOptions(t,e.codeLensProvider);n&&this.register({id:koi.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new z7e.EventEmitter,n={onDidChangeCodeLenses:i.event,provideCodeLenses:(o,r)=>{const a=this._client,c=(d,h)=>a.sendRequest(SP.CodeLensRequest.type,a.code2ProtocolConverter.asCodeLensParams(d),h).then(u=>h.isCancellationRequested?null:a.protocol2CodeConverter.asCodeLenses(u,h),u=>a.handleFailedRequest(SP.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(SP.CodeLensResolveRequest.type,a.code2ProtocolConverter.asCodeLens(d),h).then(u=>h.isCancellationRequested?d:a.protocol2CodeConverter.asCodeLens(u),u=>a.handleFailedRequest(SP.CodeLensResolveRequest.type,h,u,d)),l=a.middleware;return l.resolveCodeLens?l.resolveCodeLens(o,r,c):c(o,r)}:void 0};return[z7e.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeCodeLensEmitter:i}]}}Ble.CodeLensFeature=Ioi;var kD={};Object.defineProperty(kD,"__esModule",{value:!0});kD.DocumentOnTypeFormattingFeature=kD.DocumentRangeFormattingFeature=kD.DocumentFormattingFeature=void 0;const Wle=Xn,lb=ps,HPe=or,vA=Mn;var oU;(function(s){function e(t){const i=Wle.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:i.get("trimTrailingWhitespace"),trimFinalNewlines:i.get("trimFinalNewlines"),insertFinalNewline:i.get("insertFinalNewline")}}s.fromConfiguration=e})(oU||(oU={}));class Toi extends vA.TextDocumentLanguageFeature{constructor(e){super(e,lb.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,vA.ensure)((0,vA.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentFormattingProvider);i&&this.register({id:HPe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentFormattingEdits:(n,o,r)=>{const a=this._client,c=(d,h,u)=>{const f={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(d),options:a.code2ProtocolConverter.asFormattingOptions(h,oU.fromConfiguration(d))};return a.sendRequest(lb.DocumentFormattingRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asTextEdits(p,u),p=>a.handleFailedRequest(lb.DocumentFormattingRequest.type,u,p,null))},l=a.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(n,o,r,c):c(n,o,r)}};return[Wle.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}kD.DocumentFormattingFeature=Toi;class Loi extends vA.TextDocumentLanguageFeature{constructor(e){super(e,lb.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){const t=(0,vA.ensure)((0,vA.ensure)(e,"textDocument"),"rangeFormatting");t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);i&&this.register({id:HPe.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentRangeFormattingEdits:(n,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,oU.fromConfiguration(h))};return c.sendRequest(lb.DocumentRangeFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(lb.DocumentRangeFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangeFormattingEdits?d.provideDocumentRangeFormattingEdits(n,o,r,a,l):l(n,o,r,a)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(n,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,oU.fromConfiguration(h))};return c.sendRequest(lb.DocumentRangesFormattingRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(v,p),v=>c.handleFailedRequest(lb.DocumentRangesFormattingRequest.type,p,v,null))},d=c.middleware;return d.provideDocumentRangesFormattingEdits?d.provideDocumentRangesFormattingEdits(n,o,r,a,l):l(n,o,r,a)}),[Wle.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}kD.DocumentRangeFormattingFeature=Loi;class Roi extends vA.TextDocumentLanguageFeature{constructor(e){super(e,lb.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,vA.ensure)((0,vA.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);i&&this.register({id:HPe.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,b)=>{let w={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(f),position:d.code2ProtocolConverter.asPosition(p),ch:m,options:d.code2ProtocolConverter.asFormattingOptions(v,oU.fromConfiguration(f))};return d.sendRequest(lb.DocumentOnTypeFormattingRequest.type,w,b).then(y=>b.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(y,b),y=>d.handleFailedRequest(lb.DocumentOnTypeFormattingRequest.type,b,y,null))},u=d.middleware;return u.provideOnTypeFormattingEdits?u.provideOnTypeFormattingEdits(o,r,a,c,l,h):h(o,r,a,c,l)}},n=e.moreTriggerCharacter||[];return[Wle.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i,e.firstTriggerCharacter,...n),i]}}kD.DocumentOnTypeFormattingFeature=Roi;var Hle={};Object.defineProperty(Hle,"__esModule",{value:!0});Hle.RenameFeature=void 0;const Moi=Xn,KI=ps,Noi=or,$7e=kr,vge=Mn;class Poi extends vge.TextDocumentLanguageFeature{constructor(e){super(e,KI.RenameRequest.type)}fillClientCapabilities(e){let t=(0,vge.ensure)((0,vge.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=KI.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.renameProvider);i&&($7e.boolean(e.renameProvider)&&(i.prepareProvider=!1),this.register({id:Noi.generateUuid(),registerOptions:i}))}registerLanguageProvider(e){const t=e.documentSelector,i={provideRenameEdits:(n,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(KI.RenameRequest.type,m,p).then(v=>p.isCancellationRequested?null:c.protocol2CodeConverter.asWorkspaceEdit(v,p),v=>c.handleFailedRequest(KI.RenameRequest.type,p,v,null,!1))},d=c.middleware;return d.provideRenameEdits?d.provideRenameEdits(n,o,r,a,l):l(n,o,r,a)},prepareRename:e.prepareProvider?(n,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(KI.PrepareRenameRequest.type,f,u).then(p=>u.isCancellationRequested?null:KI.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&&KI.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(n,o,r,c):c(n,o,r)}:void 0};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Moi.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){const t=e;return t&&$7e.boolean(t.defaultBehavior)}}Hle.RenameFeature=Poi;var Ule={};Object.defineProperty(Ule,"__esModule",{value:!0});Ule.DocumentLinkFeature=void 0;const Foi=Xn,H4=ps,bge=Mn,Ooi=or;class Boi extends bge.TextDocumentLanguageFeature{constructor(e){super(e,H4.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=(0,bge.ensure)((0,bge.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.documentLinkProvider);i&&this.register({id:Ooi.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDocumentLinks:(n,o)=>{const r=this._client,a=(l,d)=>r.sendRequest(H4.DocumentLinkRequest.type,r.code2ProtocolConverter.asDocumentLinkParams(l),d).then(h=>d.isCancellationRequested?null:r.protocol2CodeConverter.asDocumentLinks(h,d),h=>r.handleFailedRequest(H4.DocumentLinkRequest.type,d,h,null)),c=r.middleware;return c.provideDocumentLinks?c.provideDocumentLinks(n,o,a):a(n,o)},resolveDocumentLink:e.resolveProvider?(n,o)=>{const r=this._client;let a=(l,d)=>r.sendRequest(H4.DocumentLinkResolveRequest.type,r.code2ProtocolConverter.asDocumentLink(l),d).then(h=>d.isCancellationRequested?l:r.protocol2CodeConverter.asDocumentLink(h),h=>r.handleFailedRequest(H4.DocumentLinkResolveRequest.type,d,h,l));const c=r.middleware;return c.resolveDocumentLink?c.resolveDocumentLink(n,o,a):a(n,o)}:void 0};return[Foi.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}Ule.DocumentLinkFeature=Boi;var Vle={};Object.defineProperty(Vle,"__esModule",{value:!0});Vle.ExecuteCommandFeature=void 0;const Woi=Xn,wge=ps,Hoi=or,G7e=Mn;class Uoi{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 wge.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,G7e.ensure)((0,G7e.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:Hoi.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){const t=this._client,i=t.middleware,n=(o,r)=>{let a={command:o,arguments:r};return t.sendRequest(wge.ExecuteCommandRequest.type,a).then(void 0,c=>t.handleFailedRequest(wge.ExecuteCommandRequest.type,void 0,c,void 0))};if(e.registerOptions.commands){const o=[];for(const r of e.registerOptions.commands)o.push(Woi.commands.registerCommand(r,(...a)=>i.executeCommand?i.executeCommand(r,a,n):n(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()}}Vle.ExecuteCommandFeature=Uoi;var zle={};Object.defineProperty(zle,"__esModule",{value:!0});zle.FileSystemWatcherFeature=void 0;const Voi=Xn,qI=ps,XK=Mn;class zoi{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 qI.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,XK.ensure)((0,XK.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,XK.ensure)((0,XK.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 n=this._client.protocol2CodeConverter.asGlobPattern(i.globPattern);if(n===void 0)continue;let o=!0,r=!0,a=!0;i.kind!==void 0&&i.kind!==null&&(o=(i.kind&qI.WatchKind.Create)!==0,r=(i.kind&qI.WatchKind.Change)!==0,a=(i.kind&qI.WatchKind.Delete)!==0);const c=Voi.workspace.createFileSystemWatcher(n,!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 n of t)this.hookListeners(n,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,n,o){t&&e.onDidCreate(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:qI.FileChangeType.Created}),null,o),i&&e.onDidChange(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:qI.FileChangeType.Changed}),null,o),n&&e.onDidDelete(r=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(r),type:qI.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()}}zle.FileSystemWatcherFeature=zoi;var $le={};Object.defineProperty($le,"__esModule",{value:!0});$le.ColorProviderFeature=void 0;const $oi=Xn,U4=ps,yge=Mn;class Goi extends yge.TextDocumentLanguageFeature{constructor(e){super(e,U4.DocumentColorRequest.type)}fillClientCapabilities(e){(0,yge.ensure)((0,yge.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.colorProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideColorPresentations:(n,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(U4.ColorPresentationRequest.type,f,u).then(p=>u.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(p,u),p=>a.handleFailedRequest(U4.ColorPresentationRequest.type,u,p,null))},l=a.middleware;return l.provideColorPresentations?l.provideColorPresentations(n,o,r,c):c(n,o,r)},provideDocumentColors:(n,o)=>{const r=this._client,a=(l,d)=>{const h={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(l)};return r.sendRequest(U4.DocumentColorRequest.type,h,d).then(u=>d.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(u,d),u=>r.handleFailedRequest(U4.DocumentColorRequest.type,d,u,null))},c=r.middleware;return c.provideDocumentColors?c.provideDocumentColors(n,o,a):a(n,o)}};return[$oi.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}$le.ColorProviderFeature=Goi;var Gle={};Object.defineProperty(Gle,"__esModule",{value:!0});Gle.ImplementationFeature=void 0;const Koi=Xn,Cge=ps,Sge=Mn;class qoi extends Sge.TextDocumentLanguageFeature{constructor(e){super(e,Cge.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Sge.ensure)((0,Sge.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.implementationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideImplementation:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Cge.ImplementationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Cge.ImplementationRequest.type,u,f,null)),l=a.middleware;return l.provideImplementation?l.provideImplementation(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Koi.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Gle.ImplementationFeature=qoi;var Kle={};Object.defineProperty(Kle,"__esModule",{value:!0});Kle.TypeDefinitionFeature=void 0;const Qoi=Xn,Age=ps,V4=Mn;class joi extends V4.TextDocumentLanguageFeature{constructor(e){super(e,Age.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,V4.ensure)((0,V4.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,V4.ensure)((0,V4.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.typeDefinitionProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideTypeDefinition:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Age.TypeDefinitionRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDefinitionResult(f,u),f=>a.handleFailedRequest(Age.TypeDefinitionRequest.type,u,f,null)),l=a.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Qoi.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Kle.TypeDefinitionFeature=joi;var rU={};Object.defineProperty(rU,"__esModule",{value:!0});rU.WorkspaceFoldersFeature=rU.arrayDiff=void 0;const Yoi=or,ZK=Xn,z4=ps;function Ege(s,e){if(s!=null)return s[e]}function _1e(s,e){return s.filter(t=>e.indexOf(t)<0)}rU.arrayDiff=_1e;class Joi{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 z4.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){const t=ZK.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(z4.WorkspaceFoldersRequest.type,o=>{const r=()=>{const c=ZK.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=Ege(Ege(Ege(e,"workspace"),"workspaceFolders"),"changeNotifications");let n;typeof i=="string"?n=i:i===!0&&(n=Yoi.generateUuid()),n&&this.register({id:n,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){const i=_1e(this._initialFolders,e),n=_1e(e,this._initialFolders);(n.length>0||i.length>0)&&(t=this.doSendEvent(n,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 ${z4.DidChangeWorkspaceFoldersNotification.type.method} failed`,i)})}doSendEvent(e,t){let i={event:{added:e.map(n=>this.asProtocol(n)),removed:t.map(n=>this.asProtocol(n))}};return this._client.sendNotification(z4.DidChangeWorkspaceFoldersNotification.type,i)}register(e){let t=e.id,i=this._client,n=ZK.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 ${z4.DidChangeWorkspaceFoldersNotification.type.method} failed`,l)})});this._listeners.set(t,n),this.sendInitialEvent(ZK.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}}}rU.WorkspaceFoldersFeature=Joi;var qle={};Object.defineProperty(qle,"__esModule",{value:!0});qle.FoldingRangeFeature=void 0;const K7e=Xn,QI=ps,$4=Mn;class Xoi extends $4.TextDocumentLanguageFeature{constructor(e){super(e,QI.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,$4.ensure)((0,$4.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[QI.FoldingRangeKind.Comment,QI.FoldingRangeKind.Imports,QI.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,$4.ensure)((0,$4.ensure)(e,"workspace"),"foldingRange").refreshSupport=!0}initialize(e,t){this._client.onRequest(QI.FoldingRangeRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeFoldingRange.fire()});let[i,n]=this.getRegistration(t,e.foldingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new K7e.EventEmitter,n={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(QI.FoldingRangeRequest.type,p,f).then(m=>f.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(m,f),m=>c.handleFailedRequest(QI.FoldingRangeRequest.type,f,m,null))},d=c.middleware;return d.provideFoldingRanges?d.provideFoldingRanges(o,r,a,l):l(o,r,a)}};return[K7e.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),{provider:n,onDidChangeFoldingRange:i}]}}qle.FoldingRangeFeature=Xoi;var Qle={};Object.defineProperty(Qle,"__esModule",{value:!0});Qle.DeclarationFeature=void 0;const Zoi=Xn,xge=ps,Dge=Mn;class eri extends Dge.TextDocumentLanguageFeature{constructor(e){super(e,xge.DeclarationRequest.type)}fillClientCapabilities(e){const t=(0,Dge.ensure)((0,Dge.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.declarationProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideDeclaration:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(xge.DeclarationRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asDeclarationResult(f,u),f=>a.handleFailedRequest(xge.DeclarationRequest.type,u,f,null)),l=a.middleware;return l.provideDeclaration?l.provideDeclaration(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return Zoi.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Qle.DeclarationFeature=eri;var jle={};Object.defineProperty(jle,"__esModule",{value:!0});jle.SelectionRangeFeature=void 0;const tri=Xn,kge=ps,Ige=Mn;class iri extends Ige.TextDocumentLanguageFeature{constructor(e){super(e,kge.SelectionRangeRequest.type)}fillClientCapabilities(e){const t=(0,Ige.ensure)((0,Ige.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.selectionRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideSelectionRanges:(n,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(kge.SelectionRangeRequest.type,f,u).then(p=>u.isCancellationRequested?null:a.protocol2CodeConverter.asSelectionRanges(p,u),p=>a.handleFailedRequest(kge.SelectionRangeRequest.type,u,p,null))},l=a.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return tri.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}jle.SelectionRangeFeature=iri;var Yle={};Object.defineProperty(Yle,"__esModule",{value:!0});Yle.ProgressFeature=void 0;const q7e=ps,nri=fG;function sri(s,e){return s[e]===void 0&&(s[e]=Object.create(null)),s[e]}class ori{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:q7e.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){sri(e,"window").workDoneProgress=!0}initialize(){const e=this._client,t=n=>{this.activeParts.delete(n)},i=n=>{this.activeParts.add(new nri.ProgressPart(this._client,n.token,t))};e.onRequest(q7e.WorkDoneProgressCreateRequest.type,i)}clear(){for(const e of this.activeParts)e.done();this.activeParts.clear()}}Yle.ProgressFeature=ori;var Jle={};Object.defineProperty(Jle,"__esModule",{value:!0});Jle.CallHierarchyFeature=void 0;const rri=Xn,D0=ps,Tge=Mn;class ari{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,i){const n=this.client,o=this.middleware,r=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(D0.CallHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyItems(h,l),h=>n.handleFailedRequest(D0.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,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(D0.CallHierarchyIncomingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyIncomingCalls(l,a),l=>i.handleFailedRequest(D0.CallHierarchyIncomingCallsRequest.type,a,l,null))};return n.provideCallHierarchyIncomingCalls?n.provideCallHierarchyIncomingCalls(e,t,o):o(e,t)}provideCallHierarchyOutgoingCalls(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asCallHierarchyItem(r)};return i.sendRequest(D0.CallHierarchyOutgoingCallsRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyOutgoingCalls(l,a),l=>i.handleFailedRequest(D0.CallHierarchyOutgoingCallsRequest.type,a,l,null))};return n.provideCallHierarchyOutgoingCalls?n.provideCallHierarchyOutgoingCalls(e,t,o):o(e,t)}}class cri extends Tge.TextDocumentLanguageFeature{constructor(e){super(e,D0.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=e,i=(0,Tge.ensure)((0,Tge.ensure)(t,"textDocument"),"callHierarchy");i.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.callHierarchyProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=this._client,i=new ari(t);return[rri.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}Jle.CallHierarchyFeature=cri;var Xle={};Object.defineProperty(Xle,"__esModule",{value:!0});Xle.SemanticTokensFeature=void 0;const eq=Xn,Ss=ps,G4=Mn,lri=kr;class dri extends G4.TextDocumentLanguageFeature{constructor(e){super(e,Ss.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){const t=(0,G4.ensure)((0,G4.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[Ss.SemanticTokenTypes.namespace,Ss.SemanticTokenTypes.type,Ss.SemanticTokenTypes.class,Ss.SemanticTokenTypes.enum,Ss.SemanticTokenTypes.interface,Ss.SemanticTokenTypes.struct,Ss.SemanticTokenTypes.typeParameter,Ss.SemanticTokenTypes.parameter,Ss.SemanticTokenTypes.variable,Ss.SemanticTokenTypes.property,Ss.SemanticTokenTypes.enumMember,Ss.SemanticTokenTypes.event,Ss.SemanticTokenTypes.function,Ss.SemanticTokenTypes.method,Ss.SemanticTokenTypes.macro,Ss.SemanticTokenTypes.keyword,Ss.SemanticTokenTypes.modifier,Ss.SemanticTokenTypes.comment,Ss.SemanticTokenTypes.string,Ss.SemanticTokenTypes.number,Ss.SemanticTokenTypes.regexp,Ss.SemanticTokenTypes.operator,Ss.SemanticTokenTypes.decorator],t.tokenModifiers=[Ss.SemanticTokenModifiers.declaration,Ss.SemanticTokenModifiers.definition,Ss.SemanticTokenModifiers.readonly,Ss.SemanticTokenModifiers.static,Ss.SemanticTokenModifiers.deprecated,Ss.SemanticTokenModifiers.abstract,Ss.SemanticTokenModifiers.async,Ss.SemanticTokenModifiers.modification,Ss.SemanticTokenModifiers.documentation,Ss.SemanticTokenModifiers.defaultLibrary],t.formats=[Ss.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,G4.ensure)((0,G4.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Ss.SemanticTokensRefreshRequest.type,async()=>{for(const r of this.getAllProviders())r.onDidChangeSemanticTokensEmitter.fire()});const[n,o]=this.getRegistration(t,e.semanticTokensProvider);!n||!o||this.register({id:n,registerOptions:o})}registerLanguageProvider(e){const t=e.documentSelector,i=lri.boolean(e.full)?e.full:e.full!==void 0,n=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,o=new eq.EventEmitter,r=i?{onDidChangeSemanticTokens:o.event,provideDocumentSemanticTokens:(f,p)=>{const m=this._client,v=m.middleware,b=(w,y)=>{const C={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(w)};return m.sendRequest(Ss.SemanticTokensRequest.type,C,y).then(A=>y.isCancellationRequested?null:m.protocol2CodeConverter.asSemanticTokens(A,y),A=>m.handleFailedRequest(Ss.SemanticTokensRequest.type,y,A,null))};return v.provideDocumentSemanticTokens?v.provideDocumentSemanticTokens(f,p,b):b(f,p)},provideDocumentSemanticTokensEdits:n?(f,p,m)=>{const v=this._client,b=v.middleware,w=(y,C,A)=>{const L={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(y),previousResultId:C};return v.sendRequest(Ss.SemanticTokensDeltaRequest.type,L,A).then(async k=>A.isCancellationRequested?null:Ss.SemanticTokens.is(k)?await v.protocol2CodeConverter.asSemanticTokens(k,A):await v.protocol2CodeConverter.asSemanticTokensEdits(k,A),k=>v.handleFailedRequest(Ss.SemanticTokensDeltaRequest.type,A,k,null))};return b.provideDocumentSemanticTokensEdits?b.provideDocumentSemanticTokensEdits(f,p,m,w):w(f,p,m)}:void 0}:void 0,c=e.range===!0?{provideDocumentRangeSemanticTokens:(f,p,m)=>{const v=this._client,b=v.middleware,w=(y,C,A)=>{const L={textDocument:v.code2ProtocolConverter.asTextDocumentIdentifier(y),range:v.code2ProtocolConverter.asRange(C)};return v.sendRequest(Ss.SemanticTokensRangeRequest.type,L,A).then(k=>A.isCancellationRequested?null:v.protocol2CodeConverter.asSemanticTokens(k,A),k=>v.handleFailedRequest(Ss.SemanticTokensRangeRequest.type,A,k,null))};return b.provideDocumentRangeSemanticTokens?b.provideDocumentRangeSemanticTokens(f,p,m,w):w(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(eq.languages.registerDocumentSemanticTokensProvider(u,r,h)),c!==void 0&&l.push(eq.languages.registerDocumentRangeSemanticTokensProvider(u,c,h)),[new eq.Disposable(()=>l.forEach(f=>f.dispose())),{range:c,full:r,onDidChangeSemanticTokensEmitter:o}]}}Xle.SemanticTokensFeature=dri;var Gf={};Object.defineProperty(Gf,"__esModule",{value:!0});Gf.WillDeleteFilesFeature=Gf.WillRenameFilesFeature=Gf.WillCreateFilesFeature=Gf.DidDeleteFilesFeature=Gf.DidRenameFilesFeature=Gf.DidCreateFilesFeature=void 0;const x_=Xn,hri=_le,bA=ps,uri=or;function Q7e(s,e){return s[e]===void 0&&(s[e]={}),s[e]}function gri(s,e){return s[e]}function j7e(s,e,t){s[e]=t}class iL{constructor(e,t,i,n,o){this._client=e,this._event=t,this._registrationType=i,this._clientCapability=n,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=Q7e(Q7e(e,"workspace"),"fileOperations");j7e(t,"dynamicRegistration",!0),j7e(t,this._clientCapability,!0)}initialize(e){const t=e.workspace?.fileOperations,i=t!==void 0?gri(t,this._serverCapability):void 0;if(i?.filters!==void 0)try{this.register({id:uri.generateUuid(),registerOptions:{filters:i.filters}})}catch(n){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${n}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));const t=e.registerOptions.filters.map(i=>{const n=new hri.Minimatch(i.pattern.glob,iL.asMinimatchOptions(i.pattern.options));if(!n.makeRe())throw new Error(`Invalid pattern ${i.pattern.glob}!`);return{scheme:i.scheme,matcher:n,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 iL.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===x_.FileType.File&&l.kind===bA.FileOperationPatternKind.file||d===x_.FileType.Directory&&l.kind===bA.FileOperationPatternKind.folder)return!0}else if(l.kind===bA.FileOperationPatternKind.folder&&await iL.getFileType(r)===x_.FileType.Directory&&l.matcher.match(`${a}/`))return!0}return!1})),n=e.files.filter((o,r)=>i[r]);return{...e,files:n}}static async getFileType(e){try{return(await x_.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){const t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}}class Bot extends iL{constructor(e,t,i,n,o,r,a){super(e,t,i,n,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 n=>this._client.sendNotification(this._notificationType,this._createParams(n));return this.doSend(t,i)}}}class Wot extends Bot{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 iL.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 fri extends Bot{constructor(e){super(e,x_.workspace.onDidCreateFiles,bA.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)}}Gf.DidCreateFilesFeature=fri;class pri extends Wot{constructor(e){super(e,x_.workspace.onDidRenameFiles,bA.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=x_.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)}}Gf.DidRenameFilesFeature=pri;class mri extends Wot{constructor(e){super(e,x_.workspace.onDidDeleteFiles,bA.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=x_.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)}}Gf.DidDeleteFilesFeature=mri;class UPe extends iL{constructor(e,t,i,n,o,r,a){super(e,t,i,n,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=n=>this._client.sendRequest(this._requestType,this._createParams(n),n.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,i)}else return}}class _ri extends UPe{constructor(e){super(e,x_.workspace.onWillCreateFiles,bA.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)}}Gf.WillCreateFilesFeature=_ri;class vri extends UPe{constructor(e){super(e,x_.workspace.onWillRenameFiles,bA.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)}}Gf.WillRenameFilesFeature=vri;class bri extends UPe{constructor(e){super(e,x_.workspace.onWillDeleteFiles,bA.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)}}Gf.WillDeleteFilesFeature=bri;var Zle={};Object.defineProperty(Zle,"__esModule",{value:!0});Zle.LinkedEditingFeature=void 0;const wri=Xn,Lge=ps,Rge=Mn;class yri extends Rge.TextDocumentLanguageFeature{constructor(e){super(e,Lge.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){const t=(0,Rge.ensure)((0,Rge.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.linkedEditingRangeProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i={provideLinkedEditingRanges:(n,o,r)=>{const a=this._client,c=(d,h,u)=>a.sendRequest(Lge.LinkedEditingRangeRequest.type,a.code2ProtocolConverter.asTextDocumentPositionParams(d,h),u).then(f=>u.isCancellationRequested?null:a.protocol2CodeConverter.asLinkedEditingRanges(f,u),f=>a.handleFailedRequest(Lge.LinkedEditingRangeRequest.type,u,f,null)),l=a.middleware;return l.provideLinkedEditingRange?l.provideLinkedEditingRange(n,o,r,c):c(n,o,r)}};return[this.registerProvider(t,i),i]}registerProvider(e,t){return wri.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}Zle.LinkedEditingFeature=yri;var ede={};Object.defineProperty(ede,"__esModule",{value:!0});ede.TypeHierarchyFeature=void 0;const Cri=Xn,k0=ps,Mge=Mn;class Sri{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,i){const n=this.client,o=this.middleware,r=(a,c,l)=>{const d=n.code2ProtocolConverter.asTextDocumentPositionParams(a,c);return n.sendRequest(k0.TypeHierarchyPrepareRequest.type,d,l).then(h=>l.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(h,l),h=>n.handleFailedRequest(k0.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,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(k0.TypeHierarchySupertypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(k0.TypeHierarchySupertypesRequest.type,a,l,null))};return n.provideTypeHierarchySupertypes?n.provideTypeHierarchySupertypes(e,t,o):o(e,t)}provideTypeHierarchySubtypes(e,t){const i=this.client,n=this.middleware,o=(r,a)=>{const c={item:i.code2ProtocolConverter.asTypeHierarchyItem(r)};return i.sendRequest(k0.TypeHierarchySubtypesRequest.type,c,a).then(l=>a.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(l,a),l=>i.handleFailedRequest(k0.TypeHierarchySubtypesRequest.type,a,l,null))};return n.provideTypeHierarchySubtypes?n.provideTypeHierarchySubtypes(e,t,o):o(e,t)}}class Ari extends Mge.TextDocumentLanguageFeature{constructor(e){super(e,k0.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){const t=(0,Mge.ensure)((0,Mge.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){const[i,n]=this.getRegistration(t,e.typeHierarchyProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=this._client,i=new Sri(t);return[Cri.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),i),i]}}ede.TypeHierarchyFeature=Ari;var tde={};Object.defineProperty(tde,"__esModule",{value:!0});tde.InlineValueFeature=void 0;const Y7e=Xn,tq=ps,K4=Mn;class Eri extends K4.TextDocumentLanguageFeature{constructor(e){super(e,tq.InlineValueRequest.type)}fillClientCapabilities(e){(0,K4.ensure)((0,K4.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,K4.ensure)((0,K4.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(tq.InlineValueRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlineValues.fire()});const[i,n]=this.getRegistration(t,e.inlineValueProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new Y7e.EventEmitter,n={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(tq.InlineValueRequest.type,v,m).then(b=>m.isCancellationRequested?null:l.protocol2CodeConverter.asInlineValues(b,m),b=>l.handleFailedRequest(tq.InlineValueRequest.type,m,b,null))},h=l.middleware;return h.provideInlineValues?h.provideInlineValues(o,r,a,c,d):d(o,r,a,c)}};return[this.registerProvider(t,n),{provider:n,onDidChangeInlineValues:i}]}registerProvider(e,t){return Y7e.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}tde.InlineValueFeature=Eri;var ide={};Object.defineProperty(ide,"__esModule",{value:!0});ide.InlayHintsFeature=void 0;const J7e=Xn,AP=ps,q4=Mn;class xri extends q4.TextDocumentLanguageFeature{constructor(e){super(e,AP.InlayHintRequest.type)}fillClientCapabilities(e){const t=(0,q4.ensure)((0,q4.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,q4.ensure)((0,q4.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(AP.InlayHintRefreshRequest.type,async()=>{for(const o of this.getAllProviders())o.onDidChangeInlayHints.fire()});const[i,n]=this.getRegistration(t,e.inlayHintProvider);!i||!n||this.register({id:i,registerOptions:n})}registerLanguageProvider(e){const t=e.documentSelector,i=new J7e.EventEmitter,n={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(AP.InlayHintRequest.type,p,f);return f.isCancellationRequested?null:c.protocol2CodeConverter.asInlayHints(m,f)}catch(m){return c.handleFailedRequest(AP.InlayHintRequest.type,f,m,null)}},d=c.middleware;return d.provideInlayHints?d.provideInlayHints(o,r,a,l):l(o,r,a)}};return n.resolveInlayHint=e.resolveProvider===!0?(o,r)=>{const a=this._client,c=async(d,h)=>{try{const u=await a.sendRequest(AP.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(AP.InlayHintResolveRequest.type,h,u,null)}},l=a.middleware;return l.resolveInlayHint?l.resolveInlayHint(o,r,c):c(o,r)}:void 0,[this.registerProvider(t,n),{provider:n,onDidChangeInlayHints:i}]}registerProvider(e,t){return J7e.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}}ide.InlayHintsFeature=xri;var nde={};Object.defineProperty(nde,"__esModule",{value:!0});nde.InlineCompletionItemFeature=void 0;const Dri=Xn,Nge=ps,Pge=Mn,kri=or;class Iri extends Pge.TextDocumentLanguageFeature{constructor(e){super(e,Nge.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,Pge.ensure)((0,Pge.ensure)(e,"textDocument"),"inlineCompletion");t.dynamicRegistration=!0}initialize(e,t){const i=this.getRegistrationOptions(t,e.inlineCompletionProvider);i&&this.register({id:kri.generateUuid(),registerOptions:i})}registerLanguageProvider(e){const t=e.documentSelector,i={provideInlineCompletionItems:(n,o,r,a)=>{const c=this._client,l=this._client.middleware,d=(h,u,f,p)=>c.sendRequest(Nge.InlineCompletionRequest.type,c.code2ProtocolConverter.asInlineCompletionParams(h,u,f),p).then(m=>p.isCancellationRequested?null:c.protocol2CodeConverter.asInlineCompletionResult(m,p),m=>c.handleFailedRequest(Nge.InlineCompletionRequest.type,p,m,null));return l.provideInlineCompletionItems?l.provideInlineCompletionItems(n,o,r,a,d):d(n,o,r,a)}};return[Dri.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),i),i]}}nde.InlineCompletionItemFeature=Iri;Object.defineProperty(mh,"__esModule",{value:!0});mh.ProposedFeatures=Hot=mh.BaseLanguageClient=mh.MessageTransports=mh.SuspendMode=mh.State=mh.CloseAction=mh.ErrorAction=mh.RevealOutputChannelOn=void 0;const Wr=Xn,It=ps,Tri=ble,Lri=kle,Lv=kr,iq=bh,X7e=or,Rri=fG,uv=Mn,Mri=_A,Z7e=Ile,e6e=DD,EP=$f,Nri=Tle,Pri=Lle,Fri=Rle,Ori=Mle,Bri=Nle,Wri=WPe,Hri=Ple,Uri=Fle,Vri=Ole,zri=Ble,Fge=kD,$ri=Hle,Gri=Ule,Kri=Vle,qri=zle,Qri=$le,jri=Gle,Yri=Kle,Jri=rU,Xri=qle,Zri=Qle,eai=jle,tai=Yle,iai=Jle,nai=Xle,xP=Gf,sai=Zle,oai=ede,rai=tde,aai=ide,cai=nde;var s1;(function(s){s[s.Debug=0]="Debug",s[s.Info=1]="Info",s[s.Warn=2]="Warn",s[s.Error=3]="Error",s[s.Never=4]="Never"})(s1||(mh.RevealOutputChannelOn=s1={}));var l7;(function(s){s[s.Continue=1]="Continue",s[s.Shutdown=2]="Shutdown"})(l7||(mh.ErrorAction=l7={}));var ID;(function(s){s[s.DoNotRestart=1]="DoNotRestart",s[s.Restart=2]="Restart"})(ID||(mh.CloseAction=ID={}));var kz;(function(s){s[s.Stopped=1]="Stopped",s[s.Starting=3]="Starting",s[s.Running=2]="Running"})(kz||(mh.State=kz={}));var t6e;(function(s){s.off="off",s.on="on"})(t6e||(mh.SuspendMode=t6e={}));var v1e;(function(s){function e(t){return t==null?!1:typeof t=="boolean"||typeof t=="object"&&t!==null&&Lv.stringArray(t.enabledCommands)?t:!1}s.sanitizeIsTrusted=e})(v1e||(v1e={}));class lai{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,i){return i&&i<=3?{action:l7.Continue}:{action:l7.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:ID.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:ID.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:ID.Restart})}}var no;(function(s){s.Initial="initial",s.Starting="starting",s.StartFailed="startFailed",s.Running="running",s.Stopping="stopping",s.Stopped="stopped"})(no||(no={}));var i6e;(function(s){function e(t){return t&&It.MessageReader.is(t.reader)&&It.MessageWriter.is(t.writer)}s.is=e})(i6e||(mh.MessageTransports=i6e={}));class nL{constructor(e,t,i){this._traceFormat=It.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new iq.Semaphore(1),this._id=e,this._name=t,i=i||{};const n={isTrusted:!1,supportHtml:!1};i.markdown!==void 0&&(n.isTrusted=v1e.sanitizeIsTrusted(i.markdown.isTrusted),n.supportHtml=i.markdown.supportHtml===!0),this._clientOptions={documentSelector:i.documentSelector??[],synchronize:i.synchronize??{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName??this._name,revealOutputChannelOn:i.revealOutputChannelOn??s1.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:n,diagnosticPullOptions:i.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:i.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=no.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 iq.Semaphore(1),this._pendingChangeDelayer=new iq.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new iq.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new It.Emitter,this._stateChangeEmitter=new It.Emitter,this._trace=It.Trace.Off,this._tracer={log:(o,r)=>{Lv.string(o)?this.logTrace(o,r):this.logObjectTrace(o)}},this._c2p=Tri.createConverter(i.uriConverters?i.uriConverters.code2Protocol:void 0),this._p2c=Lri.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=Wr.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 no.Starting:return kz.Starting;case no.Running:return kz.Running;default:return kz.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));const i=await this.$start();this._didChangeTextDocumentFeature.syncKind===It.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(i);const n=this._clientOptions.middleware?.sendRequest;if(n!==void 0){let o,r;return t.length===1?It.CancellationToken.is(t[0])?r=t[0]:o=t[0]:t.length===2&&(o=t[0],r=t[1]),n(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 n=this.activeConnection();let o;return n!==void 0?(this._requestDisposables.set(i,n.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===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));const i=this._didChangeTextDocumentFeature.syncKind===It.TextDocumentSyncKind.Full;let n;i&&typeof e!="string"&&e.method===It.DidOpenTextDocumentNotification.method&&(n=t?.textDocument.uri,this._pendingOpenNotifications.add(n));const o=await this.$start();i&&await this.sendPendingFullTextDocumentChanges(o),n!==void 0&&this._pendingOpenNotifications.delete(n);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 n=this.activeConnection();let o;return n!==void 0?(this._notificationDisposables.set(i,n.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===no.StartFailed||this.$state===no.Stopping||this.$state===no.Stopped)return Promise.reject(new It.ResponseError(It.ErrorCodes.ConnectionInactive,"Client is not running"));try{return(await this.$start()).sendProgress(e,t,i)}catch(n){throw this.error(`Sending progress for token ${t} failed.`,n),n}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});const n=this.activeConnection();let o;const r=this._clientOptions.middleware?.handleWorkDoneProgress,a=It.WorkDoneProgress.is(e)&&r!==void 0?c=>{r(t,c,()=>i(c))}:i;return n!==void 0?(this._progressDisposables.set(t,n.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 lai(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 It.ResponseError){const t=e;return` Message: ${t.message} Code: ${t.code} ${t.data?` -`+t.data.toString():""}`}return e instanceof Error?Nv.string(e.stack)?e.stack:e.message:Nv.string(e)?e:e.toString()}debug(e,t,i=!0){this.logOutputMessage(It.MessageType.Debug,c1.Debug,"Debug",e,t,i)}info(e,t,i=!0){this.logOutputMessage(It.MessageType.Info,c1.Info,"Info",e,t,i)}warn(e,t,i=!0){this.logOutputMessage(It.MessageType.Warning,c1.Warn,"Warn",e,t,i)}error(e,t,i=!0){this.logOutputMessage(It.MessageType.Error,c1.Error,"Error",e,t,i)}logOutputMessage(e,t,i,n,o,r){this.outputChannel.appendLine(`[${i.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${n}`),o!=null&&this.outputChannel.appendLine(this.data2String(o)),(r==="force"||r&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,n)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===It.MessageType.Error?Wr.window.showErrorMessage:e===It.MessageType.Warning?Wr.window.showWarningMessage:Wr.window.showInformationMessage)(t,"Go to output").then(n=>{n!==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===no.Initial||this.$state===no.Stopping||this.$state===no.Stopped}needsStop(){return this.$state===no.Starting||this.$state===no.Running}activeConnection(){return this.$state===no.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===no.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===no.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?Wr.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Wr.languages.createDiagnosticCollection());for(const[n,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(n)||this._pendingNotificationHandlers.set(n,o);for(const[n,o]of this._requestHandlers)this._pendingRequestHandlers.has(n)||this._pendingRequestHandlers.set(n,o);for(const[n,o]of this._progressHandlers)this._pendingProgressHandlers.has(n)||this._pendingProgressHandlers.set(n,o);this.$state=no.Starting;try{const n=await this.createConnection();n.onNotification(It.LogMessageNotification.type,o=>{switch(o.type){case It.MessageType.Error:this.error(o.message,void 0,!1);break;case It.MessageType.Warning:this.warn(o.message,void 0,!1);break;case It.MessageType.Info:this.info(o.message,void 0,!1);break;case It.MessageType.Debug:this.debug(o.message,void 0,!1);break;default:this.outputChannel.appendLine(o.message)}}),n.onNotification(It.ShowMessageNotification.type,o=>{switch(o.type){case It.MessageType.Error:Wr.window.showErrorMessage(o.message);break;case It.MessageType.Warning:Wr.window.showWarningMessage(o.message);break;case It.MessageType.Info:Wr.window.showInformationMessage(o.message);break;default:Wr.window.showInformationMessage(o.message)}}),n.onRequest(It.ShowMessageRequest.type,o=>{let r;switch(o.type){case It.MessageType.Error:r=Wr.window.showErrorMessage;break;case It.MessageType.Warning:r=Wr.window.showWarningMessage;break;case It.MessageType.Info:r=Wr.window.showInformationMessage;break;default:r=Wr.window.showInformationMessage}let a=o.actions||[];return r(o.message,...a)}),n.onNotification(It.TelemetryEventNotification.type,o=>{this._telemetryEmitter.fire(o)}),n.onRequest(It.ShowDocumentRequest.type,async o=>{const r=async c=>{const l=this.protocol2CodeConverter.asUri(c.uri);try{if(c.external===!0)return{success:await Wr.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 Wr.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)}),n.listen(),await this.initialize(n),t()}catch(n){this.$state=no.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,n,"force"),i(n)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((n,o)=>{e=n,t=o}),e,t]}async initialize(e){this.refreshTrace(e,!1);const t=this._clientOptions.initializationOptions,[i,n]=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:Wr.env.appName,version:Wr.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(Wr.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Nv.func(t)?t():t,trace:It.Trace.toString(this._trace),workspaceFolders:n};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){const r=r6e.generateUuid(),a=new Mai.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!==It.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${i.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=i,this.$state=no.Running;let n;Nv.number(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===It.TextDocumentSyncKind.None?n={openClose:!1,change:It.TextDocumentSyncKind.None,save:void 0}:n={openClose:!0,change:i.capabilities.textDocumentSync,save:{includeText:!1}}:i.capabilities.textDocumentSync!==void 0&&i.capabilities.textDocumentSync!==null&&(n=i.capabilities.textDocumentSync),this._capabilities=Object.assign({},i.capabilities,{resolvedTextDocumentSync:n}),e.onNotification(It.PublishDiagnosticsNotification.type,o=>this.handleDiagnostics(o)),e.onRequest(It.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(It.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(It.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(It.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 It.ResponseError&&i.data&&i.data.retry?Wr.window.showErrorMessage(i.message,{title:"Retry",id:"retry"}).then(n=>{n&&n.id==="retry"?this.initialize(e):this.stop()}):(i&&i.message&&Wr.window.showErrorMessage(i.message),this.error("Server initialization failed.",i),this.stop()),i}}_clientGetRootPath(){let e=Wr.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===no.Stopped||this.$state===no.Initial)return;if(this.$state===no.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!==no.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=no.Stopping,this.cleanUp(e);const n=new Promise(r=>{(0,It.RAL)().timer.setTimeout(r,t)}),o=(async r=>(await r.shutdown(),await r.exit(),r))(i);return this._onStop=Promise.race([n,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=no.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(n=>n[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(It.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}const n=this.clientOptions.middleware?.workspace;(n?.didChangeWatchedFile?n.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 n=this.code2ProtocolConverter.asChangeTextDocumentParams(i);await e.sendNotification(It.DidChangeTextDocumentNotification.type,n),this._didChangeTextDocumentFeature.notificationSent(i,It.DidChangeTextDocumentNotification.type,n)}}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,It.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 n=new Wr.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:n},this._p2c.asDiagnostics(i,n.token).then(o=>{if(!n.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 Wr.env.language}async $start(){if(this.$state===no.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=(n,o,r)=>{this.handleConnectionError(n,o,r).catch(a=>this.error("Handling connection error failed",a))},t=()=>{this.handleConnectionClosed().catch(n=>this.error("Handling connection close failed",n))};const i=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=uci(i.reader,i.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===no.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:ND.DoNotRestart};if(this.$state!==no.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===ND.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===no.Starting?this.$state=no.StartFailed:this.$state=no.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===ND.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=no.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 n=await this._clientOptions.errorHandler.error(e,t,i);n.action===g7.Shutdown?(this.error(n.message??`Client ${this._name}: connection to server is erroring. +`+t.data.toString():""}`}return e instanceof Error?Lv.string(e.stack)?e.stack:e.message:Lv.string(e)?e:e.toString()}debug(e,t,i=!0){this.logOutputMessage(It.MessageType.Debug,s1.Debug,"Debug",e,t,i)}info(e,t,i=!0){this.logOutputMessage(It.MessageType.Info,s1.Info,"Info",e,t,i)}warn(e,t,i=!0){this.logOutputMessage(It.MessageType.Warning,s1.Warn,"Warn",e,t,i)}error(e,t,i=!0){this.logOutputMessage(It.MessageType.Error,s1.Error,"Error",e,t,i)}logOutputMessage(e,t,i,n,o,r){this.outputChannel.appendLine(`[${i.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${n}`),o!=null&&this.outputChannel.appendLine(this.data2String(o)),(r==="force"||r&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,n)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===It.MessageType.Error?Wr.window.showErrorMessage:e===It.MessageType.Warning?Wr.window.showWarningMessage:Wr.window.showInformationMessage)(t,"Go to output").then(n=>{n!==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===no.Initial||this.$state===no.Stopping||this.$state===no.Stopped}needsStop(){return this.$state===no.Starting||this.$state===no.Running}activeConnection(){return this.$state===no.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===no.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===no.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?Wr.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Wr.languages.createDiagnosticCollection());for(const[n,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(n)||this._pendingNotificationHandlers.set(n,o);for(const[n,o]of this._requestHandlers)this._pendingRequestHandlers.has(n)||this._pendingRequestHandlers.set(n,o);for(const[n,o]of this._progressHandlers)this._pendingProgressHandlers.has(n)||this._pendingProgressHandlers.set(n,o);this.$state=no.Starting;try{const n=await this.createConnection();n.onNotification(It.LogMessageNotification.type,o=>{switch(o.type){case It.MessageType.Error:this.error(o.message,void 0,!1);break;case It.MessageType.Warning:this.warn(o.message,void 0,!1);break;case It.MessageType.Info:this.info(o.message,void 0,!1);break;case It.MessageType.Debug:this.debug(o.message,void 0,!1);break;default:this.outputChannel.appendLine(o.message)}}),n.onNotification(It.ShowMessageNotification.type,o=>{switch(o.type){case It.MessageType.Error:Wr.window.showErrorMessage(o.message);break;case It.MessageType.Warning:Wr.window.showWarningMessage(o.message);break;case It.MessageType.Info:Wr.window.showInformationMessage(o.message);break;default:Wr.window.showInformationMessage(o.message)}}),n.onRequest(It.ShowMessageRequest.type,o=>{let r;switch(o.type){case It.MessageType.Error:r=Wr.window.showErrorMessage;break;case It.MessageType.Warning:r=Wr.window.showWarningMessage;break;case It.MessageType.Info:r=Wr.window.showInformationMessage;break;default:r=Wr.window.showInformationMessage}let a=o.actions||[];return r(o.message,...a)}),n.onNotification(It.TelemetryEventNotification.type,o=>{this._telemetryEmitter.fire(o)}),n.onRequest(It.ShowDocumentRequest.type,async o=>{const r=async c=>{const l=this.protocol2CodeConverter.asUri(c.uri);try{if(c.external===!0)return{success:await Wr.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 Wr.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)}),n.listen(),await this.initialize(n),t()}catch(n){this.$state=no.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,n,"force"),i(n)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((n,o)=>{e=n,t=o}),e,t]}async initialize(e){this.refreshTrace(e,!1);const t=this._clientOptions.initializationOptions,[i,n]=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:Wr.env.appName,version:Wr.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(Wr.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Lv.func(t)?t():t,trace:It.Trace.toString(this._trace),workspaceFolders:n};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){const r=X7e.generateUuid(),a=new Rri.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!==It.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${i.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=i,this.$state=no.Running;let n;Lv.number(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===It.TextDocumentSyncKind.None?n={openClose:!1,change:It.TextDocumentSyncKind.None,save:void 0}:n={openClose:!0,change:i.capabilities.textDocumentSync,save:{includeText:!1}}:i.capabilities.textDocumentSync!==void 0&&i.capabilities.textDocumentSync!==null&&(n=i.capabilities.textDocumentSync),this._capabilities=Object.assign({},i.capabilities,{resolvedTextDocumentSync:n}),e.onNotification(It.PublishDiagnosticsNotification.type,o=>this.handleDiagnostics(o)),e.onRequest(It.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(It.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(It.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(It.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 It.ResponseError&&i.data&&i.data.retry?Wr.window.showErrorMessage(i.message,{title:"Retry",id:"retry"}).then(n=>{n&&n.id==="retry"?this.initialize(e):this.stop()}):(i&&i.message&&Wr.window.showErrorMessage(i.message),this.error("Server initialization failed.",i),this.stop()),i}}_clientGetRootPath(){let e=Wr.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===no.Stopped||this.$state===no.Initial)return;if(this.$state===no.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!==no.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=no.Stopping,this.cleanUp(e);const n=new Promise(r=>{(0,It.RAL)().timer.setTimeout(r,t)}),o=(async r=>(await r.shutdown(),await r.exit(),r))(i);return this._onStop=Promise.race([n,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=no.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(n=>n[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(It.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}const n=this.clientOptions.middleware?.workspace;(n?.didChangeWatchedFile?n.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 n=this.code2ProtocolConverter.asChangeTextDocumentParams(i);await e.sendNotification(It.DidChangeTextDocumentNotification.type,n),this._didChangeTextDocumentFeature.notificationSent(i,It.DidChangeTextDocumentNotification.type,n)}}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,It.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 n=new Wr.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:n},this._p2c.asDiagnostics(i,n.token).then(o=>{if(!n.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 Wr.env.language}async $start(){if(this.$state===no.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=(n,o,r)=>{this.handleConnectionError(n,o,r).catch(a=>this.error("Handling connection error failed",a))},t=()=>{this.handleConnectionClosed().catch(n=>this.error("Handling connection close failed",n))};const i=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=hai(i.reader,i.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===no.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:ID.DoNotRestart};if(this.$state!==no.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===ID.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===no.Starting?this.$state=no.StartFailed:this.$state=no.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===ID.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=no.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 n=await this._clientOptions.errorHandler.error(e,t,i);n.action===l7.Shutdown?(this.error(n.message??`Client ${this._name}: connection to server is erroring. ${e.message} Shutting down server.`,void 0,n.handled===!0?!1:"force"),this.stop().catch(o=>{this.error("Stopping server failed",o,!1)})):this.error(n.message??`Client ${this._name}: connection to server is erroring. -${e.message}`,void 0,n.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Wr.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=Wr.workspace.getConfiguration(this._id);let n=It.Trace.Off,o=It.TraceFormat.Text;if(i){const r=i.get("trace.server","off");typeof r=="string"?n=It.Trace.fromString(r):(n=It.Trace.fromString(i.get("trace.server.verbosity","off")),o=It.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=n,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;Nv.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(It.DidChangeWatchedFilesNotification.type.method).registerRaw(r6e.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),pv.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(It.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof a6e.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new c6e.ConfigurationFeature(this)),this.registerFeature(new kP.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new kP.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new kP.WillSaveFeature(this)),this.registerFeature(new kP.WillSaveWaitUntilFeature(this)),this.registerFeature(new kP.DidSaveTextDocumentFeature(this)),this.registerFeature(new kP.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new Qai.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new Pai.CompletionItemFeature(this)),this.registerFeature(new Fai.HoverFeature(this)),this.registerFeature(new Bai.SignatureHelpFeature(this)),this.registerFeature(new Oai.DefinitionFeature(this)),this.registerFeature(new Vai.ReferencesFeature(this)),this.registerFeature(new Wai.DocumentHighlightFeature(this)),this.registerFeature(new Hai.DocumentSymbolFeature(this)),this.registerFeature(new Uai.WorkspaceSymbolFeature(this)),this.registerFeature(new zai.CodeActionFeature(this)),this.registerFeature(new $ai.CodeLensFeature(this)),this.registerFeature(new Vge.DocumentFormattingFeature(this)),this.registerFeature(new Vge.DocumentRangeFormattingFeature(this)),this.registerFeature(new Vge.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new Gai.RenameFeature(this)),this.registerFeature(new Kai.DocumentLinkFeature(this)),this.registerFeature(new qai.ExecuteCommandFeature(this)),this.registerFeature(new c6e.SyncConfigurationFeature(this)),this.registerFeature(new Jai.TypeDefinitionFeature(this)),this.registerFeature(new Yai.ImplementationFeature(this)),this.registerFeature(new jai.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Xai.WorkspaceFoldersFeature(this)),this.registerFeature(new Zai.FoldingRangeFeature(this)),this.registerFeature(new eci.DeclarationFeature(this)),this.registerFeature(new tci.SelectionRangeFeature(this)),this.registerFeature(new ici.ProgressFeature(this)),this.registerFeature(new nci.CallHierarchyFeature(this)),this.registerFeature(new sci.SemanticTokensFeature(this)),this.registerFeature(new oci.LinkedEditingFeature(this)),this.registerFeature(new IP.DidCreateFilesFeature(this)),this.registerFeature(new IP.DidRenameFilesFeature(this)),this.registerFeature(new IP.DidDeleteFilesFeature(this)),this.registerFeature(new IP.WillCreateFilesFeature(this)),this.registerFeature(new IP.WillRenameFilesFeature(this)),this.registerFeature(new IP.WillDeleteFilesFeature(this)),this.registerFeature(new rci.TypeHierarchyFeature(this)),this.registerFeature(new aci.InlineValueFeature(this)),this.registerFeature(new cci.InlayHintsFeature(this)),this.registerFeature(new Nai.DiagnosticFeature(this)),this.registerFeature(new a6e.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(L1e.createAll(this))}fillInitializeParams(e){for(let t of this._features)Nv.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,pv.ensure)(e,"workspace").applyEdit=!0;const t=(0,pv.ensure)((0,pv.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[It.ResourceOperationKind.Create,It.ResourceOperationKind.Rename,It.ResourceOperationKind.Delete],t.failureHandling=It.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,pv.ensure)((0,pv.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[It.DiagnosticTag.Unnecessary,It.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const n=(0,pv.ensure)(e,"window"),o=(0,pv.ensure)(n,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};const r=(0,pv.ensure)(n,"showDocument");r.support=!0;const a=(0,pv.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(aL.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)Nv.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 n=t.registerOptions??{};n.documentSelector=n.documentSelector??this._clientOptions.documentSelector;const o={id:t.id,registerOptions:n};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)),n=new Map;Wr.workspace.textDocuments.forEach(r=>n.set(r.uri.toString(),r));let o=!1;if(t.documentChanges){for(const r of t.documentChanges)if(It.TextDocumentEdit.is(r)&&r.textDocument.version&&r.textDocument.version>=0){const a=this._p2c.asUri(r.textDocument.uri).toString(),c=n.get(a);if(c&&c.version!==r.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):Nv.asPromise(Wr.workspace.applyEdit(i).then(r=>({applied:r})))}handleFailedRequest(e,t,i,n,o=!0){if(i instanceof It.ResponseError){if(i.code===It.ErrorCodes.PendingResponseRejected||i.code===It.ErrorCodes.ConnectionInactive)return n;if(i.code===It.LSPErrorCodes.RequestCancelled||i.code===It.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return n;throw i.data!==void 0?new pv.LSPCancellationError(i.data):new Wr.CancellationError}else if(i.code===It.LSPErrorCodes.ContentModified){if(aL.RequestsToCancelOnContentModified.has(e.method)||aL.CancellableResolveCalls.has(e.method))throw new Wr.CancellationError;return n}}throw this.error(`Request ${e.method} failed.`,i,o),i}}var Jot=vh.BaseLanguageClient=aL;aL.RequestsToCancelOnContentModified=new Set([It.SemanticTokensRequest.method,It.SemanticTokensRangeRequest.method,It.SemanticTokensDeltaRequest.method]);aL.CancellableResolveCalls=new Set([It.CompletionResolveRequest.method,It.CodeLensResolveRequest.method,It.CodeActionResolveRequest.method,It.InlayHintResolveRequest.method,It.DocumentLinkResolveRequest.method,It.WorkspaceSymbolResolveRequest.method]);class hci{error(e){(0,It.RAL)().console.error(e)}warn(e){(0,It.RAL)().console.warn(e)}info(e){(0,It.RAL)().console.info(e)}log(e){(0,It.RAL)().console.log(e)}}function uci(s,e,t,i,n){const o=new hci,r=(0,It.createProtocolConnection)(s,e,o,n);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:It.TraceFormat.Text};return d===void 0?r.trace(c,l,h):(Nv.boolean(d),r.trace(c,l,d))},initialize:c=>r.sendRequest(It.InitializeRequest.type,c),shutdown:()=>r.sendRequest(It.ShutdownRequest.type,void 0),exit:()=>r.sendNotification(It.ExitNotification.type),end:()=>r.end(),dispose:()=>r.dispose()}}var L1e;(function(s){function e(t){return[new lci.InlineCompletionItemFeature(t)]}s.createAll=e})(L1e||(vh.ProposedFeatures=L1e={}));(function(s){var e=rd&&rd.__createBinding||(Object.create?function(n,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(n,a,c)}:function(n,o,r,a){a===void 0&&(a=r),n[a]=o[r]}),t=rd&&rd.__exportStar||function(n,o){for(var r in n)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&e(o,n,r)};Object.defineProperty(s,"__esModule",{value:!0}),s.DiagnosticPullMode=s.vsdiag=void 0,t(ps,s),t(Mn,s);var i=bA;Object.defineProperty(s,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(s,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(vh,s)})(u0e);var Tne=ps;(function(s){var e=rd&&rd.__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=rd&&rd.__exportStar||function(r,a){for(var c in r)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,r,c)};Object.defineProperty(s,"__esModule",{value:!0}),s.LanguageClient=void 0;const i=u0e,n=Tne;t(Tne,s),t(u0e,s);class o extends i.BaseLanguageClient{constructor(a,c,l,d){super(a,c,l),this.worker=d}createMessageTransports(a){const c=new n.BrowserMessageReader(this.worker),l=new n.BrowserMessageWriter(this.worker);return Promise.resolve({reader:c,writer:l})}}s.LanguageClient=o})(h0e);class gci extends Jot{connectionProvider;constructor({id:e,name:t,clientOptions:i,connectionProvider:n}){super(e??t.toLowerCase(),t,i),this.connectionProvider=n}createMessageTransports(e){return this.connectionProvider.get(e)}}let Vt;const bS=new Array(128).fill(void 0);bS.push(void 0,null,!0,!1);function q(s){return bS[s]}let Rz=bS.length;function fci(s){s<132||(bS[s]=Rz,Rz=s)}function qp(s){const e=q(s);return fci(s),e}let da=0,KV=null;function mj(){return(KV===null||KV.byteLength===0)&&(KV=new Uint8Array(Vt.memory.buffer)),KV}const _j=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},pci=typeof _j.encodeInto=="function"?function(s,e){return _j.encodeInto(s,e)}:function(s,e){const t=_j.encode(s);return e.set(t),{read:s.length,written:t.length}};function Va(s,e,t){if(t===void 0){const a=_j.encode(s),c=e(a.length,1)>>>0;return mj().subarray(c,c+a.length).set(a),da=a.length,c}let i=s.length,n=e(i,1)>>>0;const o=mj();let r=0;for(;r127)break;o[n+r]=a}if(r!==i){r!==0&&(s=s.slice(r)),n=t(n,i,i=r+s.length*3,1)>>>0;const a=mj().subarray(n+r,n+i),c=pci(s,a);r+=c.written,n=t(n,i,r,1)>>>0}return da=r,n}function Ts(s){return s==null}let M0=null;function Ti(){return(M0===null||M0.buffer.detached===!0||M0.buffer.detached===void 0&&M0.buffer!==Vt.memory.buffer)&&(M0=new DataView(Vt.memory.buffer)),M0}function Je(s){Rz===bS.length&&bS.push(bS.length+1);const e=Rz;return Rz=bS[e],bS[e]=s,e}const Xot=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Xot.decode();function Ks(s,e){return s=s>>>0,Xot.decode(mj().subarray(s,s+e))}function R1e(s){const e=typeof s;if(e=="number"||e=="boolean"||s==null)return`${s}`;if(e=="string")return`"${s}"`;if(e=="symbol"){const n=s.description;return n==null?"Symbol":`Symbol(${n})`}if(e=="function"){const n=s.name;return typeof n=="string"&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(s)){const n=s.length;let o="[";n>0&&(o+=R1e(s[0]));for(let r=1;r1)i=t[1];else return toString.call(s);if(i=="Object")try{return"Object("+JSON.stringify(s)+")"}catch{return"Object"}return s instanceof Error?`${s.name}: ${s.message} -${s.stack}`:i}const Lne=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{Vt.__wbindgen_export_2.get(s.dtor)(s.a,s.b)});function Y4(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},o=(...r)=>{n.cnt++;try{return i(n.a,n.b,...r)}finally{--n.cnt===0&&(Vt.__wbindgen_export_2.get(n.dtor)(n.a,n.b),n.a=0,Lne.unregister(n))}};return o.original=n,Lne.register(o,n,n),o}function J4(s,e,t){Vt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h064a8f7c292bc49f(s,e,Je(t))}function mv(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},o=(...r)=>{n.cnt++;const a=n.a;n.a=0;try{return i(a,n.b,...r)}finally{--n.cnt===0?(Vt.__wbindgen_export_2.get(n.dtor)(a,n.b),Lne.unregister(n)):n.a=a}};return o.original=n,Lne.register(o,n,n),o}function h6e(s,e){Vt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h982fa4f9af5f0d41(s,e)}function vE(s,e,t){Vt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1b2bf3251affd4b0(s,e,Je(t))}function u6e(s,e,t,i){Vt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9e6364c3f89b0ca1(s,e,Je(t),Je(i))}function Xi(s,e){try{return s.apply(this,e)}catch(t){Vt.__wbindgen_exn_store(Je(t))}}function mci(){try{const t=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.run_event_loop(t);var s=Ti().getInt32(t+4*0,!0),e=Ti().getInt32(t+4*1,!0);if(e)throw qp(s)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}let qV=null;function _ci(){return(qV===null||qV.byteLength===0)&&(qV=new Float32Array(Vt.memory.buffer)),qV}function oq(s,e){return s=s>>>0,_ci().subarray(s/4,s/4+e)}const g6e=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>Vt.__wbg_previewconnector_free(s>>>0,1));class hde{static __wrap(e){e=e>>>0;const t=Object.create(hde.prototype);return t.__wbg_ptr=e,g6e.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,g6e.unregister(this),e}free(){const e=this.__destroy_into_raw();Vt.__wbg_previewconnector_free(e,0)}static create(e,t,i,n){try{const c=Vt.__wbindgen_add_to_stack_pointer(-16),l=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),d=da;Vt.previewconnector_create(c,Je(e),Je(t),l,d,n);var o=Ti().getInt32(c+4*0,!0),r=Ti().getInt32(c+4*1,!0),a=Ti().getInt32(c+4*2,!0);if(a)throw qp(r);return qp(o)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=Vt.previewconnector_current_style(this.__wbg_ptr);return qp(e)}show_ui(){try{const n=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.previewconnector_show_ui(n,this.__wbg_ptr);var e=Ti().getInt32(n+4*0,!0),t=Ti().getInt32(n+4*1,!0),i=Ti().getInt32(n+4*2,!0);if(i)throw qp(t);return qp(e)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const n=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.previewconnector_process_lsp_to_preview_message(n,this.__wbg_ptr,Je(e));var t=Ti().getInt32(n+4*0,!0),i=Ti().getInt32(n+4*1,!0);if(i)throw qp(t)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(s=>Vt.__wbg_slintserver_free(s>>>0,1));async function vci(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(i){if(s.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 s.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function bci(){const s={};return s.wbg={},s.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Je(e)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=q(t).stack,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,n;try{i=e,n=t,console.error(Ks(e,t))}finally{Vt.__wbindgen_free(i,n,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){qp(e)},s.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=q(e).createProgram();return Ts(t)?0:Je(t)},s.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=q(e).createProgram();return Ts(t)?0:Je(t)},s.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,i){q(e).attachShader(q(t),q(i))},s.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,i){q(e).attachShader(q(t),q(i))},s.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,i,n,o){q(e).bindAttribLocation(q(t),i>>>0,Ks(n,o))},s.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,n,o){q(e).bindAttribLocation(q(t),i>>>0,Ks(n,o))},s.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){q(e).linkProgram(q(t))},s.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){q(e).linkProgram(q(t))},s.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,i){const n=q(e).getProgramParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const n=q(e).getProgramParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbindgen_boolean_get=function(e){const t=q(e);return typeof t=="boolean"?t?1:0:2},s.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,i){q(e).detachShader(q(t),q(i))},s.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,i){q(e).detachShader(q(t),q(i))},s.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,i){const n=q(t).getProgramInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const n=q(t).getProgramInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=q(e).createShader(t>>>0);return Ts(i)?0:Je(i)},s.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=q(e).createShader(t>>>0);return Ts(i)?0:Je(i)},s.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,n){q(e).shaderSource(q(t),Ks(i,n))},s.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,n){q(e).shaderSource(q(t),Ks(i,n))},s.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){q(e).compileShader(q(t))},s.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){q(e).compileShader(q(t))},s.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,i){const n=q(e).getShaderParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const n=q(e).getShaderParameter(q(t),i>>>0);return Je(n)},s.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const n=q(t).getShaderInfoLog(q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,n){q(e).uniform2fv(q(t),oq(i,n))},s.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,n){q(e).uniform2fv(q(t),oq(i,n))},s.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){q(e).deleteFramebuffer(q(t))},s.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){q(e).deleteFramebuffer(q(t))},s.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){q(e).deleteRenderbuffer(q(t))},s.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){q(e).deleteRenderbuffer(q(t))},s.wbg.__wbg_width_ac5901de11cd9abc=function(e){return q(e).width},s.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return q(e).height},s.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=q(e).createTexture();return Ts(t)?0:Je(t)},s.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=q(e).createTexture();return Ts(t)?0:Je(t)},s.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return Je(e)},s.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){q(e).stencil=t!==0},s.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){q(e).antialias=t!==0},s.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return Xi(function(e,t,i,n){const o=q(e).getContext(Ks(t,i),q(n));return Ts(o)?0:Je(o)},arguments)},s.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=q(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},s.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=q(e).getSupportedExtensions();return Ts(t)?0:Je(t)},s.wbg.__wbg_length_ae22078168b726f5=function(e){return q(e).length},s.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const i=q(e)[t>>>0];return Je(i)},s.wbg.__wbindgen_string_get=function(e,t){const i=q(t),n=typeof i=="string"?i:void 0;var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getParameter_cfaed180705b9280=function(){return Xi(function(e,t){const i=q(e).getParameter(t>>>0);return Je(i)},arguments)},s.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=q(e).createVertexArrayOES();return Ts(t)?0:Je(t)},s.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=q(e).createVertexArray();return Ts(t)?0:Je(t)},s.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=q(e).createBuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=q(e).createBuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return q(e).getError()},s.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return q(e).getError()},s.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=q(e).createFramebuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=q(e).createFramebuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,n,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(o),r)},s.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,n,o,r){q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,q(o),r)},s.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=q(e).createRenderbuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=q(e).createRenderbuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,n,o){q(e).renderbufferStorage(t>>>0,i>>>0,n,o)},s.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,n,o){q(e).renderbufferStorage(t>>>0,i>>>0,n,o)},s.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,n,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(o))},s.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,n,o){q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,q(o))},s.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},s.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return q(e).checkFramebufferStatus(t>>>0)},s.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,i,n,o){q(e).scissor(t,i,n,o)},s.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,n,o){q(e).scissor(t,i,n,o)},s.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,n,o){q(e).clearColor(t,i,n,o)},s.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,n,o){q(e).clearColor(t,i,n,o)},s.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){q(e).clear(t>>>0)},s.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){q(e).clear(t>>>0)},s.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,i,n){q(e).uniform4fv(q(t),oq(i,n))},s.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,n){q(e).uniform4fv(q(t),oq(i,n))},s.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){q(e).deleteTexture(q(t))},s.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){q(e).deleteTexture(q(t))},s.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){q(e).deleteShader(q(t))},s.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){q(e).deleteShader(q(t))},s.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){q(e).deleteProgram(q(t))},s.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){q(e).deleteProgram(q(t))},s.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){q(e).useProgram(q(t))},s.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){q(e).useProgram(q(t))},s.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},s.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,i){q(e).bindBuffer(t>>>0,q(i))},s.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},s.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,i){q(e).bindFramebuffer(t>>>0,q(i))},s.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},s.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,i){q(e).bindRenderbuffer(t>>>0,q(i))},s.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){q(e).bindVertexArray(q(t))},s.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){q(e).bindVertexArrayOES(q(t))},s.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,i){q(e).pixelStorei(t>>>0,i)},s.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,i){q(e).pixelStorei(t>>>0,i)},s.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){q(e).disable(t>>>0)},s.wbg.__wbg_disable_8908871f2334e76b=function(e,t){q(e).disable(t>>>0)},s.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){q(e).disableVertexAttribArray(t>>>0)},s.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){q(e).disableVertexAttribArray(t>>>0)},s.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,i,n){q(e).drawArrays(t>>>0,i,n)},s.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,i,n){q(e).drawArrays(t>>>0,i,n)},s.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){q(e).enable(t>>>0)},s.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){q(e).enable(t>>>0)},s.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){q(e).enableVertexAttribArray(t>>>0)},s.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){q(e).enableVertexAttribArray(t>>>0)},s.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,i,n){const o=q(e).getUniformLocation(q(t),Ks(i,n));return Ts(o)?0:Je(o)},s.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,n){const o=q(e).getUniformLocation(q(t),Ks(i,n));return Ts(o)?0:Je(o)},s.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){q(e).generateMipmap(t>>>0)},s.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){q(e).generateMipmap(t>>>0)},s.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,i){q(e).uniform1i(q(t),i)},s.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,i){q(e).uniform1i(q(t),i)},s.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,i,n,o){q(e).colorMask(t!==0,i!==0,n!==0,o!==0)},s.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,n,o){q(e).colorMask(t!==0,i!==0,n!==0,o!==0)},s.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},s.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,i){q(e).bindTexture(t>>>0,q(i))},s.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){q(e).activeTexture(t>>>0)},s.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){q(e).activeTexture(t>>>0)},s.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,i,n){q(e).texParameteri(t>>>0,i>>>0,n)},s.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,i,n){q(e).texParameteri(t>>>0,i>>>0,n)},s.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,q(d))},arguments)},s.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,d)},arguments)},s.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,n,o,r,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,o!==0,r,a)},s.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,n,o,r,a){q(e).vertexAttribPointer(t>>>0,i,n>>>0,o!==0,r,a)},s.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,n,o){q(e).viewport(t,i,n,o)},s.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,n,o){q(e).viewport(t,i,n,o)},s.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,i,n){q(e).stencilFunc(t>>>0,i,n>>>0)},s.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,i,n){q(e).stencilFunc(t>>>0,i,n>>>0)},s.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){q(e).stencilMask(t>>>0)},s.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){q(e).stencilMask(t>>>0)},s.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,i,n){q(e).stencilOp(t>>>0,i>>>0,n>>>0)},s.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,i,n){q(e).stencilOp(t>>>0,i>>>0,n>>>0)},s.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,i,n,o){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,n,o){q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return q(e).devicePixelRatio},s.wbg.__wbg_document_8554450897a855b9=function(e){const t=q(e).document;return Ts(t)?0:Je(t)},s.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const n=q(e).getElementById(Ks(t,i));return Ts(n)?0:Je(n)},s.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=q(e)instanceof HTMLCanvasElement}catch{t=!1}return t},s.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){q(e).width=t>>>0},s.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){q(e).height=t>>>0},s.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return q(e).clientWidth},s.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return q(e).clientHeight},s.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=q(e).dataset;return Je(t)},s.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,n){const o=q(t)[Ks(i,n)];var r=Ts(o)?0:Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},s.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=q(e)instanceof HTMLInputElement}catch{t=!1}return t},s.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=q(e).style;return Je(t)},s.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return q(e).offsetLeft},s.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return q(e).offsetTop},s.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return q(e).offsetWidth},s.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return q(e).offsetHeight},s.wbg.__wbg_before_ac3792b457802cbf=function(){return Xi(function(e,t){q(e).before(q(t))},arguments)},s.wbg.__wbindgen_object_clone_ref=function(e){const t=q(e);return Je(t)},s.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){q(e).value=Ks(t,i)},s.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=q(t).data;var n=Ts(i)?0:Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return q(e).isComposing},s.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const i=q(t).inputType,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){q(e).preventDefault()},s.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return q(e).isComposing},s.wbg.__wbg_key_a626396efbca2b95=function(e,t){const i=q(t).key,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return q(e).shiftKey},s.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return q(e).ctrlKey},s.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return q(e).altKey},s.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,i){return q(e).getModifierState(Ks(t,i))},s.wbg.__wbg_repeat_8451a79b3608855b=function(e){return q(e).repeat},s.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=q(e).clipboardData;return Ts(t)?0:Je(t)},s.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return Xi(function(e,t,i,n){const o=q(t).getData(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=q(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},s.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,i){q(e).font=Ks(t,i)},s.wbg.__wbindgen_string_new=function(e,t){const i=Ks(e,t);return Je(i)},s.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){q(e).fillStyle=q(t)},s.wbg.__wbg_id_8071f78aa2301217=function(e,t){const i=q(t).id,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return q(e).naturalWidth},s.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return q(e).naturalHeight},s.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const i=q(t).currentSrc,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new0_65387337a95cf44d=function(){return Je(new Date)},s.wbg.__wbg_getTime_91058879093a1589=function(e){return q(e).getTime()},s.wbg.__wbindgen_number_new=function(e){return Je(e)},s.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(q(e));return Je(t)},s.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return q(e).getTimezoneOffset()},s.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=q(t).src,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_0d5e77f348d88b87=function(){return Xi(function(){const e=new Image;return Je(e)},arguments)},s.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){q(e).crossOrigin=t===0?void 0:Ks(t,i)},s.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){q(e).onload=q(t)},s.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,i){q(e).src=Ks(t,i)},s.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(Ks(e,t))},s.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){q(e).cullFace(t>>>0)},s.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){q(e).cullFace(t>>>0)},s.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){q(e).frontFace(t>>>0)},s.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){q(e).frontFace(t>>>0)},s.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,i,n){q(e).bufferData(t>>>0,q(i),n>>>0)},s.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,i,n){q(e).bufferData(t>>>0,q(i),n>>>0)},s.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,i,n,o){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,n,o){q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).readPixels(t,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).readPixels(t,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){q(e).width=t>>>0},s.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){q(e).height=t>>>0},s.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){q(e).deleteVertexArray(q(t))},s.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){q(e).deleteVertexArrayOES(q(t))},s.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){q(e).deleteBuffer(q(t))},s.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){q(e).deleteBuffer(q(t))},s.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).texSubImage2D(t>>>0,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return Xi(function(e,t,i,n,o,r,a,c){q(e).texSubImage2D(t>>>0,i,n,o,r>>>0,a>>>0,q(c))},arguments)},s.wbg.__wbg_next_f9cb570345655b9a=function(){return Xi(function(e){const t=q(e).next();return Je(t)},arguments)},s.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return q(e).done},s.wbg.__wbg_value_6d39332ab4788d86=function(e){const t=q(e).value;return Je(t)},s.wbg.__wbg_iterator_888179a48810a9fe=function(){return Je(Symbol.iterator)},s.wbg.__wbg_get_224d16597dbbfd96=function(){return Xi(function(e,t){const i=Reflect.get(q(e),q(t));return Je(i)},arguments)},s.wbg.__wbindgen_is_function=function(e){return typeof q(e)=="function"},s.wbg.__wbindgen_is_object=function(e){const t=q(e);return typeof t=="object"&&t!==null},s.wbg.__wbg_next_de3e9db4440638b2=function(e){const t=q(e).next;return Je(t)},s.wbg.__wbg_call_1084a111329e68ce=function(){return Xi(function(e,t){const i=q(e).call(q(t));return Je(i)},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return Xi(function(e,t,i){const n=q(e).call(q(t),q(i));return Je(n)},arguments)},s.wbg.__wbg_call_c6fe275aaa60da79=function(){return Xi(function(e,t,i,n){const o=q(e).call(q(t),q(i),q(n));return Je(o)},arguments)},s.wbg.__wbindgen_memory=function(){const e=Vt.memory;return Je(e)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=q(e).buffer;return Je(t)},s.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const n=new Uint8Array(q(e),t>>>0,i>>>0);return Je(n)},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return q(e).length},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){const t=new Uint8Array(q(e));return Je(t)},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){q(e).set(q(t),i>>>0)},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return Xi(function(e,t,i){return Reflect.set(q(e),q(t),q(i))},arguments)},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return Xi(function(){const e=self.self;return Je(e)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return Xi(function(){const e=window.window;return Je(e)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return Xi(function(){const e=globalThis.globalThis;return Je(e)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return Xi(function(){const e=global.global;return Je(e)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return q(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const i=new Function(Ks(e,t));return Je(i)},s.wbg.__wbindgen_error_new=function(e,t){const i=new Error(Ks(e,t));return Je(i)},s.wbg.__wbindgen_jsval_loose_eq=function(e,t){return q(e)==q(t)},s.wbg.__wbindgen_number_get=function(e,t){const i=q(t),n=typeof i=="number"?i:void 0;Ti().setFloat64(e+8*1,Ts(n)?0:n,!0),Ti().setInt32(e+4*0,!Ts(n),!0)},s.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let t;try{t=q(e)instanceof Uint8Array}catch{t=!1}return t},s.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let t;try{t=q(e)instanceof ArrayBuffer}catch{t=!1}return t},s.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const t=Object.entries(q(e));return Je(t)},s.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(q(e))},s.wbg.__wbindgen_as_number=function(e){return+q(e)},s.wbg.__wbg_String_b9412f8799faab3e=function(e,t){const i=String(q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(q(e))},s.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=q(e)[q(t)];return Je(i)},s.wbg.__wbindgen_in=function(e,t){return q(e)in q(t)},s.wbg.__wbindgen_is_string=function(e){return typeof q(e)=="string"},s.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=q(e).navigator;return Je(t)},s.wbg.__wbg_platform_509d898d9dce4c23=function(){return Xi(function(e,t){const i=q(t).platform,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_previewconnector_new=function(e){const t=hde.__wrap(e);return Je(t)},s.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return Je(e)},s.wbg.__wbg_set_f975102236d3c502=function(e,t,i){q(e)[qp(t)]=qp(i)},s.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){q(e)[t>>>0]=qp(i)},s.wbg.__wbg_new_8608a2b51a5f6737=function(){return Je(new Map)},s.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const n=q(e).set(q(t),q(i));return Je(n)},s.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return Je(t)},s.wbg.__wbindgen_bigint_from_i64=function(e){return Je(e)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var i={a:e,b:t},n=(r,a)=>{const c=i.a;i.a=0;try{return u6e(c,i.b,r,a)}finally{i.a=c}};const o=new Promise(n);return Je(o)}finally{i.a=i.b=0}},s.wbg.__wbindgen_is_bigint=function(e){return typeof q(e)=="bigint"},s.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const i=q(t),n=typeof i=="bigint"?i:void 0;Ti().setBigInt64(e+8*1,Ts(n)?BigInt(0):n,!0),Ti().setInt32(e+4*0,!Ts(n),!0)},s.wbg.__wbindgen_jsval_eq=function(e,t){return q(e)===q(t)},s.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let t;try{t=q(e)instanceof Map}catch{t=!1}return t},s.wbg.__wbindgen_throw=function(e,t){throw new Error(Ks(e,t))},s.wbg.__wbindgen_debug_string=function(e,t){const i=R1e(q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=q(e).queueMicrotask;return Je(t)},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(q(e));return Je(t)},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const n=q(e).then(q(t),q(i));return Je(n)},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=q(e).then(q(t));return Je(i)},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(q(e))},s.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return Xi(function(e,t,i){const n=q(e).getExtension(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return Xi(function(e,t,i){const n=q(e).matchMedia(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return Xi(function(e,t){q(e).cancelAnimationFrame(t)},arguments)},s.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return Xi(function(e,t){return q(e).setTimeout(q(t))},arguments)},s.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return Xi(function(e,t,i){const n=q(e).createElement(Ks(t,i));return Je(n)},arguments)},s.wbg.__wbg_matches_212d57a200ff58f8=function(){return Xi(function(e,t,i){return q(e).matches(Ks(t,i))},arguments)},s.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return Xi(function(e,t,i,n,o){q(e).setAttribute(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_focus_06621101cc79f5d8=function(){return Xi(function(e){q(e).focus()},arguments)},s.wbg.__wbg_fillText_ae0445d1930428dd=function(){return Xi(function(e,t,i,n,o){q(e).fillText(Ks(t,i),n,o)},arguments)},s.wbg.__wbg_getContext_69ec873410cbba3c=function(){return Xi(function(e,t,i){const n=q(e).getContext(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return Xi(function(e,t){q(e).addListener(q(t))},arguments)},s.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return Xi(function(e,t,i,n,o){q(e).setProperty(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return Xi(function(e,t){URL.revokeObjectURL(Ks(e,t))},arguments)},s.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=q(e)instanceof Window}catch{t=!1}return t},s.wbg.__wbg_setData_41207994e2d54785=function(){return Xi(function(e,t,i,n,o){q(e).setData(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return Xi(function(e,t,i,n){q(e).addEventListener(Ks(t,i),q(n))},arguments)},s.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return Xi(function(e,t,i,n){q(e).removeEventListener(Ks(t,i),q(n))},arguments)},s.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return Xi(function(e,t){q(e).postMessage(q(t))},arguments)},s.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=q(t).data;var n=Ts(i)?0:Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_ebf2727385ee825c=function(){return Xi(function(){const e=new AbortController;return Je(e)},arguments)},s.wbg.__wbg_new_40ff2b042829bc58=function(){return Xi(function(){const e=new MessageChannel;return Je(e)},arguments)},s.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=q(e).performance;return Je(t)},s.wbg.__wbg_now_abd80e969af37148=function(e){return q(e).now()},s.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return q(e).movementX},s.wbg.__wbg_movementY_3064817f736e8151=function(e){return q(e).movementY},s.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=q(e).scheduler;return Je(t)},s.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=q(e).signal;return Je(t)},s.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const n=q(e).postTask(q(t),q(i));return Je(n)},s.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=q(e).catch(q(t));return Je(i)},s.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=q(e).port1;return Je(t)},s.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){q(e).onmessage=q(t)},s.wbg.__wbg_start_f642a950f6c98a0e=function(e){q(e).start()},s.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=q(e).port2;return Je(t)},s.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return Xi(function(e,t){return q(e).requestIdleCallback(q(t))},arguments)},s.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return Xi(function(e,t,i){return q(e).setTimeout(q(t),i)},arguments)},s.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const i=Array.of(q(e),q(t));return Je(i)},s.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(q(e));return Je(t)},s.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return Xi(function(e,t,i){q(e).postMessage(q(t),q(i))},arguments)},s.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return q(e).pointerId},s.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return q(e).matches},s.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=q(e).contentRect;return Je(t)},s.wbg.__wbg_width_e7964a50b174d035=function(e){return q(e).width},s.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return q(e).height},s.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=q(e).devicePixelContentBoxSize;return Je(t)},s.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return q(e).inlineSize},s.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return q(e).blockSize},s.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const i=q(t).pointerType,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return q(e).pressure},s.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return q(e).persisted},s.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return q(e).isIntersecting},s.wbg.__wbg_buttons_a302533e27733599=function(e){return q(e).buttons},s.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return Xi(function(e,t){q(e).setPointerCapture(t)},arguments)},s.wbg.__wbindgen_cb_drop=function(e){const t=qp(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){q(e).type=Ks(t,i)},s.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return Xi(function(e,t){const i=new Blob(q(e),q(t));return Je(i)},arguments)},s.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return Xi(function(e,t){const i=URL.createObjectURL(q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return Je(e)},s.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(q(e),q(t));return Je(i)},s.wbg.__wbg_new_25d9d4e2932d816f=function(){return Xi(function(e,t){const i=new Worker(Ks(e,t));return Je(i)},arguments)},s.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=q(e).Window;return Je(t)},s.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(q(e),q(t))},s.wbg.__wbg_abort_8659d889a7877ae3=function(e){q(e).abort()},s.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){q(e).cancelIdleCallback(t>>>0)},s.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){q(e).clearTimeout(t)},s.wbg.__wbg_close_87d69f9e9fe928c3=function(e){q(e).close()},s.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=q(e).userAgentData;return Ts(t)?0:Je(t)},s.wbg.__wbg_brands_982de08b35281a98=function(e){const t=q(e).brands;return Je(t)},s.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=q(t).brand,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return Xi(function(e,t){const i=q(t).userAgent,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){q(e).disconnect()},s.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){q(e).disconnect()},s.wbg.__wbg_cancel_cba86749f45f30ae=function(e){q(e).cancel()},s.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(qp(e))},s.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){q(e).webkitRequestFullscreen()},s.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=q(e).requestFullscreen();return Je(t)},s.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=q(e).webkitFullscreenElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=q(e).fullscreenElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(q(e),q(t))},s.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,i){const n=q(e).animate(q(t),q(i));return Je(n)},s.wbg.__wbg_play_5896e5851ba90aa2=function(e){q(e).play()},s.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return Xi(function(e,t){q(e).removeListener(q(t))},arguments)},s.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return q(e).contains(q(t))},s.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){q(e).unobserve(q(t))},s.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){q(e).observe(q(t))},s.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){q(e).webkitExitFullscreen()},s.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){q(e).exitFullscreen()},s.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return Xi(function(e,t,i,n){const o=q(t).getPropertyValue(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return Xi(function(e,t,i,n){const o=q(t).removeProperty(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=q(e).visibilityState;return{hidden:0,visible:1}[t]??2},s.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=q(e).body;return Ts(t)?0:Je(t)},s.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return Xi(function(e,t){const i=q(e).appendChild(q(t));return Je(i)},arguments)},s.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return Xi(function(e,t){const i=q(e).getComputedStyle(q(t));return Ts(i)?0:Je(i)},arguments)},s.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=q(e).activeElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_new_42acb42ec2ace97c=function(){return Xi(function(e){const t=new ResizeObserver(q(e));return Je(t)},arguments)},s.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){q(e).box=["border-box","content-box","device-pixel-content-box"][t]},s.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,i){q(e).observe(q(t),q(i))},s.wbg.__wbg_new_d0c6c2df51a6d903=function(){return Xi(function(e){const t=new IntersectionObserver(q(e));return Je(t)},arguments)},s.wbg.__wbg_observe_c901133fbef21560=function(e,t){q(e).observe(q(t))},s.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=q(e).getBoundingClientRect();return Je(t)},s.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return q(e).x},s.wbg.__wbg_y_bd4e2c0613413655=function(e){return q(e).y},s.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return Xi(function(e,t){return q(e).requestAnimationFrame(q(t))},arguments)},s.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=q(e).scheduler;return Je(t)},s.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=q(e).getCoalescedEvents;return Je(t)},s.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=q(e).requestIdleCallback;return Je(t)},s.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=q(e).requestFullscreen;return Je(t)},s.wbg.__wbg_button_460cdec9f2512a91=function(e){return q(e).button},s.wbg.__wbg_offsetX_294898d040917c6b=function(e){return q(e).offsetX},s.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return q(e).offsetY},s.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return q(e).deltaX},s.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return q(e).deltaY},s.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return q(e).deltaMode},s.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const i=q(t).code,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return q(e).location},s.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return q(e).metaKey},s.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return q(e).shiftKey},s.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return q(e).ctrlKey},s.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return q(e).altKey},s.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return q(e).metaKey},s.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=q(e).getCoalescedEvents();return Je(t)},s.wbg.__wbindgen_closure_wrapper4162=function(e,t,i){const n=Y4(e,t,1618,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4164=function(e,t,i){const n=Y4(e,t,1618,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4165=function(e,t,i){const n=Y4(e,t,1618,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4166=function(e,t,i){const n=Y4(e,t,1618,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4167=function(e,t,i){const n=Y4(e,t,1618,J4);return Je(n)},s.wbg.__wbindgen_closure_wrapper6478=function(e,t,i){const n=mv(e,t,1844,h6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper12140=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13308=function(e,t,i){const n=mv(e,t,1844,h6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper13345=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13357=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13363=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13374=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13388=function(e,t,i){const n=mv(e,t,1844,u6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper13412=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13417=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13439=function(e,t,i){const n=mv(e,t,1844,vE);return Je(n)},s}function wci(s,e){return Vt=s.exports,Zot.__wbindgen_wasm_module=e,M0=null,qV=null,KV=null,Vt}async function Zot(s){if(Vt!==void 0)return Vt;typeof s<"u"&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof s>"u"&&(s=new URL(""+new URL("slint_lsp_wasm_bg-DCweP4bQ.wasm",import.meta.url).href,import.meta.url));const e=bci();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:i}=await vci(await s,e);return wci(t,i)}function yci(s){return new gci({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:h0e.ErrorAction.Continue}),closed:()=>({action:h0e.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(s)}})}var f2,p2;class Cci{constructor(){Wt(this,f2);Wt(this,p2);const e=new Worker(new URL(""+new URL("lsp_worker-C9Slr--s.js",import.meta.url).href,import.meta.url),{type:"module"});Ct(this,p2,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),Ct(this,f2,Zot({}))}async wait_for_lsp(){const e=Ce(this,p2);Ct(this,p2,null);const t=Ce(this,f2);Ct(this,f2,null);const[i,n]=await Promise.all([t,e]);return Promise.resolve(new Aci(n))}}f2=new WeakMap,p2=new WeakMap;var m2;class Sci{constructor(e){Wt(this,m2);Ct(this,m2,e)}show_ui(){return Ce(this,m2).show_ui()}current_style(){return Ce(this,m2).current_style()}}m2=new WeakMap;var R7,M7,lT,dT,_2,hT;class Aci{constructor(e){Wt(this,R7,null);Wt(this,M7,null);Wt(this,lT);Wt(this,dT);Wt(this,_2);Wt(this,hT,null);Ct(this,lT,e);const t=new Zii(new Tne.BrowserMessageReader(Ce(this,lT)),n=>{if(n.method==="slint/lsp_to_preview"){const r=n.params;return Ce(this,hT)?.process_lsp_to_preview_message(r),!0}if(n.method==="slint/load_file"){const o=n,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}return!1}),i=new Tne.BrowserMessageWriter(Ce(this,lT));Ct(this,dT,t),Ct(this,_2,i)}get lsp_worker(){return Ce(this,lT)}get lsp_reader(){return Ce(this,dT)}get lsp_writer(){return Ce(this,_2)}set file_reader(e){Ct(this,M7,e)}read_url(e){var t;try{return((t=Ce(this,M7))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=Ce(this,R7);if(e===null){const t=yci({reader:Ce(this,dT),writer:Ce(this,_2)});Ct(this,R7,t),t.start(),Ce(this,dT).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(Ce(this,hT)===null){try{mci()}catch{}const n=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");Ct(this,hT,await hde.create(o=>{this.language_client.sendNotification("slint/preview_to_lsp",o)},e,t,n==="1"))}return new Sci(Ce(this,hT))}}R7=new WeakMap,M7=new WeakMap,lT=new WeakMap,dT=new WeakMap,_2=new WeakMap,hT=new WeakMap;const rq="canvas";var uT;const gFe=class gFe extends nt{constructor(t,i,n){super({node:gFe.createNode()});Wt(this,uT,null);this.setFlag(nt.Flag.DisallowLayout),this.addClass("content"),this.addClass("preview"),this.title.label="Preview",this.title.caption="Slint Viewer",this.title.closable=!0,t.previewer(i,n).then(o=>{Ct(this,uT,o),Ce(this,uT).show_ui().then(()=>{console.info("UI should be up!");const r=document.getElementById(rq);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=rq,i.className=rq,i.style.width="100%",i.style.height="100%",i.style.outline="none",i.style.touchAction="none",t.appendChild(i),t}current_style(){return Ce(this,uT)?Ce(this,uT).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(rq);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};uT=new WeakMap;let M1e=gFe;const Eci=new Cci,jf=new lC;function xci(s){const e=new W_({commands:jf});e.title.label="Open Demo";for(const t of s.known_demos()){const i="slint:set_demo_"+t[1];jf.addCommand(i,{label:t[1],execute:()=>s.set_demo(t[0])}),e.addItem({command:i})}return e}function Dci(){const s=new W_({commands:jf});return s.title.label="Settings",jf.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{Ist()}}),s.addItem({command:"slint:store_github_token"}),s}function kci(s,e){const t=new W_({commands:jf});return t.title.label="Project",jf.addCommand("slint:open_url",{label:"Open URL",iconClass:"fa fa-link",mnemonic:1,execute:()=>{const i=prompt("Please enter the URL to open");s.project_from_url(i)}}),jf.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),jf.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"),s.add_empty_file_to_project(i))}}),jf.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:xci(s)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:Ici(s,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:Dci()}),t.addItem({type:"separator"}),jf.addCommand("slint:about",{label:"About",iconClass:"fa-info-circle",execute:()=>xXt()}),t.addItem({command:"slint:about"}),t}function Ici(s,e){const t=new W_({commands:jf});return t.title.label="Share",jf.addCommand("slint:copy_permalink",{label:"Copy Permalink to Clipboard",iconClass:"fa fa-share",mnemonic:1,isEnabled:()=>s.open_document_urls.length===1,execute:()=>{const i=new URLSearchParams;i.set("snippet",s.current_editor_content),i.set("style",e.current_style());const n=new URL(window.location.toString());n.search=i.toString(),Y3e(n.toString())}}),jf.addCommand("slint:create_gist",{label:"Export to github Gist",iconClass:"fa-brands fa-github",mnemonic:1,isEnabled:()=>s.open_document_urls.length>0,execute:async()=>{let i=MDe();i||await Ist(),i=MDe(),i?await EXt((n,o)=>{IXt(s,n,o).then(r=>{const a=new URLSearchParams;a.set("load_url",r);const c=new URL(window.location.toString());c.search=a.toString(),Y3e(r,c.toString())}).catch(r=>AXt(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 Tci=new URLSearchParams(window.location.search),Lci=Tci.get("style");function Rci(s){const e=new Xii(s),t=new M1e(s,o=>e.map_url(o),Lci??""),i=new Y$;i.id="menuBar",i.addMenu(kci(e,t));const n=new KH({orientation:"horizontal"});n.id="main",n.addWidget(e),n.addWidget(t),window.onresize=()=>{n.update()},document.addEventListener("keydown",o=>{jf.processKeydownEvent(o)}),nt.attach(i,document.body),nt.attach(n,document.body)}function Mci(){qii().then(s=>{Eci.wait_for_lsp().then(e=>{Rci(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(s=>{console.info("Monaco fail:",s)})}window.onload=Mci;export{rd as c,WEi as g}; +${e.message}`,void 0,n.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Wr.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){const i=Wr.workspace.getConfiguration(this._id);let n=It.Trace.Off,o=It.TraceFormat.Text;if(i){const r=i.get("trace.server","off");typeof r=="string"?n=It.Trace.fromString(r):(n=It.Trace.fromString(i.get("trace.server.verbosity","off")),o=It.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=n,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;Lv.array(t)?i=t:i=[t],i&&this._dynamicFeatures.get(It.DidChangeWatchedFilesNotification.type.method).registerRaw(X7e.generateUuid(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),uv.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(It.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof Z7e.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){const e=new Map;this.registerFeature(new e6e.ConfigurationFeature(this)),this.registerFeature(new EP.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new EP.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new EP.WillSaveFeature(this)),this.registerFeature(new EP.WillSaveWaitUntilFeature(this)),this.registerFeature(new EP.DidSaveTextDocumentFeature(this)),this.registerFeature(new EP.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new qri.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new Nri.CompletionItemFeature(this)),this.registerFeature(new Pri.HoverFeature(this)),this.registerFeature(new Ori.SignatureHelpFeature(this)),this.registerFeature(new Fri.DefinitionFeature(this)),this.registerFeature(new Uri.ReferencesFeature(this)),this.registerFeature(new Bri.DocumentHighlightFeature(this)),this.registerFeature(new Wri.DocumentSymbolFeature(this)),this.registerFeature(new Hri.WorkspaceSymbolFeature(this)),this.registerFeature(new Vri.CodeActionFeature(this)),this.registerFeature(new zri.CodeLensFeature(this)),this.registerFeature(new Fge.DocumentFormattingFeature(this)),this.registerFeature(new Fge.DocumentRangeFormattingFeature(this)),this.registerFeature(new Fge.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new $ri.RenameFeature(this)),this.registerFeature(new Gri.DocumentLinkFeature(this)),this.registerFeature(new Kri.ExecuteCommandFeature(this)),this.registerFeature(new e6e.SyncConfigurationFeature(this)),this.registerFeature(new Yri.TypeDefinitionFeature(this)),this.registerFeature(new jri.ImplementationFeature(this)),this.registerFeature(new Qri.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Jri.WorkspaceFoldersFeature(this)),this.registerFeature(new Xri.FoldingRangeFeature(this)),this.registerFeature(new Zri.DeclarationFeature(this)),this.registerFeature(new eai.SelectionRangeFeature(this)),this.registerFeature(new tai.ProgressFeature(this)),this.registerFeature(new iai.CallHierarchyFeature(this)),this.registerFeature(new nai.SemanticTokensFeature(this)),this.registerFeature(new sai.LinkedEditingFeature(this)),this.registerFeature(new xP.DidCreateFilesFeature(this)),this.registerFeature(new xP.DidRenameFilesFeature(this)),this.registerFeature(new xP.DidDeleteFilesFeature(this)),this.registerFeature(new xP.WillCreateFilesFeature(this)),this.registerFeature(new xP.WillRenameFilesFeature(this)),this.registerFeature(new xP.WillDeleteFilesFeature(this)),this.registerFeature(new oai.TypeHierarchyFeature(this)),this.registerFeature(new rai.InlineValueFeature(this)),this.registerFeature(new aai.InlayHintsFeature(this)),this.registerFeature(new Mri.DiagnosticFeature(this)),this.registerFeature(new Z7e.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(b1e.createAll(this))}fillInitializeParams(e){for(let t of this._features)Lv.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){const e={};(0,uv.ensure)(e,"workspace").applyEdit=!0;const t=(0,uv.ensure)((0,uv.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[It.ResourceOperationKind.Create,It.ResourceOperationKind.Rename,It.ResourceOperationKind.Delete],t.failureHandling=It.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};const i=(0,uv.ensure)((0,uv.ensure)(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[It.DiagnosticTag.Unnecessary,It.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;const n=(0,uv.ensure)(e,"window"),o=(0,uv.ensure)(n,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};const r=(0,uv.ensure)(n,"showDocument");r.support=!0;const a=(0,uv.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(nL.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)Lv.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 n=t.registerOptions??{};n.documentSelector=n.documentSelector??this._clientOptions.documentSelector;const o={id:t.id,registerOptions:n};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)),n=new Map;Wr.workspace.textDocuments.forEach(r=>n.set(r.uri.toString(),r));let o=!1;if(t.documentChanges){for(const r of t.documentChanges)if(It.TextDocumentEdit.is(r)&&r.textDocument.version&&r.textDocument.version>=0){const a=this._p2c.asUri(r.textDocument.uri).toString(),c=n.get(a);if(c&&c.version!==r.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):Lv.asPromise(Wr.workspace.applyEdit(i).then(r=>({applied:r})))}handleFailedRequest(e,t,i,n,o=!0){if(i instanceof It.ResponseError){if(i.code===It.ErrorCodes.PendingResponseRejected||i.code===It.ErrorCodes.ConnectionInactive)return n;if(i.code===It.LSPErrorCodes.RequestCancelled||i.code===It.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return n;throw i.data!==void 0?new uv.LSPCancellationError(i.data):new Wr.CancellationError}else if(i.code===It.LSPErrorCodes.ContentModified){if(nL.RequestsToCancelOnContentModified.has(e.method)||nL.CancellableResolveCalls.has(e.method))throw new Wr.CancellationError;return n}}throw this.error(`Request ${e.method} failed.`,i,o),i}}var Hot=mh.BaseLanguageClient=nL;nL.RequestsToCancelOnContentModified=new Set([It.SemanticTokensRequest.method,It.SemanticTokensRangeRequest.method,It.SemanticTokensDeltaRequest.method]);nL.CancellableResolveCalls=new Set([It.CompletionResolveRequest.method,It.CodeLensResolveRequest.method,It.CodeActionResolveRequest.method,It.InlayHintResolveRequest.method,It.DocumentLinkResolveRequest.method,It.WorkspaceSymbolResolveRequest.method]);class dai{error(e){(0,It.RAL)().console.error(e)}warn(e){(0,It.RAL)().console.warn(e)}info(e){(0,It.RAL)().console.info(e)}log(e){(0,It.RAL)().console.log(e)}}function hai(s,e,t,i,n){const o=new dai,r=(0,It.createProtocolConnection)(s,e,o,n);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:It.TraceFormat.Text};return d===void 0?r.trace(c,l,h):(Lv.boolean(d),r.trace(c,l,d))},initialize:c=>r.sendRequest(It.InitializeRequest.type,c),shutdown:()=>r.sendRequest(It.ShutdownRequest.type,void 0),exit:()=>r.sendNotification(It.ExitNotification.type),end:()=>r.end(),dispose:()=>r.dispose()}}var b1e;(function(s){function e(t){return[new cai.InlineCompletionItemFeature(t)]}s.createAll=e})(b1e||(mh.ProposedFeatures=b1e={}));(function(s){var e=sd&&sd.__createBinding||(Object.create?function(n,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(n,a,c)}:function(n,o,r,a){a===void 0&&(a=r),n[a]=o[r]}),t=sd&&sd.__exportStar||function(n,o){for(var r in n)r!=="default"&&!Object.prototype.hasOwnProperty.call(o,r)&&e(o,n,r)};Object.defineProperty(s,"__esModule",{value:!0}),s.DiagnosticPullMode=s.vsdiag=void 0,t(ps,s),t(Mn,s);var i=_A;Object.defineProperty(s,"vsdiag",{enumerable:!0,get:function(){return i.vsdiag}}),Object.defineProperty(s,"DiagnosticPullMode",{enumerable:!0,get:function(){return i.DiagnosticPullMode}}),t(mh,s)})(r0e);var xne=ps;(function(s){var e=sd&&sd.__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=sd&&sd.__exportStar||function(r,a){for(var c in r)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,r,c)};Object.defineProperty(s,"__esModule",{value:!0}),s.LanguageClient=void 0;const i=r0e,n=xne;t(xne,s),t(r0e,s);class o extends i.BaseLanguageClient{constructor(a,c,l,d){super(a,c,l),this.worker=d}createMessageTransports(a){const c=new n.BrowserMessageReader(this.worker),l=new n.BrowserMessageWriter(this.worker);return Promise.resolve({reader:c,writer:l})}}s.LanguageClient=o})(o0e);class uai extends Hot{connectionProvider;constructor({id:e,name:t,clientOptions:i,connectionProvider:n}){super(e??t.toLowerCase(),t,i),this.connectionProvider=n}createMessageTransports(e){return this.connectionProvider.get(e)}}let Vt;const vS=new Array(128).fill(void 0);vS.push(void 0,null,!0,!1);function Q(s){return vS[s]}let Iz=vS.length;function gai(s){s<132||(vS[s]=Iz,Iz=s)}function $p(s){const e=Q(s);return gai(s),e}let da=0,zV=null;function fj(){return(zV===null||zV.byteLength===0)&&(zV=new Uint8Array(Vt.memory.buffer)),zV}const pj=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},fai=typeof pj.encodeInto=="function"?function(s,e){return pj.encodeInto(s,e)}:function(s,e){const t=pj.encode(s);return e.set(t),{read:s.length,written:t.length}};function Va(s,e,t){if(t===void 0){const a=pj.encode(s),c=e(a.length,1)>>>0;return fj().subarray(c,c+a.length).set(a),da=a.length,c}let i=s.length,n=e(i,1)>>>0;const o=fj();let r=0;for(;r127)break;o[n+r]=a}if(r!==i){r!==0&&(s=s.slice(r)),n=t(n,i,i=r+s.length*3,1)>>>0;const a=fj().subarray(n+r,n+i),c=fai(s,a);r+=c.written,n=t(n,i,r,1)>>>0}return da=r,n}function Ts(s){return s==null}let I0=null;function Ti(){return(I0===null||I0.buffer.detached===!0||I0.buffer.detached===void 0&&I0.buffer!==Vt.memory.buffer)&&(I0=new DataView(Vt.memory.buffer)),I0}function Je(s){Iz===vS.length&&vS.push(vS.length+1);const e=Iz;return Iz=vS[e],vS[e]=s,e}const Uot=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Uot.decode();function Ks(s,e){return s=s>>>0,Uot.decode(fj().subarray(s,s+e))}function w1e(s){const e=typeof s;if(e=="number"||e=="boolean"||s==null)return`${s}`;if(e=="string")return`"${s}"`;if(e=="symbol"){const n=s.description;return n==null?"Symbol":`Symbol(${n})`}if(e=="function"){const n=s.name;return typeof n=="string"&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(s)){const n=s.length;let o="[";n>0&&(o+=w1e(s[0]));for(let r=1;r1)i=t[1];else return toString.call(s);if(i=="Object")try{return"Object("+JSON.stringify(s)+")"}catch{return"Object"}return s instanceof Error?`${s.name}: ${s.message} +${s.stack}`:i}const Dne=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{Vt.__wbindgen_export_2.get(s.dtor)(s.a,s.b)});function Q4(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},o=(...r)=>{n.cnt++;try{return i(n.a,n.b,...r)}finally{--n.cnt===0&&(Vt.__wbindgen_export_2.get(n.dtor)(n.a,n.b),n.a=0,Dne.unregister(n))}};return o.original=n,Dne.register(o,n,n),o}function j4(s,e,t){Vt._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h064a8f7c292bc49f(s,e,Je(t))}function gv(s,e,t,i){const n={a:s,b:e,cnt:1,dtor:t},o=(...r)=>{n.cnt++;const a=n.a;n.a=0;try{return i(a,n.b,...r)}finally{--n.cnt===0?(Vt.__wbindgen_export_2.get(n.dtor)(a,n.b),Dne.unregister(n)):n.a=a}};return o.original=n,Dne.register(o,n,n),o}function n6e(s,e){Vt._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h982fa4f9af5f0d41(s,e)}function pE(s,e,t){Vt._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1b2bf3251affd4b0(s,e,Je(t))}function s6e(s,e,t,i){Vt._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9e6364c3f89b0ca1(s,e,Je(t),Je(i))}function Xi(s,e){try{return s.apply(this,e)}catch(t){Vt.__wbindgen_exn_store(Je(t))}}function pai(){try{const t=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.run_event_loop(t);var s=Ti().getInt32(t+4*0,!0),e=Ti().getInt32(t+4*1,!0);if(e)throw $p(s)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}let $V=null;function mai(){return($V===null||$V.byteLength===0)&&($V=new Float32Array(Vt.memory.buffer)),$V}function nq(s,e){return s=s>>>0,mai().subarray(s/4,s/4+e)}const o6e=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>Vt.__wbg_previewconnector_free(s>>>0,1));class sde{static __wrap(e){e=e>>>0;const t=Object.create(sde.prototype);return t.__wbg_ptr=e,o6e.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,o6e.unregister(this),e}free(){const e=this.__destroy_into_raw();Vt.__wbg_previewconnector_free(e,0)}static create(e,t,i,n){try{const c=Vt.__wbindgen_add_to_stack_pointer(-16),l=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),d=da;Vt.previewconnector_create(c,Je(e),Je(t),l,d,n);var o=Ti().getInt32(c+4*0,!0),r=Ti().getInt32(c+4*1,!0),a=Ti().getInt32(c+4*2,!0);if(a)throw $p(r);return $p(o)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}current_style(){const e=Vt.previewconnector_current_style(this.__wbg_ptr);return $p(e)}show_ui(){try{const n=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.previewconnector_show_ui(n,this.__wbg_ptr);var e=Ti().getInt32(n+4*0,!0),t=Ti().getInt32(n+4*1,!0),i=Ti().getInt32(n+4*2,!0);if(i)throw $p(t);return $p(e)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(e){try{const n=Vt.__wbindgen_add_to_stack_pointer(-16);Vt.previewconnector_process_lsp_to_preview_message(n,this.__wbg_ptr,Je(e));var t=Ti().getInt32(n+4*0,!0),i=Ti().getInt32(n+4*1,!0);if(i)throw $p(t)}finally{Vt.__wbindgen_add_to_stack_pointer(16)}}}typeof FinalizationRegistry>"u"||new FinalizationRegistry(s=>Vt.__wbg_slintserver_free(s>>>0,1));async function _ai(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(i){if(s.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 s.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function vai(){const s={};return s.wbg={},s.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Je(e)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const i=Q(t).stack,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let i,n;try{i=e,n=t,console.error(Ks(e,t))}finally{Vt.__wbindgen_free(i,n,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){$p(e)},s.wbg.__wbg_createProgram_2c3a8969b5a76988=function(e){const t=Q(e).createProgram();return Ts(t)?0:Je(t)},s.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(e){const t=Q(e).createProgram();return Ts(t)?0:Je(t)},s.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(e,t,i){Q(e).attachShader(Q(t),Q(i))},s.wbg.__wbg_attachShader_396d529f1d7c9abc=function(e,t,i){Q(e).attachShader(Q(t),Q(i))},s.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(e,t,i,n,o){Q(e).bindAttribLocation(Q(t),i>>>0,Ks(n,o))},s.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(e,t,i,n,o){Q(e).bindAttribLocation(Q(t),i>>>0,Ks(n,o))},s.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(e,t){Q(e).linkProgram(Q(t))},s.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(e,t){Q(e).linkProgram(Q(t))},s.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(e,t,i){const n=Q(e).getProgramParameter(Q(t),i>>>0);return Je(n)},s.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(e,t,i){const n=Q(e).getProgramParameter(Q(t),i>>>0);return Je(n)},s.wbg.__wbindgen_boolean_get=function(e){const t=Q(e);return typeof t=="boolean"?t?1:0:2},s.wbg.__wbg_detachShader_c5af8831e42dad83=function(e,t,i){Q(e).detachShader(Q(t),Q(i))},s.wbg.__wbg_detachShader_32f119837bb4e8a9=function(e,t,i){Q(e).detachShader(Q(t),Q(i))},s.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(e,t,i){const n=Q(t).getProgramInfoLog(Q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(e,t,i){const n=Q(t).getProgramInfoLog(Q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_createShader_af087106532661d9=function(e,t){const i=Q(e).createShader(t>>>0);return Ts(i)?0:Je(i)},s.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(e,t){const i=Q(e).createShader(t>>>0);return Ts(i)?0:Je(i)},s.wbg.__wbg_shaderSource_d447b31057e4f64c=function(e,t,i,n){Q(e).shaderSource(Q(t),Ks(i,n))},s.wbg.__wbg_shaderSource_b92b2b5c29126344=function(e,t,i,n){Q(e).shaderSource(Q(t),Ks(i,n))},s.wbg.__wbg_compileShader_043cc8b99c2efc21=function(e,t){Q(e).compileShader(Q(t))},s.wbg.__wbg_compileShader_77ef81728b1c03f6=function(e,t){Q(e).compileShader(Q(t))},s.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(e,t,i){const n=Q(e).getShaderParameter(Q(t),i>>>0);return Je(n)},s.wbg.__wbg_getShaderParameter_806970126d526c29=function(e,t,i){const n=Q(e).getShaderParameter(Q(t),i>>>0);return Je(n)},s.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(e,t,i){const n=Q(t).getShaderInfoLog(Q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(e,t,i){const n=Q(t).getShaderInfoLog(Q(i));var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_uniform2fv_b73144e507d90a92=function(e,t,i,n){Q(e).uniform2fv(Q(t),nq(i,n))},s.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(e,t,i,n){Q(e).uniform2fv(Q(t),nq(i,n))},s.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(e,t){Q(e).deleteFramebuffer(Q(t))},s.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(e,t){Q(e).deleteFramebuffer(Q(t))},s.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(e,t){Q(e).deleteRenderbuffer(Q(t))},s.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(e,t){Q(e).deleteRenderbuffer(Q(t))},s.wbg.__wbg_width_ac5901de11cd9abc=function(e){return Q(e).width},s.wbg.__wbg_height_bf0ba2fba351acb3=function(e){return Q(e).height},s.wbg.__wbg_createTexture_e49c36c5f31925a3=function(e){const t=Q(e).createTexture();return Ts(t)?0:Je(t)},s.wbg.__wbg_createTexture_2426b031baa26a82=function(e){const t=Q(e).createTexture();return Ts(t)?0:Je(t)},s.wbg.__wbg_new_525245e2b9901204=function(){const e=new Object;return Je(e)},s.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(e,t){Q(e).stencil=t!==0},s.wbg.__wbg_setantialias_05dc0a39d7b109be=function(e,t){Q(e).antialias=t!==0},s.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return Xi(function(e,t,i,n){const o=Q(e).getContext(Ks(t,i),Q(n));return Ts(o)?0:Je(o)},arguments)},s.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(e){let t;try{t=Q(e)instanceof WebGL2RenderingContext}catch{t=!1}return t},s.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(e){const t=Q(e).getSupportedExtensions();return Ts(t)?0:Je(t)},s.wbg.__wbg_length_ae22078168b726f5=function(e){return Q(e).length},s.wbg.__wbg_get_3baa728f9d58d3f6=function(e,t){const i=Q(e)[t>>>0];return Je(i)},s.wbg.__wbindgen_string_get=function(e,t){const i=Q(t),n=typeof i=="string"?i:void 0;var o=Ts(n)?0:Va(n,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),r=da;Ti().setInt32(e+4*1,r,!0),Ti().setInt32(e+4*0,o,!0)},s.wbg.__wbg_getParameter_cfaed180705b9280=function(){return Xi(function(e,t){const i=Q(e).getParameter(t>>>0);return Je(i)},arguments)},s.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(e){const t=Q(e).createVertexArrayOES();return Ts(t)?0:Je(t)},s.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(e){const t=Q(e).createVertexArray();return Ts(t)?0:Je(t)},s.wbg.__wbg_createBuffer_9571c039ba6696c6=function(e){const t=Q(e).createBuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(e){const t=Q(e).createBuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_getError_c620f28d427d8ad8=function(e){return Q(e).getError()},s.wbg.__wbg_getError_deb0c909d3a7041a=function(e){return Q(e).getError()},s.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(e){const t=Q(e).createFramebuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createFramebuffer_a12847edac092647=function(e){const t=Q(e).createFramebuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(e,t,i,n,o,r){Q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,Q(o),r)},s.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(e,t,i,n,o,r){Q(e).framebufferTexture2D(t>>>0,i>>>0,n>>>0,Q(o),r)},s.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(e){const t=Q(e).createRenderbuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(e){const t=Q(e).createRenderbuffer();return Ts(t)?0:Je(t)},s.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(e,t,i,n,o){Q(e).renderbufferStorage(t>>>0,i>>>0,n,o)},s.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(e,t,i,n,o){Q(e).renderbufferStorage(t>>>0,i>>>0,n,o)},s.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(e,t,i,n,o){Q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,Q(o))},s.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(e,t,i,n,o){Q(e).framebufferRenderbuffer(t>>>0,i>>>0,n>>>0,Q(o))},s.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(e,t){return Q(e).checkFramebufferStatus(t>>>0)},s.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(e,t){return Q(e).checkFramebufferStatus(t>>>0)},s.wbg.__wbg_scissor_d06b14c4966727fa=function(e,t,i,n,o){Q(e).scissor(t,i,n,o)},s.wbg.__wbg_scissor_2b172ca4e459dd16=function(e,t,i,n,o){Q(e).scissor(t,i,n,o)},s.wbg.__wbg_clearColor_ac713fa6931cef3c=function(e,t,i,n,o){Q(e).clearColor(t,i,n,o)},s.wbg.__wbg_clearColor_837d30f5bf4f982b=function(e,t,i,n,o){Q(e).clearColor(t,i,n,o)},s.wbg.__wbg_clear_780c4e5384fe3fc6=function(e,t){Q(e).clear(t>>>0)},s.wbg.__wbg_clear_7a2a7ca897047e8d=function(e,t){Q(e).clear(t>>>0)},s.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(e,t,i,n){Q(e).uniform4fv(Q(t),nq(i,n))},s.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(e,t,i,n){Q(e).uniform4fv(Q(t),nq(i,n))},s.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(e,t){Q(e).deleteTexture(Q(t))},s.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(e,t){Q(e).deleteTexture(Q(t))},s.wbg.__wbg_deleteShader_da06706168cf00dc=function(e,t){Q(e).deleteShader(Q(t))},s.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(e,t){Q(e).deleteShader(Q(t))},s.wbg.__wbg_deleteProgram_c3238b647d849334=function(e,t){Q(e).deleteProgram(Q(t))},s.wbg.__wbg_deleteProgram_5f938b0667141206=function(e,t){Q(e).deleteProgram(Q(t))},s.wbg.__wbg_useProgram_001c6b9208b683d3=function(e,t){Q(e).useProgram(Q(t))},s.wbg.__wbg_useProgram_d4616618ac6d0652=function(e,t){Q(e).useProgram(Q(t))},s.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(e,t,i){Q(e).bindBuffer(t>>>0,Q(i))},s.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(e,t,i){Q(e).bindBuffer(t>>>0,Q(i))},s.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(e,t,i){Q(e).bindFramebuffer(t>>>0,Q(i))},s.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(e,t,i){Q(e).bindFramebuffer(t>>>0,Q(i))},s.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(e,t,i){Q(e).bindRenderbuffer(t>>>0,Q(i))},s.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(e,t,i){Q(e).bindRenderbuffer(t>>>0,Q(i))},s.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(e,t){Q(e).bindVertexArray(Q(t))},s.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(e,t){Q(e).bindVertexArrayOES(Q(t))},s.wbg.__wbg_pixelStorei_2498331e094ff305=function(e,t,i){Q(e).pixelStorei(t>>>0,i)},s.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(e,t,i){Q(e).pixelStorei(t>>>0,i)},s.wbg.__wbg_disable_d73e59fee5b5e973=function(e,t){Q(e).disable(t>>>0)},s.wbg.__wbg_disable_8908871f2334e76b=function(e,t){Q(e).disable(t>>>0)},s.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(e,t){Q(e).disableVertexAttribArray(t>>>0)},s.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(e,t){Q(e).disableVertexAttribArray(t>>>0)},s.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(e,t,i,n){Q(e).drawArrays(t>>>0,i,n)},s.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(e,t,i,n){Q(e).drawArrays(t>>>0,i,n)},s.wbg.__wbg_enable_68b3fa03a633259a=function(e,t){Q(e).enable(t>>>0)},s.wbg.__wbg_enable_541ed84c1e7d269d=function(e,t){Q(e).enable(t>>>0)},s.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(e,t){Q(e).enableVertexAttribArray(t>>>0)},s.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(e,t){Q(e).enableVertexAttribArray(t>>>0)},s.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(e,t,i,n){const o=Q(e).getUniformLocation(Q(t),Ks(i,n));return Ts(o)?0:Je(o)},s.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(e,t,i,n){const o=Q(e).getUniformLocation(Q(t),Ks(i,n));return Ts(o)?0:Je(o)},s.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(e,t){Q(e).generateMipmap(t>>>0)},s.wbg.__wbg_generateMipmap_52183f0501f63234=function(e,t){Q(e).generateMipmap(t>>>0)},s.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){Q(e).texImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},s.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){Q(e).texImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},s.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(e,t,i){Q(e).uniform1i(Q(t),i)},s.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(e,t,i){Q(e).uniform1i(Q(t),i)},s.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(e,t,i,n,o){Q(e).colorMask(t!==0,i!==0,n!==0,o!==0)},s.wbg.__wbg_colorMask_7c2aafdec5441392=function(e,t,i,n,o){Q(e).colorMask(t!==0,i!==0,n!==0,o!==0)},s.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(e,t,i){Q(e).bindTexture(t>>>0,Q(i))},s.wbg.__wbg_bindTexture_bffa89324927e23a=function(e,t,i){Q(e).bindTexture(t>>>0,Q(i))},s.wbg.__wbg_activeTexture_b967ed47a8083daa=function(e,t){Q(e).activeTexture(t>>>0)},s.wbg.__wbg_activeTexture_067b93df6d1ed857=function(e,t){Q(e).activeTexture(t>>>0)},s.wbg.__wbg_texParameteri_83ad7181b62f4997=function(e,t,i,n){Q(e).texParameteri(t>>>0,i>>>0,n)},s.wbg.__wbg_texParameteri_531d0268109950ba=function(e,t,i,n){Q(e).texParameteri(t>>>0,i>>>0,n)},s.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){Q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},s.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){Q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,Q(d))},arguments)},s.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return Xi(function(e,t,i,n,o,r,a,c,l,d){Q(e).texSubImage2D(t>>>0,i,n,o,r,a,c>>>0,l>>>0,d)},arguments)},s.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(e,t,i,n,o,r,a){Q(e).vertexAttribPointer(t>>>0,i,n>>>0,o!==0,r,a)},s.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(e,t,i,n,o,r,a){Q(e).vertexAttribPointer(t>>>0,i,n>>>0,o!==0,r,a)},s.wbg.__wbg_viewport_efc09c09d4f3cc48=function(e,t,i,n,o){Q(e).viewport(t,i,n,o)},s.wbg.__wbg_viewport_536c78dd69c44351=function(e,t,i,n,o){Q(e).viewport(t,i,n,o)},s.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(e,t,i,n){Q(e).stencilFunc(t>>>0,i,n>>>0)},s.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(e,t,i,n){Q(e).stencilFunc(t>>>0,i,n>>>0)},s.wbg.__wbg_stencilMask_f55f160fc49b981a=function(e,t){Q(e).stencilMask(t>>>0)},s.wbg.__wbg_stencilMask_702162181d88081f=function(e,t){Q(e).stencilMask(t>>>0)},s.wbg.__wbg_stencilOp_2418383669ca9228=function(e,t,i,n){Q(e).stencilOp(t>>>0,i>>>0,n>>>0)},s.wbg.__wbg_stencilOp_0634a11fbde7da95=function(e,t,i,n){Q(e).stencilOp(t>>>0,i>>>0,n>>>0)},s.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(e,t,i,n,o){Q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(e,t,i,n,o){Q(e).stencilOpSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(e){return Q(e).devicePixelRatio},s.wbg.__wbg_document_8554450897a855b9=function(e){const t=Q(e).document;return Ts(t)?0:Je(t)},s.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(e,t,i){const n=Q(e).getElementById(Ks(t,i));return Ts(n)?0:Je(n)},s.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(e){let t;try{t=Q(e)instanceof HTMLCanvasElement}catch{t=!1}return t},s.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(e,t){Q(e).width=t>>>0},s.wbg.__wbg_setheight_ba99ad2df4295e89=function(e,t){Q(e).height=t>>>0},s.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(e){return Q(e).clientWidth},s.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(e){return Q(e).clientHeight},s.wbg.__wbg_dataset_b0dd1a3513142b54=function(e){const t=Q(e).dataset;return Je(t)},s.wbg.__wbg_get_9a60fce5bf7da364=function(e,t,i,n){const o=Q(t)[Ks(i,n)];var r=Ts(o)?0:Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},s.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(e){let t;try{t=Q(e)instanceof HTMLInputElement}catch{t=!1}return t},s.wbg.__wbg_style_e06c9e03355741e9=function(e){const t=Q(e).style;return Je(t)},s.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(e){return Q(e).offsetLeft},s.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(e){return Q(e).offsetTop},s.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(e){return Q(e).offsetWidth},s.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(e){return Q(e).offsetHeight},s.wbg.__wbg_before_ac3792b457802cbf=function(){return Xi(function(e,t){Q(e).before(Q(t))},arguments)},s.wbg.__wbindgen_object_clone_ref=function(e){const t=Q(e);return Je(t)},s.wbg.__wbg_setvalue_688819688274bec0=function(e,t,i){Q(e).value=Ks(t,i)},s.wbg.__wbg_data_edba00a6420faae3=function(e,t){const i=Q(t).data;var n=Ts(i)?0:Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_isComposing_ca7496e67564f5b9=function(e){return Q(e).isComposing},s.wbg.__wbg_inputType_dc144c8251b0d194=function(e,t){const i=Q(t).inputType,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(e){Q(e).preventDefault()},s.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(e){return Q(e).isComposing},s.wbg.__wbg_key_a626396efbca2b95=function(e,t){const i=Q(t).key,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_shiftKey_f38dee34420e0d62=function(e){return Q(e).shiftKey},s.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(e){return Q(e).ctrlKey},s.wbg.__wbg_altKey_5a6eb49ec8194792=function(e){return Q(e).altKey},s.wbg.__wbg_getModifierState_fde3eed099a4880a=function(e,t,i){return Q(e).getModifierState(Ks(t,i))},s.wbg.__wbg_repeat_8451a79b3608855b=function(e){return Q(e).repeat},s.wbg.__wbg_clipboardData_93c130a72996456a=function(e){const t=Q(e).clipboardData;return Ts(t)?0:Je(t)},s.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return Xi(function(e,t,i,n){const o=Q(t).getData(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(e){let t;try{t=Q(e)instanceof CanvasRenderingContext2D}catch{t=!1}return t},s.wbg.__wbg_setfont_931e1f36bec6a342=function(e,t,i){Q(e).font=Ks(t,i)},s.wbg.__wbindgen_string_new=function(e,t){const i=Ks(e,t);return Je(i)},s.wbg.__wbg_setfillStyle_98060f7b257936ba=function(e,t){Q(e).fillStyle=Q(t)},s.wbg.__wbg_id_8071f78aa2301217=function(e,t){const i=Q(t).id,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(e){return Q(e).naturalWidth},s.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(e){return Q(e).naturalHeight},s.wbg.__wbg_currentSrc_299fcc32125efadb=function(e,t){const i=Q(t).currentSrc,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new0_65387337a95cf44d=function(){return Je(new Date)},s.wbg.__wbg_getTime_91058879093a1589=function(e){return Q(e).getTime()},s.wbg.__wbindgen_number_new=function(e){return Je(e)},s.wbg.__wbg_new_7982fb43cfca37ae=function(e){const t=new Date(Q(e));return Je(t)},s.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(e){return Q(e).getTimezoneOffset()},s.wbg.__wbg_src_707c2de7cbb580c7=function(e,t){const i=Q(t).src,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_0d5e77f348d88b87=function(){return Xi(function(){const e=new Image;return Je(e)},arguments)},s.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(e,t,i){Q(e).crossOrigin=t===0?void 0:Ks(t,i)},s.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(e,t){Q(e).onload=Q(t)},s.wbg.__wbg_setsrc_129ba95151116b01=function(e,t,i){Q(e).src=Ks(t,i)},s.wbg.__wbg_log_2f54632e0e18c089=function(e,t){console.log(Ks(e,t))},s.wbg.__wbg_cullFace_ccad99c645b704eb=function(e,t){Q(e).cullFace(t>>>0)},s.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(e,t){Q(e).cullFace(t>>>0)},s.wbg.__wbg_frontFace_358bf8c6c5159d54=function(e,t){Q(e).frontFace(t>>>0)},s.wbg.__wbg_frontFace_54ccf43770ae1011=function(e,t){Q(e).frontFace(t>>>0)},s.wbg.__wbg_bufferData_0db2a74470353a96=function(e,t,i,n){Q(e).bufferData(t>>>0,Q(i),n>>>0)},s.wbg.__wbg_bufferData_94ce174a81b32961=function(e,t,i,n){Q(e).bufferData(t>>>0,Q(i),n>>>0)},s.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(e,t,i,n,o){Q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(e,t,i,n,o){Q(e).blendFuncSeparate(t>>>0,i>>>0,n>>>0,o>>>0)},s.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return Xi(function(e,t,i,n,o,r,a,c){Q(e).readPixels(t,i,n,o,r>>>0,a>>>0,Q(c))},arguments)},s.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return Xi(function(e,t,i,n,o,r,a,c){Q(e).readPixels(t,i,n,o,r>>>0,a>>>0,Q(c))},arguments)},s.wbg.__wbg_setwidth_84b579903fae1a52=function(e,t){Q(e).width=t>>>0},s.wbg.__wbg_setheight_6ae385769cc2e592=function(e,t){Q(e).height=t>>>0},s.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(e,t){Q(e).deleteVertexArray(Q(t))},s.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(e,t){Q(e).deleteVertexArrayOES(Q(t))},s.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(e,t){Q(e).deleteBuffer(Q(t))},s.wbg.__wbg_deleteBuffer_898974b9db136e43=function(e,t){Q(e).deleteBuffer(Q(t))},s.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return Xi(function(e,t,i,n,o,r,a,c){Q(e).texSubImage2D(t>>>0,i,n,o,r>>>0,a>>>0,Q(c))},arguments)},s.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return Xi(function(e,t,i,n,o,r,a,c){Q(e).texSubImage2D(t>>>0,i,n,o,r>>>0,a>>>0,Q(c))},arguments)},s.wbg.__wbg_next_f9cb570345655b9a=function(){return Xi(function(e){const t=Q(e).next();return Je(t)},arguments)},s.wbg.__wbg_done_bfda7aa8f252b39f=function(e){return Q(e).done},s.wbg.__wbg_value_6d39332ab4788d86=function(e){const t=Q(e).value;return Je(t)},s.wbg.__wbg_iterator_888179a48810a9fe=function(){return Je(Symbol.iterator)},s.wbg.__wbg_get_224d16597dbbfd96=function(){return Xi(function(e,t){const i=Reflect.get(Q(e),Q(t));return Je(i)},arguments)},s.wbg.__wbindgen_is_function=function(e){return typeof Q(e)=="function"},s.wbg.__wbindgen_is_object=function(e){const t=Q(e);return typeof t=="object"&&t!==null},s.wbg.__wbg_next_de3e9db4440638b2=function(e){const t=Q(e).next;return Je(t)},s.wbg.__wbg_call_1084a111329e68ce=function(){return Xi(function(e,t){const i=Q(e).call(Q(t));return Je(i)},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return Xi(function(e,t,i){const n=Q(e).call(Q(t),Q(i));return Je(n)},arguments)},s.wbg.__wbg_call_c6fe275aaa60da79=function(){return Xi(function(e,t,i,n){const o=Q(e).call(Q(t),Q(i),Q(n));return Je(o)},arguments)},s.wbg.__wbindgen_memory=function(){const e=Vt.memory;return Je(e)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){const t=Q(e).buffer;return Je(t)},s.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(e,t,i){const n=new Uint8Array(Q(e),t>>>0,i>>>0);return Je(n)},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return Q(e).length},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){const t=new Uint8Array(Q(e));return Je(t)},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,i){Q(e).set(Q(t),i>>>0)},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return Xi(function(e,t,i){return Reflect.set(Q(e),Q(t),Q(i))},arguments)},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return Xi(function(){const e=self.self;return Je(e)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return Xi(function(){const e=window.window;return Je(e)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return Xi(function(){const e=globalThis.globalThis;return Je(e)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return Xi(function(){const e=global.global;return Je(e)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return Q(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){const i=new Function(Ks(e,t));return Je(i)},s.wbg.__wbindgen_error_new=function(e,t){const i=new Error(Ks(e,t));return Je(i)},s.wbg.__wbindgen_jsval_loose_eq=function(e,t){return Q(e)==Q(t)},s.wbg.__wbindgen_number_get=function(e,t){const i=Q(t),n=typeof i=="number"?i:void 0;Ti().setFloat64(e+8*1,Ts(n)?0:n,!0),Ti().setInt32(e+4*0,!Ts(n),!0)},s.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(e){let t;try{t=Q(e)instanceof Uint8Array}catch{t=!1}return t},s.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(e){let t;try{t=Q(e)instanceof ArrayBuffer}catch{t=!1}return t},s.wbg.__wbg_entries_7a0e06255456ebcd=function(e){const t=Object.entries(Q(e));return Je(t)},s.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(e){return Number.isSafeInteger(Q(e))},s.wbg.__wbindgen_as_number=function(e){return+Q(e)},s.wbg.__wbg_String_b9412f8799faab3e=function(e,t){const i=String(Q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(Q(e))},s.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(e,t){const i=Q(e)[Q(t)];return Je(i)},s.wbg.__wbindgen_in=function(e,t){return Q(e)in Q(t)},s.wbg.__wbindgen_is_string=function(e){return typeof Q(e)=="string"},s.wbg.__wbg_navigator_6210380287bf8581=function(e){const t=Q(e).navigator;return Je(t)},s.wbg.__wbg_platform_509d898d9dce4c23=function(){return Xi(function(e,t){const i=Q(t).platform,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_previewconnector_new=function(e){const t=sde.__wrap(e);return Je(t)},s.wbg.__wbg_new_a220cf903aa02ca2=function(){const e=new Array;return Je(e)},s.wbg.__wbg_set_f975102236d3c502=function(e,t,i){Q(e)[$p(t)]=$p(i)},s.wbg.__wbg_set_673dda6c73d19609=function(e,t,i){Q(e)[t>>>0]=$p(i)},s.wbg.__wbg_new_8608a2b51a5f6737=function(){return Je(new Map)},s.wbg.__wbg_set_49185437f0ab06f8=function(e,t,i){const n=Q(e).set(Q(t),Q(i));return Je(n)},s.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return Je(t)},s.wbg.__wbindgen_bigint_from_i64=function(e){return Je(e)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var i={a:e,b:t},n=(r,a)=>{const c=i.a;i.a=0;try{return s6e(c,i.b,r,a)}finally{i.a=c}};const o=new Promise(n);return Je(o)}finally{i.a=i.b=0}},s.wbg.__wbindgen_is_bigint=function(e){return typeof Q(e)=="bigint"},s.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const i=Q(t),n=typeof i=="bigint"?i:void 0;Ti().setBigInt64(e+8*1,Ts(n)?BigInt(0):n,!0),Ti().setInt32(e+4*0,!Ts(n),!0)},s.wbg.__wbindgen_jsval_eq=function(e,t){return Q(e)===Q(t)},s.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(e){let t;try{t=Q(e)instanceof Map}catch{t=!1}return t},s.wbg.__wbindgen_throw=function(e,t){throw new Error(Ks(e,t))},s.wbg.__wbindgen_debug_string=function(e,t){const i=w1e(Q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){const t=Q(e).queueMicrotask;return Je(t)},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){const t=Promise.resolve(Q(e));return Je(t)},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,i){const n=Q(e).then(Q(t),Q(i));return Je(n)},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){const i=Q(e).then(Q(t));return Je(i)},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(Q(e))},s.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return Xi(function(e,t,i){const n=Q(e).getExtension(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return Xi(function(e,t,i){const n=Q(e).matchMedia(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return Xi(function(e,t){Q(e).cancelAnimationFrame(t)},arguments)},s.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return Xi(function(e,t){return Q(e).setTimeout(Q(t))},arguments)},s.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return Xi(function(e,t,i){const n=Q(e).createElement(Ks(t,i));return Je(n)},arguments)},s.wbg.__wbg_matches_212d57a200ff58f8=function(){return Xi(function(e,t,i){return Q(e).matches(Ks(t,i))},arguments)},s.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return Xi(function(e,t,i,n,o){Q(e).setAttribute(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_focus_06621101cc79f5d8=function(){return Xi(function(e){Q(e).focus()},arguments)},s.wbg.__wbg_fillText_ae0445d1930428dd=function(){return Xi(function(e,t,i,n,o){Q(e).fillText(Ks(t,i),n,o)},arguments)},s.wbg.__wbg_getContext_69ec873410cbba3c=function(){return Xi(function(e,t,i){const n=Q(e).getContext(Ks(t,i));return Ts(n)?0:Je(n)},arguments)},s.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return Xi(function(e,t){Q(e).addListener(Q(t))},arguments)},s.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return Xi(function(e,t,i,n,o){Q(e).setProperty(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return Xi(function(e,t){URL.revokeObjectURL(Ks(e,t))},arguments)},s.wbg.__wbg_instanceof_Window_5012736c80a01584=function(e){let t;try{t=Q(e)instanceof Window}catch{t=!1}return t},s.wbg.__wbg_setData_41207994e2d54785=function(){return Xi(function(e,t,i,n,o){Q(e).setData(Ks(t,i),Ks(n,o))},arguments)},s.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return Xi(function(e,t,i,n){Q(e).addEventListener(Ks(t,i),Q(n))},arguments)},s.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return Xi(function(e,t,i,n){Q(e).removeEventListener(Ks(t,i),Q(n))},arguments)},s.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return Xi(function(e,t){Q(e).postMessage(Q(t))},arguments)},s.wbg.__wbg_data_ee8c1a738c70cbe1=function(e,t){const i=Q(t).data;var n=Ts(i)?0:Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_new_ebf2727385ee825c=function(){return Xi(function(){const e=new AbortController;return Je(e)},arguments)},s.wbg.__wbg_new_40ff2b042829bc58=function(){return Xi(function(){const e=new MessageChannel;return Je(e)},arguments)},s.wbg.__wbg_performance_a1b8bde2ee512264=function(e){const t=Q(e).performance;return Je(t)},s.wbg.__wbg_now_abd80e969af37148=function(e){return Q(e).now()},s.wbg.__wbg_movementX_ecd0c638be0899eb=function(e){return Q(e).movementX},s.wbg.__wbg_movementY_3064817f736e8151=function(e){return Q(e).movementY},s.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(e){const t=Q(e).scheduler;return Je(t)},s.wbg.__wbg_signal_41e46ccad44bb5e2=function(e){const t=Q(e).signal;return Je(t)},s.wbg.__wbg_postTask_99464245f349be5a=function(e,t,i){const n=Q(e).postTask(Q(t),Q(i));return Je(n)},s.wbg.__wbg_catch_a279b1da46d132d8=function(e,t){const i=Q(e).catch(Q(t));return Je(i)},s.wbg.__wbg_port1_9e11ba1fe63adb21=function(e){const t=Q(e).port1;return Je(t)},s.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(e,t){Q(e).onmessage=Q(t)},s.wbg.__wbg_start_f642a950f6c98a0e=function(e){Q(e).start()},s.wbg.__wbg_port2_7d887905fa4a6677=function(e){const t=Q(e).port2;return Je(t)},s.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return Xi(function(e,t){return Q(e).requestIdleCallback(Q(t))},arguments)},s.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return Xi(function(e,t,i){return Q(e).setTimeout(Q(t),i)},arguments)},s.wbg.__wbg_of_99c2a118200b1e62=function(e,t){const i=Array.of(Q(e),Q(t));return Je(i)},s.wbg.__wbg_of_4a1c869ef05b4b73=function(e){const t=Array.of(Q(e));return Je(t)},s.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return Xi(function(e,t,i){Q(e).postMessage(Q(t),Q(i))},arguments)},s.wbg.__wbg_pointerId_37ae0c4682f85248=function(e){return Q(e).pointerId},s.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return Q(e).matches},s.wbg.__wbg_contentRect_c1a9045c459744d9=function(e){const t=Q(e).contentRect;return Je(t)},s.wbg.__wbg_width_e7964a50b174d035=function(e){return Q(e).width},s.wbg.__wbg_height_cd5c897b4d3fabe3=function(e){return Q(e).height},s.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(e){const t=Q(e).devicePixelContentBoxSize;return Je(t)},s.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(e){return Q(e).inlineSize},s.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(e){return Q(e).blockSize},s.wbg.__wbg_pointerType_d375491a3013a9bc=function(e,t){const i=Q(t).pointerType,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return Q(e).pressure},s.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return Q(e).persisted},s.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return Q(e).isIntersecting},s.wbg.__wbg_buttons_a302533e27733599=function(e){return Q(e).buttons},s.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return Xi(function(e,t){Q(e).setPointerCapture(t)},arguments)},s.wbg.__wbindgen_cb_drop=function(e){const t=$p(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_settype_b6ab7b74bd1908a1=function(e,t,i){Q(e).type=Ks(t,i)},s.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return Xi(function(e,t){const i=new Blob(Q(e),Q(t));return Je(i)},arguments)},s.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return Xi(function(e,t){const i=URL.createObjectURL(Q(t)),n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_prototype_d33365945f23f380=function(){const e=ResizeObserverEntry.prototype;return Je(e)},s.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(e,t){const i=Object.getOwnPropertyDescriptor(Q(e),Q(t));return Je(i)},s.wbg.__wbg_new_25d9d4e2932d816f=function(){return Xi(function(e,t){const i=new Worker(Ks(e,t));return Je(i)},arguments)},s.wbg.__wbg_Window_bd9ec3fee5f673ee=function(e){const t=Q(e).Window;return Je(t)},s.wbg.__wbg_error_9ce09486992d3ac5=function(e,t){console.error(Q(e),Q(t))},s.wbg.__wbg_abort_8659d889a7877ae3=function(e){Q(e).abort()},s.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(e,t){Q(e).cancelIdleCallback(t>>>0)},s.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(e,t){Q(e).clearTimeout(t)},s.wbg.__wbg_close_87d69f9e9fe928c3=function(e){Q(e).close()},s.wbg.__wbg_userAgentData_85a8393570ab7dee=function(e){const t=Q(e).userAgentData;return Ts(t)?0:Je(t)},s.wbg.__wbg_brands_982de08b35281a98=function(e){const t=Q(e).brands;return Je(t)},s.wbg.__wbg_brand_cdcf0249d44027a8=function(e,t){const i=Q(t).brand,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return Xi(function(e,t){const i=Q(t).userAgent,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},arguments)},s.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(e){Q(e).disconnect()},s.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(e){Q(e).disconnect()},s.wbg.__wbg_cancel_cba86749f45f30ae=function(e){Q(e).cancel()},s.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask($p(e))},s.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(e){Q(e).webkitRequestFullscreen()},s.wbg.__wbg_requestFullscreen_24891df6120b675d=function(e){const t=Q(e).requestFullscreen();return Je(t)},s.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(e){const t=Q(e).webkitFullscreenElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(e){const t=Q(e).fullscreenElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_is_009b1ef508712fda=function(e,t){return Object.is(Q(e),Q(t))},s.wbg.__wbg_animate_b321da85ed3f2b4a=function(e,t,i){const n=Q(e).animate(Q(t),Q(i));return Je(n)},s.wbg.__wbg_play_5896e5851ba90aa2=function(e){Q(e).play()},s.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return Xi(function(e,t){Q(e).removeListener(Q(t))},arguments)},s.wbg.__wbg_contains_4f87c5405416b4fd=function(e,t){return Q(e).contains(Q(t))},s.wbg.__wbg_unobserve_e67452df241a602d=function(e,t){Q(e).unobserve(Q(t))},s.wbg.__wbg_observe_101f5cf5a11e9a79=function(e,t){Q(e).observe(Q(t))},s.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(e){Q(e).webkitExitFullscreen()},s.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(e){Q(e).exitFullscreen()},s.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return Xi(function(e,t,i,n){const o=Q(t).getPropertyValue(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return Xi(function(e,t,i,n){const o=Q(t).removeProperty(Ks(i,n)),r=Va(o,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),a=da;Ti().setInt32(e+4*1,a,!0),Ti().setInt32(e+4*0,r,!0)},arguments)},s.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(e){const t=Q(e).visibilityState;return{hidden:0,visible:1}[t]??2},s.wbg.__wbg_body_b3bb488e8e54bf4b=function(e){const t=Q(e).body;return Ts(t)?0:Je(t)},s.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return Xi(function(e,t){const i=Q(e).appendChild(Q(t));return Je(i)},arguments)},s.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return Xi(function(e,t){const i=Q(e).getComputedStyle(Q(t));return Ts(i)?0:Je(i)},arguments)},s.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(e){const t=Q(e).activeElement;return Ts(t)?0:Je(t)},s.wbg.__wbg_new_42acb42ec2ace97c=function(){return Xi(function(e){const t=new ResizeObserver(Q(e));return Je(t)},arguments)},s.wbg.__wbg_setbox_0d838a2d268b7fac=function(e,t){Q(e).box=["border-box","content-box","device-pixel-content-box"][t]},s.wbg.__wbg_observe_60f3631b2f7c6d8b=function(e,t,i){Q(e).observe(Q(t),Q(i))},s.wbg.__wbg_new_d0c6c2df51a6d903=function(){return Xi(function(e){const t=new IntersectionObserver(Q(e));return Je(t)},arguments)},s.wbg.__wbg_observe_c901133fbef21560=function(e,t){Q(e).observe(Q(t))},s.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(e){const t=Q(e).getBoundingClientRect();return Je(t)},s.wbg.__wbg_x_a79a5b516ee71e4c=function(e){return Q(e).x},s.wbg.__wbg_y_bd4e2c0613413655=function(e){return Q(e).y},s.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return Xi(function(e,t){return Q(e).requestAnimationFrame(Q(t))},arguments)},s.wbg.__wbg_scheduler_f38a681d98b5a776=function(e){const t=Q(e).scheduler;return Je(t)},s.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=Q(e).getCoalescedEvents;return Je(t)},s.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=Q(e).requestIdleCallback;return Je(t)},s.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=Q(e).requestFullscreen;return Je(t)},s.wbg.__wbg_button_460cdec9f2512a91=function(e){return Q(e).button},s.wbg.__wbg_offsetX_294898d040917c6b=function(e){return Q(e).offsetX},s.wbg.__wbg_offsetY_f484804b7b03dd86=function(e){return Q(e).offsetY},s.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(e){return Q(e).deltaX},s.wbg.__wbg_deltaY_606f12aa66daba69=function(e){return Q(e).deltaY},s.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(e){return Q(e).deltaMode},s.wbg.__wbg_code_01dc6af887ca9ecb=function(e,t){const i=Q(t).code,n=Va(i,Vt.__wbindgen_malloc,Vt.__wbindgen_realloc),o=da;Ti().setInt32(e+4*1,o,!0),Ti().setInt32(e+4*0,n,!0)},s.wbg.__wbg_location_d7fe3090ad7e80d7=function(e){return Q(e).location},s.wbg.__wbg_metaKey_00fdcfadf1968d45=function(e){return Q(e).metaKey},s.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(e){return Q(e).shiftKey},s.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(e){return Q(e).ctrlKey},s.wbg.__wbg_altKey_d3fbce7596aac8cf=function(e){return Q(e).altKey},s.wbg.__wbg_metaKey_be0158b14b1cef4a=function(e){return Q(e).metaKey},s.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(e){const t=Q(e).getCoalescedEvents();return Je(t)},s.wbg.__wbindgen_closure_wrapper4161=function(e,t,i){const n=Q4(e,t,1618,j4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4163=function(e,t,i){const n=Q4(e,t,1618,j4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4164=function(e,t,i){const n=Q4(e,t,1618,j4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4165=function(e,t,i){const n=Q4(e,t,1618,j4);return Je(n)},s.wbg.__wbindgen_closure_wrapper4166=function(e,t,i){const n=Q4(e,t,1618,j4);return Je(n)},s.wbg.__wbindgen_closure_wrapper6477=function(e,t,i){const n=gv(e,t,1844,n6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper12139=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13307=function(e,t,i){const n=gv(e,t,1844,n6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper13344=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13356=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13362=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13373=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13387=function(e,t,i){const n=gv(e,t,1844,s6e);return Je(n)},s.wbg.__wbindgen_closure_wrapper13411=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13416=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s.wbg.__wbindgen_closure_wrapper13438=function(e,t,i){const n=gv(e,t,1844,pE);return Je(n)},s}function bai(s,e){return Vt=s.exports,Vot.__wbindgen_wasm_module=e,I0=null,$V=null,zV=null,Vt}async function Vot(s){if(Vt!==void 0)return Vt;typeof s<"u"&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof s>"u"&&(s=new URL(""+new URL("slint_lsp_wasm_bg-CQ1FUJ6d.wasm",import.meta.url).href,import.meta.url));const e=vai();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:i}=await _ai(await s,e);return bai(t,i)}function wai(s){return new uai({name:"Slint Language Client",clientOptions:{documentSelector:[{language:"slint"}],errorHandler:{error:()=>({action:o0e.ErrorAction.Continue}),closed:()=>({action:o0e.CloseAction.DoNotRestart})}},connectionProvider:{get:t=>Promise.resolve(s)}})}var d2,h2;class yai{constructor(){Wt(this,d2);Wt(this,h2);const e=new Worker(new URL(""+new URL("lsp_worker-DbrmH7kw.js",import.meta.url).href,import.meta.url),{type:"module"});Ct(this,h2,new Promise(t=>{e.onmessage=i=>{i.data==="OK"&&t(e)}})),Ct(this,d2,Vot({}))}async wait_for_lsp(){const e=Ce(this,h2);Ct(this,h2,null);const t=Ce(this,d2);Ct(this,d2,null);const[i,n]=await Promise.all([t,e]);return Promise.resolve(new Sai(n))}}d2=new WeakMap,h2=new WeakMap;var u2;class Cai{constructor(e){Wt(this,u2);Ct(this,u2,e)}show_ui(){return Ce(this,u2).show_ui()}current_style(){return Ce(this,u2).current_style()}}u2=new WeakMap;var k7,I7,oT,rT,g2,aT;class Sai{constructor(e){Wt(this,k7,null);Wt(this,I7,null);Wt(this,oT);Wt(this,rT);Wt(this,g2);Wt(this,aT,null);Ct(this,oT,e);const t=new Vii(new xne.BrowserMessageReader(Ce(this,oT)),n=>{if(n.method==="slint/lsp_to_preview"){const r=n.params;return Ce(this,aT)?.process_lsp_to_preview_message(r),!0}if(n.method==="slint/load_file"){const o=n,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}return!1}),i=new xne.BrowserMessageWriter(Ce(this,oT));Ct(this,rT,t),Ct(this,g2,i)}get lsp_worker(){return Ce(this,oT)}get lsp_reader(){return Ce(this,rT)}get lsp_writer(){return Ce(this,g2)}set file_reader(e){Ct(this,I7,e)}read_url(e){var t;try{return((t=Ce(this,I7))==null?void 0:t.call(this,e))??Promise.reject()}catch{return Promise.reject("Failed to read file")}}get language_client(){let e=Ce(this,k7);if(e===null){const t=wai({reader:Ce(this,rT),writer:Ce(this,g2)});Ct(this,k7,t),t.start(),Ce(this,rT).onClose(()=>{t.stop()}),e=t}return e}async previewer(e,t){if(Ce(this,aT)===null){try{pai()}catch{}const n=new URLSearchParams(window.location.search).get("SLINT_EXPERIMENTAL_FEATURES");Ct(this,aT,await sde.create(o=>{this.language_client.sendNotification("slint/preview_to_lsp",o)},e,t,n==="1"))}return new Cai(Ce(this,aT))}}k7=new WeakMap,I7=new WeakMap,oT=new WeakMap,rT=new WeakMap,g2=new WeakMap,aT=new WeakMap;const sq="canvas";var cT;const tFe=class tFe extends nt{constructor(t,i,n){super({node:tFe.createNode()});Wt(this,cT,null);this.setFlag(nt.Flag.DisallowLayout),this.addClass("content"),this.addClass("preview"),this.title.label="Preview",this.title.caption="Slint Viewer",this.title.closable=!0,t.previewer(i,n).then(o=>{Ct(this,cT,o),Ce(this,cT).show_ui().then(()=>{console.info("UI should be up!");const r=document.getElementById(sq);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=sq,i.className=sq,i.style.width="100%",i.style.height="100%",i.style.outline="none",i.style.touchAction="none",t.appendChild(i),t}current_style(){return Ce(this,cT)?Ce(this,cT).current_style():""}onResize(t){super.onResize(t);const i=document.getElementById(sq);i.style.width="100%",i.style.height="100%"}onCloseRequest(t){super.onCloseRequest(t),this.dispose()}get contentNode(){return this.node.getElementsByClassName("preview-container")[0]}};cT=new WeakMap;let y1e=tFe;const Aai=new yai,Kf=new rC;function Eai(s){const e=new F_({commands:Kf});e.title.label="Open Demo";for(const t of s.known_demos()){const i="slint:set_demo_"+t[1];Kf.addCommand(i,{label:t[1],execute:()=>s.set_demo(t[0])}),e.addItem({command:i})}return e}function xai(){const s=new F_({commands:Kf});return s.title.label="Settings",Kf.addCommand("slint:store_github_token",{label:"Manage Github login",iconClass:"fa-brands fa-github",execute:()=>{yst()}}),s.addItem({command:"slint:store_github_token"}),s}function Dai(s,e){const t=new F_({commands:Kf});return t.title.label="Project",Kf.addCommand("slint:open_url",{label:"Open URL",iconClass:"fa fa-link",mnemonic:1,execute:()=>{const i=prompt("Please enter the URL to open");s.project_from_url(i)}}),Kf.addKeyBinding({keys:["Accel O"],selector:"body",command:"slint:open_url"}),Kf.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"),s.add_empty_file_to_project(i))}}),Kf.addKeyBinding({keys:["Accel N"],selector:"body",command:"slint:add_file"}),t.addItem({command:"slint:open_url"}),t.addItem({type:"submenu",submenu:Eai(s)}),t.addItem({type:"separator"}),t.addItem({command:"slint:add_file"}),t.addItem({type:"submenu",submenu:kai(s,e)}),t.addItem({type:"separator"}),t.addItem({type:"submenu",submenu:xai()}),t.addItem({type:"separator"}),Kf.addCommand("slint:about",{label:"About",iconClass:"fa-info-circle",execute:()=>pXt()}),t.addItem({command:"slint:about"}),t}function kai(s,e){const t=new F_({commands:Kf});return t.title.label="Share",Kf.addCommand("slint:copy_permalink",{label:"Copy Permalink to Clipboard",iconClass:"fa fa-share",mnemonic:1,isEnabled:()=>s.open_document_urls.length===1,execute:()=>{const i=new URLSearchParams;i.set("snippet",s.current_editor_content),i.set("style",e.current_style());const n=new URL(window.location.toString());n.search=i.toString(),B3e(n.toString())}}),Kf.addCommand("slint:create_gist",{label:"Export to github Gist",iconClass:"fa-brands fa-github",mnemonic:1,isEnabled:()=>s.open_document_urls.length>0,execute:async()=>{let i=DDe();i||await yst(),i=DDe(),i?await fXt((n,o)=>{vXt(s,n,o).then(r=>{const a=new URLSearchParams;a.set("load_url",r);const c=new URL(window.location.toString());c.search=a.toString(),B3e(r,c.toString())}).catch(r=>gXt(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 Iai=new URLSearchParams(window.location.search),Tai=Iai.get("style");function Lai(s){const e=new Uii(s),t=new y1e(s,o=>e.map_url(o),Tai??""),i=new q$;i.id="menuBar",i.addMenu(Dai(e,t));const n=new VH({orientation:"horizontal"});n.id="main",n.addWidget(e),n.addWidget(t),window.onresize=()=>{n.update()},document.addEventListener("keydown",o=>{Kf.processKeydownEvent(o)}),nt.attach(i,document.body),nt.attach(n,document.body)}function Rai(){Fii().then(s=>{Aai.wait_for_lsp().then(e=>{Lai(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(s=>{console.info("Monaco fail:",s)})}window.onload=Rai;export{sd as c,MAi as g}; diff --git a/snapshots/master/editor/assets/index-D528k8VQ.js b/snapshots/master/editor/assets/index-Fv_728R0.js similarity index 99% rename from snapshots/master/editor/assets/index-D528k8VQ.js rename to snapshots/master/editor/assets/index-Fv_728R0.js index 3991a5b72..20b9d6f4c 100644 --- a/snapshots/master/editor/assets/index-D528k8VQ.js +++ b/snapshots/master/editor/assets/index-Fv_728R0.js @@ -1,4 +1,4 @@ -import{g as v1}from"./index-dbwEMpxN.js";function T1(r,o){for(var i=0;ih[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var Y={},p={detecting:0,foundIt:1,notMe:2,start:0,error:1,itsMe:2,SHORTCUT_THRESHOLD:.95},S1=p;function b1(){this.reset=function(){this._mState=S1.detecting},this.getCharsetName=function(){return null},this.getSupportedCharsetNames=function(){throw new Error("Unimplemented method getSupportedCharsetNames()")},this.feed=function(r){},this.getState=function(){return this._mState},this.getConfidence=function(){return 0},this.filterHighBitOnly=function(r){return r=r.replace(/[\x00-\x7F]+/g," "),r},this.filterWithoutEnglishLetters=function(r){return r=r.replace(/[A-Za-z]+/g," "),r},this.removeXmlTags=function(r){for(var o="",i=!1,h=0,a=0;a"&&r[a-1]!=="?"?(h=a+1,i=!1):n=="<"&&r[a+1]!=="?"&&(a>h&&!i&&(o=o+r.substring(h,a)+" "),i=!0)}return i||(o=o+r.substring(h)),o}}var k=b1,R={};R.log=function(){};R.setLogger=function(o){R.enabled=!0,R.log=o};var Z=p,P0=k,T0=R;function u0(){P0.apply(this);var r=this;function o(){r._mActiveNum=0,r._mProbers=[],r._mBestGuessProber=null}this.reset=function(){u0.prototype.reset.apply(this),this._mActiveNum=0;for(var i=0,h;h=this._mProbers[i];i++)h&&(h.reset(),h.active=!0,this._mActiveNum++);this._mBestGuessProber=null},this.getCharsetName=function(){return!this._mBestGuessProber&&(this.getConfidence(),!this._mBestGuessProber)?null:this._mBestGuessProber.getCharsetName()},this.getSupportedCharsetNames=function(){throw new Error("Unimplemented method getSupportedCharsetNames()")},this.feed=function(i){for(var h=0,a;a=this._mProbers[h];h++)if(!(!a||!a.active)){var n=a.feed(i);if(n){if(n==Z.foundIt)return this._mBestGuessProber=a,this.getState();if(n==Z.notMe&&(a.active=!1,this._mActiveNum--,this._mActiveNum<=0))return this._mState=Z.notMe,this.getState()}}return this.getState()},this.getConfidence=function(){var i=this.getState();if(i==Z.foundIt)return .99;if(i==Z.notMe)return .01;var h=0;this._mBestGuessProber=null;for(var a=0,n;n=this._mProbers[a];a++)if(n){if(!n.active){T0.log(n.getCharsetName()+` not active +import{g as v1}from"./index-CkfPwF5r.js";function T1(r,o){for(var i=0;ih[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var Y={},p={detecting:0,foundIt:1,notMe:2,start:0,error:1,itsMe:2,SHORTCUT_THRESHOLD:.95},S1=p;function b1(){this.reset=function(){this._mState=S1.detecting},this.getCharsetName=function(){return null},this.getSupportedCharsetNames=function(){throw new Error("Unimplemented method getSupportedCharsetNames()")},this.feed=function(r){},this.getState=function(){return this._mState},this.getConfidence=function(){return 0},this.filterHighBitOnly=function(r){return r=r.replace(/[\x00-\x7F]+/g," "),r},this.filterWithoutEnglishLetters=function(r){return r=r.replace(/[A-Za-z]+/g," "),r},this.removeXmlTags=function(r){for(var o="",i=!1,h=0,a=0;a"&&r[a-1]!=="?"?(h=a+1,i=!1):n=="<"&&r[a+1]!=="?"&&(a>h&&!i&&(o=o+r.substring(h,a)+" "),i=!0)}return i||(o=o+r.substring(h)),o}}var k=b1,R={};R.log=function(){};R.setLogger=function(o){R.enabled=!0,R.log=o};var Z=p,P0=k,T0=R;function u0(){P0.apply(this);var r=this;function o(){r._mActiveNum=0,r._mProbers=[],r._mBestGuessProber=null}this.reset=function(){u0.prototype.reset.apply(this),this._mActiveNum=0;for(var i=0,h;h=this._mProbers[i];i++)h&&(h.reset(),h.active=!0,this._mActiveNum++);this._mBestGuessProber=null},this.getCharsetName=function(){return!this._mBestGuessProber&&(this.getConfidence(),!this._mBestGuessProber)?null:this._mBestGuessProber.getCharsetName()},this.getSupportedCharsetNames=function(){throw new Error("Unimplemented method getSupportedCharsetNames()")},this.feed=function(i){for(var h=0,a;a=this._mProbers[h];h++)if(!(!a||!a.active)){var n=a.feed(i);if(n){if(n==Z.foundIt)return this._mBestGuessProber=a,this.getState();if(n==Z.notMe&&(a.active=!1,this._mActiveNum--,this._mActiveNum<=0))return this._mState=Z.notMe,this.getState()}}return this.getState()},this.getConfidence=function(){var i=this.getState();if(i==Z.foundIt)return .99;if(i==Z.notMe)return .01;var h=0;this._mBestGuessProber=null;for(var a=0,n;n=this._mProbers[a];a++)if(n){if(!n.active){T0.log(n.getCharsetName()+` not active `);continue}var l=n.getConfidence();T0.log(n.getCharsetName()+" confidence = "+l+` `),hx.SHORTCUT_THRESHOLD&&(this._mState=x.foundIt),this.getState()},this.getConfidence=function(){return this._mDistributionAnalyzer.getConfidence()}}C0.prototype=new N0;var j=C0,T=p,O1=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0],y1=[T.error,T.start,T.start,3,T.error,T.error,T.error,T.error,T.error,T.error,T.itsMe,T.itsMe,T.itsMe,T.itsMe,T.itsMe,T.error,T.error,T.start,T.start,T.start,T.start,T.start,T.start,T.start],E1=[0,1,1,2,0],I1={classTable:O1,classFactor:5,stateTable:y1,charLenTable:E1,name:"Big5"},P={},t0={};t0.JIS_TYPICAL_DISTRIBUTION_RATIO=3;t0.JIS_TABLE_SIZE=4368;t0.JISCharToFreqOrder=[40,1,6,182,152,180,295,2127,285,381,3295,4304,3068,4606,3165,3510,3511,1822,2785,4607,1193,2226,5070,4608,171,2996,1247,18,179,5071,856,1661,1262,5072,619,127,3431,3512,3230,1899,1700,232,228,1294,1298,284,283,2041,2042,1061,1062,48,49,44,45,433,434,1040,1041,996,787,2997,1255,4305,2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928,5081,3296,3432,290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375,1691,3297,4306,4307,4611,452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472,598,618,820,1205,1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172,1875,2043,2149,1793,1382,2973,925,2404,1067,1241,960,1377,2935,1491,919,1217,1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804,2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998,3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161,26,3377,2,3929,20,3691,47,4100,50,17,16,35,268,27,243,42,155,24,154,29,184,4,91,14,92,53,396,33,289,9,37,64,620,21,39,321,5,12,11,52,13,3,208,138,0,7,60,526,141,151,1069,181,275,1591,83,132,1475,126,331,829,15,69,160,59,22,157,55,1079,312,109,38,23,25,10,19,79,5195,61,382,1124,8,30,5196,5197,5198,5199,5200,5201,5202,5203,5204,5205,5206,89,62,74,34,2416,112,139,196,271,149,84,607,131,765,46,88,153,683,76,874,101,258,57,80,32,364,121,1508,169,1547,68,235,145,2999,41,360,3027,70,63,31,43,259,262,1383,99,533,194,66,93,846,217,192,56,106,58,565,280,272,311,256,146,82,308,71,100,128,214,655,110,261,104,1140,54,51,36,87,67,3070,185,2618,2936,2020,28,1066,2390,2059,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238,5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247,4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,363,642,2787,2878,2788,2789,2316,3232,2317,3434,2011,165,1942,3930,3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,2044,2060,4621,997,1235,473,1186,4622,920,3378,6115,6116,379,1108,4313,2657,2735,3934,6117,3809,636,3233,573,1026,3693,3435,2974,3300,2298,4105,854,2937,2463,393,2581,2417,539,752,1280,2750,2480,140,1161,440,708,1569,665,2497,1746,1291,1523,3e3,164,1603,847,1331,537,1997,486,508,1693,2418,1970,2227,878,1220,299,1030,969,652,2751,624,1137,3301,2619,65,3302,2045,1761,1859,3120,1930,3694,3516,663,1767,852,835,3695,269,767,2826,2339,1305,896,1150,770,1616,6118,506,1502,2075,1012,2519,775,2520,2975,2340,2938,4314,3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557,175,597,985,3517,2419,2521,1416,3029,585,938,1931,1007,1052,1932,1685,6120,3379,4316,4623,804,599,3121,1333,2128,2539,1159,1554,2032,3810,687,2033,2904,952,675,1467,3436,6121,2241,1096,1786,2440,1543,1924,980,1813,2228,781,2692,1879,728,1918,3696,4624,548,1950,4625,1809,1088,1356,3303,2522,1944,502,972,373,513,2827,586,2377,2391,1003,1976,1631,6122,2464,1084,648,1776,4626,2141,324,962,2012,2177,2076,1384,742,2178,1448,1173,1810,222,102,301,445,125,2420,662,2498,277,200,1476,1165,1068,224,2562,1378,1446,450,1880,659,791,582,4627,2939,3936,1516,1274,555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229,412,2114,1900,2392,3518,512,2597,427,1925,2341,3122,1653,1686,2465,2499,697,330,273,380,2162,951,832,780,991,1301,3073,965,2270,3519,668,2523,2636,1286,535,1407,518,671,957,2658,2378,267,611,2197,3030,6123,248,2299,967,1799,2356,850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879,2829,499,2179,676,4629,557,2329,2214,2090,325,3234,464,811,3001,992,2342,2481,1232,1469,303,2242,466,1070,2163,603,1777,2091,4630,2752,4631,2714,322,2659,1964,1768,481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849,2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634,1604,943,1724,1454,917,868,2215,1169,2940,552,1145,1800,1228,1823,1955,316,1080,2510,361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127,541,1263,1229,1148,2540,545,465,1833,2880,3438,1901,3074,2482,816,3937,713,1788,2500,122,1575,195,1451,2501,1111,6128,859,374,1225,2243,2483,4317,390,1033,3439,3075,2524,1687,266,793,1440,2599,946,779,802,507,897,1081,528,2189,1292,711,1866,1725,1167,1640,753,398,2661,1053,246,348,4318,137,1024,3440,1600,2077,2129,825,4319,698,238,521,187,2300,1157,2423,1641,1605,1464,1610,1097,2541,1260,1436,759,2255,1814,2150,705,3235,409,2563,3304,561,3033,2005,2564,726,1956,2343,3698,4109,949,3812,3813,3520,1669,653,1379,2525,881,2198,632,2256,1027,778,1074,733,1957,514,1481,2466,554,2180,702,3938,1606,1017,1398,6129,1380,3521,921,993,1313,594,449,1489,1617,1166,768,1426,1360,495,1794,3601,1177,3602,1170,4320,2344,476,425,3167,4635,3168,1424,401,2662,1171,3382,1998,1089,4110,477,3169,474,6130,1909,596,2831,1842,494,693,1051,1028,1207,3076,606,2115,727,2790,1473,1115,743,3522,630,805,1532,4321,2021,366,1057,838,684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090,1536,3939,3523,3306,1455,2199,336,369,2331,1035,584,2393,902,718,2600,6131,2753,463,2151,1149,1611,2467,715,1308,3124,1268,343,1413,3236,1517,1347,2663,2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980,872,2368,2441,2943,320,2369,2116,1082,679,1933,3941,2791,3815,625,1143,2023,422,2200,3816,6133,730,1695,356,2257,1626,2301,2858,2637,1627,1778,937,883,2906,2693,3002,1769,1086,400,1063,1325,3307,2792,4111,3077,456,2345,1046,747,6134,1524,884,1094,3383,1474,2164,1059,974,1688,2181,2258,1047,345,1665,1187,358,875,3170,305,660,3524,2190,1334,1135,3171,1540,1649,2542,1527,927,968,2793,885,1972,1850,482,500,2638,1218,1109,1085,2543,1654,2034,876,78,2287,1482,1277,861,1675,1083,1779,724,2754,454,397,1132,1612,2332,893,672,1237,257,2259,2370,135,3384,337,2244,547,352,340,709,2485,1400,788,1138,2511,540,772,1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533,407,576,3308,1254,2071,978,3385,170,136,1201,3125,2664,3172,2394,213,912,873,3603,1713,2202,699,3604,3699,813,3442,493,531,1054,468,2907,1483,304,281,4112,1726,1252,2094,339,2319,2130,2639,756,1563,2944,748,571,2976,1588,2425,2715,1851,1460,2426,1528,1392,1973,3237,288,3309,685,3386,296,892,2716,2216,1570,2245,722,1747,2217,905,3238,1103,6135,1893,1441,1965,251,1805,2371,3700,2601,1919,1078,75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817,524,706,1075,292,3818,1756,2602,317,98,3173,3605,3525,1844,2218,3819,2502,814,567,385,2908,1534,6137,534,1642,3239,797,6138,1670,1529,953,4323,188,1071,538,178,729,3240,2109,1226,1374,2e3,2357,2977,731,2468,1116,2014,2051,6139,1261,1593,803,2859,2736,3443,556,682,823,1541,6140,1369,2289,1706,2794,845,462,2603,2665,1361,387,162,2358,1740,739,1770,1720,1304,1401,3241,1049,627,1571,2427,3526,1877,3942,1852,1500,431,1910,1503,677,297,2795,286,1433,1038,1198,2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442,108,712,4640,2372,866,3701,2755,3242,1348,834,1945,1408,3527,2395,3243,1811,824,994,1179,2110,1548,1453,790,3003,690,4324,4325,2832,2909,3820,1860,3821,225,1748,310,346,1780,2470,821,1993,2717,2796,828,877,3528,2860,2471,1702,2165,2910,2486,1789,453,359,2291,1676,73,1164,1461,1127,3311,421,604,314,1037,589,116,2487,737,837,1180,111,244,735,6142,2261,1861,1362,986,523,418,581,2666,3822,103,855,503,1414,1867,2488,1091,657,1597,979,605,1316,4641,1021,2443,2078,2001,1209,96,587,2166,1032,260,1072,2153,173,94,226,3244,819,2006,4642,4114,2203,231,1744,782,97,2667,786,3387,887,391,442,2219,4326,1425,6143,2694,633,1544,1202,483,2015,592,2052,1958,2472,1655,419,129,4327,3444,3312,1714,1257,3078,4328,1518,1098,865,1310,1019,1885,1512,1734,469,2444,148,773,436,1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643,579,1238,932,2320,353,205,801,115,2428,944,2321,1881,399,2565,1211,678,766,3944,335,2101,1459,1781,1402,3945,2737,2131,1010,844,981,1326,1013,550,1816,1545,2620,1335,1008,371,2881,936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503,416,1643,4330,806,1126,229,591,3946,1314,1981,1576,1837,1666,347,1790,977,3313,764,2861,1853,688,2429,1920,1462,77,595,415,2002,3034,798,1192,4115,6144,2978,4331,3035,2695,2582,2072,2566,430,2430,1727,842,1396,3947,3702,613,377,278,236,1417,3388,3314,3174,757,1869,107,3530,6145,1194,623,2262,207,1253,2167,3446,3948,492,1117,1935,536,1838,2757,1246,4332,696,2095,2406,1393,1572,3175,1782,583,190,253,1390,2230,830,3126,3389,934,3245,1703,1749,2979,1870,2545,1656,2204,869,2346,4116,3176,1817,496,1764,4644,942,1504,404,1903,1122,1580,3606,2945,1022,515,372,1735,955,2431,3036,6146,2797,1110,2302,2798,617,6147,441,762,1771,3447,3607,3608,1904,840,3037,86,939,1385,572,1370,2445,1336,114,3703,898,294,203,3315,703,1583,2274,429,961,4333,1854,1951,3390,2373,3704,4334,1318,1381,966,1911,2322,1006,1155,309,989,458,2718,1795,1372,1203,252,1689,1363,3177,517,1936,168,1490,562,193,3823,1042,4117,1835,551,470,4645,395,489,3448,1871,1465,2583,2641,417,1493,279,1295,511,1236,1119,72,1231,1982,1812,3004,871,1564,984,3449,1667,2696,2096,4646,2347,2833,1673,3609,695,3246,2668,807,1183,4647,890,388,2333,1801,1457,2911,1765,1477,1031,3316,3317,1278,3391,2799,2292,2526,163,3450,4335,2669,1404,1802,6148,2323,2407,1584,1728,1494,1824,1269,298,909,3318,1034,1632,375,776,1683,2061,291,210,1123,809,1249,1002,2642,3038,206,1011,2132,144,975,882,1565,342,667,754,1442,2143,1299,2303,2062,447,626,2205,1221,2739,2912,1144,1214,2206,2584,760,1715,614,950,1281,2670,2621,810,577,1287,2546,4648,242,2168,250,2643,691,123,2644,647,313,1029,689,1357,2946,1650,216,771,1339,1306,808,2063,549,913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079,406,2671,2117,3949,4649,487,1825,2220,6150,2915,448,2348,1073,6151,2397,1707,130,900,1598,329,176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155,3706,1912,1513,1614,6153,1988,646,392,2304,1589,3320,3039,1826,1239,1352,1340,2916,505,2567,1709,1437,2408,2547,906,6154,2672,384,1458,1594,1100,1329,710,423,3531,2064,2231,2622,1989,2673,1087,1882,333,841,3005,1296,2882,2379,580,1937,1827,1293,2585,601,574,249,1772,4118,2079,1120,645,901,1176,1690,795,2207,478,1434,516,1190,1530,761,2080,930,1264,355,435,1552,644,1791,987,220,1364,1163,1121,1538,306,2169,1327,1222,546,2645,218,241,610,1704,3321,1984,1839,1966,2528,451,6155,2586,3707,2568,907,3178,254,2947,186,1845,4650,745,432,1757,428,1633,888,2246,2221,2489,3611,2118,1258,1265,956,3127,1784,4337,2490,319,510,119,457,3612,274,2035,2007,4651,1409,3128,970,2758,590,2800,661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111,485,2491,1429,1156,6156,2548,2183,1495,831,1840,2529,2446,501,1657,307,1894,3247,1341,666,899,2156,1539,2549,1559,886,349,2208,3081,2305,1736,3824,2170,2759,1014,1913,1386,542,1397,2948,490,368,716,362,159,282,2569,1129,1658,1288,1750,2674,276,649,2016,751,1496,658,1818,1284,1862,2209,2087,2512,3451,622,2834,376,117,1060,2053,1208,1721,1101,1443,247,1250,3179,1792,3952,2760,2398,3953,6157,2144,3708,446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082,424,2222,1251,2449,2119,2836,504,1581,4338,602,817,857,3825,2349,2306,357,3826,1470,1883,2883,255,958,929,2917,3248,302,4653,1050,1271,1751,2307,1952,1430,2697,2719,2359,354,3180,777,158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232,3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428,637,931,2721,2145,914,2550,2587,81,2450,612,827,2646,1242,4655,1118,2884,472,1855,3181,3533,3534,569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152,1938,134,1830,471,3710,2276,1112,1535,3323,3453,3535,982,1337,2950,488,826,674,1058,1628,4120,2017,522,2399,211,568,1367,3454,350,293,1872,1139,3249,1399,1946,3006,1300,2360,3324,588,736,6160,2606,744,669,3536,3828,6161,1358,199,723,848,933,851,1939,1505,1514,1338,1618,1831,4656,1634,3613,443,2740,3829,717,1947,491,1914,6162,2551,1542,4121,1025,6163,1099,1223,198,3040,2722,370,410,1905,2589,998,1248,3182,2380,519,1449,4122,1710,947,928,1153,4341,2277,344,2624,1511,615,105,161,1212,1076,1960,3130,2054,1926,1175,1906,2473,414,1873,2801,6164,2309,315,1319,3325,318,2018,2146,2157,963,631,223,4342,4343,2675,479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886,2184,1674,1330,1711,1635,1506,799,219,3250,3083,3954,1677,3713,3326,2081,3614,1652,2073,4657,1147,3041,1752,643,1961,147,1974,3955,6167,1716,2037,918,3007,1994,120,1537,118,609,3184,4345,740,3455,1219,332,1615,3830,6168,1621,2980,1582,783,212,553,2350,3714,1349,2433,2082,4124,889,6169,2310,1275,1410,973,166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658,629,822,3008,763,940,1990,2862,439,2409,1566,1240,1622,926,1282,1907,2764,654,2210,1607,327,1130,3956,1678,1623,6170,2434,2192,686,608,3831,3715,903,3957,3042,6171,2741,1522,1915,1105,1555,2552,1359,323,3251,4346,3457,738,1354,2553,2311,2334,1828,2003,3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847,520,1204,2607,264,4659,836,2677,2102,600,4660,3833,2278,3084,6174,4347,3615,1342,640,532,543,2608,1888,2400,2591,1009,4348,1497,341,1737,3616,2723,1394,529,3252,1321,983,4661,1515,2120,971,2592,924,287,1662,3186,4349,2700,4350,1519,908,1948,2452,156,796,1629,1486,2223,2055,694,4126,1259,1036,3392,1213,2249,2742,1889,1230,3958,1015,910,408,559,3617,4662,746,725,935,4663,3959,3009,1289,563,867,4664,3960,1567,2981,2038,2626,988,2263,2381,4351,143,2374,704,1895,6175,1188,3716,2088,673,3085,2362,4352,484,1608,1921,2765,2918,215,904,3618,3537,894,509,976,3043,2701,3961,4353,2837,2982,498,6176,6177,1102,3538,1332,3393,1487,1636,1637,233,245,3962,383,650,995,3044,460,1520,1206,2352,749,3327,530,700,389,1438,1560,1773,3963,2264,719,2951,2724,3834,870,1832,1644,1e3,839,2474,3717,197,1630,3394,365,2886,3964,1285,2133,734,922,818,1106,732,480,2083,1774,3458,923,2279,1350,221,3086,85,2233,2234,3835,1585,3010,2147,1387,1705,2382,1619,2475,133,239,2802,1991,1016,2084,2383,411,2838,1113,651,1985,1160,3328,990,1863,3087,1048,1276,2647,265,2627,1599,3253,2056,150,638,2019,656,853,326,1479,680,1439,4354,1001,1759,413,3459,3395,2492,1431,459,4355,1125,3329,2265,1953,1450,2065,2863,849,351,2678,3131,3254,3255,1104,1577,227,1351,1645,2453,2193,1421,2887,812,2121,634,95,2435,201,2312,4665,1646,1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189,328,2679,1077,1940,1136,558,1283,964,1195,621,2074,1199,1743,3460,3619,1896,1916,1890,3836,2952,1154,2112,1064,862,378,3011,2066,2113,2803,1568,2839,6178,3088,2919,1941,1660,2004,1992,2194,142,707,1590,1708,1624,1922,1023,1836,1233,1004,2313,789,741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721,593,2840,367,2920,1878,6180,3461,1521,628,1168,692,2211,2649,300,720,2067,2571,2953,3396,959,2504,3966,3539,3462,1977,701,6181,954,1043,800,681,183,3722,1803,1730,3540,4128,2103,815,2314,174,467,230,2454,1093,2134,755,3541,3397,1141,1162,6182,1738,2039,270,3256,2513,1005,1647,2185,3837,858,1679,1897,1719,2954,2324,1806,402,670,167,4129,1498,2158,2104,750,6183,915,189,1680,1551,455,4356,1501,2455,405,1095,2955,338,1586,1266,1819,570,641,1324,237,1556,2650,1388,3723,6184,1368,2384,1343,1978,3089,2436,879,3724,792,1191,758,3012,1411,2135,1322,4357,240,4667,1848,3725,1574,6185,420,3045,1546,1391,714,4358,1967,941,1864,863,664,426,560,1731,2680,1785,2864,1949,2363,403,3330,1415,1279,2136,1697,2335,204,721,2097,3838,90,6186,2085,2505,191,3967,124,2148,1376,1798,1178,1107,1898,1405,860,4359,1243,1272,2375,2983,1558,2456,1638,113,3621,578,1923,2609,880,386,4130,784,2186,2266,1422,2956,2172,1722,497,263,2514,1267,2412,2610,177,2703,3542,774,1927,1344,616,1432,1595,1018,172,4360,2325,911,4361,438,1468,3622,794,3968,2024,2173,1681,1829,2957,945,895,3090,575,2212,2476,475,2401,2681,785,2744,1745,2293,2555,1975,3133,2865,394,4668,3839,635,4131,639,202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457,3727,3134,4362,843,2611,437,916,4669,234,769,1884,3046,3047,3623,833,6187,1639,2250,2402,1355,1185,2010,2047,999,525,1732,1290,1488,2612,948,1578,3728,2413,2477,1216,2725,2159,334,3840,1328,3624,2921,1525,4132,564,1056,891,4363,1444,1698,2385,2251,3729,1365,2281,2235,1717,6188,864,3841,2515,444,527,2767,2922,3625,544,461,6189,566,209,2437,3398,2098,1065,2068,3331,3626,3257,2137,2138,2122,3730,2888,1995,1820,1044,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,4670,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,3187,6238,6239,3969,6240,6241,6242,6243,6244,4671,6245,6246,4672,6247,6248,4133,6249,6250,4364,6251,2923,2556,2613,4673,4365,3970,6252,6253,6254,6255,4674,6256,6257,6258,2768,2353,4366,4675,4676,3188,4367,3463,6259,4134,4677,4678,6260,2267,6261,3842,3332,4368,3543,6262,6263,6264,3013,1954,1928,4135,4679,6265,6266,2478,3091,6267,4680,4369,6268,6269,1699,6270,3544,4136,4681,6271,4137,6272,4370,2804,6273,6274,2593,3971,3972,4682,6275,2236,4683,6276,6277,4684,6278,6279,4138,3973,4685,6280,6281,3258,6282,6283,6284,6285,3974,4686,2841,3975,6286,6287,3545,6288,6289,4139,4687,4140,6290,4141,6291,4142,6292,6293,3333,6294,6295,6296,4371,6297,3399,6298,6299,4372,3976,6300,6301,6302,4373,6303,6304,3843,3731,6305,4688,4374,6306,6307,3259,2294,6308,3732,2530,4143,6309,4689,6310,6311,6312,3048,6313,6314,4690,3733,2237,6315,6316,2282,3334,6317,6318,3844,6319,6320,4691,6321,3400,4692,6322,4693,6323,3049,6324,4375,6325,3977,6326,6327,6328,3546,6329,4694,3335,6330,4695,4696,6331,6332,6333,6334,4376,3978,6335,4697,3979,4144,6336,3980,4698,6337,6338,6339,6340,6341,4699,4700,4701,6342,6343,4702,6344,6345,4703,6346,6347,4704,6348,4705,4706,3135,6349,4707,6350,4708,6351,4377,6352,4709,3734,4145,6353,2506,4710,3189,6354,3050,4711,3981,6355,3547,3014,4146,4378,3735,2651,3845,3260,3136,2224,1986,6356,3401,6357,4712,2594,3627,3137,2573,3736,3982,4713,3628,4714,4715,2682,3629,4716,6358,3630,4379,3631,6359,6360,6361,3983,6362,6363,6364,6365,4147,3846,4717,6366,6367,3737,2842,6368,4718,2628,6369,3261,6370,2386,6371,6372,3738,3984,4719,3464,4720,3402,6373,2924,3336,4148,2866,6374,2805,3262,4380,2704,2069,2531,3138,2806,2984,6375,2769,6376,4721,4722,3403,6377,6378,3548,6379,6380,2705,3092,1979,4149,2629,3337,2889,6381,3338,4150,2557,3339,4381,6382,3190,3263,3739,6383,4151,4723,4152,2558,2574,3404,3191,6384,6385,4153,6386,4724,4382,6387,6388,4383,6389,6390,4154,6391,4725,3985,6392,3847,4155,6393,6394,6395,6396,6397,3465,6398,4384,6399,6400,6401,6402,6403,6404,4156,6405,6406,6407,6408,2123,6409,6410,2326,3192,4726,6411,6412,6413,6414,4385,4157,6415,6416,4158,6417,3093,3848,6418,3986,6419,6420,3849,6421,6422,6423,4159,6424,6425,4160,6426,3740,6427,6428,6429,6430,3987,6431,4727,6432,2238,6433,6434,4386,3988,6435,6436,3632,6437,6438,2843,6439,6440,6441,6442,3633,6443,2958,6444,6445,3466,6446,2364,4387,3850,6447,4388,2959,3340,6448,3851,6449,4728,6450,6451,3264,4729,6452,3193,6453,4389,4390,2706,3341,4730,6454,3139,6455,3194,6456,3051,2124,3852,1602,4391,4161,3853,1158,3854,4162,3989,4392,3990,4731,4732,4393,2040,4163,4394,3265,6457,2807,3467,3855,6458,6459,6460,3991,3468,4733,4734,6461,3140,2960,6462,4735,6463,6464,6465,6466,4736,4737,4738,4739,6467,6468,4164,2403,3856,6469,6470,2770,2844,6471,4740,6472,6473,6474,6475,6476,6477,6478,3195,6479,4741,4395,6480,2867,6481,4742,2808,6482,2493,4165,6483,6484,6485,6486,2295,4743,6487,6488,6489,3634,6490,6491,6492,6493,6494,6495,6496,2985,4744,6497,6498,4745,6499,6500,2925,3141,4166,6501,6502,4746,6503,6504,4747,6505,6506,6507,2890,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,3469,4167,6520,6521,6522,4748,4396,3741,4397,4749,4398,3342,2125,4750,6523,4751,4752,4753,3052,6524,2961,4168,6525,4754,6526,4755,4399,2926,4169,6527,3857,6528,4400,4170,6529,4171,6530,6531,2595,6532,6533,6534,6535,3635,6536,6537,6538,6539,6540,6541,6542,4756,6543,6544,6545,6546,6547,6548,4401,6549,6550,6551,6552,4402,3405,4757,4403,6553,6554,6555,4172,3742,6556,6557,6558,3992,3636,6559,6560,3053,2726,6561,3549,4173,3054,4404,6562,6563,3993,4405,3266,3550,2809,4406,6564,6565,6566,4758,4759,6567,3743,6568,4760,3744,4761,3470,6569,6570,6571,4407,6572,3745,4174,6573,4175,2810,4176,3196,4762,6574,4177,6575,6576,2494,2891,3551,6577,6578,3471,6579,4408,6580,3015,3197,6581,3343,2532,3994,3858,6582,3094,3406,4409,6583,2892,4178,4763,4410,3016,4411,6584,3995,3142,3017,2683,6585,4179,6586,6587,4764,4412,6588,6589,4413,6590,2986,6591,2962,3552,6592,2963,3472,6593,6594,4180,4765,6595,6596,2225,3267,4414,6597,3407,3637,4766,6598,6599,3198,6600,4415,6601,3859,3199,6602,3473,4767,2811,4416,1856,3268,3200,2575,3996,3997,3201,4417,6603,3095,2927,6604,3143,6605,2268,6606,3998,3860,3096,2771,6607,6608,3638,2495,4768,6609,3861,6610,3269,2745,4769,4181,3553,6611,2845,3270,6612,6613,6614,3862,6615,6616,4770,4771,6617,3474,3999,4418,4419,6618,3639,3344,6619,4772,4182,6620,2126,6621,6622,6623,4420,4773,6624,3018,6625,4774,3554,6626,4183,2025,3746,6627,4184,2707,6628,4421,4422,3097,1775,4185,3555,6629,6630,2868,6631,6632,4423,6633,6634,4424,2414,2533,2928,6635,4186,2387,6636,4775,6637,4187,6638,1891,4425,3202,3203,6639,6640,4776,6641,3345,6642,6643,3640,6644,3475,3346,3641,4e3,6645,3144,6646,3098,2812,4188,3642,3204,6647,3863,3476,6648,3864,6649,4426,4001,6650,6651,6652,2576,6653,4189,4777,6654,6655,6656,2846,6657,3477,3205,4002,6658,4003,6659,3347,2252,6660,6661,6662,4778,6663,6664,6665,6666,6667,6668,6669,4779,4780,2048,6670,3478,3099,6671,3556,3747,4004,6672,6673,6674,3145,4005,3748,6675,6676,6677,6678,6679,3408,6680,6681,6682,6683,3206,3207,6684,6685,4781,4427,6686,4782,4783,4784,6687,6688,6689,4190,6690,6691,3479,6692,2746,6693,4428,6694,6695,6696,6697,6698,6699,4785,6700,6701,3208,2727,6702,3146,6703,6704,3409,2196,6705,4429,6706,6707,6708,2534,1996,6709,6710,6711,2747,6712,6713,6714,4786,3643,6715,4430,4431,6716,3557,6717,4432,4433,6718,6719,6720,6721,3749,6722,4006,4787,6723,6724,3644,4788,4434,6725,6726,4789,2772,6727,6728,6729,6730,6731,2708,3865,2813,4435,6732,6733,4790,4791,3480,6734,6735,6736,6737,4436,3348,6738,3410,4007,6739,6740,4008,6741,6742,4792,3411,4191,6743,6744,6745,6746,6747,3866,6748,3750,6749,6750,6751,6752,6753,6754,6755,3867,6756,4009,6757,4793,4794,6758,2814,2987,6759,6760,6761,4437,6762,6763,6764,6765,3645,6766,6767,3481,4192,6768,3751,6769,6770,2174,6771,3868,3752,6772,6773,6774,4193,4795,4438,3558,4796,4439,6775,4797,6776,6777,4798,6778,4799,3559,4800,6779,6780,6781,3482,6782,2893,6783,6784,4194,4801,4010,6785,6786,4440,6787,4011,6788,6789,6790,6791,6792,6793,4802,6794,6795,6796,4012,6797,6798,6799,6800,3349,4803,3483,6801,4804,4195,6802,4013,6803,6804,4196,6805,4014,4015,6806,2847,3271,2848,6807,3484,6808,6809,6810,4441,6811,4442,4197,4443,3272,4805,6812,3412,4016,1579,6813,6814,4017,6815,3869,6816,2964,6817,4806,6818,6819,4018,3646,6820,6821,4807,4019,4020,6822,6823,3560,6824,6825,4021,4444,6826,4198,6827,6828,4445,6829,6830,4199,4808,6831,6832,6833,3870,3019,2458,6834,3753,3413,3350,6835,4809,3871,4810,3561,4446,6836,6837,4447,4811,4812,6838,2459,4448,6839,4449,6840,6841,4022,3872,6842,4813,4814,6843,6844,4815,4200,4201,4202,6845,4023,6846,6847,4450,3562,3873,6848,6849,4816,4817,6850,4451,4818,2139,6851,3563,6852,6853,3351,6854,6855,3352,4024,2709,3414,4203,4452,6856,4204,6857,6858,3874,3875,6859,6860,4819,6861,6862,6863,6864,4453,3647,6865,6866,4820,6867,6868,6869,6870,4454,6871,2869,6872,6873,4821,6874,3754,6875,4822,4205,6876,6877,6878,3648,4206,4455,6879,4823,6880,4824,3876,6881,3055,4207,6882,3415,6883,6884,6885,4208,4209,6886,4210,3353,6887,3354,3564,3209,3485,2652,6888,2728,6889,3210,3755,6890,4025,4456,6891,4825,6892,6893,6894,6895,4211,6896,6897,6898,4826,6899,6900,4212,6901,4827,6902,2773,3565,6903,4828,6904,6905,6906,6907,3649,3650,6908,2849,3566,6909,3567,3100,6910,6911,6912,6913,6914,6915,4026,6916,3355,4829,3056,4457,3756,6917,3651,6918,4213,3652,2870,6919,4458,6920,2438,6921,6922,3757,2774,4830,6923,3356,4831,4832,6924,4833,4459,3653,2507,6925,4834,2535,6926,6927,3273,4027,3147,6928,3568,6929,6930,6931,4460,6932,3877,4461,2729,3654,6933,6934,6935,6936,2175,4835,2630,4214,4028,4462,4836,4215,6937,3148,4216,4463,4837,4838,4217,6938,6939,2850,4839,6940,4464,6941,6942,6943,4840,6944,4218,3274,4465,6945,6946,2710,6947,4841,4466,6948,6949,2894,6950,6951,4842,6952,4219,3057,2871,6953,6954,6955,6956,4467,6957,2711,6958,6959,6960,3275,3101,4843,6961,3357,3569,6962,4844,6963,6964,4468,4845,3570,6965,3102,4846,3758,6966,4847,3878,4848,4849,4029,6967,2929,3879,4850,4851,6968,6969,1733,6970,4220,6971,6972,6973,6974,6975,6976,4852,6977,6978,6979,6980,6981,6982,3759,6983,6984,6985,3486,3487,6986,3488,3416,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,4853,6998,6999,4030,7e3,7001,3211,7002,7003,4221,7004,7005,3571,4031,7006,3572,7007,2614,4854,2577,7008,7009,2965,3655,3656,4855,2775,3489,3880,4222,4856,3881,4032,3882,3657,2730,3490,4857,7010,3149,7011,4469,4858,2496,3491,4859,2283,7012,7013,7014,2365,4860,4470,7015,7016,3760,7017,7018,4223,1917,7019,7020,7021,4471,7022,2776,4472,7023,7024,7025,7026,4033,7027,3573,4224,4861,4034,4862,7028,7029,1929,3883,4035,7030,4473,3058,7031,2536,3761,3884,7032,4036,7033,2966,2895,1968,4474,3276,4225,3417,3492,4226,2105,7034,7035,1754,2596,3762,4227,4863,4475,3763,4864,3764,2615,2777,3103,3765,3658,3418,4865,2296,3766,2815,7036,7037,7038,3574,2872,3277,4476,7039,4037,4477,7040,7041,4038,7042,7043,7044,7045,7046,7047,2537,7048,7049,7050,7051,7052,7053,7054,4478,7055,7056,3767,3659,4228,3575,7057,7058,4229,7059,7060,7061,3660,7062,3212,7063,3885,4039,2460,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,4866,3768,4867,7075,7076,7077,7078,4868,3358,3278,2653,7079,7080,4479,3886,7081,7082,4869,7083,7084,7085,7086,7087,7088,2538,7089,7090,7091,4040,3150,3769,4870,4041,2896,3359,4230,2930,7092,3279,7093,2967,4480,3213,4481,3661,7094,7095,7096,7097,7098,7099,7100,7101,7102,2461,3770,7103,7104,4231,3151,7105,7106,7107,4042,3662,7108,7109,4871,3663,4872,4043,3059,7110,7111,7112,3493,2988,7113,4873,7114,7115,7116,3771,4874,7117,7118,4232,4875,7119,3576,2336,4876,7120,4233,3419,4044,4877,4878,4482,4483,4879,4484,4234,7121,3772,4880,1045,3280,3664,4881,4882,7122,7123,7124,7125,4883,7126,2778,7127,4485,4486,7128,4884,3214,3887,7129,7130,3215,7131,4885,4045,7132,7133,4046,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,4235,7144,4886,7145,7146,7147,4887,7148,7149,7150,4487,4047,4488,7151,7152,4888,4048,2989,3888,7153,3665,7154,4049,7155,7156,7157,7158,7159,7160,2931,4889,4890,4489,7161,2631,3889,4236,2779,7162,7163,4891,7164,3060,7165,1672,4892,7166,4893,4237,3281,4894,7167,7168,3666,7169,3494,7170,7171,4050,7172,7173,3104,3360,3420,4490,4051,2684,4052,7174,4053,7175,7176,7177,2253,4054,7178,7179,4895,7180,3152,3890,3153,4491,3216,7181,7182,7183,2968,4238,4492,4055,7184,2990,7185,2479,7186,7187,4493,7188,7189,7190,7191,7192,4896,7193,4897,2969,4494,4898,7194,3495,7195,7196,4899,4495,7197,3105,2731,7198,4900,7199,7200,7201,4056,7202,3361,7203,7204,4496,4901,4902,7205,4497,7206,7207,2315,4903,7208,4904,7209,4905,2851,7210,7211,3577,7212,3578,4906,7213,4057,3667,4907,7214,4058,2354,3891,2376,3217,3773,7215,7216,7217,7218,7219,4498,7220,4908,3282,2685,7221,3496,4909,2632,3154,4910,7222,2337,7223,4911,7224,7225,7226,4912,4913,3283,4239,4499,7227,2816,7228,7229,7230,7231,7232,7233,7234,4914,4500,4501,7235,7236,7237,2686,7238,4915,7239,2897,4502,7240,4503,7241,2516,7242,4504,3362,3218,7243,7244,7245,4916,7246,7247,4505,3363,7248,7249,7250,7251,3774,4506,7252,7253,4917,7254,7255,3284,2991,4918,4919,3219,3892,4920,3106,3497,4921,7256,7257,7258,4922,7259,4923,3364,4507,4508,4059,7260,4240,3498,7261,7262,4924,7263,2992,3893,4060,3220,7264,7265,7266,7267,7268,7269,4509,3775,7270,2817,7271,4061,4925,4510,3776,7272,4241,4511,3285,7273,7274,3499,7275,7276,7277,4062,4512,4926,7278,3107,3894,7279,7280,4927,7281,4513,7282,7283,3668,7284,7285,4242,4514,4243,7286,2058,4515,4928,4929,4516,7287,3286,4244,7288,4517,7289,7290,7291,3669,7292,7293,4930,4931,4932,2355,4933,7294,2633,4518,7295,4245,7296,7297,4519,7298,7299,4520,4521,4934,7300,4246,4522,7301,7302,7303,3579,7304,4247,4935,7305,4936,7306,7307,7308,7309,3777,7310,4523,7311,7312,7313,4248,3580,7314,4524,3778,4249,7315,3581,7316,3287,7317,3221,7318,4937,7319,7320,7321,7322,7323,7324,4938,4939,7325,4525,7326,7327,7328,4063,7329,7330,4940,7331,7332,4941,7333,4526,7334,3500,2780,1741,4942,2026,1742,7335,7336,3582,4527,2388,7337,7338,7339,4528,7340,4250,4943,7341,7342,7343,4944,7344,7345,7346,3020,7347,4945,7348,7349,7350,7351,3895,7352,3896,4064,3897,7353,7354,7355,4251,7356,7357,3898,7358,3779,7359,3780,3288,7360,7361,4529,7362,4946,4530,2027,7363,3899,4531,4947,3222,3583,7364,4948,7365,7366,7367,7368,4949,3501,4950,3781,4951,4532,7369,2517,4952,4252,4953,3155,7370,4954,4955,4253,2518,4533,7371,7372,2712,4254,7373,7374,7375,3670,4956,3671,7376,2389,3502,4065,7377,2338,7378,7379,7380,7381,3061,7382,4957,7383,7384,7385,7386,4958,4534,7387,7388,2993,7389,3062,7390,4959,7391,7392,7393,4960,3108,4961,7394,4535,7395,4962,3421,4536,7396,4963,7397,4964,1857,7398,4965,7399,7400,2176,3584,4966,7401,7402,3422,4537,3900,3585,7403,3782,7404,2852,7405,7406,7407,4538,3783,2654,3423,4967,4539,7408,3784,3586,2853,4540,4541,7409,3901,7410,3902,7411,7412,3785,3109,2327,3903,7413,7414,2970,4066,2932,7415,7416,7417,3904,3672,3424,7418,4542,4543,4544,7419,4968,7420,7421,4255,7422,7423,7424,7425,7426,4067,7427,3673,3365,4545,7428,3110,2559,3674,7429,7430,3156,7431,7432,3503,7433,3425,4546,7434,3063,2873,7435,3223,4969,4547,4548,2898,4256,4068,7436,4069,3587,3786,2933,3787,4257,4970,4971,3788,7437,4972,3064,7438,4549,7439,7440,7441,7442,7443,4973,3905,7444,2874,7445,7446,7447,7448,3021,7449,4550,3906,3588,4974,7450,7451,3789,3675,7452,2578,7453,4070,7454,7455,7456,4258,3676,7457,4975,7458,4976,4259,3790,3504,2634,4977,3677,4551,4260,7459,7460,7461,7462,3907,4261,4978,7463,7464,7465,7466,4979,4980,7467,7468,2213,4262,7469,7470,7471,3678,4981,7472,2439,7473,4263,3224,3289,7474,3908,2415,4982,7475,4264,7476,4983,2655,7477,7478,2732,4552,2854,2875,7479,7480,4265,7481,4553,4984,7482,7483,4266,7484,3679,3366,3680,2818,2781,2782,3367,3589,4554,3065,7485,4071,2899,7486,7487,3157,2462,4072,4555,4073,4985,4986,3111,4267,2687,3368,4556,4074,3791,4268,7488,3909,2783,7489,2656,1962,3158,4557,4987,1963,3159,3160,7490,3112,4988,4989,3022,4990,4991,3792,2855,7491,7492,2971,4558,7493,7494,4992,7495,7496,7497,7498,4993,7499,3426,4559,4994,7500,3681,4560,4269,4270,3910,7501,4075,4995,4271,7502,7503,4076,7504,4996,7505,3225,4997,4272,4077,2819,3023,7506,7507,2733,4561,7508,4562,7509,3369,3793,7510,3590,2508,7511,7512,4273,3113,2994,2616,7513,7514,7515,7516,7517,7518,2820,3911,4078,2748,7519,7520,4563,4998,7521,7522,7523,7524,4999,4274,7525,4564,3682,2239,4079,4565,7526,7527,7528,7529,5e3,7530,7531,5001,4275,3794,7532,7533,7534,3066,5002,4566,3161,7535,7536,4080,7537,3162,7538,7539,4567,7540,7541,7542,7543,7544,7545,5003,7546,4568,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,5004,7557,7558,7559,5005,7560,3795,7561,4569,7562,7563,7564,2821,3796,4276,4277,4081,7565,2876,7566,5006,7567,7568,2900,7569,3797,3912,7570,7571,7572,4278,7573,7574,7575,5007,7576,7577,5008,7578,7579,4279,2934,7580,7581,5009,7582,4570,7583,4280,7584,7585,7586,4571,4572,3913,7587,4573,3505,7588,5010,7589,7590,7591,7592,3798,4574,7593,7594,5011,7595,4281,7596,7597,7598,4282,5012,7599,7600,5013,3163,7601,5014,7602,3914,7603,7604,2734,4575,4576,4577,7605,7606,7607,7608,7609,3506,5015,4578,7610,4082,7611,2822,2901,2579,3683,3024,4579,3507,7612,4580,7613,3226,3799,5016,7614,7615,7616,7617,7618,7619,7620,2995,3290,7621,4083,7622,5017,7623,7624,7625,7626,7627,4581,3915,7628,3291,7629,5018,7630,7631,7632,7633,4084,7634,7635,3427,3800,7636,7637,4582,7638,5019,4583,5020,7639,3916,7640,3801,5021,4584,4283,7641,7642,3428,3591,2269,7643,2617,7644,4585,3592,7645,4586,2902,7646,7647,3227,5022,7648,4587,7649,4284,7650,7651,7652,4588,2284,7653,5023,7654,7655,7656,4589,5024,3802,7657,7658,5025,3508,4590,7659,7660,7661,1969,5026,7662,7663,3684,1821,2688,7664,2028,2509,4285,7665,2823,1841,7666,2689,3114,7667,3917,4085,2160,5027,5028,2972,7668,5029,7669,7670,7671,3593,4086,7672,4591,4087,5030,3803,7673,7674,7675,7676,7677,7678,7679,4286,2366,4592,4593,3067,2328,7680,7681,4594,3594,3918,2029,4287,7682,5031,3919,3370,4288,4595,2856,7683,3509,7684,7685,5032,5033,7686,7687,3804,2784,7688,7689,7690,7691,3371,7692,7693,2877,5034,7694,7695,3920,4289,4088,7696,7697,7698,5035,7699,5036,4290,5037,5038,5039,7700,7701,7702,5040,5041,3228,7703,1760,7704,5042,3229,4596,2106,4089,7705,4597,2824,5043,2107,3372,7706,4291,4090,5044,7707,4091,7708,5045,3025,3805,4598,4292,4293,4294,3373,7709,4599,7710,5046,7711,7712,5047,5048,3806,7713,7714,7715,5049,7716,7717,7718,7719,4600,5050,7720,7721,7722,5051,7723,4295,3429,7724,7725,7726,7727,3921,7728,3292,5052,4092,7729,7730,7731,7732,7733,7734,7735,5053,5054,7736,7737,7738,7739,3922,3685,7740,7741,7742,7743,2635,5055,7744,5056,4601,7745,7746,2560,7747,7748,7749,7750,3923,7751,7752,7753,7754,7755,4296,2903,7756,7757,7758,7759,7760,3924,7761,5057,4297,7762,7763,5058,4298,7764,4093,7765,7766,5059,3925,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,3595,7777,4299,5060,4094,7778,3293,5061,7779,7780,4300,7781,7782,4602,7783,3596,7784,7785,3430,2367,7786,3164,5062,5063,4301,7787,7788,4095,5064,5065,7789,3374,3115,7790,7791,7792,7793,7794,7795,7796,3597,4603,7797,7798,3686,3116,3807,5066,7799,7800,5067,7801,7802,4604,4302,5068,4303,4096,7803,7804,3294,7805,7806,5069,4605,2690,7807,3026,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,3926,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271];var i0={};i0.EUCTW_TYPICAL_DISTRIBUTION_RATIO=.75;i0.EUCTW_TABLE_SIZE=8102;i0.EUCTWCharToFreqOrder=[1,1800,1506,255,1431,198,9,82,6,7310,177,202,3615,1256,2808,110,3735,33,3241,261,76,44,2113,16,2931,2184,1176,659,3868,26,3404,2643,1198,3869,3313,4060,410,2211,302,590,361,1963,8,204,58,4296,7311,1931,63,7312,7313,317,1614,75,222,159,4061,2412,1480,7314,3500,3068,224,2809,3616,3,10,3870,1471,29,2774,1135,2852,1939,873,130,3242,1123,312,7315,4297,2051,507,252,682,7316,142,1914,124,206,2932,34,3501,3173,64,604,7317,2494,1976,1977,155,1990,645,641,1606,7318,3405,337,72,406,7319,80,630,238,3174,1509,263,939,1092,2644,756,1440,1094,3406,449,69,2969,591,179,2095,471,115,2034,1843,60,50,2970,134,806,1868,734,2035,3407,180,995,1607,156,537,2893,688,7320,319,1305,779,2144,514,2374,298,4298,359,2495,90,2707,1338,663,11,906,1099,2545,20,2436,182,532,1716,7321,732,1376,4062,1311,1420,3175,25,2312,1056,113,399,382,1949,242,3408,2467,529,3243,475,1447,3617,7322,117,21,656,810,1297,2295,2329,3502,7323,126,4063,706,456,150,613,4299,71,1118,2036,4064,145,3069,85,835,486,2114,1246,1426,428,727,1285,1015,800,106,623,303,1281,7324,2127,2354,347,3736,221,3503,3110,7325,1955,1153,4065,83,296,1199,3070,192,624,93,7326,822,1897,2810,3111,795,2064,991,1554,1542,1592,27,43,2853,859,139,1456,860,4300,437,712,3871,164,2392,3112,695,211,3017,2096,195,3872,1608,3504,3505,3618,3873,234,811,2971,2097,3874,2229,1441,3506,1615,2375,668,2076,1638,305,228,1664,4301,467,415,7327,262,2098,1593,239,108,300,200,1033,512,1247,2077,7328,7329,2173,3176,3619,2673,593,845,1062,3244,88,1723,2037,3875,1950,212,266,152,149,468,1898,4066,4302,77,187,7330,3018,37,5,2972,7331,3876,7332,7333,39,2517,4303,2894,3177,2078,55,148,74,4304,545,483,1474,1029,1665,217,1869,1531,3113,1104,2645,4067,24,172,3507,900,3877,3508,3509,4305,32,1408,2811,1312,329,487,2355,2247,2708,784,2674,4,3019,3314,1427,1788,188,109,499,7334,3620,1717,1789,888,1217,3020,4306,7335,3510,7336,3315,1520,3621,3878,196,1034,775,7337,7338,929,1815,249,439,38,7339,1063,7340,794,3879,1435,2296,46,178,3245,2065,7341,2376,7342,214,1709,4307,804,35,707,324,3622,1601,2546,140,459,4068,7343,7344,1365,839,272,978,2257,2572,3409,2128,1363,3623,1423,697,100,3071,48,70,1231,495,3114,2193,7345,1294,7346,2079,462,586,1042,3246,853,256,988,185,2377,3410,1698,434,1084,7347,3411,314,2615,2775,4308,2330,2331,569,2280,637,1816,2518,757,1162,1878,1616,3412,287,1577,2115,768,4309,1671,2854,3511,2519,1321,3737,909,2413,7348,4069,933,3738,7349,2052,2356,1222,4310,765,2414,1322,786,4311,7350,1919,1462,1677,2895,1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070,309,1369,1130,2812,364,2230,1653,1299,3881,3512,3882,3883,2646,525,1085,3021,902,2e3,1475,964,4313,421,1844,1415,1057,2281,940,1364,3116,376,4314,4315,1381,7,2520,983,2378,336,1710,2675,1845,321,3414,559,1131,3022,2742,1808,1132,1313,265,1481,1857,7352,352,1203,2813,3247,167,1089,420,2814,776,792,1724,3513,4071,2438,3248,7353,4072,7354,446,229,333,2743,901,3739,1200,1557,4316,2647,1920,395,2744,2676,3740,4073,1835,125,916,3178,2616,4317,7355,7356,3741,7357,7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145,438,2591,2896,2379,3317,1068,958,3023,461,311,2855,2677,4074,1915,3179,4075,1978,383,750,2745,2617,4076,274,539,385,1278,1442,7361,1154,1964,384,561,210,98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257,129,7363,3742,642,523,2776,2777,2648,7364,141,2231,1333,68,176,441,876,907,4077,603,2592,710,171,3417,404,549,18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320,7366,2973,368,7367,146,366,99,871,3627,1543,748,807,1586,1185,22,2258,379,3743,3180,7368,3181,505,1941,2618,1991,1382,2314,7369,380,2357,218,702,1817,1248,3418,3024,3517,3318,3249,7370,2974,3628,930,3250,3744,7371,59,7372,585,601,4078,497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374,749,1836,690,1899,3745,1772,3885,1476,429,1043,1790,2232,2116,917,4079,447,1086,1629,7375,556,7376,7377,2020,1654,844,1090,105,550,966,1758,2815,1008,1782,686,1095,7378,2282,793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746,980,2496,544,353,527,4324,908,2678,2899,7380,381,2619,1942,1348,7381,1341,1252,560,3072,7382,3420,2856,7383,2053,973,886,2080,143,4325,7384,7385,157,3886,496,4081,57,840,540,2038,4326,4327,3421,2117,1445,970,2259,1748,1965,2081,4082,3119,1234,1775,3251,2816,3629,773,1206,2129,1066,2039,1326,3887,1738,1725,4083,279,3120,51,1544,2594,423,1578,2130,2066,173,4328,1879,7386,7387,1583,264,610,3630,4329,2439,280,154,7388,7389,7390,1739,338,1282,3073,693,2857,1411,1074,3747,2440,7391,4330,7392,7393,1240,952,2394,7394,2900,1538,2679,685,1483,4084,2468,1436,953,4085,2054,4331,671,2395,79,4086,2441,3252,608,567,2680,3422,4087,4088,1691,393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672,3748,3182,1464,522,1119,661,1150,216,675,4333,3888,1432,3519,609,4334,2681,2397,7400,7401,7402,4089,3025,0,7403,2469,315,231,2442,301,3319,4335,2380,7404,233,4090,3631,1818,4336,4337,7405,96,1776,1315,2082,7406,257,7407,1809,3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074,363,1655,3183,7409,2975,7410,7411,7412,3889,1567,3890,718,103,3184,849,1443,341,3320,2934,1484,7413,1712,127,67,339,4092,2398,679,1412,821,7414,7415,834,738,351,2976,2146,846,235,1497,1880,418,1992,3749,2710,186,1100,2147,2746,3520,1545,1355,2935,2858,1377,583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358,78,3750,3751,267,1289,2099,2001,1594,4094,348,369,1274,2194,2175,1837,4338,1820,2817,3635,2747,2283,2002,4339,2936,2748,144,3321,882,4340,3892,2749,3423,4341,2901,7417,4095,1726,320,7418,3893,3026,788,2978,7419,2818,1773,1327,2859,3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650,787,2022,506,824,3636,534,323,4343,1044,3322,2023,1900,946,3424,7421,1778,1500,1678,7422,1881,4344,165,243,4345,3637,2521,123,683,4096,764,4346,36,3895,1792,589,2902,816,626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932,891,2083,2903,304,4097,7424,292,2979,2711,3522,691,2100,4098,1115,4347,118,662,7425,611,1156,854,2381,1316,2861,2,386,515,2904,7426,7427,3253,868,2234,1486,855,2651,785,2212,3028,7428,1040,3185,3523,7429,3121,448,7430,1525,7431,2164,4348,7432,3754,7433,4099,2820,3524,3122,503,818,3898,3123,1568,814,676,1444,306,1749,7434,3755,1416,1030,197,1428,805,2821,1501,4349,7435,7436,7437,1993,7438,4350,7439,7440,2195,13,2779,3638,2980,3124,1229,1916,7441,3756,2131,7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445,646,3757,2443,307,7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451,519,7452,128,2132,92,2284,1979,7453,3900,1512,342,3125,2196,7454,2780,2214,1980,3323,7455,290,1656,1317,789,827,2360,7456,3758,4352,562,581,3901,7457,401,4353,2248,94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459,828,1105,4101,1262,1394,7460,4102,605,4356,7461,1783,2862,7462,2822,819,2101,578,2197,2937,7463,1502,436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466,2332,2067,23,4357,193,826,3759,2102,699,1630,4104,3075,390,1793,1064,3526,7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359,137,4106,598,3078,1966,780,104,974,2938,7470,278,899,253,402,572,504,493,1339,7471,3903,1275,4360,2574,2550,7472,3640,3029,3079,2249,565,1334,2713,863,41,7473,7474,4361,7475,1657,2333,19,463,2750,4107,606,7476,2981,3256,1087,2084,1323,2652,2982,7477,1631,1623,1750,4108,2682,7478,2864,791,2714,2653,2334,232,2416,7479,2983,1498,7480,2654,2620,755,1366,3641,3257,3126,2025,1609,119,1917,3427,862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125,817,4110,4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485,2683,733,40,1632,1106,2865,345,4113,841,2524,230,4364,2984,1846,3259,3428,7486,1263,986,3429,7487,735,879,254,1137,857,622,1300,1180,1388,1562,3907,3908,2939,967,2751,2655,1349,592,2133,1692,3324,2985,1994,4114,1679,3909,1901,2185,7488,739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870,2752,2986,7490,435,7491,343,1108,596,17,1751,4365,2235,3430,3643,7492,4366,294,3527,2940,1693,477,979,281,2041,3528,643,2042,3644,2621,2782,2261,1031,2335,2134,2298,3529,4367,367,1249,2552,7493,3530,7494,4368,1283,3325,2004,240,1762,3326,4369,4370,836,1069,3128,474,7495,2148,2525,268,3531,7496,3188,1521,1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118,961,1673,2622,190,2005,2200,3762,4371,4372,7500,570,2497,3645,1490,7501,4373,2623,3260,1956,4374,584,1514,396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910,619,7505,3129,3261,215,2006,2783,2553,3189,4377,3190,4378,763,4119,3763,4379,7506,7507,1957,1767,2941,3328,3646,1174,452,1477,4380,3329,3130,7508,2825,1253,2382,2186,1091,2285,4120,492,7509,638,1169,1824,2135,1752,3911,648,926,1021,1324,4381,520,4382,997,847,1007,892,4383,3764,2262,1871,3647,7510,2400,1784,4384,1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551,30,2263,4122,7511,2026,4386,3534,7512,501,7513,4123,594,3431,2165,1821,3535,3432,3536,3192,829,2826,4124,7514,1680,3132,1225,4125,7515,3262,4387,4126,3133,2336,7516,4388,4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389,374,3914,652,4128,4129,375,1140,798,7520,7521,7522,2361,4390,2264,546,1659,138,3031,2445,4391,7523,2250,612,1848,910,796,3765,1740,1371,825,3766,3767,7524,2906,2554,7525,692,444,3032,2624,801,4392,4130,7526,1491,244,1053,3033,4131,4132,340,7527,3915,1041,2987,293,1168,87,1357,7528,1539,959,7529,2236,721,694,4133,3768,219,1478,644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825,730,1515,184,2827,66,4393,7532,1660,2943,246,3332,378,1457,226,3433,975,3917,2944,1264,3537,674,696,7533,163,7534,1141,2417,2166,713,3538,3333,4394,3918,7535,7536,1186,15,7537,1079,1070,7538,1522,3193,3539,276,1050,2716,758,1126,653,2945,3263,7539,2337,889,3540,3919,3081,2989,903,1250,4395,3920,3434,3541,1342,1681,1718,766,3264,286,89,2946,3649,7540,1713,7541,2597,3334,2990,7542,2947,2215,3194,2866,7543,4396,2498,2526,181,387,1075,3921,731,2187,3335,7544,3265,310,313,3435,2299,770,4134,54,3034,189,4397,3082,3769,3922,7545,1230,1617,1849,355,3542,4135,4398,3336,111,4136,3650,1350,3135,3436,3035,4137,2149,3266,3543,7546,2784,3923,3924,2991,722,2008,7547,1071,247,1207,2338,2471,1378,4399,2009,864,1437,1214,4400,373,3770,1142,2216,667,4401,442,2753,2555,3771,3925,1968,4138,3267,1839,837,170,1107,934,1336,1882,7548,7549,2118,4139,2828,743,1569,7550,4402,4140,582,2384,1418,3437,7551,1802,7552,357,1395,1729,3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554,482,2446,4404,7555,7556,1492,833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652,4142,1686,1794,416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867,4405,1610,1584,3036,2419,2754,443,3269,1163,3136,7561,7562,3926,7563,4143,2499,3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145,431,3438,7565,250,97,81,4146,7566,1648,1850,1558,160,848,7567,866,740,1694,7568,2201,2830,3195,4147,4407,3653,1687,950,2472,426,469,3196,3654,3655,3928,7569,7570,1188,424,1995,861,3546,4148,3775,2202,2685,168,1235,3547,4149,7571,2086,1674,4408,3337,3270,220,2557,1009,7572,3776,670,2992,332,1208,717,7573,7574,3548,2447,3929,3338,7575,513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527,3656,3549,815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932,1741,3933,3778,3934,7582,236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411,7585,308,7586,4412,245,4413,1851,2473,1307,2575,430,715,2136,2449,7587,270,199,2869,3935,7588,3551,2718,1753,761,1754,725,1661,1840,4414,3440,3658,7589,7590,587,14,3272,227,2598,326,480,2265,943,2755,3552,291,650,1883,7591,1702,1226,102,1547,62,3441,904,4415,3442,1164,4150,7592,7593,1224,1548,2756,391,498,1493,7594,1386,1419,7595,2055,1177,4416,813,880,1081,2363,566,1145,4417,2286,1001,1035,2558,2599,2238,394,1286,7596,7597,2068,7598,86,1494,1730,3936,491,1588,745,897,2948,843,3340,3937,2757,2870,3273,1768,998,2217,2069,397,1826,1195,1969,3659,2993,3341,284,7599,3782,2500,2137,2119,1903,7600,3938,2150,3939,4151,1036,3443,1904,114,2559,4152,209,1527,7601,7602,2949,2831,2625,2385,2719,3139,812,2560,7603,3274,7604,1559,737,1884,3660,1210,885,28,2686,3553,3783,7605,4153,1004,1779,4418,7606,346,1981,2218,2687,4419,3784,1742,797,1642,3940,1933,1072,1384,2151,896,3941,3275,3661,3197,2871,3554,7607,2561,1958,4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528,2600,161,1178,4156,1982,987,4423,1101,4157,631,3943,1157,3198,2420,1343,1241,1016,2239,2562,372,877,2339,2501,1160,555,1934,911,3944,7611,466,1170,169,1051,2907,2688,3663,2474,2994,1182,2011,2563,1251,2626,7612,992,2340,3444,1540,2721,1201,2070,2401,1996,2475,7613,4424,528,1922,2188,1503,1873,1570,2364,3342,3276,7614,557,1073,7615,1827,3445,2087,2266,3140,3039,3084,767,3085,2786,4425,1006,4158,4426,2341,1267,2176,3664,3199,778,3945,3200,2722,1597,2657,7616,4427,7617,3446,7618,7619,7620,3277,2689,1433,3278,131,95,1504,3946,723,4159,3141,1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949,4160,2576,248,1634,3785,912,7623,2832,3666,3040,3786,654,53,7624,2996,7625,1688,4428,777,3447,1032,3950,1425,7626,191,820,2120,2833,971,4429,931,3202,135,664,783,3787,1997,772,2908,1935,3951,3788,4430,2909,3203,282,2723,640,1372,3448,1127,922,325,3344,7627,7628,711,2044,7629,7630,3952,2219,2787,1936,3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955,3956,7632,2221,258,3205,4432,101,1227,7633,3280,1755,7634,1391,3281,7635,2910,2056,893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642,878,1325,1780,2788,4433,259,1385,2577,744,1183,2267,4434,7643,3957,2502,7644,684,1024,4162,7645,472,3557,3449,1165,3282,3958,3959,322,2152,881,455,1695,1152,1340,660,554,2153,4435,1058,4436,4163,830,1065,3346,3960,4437,1923,7646,1703,1918,7647,932,2268,122,7648,4438,947,677,7649,3791,2627,297,1905,1924,2269,4439,2317,3283,7650,7651,4164,7652,4165,84,4166,112,989,7653,547,1059,3961,701,3558,1019,7654,4167,7655,3450,942,639,457,2301,2451,993,2951,407,851,494,4440,3347,927,7656,1237,7657,2421,3348,573,4168,680,921,2911,1279,1874,285,790,1448,1983,719,2167,7658,7659,4441,3962,3963,1649,7660,1541,563,7661,1077,7662,3349,3041,3451,511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443,7663,535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169,1238,2578,3086,1259,7665,700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906,4444,2601,3967,781,2422,132,1589,203,147,273,2789,2402,898,1786,2154,3968,3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793,965,7673,1804,2690,1516,3559,1121,1082,1329,3284,3970,1449,3794,65,1128,2835,2913,2759,1590,3795,7674,7675,12,2658,45,976,2579,3144,4447,517,2528,1013,1037,3209,7676,3796,2836,7677,3797,7678,3452,7679,2602,614,1998,2318,3798,3087,2724,2628,7680,2580,4172,599,1269,7681,1810,3669,7682,2691,3088,759,1060,489,1805,3351,3285,1358,7683,7684,2386,1387,1215,2629,2252,490,7685,7686,4173,1759,2387,2343,7687,4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344,874,7688,7689,3454,3670,1858,91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202,1403,3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973,2365,4453,7694,2029,7695,7696,3974,2693,1216,237,2581,4174,2319,3975,3802,4454,4455,2694,3560,3457,445,4456,7697,7698,7699,7700,2761,61,3976,3672,1822,3977,7701,687,2045,935,925,405,2660,703,1096,1859,2725,4457,3978,1876,1367,2695,3352,918,2105,1781,2476,334,3287,1611,1093,4458,564,3146,3458,3673,3353,945,2631,2057,4459,7702,1925,872,4175,7703,3459,2696,3089,349,4176,3674,3979,4460,3803,4177,3675,2155,3980,4461,4462,4178,4463,2403,2046,782,3981,400,251,4179,1624,7704,7705,277,3676,299,1265,476,1191,3804,2121,4180,4181,1109,205,7706,2582,1e3,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565,107,2477,2157,3982,3460,3147,7711,1533,541,1301,158,753,4182,2872,3562,7712,1696,370,1088,4183,4466,3563,579,327,440,162,2240,269,1937,1374,3461,968,3043,56,1396,3090,2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717,2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985,7722,1076,49,7723,951,3211,3289,3290,450,2837,920,7724,1811,2792,2366,4184,1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472,2388,2604,260,1795,3213,7727,7728,3808,3291,708,7729,3565,1704,7730,3566,1351,1618,3357,2999,1886,944,4185,3358,4186,3044,3359,4187,7731,3678,422,413,1714,3292,500,2058,2345,4188,2479,7732,1344,1910,954,7733,1668,7734,7735,3986,2404,4189,3567,3809,4190,7736,2302,1318,2505,3091,133,3092,2873,4473,629,31,2838,2697,3810,4474,850,949,4475,3987,2955,1732,2088,4191,1496,1852,7737,3988,620,3214,981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738,3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743,869,2839,655,3811,3812,3094,3989,3e3,3813,1310,3569,4477,7744,7745,7746,1733,558,4478,3681,335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192,470,2726,2107,2793,913,1054,3990,7747,1027,7748,3046,3991,4479,982,2662,3362,3148,3465,3216,3217,1946,2794,7749,571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089,984,4481,3683,1959,7753,3684,852,923,2795,3466,3685,969,1519,999,2048,2320,1705,7754,3095,615,1662,151,597,3992,2405,2321,1049,275,4482,3686,4193,568,3687,3571,2480,4194,3688,7755,2425,2270,409,3218,7756,1566,2874,3467,1002,769,2840,194,2090,3149,3689,2222,3294,4195,628,1505,7757,7758,1763,2177,3001,3993,521,1161,2584,1787,2203,2406,4483,3994,1625,4196,4197,412,42,3096,464,7759,2632,4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295,1651,3364,3572,7760,7761,3573,2481,3469,7762,3690,7763,7764,2271,2091,460,7765,4487,7766,3002,962,588,3574,289,3219,2634,1116,52,7767,3047,1796,7768,7769,7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365,465,4489,1572,510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776,7777,4199,536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911,2796,7781,3296,1122,377,3220,7782,360,7783,7784,4200,1529,551,7785,2059,3693,1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404,136,1468,1479,672,1171,3221,2303,271,3151,7787,2762,7788,2049,678,2727,865,1947,4493,7789,2013,3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816,509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010,552,681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154,358,453,736,175,478,1117,905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473,3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298,2918,3049,2179,3474,595,2122,7800,3997,7801,7802,4206,1707,2636,223,3696,1359,751,3098,183,3475,7803,2797,3003,419,2369,633,704,3818,2389,241,7804,7805,7806,838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807,1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605,484,3698,7810,3999,625,4209,2273,3368,1499,4210,4e3,7811,4001,4211,3222,2274,2275,3476,7812,7813,2764,808,2606,3699,3369,4002,4212,3100,2532,526,3370,3821,4213,955,7814,1620,4214,2637,2427,7815,1429,3700,1669,1831,994,928,7816,3578,1260,7817,7818,7819,1948,2288,741,2919,1626,4215,2729,2455,867,1184,362,3371,1392,7820,7821,4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877,1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702,2483,3299,7824,3703,4501,7825,7826,666,1003,3005,1022,3579,4218,7827,4502,1813,2253,574,3822,1603,295,1535,705,3823,4219,283,858,417,7828,7829,3224,4503,4504,3051,1220,1889,1046,2276,2456,4004,1393,1599,689,2567,388,4220,7830,2484,802,7831,2798,3824,2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833,809,7834,7835,7836,575,2730,3477,956,1552,1469,1144,2323,7837,2324,1560,2457,3580,3226,4005,616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704,3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826,607,2306,3827,762,2878,1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508,2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451,7851,7852,7853,7854,2922,4006,4007,2485,2346,411,4008,4009,3582,3300,3101,4509,1561,2664,1452,4010,1375,7855,7856,47,2959,316,7857,1406,1591,2923,3156,7858,1025,2141,3102,3157,354,2731,884,2224,4225,2407,508,3706,726,3583,996,2428,3584,729,7859,392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800,919,2347,2960,2348,1270,4511,4012,73,7862,7863,647,7864,3228,2843,2255,1550,1346,3006,7865,1332,883,3479,7866,7867,7868,7869,3301,2765,7870,1212,831,1347,4226,4512,2326,3830,1863,3053,720,3831,4513,4514,3832,7871,4227,7872,7873,4515,7874,7875,1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924,669,2208,2665,2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518,3158,518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833,516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961,1422,577,1470,3008,1524,3373,7892,7893,432,4232,3054,3480,7894,2586,1455,2508,2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482,2639,4016,4233,4521,2290,895,924,4234,2170,331,2243,3056,166,1627,3057,1098,7898,1232,2880,2227,3374,4522,657,403,1196,2372,542,3709,3375,1600,4235,3483,7899,4523,2767,3230,576,530,1362,7900,4524,2533,2666,3710,4017,7901,842,3834,7902,2801,2031,1014,4018,213,2700,3376,665,621,4236,7903,3711,2925,2430,7904,2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906,724,2277,600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909,651,4240,7910,1612,4241,2611,7911,2844,7912,2734,2307,3058,7913,716,2459,3059,174,1255,2701,4019,3590,548,1320,1398,728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062,3712,3591,3713,747,7916,635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922,3378,4530,2432,451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925,4246,350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024,488,4532,458,4248,4025,3715,771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487,2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015,2736,7932,1155,1017,3716,3836,7933,3303,2308,201,1864,4253,1430,7934,4026,7935,7936,7937,7938,7939,4254,1604,7940,414,1865,371,2587,4534,4535,3485,2016,3104,4536,1708,960,4255,887,389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580,7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380,2882,4256,7950,4257,2640,3381,2802,673,2703,2460,709,3486,4028,3593,4258,7951,1148,502,634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105,948,3232,121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151,1771,3838,1488,4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803,531,2737,2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017,120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047,2704,1266,7965,1368,4543,2845,649,3383,3841,2539,2738,1102,2846,2669,7966,7967,1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385,2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460,856,7974,3600,7975,2885,2963,7976,2886,3843,7977,4264,632,2510,875,3844,1697,3845,2291,7978,7979,4544,3010,1239,580,4545,4265,7980,914,936,2074,1190,4032,1039,2123,7981,7982,7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033,915,3305,4267,4268,3306,1605,1834,7986,2739,398,3601,4269,3847,4034,328,1912,2847,4035,3848,1331,4270,3011,937,4271,7987,3602,4036,4037,3387,2160,4546,3388,524,742,538,3065,1012,7988,7989,3849,2461,7990,658,1103,225,3850,7991,7992,4547,7993,4548,7994,3236,1243,7995,4038,963,2246,4549,7996,2705,3603,3161,7997,7998,2588,2327,7999,4550,8e3,8001,8002,3489,3307,957,3389,2540,2032,1930,2927,2462,870,2018,3604,1746,2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066,8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292,977,2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689,714,4551,3491,8009,2328,3852,533,4273,3605,2181,617,8010,2464,3308,3492,2310,8011,8012,3165,8013,8014,3853,1987,618,427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552,8018,3494,8019,8020,2279,1576,473,3606,4275,3395,972,8021,3607,8022,3067,8023,8024,4553,4554,8025,3727,4041,4042,8026,153,4555,356,8027,1891,2888,4276,2143,408,803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278,8031,2411,3396,752,8032,8033,1961,2964,8034,746,3012,2465,8035,4279,3728,698,4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706,3858,1973,4281,8038,4282,3167,823,1303,1288,1236,2848,3495,4044,3398,774,3859,8039,1581,4560,1304,2849,3860,4561,8040,2435,2161,1083,3237,4283,4045,4284,344,1173,288,2311,454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563,985,894,8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194,425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053,636,4565,1855,3861,760,1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210,479,8058,8059,832,8060,4049,2489,8061,2965,2490,3731,990,3109,627,1814,2642,4289,1582,4290,2125,2111,3496,4567,8062,799,4291,3170,8063,4568,2112,1737,3013,1018,543,754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889,4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239,1842,3610,1715,481,365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240,433,1894,2063,2075,8077,602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083,3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088,4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094,8095,1895,8096,8097,4580,1896,4054,318,8098,2094,4055,4293,8099,8100,485,8101,938,3862,553,2670,116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104,3613,2929,4056,1747,2930,2968,8105,8106,207,8107,8108,2672,4581,2514,8109,3015,890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114,941,2294,208,3499,4057,2019,330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118,2515,1613,4582,8119,3312,3866,2516,8120,4058,8121,1637,4059,2466,4583,3867,8122,2493,3016,3734,8123,8124,2192,8125,8126,2162,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741];var s0={};s0.EUCKR_TYPICAL_DISTRIBUTION_RATIO=6;s0.EUCKR_TABLE_SIZE=2352;s0.EUCKRCharToFreqOrder=[13,130,120,1396,481,1719,1720,328,609,212,1721,707,400,299,1722,87,1397,1723,104,536,1117,1203,1724,1267,685,1268,508,1725,1726,1727,1728,1398,1399,1729,1730,1731,141,621,326,1057,368,1732,267,488,20,1733,1269,1734,945,1400,1735,47,904,1270,1736,1737,773,248,1738,409,313,786,429,1739,116,987,813,1401,683,75,1204,145,1740,1741,1742,1743,16,847,667,622,708,1744,1745,1746,966,787,304,129,1747,60,820,123,676,1748,1749,1750,1751,617,1752,626,1753,1754,1755,1756,653,1757,1758,1759,1760,1761,1762,856,344,1763,1764,1765,1766,89,401,418,806,905,848,1767,1768,1769,946,1205,709,1770,1118,1771,241,1772,1773,1774,1271,1775,569,1776,999,1777,1778,1779,1780,337,751,1058,28,628,254,1781,177,906,270,349,891,1079,1782,19,1783,379,1784,315,1785,629,754,1402,559,1786,636,203,1206,1787,710,567,1788,935,814,1789,1790,1207,766,528,1791,1792,1208,1793,1794,1795,1796,1797,1403,1798,1799,533,1059,1404,1405,1156,1406,936,884,1080,1800,351,1801,1802,1803,1804,1805,801,1806,1807,1808,1119,1809,1157,714,474,1407,1810,298,899,885,1811,1120,802,1158,1812,892,1813,1814,1408,659,1815,1816,1121,1817,1818,1819,1820,1821,1822,319,1823,594,545,1824,815,937,1209,1825,1826,573,1409,1022,1827,1210,1828,1829,1830,1831,1832,1833,556,722,807,1122,1060,1834,697,1835,900,557,715,1836,1410,540,1411,752,1159,294,597,1211,976,803,770,1412,1837,1838,39,794,1413,358,1839,371,925,1840,453,661,788,531,723,544,1023,1081,869,91,1841,392,430,790,602,1414,677,1082,457,1415,1416,1842,1843,475,327,1024,1417,795,121,1844,733,403,1418,1845,1846,1847,300,119,711,1212,627,1848,1272,207,1849,1850,796,1213,382,1851,519,1852,1083,893,1853,1854,1855,367,809,487,671,1856,663,1857,1858,956,471,306,857,1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871,282,96,574,1872,502,1085,1873,1214,1874,907,1875,1876,827,977,1419,1420,1421,268,1877,1422,1878,1879,1880,308,1881,2,537,1882,1883,1215,1884,1885,127,791,1886,1273,1423,1887,34,336,404,643,1888,571,654,894,840,1889,0,886,1274,122,575,260,908,938,1890,1275,410,316,1891,1892,100,1893,1894,1123,48,1161,1124,1025,1895,633,901,1276,1896,1897,115,816,1898,317,1899,694,1900,909,734,1424,572,866,1425,691,85,524,1010,543,394,841,1901,1902,1903,1026,1904,1905,1906,1907,1908,1909,30,451,651,988,310,1910,1911,1426,810,1216,93,1912,1913,1277,1217,1914,858,759,45,58,181,610,269,1915,1916,131,1062,551,443,1e3,821,1427,957,895,1086,1917,1918,375,1919,359,1920,687,1921,822,1922,293,1923,1924,40,662,118,692,29,939,887,640,482,174,1925,69,1162,728,1428,910,1926,1278,1218,1279,386,870,217,854,1163,823,1927,1928,1929,1930,834,1931,78,1932,859,1933,1063,1934,1935,1936,1937,438,1164,208,595,1938,1939,1940,1941,1219,1125,1942,280,888,1429,1430,1220,1431,1943,1944,1945,1946,1947,1280,150,510,1432,1948,1949,1950,1951,1952,1953,1954,1011,1087,1955,1433,1043,1956,881,1957,614,958,1064,1065,1221,1958,638,1001,860,967,896,1434,989,492,553,1281,1165,1959,1282,1002,1283,1222,1960,1961,1962,1963,36,383,228,753,247,454,1964,876,678,1965,1966,1284,126,464,490,835,136,672,529,940,1088,1435,473,1967,1968,467,50,390,227,587,279,378,598,792,968,240,151,160,849,882,1126,1285,639,1044,133,140,288,360,811,563,1027,561,142,523,1969,1970,1971,7,103,296,439,407,506,634,990,1972,1973,1974,1975,645,1976,1977,1978,1979,1980,1981,236,1982,1436,1983,1984,1089,192,828,618,518,1166,333,1127,1985,818,1223,1986,1987,1988,1989,1990,1991,1992,1993,342,1128,1286,746,842,1994,1995,560,223,1287,98,8,189,650,978,1288,1996,1437,1997,17,345,250,423,277,234,512,226,97,289,42,167,1998,201,1999,2e3,843,836,824,532,338,783,1090,182,576,436,1438,1439,527,500,2001,947,889,2002,2003,2004,2005,262,600,314,447,2006,547,2007,693,738,1129,2008,71,1440,745,619,688,2009,829,2010,2011,147,2012,33,948,2013,2014,74,224,2015,61,191,918,399,637,2016,1028,1130,257,902,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,837,2027,2028,2029,2030,179,874,591,52,724,246,2031,2032,2033,2034,1167,969,2035,1289,630,605,911,1091,1168,2036,2037,2038,1441,912,2039,623,2040,2041,253,1169,1290,2042,1442,146,620,611,577,433,2043,1224,719,1170,959,440,437,534,84,388,480,1131,159,220,198,679,2044,1012,819,1066,1443,113,1225,194,318,1003,1029,2045,2046,2047,2048,1067,2049,2050,2051,2052,2053,59,913,112,2054,632,2055,455,144,739,1291,2056,273,681,499,2057,448,2058,2059,760,2060,2061,970,384,169,245,1132,2062,2063,414,1444,2064,2065,41,235,2066,157,252,877,568,919,789,580,2067,725,2068,2069,1292,2070,2071,1445,2072,1446,2073,2074,55,588,66,1447,271,1092,2075,1226,2076,960,1013,372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085,850,2086,2087,2088,2089,2090,186,2091,1068,180,2092,2093,2094,109,1227,522,606,2095,867,1448,1093,991,1171,926,353,1133,2096,581,2097,2098,2099,1294,1449,1450,2100,596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452,949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,804,2118,2119,1230,1231,805,1456,405,1136,2120,2121,2122,2123,2124,720,701,1297,992,1457,927,1004,2125,2126,2127,2128,2129,2130,22,417,2131,303,2132,385,2133,971,520,513,2134,1174,73,1096,231,274,962,1458,673,2135,1459,2136,152,1137,2137,2138,2139,2140,1005,1138,1460,1139,2141,2142,2143,2144,11,374,844,2145,154,1232,46,1461,2146,838,830,721,1233,106,2147,90,428,462,578,566,1175,352,2148,2149,538,1234,124,1298,2150,1462,761,565,2151,686,2152,649,2153,72,173,2154,460,415,2155,1463,2156,1235,305,2157,2158,2159,2160,2161,2162,579,2163,2164,2165,2166,2167,747,2168,2169,2170,2171,1464,669,2172,2173,2174,2175,2176,1465,2177,23,530,285,2178,335,729,2179,397,2180,2181,2182,1030,2183,2184,698,2185,2186,325,2187,2188,369,2189,799,1097,1015,348,2190,1069,680,2191,851,1466,2192,2193,10,2194,613,424,2195,979,108,449,589,27,172,81,1031,80,774,281,350,1032,525,301,582,1176,2196,674,1045,2197,2198,1467,730,762,2199,2200,2201,2202,1468,2203,993,2204,2205,266,1070,963,1140,2206,2207,2208,664,1098,972,2209,2210,2211,1177,1469,1470,871,2212,2213,2214,2215,2216,1471,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233,2234,2235,1299,2236,2237,200,2238,477,373,2239,2240,731,825,777,2241,2242,2243,521,486,548,2244,2245,2246,1473,1300,53,549,137,875,76,158,2247,1301,1474,469,396,1016,278,712,2248,321,442,503,767,744,941,1237,1178,1475,2249,82,178,1141,1179,973,2250,1302,2251,297,2252,2253,570,2254,2255,2256,18,450,206,2257,290,292,1142,2258,511,162,99,346,164,735,2259,1476,1477,4,554,343,798,1099,2260,1100,2261,43,171,1303,139,215,2262,2263,717,775,2264,1033,322,216,2265,831,2266,149,2267,1304,2268,2269,702,1238,135,845,347,309,2270,484,2271,878,655,238,1006,1478,2272,67,2273,295,2274,2275,461,2276,478,942,412,2277,1034,2278,2279,2280,265,2281,541,2282,2283,2284,2285,2286,70,852,1071,2287,2288,2289,2290,21,56,509,117,432,2291,2292,331,980,552,1101,148,284,105,393,1180,1239,755,2293,187,2294,1046,1479,2295,340,2296,63,1047,230,2297,2298,1305,763,1306,101,800,808,494,2299,2300,2301,903,2302,37,1072,14,5,2303,79,675,2304,312,2305,2306,2307,2308,2309,1480,6,1307,2310,2311,2312,1,470,35,24,229,2313,695,210,86,778,15,784,592,779,32,77,855,964,2314,259,2315,501,380,2316,2317,83,981,153,689,1308,1481,1482,1483,2318,2319,716,1484,2320,2321,2322,2323,2324,2325,1485,2326,2327,128,57,68,261,1048,211,170,1240,31,2328,51,435,742,2329,2330,2331,635,2332,264,456,2333,2334,2335,425,2336,1486,143,507,263,943,2337,363,920,1487,256,1488,1102,243,601,1489,2338,2339,2340,2341,2342,2343,2344,861,2345,2346,2347,2348,2349,2350,395,2351,1490,1491,62,535,166,225,2352,2353,668,419,1241,138,604,928,2354,1181,2355,1492,1493,2356,2357,2358,1143,2359,696,2360,387,307,1309,682,476,2361,2362,332,12,222,156,2363,232,2364,641,276,656,517,1494,1495,1035,416,736,1496,2365,1017,586,2366,2367,2368,1497,2369,242,2370,2371,2372,1498,2373,965,713,2374,2375,2376,2377,740,982,1499,944,1500,1007,2378,2379,1310,1501,2380,2381,2382,785,329,2383,2384,1502,2385,2386,2387,932,2388,1503,2389,2390,2391,2392,1242,2393,2394,2395,2396,2397,994,950,2398,2399,2400,2401,1504,1311,2402,2403,2404,2405,1049,749,2406,2407,853,718,1144,1312,2408,1182,1505,2409,2410,255,516,479,564,550,214,1506,1507,1313,413,239,444,339,1145,1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414,176,703,497,624,593,921,302,2415,341,165,1103,1512,2416,1513,2417,2418,2419,376,2420,700,2421,2422,2423,258,768,1316,2424,1183,2425,995,608,2426,2427,2428,2429,221,2430,2431,2432,2433,2434,2435,2436,2437,195,323,726,188,897,983,1317,377,644,1050,879,2438,452,2439,2440,2441,2442,2443,2444,914,2445,2446,2447,2448,915,489,2449,1514,1184,2450,2451,515,64,427,495,2452,583,2453,483,485,1038,562,213,1515,748,666,2454,2455,2456,2457,334,2458,780,996,1008,705,1243,2459,2460,2461,2462,2463,114,2464,493,1146,366,163,1516,961,1104,2465,291,2466,1318,1105,2467,1517,365,2468,355,951,1244,2469,1319,2470,631,2471,2472,218,1320,364,320,756,1518,1519,1321,1520,1322,2473,2474,2475,2476,997,2477,2478,2479,2480,665,1185,2481,916,1521,2482,2483,2484,584,684,2485,2486,797,2487,1051,1186,2488,2489,2490,1522,2491,2492,370,2493,1039,1187,65,2494,434,205,463,1188,2495,125,812,391,402,826,699,286,398,155,781,771,585,2496,590,505,1073,2497,599,244,219,917,1018,952,646,1523,2498,1323,2499,2500,49,984,354,741,2501,625,2502,1324,2503,1019,190,357,757,491,95,782,868,2504,2505,2506,2507,2508,2509,134,1524,1074,422,1525,898,2510,161,2511,2512,2513,2514,769,2515,1526,2516,2517,411,1325,2518,472,1527,2519,2520,2521,2522,2523,2524,985,2525,2526,2527,2528,2529,2530,764,2531,1245,2532,2533,25,204,311,2534,496,2535,1052,2536,2537,2538,2539,2540,2541,2542,199,704,504,468,758,657,1528,196,44,839,1246,272,750,2543,765,862,2544,2545,1326,2546,132,615,933,2547,732,2548,2549,2550,1189,1529,2551,283,1247,1053,607,929,2552,2553,2554,930,183,872,616,1040,1147,2555,1148,1020,441,249,1075,2556,2557,2558,466,743,2559,2560,2561,92,514,426,420,526,2562,2563,2564,2565,2566,2567,2568,185,2569,2570,2571,2572,776,1530,658,2573,362,2574,361,922,1076,793,2575,2576,2577,2578,2579,2580,1531,251,2581,2582,2583,2584,1532,54,612,237,1327,2585,2586,275,408,647,111,2587,1533,1106,465,3,458,9,38,2588,107,110,890,209,26,737,498,2589,1534,2590,431,202,88,1535,356,287,1107,660,1149,2591,381,1536,986,1150,445,1248,1151,974,2592,2593,846,2594,446,953,184,1249,1250,727,2595,923,193,883,2596,2597,2598,102,324,539,817,2599,421,1041,2600,832,2601,94,175,197,406,2602,459,2603,2604,2605,2606,2607,330,555,2608,2609,2610,706,1108,389,2611,2612,2613,2614,233,2615,833,558,931,954,1251,2616,2617,1537,546,2618,2619,1009,2620,2621,2622,1538,690,1328,2623,955,2624,1539,2625,2626,772,2627,2628,2629,2630,2631,924,648,863,603,2632,2633,934,1540,864,865,2634,642,1042,670,1190,2635,2636,2637,2638,168,2639,652,873,542,1054,1541,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,1542,880,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,1543,2726,2727,2728,2729,2730,2731,2732,1544,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,1545,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,1546,2767,1547,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,1548,2787,2788,2789,1109,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,1329,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,1549,2857,2858,2859,2860,1550,2861,2862,1551,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,1110,1330,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,1331,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,1552,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,1252,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3e3,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,1553,3013,3014,3015,3016,3017,1554,3018,1332,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,1555,3051,3052,3053,1556,1557,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,1558,3068,3069,3070,3071,3072,3073,3074,3075,3076,1559,3077,3078,3079,3080,3081,3082,3083,1253,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,1152,3109,3110,3111,3112,3113,1560,3114,3115,3116,3117,1111,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,1333,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,1561,3190,3191,1334,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,1562,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,1563,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,1335,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,1336,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,1337,3415,3416,3417,3418,3419,1338,3420,3421,3422,1564,1565,3423,3424,3425,3426,3427,3428,3429,3430,3431,1254,3432,3433,3434,1339,3435,3436,3437,3438,3439,1566,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,1255,3455,3456,3457,3458,3459,1567,1191,3460,1568,1569,3461,3462,3463,1570,3464,3465,3466,3467,3468,1571,3469,3470,3471,3472,3473,1572,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,1340,3487,3488,3489,3490,3491,3492,1021,3493,3494,3495,3496,3497,3498,1573,3499,1341,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,1342,3512,3513,3514,3515,3516,1574,1343,3517,3518,3519,1575,3520,1576,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,1577,3581,3582,1578,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,1579,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,1580,3630,3631,1581,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,1582,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,1192,3701,3702,3703,3704,1256,3705,3706,3707,3708,1583,1257,3709,3710,3711,3712,3713,3714,3715,3716,1584,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,1344,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,1585,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,1586,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,1345,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,1346,1587,3796,3797,1588,3798,3799,3800,3801,3802,3803,3804,3805,3806,1347,3807,3808,3809,3810,3811,1589,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,1590,3822,3823,1591,1348,3824,3825,3826,3827,3828,3829,3830,1592,3831,3832,1593,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,1349,3845,3846,3847,3848,3849,3850,3851,3852,3853,3854,3855,3856,3857,3858,1594,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,1595,3870,3871,3872,3873,1596,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,1597,3887,3888,3889,3890,3891,3892,3893,3894,3895,1598,3896,3897,3898,1599,1600,3899,1350,3900,1351,3901,3902,1352,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,1258,3925,3926,3927,3928,3929,3930,3931,1193,3932,1601,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,1602,3944,3945,3946,3947,3948,1603,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,1604,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,1353,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,1354,3992,3993,3994,3995,3996,3997,3998,3999,4e3,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,1355,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,1605,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,1606,4061,4062,4063,4064,1607,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,1194,4077,4078,1608,4079,4080,4081,4082,4083,4084,4085,4086,4087,1609,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,1259,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,1195,4125,4126,4127,1610,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,1356,4138,4139,4140,4141,4142,4143,4144,1611,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,1612,4220,4221,4222,4223,4224,4225,4226,4227,1357,4228,1613,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,1614,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,1196,1358,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,1615,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,1616,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,1617,4361,4362,4363,4364,4365,1618,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,1619,4417,4418,4419,4420,4421,4422,4423,4424,4425,1112,4426,4427,4428,4429,4430,1620,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,1260,1261,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,1359,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,1621,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,1055,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,1622,4519,4520,4521,1623,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,1360,4536,4537,4538,4539,4540,4541,4542,4543,975,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,1624,4572,4573,4574,4575,4576,1625,4577,4578,4579,4580,4581,4582,4583,4584,1626,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,1627,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,1628,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,1361,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,1362,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,1629,4683,4684,4685,4686,4687,1630,4688,4689,4690,4691,1153,4692,4693,4694,1113,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,1197,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,1631,4736,1632,4737,4738,4739,4740,4741,4742,4743,4744,1633,4745,4746,4747,4748,4749,1262,4750,4751,4752,4753,4754,1363,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,1634,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,1635,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,1636,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,1637,4807,4808,4809,1638,4810,4811,4812,4813,4814,4815,4816,4817,4818,1639,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,1077,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,1640,4884,4885,1641,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,1642,4912,4913,4914,1364,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,1643,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,1644,4981,4982,4983,4984,1645,4985,4986,1646,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5e3,5001,5002,5003,5004,5005,1647,5006,1648,5007,5008,5009,5010,5011,5012,1078,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,1365,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,1649,5040,5041,5042,5043,5044,5045,1366,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,1650,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,1651,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,1652,5111,5112,5113,5114,5115,5116,5117,5118,1367,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,1653,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,1368,5150,1654,5151,1369,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,1370,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,1655,5199,5200,5201,5202,1656,5203,5204,5205,5206,1371,5207,1372,5208,5209,5210,5211,1373,5212,5213,1374,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,1657,5248,5249,5250,5251,1658,1263,5252,5253,5254,5255,5256,1375,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,1659,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,1660,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,1376,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,1198,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,1661,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,1264,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,1662,5413,5414,5415,5416,1663,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,1664,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,1154,5479,5480,5481,5482,5483,5484,5485,1665,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,1377,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,1114,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,1378,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,1379,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,1380,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,1381,1056,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,1666,5661,5662,5663,5664,5665,5666,5667,5668,1667,5669,1668,5670,5671,5672,5673,5674,5675,5676,5677,5678,1155,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,1669,5699,5700,5701,5702,5703,5704,5705,1670,5706,5707,5708,5709,5710,1671,5711,5712,5713,5714,1382,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,1672,5726,5727,1673,1674,5728,5729,5730,5731,5732,5733,5734,5735,5736,1675,5737,5738,5739,5740,5741,5742,5743,5744,1676,5745,5746,5747,5748,5749,5750,5751,1383,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,1677,5769,5770,5771,5772,5773,1678,5774,5775,5776,998,5777,5778,5779,5780,5781,5782,5783,5784,5785,1384,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,1679,5801,5802,5803,1115,1116,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,1680,5856,5857,5858,5859,5860,5861,5862,5863,5864,1681,5865,5866,5867,1682,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,1683,5880,1684,5881,5882,5883,5884,1685,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,1686,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,1687,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,1688,1689,5953,1199,5954,5955,5956,5957,5958,5959,5960,5961,1690,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,1385,5982,1386,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,1265,6028,6029,1691,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,1692,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,1693,6132,6133,6134,6135,6136,1694,6137,6138,6139,6140,6141,1695,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,1696,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,1697,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,1698,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,1200,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,1699,6303,6304,1700,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,1701,6340,6341,6342,6343,6344,1387,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,1702,6414,6415,6416,6417,6418,6419,6420,6421,6422,1703,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,1704,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,1266,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,1705,1706,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,1388,6638,6639,6640,6641,6642,6643,6644,1707,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,1708,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,1201,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,1389,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,1390,1709,6737,6738,6739,6740,6741,6742,1710,6743,6744,6745,6746,1391,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,1392,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,1202,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,1711,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,1393,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,1712,6903,6904,6905,6906,6907,6908,6909,6910,1713,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,1714,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,1394,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7e3,1715,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,1716,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,1395,7208,7209,7210,7211,7212,7213,1717,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,1718,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741];var a0={};a0.GB2312_TYPICAL_DISTRIBUTION_RATIO=.9;a0.GB2312_TABLE_SIZE=3760;a0.GB2312CharToFreqOrder=[1671,749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515,572,3191,2205,2361,224,2558,479,1711,963,3162,440,4060,1905,2966,2947,3580,2647,3961,3842,2204,869,4207,970,2678,5626,2944,2956,1479,4048,514,3595,588,1346,2820,3409,249,4088,1746,1873,2047,1774,581,1813,358,1174,3590,1014,1561,4844,2245,670,1636,3112,889,1286,953,556,2327,3060,1290,3141,613,185,3477,1367,850,3820,1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349,388,3098,2091,1360,3585,152,1687,1539,738,1559,59,1232,2925,2267,1388,1249,1741,1679,2960,151,1566,1125,1352,4271,924,4296,385,3166,4459,310,1245,2850,70,3285,2729,3534,3575,2398,3298,3466,1960,2265,217,3647,864,1909,2084,4401,2773,1010,3269,5152,853,3051,3121,1244,4251,1895,364,1499,1540,2313,1180,3655,2268,562,715,2417,3061,544,336,3768,2380,1752,4075,950,280,2425,4382,183,2759,3272,333,4297,2155,1688,2356,1444,1039,4540,736,1177,3349,2443,2368,2144,2225,565,196,1482,3406,927,1335,4147,692,878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816,2534,1546,2393,2760,737,2494,13,447,245,2747,38,2765,2129,2589,1079,606,360,471,3755,2890,404,848,699,1785,1236,370,2221,1023,3746,2074,2026,2023,2388,1581,2119,812,1141,3091,2536,1519,804,2053,406,1596,1090,784,548,4414,1806,2264,2936,1100,343,4114,5096,622,3358,743,3668,1510,1626,5020,3567,2513,3195,4115,5627,2489,2991,24,2065,2697,1087,2719,48,1634,315,68,985,2052,198,2239,1347,1107,1439,597,2366,2172,871,3307,919,2487,2790,1867,236,2570,1413,3794,906,3365,3381,1701,1982,1818,1524,2924,1205,616,2586,2072,2004,575,253,3099,32,1365,1182,197,1714,2454,1201,554,3388,3224,2748,756,2587,250,2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153,615,911,1506,1474,2495,1265,1906,2749,3756,3280,2161,898,2714,1759,3450,2243,2444,563,26,3286,2266,3769,3344,2707,3677,611,1402,531,1028,2871,4548,1375,261,2948,835,1190,4134,353,840,2684,1900,3082,1435,2109,1207,1674,329,1872,2781,4055,2686,2104,608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054,1681,1153,225,1627,2929,162,2050,2511,3687,1954,124,1859,2431,1684,3032,2894,585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209,256,518,2042,2105,3777,3657,643,2298,1148,1779,190,989,3544,414,11,2135,2063,2979,1471,403,3678,126,770,1563,671,2499,3216,2877,600,1179,307,2805,4937,1268,1297,2694,252,4032,1448,1494,1331,1394,127,2256,222,1647,1035,1481,3056,1915,1048,873,3651,210,33,1608,2516,200,1520,415,102,0,3389,1287,817,91,3299,2940,836,1814,549,2197,1396,1669,2987,3582,2297,2848,4528,1070,687,20,1819,121,1552,1364,1461,1968,2617,3540,2824,2083,177,948,4938,2291,110,4549,2066,648,3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123,208,1804,3159,2992,2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680,72,842,1990,212,1233,1154,1586,75,2027,3410,4900,1823,1337,2710,2676,728,2810,1522,3026,4995,157,755,1050,4022,710,785,1936,2194,2085,1406,2777,2400,150,1250,4049,1206,807,1910,534,529,3309,1721,1660,274,39,2827,661,2670,1578,925,3248,3815,1094,4278,4901,4252,41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,887,538,4187,3199,1294,2439,3042,2329,2343,2497,1255,107,543,1527,521,3478,3568,194,5062,15,961,3870,1241,1192,2664,66,5215,3260,2111,1295,1127,2152,3805,4135,901,1164,1976,398,1278,530,1460,748,904,1054,1966,1426,53,2909,509,523,2279,1534,536,1019,239,1685,460,2353,673,1065,2401,3600,4298,2272,1272,2363,284,1753,3679,4064,1695,81,815,2677,2757,2731,1386,859,500,4221,2190,2566,757,1006,2519,2068,1166,1455,337,2654,3203,1863,1682,1914,3025,1252,1409,1366,847,714,2834,2038,3209,964,2970,1901,885,2553,1078,1756,3049,301,1572,3326,688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088,262,1158,1254,389,1641,1812,526,1719,923,2073,1073,1902,468,489,4625,1140,857,2375,3070,3319,2863,380,116,1328,2693,1161,2244,273,1212,1884,2769,3011,1775,1142,461,3066,1200,2147,2212,790,702,2695,4222,1601,1058,434,2338,5153,3640,67,2360,4099,2502,618,3472,1329,416,1132,830,2782,1807,2653,3211,3510,1662,192,2124,296,3979,1739,1611,3684,23,118,324,446,1239,1225,293,2520,3814,3795,2535,3116,17,1074,467,2692,2201,387,2922,45,1326,3055,1645,3659,2817,958,243,1903,2320,1339,2825,1784,3289,356,576,865,2315,2381,3377,3916,1088,3122,1713,1655,935,628,4689,1034,1327,441,800,720,894,1979,2183,1528,5289,2702,1071,4046,3572,2399,1571,3281,79,761,1103,327,134,758,1899,1371,1615,879,442,215,2605,2579,173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,814,4968,3487,1548,2644,1567,1285,2,295,2636,97,946,3576,832,141,4257,3273,760,3821,3521,3156,2607,949,1024,1733,1516,1803,1920,2125,2283,2665,3180,1501,2064,3560,2171,1592,803,3518,1416,732,3897,4258,1363,1362,2458,119,1427,602,1525,2608,1605,1639,3175,694,3064,10,465,76,2e3,4846,4208,444,3781,1619,3353,2206,1273,3796,740,2483,320,1723,2377,3660,2619,1359,1137,1762,1724,2345,2842,1850,1862,912,821,1866,612,2625,1735,2573,3369,1093,844,89,937,930,1424,3564,2413,2972,1004,3046,3019,2011,711,3171,1452,4178,428,801,1943,432,445,2811,206,4136,1472,730,349,73,397,2802,2547,998,1637,1167,789,396,3217,154,1218,716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627,552,3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703,640,1045,1370,1246,4996,371,1575,2436,1621,2210,984,4033,1734,2638,16,4529,663,2755,3255,1451,3917,2257,1253,1955,2234,1263,2951,214,1229,617,485,359,1831,1969,473,2310,750,2058,165,80,2864,2419,361,4344,2416,2479,1134,796,3726,1266,2943,860,2715,938,390,2734,1313,1384,248,202,877,1064,2854,522,3907,279,1602,297,2357,395,3740,137,2075,944,4089,2584,1267,3802,62,1533,2285,178,176,780,2440,201,3707,590,478,1560,4354,2117,1075,30,74,4643,4004,1635,1441,2745,776,2596,238,1077,1692,1912,2844,605,499,1742,3947,241,3053,980,1749,936,2640,4511,2582,515,1543,2162,5322,2892,2993,890,2148,1924,665,1827,3581,1032,968,3163,339,1044,1896,270,583,1791,1720,4367,1194,3488,3669,43,2523,1657,163,2167,290,1209,1622,3378,550,634,2508,2510,695,2634,2384,2512,1476,1414,220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680,854,3227,1299,2976,3172,186,2998,1459,443,1067,3251,1495,321,1932,3054,909,753,1410,1828,436,2441,1119,1587,3164,2186,1258,227,231,1425,1890,3200,3942,247,959,725,5254,2741,577,2158,2079,929,120,174,838,2813,591,1115,417,2024,40,3240,1536,1037,291,4151,2354,632,1298,2406,2500,3535,1825,1846,3451,205,1171,345,4238,18,1163,811,685,2208,1217,425,1312,1508,1175,4308,2552,1033,587,1381,3059,2984,3482,340,1316,4023,3972,792,3176,519,777,4690,918,933,4130,2981,3741,90,3360,2911,2200,5184,4550,609,3079,2030,272,3379,2736,363,3881,1130,1447,286,779,357,1169,3350,3137,1630,1220,2687,2391,747,1277,3688,2618,2682,2601,1156,3196,5290,4034,3102,1689,3596,3128,874,219,2783,798,508,1843,2461,269,1658,1776,1392,1913,2983,3287,2866,2159,2372,829,4076,46,4253,2873,1889,1894,915,1834,1631,2181,2318,298,664,2818,3555,2735,954,3228,3117,527,3511,2173,681,2712,3033,2247,2346,3467,1652,155,2164,3382,113,1994,450,899,494,994,1237,2958,1875,2336,1926,3727,545,1577,1550,633,3473,204,1305,3072,2410,1956,2471,707,2134,841,2195,2196,2663,3843,1026,4940,990,3252,4997,368,1092,437,3212,3258,1933,1829,675,2977,2893,412,943,3723,4644,3294,3283,2230,2373,5154,2389,2241,2661,2323,1404,2524,593,787,677,3008,1275,2059,438,2709,2609,2240,2269,2246,1446,36,1568,1373,3892,1574,2301,1456,3962,693,2276,5216,2035,1143,2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090,424,1694,312,3634,3390,4179,3335,2252,1214,561,1059,3243,2295,2561,975,5155,2321,2751,3772,472,1537,3282,3398,1047,2077,2348,2878,1323,3340,3076,690,2906,51,369,170,3541,1060,2187,2688,3670,2541,1083,1683,928,3918,459,109,4427,599,3744,4286,143,2101,2730,2490,82,1588,3036,2121,281,1860,477,4035,1238,2812,3020,2716,3312,1530,2188,2055,1317,843,636,1808,1173,3495,649,181,1002,147,3641,1159,2414,3750,2289,2795,813,3123,2610,1136,4368,5,3391,4541,2174,420,429,1728,754,1228,2115,2219,347,2223,2733,735,1518,3003,2355,3134,1764,3948,3329,1888,2424,1001,1234,1972,3321,3363,1672,1021,1450,1584,226,765,655,2526,3404,3244,2302,3665,731,594,2184,319,1576,621,658,2656,4299,2099,3864,1279,2071,2598,2739,795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,2591,1084,213,2287,1963,3565,2250,822,793,4574,3187,1772,1789,3050,595,1484,1959,2770,1080,2650,456,422,2996,940,3322,4328,4345,3092,2742,965,2784,739,4124,952,1358,2498,2949,2565,332,2698,2378,660,2260,2473,4194,3856,2919,535,1260,2651,1208,1428,1300,1949,1303,2942,433,2455,2450,1251,1946,614,1269,641,1306,1810,2737,3078,2912,564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,3218,2175,1897,3063,682,1157,4040,4005,1712,1160,1941,1399,394,402,2952,1573,1151,2986,2404,862,299,2033,1489,3006,346,171,2886,3401,1726,2932,168,2533,47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,504,1036,2690,2988,2405,745,5871,849,2397,2056,3081,863,2359,3857,2096,99,1397,1769,2300,4428,1643,3455,1978,1757,3718,1440,35,4879,3742,1296,4228,2280,160,5063,1599,2013,166,520,3479,1646,3345,3012,490,1937,1545,1264,2182,2505,1096,1188,1369,1436,2421,1667,2792,2460,1270,2122,727,3167,2143,806,1706,1012,1800,3037,960,2218,1882,805,139,2456,1139,1521,851,1052,3093,3089,342,2039,744,5097,1468,1502,1585,2087,223,939,326,2140,2577,892,2481,1623,4077,982,3708,135,2131,87,2503,3114,2326,1106,876,1616,547,2997,2831,2093,3441,4530,4314,9,3256,4229,4148,659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,3274,1368,3689,4645,1477,705,3384,3635,1068,1529,2941,1458,3782,1509,100,1656,2548,718,2339,408,1590,2780,3548,1838,4117,3719,1345,3530,717,3442,2778,3220,2898,1892,4590,3614,3371,2043,1998,1224,3483,891,635,584,2559,3355,733,1766,1729,1172,3789,1891,2307,781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,3213,1189,1934,5693,3262,586,3118,1324,1598,517,1564,2217,1868,1893,4445,3728,2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287,338,1993,3129,3489,2689,1809,2815,1997,957,1855,3898,2550,3275,3057,1105,1319,627,1505,1911,1883,3526,698,3629,3456,1833,1431,746,77,1261,2017,2296,1977,1885,125,1334,1600,525,1798,1109,2222,1470,1945,559,2236,1186,3443,2476,1929,1411,2411,3135,1777,3372,2621,1841,1613,3229,668,1430,1839,2643,2916,195,1989,2671,2358,1387,629,3205,2293,5256,4439,123,1310,888,1879,4300,3021,3605,1003,1162,3192,2910,2010,140,2395,2859,55,1082,2012,2901,662,419,2081,1438,680,2774,4654,3912,1620,1731,1625,5035,4065,2328,512,1344,802,5443,2163,2311,2537,524,3399,98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,180,1113,4655,3461,2028,1698,833,2696,1235,1322,1594,4408,3623,3013,3225,2040,3022,541,2881,607,3632,2029,1665,1219,639,1385,1686,1099,2803,3231,1938,3188,2858,427,676,2772,1168,2025,454,3253,2486,3556,230,1950,580,791,1991,1280,1086,1974,2034,630,257,3338,2788,4903,1017,86,4790,966,2789,1995,1696,1131,259,3095,4188,1308,179,1463,5257,289,4107,1248,42,3413,1725,2288,896,1947,774,4474,4254,604,3430,4264,392,2514,2588,452,237,1408,3018,988,4531,1970,3034,3310,540,2370,1562,1288,2990,502,4765,1147,4,1853,2708,207,294,2814,4078,2902,2509,684,34,3105,3532,2551,644,709,2801,2344,573,1727,3573,3557,2021,1081,3100,4315,2100,3681,199,2263,1837,2385,146,3484,1195,2776,3949,997,1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076,493,117,5400,2521,972,1490,2934,1796,4542,2374,1512,2933,2657,413,2888,1135,2762,2314,2156,1355,2369,766,2007,2527,2170,3124,2491,2593,2632,4757,2437,234,3125,3591,1898,1750,1376,1942,3468,3138,570,2127,2145,3276,4131,962,132,1445,4196,19,941,3624,3480,3366,1973,1374,4461,3431,2629,283,2415,2275,808,2887,3620,2112,2563,1353,3610,955,1089,3103,1053,96,88,4097,823,3808,1583,399,292,4091,3313,421,1128,642,4006,903,2539,1877,2082,596,29,4066,1790,722,2157,130,995,1569,769,1485,464,513,2213,288,1923,1101,2453,4316,133,486,2445,50,625,487,2207,57,423,481,2962,159,3729,1558,491,303,482,501,240,2837,112,3648,2392,1783,362,8,3433,3422,610,2793,3277,1390,1284,1654,21,3823,734,367,623,193,287,374,1009,1483,816,476,313,2255,2340,1262,2150,2899,1146,2581,782,2116,1659,2018,1880,255,3586,3314,1110,2867,2137,2564,986,2767,5185,2006,650,158,926,762,881,3157,2717,2362,3587,306,3690,3245,1542,3077,2427,1691,2478,2118,2985,3490,2438,539,2305,983,129,1754,355,4201,2386,827,2923,104,1773,2838,2771,411,2905,3919,376,767,122,1114,828,2422,1817,3506,266,3460,1007,1609,4998,945,2612,4429,2274,726,1247,1964,2914,2199,2070,4002,4108,657,3323,1422,579,455,2764,4737,1222,2895,1670,824,1223,1487,2525,558,861,3080,598,2659,2515,1967,752,2583,2376,2214,4180,977,704,2464,4999,2622,4109,1210,2961,819,1541,142,2284,44,418,457,1126,3730,4347,4626,1644,1876,3671,1864,302,1063,5694,624,723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098,409,1011,2325,3704,2306,818,1732,1383,1824,1844,3757,999,2705,3497,1216,1423,2683,2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343,783,724,191,2434,1354,2220,5065,1763,2752,2472,4152,131,175,2885,3434,92,1466,4920,2616,3871,3872,3866,128,1551,1632,669,1854,3682,4691,4125,1230,188,2973,3290,1302,1213,560,3266,917,763,3909,3249,1760,868,1958,764,1782,2097,145,2277,3774,4462,64,1491,3062,971,2132,3606,2442,221,1226,1617,218,323,1185,3207,3147,571,619,1473,1005,1744,2281,449,1887,2396,3685,275,375,3816,1743,3844,3731,845,1983,2350,4210,1377,773,967,3499,3052,3743,2725,4007,1697,1022,3943,1464,3264,2855,2722,1952,1029,2839,2467,84,4383,2215,820,1391,2015,2448,3672,377,1948,2168,797,2545,3536,2578,2645,94,2874,1678,405,1259,3071,771,546,1315,470,1243,3083,895,2468,981,969,2037,846,4181,653,1276,2928,14,2594,557,3007,2474,156,902,1338,1740,2574,537,2518,973,2282,2216,2433,1928,138,2903,1293,2631,1612,646,3457,839,2935,111,496,2191,2847,589,3186,149,3994,2060,4031,2641,4067,3145,1870,37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,1301,251,2446,2599,2153,872,3246,637,334,3705,831,884,921,3065,3140,4092,2198,1944,246,2964,108,2045,1152,1921,2308,1031,203,3173,4170,1907,3890,810,1401,2003,1690,506,647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,498,666,2613,834,3817,1231,184,2851,1124,883,3197,2261,3710,1765,1553,2658,1178,2639,2351,93,1193,942,2538,2141,4402,235,1821,870,1591,2192,1709,1871,3341,1618,4126,2595,2334,603,651,69,701,268,2662,3411,2555,1380,1606,503,448,254,2371,2646,574,1187,2309,1770,322,2235,1292,1801,305,566,1133,229,2067,2057,706,167,483,2002,2672,3295,1820,3561,3067,316,378,2746,3452,1112,136,1981,507,1651,2917,1117,285,4591,182,2580,3522,1304,335,3303,1835,2504,1795,1792,2248,674,1018,2106,2449,1857,2292,2845,976,3047,1781,2600,2727,1389,1281,52,3152,153,265,3950,672,3485,3951,4463,430,1183,365,278,2169,27,1407,1336,2304,209,1340,1730,2202,1852,2403,2883,979,1737,1062,631,2829,2542,3876,2592,825,2086,2226,3048,3625,352,1417,3724,542,991,431,1351,3938,1861,2294,826,1361,2927,3142,3503,1738,463,2462,2723,582,1916,1595,2808,400,3845,3891,2868,3621,2254,58,2492,1123,910,2160,2614,1372,1603,1196,1072,3385,1700,3267,1980,696,480,2430,920,799,1570,2920,1951,2041,4047,2540,1321,4223,2469,3562,2228,1271,2602,401,2833,3351,2575,5157,907,2312,1256,410,263,3507,1582,996,678,1849,2316,1480,908,3545,2237,703,2322,667,1826,2849,1531,2604,2999,2407,3146,2151,2630,1786,3711,469,3542,497,3899,2409,858,837,4446,3393,1274,786,620,1845,2001,3311,484,308,3367,1204,1815,3691,2332,1532,2557,1842,2020,2724,1927,2333,4440,567,22,1673,2728,4475,1987,1858,1144,1597,101,1832,3601,12,974,3783,4391,951,1412,1,3720,453,4608,4041,528,1041,1027,3230,2628,1129,875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278,144,1758,3040,31,475,1680,366,2685,3184,311,1642,4008,2466,5036,1593,1493,2809,216,1420,1668,233,304,2128,3284,232,1429,1768,1040,2008,3407,2740,2967,2543,242,2133,778,1565,2022,2620,505,2189,2756,1098,2273,372,1614,708,553,2846,2094,2278,169,3626,2835,4161,228,2674,3165,809,1454,1309,466,1705,1095,900,3423,880,2667,3751,5258,2317,3109,2571,4317,2766,1503,1342,866,4447,1118,63,2076,314,1881,1348,1061,172,978,3515,1747,532,511,3970,6,601,905,2699,3300,1751,276,1467,3725,2668,65,4239,2544,2779,2556,1604,578,2451,1802,992,2331,2624,1320,3446,713,1513,1013,103,2786,2447,1661,886,1702,916,654,3574,2031,1556,751,2178,2821,2179,1498,1538,2176,271,914,2251,2080,1325,638,1953,2937,3877,2432,2754,95,3265,1716,260,1227,4083,775,106,1357,3254,426,1607,555,2480,772,1985,244,2546,474,495,1046,2611,1851,2061,71,2089,1675,2590,742,3758,2843,3222,1433,267,2180,2576,2826,2233,2092,3913,2435,956,1745,3075,856,2113,1116,451,3,1988,2896,1398,993,2463,1878,2049,1341,2718,2721,2870,2108,712,2904,4363,2753,2324,277,2872,2349,2649,384,987,435,691,3e3,922,164,3939,652,1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,2530,1434,2408,893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078,49,3770,3469,462,318,656,2259,3250,3069,679,1629,2758,344,1138,1104,3120,1836,1283,3115,2154,1437,4448,934,759,1999,794,2862,1038,533,2560,1722,2342,855,2626,1197,1663,4476,3127,85,4240,2528,25,1111,1181,3673,407,3470,4561,2679,2713,768,1925,2841,3986,1544,1165,932,373,1240,2146,1930,2673,721,4766,354,4333,391,2963,187,61,3364,1442,1102,330,1940,1767,341,3809,4118,393,2496,2062,2211,105,331,300,439,913,1332,626,379,3304,1557,328,689,3952,309,1555,931,317,2517,3027,325,569,686,2107,3084,60,1042,1333,2794,264,3177,4014,1628,258,3712,7,4464,1176,1043,1778,683,114,1975,78,1492,383,1886,510,386,645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,1282,1289,4609,697,1453,3044,2666,3611,1856,2412,54,719,1330,568,3778,2459,1748,788,492,551,1191,1e3,488,3394,3763,282,1799,348,2016,1523,3155,2390,1049,382,2019,1788,1170,729,2968,3523,897,3926,2785,2938,3292,350,2319,3238,1718,1717,2655,3453,3143,4465,161,2889,2980,2009,1421,56,1908,1640,2387,2232,1917,1874,2477,4921,148,83,3438,592,4245,2882,1822,1055,741,115,1496,1624,381,1638,4592,1020,516,3214,458,947,4575,1432,211,1514,2926,1865,2142,189,852,1221,1400,1486,882,2299,4036,351,28,1122,700,6479,6480,6481,6482,6483,5508,6484,3900,3414,3974,4441,4024,3537,4037,5628,5099,3633,6485,3148,6486,3636,5509,3257,5510,5973,5445,5872,4941,4403,3174,4627,5873,6276,2286,4230,5446,5874,5122,6102,6103,4162,5447,5123,5323,4849,6277,3980,3851,5066,4246,5774,5067,6278,3001,2807,5695,3346,5775,5974,5158,5448,6487,5975,5976,5776,3598,6279,5696,4806,4211,4154,6280,6488,6489,6490,6281,4212,5037,3374,4171,6491,4562,4807,4722,4827,5977,6104,4532,4079,5159,5324,5160,4404,3858,5359,5875,3975,4288,4610,3486,4512,5325,3893,5360,6282,6283,5560,2522,4231,5978,5186,5449,2569,3878,6284,5401,3578,4415,6285,4656,5124,5979,2506,4247,4449,3219,3417,4334,4969,4329,6492,4576,4828,4172,4416,4829,5402,6286,3927,3852,5361,4369,4830,4477,4867,5876,4173,6493,6105,4657,6287,6106,5877,5450,6494,4155,4868,5451,3700,5629,4384,6288,6289,5878,3189,4881,6107,6290,6495,4513,6496,4692,4515,4723,5100,3356,6497,6291,3810,4080,5561,3570,4430,5980,6498,4355,5697,6499,4724,6108,6109,3764,4050,5038,5879,4093,3226,6292,5068,5217,4693,3342,5630,3504,4831,4377,4466,4309,5698,4431,5777,6293,5778,4272,3706,6110,5326,3752,4676,5327,4273,5403,4767,5631,6500,5699,5880,3475,5039,6294,5562,5125,4348,4301,4482,4068,5126,4593,5700,3380,3462,5981,5563,3824,5404,4970,5511,3825,4738,6295,6501,5452,4516,6111,5881,5564,6502,6296,5982,6503,4213,4163,3454,6504,6112,4009,4450,6113,4658,6297,6114,3035,6505,6115,3995,4904,4739,4563,4942,4110,5040,3661,3928,5362,3674,6506,5292,3612,4791,5565,4149,5983,5328,5259,5021,4725,4577,4564,4517,4364,6298,5405,4578,5260,4594,4156,4157,5453,3592,3491,6507,5127,5512,4709,4922,5984,5701,4726,4289,6508,4015,6116,5128,4628,3424,4241,5779,6299,4905,6509,6510,5454,5702,5780,6300,4365,4923,3971,6511,5161,3270,3158,5985,4100,867,5129,5703,6117,5363,3695,3301,5513,4467,6118,6512,5455,4232,4242,4629,6513,3959,4478,6514,5514,5329,5986,4850,5162,5566,3846,4694,6119,5456,4869,5781,3779,6301,5704,5987,5515,4710,6302,5882,6120,4392,5364,5705,6515,6121,6516,6517,3736,5988,5457,5989,4695,2457,5883,4551,5782,6303,6304,6305,5130,4971,6122,5163,6123,4870,3263,5365,3150,4871,6518,6306,5783,5069,5706,3513,3498,4409,5330,5632,5366,5458,5459,3991,5990,4502,3324,5991,5784,3696,4518,5633,4119,6519,4630,5634,4417,5707,4832,5992,3418,6124,5993,5567,4768,5218,6520,4595,3458,5367,6125,5635,6126,4202,6521,4740,4924,6307,3981,4069,4385,6308,3883,2675,4051,3834,4302,4483,5568,5994,4972,4101,5368,6309,5164,5884,3922,6127,6522,6523,5261,5460,5187,4164,5219,3538,5516,4111,3524,5995,6310,6311,5369,3181,3386,2484,5188,3464,5569,3627,5708,6524,5406,5165,4677,4492,6312,4872,4851,5885,4468,5996,6313,5709,5710,6128,2470,5886,6314,5293,4882,5785,3325,5461,5101,6129,5711,5786,6525,4906,6526,6527,4418,5887,5712,4808,2907,3701,5713,5888,6528,3765,5636,5331,6529,6530,3593,5889,3637,4943,3692,5714,5787,4925,6315,6130,5462,4405,6131,6132,6316,5262,6531,6532,5715,3859,5716,5070,4696,5102,3929,5788,3987,4792,5997,6533,6534,3920,4809,5e3,5998,6535,2974,5370,6317,5189,5263,5717,3826,6536,3953,5001,4883,3190,5463,5890,4973,5999,4741,6133,6134,3607,5570,6e3,4711,3362,3630,4552,5041,6318,6001,2950,2953,5637,4646,5371,4944,6002,2044,4120,3429,6319,6537,5103,4833,6538,6539,4884,4647,3884,6003,6004,4758,3835,5220,5789,4565,5407,6540,6135,5294,4697,4852,6320,6321,3206,4907,6541,6322,4945,6542,6136,6543,6323,6005,4631,3519,6544,5891,6545,5464,3784,5221,6546,5571,4659,6547,6324,6137,5190,6548,3853,6549,4016,4834,3954,6138,5332,3827,4017,3210,3546,4469,5408,5718,3505,4648,5790,5131,5638,5791,5465,4727,4318,6325,6326,5792,4553,4010,4698,3439,4974,3638,4335,3085,6006,5104,5042,5166,5892,5572,6327,4356,4519,5222,5573,5333,5793,5043,6550,5639,5071,4503,6328,6139,6551,6140,3914,3901,5372,6007,5640,4728,4793,3976,3836,4885,6552,4127,6553,4451,4102,5002,6554,3686,5105,6555,5191,5072,5295,4611,5794,5296,6556,5893,5264,5894,4975,5466,5265,4699,4976,4370,4056,3492,5044,4886,6557,5795,4432,4769,4357,5467,3940,4660,4290,6141,4484,4770,4661,3992,6329,4025,4662,5022,4632,4835,4070,5297,4663,4596,5574,5132,5409,5895,6142,4504,5192,4664,5796,5896,3885,5575,5797,5023,4810,5798,3732,5223,4712,5298,4084,5334,5468,6143,4052,4053,4336,4977,4794,6558,5335,4908,5576,5224,4233,5024,4128,5469,5225,4873,6008,5045,4729,4742,4633,3675,4597,6559,5897,5133,5577,5003,5641,5719,6330,6560,3017,2382,3854,4406,4811,6331,4393,3964,4946,6561,2420,3722,6562,4926,4378,3247,1736,4442,6332,5134,6333,5226,3996,2918,5470,4319,4003,4598,4743,4744,4485,3785,3902,5167,5004,5373,4394,5898,6144,4874,1793,3997,6334,4085,4214,5106,5642,4909,5799,6009,4419,4189,3330,5899,4165,4420,5299,5720,5227,3347,6145,4081,6335,2876,3930,6146,3293,3786,3910,3998,5900,5300,5578,2840,6563,5901,5579,6147,3531,5374,6564,6565,5580,4759,5375,6566,6148,3559,5643,6336,6010,5517,6337,6338,5721,5902,3873,6011,6339,6567,5518,3868,3649,5722,6568,4771,4947,6569,6149,4812,6570,2853,5471,6340,6341,5644,4795,6342,6012,5723,6343,5724,6013,4349,6344,3160,6150,5193,4599,4514,4493,5168,4320,6345,4927,3666,4745,5169,5903,5005,4928,6346,5725,6014,4730,4203,5046,4948,3395,5170,6015,4150,6016,5726,5519,6347,5047,3550,6151,6348,4197,4310,5904,6571,5581,2965,6152,4978,3960,4291,5135,6572,5301,5727,4129,4026,5905,4853,5728,5472,6153,6349,4533,2700,4505,5336,4678,3583,5073,2994,4486,3043,4554,5520,6350,6017,5800,4487,6351,3931,4103,5376,6352,4011,4321,4311,4190,5136,6018,3988,3233,4350,5906,5645,4198,6573,5107,3432,4191,3435,5582,6574,4139,5410,6353,5411,3944,5583,5074,3198,6575,6354,4358,6576,5302,4600,5584,5194,5412,6577,6578,5585,5413,5303,4248,5414,3879,4433,6579,4479,5025,4854,5415,6355,4760,4772,3683,2978,4700,3797,4452,3965,3932,3721,4910,5801,6580,5195,3551,5907,3221,3471,3029,6019,3999,5908,5909,5266,5267,3444,3023,3828,3170,4796,5646,4979,4259,6356,5647,5337,3694,6357,5648,5338,4520,4322,5802,3031,3759,4071,6020,5586,4836,4386,5048,6581,3571,4679,4174,4949,6154,4813,3787,3402,3822,3958,3215,3552,5268,4387,3933,4950,4359,6021,5910,5075,3579,6358,4234,4566,5521,6359,3613,5049,6022,5911,3375,3702,3178,4911,5339,4521,6582,6583,4395,3087,3811,5377,6023,6360,6155,4027,5171,5649,4421,4249,2804,6584,2270,6585,4e3,4235,3045,6156,5137,5729,4140,4312,3886,6361,4330,6157,4215,6158,3500,3676,4929,4331,3713,4930,5912,4265,3776,3368,5587,4470,4855,3038,4980,3631,6159,6160,4132,4680,6161,6362,3923,4379,5588,4255,6586,4121,6587,6363,4649,6364,3288,4773,4774,6162,6024,6365,3543,6588,4274,3107,3737,5050,5803,4797,4522,5589,5051,5730,3714,4887,5378,4001,4523,6163,5026,5522,4701,4175,2791,3760,6589,5473,4224,4133,3847,4814,4815,4775,3259,5416,6590,2738,6164,6025,5304,3733,5076,5650,4816,5590,6591,6165,6592,3934,5269,6593,3396,5340,6594,5804,3445,3602,4042,4488,5731,5732,3525,5591,4601,5196,6166,6026,5172,3642,4612,3202,4506,4798,6366,3818,5108,4303,5138,5139,4776,3332,4304,2915,3415,4434,5077,5109,4856,2879,5305,4817,6595,5913,3104,3144,3903,4634,5341,3133,5110,5651,5805,6167,4057,5592,2945,4371,5593,6596,3474,4182,6367,6597,6168,4507,4279,6598,2822,6599,4777,4713,5594,3829,6169,3887,5417,6170,3653,5474,6368,4216,2971,5228,3790,4579,6369,5733,6600,6601,4951,4746,4555,6602,5418,5475,6027,3400,4665,5806,6171,4799,6028,5052,6172,3343,4800,4747,5006,6370,4556,4217,5476,4396,5229,5379,5477,3839,5914,5652,5807,4714,3068,4635,5808,6173,5342,4192,5078,5419,5523,5734,6174,4557,6175,4602,6371,6176,6603,5809,6372,5735,4260,3869,5111,5230,6029,5112,6177,3126,4681,5524,5915,2706,3563,4748,3130,6178,4018,5525,6604,6605,5478,4012,4837,6606,4534,4193,5810,4857,3615,5479,6030,4082,3697,3539,4086,5270,3662,4508,4931,5916,4912,5811,5027,3888,6607,4397,3527,3302,3798,2775,2921,2637,3966,4122,4388,4028,4054,1633,4858,5079,3024,5007,3982,3412,5736,6608,3426,3236,5595,3030,6179,3427,3336,3279,3110,6373,3874,3039,5080,5917,5140,4489,3119,6374,5812,3405,4494,6031,4666,4141,6180,4166,6032,5813,4981,6609,5081,4422,4982,4112,3915,5653,3296,3983,6375,4266,4410,5654,6610,6181,3436,5082,6611,5380,6033,3819,5596,4535,5231,5306,5113,6612,4952,5918,4275,3113,6613,6376,6182,6183,5814,3073,4731,4838,5008,3831,6614,4888,3090,3848,4280,5526,5232,3014,5655,5009,5737,5420,5527,6615,5815,5343,5173,5381,4818,6616,3151,4953,6617,5738,2796,3204,4360,2989,4281,5739,5174,5421,5197,3132,5141,3849,5142,5528,5083,3799,3904,4839,5480,2880,4495,3448,6377,6184,5271,5919,3771,3193,6034,6035,5920,5010,6036,5597,6037,6378,6038,3106,5422,6618,5423,5424,4142,6619,4889,5084,4890,4313,5740,6620,3437,5175,5307,5816,4199,5198,5529,5817,5199,5656,4913,5028,5344,3850,6185,2955,5272,5011,5818,4567,4580,5029,5921,3616,5233,6621,6622,6186,4176,6039,6379,6380,3352,5200,5273,2908,5598,5234,3837,5308,6623,6624,5819,4496,4323,5309,5201,6625,6626,4983,3194,3838,4167,5530,5922,5274,6381,6382,3860,3861,5599,3333,4292,4509,6383,3553,5481,5820,5531,4778,6187,3955,3956,4324,4389,4218,3945,4325,3397,2681,5923,4779,5085,4019,5482,4891,5382,5383,6040,4682,3425,5275,4094,6627,5310,3015,5483,5657,4398,5924,3168,4819,6628,5925,6629,5532,4932,4613,6041,6630,4636,6384,4780,4204,5658,4423,5821,3989,4683,5822,6385,4954,6631,5345,6188,5425,5012,5384,3894,6386,4490,4104,6632,5741,5053,6633,5823,5926,5659,5660,5927,6634,5235,5742,5824,4840,4933,4820,6387,4859,5928,4955,6388,4143,3584,5825,5346,5013,6635,5661,6389,5014,5484,5743,4337,5176,5662,6390,2836,6391,3268,6392,6636,6042,5236,6637,4158,6638,5744,5663,4471,5347,3663,4123,5143,4293,3895,6639,6640,5311,5929,5826,3800,6189,6393,6190,5664,5348,3554,3594,4749,4603,6641,5385,4801,6043,5827,4183,6642,5312,5426,4761,6394,5665,6191,4715,2669,6643,6644,5533,3185,5427,5086,5930,5931,5386,6192,6044,6645,4781,4013,5745,4282,4435,5534,4390,4267,6045,5746,4984,6046,2743,6193,3501,4087,5485,5932,5428,4184,4095,5747,4061,5054,3058,3862,5933,5600,6646,5144,3618,6395,3131,5055,5313,6396,4650,4956,3855,6194,3896,5202,4985,4029,4225,6195,6647,5828,5486,5829,3589,3002,6648,6397,4782,5276,6649,6196,6650,4105,3803,4043,5237,5830,6398,4096,3643,6399,3528,6651,4453,3315,4637,6652,3984,6197,5535,3182,3339,6653,3096,2660,6400,6654,3449,5934,4250,4236,6047,6401,5831,6655,5487,3753,4062,5832,6198,6199,6656,3766,6657,3403,4667,6048,6658,4338,2897,5833,3880,2797,3780,4326,6659,5748,5015,6660,5387,4351,5601,4411,6661,3654,4424,5935,4339,4072,5277,4568,5536,6402,6662,5238,6663,5349,5203,6200,5204,6201,5145,4536,5016,5056,4762,5834,4399,4957,6202,6403,5666,5749,6664,4340,6665,5936,5177,5667,6666,6667,3459,4668,6404,6668,6669,4543,6203,6670,4276,6405,4480,5537,6671,4614,5205,5668,6672,3348,2193,4763,6406,6204,5937,5602,4177,5669,3419,6673,4020,6205,4443,4569,5388,3715,3639,6407,6049,4058,6206,6674,5938,4544,6050,4185,4294,4841,4651,4615,5488,6207,6408,6051,5178,3241,3509,5835,6208,4958,5836,4341,5489,5278,6209,2823,5538,5350,5206,5429,6675,4638,4875,4073,3516,4684,4914,4860,5939,5603,5389,6052,5057,3237,5490,3791,6676,6409,6677,4821,4915,4106,5351,5058,4243,5539,4244,5604,4842,4916,5239,3028,3716,5837,5114,5605,5390,5940,5430,6210,4332,6678,5540,4732,3667,3840,6053,4305,3408,5670,5541,6410,2744,5240,5750,6679,3234,5606,6680,5607,5671,3608,4283,4159,4400,5352,4783,6681,6411,6682,4491,4802,6211,6412,5941,6413,6414,5542,5751,6683,4669,3734,5942,6684,6415,5943,5059,3328,4670,4144,4268,6685,6686,6687,6688,4372,3603,6689,5944,5491,4373,3440,6416,5543,4784,4822,5608,3792,4616,5838,5672,3514,5391,6417,4892,6690,4639,6691,6054,5673,5839,6055,6692,6056,5392,6212,4038,5544,5674,4497,6057,6693,5840,4284,5675,4021,4545,5609,6418,4454,6419,6213,4113,4472,5314,3738,5087,5279,4074,5610,4959,4063,3179,4750,6058,6420,6214,3476,4498,4716,5431,4960,4685,6215,5241,6694,6421,6216,6695,5841,5945,6422,3748,5946,5179,3905,5752,5545,5947,4374,6217,4455,6423,4412,6218,4803,5353,6696,3832,5280,6219,4327,4702,6220,6221,6059,4652,5432,6424,3749,4751,6425,5753,4986,5393,4917,5948,5030,5754,4861,4733,6426,4703,6697,6222,4671,5949,4546,4961,5180,6223,5031,3316,5281,6698,4862,4295,4934,5207,3644,6427,5842,5950,6428,6429,4570,5843,5282,6430,6224,5088,3239,6060,6699,5844,5755,6061,6431,2701,5546,6432,5115,5676,4039,3993,3327,4752,4425,5315,6433,3941,6434,5677,4617,4604,3074,4581,6225,5433,6435,6226,6062,4823,5756,5116,6227,3717,5678,4717,5845,6436,5679,5846,6063,5847,6064,3977,3354,6437,3863,5117,6228,5547,5394,4499,4524,6229,4605,6230,4306,4500,6700,5951,6065,3693,5952,5089,4366,4918,6701,6231,5548,6232,6702,6438,4704,5434,6703,6704,5953,4168,6705,5680,3420,6706,5242,4407,6066,3812,5757,5090,5954,4672,4525,3481,5681,4618,5395,5354,5316,5955,6439,4962,6707,4526,6440,3465,4673,6067,6441,5682,6708,5435,5492,5758,5683,4619,4571,4674,4804,4893,4686,5493,4753,6233,6068,4269,6442,6234,5032,4705,5146,5243,5208,5848,6235,6443,4963,5033,4640,4226,6236,5849,3387,6444,6445,4436,4437,5850,4843,5494,4785,4894,6709,4361,6710,5091,5956,3331,6237,4987,5549,6069,6711,4342,3517,4473,5317,6070,6712,6071,4706,6446,5017,5355,6713,6714,4988,5436,6447,4734,5759,6715,4735,4547,4456,4754,6448,5851,6449,6450,3547,5852,5318,6451,6452,5092,4205,6716,6238,4620,4219,5611,6239,6072,4481,5760,5957,5958,4059,6240,6453,4227,4537,6241,5761,4030,4186,5244,5209,3761,4457,4876,3337,5495,5181,6242,5959,5319,5612,5684,5853,3493,5854,6073,4169,5613,5147,4895,6074,5210,6717,5182,6718,3830,6243,2798,3841,6075,6244,5855,5614,3604,4606,5496,5685,5118,5356,6719,6454,5960,5357,5961,6720,4145,3935,4621,5119,5962,4261,6721,6455,4786,5963,4375,4582,6245,6246,6247,6076,5437,4877,5856,3376,4380,6248,4160,6722,5148,6456,5211,6457,6723,4718,6458,6724,6249,5358,4044,3297,6459,6250,5857,5615,5497,5245,6460,5498,6725,6251,6252,5550,3793,5499,2959,5396,6461,6462,4572,5093,5500,5964,3806,4146,6463,4426,5762,5858,6077,6253,4755,3967,4220,5965,6254,4989,5501,6464,4352,6726,6078,4764,2290,5246,3906,5438,5283,3767,4964,2861,5763,5094,6255,6256,4622,5616,5859,5860,4707,6727,4285,4708,4824,5617,6257,5551,4787,5212,4965,4935,4687,6465,6728,6466,5686,6079,3494,4413,2995,5247,5966,5618,6729,5967,5764,5765,5687,5502,6730,6731,6080,5397,6467,4990,6258,6732,4538,5060,5619,6733,4719,5688,5439,5018,5149,5284,5503,6734,6081,4607,6259,5120,3645,5861,4583,6260,4584,4675,5620,4098,5440,6261,4863,2379,3306,4585,5552,5689,4586,5285,6735,4864,6736,5286,6082,6737,4623,3010,4788,4381,4558,5621,4587,4896,3698,3161,5248,4353,4045,6262,3754,5183,4588,6738,6263,6739,6740,5622,3936,6741,6468,6742,6264,5095,6469,4991,5968,6743,4992,6744,6083,4897,6745,4256,5766,4307,3108,3968,4444,5287,3889,4343,6084,4510,6085,4559,6086,4898,5969,6746,5623,5061,4919,5249,5250,5504,5441,6265,5320,4878,3242,5862,5251,3428,6087,6747,4237,5624,5442,6266,5553,4539,6748,2585,3533,5398,4262,6088,5150,4736,4438,6089,6267,5505,4966,6749,6268,6750,6269,5288,5554,3650,6090,6091,4624,6092,5690,6751,5863,4270,5691,4277,5555,5864,6752,5692,4720,4865,6470,5151,4688,4825,6753,3094,6754,6471,3235,4653,6755,5213,5399,6756,3201,4589,5865,4967,6472,5866,6473,5019,3016,6757,5321,4756,3957,4573,6093,4993,5767,4721,6474,6758,5625,6759,4458,6475,6270,6760,5556,4994,5214,5252,6271,3875,5768,6094,5034,5506,4376,5769,6761,2120,6476,5253,5770,6762,5771,5970,3990,5971,5557,5558,5772,6477,6095,2787,4641,5972,5121,6096,6097,6272,6763,3703,5867,5507,6273,4206,6274,4789,6098,6764,3619,3646,3833,3804,2394,3788,4936,3978,4866,4899,6099,6100,5559,6478,6765,3599,5868,6101,5869,5870,6275,6766,4527,6767];var o0={};o0.BIG5_TYPICAL_DISTRIBUTION_RATIO=.75;o0.BIG5_TABLE_SIZE=5376;o0.Big5CharToFreqOrder=[1,1801,1506,255,1431,198,9,82,6,5008,177,202,3681,1256,2821,110,3814,33,3274,261,76,44,2114,16,2946,2187,1176,659,3971,26,3451,2653,1198,3972,3350,4202,410,2215,302,590,361,1964,8,204,58,4510,5009,1932,63,5010,5011,317,1614,75,222,159,4203,2417,1480,5012,3555,3091,224,2822,3682,3,10,3973,1471,29,2787,1135,2866,1940,873,130,3275,1123,312,5013,4511,2052,507,252,682,5014,142,1915,124,206,2947,34,3556,3204,64,604,5015,2501,1977,1978,155,1991,645,641,1606,5016,3452,337,72,406,5017,80,630,238,3205,1509,263,939,1092,2654,756,1440,1094,3453,449,69,2987,591,179,2096,471,115,2035,1844,60,50,2988,134,806,1869,734,2036,3454,180,995,1607,156,537,2907,688,5018,319,1305,779,2145,514,2379,298,4512,359,2502,90,2716,1338,663,11,906,1099,2553,20,2441,182,532,1716,5019,732,1376,4204,1311,1420,3206,25,2317,1056,113,399,382,1950,242,3455,2474,529,3276,475,1447,3683,5020,117,21,656,810,1297,2300,2334,3557,5021,126,4205,706,456,150,613,4513,71,1118,2037,4206,145,3092,85,835,486,2115,1246,1426,428,727,1285,1015,800,106,623,303,1281,5022,2128,2359,347,3815,221,3558,3135,5023,1956,1153,4207,83,296,1199,3093,192,624,93,5024,822,1898,2823,3136,795,2065,991,1554,1542,1592,27,43,2867,859,139,1456,860,4514,437,712,3974,164,2397,3137,695,211,3037,2097,195,3975,1608,3559,3560,3684,3976,234,811,2989,2098,3977,2233,1441,3561,1615,2380,668,2077,1638,305,228,1664,4515,467,415,5025,262,2099,1593,239,108,300,200,1033,512,1247,2078,5026,5027,2176,3207,3685,2682,593,845,1062,3277,88,1723,2038,3978,1951,212,266,152,149,468,1899,4208,4516,77,187,5028,3038,37,5,2990,5029,3979,5030,5031,39,2524,4517,2908,3208,2079,55,148,74,4518,545,483,1474,1029,1665,217,1870,1531,3138,1104,2655,4209,24,172,3562,900,3980,3563,3564,4519,32,1408,2824,1312,329,487,2360,2251,2717,784,2683,4,3039,3351,1427,1789,188,109,499,5032,3686,1717,1790,888,1217,3040,4520,5033,3565,5034,3352,1520,3687,3981,196,1034,775,5035,5036,929,1816,249,439,38,5037,1063,5038,794,3982,1435,2301,46,178,3278,2066,5039,2381,5040,214,1709,4521,804,35,707,324,3688,1601,2554,140,459,4210,5041,5042,1365,839,272,978,2262,2580,3456,2129,1363,3689,1423,697,100,3094,48,70,1231,495,3139,2196,5043,1294,5044,2080,462,586,1042,3279,853,256,988,185,2382,3457,1698,434,1084,5045,3458,314,2625,2788,4522,2335,2336,569,2285,637,1817,2525,757,1162,1879,1616,3459,287,1577,2116,768,4523,1671,2868,3566,2526,1321,3816,909,2418,5046,4211,933,3817,4212,2053,2361,1222,4524,765,2419,1322,786,4525,5047,1920,1462,1677,2909,1699,5048,4526,1424,2442,3140,3690,2600,3353,1775,1941,3460,3983,4213,309,1369,1130,2825,364,2234,1653,1299,3984,3567,3985,3986,2656,525,1085,3041,902,2001,1475,964,4527,421,1845,1415,1057,2286,940,1364,3141,376,4528,4529,1381,7,2527,983,2383,336,1710,2684,1846,321,3461,559,1131,3042,2752,1809,1132,1313,265,1481,1858,5049,352,1203,2826,3280,167,1089,420,2827,776,792,1724,3568,4214,2443,3281,5050,4215,5051,446,229,333,2753,901,3818,1200,1557,4530,2657,1921,395,2754,2685,3819,4216,1836,125,916,3209,2626,4531,5052,5053,3820,5054,5055,5056,4532,3142,3691,1133,2555,1757,3462,1510,2318,1409,3569,5057,2146,438,2601,2910,2384,3354,1068,958,3043,461,311,2869,2686,4217,1916,3210,4218,1979,383,750,2755,2627,4219,274,539,385,1278,1442,5058,1154,1965,384,561,210,98,1295,2556,3570,5059,1711,2420,1482,3463,3987,2911,1257,129,5060,3821,642,523,2789,2790,2658,5061,141,2235,1333,68,176,441,876,907,4220,603,2602,710,171,3464,404,549,18,3143,2398,1410,3692,1666,5062,3571,4533,2912,4534,5063,2991,368,5064,146,366,99,871,3693,1543,748,807,1586,1185,22,2263,379,3822,3211,5065,3212,505,1942,2628,1992,1382,2319,5066,380,2362,218,702,1818,1248,3465,3044,3572,3355,3282,5067,2992,3694,930,3283,3823,5068,59,5069,585,601,4221,497,3466,1112,1314,4535,1802,5070,1223,1472,2177,5071,749,1837,690,1900,3824,1773,3988,1476,429,1043,1791,2236,2117,917,4222,447,1086,1629,5072,556,5073,5074,2021,1654,844,1090,105,550,966,1758,2828,1008,1783,686,1095,5075,2287,793,1602,5076,3573,2603,4536,4223,2948,2302,4537,3825,980,2503,544,353,527,4538,908,2687,2913,5077,381,2629,1943,1348,5078,1341,1252,560,3095,5079,3467,2870,5080,2054,973,886,2081,143,4539,5081,5082,157,3989,496,4224,57,840,540,2039,4540,4541,3468,2118,1445,970,2264,1748,1966,2082,4225,3144,1234,1776,3284,2829,3695,773,1206,2130,1066,2040,1326,3990,1738,1725,4226,279,3145,51,1544,2604,423,1578,2131,2067,173,4542,1880,5083,5084,1583,264,610,3696,4543,2444,280,154,5085,5086,5087,1739,338,1282,3096,693,2871,1411,1074,3826,2445,5088,4544,5089,5090,1240,952,2399,5091,2914,1538,2688,685,1483,4227,2475,1436,953,4228,2055,4545,671,2400,79,4229,2446,3285,608,567,2689,3469,4230,4231,1691,393,1261,1792,2401,5092,4546,5093,5094,5095,5096,1383,1672,3827,3213,1464,522,1119,661,1150,216,675,4547,3991,1432,3574,609,4548,2690,2402,5097,5098,5099,4232,3045,0,5100,2476,315,231,2447,301,3356,4549,2385,5101,233,4233,3697,1819,4550,4551,5102,96,1777,1315,2083,5103,257,5104,1810,3698,2718,1139,1820,4234,2022,1124,2164,2791,1778,2659,5105,3097,363,1655,3214,5106,2993,5107,5108,5109,3992,1567,3993,718,103,3215,849,1443,341,3357,2949,1484,5110,1712,127,67,339,4235,2403,679,1412,821,5111,5112,834,738,351,2994,2147,846,235,1497,1881,418,1993,3828,2719,186,1100,2148,2756,3575,1545,1355,2950,2872,1377,583,3994,4236,2581,2995,5113,1298,3699,1078,2557,3700,2363,78,3829,3830,267,1289,2100,2002,1594,4237,348,369,1274,2197,2178,1838,4552,1821,2830,3701,2757,2288,2003,4553,2951,2758,144,3358,882,4554,3995,2759,3470,4555,2915,5114,4238,1726,320,5115,3996,3046,788,2996,5116,2831,1774,1327,2873,3997,2832,5117,1306,4556,2004,1700,3831,3576,2364,2660,787,2023,506,824,3702,534,323,4557,1044,3359,2024,1901,946,3471,5118,1779,1500,1678,5119,1882,4558,165,243,4559,3703,2528,123,683,4239,764,4560,36,3998,1793,589,2916,816,626,1667,3047,2237,1639,1555,1622,3832,3999,5120,4e3,2874,1370,1228,1933,891,2084,2917,304,4240,5121,292,2997,2720,3577,691,2101,4241,1115,4561,118,662,5122,611,1156,854,2386,1316,2875,2,386,515,2918,5123,5124,3286,868,2238,1486,855,2661,785,2216,3048,5125,1040,3216,3578,5126,3146,448,5127,1525,5128,2165,4562,5129,3833,5130,4242,2833,3579,3147,503,818,4001,3148,1568,814,676,1444,306,1749,5131,3834,1416,1030,197,1428,805,2834,1501,4563,5132,5133,5134,1994,5135,4564,5136,5137,2198,13,2792,3704,2998,3149,1229,1917,5138,3835,2132,5139,4243,4565,2404,3580,5140,2217,1511,1727,1120,5141,5142,646,3836,2448,307,5143,5144,1595,3217,5145,5146,5147,3705,1113,1356,4002,1465,2529,2530,5148,519,5149,128,2133,92,2289,1980,5150,4003,1512,342,3150,2199,5151,2793,2218,1981,3360,4244,290,1656,1317,789,827,2365,5152,3837,4566,562,581,4004,5153,401,4567,2252,94,4568,5154,1399,2794,5155,1463,2025,4569,3218,1944,5156,828,1105,4245,1262,1394,5157,4246,605,4570,5158,1784,2876,5159,2835,819,2102,578,2200,2952,5160,1502,436,3287,4247,3288,2836,4005,2919,3472,3473,5161,2721,2320,5162,5163,2337,2068,23,4571,193,826,3838,2103,699,1630,4248,3098,390,1794,1064,3581,5164,1579,3099,3100,1400,5165,4249,1839,1640,2877,5166,4572,4573,137,4250,598,3101,1967,780,104,974,2953,5167,278,899,253,402,572,504,493,1339,5168,4006,1275,4574,2582,2558,5169,3706,3049,3102,2253,565,1334,2722,863,41,5170,5171,4575,5172,1657,2338,19,463,2760,4251,606,5173,2999,3289,1087,2085,1323,2662,3e3,5174,1631,1623,1750,4252,2691,5175,2878,791,2723,2663,2339,232,2421,5176,3001,1498,5177,2664,2630,755,1366,3707,3290,3151,2026,1609,119,1918,3474,862,1026,4253,5178,4007,3839,4576,4008,4577,2265,1952,2477,5179,1125,817,4254,4255,4009,1513,1766,2041,1487,4256,3050,3291,2837,3840,3152,5180,5181,1507,5182,2692,733,40,1632,1106,2879,345,4257,841,2531,230,4578,3002,1847,3292,3475,5183,1263,986,3476,5184,735,879,254,1137,857,622,1300,1180,1388,1562,4010,4011,2954,967,2761,2665,1349,592,2134,1692,3361,3003,1995,4258,1679,4012,1902,2188,5185,739,3708,2724,1296,1290,5186,4259,2201,2202,1922,1563,2605,2559,1871,2762,3004,5187,435,5188,343,1108,596,17,1751,4579,2239,3477,3709,5189,4580,294,3582,2955,1693,477,979,281,2042,3583,643,2043,3710,2631,2795,2266,1031,2340,2135,2303,3584,4581,367,1249,2560,5190,3585,5191,4582,1283,3362,2005,240,1762,3363,4583,4584,836,1069,3153,474,5192,2149,2532,268,3586,5193,3219,1521,1284,5194,1658,1546,4260,5195,3587,3588,5196,4261,3364,2693,1685,4262,961,1673,2632,190,2006,2203,3841,4585,4586,5197,570,2504,3711,1490,5198,4587,2633,3293,1957,4588,584,1514,396,1045,1945,5199,4589,1968,2449,5200,5201,4590,4013,619,5202,3154,3294,215,2007,2796,2561,3220,4591,3221,4592,763,4263,3842,4593,5203,5204,1958,1767,2956,3365,3712,1174,452,1477,4594,3366,3155,5205,2838,1253,2387,2189,1091,2290,4264,492,5206,638,1169,1825,2136,1752,4014,648,926,1021,1324,4595,520,4596,997,847,1007,892,4597,3843,2267,1872,3713,2405,1785,4598,1953,2957,3103,3222,1728,4265,2044,3714,4599,2008,1701,3156,1551,30,2268,4266,5207,2027,4600,3589,5208,501,5209,4267,594,3478,2166,1822,3590,3479,3591,3223,829,2839,4268,5210,1680,3157,1225,4269,5211,3295,4601,4270,3158,2341,5212,4602,4271,5213,4015,4016,5214,1848,2388,2606,3367,5215,4603,374,4017,652,4272,4273,375,1140,798,5216,5217,5218,2366,4604,2269,546,1659,138,3051,2450,4605,5219,2254,612,1849,910,796,3844,1740,1371,825,3845,3846,5220,2920,2562,5221,692,444,3052,2634,801,4606,4274,5222,1491,244,1053,3053,4275,4276,340,5223,4018,1041,3005,293,1168,87,1357,5224,1539,959,5225,2240,721,694,4277,3847,219,1478,644,1417,3368,2666,1413,1401,1335,1389,4019,5226,5227,3006,2367,3159,1826,730,1515,184,2840,66,4607,5228,1660,2958,246,3369,378,1457,226,3480,975,4020,2959,1264,3592,674,696,5229,163,5230,1141,2422,2167,713,3593,3370,4608,4021,5231,5232,1186,15,5233,1079,1070,5234,1522,3224,3594,276,1050,2725,758,1126,653,2960,3296,5235,2342,889,3595,4022,3104,3007,903,1250,4609,4023,3481,3596,1342,1681,1718,766,3297,286,89,2961,3715,5236,1713,5237,2607,3371,3008,5238,2962,2219,3225,2880,5239,4610,2505,2533,181,387,1075,4024,731,2190,3372,5240,3298,310,313,3482,2304,770,4278,54,3054,189,4611,3105,3848,4025,5241,1230,1617,1850,355,3597,4279,4612,3373,111,4280,3716,1350,3160,3483,3055,4281,2150,3299,3598,5242,2797,4026,4027,3009,722,2009,5243,1071,247,1207,2343,2478,1378,4613,2010,864,1437,1214,4614,373,3849,1142,2220,667,4615,442,2763,2563,3850,4028,1969,4282,3300,1840,837,170,1107,934,1336,1883,5244,5245,2119,4283,2841,743,1569,5246,4616,4284,582,2389,1418,3484,5247,1803,5248,357,1395,1729,3717,3301,2423,1564,2241,5249,3106,3851,1633,4617,1114,2086,4285,1532,5250,482,2451,4618,5251,5252,1492,833,1466,5253,2726,3599,1641,2842,5254,1526,1272,3718,4286,1686,1795,416,2564,1903,1954,1804,5255,3852,2798,3853,1159,2321,5256,2881,4619,1610,1584,3056,2424,2764,443,3302,1163,3161,5257,5258,4029,5259,4287,2506,3057,4620,4030,3162,2104,1647,3600,2011,1873,4288,5260,4289,431,3485,5261,250,97,81,4290,5262,1648,1851,1558,160,848,5263,866,740,1694,5264,2204,2843,3226,4291,4621,3719,1687,950,2479,426,469,3227,3720,3721,4031,5265,5266,1188,424,1996,861,3601,4292,3854,2205,2694,168,1235,3602,4293,5267,2087,1674,4622,3374,3303,220,2565,1009,5268,3855,670,3010,332,1208,717,5269,5270,3603,2452,4032,3375,5271,513,5272,1209,2882,3376,3163,4623,1080,5273,5274,5275,5276,2534,3722,3604,815,1587,4033,4034,5277,3605,3486,3856,1254,4624,1328,3058,1390,4035,1741,4036,3857,4037,5278,236,3858,2453,3304,5279,5280,3723,3859,1273,3860,4625,5281,308,5282,4626,245,4627,1852,2480,1307,2583,430,715,2137,2454,5283,270,199,2883,4038,5284,3606,2727,1753,761,1754,725,1661,1841,4628,3487,3724,5285,5286,587,14,3305,227,2608,326,480,2270,943,2765,3607,291,650,1884,5287,1702,1226,102,1547,62,3488,904,4629,3489,1164,4294,5288,5289,1224,1548,2766,391,498,1493,5290,1386,1419,5291,2056,1177,4630,813,880,1081,2368,566,1145,4631,2291,1001,1035,2566,2609,2242,394,1286,5292,5293,2069,5294,86,1494,1730,4039,491,1588,745,897,2963,843,3377,4040,2767,2884,3306,1768,998,2221,2070,397,1827,1195,1970,3725,3011,3378,284,5295,3861,2507,2138,2120,1904,5296,4041,2151,4042,4295,1036,3490,1905,114,2567,4296,209,1527,5297,5298,2964,2844,2635,2390,2728,3164,812,2568,5299,3307,5300,1559,737,1885,3726,1210,885,28,2695,3608,3862,5301,4297,1004,1780,4632,5302,346,1982,2222,2696,4633,3863,1742,797,1642,4043,1934,1072,1384,2152,896,4044,3308,3727,3228,2885,3609,5303,2569,1959,4634,2455,1786,5304,5305,5306,4045,4298,1005,1308,3728,4299,2729,4635,4636,1528,2610,161,1178,4300,1983,987,4637,1101,4301,631,4046,1157,3229,2425,1343,1241,1016,2243,2570,372,877,2344,2508,1160,555,1935,911,4047,5307,466,1170,169,1051,2921,2697,3729,2481,3012,1182,2012,2571,1251,2636,5308,992,2345,3491,1540,2730,1201,2071,2406,1997,2482,5309,4638,528,1923,2191,1503,1874,1570,2369,3379,3309,5310,557,1073,5311,1828,3492,2088,2271,3165,3059,3107,767,3108,2799,4639,1006,4302,4640,2346,1267,2179,3730,3230,778,4048,3231,2731,1597,2667,5312,4641,5313,3493,5314,5315,5316,3310,2698,1433,3311,131,95,1504,4049,723,4303,3166,1842,3610,2768,2192,4050,2028,2105,3731,5317,3013,4051,1218,5318,3380,3232,4052,4304,2584,248,1634,3864,912,5319,2845,3732,3060,3865,654,53,5320,3014,5321,1688,4642,777,3494,1032,4053,1425,5322,191,820,2121,2846,971,4643,931,3233,135,664,783,3866,1998,772,2922,1936,4054,3867,4644,2923,3234,282,2732,640,1372,3495,1127,922,325,3381,5323,5324,711,2045,5325,5326,4055,2223,2800,1937,4056,3382,2224,2255,3868,2305,5327,4645,3869,1258,3312,4057,3235,2139,2965,4058,4059,5328,2225,258,3236,4646,101,1227,5329,3313,1755,5330,1391,3314,5331,2924,2057,893,5332,5333,5334,1402,4305,2347,5335,5336,3237,3611,5337,5338,878,1325,1781,2801,4647,259,1385,2585,744,1183,2272,4648,5339,4060,2509,5340,684,1024,4306,5341,472,3612,3496,1165,3315,4061,4062,322,2153,881,455,1695,1152,1340,660,554,2154,4649,1058,4650,4307,830,1065,3383,4063,4651,1924,5342,1703,1919,5343,932,2273,122,5344,4652,947,677,5345,3870,2637,297,1906,1925,2274,4653,2322,3316,5346,5347,4308,5348,4309,84,4310,112,989,5349,547,1059,4064,701,3613,1019,5350,4311,5351,3497,942,639,457,2306,2456,993,2966,407,851,494,4654,3384,927,5352,1237,5353,2426,3385,573,4312,680,921,2925,1279,1875,285,790,1448,1984,719,2168,5354,5355,4655,4065,4066,1649,5356,1541,563,5357,1077,5358,3386,3061,3498,511,3015,4067,4068,3733,4069,1268,2572,3387,3238,4656,4657,5359,535,1048,1276,1189,2926,2029,3167,1438,1373,2847,2967,1134,2013,5360,4313,1238,2586,3109,1259,5361,700,5362,2968,3168,3734,4314,5363,4315,1146,1876,1907,4658,2611,4070,781,2427,132,1589,203,147,273,2802,2407,898,1787,2155,4071,4072,5364,3871,2803,5365,5366,4659,4660,5367,3239,5368,1635,3872,965,5369,1805,2699,1516,3614,1121,1082,1329,3317,4073,1449,3873,65,1128,2848,2927,2769,1590,3874,5370,5371,12,2668,45,976,2587,3169,4661,517,2535,1013,1037,3240,5372,3875,2849,5373,3876,5374,3499,5375,2612,614,1999,2323,3877,3110,2733,2638,5376,2588,4316,599,1269,5377,1811,3735,5378,2700,3111,759,1060,489,1806,3388,3318,1358,5379,5380,2391,1387,1215,2639,2256,490,5381,5382,4317,1759,2392,2348,5383,4662,3878,1908,4074,2640,1807,3241,4663,3500,3319,2770,2349,874,5384,5385,3501,3736,1859,91,2928,3737,3062,3879,4664,5386,3170,4075,2669,5387,3502,1202,1403,3880,2969,2536,1517,2510,4665,3503,2511,5388,4666,5389,2701,1886,1495,1731,4076,2370,4667,5390,2030,5391,5392,4077,2702,1216,237,2589,4318,2324,4078,3881,4668,4669,2703,3615,3504,445,4670,5393,5394,5395,5396,2771,61,4079,3738,1823,4080,5397,687,2046,935,925,405,2670,703,1096,1860,2734,4671,4081,1877,1367,2704,3389,918,2106,1782,2483,334,3320,1611,1093,4672,564,3171,3505,3739,3390,945,2641,2058,4673,5398,1926,872,4319,5399,3506,2705,3112,349,4320,3740,4082,4674,3882,4321,3741,2156,4083,4675,4676,4322,4677,2408,2047,782,4084,400,251,4323,1624,5400,5401,277,3742,299,1265,476,1191,3883,2122,4324,4325,1109,205,5402,2590,1e3,2157,3616,1861,5403,5404,5405,4678,5406,4679,2573,107,2484,2158,4085,3507,3172,5407,1533,541,1301,158,753,4326,2886,3617,5408,1696,370,1088,4327,4680,3618,579,327,440,162,2244,269,1938,1374,3508,968,3063,56,1396,3113,2107,3321,3391,5409,1927,2159,4681,3016,5410,3619,5411,5412,3743,4682,2485,5413,2804,5414,1650,4683,5415,2613,5416,5417,4086,2671,3392,1149,3393,4087,3884,4088,5418,1076,49,5419,951,3242,3322,3323,450,2850,920,5420,1812,2805,2371,4328,1909,1138,2372,3885,3509,5421,3243,4684,1910,1147,1518,2428,4685,3886,5422,4686,2393,2614,260,1796,3244,5423,5424,3887,3324,708,5425,3620,1704,5426,3621,1351,1618,3394,3017,1887,944,4329,3395,4330,3064,3396,4331,5427,3744,422,413,1714,3325,500,2059,2350,4332,2486,5428,1344,1911,954,5429,1668,5430,5431,4089,2409,4333,3622,3888,4334,5432,2307,1318,2512,3114,133,3115,2887,4687,629,31,2851,2706,3889,4688,850,949,4689,4090,2970,1732,2089,4335,1496,1853,5433,4091,620,3245,981,1242,3745,3397,1619,3746,1643,3326,2140,2457,1971,1719,3510,2169,5434,3246,5435,5436,3398,1829,5437,1277,4690,1565,2048,5438,1636,3623,3116,5439,869,2852,655,3890,3891,3117,4092,3018,3892,1310,3624,4691,5440,5441,5442,1733,558,4692,3747,335,1549,3065,1756,4336,3748,1946,3511,1830,1291,1192,470,2735,2108,2806,913,1054,4093,5443,1027,5444,3066,4094,4693,982,2672,3399,3173,3512,3247,3248,1947,2807,5445,571,4694,5446,1831,5447,3625,2591,1523,2429,5448,2090,984,4695,3749,1960,5449,3750,852,923,2808,3513,3751,969,1519,999,2049,2325,1705,5450,3118,615,1662,151,597,4095,2410,2326,1049,275,4696,3752,4337,568,3753,3626,2487,4338,3754,5451,2430,2275,409,3249,5452,1566,2888,3514,1002,769,2853,194,2091,3174,3755,2226,3327,4339,628,1505,5453,5454,1763,2180,3019,4096,521,1161,2592,1788,2206,2411,4697,4097,1625,4340,4341,412,42,3119,464,5455,2642,4698,3400,1760,1571,2889,3515,2537,1219,2207,3893,2643,2141,2373,4699,4700,3328,1651,3401,3627,5456,5457,3628,2488,3516,5458,3756,5459,5460,2276,2092,460,5461,4701,5462,3020,962,588,3629,289,3250,2644,1116,52,5463,3067,1797,5464,5465,5466,1467,5467,1598,1143,3757,4342,1985,1734,1067,4702,1280,3402,465,4703,1572,510,5468,1928,2245,1813,1644,3630,5469,4704,3758,5470,5471,2673,1573,1534,5472,5473,536,1808,1761,3517,3894,3175,2645,5474,5475,5476,4705,3518,2929,1912,2809,5477,3329,1122,377,3251,5478,360,5479,5480,4343,1529,551,5481,2060,3759,1769,2431,5482,2930,4344,3330,3120,2327,2109,2031,4706,1404,136,1468,1479,672,1171,3252,2308,271,3176,5483,2772,5484,2050,678,2736,865,1948,4707,5485,2014,4098,2971,5486,2737,2227,1397,3068,3760,4708,4709,1735,2931,3403,3631,5487,3895,509,2854,2458,2890,3896,5488,5489,3177,3178,4710,4345,2538,4711,2309,1166,1010,552,681,1888,5490,5491,2972,2973,4099,1287,1596,1862,3179,358,453,736,175,478,1117,905,1167,1097,5492,1854,1530,5493,1706,5494,2181,3519,2292,3761,3520,3632,4346,2093,4347,5495,3404,1193,2489,4348,1458,2193,2208,1863,1889,1421,3331,2932,3069,2182,3521,595,2123,5496,4100,5497,5498,4349,1707,2646,223,3762,1359,751,3121,183,3522,5499,2810,3021,419,2374,633,704,3897,2394,241,5500,5501,5502,838,3022,3763,2277,2773,2459,3898,1939,2051,4101,1309,3122,2246,1181,5503,1136,2209,3899,2375,1446,4350,2310,4712,5504,5505,4351,1055,2615,484,3764,5506,4102,625,4352,2278,3405,1499,4353,4103,5507,4104,4354,3253,2279,2280,3523,5508,5509,2774,808,2616,3765,3406,4105,4355,3123,2539,526,3407,3900,4356,955,5510,1620,4357,2647,2432,5511,1429,3766,1669,1832,994,928,5512,3633,1260,5513,5514,5515,1949,2293,741,2933,1626,4358,2738,2460,867,1184,362,3408,1392,5516,5517,4106,4359,1770,1736,3254,2934,4713,4714,1929,2707,1459,1158,5518,3070,3409,2891,1292,1930,2513,2855,3767,1986,1187,2072,2015,2617,4360,5519,2574,2514,2170,3768,2490,3332,5520,3769,4715,5521,5522,666,1003,3023,1022,3634,4361,5523,4716,1814,2257,574,3901,1603,295,1535,705,3902,4362,283,858,417,5524,5525,3255,4717,4718,3071,1220,1890,1046,2281,2461,4107,1393,1599,689,2575,388,4363,5526,2491,802,5527,2811,3903,2061,1405,2258,5528,4719,3904,2110,1052,1345,3256,1585,5529,809,5530,5531,5532,575,2739,3524,956,1552,1469,1144,2328,5533,2329,1560,2462,3635,3257,4108,616,2210,4364,3180,2183,2294,5534,1833,5535,3525,4720,5536,1319,3770,3771,1211,3636,1023,3258,1293,2812,5537,5538,5539,3905,607,2311,3906,762,2892,1439,4365,1360,4721,1485,3072,5540,4722,1038,4366,1450,2062,2648,4367,1379,4723,2593,5541,5542,4368,1352,1414,2330,2935,1172,5543,5544,3907,3908,4724,1798,1451,5545,5546,5547,5548,2936,4109,4110,2492,2351,411,4111,4112,3637,3333,3124,4725,1561,2674,1452,4113,1375,5549,5550,47,2974,316,5551,1406,1591,2937,3181,5552,1025,2142,3125,3182,354,2740,884,2228,4369,2412,508,3772,726,3638,996,2433,3639,729,5553,392,2194,1453,4114,4726,3773,5554,5555,2463,3640,2618,1675,2813,919,2352,2975,2353,1270,4727,4115,73,5556,5557,647,5558,3259,2856,2259,1550,1346,3024,5559,1332,883,3526,5560,5561,5562,5563,3334,2775,5564,1212,831,1347,4370,4728,2331,3909,1864,3073,720,3910,4729,4730,3911,5565,4371,5566,5567,4731,5568,5569,1799,4732,3774,2619,4733,3641,1645,2376,4734,5570,2938,669,2211,2675,2434,5571,2893,5572,5573,1028,3260,5574,4372,2413,5575,2260,1353,5576,5577,4735,3183,518,5578,4116,5579,4373,1961,5580,2143,4374,5581,5582,3025,2354,2355,3912,516,1834,1454,4117,2708,4375,4736,2229,2620,1972,1129,3642,5583,2776,5584,2976,1422,577,1470,3026,1524,3410,5585,5586,432,4376,3074,3527,5587,2594,1455,2515,2230,1973,1175,5588,1020,2741,4118,3528,4737,5589,2742,5590,1743,1361,3075,3529,2649,4119,4377,4738,2295,895,924,4378,2171,331,2247,3076,166,1627,3077,1098,5591,1232,2894,2231,3411,4739,657,403,1196,2377,542,3775,3412,1600,4379,3530,5592,4740,2777,3261,576,530,1362,4741,4742,2540,2676,3776,4120,5593,842,3913,5594,2814,2032,1014,4121,213,2709,3413,665,621,4380,5595,3777,2939,2435,5596,2436,3335,3643,3414,4743,4381,2541,4382,4744,3644,1682,4383,3531,1380,5597,724,2282,600,1670,5598,1337,1233,4745,3126,2248,5599,1621,4746,5600,651,4384,5601,1612,4385,2621,5602,2857,5603,2743,2312,3078,5604,716,2464,3079,174,1255,2710,4122,3645,548,1320,1398,728,4123,1574,5605,1891,1197,3080,4124,5606,3081,3082,3778,3646,3779,747,5607,635,4386,4747,5608,5609,5610,4387,5611,5612,4748,5613,3415,4749,2437,451,5614,3780,2542,2073,4388,2744,4389,4125,5615,1764,4750,5616,4390,350,4751,2283,2395,2493,5617,4391,4126,2249,1434,4127,488,4752,458,4392,4128,3781,771,1330,2396,3914,2576,3184,2160,2414,1553,2677,3185,4393,5618,2494,2895,2622,1720,2711,4394,3416,4753,5619,2543,4395,5620,3262,4396,2778,5621,2016,2745,5622,1155,1017,3782,3915,5623,3336,2313,201,1865,4397,1430,5624,4129,5625,5626,5627,5628,5629,4398,1604,5630,414,1866,371,2595,4754,4755,3532,2017,3127,4756,1708,960,4399,887,389,2172,1536,1663,1721,5631,2232,4130,2356,2940,1580,5632,5633,1744,4757,2544,4758,4759,5634,4760,5635,2074,5636,4761,3647,3417,2896,4400,5637,4401,2650,3418,2815,673,2712,2465,709,3533,4131,3648,4402,5638,1148,502,634,5639,5640,1204,4762,3649,1575,4763,2623,3783,5641,3784,3128,948,3263,121,1745,3916,1110,5642,4403,3083,2516,3027,4132,3785,1151,1771,3917,1488,4133,1987,5643,2438,3534,5644,5645,2094,5646,4404,3918,1213,1407,2816,531,2746,2545,3264,1011,1537,4764,2779,4405,3129,1061,5647,3786,3787,1867,2897,5648,2018,120,4406,4407,2063,3650,3265,2314,3919,2678,3419,1955,4765,4134,5649,3535,1047,2713,1266,5650,1368,4766,2858,649,3420,3920,2546,2747,1102,2859,2679,5651,5652,2e3,5653,1111,3651,2977,5654,2495,3921,3652,2817,1855,3421,3788,5655,5656,3422,2415,2898,3337,3266,3653,5657,2577,5658,3654,2818,4135,1460,856,5659,3655,5660,2899,2978,5661,2900,3922,5662,4408,632,2517,875,3923,1697,3924,2296,5663,5664,4767,3028,1239,580,4768,4409,5665,914,936,2075,1190,4136,1039,2124,5666,5667,5668,5669,3423,1473,5670,1354,4410,3925,4769,2173,3084,4137,915,3338,4411,4412,3339,1605,1835,5671,2748,398,3656,4413,3926,4138,328,1913,2860,4139,3927,1331,4414,3029,937,4415,5672,3657,4140,4141,3424,2161,4770,3425,524,742,538,3085,1012,5673,5674,3928,2466,5675,658,1103,225,3929,5676,5677,4771,5678,4772,5679,3267,1243,5680,4142,963,2250,4773,5681,2714,3658,3186,5682,5683,2596,2332,5684,4774,5685,5686,5687,3536,957,3426,2547,2033,1931,2941,2467,870,2019,3659,1746,2780,2781,2439,2468,5688,3930,5689,3789,3130,3790,3537,3427,3791,5690,1179,3086,5691,3187,2378,4416,3792,2548,3188,3131,2749,4143,5692,3428,1556,2549,2297,977,2901,2034,4144,1205,3429,5693,1765,3430,3189,2125,1271,714,1689,4775,3538,5694,2333,3931,533,4417,3660,2184,617,5695,2469,3340,3539,2315,5696,5697,3190,5698,5699,3932,1988,618,427,2651,3540,3431,5700,5701,1244,1690,5702,2819,4418,4776,5703,3541,4777,5704,2284,1576,473,3661,4419,3432,972,5705,3662,5706,3087,5707,5708,4778,4779,5709,3793,4145,4146,5710,153,4780,356,5711,1892,2902,4420,2144,408,803,2357,5712,3933,5713,4421,1646,2578,2518,4781,4782,3934,5714,3935,4422,5715,2416,3433,752,5716,5717,1962,3341,2979,5718,746,3030,2470,4783,4423,3794,698,4784,1893,4424,3663,2550,4785,3664,3936,5719,3191,3434,5720,1824,1302,4147,2715,3937,1974,4425,5721,4426,3192,823,1303,1288,1236,2861,3542,4148,3435,774,3938,5722,1581,4786,1304,2862,3939,4787,5723,2440,2162,1083,3268,4427,4149,4428,344,1173,288,2316,454,1683,5724,5725,1461,4788,4150,2597,5726,5727,4789,985,894,5728,3436,3193,5729,1914,2942,3795,1989,5730,2111,1975,5731,4151,5732,2579,1194,425,5733,4790,3194,1245,3796,4429,5734,5735,2863,5736,636,4791,1856,3940,760,1800,5737,4430,2212,1508,4792,4152,1894,1684,2298,5738,5739,4793,4431,4432,2213,479,5740,5741,832,5742,4153,2496,5743,2980,2497,3797,990,3132,627,1815,2652,4433,1582,4434,2126,2112,3543,4794,5744,799,4435,3195,5745,4795,2113,1737,3031,1018,543,754,4436,3342,1676,4796,4797,4154,4798,1489,5746,3544,5747,2624,2903,4155,5748,5749,2981,5750,5751,5752,5753,3196,4799,4800,2185,1722,5754,3269,3270,1843,3665,1715,481,365,1976,1857,5755,5756,1963,2498,4801,5757,2127,3666,3271,433,1895,2064,2076,5758,602,2750,5759,5760,5761,5762,5763,3032,1628,3437,5764,3197,4802,4156,2904,4803,2519,5765,2551,2782,5766,5767,5768,3343,4804,2905,5769,4805,5770,2864,4806,4807,1221,2982,4157,2520,5771,5772,5773,1868,1990,5774,5775,5776,1896,5777,5778,4808,1897,4158,318,5779,2095,4159,4437,5780,5781,485,5782,938,3941,553,2680,116,5783,3942,3667,5784,3545,2681,2783,3438,3344,2820,5785,3668,2943,4160,1747,2944,2983,5786,5787,207,5788,4809,5789,4810,2521,5790,3033,890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795,941,2299,208,3546,4161,2020,330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798,2522,1613,4812,5799,3345,3945,2523,5800,4162,5801,1637,4163,2471,4813,3946,5802,2500,3034,3800,5803,5804,2195,4814,5805,2163,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6e3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,3670,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,4815,6286,6287,6288,6289,6290,6291,6292,4816,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,4817,4818,6312,6313,6314,6315,6316,6317,6318,4819,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,4820,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,3441,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,4440,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,4821,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,3947,3948,6478,6479,6480,6481,3272,4441,6482,6483,6484,6485,4442,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,4822,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,2784,6557,4823,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,3949,6570,6571,6572,4824,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,4825,6584,6585,6586,3950,2785,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,4826,6613,6614,6615,4827,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,4164,6626,6627,6628,6629,6630,6631,6632,6633,6634,3547,6635,4828,6636,6637,6638,6639,6640,6641,6642,3951,2984,6643,6644,6645,6646,6647,6648,6649,4165,6650,4829,6651,6652,4830,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,4831,6663,6664,6665,6666,6667,6668,6669,6670,6671,4166,6672,4832,3952,6673,6674,6675,6676,4833,6677,6678,6679,4167,6680,6681,6682,3198,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,4834,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,4443,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,4444,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,4168,6782,6783,3442,6784,6785,6786,6787,6788,6789,6790,6791,4169,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,4835,6812,6813,6814,4445,6815,6816,4446,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,3548,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,4836,6847,6848,6849,6850,6851,6852,6853,6854,3953,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,3199,6878,6879,6880,6881,6882,4447,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,4170,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,4837,6928,6929,6930,6931,6932,6933,6934,6935,6936,3346,6937,6938,4838,6939,6940,6941,4448,6942,6943,6944,6945,6946,4449,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,3671,6995,6996,6997,6998,4839,6999,7e3,7001,7002,3549,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,4840,7031,7032,7033,7034,7035,7036,7037,7038,4841,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,2985,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,4842,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,4450,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,4843,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,4171,4172,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,4844,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,4451,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,4173,7354,7355,4845,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,4846,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,3672,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,4452,7454,3200,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,4847,7475,7476,7477,3133,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,3347,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,4848,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,3801,4849,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,3035,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,4850,7617,7618,3802,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,4851,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,4453,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,3443,7698,7699,7700,7701,7702,4454,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,2472,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,3954,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,3134,7751,7752,4852,7753,7754,7755,4853,7756,7757,7758,7759,7760,4174,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,4854,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,4855,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,3955,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,3444,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,4175,7892,7893,7894,7895,7896,4856,4857,7897,7898,7899,7900,2598,7901,7902,7903,7904,7905,7906,7907,7908,4455,7909,7910,7911,7912,7913,7914,3201,7915,7916,7917,7918,7919,7920,7921,4858,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,4859,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,4860,7997,7998,7999,8e3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,4176,8017,8018,8019,8020,8021,8022,8023,4861,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,4862,4456,8037,8038,8039,8040,4863,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,4864,4177,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,4178,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,4865,4866,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,4179,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,4457,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,3445,8257,8258,8259,8260,8261,8262,4458,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,4459,8273,8274,8275,8276,3550,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,4460,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,4867,8308,8309,8310,8311,8312,3551,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,4868,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,4869,4461,8364,8365,8366,8367,8368,8369,8370,4870,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,4871,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,4462,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,2986,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,4180,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,4872,8565,8566,8567,8568,8569,8570,8571,8572,8573,4873,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,3803,8606,8607,8608,8609,8610,8611,8612,8613,4874,3804,8614,8615,8616,8617,8618,8619,8620,8621,3956,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,2865,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,4463,8657,8658,8659,4875,4876,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,4464,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,2261,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,4181,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,4877,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,4878,8789,4879,8790,8791,8792,4880,8793,8794,8795,8796,8797,8798,8799,8800,8801,4881,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,3957,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,4882,8848,8849,8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,3202,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,4465,8925,8926,8927,8928,8929,8930,8931,8932,4883,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,2214,8944,8945,8946,8947,8948,8949,8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,4884,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,4885,8993,8994,8995,8996,8997,8998,8999,9e3,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,4182,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,4886,9064,9065,9066,9067,9068,9069,4887,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,3958,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,4888,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,4889,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,4890,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,4466,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,4891,9246,9247,9248,9249,9250,9251,9252,9253,9254,9255,9256,9257,4892,9258,9259,9260,9261,4893,4894,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,4467,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,3673,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,4895,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,4468,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,4896,9374,4469,9375,9376,9377,9378,9379,4897,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9406,4470,9407,2751,9408,9409,3674,3552,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,4898,9422,9423,9424,9425,9426,9427,9428,9429,3959,9430,9431,9432,9433,9434,9435,9436,4471,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9450,3348,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,4899,9473,9474,9475,9476,9477,4900,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,3349,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,4901,9521,9522,9523,9524,9525,9526,4902,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,3805,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,4903,9603,9604,9605,9606,9607,4904,9608,9609,9610,9611,9612,9613,9614,4905,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9632,4906,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,4907,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9657,9658,9659,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,4183,9673,9674,9675,9676,9677,4908,9678,9679,9680,9681,4909,9682,9683,9684,9685,9686,9687,9688,9689,9690,4910,9691,9692,9693,3675,9694,9695,9696,2945,9697,9698,9699,9700,9701,9702,9703,9704,9705,4911,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,4912,9736,9737,9738,9739,9740,4913,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,4914,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,4915,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,4916,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,4917,9869,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,9892,4472,9893,9894,9895,9896,9897,3806,9898,9899,9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,4918,9915,9916,9917,4919,9918,9919,9920,9921,4184,9922,9923,9924,9925,9926,9927,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944,9945,9946,4920,9947,9948,9949,9950,9951,9952,9953,9954,9955,4185,9956,9957,9958,9959,9960,9961,9962,9963,9964,9965,4921,9966,9967,9968,4473,9969,9970,9971,9972,9973,9974,9975,9976,9977,4474,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987,9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,9999,1e4,10001,10002,10003,10004,10005,10006,10007,10008,10009,10010,10011,10012,10013,10014,10015,10016,10017,10018,10019,10020,10021,4922,10022,4923,10023,10024,10025,10026,10027,10028,10029,10030,10031,10032,10033,10034,10035,10036,10037,10038,10039,10040,10041,10042,10043,10044,10045,10046,10047,10048,4924,10049,10050,10051,10052,10053,10054,10055,10056,10057,10058,10059,10060,10061,10062,10063,10064,10065,10066,10067,10068,10069,10070,10071,10072,10073,10074,10075,10076,10077,10078,10079,10080,10081,10082,10083,10084,10085,10086,10087,4475,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,4476,10098,10099,10100,10101,10102,10103,10104,10105,10106,10107,10108,10109,10110,10111,2174,10112,10113,10114,10115,10116,10117,10118,10119,10120,10121,10122,10123,10124,10125,10126,10127,10128,10129,10130,10131,10132,10133,10134,10135,10136,10137,10138,10139,10140,3807,4186,4925,10141,10142,10143,10144,10145,10146,10147,4477,4187,10148,10149,10150,10151,10152,10153,4188,10154,10155,10156,10157,10158,10159,10160,10161,4926,10162,10163,10164,10165,10166,10167,10168,10169,10170,10171,10172,10173,10174,10175,10176,10177,10178,10179,10180,10181,10182,10183,10184,10185,10186,10187,10188,10189,10190,10191,10192,3203,10193,10194,10195,10196,10197,10198,10199,10200,4478,10201,10202,10203,10204,4479,10205,10206,10207,10208,10209,10210,10211,10212,10213,10214,10215,10216,10217,10218,10219,10220,10221,10222,10223,10224,10225,10226,10227,10228,10229,10230,10231,10232,10233,10234,4927,10235,10236,10237,10238,10239,10240,10241,10242,10243,10244,10245,10246,10247,10248,10249,10250,10251,10252,10253,10254,10255,10256,10257,10258,10259,10260,10261,10262,10263,10264,10265,10266,10267,10268,10269,10270,10271,10272,10273,4480,4928,4929,10274,10275,10276,10277,10278,10279,10280,10281,10282,10283,10284,10285,10286,10287,10288,10289,10290,10291,10292,10293,10294,10295,10296,10297,10298,10299,10300,10301,10302,10303,10304,10305,10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,10317,10318,10319,10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,10332,10333,10334,4930,10335,10336,10337,10338,10339,10340,10341,10342,4931,10343,10344,10345,10346,10347,10348,10349,10350,10351,10352,10353,10354,10355,3088,10356,2786,10357,10358,10359,10360,4189,10361,10362,10363,10364,10365,10366,10367,10368,10369,10370,10371,10372,10373,10374,10375,4932,10376,10377,10378,10379,10380,10381,10382,10383,10384,10385,10386,10387,10388,10389,10390,10391,10392,4933,10393,10394,10395,4934,10396,10397,10398,10399,10400,10401,10402,10403,10404,10405,10406,10407,10408,10409,10410,10411,10412,3446,10413,10414,10415,10416,10417,10418,10419,10420,10421,10422,10423,4935,10424,10425,10426,10427,10428,10429,10430,4936,10431,10432,10433,10434,10435,10436,10437,10438,10439,10440,10441,10442,10443,4937,10444,10445,10446,10447,4481,10448,10449,10450,10451,10452,10453,10454,10455,10456,10457,10458,10459,10460,10461,10462,10463,10464,10465,10466,10467,10468,10469,10470,10471,10472,10473,10474,10475,10476,10477,10478,10479,10480,10481,10482,10483,10484,10485,10486,10487,10488,10489,10490,10491,10492,10493,10494,10495,10496,10497,10498,10499,10500,10501,10502,10503,10504,10505,4938,10506,10507,10508,10509,10510,2552,10511,10512,10513,10514,10515,10516,3447,10517,10518,10519,10520,10521,10522,10523,10524,10525,10526,10527,10528,10529,10530,10531,10532,10533,10534,10535,10536,10537,10538,10539,10540,10541,10542,10543,4482,10544,4939,10545,10546,10547,10548,10549,10550,10551,10552,10553,10554,10555,10556,10557,10558,10559,10560,10561,10562,10563,10564,10565,10566,10567,3676,4483,10568,10569,10570,10571,10572,3448,10573,10574,10575,10576,10577,10578,10579,10580,10581,10582,10583,10584,10585,10586,10587,10588,10589,10590,10591,10592,10593,10594,10595,10596,10597,10598,10599,10600,10601,10602,10603,10604,10605,10606,10607,10608,10609,10610,10611,10612,10613,10614,10615,10616,10617,10618,10619,10620,10621,10622,10623,10624,10625,10626,10627,4484,10628,10629,10630,10631,10632,4940,10633,10634,10635,10636,10637,10638,10639,10640,10641,10642,10643,10644,10645,10646,10647,10648,10649,10650,10651,10652,10653,10654,10655,10656,4941,10657,10658,10659,2599,10660,10661,10662,10663,10664,10665,10666,3089,10667,10668,10669,10670,10671,10672,10673,10674,10675,10676,10677,10678,10679,10680,4942,10681,10682,10683,10684,10685,10686,10687,10688,10689,10690,10691,10692,10693,10694,10695,10696,10697,4485,10698,10699,10700,10701,10702,10703,10704,4943,10705,3677,10706,10707,10708,10709,10710,10711,10712,4944,10713,10714,10715,10716,10717,10718,10719,10720,10721,10722,10723,10724,10725,10726,10727,10728,4945,10729,10730,10731,10732,10733,10734,10735,10736,10737,10738,10739,10740,10741,10742,10743,10744,10745,10746,10747,10748,10749,10750,10751,10752,10753,10754,10755,10756,10757,10758,10759,10760,10761,4946,10762,10763,10764,10765,10766,10767,4947,4948,10768,10769,10770,10771,10772,10773,10774,10775,10776,10777,10778,10779,10780,10781,10782,10783,10784,10785,10786,10787,10788,10789,10790,10791,10792,10793,10794,10795,10796,10797,10798,10799,10800,10801,10802,10803,10804,10805,10806,10807,10808,10809,10810,10811,10812,10813,10814,10815,10816,10817,10818,10819,10820,10821,10822,10823,10824,10825,10826,10827,10828,10829,10830,10831,10832,10833,10834,10835,10836,10837,10838,10839,10840,10841,10842,10843,10844,10845,10846,10847,10848,10849,10850,10851,10852,10853,10854,10855,10856,10857,10858,10859,10860,10861,10862,10863,10864,10865,10866,10867,10868,10869,10870,10871,10872,10873,10874,10875,10876,10877,10878,4486,10879,10880,10881,10882,10883,10884,10885,4949,10886,10887,10888,10889,10890,10891,10892,10893,10894,10895,10896,10897,10898,10899,10900,10901,10902,10903,10904,10905,10906,10907,10908,10909,10910,10911,10912,10913,10914,10915,10916,10917,10918,10919,4487,10920,10921,10922,10923,10924,10925,10926,10927,10928,10929,10930,10931,10932,4950,10933,10934,10935,10936,10937,10938,10939,10940,10941,10942,10943,10944,10945,10946,10947,10948,10949,4488,10950,10951,10952,10953,10954,10955,10956,10957,10958,10959,4190,10960,10961,10962,10963,10964,10965,10966,10967,10968,10969,10970,10971,10972,10973,10974,10975,10976,10977,10978,10979,10980,10981,10982,10983,10984,10985,10986,10987,10988,10989,10990,10991,10992,10993,10994,10995,10996,10997,10998,10999,11e3,11001,11002,11003,11004,11005,11006,3960,11007,11008,11009,11010,11011,11012,11013,11014,11015,11016,11017,11018,11019,11020,11021,11022,11023,11024,11025,11026,11027,11028,11029,11030,11031,11032,4951,11033,11034,11035,11036,11037,11038,11039,11040,11041,11042,11043,11044,11045,11046,11047,4489,11048,11049,11050,11051,4952,11052,11053,11054,11055,11056,11057,11058,4953,11059,11060,11061,11062,11063,11064,11065,11066,11067,11068,11069,11070,11071,4954,11072,11073,11074,11075,11076,11077,11078,11079,11080,11081,11082,11083,11084,11085,11086,11087,11088,11089,11090,11091,11092,11093,11094,11095,11096,11097,11098,11099,11100,11101,11102,11103,11104,11105,11106,11107,11108,11109,11110,11111,11112,11113,11114,11115,3808,11116,11117,11118,11119,11120,11121,11122,11123,11124,11125,11126,11127,11128,11129,11130,11131,11132,11133,11134,4955,11135,11136,11137,11138,11139,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149,11150,11151,11152,11153,11154,11155,11156,11157,11158,11159,11160,11161,4956,11162,11163,11164,11165,11166,11167,11168,11169,11170,11171,11172,11173,11174,11175,11176,11177,11178,11179,11180,4957,11181,11182,11183,11184,11185,11186,4958,11187,11188,11189,11190,11191,11192,11193,11194,11195,11196,11197,11198,11199,11200,3678,11201,11202,11203,11204,11205,11206,4191,11207,11208,11209,11210,11211,11212,11213,11214,11215,11216,11217,11218,11219,11220,11221,11222,11223,11224,11225,11226,11227,11228,11229,11230,11231,11232,11233,11234,11235,11236,11237,11238,11239,11240,11241,11242,11243,11244,11245,11246,11247,11248,11249,11250,11251,4959,11252,11253,11254,11255,11256,11257,11258,11259,11260,11261,11262,11263,11264,11265,11266,11267,11268,11269,11270,11271,11272,11273,11274,11275,11276,11277,11278,11279,11280,11281,11282,11283,11284,11285,11286,11287,11288,11289,11290,11291,11292,11293,11294,11295,11296,11297,11298,11299,11300,11301,11302,11303,11304,11305,11306,11307,11308,11309,11310,11311,11312,11313,11314,3679,11315,11316,11317,11318,4490,11319,11320,11321,11322,11323,11324,11325,11326,11327,11328,11329,11330,11331,11332,11333,11334,11335,11336,11337,11338,11339,11340,11341,11342,11343,11344,11345,11346,11347,4960,11348,11349,11350,11351,11352,11353,11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,3961,4961,11378,11379,11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11390,11391,11392,11393,11394,11395,11396,11397,4192,11398,11399,11400,11401,11402,11403,11404,11405,11406,11407,11408,11409,11410,11411,4962,11412,11413,11414,11415,11416,11417,11418,11419,11420,11421,11422,11423,11424,11425,11426,11427,11428,11429,11430,11431,11432,11433,11434,11435,11436,11437,11438,11439,11440,11441,11442,11443,11444,11445,11446,11447,11448,11449,11450,11451,11452,11453,11454,11455,11456,11457,11458,11459,11460,11461,11462,11463,11464,11465,11466,11467,11468,11469,4963,11470,11471,4491,11472,11473,11474,11475,4964,11476,11477,11478,11479,11480,11481,11482,11483,11484,11485,11486,11487,11488,11489,11490,11491,11492,4965,11493,11494,11495,11496,11497,11498,11499,11500,11501,11502,11503,11504,11505,11506,11507,11508,11509,11510,11511,11512,11513,11514,11515,11516,11517,11518,11519,11520,11521,11522,11523,11524,11525,11526,11527,11528,11529,3962,11530,11531,11532,11533,11534,11535,11536,11537,11538,11539,11540,11541,11542,11543,11544,11545,11546,11547,11548,11549,11550,11551,11552,11553,11554,11555,11556,11557,11558,11559,11560,11561,11562,11563,11564,4193,4194,11565,11566,11567,11568,11569,11570,11571,11572,11573,11574,11575,11576,11577,11578,11579,11580,11581,11582,11583,11584,11585,11586,11587,11588,11589,11590,11591,4966,4195,11592,11593,11594,11595,11596,11597,11598,11599,11600,11601,11602,11603,11604,3090,11605,11606,11607,11608,11609,11610,4967,11611,11612,11613,11614,11615,11616,11617,11618,11619,11620,11621,11622,11623,11624,11625,11626,11627,11628,11629,11630,11631,11632,11633,11634,11635,11636,11637,11638,11639,11640,11641,11642,11643,11644,11645,11646,11647,11648,11649,11650,11651,11652,11653,11654,11655,11656,11657,11658,11659,11660,11661,11662,11663,11664,11665,11666,11667,11668,11669,11670,11671,11672,11673,11674,4968,11675,11676,11677,11678,11679,11680,11681,11682,11683,11684,11685,11686,11687,11688,11689,11690,11691,11692,11693,3809,11694,11695,11696,11697,11698,11699,11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710,11711,11712,11713,11714,11715,11716,11717,11718,3553,11719,11720,11721,11722,11723,11724,11725,11726,11727,11728,11729,11730,4969,11731,11732,11733,11734,11735,11736,11737,11738,11739,11740,4492,11741,11742,11743,11744,11745,11746,11747,11748,11749,11750,11751,11752,4970,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11788,11789,11790,4971,11791,11792,11793,11794,11795,11796,11797,4972,11798,11799,11800,11801,11802,11803,11804,11805,11806,11807,11808,11809,11810,4973,11811,11812,11813,11814,11815,11816,11817,11818,11819,11820,11821,11822,11823,11824,11825,11826,11827,11828,11829,11830,11831,11832,11833,11834,3680,3810,11835,11836,4974,11837,11838,11839,11840,11841,11842,11843,11844,11845,11846,11847,11848,11849,11850,11851,11852,11853,11854,11855,11856,11857,11858,11859,11860,11861,11862,11863,11864,11865,11866,11867,11868,11869,11870,11871,11872,11873,11874,11875,11876,11877,11878,11879,11880,11881,11882,11883,11884,4493,11885,11886,11887,11888,11889,11890,11891,11892,11893,11894,11895,11896,11897,11898,11899,11900,11901,11902,11903,11904,11905,11906,11907,11908,11909,11910,11911,11912,11913,11914,11915,4975,11916,11917,11918,11919,11920,11921,11922,11923,11924,11925,11926,11927,11928,11929,11930,11931,11932,11933,11934,11935,11936,11937,11938,11939,11940,11941,11942,11943,11944,11945,11946,11947,11948,11949,4976,11950,11951,11952,11953,11954,11955,11956,11957,11958,11959,11960,11961,11962,11963,11964,11965,11966,11967,11968,11969,11970,11971,11972,11973,11974,11975,11976,11977,11978,11979,11980,11981,11982,11983,11984,11985,11986,11987,4196,11988,11989,11990,11991,11992,4977,11993,11994,11995,11996,11997,11998,11999,12e3,12001,12002,12003,12004,12005,12006,12007,12008,12009,12010,12011,12012,12013,12014,12015,12016,12017,12018,12019,12020,12021,12022,12023,12024,12025,12026,12027,12028,12029,12030,12031,12032,12033,12034,12035,12036,12037,12038,12039,12040,12041,12042,12043,12044,12045,12046,12047,12048,12049,12050,12051,12052,12053,12054,12055,12056,12057,12058,12059,12060,12061,4978,12062,12063,12064,12065,12066,12067,12068,12069,12070,12071,12072,12073,12074,12075,12076,12077,12078,12079,12080,12081,12082,12083,12084,12085,12086,12087,12088,12089,12090,12091,12092,12093,12094,12095,12096,12097,12098,12099,12100,12101,12102,12103,12104,12105,12106,12107,12108,12109,12110,12111,12112,12113,12114,12115,12116,12117,12118,12119,12120,12121,12122,12123,4979,12124,12125,12126,12127,12128,4197,12129,12130,12131,12132,12133,12134,12135,12136,12137,12138,12139,12140,12141,12142,12143,12144,12145,12146,12147,12148,12149,12150,12151,12152,12153,12154,4980,12155,12156,12157,12158,12159,12160,4494,12161,12162,12163,12164,3811,12165,12166,12167,12168,12169,4495,12170,12171,4496,12172,12173,12174,12175,12176,3812,12177,12178,12179,12180,12181,12182,12183,12184,12185,12186,12187,12188,12189,12190,12191,12192,12193,12194,12195,12196,12197,12198,12199,12200,12201,12202,12203,12204,12205,12206,12207,12208,12209,12210,12211,12212,12213,12214,12215,12216,12217,12218,12219,12220,12221,4981,12222,12223,12224,12225,12226,12227,12228,12229,12230,12231,12232,12233,12234,12235,4982,12236,12237,12238,12239,12240,12241,12242,12243,12244,12245,4983,12246,12247,12248,12249,4984,12250,12251,12252,12253,12254,12255,12256,12257,12258,12259,12260,12261,12262,12263,12264,4985,12265,4497,12266,12267,12268,12269,12270,12271,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12284,12285,12286,12287,4986,12288,12289,12290,12291,12292,12293,12294,12295,12296,2473,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12307,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12319,3963,12320,12321,12322,12323,12324,12325,12326,12327,12328,12329,12330,12331,12332,4987,12333,12334,12335,12336,12337,12338,12339,12340,12341,12342,12343,12344,12345,12346,12347,12348,12349,12350,12351,12352,12353,12354,12355,12356,12357,12358,12359,3964,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,3965,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,4988,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12436,12437,12438,3554,12439,12440,12441,12442,12443,12444,12445,12446,12447,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,4989,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,4990,12481,12482,12483,12484,12485,12486,12487,12488,12489,4498,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,12535,12536,12537,12538,12539,12540,12541,12542,12543,12544,12545,12546,12547,12548,12549,12550,12551,4991,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,3036,12579,12580,12581,12582,12583,3966,12584,12585,12586,12587,12588,12589,12590,12591,12592,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,4499,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,12687,12688,12689,12690,12691,12692,12693,12694,12695,12696,12697,12698,4992,12699,12700,12701,12702,12703,12704,12705,12706,12707,12708,12709,12710,12711,12712,12713,12714,12715,12716,12717,12718,12719,12720,12721,12722,12723,12724,12725,12726,12727,12728,12729,12730,12731,12732,12733,12734,12735,12736,12737,12738,12739,12740,12741,12742,12743,12744,12745,12746,12747,12748,12749,12750,12751,12752,12753,12754,12755,12756,12757,12758,12759,12760,12761,12762,12763,12764,12765,12766,12767,12768,12769,12770,12771,12772,12773,12774,12775,12776,12777,12778,4993,2175,12779,12780,12781,12782,12783,12784,12785,12786,4500,12787,12788,12789,12790,12791,12792,12793,12794,12795,12796,12797,12798,12799,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,4198,3967,12827,12828,12829,12830,12831,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,12842,12843,12844,12845,12846,12847,12848,12849,12850,12851,12852,12853,12854,12855,12856,12857,12858,12859,12860,12861,4199,12862,12863,12864,12865,12866,12867,12868,12869,12870,12871,12872,12873,12874,12875,12876,12877,12878,12879,12880,12881,12882,12883,12884,12885,12886,12887,4501,12888,12889,12890,12891,12892,12893,12894,12895,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,4994,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,12924,12925,12926,12927,12928,12929,12930,12931,12932,12933,12934,12935,12936,12937,12938,12939,12940,12941,12942,12943,12944,12945,12946,12947,12948,12949,12950,12951,12952,12953,12954,12955,12956,1772,12957,12958,12959,12960,12961,12962,12963,12964,12965,12966,12967,12968,12969,12970,12971,12972,12973,12974,12975,12976,12977,12978,12979,12980,12981,12982,12983,12984,12985,12986,12987,12988,12989,12990,12991,12992,12993,12994,12995,12996,12997,4502,12998,4503,12999,13e3,13001,13002,13003,4504,13004,13005,13006,13007,13008,13009,13010,13011,13012,13013,13014,13015,13016,13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027,13028,13029,3449,13030,13031,13032,13033,13034,13035,13036,13037,13038,13039,13040,13041,13042,13043,13044,13045,13046,13047,13048,13049,13050,13051,13052,13053,13054,13055,13056,13057,13058,13059,13060,13061,13062,13063,13064,13065,13066,13067,13068,13069,13070,13071,13072,13073,13074,13075,13076,13077,13078,13079,13080,13081,13082,13083,13084,13085,13086,13087,13088,13089,13090,13091,13092,13093,13094,13095,13096,13097,13098,13099,13100,13101,13102,13103,13104,13105,13106,13107,13108,13109,13110,13111,13112,13113,13114,13115,13116,13117,13118,3968,13119,4995,13120,13121,13122,13123,13124,13125,13126,13127,4505,13128,13129,13130,13131,13132,13133,13134,4996,4506,13135,13136,13137,13138,13139,4997,13140,13141,13142,13143,13144,13145,13146,13147,13148,13149,13150,13151,13152,13153,13154,13155,13156,13157,13158,13159,4998,13160,13161,13162,13163,13164,13165,13166,13167,13168,13169,13170,13171,13172,13173,13174,13175,13176,4999,13177,13178,13179,13180,13181,13182,13183,13184,13185,13186,13187,13188,13189,13190,13191,13192,13193,13194,13195,13196,13197,13198,13199,13200,13201,13202,13203,13204,13205,13206,5e3,13207,13208,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13219,13220,13221,13222,13223,13224,13225,13226,13227,4200,5001,13228,13229,13230,13231,13232,13233,13234,13235,13236,13237,13238,13239,13240,3969,13241,13242,13243,13244,3970,13245,13246,13247,13248,13249,13250,13251,13252,13253,13254,13255,13256,13257,13258,13259,13260,13261,13262,13263,13264,13265,13266,13267,13268,3450,13269,13270,13271,13272,13273,13274,13275,13276,5002,13277,13278,13279,13280,13281,13282,13283,13284,13285,13286,13287,13288,13289,13290,13291,13292,13293,13294,13295,13296,13297,13298,13299,13300,13301,13302,3813,13303,13304,13305,13306,13307,13308,13309,13310,13311,13312,13313,13314,13315,13316,13317,13318,13319,13320,13321,13322,13323,13324,13325,13326,13327,13328,4507,13329,13330,13331,13332,13333,13334,13335,13336,13337,13338,13339,13340,13341,5003,13342,13343,13344,13345,13346,13347,13348,13349,13350,13351,13352,13353,13354,13355,13356,13357,13358,13359,13360,13361,13362,13363,13364,13365,13366,13367,5004,13368,13369,13370,13371,13372,13373,13374,13375,13376,13377,13378,13379,13380,13381,13382,13383,13384,13385,13386,13387,13388,13389,13390,13391,13392,13393,13394,13395,13396,13397,13398,13399,13400,13401,13402,13403,13404,13405,13406,13407,13408,13409,13410,13411,13412,13413,13414,13415,13416,13417,13418,13419,13420,13421,13422,13423,13424,13425,13426,13427,13428,13429,13430,13431,13432,4508,13433,13434,13435,4201,13436,13437,13438,13439,13440,13441,13442,13443,13444,13445,13446,13447,13448,13449,13450,13451,13452,13453,13454,13455,13456,13457,5005,13458,13459,13460,13461,13462,13463,13464,13465,13466,13467,13468,13469,13470,4509,13471,13472,13473,13474,13475,13476,13477,13478,13479,13480,13481,13482,13483,13484,13485,13486,13487,13488,13489,13490,13491,13492,13493,13494,13495,13496,13497,13498,13499,13500,13501,13502,13503,13504,13505,13506,13507,13508,13509,13510,13511,13512,13513,13514,13515,13516,13517,13518,13519,13520,13521,13522,13523,13524,13525,13526,13527,13528,13529,13530,13531,13532,13533,13534,13535,13536,13537,13538,13539,13540,13541,13542,13543,13544,13545,13546,13547,13548,13549,13550,13551,13552,13553,13554,13555,13556,13557,13558,13559,13560,13561,13562,13563,13564,13565,13566,13567,13568,13569,13570,13571,13572,13573,13574,13575,13576,13577,13578,13579,13580,13581,13582,13583,13584,13585,13586,13587,13588,13589,13590,13591,13592,13593,13594,13595,13596,13597,13598,13599,13600,13601,13602,13603,13604,13605,13606,13607,13608,13609,13610,13611,13612,13613,13614,13615,13616,13617,13618,13619,13620,13621,13622,13623,13624,13625,13626,13627,13628,13629,13630,13631,13632,13633,13634,13635,13636,13637,13638,13639,13640,13641,13642,5006,13643,13644,13645,13646,13647,13648,13649,13650,13651,5007,13652,13653,13654,13655,13656,13657,13658,13659,13660,13661,13662,13663,13664,13665,13666,13667,13668,13669,13670,13671,13672,13673,13674,13675,13676,13677,13678,13679,13680,13681,13682,13683,13684,13685,13686,13687,13688,13689,13690,13691,13692,13693,13694,13695,13696,13697,13698,13699,13700,13701,13702,13703,13704,13705,13706,13707,13708,13709,13710,13711,13712,13713,13714,13715,13716,13717,13718,13719,13720,13721,13722,13723,13724,13725,13726,13727,13728,13729,13730,13731,13732,13733,13734,13735,13736,13737,13738,13739,13740,13741,13742,13743,13744,13745,13746,13747,13748,13749,13750,13751,13752,13753,13754,13755,13756,13757,13758,13759,13760,13761,13762,13763,13764,13765,13766,13767,13768,13769,13770,13771,13772,13773,13774,3273,13775,13776,13777,13778,13779,13780,13781,13782,13783,13784,13785,13786,13787,13788,13789,13790,13791,13792,13793,13794,13795,13796,13797,13798,13799,13800,13801,13802,13803,13804,13805,13806,13807,13808,13809,13810,13811,13812,13813,13814,13815,13816,13817,13818,13819,13820,13821,13822,13823,13824,13825,13826,13827,13828,13829,13830,13831,13832,13833,13834,13835,13836,13837,13838,13839,13840,13841,13842,13843,13844,13845,13846,13847,13848,13849,13850,13851,13852,13853,13854,13855,13856,13857,13858,13859,13860,13861,13862,13863,13864,13865,13866,13867,13868,13869,13870,13871,13872,13873,13874,13875,13876,13877,13878,13879,13880,13881,13882,13883,13884,13885,13886,13887,13888,13889,13890,13891,13892,13893,13894,13895,13896,13897,13898,13899,13900,13901,13902,13903,13904,13905,13906,13907,13908,13909,13910,13911,13912,13913,13914,13915,13916,13917,13918,13919,13920,13921,13922,13923,13924,13925,13926,13927,13928,13929,13930,13931,13932,13933,13934,13935,13936,13937,13938,13939,13940,13941,13942,13943,13944,13945,13946,13947,13948,13949,13950,13951,13952,13953,13954,13955,13956,13957,13958,13959,13960,13961,13962,13963,13964,13965,13966,13967,13968,13969,13970,13971,13972];var K=t0,n0=i0,h0=s0,l0=a0,c0=o0;function w(){var r=1024,o=.99,i=.01,h=3,a=this;function n(){a._mCharToFreqOrder=null,a._mTableSize=null,a._mTypicalDistributionRatio=null,a.reset()}this.reset=function(){this._mDone=!1,this._mTotalChars=0,this._mFreqChars=0},this.feed=function(l,M){if(M==2)var m=this.getOrder(l);else m=-1;m>=0&&(this._mTotalChars++,mthis._mCharToFreqOrder[m]&&this._mFreqChars++)},this.getConfidence=function(){if(this._mTotalChars<=0||this._mFreqChars<=h)return i;if(this._mTotalChars!=this._mFreqChars){var l=this._mFreqChars/((this._mTotalChars-this._mFreqChars)*this._mTypicalDistributionRatio);if(lr},this.getOrder=function(l){return-1},n()}P.CharDistributionAnalysis=w;function F0(){w.apply(this);var r=this;function o(){r._mCharToFreqOrder=n0.EUCTWCharToFreqOrder,r._mTableSize=n0.EUCTW_TABLE_SIZE,r._mTypicalDistributionRatio=n0.EUCTW_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=196?94*(i.charCodeAt(0)-196)+i.charCodeAt(1)-161:-1},o()}F0.prototype=new w;P.EUCTWDistributionAnalysis=F0;function R0(){w.apply(this);var r=this;function o(){r._mCharToFreqOrder=h0.EUCKRCharToFreqOrder,r._mTableSize=h0.EUCKR_TABLE_SIZE,r._mTypicalDistributionRatio=h0.EUCKR_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=176?94*(i.charCodeAt(0)-176)+i.charCodeAt(1)-161:-1},o()}R0.prototype=new w;P.EUCKRDistributionAnalysis=R0;function U0(){w.apply(this);var r=this;function o(){r._mCharToFreqOrder=l0.GB2312CharToFreqOrder,r._mTableSize=l0.GB2312_TABLE_SIZE,r._mTypicalDistributionRatio=l0.GB2312_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=176&&i.charCodeAt(1)>=161?94*(i.charCodeAt(0)-176)+i.charCodeAt(1)-161:-1},o()}U0.prototype=new w;P.GB2312DistributionAnalysis=U0;function D0(){w.apply(this);var r=this;function o(){r._mCharToFreqOrder=c0.Big5CharToFreqOrder,r._mTableSize=c0.BIG5_TABLE_SIZE,r._mTypicalDistributionRatio=c0.BIG5_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i.charCodeAt(0)>=164?i.charCodeAt(1)>=161?157*(i.charCodeAt(0)-164)+i.charCodeAt(1)-161+63:157*(i.charCodeAt(0)-164)+i.charCodeAt(1)-64:-1},o()}D0.prototype=new w;P.Big5DistributionAnalysis=D0;function B0(){w.apply(this);var r=this;function o(){r._mCharToFreqOrder=K.JISCharToFreqOrder,r._mTableSize=K.JIS_TABLE_SIZE,r._mTypicalDistributionRatio=K.JIS_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){if(i.charCodeAt(0)>=129&&i.charCodeAt(0)<=159)var h=188*(i.charCodeAt(0)-129);else if(i.charCodeAt(0)>=224&&i.charCodeAt(0)<=239)h=188*(i.charCodeAt(0)-224+31);else return-1;return h+=i.charCodeAt(1)-64,(i.charCodeAt(1)<64||i.charCodeAt(1)===127||i.charCodeAt(1)>252)&&(h=-1),h},o()}B0.prototype=new w;P.SJISDistributionAnalysis=B0;function x0(){w.apply(this);var r=this;function o(){r._mCharToFreqOrder=K.JISCharToFreqOrder,r._mTableSize=K.JIS_TABLE_SIZE,r._mTypicalDistributionRatio=K.JIS_TYPICAL_DISTRIBUTION_RATIO}this.getOrder=function(i){return i[0]>=" "?94*(i.charCodeAt(0)-161)+i.charCodeAt(1)-161:-1},o()}x0.prototype=new w;P.EUCJPDistributionAnalysis=x0;var L1=q,$0=j,P1=I1,w1=P.Big5DistributionAnalysis;function H0(){$0.apply(this);var r=this;function o(){r._mCodingSM=new L1(P1),r._mDistributionAnalyzer=new w1,r.reset()}this.getCharsetName=function(){return"Big5"},o()}H0.prototype=new $0;var N1=H0,t=p,F1=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,8,8,8,8,8,8,8,8,8,8,8,8,9,8,8,10,11,11,11,11,11,11,11,12,13,13,13,14,15,0,0],R1=[t.error,t.start,t.error,t.error,t.error,t.error,12,10,9,11,8,7,6,5,4,3,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.itsMe,t.error,t.error,5,5,5,5,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,5,5,5,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,7,7,7,7,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,7,7,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,9,9,9,9,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,9,9,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,12,12,12,12,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,12,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,12,12,12,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.start,t.start,t.start,t.start,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error,t.error],U1=[0,1,0,0,0,0,2,3,3,3,4,4,5,5,6,6],D1={classTable:F1,classFactor:16,stateTable:R1,charLenTable:U1,name:"UTF-8"},B1=q,G0=k,$=p,x1=D1;function f0(){G0.apply(this);var r=.5,o=this;function i(){o._mCodingSM=new B1(x1),o.reset()}this.reset=function(){f0.prototype.reset.apply(this),this._mCodingSM.reset(),this._mNumOfMBChar=0,this._mMBCharLen=0,this._mFullLen=0,this._mBasicAsciiLen=0},this.getCharsetName=function(){return"UTF-8"},this.feed=function(h){this._mFullLen+=h.length;for(var a=0,n;a=2?(this._mNumOfMBChar++,this._mMBCharLen+=this._mCodingSM.getCurrentCharLen()):n.charCodeAt(0)<128&&this._mBasicAsciiLen++)}return this.getState()==$.detecting&&this.getConfidence()>$.SHORTCUT_THRESHOLD&&(this._mState=$.foundIt),this.getState()},this.getConfidence=function(){var h=.99,a=0,n=this._mFullLen-this._mBasicAsciiLen;return n>0&&(a=this._mMBCharLen/n),this._mNumOfMBChar<6&&a<=.6?(h*=Math.pow(r,this._mNumOfMBChar),1-h):h},i()}f0.prototype=new G0;var $1=f0,S=p,H1=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],G1=[S.error,S.start,S.start,3,S.error,S.error,S.error,S.error,S.error,S.error,S.error,S.error,S.itsMe,S.itsMe,S.itsMe,S.itsMe,S.itsMe,S.itsMe,S.error,S.error,S.start,S.start,S.start,S.start],q1=[0,1,1,2,0,0],J1={classTable:H1,classFactor:6,stateTable:G1,charLenTable:q1,name:"Shift_JIS"},_0={};(function(r){r.jp2CharContext=[[0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1],[2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4],[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2],[0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3,4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,4,0,3,0,3,0,4,5,4,3,3,3,3,4,3,5,4,4,3,5,4,4,3,4,3,4,4,4,4,5,3,4,4,3,4,5,5,4,5,5,1,4,5,4,3,0,3,3,1,3,3,0,4,4,0,3,3,1,5,3,3,3,5,0,4,0,3,0,4,4,3,4,3,3,0,4,1,1,3,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,4,0,3,0,3,0,4,0,3,4,4,3,2,2,1,2,1,3,1,3,3,3,3,3,4,3,1,3,3,5,3,3,0,4,3,0,5,4,3,3,5,4,4,3,4,4,5,0,1,2,0,1,2,0,2,2,0,1,0,0,5,2,2,1,4,0,3,0,1,0,4,4,3,5,4,3,0,2,1,0,4,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,5,0,4,0,2,1,4,4,2,4,1,4,2,4,2,4,3,3,3,4,3,3,3,3,1,4,2,3,3,3,1,4,4,1,1,1,4,3,3,2,0,2,4,3,2,0,3,3,0,3,1,1,0,0,0,3,3,0,4,2,2,3,4,0,4,0,3,0,4,4,5,3,4,4,0,3,0,0,1,4],[1,4,0,4,0,4,0,4,0,3,5,4,4,3,4,3,5,4,3,3,4,3,5,4,4,4,4,3,4,2,4,3,3,1,5,4,3,2,4,5,4,5,5,4,4,5,4,4,0,3,2,2,3,3,0,4,3,1,3,2,1,4,3,3,4,5,0,3,0,2,0,4,5,5,4,5,4,0,4,0,0,5,4],[0,5,0,5,0,4,0,3,0,4,4,3,4,3,3,3,4,0,4,4,4,3,4,3,4,3,3,1,4,2,4,3,4,0,5,4,1,4,5,4,4,5,3,2,4,3,4,3,2,4,1,3,3,3,2,3,2,0,4,3,3,4,3,3,3,4,0,4,0,3,0,4,5,4,4,4,3,0,4,1,0,1,3],[0,3,1,4,0,3,0,2,0,3,4,4,3,1,4,2,3,3,4,3,4,3,4,3,4,4,3,2,3,1,5,4,4,1,4,4,3,5,4,4,3,5,5,4,3,4,4,3,1,2,3,1,2,2,0,3,2,0,3,1,0,5,3,3,3,4,3,3,3,3,4,4,4,4,5,4,2,0,3,3,2,4,3],[0,2,0,3,0,1,0,1,0,0,3,2,0,0,2,0,1,0,2,1,3,3,3,1,2,3,1,0,1,0,4,2,1,1,3,3,0,4,3,3,1,4,3,3,0,3,3,2,0,0,0,0,1,0,0,2,0,0,0,0,0,4,1,0,2,3,2,2,2,1,3,3,3,4,4,3,2,0,3,1,0,3,3],[0,4,0,4,0,3,0,3,0,4,4,4,3,3,3,3,3,3,4,3,4,2,4,3,4,3,3,2,4,3,4,5,4,1,4,5,3,5,4,5,3,5,4,0,3,5,5,3,1,3,3,2,2,3,0,3,4,1,3,3,2,4,3,3,3,4,0,4,0,3,0,4,5,4,4,5,3,0,4,1,0,3,4],[0,2,0,3,0,3,0,0,0,2,2,2,1,0,1,0,0,0,3,0,3,0,3,0,1,3,1,0,3,1,3,3,3,1,3,3,3,0,1,3,1,3,4,0,0,3,1,1,0,3,2,0,0,0,0,1,3,0,1,0,0,3,3,2,0,3,0,0,0,0,0,3,4,3,4,3,3,0,3,0,0,2,3],[2,3,0,3,0,2,0,1,0,3,3,4,3,1,3,1,1,1,3,1,4,3,4,3,3,3,0,0,3,1,5,4,3,1,4,3,2,5,5,4,4,4,4,3,3,4,4,4,0,2,1,1,3,2,0,1,2,0,0,1,0,4,1,3,3,3,0,3,0,1,0,4,4,4,5,5,3,0,2,0,0,4,4],[0,2,0,1,0,3,1,3,0,2,3,3,3,0,3,1,0,0,3,0,3,2,3,1,3,2,1,1,0,0,4,2,1,0,2,3,1,4,3,2,0,4,4,3,1,3,1,3,0,1,0,0,1,0,0,0,1,0,0,0,0,4,1,1,1,2,0,3,0,0,0,3,4,2,4,3,2,0,1,0,0,3,3],[0,1,0,4,0,5,0,4,0,2,4,4,2,3,3,2,3,3,5,3,3,3,4,3,4,2,3,0,4,3,3,3,4,1,4,3,2,1,5,5,3,4,5,1,3,5,4,2,0,3,3,0,1,3,0,4,2,0,1,3,1,4,3,3,3,3,0,3,0,1,0,3,4,4,4,5,5,0,3,0,1,4,5],[0,2,0,3,0,3,0,0,0,2,3,1,3,0,4,0,1,1,3,0,3,4,3,2,3,1,0,3,3,2,3,1,3,0,2,3,0,2,1,4,1,2,2,0,0,3,3,0,0,2,0,0,0,1,0,0,0,0,2,2,0,3,2,1,3,3,0,2,0,2,0,0,3,3,1,2,4,0,3,0,2,2,3],[2,4,0,5,0,4,0,4,0,2,4,4,4,3,4,3,3,3,1,2,4,3,4,3,4,4,5,0,3,3,3,3,2,0,4,3,1,4,3,4,1,4,4,3,3,4,4,3,1,2,3,0,4,2,0,4,1,0,3,3,0,4,3,3,3,4,0,4,0,2,0,3,5,3,4,5,2,0,3,0,0,4,5],[0,3,0,4,0,1,0,1,0,1,3,2,2,1,3,0,3,0,2,0,2,0,3,0,2,0,0,0,1,0,1,1,0,0,3,1,0,0,0,4,0,3,1,0,2,1,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,2,2,3,1,0,3,0,0,0,1,4,4,4,3,0,0,4,0,0,1,4],[1,4,1,5,0,3,0,3,0,4,5,4,4,3,5,3,3,4,4,3,4,1,3,3,3,3,2,1,4,1,5,4,3,1,4,4,3,5,4,4,3,5,4,3,3,4,4,4,0,3,3,1,2,3,0,3,1,0,3,3,0,5,4,4,4,4,4,4,3,3,5,4,4,3,3,5,4,0,3,2,0,4,4],[0,2,0,3,0,1,0,0,0,1,3,3,3,2,4,1,3,0,3,1,3,0,2,2,1,1,0,0,2,0,4,3,1,0,4,3,0,4,4,4,1,4,3,1,1,3,3,1,0,2,0,0,1,3,0,0,0,0,2,0,0,4,3,2,4,3,5,4,3,3,3,4,3,3,4,3,3,0,2,1,0,3,3],[0,2,0,4,0,3,0,2,0,2,5,5,3,4,4,4,4,1,4,3,3,0,4,3,4,3,1,3,3,2,4,3,0,3,4,3,0,3,4,4,2,4,4,0,4,5,3,3,2,2,1,1,1,2,0,1,5,0,3,3,2,4,3,3,3,4,0,3,0,2,0,4,4,3,5,5,0,0,3,0,2,3,3],[0,3,0,4,0,3,0,1,0,3,4,3,3,1,3,3,3,0,3,1,3,0,4,3,3,1,1,0,3,0,3,3,0,0,4,4,0,1,5,4,3,3,5,0,3,3,4,3,0,2,0,1,1,1,0,1,3,0,1,2,1,3,3,2,3,3,0,3,0,1,0,1,3,3,4,4,1,0,1,2,2,1,3],[0,1,0,4,0,4,0,3,0,1,3,3,3,2,3,1,1,0,3,0,3,3,4,3,2,4,2,0,1,0,4,3,2,0,4,3,0,5,3,3,2,4,4,4,3,3,3,4,0,1,3,0,0,1,0,0,1,0,0,0,0,4,2,3,3,3,0,3,0,0,0,4,4,4,5,3,2,0,3,3,0,3,5],[0,2,0,3,0,0,0,3,0,1,3,0,2,0,0,0,1,0,3,1,1,3,3,0,0,3,0,0,3,0,2,3,1,0,3,1,0,3,3,2,0,4,2,2,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,1,0,1,0,0,0,1,3,1,2,0,0,0,1,0,0,1,4],[0,3,0,3,0,5,0,1,0,2,4,3,1,3,3,2,1,1,5,2,1,0,5,1,2,0,0,0,3,3,2,2,3,2,4,3,0,0,3,3,1,3,3,0,2,5,3,4,0,3,3,0,1,2,0,2,2,0,3,2,0,2,2,3,3,3,0,2,0,1,0,3,4,4,2,5,4,0,3,0,0,3,5],[0,3,0,3,0,3,0,1,0,3,3,3,3,0,3,0,2,0,2,1,1,0,2,0,1,0,0,0,2,1,0,0,1,0,3,2,0,0,3,3,1,2,3,1,0,3,3,0,0,1,0,0,0,0,0,2,0,0,0,0,0,2,3,1,2,3,0,3,0,1,0,3,2,1,0,4,3,0,1,1,0,3,3],[0,4,0,5,0,3,0,3,0,4,5,5,4,3,5,3,4,3,5,3,3,2,5,3,4,4,4,3,4,3,4,5,5,3,4,4,3,4,4,5,4,4,4,3,4,5,5,4,2,3,4,2,3,4,0,3,3,1,4,3,2,4,3,3,5,5,0,3,0,3,0,5,5,5,5,4,4,0,4,0,1,4,4],[0,4,0,4,0,3,0,3,0,3,5,4,4,2,3,2,5,1,3,2,5,1,4,2,3,2,3,3,4,3,3,3,3,2,5,4,1,3,3,5,3,4,4,0,4,4,3,1,1,3,1,0,2,3,0,2,3,0,3,0,0,4,3,1,3,4,0,3,0,2,0,4,4,4,3,4,5,0,4,0,0,3,4],[0,3,0,3,0,3,1,2,0,3,4,4,3,3,3,0,2,2,4,3,3,1,3,3,3,1,1,0,3,1,4,3,2,3,4,4,2,4,4,4,3,4,4,3,2,4,4,3,1,3,3,1,3,3,0,4,1,0,2,2,1,4,3,2,3,3,5,4,3,3,5,4,4,3,3,0,4,0,3,2,2,4,4],[0,2,0,1,0,0,0,0,0,1,2,1,3,0,0,0,0,0,2,0,1,2,1,0,0,1,0,0,0,0,3,0,0,1,0,1,1,3,1,0,0,0,1,1,0,1,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,2,2,0,3,4,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1],[0,1,0,0,0,1,0,0,0,0,4,0,4,1,4,0,3,0,4,0,3,0,4,0,3,0,3,0,4,1,5,1,4,0,0,3,0,5,0,5,2,0,1,0,0,0,2,1,4,0,1,3,0,0,3,0,0,3,1,1,4,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],[1,4,0,5,0,3,0,2,0,3,5,4,4,3,4,3,5,3,4,3,3,0,4,3,3,3,3,3,3,2,4,4,3,1,3,4,4,5,4,4,3,4,4,1,3,5,4,3,3,3,1,2,2,3,3,1,3,1,3,3,3,5,3,3,4,5,0,3,0,3,0,3,4,3,4,4,3,0,3,0,2,4,3],[0,1,0,4,0,0,0,0,0,1,4,0,4,1,4,2,4,0,3,0,1,0,1,0,0,0,0,0,2,0,3,1,1,1,0,3,0,0,0,1,2,1,0,0,1,1,1,1,0,1,0,0,0,1,0,0,3,0,0,0,0,3,2,0,2,2,0,1,0,0,0,2,3,2,3,3,0,0,0,0,2,1,0],[0,5,1,5,0,3,0,3,0,5,4,4,5,1,5,3,3,0,4,3,4,3,5,3,4,3,3,2,4,3,4,3,3,0,3,3,1,4,4,3,4,4,4,3,4,5,5,3,2,3,1,1,3,3,1,3,1,1,3,3,2,4,5,3,3,5,0,4,0,3,0,4,4,3,5,3,3,0,3,4,0,4,3],[0,5,0,5,0,3,0,2,0,4,4,3,5,2,4,3,3,3,4,4,4,3,5,3,5,3,3,1,4,0,4,3,3,0,3,3,0,4,4,4,4,5,4,3,3,5,5,3,2,3,1,2,3,2,0,1,0,0,3,2,2,4,4,3,1,5,0,4,0,3,0,4,3,1,3,2,1,0,3,3,0,3,3],[0,4,0,5,0,5,0,4,0,4,5,5,5,3,4,3,3,2,5,4,4,3,5,3,5,3,4,0,4,3,4,4,3,2,4,4,3,4,5,4,4,5,5,0,3,5,5,4,1,3,3,2,3,3,1,3,1,0,4,3,1,4,4,3,4,5,0,4,0,2,0,4,3,4,4,3,3,0,4,0,0,5,5],[0,4,0,4,0,5,0,1,1,3,3,4,4,3,4,1,3,0,5,1,3,0,3,1,3,1,1,0,3,0,3,3,4,0,4,3,0,4,4,4,3,4,4,0,3,5,4,1,0,3,0,0,2,3,0,3,1,0,3,1,0,3,2,1,3,5,0,3,0,1,0,3,2,3,3,4,4,0,2,2,0,4,4],[2,4,0,5,0,4,0,3,0,4,5,5,4,3,5,3,5,3,5,3,5,2,5,3,4,3,3,4,3,4,5,3,2,1,5,4,3,2,3,4,5,3,4,1,2,5,4,3,0,3,3,0,3,2,0,2,3,0,4,1,0,3,4,3,3,5,0,3,0,1,0,4,5,5,5,4,3,0,4,2,0,3,5],[0,5,0,4,0,4,0,2,0,5,4,3,4,3,4,3,3,3,4,3,4,2,5,3,5,3,4,1,4,3,4,4,4,0,3,5,0,4,4,4,4,5,3,1,3,4,5,3,3,3,3,3,3,3,0,2,2,0,3,3,2,4,3,3,3,5,3,4,1,3,3,5,3,2,0,0,0,0,4,3,1,3,3],[0,1,0,3,0,3,0,1,0,1,3,3,3,2,3,3,3,0,3,0,0,0,3,1,3,0,0,0,2,2,2,3,0,0,3,2,0,1,2,4,1,3,3,0,0,3,3,3,0,1,0,0,2,1,0,0,3,0,3,1,0,3,0,0,1,3,0,2,0,1,0,3,3,1,3,3,0,0,1,1,0,3,3],[0,2,0,3,0,2,1,4,0,2,2,3,1,1,3,1,1,0,2,0,3,1,2,3,1,3,0,0,1,0,4,3,2,3,3,3,1,4,2,3,3,3,3,1,0,3,1,4,0,1,1,0,1,2,0,1,1,0,1,1,0,3,1,3,2,2,0,1,0,0,0,2,3,3,3,1,0,0,0,0,0,2,3],[0,5,0,4,0,5,0,2,0,4,5,5,3,3,4,3,3,1,5,4,4,2,4,4,4,3,4,2,4,3,5,5,4,3,3,4,3,3,5,5,4,5,5,1,3,4,5,3,1,4,3,1,3,3,0,3,3,1,4,3,1,4,5,3,3,5,0,4,0,3,0,5,3,3,1,4,3,0,4,0,1,5,3],[0,5,0,5,0,4,0,2,0,4,4,3,4,3,3,3,3,3,5,4,4,4,4,4,4,5,3,3,5,2,4,4,4,3,4,4,3,3,4,4,5,5,3,3,4,3,4,3,3,4,3,3,3,3,1,2,2,1,4,3,3,5,4,4,3,4,0,4,0,3,0,4,4,4,4,4,1,0,4,2,0,2,4],[0,4,0,4,0,3,0,1,0,3,5,2,3,0,3,0,2,1,4,2,3,3,4,1,4,3,3,2,4,1,3,3,3,0,3,3,0,0,3,3,3,5,3,3,3,3,3,2,0,2,0,0,2,0,0,2,0,0,1,0,0,3,1,2,2,3,0,3,0,2,0,4,4,3,3,4,1,0,3,0,0,2,4],[0,0,0,4,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,1,0,2,0,1,0,0,0,0,0,3,1,3,0,3,2,0,0,0,1,0,3,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,0,2,0,0,0,0,0,0,2],[0,2,1,3,0,2,0,2,0,3,3,3,3,1,3,1,3,3,3,3,3,3,4,2,2,1,2,1,4,0,4,3,1,3,3,3,2,4,3,5,4,3,3,3,3,3,3,3,0,1,3,0,2,0,0,1,0,0,1,0,0,4,2,0,2,3,0,3,3,0,3,3,4,2,3,1,4,0,1,2,0,2,3],[0,3,0,3,0,1,0,3,0,2,3,3,3,0,3,1,2,0,3,3,2,3,3,2,3,2,3,1,3,0,4,3,2,0,3,3,1,4,3,3,2,3,4,3,1,3,3,1,1,0,1,1,0,1,0,1,0,1,0,0,0,4,1,1,0,3,0,3,1,0,2,3,3,3,3,3,1,0,0,2,0,3,3],[0,0,0,0,0,0,0,0,0,0,3,0,2,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,3,0,3,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,2,3,0,0,0,0,0,0,0,0,3],[0,2,0,3,1,3,0,3,0,2,3,3,3,1,3,1,3,1,3,1,3,3,3,1,3,0,2,3,1,1,4,3,3,2,3,3,1,2,2,4,1,3,3,0,1,4,2,3,0,1,3,0,3,0,0,1,3,0,2,0,0,3,3,2,1,3,0,3,0,2,0,3,4,4,4,3,1,0,3,0,0,3,3],[0,2,0,1,0,2,0,0,0,1,3,2,2,1,3,0,1,1,3,0,3,2,3,1,2,0,2,0,1,1,3,3,3,0,3,3,1,1,2,3,2,3,3,1,2,3,2,0,0,1,0,0,0,0,0,0,3,0,1,0,0,2,1,2,1,3,0,3,0,0,0,3,4,4,4,3,2,0,2,0,0,2,4],[0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3],[0,3,0,3,0,2,0,3,0,3,3,3,2,3,2,2,2,0,3,1,3,3,3,2,3,3,0,0,3,0,3,2,2,0,2,3,1,4,3,4,3,3,2,3,1,5,4,4,0,3,1,2,1,3,0,3,1,1,2,0,2,3,1,3,1,3,0,3,0,1,0,3,3,4,4,2,1,0,2,1,0,2,4],[0,1,0,3,0,1,0,2,0,1,4,2,5,1,4,0,2,0,2,1,3,1,4,0,2,1,0,0,2,1,4,1,1,0,3,3,0,5,1,3,2,3,3,1,0,3,2,3,0,1,0,0,0,0,0,0,1,0,0,0,0,4,0,1,0,3,0,2,0,1,0,3,3,3,4,3,3,0,0,0,0,2,3],[0,0,0,1,0,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,0,0,0,0,3],[0,1,0,3,0,4,0,3,0,2,4,3,1,0,3,2,2,1,3,1,2,2,3,1,1,1,2,1,3,0,1,2,0,1,3,2,1,3,0,5,5,1,0,0,1,3,2,1,0,3,0,0,1,0,0,0,0,0,3,4,0,1,1,1,3,2,0,2,0,1,0,2,3,3,1,2,3,0,1,0,1,0,4],[0,0,0,1,0,3,0,3,0,2,2,1,0,0,4,0,3,0,3,1,3,0,3,0,3,0,1,0,3,0,3,1,3,0,3,3,0,0,1,2,1,1,1,0,1,2,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,2,2,1,2,0,0,2,0,0,0,0,2,3,3,3,3,0,0,0,0,1,4],[0,0,0,3,0,3,0,0,0,0,3,1,1,0,3,0,1,0,2,0,1,0,0,0,0,0,0,0,1,0,3,0,2,0,2,3,0,0,2,2,3,1,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,2,3],[2,4,0,5,0,5,0,4,0,3,4,3,3,3,4,3,3,3,4,3,4,4,5,4,5,5,5,2,3,0,5,5,4,1,5,4,3,1,5,4,3,4,4,3,3,4,3,3,0,3,2,0,2,3,0,3,0,0,3,3,0,5,3,2,3,3,0,3,0,3,0,3,4,5,4,5,3,0,4,3,0,3,4],[0,3,0,3,0,3,0,3,0,3,3,4,3,2,3,2,3,0,4,3,3,3,3,3,3,3,3,0,3,2,4,3,3,1,3,4,3,4,4,4,3,4,4,3,2,4,4,1,0,2,0,0,1,1,0,2,0,0,3,1,0,5,3,2,1,3,0,3,0,1,2,4,3,2,4,3,3,0,3,2,0,4,4],[0,3,0,3,0,1,0,0,0,1,4,3,3,2,3,1,3,1,4,2,3,2,4,2,3,4,3,0,2,2,3,3,3,0,3,3,3,0,3,4,1,3,3,0,3,4,3,3,0,1,1,0,1,0,0,0,4,0,3,0,0,3,1,2,1,3,0,4,0,1,0,4,3,3,4,3,3,0,2,0,0,3,3],[0,3,0,4,0,1,0,3,0,3,4,3,3,0,3,3,3,1,3,1,3,3,4,3,3,3,0,0,3,1,5,3,3,1,3,3,2,5,4,3,3,4,5,3,2,5,3,4,0,1,0,0,0,0,0,2,0,0,1,1,0,4,2,2,1,3,0,3,0,2,0,4,4,3,5,3,2,0,1,1,0,3,4],[0,5,0,4,0,5,0,2,0,4,4,3,3,2,3,3,3,1,4,3,4,1,5,3,4,3,4,0,4,2,4,3,4,1,5,4,0,4,4,4,4,5,4,1,3,5,4,2,1,4,1,1,3,2,0,3,1,0,3,2,1,4,3,3,3,4,0,4,0,3,0,4,4,4,3,3,3,0,4,2,0,3,4],[1,4,0,4,0,3,0,1,0,3,3,3,1,1,3,3,2,2,3,3,1,0,3,2,2,1,2,0,3,1,2,1,2,0,3,2,0,2,2,3,3,4,3,0,3,3,1,2,0,1,1,3,1,2,0,0,3,0,1,1,0,3,2,2,3,3,0,3,0,0,0,2,3,3,4,3,3,0,1,0,0,1,4],[0,4,0,4,0,4,0,0,0,3,4,4,3,1,4,2,3,2,3,3,3,1,4,3,4,0,3,0,4,2,3,3,2,2,5,4,2,1,3,4,3,4,3,1,3,3,4,2,0,2,1,0,3,3,0,0,2,0,3,1,0,4,4,3,4,3,0,4,0,1,0,2,4,4,4,4,4,0,3,2,0,3,3],[0,0,0,1,0,4,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,3,2,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2],[0,2,0,3,0,4,0,4,0,1,3,3,3,0,4,0,2,1,2,1,1,1,2,0,3,1,1,0,1,0,3,1,0,0,3,3,2,0,1,1,0,0,0,0,0,1,0,2,0,2,2,0,3,1,0,0,1,0,1,1,0,1,2,0,3,0,0,0,0,1,0,0,3,3,4,3,1,0,1,0,3,0,2],[0,0,0,3,0,5,0,0,0,0,1,0,2,0,3,1,0,1,3,0,0,0,2,0,0,0,1,0,0,0,1,1,0,0,4,0,0,0,2,3,0,1,4,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,3],[0,2,0,5,0,5,0,1,0,2,4,3,3,2,5,1,3,2,3,3,3,0,4,1,2,0,3,0,4,0,2,2,1,1,5,3,0,0,1,4,2,3,2,0,3,3,3,2,0,2,4,1,1,2,0,1,1,0,3,1,0,1,3,1,2,3,0,2,0,0,0,1,3,5,4,4,4,0,3,0,0,1,3],[0,4,0,5,0,4,0,4,0,4,5,4,3,3,4,3,3,3,4,3,4,4,5,3,4,5,4,2,4,2,3,4,3,1,4,4,1,3,5,4,4,5,5,4,4,5,5,5,2,3,3,1,4,3,1,3,3,0,3,3,1,4,3,4,4,4,0,3,0,4,0,3,3,4,4,5,0,0,4,3,0,4,5],[0,4,0,4,0,3,0,3,0,3,4,4,4,3,3,2,4,3,4,3,4,3,5,3,4,3,2,1,4,2,4,4,3,1,3,4,2,4,5,5,3,4,5,4,1,5,4,3,0,3,2,2,3,2,1,3,1,0,3,3,3,5,3,3,3,5,4,4,2,3,3,4,3,3,3,2,1,0,3,2,1,4,3],[0,4,0,5,0,4,0,3,0,3,5,5,3,2,4,3,4,0,5,4,4,1,4,4,4,3,3,3,4,3,5,5,2,3,3,4,1,2,5,5,3,5,5,2,3,5,5,4,0,3,2,0,3,3,1,1,5,1,4,1,0,4,3,2,3,5,0,4,0,3,0,5,4,3,4,3,0,0,4,1,0,4,4],[1,3,0,4,0,2,0,2,0,2,5,5,3,3,3,3,3,0,4,2,3,4,4,4,3,4,0,0,3,4,5,4,3,3,3,3,2,5,5,4,5,5,5,4,3,5,5,5,1,3,1,0,1,0,0,3,2,0,4,2,0,5,2,3,2,4,1,3,0,3,0,4,5,4,5,4,3,0,4,2,0,5,4],[0,3,0,4,0,5,0,3,0,3,4,4,3,2,3,2,3,3,3,3,3,2,4,3,3,2,2,0,3,3,3,3,3,1,3,3,3,0,4,4,3,4,4,1,1,4,4,2,0,3,1,0,1,1,0,4,1,0,2,3,1,3,3,1,3,4,0,3,0,1,0,3,1,3,0,0,1,0,2,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,3,0,2,0,3,0,1,5,4,3,3,3,1,4,2,1,2,3,4,4,2,4,4,5,0,3,1,4,3,4,0,4,3,3,3,2,3,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2],[0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3],[0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1]];function o(){var a=6,n=-1,l=100,M=1e3,m=4,D=this;function y(){D.reset()}this.reset=function(){this._mTotalRel=0,this._mRelSample=[];for(var A=0;Av)this._mNeedToSkipCharNum=E-v,this._mLastCharOrder=-1;else{if(b!=-1&&this._mLastCharOrder!=-1){if(this._mTotalRel+=1,this._mTotalRel>M){this._mDone=!0;break}this._mRelSample[r.jp2CharContext[this._mLastCharOrder][b]]+=1}this._mLastCharOrder=b}}},this.gotEnoughData=function(){return this._mTotalRel>l},this.getConfidence=function(){return this._mTotalRel>m?(this._mTotalRel-this._mRelSample[0])/this._mTotalRel:n},this.getOrder=function(A){return[-1,1]},y()}function i(){this.getOrder=function(a){if(!a)return[-1,1];if(a.charCodeAt(0)>=129&&a.charCodeAt(0)<=159||a.charCodeAt(0)>=224&&a.charCodeAt(0)<=252)var n=2;else n=1;return a.length>1&&a.charCodeAt(0)==130&&a.charCodeAt(1)>=159&&a.charCodeAt(0)<=241?[a.charCodeAt(1)-159,n]:[-1,n]}}i.prototype=new o,r.SJISContextAnalysis=i;function h(){this.getOrder=function(a){if(!a)return[-1,1];if(a.charCodeAt(0)>=142||a.charCodeAt(0)>=161&&a.charCodeAt(0)<=254)var n=2;else a.charCodeAt(0)==143?n=3:n=1;return a.length>1&&a.charCodeAt(0)==164&&a.charCodeAt(1)>=161&&a.charCodeAt(1)<=243?[a.charCodeAt(1)-161,n]:[-1,n]}}h.prototype=new o,r.EUCJPContextAnalysis=h})(_0);var k1=q,q0=j,z1=J1,W1=P.SJISDistributionAnalysis,K1=_0.SJISContextAnalysis,H=p,j1=R;function m0(){q0.apply(this);var r=this;function o(){r._mCodingSM=new k1(z1),r._mDistributionAnalyzer=new W1,r._mContextAnalyzer=new K1,r.reset()}this.reset=function(){m0.prototype.reset.apply(this),this._mContextAnalyzer.reset()},this.getCharsetName=function(){return"SHIFT_JIS"},this.feed=function(i){for(var h=i.length,a=0;a{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 U(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 P(){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__h064a8f7c292bc49f(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__h982fa4f9af5f0d41(t,e)}function Ze(t,e,n){p._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1b2bf3251affd4b0(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__h9e6364c3f89b0ca1(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=P().getInt32(d+4*0,!0),o=P().getInt32(d+4*1,!0),c=P().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),_=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),w=B;p.previewconnector_create(f,g(e),g(n),_,w,i);var o=P().getInt32(f+4*0,!0),c=P().getInt32(f+4*1,!0),d=P().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=P().getInt32(i+4*0,!0),n=P().getInt32(i+4*1,!0),r=P().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=P().getInt32(i+4*0,!0),r=P().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=P().getInt32(o+4*0,!0),r=P().getInt32(o+4*1,!0),i=P().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=U(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=U(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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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_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:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().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:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().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:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().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:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().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_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_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:U(i,p.__wbindgen_malloc,p.__wbindgen_realloc),c=B;P().setInt32(e+4*1,c,!0),P().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:U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().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:U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().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_id_8071f78aa2301217=function(e,n){const r=s(n).id,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},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_src_707c2de7cbb580c7=function(e,n){const r=s(n).src,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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_log_2f54632e0e18c089=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_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_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_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;P().setFloat64(e+8*1,j(i)?0:i,!0),P().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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_isArray_8364a5371e9737d8=function(e){return Array.isArray(s(e))},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.__wbindgen_is_string=function(e){return typeof s(e)=="string"},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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},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_f975102236d3c502=function(e,n,r){s(e)[fe(n)]=fe(r)},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_set_49185437f0ab06f8=function(e,n,r){const i=s(e).set(s(n),s(r));return g(i)},t.wbg.__wbindgen_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return g(n)},t.wbg.__wbindgen_bigint_from_i64=function(e){return g(e)},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;P().setBigInt64(e+8*1,j(i)?BigInt(0):i,!0),P().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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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.__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:U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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_pointerId_37ae0c4682f85248=function(e){return s(e).pointerId},t.wbg.__wbg_matches_42eb40a28a316d0e=function(e){return s(e).matches},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_pointerType_d375491a3013a9bc=function(e,n){const r=s(n).pointerType,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_pressure_95cee3909a8549a9=function(e){return s(e).pressure},t.wbg.__wbg_persisted_6483200f25cdfed4=function(e){return s(e).persisted},t.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(e){return s(e).isIntersecting},t.wbg.__wbg_buttons_a302533e27733599=function(e){return s(e).buttons},t.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return S(function(e,n){s(e).setPointerCapture(n)},arguments)},t.wbg.__wbindgen_cb_drop=function(e){const n=fe(e).original;return n.cnt--==1?(n.a=0,!0):!1},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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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_new_25d9d4e2932d816f=function(){return S(function(e,n){const r=new Worker(F(e,n));return g(r)},arguments)},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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},t.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return S(function(e,n){const r=s(n).userAgent,i=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().setInt32(e+4*0,i,!0)},arguments)},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_queueMicrotask_693514e3dcae83e6=function(e){queueMicrotask(fe(e))},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=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().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=U(o,p.__wbindgen_malloc,p.__wbindgen_realloc),d=B;P().setInt32(e+4*1,d,!0),P().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_requestIdleCallback_86b728660e0547ef=function(e){const n=s(e).requestIdleCallback;return g(n)},t.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const n=s(e).requestFullscreen;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=U(r,p.__wbindgen_malloc,p.__wbindgen_realloc),o=B;P().setInt32(e+4*1,o,!0),P().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_wrapper4162=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4164=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4165=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4166=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper4167=function(e,n,r){const i=en(e,n,1618,tn);return g(i)},t.wbg.__wbindgen_closure_wrapper6478=function(e,n,r){const i=Ee(e,n,1844,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper12140=function(e,n,r){const i=Ee(e,n,1844,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13308=function(e,n,r){const i=Ee(e,n,1844,vo);return g(i)},t.wbg.__wbindgen_closure_wrapper13345=function(e,n,r){const i=Ee(e,n,1844,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13357=function(e,n,r){const i=Ee(e,n,1844,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13363=function(e,n,r){const i=Ee(e,n,1844,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13374=function(e,n,r){const i=Ee(e,n,1844,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13388=function(e,n,r){const i=Ee(e,n,1844,Ro);return g(i)},t.wbg.__wbindgen_closure_wrapper13412=function(e,n,r){const i=Ee(e,n,1844,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13417=function(e,n,r){const i=Ee(e,n,1844,Ze);return g(i)},t.wbg.__wbindgen_closure_wrapper13439=function(e,n,r){const i=Ee(e,n,1844,Ze);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-DCweP4bQ.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 k;(function(y){function I(A){return n.func(A)}y.is=I})(k||(k={})),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,J=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(J){case v.Verbose:return JSON.stringify(u,null,4);case v.Compact:return JSON.stringify(u);default:return}}function Wr(u){if(!(J===v.Off||!ne))if(ze===W.Text){let m;(J===v.Verbose||J===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(!(J===v.Off||!ne))if(ze===W.Text){let m;(J===v.Verbose||J===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(!(J===v.Off||!ne))if(ze===W.Text){let C;(J===v.Verbose||J===v.Compact)&&(u.error&&u.error.data?C=`Error data: ${Ie(u.error.data)} - -`:u.result?C=`Result: ${Ie(u.result)} - -`:u.error===void 0&&(C=`No result returned. - -`)),ne.log(`Sending response '${m} - (${u.id})'. Processing request took ${Date.now()-R}ms`,C)}else Ge("send-response",u)}function Hr(u){if(!(J===v.Off||!ne))if(ze===W.Text){let m;(J===v.Verbose||J===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(!(J===v.Off||!ne||u.method===me.type.method))if(ze===W.Text){let m;(J===v.Verbose||J===v.Compact)&&(u.params?m=`Params: ${Ie(u.params)} - -`:m=`No parameters provided. - -`),ne.log(`Received notification '${u.method}'.`,m)}else Ge("receive-notification",u)}function xr(u,m){if(!(J===v.Off||!ne))if(ze===W.Text){let R;if((J===v.Verbose||J===v.Compact)&&(u.error&&u.error.data?R=`Error data: ${Ie(u.error.data)} - -`:u.result?R=`Result: ${Ie(u.result)} - -`:u.error===void 0&&(R=`No result returned. - -`)),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||J===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 k.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)),J=u,ze=Q,J===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(J===v.Off||!ne)return;const m=J===v.Verbose||J===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 k=Xe;t.RAL=k.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,k){k===void 0&&(k=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,k,v)}:function(f,_,w,k){k===void 0&&(k=w),f[k]=_[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,k){return w===void 0&&(w=i.NullLogger),i.ConnectionStrategy.is(k)&&(k={connectionStrategy:k}),(0,i.createMessageConnection)(f,_,w,k)}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,k)=>{let v=w.range.start.line-k.range.start.line;return v===0?w.range.start.character-k.range.start.character:v}),_=d.length;for(let w=f.length-1;w>=0;w--){let k=f[w],v=o.offsetAt(k.range.start),M=o.offsetAt(k.range.end);if(M<=_)d=d.substring(0,v)+k.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,k=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 k(M){return M!==null&&typeof M=="object"}t.objectLiteral=k;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 J;(function(a){a.None=0,a.Full=1,a.Incremental=2})(J||(t.TextDocumentSyncKind=J={}));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=[],k=[],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(k.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||k.length>0||me.length>0)&&(M.cells={added:W,removed:be,changed:{data:k,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,k=n&&n.notebooks?new(n.notebooks(Oc)):new Oc,v=[r,o,c,d,f,_,w,k];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 k},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,k){k===void 0&&(k=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,k,v)}:function(f,_,w,k){k===void 0&&(k=w),f[k]=_[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 k=Object.getOwnPropertyDescriptor(f,_);(!k||("get"in k?!f.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return f[_]}}),Object.defineProperty(d,w,k)}: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 k,v,M,W;d!==void 0&&d.__brand==="features"&&(k=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,k)}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/lsp_worker-DbrmH7kw.js b/snapshots/master/editor/assets/lsp_worker-DbrmH7kw.js new file mode 100644 index 000000000..87e5a1d5f --- /dev/null +++ b/snapshots/master/editor/assets/lsp_worker-DbrmH7kw.js @@ -0,0 +1,36 @@ +(function(){"use strict";let R;const ze=new Array(128).fill(void 0);ze.push(void 0,null,!0,!1);function s(e){return ze[e]}let Xt=ze.length;function qc(e){e<132||(ze[e]=Xt,Xt=e)}function _e(e){const t=s(e);return qc(e),t}let V=0,Qt=null;function Sn(){return(Qt===null||Qt.byteLength===0)&&(Qt=new Uint8Array(R.memory.buffer)),Qt}const Cn=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Mc=typeof Cn.encodeInto=="function"?function(e,t){return Cn.encodeInto(e,t)}:function(e,t){const n=Cn.encode(e);return t.set(n),{read:e.length,written:n.length}};function Q(e,t,n){if(n===void 0){const a=Cn.encode(e),l=t(a.length,1)>>>0;return Sn().subarray(l,l+a.length).set(a),V=a.length,l}let i=e.length,r=t(i,1)>>>0;const o=Sn();let c=0;for(;c127)break;o[r+c]=a}if(c!==i){c!==0&&(e=e.slice(c)),r=n(r,i,i=c+e.length*3,1)>>>0;const a=Sn().subarray(r+c,r+i),l=Mc(e,a);c+=l.written,r=n(r,i,c,1)>>>0}return V=c,r}function L(e){return e==null}let _t=null;function S(){return(_t===null||_t.buffer.detached===!0||_t.buffer.detached===void 0&&_t.buffer!==R.memory.buffer)&&(_t=new DataView(R.memory.buffer)),_t}function h(e){Xt===ze.length&&ze.push(ze.length+1);const t=Xt;return Xt=ze[t],ze[t]=e,t}const co=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&co.decode();function H(e,t){return e=e>>>0,co.decode(Sn().subarray(e,e+t))}function Lr(e){const t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){const r=e.description;return r==null?"Symbol":`Symbol(${r})`}if(t=="function"){const r=e.name;return typeof r=="string"&&r.length>0?`Function(${r})`:"Function"}if(Array.isArray(e)){const r=e.length;let o="[";r>0&&(o+=Lr(e[0]));for(let c=1;c1)i=n[1];else return toString.call(e);if(i=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message} +${e.stack}`:i}const qn=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{R.__wbindgen_export_2.get(e.dtor)(e.a,e.b)});function Yt(e,t,n,i){const r={a:e,b:t,cnt:1,dtor:n},o=(...c)=>{r.cnt++;try{return i(r.a,r.b,...c)}finally{--r.cnt===0&&(R.__wbindgen_export_2.get(r.dtor)(r.a,r.b),r.a=0,qn.unregister(r))}};return o.original=r,qn.register(o,r,r),o}function Kt(e,t,n){R._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h064a8f7c292bc49f(e,t,h(n))}function Me(e,t,n,i){const r={a:e,b:t,cnt:1,dtor:n},o=(...c)=>{r.cnt++;const a=r.a;r.a=0;try{return i(a,r.b,...c)}finally{--r.cnt===0?(R.__wbindgen_export_2.get(r.dtor)(a,r.b),qn.unregister(r)):r.a=a}};return o.original=r,qn.register(o,r,r),o}function ao(e,t){R._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h982fa4f9af5f0d41(e,t)}function Ge(e,t,n){R._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1b2bf3251affd4b0(e,t,h(n))}function uo(e,t,n,i){R._dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9e6364c3f89b0ca1(e,t,h(n),h(i))}function q(e,t){try{return e.apply(this,t)}catch(n){R.__wbindgen_exn_store(h(n))}}function Oc(e,t,n,i){try{const a=R.__wbindgen_add_to_stack_pointer(-16);R.create(a,h(e),h(t),h(n),h(i));var r=S().getInt32(a+4*0,!0),o=S().getInt32(a+4*1,!0),c=S().getInt32(a+4*2,!0);if(c)throw _e(o);return Hr.__wrap(r)}finally{R.__wbindgen_add_to_stack_pointer(16)}}let Gt=null;function Ec(){return(Gt===null||Gt.byteLength===0)&&(Gt=new Float32Array(R.memory.buffer)),Gt}function Mn(e,t){return e=e>>>0,Ec().subarray(e/4,e/4+t)}const lo=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>R.__wbg_previewconnector_free(e>>>0,1));class Wr{static __wrap(t){t=t>>>0;const n=Object.create(Wr.prototype);return n.__wbg_ptr=t,lo.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lo.unregister(this),t}free(){const t=this.__destroy_into_raw();R.__wbg_previewconnector_free(t,0)}static create(t,n,i,r){try{const l=R.__wbindgen_add_to_stack_pointer(-16),f=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),_=V;R.previewconnector_create(l,h(t),h(n),f,_,r);var o=S().getInt32(l+4*0,!0),c=S().getInt32(l+4*1,!0),a=S().getInt32(l+4*2,!0);if(a)throw _e(c);return _e(o)}finally{R.__wbindgen_add_to_stack_pointer(16)}}current_style(){const t=R.previewconnector_current_style(this.__wbg_ptr);return _e(t)}show_ui(){try{const r=R.__wbindgen_add_to_stack_pointer(-16);R.previewconnector_show_ui(r,this.__wbg_ptr);var t=S().getInt32(r+4*0,!0),n=S().getInt32(r+4*1,!0),i=S().getInt32(r+4*2,!0);if(i)throw _e(n);return _e(t)}finally{R.__wbindgen_add_to_stack_pointer(16)}}process_lsp_to_preview_message(t){try{const r=R.__wbindgen_add_to_stack_pointer(-16);R.previewconnector_process_lsp_to_preview_message(r,this.__wbg_ptr,h(t));var n=S().getInt32(r+4*0,!0),i=S().getInt32(r+4*1,!0);if(i)throw _e(n)}finally{R.__wbindgen_add_to_stack_pointer(16)}}}const fo=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>R.__wbg_slintserver_free(e>>>0,1));class Hr{static __wrap(t){t=t>>>0;const n=Object.create(Hr.prototype);return n.__wbg_ptr=t,fo.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,fo.unregister(this),t}free(){const t=this.__destroy_into_raw();R.__wbg_slintserver_free(t,0)}process_preview_to_lsp_message(t){const n=R.slintserver_process_preview_to_lsp_message(this.__wbg_ptr,h(t));return _e(n)}server_initialize_result(t){try{const o=R.__wbindgen_add_to_stack_pointer(-16);R.slintserver_server_initialize_result(o,this.__wbg_ptr,h(t));var n=S().getInt32(o+4*0,!0),i=S().getInt32(o+4*1,!0),r=S().getInt32(o+4*2,!0);if(r)throw _e(i);return _e(n)}finally{R.__wbindgen_add_to_stack_pointer(16)}}reload_document(t,n,i){const r=Q(t,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V,c=R.slintserver_reload_document(this.__wbg_ptr,r,o,h(n),i);return _e(c)}handle_request(t,n,i){const r=Q(n,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V,c=R.slintserver_handle_request(this.__wbg_ptr,h(t),r,o,h(i));return _e(c)}reload_config(){const t=R.slintserver_reload_config(this.__wbg_ptr);return _e(t)}}async function Nc(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(i){if(e.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 n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function jc(){const e={};return e.wbg={},e.wbg.__wbg_new_abda76e883ba8a5f=function(){const t=new Error;return h(t)},e.wbg.__wbg_stack_658279fe44541cf6=function(t,n){const i=s(n).stack,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_error_f851667af71bcfc6=function(t,n){let i,r;try{i=t,r=n,console.error(H(t,n))}finally{R.__wbindgen_free(i,r,1)}},e.wbg.__wbindgen_object_drop_ref=function(t){_e(t)},e.wbg.__wbg_createProgram_2c3a8969b5a76988=function(t){const n=s(t).createProgram();return L(n)?0:h(n)},e.wbg.__wbg_createProgram_73611dc7a72c4ee2=function(t){const n=s(t).createProgram();return L(n)?0:h(n)},e.wbg.__wbg_attachShader_2b5810fc1d23ebe7=function(t,n,i){s(t).attachShader(s(n),s(i))},e.wbg.__wbg_attachShader_396d529f1d7c9abc=function(t,n,i){s(t).attachShader(s(n),s(i))},e.wbg.__wbg_bindAttribLocation_0018ec2a523f139f=function(t,n,i,r,o){s(t).bindAttribLocation(s(n),i>>>0,H(r,o))},e.wbg.__wbg_bindAttribLocation_9e7dad25e51f58b1=function(t,n,i,r,o){s(t).bindAttribLocation(s(n),i>>>0,H(r,o))},e.wbg.__wbg_linkProgram_1f18bca817bb6edb=function(t,n){s(t).linkProgram(s(n))},e.wbg.__wbg_linkProgram_56a5d97f63b1f56d=function(t,n){s(t).linkProgram(s(n))},e.wbg.__wbg_getProgramParameter_ab2954ca517d8589=function(t,n,i){const r=s(t).getProgramParameter(s(n),i>>>0);return h(r)},e.wbg.__wbg_getProgramParameter_9df6cbbb1343b27d=function(t,n,i){const r=s(t).getProgramParameter(s(n),i>>>0);return h(r)},e.wbg.__wbindgen_boolean_get=function(t){const n=s(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbg_detachShader_c5af8831e42dad83=function(t,n,i){s(t).detachShader(s(n),s(i))},e.wbg.__wbg_detachShader_32f119837bb4e8a9=function(t,n,i){s(t).detachShader(s(n),s(i))},e.wbg.__wbg_getProgramInfoLog_22296c36addf7a70=function(t,n,i){const r=s(n).getProgramInfoLog(s(i));var o=L(r)?0:Q(r,R.__wbindgen_malloc,R.__wbindgen_realloc),c=V;S().setInt32(t+4*1,c,!0),S().setInt32(t+4*0,o,!0)},e.wbg.__wbg_getProgramInfoLog_fe796f3a9512a8e3=function(t,n,i){const r=s(n).getProgramInfoLog(s(i));var o=L(r)?0:Q(r,R.__wbindgen_malloc,R.__wbindgen_realloc),c=V;S().setInt32(t+4*1,c,!0),S().setInt32(t+4*0,o,!0)},e.wbg.__wbg_createShader_af087106532661d9=function(t,n){const i=s(t).createShader(n>>>0);return L(i)?0:h(i)},e.wbg.__wbg_createShader_f10ffabbfd8e2c8c=function(t,n){const i=s(t).createShader(n>>>0);return L(i)?0:h(i)},e.wbg.__wbg_shaderSource_d447b31057e4f64c=function(t,n,i,r){s(t).shaderSource(s(n),H(i,r))},e.wbg.__wbg_shaderSource_b92b2b5c29126344=function(t,n,i,r){s(t).shaderSource(s(n),H(i,r))},e.wbg.__wbg_compileShader_043cc8b99c2efc21=function(t,n){s(t).compileShader(s(n))},e.wbg.__wbg_compileShader_77ef81728b1c03f6=function(t,n){s(t).compileShader(s(n))},e.wbg.__wbg_getShaderParameter_cedb1ec0d8052eff=function(t,n,i){const r=s(t).getShaderParameter(s(n),i>>>0);return h(r)},e.wbg.__wbg_getShaderParameter_806970126d526c29=function(t,n,i){const r=s(t).getShaderParameter(s(n),i>>>0);return h(r)},e.wbg.__wbg_getShaderInfoLog_935361c52a919c15=function(t,n,i){const r=s(n).getShaderInfoLog(s(i));var o=L(r)?0:Q(r,R.__wbindgen_malloc,R.__wbindgen_realloc),c=V;S().setInt32(t+4*1,c,!0),S().setInt32(t+4*0,o,!0)},e.wbg.__wbg_getShaderInfoLog_a7ca51b89a4dafab=function(t,n,i){const r=s(n).getShaderInfoLog(s(i));var o=L(r)?0:Q(r,R.__wbindgen_malloc,R.__wbindgen_realloc),c=V;S().setInt32(t+4*1,c,!0),S().setInt32(t+4*0,o,!0)},e.wbg.__wbg_uniform2fv_b73144e507d90a92=function(t,n,i,r){s(t).uniform2fv(s(n),Mn(i,r))},e.wbg.__wbg_uniform2fv_83048fbc79c7f362=function(t,n,i,r){s(t).uniform2fv(s(n),Mn(i,r))},e.wbg.__wbg_deleteFramebuffer_c0d511b2fc07620d=function(t,n){s(t).deleteFramebuffer(s(n))},e.wbg.__wbg_deleteFramebuffer_d632dfba2c1f5c75=function(t,n){s(t).deleteFramebuffer(s(n))},e.wbg.__wbg_deleteRenderbuffer_325417b497c5ae27=function(t,n){s(t).deleteRenderbuffer(s(n))},e.wbg.__wbg_deleteRenderbuffer_ccae7372581ae424=function(t,n){s(t).deleteRenderbuffer(s(n))},e.wbg.__wbg_width_ac5901de11cd9abc=function(t){return s(t).width},e.wbg.__wbg_height_bf0ba2fba351acb3=function(t){return s(t).height},e.wbg.__wbg_createTexture_e49c36c5f31925a3=function(t){const n=s(t).createTexture();return L(n)?0:h(n)},e.wbg.__wbg_createTexture_2426b031baa26a82=function(t){const n=s(t).createTexture();return L(n)?0:h(n)},e.wbg.__wbg_new_525245e2b9901204=function(){const t=new Object;return h(t)},e.wbg.__wbg_setstencil_8965dcc5fb1508bd=function(t,n){s(t).stencil=n!==0},e.wbg.__wbg_setantialias_05dc0a39d7b109be=function(t,n){s(t).antialias=n!==0},e.wbg.__wbg_getContext_70d493702d2b8f3e=function(){return q(function(t,n,i,r){const o=s(t).getContext(H(n,i),s(r));return L(o)?0:h(o)},arguments)},e.wbg.__wbg_instanceof_WebGl2RenderingContext_62ccef896d9204fa=function(t){let n;try{n=s(t)instanceof WebGL2RenderingContext}catch{n=!1}return n},e.wbg.__wbg_getSupportedExtensions_e1788ac835b7e81a=function(t){const n=s(t).getSupportedExtensions();return L(n)?0:h(n)},e.wbg.__wbg_length_ae22078168b726f5=function(t){return s(t).length},e.wbg.__wbg_get_3baa728f9d58d3f6=function(t,n){const i=s(t)[n>>>0];return h(i)},e.wbg.__wbindgen_string_get=function(t,n){const i=s(n),r=typeof i=="string"?i:void 0;var o=L(r)?0:Q(r,R.__wbindgen_malloc,R.__wbindgen_realloc),c=V;S().setInt32(t+4*1,c,!0),S().setInt32(t+4*0,o,!0)},e.wbg.__wbg_getParameter_cfaed180705b9280=function(){return q(function(t,n){const i=s(t).getParameter(n>>>0);return h(i)},arguments)},e.wbg.__wbg_createVertexArrayOES_84334a02da216381=function(t){const n=s(t).createVertexArrayOES();return L(n)?0:h(n)},e.wbg.__wbg_createVertexArray_a3e58c38609ae150=function(t){const n=s(t).createVertexArray();return L(n)?0:h(n)},e.wbg.__wbg_createBuffer_9571c039ba6696c6=function(t){const n=s(t).createBuffer();return L(n)?0:h(n)},e.wbg.__wbg_createBuffer_7b18852edffb3ab4=function(t){const n=s(t).createBuffer();return L(n)?0:h(n)},e.wbg.__wbg_getError_c620f28d427d8ad8=function(t){return s(t).getError()},e.wbg.__wbg_getError_deb0c909d3a7041a=function(t){return s(t).getError()},e.wbg.__wbg_createFramebuffer_20f79ec189ef2060=function(t){const n=s(t).createFramebuffer();return L(n)?0:h(n)},e.wbg.__wbg_createFramebuffer_a12847edac092647=function(t){const n=s(t).createFramebuffer();return L(n)?0:h(n)},e.wbg.__wbg_framebufferTexture2D_ae81a33228e46de6=function(t,n,i,r,o,c){s(t).framebufferTexture2D(n>>>0,i>>>0,r>>>0,s(o),c)},e.wbg.__wbg_framebufferTexture2D_5b524fe6135d5fe8=function(t,n,i,r,o,c){s(t).framebufferTexture2D(n>>>0,i>>>0,r>>>0,s(o),c)},e.wbg.__wbg_createRenderbuffer_620bdfb7867926e8=function(t){const n=s(t).createRenderbuffer();return L(n)?0:h(n)},e.wbg.__wbg_createRenderbuffer_e7bd95fedc0bbcb5=function(t){const n=s(t).createRenderbuffer();return L(n)?0:h(n)},e.wbg.__wbg_renderbufferStorage_8c3882aa73deada9=function(t,n,i,r,o){s(t).renderbufferStorage(n>>>0,i>>>0,r,o)},e.wbg.__wbg_renderbufferStorage_3c5e469d82dfe89b=function(t,n,i,r,o){s(t).renderbufferStorage(n>>>0,i>>>0,r,o)},e.wbg.__wbg_framebufferRenderbuffer_fee6ceb2330389b7=function(t,n,i,r,o){s(t).framebufferRenderbuffer(n>>>0,i>>>0,r>>>0,s(o))},e.wbg.__wbg_framebufferRenderbuffer_f7c592ad40667f89=function(t,n,i,r,o){s(t).framebufferRenderbuffer(n>>>0,i>>>0,r>>>0,s(o))},e.wbg.__wbg_checkFramebufferStatus_60221d3774b874b0=function(t,n){return s(t).checkFramebufferStatus(n>>>0)},e.wbg.__wbg_checkFramebufferStatus_eb8a13fec89c418c=function(t,n){return s(t).checkFramebufferStatus(n>>>0)},e.wbg.__wbg_scissor_d06b14c4966727fa=function(t,n,i,r,o){s(t).scissor(n,i,r,o)},e.wbg.__wbg_scissor_2b172ca4e459dd16=function(t,n,i,r,o){s(t).scissor(n,i,r,o)},e.wbg.__wbg_clearColor_ac713fa6931cef3c=function(t,n,i,r,o){s(t).clearColor(n,i,r,o)},e.wbg.__wbg_clearColor_837d30f5bf4f982b=function(t,n,i,r,o){s(t).clearColor(n,i,r,o)},e.wbg.__wbg_clear_780c4e5384fe3fc6=function(t,n){s(t).clear(n>>>0)},e.wbg.__wbg_clear_7a2a7ca897047e8d=function(t,n){s(t).clear(n>>>0)},e.wbg.__wbg_uniform4fv_d87e4ea9ef6cf6de=function(t,n,i,r){s(t).uniform4fv(s(n),Mn(i,r))},e.wbg.__wbg_uniform4fv_cf977e0dd611bbdd=function(t,n,i,r){s(t).uniform4fv(s(n),Mn(i,r))},e.wbg.__wbg_deleteTexture_cdd844345a2559bb=function(t,n){s(t).deleteTexture(s(n))},e.wbg.__wbg_deleteTexture_558c751a66bd2f16=function(t,n){s(t).deleteTexture(s(n))},e.wbg.__wbg_deleteShader_da06706168cf00dc=function(t,n){s(t).deleteShader(s(n))},e.wbg.__wbg_deleteShader_b9bb71cfb1a65a0d=function(t,n){s(t).deleteShader(s(n))},e.wbg.__wbg_deleteProgram_c3238b647d849334=function(t,n){s(t).deleteProgram(s(n))},e.wbg.__wbg_deleteProgram_5f938b0667141206=function(t,n){s(t).deleteProgram(s(n))},e.wbg.__wbg_useProgram_001c6b9208b683d3=function(t,n){s(t).useProgram(s(n))},e.wbg.__wbg_useProgram_d4616618ac6d0652=function(t,n){s(t).useProgram(s(n))},e.wbg.__wbg_bindBuffer_d6b05e0a99a752d4=function(t,n,i){s(t).bindBuffer(n>>>0,s(i))},e.wbg.__wbg_bindBuffer_1f581c747176e7d7=function(t,n,i){s(t).bindBuffer(n>>>0,s(i))},e.wbg.__wbg_bindFramebuffer_f5e959313c29a7c6=function(t,n,i){s(t).bindFramebuffer(n>>>0,s(i))},e.wbg.__wbg_bindFramebuffer_8cba9964befd2a6d=function(t,n,i){s(t).bindFramebuffer(n>>>0,s(i))},e.wbg.__wbg_bindRenderbuffer_691cb14fc6248155=function(t,n,i){s(t).bindRenderbuffer(n>>>0,s(i))},e.wbg.__wbg_bindRenderbuffer_297ae310683dc32b=function(t,n,i){s(t).bindRenderbuffer(n>>>0,s(i))},e.wbg.__wbg_bindVertexArray_bec56c40e9ec299d=function(t,n){s(t).bindVertexArray(s(n))},e.wbg.__wbg_bindVertexArrayOES_37868a5a4265ea0a=function(t,n){s(t).bindVertexArrayOES(s(n))},e.wbg.__wbg_pixelStorei_2498331e094ff305=function(t,n,i){s(t).pixelStorei(n>>>0,i)},e.wbg.__wbg_pixelStorei_3a600280eab03e3c=function(t,n,i){s(t).pixelStorei(n>>>0,i)},e.wbg.__wbg_disable_d73e59fee5b5e973=function(t,n){s(t).disable(n>>>0)},e.wbg.__wbg_disable_8908871f2334e76b=function(t,n){s(t).disable(n>>>0)},e.wbg.__wbg_disableVertexAttribArray_b9d8ae826c70526f=function(t,n){s(t).disableVertexAttribArray(n>>>0)},e.wbg.__wbg_disableVertexAttribArray_79a5010f18eb84cb=function(t,n){s(t).disableVertexAttribArray(n>>>0)},e.wbg.__wbg_drawArrays_532f4e0a4547dd1f=function(t,n,i,r){s(t).drawArrays(n>>>0,i,r)},e.wbg.__wbg_drawArrays_7a8f5031b1fe80ff=function(t,n,i,r){s(t).drawArrays(n>>>0,i,r)},e.wbg.__wbg_enable_68b3fa03a633259a=function(t,n){s(t).enable(n>>>0)},e.wbg.__wbg_enable_541ed84c1e7d269d=function(t,n){s(t).enable(n>>>0)},e.wbg.__wbg_enableVertexAttribArray_52c23a516be565c0=function(t,n){s(t).enableVertexAttribArray(n>>>0)},e.wbg.__wbg_enableVertexAttribArray_06043f51b716ed9d=function(t,n){s(t).enableVertexAttribArray(n>>>0)},e.wbg.__wbg_getUniformLocation_9cd213015cf8f29f=function(t,n,i,r){const o=s(t).getUniformLocation(s(n),H(i,r));return L(o)?0:h(o)},e.wbg.__wbg_getUniformLocation_6a59ad54df3bba8e=function(t,n,i,r){const o=s(t).getUniformLocation(s(n),H(i,r));return L(o)?0:h(o)},e.wbg.__wbg_generateMipmap_52c223b74b4f16a3=function(t,n){s(t).generateMipmap(n>>>0)},e.wbg.__wbg_generateMipmap_52183f0501f63234=function(t,n){s(t).generateMipmap(n>>>0)},e.wbg.__wbg_texImage2D_d704e7eee22d1e6b=function(){return q(function(t,n,i,r,o,c,a,l,f,_){s(t).texImage2D(n>>>0,i,r,o,c,a,l>>>0,f>>>0,s(_))},arguments)},e.wbg.__wbg_texImage2D_75effcb59fe5da7e=function(){return q(function(t,n,i,r,o,c,a,l,f,_){s(t).texImage2D(n>>>0,i,r,o,c,a,l>>>0,f>>>0,s(_))},arguments)},e.wbg.__wbg_uniform1i_7f6e60c975d21e0a=function(t,n,i){s(t).uniform1i(s(n),i)},e.wbg.__wbg_uniform1i_ded3be13f5d8f11a=function(t,n,i){s(t).uniform1i(s(n),i)},e.wbg.__wbg_colorMask_6a64eb75df60e2cf=function(t,n,i,r,o){s(t).colorMask(n!==0,i!==0,r!==0,o!==0)},e.wbg.__wbg_colorMask_7c2aafdec5441392=function(t,n,i,r,o){s(t).colorMask(n!==0,i!==0,r!==0,o!==0)},e.wbg.__wbg_bindTexture_840f7fcfd0298dc4=function(t,n,i){s(t).bindTexture(n>>>0,s(i))},e.wbg.__wbg_bindTexture_bffa89324927e23a=function(t,n,i){s(t).bindTexture(n>>>0,s(i))},e.wbg.__wbg_activeTexture_b967ed47a8083daa=function(t,n){s(t).activeTexture(n>>>0)},e.wbg.__wbg_activeTexture_067b93df6d1ed857=function(t,n){s(t).activeTexture(n>>>0)},e.wbg.__wbg_texParameteri_83ad7181b62f4997=function(t,n,i,r){s(t).texParameteri(n>>>0,i>>>0,r)},e.wbg.__wbg_texParameteri_531d0268109950ba=function(t,n,i,r){s(t).texParameteri(n>>>0,i>>>0,r)},e.wbg.__wbg_texSubImage2D_bed4633ee03b384d=function(){return q(function(t,n,i,r,o,c,a,l,f,_){s(t).texSubImage2D(n>>>0,i,r,o,c,a,l>>>0,f>>>0,s(_))},arguments)},e.wbg.__wbg_texSubImage2D_be0166513e368886=function(){return q(function(t,n,i,r,o,c,a,l,f,_){s(t).texSubImage2D(n>>>0,i,r,o,c,a,l>>>0,f>>>0,s(_))},arguments)},e.wbg.__wbg_texSubImage2D_338d11db84a799ed=function(){return q(function(t,n,i,r,o,c,a,l,f,_){s(t).texSubImage2D(n>>>0,i,r,o,c,a,l>>>0,f>>>0,_)},arguments)},e.wbg.__wbg_vertexAttribPointer_fcbfe42523d724ca=function(t,n,i,r,o,c,a){s(t).vertexAttribPointer(n>>>0,i,r>>>0,o!==0,c,a)},e.wbg.__wbg_vertexAttribPointer_b435a034ff758637=function(t,n,i,r,o,c,a){s(t).vertexAttribPointer(n>>>0,i,r>>>0,o!==0,c,a)},e.wbg.__wbg_viewport_efc09c09d4f3cc48=function(t,n,i,r,o){s(t).viewport(n,i,r,o)},e.wbg.__wbg_viewport_536c78dd69c44351=function(t,n,i,r,o){s(t).viewport(n,i,r,o)},e.wbg.__wbg_stencilFunc_0e2a6d25bdcb678e=function(t,n,i,r){s(t).stencilFunc(n>>>0,i,r>>>0)},e.wbg.__wbg_stencilFunc_a9e54b3cfe396b31=function(t,n,i,r){s(t).stencilFunc(n>>>0,i,r>>>0)},e.wbg.__wbg_stencilMask_f55f160fc49b981a=function(t,n){s(t).stencilMask(n>>>0)},e.wbg.__wbg_stencilMask_702162181d88081f=function(t,n){s(t).stencilMask(n>>>0)},e.wbg.__wbg_stencilOp_2418383669ca9228=function(t,n,i,r){s(t).stencilOp(n>>>0,i>>>0,r>>>0)},e.wbg.__wbg_stencilOp_0634a11fbde7da95=function(t,n,i,r){s(t).stencilOp(n>>>0,i>>>0,r>>>0)},e.wbg.__wbg_stencilOpSeparate_ea6f96abd32aae5b=function(t,n,i,r,o){s(t).stencilOpSeparate(n>>>0,i>>>0,r>>>0,o>>>0)},e.wbg.__wbg_stencilOpSeparate_52b401966f916a0f=function(t,n,i,r,o){s(t).stencilOpSeparate(n>>>0,i>>>0,r>>>0,o>>>0)},e.wbg.__wbg_devicePixelRatio_7ba8bc80d46340bd=function(t){return s(t).devicePixelRatio},e.wbg.__wbg_document_8554450897a855b9=function(t){const n=s(t).document;return L(n)?0:h(n)},e.wbg.__wbg_getElementById_f56c8e6a15a6926d=function(t,n,i){const r=s(t).getElementById(H(n,i));return L(r)?0:h(r)},e.wbg.__wbg_instanceof_HtmlCanvasElement_1a96a01603ec2d8b=function(t){let n;try{n=s(t)instanceof HTMLCanvasElement}catch{n=!1}return n},e.wbg.__wbg_setwidth_e371a8d6b16ebe84=function(t,n){s(t).width=n>>>0},e.wbg.__wbg_setheight_ba99ad2df4295e89=function(t,n){s(t).height=n>>>0},e.wbg.__wbg_clientWidth_e73e836a6257fbe5=function(t){return s(t).clientWidth},e.wbg.__wbg_clientHeight_9325ebe2318ce8af=function(t){return s(t).clientHeight},e.wbg.__wbg_dataset_b0dd1a3513142b54=function(t){const n=s(t).dataset;return h(n)},e.wbg.__wbg_get_9a60fce5bf7da364=function(t,n,i,r){const o=s(n)[H(i,r)];var c=L(o)?0:Q(o,R.__wbindgen_malloc,R.__wbindgen_realloc),a=V;S().setInt32(t+4*1,a,!0),S().setInt32(t+4*0,c,!0)},e.wbg.__wbg_instanceof_HtmlInputElement_88bf515ab1d9511d=function(t){let n;try{n=s(t)instanceof HTMLInputElement}catch{n=!1}return n},e.wbg.__wbg_style_e06c9e03355741e9=function(t){const n=s(t).style;return h(n)},e.wbg.__wbg_offsetLeft_4b5479a797fb7749=function(t){return s(t).offsetLeft},e.wbg.__wbg_offsetTop_3f1fbd1d48327b28=function(t){return s(t).offsetTop},e.wbg.__wbg_offsetWidth_e22a06cc87eb3cb2=function(t){return s(t).offsetWidth},e.wbg.__wbg_offsetHeight_3fd383b839bb6c45=function(t){return s(t).offsetHeight},e.wbg.__wbg_before_ac3792b457802cbf=function(){return q(function(t,n){s(t).before(s(n))},arguments)},e.wbg.__wbindgen_object_clone_ref=function(t){const n=s(t);return h(n)},e.wbg.__wbg_setvalue_688819688274bec0=function(t,n,i){s(t).value=H(n,i)},e.wbg.__wbg_data_edba00a6420faae3=function(t,n){const i=s(n).data;var r=L(i)?0:Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_isComposing_ca7496e67564f5b9=function(t){return s(t).isComposing},e.wbg.__wbg_inputType_dc144c8251b0d194=function(t,n){const i=s(n).inputType,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_preventDefault_c55d86c27b2dfa6e=function(t){s(t).preventDefault()},e.wbg.__wbg_isComposing_1c9533ed199eaf7b=function(t){return s(t).isComposing},e.wbg.__wbg_key_a626396efbca2b95=function(t,n){const i=s(n).key,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_shiftKey_f38dee34420e0d62=function(t){return s(t).shiftKey},e.wbg.__wbg_ctrlKey_319ff2374dc7f372=function(t){return s(t).ctrlKey},e.wbg.__wbg_altKey_5a6eb49ec8194792=function(t){return s(t).altKey},e.wbg.__wbg_getModifierState_fde3eed099a4880a=function(t,n,i){return s(t).getModifierState(H(n,i))},e.wbg.__wbg_repeat_8451a79b3608855b=function(t){return s(t).repeat},e.wbg.__wbg_clipboardData_93c130a72996456a=function(t){const n=s(t).clipboardData;return L(n)?0:h(n)},e.wbg.__wbg_getData_b768ea3ff59e2a13=function(){return q(function(t,n,i,r){const o=s(n).getData(H(i,r)),c=Q(o,R.__wbindgen_malloc,R.__wbindgen_realloc),a=V;S().setInt32(t+4*1,a,!0),S().setInt32(t+4*0,c,!0)},arguments)},e.wbg.__wbg_instanceof_CanvasRenderingContext2d_a0c4f0da6392b8ca=function(t){let n;try{n=s(t)instanceof CanvasRenderingContext2D}catch{n=!1}return n},e.wbg.__wbg_setfont_931e1f36bec6a342=function(t,n,i){s(t).font=H(n,i)},e.wbg.__wbindgen_string_new=function(t,n){const i=H(t,n);return h(i)},e.wbg.__wbg_setfillStyle_98060f7b257936ba=function(t,n){s(t).fillStyle=s(n)},e.wbg.__wbg_id_8071f78aa2301217=function(t,n){const i=s(n).id,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_naturalWidth_a29690dafff0d1ec=function(t){return s(t).naturalWidth},e.wbg.__wbg_naturalHeight_d5b070bd22a216bd=function(t){return s(t).naturalHeight},e.wbg.__wbg_currentSrc_299fcc32125efadb=function(t,n){const i=s(n).currentSrc,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_new0_65387337a95cf44d=function(){return h(new Date)},e.wbg.__wbg_getTime_91058879093a1589=function(t){return s(t).getTime()},e.wbg.__wbindgen_number_new=function(t){return h(t)},e.wbg.__wbg_new_7982fb43cfca37ae=function(t){const n=new Date(s(t));return h(n)},e.wbg.__wbg_getTimezoneOffset_c9929a3cc94500fe=function(t){return s(t).getTimezoneOffset()},e.wbg.__wbg_src_707c2de7cbb580c7=function(t,n){const i=s(n).src,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_new_0d5e77f348d88b87=function(){return q(function(){const t=new Image;return h(t)},arguments)},e.wbg.__wbg_setcrossOrigin_4fcc10b692a33720=function(t,n,i){s(t).crossOrigin=n===0?void 0:H(n,i)},e.wbg.__wbg_setonload_b4dbb9c6e43b6cb3=function(t,n){s(t).onload=s(n)},e.wbg.__wbg_setsrc_129ba95151116b01=function(t,n,i){s(t).src=H(n,i)},e.wbg.__wbg_log_2f54632e0e18c089=function(t,n){console.log(H(t,n))},e.wbg.__wbg_cullFace_ccad99c645b704eb=function(t,n){s(t).cullFace(n>>>0)},e.wbg.__wbg_cullFace_fbafcb7763a2d6aa=function(t,n){s(t).cullFace(n>>>0)},e.wbg.__wbg_frontFace_358bf8c6c5159d54=function(t,n){s(t).frontFace(n>>>0)},e.wbg.__wbg_frontFace_54ccf43770ae1011=function(t,n){s(t).frontFace(n>>>0)},e.wbg.__wbg_bufferData_0db2a74470353a96=function(t,n,i,r){s(t).bufferData(n>>>0,s(i),r>>>0)},e.wbg.__wbg_bufferData_94ce174a81b32961=function(t,n,i,r){s(t).bufferData(n>>>0,s(i),r>>>0)},e.wbg.__wbg_blendFuncSeparate_2b607032f14b9381=function(t,n,i,r,o){s(t).blendFuncSeparate(n>>>0,i>>>0,r>>>0,o>>>0)},e.wbg.__wbg_blendFuncSeparate_f81dd232d266e735=function(t,n,i,r,o){s(t).blendFuncSeparate(n>>>0,i>>>0,r>>>0,o>>>0)},e.wbg.__wbg_readPixels_0c5ad23c72dbe1b8=function(){return q(function(t,n,i,r,o,c,a,l){s(t).readPixels(n,i,r,o,c>>>0,a>>>0,s(l))},arguments)},e.wbg.__wbg_readPixels_f589cb77c7641fb2=function(){return q(function(t,n,i,r,o,c,a,l){s(t).readPixels(n,i,r,o,c>>>0,a>>>0,s(l))},arguments)},e.wbg.__wbg_setwidth_84b579903fae1a52=function(t,n){s(t).width=n>>>0},e.wbg.__wbg_setheight_6ae385769cc2e592=function(t,n){s(t).height=n>>>0},e.wbg.__wbg_deleteVertexArray_81346dd52e54eb57=function(t,n){s(t).deleteVertexArray(s(n))},e.wbg.__wbg_deleteVertexArrayOES_e22f7a6baedc5300=function(t,n){s(t).deleteVertexArrayOES(s(n))},e.wbg.__wbg_deleteBuffer_27b0fb5ed68afbe4=function(t,n){s(t).deleteBuffer(s(n))},e.wbg.__wbg_deleteBuffer_898974b9db136e43=function(t,n){s(t).deleteBuffer(s(n))},e.wbg.__wbg_texSubImage2D_064e1b60f43bdb29=function(){return q(function(t,n,i,r,o,c,a,l){s(t).texSubImage2D(n>>>0,i,r,o,c>>>0,a>>>0,s(l))},arguments)},e.wbg.__wbg_texSubImage2D_4fef3101bace1b04=function(){return q(function(t,n,i,r,o,c,a,l){s(t).texSubImage2D(n>>>0,i,r,o,c>>>0,a>>>0,s(l))},arguments)},e.wbg.__wbg_next_f9cb570345655b9a=function(){return q(function(t){const n=s(t).next();return h(n)},arguments)},e.wbg.__wbg_done_bfda7aa8f252b39f=function(t){return s(t).done},e.wbg.__wbg_value_6d39332ab4788d86=function(t){const n=s(t).value;return h(n)},e.wbg.__wbg_iterator_888179a48810a9fe=function(){return h(Symbol.iterator)},e.wbg.__wbg_get_224d16597dbbfd96=function(){return q(function(t,n){const i=Reflect.get(s(t),s(n));return h(i)},arguments)},e.wbg.__wbindgen_is_function=function(t){return typeof s(t)=="function"},e.wbg.__wbindgen_is_object=function(t){const n=s(t);return typeof n=="object"&&n!==null},e.wbg.__wbg_next_de3e9db4440638b2=function(t){const n=s(t).next;return h(n)},e.wbg.__wbg_call_1084a111329e68ce=function(){return q(function(t,n){const i=s(t).call(s(n));return h(i)},arguments)},e.wbg.__wbg_call_89af060b4e1523f2=function(){return q(function(t,n,i){const r=s(t).call(s(n),s(i));return h(r)},arguments)},e.wbg.__wbg_call_c6fe275aaa60da79=function(){return q(function(t,n,i,r){const o=s(t).call(s(n),s(i),s(r));return h(o)},arguments)},e.wbg.__wbindgen_memory=function(){const t=R.memory;return h(t)},e.wbg.__wbg_buffer_b7b08af79b0b0974=function(t){const n=s(t).buffer;return h(n)},e.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(t,n,i){const r=new Uint8Array(s(t),n>>>0,i>>>0);return h(r)},e.wbg.__wbg_length_8339fcf5d8ecd12e=function(t){return s(t).length},e.wbg.__wbg_new_ea1883e1e5e86686=function(t){const n=new Uint8Array(s(t));return h(n)},e.wbg.__wbg_set_d1e79e2388520f18=function(t,n,i){s(t).set(s(n),i>>>0)},e.wbg.__wbg_set_eacc7d73fefaafdf=function(){return q(function(t,n,i){return Reflect.set(s(t),s(n),s(i))},arguments)},e.wbg.__wbg_self_3093d5d1f7bcb682=function(){return q(function(){const t=self.self;return h(t)},arguments)},e.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return q(function(){const t=window.window;return h(t)},arguments)},e.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return q(function(){const t=globalThis.globalThis;return h(t)},arguments)},e.wbg.__wbg_global_e5a3fe56f8be9485=function(){return q(function(){const t=global.global;return h(t)},arguments)},e.wbg.__wbindgen_is_undefined=function(t){return s(t)===void 0},e.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(t,n){const i=new Function(H(t,n));return h(i)},e.wbg.__wbindgen_error_new=function(t,n){const i=new Error(H(t,n));return h(i)},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return s(t)==s(n)},e.wbg.__wbindgen_number_get=function(t,n){const i=s(n),r=typeof i=="number"?i:void 0;S().setFloat64(t+8*1,L(r)?0:r,!0),S().setInt32(t+4*0,!L(r),!0)},e.wbg.__wbg_instanceof_Uint8Array_247a91427532499e=function(t){let n;try{n=s(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902=function(t){let n;try{n=s(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_entries_7a0e06255456ebcd=function(t){const n=Object.entries(s(t));return h(n)},e.wbg.__wbg_isSafeInteger_7f1ed56200d90674=function(t){return Number.isSafeInteger(s(t))},e.wbg.__wbindgen_as_number=function(t){return+s(t)},e.wbg.__wbg_String_b9412f8799faab3e=function(t,n){const i=String(s(n)),r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_isArray_8364a5371e9737d8=function(t){return Array.isArray(s(t))},e.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(t,n){const i=s(t)[s(n)];return h(i)},e.wbg.__wbindgen_in=function(t,n){return s(t)in s(n)},e.wbg.__wbindgen_is_string=function(t){return typeof s(t)=="string"},e.wbg.__wbg_navigator_6210380287bf8581=function(t){const n=s(t).navigator;return h(n)},e.wbg.__wbg_platform_509d898d9dce4c23=function(){return q(function(t,n){const i=s(n).platform,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},arguments)},e.wbg.__wbg_previewconnector_new=function(t){const n=Wr.__wrap(t);return h(n)},e.wbg.__wbg_new_a220cf903aa02ca2=function(){const t=new Array;return h(t)},e.wbg.__wbg_set_f975102236d3c502=function(t,n,i){s(t)[_e(n)]=_e(i)},e.wbg.__wbg_set_673dda6c73d19609=function(t,n,i){s(t)[n>>>0]=_e(i)},e.wbg.__wbg_new_8608a2b51a5f6737=function(){return h(new Map)},e.wbg.__wbg_set_49185437f0ab06f8=function(t,n,i){const r=s(t).set(s(n),s(i));return h(r)},e.wbg.__wbindgen_bigint_from_u64=function(t){const n=BigInt.asUintN(64,t);return h(n)},e.wbg.__wbindgen_bigint_from_i64=function(t){return h(t)},e.wbg.__wbg_new_b85e72ed1bfd57f9=function(t,n){try{var i={a:t,b:n},r=(c,a)=>{const l=i.a;i.a=0;try{return uo(l,i.b,c,a)}finally{i.a=l}};const o=new Promise(r);return h(o)}finally{i.a=i.b=0}},e.wbg.__wbindgen_is_bigint=function(t){return typeof s(t)=="bigint"},e.wbg.__wbindgen_bigint_get_as_i64=function(t,n){const i=s(n),r=typeof i=="bigint"?i:void 0;S().setBigInt64(t+8*1,L(r)?BigInt(0):r,!0),S().setInt32(t+4*0,!L(r),!0)},e.wbg.__wbindgen_jsval_eq=function(t,n){return s(t)===s(n)},e.wbg.__wbg_instanceof_Map_763ce0e95960d55e=function(t){let n;try{n=s(t)instanceof Map}catch{n=!1}return n},e.wbg.__wbindgen_throw=function(t,n){throw new Error(H(t,n))},e.wbg.__wbindgen_debug_string=function(t,n){const i=Lr(s(n)),r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(t){const n=s(t).queueMicrotask;return h(n)},e.wbg.__wbg_resolve_570458cb99d56a43=function(t){const n=Promise.resolve(s(t));return h(n)},e.wbg.__wbg_then_876bb3c633745cc6=function(t,n,i){const r=s(t).then(s(n),s(i));return h(r)},e.wbg.__wbg_then_95e6edc0f89b73b1=function(t,n){const i=s(t).then(s(n));return h(i)},e.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(t){queueMicrotask(s(t))},e.wbg.__wbg_getExtension_095ef1e6c9d8d8ab=function(){return q(function(t,n,i){const r=s(t).getExtension(H(n,i));return L(r)?0:h(r)},arguments)},e.wbg.__wbg_matchMedia_170d35fd154463b2=function(){return q(function(t,n,i){const r=s(t).matchMedia(H(n,i));return L(r)?0:h(r)},arguments)},e.wbg.__wbg_cancelAnimationFrame_f80ecdad075d1d55=function(){return q(function(t,n){s(t).cancelAnimationFrame(n)},arguments)},e.wbg.__wbg_setTimeout_2bb9dfe810e45e24=function(){return q(function(t,n){return s(t).setTimeout(s(n))},arguments)},e.wbg.__wbg_createElement_5921e9eb06b9ec89=function(){return q(function(t,n,i){const r=s(t).createElement(H(n,i));return h(r)},arguments)},e.wbg.__wbg_matches_212d57a200ff58f8=function(){return q(function(t,n,i){return s(t).matches(H(n,i))},arguments)},e.wbg.__wbg_setAttribute_d5540a19be09f8dc=function(){return q(function(t,n,i,r,o){s(t).setAttribute(H(n,i),H(r,o))},arguments)},e.wbg.__wbg_focus_06621101cc79f5d8=function(){return q(function(t){s(t).focus()},arguments)},e.wbg.__wbg_fillText_ae0445d1930428dd=function(){return q(function(t,n,i,r,o){s(t).fillText(H(n,i),r,o)},arguments)},e.wbg.__wbg_getContext_69ec873410cbba3c=function(){return q(function(t,n,i){const r=s(t).getContext(H(n,i));return L(r)?0:h(r)},arguments)},e.wbg.__wbg_addListener_7d72b16c4161a20a=function(){return q(function(t,n){s(t).addListener(s(n))},arguments)},e.wbg.__wbg_setProperty_ff389e5a7fb9910e=function(){return q(function(t,n,i,r,o){s(t).setProperty(H(n,i),H(r,o))},arguments)},e.wbg.__wbg_revokeObjectURL_b9b370890a354a9f=function(){return q(function(t,n){URL.revokeObjectURL(H(t,n))},arguments)},e.wbg.__wbg_instanceof_Window_5012736c80a01584=function(t){let n;try{n=s(t)instanceof Window}catch{n=!1}return n},e.wbg.__wbg_setData_41207994e2d54785=function(){return q(function(t,n,i,r,o){s(t).setData(H(n,i),H(r,o))},arguments)},e.wbg.__wbg_addEventListener_e167f012cbedfa4e=function(){return q(function(t,n,i,r){s(t).addEventListener(H(n,i),s(r))},arguments)},e.wbg.__wbg_removeEventListener_b6cef5ad085bea8f=function(){return q(function(t,n,i,r){s(t).removeEventListener(H(n,i),s(r))},arguments)},e.wbg.__wbg_postMessage_6eeb375bc13e8ec8=function(){return q(function(t,n){s(t).postMessage(s(n))},arguments)},e.wbg.__wbg_data_ee8c1a738c70cbe1=function(t,n){const i=s(n).data;var r=L(i)?0:Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_new_ebf2727385ee825c=function(){return q(function(){const t=new AbortController;return h(t)},arguments)},e.wbg.__wbg_new_40ff2b042829bc58=function(){return q(function(){const t=new MessageChannel;return h(t)},arguments)},e.wbg.__wbg_performance_a1b8bde2ee512264=function(t){const n=s(t).performance;return h(n)},e.wbg.__wbg_now_abd80e969af37148=function(t){return s(t).now()},e.wbg.__wbg_movementX_ecd0c638be0899eb=function(t){return s(t).movementX},e.wbg.__wbg_movementY_3064817f736e8151=function(t){return s(t).movementY},e.wbg.__wbg_scheduler_7ccf2d3b362018c4=function(t){const n=s(t).scheduler;return h(n)},e.wbg.__wbg_signal_41e46ccad44bb5e2=function(t){const n=s(t).signal;return h(n)},e.wbg.__wbg_postTask_99464245f349be5a=function(t,n,i){const r=s(t).postTask(s(n),s(i));return h(r)},e.wbg.__wbg_catch_a279b1da46d132d8=function(t,n){const i=s(t).catch(s(n));return h(i)},e.wbg.__wbg_port1_9e11ba1fe63adb21=function(t){const n=s(t).port1;return h(n)},e.wbg.__wbg_setonmessage_3b07505d5f934b5c=function(t,n){s(t).onmessage=s(n)},e.wbg.__wbg_start_f642a950f6c98a0e=function(t){s(t).start()},e.wbg.__wbg_port2_7d887905fa4a6677=function(t){const n=s(t).port2;return h(n)},e.wbg.__wbg_requestIdleCallback_af997f1fdcadcc54=function(){return q(function(t,n){return s(t).requestIdleCallback(s(n))},arguments)},e.wbg.__wbg_setTimeout_73b734ca971c19f4=function(){return q(function(t,n,i){return s(t).setTimeout(s(n),i)},arguments)},e.wbg.__wbg_of_99c2a118200b1e62=function(t,n){const i=Array.of(s(t),s(n));return h(i)},e.wbg.__wbg_of_4a1c869ef05b4b73=function(t){const n=Array.of(s(t));return h(n)},e.wbg.__wbg_postMessage_b651e498e4c6dbf5=function(){return q(function(t,n,i){s(t).postMessage(s(n),s(i))},arguments)},e.wbg.__wbg_pointerId_37ae0c4682f85248=function(t){return s(t).pointerId},e.wbg.__wbg_matches_42eb40a28a316d0e=function(t){return s(t).matches},e.wbg.__wbg_contentRect_c1a9045c459744d9=function(t){const n=s(t).contentRect;return h(n)},e.wbg.__wbg_width_e7964a50b174d035=function(t){return s(t).width},e.wbg.__wbg_height_cd5c897b4d3fabe3=function(t){return s(t).height},e.wbg.__wbg_devicePixelContentBoxSize_8d531ca6a4331b28=function(t){const n=s(t).devicePixelContentBoxSize;return h(n)},e.wbg.__wbg_inlineSize_322ab111c2b5c9e3=function(t){return s(t).inlineSize},e.wbg.__wbg_blockSize_981c4dfa6e1263a8=function(t){return s(t).blockSize},e.wbg.__wbg_pointerType_d375491a3013a9bc=function(t,n){const i=s(n).pointerType,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_pressure_95cee3909a8549a9=function(t){return s(t).pressure},e.wbg.__wbg_persisted_6483200f25cdfed4=function(t){return s(t).persisted},e.wbg.__wbg_isIntersecting_7cba11b732bde6a7=function(t){return s(t).isIntersecting},e.wbg.__wbg_buttons_a302533e27733599=function(t){return s(t).buttons},e.wbg.__wbg_setPointerCapture_16fb4f004fe3aaae=function(){return q(function(t,n){s(t).setPointerCapture(n)},arguments)},e.wbg.__wbindgen_cb_drop=function(t){const n=_e(t).original;return n.cnt--==1?(n.a=0,!0):!1},e.wbg.__wbg_settype_b6ab7b74bd1908a1=function(t,n,i){s(t).type=H(n,i)},e.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da=function(){return q(function(t,n){const i=new Blob(s(t),s(n));return h(i)},arguments)},e.wbg.__wbg_createObjectURL_ca544150f40fb1bf=function(){return q(function(t,n){const i=URL.createObjectURL(s(n)),r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},arguments)},e.wbg.__wbg_prototype_d33365945f23f380=function(){const t=ResizeObserverEntry.prototype;return h(t)},e.wbg.__wbg_getOwnPropertyDescriptor_104555bb47552c24=function(t,n){const i=Object.getOwnPropertyDescriptor(s(t),s(n));return h(i)},e.wbg.__wbg_new_25d9d4e2932d816f=function(){return q(function(t,n){const i=new Worker(H(t,n));return h(i)},arguments)},e.wbg.__wbg_Window_bd9ec3fee5f673ee=function(t){const n=s(t).Window;return h(n)},e.wbg.__wbg_error_9ce09486992d3ac5=function(t,n){console.error(s(t),s(n))},e.wbg.__wbg_abort_8659d889a7877ae3=function(t){s(t).abort()},e.wbg.__wbg_cancelIdleCallback_0d1373370ef859bd=function(t,n){s(t).cancelIdleCallback(n>>>0)},e.wbg.__wbg_clearTimeout_25cdc2ed88b3c0b2=function(t,n){s(t).clearTimeout(n)},e.wbg.__wbg_close_87d69f9e9fe928c3=function(t){s(t).close()},e.wbg.__wbg_userAgentData_85a8393570ab7dee=function(t){const n=s(t).userAgentData;return L(n)?0:h(n)},e.wbg.__wbg_brands_982de08b35281a98=function(t){const n=s(t).brands;return h(n)},e.wbg.__wbg_brand_cdcf0249d44027a8=function(t,n){const i=s(n).brand,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_userAgent_58dedff4303aeb66=function(){return q(function(t,n){const i=s(n).userAgent,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},arguments)},e.wbg.__wbg_disconnect_24e89f8d65ad2fd5=function(t){s(t).disconnect()},e.wbg.__wbg_disconnect_1dbf7e19d9590abd=function(t){s(t).disconnect()},e.wbg.__wbg_cancel_cba86749f45f30ae=function(t){s(t).cancel()},e.wbg.__wbg_queueMicrotask_693514e3dcae83e6=function(t){queueMicrotask(_e(t))},e.wbg.__wbg_webkitRequestFullscreen_42ba1c34171febc6=function(t){s(t).webkitRequestFullscreen()},e.wbg.__wbg_requestFullscreen_24891df6120b675d=function(t){const n=s(t).requestFullscreen();return h(n)},e.wbg.__wbg_webkitFullscreenElement_a02341d57a641b43=function(t){const n=s(t).webkitFullscreenElement;return L(n)?0:h(n)},e.wbg.__wbg_fullscreenElement_027a4ad195839d29=function(t){const n=s(t).fullscreenElement;return L(n)?0:h(n)},e.wbg.__wbg_is_009b1ef508712fda=function(t,n){return Object.is(s(t),s(n))},e.wbg.__wbg_animate_b321da85ed3f2b4a=function(t,n,i){const r=s(t).animate(s(n),s(i));return h(r)},e.wbg.__wbg_play_5896e5851ba90aa2=function(t){s(t).play()},e.wbg.__wbg_removeListener_0ff79f74b9d808ac=function(){return q(function(t,n){s(t).removeListener(s(n))},arguments)},e.wbg.__wbg_contains_4f87c5405416b4fd=function(t,n){return s(t).contains(s(n))},e.wbg.__wbg_unobserve_e67452df241a602d=function(t,n){s(t).unobserve(s(n))},e.wbg.__wbg_observe_101f5cf5a11e9a79=function(t,n){s(t).observe(s(n))},e.wbg.__wbg_webkitExitFullscreen_77a6c8d07ec6ee46=function(t){s(t).webkitExitFullscreen()},e.wbg.__wbg_exitFullscreen_3b8893467fd80879=function(t){s(t).exitFullscreen()},e.wbg.__wbg_getPropertyValue_b0f0858c3b5f17dd=function(){return q(function(t,n,i,r){const o=s(n).getPropertyValue(H(i,r)),c=Q(o,R.__wbindgen_malloc,R.__wbindgen_realloc),a=V;S().setInt32(t+4*1,a,!0),S().setInt32(t+4*0,c,!0)},arguments)},e.wbg.__wbg_removeProperty_cfd836a4f7e5e86e=function(){return q(function(t,n,i,r){const o=s(n).removeProperty(H(i,r)),c=Q(o,R.__wbindgen_malloc,R.__wbindgen_realloc),a=V;S().setInt32(t+4*1,a,!0),S().setInt32(t+4*0,c,!0)},arguments)},e.wbg.__wbg_visibilityState_51f5bb37c843e94e=function(t){const n=s(t).visibilityState;return{hidden:0,visible:1}[n]??2},e.wbg.__wbg_body_b3bb488e8e54bf4b=function(t){const n=s(t).body;return L(n)?0:h(n)},e.wbg.__wbg_appendChild_ac45d1abddf1b89b=function(){return q(function(t,n){const i=s(t).appendChild(s(n));return h(i)},arguments)},e.wbg.__wbg_getComputedStyle_ba4609b39055f674=function(){return q(function(t,n){const i=s(t).getComputedStyle(s(n));return L(i)?0:h(i)},arguments)},e.wbg.__wbg_activeElement_1036a8ddc10ec3f1=function(t){const n=s(t).activeElement;return L(n)?0:h(n)},e.wbg.__wbg_new_42acb42ec2ace97c=function(){return q(function(t){const n=new ResizeObserver(s(t));return h(n)},arguments)},e.wbg.__wbg_setbox_0d838a2d268b7fac=function(t,n){s(t).box=["border-box","content-box","device-pixel-content-box"][n]},e.wbg.__wbg_observe_60f3631b2f7c6d8b=function(t,n,i){s(t).observe(s(n),s(i))},e.wbg.__wbg_new_d0c6c2df51a6d903=function(){return q(function(t){const n=new IntersectionObserver(s(t));return h(n)},arguments)},e.wbg.__wbg_observe_c901133fbef21560=function(t,n){s(t).observe(s(n))},e.wbg.__wbg_getBoundingClientRect_35fc4d8fa10e0463=function(t){const n=s(t).getBoundingClientRect();return h(n)},e.wbg.__wbg_x_a79a5b516ee71e4c=function(t){return s(t).x},e.wbg.__wbg_y_bd4e2c0613413655=function(t){return s(t).y},e.wbg.__wbg_requestAnimationFrame_b4b782250b9c2c88=function(){return q(function(t,n){return s(t).requestAnimationFrame(s(n))},arguments)},e.wbg.__wbg_scheduler_f38a681d98b5a776=function(t){const n=s(t).scheduler;return h(n)},e.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(t){const n=s(t).getCoalescedEvents;return h(n)},e.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(t){const n=s(t).requestIdleCallback;return h(n)},e.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(t){const n=s(t).requestFullscreen;return h(n)},e.wbg.__wbg_button_460cdec9f2512a91=function(t){return s(t).button},e.wbg.__wbg_offsetX_294898d040917c6b=function(t){return s(t).offsetX},e.wbg.__wbg_offsetY_f484804b7b03dd86=function(t){return s(t).offsetY},e.wbg.__wbg_deltaX_7f4a9de8338c7ca6=function(t){return s(t).deltaX},e.wbg.__wbg_deltaY_606f12aa66daba69=function(t){return s(t).deltaY},e.wbg.__wbg_deltaMode_d6b849e45efd0f5e=function(t){return s(t).deltaMode},e.wbg.__wbg_code_01dc6af887ca9ecb=function(t,n){const i=s(n).code,r=Q(i,R.__wbindgen_malloc,R.__wbindgen_realloc),o=V;S().setInt32(t+4*1,o,!0),S().setInt32(t+4*0,r,!0)},e.wbg.__wbg_location_d7fe3090ad7e80d7=function(t){return s(t).location},e.wbg.__wbg_metaKey_00fdcfadf1968d45=function(t){return s(t).metaKey},e.wbg.__wbg_shiftKey_8c0f9a5ca3ff8f93=function(t){return s(t).shiftKey},e.wbg.__wbg_ctrlKey_957c6c31b62b4550=function(t){return s(t).ctrlKey},e.wbg.__wbg_altKey_d3fbce7596aac8cf=function(t){return s(t).altKey},e.wbg.__wbg_metaKey_be0158b14b1cef4a=function(t){return s(t).metaKey},e.wbg.__wbg_getCoalescedEvents_bf1c46ef1a01dcce=function(t){const n=s(t).getCoalescedEvents();return h(n)},e.wbg.__wbindgen_closure_wrapper4161=function(t,n,i){const r=Yt(t,n,1618,Kt);return h(r)},e.wbg.__wbindgen_closure_wrapper4163=function(t,n,i){const r=Yt(t,n,1618,Kt);return h(r)},e.wbg.__wbindgen_closure_wrapper4164=function(t,n,i){const r=Yt(t,n,1618,Kt);return h(r)},e.wbg.__wbindgen_closure_wrapper4165=function(t,n,i){const r=Yt(t,n,1618,Kt);return h(r)},e.wbg.__wbindgen_closure_wrapper4166=function(t,n,i){const r=Yt(t,n,1618,Kt);return h(r)},e.wbg.__wbindgen_closure_wrapper6477=function(t,n,i){const r=Me(t,n,1844,ao);return h(r)},e.wbg.__wbindgen_closure_wrapper12139=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e.wbg.__wbindgen_closure_wrapper13307=function(t,n,i){const r=Me(t,n,1844,ao);return h(r)},e.wbg.__wbindgen_closure_wrapper13344=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e.wbg.__wbindgen_closure_wrapper13356=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e.wbg.__wbindgen_closure_wrapper13362=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e.wbg.__wbindgen_closure_wrapper13373=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e.wbg.__wbindgen_closure_wrapper13387=function(t,n,i){const r=Me(t,n,1844,uo);return h(r)},e.wbg.__wbindgen_closure_wrapper13411=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e.wbg.__wbindgen_closure_wrapper13416=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e.wbg.__wbindgen_closure_wrapper13438=function(t,n,i){const r=Me(t,n,1844,Ge);return h(r)},e}function Fc(e,t){return R=e.exports,go.__wbindgen_wasm_module=t,_t=null,Gt=null,Qt=null,R}async function go(e){if(R!==void 0)return R;typeof e<"u"&&Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead"),typeof e>"u"&&(e=new URL(""+new URL("slint_lsp_wasm_bg-CQ1FUJ6d.wasm",self.location.href).href,self.location.href));const t=jc();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:i}=await Nc(await e,t);return Fc(n,i)}var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ic(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}var _o={},$r={},Be={},ce={},bt={},xr={},zr={},O={},we={},bo;function Zt(){if(bo)return we;bo=1,Object.defineProperty(we,"__esModule",{value:!0}),we.stringArray=we.array=we.func=we.error=we.number=we.string=we.boolean=void 0;function e(a){return a===!0||a===!1}we.boolean=e;function t(a){return typeof a=="string"||a instanceof String}we.string=t;function n(a){return typeof a=="number"||a instanceof Number}we.number=n;function i(a){return a instanceof Error}we.error=i;function r(a){return typeof a=="function"}we.func=r;function o(a){return Array.isArray(a)}we.array=o;function c(a){return o(a)&&a.every(l=>t(l))}return we.stringArray=c,we}var ho;function mo(){if(ho)return O;ho=1,Object.defineProperty(O,"__esModule",{value:!0}),O.Message=O.NotificationType9=O.NotificationType8=O.NotificationType7=O.NotificationType6=O.NotificationType5=O.NotificationType4=O.NotificationType3=O.NotificationType2=O.NotificationType1=O.NotificationType0=O.NotificationType=O.RequestType9=O.RequestType8=O.RequestType7=O.RequestType6=O.RequestType5=O.RequestType4=O.RequestType3=O.RequestType2=O.RequestType1=O.RequestType=O.RequestType0=O.AbstractMessageSignature=O.ParameterStructures=O.ResponseError=O.ErrorCodes=void 0;const e=Zt();var t;(function(j){j.ParseError=-32700,j.InvalidRequest=-32600,j.MethodNotFound=-32601,j.InvalidParams=-32602,j.InternalError=-32603,j.jsonrpcReservedErrorRangeStart=-32099,j.serverErrorStart=-32099,j.MessageWriteError=-32099,j.MessageReadError=-32098,j.PendingResponseRejected=-32097,j.ConnectionInactive=-32096,j.ServerNotInitialized=-32002,j.UnknownErrorCode=-32001,j.jsonrpcReservedErrorRangeEnd=-32e3,j.serverErrorEnd=-32e3})(t||(O.ErrorCodes=t={}));class n extends Error{constructor(b,N,A){super(N),this.code=e.number(b)?b:t.UnknownErrorCode,this.data=A,Object.setPrototypeOf(this,n.prototype)}toJson(){const b={code:this.code,message:this.message};return this.data!==void 0&&(b.data=this.data),b}}O.ResponseError=n;class i{constructor(b){this.kind=b}static is(b){return b===i.auto||b===i.byName||b===i.byPosition}toString(){return this.kind}}O.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");class r{constructor(b,N){this.method=b,this.numberOfParams=N}get parameterStructures(){return i.auto}}O.AbstractMessageSignature=r;class o extends r{constructor(b){super(b,0)}}O.RequestType0=o;class c extends r{constructor(b,N=i.auto){super(b,1),this._parameterStructures=N}get parameterStructures(){return this._parameterStructures}}O.RequestType=c;class a extends r{constructor(b,N=i.auto){super(b,1),this._parameterStructures=N}get parameterStructures(){return this._parameterStructures}}O.RequestType1=a;class l extends r{constructor(b){super(b,2)}}O.RequestType2=l;class f extends r{constructor(b){super(b,3)}}O.RequestType3=f;class _ extends r{constructor(b){super(b,4)}}O.RequestType4=_;class p extends r{constructor(b){super(b,5)}}O.RequestType5=p;class v extends r{constructor(b){super(b,6)}}O.RequestType6=v;class D extends r{constructor(b){super(b,7)}}O.RequestType7=D;class C extends r{constructor(b){super(b,8)}}O.RequestType8=C;class J extends r{constructor(b){super(b,9)}}O.RequestType9=J;class Y extends r{constructor(b,N=i.auto){super(b,1),this._parameterStructures=N}get parameterStructures(){return this._parameterStructures}}O.NotificationType=Y;class W extends r{constructor(b){super(b,0)}}O.NotificationType0=W;class m extends r{constructor(b,N=i.auto){super(b,1),this._parameterStructures=N}get parameterStructures(){return this._parameterStructures}}O.NotificationType1=m;class w extends r{constructor(b){super(b,2)}}O.NotificationType2=w;class T extends r{constructor(b){super(b,3)}}O.NotificationType3=T;class ue extends r{constructor(b){super(b,4)}}O.NotificationType4=ue;class ee extends r{constructor(b){super(b,5)}}O.NotificationType5=ee;class be extends r{constructor(b){super(b,6)}}O.NotificationType6=be;class ct extends r{constructor(b){super(b,7)}}O.NotificationType7=ct;class Le extends r{constructor(b){super(b,8)}}O.NotificationType8=Le;class at extends r{constructor(b){super(b,9)}}O.NotificationType9=at;var me;return function(j){function b(E){const x=E;return x&&e.string(x.method)&&(e.string(x.id)||e.number(x.id))}j.isRequest=b;function N(E){const x=E;return x&&e.string(x.method)&&E.id===void 0}j.isNotification=N;function A(E){const x=E;return x&&(x.result!==void 0||!!x.error)&&(e.string(x.id)||e.number(x.id)||x.id===null)}j.isResponse=A}(me||(O.Message=me={})),O}var Ue={},wo;function po(){if(wo)return Ue;wo=1;var e;Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.LRUCache=Ue.LinkedMap=Ue.Touch=void 0;var t;(function(r){r.None=0,r.First=1,r.AsOld=r.First,r.Last=2,r.AsNew=r.Last})(t||(Ue.Touch=t={}));class n{constructor(){this[e]="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(o){return this._map.has(o)}get(o,c=t.None){const a=this._map.get(o);if(a)return c!==t.None&&this.touch(a,c),a.value}set(o,c,a=t.None){let l=this._map.get(o);if(l)l.value=c,a!==t.None&&this.touch(l,a);else{switch(l={key:o,value:c,next:void 0,previous:void 0},a){case t.None:this.addItemLast(l);break;case t.First:this.addItemFirst(l);break;case t.Last:this.addItemLast(l);break;default:this.addItemLast(l);break}this._map.set(o,l),this._size++}return this}delete(o){return!!this.remove(o)}remove(o){const c=this._map.get(o);if(c)return this._map.delete(o),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const o=this._head;return this._map.delete(o.key),this.removeItem(o),this._size--,o.value}forEach(o,c){const a=this._state;let l=this._head;for(;l;){if(c?o.bind(c)(l.value,l.key,this):o(l.value,l.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");l=l.next}}keys(){const o=this._state;let c=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==o)throw new Error("LinkedMap got modified during iteration.");if(c){const l={value:c.key,done:!1};return c=c.next,l}else return{value:void 0,done:!0}}};return a}values(){const o=this._state;let c=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==o)throw new Error("LinkedMap got modified during iteration.");if(c){const l={value:c.value,done:!1};return c=c.next,l}else return{value:void 0,done:!0}}};return a}entries(){const o=this._state;let c=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==o)throw new Error("LinkedMap got modified during iteration.");if(c){const l={value:[c.key,c.value],done:!1};return c=c.next,l}else return{value:void 0,done:!0}}};return a}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(o){if(o>=this.size)return;if(o===0){this.clear();return}let c=this._head,a=this.size;for(;c&&a>o;)this._map.delete(c.key),c=c.next,a--;this._head=c,this._size=a,c&&(c.previous=void 0),this._state++}addItemFirst(o){if(!this._head&&!this._tail)this._tail=o;else if(this._head)o.next=this._head,this._head.previous=o;else throw new Error("Invalid list");this._head=o,this._state++}addItemLast(o){if(!this._head&&!this._tail)this._head=o;else if(this._tail)o.previous=this._tail,this._tail.next=o;else throw new Error("Invalid list");this._tail=o,this._state++}removeItem(o){if(o===this._head&&o===this._tail)this._head=void 0,this._tail=void 0;else if(o===this._head){if(!o.next)throw new Error("Invalid list");o.next.previous=void 0,this._head=o.next}else if(o===this._tail){if(!o.previous)throw new Error("Invalid list");o.previous.next=void 0,this._tail=o.previous}else{const c=o.next,a=o.previous;if(!c||!a)throw new Error("Invalid list");c.previous=a,a.next=c}o.next=void 0,o.previous=void 0,this._state++}touch(o,c){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(c!==t.First&&c!==t.Last)){if(c===t.First){if(o===this._head)return;const a=o.next,l=o.previous;o===this._tail?(l.next=void 0,this._tail=l):(a.previous=l,l.next=a),o.previous=void 0,o.next=this._head,this._head.previous=o,this._head=o,this._state++}else if(c===t.Last){if(o===this._tail)return;const a=o.next,l=o.previous;o===this._head?(a.previous=void 0,this._head=a):(a.previous=l,l.next=a),o.next=void 0,o.previous=this._tail,this._tail.next=o,this._tail=o,this._state++}}}toJSON(){const o=[];return this.forEach((c,a)=>{o.push([a,c])}),o}fromJSON(o){this.clear();for(const[c,a]of o)this.set(c,a)}}Ue.LinkedMap=n;class i extends n{constructor(o,c=1){super(),this._limit=o,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(o){this._limit=o,this.checkTrim()}get ratio(){return this._ratio}set ratio(o){this._ratio=Math.min(Math.max(0,o),1),this.checkTrim()}get(o,c=t.AsNew){return super.get(o,c)}peek(o){return super.get(o,t.None)}set(o,c){return super.set(o,c,t.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return Ue.LRUCache=i,Ue}var en={},yo;function Ac(){if(yo)return en;yo=1,Object.defineProperty(en,"__esModule",{value:!0}),en.Disposable=void 0;var e;return function(t){function n(i){return{dispose:i}}t.create=n}(e||(en.Disposable=e={})),en}var ht={},On={},vo;function mt(){if(vo)return On;vo=1,Object.defineProperty(On,"__esModule",{value:!0});let e;function t(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}return function(n){function i(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");e=r}n.install=i}(t||(t={})),On.default=t,On}var Ro;function tn(){if(Ro)return ht;Ro=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.Emitter=ht.Event=void 0;const e=mt();var t;(function(r){const o={dispose(){}};r.None=function(){return o}})(t||(ht.Event=t={}));class n{add(o,c=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(o),this._contexts.push(c),Array.isArray(a)&&a.push({dispose:()=>this.remove(o,c)})}remove(o,c=null){if(!this._callbacks)return;let a=!1;for(let l=0,f=this._callbacks.length;l{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,c);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(o,c),l.dispose=i._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(l),l}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return ht.Emitter=i,i._noop=function(){},ht}var wt={},Do;function Br(){if(Do)return wt;Do=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.CancellationTokenSource=wt.CancellationToken=void 0;const e=mt(),t=Zt(),n=tn();var i;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function l(f){const _=f;return _&&(_===a.None||_===a.Cancelled||t.boolean(_.isCancellationRequested)&&!!_.onCancellationRequested)}a.is=l})(i||(wt.CancellationToken=i={}));const r=Object.freeze(function(a,l){const f=(0,e.default)().timer.setTimeout(a.bind(l),0);return{dispose(){f.dispose()}}});class o{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?r:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class c{get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}}return wt.CancellationTokenSource=c,wt}var pt={},To;function Lc(){if(To)return pt;To=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.SharedArrayReceiverStrategy=pt.SharedArraySenderStrategy=void 0;const e=Br();var t;(function(c){c.Continue=0,c.Cancelled=1})(t||(t={}));class n{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const l=new SharedArrayBuffer(4),f=new Int32Array(l,0,1);f[0]=t.Continue,this.buffers.set(a.id,l),a.$cancellationData=l}async sendCancellation(a,l){const f=this.buffers.get(l);if(f===void 0)return;const _=new Int32Array(f,0,1);Atomics.store(_,0,t.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}pt.SharedArraySenderStrategy=n;class i{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===t.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class r{constructor(a){this.token=new i(a)}cancel(){}dispose(){}}class o{constructor(){this.kind="request"}createCancellationTokenSource(a){const l=a.$cancellationData;return l===void 0?new e.CancellationTokenSource:new r(l)}}return pt.SharedArrayReceiverStrategy=o,pt}var Ve={},nn={},ko;function Po(){if(ko)return nn;ko=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.Semaphore=void 0;const e=mt();class t{constructor(i=1){if(i<=0)throw new Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((r,o)=>{this._waiting.push({thunk:i,resolve:r,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const r=i.thunk();r instanceof Promise?r.then(o=>{this._active--,i.resolve(o),this.runNext()},o=>{this._active--,i.reject(o),this.runNext()}):(this._active--,i.resolve(r),this.runNext())}catch(r){this._active--,i.reject(r),this.runNext()}}}return nn.Semaphore=t,nn}var So;function Wc(){if(So)return Ve;So=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.ReadableStreamMessageReader=Ve.AbstractMessageReader=Ve.MessageReader=void 0;const e=mt(),t=Zt(),n=tn(),i=Po();var r;(function(l){function f(_){let p=_;return p&&t.func(p.listen)&&t.func(p.dispose)&&t.func(p.onError)&&t.func(p.onClose)&&t.func(p.onPartialMessage)}l.is=f})(r||(Ve.MessageReader=r={}));class o{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${t.string(f.message)?f.message:"unknown"}`)}}Ve.AbstractMessageReader=o;var c;(function(l){function f(_){let p,v;const D=new Map;let C;const J=new Map;if(_===void 0||typeof _=="string")p=_??"utf-8";else{if(p=_.charset??"utf-8",_.contentDecoder!==void 0&&(v=_.contentDecoder,D.set(v.name,v)),_.contentDecoders!==void 0)for(const Y of _.contentDecoders)D.set(Y.name,Y);if(_.contentTypeDecoder!==void 0&&(C=_.contentTypeDecoder,J.set(C.name,C)),_.contentTypeDecoders!==void 0)for(const Y of _.contentTypeDecoders)J.set(Y.name,Y)}return C===void 0&&(C=(0,e.default)().applicationJson.decoder,J.set(C.name,C)),{charset:p,contentDecoder:v,contentDecoders:D,contentTypeDecoder:C,contentTypeDecoders:J}}l.fromOptions=f})(c||(c={}));class a extends o{constructor(f,_){super(),this.readable=f,this.options=c.fromOptions(_),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const _=this.readable.onData(p=>{this.onData(p)});return this.readable.onError(p=>this.fireError(p)),this.readable.onClose(()=>this.fireClose()),_}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const p=this.buffer.tryReadHeaders(!0);if(!p)return;const v=p.get("content-length");if(!v){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(p))}`));return}const D=parseInt(v);if(isNaN(D)){this.fireError(new Error(`Content-Length value must be a number. Got ${v}`));return}this.nextMessageLength=D}const _=this.buffer.tryReadBody(this.nextMessageLength);if(_===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const p=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(_):_,v=await this.options.contentTypeDecoder.decode(p,this.options);this.callback(v)}).catch(p=>{this.fireError(p)})}}catch(_){this.fireError(_)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,_)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:_}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return Ve.ReadableStreamMessageReader=a,Ve}var Je={},Co;function Hc(){if(Co)return Je;Co=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.WriteableStreamMessageWriter=Je.AbstractMessageWriter=Je.MessageWriter=void 0;const e=mt(),t=Zt(),n=Po(),i=tn(),r="Content-Length: ",o=`\r +`;var c;(function(_){function p(v){let D=v;return D&&t.func(D.dispose)&&t.func(D.onClose)&&t.func(D.onError)&&t.func(D.write)}_.is=p})(c||(Je.MessageWriter=c={}));class a{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p,v,D){this.errorEmitter.fire([this.asError(p),v,D])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(p){return p instanceof Error?p:new Error(`Writer received error. Reason: ${t.string(p.message)?p.message:"unknown"}`)}}Je.AbstractMessageWriter=a;var l;(function(_){function p(v){return v===void 0||typeof v=="string"?{charset:v??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:v.charset??"utf-8",contentEncoder:v.contentEncoder,contentTypeEncoder:v.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}_.fromOptions=p})(l||(l={}));class f extends a{constructor(p,v){super(),this.writable=p,this.options=l.fromOptions(v),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(D=>this.fireError(D)),this.writable.onClose(()=>this.fireClose())}async write(p){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(p,this.options).then(D=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(D):D).then(D=>{const C=[];return C.push(r,D.byteLength.toString(),o),C.push(o),this.doWrite(p,C,D)},D=>{throw this.fireError(D),D}))}async doWrite(p,v,D){try{return await this.writable.write(v.join(""),"ascii"),this.writable.write(D)}catch(C){return this.handleError(C,p),Promise.reject(C)}}handleError(p,v){this.errorCount++,this.fireError(p,v,this.errorCount)}end(){this.writable.end()}}return Je.WriteableStreamMessageWriter=f,Je}var rn={},qo;function $c(){if(qo)return rn;qo=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.AbstractMessageBuffer=void 0;const e=13,t=10,n=`\r +`;class i{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const c=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(c),this._totalLength+=c.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let c=0,a=0,l=0,f=0;e:for(;athis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const f=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(f)}if(this._chunks[0].byteLength>o){const f=this._chunks[0],_=this.asNative(f,o);return this._chunks[0]=f.slice(o),this._totalLength-=o,_}const c=this.allocNative(o);let a=0,l=0;for(;o>0;){const f=this._chunks[l];if(f.byteLength>o){const _=f.slice(0,o);c.set(_,a),a+=o,this._chunks[l]=f.slice(o),this._totalLength-=o,o-=o}else c.set(f,a),a+=f.byteLength,this._chunks.shift(),this._totalLength-=f.byteLength,o-=f.byteLength}return c}}return rn.AbstractMessageBuffer=i,rn}var Ur={},Mo;function xc(){return Mo||(Mo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;const t=mt(),n=Zt(),i=mo(),r=po(),o=tn(),c=Br();var a;(function(b){b.type=new i.NotificationType("$/cancelRequest")})(a||(a={}));var l;(function(b){function N(A){return typeof A=="string"||typeof A=="number"}b.is=N})(l||(e.ProgressToken=l={}));var f;(function(b){b.type=new i.NotificationType("$/progress")})(f||(f={}));class _{constructor(){}}e.ProgressType=_;var p;(function(b){function N(A){return n.func(A)}b.is=N})(p||(p={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var v;(function(b){b[b.Off=0]="Off",b[b.Messages=1]="Messages",b[b.Compact=2]="Compact",b[b.Verbose=3]="Verbose"})(v||(e.Trace=v={}));var D;(function(b){b.Off="off",b.Messages="messages",b.Compact="compact",b.Verbose="verbose"})(D||(e.TraceValues=D={})),function(b){function N(E){if(!n.string(E))return b.Off;switch(E=E.toLowerCase(),E){case"off":return b.Off;case"messages":return b.Messages;case"compact":return b.Compact;case"verbose":return b.Verbose;default:return b.Off}}b.fromString=N;function A(E){switch(E){case b.Off:return"off";case b.Messages:return"messages";case b.Compact:return"compact";case b.Verbose:return"verbose";default:return"off"}}b.toString=A}(v||(e.Trace=v={}));var C;(function(b){b.Text="text",b.JSON="json"})(C||(e.TraceFormat=C={})),function(b){function N(A){return n.string(A)?(A=A.toLowerCase(),A==="json"?b.JSON:b.Text):b.Text}b.fromString=N}(C||(e.TraceFormat=C={}));var J;(function(b){b.type=new i.NotificationType("$/setTrace")})(J||(e.SetTraceNotification=J={}));var Y;(function(b){b.type=new i.NotificationType("$/logTrace")})(Y||(e.LogTraceNotification=Y={}));var W;(function(b){b[b.Closed=1]="Closed",b[b.Disposed=2]="Disposed",b[b.AlreadyListening=3]="AlreadyListening"})(W||(e.ConnectionErrors=W={}));class m extends Error{constructor(N,A){super(A),this.code=N,Object.setPrototypeOf(this,m.prototype)}}e.ConnectionError=m;var w;(function(b){function N(A){const E=A;return E&&n.func(E.cancelUndispatched)}b.is=N})(w||(e.ConnectionStrategy=w={}));var T;(function(b){function N(A){const E=A;return E&&(E.kind===void 0||E.kind==="id")&&n.func(E.createCancellationTokenSource)&&(E.dispose===void 0||n.func(E.dispose))}b.is=N})(T||(e.IdCancellationReceiverStrategy=T={}));var ue;(function(b){function N(A){const E=A;return E&&E.kind==="request"&&n.func(E.createCancellationTokenSource)&&(E.dispose===void 0||n.func(E.dispose))}b.is=N})(ue||(e.RequestCancellationReceiverStrategy=ue={}));var ee;(function(b){b.Message=Object.freeze({createCancellationTokenSource(A){return new c.CancellationTokenSource}});function N(A){return T.is(A)||ue.is(A)}b.is=N})(ee||(e.CancellationReceiverStrategy=ee={}));var be;(function(b){b.Message=Object.freeze({sendCancellation(A,E){return A.sendNotification(a.type,{id:E})},cleanup(A){}});function N(A){const E=A;return E&&n.func(E.sendCancellation)&&n.func(E.cleanup)}b.is=N})(be||(e.CancellationSenderStrategy=be={}));var ct;(function(b){b.Message=Object.freeze({receiver:ee.Message,sender:be.Message});function N(A){const E=A;return E&&ee.is(E.receiver)&&be.is(E.sender)}b.is=N})(ct||(e.CancellationStrategy=ct={}));var Le;(function(b){function N(A){const E=A;return E&&n.func(E.handleMessage)}b.is=N})(Le||(e.MessageStrategy=Le={}));var at;(function(b){function N(A){const E=A;return E&&(ct.is(E.cancellationStrategy)||w.is(E.connectionStrategy)||Le.is(E.messageStrategy))}b.is=N})(at||(e.ConnectionOptions=at={}));var me;(function(b){b[b.New=1]="New",b[b.Listening=2]="Listening",b[b.Closed=3]="Closed",b[b.Disposed=4]="Disposed"})(me||(me={}));function j(b,N,A,E){const x=A!==void 0?A:e.NullLogger;let mr=0,wr=0,pr=0;const ut="2.0";let dt;const Tt=new Map;let lt;const kt=new Map,Pt=new Map;let Ut,We=new r.LinkedMap,He=new Map,St=new Set,qe=new Map,K=v.Off,$e=C.Text,oe,Ee=me.New;const Vt=new o.Emitter,hn=new o.Emitter,mn=new o.Emitter,wn=new o.Emitter,pn=new o.Emitter,Ne=E&&E.cancellationStrategy?E.cancellationStrategy:ct.Message;function yn(d){if(d===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+d.toString()}function yr(d){return d===null?"res-unknown-"+(++pr).toString():"res-"+d.toString()}function vr(){return"not-"+(++wr).toString()}function Rr(d,y){i.Message.isRequest(y)?d.set(yn(y.id),y):i.Message.isResponse(y)?d.set(yr(y.id),y):d.set(vr(),y)}function Dr(d){}function vn(){return Ee===me.Listening}function Rn(){return Ee===me.Closed}function Ye(){return Ee===me.Disposed}function Dn(){(Ee===me.New||Ee===me.Listening)&&(Ee=me.Closed,hn.fire(void 0))}function Tr(d){Vt.fire([d,void 0,void 0])}function kr(d){Vt.fire(d)}b.onClose(Dn),b.onError(Tr),N.onClose(Dn),N.onError(kr);function Tn(){Ut||We.size===0||(Ut=(0,t.default)().timer.setImmediate(()=>{Ut=void 0,Pr()}))}function kn(d){i.Message.isRequest(d)?Cr(d):i.Message.isNotification(d)?Mr(d):i.Message.isResponse(d)?qr(d):Or(d)}function Pr(){if(We.size===0)return;const d=We.shift();try{const y=E?.messageStrategy;Le.is(y)?y.handleMessage(d,kn):kn(d)}finally{Tn()}}const Sr=d=>{try{if(i.Message.isNotification(d)&&d.method===a.type.method){const y=d.params.id,k=yn(y),M=We.get(k);if(i.Message.isRequest(M)){const G=E?.connectionStrategy,se=G&&G.cancelUndispatched?G.cancelUndispatched(M,Dr):void 0;if(se&&(se.error!==void 0||se.result!==void 0)){We.delete(k),qe.delete(y),se.id=M.id,Ct(se,d.method,Date.now()),N.write(se).catch(()=>x.error("Sending response for canceled message failed."));return}}const Z=qe.get(y);if(Z!==void 0){Z.cancel(),Jt(d);return}else St.add(y)}Rr(We,d)}finally{Tn()}};function Cr(d){if(Ye())return;function y(B,te,X){const he={jsonrpc:ut,id:d.id};B instanceof i.ResponseError?he.error=B.toJson():he.result=B===void 0?null:B,Ct(he,te,X),N.write(he).catch(()=>x.error("Sending response failed."))}function k(B,te,X){const he={jsonrpc:ut,id:d.id,error:B.toJson()};Ct(he,te,X),N.write(he).catch(()=>x.error("Sending response failed."))}function M(B,te,X){B===void 0&&(B=null);const he={jsonrpc:ut,id:d.id,result:B};Ct(he,te,X),N.write(he).catch(()=>x.error("Sending response failed."))}jr(d);const Z=Tt.get(d.method);let G,se;Z&&(G=Z.type,se=Z.handler);const fe=Date.now();if(se||dt){const B=d.id??String(Date.now()),te=T.is(Ne.receiver)?Ne.receiver.createCancellationTokenSource(B):Ne.receiver.createCancellationTokenSource(d);d.id!==null&&St.has(d.id)&&te.cancel(),d.id!==null&&qe.set(B,te);try{let X;if(se)if(d.params===void 0){if(G!==void 0&&G.numberOfParams!==0){k(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${d.method} defines ${G.numberOfParams} params but received none.`),d.method,fe);return}X=se(te.token)}else if(Array.isArray(d.params)){if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byName){k(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by name but received parameters by position`),d.method,fe);return}X=se(...d.params,te.token)}else{if(G!==void 0&&G.parameterStructures===i.ParameterStructures.byPosition){k(new i.ResponseError(i.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by position but received parameters by name`),d.method,fe);return}X=se(d.params,te.token)}else dt&&(X=dt(d.method,d.params,te.token));const he=X;X?he.then?he.then(ve=>{qe.delete(B),y(ve,d.method,fe)},ve=>{qe.delete(B),ve instanceof i.ResponseError?k(ve,d.method,fe):ve&&n.string(ve.message)?k(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${ve.message}`),d.method,fe):k(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,fe)}):(qe.delete(B),y(X,d.method,fe)):(qe.delete(B),M(X,d.method,fe))}catch(X){qe.delete(B),X instanceof i.ResponseError?y(X,d.method,fe):X&&n.string(X.message)?k(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${X.message}`),d.method,fe):k(new i.ResponseError(i.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,fe)}}else k(new i.ResponseError(i.ErrorCodes.MethodNotFound,`Unhandled method ${d.method}`),d.method,fe)}function qr(d){if(!Ye())if(d.id===null)d.error?x.error(`Received response message without id: Error is: +${JSON.stringify(d.error,void 0,4)}`):x.error("Received response message without id. No further error information provided.");else{const y=d.id,k=He.get(y);if(Fr(d,k),k!==void 0){He.delete(y);try{if(d.error){const M=d.error;k.reject(new i.ResponseError(M.code,M.message,M.data))}else if(d.result!==void 0)k.resolve(d.result);else throw new Error("Should never happen.")}catch(M){M.message?x.error(`Response handler '${k.method}' failed with message: ${M.message}`):x.error(`Response handler '${k.method}' failed unexpectedly.`)}}}}function Mr(d){if(Ye())return;let y,k;if(d.method===a.type.method){const M=d.params.id;St.delete(M),Jt(d);return}else{const M=kt.get(d.method);M&&(k=M.handler,y=M.type)}if(k||lt)try{if(Jt(d),k)if(d.params===void 0)y!==void 0&&y.numberOfParams!==0&&y.parameterStructures!==i.ParameterStructures.byName&&x.error(`Notification ${d.method} defines ${y.numberOfParams} params but received none.`),k();else if(Array.isArray(d.params)){const M=d.params;d.method===f.type.method&&M.length===2&&l.is(M[0])?k({token:M[0],value:M[1]}):(y!==void 0&&(y.parameterStructures===i.ParameterStructures.byName&&x.error(`Notification ${d.method} defines parameters by name but received parameters by position`),y.numberOfParams!==d.params.length&&x.error(`Notification ${d.method} defines ${y.numberOfParams} params but received ${M.length} arguments`)),k(...M))}else y!==void 0&&y.parameterStructures===i.ParameterStructures.byPosition&&x.error(`Notification ${d.method} defines parameters by position but received parameters by name`),k(d.params);else lt&<(d.method,d.params)}catch(M){M.message?x.error(`Notification handler '${d.method}' failed with message: ${M.message}`):x.error(`Notification handler '${d.method}' failed unexpectedly.`)}else mn.fire(d)}function Or(d){if(!d){x.error("Received empty message.");return}x.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(d,null,4)}`);const y=d;if(n.string(y.id)||n.number(y.id)){const k=y.id,M=He.get(k);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}function je(d){if(d!=null)switch(K){case v.Verbose:return JSON.stringify(d,null,4);case v.Compact:return JSON.stringify(d);default:return}}function Er(d){if(!(K===v.Off||!oe))if($e===C.Text){let y;(K===v.Verbose||K===v.Compact)&&d.params&&(y=`Params: ${je(d.params)} + +`),oe.log(`Sending request '${d.method} - (${d.id})'.`,y)}else Ke("send-request",d)}function Nr(d){if(!(K===v.Off||!oe))if($e===C.Text){let y;(K===v.Verbose||K===v.Compact)&&(d.params?y=`Params: ${je(d.params)} + +`:y=`No parameters provided. + +`),oe.log(`Sending notification '${d.method}'.`,y)}else Ke("send-notification",d)}function Ct(d,y,k){if(!(K===v.Off||!oe))if($e===C.Text){let M;(K===v.Verbose||K===v.Compact)&&(d.error&&d.error.data?M=`Error data: ${je(d.error.data)} + +`:d.result?M=`Result: ${je(d.result)} + +`:d.error===void 0&&(M=`No result returned. + +`)),oe.log(`Sending response '${y} - (${d.id})'. Processing request took ${Date.now()-k}ms`,M)}else Ke("send-response",d)}function jr(d){if(!(K===v.Off||!oe))if($e===C.Text){let y;(K===v.Verbose||K===v.Compact)&&d.params&&(y=`Params: ${je(d.params)} + +`),oe.log(`Received request '${d.method} - (${d.id})'.`,y)}else Ke("receive-request",d)}function Jt(d){if(!(K===v.Off||!oe||d.method===Y.type.method))if($e===C.Text){let y;(K===v.Verbose||K===v.Compact)&&(d.params?y=`Params: ${je(d.params)} + +`:y=`No parameters provided. + +`),oe.log(`Received notification '${d.method}'.`,y)}else Ke("receive-notification",d)}function Fr(d,y){if(!(K===v.Off||!oe))if($e===C.Text){let k;if((K===v.Verbose||K===v.Compact)&&(d.error&&d.error.data?k=`Error data: ${je(d.error.data)} + +`:d.result?k=`Result: ${je(d.result)} + +`:d.error===void 0&&(k=`No result returned. + +`)),y){const M=d.error?` Request failed: ${d.error.message} (${d.error.code}).`:"";oe.log(`Received response '${y.method} - (${d.id})' in ${Date.now()-y.timerStart}ms.${M}`,k)}else oe.log(`Received response ${d.id} without active response promise.`,k)}else Ke("receive-response",d)}function Ke(d,y){if(!oe||K===v.Off)return;const k={isLSPMessage:!0,type:d,message:y,timestamp:Date.now()};oe.log(k)}function ft(){if(Rn())throw new m(W.Closed,"Connection is closed.");if(Ye())throw new m(W.Disposed,"Connection is disposed.")}function Ir(){if(vn())throw new m(W.AlreadyListening,"Connection is already listening")}function Ar(){if(!vn())throw new Error("Call listen() first.")}function gt(d){return d===void 0?null:d}function Pn(d){if(d!==null)return d}function u(d){return d!=null&&!Array.isArray(d)&&typeof d=="object"}function de(d,y){switch(d){case i.ParameterStructures.auto:return u(y)?Pn(y):[gt(y)];case i.ParameterStructures.byName:if(!u(y))throw new Error("Received parameters by name but param is not an object literal.");return Pn(y);case i.ParameterStructures.byPosition:return[gt(y)];default:throw new Error(`Unknown parameter structure ${d.toString()}`)}}function le(d,y){let k;const M=d.numberOfParams;switch(M){case 0:k=void 0;break;case 1:k=de(d.parameterStructures,y[0]);break;default:k=[];for(let Z=0;Z{ft();let k,M;if(n.string(d)){k=d;const G=y[0];let se=0,fe=i.ParameterStructures.auto;i.ParameterStructures.is(G)&&(se=1,fe=G);let B=y.length;const te=B-se;switch(te){case 0:M=void 0;break;case 1:M=de(fe,y[se]);break;default:if(fe===i.ParameterStructures.byName)throw new Error(`Received ${te} parameters for 'by Name' notification parameter structure.`);M=y.slice(se,B).map(X=>gt(X));break}}else{const G=y;k=d.method,M=le(d,G)}const Z={jsonrpc:ut,method:k,params:M};return Nr(Z),N.write(Z).catch(G=>{throw x.error("Sending notification failed."),G})},onNotification:(d,y)=>{ft();let k;return n.func(d)?lt=d:y&&(n.string(d)?(k=d,kt.set(d,{type:void 0,handler:y})):(k=d.method,kt.set(d.method,{type:d,handler:y}))),{dispose:()=>{k!==void 0?kt.delete(k):lt=void 0}}},onProgress:(d,y,k)=>{if(Pt.has(y))throw new Error(`Progress handler for token ${y} already registered`);return Pt.set(y,k),{dispose:()=>{Pt.delete(y)}}},sendProgress:(d,y,k)=>F.sendNotification(f.type,{token:y,value:k}),onUnhandledProgress:wn.event,sendRequest:(d,...y)=>{ft(),Ar();let k,M,Z;if(n.string(d)){k=d;const B=y[0],te=y[y.length-1];let X=0,he=i.ParameterStructures.auto;i.ParameterStructures.is(B)&&(X=1,he=B);let ve=y.length;c.CancellationToken.is(te)&&(ve=ve-1,Z=te);const xe=ve-X;switch(xe){case 0:M=void 0;break;case 1:M=de(he,y[X]);break;default:if(he===i.ParameterStructures.byName)throw new Error(`Received ${xe} parameters for 'by Name' request parameter structure.`);M=y.slice(X,ve).map(bu=>gt(bu));break}}else{const B=y;k=d.method,M=le(d,B);const te=d.numberOfParams;Z=c.CancellationToken.is(B[te])?B[te]:void 0}const G=mr++;let se;Z&&(se=Z.onCancellationRequested(()=>{const B=Ne.sender.sendCancellation(F,G);return B===void 0?(x.log(`Received no promise from cancellation strategy when cancelling id ${G}`),Promise.resolve()):B.catch(()=>{x.log(`Sending cancellation messages for id ${G} failed`)})}));const fe={jsonrpc:ut,id:G,method:k,params:M};return Er(fe),typeof Ne.sender.enableCancellation=="function"&&Ne.sender.enableCancellation(fe),new Promise(async(B,te)=>{const X=xe=>{B(xe),Ne.sender.cleanup(G),se?.dispose()},he=xe=>{te(xe),Ne.sender.cleanup(G),se?.dispose()},ve={method:k,timerStart:Date.now(),resolve:X,reject:he};try{await N.write(fe),He.set(G,ve)}catch(xe){throw x.error("Sending request failed."),ve.reject(new i.ResponseError(i.ErrorCodes.MessageWriteError,xe.message?xe.message:"Unknown reason")),xe}})},onRequest:(d,y)=>{ft();let k=null;return p.is(d)?(k=void 0,dt=d):n.string(d)?(k=null,y!==void 0&&(k=d,Tt.set(d,{handler:y,type:void 0}))):y!==void 0&&(k=d.method,Tt.set(d.method,{type:d,handler:y})),{dispose:()=>{k!==null&&(k!==void 0?Tt.delete(k):dt=void 0)}}},hasPendingResponse:()=>He.size>0,trace:async(d,y,k)=>{let M=!1,Z=C.Text;k!==void 0&&(n.boolean(k)?M=k:(M=k.sendNotification||!1,Z=k.traceFormat||C.Text)),K=d,$e=Z,K===v.Off?oe=void 0:oe=y,M&&!Rn()&&!Ye()&&await F.sendNotification(J.type,{value:v.toString(d)})},onError:Vt.event,onClose:hn.event,onUnhandledNotification:mn.event,onDispose:pn.event,end:()=>{N.end()},dispose:()=>{if(Ye())return;Ee=me.Disposed,pn.fire(void 0);const d=new i.ResponseError(i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const y of He.values())y.reject(d);He=new Map,qe=new Map,St=new Set,We=new r.LinkedMap,n.func(N.dispose)&&N.dispose(),n.func(b.dispose)&&b.dispose()},listen:()=>{ft(),Ir(),Ee=me.Listening,b.listen(Sr)},inspect:()=>{(0,t.default)().console.log("inspect")}};return F.onNotification(Y.type,d=>{if(K===v.Off||!oe)return;const y=K===v.Verbose||K===v.Compact;oe.log(d.message,y?d.verbose:void 0)}),F.onNotification(f.type,d=>{const y=Pt.get(d.token);y?y(d.value):wn.fire(d)}),F}e.createMessageConnection=j}(Ur)),Ur}var Oo;function Vr(){return Oo||(Oo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;const t=mo();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});const n=po();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});const i=Ac();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const r=tn();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return r.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return r.Emitter}});const o=Br();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const c=Lc();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return c.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return c.SharedArrayReceiverStrategy}});const a=Wc();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const l=Hc();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return l.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return l.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return l.WriteableStreamMessageWriter}});const f=$c();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return f.AbstractMessageBuffer}});const _=xc();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return _.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return _.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return _.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return _.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return _.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return _.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return _.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return _.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return _.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return _.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return _.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return _.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return _.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return _.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return _.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return _.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return _.MessageStrategy}});const p=mt();e.RAL=p.default}(zr)),zr}Object.defineProperty(xr,"__esModule",{value:!0});const Fe=Vr();class En extends Fe.AbstractMessageBuffer{constructor(t="utf-8"){super(t),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return En.emptyBuffer}fromString(t,n){return new TextEncoder().encode(t)}toString(t,n){return n==="ascii"?this.asciiDecoder.decode(t):new TextDecoder(n).decode(t)}asNative(t,n){return n===void 0?t:t.slice(0,n)}allocNative(t){return new Uint8Array(t)}}En.emptyBuffer=new Uint8Array(0);class zc{constructor(t){this.socket=t,this._onData=new Fe.Emitter,this._messageListener=n=>{n.data.arrayBuffer().then(r=>{this._onData.fire(new Uint8Array(r))},()=>{(0,Fe.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(t){return this.socket.addEventListener("close",t),Fe.Disposable.create(()=>this.socket.removeEventListener("close",t))}onError(t){return this.socket.addEventListener("error",t),Fe.Disposable.create(()=>this.socket.removeEventListener("error",t))}onEnd(t){return this.socket.addEventListener("end",t),Fe.Disposable.create(()=>this.socket.removeEventListener("end",t))}onData(t){return this._onData.event(t)}}class Bc{constructor(t){this.socket=t}onClose(t){return this.socket.addEventListener("close",t),Fe.Disposable.create(()=>this.socket.removeEventListener("close",t))}onError(t){return this.socket.addEventListener("error",t),Fe.Disposable.create(()=>this.socket.removeEventListener("error",t))}onEnd(t){return this.socket.addEventListener("end",t),Fe.Disposable.create(()=>this.socket.removeEventListener("end",t))}write(t,n){if(typeof t=="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(t)}else this.socket.send(t);return Promise.resolve()}end(){this.socket.close()}}const Uc=new TextEncoder,Eo=Object.freeze({messageBuffer:Object.freeze({create:e=>new En(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{if(t.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t.charset}`);return Promise.resolve(Uc.encode(JSON.stringify(e,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{if(!(e instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))}})}),stream:Object.freeze({asReadableStream:e=>new zc(e),asWritableStream:e=>new Bc(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){const i=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(i)}},setImmediate(e,...t){const n=setTimeout(e,0,...t);return{dispose:()=>clearTimeout(n)}},setInterval(e,t,...n){const i=setInterval(e,t,...n);return{dispose:()=>clearInterval(i)}}})});function Jr(){return Eo}(function(e){function t(){Fe.RAL.install(Eo)}e.install=t})(Jr||(Jr={})),xr.default=Jr,function(e){var t=ge&&ge.__createBinding||(Object.create?function(l,f,_,p){p===void 0&&(p=_);var v=Object.getOwnPropertyDescriptor(f,_);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[_]}}),Object.defineProperty(l,p,v)}:function(l,f,_,p){p===void 0&&(p=_),l[p]=f[_]}),n=ge&&ge.__exportStar||function(l,f){for(var _ in l)_!=="default"&&!Object.prototype.hasOwnProperty.call(f,_)&&t(f,l,_)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,xr.default.install();const r=Vr();n(Vr(),e);class o extends r.AbstractMessageReader{constructor(f){super(),this._onData=new r.Emitter,this._messageListener=_=>{this._onData.fire(_.data)},f.addEventListener("error",_=>this.fireError(_)),f.onmessage=this._messageListener}listen(f){return this._onData.event(f)}}e.BrowserMessageReader=o;class c extends r.AbstractMessageWriter{constructor(f){super(),this.port=f,this.errorCount=0,f.addEventListener("error",_=>this.fireError(_))}write(f){try{return this.port.postMessage(f),Promise.resolve()}catch(_){return this.handleError(_,f),Promise.reject(_)}}handleError(f,_){this.errorCount++,this.fireError(f,_,this.errorCount)}end(){}}e.BrowserMessageWriter=c;function a(l,f,_,p){return _===void 0&&(_=r.NullLogger),r.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,r.createMessageConnection)(l,f,_,p)}e.createMessageConnection=a}(bt);var No=bt,jo={},Xr;(function(e){function t(n){return typeof n=="string"}e.is=t})(Xr||(Xr={}));var Nn;(function(e){function t(n){return typeof n=="string"}e.is=t})(Nn||(Nn={}));var Qr;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Qr||(Qr={}));var on;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(on||(on={}));var Te;(function(e){function t(i,r){return i===Number.MAX_VALUE&&(i=on.MAX_VALUE),r===Number.MAX_VALUE&&(r=on.MAX_VALUE),{line:i,character:r}}e.create=t;function n(i){let r=i;return g.objectLiteral(r)&&g.uinteger(r.line)&&g.uinteger(r.character)}e.is=n})(Te||(Te={}));var ne;(function(e){function t(i,r,o,c){if(g.uinteger(i)&&g.uinteger(r)&&g.uinteger(o)&&g.uinteger(c))return{start:Te.create(i,r),end:Te.create(o,c)};if(Te.is(i)&&Te.is(r))return{start:i,end:r};throw new Error(`Range#create called with invalid arguments[${i}, ${r}, ${o}, ${c}]`)}e.create=t;function n(i){let r=i;return g.objectLiteral(r)&&Te.is(r.start)&&Te.is(r.end)}e.is=n})(ne||(ne={}));var sn;(function(e){function t(i,r){return{uri:i,range:r}}e.create=t;function n(i){let r=i;return g.objectLiteral(r)&&ne.is(r.range)&&(g.string(r.uri)||g.undefined(r.uri))}e.is=n})(sn||(sn={}));var Yr;(function(e){function t(i,r,o,c){return{targetUri:i,targetRange:r,targetSelectionRange:o,originSelectionRange:c}}e.create=t;function n(i){let r=i;return g.objectLiteral(r)&&ne.is(r.targetRange)&&g.string(r.targetUri)&&ne.is(r.targetSelectionRange)&&(ne.is(r.originSelectionRange)||g.undefined(r.originSelectionRange))}e.is=n})(Yr||(Yr={}));var jn;(function(e){function t(i,r,o,c){return{red:i,green:r,blue:o,alpha:c}}e.create=t;function n(i){const r=i;return g.objectLiteral(r)&&g.numberRange(r.red,0,1)&&g.numberRange(r.green,0,1)&&g.numberRange(r.blue,0,1)&&g.numberRange(r.alpha,0,1)}e.is=n})(jn||(jn={}));var Kr;(function(e){function t(i,r){return{range:i,color:r}}e.create=t;function n(i){const r=i;return g.objectLiteral(r)&&ne.is(r.range)&&jn.is(r.color)}e.is=n})(Kr||(Kr={}));var Gr;(function(e){function t(i,r,o){return{label:i,textEdit:r,additionalTextEdits:o}}e.create=t;function n(i){const r=i;return g.objectLiteral(r)&&g.string(r.label)&&(g.undefined(r.textEdit)||Ie.is(r))&&(g.undefined(r.additionalTextEdits)||g.typedArray(r.additionalTextEdits,Ie.is))}e.is=n})(Gr||(Gr={}));var Zr;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Zr||(Zr={}));var ei;(function(e){function t(i,r,o,c,a,l){const f={startLine:i,endLine:r};return g.defined(o)&&(f.startCharacter=o),g.defined(c)&&(f.endCharacter=c),g.defined(a)&&(f.kind=a),g.defined(l)&&(f.collapsedText=l),f}e.create=t;function n(i){const r=i;return g.objectLiteral(r)&&g.uinteger(r.startLine)&&g.uinteger(r.startLine)&&(g.undefined(r.startCharacter)||g.uinteger(r.startCharacter))&&(g.undefined(r.endCharacter)||g.uinteger(r.endCharacter))&&(g.undefined(r.kind)||g.string(r.kind))}e.is=n})(ei||(ei={}));var Fn;(function(e){function t(i,r){return{location:i,message:r}}e.create=t;function n(i){let r=i;return g.defined(r)&&sn.is(r.location)&&g.string(r.message)}e.is=n})(Fn||(Fn={}));var ti;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(ti||(ti={}));var ni;(function(e){e.Unnecessary=1,e.Deprecated=2})(ni||(ni={}));var ri;(function(e){function t(n){const i=n;return g.objectLiteral(i)&&g.string(i.href)}e.is=t})(ri||(ri={}));var cn;(function(e){function t(i,r,o,c,a,l){let f={range:i,message:r};return g.defined(o)&&(f.severity=o),g.defined(c)&&(f.code=c),g.defined(a)&&(f.source=a),g.defined(l)&&(f.relatedInformation=l),f}e.create=t;function n(i){var r;let o=i;return g.defined(o)&&ne.is(o.range)&&g.string(o.message)&&(g.number(o.severity)||g.undefined(o.severity))&&(g.integer(o.code)||g.string(o.code)||g.undefined(o.code))&&(g.undefined(o.codeDescription)||g.string((r=o.codeDescription)===null||r===void 0?void 0:r.href))&&(g.string(o.source)||g.undefined(o.source))&&(g.undefined(o.relatedInformation)||g.typedArray(o.relatedInformation,Fn.is))}e.is=n})(cn||(cn={}));var yt;(function(e){function t(i,r,...o){let c={title:i,command:r};return g.defined(o)&&o.length>0&&(c.arguments=o),c}e.create=t;function n(i){let r=i;return g.defined(r)&&g.string(r.title)&&g.string(r.command)}e.is=n})(yt||(yt={}));var Ie;(function(e){function t(o,c){return{range:o,newText:c}}e.replace=t;function n(o,c){return{range:{start:o,end:o},newText:c}}e.insert=n;function i(o){return{range:o,newText:""}}e.del=i;function r(o){const c=o;return g.objectLiteral(c)&&g.string(c.newText)&&ne.is(c.range)}e.is=r})(Ie||(Ie={}));var vt;(function(e){function t(i,r,o){const c={label:i};return r!==void 0&&(c.needsConfirmation=r),o!==void 0&&(c.description=o),c}e.create=t;function n(i){const r=i;return g.objectLiteral(r)&&g.string(r.label)&&(g.boolean(r.needsConfirmation)||r.needsConfirmation===void 0)&&(g.string(r.description)||r.description===void 0)}e.is=n})(vt||(vt={}));var pe;(function(e){function t(n){const i=n;return g.string(i)}e.is=t})(pe||(pe={}));var Xe;(function(e){function t(o,c,a){return{range:o,newText:c,annotationId:a}}e.replace=t;function n(o,c,a){return{range:{start:o,end:o},newText:c,annotationId:a}}e.insert=n;function i(o,c){return{range:o,newText:"",annotationId:c}}e.del=i;function r(o){const c=o;return Ie.is(c)&&(vt.is(c.annotationId)||pe.is(c.annotationId))}e.is=r})(Xe||(Xe={}));var an;(function(e){function t(i,r){return{textDocument:i,edits:r}}e.create=t;function n(i){let r=i;return g.defined(r)&&un.is(r.textDocument)&&Array.isArray(r.edits)}e.is=n})(an||(an={}));var qt;(function(e){function t(i,r,o){let c={kind:"create",uri:i};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(c.options=r),o!==void 0&&(c.annotationId=o),c}e.create=t;function n(i){let r=i;return r&&r.kind==="create"&&g.string(r.uri)&&(r.options===void 0||(r.options.overwrite===void 0||g.boolean(r.options.overwrite))&&(r.options.ignoreIfExists===void 0||g.boolean(r.options.ignoreIfExists)))&&(r.annotationId===void 0||pe.is(r.annotationId))}e.is=n})(qt||(qt={}));var Mt;(function(e){function t(i,r,o,c){let a={kind:"rename",oldUri:i,newUri:r};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),c!==void 0&&(a.annotationId=c),a}e.create=t;function n(i){let r=i;return r&&r.kind==="rename"&&g.string(r.oldUri)&&g.string(r.newUri)&&(r.options===void 0||(r.options.overwrite===void 0||g.boolean(r.options.overwrite))&&(r.options.ignoreIfExists===void 0||g.boolean(r.options.ignoreIfExists)))&&(r.annotationId===void 0||pe.is(r.annotationId))}e.is=n})(Mt||(Mt={}));var Ot;(function(e){function t(i,r,o){let c={kind:"delete",uri:i};return r!==void 0&&(r.recursive!==void 0||r.ignoreIfNotExists!==void 0)&&(c.options=r),o!==void 0&&(c.annotationId=o),c}e.create=t;function n(i){let r=i;return r&&r.kind==="delete"&&g.string(r.uri)&&(r.options===void 0||(r.options.recursive===void 0||g.boolean(r.options.recursive))&&(r.options.ignoreIfNotExists===void 0||g.boolean(r.options.ignoreIfNotExists)))&&(r.annotationId===void 0||pe.is(r.annotationId))}e.is=n})(Ot||(Ot={}));var In;(function(e){function t(n){let i=n;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(r=>g.string(r.kind)?qt.is(r)||Mt.is(r)||Ot.is(r):an.is(r)))}e.is=t})(In||(In={}));class An{constructor(t,n){this.edits=t,this.changeAnnotations=n}insert(t,n,i){let r,o;if(i===void 0?r=Ie.insert(t,n):pe.is(i)?(o=i,r=Xe.insert(t,n,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),r=Xe.insert(t,n,o)),this.edits.push(r),o!==void 0)return o}replace(t,n,i){let r,o;if(i===void 0?r=Ie.replace(t,n):pe.is(i)?(o=i,r=Xe.replace(t,n,i)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(i),r=Xe.replace(t,n,o)),this.edits.push(r),o!==void 0)return o}delete(t,n){let i,r;if(n===void 0?i=Ie.del(t):pe.is(n)?(r=n,i=Xe.del(t,n)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(n),i=Xe.del(t,r)),this.edits.push(i),r!==void 0)return r}add(t){this.edits.push(t)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(t){if(t===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class Fo{constructor(t){this._annotations=t===void 0?Object.create(null):t,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(t,n){let i;if(pe.is(t)?i=t:(i=this.nextId(),n=t),this._annotations[i]!==void 0)throw new Error(`Id ${i} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${i}`);return this._annotations[i]=n,this._size++,i}nextId(){return this._counter++,this._counter.toString()}}class Vc{constructor(t){this._textEditChanges=Object.create(null),t!==void 0?(this._workspaceEdit=t,t.documentChanges?(this._changeAnnotations=new Fo(t.changeAnnotations),t.changeAnnotations=this._changeAnnotations.all(),t.documentChanges.forEach(n=>{if(an.is(n)){const i=new An(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=i}})):t.changes&&Object.keys(t.changes).forEach(n=>{const i=new An(t.changes[n]);this._textEditChanges[n]=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(t){if(un.is(t)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:t.uri,version:t.version};let i=this._textEditChanges[n.uri];if(!i){const r=[],o={textDocument:n,edits:r};this._workspaceEdit.documentChanges.push(o),i=new An(r,this._changeAnnotations),this._textEditChanges[n.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 n=this._textEditChanges[t];if(!n){let i=[];this._workspaceEdit.changes[t]=i,n=new An(i),this._textEditChanges[t]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Fo,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(t,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r;vt.is(n)||pe.is(n)?r=n:i=n;let o,c;if(r===void 0?o=qt.create(t,i):(c=pe.is(r)?r:this._changeAnnotations.manage(r),o=qt.create(t,i,c)),this._workspaceEdit.documentChanges.push(o),c!==void 0)return c}renameFile(t,n,i,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;vt.is(i)||pe.is(i)?o=i:r=i;let c,a;if(o===void 0?c=Mt.create(t,n,r):(a=pe.is(o)?o:this._changeAnnotations.manage(o),c=Mt.create(t,n,r,a)),this._workspaceEdit.documentChanges.push(c),a!==void 0)return a}deleteFile(t,n,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let r;vt.is(n)||pe.is(n)?r=n:i=n;let o,c;if(r===void 0?o=Ot.create(t,i):(c=pe.is(r)?r:this._changeAnnotations.manage(r),o=Ot.create(t,i,c)),this._workspaceEdit.documentChanges.push(o),c!==void 0)return c}}var ii;(function(e){function t(i){return{uri:i}}e.create=t;function n(i){let r=i;return g.defined(r)&&g.string(r.uri)}e.is=n})(ii||(ii={}));var oi;(function(e){function t(i,r){return{uri:i,version:r}}e.create=t;function n(i){let r=i;return g.defined(r)&&g.string(r.uri)&&g.integer(r.version)}e.is=n})(oi||(oi={}));var un;(function(e){function t(i,r){return{uri:i,version:r}}e.create=t;function n(i){let r=i;return g.defined(r)&&g.string(r.uri)&&(r.version===null||g.integer(r.version))}e.is=n})(un||(un={}));var si;(function(e){function t(i,r,o,c){return{uri:i,languageId:r,version:o,text:c}}e.create=t;function n(i){let r=i;return g.defined(r)&&g.string(r.uri)&&g.string(r.languageId)&&g.integer(r.version)&&g.string(r.text)}e.is=n})(si||(si={}));var Ln;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){const i=n;return i===e.PlainText||i===e.Markdown}e.is=t})(Ln||(Ln={}));var Et;(function(e){function t(n){const i=n;return g.objectLiteral(n)&&Ln.is(i.kind)&&g.string(i.value)}e.is=t})(Et||(Et={}));var ci;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(ci||(ci={}));var ai;(function(e){e.PlainText=1,e.Snippet=2})(ai||(ai={}));var ui;(function(e){e.Deprecated=1})(ui||(ui={}));var di;(function(e){function t(i,r,o){return{newText:i,insert:r,replace:o}}e.create=t;function n(i){const r=i;return r&&g.string(r.newText)&&ne.is(r.insert)&&ne.is(r.replace)}e.is=n})(di||(di={}));var li;(function(e){e.asIs=1,e.adjustIndentation=2})(li||(li={}));var fi;(function(e){function t(n){const i=n;return i&&(g.string(i.detail)||i.detail===void 0)&&(g.string(i.description)||i.description===void 0)}e.is=t})(fi||(fi={}));var gi;(function(e){function t(n){return{label:n}}e.create=t})(gi||(gi={}));var _i;(function(e){function t(n,i){return{items:n||[],isIncomplete:!!i}}e.create=t})(_i||(_i={}));var dn;(function(e){function t(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(i){const r=i;return g.string(r)||g.objectLiteral(r)&&g.string(r.language)&&g.string(r.value)}e.is=n})(dn||(dn={}));var bi;(function(e){function t(n){let i=n;return!!i&&g.objectLiteral(i)&&(Et.is(i.contents)||dn.is(i.contents)||g.typedArray(i.contents,dn.is))&&(n.range===void 0||ne.is(n.range))}e.is=t})(bi||(bi={}));var hi;(function(e){function t(n,i){return i?{label:n,documentation:i}:{label:n}}e.create=t})(hi||(hi={}));var mi;(function(e){function t(n,i,...r){let o={label:n};return g.defined(i)&&(o.documentation=i),g.defined(r)?o.parameters=r:o.parameters=[],o}e.create=t})(mi||(mi={}));var wi;(function(e){e.Text=1,e.Read=2,e.Write=3})(wi||(wi={}));var pi;(function(e){function t(n,i){let r={range:n};return g.number(i)&&(r.kind=i),r}e.create=t})(pi||(pi={}));var yi;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(yi||(yi={}));var vi;(function(e){e.Deprecated=1})(vi||(vi={}));var Ri;(function(e){function t(n,i,r,o,c){let a={name:n,kind:i,location:{uri:o,range:r}};return c&&(a.containerName=c),a}e.create=t})(Ri||(Ri={}));var Di;(function(e){function t(n,i,r,o){return o!==void 0?{name:n,kind:i,location:{uri:r,range:o}}:{name:n,kind:i,location:{uri:r}}}e.create=t})(Di||(Di={}));var Ti;(function(e){function t(i,r,o,c,a,l){let f={name:i,detail:r,kind:o,range:c,selectionRange:a};return l!==void 0&&(f.children=l),f}e.create=t;function n(i){let r=i;return r&&g.string(r.name)&&g.number(r.kind)&&ne.is(r.range)&&ne.is(r.selectionRange)&&(r.detail===void 0||g.string(r.detail))&&(r.deprecated===void 0||g.boolean(r.deprecated))&&(r.children===void 0||Array.isArray(r.children))&&(r.tags===void 0||Array.isArray(r.tags))}e.is=n})(Ti||(Ti={}));var ki;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(ki||(ki={}));var ln;(function(e){e.Invoked=1,e.Automatic=2})(ln||(ln={}));var Pi;(function(e){function t(i,r,o){let c={diagnostics:i};return r!=null&&(c.only=r),o!=null&&(c.triggerKind=o),c}e.create=t;function n(i){let r=i;return g.defined(r)&&g.typedArray(r.diagnostics,cn.is)&&(r.only===void 0||g.typedArray(r.only,g.string))&&(r.triggerKind===void 0||r.triggerKind===ln.Invoked||r.triggerKind===ln.Automatic)}e.is=n})(Pi||(Pi={}));var Si;(function(e){function t(i,r,o){let c={title:i},a=!0;return typeof r=="string"?(a=!1,c.kind=r):yt.is(r)?c.command=r:c.edit=r,a&&o!==void 0&&(c.kind=o),c}e.create=t;function n(i){let r=i;return r&&g.string(r.title)&&(r.diagnostics===void 0||g.typedArray(r.diagnostics,cn.is))&&(r.kind===void 0||g.string(r.kind))&&(r.edit!==void 0||r.command!==void 0)&&(r.command===void 0||yt.is(r.command))&&(r.isPreferred===void 0||g.boolean(r.isPreferred))&&(r.edit===void 0||In.is(r.edit))}e.is=n})(Si||(Si={}));var Ci;(function(e){function t(i,r){let o={range:i};return g.defined(r)&&(o.data=r),o}e.create=t;function n(i){let r=i;return g.defined(r)&&ne.is(r.range)&&(g.undefined(r.command)||yt.is(r.command))}e.is=n})(Ci||(Ci={}));var qi;(function(e){function t(i,r){return{tabSize:i,insertSpaces:r}}e.create=t;function n(i){let r=i;return g.defined(r)&&g.uinteger(r.tabSize)&&g.boolean(r.insertSpaces)}e.is=n})(qi||(qi={}));var Mi;(function(e){function t(i,r,o){return{range:i,target:r,data:o}}e.create=t;function n(i){let r=i;return g.defined(r)&&ne.is(r.range)&&(g.undefined(r.target)||g.string(r.target))}e.is=n})(Mi||(Mi={}));var Oi;(function(e){function t(i,r){return{range:i,parent:r}}e.create=t;function n(i){let r=i;return g.objectLiteral(r)&&ne.is(r.range)&&(r.parent===void 0||e.is(r.parent))}e.is=n})(Oi||(Oi={}));var Ei;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Ei||(Ei={}));var Ni;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(Ni||(Ni={}));var ji;(function(e){function t(n){const i=n;return g.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}e.is=t})(ji||(ji={}));var Fi;(function(e){function t(i,r){return{range:i,text:r}}e.create=t;function n(i){const r=i;return r!=null&&ne.is(r.range)&&g.string(r.text)}e.is=n})(Fi||(Fi={}));var Ii;(function(e){function t(i,r,o){return{range:i,variableName:r,caseSensitiveLookup:o}}e.create=t;function n(i){const r=i;return r!=null&&ne.is(r.range)&&g.boolean(r.caseSensitiveLookup)&&(g.string(r.variableName)||r.variableName===void 0)}e.is=n})(Ii||(Ii={}));var Ai;(function(e){function t(i,r){return{range:i,expression:r}}e.create=t;function n(i){const r=i;return r!=null&&ne.is(r.range)&&(g.string(r.expression)||r.expression===void 0)}e.is=n})(Ai||(Ai={}));var Li;(function(e){function t(i,r){return{frameId:i,stoppedLocation:r}}e.create=t;function n(i){const r=i;return g.defined(r)&&ne.is(i.stoppedLocation)}e.is=n})(Li||(Li={}));var Wn;(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(Wn||(Wn={}));var Hn;(function(e){function t(i){return{value:i}}e.create=t;function n(i){const r=i;return g.objectLiteral(r)&&(r.tooltip===void 0||g.string(r.tooltip)||Et.is(r.tooltip))&&(r.location===void 0||sn.is(r.location))&&(r.command===void 0||yt.is(r.command))}e.is=n})(Hn||(Hn={}));var Wi;(function(e){function t(i,r,o){const c={position:i,label:r};return o!==void 0&&(c.kind=o),c}e.create=t;function n(i){const r=i;return g.objectLiteral(r)&&Te.is(r.position)&&(g.string(r.label)||g.typedArray(r.label,Hn.is))&&(r.kind===void 0||Wn.is(r.kind))&&r.textEdits===void 0||g.typedArray(r.textEdits,Ie.is)&&(r.tooltip===void 0||g.string(r.tooltip)||Et.is(r.tooltip))&&(r.paddingLeft===void 0||g.boolean(r.paddingLeft))&&(r.paddingRight===void 0||g.boolean(r.paddingRight))}e.is=n})(Wi||(Wi={}));var Hi;(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t})(Hi||(Hi={}));var $i;(function(e){function t(n,i,r,o){return{insertText:n,filterText:i,range:r,command:o}}e.create=t})($i||($i={}));var xi;(function(e){function t(n){return{items:n}}e.create=t})(xi||(xi={}));var zi;(function(e){e.Invoked=0,e.Automatic=1})(zi||(zi={}));var Bi;(function(e){function t(n,i){return{range:n,text:i}}e.create=t})(Bi||(Bi={}));var Ui;(function(e){function t(n,i){return{triggerKind:n,selectedCompletionInfo:i}}e.create=t})(Ui||(Ui={}));var Vi;(function(e){function t(n){const i=n;return g.objectLiteral(i)&&Nn.is(i.uri)&&g.string(i.name)}e.is=t})(Vi||(Vi={}));const Jc=[` +`,`\r +`,"\r"];var Ji;(function(e){function t(o,c,a,l){return new Xc(o,c,a,l)}e.create=t;function n(o){let c=o;return!!(g.defined(c)&&g.string(c.uri)&&(g.undefined(c.languageId)||g.string(c.languageId))&&g.uinteger(c.lineCount)&&g.func(c.getText)&&g.func(c.positionAt)&&g.func(c.offsetAt))}e.is=n;function i(o,c){let a=o.getText(),l=r(c,(_,p)=>{let v=_.range.start.line-p.range.start.line;return v===0?_.range.start.character-p.range.start.character:v}),f=a.length;for(let _=l.length-1;_>=0;_--){let p=l[_],v=o.offsetAt(p.range.start),D=o.offsetAt(p.range.end);if(D<=f)a=a.substring(0,v)+p.newText+a.substring(D,a.length);else throw new Error("Overlapping edit");f=v}return a}e.applyEdits=i;function r(o,c){if(o.length<=1)return o;const a=o.length/2|0,l=o.slice(0,a),f=o.slice(a);r(l,c),r(f,c);let _=0,p=0,v=0;for(;_0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return Te.create(0,t);for(;it?r=c:i=c+1}let o=i-1;return Te.create(o,t-n[o])}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let i=n[t.line],r=t.line+1"u"}e.undefined=i;function r(D){return D===!0||D===!1}e.boolean=r;function o(D){return t.call(D)==="[object String]"}e.string=o;function c(D){return t.call(D)==="[object Number]"}e.number=c;function a(D,C,J){return t.call(D)==="[object Number]"&&C<=D&&D<=J}e.numberRange=a;function l(D){return t.call(D)==="[object Number]"&&-2147483648<=D&&D<=2147483647}e.integer=l;function f(D){return t.call(D)==="[object Number]"&&0<=D&&D<=2147483647}e.uinteger=f;function _(D){return t.call(D)==="[object Function]"}e.func=_;function p(D){return D!==null&&typeof D=="object"}e.objectLiteral=p;function v(D,C){return Array.isArray(D)&&D.every(C)}e.typedArray=v})(g||(g={}));var Qc=Object.freeze({__proto__:null,get AnnotatedTextEdit(){return Xe},get ChangeAnnotation(){return vt},get ChangeAnnotationIdentifier(){return pe},get CodeAction(){return Si},get CodeActionContext(){return Pi},get CodeActionKind(){return ki},get CodeActionTriggerKind(){return ln},get CodeDescription(){return ri},get CodeLens(){return Ci},get Color(){return jn},get ColorInformation(){return Kr},get ColorPresentation(){return Gr},get Command(){return yt},get CompletionItem(){return gi},get CompletionItemKind(){return ci},get CompletionItemLabelDetails(){return fi},get CompletionItemTag(){return ui},get CompletionList(){return _i},get CreateFile(){return qt},get DeleteFile(){return Ot},get Diagnostic(){return cn},get DiagnosticRelatedInformation(){return Fn},get DiagnosticSeverity(){return ti},get DiagnosticTag(){return ni},get DocumentHighlight(){return pi},get DocumentHighlightKind(){return wi},get DocumentLink(){return Mi},get DocumentSymbol(){return Ti},get DocumentUri(){return Xr},EOL:Jc,get FoldingRange(){return ei},get FoldingRangeKind(){return Zr},get FormattingOptions(){return qi},get Hover(){return bi},get InlayHint(){return Wi},get InlayHintKind(){return Wn},get InlayHintLabelPart(){return Hn},get InlineCompletionContext(){return Ui},get InlineCompletionItem(){return $i},get InlineCompletionList(){return xi},get InlineCompletionTriggerKind(){return zi},get InlineValueContext(){return Li},get InlineValueEvaluatableExpression(){return Ai},get InlineValueText(){return Fi},get InlineValueVariableLookup(){return Ii},get InsertReplaceEdit(){return di},get InsertTextFormat(){return ai},get InsertTextMode(){return li},get Location(){return sn},get LocationLink(){return Yr},get MarkedString(){return dn},get MarkupContent(){return Et},get MarkupKind(){return Ln},get OptionalVersionedTextDocumentIdentifier(){return un},get ParameterInformation(){return hi},get Position(){return Te},get Range(){return ne},get RenameFile(){return Mt},get SelectedCompletionInfo(){return Bi},get SelectionRange(){return Oi},get SemanticTokenModifiers(){return Ni},get SemanticTokenTypes(){return Ei},get SemanticTokens(){return ji},get SignatureInformation(){return mi},get StringValue(){return Hi},get SymbolInformation(){return Ri},get SymbolKind(){return yi},get SymbolTag(){return vi},get TextDocument(){return Ji},get TextDocumentEdit(){return an},get TextDocumentIdentifier(){return ii},get TextDocumentItem(){return si},get TextEdit(){return Ie},get URI(){return Nn},get VersionedTextDocumentIdentifier(){return oi},WorkspaceChange:Vc,get WorkspaceEdit(){return In},get WorkspaceFolder(){return Vi},get WorkspaceSymbol(){return Di},get integer(){return Qr},get uinteger(){return on}}),Xi=Ic(Qc),z={};Object.defineProperty(z,"__esModule",{value:!0}),z.ProtocolNotificationType=z.ProtocolNotificationType0=z.ProtocolRequestType=z.ProtocolRequestType0=z.RegistrationType=z.MessageDirection=void 0;const Nt=bt;var Io;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(Io||(z.MessageDirection=Io={}));class Yc{constructor(t){this.method=t}}z.RegistrationType=Yc;class Kc extends Nt.RequestType0{constructor(t){super(t)}}z.ProtocolRequestType0=Kc;class Gc extends Nt.RequestType{constructor(t){super(t,Nt.ParameterStructures.byName)}}z.ProtocolRequestType=Gc;class Zc extends Nt.NotificationType0{constructor(t){super(t)}}z.ProtocolNotificationType0=Zc;class ea extends Nt.NotificationType{constructor(t){super(t,Nt.ParameterStructures.byName)}}z.ProtocolNotificationType=ea;var Ao={},re={};Object.defineProperty(re,"__esModule",{value:!0}),re.objectLiteral=re.typedArray=re.stringArray=re.array=re.func=re.error=re.number=re.string=re.boolean=void 0;function ta(e){return e===!0||e===!1}re.boolean=ta;function Lo(e){return typeof e=="string"||e instanceof String}re.string=Lo;function na(e){return typeof e=="number"||e instanceof Number}re.number=na;function ra(e){return e instanceof Error}re.error=ra;function ia(e){return typeof e=="function"}re.func=ia;function Wo(e){return Array.isArray(e)}re.array=Wo;function oa(e){return Wo(e)&&e.every(t=>Lo(t))}re.stringArray=oa;function sa(e,t){return Array.isArray(e)&&e.every(t)}re.typedArray=sa;function ca(e){return e!==null&&typeof e=="object"}re.objectLiteral=ca;var $n={};Object.defineProperty($n,"__esModule",{value:!0}),$n.ImplementationRequest=void 0;const Ho=z;var $o;(function(e){e.method="textDocument/implementation",e.messageDirection=Ho.MessageDirection.clientToServer,e.type=new Ho.ProtocolRequestType(e.method)})($o||($n.ImplementationRequest=$o={}));var xn={};Object.defineProperty(xn,"__esModule",{value:!0}),xn.TypeDefinitionRequest=void 0;const xo=z;var zo;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=xo.MessageDirection.clientToServer,e.type=new xo.ProtocolRequestType(e.method)})(zo||(xn.TypeDefinitionRequest=zo={}));var jt={};Object.defineProperty(jt,"__esModule",{value:!0}),jt.DidChangeWorkspaceFoldersNotification=jt.WorkspaceFoldersRequest=void 0;const zn=z;var Bo;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=zn.MessageDirection.serverToClient,e.type=new zn.ProtocolRequestType0(e.method)})(Bo||(jt.WorkspaceFoldersRequest=Bo={}));var Uo;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=zn.MessageDirection.clientToServer,e.type=new zn.ProtocolNotificationType(e.method)})(Uo||(jt.DidChangeWorkspaceFoldersNotification=Uo={}));var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.ConfigurationRequest=void 0;const Vo=z;var Jo;(function(e){e.method="workspace/configuration",e.messageDirection=Vo.MessageDirection.serverToClient,e.type=new Vo.ProtocolRequestType(e.method)})(Jo||(Bn.ConfigurationRequest=Jo={}));var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.ColorPresentationRequest=Ft.DocumentColorRequest=void 0;const Un=z;var Xo;(function(e){e.method="textDocument/documentColor",e.messageDirection=Un.MessageDirection.clientToServer,e.type=new Un.ProtocolRequestType(e.method)})(Xo||(Ft.DocumentColorRequest=Xo={}));var Qo;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=Un.MessageDirection.clientToServer,e.type=new Un.ProtocolRequestType(e.method)})(Qo||(Ft.ColorPresentationRequest=Qo={}));var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.FoldingRangeRefreshRequest=It.FoldingRangeRequest=void 0;const Vn=z;var Yo;(function(e){e.method="textDocument/foldingRange",e.messageDirection=Vn.MessageDirection.clientToServer,e.type=new Vn.ProtocolRequestType(e.method)})(Yo||(It.FoldingRangeRequest=Yo={}));var Ko;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=Vn.MessageDirection.serverToClient,e.type=new Vn.ProtocolRequestType0(e.method)})(Ko||(It.FoldingRangeRefreshRequest=Ko={}));var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.DeclarationRequest=void 0;const Go=z;var Zo;(function(e){e.method="textDocument/declaration",e.messageDirection=Go.MessageDirection.clientToServer,e.type=new Go.ProtocolRequestType(e.method)})(Zo||(Jn.DeclarationRequest=Zo={}));var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.SelectionRangeRequest=void 0;const es=z;var ts;(function(e){e.method="textDocument/selectionRange",e.messageDirection=es.MessageDirection.clientToServer,e.type=new es.ProtocolRequestType(e.method)})(ts||(Xn.SelectionRangeRequest=ts={}));var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.WorkDoneProgressCancelNotification=Ze.WorkDoneProgressCreateRequest=Ze.WorkDoneProgress=void 0;const aa=bt,Qn=z;var ns;(function(e){e.type=new aa.ProgressType;function t(n){return n===e.type}e.is=t})(ns||(Ze.WorkDoneProgress=ns={}));var rs;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=Qn.MessageDirection.serverToClient,e.type=new Qn.ProtocolRequestType(e.method)})(rs||(Ze.WorkDoneProgressCreateRequest=rs={}));var is;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=Qn.MessageDirection.clientToServer,e.type=new Qn.ProtocolNotificationType(e.method)})(is||(Ze.WorkDoneProgressCancelNotification=is={}));var et={};Object.defineProperty(et,"__esModule",{value:!0}),et.CallHierarchyOutgoingCallsRequest=et.CallHierarchyIncomingCallsRequest=et.CallHierarchyPrepareRequest=void 0;const At=z;var os;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method)})(os||(et.CallHierarchyPrepareRequest=os={}));var ss;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method)})(ss||(et.CallHierarchyIncomingCallsRequest=ss={}));var cs;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method)})(cs||(et.CallHierarchyOutgoingCallsRequest=cs={}));var Re={};Object.defineProperty(Re,"__esModule",{value:!0}),Re.SemanticTokensRefreshRequest=Re.SemanticTokensRangeRequest=Re.SemanticTokensDeltaRequest=Re.SemanticTokensRequest=Re.SemanticTokensRegistrationType=Re.TokenFormat=void 0;const Qe=z;var as;(function(e){e.Relative="relative"})(as||(Re.TokenFormat=as={}));var fn;(function(e){e.method="textDocument/semanticTokens",e.type=new Qe.RegistrationType(e.method)})(fn||(Re.SemanticTokensRegistrationType=fn={}));var us;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=Qe.MessageDirection.clientToServer,e.type=new Qe.ProtocolRequestType(e.method),e.registrationMethod=fn.method})(us||(Re.SemanticTokensRequest=us={}));var ds;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=Qe.MessageDirection.clientToServer,e.type=new Qe.ProtocolRequestType(e.method),e.registrationMethod=fn.method})(ds||(Re.SemanticTokensDeltaRequest=ds={}));var ls;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=Qe.MessageDirection.clientToServer,e.type=new Qe.ProtocolRequestType(e.method),e.registrationMethod=fn.method})(ls||(Re.SemanticTokensRangeRequest=ls={}));var fs;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=Qe.MessageDirection.serverToClient,e.type=new Qe.ProtocolRequestType0(e.method)})(fs||(Re.SemanticTokensRefreshRequest=fs={}));var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.ShowDocumentRequest=void 0;const gs=z;var _s;(function(e){e.method="window/showDocument",e.messageDirection=gs.MessageDirection.serverToClient,e.type=new gs.ProtocolRequestType(e.method)})(_s||(Yn.ShowDocumentRequest=_s={}));var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.LinkedEditingRangeRequest=void 0;const bs=z;var hs;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=bs.MessageDirection.clientToServer,e.type=new bs.ProtocolRequestType(e.method)})(hs||(Kn.LinkedEditingRangeRequest=hs={}));var ye={};Object.defineProperty(ye,"__esModule",{value:!0}),ye.WillDeleteFilesRequest=ye.DidDeleteFilesNotification=ye.DidRenameFilesNotification=ye.WillRenameFilesRequest=ye.DidCreateFilesNotification=ye.WillCreateFilesRequest=ye.FileOperationPatternKind=void 0;const ke=z;var ms;(function(e){e.file="file",e.folder="folder"})(ms||(ye.FileOperationPatternKind=ms={}));var ws;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=ke.MessageDirection.clientToServer,e.type=new ke.ProtocolRequestType(e.method)})(ws||(ye.WillCreateFilesRequest=ws={}));var ps;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=ke.MessageDirection.clientToServer,e.type=new ke.ProtocolNotificationType(e.method)})(ps||(ye.DidCreateFilesNotification=ps={}));var ys;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=ke.MessageDirection.clientToServer,e.type=new ke.ProtocolRequestType(e.method)})(ys||(ye.WillRenameFilesRequest=ys={}));var vs;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=ke.MessageDirection.clientToServer,e.type=new ke.ProtocolNotificationType(e.method)})(vs||(ye.DidRenameFilesNotification=vs={}));var Rs;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=ke.MessageDirection.clientToServer,e.type=new ke.ProtocolNotificationType(e.method)})(Rs||(ye.DidDeleteFilesNotification=Rs={}));var Ds;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=ke.MessageDirection.clientToServer,e.type=new ke.ProtocolRequestType(e.method)})(Ds||(ye.WillDeleteFilesRequest=Ds={}));var tt={};Object.defineProperty(tt,"__esModule",{value:!0}),tt.MonikerRequest=tt.MonikerKind=tt.UniquenessLevel=void 0;const Ts=z;var ks;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(ks||(tt.UniquenessLevel=ks={}));var Ps;(function(e){e.$import="import",e.$export="export",e.local="local"})(Ps||(tt.MonikerKind=Ps={}));var Ss;(function(e){e.method="textDocument/moniker",e.messageDirection=Ts.MessageDirection.clientToServer,e.type=new Ts.ProtocolRequestType(e.method)})(Ss||(tt.MonikerRequest=Ss={}));var nt={};Object.defineProperty(nt,"__esModule",{value:!0}),nt.TypeHierarchySubtypesRequest=nt.TypeHierarchySupertypesRequest=nt.TypeHierarchyPrepareRequest=void 0;const Lt=z;var Cs;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=Lt.MessageDirection.clientToServer,e.type=new Lt.ProtocolRequestType(e.method)})(Cs||(nt.TypeHierarchyPrepareRequest=Cs={}));var qs;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=Lt.MessageDirection.clientToServer,e.type=new Lt.ProtocolRequestType(e.method)})(qs||(nt.TypeHierarchySupertypesRequest=qs={}));var Ms;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=Lt.MessageDirection.clientToServer,e.type=new Lt.ProtocolRequestType(e.method)})(Ms||(nt.TypeHierarchySubtypesRequest=Ms={}));var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.InlineValueRefreshRequest=Wt.InlineValueRequest=void 0;const Gn=z;var Os;(function(e){e.method="textDocument/inlineValue",e.messageDirection=Gn.MessageDirection.clientToServer,e.type=new Gn.ProtocolRequestType(e.method)})(Os||(Wt.InlineValueRequest=Os={}));var Es;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=Gn.MessageDirection.serverToClient,e.type=new Gn.ProtocolRequestType0(e.method)})(Es||(Wt.InlineValueRefreshRequest=Es={}));var rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.InlayHintRefreshRequest=rt.InlayHintResolveRequest=rt.InlayHintRequest=void 0;const Ht=z;var Ns;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Ht.MessageDirection.clientToServer,e.type=new Ht.ProtocolRequestType(e.method)})(Ns||(rt.InlayHintRequest=Ns={}));var js;(function(e){e.method="inlayHint/resolve",e.messageDirection=Ht.MessageDirection.clientToServer,e.type=new Ht.ProtocolRequestType(e.method)})(js||(rt.InlayHintResolveRequest=js={}));var Fs;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Ht.MessageDirection.serverToClient,e.type=new Ht.ProtocolRequestType0(e.method)})(Fs||(rt.InlayHintRefreshRequest=Fs={}));var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.DiagnosticRefreshRequest=Pe.WorkspaceDiagnosticRequest=Pe.DocumentDiagnosticRequest=Pe.DocumentDiagnosticReportKind=Pe.DiagnosticServerCancellationData=void 0;const Is=bt,ua=re,$t=z;var As;(function(e){function t(n){const i=n;return i&&ua.boolean(i.retriggerRequest)}e.is=t})(As||(Pe.DiagnosticServerCancellationData=As={}));var Ls;(function(e){e.Full="full",e.Unchanged="unchanged"})(Ls||(Pe.DocumentDiagnosticReportKind=Ls={}));var Ws;(function(e){e.method="textDocument/diagnostic",e.messageDirection=$t.MessageDirection.clientToServer,e.type=new $t.ProtocolRequestType(e.method),e.partialResult=new Is.ProgressType})(Ws||(Pe.DocumentDiagnosticRequest=Ws={}));var Hs;(function(e){e.method="workspace/diagnostic",e.messageDirection=$t.MessageDirection.clientToServer,e.type=new $t.ProtocolRequestType(e.method),e.partialResult=new Is.ProgressType})(Hs||(Pe.WorkspaceDiagnosticRequest=Hs={}));var $s;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=$t.MessageDirection.serverToClient,e.type=new $t.ProtocolRequestType0(e.method)})($s||(Pe.DiagnosticRefreshRequest=$s={}));var ie={};Object.defineProperty(ie,"__esModule",{value:!0}),ie.DidCloseNotebookDocumentNotification=ie.DidSaveNotebookDocumentNotification=ie.DidChangeNotebookDocumentNotification=ie.NotebookCellArrayChange=ie.DidOpenNotebookDocumentNotification=ie.NotebookDocumentSyncRegistrationType=ie.NotebookDocument=ie.NotebookCell=ie.ExecutionSummary=ie.NotebookCellKind=void 0;const gn=Xi,Oe=re,Ae=z;var Qi;(function(e){e.Markup=1,e.Code=2;function t(n){return n===1||n===2}e.is=t})(Qi||(ie.NotebookCellKind=Qi={}));var Yi;(function(e){function t(r,o){const c={executionOrder:r};return(o===!0||o===!1)&&(c.success=o),c}e.create=t;function n(r){const o=r;return Oe.objectLiteral(o)&&gn.uinteger.is(o.executionOrder)&&(o.success===void 0||Oe.boolean(o.success))}e.is=n;function i(r,o){return r===o?!0:r==null||o===null||o===void 0?!1:r.executionOrder===o.executionOrder&&r.success===o.success}e.equals=i})(Yi||(ie.ExecutionSummary=Yi={}));var Zn;(function(e){function t(o,c){return{kind:o,document:c}}e.create=t;function n(o){const c=o;return Oe.objectLiteral(c)&&Qi.is(c.kind)&&gn.DocumentUri.is(c.document)&&(c.metadata===void 0||Oe.objectLiteral(c.metadata))}e.is=n;function i(o,c){const a=new Set;return o.document!==c.document&&a.add("document"),o.kind!==c.kind&&a.add("kind"),o.executionSummary!==c.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||c.metadata!==void 0)&&!r(o.metadata,c.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||c.executionSummary!==void 0)&&!Yi.equals(o.executionSummary,c.executionSummary)&&a.add("executionSummary"),a}e.diff=i;function r(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 a=Array.isArray(o),l=Array.isArray(c);if(a!==l)return!1;if(a&&l){if(o.length!==c.length)return!1;for(let f=0;f0}u.hasId=de})(mr||(e.StaticRegistrationOptions=mr={}));var wr;(function(u){function de(le){const F=le;return F&&(F.documentSelector===null||j.is(F.documentSelector))}u.is=de})(wr||(e.TextDocumentRegistrationOptions=wr={}));var pr;(function(u){function de(F){const d=F;return i.objectLiteral(d)&&(d.workDoneProgress===void 0||i.boolean(d.workDoneProgress))}u.is=de;function le(F){const d=F;return d&&i.boolean(d.workDoneProgress)}u.hasWorkDoneProgress=le})(pr||(e.WorkDoneProgressOptions=pr={}));var ut;(function(u){u.method="initialize",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(ut||(e.InitializeRequest=ut={}));var dt;(function(u){u.unknownProtocolVersion=1})(dt||(e.InitializeErrorCodes=dt={}));var Tt;(function(u){u.method="initialized",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(Tt||(e.InitializedNotification=Tt={}));var lt;(function(u){u.method="shutdown",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType0(u.method)})(lt||(e.ShutdownRequest=lt={}));var kt;(function(u){u.method="exit",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType0(u.method)})(kt||(e.ExitNotification=kt={}));var Pt;(function(u){u.method="workspace/didChangeConfiguration",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(Pt||(e.DidChangeConfigurationNotification=Pt={}));var Ut;(function(u){u.Error=1,u.Warning=2,u.Info=3,u.Log=4,u.Debug=5})(Ut||(e.MessageType=Ut={}));var We;(function(u){u.method="window/showMessage",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolNotificationType(u.method)})(We||(e.ShowMessageNotification=We={}));var He;(function(u){u.method="window/showMessageRequest",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType(u.method)})(He||(e.ShowMessageRequest=He={}));var St;(function(u){u.method="window/logMessage",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolNotificationType(u.method)})(St||(e.LogMessageNotification=St={}));var qe;(function(u){u.method="telemetry/event",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolNotificationType(u.method)})(qe||(e.TelemetryEventNotification=qe={}));var K;(function(u){u.None=0,u.Full=1,u.Incremental=2})(K||(e.TextDocumentSyncKind=K={}));var $e;(function(u){u.method="textDocument/didOpen",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})($e||(e.DidOpenTextDocumentNotification=$e={}));var oe;(function(u){function de(F){let d=F;return d!=null&&typeof d.text=="string"&&d.range!==void 0&&(d.rangeLength===void 0||typeof d.rangeLength=="number")}u.isIncremental=de;function le(F){let d=F;return d!=null&&typeof d.text=="string"&&d.range===void 0&&d.rangeLength===void 0}u.isFull=le})(oe||(e.TextDocumentContentChangeEvent=oe={}));var Ee;(function(u){u.method="textDocument/didChange",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(Ee||(e.DidChangeTextDocumentNotification=Ee={}));var Vt;(function(u){u.method="textDocument/didClose",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(Vt||(e.DidCloseTextDocumentNotification=Vt={}));var hn;(function(u){u.method="textDocument/didSave",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(hn||(e.DidSaveTextDocumentNotification=hn={}));var mn;(function(u){u.Manual=1,u.AfterDelay=2,u.FocusOut=3})(mn||(e.TextDocumentSaveReason=mn={}));var wn;(function(u){u.method="textDocument/willSave",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(wn||(e.WillSaveTextDocumentNotification=wn={}));var pn;(function(u){u.method="textDocument/willSaveWaitUntil",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(pn||(e.WillSaveTextDocumentWaitUntilRequest=pn={}));var Ne;(function(u){u.method="workspace/didChangeWatchedFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(Ne||(e.DidChangeWatchedFilesNotification=Ne={}));var yn;(function(u){u.Created=1,u.Changed=2,u.Deleted=3})(yn||(e.FileChangeType=yn={}));var yr;(function(u){function de(le){const F=le;return i.objectLiteral(F)&&(n.URI.is(F.baseUri)||n.WorkspaceFolder.is(F.baseUri))&&i.string(F.pattern)}u.is=de})(yr||(e.RelativePattern=yr={}));var vr;(function(u){u.Create=1,u.Change=2,u.Delete=4})(vr||(e.WatchKind=vr={}));var Rr;(function(u){u.method="textDocument/publishDiagnostics",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolNotificationType(u.method)})(Rr||(e.PublishDiagnosticsNotification=Rr={}));var Dr;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.TriggerForIncompleteCompletions=3})(Dr||(e.CompletionTriggerKind=Dr={}));var vn;(function(u){u.method="textDocument/completion",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(vn||(e.CompletionRequest=vn={}));var Rn;(function(u){u.method="completionItem/resolve",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Rn||(e.CompletionResolveRequest=Rn={}));var Ye;(function(u){u.method="textDocument/hover",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Ye||(e.HoverRequest=Ye={}));var Dn;(function(u){u.Invoked=1,u.TriggerCharacter=2,u.ContentChange=3})(Dn||(e.SignatureHelpTriggerKind=Dn={}));var Tr;(function(u){u.method="textDocument/signatureHelp",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Tr||(e.SignatureHelpRequest=Tr={}));var kr;(function(u){u.method="textDocument/definition",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(kr||(e.DefinitionRequest=kr={}));var Tn;(function(u){u.method="textDocument/references",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Tn||(e.ReferencesRequest=Tn={}));var kn;(function(u){u.method="textDocument/documentHighlight",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(kn||(e.DocumentHighlightRequest=kn={}));var Pr;(function(u){u.method="textDocument/documentSymbol",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Pr||(e.DocumentSymbolRequest=Pr={}));var Sr;(function(u){u.method="textDocument/codeAction",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Sr||(e.CodeActionRequest=Sr={}));var Cr;(function(u){u.method="codeAction/resolve",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Cr||(e.CodeActionResolveRequest=Cr={}));var qr;(function(u){u.method="workspace/symbol",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(qr||(e.WorkspaceSymbolRequest=qr={}));var Mr;(function(u){u.method="workspaceSymbol/resolve",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Mr||(e.WorkspaceSymbolResolveRequest=Mr={}));var Or;(function(u){u.method="textDocument/codeLens",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Or||(e.CodeLensRequest=Or={}));var je;(function(u){u.method="codeLens/resolve",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(je||(e.CodeLensResolveRequest=je={}));var Er;(function(u){u.method="workspace/codeLens/refresh",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType0(u.method)})(Er||(e.CodeLensRefreshRequest=Er={}));var Nr;(function(u){u.method="textDocument/documentLink",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Nr||(e.DocumentLinkRequest=Nr={}));var Ct;(function(u){u.method="documentLink/resolve",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Ct||(e.DocumentLinkResolveRequest=Ct={}));var jr;(function(u){u.method="textDocument/formatting",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(jr||(e.DocumentFormattingRequest=jr={}));var Jt;(function(u){u.method="textDocument/rangeFormatting",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Jt||(e.DocumentRangeFormattingRequest=Jt={}));var Fr;(function(u){u.method="textDocument/rangesFormatting",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Fr||(e.DocumentRangesFormattingRequest=Fr={}));var Ke;(function(u){u.method="textDocument/onTypeFormatting",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Ke||(e.DocumentOnTypeFormattingRequest=Ke={}));var ft;(function(u){u.Identifier=1})(ft||(e.PrepareSupportDefaultBehavior=ft={}));var Ir;(function(u){u.method="textDocument/rename",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Ir||(e.RenameRequest=Ir={}));var Ar;(function(u){u.method="textDocument/prepareRename",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(Ar||(e.PrepareRenameRequest=Ar={}));var gt;(function(u){u.method="workspace/executeCommand",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(gt||(e.ExecuteCommandRequest=gt={}));var Pn;(function(u){u.method="workspace/applyEdit",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType("workspace/applyEdit")})(Pn||(e.ApplyWorkspaceEditRequest=Pn={}))}(Ao);var tr={};Object.defineProperty(tr,"__esModule",{value:!0}),tr.createProtocolConnection=void 0;const Ys=bt;function da(e,t,n,i){return Ys.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,Ys.createMessageConnection)(e,t,n,i)}tr.createProtocolConnection=da,function(e){var t=ge&&ge.__createBinding||(Object.create?function(o,c,a,l){l===void 0&&(l=a);var f=Object.getOwnPropertyDescriptor(c,a);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[a]}}),Object.defineProperty(o,l,f)}:function(o,c,a,l){l===void 0&&(l=a),o[l]=c[a]}),n=ge&&ge.__exportStar||function(o,c){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(c,a)&&t(c,o,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(bt,e),n(Xi,e),n(z,e),n(Ao,e);var i=tr;Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}});var r;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(r||(e.LSPErrorCodes=r={}))}(jo),function(e){var t=ge&&ge.__createBinding||(Object.create?function(o,c,a,l){l===void 0&&(l=a);var f=Object.getOwnPropertyDescriptor(c,a);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[a]}}),Object.defineProperty(o,l,f)}:function(o,c,a,l){l===void 0&&(l=a),o[l]=c[a]}),n=ge&&ge.__exportStar||function(o,c){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(c,a)&&t(c,o,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;const i=No;n(No,e),n(jo,e);function r(o,c,a,l){return(0,i.createMessageConnection)(o,c,a,l)}e.createProtocolConnection=r}(ce),Object.defineProperty(Be,"__esModule",{value:!0}),Be.SemanticTokensBuilder=Be.SemanticTokensDiff=Be.SemanticTokensFeature=void 0;const nr=ce,la=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(nr.SemanticTokensRefreshRequest.type),on:t=>{const n=nr.SemanticTokensRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))},onDelta:t=>{const n=nr.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))},onRange:t=>{const n=nr.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))}}}};Be.SemanticTokensFeature=la;class Ks{constructor(t,n){this.originalSequence=t,this.modifiedSequence=n}computeDiff(){const t=this.originalSequence.length,n=this.modifiedSequence.length;let i=0;for(;i=i&&o>=i&&this.originalSequence[r]===this.modifiedSequence[o];)r--,o--;(r0&&(c-=this._prevLine,c===0&&(a-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=r,this._data[this._dataLen++]=o,this._prevLine=t,this._prevChar=n}get id(){return this._id.toString()}previousResult(t){this.id===t&&(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 Ks(this._prevData,this._data).computeDiff()}:this.build()}}Be.SemanticTokensBuilder=fa;var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.InlineCompletionFeature=void 0;const ga=ce,_a=e=>class extends e{get inlineCompletion(){return{on:t=>this.connection.onRequest(ga.InlineCompletionRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n)))}}};rr.InlineCompletionFeature=_a;var _n={};Object.defineProperty(_n,"__esModule",{value:!0}),_n.TextDocuments=void 0;const Rt=ce;class ba{constructor(t){this._configuration=t,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(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=Rt.TextDocumentSyncKind.Incremental;const n=[];return n.push(t.onDidOpenTextDocument(i=>{const r=i.textDocument,o=this._configuration.create(r.uri,r.languageId,r.version,r.text);this._syncedDocuments.set(r.uri,o);const c=Object.freeze({document:o});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),n.push(t.onDidChangeTextDocument(i=>{const r=i.textDocument,o=i.contentChanges;if(o.length===0)return;const{version:c}=r;if(c==null)throw new Error(`Received document change event for ${r.uri} without valid version identifier`);let a=this._syncedDocuments.get(r.uri);a!==void 0&&(a=this._configuration.update(a,o,c),this._syncedDocuments.set(r.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(t.onDidCloseTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&(this._syncedDocuments.delete(i.textDocument.uri),this._onDidClose.fire(Object.freeze({document:r})))})),n.push(t.onWillSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onWillSave.fire(Object.freeze({document:r,reason:i.reason}))})),n.push(t.onWillSaveTextDocumentWaitUntil((i,r)=>{let o=this._syncedDocuments.get(i.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:i.reason}),r):[]})),n.push(t.onDidSaveTextDocument(i=>{let r=this._syncedDocuments.get(i.textDocument.uri);r!==void 0&&this._onDidSave.fire(Object.freeze({document:r}))})),Rt.Disposable.create(()=>{n.forEach(i=>i.dispose())})}}_n.TextDocuments=ba;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.NotebookDocuments=Dt.NotebookSyncFeature=void 0;const Se=ce,Gs=_n,ha=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:t=>this.connection.onNotification(Se.DidOpenNotebookDocumentNotification.type,n=>{t(n)}),onDidChangeNotebookDocument:t=>this.connection.onNotification(Se.DidChangeNotebookDocumentNotification.type,n=>{t(n)}),onDidSaveNotebookDocument:t=>this.connection.onNotification(Se.DidSaveNotebookDocumentNotification.type,n=>{t(n)}),onDidCloseNotebookDocument:t=>this.connection.onNotification(Se.DidCloseNotebookDocumentNotification.type,n=>{t(n)})}}};Dt.NotebookSyncFeature=ha;class zt{onDidOpenTextDocument(t){return this.openHandler=t,Se.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,Se.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,Se.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return zt.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return zt.NULL_DISPOSE}onDidSaveTextDocument(){return zt.NULL_DISPOSE}}zt.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class ma{constructor(t){t instanceof Gs.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new Gs.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Se.Emitter,this._onDidChange=new Se.Emitter,this._onDidSave=new Se.Emitter,this._onDidClose=new Se.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){const n=this.notebookCellMap.get(t);return n&&n[0]}findNotebookDocumentForCell(t){const n=typeof t=="string"?t:t.document,i=this.notebookCellMap.get(n);return i&&i[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(t){const n=new zt,i=[];return i.push(this.cellTextDocuments.listen(n)),i.push(t.notebooks.synchronization.onDidOpenNotebookDocument(r=>{this.notebookDocuments.set(r.notebookDocument.uri,r.notebookDocument);for(const o of r.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(r.notebookDocument),this._onDidOpen.fire(r.notebookDocument)})),i.push(t.notebooks.synchronization.onDidChangeNotebookDocument(r=>{const o=this.notebookDocuments.get(r.notebookDocument.uri);if(o===void 0)return;o.version=r.notebookDocument.version;const c=o.metadata;let a=!1;const l=r.change;l.metadata!==void 0&&(a=!0,o.metadata=l.metadata);const f=[],_=[],p=[],v=[];if(l.cells!==void 0){const W=l.cells;if(W.structure!==void 0){const m=W.structure.array;if(o.cells.splice(m.start,m.deleteCount,...m.cells!==void 0?m.cells:[]),W.structure.didOpen!==void 0)for(const w of W.structure.didOpen)n.openTextDocument({textDocument:w}),f.push(w.uri);if(W.structure.didClose)for(const w of W.structure.didClose)n.closeTextDocument({textDocument:w}),_.push(w.uri)}if(W.data!==void 0){const m=new Map(W.data.map(w=>[w.document,w]));for(let w=0;w<=o.cells.length;w++){const T=m.get(o.cells[w].document);if(T!==void 0){const ue=o.cells.splice(w,1,T);if(p.push({old:ue[0],new:T}),m.delete(T.document),m.size===0)break}}}if(W.textContent!==void 0)for(const m of W.textContent)n.changeTextDocument({textDocument:m.document,contentChanges:m.changes}),v.push(m.document.uri)}this.updateCellMap(o);const D={notebookDocument:o};a&&(D.metadata={old:c,new:o.metadata});const C=[];for(const W of f)C.push(this.getNotebookCell(W));const J=[];for(const W of _)J.push(this.getNotebookCell(W));const Y=[];for(const W of v)Y.push(this.getNotebookCell(W));(C.length>0||J.length>0||p.length>0||Y.length>0)&&(D.cells={added:C,removed:J,changed:{data:p,textContent:Y}}),(D.metadata!==void 0||D.cells!==void 0)&&this._onDidChange.fire(D)})),i.push(t.notebooks.synchronization.onDidSaveNotebookDocument(r=>{const o=this.notebookDocuments.get(r.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),i.push(t.notebooks.synchronization.onDidCloseNotebookDocument(r=>{const o=this.notebookDocuments.get(r.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(const c of r.cellTextDocuments)n.closeTextDocument({textDocument:c});this.notebookDocuments.delete(r.notebookDocument.uri);for(const c of o.cells)this.notebookCellMap.delete(c.document)}})),Se.Disposable.create(()=>{i.forEach(r=>r.dispose())})}updateCellMap(t){for(const n of t.cells)this.notebookCellMap.set(n.document,[n,t])}}Dt.NotebookDocuments=ma;var U={},ae={};Object.defineProperty(ae,"__esModule",{value:!0}),ae.thenable=ae.typedArray=ae.stringArray=ae.array=ae.func=ae.error=ae.number=ae.string=ae.boolean=void 0;function wa(e){return e===!0||e===!1}ae.boolean=wa;function Zs(e){return typeof e=="string"||e instanceof String}ae.string=Zs;function pa(e){return typeof e=="number"||e instanceof Number}ae.number=pa;function ya(e){return e instanceof Error}ae.error=ya;function ec(e){return typeof e=="function"}ae.func=ec;function tc(e){return Array.isArray(e)}ae.array=tc;function va(e){return tc(e)&&e.every(t=>Zs(t))}ae.stringArray=va;function Ra(e,t){return Array.isArray(e)&&e.every(t)}ae.typedArray=Ra;function Da(e){return e&&ec(e.then)}ae.thenable=Da;var De={};Object.defineProperty(De,"__esModule",{value:!0}),De.generateUuid=De.parse=De.isUUID=De.v4=De.empty=void 0;class Ki{constructor(t){this._value=t}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}}class $ extends Ki{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return $._oneOf($._chars)}constructor(){super([$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),"-",$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),"-","4",$._randomHex(),$._randomHex(),$._randomHex(),"-",$._oneOf($._timeHighBits),$._randomHex(),$._randomHex(),$._randomHex(),"-",$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex(),$._randomHex()].join(""))}}$._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],$._timeHighBits=["8","9","a","b"],De.empty=new Ki("00000000-0000-0000-0000-000000000000");function nc(){return new $}De.v4=nc;const Ta=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function rc(e){return Ta.test(e)}De.isUUID=rc;function ka(e){if(!rc(e))throw new Error("invalid uuid");return new Ki(e)}De.parse=ka;function Pa(){return nc().asHex()}De.generateUuid=Pa;var it={};Object.defineProperty(it,"__esModule",{value:!0}),it.attachPartialResult=it.ProgressFeature=it.attachWorkDone=void 0;const ot=ce,Sa=De;class st{constructor(t,n){this._connection=t,this._token=n,st.Instances.set(this._token,this)}begin(t,n,i,r){let o={kind:"begin",title:t,percentage:n,message:i,cancellable:r};this._connection.sendProgress(ot.WorkDoneProgress.type,this._token,o)}report(t,n){let i={kind:"report"};typeof t=="number"?(i.percentage=t,n!==void 0&&(i.message=n)):i.message=t,this._connection.sendProgress(ot.WorkDoneProgress.type,this._token,i)}done(){st.Instances.delete(this._token),this._connection.sendProgress(ot.WorkDoneProgress.type,this._token,{kind:"end"})}}st.Instances=new Map;class ic extends st{constructor(t,n){super(t,n),this._source=new ot.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class Gi{constructor(){}begin(){}report(){}done(){}}class oc extends Gi{constructor(){super(),this._source=new ot.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function Ca(e,t){if(t===void 0||t.workDoneToken===void 0)return new Gi;const n=t.workDoneToken;return delete t.workDoneToken,new st(e,n)}it.attachWorkDone=Ca;const qa=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(ot.WorkDoneProgressCancelNotification.type,n=>{let i=st.Instances.get(n.token);(i instanceof ic||i instanceof oc)&&i.cancel()}))}attachWorkDoneProgress(t){return t===void 0?new Gi:new st(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){const t=(0,Sa.generateUuid)();return this.connection.sendRequest(ot.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new ic(this.connection,t))}else return Promise.resolve(new oc)}};it.ProgressFeature=qa;var Zi;(function(e){e.type=new ot.ProgressType})(Zi||(Zi={}));class Ma{constructor(t,n){this._connection=t,this._token=n}report(t){this._connection.sendProgress(Zi.type,this._token,t)}}function Oa(e,t){if(t===void 0||t.partialResultToken===void 0)return;const n=t.partialResultToken;return delete t.partialResultToken,new Ma(e,n)}it.attachPartialResult=Oa;var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.ConfigurationFeature=void 0;const Ea=ce,Na=ae,ja=e=>class extends e{getConfiguration(t){return t?Na.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let n={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(Ea.ConfigurationRequest.type,n).then(i=>Array.isArray(i)?Array.isArray(t)?i:i[0]:Array.isArray(t)?[]:null)}};ir.ConfigurationFeature=ja;var or={};Object.defineProperty(or,"__esModule",{value:!0}),or.WorkspaceFoldersFeature=void 0;const sr=ce,Fa=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(t){super.initialize(t);let n=t.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new sr.Emitter,this.connection.onNotification(sr.DidChangeWorkspaceFoldersNotification.type,i=>{this._onDidChangeWorkspaceFolders.fire(i.event)}))}fillServerCapabilities(t){super.fillServerCapabilities(t);const n=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(sr.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(sr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};or.WorkspaceFoldersFeature=Fa;var cr={};Object.defineProperty(cr,"__esModule",{value:!0}),cr.CallHierarchyFeature=void 0;const eo=ce,Ia=e=>class extends e{get callHierarchy(){return{onPrepare:t=>this.connection.onRequest(eo.CallHierarchyPrepareRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:t=>{const n=eo.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))},onOutgoingCalls:t=>{const n=eo.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))}}}};cr.CallHierarchyFeature=Ia;var ar={};Object.defineProperty(ar,"__esModule",{value:!0}),ar.ShowDocumentFeature=void 0;const Aa=ce,La=e=>class extends e{showDocument(t){return this.connection.sendRequest(Aa.ShowDocumentRequest.type,t)}};ar.ShowDocumentFeature=La;var ur={};Object.defineProperty(ur,"__esModule",{value:!0}),ur.FileOperationsFeature=void 0;const Bt=ce,Wa=e=>class extends e{onDidCreateFiles(t){return this.connection.onNotification(Bt.DidCreateFilesNotification.type,n=>{t(n)})}onDidRenameFiles(t){return this.connection.onNotification(Bt.DidRenameFilesNotification.type,n=>{t(n)})}onDidDeleteFiles(t){return this.connection.onNotification(Bt.DidDeleteFilesNotification.type,n=>{t(n)})}onWillCreateFiles(t){return this.connection.onRequest(Bt.WillCreateFilesRequest.type,(n,i)=>t(n,i))}onWillRenameFiles(t){return this.connection.onRequest(Bt.WillRenameFilesRequest.type,(n,i)=>t(n,i))}onWillDeleteFiles(t){return this.connection.onRequest(Bt.WillDeleteFilesRequest.type,(n,i)=>t(n,i))}};ur.FileOperationsFeature=Wa;var dr={};Object.defineProperty(dr,"__esModule",{value:!0}),dr.LinkedEditingRangeFeature=void 0;const Ha=ce,$a=e=>class extends e{onLinkedEditingRange(t){return this.connection.onRequest(Ha.LinkedEditingRangeRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0))}};dr.LinkedEditingRangeFeature=$a;var lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.TypeHierarchyFeature=void 0;const to=ce,xa=e=>class extends e{get typeHierarchy(){return{onPrepare:t=>this.connection.onRequest(to.TypeHierarchyPrepareRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),void 0)),onSupertypes:t=>{const n=to.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))},onSubtypes:t=>{const n=to.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))}}}};lr.TypeHierarchyFeature=xa;var fr={};Object.defineProperty(fr,"__esModule",{value:!0}),fr.InlineValueFeature=void 0;const sc=ce,za=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(sc.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(sc.InlineValueRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n)))}}};fr.InlineValueFeature=za;var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.FoldingRangeFeature=void 0;const cc=ce,Ba=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(cc.FoldingRangeRefreshRequest.type),on:t=>{const n=cc.FoldingRangeRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))}}}};gr.FoldingRangeFeature=Ba;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.InlayHintFeature=void 0;const no=ce,Ua=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(no.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest(no.InlayHintRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n))),resolve:t=>this.connection.onRequest(no.InlayHintResolveRequest.type,(n,i)=>t(n,i))}}};_r.InlayHintFeature=Ua;var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.DiagnosticFeature=void 0;const bn=ce,Va=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(bn.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(bn.DocumentDiagnosticRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(bn.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:t=>this.connection.onRequest(bn.WorkspaceDiagnosticRequest.type,(n,i)=>t(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(bn.WorkspaceDiagnosticRequest.partialResult,n)))}}};br.DiagnosticFeature=Va;var hr={};Object.defineProperty(hr,"__esModule",{value:!0}),hr.MonikerFeature=void 0;const Ja=ce,Xa=e=>class extends e{get moniker(){return{on:t=>{const n=Ja.MonikerRequest.type;return this.connection.onRequest(n,(i,r)=>t(i,r,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(n,i)))}}}};hr.MonikerFeature=Xa,Object.defineProperty(U,"__esModule",{value:!0}),U.createConnection=U.combineFeatures=U.combineNotebooksFeatures=U.combineLanguagesFeatures=U.combineWorkspaceFeatures=U.combineWindowFeatures=U.combineClientFeatures=U.combineTracerFeatures=U.combineTelemetryFeatures=U.combineConsoleFeatures=U._NotebooksImpl=U._LanguagesImpl=U.BulkUnregistration=U.BulkRegistration=U.ErrorMessageTracker=void 0;const P=ce,Ce=ae,ro=De,I=it,Qa=ir,Ya=or,Ka=cr,Ga=Be,Za=ar,eu=ur,tu=dr,nu=lr,ru=fr,iu=gr,ou=_r,su=br,cu=Dt,au=hr;function io(e){if(e!==null)return e}class uu{constructor(){this._messages=Object.create(null)}add(t){let n=this._messages[t];n||(n=0),n++,this._messages[t]=n}sendErrors(t){Object.keys(this._messages).forEach(n=>{t.window.showErrorMessage(n)})}}U.ErrorMessageTracker=uu;class ac{constructor(){}rawAttach(t){this._rawConnection=t}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(P.MessageType.Error,t)}warn(t){this.send(P.MessageType.Warning,t)}info(t){this.send(P.MessageType.Info,t)}log(t){this.send(P.MessageType.Log,t)}debug(t){this.send(P.MessageType.Debug,t)}send(t,n){this._rawConnection&&this._rawConnection.sendNotification(P.LogMessageNotification.type,{type:t,message:n}).catch(()=>{(0,P.RAL)().console.error("Sending log message failed")})}}class du{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...n){let i={type:P.MessageType.Error,message:t,actions:n};return this.connection.sendRequest(P.ShowMessageRequest.type,i).then(io)}showWarningMessage(t,...n){let i={type:P.MessageType.Warning,message:t,actions:n};return this.connection.sendRequest(P.ShowMessageRequest.type,i).then(io)}showInformationMessage(t,...n){let i={type:P.MessageType.Info,message:t,actions:n};return this.connection.sendRequest(P.ShowMessageRequest.type,i).then(io)}}const uc=(0,Za.ShowDocumentFeature)((0,I.ProgressFeature)(du));var dc;(function(e){function t(){return new lc}e.create=t})(dc||(U.BulkRegistration=dc={}));class lc{constructor(){this._registrations=[],this._registered=new Set}add(t,n){const i=Ce.string(t)?t:t.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);const r=ro.generateUuid();this._registrations.push({id:r,method:i,registerOptions:n||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}}var fc;(function(e){function t(){return new oo(void 0,[])}e.create=t})(fc||(U.BulkUnregistration=fc={}));class oo{constructor(t,n){this._connection=t,this._unregistrations=new Map,n.forEach(i=>{this._unregistrations.set(i.method,i)})}get isAttached(){return!!this._connection}attach(t){this._connection=t}add(t){this._unregistrations.set(t.method,t)}dispose(){let t=[];for(let i of this._unregistrations.values())t.push(i);let n={unregisterations:t};this._connection.sendRequest(P.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(t){const n=Ce.string(t)?t:t.method,i=this._unregistrations.get(n);if(!i)return!1;let r={unregisterations:[i]};return this._connection.sendRequest(P.UnregistrationRequest.type,r).then(()=>{this._unregistrations.delete(n)},o=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}}class gc{attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,n,i){return t instanceof lc?this.registerMany(t):t instanceof oo?this.registerSingle1(t,n,i):this.registerSingle2(t,n)}registerSingle1(t,n,i){const r=Ce.string(n)?n:n.method,o=ro.generateUuid();let c={registrations:[{id:o,method:r,registerOptions:i||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(P.RegistrationRequest.type,c).then(a=>(t.add({id:o,method:r}),t),a=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(a)))}registerSingle2(t,n){const i=Ce.string(t)?t:t.method,r=ro.generateUuid();let o={registrations:[{id:r,method:i,registerOptions:n||{}}]};return this.connection.sendRequest(P.RegistrationRequest.type,o).then(c=>P.Disposable.create(()=>{this.unregisterSingle(r,i).catch(()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(c)))}unregisterSingle(t,n){let i={unregisterations:[{id:t,method:n}]};return this.connection.sendRequest(P.UnregistrationRequest.type,i).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`)})}registerMany(t){let n=t.asRegistrationParams();return this.connection.sendRequest(P.RegistrationRequest.type,n).then(()=>new oo(this._connection,n.registrations.map(i=>({id:i.id,method:i.method}))),i=>(this.connection.console.info("Bulk registration failed."),Promise.reject(i)))}}class lu{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function n(r){return r&&!!r.edit}let i=n(t)?t:{edit:t};return this.connection.sendRequest(P.ApplyWorkspaceEditRequest.type,i)}}const _c=(0,eu.FileOperationsFeature)((0,Ya.WorkspaceFoldersFeature)((0,Qa.ConfigurationFeature)(lu)));class bc{constructor(){this._trace=P.Trace.Off}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t}log(t,n){this._trace!==P.Trace.Off&&this.connection.sendNotification(P.LogTraceNotification.type,{message:t,verbose:this._trace===P.Trace.Verbose?n:void 0}).catch(()=>{})}}class hc{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(P.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class mc{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,I.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,I.attachPartialResult)(this.connection,n)}}U._LanguagesImpl=mc;const wc=(0,iu.FoldingRangeFeature)((0,au.MonikerFeature)((0,su.DiagnosticFeature)((0,ou.InlayHintFeature)((0,ru.InlineValueFeature)((0,nu.TypeHierarchyFeature)((0,tu.LinkedEditingRangeFeature)((0,Ga.SemanticTokensFeature)((0,Ka.CallHierarchyFeature)(mc)))))))));class pc{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,I.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,I.attachPartialResult)(this.connection,n)}}U._NotebooksImpl=pc;const yc=(0,cu.NotebookSyncFeature)(pc);function vc(e,t){return function(n){return t(e(n))}}U.combineConsoleFeatures=vc;function Rc(e,t){return function(n){return t(e(n))}}U.combineTelemetryFeatures=Rc;function Dc(e,t){return function(n){return t(e(n))}}U.combineTracerFeatures=Dc;function Tc(e,t){return function(n){return t(e(n))}}U.combineClientFeatures=Tc;function kc(e,t){return function(n){return t(e(n))}}U.combineWindowFeatures=kc;function Pc(e,t){return function(n){return t(e(n))}}U.combineWorkspaceFeatures=Pc;function Sc(e,t){return function(n){return t(e(n))}}U.combineLanguagesFeatures=Sc;function Cc(e,t){return function(n){return t(e(n))}}U.combineNotebooksFeatures=Cc;function fu(e,t){function n(r,o,c){return r&&o?c(r,o):r||o}return{__brand:"features",console:n(e.console,t.console,vc),tracer:n(e.tracer,t.tracer,Dc),telemetry:n(e.telemetry,t.telemetry,Rc),client:n(e.client,t.client,Tc),window:n(e.window,t.window,kc),workspace:n(e.workspace,t.workspace,Pc),languages:n(e.languages,t.languages,Sc),notebooks:n(e.notebooks,t.notebooks,Cc)}}U.combineFeatures=fu;function gu(e,t,n){const i=n&&n.console?new(n.console(ac)):new ac,r=e(i);i.rawAttach(r);const o=n&&n.tracer?new(n.tracer(bc)):new bc,c=n&&n.telemetry?new(n.telemetry(hc)):new hc,a=n&&n.client?new(n.client(gc)):new gc,l=n&&n.window?new(n.window(uc)):new uc,f=n&&n.workspace?new(n.workspace(_c)):new _c,_=n&&n.languages?new(n.languages(wc)):new wc,p=n&&n.notebooks?new(n.notebooks(yc)):new yc,v=[i,o,c,a,l,f,_,p];function D(m){return m instanceof Promise?m:Ce.thenable(m)?new Promise((w,T)=>{m.then(ue=>w(ue),ue=>T(ue))}):Promise.resolve(m)}let C,J,Y,W={listen:()=>r.listen(),sendRequest:(m,...w)=>r.sendRequest(Ce.string(m)?m:m.method,...w),onRequest:(m,w)=>r.onRequest(m,w),sendNotification:(m,w)=>{const T=Ce.string(m)?m:m.method;return r.sendNotification(T,w)},onNotification:(m,w)=>r.onNotification(m,w),onProgress:r.onProgress,sendProgress:r.sendProgress,onInitialize:m=>(J=m,{dispose:()=>{J=void 0}}),onInitialized:m=>r.onNotification(P.InitializedNotification.type,m),onShutdown:m=>(C=m,{dispose:()=>{C=void 0}}),onExit:m=>(Y=m,{dispose:()=>{Y=void 0}}),get console(){return i},get telemetry(){return c},get tracer(){return o},get client(){return a},get window(){return l},get workspace(){return f},get languages(){return _},get notebooks(){return p},onDidChangeConfiguration:m=>r.onNotification(P.DidChangeConfigurationNotification.type,m),onDidChangeWatchedFiles:m=>r.onNotification(P.DidChangeWatchedFilesNotification.type,m),__textDocumentSync:void 0,onDidOpenTextDocument:m=>r.onNotification(P.DidOpenTextDocumentNotification.type,m),onDidChangeTextDocument:m=>r.onNotification(P.DidChangeTextDocumentNotification.type,m),onDidCloseTextDocument:m=>r.onNotification(P.DidCloseTextDocumentNotification.type,m),onWillSaveTextDocument:m=>r.onNotification(P.WillSaveTextDocumentNotification.type,m),onWillSaveTextDocumentWaitUntil:m=>r.onRequest(P.WillSaveTextDocumentWaitUntilRequest.type,m),onDidSaveTextDocument:m=>r.onNotification(P.DidSaveTextDocumentNotification.type,m),sendDiagnostics:m=>r.sendNotification(P.PublishDiagnosticsNotification.type,m),onHover:m=>r.onRequest(P.HoverRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),void 0)),onCompletion:m=>r.onRequest(P.CompletionRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onCompletionResolve:m=>r.onRequest(P.CompletionResolveRequest.type,m),onSignatureHelp:m=>r.onRequest(P.SignatureHelpRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),void 0)),onDeclaration:m=>r.onRequest(P.DeclarationRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onDefinition:m=>r.onRequest(P.DefinitionRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onTypeDefinition:m=>r.onRequest(P.TypeDefinitionRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onImplementation:m=>r.onRequest(P.ImplementationRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onReferences:m=>r.onRequest(P.ReferencesRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onDocumentHighlight:m=>r.onRequest(P.DocumentHighlightRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onDocumentSymbol:m=>r.onRequest(P.DocumentSymbolRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onWorkspaceSymbol:m=>r.onRequest(P.WorkspaceSymbolRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onWorkspaceSymbolResolve:m=>r.onRequest(P.WorkspaceSymbolResolveRequest.type,m),onCodeAction:m=>r.onRequest(P.CodeActionRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onCodeActionResolve:m=>r.onRequest(P.CodeActionResolveRequest.type,(w,T)=>m(w,T)),onCodeLens:m=>r.onRequest(P.CodeLensRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onCodeLensResolve:m=>r.onRequest(P.CodeLensResolveRequest.type,(w,T)=>m(w,T)),onDocumentFormatting:m=>r.onRequest(P.DocumentFormattingRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),void 0)),onDocumentRangeFormatting:m=>r.onRequest(P.DocumentRangeFormattingRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),void 0)),onDocumentOnTypeFormatting:m=>r.onRequest(P.DocumentOnTypeFormattingRequest.type,(w,T)=>m(w,T)),onRenameRequest:m=>r.onRequest(P.RenameRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),void 0)),onPrepareRename:m=>r.onRequest(P.PrepareRenameRequest.type,(w,T)=>m(w,T)),onDocumentLinks:m=>r.onRequest(P.DocumentLinkRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onDocumentLinkResolve:m=>r.onRequest(P.DocumentLinkResolveRequest.type,(w,T)=>m(w,T)),onDocumentColor:m=>r.onRequest(P.DocumentColorRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onColorPresentation:m=>r.onRequest(P.ColorPresentationRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onFoldingRanges:m=>r.onRequest(P.FoldingRangeRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onSelectionRanges:m=>r.onRequest(P.SelectionRangeRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),(0,I.attachPartialResult)(r,w))),onExecuteCommand:m=>r.onRequest(P.ExecuteCommandRequest.type,(w,T)=>m(w,T,(0,I.attachWorkDone)(r,w),void 0)),dispose:()=>r.dispose()};for(let m of v)m.attach(W);return r.onRequest(P.InitializeRequest.type,m=>{t.initialize(m),Ce.string(m.trace)&&(o.trace=P.Trace.fromString(m.trace));for(let w of v)w.initialize(m.capabilities);if(J){let w=J(m,new P.CancellationTokenSource().token,(0,I.attachWorkDone)(r,m),void 0);return D(w).then(T=>{if(T instanceof P.ResponseError)return T;let ue=T;ue||(ue={capabilities:{}});let ee=ue.capabilities;ee||(ee={},ue.capabilities=ee),ee.textDocumentSync===void 0||ee.textDocumentSync===null?ee.textDocumentSync=Ce.number(W.__textDocumentSync)?W.__textDocumentSync:P.TextDocumentSyncKind.None:!Ce.number(ee.textDocumentSync)&&!Ce.number(ee.textDocumentSync.change)&&(ee.textDocumentSync.change=Ce.number(W.__textDocumentSync)?W.__textDocumentSync:P.TextDocumentSyncKind.None);for(let be of v)be.fillServerCapabilities(ee);return ue})}else{let w={capabilities:{textDocumentSync:P.TextDocumentSyncKind.None}};for(let T of v)T.fillServerCapabilities(w.capabilities);return w}}),r.onRequest(P.ShutdownRequest.type,()=>{if(t.shutdownReceived=!0,C)return C(new P.CancellationTokenSource().token)}),r.onNotification(P.ExitNotification.type,()=>{try{Y&&Y()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}}),r.onNotification(P.SetTraceNotification.type,m=>{o.trace=P.Trace.fromString(m.value)}),W}U.createConnection=gu,function(e){var t=ge&&ge.__createBinding||(Object.create?function(l,f,_,p){p===void 0&&(p=_);var v=Object.getOwnPropertyDescriptor(f,_);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[_]}}),Object.defineProperty(l,p,v)}:function(l,f,_,p){p===void 0&&(p=_),l[p]=f[_]}),n=ge&&ge.__exportStar||function(l,f){for(var _ in l)_!=="default"&&!Object.prototype.hasOwnProperty.call(f,_)&&t(f,l,_)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProposedFeatures=e.NotebookDocuments=e.TextDocuments=e.SemanticTokensBuilder=void 0;const i=Be;Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return i.SemanticTokensBuilder}});const r=rr;n(ce,e);const o=_n;Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return o.TextDocuments}});const c=Dt;Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return c.NotebookDocuments}}),n(U,e);var a;(function(l){l.all={__brand:"features",languages:r.InlineCompletionFeature}})(a||(e.ProposedFeatures=a={}))}($r);var _u=ce;(function(e){var t=ge&&ge.__createBinding||(Object.create?function(a,l,f,_){_===void 0&&(_=f);var p=Object.getOwnPropertyDescriptor(l,f);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[f]}}),Object.defineProperty(a,_,p)}:function(a,l,f,_){_===void 0&&(_=f),a[_]=l[f]}),n=ge&&ge.__exportStar||function(a,l){for(var f in a)f!=="default"&&!Object.prototype.hasOwnProperty.call(l,f)&&t(l,a,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=void 0;const i=$r;n(_u,e),n($r,e);let r=!1;const o={initialize:a=>{},get shutdownReceived(){return r},set shutdownReceived(a){r=a},exit:a=>{}};function c(a,l,f,_){let p,v,D,C;a!==void 0&&a.__brand==="features"&&(p=a,a=l,l=f,f=_),i.ConnectionStrategy.is(a)||i.ConnectionOptions.is(a)?C=a:(v=a,D=l,C=f);const J=Y=>(0,i.createProtocolConnection)(v,D,Y,C);return(0,i.createConnection)(J,o,p)}e.createConnection=c})(_o);var so=_o;go({}).then(()=>{const e=new so.BrowserMessageReader(self),t=new so.BrowserMessageWriter(self);let n;const i=so.createConnection(e,t);function r(a,l){return i.sendNotification(a,l),!0}async function o(a,l){return await i.sendRequest(a,l)}async function c(a){return await i.sendRequest("slint/load_file",a)}i.onInitialize(a=>(n=Oc(a,r,o,c),n.server_initialize_result(a.capabilities))),i.onRequest(async(a,l,f)=>await n.handle_request(f,a,l)),i.onNotification("slint/preview_to_lsp",async a=>{await n.process_preview_to_lsp_message(a)}),i.onDidChangeTextDocument(async a=>{await n.reload_document(a.contentChanges[a.contentChanges.length-1].text,a.textDocument.uri,a.textDocument.version)}),i.onDidOpenTextDocument(async a=>{await n.reload_document(a.textDocument.text,a.textDocument.uri,a.textDocument.version)}),i.onDidChangeConfiguration(async a=>{await n.reload_config()}),i.listen(),self.postMessage("OK")})})(); diff --git a/snapshots/master/editor/assets/preview-DQheKQwQ.js b/snapshots/master/editor/assets/preview-BsB6EGDd.js similarity index 99% rename from snapshots/master/editor/assets/preview-DQheKQwQ.js rename to snapshots/master/editor/assets/preview-BsB6EGDd.js index b557068ef..ffaaffc69 100644 --- a/snapshots/master/editor/assets/preview-DQheKQwQ.js +++ b/snapshots/master/editor/assets/preview-BsB6EGDd.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 D=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ee=typeof D.encodeInto=="function"?function(n,e){return D.encodeInto(n,e)}:function(n,e){const t=D.encode(n);return e.set(t),{read:n.length,written:t.length}};function m(n,e,t){if(t===void 0){const g=D.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 L=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,L.unregister(c))}};return o.original=c,L.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__h146a5aa9c088bf22(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),L.unregister(c)):c.a=g}};return o.original=c,L.register(o,c,c),o}function $(n,e){a._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h05bf02fe019468a2(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30f924960e3aff20(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__hdaae2479263252f1(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_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_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_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_id_8071f78aa2301217=function(e,t){const _=r(t).id,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_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_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_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_log_2f54632e0e18c089=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_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_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_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_then_876bb3c633745cc6=function(e,t,_){const c=r(e).then(r(t),r(_));return b(c)},n.wbg.__wbg_compilationresult_new=function(e){const t=V.__wrap(e);return b(t)},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_wrappedinstance_new=function(e){const t=W.__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_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_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},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_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},n.wbg.__wbg_buttons_a302533e27733599=function(e){return r(e).buttons},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_pressure_95cee3909a8549a9=function(e){return r(e).pressure},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_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},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_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_scheduler_f38a681d98b5a776=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=r(e).requestFullscreen;return b(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;return b(t)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=r(e).requestIdleCallback;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_wrapper1197=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1199=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1200=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1201=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1202=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper3364=function(e,t,_){const c=x(e,t,378,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6345=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8481=function(e,t,_){const c=x(e,t,378,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8515=function(e,t,_){const c=x(e,t,378,X);return b(c)},n.wbg.__wbindgen_closure_wrapper8526=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8532=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8539=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8545=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8572=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8577=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8612=function(e,t,_){const c=x(e,t,378,S);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-DAOEyG6q.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 L=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,L.unregister(c))}};return o.original=c,L.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__h146a5aa9c088bf22(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),L.unregister(c)):c.a=g}};return o.original=c,L.register(o,c,c),o}function $(n,e){a._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h05bf02fe019468a2(n,e)}function S(n,e,t){a._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30f924960e3aff20(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__hdaae2479263252f1(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_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_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_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_id_8071f78aa2301217=function(e,t){const _=r(t).id,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_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_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_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_log_2f54632e0e18c089=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_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_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_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_then_876bb3c633745cc6=function(e,t,_){const c=r(e).then(r(t),r(_));return b(c)},n.wbg.__wbg_compilationresult_new=function(e){const t=V.__wrap(e);return b(t)},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_wrappedinstance_new=function(e){const t=W.__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_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_isIntersecting_7cba11b732bde6a7=function(e){return r(e).isIntersecting},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_pointerId_37ae0c4682f85248=function(e){return r(e).pointerId},n.wbg.__wbg_buttons_a302533e27733599=function(e){return r(e).buttons},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_pressure_95cee3909a8549a9=function(e){return r(e).pressure},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_new_25d9d4e2932d816f=function(){return f(function(e,t){const _=new Worker(s(e,t));return b(_)},arguments)},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_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_scheduler_f38a681d98b5a776=function(e){const t=r(e).scheduler;return b(t)},n.wbg.__wbg_requestFullscreen_8a94df4e7f757077=function(e){const t=r(e).requestFullscreen;return b(t)},n.wbg.__wbg_getCoalescedEvents_85701851c470c4e6=function(e){const t=r(e).getCoalescedEvents;return b(t)},n.wbg.__wbg_requestIdleCallback_86b728660e0547ef=function(e){const t=r(e).requestIdleCallback;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_wrapper1197=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1199=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1200=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1201=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper1202=function(e,t,_){const c=k(e,t,170,P);return b(c)},n.wbg.__wbindgen_closure_wrapper3364=function(e,t,_){const c=x(e,t,378,$);return b(c)},n.wbg.__wbindgen_closure_wrapper6345=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8481=function(e,t,_){const c=x(e,t,378,$);return b(c)},n.wbg.__wbindgen_closure_wrapper8515=function(e,t,_){const c=x(e,t,378,X);return b(c)},n.wbg.__wbindgen_closure_wrapper8526=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8532=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8539=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8545=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8572=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8577=function(e,t,_){const c=x(e,t,378,S);return b(c)},n.wbg.__wbindgen_closure_wrapper8612=function(e,t,_){const c=x(e,t,378,S);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-DFSurus9.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-DCweP4bQ.wasm b/snapshots/master/editor/assets/slint_lsp_wasm_bg-CQ1FUJ6d.wasm similarity index 83% rename from snapshots/master/editor/assets/slint_lsp_wasm_bg-DCweP4bQ.wasm rename to snapshots/master/editor/assets/slint_lsp_wasm_bg-CQ1FUJ6d.wasm index 24c157a23..8fbe55f19 100644 Binary files a/snapshots/master/editor/assets/slint_lsp_wasm_bg-DCweP4bQ.wasm and b/snapshots/master/editor/assets/slint_lsp_wasm_bg-CQ1FUJ6d.wasm differ diff --git a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DAOEyG6q.wasm b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DFSurus9.wasm similarity index 95% rename from snapshots/master/editor/assets/slint_wasm_interpreter_bg-DAOEyG6q.wasm rename to snapshots/master/editor/assets/slint_wasm_interpreter_bg-DFSurus9.wasm index f7fc179c4..b9688bfc8 100644 Binary files a/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DAOEyG6q.wasm and b/snapshots/master/editor/assets/slint_wasm_interpreter_bg-DFSurus9.wasm differ diff --git a/snapshots/master/editor/index.html b/snapshots/master/editor/index.html index e7aa4aab5..6d5ca6e42 100644 --- a/snapshots/master/editor/index.html +++ b/snapshots/master/editor/index.html @@ -11,7 +11,7 @@ SlintPad - + diff --git a/snapshots/master/editor/preview.html b/snapshots/master/editor/preview.html index d7f0e61ae..e8a2194c9 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_bg.wasm b/snapshots/master/wasm-interpreter/slint_wasm_interpreter_bg.wasm index f7fc179c4..b9688bfc8 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